@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | // Load Dolibarr environment |
29 | 29 | require '../main.inc.php'; |
30 | 30 | |
31 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; |
|
32 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
33 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; |
|
31 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_evaluation.lib.php'; |
|
34 | 34 | |
35 | 35 | |
36 | 36 | // Load translation files required by the page |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | // Permissions |
63 | 63 | $permissionnote = $user->hasRight('hrm', 'evaluation', 'write'); // Used by the include of actions_setnotes.inc.php |
64 | -$permissiontoread = $user->hasRight('hrm', 'evaluation', 'read'); // Used by the include of actions_addupdatedelete.inc.php |
|
64 | +$permissiontoread = $user->hasRight('hrm', 'evaluation', 'read'); // Used by the include of actions_addupdatedelete.inc.php |
|
65 | 65 | |
66 | 66 | // Security check (enable the most restrictive one) |
67 | 67 | //if ($user->socid > 0) accessforbidden(); |
@@ -29,19 +29,19 @@ discard block |
||
29 | 29 | // Load Dolibarr environment |
30 | 30 | require '../main.inc.php'; |
31 | 31 | |
32 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
33 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php'; |
|
38 | 38 | //dol_include_once('/hrm/position.php'); |
39 | 39 | |
40 | 40 | // Get Parameters |
41 | -$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... |
|
41 | +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... |
|
42 | 42 | $backtopage = GETPOST('backtopage', 'alpha'); |
43 | 43 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
44 | -$id = GETPOST('id', 'int'); |
|
44 | +$id = GETPOST('id', 'int'); |
|
45 | 45 | |
46 | 46 | // Initialize technical objects |
47 | 47 | $form = new Form($db); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
57 | 57 | $permissiontodelete = $user->hasRight('hrm', 'all', 'delete'); |
58 | 58 | $permissiondellink = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_dellink.inc.php |
59 | -$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/position'; |
|
59 | +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/position'; |
|
60 | 60 | |
61 | 61 | // Security check (enable the most restrictive one) |
62 | 62 | //if ($user->socid > 0) accessforbidden(); |
@@ -75,10 +75,10 @@ discard block |
||
75 | 75 | |
76 | 76 | |
77 | 77 | // Get parameters |
78 | -$id = GETPOST('id', 'int'); |
|
78 | +$id = GETPOST('id', 'int'); |
|
79 | 79 | $fk_job = GETPOST('fk_job', 'int'); |
80 | 80 | |
81 | -$ref = GETPOST('ref', 'alpha'); |
|
81 | +$ref = GETPOST('ref', 'alpha'); |
|
82 | 82 | $action = GETPOST('action', 'aZ09'); |
83 | 83 | $confirm = GETPOST('confirm', 'alpha'); |
84 | 84 | $cancel = GETPOST('cancel', 'aZ09'); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | $extrafields = new ExtraFields($db); |
98 | 98 | |
99 | -$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; |
|
99 | +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; |
|
100 | 100 | $hookmanager->initHooks(array('positioncard', 'globalcard')); // Note that conf->hooks_modules contains array |
101 | 101 | |
102 | 102 | // Fetch optionals attributes and labels |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | $search_all = GETPOST("search_all", 'alpha'); |
109 | 109 | $search = array(); |
110 | 110 | foreach ($object->fields as $key => $val) { |
111 | - if (GETPOST('search_' . $key, 'alpha')) { |
|
112 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
111 | + if (GETPOST('search_'.$key, 'alpha')) { |
|
112 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | // Load object |
121 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
121 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
122 | 122 | |
123 | 123 | |
124 | 124 | /* |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
142 | 142 | $backtopage = $backurlforlist; |
143 | 143 | } else { |
144 | - $backtopage = dol_buildpath('/hrm/position_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); |
|
144 | + $backtopage = dol_buildpath('/hrm/position_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | } |
@@ -149,19 +149,19 @@ discard block |
||
149 | 149 | $triggermodname = 'HRM_POSITION_MODIFY'; // Name of trigger action code to execute when we modify record |
150 | 150 | |
151 | 151 | // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen |
152 | - include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; |
|
152 | + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; |
|
153 | 153 | |
154 | 154 | // Actions when linking object each other |
155 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
155 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
156 | 156 | |
157 | 157 | // Actions when printing a doc from card |
158 | - include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; |
|
158 | + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
|
159 | 159 | |
160 | 160 | // Action to move up and down lines of object |
161 | 161 | //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; |
162 | 162 | |
163 | 163 | // Action to build doc |
164 | - include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; |
|
164 | + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
|
165 | 165 | |
166 | 166 | if ($action == 'set_thirdparty' && $permissiontoadd) { |
167 | 167 | $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | // Actions to send emails |
174 | 174 | $triggersendname = 'HRM_POSITION_SENTBYMAIL'; |
175 | 175 | $autocopy = 'MAIN_MAIL_AUTOCOPY_POSITION_TO'; |
176 | - $trackid = 'position' . $object->id; |
|
177 | - include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; |
|
176 | + $trackid = 'position'.$object->id; |
|
177 | + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | |
@@ -219,36 +219,36 @@ discard block |
||
219 | 219 | |
220 | 220 | // Part to edit record |
221 | 221 | if (($id || $ref) && $action == 'edit') { |
222 | - print load_fiche_titre($langs->trans("Position"), '', 'object_' . $object->picto); |
|
222 | + print load_fiche_titre($langs->trans("Position"), '', 'object_'.$object->picto); |
|
223 | 223 | |
224 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '">'; |
|
225 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
224 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">'; |
|
225 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
226 | 226 | print '<input type="hidden" name="action" value="update">'; |
227 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
227 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
228 | 228 | |
229 | 229 | if ($backtopage) { |
230 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
230 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
231 | 231 | } |
232 | 232 | if ($backtopageforcancel) { |
233 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
233 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | print dol_get_fiche_head(); |
237 | 237 | |
238 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
238 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
239 | 239 | |
240 | 240 | // Common attributes |
241 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
241 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
242 | 242 | |
243 | 243 | // Other attributes |
244 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; |
|
244 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
|
245 | 245 | |
246 | 246 | print '</table>'; |
247 | 247 | |
248 | 248 | print dol_get_fiche_end(); |
249 | 249 | |
250 | - print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">'; |
|
251 | - print ' <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
250 | + print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">'; |
|
251 | + print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
252 | 252 | print '</div>'; |
253 | 253 | |
254 | 254 | print '</form>'; |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | |
268 | 268 | // Confirmation to delete |
269 | 269 | if ($action == 'delete') { |
270 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeletePosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
270 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeletePosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | // Call Hook formConfirm |
@@ -302,18 +302,18 @@ discard block |
||
302 | 302 | print '<div class="fichecenter">'; |
303 | 303 | print '<div class="fichehalfleft">'; |
304 | 304 | print '<div class="underbanner clearboth"></div>'; |
305 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
305 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
306 | 306 | |
307 | 307 | // Common attributes |
308 | 308 | //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field |
309 | 309 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
310 | 310 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
311 | - $object->fields['fk_user']['visible']=0; // Already in banner |
|
312 | - $object->fields['fk_job']['visible']=0; // Already in banner |
|
313 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
311 | + $object->fields['fk_user']['visible'] = 0; // Already in banner |
|
312 | + $object->fields['fk_job']['visible'] = 0; // Already in banner |
|
313 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
314 | 314 | |
315 | 315 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
316 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
316 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
317 | 317 | |
318 | 318 | print '</table>'; |
319 | 319 | print '</div>'; |
@@ -332,10 +332,10 @@ discard block |
||
332 | 332 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
333 | 333 | |
334 | 334 | |
335 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
335 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
336 | 336 | |
337 | 337 | // Delete (need delete permission, or if draft, just need create/modify permission) |
338 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete); |
|
338 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete); |
|
339 | 339 | } |
340 | 340 | } |
341 | 341 | |
@@ -373,10 +373,10 @@ discard block |
||
373 | 373 | //} |
374 | 374 | |
375 | 375 | |
376 | -print '</table>' . "\n"; |
|
377 | -print '</div>' . "\n"; |
|
376 | +print '</table>'."\n"; |
|
377 | +print '</div>'."\n"; |
|
378 | 378 | |
379 | -print '</form>' . "\n"; |
|
379 | +print '</form>'."\n"; |
|
380 | 380 | |
381 | 381 | |
382 | 382 | if ($action !== 'edit' && $action !== 'create') { |
@@ -394,9 +394,9 @@ discard block |
||
394 | 394 | $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/position_agenda.php?id='.$object->id); |
395 | 395 | |
396 | 396 | // List of actions on element |
397 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
397 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; |
|
398 | 398 | $formactions = new FormActions($db); |
399 | - $somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
399 | + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
400 | 400 | |
401 | 401 | print '</div></div>'; |
402 | 402 | } |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | // Load Dolibarr environment |
30 | 30 | require '../main.inc.php'; |
31 | 31 | |
32 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
33 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php'; |
|
38 | 38 | |
39 | 39 | // Load translation files required by the page |
40 | -$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
40 | +$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
41 | 41 | |
42 | 42 | // Get parameters |
43 | 43 | $id = GETPOST('id', 'int'); |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'jobcard'; // To manage different context of search |
49 | 49 | $backtopage = GETPOST('backtopage', 'alpha'); |
50 | 50 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
51 | -$lineid = GETPOST('lineid', 'int'); |
|
51 | +$lineid = GETPOST('lineid', 'int'); |
|
52 | 52 | |
53 | 53 | // Initialize technical objects |
54 | 54 | $object = new Job($db); |
55 | 55 | $extrafields = new ExtraFields($db); |
56 | -$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; |
|
56 | +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; |
|
57 | 57 | $hookmanager->initHooks(array('jobcard', 'globalcard')); // Note that conf->hooks_modules contains array |
58 | 58 | |
59 | 59 | // Fetch optionals attributes and labels |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | $search_all = GETPOST("search_all", 'alpha'); |
66 | 66 | $search = array(); |
67 | 67 | foreach ($object->fields as $key => $val) { |
68 | - if (GETPOST('search_' . $key, 'alpha')) { |
|
69 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
68 | + if (GETPOST('search_'.$key, 'alpha')) { |
|
69 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | // Load object |
78 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
78 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
79 | 79 | |
80 | 80 | // Permissions |
81 | 81 | $permissiontoread = $user->hasRight('hrm', 'all', 'read'); |
82 | 82 | $permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
83 | 83 | $permissiontodelete = $user->hasRight('hrm', 'all', 'delete'); |
84 | -$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/job'; |
|
84 | +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/job'; |
|
85 | 85 | |
86 | 86 | // Security check (enable the most restrictive one) |
87 | 87 | //if ($user->socid > 0) accessforbidden(); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
117 | 117 | $backtopage = $backurlforlist; |
118 | 118 | } else { |
119 | - $backtopage = dol_buildpath('/hrm/job_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); |
|
119 | + $backtopage = dol_buildpath('/hrm/job_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 | } |
@@ -126,20 +126,20 @@ discard block |
||
126 | 126 | |
127 | 127 | // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen |
128 | 128 | if ($action != 'confirm_clone') { |
129 | - include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; |
|
129 | + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | // Actions when linking object each other |
133 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
133 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
134 | 134 | |
135 | 135 | // Actions when printing a doc from card |
136 | - include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; |
|
136 | + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
|
137 | 137 | |
138 | 138 | // Action to move up and down lines of object |
139 | 139 | //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; |
140 | 140 | |
141 | 141 | // Action to build doc |
142 | - include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; |
|
142 | + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
|
143 | 143 | |
144 | 144 | if ($action == 'set_thirdparty' && $permissiontoadd) { |
145 | 145 | $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | // Actions to send emails |
152 | 152 | $triggersendname = 'HRM_JOB_SENTBYMAIL'; |
153 | 153 | $autocopy = 'MAIN_MAIL_AUTOCOPY_JOB_TO'; |
154 | - $trackid = 'job' . $object->id; |
|
155 | - include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; |
|
154 | + $trackid = 'job'.$object->id; |
|
155 | + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
|
156 | 156 | |
157 | 157 | if ($action == 'confirm_clone' && $confirm != 'yes') { |
158 | 158 | $action = ''; |
@@ -239,36 +239,36 @@ discard block |
||
239 | 239 | |
240 | 240 | // Part to create |
241 | 241 | if ($action == 'create') { |
242 | - print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_' . $object->picto); |
|
242 | + print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_'.$object->picto); |
|
243 | 243 | |
244 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
245 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
244 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
245 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
246 | 246 | print '<input type="hidden" name="action" value="add">'; |
247 | 247 | if ($backtopage) { |
248 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
248 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
249 | 249 | } |
250 | 250 | if ($backtopageforcancel) { |
251 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
251 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | print dol_get_fiche_head(array(), ''); |
255 | 255 | |
256 | - print '<table class="border centpercent tableforfieldcreate">' . "\n"; |
|
256 | + print '<table class="border centpercent tableforfieldcreate">'."\n"; |
|
257 | 257 | |
258 | 258 | // Common attributes |
259 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; |
|
259 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; |
|
260 | 260 | |
261 | 261 | // Other attributes |
262 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; |
|
262 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
|
263 | 263 | |
264 | - print '</table>' . "\n"; |
|
264 | + print '</table>'."\n"; |
|
265 | 265 | |
266 | 266 | print dol_get_fiche_end(); |
267 | 267 | |
268 | 268 | print '<div class="center">'; |
269 | - print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">'; |
|
269 | + print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">'; |
|
270 | 270 | print ' '; |
271 | - 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 |
|
271 | + 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 |
|
272 | 272 | print '</div>'; |
273 | 273 | |
274 | 274 | print '</form>'; |
@@ -278,35 +278,35 @@ discard block |
||
278 | 278 | |
279 | 279 | // Part to edit record |
280 | 280 | if (($id || $ref) && $action == 'edit') { |
281 | - print load_fiche_titre($langs->trans("JobProfile"), '', 'object_' . $object->picto); |
|
281 | + print load_fiche_titre($langs->trans("JobProfile"), '', 'object_'.$object->picto); |
|
282 | 282 | |
283 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
284 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
283 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
284 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
285 | 285 | print '<input type="hidden" name="action" value="update">'; |
286 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
286 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
287 | 287 | if ($backtopage) { |
288 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
288 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
289 | 289 | } |
290 | 290 | if ($backtopageforcancel) { |
291 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
291 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | print dol_get_fiche_head(); |
295 | 295 | |
296 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
296 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
297 | 297 | |
298 | 298 | // Common attributes |
299 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
299 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
300 | 300 | |
301 | 301 | // Other attributes |
302 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; |
|
302 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
|
303 | 303 | |
304 | 304 | print '</table>'; |
305 | 305 | |
306 | 306 | print dol_get_fiche_end(); |
307 | 307 | |
308 | - print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">'; |
|
309 | - print ' <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
308 | + print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">'; |
|
309 | + print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
310 | 310 | print '</div>'; |
311 | 311 | |
312 | 312 | print '</form>'; |
@@ -324,11 +324,11 @@ discard block |
||
324 | 324 | |
325 | 325 | // Confirmation to delete |
326 | 326 | if ($action == 'delete') { |
327 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
327 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
328 | 328 | } |
329 | 329 | // Confirmation to delete line |
330 | 330 | if ($action == 'deleteline') { |
331 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); |
|
331 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); |
|
332 | 332 | } |
333 | 333 | // Clone confirmation |
334 | 334 | if ($action == 'clone') { |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) |
355 | 355 | ); |
356 | 356 | */ |
357 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); |
|
357 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | // Call Hook formConfirm |
@@ -372,10 +372,10 @@ discard block |
||
372 | 372 | |
373 | 373 | // Object card |
374 | 374 | // ------------------------------------------------------------ |
375 | - $linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
375 | + $linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
376 | 376 | |
377 | 377 | $morehtmlref = '<div class="refid">'; |
378 | - $morehtmlref.= $object->label; |
|
378 | + $morehtmlref .= $object->label; |
|
379 | 379 | $morehtmlref .= '</div>'; |
380 | 380 | |
381 | 381 | |
@@ -391,11 +391,11 @@ discard block |
||
391 | 391 | //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field |
392 | 392 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
393 | 393 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
394 | - $object->fields['label']['visible']=0; // Already in banner |
|
395 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
394 | + $object->fields['label']['visible'] = 0; // Already in banner |
|
395 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
396 | 396 | |
397 | 397 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
398 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
398 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
399 | 399 | |
400 | 400 | print '</table>'; |
401 | 401 | print '</div>'; |
@@ -414,16 +414,16 @@ discard block |
||
414 | 414 | // Show object lines |
415 | 415 | $result = $object->getLinesArray(); |
416 | 416 | |
417 | - print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '#line_' . GETPOST('lineid', 'int')) . '" method="POST"> |
|
418 | - <input type="hidden" name="token" value="' . newToken() . '"> |
|
419 | - <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> |
|
417 | + print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOST('lineid', 'int')).'" method="POST"> |
|
418 | + <input type="hidden" name="token" value="' . newToken().'"> |
|
419 | + <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'"> |
|
420 | 420 | <input type="hidden" name="mode" value=""> |
421 | 421 | <input type="hidden" name="page_y" value=""> |
422 | - <input type="hidden" name="id" value="' . $object->id . '"> |
|
422 | + <input type="hidden" name="id" value="' . $object->id.'"> |
|
423 | 423 | '; |
424 | 424 | |
425 | 425 | if (!empty($conf->use_javascript_ajax) && $object->status == 0) { |
426 | - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; |
|
426 | + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; |
|
427 | 427 | } |
428 | 428 | |
429 | 429 | print '<div class="div-table-responsive-no-min">'; |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | // Buttons for actions |
464 | 464 | |
465 | 465 | if ($action != 'presend' && $action != 'editline') { |
466 | - print '<div class="tabsAction">' . "\n"; |
|
466 | + print '<div class="tabsAction">'."\n"; |
|
467 | 467 | $parameters = array(); |
468 | 468 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
469 | 469 | if ($reshook < 0) { |
@@ -473,17 +473,17 @@ discard block |
||
473 | 473 | if (empty($reshook)) { |
474 | 474 | // Back to draft |
475 | 475 | if ($object->status == $object::STATUS_VALIDATED) { |
476 | - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd); |
|
476 | + print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); |
|
477 | 477 | } |
478 | 478 | |
479 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
479 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
480 | 480 | |
481 | - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', $permissiontoadd); |
|
481 | + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=clone&token='.newToken(), '', $permissiontoadd); |
|
482 | 482 | |
483 | 483 | // Delete (need delete permission, or if draft, just need create/modify permission) |
484 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete); |
|
484 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete); |
|
485 | 485 | } |
486 | - print '</div>' . "\n"; |
|
486 | + print '</div>'."\n"; |
|
487 | 487 | } |
488 | 488 | |
489 | 489 | |
@@ -501,12 +501,12 @@ discard block |
||
501 | 501 | // Documents |
502 | 502 | if ($includedocgeneration) { |
503 | 503 | $objref = dol_sanitizeFileName($object->ref); |
504 | - $relativepath = $objref . '/' . $objref . '.pdf'; |
|
505 | - $filedir = $conf->hrm->dir_output . '/' . $object->element . '/' . $objref; |
|
506 | - $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; |
|
504 | + $relativepath = $objref.'/'.$objref.'.pdf'; |
|
505 | + $filedir = $conf->hrm->dir_output.'/'.$object->element.'/'.$objref; |
|
506 | + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; |
|
507 | 507 | $genallowed = $user->hasRight('hrm', 'job', 'read'); // If you can read, you can build the PDF to read content |
508 | 508 | $delallowed = $user->hasRight('hrm', 'job', 'write'); // If you can create/edit, you can remove a file on card |
509 | - print $formfile->showdocuments('hrm:Job', $object->element . '/' . $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); |
|
509 | + print $formfile->showdocuments('hrm:Job', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); |
|
510 | 510 | } |
511 | 511 | |
512 | 512 | // Show links to link elements |
@@ -521,9 +521,9 @@ discard block |
||
521 | 521 | $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id); |
522 | 522 | |
523 | 523 | // List of actions on element |
524 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
524 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; |
|
525 | 525 | $formactions = new FormActions($db); |
526 | - $somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
526 | + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
527 | 527 | |
528 | 528 | print '</div></div>'; |
529 | 529 | } |
@@ -532,9 +532,9 @@ discard block |
||
532 | 532 | $modelmail = 'job'; |
533 | 533 | $defaulttopic = 'InformationMessage'; |
534 | 534 | $diroutput = $conf->hrm->dir_output; |
535 | - $trackid = 'job' . $object->id; |
|
535 | + $trackid = 'job'.$object->id; |
|
536 | 536 | |
537 | - include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php'; |
|
537 | + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; |
|
538 | 538 | } |
539 | 539 | |
540 | 540 | // End of page |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | |
30 | 30 | // Load Dolibarr environment |
31 | 31 | require '../main.inc.php'; |
32 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
33 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php'; |
|
37 | 37 | |
38 | 38 | |
39 | 39 | // Load translation files required by the page |
40 | -$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
40 | +$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
41 | 41 | |
42 | 42 | // Get parameters |
43 | 43 | $id = GETPOST('id', 'int'); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'skillcard'; // To manage different context of search |
49 | 49 | $backtopage = GETPOST('backtopage', 'alpha'); |
50 | 50 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
51 | -$lineid = GETPOST('lineid', 'int'); |
|
51 | +$lineid = GETPOST('lineid', 'int'); |
|
52 | 52 | |
53 | 53 | // Initialize technical objects |
54 | 54 | $object = new Skill($db); |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | $search_all = GETPOST("search_all", 'alpha'); |
67 | 67 | $search = array(); |
68 | 68 | foreach ($object->fields as $key => $val) { |
69 | - if (GETPOST('search_' . $key, 'alpha')) { |
|
70 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
69 | + if (GETPOST('search_'.$key, 'alpha')) { |
|
70 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | // Load object |
79 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
79 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
80 | 80 | |
81 | 81 | // Permissions |
82 | 82 | $permissiontoread = $user->hasRight('hrm', 'all', 'read'); |
83 | 83 | $permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
84 | 84 | $permissiontodelete = $user->hasRight('hrm', 'all', 'delete'); |
85 | -$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/skill'; |
|
85 | +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/skill'; |
|
86 | 86 | |
87 | 87 | // Security check (enable the most restrictive one) |
88 | 88 | //if ($user->socid > 0) accessforbidden(); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
120 | 120 | $backtopage = $backurlforlist; |
121 | 121 | } else { |
122 | - $backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id=' . ($id > 0 ? $id : '__ID__'); |
|
122 | + $backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id='.($id > 0 ? $id : '__ID__'); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | } |
@@ -152,16 +152,16 @@ discard block |
||
152 | 152 | |
153 | 153 | |
154 | 154 | // Actions when linking object each other |
155 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
155 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
156 | 156 | |
157 | 157 | // Actions when printing a doc from card |
158 | - include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; |
|
158 | + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
|
159 | 159 | |
160 | 160 | // Action to move up and down lines of object |
161 | 161 | //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; |
162 | 162 | |
163 | 163 | // Action to build doc |
164 | - include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; |
|
164 | + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
|
165 | 165 | |
166 | 166 | if ($action == 'set_thirdparty' && $permissiontoadd) { |
167 | 167 | $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | // Actions to send emails |
174 | 174 | $triggersendname = 'HRM_SKILL_SENTBYMAIL'; |
175 | 175 | $autocopy = 'MAIN_MAIL_AUTOCOPY_SKILL_TO'; |
176 | - $trackid = 'skill' . $object->id; |
|
177 | - include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; |
|
176 | + $trackid = 'skill'.$object->id; |
|
177 | + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
|
178 | 178 | |
179 | 179 | if ($action == 'confirm_clone' && $confirm != 'yes') { |
180 | 180 | $action = ''; |
@@ -203,25 +203,25 @@ discard block |
||
203 | 203 | |
204 | 204 | // Part to create |
205 | 205 | if ($action == 'create') { |
206 | - print load_fiche_titre($langs->trans("NewSkill"), '', 'object_' . $object->picto); |
|
206 | + print load_fiche_titre($langs->trans("NewSkill"), '', 'object_'.$object->picto); |
|
207 | 207 | |
208 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
209 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
208 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
209 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
210 | 210 | print '<input type="hidden" name="action" value="add">'; |
211 | - $backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?') ."objecttype=job"; |
|
211 | + $backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?')."objecttype=job"; |
|
212 | 212 | if ($backtopage) { |
213 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
213 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
214 | 214 | } |
215 | 215 | if ($backtopageforcancel) { |
216 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
216 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | print dol_get_fiche_head(array(), ''); |
220 | 220 | |
221 | - print '<table class="border centpercent tableforfieldcreate">' . "\n"; |
|
221 | + print '<table class="border centpercent tableforfieldcreate">'."\n"; |
|
222 | 222 | |
223 | 223 | // Common attributes |
224 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; |
|
224 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; |
|
225 | 225 | |
226 | 226 | // Other attributes |
227 | 227 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
@@ -231,15 +231,15 @@ discard block |
||
231 | 231 | //@todo je stop ici ... à continuer (affichage des 5 skilled input pour create action |
232 | 232 | //print $object->showInputField($val, $key, $value, '', '['']', '', 0); |
233 | 233 | |
234 | - print '</table>' . "\n"; |
|
234 | + print '</table>'."\n"; |
|
235 | 235 | |
236 | 236 | print dol_get_fiche_end(); |
237 | 237 | |
238 | 238 | print '<div class="center">'; |
239 | - print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">'; |
|
239 | + print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">'; |
|
240 | 240 | print ' '; |
241 | 241 | |
242 | - 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 |
|
242 | + 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 |
|
243 | 243 | print '</div>'; |
244 | 244 | |
245 | 245 | print '</form>'; |
@@ -250,25 +250,25 @@ discard block |
||
250 | 250 | // Part to edit record |
251 | 251 | // and skilldet edition |
252 | 252 | if (($id || $ref) && $action == 'edit') { |
253 | - print load_fiche_titre($langs->trans("Skill"), '', 'object_' . $object->picto); |
|
253 | + print load_fiche_titre($langs->trans("Skill"), '', 'object_'.$object->picto); |
|
254 | 254 | |
255 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
256 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
255 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
256 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
257 | 257 | print '<input type="hidden" name="action" value="update">'; |
258 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
258 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
259 | 259 | if ($backtopage) { |
260 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
260 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
261 | 261 | } |
262 | 262 | if ($backtopageforcancel) { |
263 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
263 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | print dol_get_fiche_head(); |
267 | 267 | |
268 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
268 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
269 | 269 | |
270 | 270 | // Common attributes |
271 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
271 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
272 | 272 | |
273 | 273 | // Other attributes |
274 | 274 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | continue; |
292 | 292 | } |
293 | 293 | |
294 | - print '<table class="border centpercent =">' . "\n"; |
|
294 | + print '<table class="border centpercent =">'."\n"; |
|
295 | 295 | $sk->fields = dol_sort_array($sk->fields, 'position'); |
296 | 296 | foreach ($sk->fields as $key => $val) { |
297 | 297 | if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4) { |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | continue; // We don't want this field |
303 | 303 | } |
304 | 304 | |
305 | - print '<tr class="field_' . $key . '"><td'; |
|
305 | + print '<tr class="field_'.$key.'"><td'; |
|
306 | 306 | print ' class="titlefieldcreate'; |
307 | 307 | if (isset($val['notnull']) && $val['notnull'] > 0) { |
308 | 308 | print ' fieldrequired'; |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | if (empty($skilldetArray)) { |
338 | 338 | $value = GETPOSTISSET($key) ? GETPOST($key, $check) : $sk->$key; |
339 | 339 | } else { |
340 | - $value=$skilldetArray[$sk->id]; |
|
340 | + $value = $skilldetArray[$sk->id]; |
|
341 | 341 | } |
342 | 342 | // |
343 | 343 | // } elseif ($val['type'] == 'price') { |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | print $sk->showOutputField($val, $key, $value, '', '', '', 0); |
351 | 351 | } else { |
352 | 352 | /** @var Skilldet $sk */ |
353 | - print $sk->showInputField($val, $key, $value, "", "line[" . $sk->id . "]", "", ""); |
|
353 | + print $sk->showInputField($val, $key, $value, "", "line[".$sk->id."]", "", ""); |
|
354 | 354 | } |
355 | 355 | print '</td>'; |
356 | 356 | print '</tr>'; |
@@ -362,8 +362,8 @@ discard block |
||
362 | 362 | |
363 | 363 | print dol_get_fiche_end(); |
364 | 364 | |
365 | - print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">'; |
|
366 | - print ' <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
365 | + print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">'; |
|
366 | + print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
367 | 367 | print '</div>'; |
368 | 368 | |
369 | 369 | print '</form>'; |
@@ -381,11 +381,11 @@ discard block |
||
381 | 381 | |
382 | 382 | // Confirmation to delete |
383 | 383 | if ($action == 'delete') { |
384 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
384 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
385 | 385 | } |
386 | 386 | // Confirmation to delete line |
387 | 387 | if ($action == 'deleteline') { |
388 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); |
|
388 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); |
|
389 | 389 | } |
390 | 390 | // Confirmation clone |
391 | 391 | if ($action === 'clone') { |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) |
409 | 409 | ); |
410 | 410 | */ |
411 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); |
|
411 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | // Call Hook formConfirm |
@@ -426,11 +426,11 @@ discard block |
||
426 | 426 | |
427 | 427 | // Object card |
428 | 428 | // ------------------------------------------------------------ |
429 | - $linkback = '<a href="' . DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
429 | + $linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
430 | 430 | |
431 | 431 | |
432 | 432 | $morehtmlref = '<div class="refid">'; |
433 | - $morehtmlref.= $object->label; |
|
433 | + $morehtmlref .= $object->label; |
|
434 | 434 | $morehtmlref .= '</div>'; |
435 | 435 | dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); |
436 | 436 | |
@@ -438,10 +438,10 @@ discard block |
||
438 | 438 | print '<div class="fichecenter">'; |
439 | 439 | print '<div class="fichehalfleft">'; |
440 | 440 | print '<div class="underbanner clearboth"></div>'; |
441 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
441 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
442 | 442 | |
443 | - $object->fields['label']['visible']=0; // Already in banner |
|
444 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
443 | + $object->fields['label']['visible'] = 0; // Already in banner |
|
444 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
445 | 445 | |
446 | 446 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
447 | 447 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | // Buttons for actions |
462 | 462 | |
463 | 463 | if ($action != 'presend' && $action != 'editline') { |
464 | - print '<div class="tabsAction">' . "\n"; |
|
464 | + print '<div class="tabsAction">'."\n"; |
|
465 | 465 | $parameters = array(); |
466 | 466 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
467 | 467 | if ($reshook < 0) { |
@@ -471,19 +471,19 @@ discard block |
||
471 | 471 | if (empty($reshook)) { |
472 | 472 | // Back to draft |
473 | 473 | if ($object->status == $object::STATUS_VALIDATED) { |
474 | - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd); |
|
474 | + print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); |
|
475 | 475 | } |
476 | 476 | |
477 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
477 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
478 | 478 | |
479 | 479 | // Clone |
480 | 480 | if ($permissiontoadd) { |
481 | 481 | print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id, ''); |
482 | 482 | } |
483 | 483 | // Delete (need delete permission, or if draft, just need create/modify permission) |
484 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete); |
|
484 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete); |
|
485 | 485 | } |
486 | - print '</div>' . "\n"; |
|
486 | + print '</div>'."\n"; |
|
487 | 487 | } |
488 | 488 | } |
489 | 489 | |
@@ -491,12 +491,12 @@ discard block |
||
491 | 491 | //*--------------------------------------------------------------------------- |
492 | 492 | |
493 | 493 | if ($action != "create" && $action != "edit") { |
494 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
495 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
496 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
494 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
495 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
496 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
497 | 497 | |
498 | 498 | // load hrm libraries |
499 | - require_once __DIR__ . '/class/skilldet.class.php'; |
|
499 | + require_once __DIR__.'/class/skilldet.class.php'; |
|
500 | 500 | |
501 | 501 | // for other modules |
502 | 502 | //dol_include_once('/othermodule/class/otherobject.class.php'); |
@@ -533,8 +533,8 @@ discard block |
||
533 | 533 | |
534 | 534 | // Default sort order (if not yet defined by previous GETPOST) |
535 | 535 | if (!$sortfield) { |
536 | - reset($objectline->fields); // Reset is required to avoid key() to return null. |
|
537 | - $sortfield = "t." . key($objectline->fields); // Set here default search field. By default 1st field in definition. |
|
536 | + reset($objectline->fields); // Reset is required to avoid key() to return null. |
|
537 | + $sortfield = "t.".key($objectline->fields); // Set here default search field. By default 1st field in definition. |
|
538 | 538 | } |
539 | 539 | if (!$sortorder) { |
540 | 540 | $sortorder = "ASC"; |
@@ -544,12 +544,12 @@ discard block |
||
544 | 544 | $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); |
545 | 545 | $search = array(); |
546 | 546 | foreach ($objectline->fields as $key => $val) { |
547 | - if (GETPOST('search_' . $key, 'alpha') !== '') { |
|
548 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
547 | + if (GETPOST('search_'.$key, 'alpha') !== '') { |
|
548 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
549 | 549 | } |
550 | 550 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
551 | - $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_' . $key . '_dtstartmonth', 'int'), GETPOST('search_' . $key . '_dtstartday', 'int'), GETPOST('search_' . $key . '_dtstartyear', 'int')); |
|
552 | - $search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_' . $key . '_dtendmonth', 'int'), GETPOST('search_' . $key . '_dtendday', 'int'), GETPOST('search_' . $key . '_dtendyear', 'int')); |
|
551 | + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); |
|
552 | + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); |
|
553 | 553 | } |
554 | 554 | } |
555 | 555 | |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | $fieldstosearchall = array(); |
558 | 558 | foreach ($objectline->fields as $key => $val) { |
559 | 559 | if (!empty($val['searchall'])) { |
560 | - $fieldstosearchall['t.' . $key] = $val['label']; |
|
560 | + $fieldstosearchall['t.'.$key] = $val['label']; |
|
561 | 561 | } |
562 | 562 | } |
563 | 563 | |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | // If $val['visible']==0, then we never show the field |
568 | 568 | if (!empty($val['visible'])) { |
569 | 569 | $visible = (int) dol_eval($val['visible'], 1, 1, '1'); |
570 | - $arrayfields['t.' . $key] = array( |
|
570 | + $arrayfields['t.'.$key] = array( |
|
571 | 571 | 'label' => $val['label'], |
572 | 572 | 'checked' => (($visible < 0) ? 0 : 1), |
573 | 573 | 'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), |
@@ -599,9 +599,9 @@ discard block |
||
599 | 599 | // -------------------------------------------------------------------- |
600 | 600 | $sql = 'SELECT '; |
601 | 601 | $sql .= $objectline->getFieldList('t'); |
602 | - $sql .= " FROM " . MAIN_DB_PREFIX . $objectline->table_element . " as t"; |
|
602 | + $sql .= " FROM ".MAIN_DB_PREFIX.$objectline->table_element." as t"; |
|
603 | 603 | if ($objectline->ismultientitymanaged == 1) { |
604 | - $sql .= " WHERE t.entity IN (" . getEntity($objectline->element) . ")"; |
|
604 | + $sql .= " WHERE t.entity IN (".getEntity($objectline->element).")"; |
|
605 | 605 | } else { |
606 | 606 | $sql .= " WHERE 1 = 1 "; |
607 | 607 | } |
@@ -611,41 +611,41 @@ discard block |
||
611 | 611 | $nbtotalofrecords = $db->num_rows($resql); |
612 | 612 | $num = $db->num_rows($resql); |
613 | 613 | |
614 | - print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">' . "\n"; |
|
614 | + print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n"; |
|
615 | 615 | if ($optioncss != '') { |
616 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
616 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
617 | 617 | } |
618 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
618 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
619 | 619 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
620 | 620 | print '<input type="hidden" name="action" value="list">'; |
621 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
622 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
623 | - print '<input type="hidden" name="page" value="' . $page . '">'; |
|
624 | - print '<input type="hidden" name="contextpage" value="' . $contextpage . '">'; |
|
621 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
622 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
623 | + print '<input type="hidden" name="page" value="'.$page.'">'; |
|
624 | + print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; |
|
625 | 625 | if (!empty($id)) { |
626 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
626 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
627 | 627 | } |
628 | 628 | |
629 | - $param_fk = "&fk_skill=" . $id . "&fk_user_creat=" . (!empty($user->rowid) ? $user->rowid : 0); |
|
630 | - $backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . $id; |
|
629 | + $param_fk = "&fk_skill=".$id."&fk_user_creat=".(!empty($user->rowid) ? $user->rowid : 0); |
|
630 | + $backtopage = dol_buildpath('/hrm/skill_card.php', 1).'?id='.$id; |
|
631 | 631 | $param = ""; |
632 | 632 | $massactionbutton = ""; |
633 | 633 | //$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/skilldet_card.php', 1) . '?action=create&backtopage=' . urlencode($_SERVER['PHP_SELF']) . $param_fk . '&backtopage=' . $backtopage, '', $permissiontoadd); |
634 | 634 | |
635 | - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, "", '', '', 0, 0, 1); |
|
635 | + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, "", '', '', 0, 0, 1); |
|
636 | 636 | |
637 | 637 | // Add code for pre mass action (confirmation or email presend form) |
638 | 638 | $topicmail = "SendSkilldetRef"; |
639 | 639 | $modelmail = "skilldet"; |
640 | 640 | $objecttmp = new Skilldet($db); |
641 | - $trackid = 'xxxx' . $object->id; |
|
641 | + $trackid = 'xxxx'.$object->id; |
|
642 | 642 | //include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; |
643 | 643 | |
644 | 644 | if ($search_all) { |
645 | 645 | foreach ($fieldstosearchall as $key => $val) { |
646 | 646 | $fieldstosearchall[$key] = $langs->trans($val); |
647 | 647 | } |
648 | - print '<div class="divsearchfieldfilter">' . $langs->trans("FilterOnInto", $search_all) . join(', ', $fieldstosearchall) . '</div>'; |
|
648 | + print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>'; |
|
649 | 649 | } |
650 | 650 | |
651 | 651 | $moreforfilter = ''; |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | // $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
673 | 673 | |
674 | 674 | print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table |
675 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
675 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
676 | 676 | |
677 | 677 | |
678 | 678 | // Fields title label |
@@ -689,13 +689,13 @@ discard block |
||
689 | 689 | // } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
690 | 690 | // $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
691 | 691 | // } |
692 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
693 | - print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, (!empty($cssforfield) ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield . ' ' : '')) . "\n"; |
|
692 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
693 | + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, (!empty($cssforfield) ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield.' ' : ''))."\n"; |
|
694 | 694 | } |
695 | 695 | } |
696 | 696 | //print '<td></td>'; |
697 | 697 | print '<td></td>'; |
698 | - print '</tr>' . "\n"; |
|
698 | + print '</tr>'."\n"; |
|
699 | 699 | |
700 | 700 | |
701 | 701 | // Display all ranks of skill |
@@ -738,14 +738,14 @@ discard block |
||
738 | 738 | // } |
739 | 739 | //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; |
740 | 740 | |
741 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
742 | - print '<td' . (empty($cssforfield) ? '' : ' class="' . $cssforfield . '"') . '>'; |
|
741 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
742 | + print '<td'.(empty($cssforfield) ? '' : ' class="'.$cssforfield.'"').'>'; |
|
743 | 743 | if ($key == 'status') { |
744 | 744 | print $objectline->getLibStatut(5); |
745 | 745 | } elseif ($key == 'rowid') { |
746 | 746 | print $objectline->showOutputField($val, $key, $objectline->id, ''); |
747 | 747 | // ajout pencil |
748 | - print '<a class="timeline-btn" href="' . DOL_MAIN_URL_ROOT . '/comm/action/skilldet_card.php?action=edit&id=' . $objectline->id . '"><i class="fa fa-pencil" title="' . $langs->trans("Modify") . '" ></i></a>'; |
|
748 | + print '<a class="timeline-btn" href="'.DOL_MAIN_URL_ROOT.'/comm/action/skilldet_card.php?action=edit&id='.$objectline->id.'"><i class="fa fa-pencil" title="'.$langs->trans("Modify").'" ></i></a>'; |
|
749 | 749 | } else { |
750 | 750 | print $objectline->showOutputField($val, $key, $objectline->$key, ''); |
751 | 751 | } |
@@ -757,15 +757,15 @@ discard block |
||
757 | 757 | } |
758 | 758 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
759 | 759 | if (!$i) { |
760 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
760 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
761 | 761 | } |
762 | 762 | if (!isset($totalarray['val'])) { |
763 | 763 | $totalarray['val'] = array(); |
764 | 764 | } |
765 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
766 | - $totalarray['val']['t.' . $key] = 0; |
|
765 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
766 | + $totalarray['val']['t.'.$key] = 0; |
|
767 | 767 | } |
768 | - $totalarray['val']['t.' . $key] += $objectline->$key; |
|
768 | + $totalarray['val']['t.'.$key] += $objectline->$key; |
|
769 | 769 | } |
770 | 770 | } |
771 | 771 | } |
@@ -798,7 +798,7 @@ discard block |
||
798 | 798 | $totalarray['nbfield']++; |
799 | 799 | } |
800 | 800 | |
801 | - print '</tr>' . "\n"; |
|
801 | + print '</tr>'."\n"; |
|
802 | 802 | |
803 | 803 | $i++; |
804 | 804 | } |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | $colspan++; |
814 | 814 | } |
815 | 815 | } |
816 | - print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
816 | + print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
817 | 817 | } |
818 | 818 | |
819 | 819 | if (!empty($resql)) { |
@@ -824,10 +824,10 @@ discard block |
||
824 | 824 | $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $objectline); // Note that $action and $objectline may have been modified by hook |
825 | 825 | print $hookmanager->resPrint; |
826 | 826 | |
827 | - print '</table>' . "\n"; |
|
828 | - print '</div>' . "\n"; |
|
827 | + print '</table>'."\n"; |
|
828 | + print '</div>'."\n"; |
|
829 | 829 | |
830 | - print '</form>' . "\n"; |
|
830 | + print '</form>'."\n"; |
|
831 | 831 | |
832 | 832 | // if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { |
833 | 833 | // $hidegeneratedfilelistifempty = 1; |
@@ -862,9 +862,9 @@ discard block |
||
862 | 862 | $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/skill_agenda.php?id='.$object->id); |
863 | 863 | |
864 | 864 | // List of actions on element |
865 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
865 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; |
|
866 | 866 | $formactions = new FormActions($db); |
867 | - $somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
867 | + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
868 | 868 | |
869 | 869 | print '</div></div>'; |
870 | 870 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | $sql = "SELECT t.rowid"; |
151 | 151 | $sql .= " FROM ".MAIN_DB_PREFIX."societe as t"; |
152 | - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
152 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
153 | 153 | if ($category > 0) { |
154 | 154 | if ($mode != 4) { |
155 | 155 | $sql .= ", ".MAIN_DB_PREFIX."categorie_societe as c"; |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | } |
440 | 440 | |
441 | 441 | if ($priceLevel < 1 || $priceLevel > getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT')) { |
442 | - throw new RestException(400, 'Price level must be between 1 and ' . getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT')); |
|
442 | + throw new RestException(400, 'Price level must be between 1 and '.getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT')); |
|
443 | 443 | } |
444 | 444 | |
445 | 445 | if (!DolibarrApiAccess::$user->hasRight('societe', 'creer')) { |
@@ -45,19 +45,19 @@ discard block |
||
45 | 45 | $object = new Workstation($db); |
46 | 46 | $extrafields = new ExtraFields($db); |
47 | 47 | $diroutputmassaction = $conf->workstation->dir_output.'/temp/massgeneration/'.$user->id; |
48 | -$hookmanager->initHooks(array('workstationnote', 'globalcard')); // Note that conf->hooks_modules contains array |
|
48 | +$hookmanager->initHooks(array('workstationnote', 'globalcard')); // Note that conf->hooks_modules contains array |
|
49 | 49 | |
50 | 50 | // Fetch optionals attributes and labels |
51 | 51 | $extrafields->fetch_name_optionals_label($object->table_element); |
52 | 52 | |
53 | 53 | // Load object |
54 | -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
54 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
55 | 55 | if ($id > 0 || !empty($ref)) { |
56 | 56 | $upload_dir = $conf->workstation->multidir_output[$object->entity]."/".$object->id; |
57 | 57 | } |
58 | 58 | |
59 | -$permissionnote = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_setnotes.inc.php |
|
60 | -$permissiontoadd = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_addupdatedelete.inc.php |
|
59 | +$permissionnote = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_setnotes.inc.php |
|
60 | +$permissiontoadd = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_addupdatedelete.inc.php |
|
61 | 61 | |
62 | 62 | // Security check |
63 | 63 | $isdraft = 0; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * Actions |
69 | 69 | */ |
70 | 70 | $parameters = array(); |
71 | -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
71 | +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
72 | 72 | if ($reshook < 0) { |
73 | 73 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
74 | 74 | } |
@@ -84,7 +84,7 @@ |
||
84 | 84 | } |
85 | 85 | $result = restrictedArea($user, 'don', $object->id); |
86 | 86 | |
87 | -$permissiontoadd = $user->hasRight('don', 'creer'); // Used by the include of actions_dellink.inc.php |
|
87 | +$permissiontoadd = $user->hasRight('don', 'creer'); // Used by the include of actions_dellink.inc.php |
|
88 | 88 | |
89 | 89 | |
90 | 90 | /* |
@@ -79,7 +79,7 @@ |
||
79 | 79 | } |
80 | 80 | $result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges'); |
81 | 81 | |
82 | -$permissiontoadd = $user->hasRight('tax', 'charges', 'creer'); // Used by the include of actions_dellink.inc.php |
|
82 | +$permissiontoadd = $user->hasRight('tax', 'charges', 'creer'); // Used by the include of actions_dellink.inc.php |
|
83 | 83 | |
84 | 84 | |
85 | 85 | /* |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'picto'=>'bill', 'enabled' => isModEnabled('tax'), 'perms' => $user->hasRight('tax', 'charges', 'lire')), |
143 | 143 | 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'picto'=>'salary', 'lang'=>'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => $user->hasRight('salaries', 'read')), |
144 | 144 | 'selectvariouspayment'=>array('label'=>'VariousPayment', 'picto'=>'payment', 'enabled' => isModEnabled('banque'), 'perms' => $user->hasRight('banque', 'lire')), |
145 | - 'selectloanspayment'=>array('label'=>'PaymentLoan','picto'=>'loan', 'enabled' => isModEnabled('don'), 'perms' => $user->hasRight('loan', 'read')), |
|
145 | + 'selectloanspayment'=>array('label'=>'PaymentLoan', 'picto'=>'loan', 'enabled' => isModEnabled('don'), 'perms' => $user->hasRight('loan', 'read')), |
|
146 | 146 | ); |
147 | 147 | |
148 | 148 | |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | $zipname .= '_'.$project->ref; |
523 | 523 | } |
524 | 524 | } |
525 | - $zipname .='_export.zip'; |
|
525 | + $zipname .= '_export.zip'; |
|
526 | 526 | |
527 | 527 | dol_delete_file($zipname); |
528 | 528 |