@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | if ($object->dao->close($user)) { |
| 173 | 173 | setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs'); |
| 174 | 174 | |
| 175 | - $url = 'view.php?action=view_ticket&track_id='.GETPOST('track_id', 'alpha').(!empty($entity) && isModEnabled('multicompany')?'&entity='.$entity:'').'&token='.newToken(); |
|
| 175 | + $url = 'view.php?action=view_ticket&track_id='.GETPOST('track_id', 'alpha').(!empty($entity) && isModEnabled('multicompany') ? '&entity='.$entity : '').'&token='.newToken(); |
|
| 176 | 176 | header("Location: ".$url); |
| 177 | 177 | exit; |
| 178 | 178 | } else { |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | // Confirmation close |
| 248 | 248 | if ($action == 'close') { |
| 249 | - print $form->formconfirm($_SERVER["PHP_SELF"]."?track_id=".$track_id.(!empty($entity) && isModEnabled('multicompany')?'&entity='.$entity:''), $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_public_close", '', '', 1); |
|
| 249 | + print $form->formconfirm($_SERVER["PHP_SELF"]."?track_id=".$track_id.(!empty($entity) && isModEnabled('multicompany') ? '&entity='.$entity : ''), $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_public_close", '', '', 1); |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | print '<div id="form_view_ticket" class="margintoponly">'; |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | $formticket->trackid = 'tic'.$object->dao->id; |
| 391 | 391 | |
| 392 | 392 | $formticket->param = array('track_id' => $object->dao->track_id, 'fk_user_create' => '-1', |
| 393 | - 'returnurl' => DOL_URL_ROOT.'/public/ticket/view.php'.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'')); |
|
| 393 | + 'returnurl' => DOL_URL_ROOT.'/public/ticket/view.php'.(!empty($entity) && isModEnabled('multicompany') ? '?entity='.$entity : '')); |
|
| 394 | 394 | |
| 395 | 395 | $formticket->withfile = 2; |
| 396 | 396 | $formticket->withcancel = 1; |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | if ($action != 'presend') { |
| 402 | - print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" action="'.DOL_URL_ROOT.'/public/ticket/list.php'.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'">'; |
|
| 402 | + print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" action="'.DOL_URL_ROOT.'/public/ticket/list.php'.(!empty($entity) && isModEnabled('multicompany') ? '?entity='.$entity : '').'">'; |
|
| 403 | 403 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 404 | 404 | print '<input type="hidden" name="action" value="view_ticketlist">'; |
| 405 | 405 | print '<input type="hidden" name="track_id" value="'.$object->dao->track_id.'">'; |
@@ -414,11 +414,11 @@ discard block |
||
| 414 | 414 | |
| 415 | 415 | if ($object->dao->fk_statut < Ticket::STATUS_CLOSED) { |
| 416 | 416 | // New message |
| 417 | - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=presend&mode=init&track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany')?'&entity='.$entity:'').'&token='.newToken().'">'.$langs->trans('TicketAddMessage').'</a></div>'; |
|
| 417 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=presend&mode=init&track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany') ? '&entity='.$entity : '').'&token='.newToken().'">'.$langs->trans('TicketAddMessage').'</a></div>'; |
|
| 418 | 418 | |
| 419 | 419 | // Close ticket |
| 420 | 420 | if ($object->dao->fk_statut >= Ticket::STATUS_NOT_READ && $object->dao->fk_statut < Ticket::STATUS_CLOSED) { |
| 421 | - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=close&track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany')?'&entity='.$entity:'').'&token='.newToken().'">'.$langs->trans('CloseTicket').'</a></div>'; |
|
| 421 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=close&track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany') ? '&entity='.$entity : '').'&token='.newToken().'">'.$langs->trans('CloseTicket').'</a></div>'; |
|
| 422 | 422 | } |
| 423 | 423 | } |
| 424 | 424 | |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | print '<!-- public view ticket -->'; |
| 438 | 438 | print '<div class="ticketpublicarea ticketlargemargin centpercent">'; |
| 439 | 439 | |
| 440 | - print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'" rel="nofollow noopener">'.$langs->trans('Back').'</a></div>'; |
|
| 440 | + print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany') ? '?entity='.$entity : '').'" rel="nofollow noopener">'.$langs->trans('Back').'</a></div>'; |
|
| 441 | 441 | |
| 442 | 442 | print '</div>'; |
| 443 | 443 | } |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | print '<div class="center opacitymedium margintoponly marginbottomonly ticketlargemargin">'.$langs->trans("TicketPublicMsgViewLogIn").'</div>'; |
| 449 | 449 | |
| 450 | 450 | print '<div id="form_view_ticket">'; |
| 451 | - print '<form method="post" name="form_view_ticket" action="'.$_SERVER['PHP_SELF'].(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'">'; |
|
| 451 | + print '<form method="post" name="form_view_ticket" action="'.$_SERVER['PHP_SELF'].(!empty($entity) && isModEnabled('multicompany') ? '?entity='.$entity : '').'">'; |
|
| 452 | 452 | |
| 453 | 453 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 454 | 454 | print '<input type="hidden" name="action" value="view_ticket">'; |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | if ($line->fk_product) { |
| 712 | 712 | $spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - strlen($line->subprice) - 10 - 1; |
| 713 | 713 | $spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0); |
| 714 | - $this->printer->text($line->ref . $spaces . $line->qty . str_pad(price($line->subprice), 10, ' ', STR_PAD_LEFT) . ' ' . str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT) . "\n"); |
|
| 714 | + $this->printer->text($line->ref.$spaces.$line->qty.str_pad(price($line->subprice), 10, ' ', STR_PAD_LEFT).' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n"); |
|
| 715 | 715 | $this->printer->text(strip_tags(htmlspecialchars_decode($line->product_label))."\n \n"); |
| 716 | 716 | } else { |
| 717 | 717 | $spacestoadd = $nbcharactbyline - strlen($line->description) - strlen($line->qty) - strlen($line->subprice) - 10 - 1; |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | $this->printer->text($title.$spaces.str_pad(price($object->total_ttc), 10, ' ', STR_PAD_LEFT)."\n"); |
| 781 | 781 | break; |
| 782 | 782 | case 'DOL_PRINT_CURR_DATE': |
| 783 | - if (strlen($vals[$tplline]['value'])<2) $this->printer->text(date('d/m/Y H:i:s')."\n"); |
|
| 783 | + if (strlen($vals[$tplline]['value']) < 2) $this->printer->text(date('d/m/Y H:i:s')."\n"); |
|
| 784 | 784 | else $this->printer->text(date($vals[$tplline]['value'])."\n"); |
| 785 | 785 | break; |
| 786 | 786 | case 'DOL_LINE_FEED': |
@@ -870,7 +870,7 @@ discard block |
||
| 870 | 870 | $this->printer->getPrintConnector() -> write("\x1e"); |
| 871 | 871 | break; |
| 872 | 872 | case 'DOL_BEEP_ALTERNATIVE': //if DOL_BEEP not works |
| 873 | - $this->printer->getPrintConnector() -> write(Printer::ESC . "B" . chr(4) . chr(1)); |
|
| 873 | + $this->printer->getPrintConnector() -> write(Printer::ESC."B".chr(4).chr(1)); |
|
| 874 | 874 | break; |
| 875 | 875 | case 'DOL_PRINT_ORDER_LINES': |
| 876 | 876 | foreach ($object->lines as $line) { |
@@ -920,11 +920,11 @@ discard block |
||
| 920 | 920 | } |
| 921 | 921 | break; |
| 922 | 922 | default: |
| 923 | - $parameters = array('vals' => $vals[$tplline],'object' => $object,'nbcharactbyline' => $nbcharactbyline); |
|
| 923 | + $parameters = array('vals' => $vals[$tplline], 'object' => $object, 'nbcharactbyline' => $nbcharactbyline); |
|
| 924 | 924 | $action = ''; |
| 925 | 925 | $reshook = $hookmanager->executeHooks('sendToPrinterAfter', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 926 | 926 | |
| 927 | - if (!$reshook || $reshook < 0 ) { |
|
| 927 | + if (!$reshook || $reshook < 0) { |
|
| 928 | 928 | $this->printer->text($vals[$tplline]['tag']); |
| 929 | 929 | $this->printer->text($vals[$tplline]['value']); |
| 930 | 930 | $this->errors[] = 'UnknowTag: <'.strtolower($vals[$tplline]['tag']).'>'; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | public $liste_limit; |
| 121 | 121 | |
| 122 | - public $tzuserinputkey = 'tzserver'; // Use 'tzuserrel' to always store date in GMT and show date in time zone of user. |
|
| 122 | + public $tzuserinputkey = 'tzserver'; // Use 'tzuserrel' to always store date in GMT and show date in time zone of user. |
|
| 123 | 123 | |
| 124 | 124 | |
| 125 | 125 | // TODO Remove this part. |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | $value = $_ENV['DOLIBARR_'.$key]; |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | - $this->global->$key = dolDecrypt($value); // decrypt data excrypted with dolibarr_set_const($db, $name, $value) |
|
| 345 | + $this->global->$key = dolDecrypt($value); // decrypt data excrypted with dolibarr_set_const($db, $name, $value) |
|
| 346 | 346 | |
| 347 | 347 | if ($value && strpos($key, 'MAIN_MODULE_') === 0) { |
| 348 | 348 | $reg = array(); |
@@ -398,9 +398,9 @@ discard block |
||
| 398 | 398 | // deprecated in php 8.2 |
| 399 | 399 | //if (version_compare(phpversion(), '8.2') < 0) { |
| 400 | 400 | if (!isset($this->$modulename) || !is_object($this->$modulename)) { |
| 401 | - $this->$modulename = new stdClass(); // We need this to use the ->enabled and the ->multidir, ->dir... |
|
| 401 | + $this->$modulename = new stdClass(); // We need this to use the ->enabled and the ->multidir, ->dir... |
|
| 402 | 402 | } |
| 403 | - $this->$modulename->enabled = true; // TODO Remove this |
|
| 403 | + $this->$modulename->enabled = true; // TODO Remove this |
|
| 404 | 404 | //} |
| 405 | 405 | } |
| 406 | 406 | } |
@@ -1028,7 +1028,7 @@ discard block |
||
| 1028 | 1028 | } |
| 1029 | 1029 | |
| 1030 | 1030 | if (!empty($this->global->MAIN_TZUSERINPUTKEY)) { |
| 1031 | - $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY; // 'tzserver' or 'tzuserrel' |
|
| 1031 | + $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY; // 'tzserver' or 'tzuserrel' |
|
| 1032 | 1032 | } |
| 1033 | 1033 | |
| 1034 | 1034 | if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) { |
@@ -58,16 +58,16 @@ discard block |
||
| 58 | 58 | public $total_ht; |
| 59 | 59 | public $total_tva; |
| 60 | 60 | public $total_ttc; |
| 61 | - public $amount_ht; // deprecated |
|
| 61 | + public $amount_ht; // deprecated |
|
| 62 | 62 | public $amount_tva; // deprecated |
| 63 | 63 | public $amount_ttc; // deprecated |
| 64 | 64 | |
| 65 | 65 | public $multicurrency_total_ht; |
| 66 | 66 | public $multicurrency_total_tva; |
| 67 | 67 | public $multicurrency_total_ttc; |
| 68 | - public $multicurrency_amount_ht; // deprecated |
|
| 69 | - public $multicurrency_amount_tva; // deprecated |
|
| 70 | - public $multicurrency_amount_ttc; // deprecated |
|
| 68 | + public $multicurrency_amount_ht; // deprecated |
|
| 69 | + public $multicurrency_amount_tva; // deprecated |
|
| 70 | + public $multicurrency_amount_ttc; // deprecated |
|
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * @var double |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | $sql .= " AND fk_invoice_supplier IS NULL)"; // Not used as credit note and not used as deposit |
| 382 | 382 | |
| 383 | 383 | dol_syslog(get_class($this)."::delete Delete discount", LOG_DEBUG); |
| 384 | - require_once DOL_DOCUMENT_ROOT. '/core/class/commoninvoice.class.php'; |
|
| 384 | + require_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php'; |
|
| 385 | 385 | $result = $this->db->query($sql); |
| 386 | 386 | if ($result) { |
| 387 | 387 | // If source of discount was a credit note or deposit, we change source statut. |
@@ -589,12 +589,12 @@ discard block |
||
| 589 | 589 | $sql = "SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount"; |
| 590 | 590 | $sql .= " FROM ".$this->db->prefix()."societe_remise_except as rc, ".$this->db->prefix()."facture as f"; |
| 591 | 591 | $sql .= " WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = ".((int) $invoice->id); |
| 592 | - $sql .= " AND f.type = ". (int) $invoice::TYPE_DEPOSIT; |
|
| 592 | + $sql .= " AND f.type = ".(int) $invoice::TYPE_DEPOSIT; |
|
| 593 | 593 | } elseif ($invoice->element == 'invoice_supplier') { |
| 594 | 594 | $sql = "SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount"; |
| 595 | 595 | $sql .= " FROM ".$this->db->prefix()."societe_remise_except as rc, ".$this->db->prefix()."facture_fourn as f"; |
| 596 | 596 | $sql .= " WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = ".((int) $invoice->id); |
| 597 | - $sql .= " AND f.type = ". (int) $invoice::TYPE_DEPOSIT; |
|
| 597 | + $sql .= " AND f.type = ".(int) $invoice::TYPE_DEPOSIT; |
|
| 598 | 598 | } else { |
| 599 | 599 | $this->error = get_class($this)."::getSumDepositsUsed was called with a bad object as a first parameter"; |
| 600 | 600 | dol_print_error($this->error); |
@@ -101,27 +101,27 @@ discard block |
||
| 101 | 101 | { |
| 102 | 102 | global $langs; |
| 103 | 103 | $legendSkills = '<div style="font-style:italic;"> |
| 104 | - ' . $langs->trans('legend') . ' |
|
| 104 | + ' . $langs->trans('legend').' |
|
| 105 | 105 | <table class="border" width="100%"> |
| 106 | 106 | <tr> |
| 107 | 107 | <td><span style="vertical-align:middle" class="toohappy diffnote little"></span> |
| 108 | - ' . $langs->trans('CompetenceAcquiredByOneOrMore') . '</td> |
|
| 108 | + ' . $langs->trans('CompetenceAcquiredByOneOrMore').'</td> |
|
| 109 | 109 | </tr> |
| 110 | 110 | <tr> |
| 111 | 111 | <td><span style="vertical-align:middle" class="veryhappy diffnote little"></span> |
| 112 | - ' . $langs->trans('MaxlevelGreaterThan') . '</td> |
|
| 112 | + ' . $langs->trans('MaxlevelGreaterThan').'</td> |
|
| 113 | 113 | </tr> |
| 114 | 114 | <tr> |
| 115 | 115 | <td><span style="vertical-align:middle" class="happy diffnote little"></span> |
| 116 | - ' . $langs->trans('MaxLevelEqualTo') . '</td> |
|
| 116 | + ' . $langs->trans('MaxLevelEqualTo').'</td> |
|
| 117 | 117 | </tr> |
| 118 | 118 | <tr> |
| 119 | 119 | <td><span style="vertical-align:middle" class="sad diffnote little"></span> |
| 120 | - ' . $langs->trans('MaxLevelLowerThan') . '</td> |
|
| 120 | + ' . $langs->trans('MaxLevelLowerThan').'</td> |
|
| 121 | 121 | </tr> |
| 122 | 122 | <tr> |
| 123 | 123 | <td><span style="vertical-align:middle" class="toosad diffnote little"></span> |
| 124 | - ' . $langs->trans('SkillNotAcquired') . '</td> |
|
| 124 | + ' . $langs->trans('SkillNotAcquired').'</td> |
|
| 125 | 125 | </tr> |
| 126 | 126 | </table> |
| 127 | 127 | </div>'; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | } elseif ($obj->rankorder < $obj->required_rank) { |
| 158 | 158 | $key = 'lesser'; |
| 159 | 159 | } |
| 160 | - return '<span title="'.strtoupper($obj->label).': ' .$results[$key]['title']. '" class="radio_js_bloc_number TNote_1" style="' . htmlspecialchars($results[$key]['style'], ENT_QUOTES) . '">' . strtoupper(substr($obj->label, 0, 3)) .(strlen($obj->label) > 3 ? '..' : '').'</span>'; |
|
| 160 | + return '<span title="'.strtoupper($obj->label).': '.$results[$key]['title'].'" class="radio_js_bloc_number TNote_1" style="'.htmlspecialchars($results[$key]['style'], ENT_QUOTES).'">'.strtoupper(substr($obj->label, 0, 3)).(strlen($obj->label) > 3 ? '..' : '').'</span>'; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -29,15 +29,15 @@ discard block |
||
| 29 | 29 | // Load Dolibarr environment |
| 30 | 30 | require '../main.inc.php'; |
| 31 | 31 | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
| 33 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
| 34 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 35 | -require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
| 36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
| 37 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; |
|
| 38 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php'; |
|
| 39 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; |
|
| 40 | -require_once DOL_DOCUMENT_ROOT .'/hrm/class/evaluation.class.php'; |
|
| 32 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
| 33 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
| 34 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 35 | +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
| 37 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php'; |
|
| 38 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php'; |
|
| 39 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php'; |
|
| 40 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php'; |
|
| 41 | 41 | require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_evaluation.lib.php'; |
| 42 | 42 | |
| 43 | 43 | // Load translation files required by the page |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $hookmanager->initHooks(array('skilltab', 'globalcard')); // Note that conf->hooks_modules contains array |
| 79 | 79 | |
| 80 | 80 | // Load object |
| 81 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 81 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 82 | 82 | if (method_exists($object, 'loadPersonalConf')) { |
| 83 | 83 | $object->loadPersonalConf(); |
| 84 | 84 | } |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
| 120 | 120 | $backtopage = $backurlforlist; |
| 121 | 121 | } else { |
| 122 | - $backtopage = DOL_URL_ROOT.'/hrm/skill_list.php?id=' . ($id > 0 ? $id : '__ID__'); |
|
| 122 | + $backtopage = DOL_URL_ROOT.'/hrm/skill_list.php?id='.($id > 0 ? $id : '__ID__'); |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | } elseif ($action == 'saveSkill') { |
| 156 | 156 | if (!empty($TNote)) { |
| 157 | 157 | foreach ($TNote as $skillId => $rank) { |
| 158 | - $TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . ((int) $id) . " AND objecttype='" . $db->escape($objecttype) . "' AND fk_skill = " . ((int) $skillId))); |
|
| 158 | + $TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object='.((int) $id)." AND objecttype='".$db->escape($objecttype)."' AND fk_skill = ".((int) $skillId))); |
|
| 159 | 159 | if (is_array($TSkills) && !empty($TSkills)) { |
| 160 | 160 | foreach ($TSkills as $tmpObj) { |
| 161 | 161 | $tmpObj->rankorder = $rank; |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | setEventMessages($langs->trans("SaveLevelSkill"), null); |
| 167 | - header("Location: " . DOL_URL_ROOT.'/hrm/skill_tab.php?id=' . $id. '&objecttype=job'); |
|
| 167 | + header("Location: ".DOL_URL_ROOT.'/hrm/skill_tab.php?id='.$id.'&objecttype=job'); |
|
| 168 | 168 | exit; |
| 169 | 169 | } |
| 170 | 170 | } elseif ($action == 'confirm_deleteskill' && $confirm == 'yes') { |
@@ -195,11 +195,11 @@ discard block |
||
| 195 | 195 | |
| 196 | 196 | // view configuration |
| 197 | 197 | if ($objecttype == 'job') { |
| 198 | - require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
| 198 | + require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
| 199 | 199 | $head = jobPrepareHead($object); |
| 200 | 200 | $listLink = dol_buildpath('/hrm/job_list.php', 1); |
| 201 | 201 | } elseif ($objecttype == "user") { |
| 202 | - require_once DOL_DOCUMENT_ROOT . "/core/lib/usergroups.lib.php"; |
|
| 202 | + require_once DOL_DOCUMENT_ROOT."/core/lib/usergroups.lib.php"; |
|
| 203 | 203 | $object->getRights(); |
| 204 | 204 | $head = user_prepare_head($object); |
| 205 | 205 | $listLink = dol_buildpath('/user/list.php', 1); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | }*/ |
| 216 | 216 | // Confirmation to delete line |
| 217 | 217 | if ($action == 'ask_deleteskill') { |
| 218 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&objecttype=' . $objecttype . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteskill', '', 0, 1); |
|
| 218 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&objecttype='.$objecttype.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteskill', '', 0, 1); |
|
| 219 | 219 | } |
| 220 | 220 | // Clone confirmation |
| 221 | 221 | /*if ($action == 'clone') { |
@@ -240,15 +240,15 @@ discard block |
||
| 240 | 240 | // Object card |
| 241 | 241 | // ------------------------------------------------------------ |
| 242 | 242 | if ($objecttype == 'job') { |
| 243 | - $linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
| 243 | + $linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
| 244 | 244 | |
| 245 | 245 | $morehtmlref = '<div class="refid">'; |
| 246 | - $morehtmlref.= $object->label; |
|
| 246 | + $morehtmlref .= $object->label; |
|
| 247 | 247 | $morehtmlref .= '</div>'; |
| 248 | 248 | |
| 249 | 249 | dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); |
| 250 | 250 | } else { |
| 251 | - $linkback = '<a href="' . $listLink . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
| 251 | + $linkback = '<a href="'.$listLink.'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
| 252 | 252 | |
| 253 | 253 | $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">'; |
| 254 | 254 | $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $TAllSkills = $static_skill->fetchAll(); |
| 266 | 266 | |
| 267 | 267 | // Array format for multiselectarray function |
| 268 | - $TAllSkillsFormatted=array(); |
|
| 268 | + $TAllSkillsFormatted = array(); |
|
| 269 | 269 | if (!empty($TAllSkills)) { |
| 270 | 270 | foreach ($TAllSkills as $k=>$v) { |
| 271 | 271 | $TAllSkillsFormatted[$k] = $v->label; |
@@ -275,12 +275,12 @@ discard block |
||
| 275 | 275 | // table of skillRank linked to current object |
| 276 | 276 | //$TSkillsJob = $skill->fetchAll('ASC', 't.rowid', 0, 0); |
| 277 | 277 | $sql_skill = "SELECT sr.fk_object, sr.rowid, s.label,s.skill_type, sr.rankorder, sr.fk_skill"; |
| 278 | - $sql_skill .=" FROM ".MAIN_DB_PREFIX."hrm_skillrank AS sr"; |
|
| 279 | - $sql_skill .=" JOIN ".MAIN_DB_PREFIX."hrm_skill AS s ON sr.fk_skill = s.rowid"; |
|
| 278 | + $sql_skill .= " FROM ".MAIN_DB_PREFIX."hrm_skillrank AS sr"; |
|
| 279 | + $sql_skill .= " JOIN ".MAIN_DB_PREFIX."hrm_skill AS s ON sr.fk_skill = s.rowid"; |
|
| 280 | 280 | $sql_skill .= " AND sr.fk_object = ".((int) $id); |
| 281 | 281 | $result = $db->query($sql_skill); |
| 282 | 282 | $numSkills = $db->num_rows($result); |
| 283 | - for ($i=0; $i < $numSkills; $i++) { |
|
| 283 | + for ($i = 0; $i < $numSkills; $i++) { |
|
| 284 | 284 | $objSkillRank = $db->fetch_object($result); |
| 285 | 285 | $TSkillsJob[] = $objSkillRank; |
| 286 | 286 | } |
@@ -303,11 +303,11 @@ discard block |
||
| 303 | 303 | //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field |
| 304 | 304 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
| 305 | 305 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
| 306 | - $object->fields['label']['visible']=0; // Already in banner |
|
| 307 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
| 306 | + $object->fields['label']['visible'] = 0; // Already in banner |
|
| 307 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
| 308 | 308 | |
| 309 | 309 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
| 310 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 310 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 311 | 311 | } else { |
| 312 | 312 | // Login |
| 313 | 313 | print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>'; |
@@ -330,9 +330,9 @@ discard block |
||
| 330 | 330 | } |
| 331 | 331 | print '</tr>'."\n"; |
| 332 | 332 | |
| 333 | - $object->fields['label']['visible']=0; // Already in banner |
|
| 334 | - $object->fields['firstname']['visible']=0; // Already in banner |
|
| 335 | - $object->fields['lastname']['visible']=0; // Already in banner |
|
| 333 | + $object->fields['label']['visible'] = 0; // Already in banner |
|
| 334 | + $object->fields['firstname']['visible'] = 0; // Already in banner |
|
| 335 | + $object->fields['lastname']['visible'] = 0; // Already in banner |
|
| 336 | 336 | //include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
| 337 | 337 | |
| 338 | 338 | // Ref employee |
@@ -372,19 +372,19 @@ discard block |
||
| 372 | 372 | |
| 373 | 373 | if ($objecttype != 'user' && $permissiontoadd) { |
| 374 | 374 | // form pour ajouter des compétences |
| 375 | - print '<form name="addSkill" method="post" action="' . $_SERVER['PHP_SELF'] . '">'; |
|
| 376 | - print '<input type="hidden" name="objecttype" value="' . $objecttype . '">'; |
|
| 377 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
| 375 | + print '<form name="addSkill" method="post" action="'.$_SERVER['PHP_SELF'].'">'; |
|
| 376 | + print '<input type="hidden" name="objecttype" value="'.$objecttype.'">'; |
|
| 377 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
| 378 | 378 | print '<input type="hidden" name="action" value="addSkill">'; |
| 379 | 379 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 380 | 380 | print '<div class="div-table-responsive-no-min">'; |
| 381 | 381 | print '<table id="tablelines" class="noborder noshadow" width="100%">'; |
| 382 | - print '<tr><td style="width:90%">' . $langs->trans('AddSkill') . '</td><td style="width:10%"></td></tr>'; |
|
| 382 | + print '<tr><td style="width:90%">'.$langs->trans('AddSkill').'</td><td style="width:10%"></td></tr>'; |
|
| 383 | 383 | print '<tr>'; |
| 384 | 384 | print '<td>'; |
| 385 | 385 | print img_picto('', 'shapes', 'class="pictofixedwidth"'); |
| 386 | - print $form->multiselectarray('fk_skill', array_diff_key($TAllSkillsFormatted, $TAlreadyUsedSkill), array(), 0, 0, 'widthcentpercentminusx') . '</td>'; |
|
| 387 | - print '<td><input class="button reposition" type="submit" value="' . $langs->trans('Add') . '"></td>'; |
|
| 386 | + print $form->multiselectarray('fk_skill', array_diff_key($TAllSkillsFormatted, $TAlreadyUsedSkill), array(), 0, 0, 'widthcentpercentminusx').'</td>'; |
|
| 387 | + print '<td><input class="button reposition" type="submit" value="'.$langs->trans('Add').'"></td>'; |
|
| 388 | 388 | print '</tr>'; |
| 389 | 389 | print '</table>'; |
| 390 | 390 | print '</div>'; |
@@ -395,9 +395,9 @@ discard block |
||
| 395 | 395 | print '<div class="clearboth"></div>'; |
| 396 | 396 | |
| 397 | 397 | if ($objecttype != 'user' && $permissiontoadd) { |
| 398 | - print '<form name="saveSkill" method="post" action="' . $_SERVER['PHP_SELF'] . '">'; |
|
| 399 | - print '<input type="hidden" name="objecttype" value="' . $objecttype . '">'; |
|
| 400 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
| 398 | + print '<form name="saveSkill" method="post" action="'.$_SERVER['PHP_SELF'].'">'; |
|
| 399 | + print '<input type="hidden" name="objecttype" value="'.$objecttype.'">'; |
|
| 400 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
| 401 | 401 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 402 | 402 | print '<input type="hidden" name="action" value="saveSkill">'; |
| 403 | 403 | } |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | } |
| 416 | 416 | print '</tr>'; |
| 417 | 417 | if (!is_array($TSkillsJob) || empty($TSkillsJob)) { |
| 418 | - print '<tr><td><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
| 418 | + print '<tr><td><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
| 419 | 419 | } else { |
| 420 | 420 | $sk = new Skill($db); |
| 421 | 421 | foreach ($TSkillsJob as $skillElement) { |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | if ($objecttype != 'user' && $permissiontoadd) { |
| 435 | 435 | print '<td class="linecoledit"></td>'; |
| 436 | 436 | print '<td class="linecoldelete">'; |
| 437 | - print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $skillElement->fk_object . '&objecttype=' . $objecttype . '&action=ask_deleteskill&lineid=' . $skillElement->id . '">'; |
|
| 437 | + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$skillElement->fk_object.'&objecttype='.$objecttype.'&action=ask_deleteskill&lineid='.$skillElement->id.'">'; |
|
| 438 | 438 | print img_delete(); |
| 439 | 439 | print '</a>'; |
| 440 | 440 | } |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | print '</table>'; |
| 447 | - if ($objecttype != 'user' && $permissiontoadd) print '<td><input class="button pull-right" type="submit" value="' . $langs->trans('SaveRank') . '"></td>'; |
|
| 447 | + if ($objecttype != 'user' && $permissiontoadd) print '<td><input class="button pull-right" type="submit" value="'.$langs->trans('SaveRank').'"></td>'; |
|
| 448 | 448 | print '</div>'; |
| 449 | 449 | if ($objecttype != 'user' && $permissiontoadd) print '</form>'; |
| 450 | 450 | } |
@@ -474,10 +474,10 @@ discard block |
||
| 474 | 474 | print '<th>'.$langs->trans('Description').'</th>'; |
| 475 | 475 | print '<th>'.$langs->trans('DateEval').'</th>'; |
| 476 | 476 | print '<th>'.$langs->trans('Status').'</th>'; |
| 477 | - print '<th>'.$langs->trans("Result").' ' .$form->textwithpicto('', GetLegendSkills(), 1) .'</th>'; |
|
| 477 | + print '<th>'.$langs->trans("Result").' '.$form->textwithpicto('', GetLegendSkills(), 1).'</th>'; |
|
| 478 | 478 | print '</tr>'; |
| 479 | 479 | if (!$resql) { |
| 480 | - print '<tr><td><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
| 480 | + print '<tr><td><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
| 481 | 481 | } else { |
| 482 | 482 | $i = 0; |
| 483 | 483 | $sameRef = array(); |
@@ -147,10 +147,14 @@ discard block |
||
| 147 | 147 | $skillAdded->fk_object = $id; |
| 148 | 148 | $skillAdded->objecttype = $objecttype; |
| 149 | 149 | $ret = $skillAdded->create($user); |
| 150 | - if ($ret < 0) setEventMessages($skillAdded->error, null, 'errors'); |
|
| 150 | + if ($ret < 0) { |
|
| 151 | + setEventMessages($skillAdded->error, null, 'errors'); |
|
| 152 | + } |
|
| 151 | 153 | //else unset($TSkillsToAdd); |
| 152 | 154 | } |
| 153 | - if ($ret > 0) setEventMessages($langs->trans("SaveAddSkill"), null); |
|
| 155 | + if ($ret > 0) { |
|
| 156 | + setEventMessages($langs->trans("SaveAddSkill"), null); |
|
| 157 | + } |
|
| 154 | 158 | } |
| 155 | 159 | } elseif ($action == 'saveSkill') { |
| 156 | 160 | if (!empty($TNote)) { |
@@ -444,9 +448,13 @@ discard block |
||
| 444 | 448 | } |
| 445 | 449 | |
| 446 | 450 | print '</table>'; |
| 447 | - if ($objecttype != 'user' && $permissiontoadd) print '<td><input class="button pull-right" type="submit" value="' . $langs->trans('SaveRank') . '"></td>'; |
|
| 451 | + if ($objecttype != 'user' && $permissiontoadd) { |
|
| 452 | + print '<td><input class="button pull-right" type="submit" value="' . $langs->trans('SaveRank') . '"></td>'; |
|
| 453 | + } |
|
| 448 | 454 | print '</div>'; |
| 449 | - if ($objecttype != 'user' && $permissiontoadd) print '</form>'; |
|
| 455 | + if ($objecttype != 'user' && $permissiontoadd) { |
|
| 456 | + print '</form>'; |
|
| 457 | + } |
|
| 450 | 458 | } |
| 451 | 459 | |
| 452 | 460 | |