Completed
Branch develop (a31803)
by Laurent
21:16
created
htdocs/core/boxes/box_accountancy_last_manual_entries.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
 				while ($line < $num) {
101 101
 					$objp		= $this->db->fetch_object($result);
102 102
 					$date		= $this->db->jdate($objp->date_movement);
103
-					$journal	= $objp->code_journal;
103
+					$journal = $objp->code_journal;
104 104
 					$label = $objp->label_operation;
105 105
 					$amount = $objp->amount;
106 106
 
Please login to merge, or discard this patch.
htdocs/product/stock/productlot_list.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,9 @@
 block discarded – undo
110 110
 	accessforbidden();
111 111
 }
112 112
 //$result = restrictedArea($user, 'productbatch');
113
-if (!$permissiontoread) accessforbidden();
113
+if (!$permissiontoread) {
114
+	accessforbidden();
115
+}
114 116
 
115 117
 
116 118
 /*
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -507,7 +507,7 @@
 block discarded – undo
507 507
 	} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
508 508
 		$cssforfield .= ($cssforfield ? ' ' : '').'right';
509 509
 	}
510
-	$cssforfield = preg_replace('/small\s*/', '', $cssforfield);	// the 'small' css must not be used for the title label
510
+	$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
511 511
 	if (!empty($arrayfields['t.'.$key]['checked'])) {
512 512
 		print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
513 513
 		$totalarray['nbfield']++;
Please login to merge, or discard this patch.
htdocs/hrm/establishment/card.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
 			$object->town = GETPOST('town', 'alpha');
85 85
 			$object->country_id = GETPOST("country_id", 'int');
86 86
 			$object->status = GETPOST('status', 'int');
87
-			$object->fk_user_author	= $user->id;
87
+			$object->fk_user_author = $user->id;
88 88
 			$object->datec = dol_now();
89 89
 			$object->entity = GETPOST('entity', 'int') > 0 ?GETPOST('entity', 'int') : $conf->entity;
90 90
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,8 +46,12 @@
 block discarded – undo
46 46
 //if ($user->socid > 0) $socid = $user->socid;
47 47
 //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
48 48
 //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0);
49
-if (!isModEnabled('hrm')) accessforbidden();
50
-if (empty($permissiontoread)) accessforbidden();
49
+if (!isModEnabled('hrm')) {
50
+	accessforbidden();
51
+}
52
+if (empty($permissiontoread)) {
53
+	accessforbidden();
54
+}
51 55
 
52 56
 
53 57
 /*
Please login to merge, or discard this patch.
htdocs/cron/info.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
  * View
44 44
  */
45 45
 
46
-$form = new Form($db);	// $form is required as global value into dol_banner_tab
46
+$form = new Form($db); // $form is required as global value into dol_banner_tab
47 47
 
48 48
 llxHeader('', $langs->trans("CronInfo"));
49 49
 
Please login to merge, or discard this patch.
htdocs/compta/stats/supplier_turnover_by_prodserv.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,8 +97,8 @@
 block discarded – undo
97 97
 	$month_current = dol_print_date(dol_now(), '%m');
98 98
 	$year_start = $year;
99 99
 }
100
-$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver');	// We use timezone of server so report is same from everywhere
101
-$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver');		// We use timezone of server so report is same from everywhere
100
+$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
101
+$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
102 102
 // Quarter
103 103
 if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
104 104
 	$q = GETPOST("q", "int");
Please login to merge, or discard this patch.
htdocs/eventorganization/conferenceorboothattendee_list.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,9 @@
 block discarded – undo
152 152
 	accessforbidden();
153 153
 }
154 154
 $result = restrictedArea($user, 'eventorganization');
155
-if (!$permissiontoread) accessforbidden();
155
+if (!$permissiontoread) {
156
+	accessforbidden();
157
+}
156 158
 
157 159
 
