job_card.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. <?php
  2. /* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
  4. * Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
  5. * Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
  6. * Copyright (C) 2021 Grégory BLEMAND <gregory.blemand@atm-consulting.fr>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. */
  21. /**
  22. * \file htdocs/hrm/job_card.php
  23. * \ingroup hrm
  24. * \brief Page to create/edit/view job
  25. */
  26. // Load Dolibarr environment
  27. require '../main.inc.php';
  28. require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
  29. require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
  30. require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
  31. require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
  32. require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
  33. require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php';
  34. // Load translation files required by the page
  35. $langs->loadLangs(array('hrm', 'other', 'products')); // why products?
  36. // Get parameters
  37. $id = GETPOST('id', 'int');
  38. $ref = GETPOST('ref', 'alpha');
  39. $action = GETPOST('action', 'aZ09');
  40. $confirm = GETPOST('confirm', 'alpha');
  41. $cancel = GETPOST('cancel', 'aZ09');
  42. $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'jobcard'; // To manage different context of search
  43. $backtopage = GETPOST('backtopage', 'alpha');
  44. $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
  45. $lineid = GETPOST('lineid', 'int');
  46. // Initialize technical objects
  47. $object = new Job($db);
  48. $extrafields = new ExtraFields($db);
  49. $diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id;
  50. $hookmanager->initHooks(array('jobcard', 'globalcard')); // Note that conf->hooks_modules contains array
  51. // Fetch optionals attributes and labels
  52. $extrafields->fetch_name_optionals_label($object->table_element);
  53. $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
  54. // Initialize array of search criterias
  55. $search_all = GETPOST("search_all", 'alpha');
  56. $search = array();
  57. foreach ($object->fields as $key => $val) {
  58. if (GETPOST('search_' . $key, 'alpha')) {
  59. $search[$key] = GETPOST('search_' . $key, 'alpha');
  60. }
  61. }
  62. if (empty($action) && empty($id) && empty($ref)) {
  63. $action = 'view';
  64. }
  65. // Load object
  66. include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
  67. // Permissions
  68. $permissiontoread = $user->rights->hrm->all->read;
  69. $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
  70. $permissiontodelete = $user->rights->hrm->all->delete;
  71. $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/job';
  72. // Security check (enable the most restrictive one)
  73. //if ($user->socid > 0) accessforbidden();
  74. //if ($user->socid > 0) $socid = $user->socid;
  75. //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
  76. //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
  77. if (empty($conf->hrm->enabled)) {
  78. accessforbidden();
  79. }
  80. if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) {
  81. accessforbidden();
  82. }
  83. /*
  84. * Actions
  85. */
  86. $parameters = array();
  87. $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
  88. if ($reshook < 0) {
  89. setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  90. }
  91. if (empty($reshook)) {
  92. $error = 0;
  93. $backurlforlist = dol_buildpath('/hrm/job_list.php', 1);
  94. if (empty($backtopage) || ($cancel && empty($id))) {
  95. if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
  96. if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
  97. $backtopage = $backurlforlist;
  98. } else {
  99. $backtopage = dol_buildpath('/hrm/job_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__');
  100. }
  101. }
  102. }
  103. $triggermodname = 'HRM_JOB_MODIFY'; // Name of trigger action code to execute when we modify record
  104. // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
  105. if ($action != 'confirm_clone') {
  106. include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
  107. }
  108. // Actions when linking object each other
  109. include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
  110. // Actions when printing a doc from card
  111. include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
  112. // Action to move up and down lines of object
  113. //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
  114. // Action to build doc
  115. include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
  116. if ($action == 'set_thirdparty' && $permissiontoadd) {
  117. $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname);
  118. }
  119. if ($action == 'classin' && $permissiontoadd) {
  120. $object->setProject(GETPOST('projectid', 'int'));
  121. }
  122. // Actions to send emails
  123. $triggersendname = 'HRM_JOB_SENTBYMAIL';
  124. $autocopy = 'MAIN_MAIL_AUTOCOPY_JOB_TO';
  125. $trackid = 'job' . $object->id;
  126. include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
  127. if ($action == 'confirm_clone' && $confirm != 'yes') {
  128. $action = '';
  129. }
  130. if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->hasRight('salaries', 'write'))) {
  131. $db->begin();
  132. $originalId = $id;
  133. $object->fetch($id);
  134. $skillRequire = $object->getSkillRankForJob($originalId);
  135. if ($object->id > 0) {
  136. $object->id = $object->ref = null;
  137. if (GETPOST('clone_label', 'alphanohtml')) {
  138. $object->label = GETPOST('clone_label', 'alphanohtml');
  139. } else {
  140. $object->label = $langs->trans("CopyOf").' '.$object->label;
  141. }
  142. if (GETPOST('clone_skills_required')) {
  143. $cloneSkillRequired = GETPOST('clone_skills_required');
  144. }
  145. $id = $object->create($user);
  146. if ($id > 0) {
  147. if (!empty($cloneSkillRequired)) {
  148. $i = 0;
  149. while ($i < count($skillRequire)) {
  150. $skillrank = new SkillRank($db);
  151. $skillrank->createFromClone($user, $skillRequire[$i]->rowid, $id);
  152. $i++;
  153. }
  154. }
  155. $db->commit();
  156. $db->close();
  157. header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
  158. exit;
  159. } else {
  160. $id = $originalId;
  161. $db->rollback();
  162. setEventMessages($object->error, $object->errors, 'errors');
  163. }
  164. } else {
  165. $db->rollback();
  166. dol_print_error($db, $object->error);
  167. }
  168. }
  169. }
  170. /*
  171. * View
  172. *
  173. * Put here all code to build page
  174. */
  175. $form = new Form($db);
  176. $formfile = new FormFile($db);
  177. $formproject = new FormProjets($db);
  178. $title = $langs->trans("Job");
  179. $help_url = '';
  180. llxHeader('', $title, $help_url);
  181. // Example : Adding jquery code
  182. // print '<script type="text/javascript" language="javascript">
  183. // jQuery(document).ready(function() {
  184. // function init_myfunc()
  185. // {
  186. // jQuery("#myid").removeAttr(\'disabled\');
  187. // jQuery("#myid").attr(\'disabled\',\'disabled\');
  188. // }
  189. // init_myfunc();
  190. // jQuery("#mybutton").click(function() {
  191. // init_myfunc();
  192. // });
  193. // });
  194. // </script>';
  195. // Part to create
  196. if ($action == 'create') {
  197. print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_' . $object->picto);
  198. print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
  199. print '<input type="hidden" name="token" value="' . newToken() . '">';
  200. print '<input type="hidden" name="action" value="add">';
  201. if ($backtopage) {
  202. print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
  203. }
  204. if ($backtopageforcancel) {
  205. print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
  206. }
  207. print dol_get_fiche_head(array(), '');
  208. print '<table class="border centpercent tableforfieldcreate">' . "\n";
  209. // Common attributes
  210. include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
  211. // Other attributes
  212. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
  213. print '</table>' . "\n";
  214. print dol_get_fiche_end();
  215. print '<div class="center">';
  216. print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">';
  217. print '&nbsp; ';
  218. print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="history.go(-1)"') . '>'; // Cancel for create does not post form if we don't know the backtopage
  219. print '</div>';
  220. print '</form>';
  221. //dol_set_focus('input[name="ref"]');
  222. }
  223. // Part to edit record
  224. if (($id || $ref) && $action == 'edit') {
  225. print load_fiche_titre($langs->trans("JobProfile"), '', 'object_' . $object->picto);
  226. print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
  227. print '<input type="hidden" name="token" value="' . newToken() . '">';
  228. print '<input type="hidden" name="action" value="update">';
  229. print '<input type="hidden" name="id" value="' . $object->id . '">';
  230. if ($backtopage) {
  231. print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
  232. }
  233. if ($backtopageforcancel) {
  234. print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
  235. }
  236. print dol_get_fiche_head();
  237. print '<table class="border centpercent tableforfieldedit">' . "\n";
  238. // Common attributes
  239. include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
  240. // Other attributes
  241. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
  242. print '</table>';
  243. print dol_get_fiche_end();
  244. print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">';
  245. print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
  246. print '</div>';
  247. print '</form>';
  248. }
  249. // Part to show record
  250. if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
  251. $res = $object->fetch_optionals();
  252. $head = jobPrepareHead($object);
  253. $picto = 'company.png';
  254. print dol_get_fiche_head($head, 'job_card', $langs->trans("Workstation"), -1, $object->picto);
  255. $formconfirm = '';
  256. // Confirmation to delete
  257. if ($action == 'delete') {
  258. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
  259. }
  260. // Confirmation to delete line
  261. if ($action == 'deleteline') {
  262. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
  263. }
  264. // Clone confirmation
  265. if ($action == 'clone') {
  266. // Create an array for form
  267. $formquestion = array(
  268. array('type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans("Label"), 'value' => $langs->trans("CopyOf").' '.$object->label),
  269. array('type' => 'checkbox', 'name' => 'clone_skills_required', 'label' => $langs->trans("RequiredSkills"), 'value' => '',),
  270. );
  271. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->label), 'confirm_clone', $formquestion, 'yes', 1, 280);
  272. }
  273. // Confirmation of action xxxx
  274. if ($action == 'xxx') {
  275. $formquestion = array();
  276. /*
  277. $forcecombo=0;
  278. if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
  279. $formquestion = array(
  280. // 'text' => $langs->trans("ConfirmClone"),
  281. // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
  282. // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
  283. // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
  284. );
  285. */
  286. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
  287. }
  288. // Call Hook formConfirm
  289. $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
  290. $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  291. if (empty($reshook)) {
  292. $formconfirm .= $hookmanager->resPrint;
  293. } elseif ($reshook > 0) {
  294. $formconfirm = $hookmanager->resPrint;
  295. }
  296. // Print form confirm
  297. print $formconfirm;
  298. // Object card
  299. // ------------------------------------------------------------
  300. $linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
  301. $morehtmlref = '<div class="refid">';
  302. $morehtmlref.= $object->label;
  303. $morehtmlref .= '</div>';
  304. dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref);
  305. print '<div class="fichecenter">';
  306. print '<div class="fichehalfleft">';
  307. print '<div class="underbanner clearboth"></div>';
  308. print '<table class="border centpercent tableforfield">'."\n";
  309. // Common attributes
  310. //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
  311. //unset($object->fields['fk_project']); // Hide field already shown in banner
  312. //unset($object->fields['fk_soc']); // Hide field already shown in banner
  313. $object->fields['label']['visible']=0; // Already in banner
  314. include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
  315. // Other attributes. Fields from hook formObjectOptions and Extrafields.
  316. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
  317. print '</table>';
  318. print '</div>';
  319. print '</div>';
  320. print '<div class="clearboth"></div>';
  321. print dol_get_fiche_end();
  322. /*
  323. * Lines
  324. */
  325. if (!empty($object->table_element_line)) {
  326. // Show object lines
  327. $result = $object->getLinesArray();
  328. print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '#line_' . GETPOST('lineid', 'int')) . '" method="POST">
  329. <input type="hidden" name="token" value="' . newToken() . '">
  330. <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
  331. <input type="hidden" name="mode" value="">
  332. <input type="hidden" name="page_y" value="">
  333. <input type="hidden" name="id" value="' . $object->id . '">
  334. ';
  335. if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
  336. include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
  337. }
  338. print '<div class="div-table-responsive-no-min">';
  339. if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
  340. print '<table id="tablelines" class="noborder noshadow" width="100%">';
  341. }
  342. if (!empty($object->lines)) {
  343. $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1);
  344. }
  345. // Form to add new line
  346. if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') {
  347. if ($action != 'editline') {
  348. // Add products/services form
  349. $parameters = array();
  350. $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  351. if ($reshook < 0) {
  352. setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  353. }
  354. if (empty($reshook)) {
  355. $object->formAddObjectLine(1, $mysoc, $soc);
  356. }
  357. }
  358. }
  359. if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
  360. print '</table>';
  361. }
  362. print '</div>';
  363. print "</form>\n";
  364. }
  365. // Buttons for actions
  366. if ($action != 'presend' && $action != 'editline') {
  367. print '<div class="tabsAction">' . "\n";
  368. $parameters = array();
  369. $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  370. if ($reshook < 0) {
  371. setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  372. }
  373. if (empty($reshook)) {
  374. // Back to draft
  375. if ($object->status == $object::STATUS_VALIDATED) {
  376. print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd);
  377. }
  378. print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
  379. print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', $permissiontoadd);
  380. // Delete (need delete permission, or if draft, just need create/modify permission)
  381. print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
  382. }
  383. print '</div>' . "\n";
  384. }
  385. // Select mail models is same action as presend
  386. if (GETPOST('modelselected')) {
  387. $action = 'presend';
  388. }
  389. if ($action != 'presend') {
  390. print '<div class="fichecenter"><div class="fichehalfleft">';
  391. print '<a name="builddoc"></a>'; // ancre
  392. $includedocgeneration = 0;
  393. // Documents
  394. if ($includedocgeneration) {
  395. $objref = dol_sanitizeFileName($object->ref);
  396. $relativepath = $objref . '/' . $objref . '.pdf';
  397. $filedir = $conf->hrm->dir_output . '/' . $object->element . '/' . $objref;
  398. $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
  399. $genallowed = $user->rights->hrm->job->read; // If you can read, you can build the PDF to read content
  400. $delallowed = $user->rights->hrm->job->write; // If you can create/edit, you can remove a file on card
  401. print $formfile->showdocuments('hrm:Job', $object->element . '/' . $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
  402. }
  403. // Show links to link elements
  404. $linktoelem = $form->showLinkToObjectBlock($object, null, array('job'));
  405. $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
  406. print '</div><div class="fichehalfright">';
  407. $MAXEVENT = 10;
  408. $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id);
  409. // List of actions on element
  410. include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
  411. $formactions = new FormActions($db);
  412. $somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
  413. print '</div></div>';
  414. }
  415. // Presend form
  416. $modelmail = 'job';
  417. $defaulttopic = 'InformationMessage';
  418. $diroutput = $conf->hrm->dir_output;
  419. $trackid = 'job' . $object->id;
  420. include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
  421. }
  422. // End of page
  423. llxFooter();
  424. $db->close();