@@ -80,7 +80,7 @@ |
||
80 | 80 | } else { |
81 | 81 | dol_print_error($db); |
82 | 82 | } |
83 | - dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
83 | + dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
84 | 84 | } |
85 | 85 | $head[$tab][0] = DOL_URL_ROOT.'/contact/project.php?id='.$object->id; |
86 | 86 | $head[$tab][1] = $langs->trans("Projects"); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | // Turning on or off the ssl target certificate |
80 | 80 | if ($ssl_verifypeer < 0) { |
81 | 81 | global $dolibarr_main_prod; |
82 | - $ssl_verifypeer = ($dolibarr_main_prod ? true : false); |
|
82 | + $ssl_verifypeer = ($dolibarr_main_prod ? true : false); |
|
83 | 83 | } |
84 | 84 | if (!empty($conf->global->MAIN_CURL_DISABLE_VERIFYPEER)) { |
85 | 85 | $ssl_verifypeer = 0; |
@@ -230,13 +230,13 @@ discard block |
||
230 | 230 | if ($iptocheck == $ipofmetadataserver) { |
231 | 231 | $info['http_code'] = 400; |
232 | 232 | $info['content'] = 'Error bad hostname IP (Used by '.$nameofmetadataserver.' metadata server). This IP is forbidden.'; |
233 | - break 2; // exit the foreach and the do... |
|
233 | + break 2; // exit the foreach and the do... |
|
234 | 234 | } |
235 | 235 | } |
236 | 236 | |
237 | 237 | // Set CURLOPT_CONNECT_TO so curl will not try another resolution that may give a different result. Possible only on PHP v7+ |
238 | 238 | if (defined('CURLOPT_CONNECT_TO')) { |
239 | - $connect_to = array(sprintf("%s:%d:%s:%d", $newUrlArray['host'], empty($newUrlArray['port'])?'':$newUrlArray['port'], $iptocheck, empty($newUrlArray['port'])?'':$newUrlArray['port'])); |
|
239 | + $connect_to = array(sprintf("%s:%d:%s:%d", $newUrlArray['host'], empty($newUrlArray['port']) ? '' : $newUrlArray['port'], $iptocheck, empty($newUrlArray['port']) ? '' : $newUrlArray['port'])); |
|
240 | 240 | //var_dump($newUrlArray); |
241 | 241 | //var_dump($connect_to); |
242 | 242 | curl_setopt($ch, CURLOPT_CONNECT_TO, $connect_to); |
@@ -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 |
@@ -88,21 +88,21 @@ discard block |
||
88 | 88 | $error = 0; |
89 | 89 | |
90 | 90 | $codecontact = dol_getIdFromCode($db, $typeid, 'c_type_contact', 'rowid', 'code'); |
91 | - if ($codecontact=='SUPPORTTEC') { |
|
91 | + if ($codecontact == 'SUPPORTTEC') { |
|
92 | 92 | $internal_contacts = $object->listeContact(-1, 'internal', 0, 'SUPPORTTEC'); |
93 | 93 | foreach ($internal_contacts as $key => $contact) { |
94 | 94 | if ($contact['id'] !== $contactid) { |
95 | 95 | //print "user à effacer : ".$useroriginassign; |
96 | 96 | $result = $object->delete_contact($contact['rowid']); |
97 | - if ($result<0) { |
|
98 | - $error ++; |
|
97 | + if ($result < 0) { |
|
98 | + $error++; |
|
99 | 99 | setEventMessages($object->error, $object->errors, 'errors'); |
100 | 100 | } |
101 | 101 | } |
102 | 102 | } |
103 | 103 | $ret = $object->assignUser($user, $contactid); |
104 | 104 | if ($ret < 0) { |
105 | - $error ++; |
|
105 | + $error++; |
|
106 | 106 | setEventMessages($object->error, $object->errors, 'errors'); |
107 | 107 | } |
108 | 108 | } |
@@ -139,10 +139,10 @@ discard block |
||
139 | 139 | if ($object->fetch($id, '', $track_id)) { |
140 | 140 | $internal_contacts = $object->listeContact(-1, 'internal', 0, 'SUPPORTTEC'); |
141 | 141 | foreach ($internal_contacts as $key => $contact) { |
142 | - if ($contact['rowid'] == $lineid && $object->fk_user_assign==$contact['id']) { |
|
142 | + if ($contact['rowid'] == $lineid && $object->fk_user_assign == $contact['id']) { |
|
143 | 143 | $ret = $object->assignUser($user, null); |
144 | 144 | if ($ret < 0) { |
145 | - $error ++; |
|
145 | + $error++; |
|
146 | 146 | setEventMessages($object->error, $object->errors, 'errors'); |
147 | 147 | } |
148 | 148 | } |
@@ -115,7 +115,9 @@ |
||
115 | 115 | $url_page_current = DOL_URL_ROOT.'/ticket/card.php'; |
116 | 116 | |
117 | 117 | // Security check - Protection if external user |
118 | -if ($user->socid > 0) $socid = $user->socid; |
|
118 | +if ($user->socid > 0) { |
|
119 | + $socid = $user->socid; |
|
120 | +} |
|
119 | 121 | $result = restrictedArea($user, 'ticket', $object->id); |
120 | 122 | |
121 | 123 | $triggermodname = 'TICKET_MODIFY'; |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | // Auto mark as read if created from backend |
263 | 263 | if (!empty($conf->global->TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND) && $user->rights->ticket->write) { |
264 | - if ( ! $object->markAsRead($user) > 0) { |
|
264 | + if (!$object->markAsRead($user) > 0) { |
|
265 | 265 | setEventMessages($object->error, $object->errors, 'errors'); |
266 | 266 | } |
267 | 267 | } |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | foreach ($internal_contacts as $key => $contact) { |
409 | 409 | if ($contact['id'] !== $usertoassign) { |
410 | 410 | $result = $object->delete_contact($contact['rowid']); |
411 | - if ($result<0) { |
|
411 | + if ($result < 0) { |
|
412 | 412 | $error++; |
413 | 413 | setEventMessages($object->error, $object->errors, 'errors'); |
414 | 414 | } |
@@ -416,9 +416,9 @@ discard block |
||
416 | 416 | } |
417 | 417 | } |
418 | 418 | |
419 | - if ($usertoassign > 0 && $usertoassign!==$useroriginassign) { |
|
419 | + if ($usertoassign > 0 && $usertoassign !== $useroriginassign) { |
|
420 | 420 | $result = $object->add_contact($usertoassign, "SUPPORTTEC", 'internal', $notrigger = 0); |
421 | - if ($result<0) { |
|
421 | + if ($result < 0) { |
|
422 | 422 | $error++; |
423 | 423 | setEventMessages($object->error, $object->errors, 'errors'); |
424 | 424 | } |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | '-3' => $langs->trans('TicketNotNotifyTiersAtClose') |
808 | 808 | ); |
809 | 809 | foreach ($thirdparty_contacts as $thirdparty_contact) { |
810 | - $contacts_select[$thirdparty_contact['id']] = $thirdparty_contact['civility'] . ' ' . $thirdparty_contact['lastname'] . ' ' . $thirdparty_contact['firstname']; |
|
810 | + $contacts_select[$thirdparty_contact['id']] = $thirdparty_contact['civility'].' '.$thirdparty_contact['lastname'].' '.$thirdparty_contact['firstname']; |
|
811 | 811 | } |
812 | 812 | |
813 | 813 | // Default select all or no contact |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | print '<input type="hidden" name="action" value="assign_user">'; |
1078 | 1078 | print '<input type="hidden" name="track_id" value="'.$object->track_id.'">'; |
1079 | 1079 | //print '<label for="fk_user_assign">'.$langs->trans("AssignUser").'</label> '; |
1080 | - print $form->select_dolusers(empty($object->fk_user_assign)?$user->id:$object->fk_user_assign, 'fk_user_assign', 1); |
|
1080 | + print $form->select_dolusers(empty($object->fk_user_assign) ? $user->id : $object->fk_user_assign, 'fk_user_assign', 1); |
|
1081 | 1081 | print ' <input type="submit" class="button small" name="btn_assign_user" value="'.$langs->trans("Validate").'" />'; |
1082 | 1082 | print '</form>'; |
1083 | 1083 | } |
@@ -1414,10 +1414,10 @@ discard block |
||
1414 | 1414 | // Link to create an intervention |
1415 | 1415 | // socid is needed otherwise fichinter ask it and forgot origin after form submit :\ |
1416 | 1416 | if (!$object->fk_soc && $user->hasRight("ficheinter", "creer")) { |
1417 | - print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
1417 | + print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
1418 | 1418 | } |
1419 | 1419 | if ($object->fk_soc > 0 && isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) { |
1420 | - print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='. $object->fk_soc.'&origin=ticket_ticket&originid='. $object->id, ''); |
|
1420 | + print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='.$object->fk_soc.'&origin=ticket_ticket&originid='.$object->id, ''); |
|
1421 | 1421 | } |
1422 | 1422 | |
1423 | 1423 | // Close ticket if statut is read |
@@ -158,7 +158,9 @@ |
||
158 | 158 | accessforbidden(); |
159 | 159 | } |
160 | 160 | // restrict view to current user's company |
161 | -if ($user->socid > 0) $socid = $user->socid; |
|
161 | +if ($user->socid > 0) { |
|
162 | + $socid = $user->socid; |
|
163 | +} |
|
162 | 164 | |
163 | 165 | // Store current page url |
164 | 166 | $url_page_current = DOL_URL_ROOT.'/ticket/list.php'; |
@@ -1038,20 +1038,20 @@ discard block |
||
1038 | 1038 | print $object->showOutputField($val, $key, $obj->$key, ''); |
1039 | 1039 | |
1040 | 1040 | // display a warning on untreated tickets |
1041 | - $is_open = ($object->status != Ticket::STATUS_CLOSED && $object->status != Ticket::STATUS_CANCELED ); |
|
1041 | + $is_open = ($object->status != Ticket::STATUS_CLOSED && $object->status != Ticket::STATUS_CANCELED); |
|
1042 | 1042 | $should_show_warning = (!empty($conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE) || !empty($conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE)); |
1043 | 1043 | if ($is_open && $should_show_warning) { |
1044 | 1044 | $date_last_msg_sent = (int) $object->date_last_msg_sent; |
1045 | - $hour_diff = ($now - $date_last_msg_sent) / 3600 ; |
|
1045 | + $hour_diff = ($now - $date_last_msg_sent) / 3600; |
|
1046 | 1046 | |
1047 | 1047 | if (!empty($conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE && $date_last_msg_sent == 0)) { |
1048 | - $creation_date = $object->datec; |
|
1049 | - $hour_diff_creation = ($now - $creation_date) / 3600 ; |
|
1048 | + $creation_date = $object->datec; |
|
1049 | + $hour_diff_creation = ($now - $creation_date) / 3600; |
|
1050 | 1050 | if ($hour_diff_creation > $conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE) { |
1051 | - print " " . img_picto($langs->trans('Late') . ' : ' . $langs->trans('TicketsDelayForFirstResponseTooLong', $conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE), 'warning', 'style="color: red;"', false, 0, 0, '', ''); |
|
1051 | + print " ".img_picto($langs->trans('Late').' : '.$langs->trans('TicketsDelayForFirstResponseTooLong', $conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE), 'warning', 'style="color: red;"', false, 0, 0, '', ''); |
|
1052 | 1052 | } |
1053 | 1053 | } elseif (!empty($conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE) && $hour_diff > $conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE) { |
1054 | - print " " . img_picto($langs->trans('Late') . ' : ' . $langs->trans('TicketsDelayFromLastResponseTooLong', $conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE), 'warning'); |
|
1054 | + print " ".img_picto($langs->trans('Late').' : '.$langs->trans('TicketsDelayFromLastResponseTooLong', $conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE), 'warning'); |
|
1055 | 1055 | } |
1056 | 1056 | } |
1057 | 1057 | } else { // Example: key=fk_soc, obj->key=123 val=array('type'=>'integer', ... |
@@ -1138,7 +1138,7 @@ discard block |
||
1138 | 1138 | |
1139 | 1139 | print '</table>'."\n"; |
1140 | 1140 | print '</div>'."\n"; |
1141 | -print '</div>'."\n"; // end div-responsive-inside |
|
1141 | +print '</div>'."\n"; // end div-responsive-inside |
|
1142 | 1142 | |
1143 | 1143 | print '</form>'."\n"; |
1144 | 1144 |
@@ -235,7 +235,7 @@ |
||
235 | 235 | $this->dateh = $this->db->jdate($obj->dateh); |
236 | 236 | $this->datef = $this->db->jdate($obj->datef); |
237 | 237 | $this->amount = $obj->subscription; |
238 | - $this->note = $obj->note_public; // deprecated |
|
238 | + $this->note = $obj->note_public; // deprecated |
|
239 | 239 | $this->note_public = $obj->note_public; |
240 | 240 | $this->fk_bank = $obj->fk_bank; |
241 | 241 | return 1; |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | $action = GETPOST('action', 'aZ09'); |
48 | 48 | $value = GETPOST('value', 'alpha'); |
49 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
49 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
50 | 50 | |
51 | 51 | $label = GETPOST('label', 'alpha'); |
52 | 52 | $scandir = GETPOST('scan_dir', 'alpha'); |
@@ -68,7 +68,7 @@ |
||
68 | 68 | // Parameters |
69 | 69 | $action = GETPOST('action', 'aZ09'); |
70 | 70 | $backtopage = GETPOST('backtopage', 'alpha'); |
71 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
71 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
72 | 72 | |
73 | 73 | $value = GETPOST('value', 'alpha'); |
74 | 74 | $label = GETPOST('label', 'alpha'); |
@@ -421,7 +421,7 @@ |
||
421 | 421 | $allowupgrade = true; |
422 | 422 | } |
423 | 423 | |
424 | - $dir = DOL_DOCUMENT_ROOT."/install/mysql/migration/"; // We use mysql migration scripts whatever is database driver |
|
424 | + $dir = DOL_DOCUMENT_ROOT."/install/mysql/migration/"; // We use mysql migration scripts whatever is database driver |
|
425 | 425 | dolibarr_install_syslog("Scan sql files for migration files in ".$dir); |
426 | 426 | |
427 | 427 | // Get files list of migration file x.y.z-a.b.c.sql into /install/mysql/migration |