Completed
Branch develop (c23a95)
by
unknown
18:46
created
htdocs/core/class/extrafields.class.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1860,7 +1860,9 @@
 block discarded – undo
1860 1860
 						}
1861 1861
 					}
1862 1862
 				}
1863
-				if (!empty($toprint)) $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
1863
+				if (!empty($toprint)) {
1864
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
1865
+				}
1864 1866
 			} else {
1865 1867
 				dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
1866 1868
 			}
Please login to merge, or discard this patch.
htdocs/product/stock/stocktransfer/stocktransfer_note.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,9 @@
 block discarded – undo
51 51
 
52 52
 // Load object
53 53
 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once  // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
54
-if ($id > 0 || !empty($ref)) $upload_dir = $conf->stocktransfer->multidir_output[$object->entity]."/".$object->id;
54
+if ($id > 0 || !empty($ref)) {
55
+	$upload_dir = $conf->stocktransfer->multidir_output[$object->entity]."/".$object->id;
56
+}
55 57
 
56 58
 $permissionnote = $user->rights->stocktransfer->stocktransfer->write; // Used by the include of actions_setnotes.inc.php
57 59
 $permissiontoadd = $user->rights->stocktransfer->stocktransfer->write; // Used by the include of actions_addupdatedelete.inc.php
Please login to merge, or discard this patch.
htdocs/product/stock/stocktransfer/stocktransfer_contact.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,9 @@  discard block
 block discarded – undo
35 35
 $action = GETPOST('action', 'alpha');
36 36
 
37 37
 // Security check
38
-if ($user->socid) $socid = $user->socid;
38
+if ($user->socid) {
39
+	$socid = $user->socid;
40
+}
39 41
 
40 42
 $result = restrictedArea($user, 'stocktransfer', $id, '', 'stocktransfer');
41 43
 
@@ -175,7 +177,9 @@  discard block
 block discarded – undo
175 177
 	$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
176 178
 	foreach ($dirtpls as $reldir) {
177 179
 		$res = @include dol_buildpath($reldir.'/contacts.tpl.php');
178
-		if ($res) break;
180
+		if ($res) {
181
+			break;
182
+		}
179 183
 	}
180 184
 }
181 185
 
Please login to merge, or discard this patch.
htdocs/contrat/class/contrat.class.php 1 patch
Braces   +7 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2637,7 +2637,9 @@  discard block
 block discarded – undo
2637 2637
 		$sql.= ' WHERE cd.fk_contrat = c.rowid';
2638 2638
 		$sql.= " AND date_format(cd.date_fin_validite, '%Y-%m-%d') <= date_format('".$this->db->idate($enddatetoscan)."', '%Y-%m-%d')";
2639 2639
 		$sql.= " AND cd.statut = 4";
2640
-		if ($thirdparty_id > 0) $sql.=" AND c.fk_soc = ".((int) $thirdparty_id);
2640
+		if ($thirdparty_id > 0) {
2641
+			$sql.=" AND c.fk_soc = ".((int) $thirdparty_id);
2642
+		}
2641 2643
 		//print $sql;
2642 2644
 
2643 2645
 		$resql = $this->db->query($sql);
@@ -2682,7 +2684,10 @@  discard block
 block discarded – undo
2682 2684
 						//dol_sort_array($contract->linkedObjects['facture'], 'date');
2683 2685
 						$someinvoicenotpaid=0;
