Completed
Branch develop (b66a18)
by
unknown
14:24
created
htdocs/eventorganization/conferenceorbooth_contact.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	accessforbidden();
74 74
 }
75 75
 
76
-$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0);
76
+$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
77 77
 $result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
78 78
 
79 79
 $permissiontoread = $user->rights->eventorganization->read;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 if ($user->socid > 0) {
88 88
 	accessforbidden();
89 89
 }
90
-$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0);
90
+$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
91 91
 $result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
92 92
 
93 93
 if (!$permissiontoread) {
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
112 112
 
113 113
 	if ($result >= 0) {
114
-		header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject)?'&withproject=1':''));
114
+		header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject) ? '&withproject=1' : ''));
115 115
 		exit;
116 116
 	} else {
117 117
 		if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	$result = $object->delete_contact($lineid);
130 130
 
131 131
 	if ($result >= 0) {
132
-		header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject)?'&withproject=1':''));
132
+		header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject) ? '&withproject=1' : ''));
133 133
 		exit;
134 134
 	} else {
135 135
 		dol_print_error($db);
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 if (!empty($projectstatic->socid)) {
166 166
 	$projectstatic->fetch_thirdparty();
167 167
 }
168
-$withProjectUrl='';
168
+$withProjectUrl = '';
169 169
 $object->project = clone $projectstatic;
170 170
 
171 171
 if (!empty($withproject)) {
Please login to merge, or discard this patch.
htdocs/product/stock/stocktransfer/class/stocktransfer.class.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	/**
104 104
 	 * @var array  Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
105 105
 	 */
106
-	public $fields=array(
106
+	public $fields = array(
107 107
 		'rowid'                    => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"),
108 108
 		'entity'                   => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>'1', 'position'=>1, 'default'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"),
109 109
 		'ref'                      => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"),
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 	 */
352 352
 	public function fetchLines()
353 353
 	{
354
-		require_once DOL_DOCUMENT_ROOT . '/product/stock/stocktransfer/class/stocktransferline.class.php';
354
+		require_once DOL_DOCUMENT_ROOT.'/product/stock/stocktransfer/class/stocktransferline.class.php';
355 355
 		$this->lines = array();
356 356
 
357 357
 		$result = $this->fetchLinesCommon();
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 
387 387
 		if (empty($this->lines)) $this->fetchLines();
388 388
 		if (!empty($this->lines)) {
389
-			foreach ($this->lines as $l) $total_pmp+= ($l->pmp * $l->qty);
389
+			foreach ($this->lines as $l) $total_pmp += ($l->pmp * $l->qty);
390 390
 		}
391 391
 
392 392
 		return $total_pmp;
Please login to merge, or discard this patch.
Braces   +77 added lines, -27 removed lines patch added patch discarded remove patch
@@ -182,8 +182,12 @@  discard block
 block discarded – undo
182 182
 		$this->db = $db;
183 183
 		$this->origin_type = 'StockTransfer@product/stock/stocktransfer';
184 184
 
185
-		if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0;
186
-		if (!isModEnabled('multicompany') && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0;
185
+		if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
186
+			$this->fields['rowid']['visible'] = 0;
187
+		}
188
+		if (!isModEnabled('multicompany') && isset($this->fields['entity'])) {
189
+			$this->fields['entity']['enabled'] = 0;
190
+		}
187 191
 
188 192
 		// Example to show how to set values of fields definition dynamically
189 193
 		/*if ($user->rights->stocktransfer->stocktransfer->read) {
@@ -220,10 +224,16 @@  discard block
 block discarded – undo
220 224
 	public function create(User $user, $notrigger = false)
221 225
 	{
222 226
 		$model_pdf = GETPOST('model');
223
-		if (!empty($model_pdf)) $this->model_pdf = $model_pdf;
227
+		if (!empty($model_pdf)) {
228
+			$this->model_pdf = $model_pdf;
229
+		}
224 230
 		$this->status = (int) $this->status;
225
-		if ($this->fk_warehouse_source <= 0) $this->fk_warehouse_source = 0;
226
-		if ($this->fk_warehouse_destination <= 0) $this->fk_warehouse_destination = 0;
231
+		if ($this->fk_warehouse_source <= 0) {
232
+			$this->fk_warehouse_source = 0;
233
+		}
234
+		if ($this->fk_warehouse_destination <= 0) {
235
+			$this->fk_warehouse_destination = 0;
236
+		}
227 237
 		return $this->createCommon($user, $notrigger);
228 238
 	}
229 239
 
@@ -247,7 +257,9 @@  discard block
 block discarded – undo
247 257
 
248 258
 		// Load source object
249 259
 		$result = $object->fetchCommon($fromid);
250
-		if ($result > 0 && !empty($object->table_element_line)) $object->fetchLines();
260
+		if ($result > 0 && !empty($object->table_element_line)) {
261
+			$object->fetchLines();
262
+		}
251 263
 
252 264
 		// get lines so they will be clone
253 265
 		//foreach($this->lines as $line)
@@ -299,8 +311,9 @@  discard block
 block discarded – undo
299 311
 		if (!$error) {
300 312
 			// copy external contacts if same company
301 313
 			if (property_exists($this, 'socid') && $this->socid == $object->socid) {
302
-				if ($this->copy_linked_contact($object, 'external') < 0)
303
-					$error++;
314
+				if ($this->copy_linked_contact($object, 'external') < 0) {
315
+									$error++;
316
+				}
304 317
 			}
305 318
 		}
306 319
 
@@ -326,7 +339,9 @@  discard block
 block discarded – undo
326 339
 	public function fetch($id, $ref = null)
327 340
 	{
328 341
 		$result = $this->fetchCommon($id, $ref);
329
-		if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines();
342
+		if ($result > 0 && !empty($this->table_element_line)) {
343
+			$this->fetchLines();
344
+		}
330 345
 		return $result;
331 346
 	}
332 347
 
@@ -370,9 +385,13 @@  discard block
 block discarded – undo
370 385
 
371 386
 		$total_pmp = 0;
372 387
 
373
-		if (empty($this->lines)) $this->fetchLines();
388
+		if (empty($this->lines)) {
389
+			$this->fetchLines();
390
+		}
374 391
 		if (!empty($this->lines)) {
375
-			foreach ($this->lines as $l) $total_pmp+= ($l->pmp * $l->qty);
392
+			foreach ($this->lines as $l) {
393
+				$total_pmp+= ($l->pmp * $l->qty);
394
+			}
376 395
 		}
377 396
 
378 397
 		return $total_pmp;
@@ -400,8 +419,11 @@  discard block
 block discarded – undo
400 419
 		$sql = 'SELECT ';
401 420
 		$sql .= $this->getFieldList();
402 421
 		$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
403
-		if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .= ' WHERE t.entity IN ('.getEntity($this->element).')';
404
-		else $sql .= ' WHERE 1 = 1';
422
+		if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
423
+			$sql .= ' WHERE t.entity IN ('.getEntity($this->element).')';
424
+		} else {
425
+			$sql .= ' WHERE 1 = 1';
426
+		}
405 427
 		// Manage filter
406 428
 		$sqlwhere = array();
407 429
 		if (count($filter) > 0) {
@@ -464,8 +486,12 @@  discard block
 block discarded – undo
464 486
 	{
465 487
 		$this->tms = ''; // Will be done automatically because tms field is on update cascade
466 488
 		$res = $this->updateCommon($user, $notrigger);
467
-		if ($this->socid > 0 || $this->fk_soc > 0 && empty($this->thirdparty)) $this->fetch_thirdparty();
468
-		if (empty($this->socid) && empty($this->fk_soc)) unset($this->thirdparty);
489
+		if ($this->socid > 0 || $this->fk_soc > 0 && empty($this->thirdparty)) {
490
+			$this->fetch_thirdparty();
491
+		}
492
+		if (empty($this->socid) && empty($this->fk_soc)) {
493
+			unset($this->thirdparty);
494
+		}
469 495
 		return $res;
470 496
 	}
471 497
 
@@ -552,8 +578,12 @@  discard block
 block discarded – undo
552 578
 			$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
553 579
 			$sql .= " SET ref = '".$this->db->escape($num)."',";
554 580
 			$sql .= " status = ".self::STATUS_VALIDATED;
555
-			if (!empty($this->fields['date_validation'])) $sql .= ", date_validation = '".$this->db->idate($now)."',";
556
-			if (!empty($this->fields['fk_user_valid'])) $sql .= ", fk_user_valid = ".((int) $user->id);
581
+			if (!empty($this->fields['date_validation'])) {
582
+				$sql .= ", date_validation = '".$this->db->idate($now)."',";
583
+			}
584
+			if (!empty($this->fields['fk_user_valid'])) {
585
+				$sql .= ", fk_user_valid = ".((int) $user->id);
586
+			}
557 587
 			$sql .= " WHERE rowid = ".((int) $this->id);
558 588
 
559 589
 			dol_syslog(get_class($this)."::validate()", LOG_DEBUG);
@@ -567,7 +597,9 @@  discard block
 block discarded – undo
567 597
 			if (!$error && !$notrigger) {
568 598
 				// Call trigger
569 599
 				$result = $this->call_trigger('STOCKTRANSFER_VALIDATE', $user);
570
-				if ($result < 0) $error++;
600
+				if ($result < 0) {
601
+					$error++;
602
+				}
571 603
 				// End call triggers
572 604
 			}
573 605
 		}
@@ -709,7 +741,10 @@  discard block
 block discarded – undo
709 741
 	{
710 742
 		global $conf, $langs, $hookmanager;
711 743
 
712
-		if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
744
+		if (!empty($conf->dol_no_mouse_hover)) {
745
+			$notooltip = 1;
746
+		}
747
+		// Force disable tooltips
713 748
 
714 749
 		$result = '';
715 750
 
@@ -725,8 +760,12 @@  discard block
 block discarded – undo
725 760
 		if ($option != 'nolink') {
726 761
 			// Add param to save lastsearch_values or not
727 762
 			$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
728
-			if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
729
-			if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
763
+			if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
764
+				$add_save_lastsearch_values = 1;
765
+			}
766
+			if ($add_save_lastsearch_values) {
767
+				$url .= '&save_lastsearch_values=1';
768
+			}
730 769
 		}
731 770
 
732 771
 		$linkclose = '';
@@ -737,7 +776,9 @@  discard block
 block discarded – undo
737 776
 			}
738 777
 			$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
739 778
 			$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
740
-		} else $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
779
+		} else {
780
+			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
781
+		}
741 782
 
742 783
 		$linkstart = '<a href="'.$url.'"';
743 784
 		$linkstart .= $linkclose.'>';
@@ -746,7 +787,9 @@  discard block
 block discarded – undo
746 787
 		$result .= $linkstart;
747 788
 
748 789
 		if (empty($this->showphoto_on_popup)) {
749
-			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);
790
+			if ($withpicto) {
791
+				$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);
792
+			}
750 793
 		} else {
751 794
 			if ($withpicto) {
752 795
 				require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -772,7 +815,9 @@  discard block
 block discarded – undo
772 815
 			}
773 816
 		}
774 817
 
775
-		if ($withpicto != 2) $result .= $this->ref;
818
+		if ($withpicto != 2) {
819
+			$result .= $this->ref;
820
+		}
776 821
 
777 822
 		$result .= $linkend;
778 823
 		//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
@@ -781,8 +826,11 @@  discard block
 block discarded – undo
781 826
 		$hookmanager->initHooks(array('stocktransferdao'));
782 827
 		$parameters = array('id'=>$this->id, 'getnomurl'=>$result);
783 828
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
784
-		if ($reshook > 0) $result = $hookmanager->resPrint;
785
-		else $result .= $hookmanager->resPrint;
829
+		if ($reshook > 0) {
830
+			$result = $hookmanager->resPrint;
831
+		} else {
832
+			$result .= $hookmanager->resPrint;
833
+		}
786 834
 
787 835
 		return $result;
788 836
 	}
@@ -824,7 +872,9 @@  discard block
 block discarded – undo
824 872
 
825 873
 		$statusType = 'status'.$status;
826 874
 		//if ($status == self::STATUS_VALIDATED) $statusType = 'status1';
827
-		if ($status == self::STATUS_CLOSED) $statusType = 'status6';
875
+		if ($status == self::STATUS_CLOSED) {
876
+			$statusType = 'status6';
877
+		}
828 878
 
829 879
 		return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
830 880
 	}
Please login to merge, or discard this patch.
htdocs/asset/depreciation.php 2 patches
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.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
 
25 25
 // Load Dolibarr environment
26 26
 require '../main.inc.php';
27
-require_once DOL_DOCUMENT_ROOT . '/core/lib/asset.lib.php';
28
-require_once DOL_DOCUMENT_ROOT . '/asset/class/asset.class.php';
29
-require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php';
27
+require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php';
28
+require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php';
29
+require_once DOL_DOCUMENT_ROOT.'/asset/class/assetdepreciationoptions.class.php';
30 30
 
31 31
 // Load translation files required by the page
32 32
 $langs->loadLangs(array("assets", "companies"));
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 $extrafields->fetch_name_optionals_label($object->table_element);
49 49
 
50 50
 // Load object
51
-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
51
+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
52 52
 if ($id > 0 || !empty($ref)) {
53
-	$upload_dir = $conf->asset->multidir_output[$object->entity] . "/" . $object->id;
53
+	$upload_dir = $conf->asset->multidir_output[$object->entity]."/".$object->id;
54 54
 }
55 55
 
56 56
 // Security check (enable the most restrictive one)
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
 	// Object card
100 100
 	// ------------------------------------------------------------
101
-	$linkback = '<a href="' . DOL_URL_ROOT . '/asset/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
101
+	$linkback = '<a href="'.DOL_URL_ROOT.'/asset/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
102 102
 
103 103
 	$morehtmlref = '<div class="refidno">';
104 104
 	$morehtmlref .= '</div>';
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
 				print '<div class="fichecenter">';
135 135
 				print '<div class="fichehalfleft">';
136 136
 				print '<div class="underbanner clearboth"></div>';
137
-				print '<table class="border centpercent tableforfield">' . "\n";
138
-				print '<tr><td class="titlefield">' . $langs->trans('AssetBaseDepreciationHT') . '</td><td>' . price($depreciation_info['base_depreciation_ht']) . '</td></tr>';
139
-				print '<tr><td class="titlefield">' . $langs->trans('AssetDepreciationBeginDate') . '</td><td>' . dol_print_date($object->date_start > $object->date_acquisition ? $object->date_start : $object->date_acquisition, 'day') . '</td></tr>';
137
+				print '<table class="border centpercent tableforfield">'."\n";
138
+				print '<tr><td class="titlefield">'.$langs->trans('AssetBaseDepreciationHT').'</td><td>'.price($depreciation_info['base_depreciation_ht']).'</td></tr>';
139
+				print '<tr><td class="titlefield">'.$langs->trans('AssetDepreciationBeginDate').'</td><td>'.dol_print_date($object->date_start > $object->date_acquisition ? $object->date_start : $object->date_acquisition, 'day').'</td></tr>';
140 140
 				print '</table>';
141 141
 
142 142
 				// We close div and reopen for second column
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
 
146 146
 				print '<div class="underbanner clearboth"></div>';
147 147
 				print '<table class="border centpercent tableforfield">';
148
-				print '<tr><td class="titlefield">' . $langs->trans('AssetDepreciationDuration') . '</td><td>' . $depreciation_info['duration'] . ' ( ' . $depreciation_info['duration_type'] . ' )</td></tr>';
149
-				print '<tr><td class="titlefield">' . $langs->trans('AssetDepreciationRate') . '</td><td>' . $depreciation_info['rate'] . '</td></tr>';
148
+				print '<tr><td class="titlefield">'.$langs->trans('AssetDepreciationDuration').'</td><td>'.$depreciation_info['duration'].' ( '.$depreciation_info['duration_type'].' )</td></tr>';
149
+				print '<tr><td class="titlefield">'.$langs->trans('AssetDepreciationRate').'</td><td>'.$depreciation_info['rate'].'</td></tr>';
150 150
 				print '</table>';
151 151
 				print '</div>';
152 152
 				print '</div>';
@@ -160,21 +160,21 @@  discard block
 block discarded – undo
160 160
 
161 161
 				print '<tr class="liste_titre">';
162 162
 				print '<td class="width20"></td>';
163
-				print '<td>' . $langs->trans("Ref") . '</td>';
164
-				print '<td class="center">' . $langs->trans("AssetDepreciationDate") . '</td>';
165
-				print '<td class="right">' . $langs->trans("AssetDepreciationHT") . '</td>';
166
-				print '<td class="right">' . $langs->trans("AssetCumulativeDepreciationHT") . '</td>';
167
-				print '<td class="right">' . $langs->trans("AssetResidualHT") . '</td>';
163
+				print '<td>'.$langs->trans("Ref").'</td>';
164
+				print '<td class="center">'.$langs->trans("AssetDepreciationDate").'</td>';
165
+				print '<td class="right">'.$langs->trans("AssetDepreciationHT").'</td>';
166
+				print '<td class="right">'.$langs->trans("AssetCumulativeDepreciationHT").'</td>';
167
+				print '<td class="right">'.$langs->trans("AssetResidualHT").'</td>';
168 168
 				print '</tr>';
169 169
 
170 170
 				if (empty($lines)) {
171
-					print '<tr><td class="impair center" colspan="6"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
171
+					print '<tr><td class="impair center" colspan="6"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
172 172
 				} else {
173 173
 					foreach ($lines as $line) {
174 174
 						print '<tr class="oddeven">';
175
-						print '<td>' . ($line['bookkeeping'] ? $bookkeeping_icon : ($line['depreciation_date'] > $now ? $future_icon : '')) . '</td>';
176
-						print '<td >' . (empty($line['ref']) ? $langs->trans('AssetDepreciationReversal') : $line['ref']) . '</td>';
177
-						print '<td class="center">' . dol_print_date($line['depreciation_date'], 'day') . '</td>';
175
+						print '<td>'.($line['bookkeeping'] ? $bookkeeping_icon : ($line['depreciation_date'] > $now ? $future_icon : '')).'</td>';
176
+						print '<td >'.(empty($line['ref']) ? $langs->trans('AssetDepreciationReversal') : $line['ref']).'</td>';
177
+						print '<td class="center">'.dol_print_date($line['depreciation_date'], 'day').'</td>';
178 178
 						print '<td class="right">';
179 179
 						print price($line['depreciation_ht']);
180 180
 						print '</td>';
Please login to merge, or discard this patch.
htdocs/asset/card.php 2 patches
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.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	}
182 182
 	if (GETPOSTISSET('supplier_invoice_id')) {
183 183
 		$object->fields['supplier_invoice_id'] = array('type' => 'integer:FactureFournisseur:fourn/class/fournisseur.facture.class.php:1:entity IN (__SHARED_ENTITIES__)', 'label' => 'SupplierInvoice', 'enabled' => '1', 'noteditable' => '1', 'position' => 280, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => '1',);
184
-		print '<input type="hidden" name="supplier_invoice_id" value="' . GETPOST('supplier_invoice_id', 'int') . '">';
184
+		print '<input type="hidden" name="supplier_invoice_id" value="'.GETPOST('supplier_invoice_id', 'int').'">';
185 185
 	}
186 186
 
187 187
 	print dol_get_fiche_head(array(), '');
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 			array('type' => 'checkbox', 'name' => 'disposal_depreciated', 'label' => $langs->trans("AssetDisposalDepreciated"), 'value' => $disposal_depreciated),
285 285
 			array('type' => 'checkbox', 'name' => 'disposal_subject_to_vat', 'label' => $langs->trans("AssetDisposalSubjectToVat"), 'value' => $disposal_subject_to_vat),
286 286
 		);
287
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref . ' - ' . $object->label), 'confirm_disposal', $formquestion, 'yes', 1);
287
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref.' - '.$object->label), 'confirm_disposal', $formquestion, 'yes', 1);
288 288
 	} elseif ($action == 'reopen') {
289 289
 		// Re-open
290 290
 		// Create an array for form
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	print '<table class="border centpercent tableforfield">'."\n";
329 329
 
330 330
 	// Common attributes
331
-	$keyforbreak='date_acquisition';	// We change column just before this field
331
+	$keyforbreak = 'date_acquisition'; // We change column just before this field
332 332
 	//unset($object->fields['fk_project']);				// Hide field already shown in banner
333 333
 	//unset($object->fields['fk_soc']);					// Hide field already shown in banner
334 334
 	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 
347 347
 	// Buttons for actions
348 348
 	if ($action != 'presend' && $action != 'editline') {
349
-		print '<div class="tabsAction">' . "\n";
349
+		print '<div class="tabsAction">'."\n";
350 350
 		$parameters = array();
351 351
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
352 352
 		if ($reshook < 0) {
@@ -356,26 +356,26 @@  discard block
 block discarded – undo
356 356
 		if (empty($reshook)) {
357 357
 			// Send
358 358
 			if (empty($user->socid)) {
359
-				print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle');
359
+				print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle');
360 360
 			}
361 361
 
362 362
 			if ($object->status == $object::STATUS_DRAFT) {
363
-				print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
363
+				print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
364 364
 			}
365 365
 
366 366
 			// Clone
367 367
 			//print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', false && $permissiontoadd);
368 368
 
369 369
 			if ($object->status == $object::STATUS_DRAFT) {
370
-				print dolGetButtonAction($langs->trans('AssetDisposal'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=disposal&token=' . newToken(), '', $permissiontoadd);
370
+				print dolGetButtonAction($langs->trans('AssetDisposal'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disposal&token='.newToken(), '', $permissiontoadd);
371 371
 			} else {
372
-				print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=reopen&token=' . newToken(), '', $permissiontoadd);
372
+				print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd);
373 373
 			}
374 374
 
375 375
 			// Delete (need delete permission, or if draft, just need create/modify permission)
376
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
376
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
377 377
 		}
378
-		print '</div>' . "\n";
378
+		print '</div>'."\n";
379 379
 	}
380 380
 
381 381
 	// Select mail models is same action as presend
Please login to merge, or discard this patch.
htdocs/asset/model/card.php 2 patches
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.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
 
25 25
 // Load Dolibarr environment
26 26
 require '../../main.inc.php';
27
-require_once DOL_DOCUMENT_ROOT . '/core/lib/asset.lib.php';
28
-require_once DOL_DOCUMENT_ROOT . '/asset/class/assetmodel.class.php';
29
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
30
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
27
+require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php';
28
+require_once DOL_DOCUMENT_ROOT.'/asset/class/assetmodel.class.php';
29
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
30
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
31 31
 
32 32
 // Load translation files required by the page
33 33
 $langs->loadLangs(array("assets", "other"));
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 // Initialize technical objects
46 46
 $object = new AssetModel($db);
47 47
 $extrafields = new ExtraFields($db);
48
-$diroutputmassaction = $conf->asset->dir_output . '/temp/massgeneration/' . $user->id;
48
+$diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id;
49 49
 $hookmanager->initHooks(array('assetmodelcard', 'globalcard')); // Note that conf->hooks_modules contains array
50 50
 
51 51
 // Fetch optionals attributes and labels
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 $search_all = GETPOST("search_all", 'alpha');
58 58
 $search = array();
59 59
 foreach ($object->fields as $key => $val) {
60
-	if (GETPOST('search_' . $key, 'alpha')) {
61
-		$search[$key] = GETPOST('search_' . $key, 'alpha');
60
+	if (GETPOST('search_'.$key, 'alpha')) {
61
+		$search[$key] = GETPOST('search_'.$key, 'alpha');
62 62
 	}
63 63
 }
64 64
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 }
68 68
 
69 69
 // Load object
70
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
70
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
71 71
 
72 72
 $permissiontoread = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')));
73 73
 $permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'write'))); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
@@ -98,14 +98,14 @@  discard block
 block discarded – undo
98 98
 if (empty($reshook)) {
99 99
 	$error = 0;
100 100
 
101
-	$backurlforlist = DOL_URL_ROOT . '/asset/model/list.php';
101
+	$backurlforlist = DOL_URL_ROOT.'/asset/model/list.php';
102 102
 
103 103
 	if (empty($backtopage) || ($cancel && empty($id))) {
104 104
 		if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
105 105
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
106 106
 				$backtopage = $backurlforlist;
107 107
 			} else {
108
-				$backtopage = DOL_URL_ROOT . '/asset/model/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__');
108
+				$backtopage = DOL_URL_ROOT.'/asset/model/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
109 109
 			}
110 110
 		}
111 111
 	}
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	}
122 122
 
123 123
 	// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
124
-	include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
124
+	include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
125 125
 }
126 126
 
127 127
 
@@ -134,22 +134,22 @@  discard block
 block discarded – undo
134 134
 $form = new Form($db);
135 135
 $formfile = new FormFile($db);
136 136
 
137
-$title = $langs->trans("AssetModel") . ' - ' . $langs->trans("Card");
137
+$title = $langs->trans("AssetModel").' - '.$langs->trans("Card");
138 138
 $help_url = '';
139 139
 llxHeader('', $title, $help_url);
140 140
 
141 141
 // Part to create
142 142
 if ($action == 'create') {
143
-	print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("AssetModel")), '', 'object_' . $object->picto);
143
+	print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("AssetModel")), '', 'object_'.$object->picto);
144 144
 
145
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
146
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
145
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
146
+	print '<input type="hidden" name="token" value="'.newToken().'">';
147 147
 	print '<input type="hidden" name="action" value="add">';
148 148
 	if ($backtopage) {
149
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
149
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
150 150
 	}
151 151
 	if ($backtopageforcancel) {
152
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
152
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
153 153
 	}
154 154
 
155 155
 	print dol_get_fiche_head(array(), '');
@@ -157,15 +157,15 @@  discard block
 block discarded – undo
157 157
 	// Set some default values
158 158
 	//if (! GETPOSTISSET('fieldname')) $_POST['fieldname'] = 'myvalue';
159 159
 
160
-	print '<table class="border centpercent tableforfieldcreate">' . "\n";
160
+	print '<table class="border centpercent tableforfieldcreate">'."\n";
161 161
 
162 162
 	// Common attributes
163
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
163
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
164 164
 
165 165
 	// Other attributes
166
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
166
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
167 167
 
168
-	print '</table>' . "\n";
168
+	print '</table>'."\n";
169 169
 
170 170
 	print dol_get_fiche_end();
171 171
 
@@ -178,28 +178,28 @@  discard block
 block discarded – undo
178 178
 
179 179
 // Part to edit record
180 180
 if (($id || $ref) && $action == 'edit') {
181
-	print load_fiche_titre($langs->trans("AssetModel"), '', 'object_' . $object->picto);
181
+	print load_fiche_titre($langs->trans("AssetModel"), '', 'object_'.$object->picto);
182 182
 
183
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
184
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
183
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
184
+	print '<input type="hidden" name="token" value="'.newToken().'">';
185 185
 	print '<input type="hidden" name="action" value="update">';
186
-	print '<input type="hidden" name="id" value="' . $object->id . '">';
186
+	print '<input type="hidden" name="id" value="'.$object->id.'">';
187 187
 	if ($backtopage) {
188
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
188
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
189 189
 	}
190 190
 	if ($backtopageforcancel) {
191
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
191
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
192 192
 	}
193 193
 
194 194
 	print dol_get_fiche_head();
195 195
 
196
-	print '<table class="border centpercent tableforfieldedit">' . "\n";
196
+	print '<table class="border centpercent tableforfieldedit">'."\n";
197 197
 
198 198
 	// Common attributes
199
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
199
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
200 200
 
201 201
 	// Other attributes
202
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
202
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
203 203
 
204 204
 	print '</table>';
205 205
 
@@ -221,12 +221,12 @@  discard block
 block discarded – undo
221 221
 
222 222
 	// Confirmation to delete
223 223
 	if ($action == 'delete') {
224
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteAssetModel'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
224
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteAssetModel'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
225 225
 	} elseif ($action == 'clone') {
226 226
 		// Clone confirmation
227 227
 		// Create an array for form
228 228
 		$formquestion = array();
229
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
229
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
230 230
 	}
231 231
 
232 232
 	// Call Hook formConfirm
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
 	// Object card
246 246
 	// ------------------------------------------------------------
247
-	$linkback = '<a href="' . DOL_URL_ROOT . '/asset/model/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
247
+	$linkback = '<a href="'.DOL_URL_ROOT.'/asset/model/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
248 248
 
249 249
 	$morehtmlref = '<div class="refidno">';
250 250
 	$morehtmlref .= '</div>';
@@ -256,13 +256,13 @@  discard block
 block discarded – undo
256 256
 	print '<div class="fichecenter">';
257 257
 	print '<div class="fichehalfleft">';
258 258
 	print '<div class="underbanner clearboth"></div>';
259
-	print '<table class="border centpercent tableforfield">' . "\n";
259
+	print '<table class="border centpercent tableforfield">'."\n";
260 260
 
261 261
 	// Common attributes
262
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
262
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
263 263
 
264 264
 	// Other attributes. Fields from hook formObjectOptions and Extrafields.
265
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
265
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
266 266
 
267 267
 	print '</table>';
268 268
 	print '</div>';
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 
276 276
 	// Buttons for actions
277 277
 	if ($action != 'editline') {
278
-		print '<div class="tabsAction">' . "\n";
278
+		print '<div class="tabsAction">'."\n";
279 279
 		$parameters = array();
280 280
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
281 281
 		if ($reshook < 0) {
@@ -284,16 +284,16 @@  discard block
 block discarded – undo
284 284
 
285 285
 		if (empty($reshook)) {
286 286
 			if ($object->status == $object::STATUS_DRAFT) {
287
-				print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
287
+				print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
288 288
 			}
289 289
 
290 290
 			// Back to draft
291 291
 			if ($object->status != $object::STATUS_DRAFT) {
292
-				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd);
292
+				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
293 293
 			}
294 294
 
295 295
 			if ($object->status != $object::STATUS_VALIDATED) {
296
-				print dolGetButtonAction($langs->trans('Enable'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=confirm_validate&confirm=yes&token=' . newToken(), '', $permissiontoadd);
296
+				print dolGetButtonAction($langs->trans('Enable'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd);
297 297
 			}
298 298
 
299 299
 			if ($object->status != $object::STATUS_CANCELED) {
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
 			}
302 302
 
303 303
 			// Clone
304
-			print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . (!empty($socid) ? '&socid=' . $socid : '') . '&action=clone&token=' . newToken(), '', $permissiontoadd);
304
+			print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($socid) ? '&socid='.$socid : '').'&action=clone&token='.newToken(), '', $permissiontoadd);
305 305
 
306 306
 			// Delete (need delete permission, or if draft, just need create/modify permission)
307
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
307
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
308 308
 		}
309
-		print '</div>' . "\n";
309
+		print '</div>'."\n";
310 310
 	}
311 311
 
312 312
 	print '<div class="fichecenter"><div class="fichehalfleft">';
Please login to merge, or discard this patch.
htdocs/asset/document.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,10 +75,14 @@
 block discarded – undo
75 75
 $permissiontoadd = $user->rights->asset->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
76 76
 
77 77
 // Security check (enable the most restrictive one)
78
-if ($user->socid > 0) accessforbidden();
78
+if ($user->socid > 0) {
79
+	accessforbidden();
80
+}
79 81
 $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
80 82
 restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
81
-if (!isModEnabled('asset')) accessforbidden();
83
+if (!isModEnabled('asset')) {
84
+	accessforbidden();
85
+}
82 86
 
83 87
 
84 88
 /*
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 	// Object card
119 119
 	// ------------------------------------------------------------
120
-	$linkback = '<a href="' . dol_buildpath('/asset/asset_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
120
+	$linkback = '<a href="'.dol_buildpath('/asset/asset_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
121 121
 
122 122
 	$morehtmlref = '<div class="refidno">';
123 123
 	$morehtmlref .= '</div>';
@@ -130,10 +130,10 @@  discard block
 block discarded – undo
130 130
 	print '<table class="border centpercent tableforfield">';
131 131
 
132 132
 	// Number of files
133
-	print '<tr><td class="titlefield">' . $langs->trans("NbOfAttachedFiles") . '</td><td colspan="3">' . count($filearray) . '</td></tr>';
133
+	print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
134 134
 
135 135
 	// Total size
136
-	print '<tr><td>' . $langs->trans("TotalSizeOfAttachedFiles") . '</td><td colspan="3">' . $totalsize . ' ' . $langs->trans("bytes") . '</td></tr>';
136
+	print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
137 137
 
138 138
 	print '</table>';
139 139
 
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
 	//  $permissiontoadd = 1;
147 147
 	$permtoedit = $user->hasRight('asset', 'write');
148 148
 	//  $permtoedit = 1;
149
-	$param = '&id=' . $object->id;
149
+	$param = '&id='.$object->id;
150 150
 
151 151
 	//$relativepathwithnofile='asset/' . dol_sanitizeFileName($object->id).'/';
152
-	$relativepathwithnofile = dol_sanitizeFileName($object->ref) . '/';
152
+	$relativepathwithnofile = dol_sanitizeFileName($object->ref).'/';
153 153
 
154
-	include DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
154
+	include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
155 155
 } else {
156 156
 	accessforbidden('', 0, 1);
157 157
 }
Please login to merge, or discard this patch.
htdocs/salaries/info.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,9 @@
 block discarded – undo
100 100
  * View
101 101
  */
102 102
 
103
-if (isModEnabled('project')) $formproject = new FormProjets($db);
103
+if (isModEnabled('project')) {
104
+	$formproject = new FormProjets($db);
105
+}
104 106
 
105 107
 $title = $langs->trans('Salary')." - ".$langs->trans('Info');
106 108
 $help_url = "";
Please login to merge, or discard this patch.
htdocs/delivery/card.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,10 +89,10 @@
 block discarded – undo
89 89
  */
90 90
 
91 91
 $parameters = array();
92
-$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);       // Note that $action and $object may have been modified by some hooks
92
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
93 93
 // Delete Link
94 94
 $permissiondellink = $user->rights->expedition->delivery->supprimer; // Used by the include of actions_dellink.inc.php
95
-include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';     // Must be include, not include_once
95
+include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
96 96
 
97 97
 if ($action == 'add') {
98 98
 	$db->begin();
Please login to merge, or discard this patch.
htdocs/core/modules/mailings/partnership.modules.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@
 block discarded – undo
222 222
 			$num = $this->db->num_rows($resql);
223 223
 
224 224
 			if (empty($conf->partnership->enabled)) {
225
-				$num = 0;   // Force empty list if category module is not enabled
225
+				$num = 0; // Force empty list if category module is not enabled
226 226
 			}
227 227
 
228 228
 			if ($num) {
Please login to merge, or discard this patch.