Completed
Branch develop (bd4efc)
by
unknown
22:12
created
htdocs/ticket/contact.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,9 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -88,21 +88,21 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 			}
Please login to merge, or discard this patch.
htdocs/ticket/card.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,9 @@
 block discarded – undo
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';
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 
283 283
 				// Auto mark as read if created from backend
284 284
 				if (!empty($conf->global->TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND) && $user->rights->ticket->write) {
285
-					if ( ! $object->markAsRead($user) > 0) {
285
+					if (!$object->markAsRead($user) > 0) {
286 286
 						setEventMessages($object->error, $object->errors, 'errors');
287 287
 					}
288 288
 				}
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 
297 297
 			if (!$error) {
298 298
 				// File transfer
299
-				$object->copyFilesForTicket('');		// trackid is forced to '' because files were uploaded when no id for ticket exists yet and trackid was ''
299
+				$object->copyFilesForTicket(''); // trackid is forced to '' because files were uploaded when no id for ticket exists yet and trackid was ''
300 300
 			}
301 301
 
302 302
 			if (!$error) {
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 				foreach ($internal_contacts as $key => $contact) {
430 430
 					if ($contact['id'] !== $usertoassign) {
431 431
 						$result = $object->delete_contact($contact['rowid']);
432
-						if ($result<0) {
432
+						if ($result < 0) {
433 433
 							$error++;
434 434
 							setEventMessages($object->error, $object->errors, 'errors');
435 435
 						}
@@ -437,9 +437,9 @@  discard block
 block discarded – undo
437 437
 				}
438 438
 			}
439 439
 
440
-			if ($usertoassign > 0 && $usertoassign!==$useroriginassign) {
440
+			if ($usertoassign > 0 && $usertoassign !== $useroriginassign) {
441 441
 				$result = $object->add_contact($usertoassign, "SUPPORTTEC", 'internal', $notrigger = 0);
442
-				if ($result<0) {
442
+				if ($result < 0) {
443 443
 					$error++;
444 444
 					setEventMessages($object->error, $object->errors, 'errors');
445 445
 				}
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
 
749 749
 	print load_fiche_titre($langs->trans('NewTicket'), '', 'ticket');
750 750
 
751
-	$formticket->trackid = '';		// TODO Use a unique key 'tic' to avoid conflict in upload file feature
751
+	$formticket->trackid = ''; // TODO Use a unique key 'tic' to avoid conflict in upload file feature
752 752
 	$formticket->withfromsocid = $socid ? $socid : $user->socid;
753 753
 	$formticket->withfromcontactid = $contactid ? $contactid : '';
754 754
 	$formticket->withtitletopic = 1;
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
 
816 816
 	print '</form>'; */
817 817
 } elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'abandon' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'categories' || $action == 'reopen'
818
-	|| $action== 'edit_contrat' || $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') {
818
+	|| $action == 'edit_contrat' || $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') {
819 819
 	if ($res > 0) {
820 820
 		// or for unauthorized internals users
821 821
 		if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
 				'-3' => $langs->trans('TicketNotNotifyTiersAtClose')
831 831
 			);
832 832
 			foreach ($thirdparty_contacts as $thirdparty_contact) {
833
-				$contacts_select[$thirdparty_contact['id']] = $thirdparty_contact['civility'] . ' ' . $thirdparty_contact['lastname'] . ' ' . $thirdparty_contact['firstname'];
833
+				$contacts_select[$thirdparty_contact['id']] = $thirdparty_contact['civility'].' '.$thirdparty_contact['lastname'].' '.$thirdparty_contact['firstname'];
834 834
 			}
835 835
 
836 836
 			// Default select all or no contact
@@ -1023,8 +1023,8 @@  discard block
 block discarded – undo
1023 1023
 						$morehtmlref .= $formcontract->formSelectContract($_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid, $object->fk_contract, 'contratid', 0, 1, 1, 1);
1024 1024
 					} else {
1025 1025
 						$morehtmlref .= '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit_contrat&token='.newToken().'&id='.$object->id.'">';
1026
-						$morehtmlref .=  img_edit($langs->trans('SetContract'));
1027
-						$morehtmlref .=  '</a>';
1026
+						$morehtmlref .= img_edit($langs->trans('SetContract'));
1027
+						$morehtmlref .= '</a>';
1028 1028
 					}
1029 1029
 				} else {
1030 1030
 					if (!empty($object->fk_contract)) {
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
 			print '<input type="hidden" name="action" value="assign_user">';
1131 1131
 			print '<input type="hidden" name="track_id" value="'.$object->track_id.'">';
1132 1132
 			//print '<label for="fk_user_assign">'.$langs->trans("AssignUser").'</label> ';
1133
-			print $form->select_dolusers(empty($object->fk_user_assign)?$user->id:$object->fk_user_assign, 'fk_user_assign', 1);
1133
+			print $form->select_dolusers(empty($object->fk_user_assign) ? $user->id : $object->fk_user_assign, 'fk_user_assign', 1);
1134 1134
 			print ' <input type="submit" class="button small" name="btn_assign_user" value="'.$langs->trans("Validate").'" />';
1135 1135
 			print '</form>';
1136 1136
 		}
@@ -1469,10 +1469,10 @@  discard block
 block discarded – undo
1469 1469
 				// Link to create an intervention
1470 1470
 				// socid is needed otherwise fichinter ask it and forgot origin after form submit :\
1471 1471
 				if (!$object->fk_soc && $user->hasRight("ficheinter", "creer")) {
1472
-					print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1472
+					print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1473 1473
 				}
1474 1474
 				if ($object->fk_soc > 0 && isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $user->hasRight('ficheinter', 'creer')) {
1475
-					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, '');
1475
+					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, '');
1476 1476
 				}
1477 1477
 
1478 1478
 				// Close ticket if status is read
Please login to merge, or discard this patch.
htdocs/ticket/list.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -158,7 +158,9 @@
 block discarded – undo
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';
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
 			if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
928 928
 				print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
929 929
 			} elseif (strpos($val['type'], 'integer:') === 0) {
930
-				print $object->showInputField($val, $key, !empty($search[$key])?$search[$key]:"", '', '', 'search_', 'maxwidth150', 1);
930
+				print $object->showInputField($val, $key, !empty($search[$key]) ? $search[$key] : "", '', '', 'search_', 'maxwidth150', 1);
931 931
 			} elseif (!preg_match('/^(date|timestamp)/', $val['type'])) {
932 932
 				print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]).'">';