2684 2686
 						foreach ($object->linkedObjects['facture'] as $idinvoice => $invoice) {
2685
-							if ($invoice->statut == Facture::STATUS_DRAFT) continue;	// Draft invoice are not invoice not paid
2687
+							if ($invoice->statut == Facture::STATUS_DRAFT) {
2688
+								continue;
2689
+							}
2690
+							// Draft invoice are not invoice not paid
2686 2691
 
2687 2692
 							if (empty($invoice->paye)) {
2688 2693
 								$someinvoicenotpaid++;
Please login to merge, or discard this patch.
htdocs/product/class/productfournisseurprice.class.php 1 patch
Braces   +59 added lines, -21 removed lines patch added patch discarded remove patch
@@ -177,8 +177,12 @@  discard block
 block discarded – undo
177 177
 
178 178
 		$this->db = $db;
179 179
 
180
-		if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0;
181
-		if (!isModEnabled('multicompany') && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0;
180
+		if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
181
+			$this->fields['rowid']['visible'] = 0;
182
+		}
183
+		if (!isModEnabled('multicompany') && isset($this->fields['entity'])) {
184
+			$this->fields['entity']['enabled'] = 0;
185
+		}
182 186
 
183 187
 		// Unset fields that are disabled
184 188
 		foreach ($this->fields as $key => $val) {
@@ -220,7 +224,9 @@  discard block
 block discarded – undo
220 224
 
221 225
 		// Load source object
222 226
 		$result = $object->fetchCommon($fromid);
223
-		if ($result > 0 && !empty($object->table_element_line)) $object->fetchLines();
227
+		if ($result > 0 && !empty($object->table_element_line)) {
228
+			$object->fetchLines();
229
+		}
224 230
 
225 231
 		// get lines so they will be clone
226 232
 		//foreach($this->lines as $line)
@@ -232,8 +238,12 @@  discard block
 block discarded – undo
232 238
 		unset($object->import_key);
233 239
 
234 240
 		// Clear fields
235
-		if (property_exists($object, 'ref')) $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default'];
236
-		if (property_exists($object, 'label')) $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default'];
241
+		if (property_exists($object, 'ref')) {
242
+			$object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default'];
243
+		}
244
+		if (property_exists($object, 'label')) {
245
+			$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default'];
246
+		}
237 247
 		if (property_exists($object, 'status')) { $object->status = self::STATUS_DRAFT; }
238 248
 		if (property_exists($object, 'date_creation')) { $object->date_creation = dol_now(); }
239 249
 		if (property_exists($object, 'date_modification')) { $object->date_modification = null; }
@@ -270,8 +280,9 @@  discard block
 block discarded – undo
270 280
 		if (!$error) {
271 281
 			// copy external contacts if same company
272 282
 			if (property_exists($this, 'socid') && $this->socid == $object->socid) {
273
-				if ($this->copy_linked_contact($object, 'external') < 0)
274
-					$error++;
283
+				if ($this->copy_linked_contact($object, 'external') < 0) {
284
+									$error++;
285
+				}
275 286
 			}
276 287
 		}
277 288
 
@@ -320,8 +331,11 @@  discard block
 block discarded – undo
320 331
 		$sql = "SELECT ";
321 332
 		$sql .= $this->getFieldList();
322 333
 		$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
323
-		if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .= " WHERE t.entity IN (".getEntity($this->element).")";
324
-		else $sql .= " WHERE 1 = 1";
334
+		if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
335
+			$sql .= " WHERE t.entity IN (".getEntity($this->element).")";
336
+		} else {
337
+			$sql .= " WHERE 1 = 1";
338
+		}
325 339
 		// Manage filter
326 340
 		$sqlwhere = array();
327 341
 		if (count($filter) > 0) {
@@ -437,8 +451,12 @@  discard block
 block discarded – undo
437 451
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element;
438 452
 			$sql .= " SET ref = '".$this->db->escape($num)."',";
439 453
 			$sql .= " status = ".self::STATUS_VALIDATED;
440
-			if (!empty($this->fields['date_validation'])) $sql .= ", date_validation = '".$this->db->idate($now)."'";
441
-			if (!empty($this->fields['fk_user_valid'])) $sql .= ", fk_user_valid = ".$user->id;
454
+			if (!empty($this->fields['date_validation'])) {
455
+				$sql .= ", date_validation = '".$this->db->idate($now)."'";
456
+			}
457
+			if (!empty($this->fields['fk_user_valid'])) {
458
+				$sql .= ", fk_user_valid = ".$user->id;
459
+			}
442 460
 			$sql .= " WHERE rowid = ".((int) $this->id);
443 461
 
444 462
 			dol_syslog(get_class($this)."::validate()", LOG_DEBUG);
@@ -452,7 +470,9 @@  discard block
 block discarded – undo
452 470
 			if (!$error && !$notrigger) {
453 471
 				// Call trigger
454 472
 				$result = $this->call_trigger('PRODUCTFOURNISSEURPRICE_VALIDATE', $user);
455
-				if ($result < 0) $error++;
473
+				if ($result < 0) {
474
+					$error++;
475
+				}
456 476
 				// End call triggers
457 477
 			}
458 478
 		}
@@ -573,7 +593,10 @@  discard block
 block discarded – undo
573 593
 	{
574 594
 		global $conf, $langs, $hookmanager;
575 595
 
576
-		if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
596
+		if (!empty($conf->dol_no_mouse_hover)) {
597
+			$notooltip = 1;
598
+		}
599
+		// Force disable tooltips
577 600
 
578 601
 		$result = '';
579 602
 
@@ -589,8 +612,12 @@  discard block
 block discarded – undo
589 612
 		if ($option != 'nolink') {
590 613
 			// Add param to save lastsearch_values or not
591 614
 			$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
592
-			if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
593
-			if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
615
+			if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
616
+				$add_save_lastsearch_values = 1;
617
+			}
618
+			if ($add_save_lastsearch_values) {
619
+				$url .= '&save_lastsearch_values=1';
620
+			}
594 621
 		}
595 622
 
596 623
 		$linkclose = '';
@@ -601,7 +628,9 @@  discard block
 block discarded – undo
601 628
 			}
602 629
 			$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
603 630
 			$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
604
-		} else $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
631
+		} else {
632
+			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
633
+		}
605 634
 
