@@ -1457,7 +1457,7 @@ discard block |
||
1457 | 1457 | $tooltipClass = ' classfortooltip'; |
1458 | 1458 | $tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; |
1459 | 1459 | } else { |
1460 | - $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0 ; |
|
1460 | + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0; |
|
1461 | 1461 | } |
1462 | 1462 | $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; |
1463 | 1463 | |
@@ -1696,7 +1696,7 @@ discard block |
||
1696 | 1696 | $tooltipClass = ' classfortooltip'; |
1697 | 1697 | $tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; |
1698 | 1698 | } else { |
1699 | - $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0 ; |
|
1699 | + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0; |
|
1700 | 1700 | } |
1701 | 1701 | $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; |
1702 | 1702 | |
@@ -1757,7 +1757,7 @@ discard block |
||
1757 | 1757 | } |
1758 | 1758 | print '<input class="qtyl right" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0"'.($disabled ? ' '.$disabled : '').'> '; |
1759 | 1759 | if (empty($disabled) && getDolGlobalString('STOCK_ALLOW_NEGATIVE_TRANSFER')) { |
1760 | - print '<input name="ent1' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $warehouse_selected_id . '">'; |
|
1760 | + print '<input name="ent1'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$warehouse_selected_id.'">'; |
|
1761 | 1761 | } |
1762 | 1762 | } elseif ($line->product_type == Product::TYPE_SERVICE && getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) { |
1763 | 1763 | $disabled = ''; |
@@ -1769,7 +1769,7 @@ discard block |
||
1769 | 1769 | } |
1770 | 1770 | print '<input class="qtyl right" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$quantityToBeDelivered.'"'.($disabled ? ' '.$disabled : '').'> '; |
1771 | 1771 | if (empty($disabled) && getDolGlobalString('STOCK_ALLOW_NEGATIVE_TRANSFER')) { |
1772 | - print '<input name="ent1' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $warehouse_selected_id . '">'; |
|
1772 | + print '<input name="ent1'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$warehouse_selected_id.'">'; |
|
1773 | 1773 | } |
1774 | 1774 | } else { |
1775 | 1775 | print $langs->trans("NA"); |
@@ -1834,7 +1834,7 @@ discard block |
||
1834 | 1834 | } |
1835 | 1835 | } |
1836 | 1836 | } elseif ($object->id > 0) { |
1837 | - '@phan-var-force Expedition $object'; // Need to force it (type overridden earlier) |
|
1837 | + '@phan-var-force Expedition $object'; // Need to force it (type overridden earlier) |
|
1838 | 1838 | /* *************************************************************************** */ |
1839 | 1839 | /* */ |
1840 | 1840 | /* Edit and view mode */ |
@@ -1948,7 +1948,7 @@ discard block |
||
1948 | 1948 | $morehtmlref = '<div class="refidno">'; |
1949 | 1949 | // Ref customer shipment |
1950 | 1950 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string', '', 0, 1); |
1951 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
1951 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
1952 | 1952 | // Thirdparty |
1953 | 1953 | $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1); |
1954 | 1954 | // Project |
@@ -2714,7 +2714,7 @@ discard block |
||
2714 | 2714 | || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('expedition', 'shipping_advance', 'validate'))) { |
2715 | 2715 | print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=valid&token='.newToken().'&id='.$object->id, ''); |
2716 | 2716 | } else { |
2717 | - print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
2717 | + print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
2718 | 2718 | } |
2719 | 2719 | } |
2720 | 2720 | |
@@ -2736,7 +2736,7 @@ discard block |
||
2736 | 2736 | if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('expedition', 'shipping_advance', 'send')) { |
2737 | 2737 | print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); |
2738 | 2738 | } else { |
2739 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
2739 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
2740 | 2740 | } |
2741 | 2741 | } |
2742 | 2742 | } |
@@ -30,19 +30,19 @@ discard block |
||
30 | 30 | // Load Dolibarr environment |
31 | 31 | require '../main.inc.php'; |
32 | 32 | |
33 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php'; |
|
39 | 39 | //dol_include_once('/hrm/position.php'); |
40 | 40 | |
41 | 41 | // Get Parameters |
42 | -$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... |
|
42 | +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... |
|
43 | 43 | $backtopage = GETPOST('backtopage', 'alpha'); |
44 | 44 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
45 | -$id = GETPOSTINT('id'); |
|
45 | +$id = GETPOSTINT('id'); |
|
46 | 46 | |
47 | 47 | // Initialize a technical objects |
48 | 48 | $form = new Form($db); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
58 | 58 | $permissiontodelete = $user->hasRight('hrm', 'all', 'delete'); |
59 | 59 | $permissiondellink = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_dellink.inc.php |
60 | -$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/position'; |
|
60 | +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/position'; |
|
61 | 61 | |
62 | 62 | // Security check (enable the most restrictive one) |
63 | 63 | //if ($user->socid > 0) accessforbidden(); |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | |
77 | 77 | |
78 | 78 | // Get parameters |
79 | -$id = GETPOSTINT('id'); |
|
79 | +$id = GETPOSTINT('id'); |
|
80 | 80 | $fk_job = GETPOSTINT('fk_job'); |
81 | 81 | |
82 | -$ref = GETPOST('ref', 'alpha'); |
|
82 | +$ref = GETPOST('ref', 'alpha'); |
|
83 | 83 | $action = GETPOST('action', 'aZ09'); |
84 | 84 | $confirm = GETPOST('confirm', 'alpha'); |
85 | 85 | $cancel = GETPOST('cancel', 'aZ09'); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | $extrafields = new ExtraFields($db); |
99 | 99 | |
100 | -$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; |
|
100 | +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; |
|
101 | 101 | $hookmanager->initHooks(array('positioncard', 'globalcard')); // Note that conf->hooks_modules contains array |
102 | 102 | |
103 | 103 | // Fetch optionals attributes and labels |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | $search_all = GETPOST("search_all", 'alpha'); |
110 | 110 | $search = array(); |
111 | 111 | foreach ($object->fields as $key => $val) { |
112 | - if (GETPOST('search_' . $key, 'alpha')) { |
|
113 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
112 | + if (GETPOST('search_'.$key, 'alpha')) { |
|
113 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | // Load object |
122 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. |
|
122 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. |
|
123 | 123 | |
124 | 124 | |
125 | 125 | /* |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
143 | 143 | $backtopage = $backurlforlist; |
144 | 144 | } else { |
145 | - $backtopage = dol_buildpath('/hrm/position_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); |
|
145 | + $backtopage = dol_buildpath('/hrm/position_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | } |
@@ -150,19 +150,19 @@ discard block |
||
150 | 150 | $triggermodname = 'HRM_POSITION_MODIFY'; // Name of trigger action code to execute when we modify record |
151 | 151 | |
152 | 152 | // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen |
153 | - include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; |
|
153 | + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; |
|
154 | 154 | |
155 | 155 | // Actions when linking object each other |
156 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
156 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
157 | 157 | |
158 | 158 | // Actions when printing a doc from card |
159 | - include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; |
|
159 | + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
|
160 | 160 | |
161 | 161 | // Action to move up and down lines of object |
162 | 162 | //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; |
163 | 163 | |
164 | 164 | // Action to build doc |
165 | - include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; |
|
165 | + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
|
166 | 166 | |
167 | 167 | if ($action == 'set_thirdparty' && $permissiontoadd) { |
168 | 168 | $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname); |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | // Actions to send emails |
175 | 175 | $triggersendname = 'HRM_POSITION_SENTBYMAIL'; |
176 | 176 | $autocopy = 'MAIN_MAIL_AUTOCOPY_POSITION_TO'; |
177 | - $trackid = 'position' . $object->id; |
|
178 | - include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; |
|
177 | + $trackid = 'position'.$object->id; |
|
178 | + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | |
@@ -220,36 +220,36 @@ discard block |
||
220 | 220 | |
221 | 221 | // Part to edit record |
222 | 222 | if (($id || $ref) && $action == 'edit') { |
223 | - print load_fiche_titre($langs->trans("Position"), '', 'object_' . $object->picto); |
|
223 | + print load_fiche_titre($langs->trans("Position"), '', 'object_'.$object->picto); |
|
224 | 224 | |
225 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '">'; |
|
226 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
225 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">'; |
|
226 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
227 | 227 | print '<input type="hidden" name="action" value="update">'; |
228 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
228 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
229 | 229 | |
230 | 230 | if ($backtopage) { |
231 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
231 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
232 | 232 | } |
233 | 233 | if ($backtopageforcancel) { |
234 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
234 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | print dol_get_fiche_head(); |
238 | 238 | |
239 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
239 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
240 | 240 | |
241 | 241 | // Common attributes |
242 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
242 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
243 | 243 | |
244 | 244 | // Other attributes |
245 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; |
|
245 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
|
246 | 246 | |
247 | 247 | print '</table>'; |
248 | 248 | |
249 | 249 | print dol_get_fiche_end(); |
250 | 250 | |
251 | - print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">'; |
|
252 | - print ' <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
251 | + print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">'; |
|
252 | + print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
253 | 253 | print '</div>'; |
254 | 254 | |
255 | 255 | print '</form>'; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | |
269 | 269 | // Confirmation to delete |
270 | 270 | if ($action == 'delete') { |
271 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeletePosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
271 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeletePosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | // Call Hook formConfirm |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | print '<div class="fichecenter">'; |
304 | 304 | print '<div class="fichehalfleft">'; |
305 | 305 | print '<div class="underbanner clearboth"></div>'; |
306 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
306 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
307 | 307 | |
308 | 308 | // Common attributes |
309 | 309 | //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field |
@@ -311,10 +311,10 @@ discard block |
||
311 | 311 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
312 | 312 | $object->fields['fk_user']['visible'] = 0; // Already in banner |
313 | 313 | $object->fields['fk_job']['visible'] = 0; // Already in banner |
314 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
314 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
315 | 315 | |
316 | 316 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
317 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
317 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
318 | 318 | |
319 | 319 | print '</table>'; |
320 | 320 | print '</div>'; |
@@ -333,10 +333,10 @@ discard block |
||
333 | 333 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
334 | 334 | |
335 | 335 | |
336 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
336 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
337 | 337 | |
338 | 338 | // Delete (need delete permission, or if draft, just need create/modify permission) |
339 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete); |
|
339 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete); |
|
340 | 340 | } |
341 | 341 | } |
342 | 342 | |
@@ -374,10 +374,10 @@ discard block |
||
374 | 374 | //} |
375 | 375 | |
376 | 376 | |
377 | -print '</table>' . "\n"; |
|
378 | -print '</div>' . "\n"; |
|
377 | +print '</table>'."\n"; |
|
378 | +print '</div>'."\n"; |
|
379 | 379 | |
380 | -print '</form>' . "\n"; |
|
380 | +print '</form>'."\n"; |
|
381 | 381 | |
382 | 382 | |
383 | 383 | if ($action !== 'edit' && $action !== 'create') { |
@@ -395,9 +395,9 @@ discard block |
||
395 | 395 | $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/position_agenda.php?id='.$object->id); |
396 | 396 | |
397 | 397 | // List of actions on element |
398 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
398 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; |
|
399 | 399 | $formactions = new FormActions($db); |
400 | - $somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
400 | + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
401 | 401 | |
402 | 402 | print '</div></div>'; |
403 | 403 | } |
@@ -30,15 +30,15 @@ discard block |
||
30 | 30 | // Load Dolibarr environment |
31 | 31 | require '../main.inc.php'; |
32 | 32 | |
33 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php'; |
|
39 | 39 | |
40 | 40 | // Load translation files required by the page |
41 | -$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
41 | +$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
42 | 42 | |
43 | 43 | // Get parameters |
44 | 44 | $id = GETPOSTINT('id'); |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'jobcard'; // To manage different context of search |
50 | 50 | $backtopage = GETPOST('backtopage', 'alpha'); |
51 | 51 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
52 | -$lineid = GETPOSTINT('lineid'); |
|
52 | +$lineid = GETPOSTINT('lineid'); |
|
53 | 53 | |
54 | 54 | // Initialize a technical objects |
55 | 55 | $object = new Job($db); |
56 | 56 | $extrafields = new ExtraFields($db); |
57 | -$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; |
|
57 | +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; |
|
58 | 58 | $hookmanager->initHooks(array('jobcard', 'globalcard')); // Note that conf->hooks_modules contains array |
59 | 59 | |
60 | 60 | // Fetch optionals attributes and labels |
@@ -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] . '/job'; |
|
85 | +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/job'; |
|
86 | 86 | |
87 | 87 | // Security check (enable the most restrictive one) |
88 | 88 | //if ($user->socid > 0) accessforbidden(); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
118 | 118 | $backtopage = $backurlforlist; |
119 | 119 | } else { |
120 | - $backtopage = dol_buildpath('/hrm/job_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); |
|
120 | + $backtopage = dol_buildpath('/hrm/job_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | } |
@@ -127,20 +127,20 @@ discard block |
||
127 | 127 | |
128 | 128 | // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen |
129 | 129 | if ($action != 'confirm_clone') { |
130 | - include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; |
|
130 | + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | // Actions when linking object each other |
134 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
134 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
135 | 135 | |
136 | 136 | // Actions when printing a doc from card |
137 | - include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; |
|
137 | + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
|
138 | 138 | |
139 | 139 | // Action to move up and down lines of object |
140 | 140 | //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; |
141 | 141 | |
142 | 142 | // Action to build doc |
143 | - include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; |
|
143 | + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
|
144 | 144 | |
145 | 145 | if ($action == 'set_thirdparty' && $permissiontoadd) { |
146 | 146 | $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname); |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | // Actions to send emails |
153 | 153 | $triggersendname = 'HRM_JOB_SENTBYMAIL'; |
154 | 154 | $autocopy = 'MAIN_MAIL_AUTOCOPY_JOB_TO'; |
155 | - $trackid = 'job' . $object->id; |
|
156 | - include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; |
|
155 | + $trackid = 'job'.$object->id; |
|
156 | + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
|
157 | 157 | |
158 | 158 | if ($action == 'confirm_clone' && $confirm != 'yes') { |
159 | 159 | $action = ''; |
@@ -240,36 +240,36 @@ discard block |
||
240 | 240 | |
241 | 241 | // Part to create |
242 | 242 | if ($action == 'create') { |
243 | - print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_' . $object->picto); |
|
243 | + print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_'.$object->picto); |
|
244 | 244 | |
245 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
246 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
245 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
246 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
247 | 247 | print '<input type="hidden" name="action" value="add">'; |
248 | 248 | if ($backtopage) { |
249 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
249 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
250 | 250 | } |
251 | 251 | if ($backtopageforcancel) { |
252 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
252 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | print dol_get_fiche_head(array(), ''); |
256 | 256 | |
257 | - print '<table class="border centpercent tableforfieldcreate">' . "\n"; |
|
257 | + print '<table class="border centpercent tableforfieldcreate">'."\n"; |
|
258 | 258 | |
259 | 259 | // Common attributes |
260 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; |
|
260 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; |
|
261 | 261 | |
262 | 262 | // Other attributes |
263 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; |
|
263 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
|
264 | 264 | |
265 | - print '</table>' . "\n"; |
|
265 | + print '</table>'."\n"; |
|
266 | 266 | |
267 | 267 | print dol_get_fiche_end(); |
268 | 268 | |
269 | 269 | print '<div class="center">'; |
270 | - print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">'; |
|
270 | + print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">'; |
|
271 | 271 | print ' '; |
272 | - 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 | + 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 |
|
273 | 273 | print '</div>'; |
274 | 274 | |
275 | 275 | print '</form>'; |
@@ -279,35 +279,35 @@ discard block |
||
279 | 279 | |
280 | 280 | // Part to edit record |
281 | 281 | if (($id || $ref) && $action == 'edit') { |
282 | - print load_fiche_titre($langs->trans("JobProfile"), '', 'object_' . $object->picto); |
|
282 | + print load_fiche_titre($langs->trans("JobProfile"), '', 'object_'.$object->picto); |
|
283 | 283 | |
284 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
285 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
284 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
285 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
286 | 286 | print '<input type="hidden" name="action" value="update">'; |
287 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
287 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
288 | 288 | if ($backtopage) { |
289 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
289 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
290 | 290 | } |
291 | 291 | if ($backtopageforcancel) { |
292 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
292 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | print dol_get_fiche_head(); |
296 | 296 | |
297 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
297 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
298 | 298 | |
299 | 299 | // Common attributes |
300 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
300 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
301 | 301 | |
302 | 302 | // Other attributes |
303 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; |
|
303 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
|
304 | 304 | |
305 | 305 | print '</table>'; |
306 | 306 | |
307 | 307 | print dol_get_fiche_end(); |
308 | 308 | |
309 | - print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">'; |
|
310 | - print ' <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
309 | + print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">'; |
|
310 | + print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
311 | 311 | print '</div>'; |
312 | 312 | |
313 | 313 | print '</form>'; |
@@ -325,11 +325,11 @@ discard block |
||
325 | 325 | |
326 | 326 | // Confirmation to delete |
327 | 327 | if ($action == 'delete') { |
328 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
328 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
329 | 329 | } |
330 | 330 | // Confirmation to delete line |
331 | 331 | if ($action == 'deleteline') { |
332 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); |
|
332 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); |
|
333 | 333 | } |
334 | 334 | // Clone confirmation |
335 | 335 | if ($action == 'clone') { |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) |
356 | 356 | ); |
357 | 357 | */ |
358 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); |
|
358 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | // Call Hook formConfirm |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | |
374 | 374 | // Object card |
375 | 375 | // ------------------------------------------------------------ |
376 | - $linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
376 | + $linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
377 | 377 | |
378 | 378 | $morehtmlref = '<div class="refid">'; |
379 | 379 | $morehtmlref .= $object->label; |
@@ -393,10 +393,10 @@ discard block |
||
393 | 393 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
394 | 394 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
395 | 395 | $object->fields['label']['visible'] = 0; // Already in banner |
396 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
396 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
397 | 397 | |
398 | 398 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
399 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
399 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
400 | 400 | |
401 | 401 | print '</table>'; |
402 | 402 | print '</div>'; |
@@ -415,16 +415,16 @@ discard block |
||
415 | 415 | // Show object lines |
416 | 416 | $result = $object->getLinesArray(); |
417 | 417 | |
418 | - print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '#line_' . GETPOSTINT('lineid')) . '" method="POST"> |
|
419 | - <input type="hidden" name="token" value="' . newToken() . '"> |
|
420 | - <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> |
|
418 | + print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOSTINT('lineid')).'" method="POST"> |
|
419 | + <input type="hidden" name="token" value="' . newToken().'"> |
|
420 | + <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'"> |
|
421 | 421 | <input type="hidden" name="mode" value=""> |
422 | 422 | <input type="hidden" name="page_y" value=""> |
423 | - <input type="hidden" name="id" value="' . $object->id . '"> |
|
423 | + <input type="hidden" name="id" value="' . $object->id.'"> |
|
424 | 424 | '; |
425 | 425 | |
426 | 426 | if (!empty($conf->use_javascript_ajax) && $object->status == 0) { |
427 | - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; |
|
427 | + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | print '<div class="div-table-responsive-no-min">'; |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | // Buttons for actions |
465 | 465 | |
466 | 466 | if ($action != 'presend' && $action != 'editline') { |
467 | - print '<div class="tabsAction">' . "\n"; |
|
467 | + print '<div class="tabsAction">'."\n"; |
|
468 | 468 | $parameters = array(); |
469 | 469 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
470 | 470 | if ($reshook < 0) { |
@@ -474,17 +474,17 @@ discard block |
||
474 | 474 | if (empty($reshook)) { |
475 | 475 | // Back to draft |
476 | 476 | if ($object->status == $object::STATUS_VALIDATED) { |
477 | - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd); |
|
477 | + print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); |
|
478 | 478 | } |
479 | 479 | |
480 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
480 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
481 | 481 | |
482 | - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', $permissiontoadd); |
|
482 | + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=clone&token='.newToken(), '', $permissiontoadd); |
|
483 | 483 | |
484 | 484 | // Delete (need delete permission, or if draft, just need create/modify permission) |
485 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete); |
|
485 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete); |
|
486 | 486 | } |
487 | - print '</div>' . "\n"; |
|
487 | + print '</div>'."\n"; |
|
488 | 488 | } |
489 | 489 | |
490 | 490 | |
@@ -502,12 +502,12 @@ discard block |
||
502 | 502 | // Documents |
503 | 503 | if ($includedocgeneration) { |
504 | 504 | $objref = dol_sanitizeFileName($object->ref); |
505 | - $relativepath = $objref . '/' . $objref . '.pdf'; |
|
506 | - $filedir = $conf->hrm->dir_output . '/' . $object->element . '/' . $objref; |
|
507 | - $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; |
|
505 | + $relativepath = $objref.'/'.$objref.'.pdf'; |
|
506 | + $filedir = $conf->hrm->dir_output.'/'.$object->element.'/'.$objref; |
|
507 | + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; |
|
508 | 508 | $genallowed = $user->hasRight('hrm', 'job', 'read'); // If you can read, you can build the PDF to read content |
509 | 509 | $delallowed = $user->hasRight('hrm', 'job', 'write'); // If you can create/edit, you can remove a file on card |
510 | - print $formfile->showdocuments('hrm:Job', $object->element . '/' . $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); |
|
510 | + print $formfile->showdocuments('hrm:Job', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | // Show links to link elements |
@@ -522,9 +522,9 @@ discard block |
||
522 | 522 | $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id); |
523 | 523 | |
524 | 524 | // List of actions on element |
525 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
525 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; |
|
526 | 526 | $formactions = new FormActions($db); |
527 | - $somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
527 | + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
528 | 528 | |
529 | 529 | print '</div></div>'; |
530 | 530 | } |
@@ -533,9 +533,9 @@ discard block |
||
533 | 533 | $modelmail = 'job'; |
534 | 534 | $defaulttopic = 'InformationMessage'; |
535 | 535 | $diroutput = $conf->hrm->dir_output; |
536 | - $trackid = 'job' . $object->id; |
|
536 | + $trackid = 'job'.$object->id; |
|
537 | 537 | |
538 | - include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php'; |
|
538 | + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; |
|
539 | 539 | } |
540 | 540 | |
541 | 541 | // End of page |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | /** |
140 | 140 | * @var int|string |
141 | 141 | */ |
142 | - public $date_validite; // Note: misspelled! |
|
142 | + public $date_validite; // Note: misspelled! |
|
143 | 143 | /** |
144 | 144 | * @var float |
145 | 145 | */ |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | */ |
246 | 246 | public function create(User $user, $notrigger = 0) |
247 | 247 | { |
248 | - global $langs,$conf; |
|
248 | + global $langs, $conf; |
|
249 | 249 | |
250 | 250 | $resultcreate = $this->createCommon($user, $notrigger); |
251 | 251 | |
@@ -273,18 +273,18 @@ discard block |
||
273 | 273 | |
274 | 274 | $error = 0; |
275 | 275 | |
276 | - require_once __DIR__ . '/skilldet.class.php'; |
|
276 | + require_once __DIR__.'/skilldet.class.php'; |
|
277 | 277 | |
278 | 278 | $this->db->begin(); |
279 | 279 | |
280 | 280 | // Create level of skills |
281 | 281 | while ($i <= $MaxNumberSkill) { |
282 | 282 | $skilldet = new Skilldet($this->db); |
283 | - $skilldet->description = $defaultSkillDesc . " " . $i; |
|
283 | + $skilldet->description = $defaultSkillDesc." ".$i; |
|
284 | 284 | $skilldet->rankorder = $i; |
285 | 285 | $skilldet->fk_skill = $this->id; |
286 | 286 | |
287 | - $result = $skilldet->create($user); |
|
287 | + $result = $skilldet->create($user); |
|
288 | 288 | if ($result <= 0) { |
289 | 289 | $error++; |
290 | 290 | } |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | public function fetchLines() |
426 | 426 | { |
427 | 427 | $this->lines = array(); |
428 | - require_once __DIR__ . '/skilldet.class.php'; |
|
428 | + require_once __DIR__.'/skilldet.class.php'; |
|
429 | 429 | $skilldet = new Skilldet($this->db); |
430 | 430 | $this->lines = $skilldet->fetchAll('ASC', '', 0, 0, '(fk_skill:=:'.$this->id.')'); |
431 | 431 | |
@@ -1011,7 +1011,7 @@ discard block |
||
1011 | 1011 | if (getDolGlobalString('hrm_SKILL_ADDON')) { |
1012 | 1012 | $mybool = false; |
1013 | 1013 | |
1014 | - $file = getDolGlobalString('hrm_SKILL_ADDON') . ".php"; |
|
1014 | + $file = getDolGlobalString('hrm_SKILL_ADDON').".php"; |
|
1015 | 1015 | $classname = getDolGlobalString('hrm_SKILL_ADDON'); |
1016 | 1016 | |
1017 | 1017 | // Include file with class |
@@ -30,15 +30,15 @@ discard block |
||
30 | 30 | |
31 | 31 | // Load Dolibarr environment |
32 | 32 | require '../main.inc.php'; |
33 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php'; |
|
38 | 38 | |
39 | 39 | |
40 | 40 | // Load translation files required by the page |
41 | -$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
41 | +$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
42 | 42 | |
43 | 43 | // Get parameters |
44 | 44 | $id = GETPOSTINT('id'); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'skillcard'; // To manage different context of search |
50 | 50 | $backtopage = GETPOST('backtopage', 'alpha'); |
51 | 51 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
52 | -$lineid = GETPOSTINT('lineid'); |
|
52 | +$lineid = GETPOSTINT('lineid'); |
|
53 | 53 | |
54 | 54 | // Initialize a technical objects |
55 | 55 | $object = new Skill($db); |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | $search_all = GETPOST("search_all", 'alpha'); |
68 | 68 | $search = array(); |
69 | 69 | foreach ($object->fields as $key => $val) { |
70 | - if (GETPOST('search_' . $key, 'alpha')) { |
|
71 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
70 | + if (GETPOST('search_'.$key, 'alpha')) { |
|
71 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
@@ -77,14 +77,14 @@ discard block |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | // Load object |
80 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. |
|
80 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. |
|
81 | 81 | |
82 | 82 | // Permissions |
83 | 83 | $permissiontoread = $user->hasRight('hrm', 'all', 'read'); |
84 | 84 | $permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
85 | 85 | $permissiontodelete = $user->hasRight('hrm', 'all', 'delete'); |
86 | 86 | |
87 | -$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/skill'; |
|
87 | +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/skill'; |
|
88 | 88 | |
89 | 89 | // Security check (enable the most restrictive one) |
90 | 90 | //if ($user->socid > 0) accessforbidden(); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
122 | 122 | $backtopage = $backurlforlist; |
123 | 123 | } else { |
124 | - $backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id=' . ($id > 0 ? $id : '__ID__'); |
|
124 | + $backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id='.($id > 0 ? $id : '__ID__'); |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | } |
@@ -174,16 +174,16 @@ discard block |
||
174 | 174 | |
175 | 175 | |
176 | 176 | // Actions when linking object each other |
177 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
177 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
178 | 178 | |
179 | 179 | // Actions when printing a doc from card |
180 | - include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; |
|
180 | + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
|
181 | 181 | |
182 | 182 | // Action to move up and down lines of object |
183 | 183 | //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; |
184 | 184 | |
185 | 185 | // Action to build doc |
186 | - include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; |
|
186 | + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
|
187 | 187 | |
188 | 188 | if ($action == 'set_thirdparty' && $permissiontoadd) { |
189 | 189 | $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname); |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | // Actions to send emails |
196 | 196 | $triggersendname = 'HRM_SKILL_SENTBYMAIL'; |
197 | 197 | $autocopy = 'MAIN_MAIL_AUTOCOPY_SKILL_TO'; |
198 | - $trackid = 'skill' . $object->id; |
|
199 | - include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; |
|
198 | + $trackid = 'skill'.$object->id; |
|
199 | + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
|
200 | 200 | |
201 | 201 | if ($action == 'confirm_clone' && $confirm != 'yes') { |
202 | 202 | $action = ''; |
@@ -225,25 +225,25 @@ discard block |
||
225 | 225 | |
226 | 226 | // Part to create |
227 | 227 | if ($action == 'create') { |
228 | - print load_fiche_titre($langs->trans("NewSkill"), '', 'object_' . $object->picto); |
|
228 | + print load_fiche_titre($langs->trans("NewSkill"), '', 'object_'.$object->picto); |
|
229 | 229 | |
230 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
231 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
230 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
231 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
232 | 232 | print '<input type="hidden" name="action" value="add">'; |
233 | - $backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?') ."objecttype=job"; |
|
233 | + $backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?')."objecttype=job"; |
|
234 | 234 | if ($backtopage) { |
235 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
235 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
236 | 236 | } |
237 | 237 | if ($backtopageforcancel) { |
238 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
238 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | print dol_get_fiche_head(array(), ''); |
242 | 242 | |
243 | - print '<table class="border centpercent tableforfieldcreate">' . "\n"; |
|
243 | + print '<table class="border centpercent tableforfieldcreate">'."\n"; |
|
244 | 244 | |
245 | 245 | // Common attributes |
246 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; |
|
246 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; |
|
247 | 247 | |
248 | 248 | // Other attributes |
249 | 249 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
@@ -253,12 +253,12 @@ discard block |
||
253 | 253 | //@todo je stop ici ... à continuer (affichage des 5 skilled input pour create action |
254 | 254 | //print $object->showInputField($val, $key, $value, '', '['']', '', 0); |
255 | 255 | |
256 | - print '</table>' . "\n"; |
|
256 | + print '</table>'."\n"; |
|
257 | 257 | print '<hr>'; |
258 | 258 | |
259 | - print '<table class="border centpercent =">' . "\n"; |
|
259 | + print '<table class="border centpercent =">'."\n"; |
|
260 | 260 | for ($i = 1; $i <= $MaxNumberSkill; $i++) { |
261 | - print '<tr><td class="titlefieldcreate tdtop">'. $langs->trans('Description') . ' ' . $langs->trans('rank') . ' ' . $i . '</td>'; |
|
261 | + print '<tr><td class="titlefieldcreate tdtop">'.$langs->trans('Description').' '.$langs->trans('rank').' '.$i.'</td>'; |
|
262 | 262 | print '<td class="valuefieldcreate"><textarea name="descriptionline[]" rows="5" class="flat minwidth100" style="margin-top: 5px; width: 90%"></textarea></td>'; |
263 | 263 | } |
264 | 264 | print '</table>'; |
@@ -266,9 +266,9 @@ discard block |
||
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)"') . '>'; |
|
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)"').'>'; |
|
272 | 272 | print '</div>'; |
273 | 273 | |
274 | 274 | print '</form>'; |
@@ -279,25 +279,25 @@ discard block |
||
279 | 279 | // Part to edit record |
280 | 280 | // and skilldet edition |
281 | 281 | if (($id || $ref) && $action == 'edit') { |
282 | - print load_fiche_titre($langs->trans("Skill"), '', 'object_' . $object->picto); |
|
282 | + print load_fiche_titre($langs->trans("Skill"), '', 'object_'.$object->picto); |
|
283 | 283 | |
284 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
285 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
284 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
285 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
286 | 286 | print '<input type="hidden" name="action" value="update">'; |
287 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
287 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
288 | 288 | if ($backtopage) { |
289 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
289 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
290 | 290 | } |
291 | 291 | if ($backtopageforcancel) { |
292 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
292 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | print dol_get_fiche_head(); |
296 | 296 | |
297 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
297 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
298 | 298 | |
299 | 299 | // Common attributes |
300 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
300 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
301 | 301 | |
302 | 302 | // Other attributes |
303 | 303 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | continue; |
322 | 322 | } |
323 | 323 | |
324 | - print '<table class="border centpercent =">' . "\n"; |
|
324 | + print '<table class="border centpercent =">'."\n"; |
|
325 | 325 | $sk->fields = dol_sort_array($sk->fields, 'position'); |
326 | 326 | foreach ($sk->fields as $key => $val) { |
327 | 327 | if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4) { |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | continue; // We don't want this field |
333 | 333 | } |
334 | 334 | |
335 | - print '<tr class="field_' . $key . '"><td'; |
|
335 | + print '<tr class="field_'.$key.'"><td'; |
|
336 | 336 | print ' class="titlefieldcreate'; |
337 | 337 | if (isset($val['notnull']) && $val['notnull'] > 0) { |
338 | 338 | print ' fieldrequired'; |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | print $sk->showOutputField($val, $key, $value, '', '', '', 0); |
381 | 381 | } else { |
382 | 382 | /** @var Skilldet $sk */ |
383 | - print $sk->showInputField($val, $key, $value, "", "line[" . $sk->id . "]", "", ""); |
|
383 | + print $sk->showInputField($val, $key, $value, "", "line[".$sk->id."]", "", ""); |
|
384 | 384 | } |
385 | 385 | print '</td>'; |
386 | 386 | print '</tr>'; |
@@ -392,8 +392,8 @@ discard block |
||
392 | 392 | |
393 | 393 | print dol_get_fiche_end(); |
394 | 394 | |
395 | - print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">'; |
|
396 | - print ' <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
395 | + print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">'; |
|
396 | + print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
397 | 397 | print '</div>'; |
398 | 398 | |
399 | 399 | print '</form>'; |
@@ -411,11 +411,11 @@ discard block |
||
411 | 411 | |
412 | 412 | // Confirmation to delete |
413 | 413 | if ($action == 'delete') { |
414 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
414 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
415 | 415 | } |
416 | 416 | // Confirmation to delete line |
417 | 417 | if ($action == 'deleteline') { |
418 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); |
|
418 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); |
|
419 | 419 | } |
420 | 420 | // Confirmation clone |
421 | 421 | if ($action === 'clone') { |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) |
439 | 439 | ); |
440 | 440 | */ |
441 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); |
|
441 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | // Call Hook formConfirm |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | |
457 | 457 | // Object card |
458 | 458 | // ------------------------------------------------------------ |
459 | - $linkback = '<a href="' . DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
459 | + $linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
460 | 460 | |
461 | 461 | |
462 | 462 | $morehtmlref = '<div class="refid">'; |
@@ -468,10 +468,10 @@ discard block |
||
468 | 468 | print '<div class="fichecenter">'; |
469 | 469 | print '<div class="fichehalfleft">'; |
470 | 470 | print '<div class="underbanner clearboth"></div>'; |
471 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
471 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
472 | 472 | |
473 | 473 | $object->fields['label']['visible'] = 0; // Already in banner |
474 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
474 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
475 | 475 | |
476 | 476 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
477 | 477 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | // Buttons for actions |
492 | 492 | |
493 | 493 | if ($action != 'presend' && $action != 'editline') { |
494 | - print '<div class="tabsAction">' . "\n"; |
|
494 | + print '<div class="tabsAction">'."\n"; |
|
495 | 495 | $parameters = array(); |
496 | 496 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
497 | 497 | if ($reshook < 0) { |
@@ -501,19 +501,19 @@ discard block |
||
501 | 501 | if (empty($reshook)) { |
502 | 502 | // Back to draft |
503 | 503 | if ($object->status == $object::STATUS_VALIDATED) { |
504 | - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd); |
|
504 | + print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); |
|
505 | 505 | } |
506 | 506 | |
507 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
507 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
508 | 508 | |
509 | 509 | // Clone |
510 | 510 | if ($permissiontoadd) { |
511 | 511 | print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id, ''); |
512 | 512 | } |
513 | 513 | // Delete (need delete permission, or if draft, just need create/modify permission) |
514 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete); |
|
514 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete); |
|
515 | 515 | } |
516 | - print '</div>' . "\n"; |
|
516 | + print '</div>'."\n"; |
|
517 | 517 | } |
518 | 518 | } |
519 | 519 | |
@@ -521,12 +521,12 @@ discard block |
||
521 | 521 | //*--------------------------------------------------------------------------- |
522 | 522 | |
523 | 523 | if ($action != "create" && $action != "edit") { |
524 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
525 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
526 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
524 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
525 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
526 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
527 | 527 | |
528 | 528 | // load hrm libraries |
529 | - require_once __DIR__ . '/class/skilldet.class.php'; |
|
529 | + require_once __DIR__.'/class/skilldet.class.php'; |
|
530 | 530 | |
531 | 531 | // for other modules |
532 | 532 | //dol_include_once('/othermodule/class/otherobject.class.php'); |
@@ -563,8 +563,8 @@ discard block |
||
563 | 563 | |
564 | 564 | // Default sort order (if not yet defined by previous GETPOST) |
565 | 565 | if (!$sortfield) { |
566 | - reset($objectline->fields); // Reset is required to avoid key() to return null. |
|
567 | - $sortfield = "t." . key($objectline->fields); // Set here default search field. By default 1st field in definition. |
|
566 | + reset($objectline->fields); // Reset is required to avoid key() to return null. |
|
567 | + $sortfield = "t.".key($objectline->fields); // Set here default search field. By default 1st field in definition. |
|
568 | 568 | } |
569 | 569 | if (!$sortorder) { |
570 | 570 | $sortorder = "ASC"; |
@@ -574,12 +574,12 @@ discard block |
||
574 | 574 | $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); |
575 | 575 | $search = array(); |
576 | 576 | foreach ($objectline->fields as $key => $val) { |
577 | - if (GETPOST('search_' . $key, 'alpha') !== '') { |
|
578 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
577 | + if (GETPOST('search_'.$key, 'alpha') !== '') { |
|
578 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
579 | 579 | } |
580 | 580 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
581 | - $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_' . $key . '_dtstartmonth'), GETPOSTINT('search_' . $key . '_dtstartday'), GETPOSTINT('search_' . $key . '_dtstartyear')); |
|
582 | - $search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_' . $key . '_dtendmonth'), GETPOSTINT('search_' . $key . '_dtendday'), GETPOSTINT('search_' . $key . '_dtendyear')); |
|
581 | + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); |
|
582 | + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); |
|
583 | 583 | } |
584 | 584 | } |
585 | 585 | |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | $fieldstosearchall = array(); |
588 | 588 | foreach ($objectline->fields as $key => $val) { |
589 | 589 | if (!empty($val['searchall'])) { |
590 | - $fieldstosearchall['t.' . $key] = $val['label']; |
|
590 | + $fieldstosearchall['t.'.$key] = $val['label']; |
|
591 | 591 | } |
592 | 592 | } |
593 | 593 | |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | // If $val['visible']==0, then we never show the field |
598 | 598 | if (!empty($val['visible'])) { |
599 | 599 | $visible = (int) dol_eval((string) $val['visible'], 1, 1, '1'); |
600 | - $arrayfields['t.' . $key] = array( |
|
600 | + $arrayfields['t.'.$key] = array( |
|
601 | 601 | 'label' => $val['label'], |
602 | 602 | 'checked' => (($visible < 0) ? 0 : 1), |
603 | 603 | 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), |
@@ -627,9 +627,9 @@ discard block |
||
627 | 627 | // -------------------------------------------------------------------- |
628 | 628 | $sql = 'SELECT '; |
629 | 629 | $sql .= $objectline->getFieldList('t'); |
630 | - $sql .= " FROM " . MAIN_DB_PREFIX . $objectline->table_element . " as t"; |
|
630 | + $sql .= " FROM ".MAIN_DB_PREFIX.$objectline->table_element." as t"; |
|
631 | 631 | if ($objectline->ismultientitymanaged == 1) { |
632 | - $sql .= " WHERE t.entity IN (" . getEntity($objectline->element) . ")"; |
|
632 | + $sql .= " WHERE t.entity IN (".getEntity($objectline->element).")"; |
|
633 | 633 | } else { |
634 | 634 | $sql .= " WHERE 1 = 1 "; |
635 | 635 | } |
@@ -639,41 +639,41 @@ discard block |
||
639 | 639 | $nbtotalofrecords = $db->num_rows($resql); |
640 | 640 | $num = $db->num_rows($resql); |
641 | 641 | |
642 | - print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">' . "\n"; |
|
642 | + print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n"; |
|
643 | 643 | if ($optioncss != '') { |
644 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
644 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
645 | 645 | } |
646 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
646 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
647 | 647 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
648 | 648 | print '<input type="hidden" name="action" value="list">'; |
649 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
650 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
651 | - print '<input type="hidden" name="page" value="' . $page . '">'; |
|
652 | - print '<input type="hidden" name="contextpage" value="' . $contextpage . '">'; |
|
649 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
650 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
651 | + print '<input type="hidden" name="page" value="'.$page.'">'; |
|
652 | + print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; |
|
653 | 653 | if (!empty($id)) { |
654 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
654 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
655 | 655 | } |
656 | 656 | |
657 | - $param_fk = "&fk_skill=" . $id . "&fk_user_creat=" . (!empty($user->rowid) ? $user->rowid : 0); |
|
658 | - $backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . $id; |
|
657 | + $param_fk = "&fk_skill=".$id."&fk_user_creat=".(!empty($user->rowid) ? $user->rowid : 0); |
|
658 | + $backtopage = dol_buildpath('/hrm/skill_card.php', 1).'?id='.$id; |
|
659 | 659 | $param = ""; |
660 | 660 | $massactionbutton = ""; |
661 | 661 | //$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); |
662 | 662 | |
663 | - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, '', '', 0, 0, 0, 1); |
|
663 | + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, '', '', 0, 0, 0, 1); |
|
664 | 664 | |
665 | 665 | // Add code for pre mass action (confirmation or email presend form) |
666 | 666 | $topicmail = "SendSkilldetRef"; |
667 | 667 | $modelmail = "skilldet"; |
668 | 668 | $objecttmp = new Skilldet($db); |
669 | - $trackid = 'xxxx' . $object->id; |
|
669 | + $trackid = 'xxxx'.$object->id; |
|
670 | 670 | //include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; |
671 | 671 | |
672 | 672 | if ($search_all) { |
673 | 673 | foreach ($fieldstosearchall as $key => $val) { |
674 | 674 | $fieldstosearchall[$key] = $langs->trans($val); |
675 | 675 | } |
676 | - print '<div class="divsearchfieldfilter">' . $langs->trans("FilterOnInto", $search_all) . implode(', ', $fieldstosearchall) . '</div>'; |
|
676 | + print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>'; |
|
677 | 677 | } |
678 | 678 | |
679 | 679 | $moreforfilter = ''; |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | // $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
701 | 701 | |
702 | 702 | print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table |
703 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
703 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
704 | 704 | |
705 | 705 | |
706 | 706 | // Fields title label |
@@ -717,13 +717,13 @@ discard block |
||
717 | 717 | // } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
718 | 718 | // $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
719 | 719 | // } |
720 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
721 | - print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, (!empty($cssforfield) ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield . ' ' : '')) . "\n"; |
|
720 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
721 | + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, (!empty($cssforfield) ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield.' ' : ''))."\n"; |
|
722 | 722 | } |
723 | 723 | } |
724 | 724 | //print '<td></td>'; |
725 | 725 | print '<td></td>'; |
726 | - print '</tr>' . "\n"; |
|
726 | + print '</tr>'."\n"; |
|
727 | 727 | |
728 | 728 | |
729 | 729 | // Display all ranks of skill |
@@ -766,14 +766,14 @@ discard block |
||
766 | 766 | // } |
767 | 767 | //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; |
768 | 768 | |
769 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
770 | - print '<td' . (empty($cssforfield) ? '' : ' class="' . $cssforfield . '"') . '>'; |
|
769 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
770 | + print '<td'.(empty($cssforfield) ? '' : ' class="'.$cssforfield.'"').'>'; |
|
771 | 771 | if ($key == 'status') { |
772 | 772 | print $objectline->getLibStatut(5); |
773 | 773 | } elseif ($key == 'rowid') { |
774 | 774 | print $objectline->showOutputField($val, $key, $objectline->id, ''); |
775 | 775 | // ajout pencil |
776 | - 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>'; |
|
776 | + 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>'; |
|
777 | 777 | } else { |
778 | 778 | print $objectline->showOutputField($val, $key, $objectline->$key, ''); |
779 | 779 | } |
@@ -785,15 +785,15 @@ discard block |
||
785 | 785 | } |
786 | 786 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
787 | 787 | if (!$i) { |
788 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
788 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
789 | 789 | } |
790 | 790 | if (!isset($totalarray['val'])) { |
791 | 791 | $totalarray['val'] = array(); |
792 | 792 | } |
793 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
794 | - $totalarray['val']['t.' . $key] = 0; |
|
793 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
794 | + $totalarray['val']['t.'.$key] = 0; |
|
795 | 795 | } |
796 | - $totalarray['val']['t.' . $key] += $objectline->$key; |
|
796 | + $totalarray['val']['t.'.$key] += $objectline->$key; |
|
797 | 797 | } |
798 | 798 | } |
799 | 799 | } |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | $totalarray['nbfield']++; |
827 | 827 | } |
828 | 828 | |
829 | - print '</tr>' . "\n"; |
|
829 | + print '</tr>'."\n"; |
|
830 | 830 | |
831 | 831 | $i++; |
832 | 832 | } |
@@ -841,7 +841,7 @@ discard block |
||
841 | 841 | $colspan++; |
842 | 842 | } |
843 | 843 | } |
844 | - print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
844 | + print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
845 | 845 | } |
846 | 846 | |
847 | 847 | if (!empty($resql)) { |
@@ -852,10 +852,10 @@ discard block |
||
852 | 852 | $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $objectline); // Note that $action and $objectline may have been modified by hook |
853 | 853 | print $hookmanager->resPrint; |
854 | 854 | |
855 | - print '</table>' . "\n"; |
|
856 | - print '</div>' . "\n"; |
|
855 | + print '</table>'."\n"; |
|
856 | + print '</div>'."\n"; |
|
857 | 857 | |
858 | - print '</form>' . "\n"; |
|
858 | + print '</form>'."\n"; |
|
859 | 859 | |
860 | 860 | // if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { |
861 | 861 | // $hidegeneratedfilelistifempty = 1; |
@@ -890,9 +890,9 @@ discard block |
||
890 | 890 | $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/skill_agenda.php?id='.$object->id); |
891 | 891 | |
892 | 892 | // List of actions on element |
893 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
893 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; |
|
894 | 894 | $formactions = new FormActions($db); |
895 | - $somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
895 | + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
896 | 896 | |
897 | 897 | print '</div></div>'; |
898 | 898 | } |
@@ -32,15 +32,15 @@ discard block |
||
32 | 32 | // Load Dolibarr environment |
33 | 33 | require '../main.inc.php'; |
34 | 34 | |
35 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
39 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
40 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; |
|
41 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php'; |
|
42 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; |
|
43 | -require_once DOL_DOCUMENT_ROOT .'/hrm/class/evaluation.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
39 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
40 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php'; |
|
41 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php'; |
|
42 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php'; |
|
43 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php'; |
|
44 | 44 | require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_evaluation.lib.php'; |
45 | 45 | |
46 | 46 | // Load translation files required by the page |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $hookmanager->initHooks(array('skilltab', 'globalcard')); // Note that conf->hooks_modules contains array |
82 | 82 | |
83 | 83 | // Load object |
84 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. |
|
84 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. |
|
85 | 85 | if (method_exists($object, 'loadPersonalConf')) { |
86 | 86 | $object->loadPersonalConf(); |
87 | 87 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
123 | 123 | $backtopage = $backurlforlist; |
124 | 124 | } else { |
125 | - $backtopage = DOL_URL_ROOT.'/hrm/skill_list.php?id=' . ($id > 0 ? $id : '__ID__'); |
|
125 | + $backtopage = DOL_URL_ROOT.'/hrm/skill_list.php?id='.($id > 0 ? $id : '__ID__'); |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | } |
176 | 176 | setEventMessages($langs->trans("SaveLevelSkill"), null); |
177 | - header("Location: " . DOL_URL_ROOT.'/hrm/skill_tab.php?id=' . $id. '&objecttype=job'); |
|
177 | + header("Location: ".DOL_URL_ROOT.'/hrm/skill_tab.php?id='.$id.'&objecttype=job'); |
|
178 | 178 | exit; |
179 | 179 | } |
180 | 180 | } elseif ($action == 'confirm_deleteskill' && $confirm == 'yes' && $permissiontoadd) { |
@@ -207,11 +207,11 @@ discard block |
||
207 | 207 | |
208 | 208 | // view configuration |
209 | 209 | if ($objecttype == 'job') { |
210 | - require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
210 | + require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
211 | 211 | $head = jobPrepareHead($object); |
212 | 212 | $listLink = dol_buildpath('/hrm/job_list.php', 1); |
213 | 213 | } elseif ($objecttype == "user") { |
214 | - require_once DOL_DOCUMENT_ROOT . "/core/lib/usergroups.lib.php"; |
|
214 | + require_once DOL_DOCUMENT_ROOT."/core/lib/usergroups.lib.php"; |
|
215 | 215 | $object->getRights(); |
216 | 216 | $head = user_prepare_head($object); |
217 | 217 | $listLink = dol_buildpath('/user/list.php', 1); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | // Confirmation to delete |
225 | 225 | // Confirmation to delete line |
226 | 226 | if ($action == 'ask_deleteskill') { |
227 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&objecttype=' . $objecttype . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteskill', '', 0, 1); |
|
227 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&objecttype='.$objecttype.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteskill', '', 0, 1); |
|
228 | 228 | } |
229 | 229 | // Clone confirmation |
230 | 230 | /*if ($action == 'clone' && $permissiontoadd) { |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | // Object card |
250 | 250 | // ------------------------------------------------------------ |
251 | 251 | if ($objecttype == 'job') { |
252 | - $linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
252 | + $linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
253 | 253 | |
254 | 254 | $morehtmlref = '<div class="refid">'; |
255 | 255 | $morehtmlref .= $object->label; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | |
258 | 258 | dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); |
259 | 259 | } elseif ($listLink !== null) { |
260 | - $linkback = '<a href="' . $listLink . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
260 | + $linkback = '<a href="'.$listLink.'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
261 | 261 | |
262 | 262 | $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'&output=file&file='.urlencode(dol_sanitizeFileName($object->getFullName($langs).'.vcf')).'" class="refid" rel="noopener">'; |
263 | 263 | $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); |
@@ -314,10 +314,10 @@ discard block |
||
314 | 314 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
315 | 315 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
316 | 316 | $object->fields['label']['visible'] = 0; // Already in banner |
317 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
317 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
318 | 318 | |
319 | 319 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
320 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
320 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
321 | 321 | } else { |
322 | 322 | // Login |
323 | 323 | print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>'; |
@@ -383,19 +383,19 @@ discard block |
||
383 | 383 | if ($objecttype != 'user' && $permissiontoadd) { |
384 | 384 | // form to add new skills |
385 | 385 | print '<br>'; |
386 | - print '<form name="addSkill" method="post" action="' . $_SERVER['PHP_SELF'] . '">'; |
|
387 | - print '<input type="hidden" name="objecttype" value="' . $objecttype . '">'; |
|
388 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
386 | + print '<form name="addSkill" method="post" action="'.$_SERVER['PHP_SELF'].'">'; |
|
387 | + print '<input type="hidden" name="objecttype" value="'.$objecttype.'">'; |
|
388 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
389 | 389 | print '<input type="hidden" name="action" value="addSkill">'; |
390 | 390 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
391 | 391 | print '<div class="div-table-responsive-no-min">'; |
392 | 392 | print '<table id="tablelines" class="noborder noshadow" width="100%">'; |
393 | - print '<tr><td style="width:90%">' . $langs->trans('AddSkill') . '</td><td style="width:10%"></td></tr>'; |
|
393 | + print '<tr><td style="width:90%">'.$langs->trans('AddSkill').'</td><td style="width:10%"></td></tr>'; |
|
394 | 394 | print '<tr>'; |
395 | 395 | print '<td>'; |
396 | 396 | print img_picto('', 'shapes', 'class="pictofixedwidth"'); |
397 | - print $form->multiselectarray('fk_skill', array_diff_key($TAllSkillsFormatted, $TAlreadyUsedSkill), array(), 0, 0, 'widthcentpercentminusx') . '</td>'; |
|
398 | - print '<td><input class="button reposition" type="submit" value="' . $langs->trans('Add') . '"></td>'; |
|
397 | + print $form->multiselectarray('fk_skill', array_diff_key($TAllSkillsFormatted, $TAlreadyUsedSkill), array(), 0, 0, 'widthcentpercentminusx').'</td>'; |
|
398 | + print '<td><input class="button reposition" type="submit" value="'.$langs->trans('Add').'"></td>'; |
|
399 | 399 | print '</tr>'; |
400 | 400 | print '</table>'; |
401 | 401 | print '</div>'; |
@@ -406,9 +406,9 @@ discard block |
||
406 | 406 | print '<div class="clearboth"></div>'; |
407 | 407 | |
408 | 408 | if ($objecttype != 'user' && $permissiontoadd) { |
409 | - print '<form name="saveSkill" method="post" action="' . $_SERVER['PHP_SELF'] . '">'; |
|
410 | - print '<input type="hidden" name="objecttype" value="' . $objecttype . '">'; |
|
411 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
409 | + print '<form name="saveSkill" method="post" action="'.$_SERVER['PHP_SELF'].'">'; |
|
410 | + print '<input type="hidden" name="objecttype" value="'.$objecttype.'">'; |
|
411 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
412 | 412 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
413 | 413 | print '<input type="hidden" name="action" value="saveSkill">'; |
414 | 414 | } |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | } |
427 | 427 | print '</tr>'; |
428 | 428 | if (!is_array($TSkillsJob) || empty($TSkillsJob)) { |
429 | - print '<tr><td><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
429 | + print '<tr><td><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
430 | 430 | } else { |
431 | 431 | $sk = new Skill($db); |
432 | 432 | foreach ($TSkillsJob as $skillElement) { |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | if ($objecttype != 'user' && $permissiontoadd) { |
446 | 446 | print '<td class="linecoledit"></td>'; |
447 | 447 | print '<td class="linecoldelete">'; |
448 | - print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $skillElement->fk_object . '&objecttype=' . $objecttype . '&action=ask_deleteskill&lineid=' . $skillElement->rowid . '">'; |
|
448 | + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$skillElement->fk_object.'&objecttype='.$objecttype.'&action=ask_deleteskill&lineid='.$skillElement->rowid.'">'; |
|
449 | 449 | print img_delete(); |
450 | 450 | print '</a>'; |
451 | 451 | } |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | |
457 | 457 | print '</table>'; |
458 | 458 | if ($objecttype != 'user' && $permissiontoadd) { |
459 | - print '<td><input class="button pull-right" type="submit" value="' . $langs->trans('SaveRank') . '"></td>'; |
|
459 | + print '<td><input class="button pull-right" type="submit" value="'.$langs->trans('SaveRank').'"></td>'; |
|
460 | 460 | } |
461 | 461 | print '</div>'; |
462 | 462 | if ($objecttype != 'user' && $permissiontoadd) { |
@@ -496,10 +496,10 @@ discard block |
||
496 | 496 | print '<th>'.$langs->trans('Description').'</th>'; |
497 | 497 | print '<th>'.$langs->trans('DateEval').'</th>'; |
498 | 498 | print '<th>'.$langs->trans('Status').'</th>'; |
499 | - print '<th>'.$langs->trans("Result").' ' .$form->textwithpicto('', GetLegendSkills(), 1) .'</th>'; |
|
499 | + print '<th>'.$langs->trans("Result").' '.$form->textwithpicto('', GetLegendSkills(), 1).'</th>'; |
|
500 | 500 | print '</tr>'; |
501 | 501 | if (!$resql) { |
502 | - print '<tr><td><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
502 | + print '<tr><td><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
503 | 503 | } else { |
504 | 504 | $i = 0; |
505 | 505 | $sameRef = array(); |
@@ -118,10 +118,10 @@ discard block |
||
118 | 118 | |
119 | 119 | if (!$error) { |
120 | 120 | setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); |
121 | - $action = ''; // To avoid to execute next actions |
|
121 | + $action = ''; // To avoid to execute next actions |
|
122 | 122 | } else { |
123 | 123 | setEventMessages($langs->trans("Error"), null, 'errors'); |
124 | - $action = ''; // To avoid to execute next actions |
|
124 | + $action = ''; // To avoid to execute next actions |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | |
137 | 137 | if (!$error) { |
138 | 138 | setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); |
139 | - $action = ''; // To avoid to execute next actions |
|
139 | + $action = ''; // To avoid to execute next actions |
|
140 | 140 | } else { |
141 | 141 | setEventMessages($langs->trans("Error"), null, 'errors'); |
142 | - $action = ''; // To avoid to execute next actions |
|
142 | + $action = ''; // To avoid to execute next actions |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | if (isModEnabled('accounting')) { |
346 | 346 | print $formaccounting->select_account($conf->global->DONATION_ACCOUNTINGACCOUNT, 'DONATION_ACCOUNTINGACCOUNT', 1, array(), 1, 1); |
347 | 347 | } else { |
348 | - print '<input type="text" size="10" id="DONATION_ACCOUNTINGACCOUNT" name="DONATION_ACCOUNTINGACCOUNT" value="' . getDolGlobalString('DONATION_ACCOUNTINGACCOUNT').'">'; |
|
348 | + print '<input type="text" size="10" id="DONATION_ACCOUNTINGACCOUNT" name="DONATION_ACCOUNTINGACCOUNT" value="'.getDolGlobalString('DONATION_ACCOUNTINGACCOUNT').'">'; |
|
349 | 349 | } |
350 | 350 | print '</td><td class="center">'; |
351 | 351 | print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />'; |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | |
359 | 359 | print '<tr class="oddeven"><td colspan="2">'; |
360 | 360 | print $langs->trans("FreeTextOnDonations").' '.img_info($langs->trans("AddCRIfTooLong")).'<br>'; |
361 | -print '<textarea name="DONATION_MESSAGE" class="flat" cols="80">' . getDolGlobalString('DONATION_MESSAGE').'</textarea>'; |
|
361 | +print '<textarea name="DONATION_MESSAGE" class="flat" cols="80">'.getDolGlobalString('DONATION_MESSAGE').'</textarea>'; |
|
362 | 362 | print '</td><td class="center">'; |
363 | 363 | print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />'; |
364 | 364 | print "</td></tr>\n"; |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | |
31 | 31 | // Load Dolibarr environment |
32 | 32 | require '../../main.inc.php'; |
33 | -require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/tva.class.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/tva.class.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/paymentvat.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/salaries/class/paymentsalary.class.php'; |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
39 | 39 | |
40 | 40 | // Load translation files required by the page |
41 | 41 | $langs->loadLangs(array('compta', 'bills')); |
@@ -91,22 +91,22 @@ discard block |
||
91 | 91 | |
92 | 92 | $param = ''; |
93 | 93 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
94 | - $param .= '&contextpage=' . $contextpage; |
|
94 | + $param .= '&contextpage='.$contextpage; |
|
95 | 95 | } |
96 | 96 | if ($limit > 0 && $limit != $conf->liste_limit) { |
97 | - $param .= '&limit=' . $limit; |
|
97 | + $param .= '&limit='.$limit; |
|
98 | 98 | } |
99 | 99 | if ($sortfield) { |
100 | - $param .= '&sortfield=' . $sortfield; |
|
100 | + $param .= '&sortfield='.$sortfield; |
|
101 | 101 | } |
102 | 102 | if ($sortorder) { |
103 | - $param .= '&sortorder=' . $sortorder; |
|
103 | + $param .= '&sortorder='.$sortorder; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | $center = ''; |
107 | 107 | |
108 | 108 | if ($year) { |
109 | - $param .= '&year=' . $year; |
|
109 | + $param .= '&year='.$year; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | $sql = "SELECT tva.rowid, tva.label as label, b.fk_account, ptva.fk_bank"; |
@@ -114,19 +114,19 @@ discard block |
||
114 | 114 | $sql .= ", tva.amount as total,"; |
115 | 115 | $sql .= " ptva.rowid as pid, ptva.datep, ptva.amount as totalpaid, ptva.num_paiement as num_payment,"; |
116 | 116 | $sql .= " pct.code as payment_code"; |
117 | -$sql .= " FROM " . MAIN_DB_PREFIX . "tva as tva,"; |
|
118 | -$sql .= " " . MAIN_DB_PREFIX . "payment_vat as ptva"; |
|
119 | -$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "bank as b ON (b.rowid = ptva.fk_bank)"; |
|
120 | -$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_account as bank ON (bank.rowid = b.fk_account)"; |
|
121 | -$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_paiement as pct ON ptva.fk_typepaiement = pct.id"; |
|
117 | +$sql .= " FROM ".MAIN_DB_PREFIX."tva as tva,"; |
|
118 | +$sql .= " ".MAIN_DB_PREFIX."payment_vat as ptva"; |
|
119 | +$sql .= " INNER JOIN ".MAIN_DB_PREFIX."bank as b ON (b.rowid = ptva.fk_bank)"; |
|
120 | +$sql .= " INNER JOIN ".MAIN_DB_PREFIX."bank_account as bank ON (bank.rowid = b.fk_account)"; |
|
121 | +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON ptva.fk_typepaiement = pct.id"; |
|
122 | 122 | $sql .= " WHERE ptva.fk_tva = tva.rowid"; |
123 | -$sql .= " AND tva.entity = " . $conf->entity; |
|
123 | +$sql .= " AND tva.entity = ".$conf->entity; |
|
124 | 124 | if ($year > 0) { |
125 | 125 | $sql .= " AND ("; |
126 | 126 | // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, |
127 | 127 | // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire |
128 | - $sql .= " (tva.datev IS NOT NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')"; |
|
129 | - $sql .= " OR (tva.datev IS NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')"; |
|
128 | + $sql .= " (tva.datev IS NOT NULL AND tva.datev between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; |
|
129 | + $sql .= " OR (tva.datev IS NULL AND tva.datev between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; |
|
130 | 130 | $sql .= ")"; |
131 | 131 | } |
132 | 132 | if (preg_match('/^cs\./', $sortfield) |
@@ -151,16 +151,16 @@ discard block |
||
151 | 151 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $num, 'title_accountancy', 0, '', '', $limit); |
152 | 152 | |
153 | 153 | if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { |
154 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
154 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
155 | 155 | if ($optioncss != '') { |
156 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
156 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
157 | 157 | } |
158 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
158 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
159 | 159 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
160 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
161 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
162 | - print '<input type="hidden" name="page" value="' . $page . '">'; |
|
163 | - print '<input type="hidden" name="mode" value="' . $mode . '">'; |
|
160 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
161 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
162 | + print '<input type="hidden" name="page" value="'.$page.'">'; |
|
163 | + print '<input type="hidden" name="mode" value="'.$mode.'">'; |
|
164 | 164 | |
165 | 165 | print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table |
166 | 166 | print '<table class="noborder centpercent">'; |
@@ -186,19 +186,19 @@ discard block |
||
186 | 186 | $sql .= ", tva.amount as total,"; |
187 | 187 | $sql .= " ptva.rowid as pid, ptva.datep, ptva.amount as totalpaid, ptva.num_paiement as num_payment,"; |
188 | 188 | $sql .= " pct.code as payment_code"; |
189 | - $sql .= " FROM " . MAIN_DB_PREFIX . "tva as tva,"; |
|
190 | - $sql .= " " . MAIN_DB_PREFIX . "payment_vat as ptva"; |
|
191 | - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "bank as b ON (b.rowid = ptva.fk_bank)"; |
|
192 | - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_account as bank ON (bank.rowid = b.fk_account)"; |
|
193 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_paiement as pct ON ptva.fk_typepaiement = pct.id"; |
|
189 | + $sql .= " FROM ".MAIN_DB_PREFIX."tva as tva,"; |
|
190 | + $sql .= " ".MAIN_DB_PREFIX."payment_vat as ptva"; |
|
191 | + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."bank as b ON (b.rowid = ptva.fk_bank)"; |
|
192 | + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."bank_account as bank ON (bank.rowid = b.fk_account)"; |
|
193 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON ptva.fk_typepaiement = pct.id"; |
|
194 | 194 | $sql .= " WHERE ptva.fk_tva = tva.rowid"; |
195 | - $sql .= " AND tva.entity = " . $conf->entity; |
|
195 | + $sql .= " AND tva.entity = ".$conf->entity; |
|
196 | 196 | if ($year > 0) { |
197 | 197 | $sql .= " AND ("; |
198 | 198 | // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, |
199 | 199 | // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire |
200 | - $sql .= " (tva.datev IS NOT NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')"; |
|
201 | - $sql .= " OR (tva.datev IS NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')"; |
|
200 | + $sql .= " (tva.datev IS NOT NULL AND tva.datev between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; |
|
201 | + $sql .= " OR (tva.datev IS NULL AND tva.datev between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; |
|
202 | 202 | $sql .= ")"; |
203 | 203 | } |
204 | 204 | if ($sortfield !== null |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | print '<tr class="oddeven">'; |
228 | 228 | |
229 | 229 | // Ref payment |
230 | - print '<td>' . $payment_vat_static->getNomUrl(1) . "</td>\n"; |
|
230 | + print '<td>'.$payment_vat_static->getNomUrl(1)."</td>\n"; |
|
231 | 231 | |
232 | 232 | // VAT |
233 | 233 | print '<td>'; |
@@ -235,28 +235,28 @@ discard block |
||
235 | 235 | print '</td>'; |
236 | 236 | |
237 | 237 | // Label |
238 | - print '<td class="tdoverflowmax150" title="' . dol_escape_htmltag($obj->label) . '">' . dol_escape_htmltag($obj->label) . '</td>'; |
|
238 | + print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->label).'">'.dol_escape_htmltag($obj->label).'</td>'; |
|
239 | 239 | |
240 | 240 | // Date |
241 | 241 | $date = $db->jdate($obj->datev); |
242 | - print '<td class="center nowraponall">' . dol_print_date($date, 'day') . '</td>'; |
|
242 | + print '<td class="center nowraponall">'.dol_print_date($date, 'day').'</td>'; |
|
243 | 243 | |
244 | 244 | // Date payment |
245 | 245 | $datep = $db->jdate($obj->datep); |
246 | - print '<td class="center nowraponall">' . dol_print_date($datep, 'day') . '</td>'; |
|
246 | + print '<td class="center nowraponall">'.dol_print_date($datep, 'day').'</td>'; |
|
247 | 247 | |
248 | 248 | // Type payment |
249 | 249 | $labelpaymenttype = ''; |
250 | 250 | if ($obj->payment_code) { |
251 | - $labelpaymenttype = $langs->trans("PaymentTypeShort" . $obj->payment_code) . ' '; |
|
251 | + $labelpaymenttype = $langs->trans("PaymentTypeShort".$obj->payment_code).' '; |
|
252 | 252 | } |
253 | 253 | |
254 | - print '<td class="tdoverflowmax100" title="' . dol_escape_htmltag($labelpaymenttype) . '">'; |
|
254 | + print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($labelpaymenttype).'">'; |
|
255 | 255 | print dol_escape_htmltag($labelpaymenttype); |
256 | 256 | print '</td>'; |
257 | 257 | |
258 | 258 | // Chq number |
259 | - print '<td>' . dol_escape_htmltag($obj->num_payment) . '</td>'; |
|
259 | + print '<td>'.dol_escape_htmltag($obj->num_payment).'</td>'; |
|
260 | 260 | |
261 | 261 | if (isModEnabled("bank")) { |
262 | 262 | // Bank transaction |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | } |
275 | 275 | |
276 | 276 | // Expected to pay |
277 | - print '<td class="right"><span class="amount">' . price($obj->total) . '</span></td>'; |
|
277 | + print '<td class="right"><span class="amount">'.price($obj->total).'</span></td>'; |
|
278 | 278 | |
279 | 279 | // Paid |
280 | 280 | print '<td class="right"><span class="amount">'; |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | } |
291 | 291 | |
292 | 292 | // Total |
293 | - print '<tr class="liste_total"><td colspan="3" class="liste_total">' . $langs->trans("Total") . '</td>'; |
|
293 | + print '<tr class="liste_total"><td colspan="3" class="liste_total">'.$langs->trans("Total").'</td>'; |
|
294 | 294 | print '<td class="liste_total right"></td>'; // A total here has no sense |
295 | 295 | print '<td class="center liste_total"> </td>'; |
296 | 296 | print '<td class="center liste_total"> </td>'; |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | } |
301 | 301 | print '<td class="center liste_total"> </td>'; |
302 | 302 | print '<td class="center liste_total"> </td>'; |
303 | - print '<td class="liste_total right">' . price($totalpaid) . "</td>"; |
|
303 | + print '<td class="liste_total right">'.price($totalpaid)."</td>"; |
|
304 | 304 | print "</tr>"; |
305 | 305 | } |
306 | 306 | print '</table>'; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * \remarks To run this script as CLI: phpunit filename.php |
25 | 25 | */ |
26 | 26 | |
27 | -global $conf,$user,$langs,$db; |
|
27 | +global $conf, $user, $langs, $db; |
|
28 | 28 | //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver |
29 | 29 | //require_once 'PHPUnit/Autoload.php'; |
30 | 30 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
@@ -33,35 +33,35 @@ discard block |
||
33 | 33 | require_once dirname(__FILE__).'/../../htdocs/core/lib/functions2.lib.php'; |
34 | 34 | require_once dirname(__FILE__).'/CommonClassTest.class.php'; |
35 | 35 | |
36 | -if (! defined('NOREQUIREUSER')) { |
|
36 | +if (!defined('NOREQUIREUSER')) { |
|
37 | 37 | define('NOREQUIREUSER', '1'); |
38 | 38 | } |
39 | -if (! defined('NOREQUIREDB')) { |
|
39 | +if (!defined('NOREQUIREDB')) { |
|
40 | 40 | define('NOREQUIREDB', '1'); |
41 | 41 | } |
42 | -if (! defined('NOREQUIRESOC')) { |
|
42 | +if (!defined('NOREQUIRESOC')) { |
|
43 | 43 | define('NOREQUIRESOC', '1'); |
44 | 44 | } |
45 | -if (! defined('NOREQUIRETRAN')) { |
|
45 | +if (!defined('NOREQUIRETRAN')) { |
|
46 | 46 | define('NOREQUIRETRAN', '1'); |
47 | 47 | } |
48 | -if (! defined('NOCSRFCHECK')) { |
|
48 | +if (!defined('NOCSRFCHECK')) { |
|
49 | 49 | define('NOCSRFCHECK', '1'); |
50 | 50 | } |
51 | -if (! defined('NOTOKENRENEWAL')) { |
|
51 | +if (!defined('NOTOKENRENEWAL')) { |
|
52 | 52 | define('NOTOKENRENEWAL', '1'); |
53 | 53 | } |
54 | -if (! defined('NOREQUIREMENU')) { |
|
54 | +if (!defined('NOREQUIREMENU')) { |
|
55 | 55 | define('NOREQUIREMENU', '1'); // If there is no menu to show |
56 | 56 | } |
57 | -if (! defined('NOREQUIREHTML')) { |
|
57 | +if (!defined('NOREQUIREHTML')) { |
|
58 | 58 | define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php |
59 | 59 | } |
60 | -if (! defined('NOREQUIREAJAX')) { |
|
60 | +if (!defined('NOREQUIREAJAX')) { |
|
61 | 61 | define('NOREQUIREAJAX', '1'); |
62 | 62 | } |
63 | -if (! defined("NOLOGIN")) { |
|
64 | - define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
63 | +if (!defined("NOLOGIN")) { |
|
64 | + define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
@@ -81,15 +81,15 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function testExportCsvUtf() |
83 | 83 | { |
84 | - global $conf,$user,$langs,$db; |
|
84 | + global $conf, $user, $langs, $db; |
|
85 | 85 | |
86 | 86 | $model = 'csvutf8'; |
87 | 87 | |
88 | 88 | $conf->global->EXPORT_CSV_SEPARATOR_TO_USE = ','; |
89 | - print 'EXPORT_CSV_SEPARATOR_TO_USE = ' . getDolGlobalString('EXPORT_CSV_SEPARATOR_TO_USE'); |
|
89 | + print 'EXPORT_CSV_SEPARATOR_TO_USE = '.getDolGlobalString('EXPORT_CSV_SEPARATOR_TO_USE'); |
|
90 | 90 | |
91 | 91 | // Creation of class to export using model ExportXXX |
92 | - $dir = DOL_DOCUMENT_ROOT . "/core/modules/export/"; |
|
92 | + $dir = DOL_DOCUMENT_ROOT."/core/modules/export/"; |
|
93 | 93 | $file = "export_".$model.".modules.php"; |
94 | 94 | $classname = "Export".$model; |
95 | 95 | require_once $dir.$file; |
@@ -170,15 +170,15 @@ discard block |
||
170 | 170 | */ |
171 | 171 | public function testExportOther() |
172 | 172 | { |
173 | - global $conf,$user,$langs,$db; |
|
173 | + global $conf, $user, $langs, $db; |
|
174 | 174 | |
175 | 175 | $model = 'csviso'; |
176 | 176 | |
177 | 177 | $conf->global->EXPORT_CSV_SEPARATOR_TO_USE = ','; |
178 | - print 'EXPORT_CSV_SEPARATOR_TO_USE = ' . getDolGlobalString('EXPORT_CSV_SEPARATOR_TO_USE'); |
|
178 | + print 'EXPORT_CSV_SEPARATOR_TO_USE = '.getDolGlobalString('EXPORT_CSV_SEPARATOR_TO_USE'); |
|
179 | 179 | |
180 | 180 | // Creation of class to export using model ExportXXX |
181 | - $dir = DOL_DOCUMENT_ROOT . "/core/modules/export/"; |
|
181 | + $dir = DOL_DOCUMENT_ROOT."/core/modules/export/"; |
|
182 | 182 | $file = "export_".$model.".modules.php"; |
183 | 183 | $classname = "Export".$model; |
184 | 184 | require_once $dir.$file; |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | */ |
260 | 260 | public function testExportPersonalizedExport() |
261 | 261 | { |
262 | - global $conf,$user,$langs,$db; |
|
262 | + global $conf, $user, $langs, $db; |
|
263 | 263 | |
264 | 264 | $sql = "SELECT f.ref as f_ref, f.total_ht as f_total, f.total_tva as f_tva FROM ".MAIN_DB_PREFIX."facture f"; |
265 | 265 | |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | */ |
321 | 321 | public function testExportPersonalizedWithFilter() |
322 | 322 | { |
323 | - global $conf,$user,$langs,$db; |
|
323 | + global $conf, $user, $langs, $db; |
|
324 | 324 | /* |
325 | 325 | $sql = "SELECT f.ref as f_ref, f.total_ht as f_total_ht, f.total_tva as f_total_tva FROM ".MAIN_DB_PREFIX."facture f"; |
326 | 326 | |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | */ |
373 | 373 | public function testExportModulesDatasets() |
374 | 374 | { |
375 | - global $conf,$user,$langs,$db; |
|
375 | + global $conf, $user, $langs, $db; |
|
376 | 376 | |
377 | 377 | $model = 'csviso'; |
378 | 378 | |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | |
383 | 383 | // Load properties of arrays to make export |
384 | 384 | $objexport = new Export($db); |
385 | - $result = $objexport->load_arrays($user, $filterdatatoexport); // This load ->array_export_xxx properties for datatoexport |
|
385 | + $result = $objexport->load_arrays($user, $filterdatatoexport); // This load ->array_export_xxx properties for datatoexport |
|
386 | 386 | |
387 | 387 | // Loop on each dataset |
388 | 388 | foreach ($objexport->array_export_code as $key => $datatoexport) { |