Completed
Branch develop (5d6cf7)
by
unknown
20:24
created
template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		$maxfilesizearray = getMaxFileSizeArray();
188 188
 		$maxmin = $maxfilesizearray['maxmin'];
189 189
 		if ($maxmin > 0) {
190
-			$texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
190
+			$texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
191 191
 		}
192 192
 		$texte .= ' <input type="file" name="uploadfile">';
193 193
 		$texte .= '<input type="hidden" value="MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH" name="keyforuploaddir">';
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 				$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
283 283
 				$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
284 284
 
285
-				$newfiletmp = $objectref . '_' . $newfiletmp;
285
+				$newfiletmp = $objectref.'_'.$newfiletmp;
286 286
 				//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
287 287
 
288 288
 				// Get extension (ods or odt)
@@ -292,11 +292,11 @@  discard block
 block discarded – undo
292 292
 					if ($format == '1') {
293 293
 						$format = '%Y%m%d%H%M%S';
294 294
 					}
295
-					$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
295
+					$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
296 296
 				} else {
297
-					$filename = $newfiletmp . '.' . $newfileformat;
297
+					$filename = $newfiletmp.'.'.$newfileformat;
298 298
 				}
299
-				$file = $dir . '/' . $filename;
299
+				$file = $dir.'/'.$filename;
300 300
 				//print "newdir=".$dir;
301 301
 				//print "newfile=".$newfile;
302 302
 				//print "file=".$file;
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 				dol_mkdir($conf->mymodule->dir_temp);
306 306
 				if (!is_writable($conf->mymodule->dir_temp)) {
307 307
 					$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->mymodule->dir_temp);
308
-					dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
308
+					dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
309 309
 					return -1;
310 310
 				}
311 311
 
Please login to merge, or discard this patch.
htdocs/modulebuilder/template/myobject_agenda.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,9 @@
 block discarded – undo
149 149
 if (!isModEnabled("mymodule")) {
150 150
 	accessforbidden();
151 151
 }
152
-if (!$permissiontoread) accessforbidden();
152
+if (!$permissiontoread) {
153
+	accessforbidden();
154
+}
153 155
 
154 156
 
155 157
 /*
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -313,7 +313,7 @@
 block discarded – undo
313 313
 
314 314
 		print_barre_liste($langs->trans("ActionsOnMyObject").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
315 315
 		*/
316
-		$titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': '');
316
+		$titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : '');
317 317
 
318 318
 		print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0);
319 319
 
Please login to merge, or discard this patch.
htdocs/modulebuilder/template/myobject_list.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -192,7 +192,9 @@  discard block
 block discarded – undo
192 192
 }
193 193
 
194 194
 // Security check (enable the most restrictive one)
195
-if ($user->socid > 0) accessforbidden();
195
+if ($user->socid > 0) {
196
+	accessforbidden();
197
+}
196 198
 //if ($user->socid > 0) accessforbidden();
197 199
 //$socid = 0; if ($user->socid > 0) $socid = $user->socid;
198 200
 //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
@@ -200,7 +202,9 @@  discard block
 block discarded – undo
200 202
 if (!isModEnabled("mymodule")) {
201 203
 	accessforbidden('Module mymodule not enabled');
202 204
 }
203
-if (!$permissiontoread) accessforbidden();
205
+if (!$permissiontoread) {
206
+	accessforbidden();
207
+}
204 208
 
205 209
 
