@@ -61,7 +61,9 @@ |
||
61 | 61 | |
62 | 62 | // Security check |
63 | 63 | $id = GETPOST("id", 'int'); |
64 | -if ($user->socid > 0) $socid = $user->socid; |
|
64 | +if ($user->socid > 0) { |
|
65 | + $socid = $user->socid; |
|
66 | +} |
|
65 | 67 | $result = restrictedArea($user, 'ticket', $object->id, ''); |
66 | 68 | |
67 | 69 | // restrict access for externals users |
@@ -269,7 +269,7 @@ |
||
269 | 269 | $cachekey = 'count_events_ticket_'.$object->id; |
270 | 270 | $nbEvent = dol_getcache($cachekey); |
271 | 271 | |
272 | - $titlelist = $langs->trans("ActionsOnTicket").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': ''); |
|
272 | + $titlelist = $langs->trans("ActionsOnTicket").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); |
|
273 | 273 | |
274 | 274 | print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); |
275 | 275 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * \brief Page to edit absolute discounts for a customer |
25 | 25 | */ |
26 | 26 | |
27 | -if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
|
27 | +if (!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
|
28 | 28 | |
29 | 29 | // Load Dolibarr environment |
30 | 30 | require '../main.inc.php'; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | print '</table>'; |
331 | 331 | print '</div>'; |
332 | 332 | |
333 | - print '</div>'; // close fichecenter |
|
333 | + print '</div>'; // close fichecenter |
|
334 | 334 | |
335 | 335 | print dol_get_fiche_end(); |
336 | 336 |
@@ -24,7 +24,10 @@ |
||
24 | 24 | * \brief Page to edit absolute discounts for a customer |
25 | 25 | */ |
26 | 26 | |
27 | -if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
|
27 | +if (! defined('CSRFCHECK_WITH_TOKEN')) { |
|
28 | + define('CSRFCHECK_WITH_TOKEN', '1'); |
|
29 | +} |
|
30 | +// Force use of CSRF protection with tokens even for GET |
|
28 | 31 | |
29 | 32 | // Load Dolibarr environment |
30 | 33 | require '../main.inc.php'; |
@@ -1237,7 +1237,9 @@ discard block |
||
1237 | 1237 | if (!is_array($val)) { // For backward compatibility when val=id |
1238 | 1238 | $val = array('id'=>$val); |
1239 | 1239 | } |
1240 | - if (!empty($already_inserted[$val['id']])) continue; |
|
1240 | + if (!empty($already_inserted[$val['id']])) { |
|
1241 | + continue; |
|
1242 | + } |
|
1241 | 1243 | |
1242 | 1244 | $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)"; |
1243 | 1245 | $sql .= " VALUES(".((int) $this->id).", 'user', ".((int) $val['id']).", ".(empty($val['mandatory']) ? '0' : ((int) $val['mandatory'])).", ".(empty($val['transparency']) ? '0' : ((int) $val['transparency'])).", ".(empty($val['answer_status']) ? '0' : ((int) $val['answer_status'])).")"; |
@@ -1263,7 +1265,9 @@ discard block |
||
1263 | 1265 | if (!is_array($val)) { // For backward compatibility when val=id |
1264 | 1266 | $val = array('id'=>$val); |
1265 | 1267 | } |
1266 | - if (!empty($already_inserted[$val['id']])) continue; |
|
1268 | + if (!empty($already_inserted[$val['id']])) { |
|
1269 | + continue; |
|
1270 | + } |
|
1267 | 1271 | |
1268 | 1272 | $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)"; |
1269 | 1273 | $sql .= " VALUES(".((int) $this->id).", 'socpeople', ".((int) $val['id']).", 0, 0, 0)"; |
@@ -1334,7 +1338,9 @@ discard block |
||
1334 | 1338 | // Fields from hook |
1335 | 1339 | $parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype); |
1336 | 1340 | $reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters); // Note that $action and $object may have been modified by hook |
1337 | - if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; |
|
1341 | + if (!empty($hookmanager->resPrint)) { |
|
1342 | + $sql.= $hookmanager->resPrint; |
|
1343 | + } |
|
1338 | 1344 | $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; |
1339 | 1345 | if (!empty($socid)) { |
1340 | 1346 | $sql .= " AND a.fk_soc = ".((int) $socid); |
@@ -1356,7 +1362,9 @@ discard block |
||
1356 | 1362 | // Fields where hook |
1357 | 1363 | $parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype); |
1358 | 1364 | $reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters); // Note that $action and $object may have been modified by hook |
1359 | - if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; |
|
1365 | + if (!empty($hookmanager->resPrint)) { |
|
1366 | + $sql.= $hookmanager->resPrint; |
|
1367 | + } |
|
1360 | 1368 | if ($sortorder && $sortfield) { |
1361 | 1369 | $sql .= $this->db->order($sortfield, $sortorder); |
1362 | 1370 | } |
@@ -2553,7 +2561,9 @@ discard block |
||
2553 | 2561 | |
2554 | 2562 | $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; |
2555 | 2563 | $sql .= " SET percent = ".(int) $percent; |
2556 | - if ($usermodid > 0) $sql .= ", fk_user_mod = ".$usermodid; |
|
2564 | + if ($usermodid > 0) { |
|
2565 | + $sql .= ", fk_user_mod = ".$usermodid; |
|
2566 | + } |
|
2557 | 2567 | $sql .= " WHERE id = ".((int) $id); |
2558 | 2568 | |
2559 | 2569 | if ($this->db->query($sql)) { |
@@ -377,9 +377,9 @@ discard block |
||
377 | 377 | /** |
378 | 378 | * Properties to manage the recurring events |
379 | 379 | */ |
380 | - public $recurid; /* A string YYYYMMDDHHMMSS shared by allevent of same serie */ |
|
381 | - public $recurrule; /* Rule of recurring */ |
|
382 | - public $recurdateend; /* Repeat until this date */ |
|
380 | + public $recurid; /* A string YYYYMMDDHHMMSS shared by allevent of same serie */ |
|
381 | + public $recurrule; /* Rule of recurring */ |
|
382 | + public $recurdateend; /* Repeat until this date */ |
|
383 | 383 | |
384 | 384 | public $calling_duration; |
385 | 385 | |
@@ -559,8 +559,8 @@ discard block |
||
559 | 559 | $sql .= "ip"; |
560 | 560 | $sql .= ") VALUES ("; |
561 | 561 | $sql .= "'(PROV)', "; |
562 | - $sql .= "'".$this->db->idate($now)."', "; // date creation |
|
563 | - $sql .= "'".$this->db->idate($this->datep)."', "; // date start event |
|
562 | + $sql .= "'".$this->db->idate($now)."', "; // date creation |
|
563 | + $sql .= "'".$this->db->idate($this->datep)."', "; // date start event |
|
564 | 564 | $sql .= (strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : "null").", "; |
565 | 565 | $sql .= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '') ? "'".$this->db->escape($this->durationp)."'" : "null").", "; // deprecated |
566 | 566 | $sql .= (isset($this->type_id) ? $this->type_id : "null").","; |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | $resql = $this->db->query($sql); |
634 | 634 | if (!$resql) { |
635 | 635 | $error++; |
636 | - dol_syslog('Error to process userassigned: ' . $this->db->lasterror(), LOG_ERR); |
|
636 | + dol_syslog('Error to process userassigned: '.$this->db->lasterror(), LOG_ERR); |
|
637 | 637 | $this->errors[] = $this->db->lasterror(); |
638 | 638 | } else { |
639 | 639 | $already_inserted[$val['id']] = true; |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | $resql = $this->db->query($sql); |
659 | 659 | if (!$resql) { |
660 | 660 | $error++; |
661 | - dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR); |
|
661 | + dol_syslog('Error to process socpeopleassigned: '.$this->db->lasterror(), LOG_ERR); |
|
662 | 662 | $this->errors[] = $this->db->lasterror(); |
663 | 663 | } else { |
664 | 664 | $already_inserted[$id] = true; |
@@ -893,14 +893,14 @@ discard block |
||
893 | 893 | $this->status = $obj->status; |
894 | 894 | |
895 | 895 | //email information |
896 | - $this->email_msgid=$obj->email_msgid; |
|
897 | - $this->email_from=$obj->email_from; |
|
898 | - $this->email_sender=$obj->email_sender; |
|
899 | - $this->email_to=$obj->email_to; |
|
900 | - $this->email_tocc=$obj->email_tocc; |
|
901 | - $this->email_tobcc=$obj->email_tobcc; |
|
902 | - $this->email_subject=$obj->email_subject; |
|
903 | - $this->errors_to=$obj->errors_to; |
|
896 | + $this->email_msgid = $obj->email_msgid; |
|
897 | + $this->email_from = $obj->email_from; |
|
898 | + $this->email_sender = $obj->email_sender; |
|
899 | + $this->email_to = $obj->email_to; |
|
900 | + $this->email_tocc = $obj->email_tocc; |
|
901 | + $this->email_tobcc = $obj->email_tobcc; |
|
902 | + $this->email_subject = $obj->email_subject; |
|
903 | + $this->errors_to = $obj->errors_to; |
|
904 | 904 | |
905 | 905 | $this->fetch_optionals(); |
906 | 906 | |
@@ -1182,7 +1182,7 @@ discard block |
||
1182 | 1182 | $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm"; |
1183 | 1183 | $sql .= " SET percent = '".$this->db->escape($this->percentage)."'"; |
1184 | 1184 | $sql .= ", fk_action = ".(int) $this->type_id; |
1185 | - $sql .= ", code = " . ($code ? "'".$this->db->escape($code)."'" : "null"); |
|
1185 | + $sql .= ", code = ".($code ? "'".$this->db->escape($code)."'" : "null"); |
|
1186 | 1186 | $sql .= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'" : "null"); |
1187 | 1187 | $sql .= ", datep = ".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null'); |
1188 | 1188 | $sql .= ", datep2 = ".(strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : 'null'); |
@@ -1335,8 +1335,8 @@ discard block |
||
1335 | 1335 | $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; |
1336 | 1336 | // Fields from hook |
1337 | 1337 | $parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype); |
1338 | - $reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters); // Note that $action and $object may have been modified by hook |
|
1339 | - if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; |
|
1338 | + $reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters); // Note that $action and $object may have been modified by hook |
|
1339 | + if (!empty($hookmanager->resPrint)) $sql .= $hookmanager->resPrint; |
|
1340 | 1340 | $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; |
1341 | 1341 | if (!empty($socid)) { |
1342 | 1342 | $sql .= " AND a.fk_soc = ".((int) $socid); |
@@ -1357,8 +1357,8 @@ discard block |
||
1357 | 1357 | } |
1358 | 1358 | // Fields where hook |
1359 | 1359 | $parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype); |
1360 | - $reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters); // Note that $action and $object may have been modified by hook |
|
1361 | - if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; |
|
1360 | + $reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters); // Note that $action and $object may have been modified by hook |
|
1361 | + if (!empty($hookmanager->resPrint)) $sql .= $hookmanager->resPrint; |
|
1362 | 1362 | if ($sortorder && $sortfield) { |
1363 | 1363 | $sql .= $this->db->order($sortfield, $sortorder); |
1364 | 1364 | } |
@@ -1635,9 +1635,9 @@ discard block |
||
1635 | 1635 | } |
1636 | 1636 | // show categories for this record only in ajax to not overload lists |
1637 | 1637 | if (isModEnabled('categorie') && !$nofetch) { |
1638 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
1638 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
1639 | 1639 | $form = new Form($this->db); |
1640 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1); |
|
1640 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1); |
|
1641 | 1641 | } |
1642 | 1642 | |
1643 | 1643 | return $datas; |
@@ -1729,8 +1729,8 @@ discard block |
||
1729 | 1729 | } |
1730 | 1730 | if (!empty($this->note_private)) { |
1731 | 1731 | $tooltip .= '<br><br><b>'.$langs->trans('Description').':</b><br>'; |
1732 | - $texttoshow = dolGetFirstLineOfText($this->note_private, 8); // Try to limit length of content |
|
1733 | - $tooltip .= '<div class="tenlinesmax">'; // Restrict height of content into the tooltip |
|
1732 | + $texttoshow = dolGetFirstLineOfText($this->note_private, 8); // Try to limit length of content |
|
1733 | + $tooltip .= '<div class="tenlinesmax">'; // Restrict height of content into the tooltip |
|
1734 | 1734 | $tooltip .= (dol_textishtml($texttoshow) ? str_replace(array("\r", "\n"), "", $texttoshow) : str_replace(array("\r", "\n"), '<br>', $texttoshow)); |
1735 | 1735 | $tooltip .= '</div>'; |
1736 | 1736 | } |
@@ -1755,7 +1755,7 @@ discard block |
||
1755 | 1755 | $label = $langs->trans("ShowAction"); |
1756 | 1756 | $linkclose .= ' alt="'.dol_escape_htmltag($tooltip, 1).'"'; |
1757 | 1757 | } |
1758 | - $linkclose .= ($tooltip ? ' title="'.dol_escape_htmltag($tooltip, 1).'"' : ' title="tocomplete"'); |
|
1758 | + $linkclose .= ($tooltip ? ' title="'.dol_escape_htmltag($tooltip, 1).'"' : ' title="tocomplete"'); |
|
1759 | 1759 | $linkclose .= $dataparams.' class="'.$classname.' '.$classfortooltip.'"'; |
1760 | 1760 | } else { |
1761 | 1761 | $linkclose .= ' class="'.$classname.'"'; |
@@ -2372,7 +2372,7 @@ discard block |
||
2372 | 2372 | */ |
2373 | 2373 | public static function replaceProduct(DoliDB $dbs, $origin_id, $dest_id) |
2374 | 2374 | { |
2375 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'actioncomm SET fk_element = ' . ((int) $dest_id) . ' WHERE elementtype="product" AND fk_element = '.((int) $origin_id); |
|
2375 | + $sql = 'UPDATE '.MAIN_DB_PREFIX.'actioncomm SET fk_element = '.((int) $dest_id).' WHERE elementtype="product" AND fk_element = '.((int) $origin_id); |
|
2376 | 2376 | // using $dbs, not $this->db because function is static |
2377 | 2377 | if (!$dbs->query($sql)) { |
2378 | 2378 | //$this->errors = $dbs->lasterror(); |
@@ -234,7 +234,7 @@ |
||
234 | 234 | } |
235 | 235 | } |
236 | 236 | // For the case type is not 'system...' neither 'module', we just check module is on |
237 | - if (! in_array($obj->type, array('system', 'systemauto', 'module', 'moduleauto'))) { |
|
237 | + if (!in_array($obj->type, array('system', 'systemauto', 'module', 'moduleauto'))) { |
|
238 | 238 | $tmpmodule = $obj->module; |
239 | 239 | //var_dump($tmpmodule); |
240 | 240 | if ($tmpmodule && isset($conf->$tmpmodule) && isModEnabled($tmpmodule)) { |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $customerStatic->loadCacheOfProspStatus(); |
126 | 126 | if (!empty($customerStatic->cacheprospectstatus)) { |
127 | 127 | foreach ($customerStatic->cacheprospectstatus as $dataProspectSt) { |
128 | - $this->type_statuscommprospect[$dataProspectSt['id']]=$dataProspectSt['label']; |
|
128 | + $this->type_statuscommprospect[$dataProspectSt['id']] = $dataProspectSt['label']; |
|
129 | 129 | } |
130 | 130 | } else { |
131 | 131 | $this->type_statuscommprospect = array( |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | } |
629 | 629 | } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'link') { |
630 | 630 | if ($arrayquery['options_'.$key] > 0) { |
631 | - $sqlwhere[]= " (te.".$key." = ".((int) $arrayquery["options_".$key]).")"; |
|
631 | + $sqlwhere[] = " (te.".$key." = ".((int) $arrayquery["options_".$key]).")"; |
|
632 | 632 | } |
633 | 633 | } else { |
634 | 634 | if (is_array($arrayquery['options_'.$key])) { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public $picto = 'intracommreport'; |
57 | 57 | |
58 | 58 | |
59 | - public $label; // ref ??? |
|
59 | + public $label; // ref ??? |
|
60 | 60 | |
61 | 61 | public $period; |
62 | 62 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public $declaration_number; |
69 | 69 | |
70 | - public $type_declaration; // deb or des |
|
70 | + public $type_declaration; // deb or des |
|
71 | 71 | |
72 | 72 | |
73 | 73 | /** |
@@ -95,7 +95,7 @@ |
||
95 | 95 | // Create a line of payments |
96 | 96 | $payment = new PaymentDonation($db); |
97 | 97 | $payment->chid = $chid; |
98 | - $payment->datep = $datepaid; |
|
98 | + $payment->datep = $datepaid; |
|
99 | 99 | $payment->amounts = $amounts; // Tableau de montant |
100 | 100 | $payment->paymenttype = GETPOST("paymenttype", 'int'); |
101 | 101 | $payment->num_payment = GETPOST("num_payment", 'alphanohtml'); |
@@ -81,7 +81,7 @@ |
||
81 | 81 | } |
82 | 82 | $result = restrictedArea($user, 'don', $object->id); |
83 | 83 | |
84 | -$permissiontoadd = $user->rights->don->creer; // Used by the include of actions_dellink.inc.php |
|
84 | +$permissiontoadd = $user->rights->don->creer; // Used by the include of actions_dellink.inc.php |
|
85 | 85 | |
86 | 86 | |
87 | 87 | /* |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | |
65 | 65 | public $amounts = array(); // Array of amounts |
66 | 66 | |
67 | - public $fk_typepayment; // Payment mode ID |
|
68 | - public $paymenttype; // Payment mode ID or Code. TODO Use only the code in this field. |
|
67 | + public $fk_typepayment; // Payment mode ID |
|
68 | + public $paymenttype; // Payment mode ID or Code. TODO Use only the code in this field. |
|
69 | 69 | |
70 | 70 | public $num_payment; |
71 | 71 | |
@@ -269,8 +269,8 @@ discard block |
||
269 | 269 | $this->tms = $this->db->jdate($obj->tms); |
270 | 270 | $this->datep = $this->db->jdate($obj->datep); |
271 | 271 | $this->amount = $obj->amount; |
272 | - $this->fk_typepayment = $obj->fk_typepayment; // Id on type of payent |
|
273 | - $this->paymenttype = $obj->fk_typepayment; // Id on type of payment. We should store the code into paymenttype. |
|
272 | + $this->fk_typepayment = $obj->fk_typepayment; // Id on type of payent |
|
273 | + $this->paymenttype = $obj->fk_typepayment; // Id on type of payment. We should store the code into paymenttype. |
|
274 | 274 | $this->num_payment = $obj->num_payment; |
275 | 275 | $this->note_public = $obj->note_public; |
276 | 276 | $this->fk_bank = $obj->fk_bank; |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | } |
689 | 689 | |
690 | 690 | global $action; |
691 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
691 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
692 | 692 | $parameters = array('id'=>$this->id, 'getnomurl' => &$result); |
693 | 693 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
694 | 694 | if ($reshook > 0) { |