606 635
 		$linkstart = '<a href="'.$url.'"';
607 636
 		$linkstart .= $linkclose.'>';
@@ -610,7 +639,9 @@  discard block
 block discarded – undo
610 639
 		$result .= $linkstart;
611 640
 
612 641
 		if (empty($this->showphoto_on_popup)) {
613
-			if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
642
+			if ($withpicto) {
643
+				$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
644
+			}
614 645
 		} else {
615 646
 			if ($withpicto) {
616 647
 				require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -636,7 +667,9 @@  discard block
 block discarded – undo
636 667
 			}
637 668
 		}
638 669
 
639
-		if ($withpicto != 2) $result .= $this->ref;
670
+		if ($withpicto != 2) {
671
+			$result .= $this->ref;
672
+		}
640 673
 
641 674
 		$result .= $linkend;
642 675
 		//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
@@ -645,8 +678,11 @@  discard block
 block discarded – undo
645 678
 		$hookmanager->initHooks(array('productfournisseurpricedao'));
646 679
 		$parameters = array('id'=>$this->id, 'getnomurl' => &$result);
647 680
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
648
-		if ($reshook > 0) $result = $hookmanager->resPrint;
649
-		else $result .= $hookmanager->resPrint;
681
+		if ($reshook > 0) {
682
+			$result = $hookmanager->resPrint;
683
+		} else {
684
+			$result .= $hookmanager->resPrint;
685
+		}
650 686
 
651 687
 		return $result;
652 688
 	}
@@ -686,7 +722,9 @@  discard block
 block discarded – undo
686 722
 
687 723
 		$statusType = 'status'.$status;
688 724
 		//if ($status == self::STATUS_VALIDATED) $statusType = 'status1';
689
-		if ($status == self::STATUS_CANCELED) $statusType = 'status6';
725
+		if ($status == self::STATUS_CANCELED) {
726
+			$statusType = 'status6';
727
+		}
690 728
 