206 210
 /*
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 $object = new MyObject($db);
119 119
 $extrafields = new ExtraFields($db);
120 120
 $diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id;
121
-$hookmanager->initHooks(array($contextpage)); 	// Note that conf->hooks_modules contains array of activated contexes
121
+$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes
122 122
 
123 123
 // Fetch optionals attributes and labels
124 124
 $extrafields->fetch_name_optionals_label($object->table_element);
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
 // Default sort order (if not yet defined by previous GETPOST)
130 130
 if (!$sortfield) {
131
-	reset($object->fields);					// Reset is required to avoid key() to return null.
131
+	reset($object->fields); // Reset is required to avoid key() to return null.
132 132
 	$sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
133 133
 }
134 134
 if (!$sortorder) {
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 // Output page
423 423
 // --------------------------------------------------------------------
424 424
 
425
-llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');	// Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
425
+llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
426 426
 
427 427
 // Example : Adding jquery code
428 428
 // print '<script type="text/javascript">
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 	} 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'])) {
647 647
 		$cssforfield .= ($cssforfield ? ' ' : '').'right';
648 648
 	}
649
-	$cssforfield = preg_replace('/small\s*/', '', $cssforfield);	// the 'small' css must not be used for the title label
649
+	$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
650 650
 	if (!empty($arrayfields['t.'.$key]['checked'])) {
651 651
 		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";
652 652
 		$totalarray['nbfield']++;
Please login to merge, or discard this patch.
htdocs/holiday/define_holiday.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
47 47
 $sortfield = GETPOST('sortfield', 'aZ09comma');
48 48
 $sortorder = GETPOST('sortorder', 'aZ09comma');
49
-$toselect   = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
49
+$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
50 50
 $confirm = GETPOST('confirm', 'alpha');
51 51
 
52 52
 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -254,12 +254,12 @@  discard block
 block discarded – undo
254 254
 	foreach ($typeleaves as $key => $val) {
255 255
 		$labeltypes[$val['id']] = ($langs->trans($val['code']) != $val['code']) ? $langs->trans($val['code']) : $langs->trans($val['label']);
256 256
 	}
257
-	$formquestion [] = array( 'type' => 'other',
257
+	$formquestion [] = array('type' => 'other',
258 258
 		'name' => 'typeofholiday',
259 259
 		'label' => $langs->trans("Type"),
260 260
 		'value' => $form->selectarray('typeholiday', $labeltypes, GETPOST('typeholiday', 'alpha'), 1)
261 261
 	);
262
-	$formquestion [] = array( 'type' => 'other',
262
+	$formquestion [] = array('type' => 'other',
263 263
 		'name' => 'nbdaysholydays',
264 264
 		'label' => $langs->trans("NumberDayAddMass"),
265 265
 		'value' => '<input name="nbdaysholidays" class="maxwidth75" id="nbdaysholidays" value="'.GETPOST('nbdaysholidays', 'int').'">'
Please login to merge, or discard this patch.
htdocs/product/stock/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@
 block discarded – undo
201 201
 		$tmplotstatic->eatby = $objp->eatby;
202 202
 
203 203
 		print '<tr class="oddeven">';
204
-		print '<td class="nowraponall">'.img_picto($langs->trans("Ref").' '.$objp->mid, 'movement',  'class="pictofixedwidth"').dol_print_date($db->jdate($objp->datem), 'dayhour').'</td>';
204
+		print '<td class="nowraponall">'.img_picto($langs->trans("Ref").' '.$objp->mid, 'movement', 'class="pictofixedwidth"').dol_print_date($db->jdate($objp->datem), 'dayhour').'</td>';
205 205
 		print '<td class="tdoverflowmax150">';
206 206
 		print $producttmp->getNomUrl(1);
207 207
 		print "</td>\n";
Please login to merge, or discard this patch.
htdocs/product/stock/replenish.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 $fk_entrepot = GETPOST('fk_entrepot', 'int');
69 69
 
70 70
 // List all visible warehouses
71
-$resWar = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "entrepot WHERE entity IN (" . $db->sanitize(getEntity('stock')) .")");
71
+$resWar = $db->query("SELECT rowid FROM ".MAIN_DB_PREFIX."entrepot WHERE entity IN (".$db->sanitize(getEntity('stock')).")");
72 72
 $listofqualifiedwarehousesid = "";
73 73
 $count = 0;
74 74
 while ($tmpobj = $db->fetch_object($resWar)) {
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 $sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
362 362
 $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
363 363
 $list_warehouse = (empty($listofqualifiedwarehousesid) ? '0' : $listofqualifiedwarehousesid);
364
-$sql .= ' AND s.fk_entrepot  IN ('.$db->sanitize($list_warehouse) .')';
364
+$sql .= ' AND s.fk_entrepot  IN ('.$db->sanitize($list_warehouse).')';
365 365
 
366 366
 //$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')';
367 367
 if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
 			exit;
801 801
 		}
802 802
 
803
-		$prod->load_stock('warehouseopen, warehouseinternal'.(!$usevirtualstock?', novirtual':''), $draftchecked);
803
+		$prod->load_stock('warehouseopen, warehouseinternal'.(!$usevirtualstock ? ', novirtual' : ''), $draftchecked);
804 804
 
805 805
 		// Multilangs
806 806
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -672,8 +672,12 @@  discard block
 block discarded – undo
672 672
 if ($limit > 0 && $limit != $conf->liste_limit) {
673 673
 	$filters .= '&limit='.((int) $limit);
674 674
 }
675
-if (!empty($includeproductswithoutdesiredqty)) $filters .= '&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty);
676
-if (!empty($salert)) $filters .= '&salert='.urlencode($salert);
675
+if (!empty($includeproductswithoutdesiredqty)) {
676
+	$filters .= '&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty);
677
+}
678
+if (!empty($salert)) {
679
+	$filters .= '&salert='.urlencode($salert);
680
+}
677 681
 
678 682
 $param = (isset($type) ? '&type='.urlencode($type) : '');
679 683
 $param .= '&fourn_id='.urlencode($fourn_id).'&search_label='.urlencode($search_label).'&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty).'&salert='.urlencode($salert).'&draftorder='.urlencode($draftorder);
@@ -681,8 +685,12 @@  discard block
 block discarded – undo
681 685
 $param .= '&mode='.urlencode($mode);
682 686
 $param .= '&fk_supplier='.urlencode($fk_supplier);
683 687
 $param .= '&fk_entrepot='.urlencode($fk_entrepot);
684
-if (!empty($includeproductswithoutdesiredqty)) $param .= '&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty);
685
-if (!empty($salert)) $param .= '&salert='.urlencode($salert);
688
+if (!empty($includeproductswithoutdesiredqty)) {
689
+	$param .= '&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty);
690
+}
691
+if (!empty($salert)) {
692
+	$param .= '&salert='.urlencode($salert);
693
+}
686 694
 
687 695
 $stocklabel = $langs->trans('Stock');
688 696
 $stocklabelbis = $langs->trans('Stock');
Please login to merge, or discard this patch.
htdocs/product/stock/productlot_note.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 
34 34
 // Get parameters
35 35
 $id = GETPOST('id', 'int');
36
-$ref        = GETPOST('ref', 'alpha');
36
+$ref = GETPOST('ref', 'alpha');
37 37
 $action = GETPOST('action', 'aZ09');
38 38
 
39 39
 // Initialize technical objects
Please login to merge, or discard this patch.
htdocs/product/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -341,9 +341,9 @@
 block discarded – undo
341 341
 				$product_static->status_buy = $objp->tobuy;
342 342
 				$product_static->status_batch = $objp->tobatch;
343 343
 
344
-				$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'read');
344
+				$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('product', 'product_advance', 'read_prices') : $user->hasRight('product', 'read');
345 345
 				if ($product_static->isService()) {
346
-					$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'read');
346
+					$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('service', 'service_advance', 'read_prices') : $user->hasRight('service', 'read');
347 347
 				}
348 348
 
349 349
 				// Multilangs
Please login to merge, or discard this patch.
htdocs/accountancy/bookkeeping/card.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 		if ($mode != "_tmp") {
548 548
 			// Date document export
549 549
 			print '<tr>';
550
-			print '<td class="titlefield">' . $langs->trans("DateExport") . '</td>';
550
+			print '<td class="titlefield">'.$langs->trans("DateExport").'</td>';
551 551
 			print '<td>';
552 552
 			print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : '&nbsp;';
553 553
 			print '</td>';
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 
556 556
 			// Date document validation
557 557
 			print '<tr>';
558
-			print '<td class="titlefield">' . $langs->trans("DateValidation") . '</td>';
558
+			print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>';
559 559
 			print '<td>';
560 560
 			print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : '&nbsp;';
561 561
 			print '</td>';
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 
613 613
 		print '<br>';
614 614
 
615
-		$result = $object->fetchAllPerMvt($piece_num, $mode);	// This load $object->linesmvt
615
+		$result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt
616 616
 
617 617
 		if ($result < 0) {
618 618
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -708,14 +708,14 @@  discard block
 block discarded – undo
708 708
 							if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
709 709
 								print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label');
710 710
 							} else {
711
-								print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">';
711
+								print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">';
712 712
 							}
713
-							print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">';
713
+							print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
714 714
 							print '</td>';
715
-							print '<td><input type="text" class="minwidth200" name="label_operation" value="' . $label_operation . '"/></td>';
715
+							print '<td><input type="text" class="minwidth200" name="label_operation" value="'.$label_operation.'"/></td>';
716 716
 							print '<td class="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
717 717
 							print '<td class="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
718
-							print '<td class="center"><input type="submit" class="button small" name="save" value="' . $langs->trans("Add") . '"></td>';
718
+							print '<td class="center"><input type="submit" class="button small" name="save" value="'.$langs->trans("Add").'"></td>';
719 719
 						}
720 720
 					} else {
721 721
 						print '<!-- td columns in display mode -->';
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 
739 739
 						print '<td class="center nowraponall">';
740 740
 						if (empty($line->date_export) && empty($line->date_validation)) {
741
-							print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
741
+							print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">';
742 742
 							print img_edit('', 0, 'class="marginrightonly"');
743 743
 							print '</a> &nbsp;';
744 744
 						} else {
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 								$actiontodelete = 'confirm_delete';
754 754
 							}
755 755
 
756
-							print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
756
+							print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">';
757 757
 							print img_delete();
758 758
 							print '</a>';
759 759
 						} else {
Please login to merge, or discard this patch.