933 933
 			}
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
 	} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
973 973
 		$cssforfield .= ($cssforfield ? ' ' : '').'right';
974 974
 	}
975
-	$cssforfield = preg_replace('/small\s*/', '', $cssforfield);	// the 'small' css must not be used for the title label
975
+	$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
976 976
 	if (!empty($arrayfields['t.'.$key]['checked'])) {
977 977
 		print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
978 978
 		$totalarray['nbfield']++;
@@ -1143,20 +1143,20 @@  discard block
 block discarded – undo
1143 1143
 					print $object->showOutputField($val, $key, $obj->$key, '');
1144 1144
 
1145 1145
 					// display a warning on untreated tickets
1146
-					$is_open = ($object->status != Ticket::STATUS_CLOSED && $object->status != Ticket::STATUS_CANCELED );
1146
+					$is_open = ($object->status != Ticket::STATUS_CLOSED && $object->status != Ticket::STATUS_CANCELED);
1147 1147
 					$should_show_warning = (!empty($conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE) || !empty($conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE));
1148 1148
 					if ($is_open && $should_show_warning) {
1149 1149
 						$date_last_msg_sent = (int) $object->date_last_msg_sent;
1150
-						$hour_diff = ($now - $date_last_msg_sent) / 3600 ;
1150
+						$hour_diff = ($now - $date_last_msg_sent) / 3600;
1151 1151
 
1152 1152
 						if (!empty($conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE && $date_last_msg_sent == 0)) {
1153
-							$creation_date =  $object->datec;
1154
-							$hour_diff_creation = ($now - $creation_date) / 3600 ;
1153
+							$creation_date = $object->datec;
1154
+							$hour_diff_creation = ($now - $creation_date) / 3600;
1155 1155
 							if ($hour_diff_creation > $conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE) {
1156
-								print " " . img_picto($langs->trans('Late') . ' : ' . $langs->trans('TicketsDelayForFirstResponseTooLong', $conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE), 'warning', 'style="color: red;"', false, 0, 0, '', '');
1156
+								print " ".img_picto($langs->trans('Late').' : '.$langs->trans('TicketsDelayForFirstResponseTooLong', $conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE), 'warning', 'style="color: red;"', false, 0, 0, '', '');
1157 1157
 							}
1158 1158
 						} elseif (!empty($conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE) && $hour_diff > $conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE) {
1159
-							print " " . img_picto($langs->trans('Late') . ' : ' . $langs->trans('TicketsDelayFromLastResponseTooLong', $conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE), 'warning');
1159
+							print " ".img_picto($langs->trans('Late').' : '.$langs->trans('TicketsDelayFromLastResponseTooLong', $conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE), 'warning');
1160 1160
 						}
1161 1161
 					}
1162 1162
 				} else {	// Example: key=fk_soc, obj->key=123 val=array('type'=>'integer', ...
@@ -1246,7 +1246,7 @@  discard block
 block discarded – undo
1246 1246
 
1247 1247
 print '</table>'."\n";
1248 1248
 print '</div>'."\n";
1249
-print '</div>'."\n";	// end div-responsive-inside
1249
+print '</div>'."\n"; // end div-responsive-inside
1250 1250
 
1251 1251
 print '</form>'."\n";
1252 1252
 
Please login to merge, or discard this patch.
htdocs/adherents/class/subscription.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -235,7 +235,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
htdocs/product/admin/product.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
htdocs/recruitment/admin/setup.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
htdocs/install/check.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -421,7 +421,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
htdocs/recruitment/admin/setup_candidatures.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
htdocs/theme/eldy/style.css.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -185,7 +185,7 @@
 block discarded – undo
185 185
 $colortext           = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXT) ? $colortext : $conf->global->THEME_ELDY_TEXT) : (empty($user->conf->THEME_ELDY_TEXT) ? $colortext : $user->conf->THEME_ELDY_TEXT);
186 186
 $colortextlink       = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTLINK) ? $colortextlink : $conf->global->THEME_ELDY_TEXTLINK) : (empty($user->conf->THEME_ELDY_TEXTLINK) ? $colortextlink : $user->conf->THEME_ELDY_TEXTLINK);
187 187
 $butactionbg       	 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BTNACTION) ? $butactionbg : $conf->global->THEME_ELDY_BTNACTION) : (empty($user->conf->THEME_ELDY_BTNACTION) ? $butactionbg : $user->conf->THEME_ELDY_BTNACTION);
188
-$textbutaction     = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $conf->global->THEME_ELDY_TEXTBTNACTION) : (empty($user->conf->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $user->conf->THEME_ELDY_TEXTBTNACTION);
188
+$textbutaction = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $conf->global->THEME_ELDY_TEXTBTNACTION) : (empty($user->conf->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $user->conf->THEME_ELDY_TEXTBTNACTION);
189 189
 $fontsize            = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE1) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE1) : (empty($user->conf->THEME_ELDY_FONT_SIZE1) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE1);
190 190
 $fontsizesmaller     = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE2) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE2) : (empty($user->conf->THEME_ELDY_FONT_SIZE2) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE2);
191 191
 
Please login to merge, or discard this patch.