158 160
 /*
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -45,15 +45,15 @@  discard block
 block discarded – undo
45 45
 $langs->loadLangs(array("eventorganization", "other", "projects", "bills"));
46 46
 
47 47
 // Get Paramters
48
-$action      = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view';   // The action 'add', 'create', 'edit', 'update', 'view', ...
49
-$massaction  = GETPOST('massaction', 'alpha');   // The bulk action (combo box choice into lists)
50
-$show_files  = GETPOST('show_files', 'int');   // Show files area generated by bulk actions ?
51
-$confirm     = GETPOST('confirm', 'alpha');   // Result of a confirmation
52
-$cancel      = GETPOST('cancel', 'alpha');   // We click on a Cancel button
53
-$toselect    = GETPOST('toselect', 'array');   // Array of ids of elements selected into a list
48
+$action      = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
49
+$massaction  = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
50
+$show_files  = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
51
+$confirm     = GETPOST('confirm', 'alpha'); // Result of a confirmation
52
+$cancel      = GETPOST('cancel', 'alpha'); // We click on a Cancel button
53
+$toselect    = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
54 54
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
55
-$backtopage  = GETPOST('backtopage', 'alpha');   // Go back to a dedicated page
56
-$optioncss   = GETPOST('optioncss', 'aZ');   // Option for the css output (always '' except when 'print')
55
+$backtopage  = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
56
+$optioncss   = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
57 57
 $mode        = GETPOST('mode', 'aZ');
58 58
 
59 59
 $id = GETPOST('id', 'int');
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 $fk_project = GETPOST('fk_project', 'int') ? GETPOST('fk_project', 'int') : GETPOST('projectid', 'int');
64 64
 $projectid = $fk_project;
65 65
 
66
-$withProjectUrl='';
66
+$withProjectUrl = '';
67 67
 
68 68
 // Load variable for pagination
69 69
 $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
 // Default sort order (if not yet defined by previous GETPOST)
95 95
 if (!$sortfield) {
96
-	reset($object->fields);					// Reset is required to avoid key() to return null.
96
+	reset($object->fields); // Reset is required to avoid key() to return null.
97 97
 	$sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
98 98
 }
99 99
 if (!$sortorder) {
@@ -167,14 +167,14 @@  discard block
 block discarded – undo
167 167
 if (preg_match('/^set/', $action) && $projectid > 0 && $user->hasRight('eventorganization', 'write')) {
168 168
 	$project = new Project($db);
169 169
 	//If "set" fields keys is in projects fields
170
-	$project_attr=preg_replace('/^set/', '', $action);
170
+	$project_attr = preg_replace('/^set/', '', $action);
171 171
 	if (array_key_exists($project_attr, $project->fields)) {
172 172
 		$result = $project->fetch($projectid);
173 173
 		if ($result < 0) {
174 174
 			setEventMessages(null, $project->errors, 'errors');
175 175
 		} else {
176
-			$project->{$project_attr}=GETPOST($project_attr);
177
-			$result=$project->update($user);
176
+			$project->{$project_attr} = GETPOST($project_attr);
177
+			$result = $project->update($user);
178 178
 			if ($result < 0) {
179 179
 				setEventMessages(null, $project->errors, 'errors');
180 180
 			}
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 		$projectstatic->fetch_thirdparty();
401 401
 	}
402 402
 
403
-	$withProjectUrl='';
403
+	$withProjectUrl = '';
404 404
 	$object->project = clone $projectstatic;
405 405
 
406 406
 	if (!empty($withproject)) {
@@ -656,12 +656,12 @@  discard block
 block discarded – undo
656 656
 		print '<div class="fichecenter">';
657 657
 		print '<div class="fichehalfleft">';
658 658
 		print '<div class="underbanner clearboth"></div>';
659
-		print '<table class="border centpercent tableforfield">' . "\n";
659
+		print '<table class="border centpercent tableforfield">'."\n";
660 660
 
661
-		include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
661
+		include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
662 662
 
663 663
 		// Other attributes. Fields from hook formObjectOptions and Extrafields.
664
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
664
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
665 665
 		$object = $object_evt;
666 666
 		print '</table>';
667 667
 		print '</div>';
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
 }
734 734
 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
735 735
 
736
-print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].(!empty($conf_or_booth_id)?'?conforboothid='.$conf_or_booth_id:'').'">'."\n";
736
+print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].(!empty($conf_or_booth_id) ? '?conforboothid='.$conf_or_booth_id : '').'">'."\n";
737 737
 if ($optioncss != '') {
738 738
 	print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
739 739
 }
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 
752 752
 $params = array('morecss'=>'reposition');
753 753
 
754
-$urlnew = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl);
754
+$urlnew = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id) ? '&conforboothid='.$confOrBooth->id : '').(!empty($projectstatic->id) ? '&fk_project='.$projectstatic->id : '').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl);
755 755
 
756 756
 $newcardbutton = '';
757 757
 $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $urlnew, '', $permissiontoadd, $params);
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
 	} 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'])) {
892 892
 		$cssforfield .= ($cssforfield ? ' ' : '').'right';
893 893
 	}
894
-	$cssforfield = preg_replace('/small\s*/', '', $cssforfield);	// the 'small' css must not be used for the title label
894
+	$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
895 895
 	if (!empty($arrayfields['t.'.$key]['checked'])) {
896 896
 		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";
897 897
 		$totalarray['nbfield']++;
@@ -1002,9 +1002,9 @@  discard block
 block discarded – undo
1002 1002
 				if ($key == 'status') {
1003 1003
 					print $object->getLibStatut(5);
1004 1004
 				} elseif ($key == 'ref') {
1005
-					$optionLink = (!empty($withproject)?'conforboothidproject':'conforboothid');
1005
+					$optionLink = (!empty($withproject) ? 'conforboothidproject' : 'conforboothid');
1006 1006
 					if (empty($confOrBooth->id)) {
1007
-						$optionLink='projectid';
1007
+						$optionLink = 'projectid';
1008 1008
 					}
1009 1009
 					print $object->getNomUrl(1, $optionLink);
1010 1010
 				} else {
Please login to merge, or discard this patch.
htdocs/salaries/payment_salary/card.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
 	$result = $object->fetch($id);
48 48
 	if (!$result) dol_print_error($db, 'Failed to get payment id '.$id);
49 49
 }
50
-restrictedArea($user, 'salaries', $object->fk_salary, 'salary', '');	// $object is payment of salary
50
+restrictedArea($user, 'salaries', $object->fk_salary, 'salary', ''); // $object is payment of salary
51 51
 
52 52
 
53 53
 /*
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,15 +41,19 @@
 block discarded – undo
41 41
 $id = GETPOST("id", 'int');
42 42
 $action = GETPOST('action', 'aZ09');
43 43
 $confirm = GETPOST('confirm');
44
-if ($user->socid) $socid = $user->socid;
44
+if ($user->socid) {
45
+	$socid = $user->socid;
46
+}
45 47
 
46 48
 $salary = new Salary($db);
47 49
 
48 50
 $object = new PaymentSalary($db);
49 51
 if ($id > 0) {
50 52
 	$result = $object->fetch($id);
51
-	if (!$result) dol_print_error($db, 'Failed to get payment id '.$id);
52
-}
53
+	if (!$result) {
54
+		dol_print_error($db, 'Failed to get payment id '.$id);
55
+	}
56
+	}
53 57
 restrictedArea($user, 'salaries', $object->fk_salary, 'salary', '');	// $object is payment of salary
54 58
 
55 59
 
Please login to merge, or discard this patch.
htdocs/projet/class/project.class.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,8 +126,8 @@
 block discarded – undo
126 126
 	public $usage_bill_time; // Is the time spent on project must be invoiced or not
127 127
 
128 128
 	/**
129
-	   * @var integer		Event organization: Use Event Organization
130
-	   */
129
+	 * @var integer		Event organization: Use Event Organization
130
+	 */
131 131
 	public $usage_organize_event;
132 132
 
133 133
 	/**
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1391,7 +1391,7 @@  discard block
 block discarded – undo
1391 1391
 				$label = $langs->trans("ShowProject");
1392 1392
 				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
1393 1393
 			}
1394
-			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' :  ' title="tocomplete"');
1394
+			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
1395 1395
 			$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
1396 1396
 		} else {
1397 1397
 			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
@@ -1758,7 +1758,7 @@  discard block
 block discarded – undo
1758 1758
 
1759 1759
 				foreach (array('internal', 'external') as $source) {
1760 1760
 					$tab = $origin_project->liste_contact(-1, $source);
1761
-					if (is_array($tab) && count($tab)>0) {
1761
+					if (is_array($tab) && count($tab) > 0) {
1762 1762
 						foreach ($tab as $contacttoadd) {
1763 1763
 							$clone_project->add_contact($contacttoadd['id'], $contacttoadd['code'], $contacttoadd['source'], $notrigger);
1764 1764
 							if ($clone_project->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -1943,7 +1943,7 @@  discard block
 block discarded – undo
1943 1943
 		if ($tableName == "actioncomm") {
1944 1944
 			$sql .= " SET fk_project=".$this->id;
1945 1945
 			$sql .= " WHERE id=".((int) $elementSelectId);
1946
-		} elseif (in_array($tableName, ["entrepot","mrp_mo","stocktransfer_stocktransfer"])) {
1946
+		} elseif (in_array($tableName, ["entrepot", "mrp_mo", "stocktransfer_stocktransfer"])) {
1947 1947
 			$sql .= " SET fk_project=".$this->id;
1948 1948
 			$sql .= " WHERE rowid=".((int) $elementSelectId);
1949 1949
 		} else {
@@ -2380,7 +2380,7 @@  discard block
 block discarded – undo
2380 2380
 		require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
2381 2381
 		$taskstatic = new Task($this->db);
2382 2382
 
2383
-		$this->lines = $taskstatic->getTasksArray(0, $user, $this->id, 0, 0, '',  '-1', '', 0, 0, array(),  0,  array(),  0,  $loadRoleMode);
2383
+		$this->lines = $taskstatic->getTasksArray(0, $user, $this->id, 0, 0, '', '-1', '', 0, 0, array(), 0, array(), 0, $loadRoleMode);
2384 2384
 		return 1;
2385 2385
 	}
2386 2386
 
@@ -2451,7 +2451,7 @@  discard block
 block discarded – undo
2451 2451
 			$return .= '<br><div class="info-box-ref tdoverflowmax150 inline-block valignmiddle">'.$this->thirdparty->getNomUrl(1);
2452 2452
 			$return .= '</div><div class="inline-block valignmiddle">';
2453 2453
 			$return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone');
2454
-			$return .='</div>';
2454
+			$return .= '</div>';
2455 2455
 		}
2456 2456
 		if (!empty($arraydata['assignedusers'])) {
2457 2457
 			$return .= '<br>';
Please login to merge, or discard this patch.
htdocs/admin/system/modules.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -286,19 +286,19 @@
 block discarded – undo
286 286
 
287 287
 // sort list
288 288
 if ($sortfield == "name" && $sortorder == "asc") {
289
-	usort($moduleList, function (stdClass $a, stdClass $b) {
289
+	usort($moduleList, function(stdClass $a, stdClass $b) {
290 290
 		return strcasecmp($a->name, $b->name);
291 291
 	});
292 292
 } elseif ($sortfield == "name" && $sortorder == "desc") {
293
-	usort($moduleList, function (stdClass $a, stdClass $b) {
293
+	usort($moduleList, function(stdClass $a, stdClass $b) {
294 294
 		return strcasecmp($b->name, $a->name);
295 295
 	});
296 296
 } elseif ($sortfield == "version" && $sortorder == "asc") {
297
-	usort($moduleList, function (stdClass $a, stdClass $b) {
297
+	usort($moduleList, function(stdClass $a, stdClass $b) {
298 298
 		return strcasecmp($a->version, $b->version);
299 299
 	});
300 300
 } elseif ($sortfield == "version" && $sortorder == "desc") {
301
-	usort($moduleList, function (stdClass $a, stdClass $b) {
301
+	usort($moduleList, function(stdClass $a, stdClass $b) {
302 302
 		return strcasecmp($b->version, $a->version);
303 303
 	});
304 304
 } elseif ($sortfield == "id" && $sortorder == "asc") {
Please login to merge, or discard this patch.