691 729
 		return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
692 730
 	}
Please login to merge, or discard this patch.
htdocs/asset/depreciation.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,11 +53,17 @@
 block discarded – undo
53 53
 }
54 54
 
55 55
 // Security check (enable the most restrictive one)
56
-if ($user->socid > 0) accessforbidden();
56
+if ($user->socid > 0) {
57
+	accessforbidden();
58
+}
57 59
 $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
58 60
 restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
59
-if (!isModEnabled('asset')) accessforbidden();
60
-if (!empty($object->not_depreciated)) accessforbidden();
61
+if (!isModEnabled('asset')) {
62
+	accessforbidden();
63
+}
64
+if (!empty($object->not_depreciated)) {
65
+	accessforbidden();
66
+}
61 67
 
62 68
 $object->asset_depreciation_options = &$assetdepreciationoptions;
63 69
 $result = $assetdepreciationoptions->fetchDeprecationOptions($object->id);
Please login to merge, or discard this patch.
htdocs/asset/card.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,12 +76,20 @@
 block discarded – undo
76 76
 $upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1];
77 77
 
78 78
 // Security check (enable the most restrictive one)
79
-if ($user->socid > 0) accessforbidden();
80
-if ($user->socid > 0) $socid = $user->socid;
79
+if ($user->socid > 0) {
80
+	accessforbidden();
81
+}
82
+if ($user->socid > 0) {
83
+	$socid = $user->socid;
84
+}
81 85
 $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
82 86
 restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
83
-if (!isModEnabled('asset')) accessforbidden();
84
-if (!$permissiontoread) accessforbidden();
87
+if (!isModEnabled('asset')) {
88
+	accessforbidden();
89
+}
90
+if (!$permissiontoread) {
91
+	accessforbidden();
92
+}
85 93
 
86 94
 
87 95
 /*
Please login to merge, or discard this patch.
htdocs/asset/model/card.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,12 +76,20 @@
 block discarded – undo
76 76
 $upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1];
77 77
 
78 78
 // Security check (enable the most restrictive one)
79
-if ($user->socid > 0) accessforbidden();
80
-if ($user->socid > 0) $socid = $user->socid;
79
+if ($user->socid > 0) {
80
+	accessforbidden();
81
+}
82
+if ($user->socid > 0) {
83
+	$socid = $user->socid;
84
+}
81 85
 $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
82 86
 restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
83
-if (!isModEnabled('asset')) accessforbidden();
84
-if (!$permissiontoread) accessforbidden();
87
+if (!isModEnabled('asset')) {
88
+	accessforbidden();
89
+}
90
+if (!$permissiontoread) {
91
+	accessforbidden();
92
+}
85 93
 
86 94
 
87 95
 /*
Please login to merge, or discard this patch.
htdocs/asset/model/list.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -140,8 +140,12 @@  discard block
 block discarded – undo
140 140
 }
141 141
 $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
142 142
 restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
143
-if (!isModEnabled('asset')) accessforbidden();
144
-if (!$permissiontoread) accessforbidden();
143
+if (!isModEnabled('asset')) {
144
+	accessforbidden();
145
+}
146
+if (!$permissiontoread) {
147
+	accessforbidden();
148
+}
145 149
 
146 150
 /*
147 151
  * Actions
@@ -169,7 +173,9 @@  discard block
 block discarded – undo
169 173
 	if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
170 174
 		foreach ($object->fields as $key => $val) {
171 175
 			$search[$key] = '';
172
-			if ($key == 'fk_pays') $search[$key] = $mysoc->country_id;
176
+			if ($key == 'fk_pays') {
177
+				$search[$key] = $mysoc->country_id;
178
+			}
173 179
 			if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
174 180
 				$search[$key.'_dtstart'] = '';
175 181
 				$search[$key.'_dtend'] = '';
Please login to merge, or discard this patch.