Completed
Branch develop (236e96)
by
unknown
19:23
created
htdocs/product/stock/stocktransfer/stocktransfer_list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
 // Default sort order (if not yet defined by previous GETPOST)
76 76
 if (!$sortfield) {
77
-	reset($object->fields);					// Reset is required to avoid key() to return null.
77
+	reset($object->fields); // Reset is required to avoid key() to return null.
78 78
 	$sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
79 79
 }
80 80
 if (!$sortorder) {
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 // Output page
343 343
 // --------------------------------------------------------------------
344 344
 
345
-llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');	// Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
345
+llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
346 346
 
347 347
 // Example : Adding jquery code
348 348
 // print '<script type="text/javascript">
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 	} 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'])) {
561 561
 		$cssforfield .= ($cssforfield ? ' ' : '').'right';
562 562
 	}
563
-	$cssforfield = preg_replace('/small\s*/', '', $cssforfield);	// the 'small' css must not be used for the title label
563
+	$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
564 564
 	if (!empty($arrayfields['t.'.$key]['checked'])) {
565 565
 		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";
566 566
 		$totalarray['nbfield']++;
Please login to merge, or discard this patch.
htdocs/product/stock/stocktransfer/stocktransfer_card.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 $confirm    = GETPOST('confirm', 'alpha');
49 49
 $cancel     = GETPOST('cancel', 'aZ09');
50 50
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
51
-$backtopage = GETPOST('backtopage', 'alpha');					// if not set, a default page will be used
52
-$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');	// if not set, $backtopage will be used
51
+$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
52
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
53 53
 $qty = GETPOST('qty', 'int');
54 54
 $fk_product = GETPOST('fk_product', 'int');
55 55
 $fk_warehouse_source = GETPOST('fk_warehouse_source', 'int');
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 $date_prevue_depart = $object->date_prevue_depart;
406 406
 $date_prevue_depart_plus_delai = $date_prevue_depart;
407 407
 if ($object->lead_time_for_warning > 0) {
408
-	$date_prevue_depart_plus_delai = strtotime(date('Y-m-d', $date_prevue_depart) . ' + '.$object->lead_time_for_warning.' day');
408
+	$date_prevue_depart_plus_delai = strtotime(date('Y-m-d', $date_prevue_depart).' + '.$object->lead_time_for_warning.' day');
409 409
 }
410 410
 if (!empty($date_prevue_depart) && $date_prevue_depart_plus_delai < strtotime(date('Y-m-d'))) {
411 411
 	print "$('.valuefield.fieldname_date_prevue_depart').append('";
@@ -478,28 +478,28 @@  discard block
 block discarded – undo
478 478
 
479 479
 // Part to edit record
480 480
 if (($id || $ref) && $action == 'edit') {
481
-	print load_fiche_titre($langs->trans("StockTransfer"), '', 'object_' . $object->picto);
481
+	print load_fiche_titre($langs->trans("StockTransfer"), '', 'object_'.$object->picto);
482 482
 
483
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
484
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
483
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
484
+	print '<input type="hidden" name="token" value="'.newToken().'">';
485 485
 	print '<input type="hidden" name="action" value="update">';
486
-	print '<input type="hidden" name="id" value="' . $object->id . '">';
486
+	print '<input type="hidden" name="id" value="'.$object->id.'">';
487 487
 	if ($backtopage) {
488
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
488
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
489 489
 	}
490 490
 	if ($backtopageforcancel) {
491
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
491
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
492 492
 	}
493 493
 
494 494
 	print dol_get_fiche_head();
495 495
 
496
-	print '<table class="border centpercent tableforfieldedit">' . "\n";
496
+	print '<table class="border centpercent tableforfieldedit">'."\n";
497 497
 
498 498
 	// Common attributes
499
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
499
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
500 500
 
501 501
 	// Other attributes
502
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
502
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
503 503
 
504 504
 	print '</table>';
505 505
 
@@ -535,28 +535,28 @@  discard block
 block discarded – undo
535 535
 		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
536 536
 	} elseif ($action == 'destock') { // Destock confirmation
537 537
 		// Create an array for form
538
-		$formquestion = array(	'text' => '',
538
+		$formquestion = array('text' => '',
539 539
 			array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestock', $object->ref), 'size'=>40),
540 540
 			array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25)
541 541
 		);
542 542
 		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProduct'), '', 'confirm_destock', $formquestion, 'yes', 1);
543 543
 	} elseif ($action == 'destockcancel') { // Destock confirmation cancel
544 544
 		// Create an array for form
545
-		$formquestion = array(	'text' => '',
545
+		$formquestion = array('text' => '',
546 546
 			array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestockCancel', $object->ref), 'size'=>40),
547 547
 			array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25)
548 548
 		);
549 549
 		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProductCancel'), '', 'confirm_destockcancel', $formquestion, 'yes', 1);
550 550
 	} elseif ($action == 'addstock') { // Addstock confirmation
551 551
 		// Create an array for form
552
-		$formquestion = array(	'text' => '',
552
+		$formquestion = array('text' => '',
553 553
 			array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").'&nbsp;:', 'value' => $langs->trans('ConfirmAddStock', $object->ref), 'size'=>40),
554 554
 			array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25)
555 555
 		);
556 556
 		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AddStockAllProduct'), '', 'confirm_addstock', $formquestion, 'yes', 1);
557 557
 	} elseif ($action == 'addstockcancel') { // Addstock confirmation cancel
558 558
 		// Create an array for form
559
-		$formquestion = array(	'text' => '',
559
+		$formquestion = array('text' => '',
560 560
 			array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").'&nbsp;:', 'value' => $langs->trans('ConfirmAddStockCancel', $object->ref), 'size'=>40),
561 561
 			array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25)
562 562
 		);
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 
582 582
 
583 583
 	if ($action == 'valid' && $permissiontoadd) {
584
-		$nextref=$object->getNextNumRef();
584
+		$nextref = $object->getNextNumRef();
585 585
 		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Validate'), $langs->transnoentities('ConfirmValidateStockTransfer', $nextref), 'confirm_validate', $formquestion, 0, 2);
586 586
 	}
587 587
 
@@ -646,8 +646,8 @@  discard block
 block discarded – undo
646 646
 	//unset($object->fields['fk_project']);				// Hide field already shown in banner
647 647
 	//unset($object->fields['fk_soc']);					// Hide field already shown in banner
648 648
 
649
-	$object->fields['fk_soc']['visible']=0; // Already available in banner
650
-	$object->fields['fk_project']['visible']=0; // Already available in banner
649
+	$object->fields['fk_soc']['visible'] = 0; // Already available in banner
650
+	$object->fields['fk_project']['visible'] = 0; // Already available in banner
651 651
 	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
652 652
 
653 653
 	// Incoterms
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
 
764 764
 	$param = '';
765 765
 
766
-	$conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE=true; // Full display needed to see all column title details
766
+	$conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE = true; // Full display needed to see all column title details
767 767
 
768 768
 	print '<tr class="liste_titre">';
769 769
 	print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
@@ -868,11 +868,11 @@  discard block
 block discarded – undo
868 868
 				print '<input type="submit" class="button buttongen marginbottomonly" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'"></td>';
869 869
 			} else {
870 870
 				print '<td class="right">';
871
-				print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=editline&amp;lineid=' . $line->id . '#line_' . $line->id . '">';
872
-				print img_edit() . '</a>';
871
+				print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;lineid='.$line->id.'#line_'.$line->id.'">';
872
+				print img_edit().'</a>';
873 873
 				print '</td>';
874 874
 				print '<td class="right">';
875
-				print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '&action=deleteline&lineid=' . $line->id . '">' . img_delete($langs->trans("Remove")) . '</a>';
875
+				print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=deleteline&lineid='.$line->id.'">'.img_delete($langs->trans("Remove")).'</a>';
876 876
 				print '</td>';
877 877
 			}
878 878
 
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
 		$formproduct->loadWarehouses(); // Pour charger la totalité des entrepôts
928 928
 
929 929
 		// On stock ceux qui ne doivent pas être proposés dans la liste
930
-		$TExcludedWarehouseSource=array();
930
+		$TExcludedWarehouseSource = array();
931 931
 		if (!empty($object->fk_warehouse_source)) {
932 932
 			$source_ent = new Entrepot($db);
933 933
 			$source_ent->fetch($object->fk_warehouse_source);
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
 		}
940 940
 
941 941
 		// On stock ceux qui ne doivent pas être proposés dans la liste
942
-		$TExcludedWarehouseDestination=array();
942
+		$TExcludedWarehouseDestination = array();
943 943
 		if (!empty($object->fk_warehouse_destination)) {
944 944
 			$dest_ent = new Entrepot($db);
945 945
 			$dest_ent->fetch($object->fk_warehouse_destination);
@@ -951,14 +951,14 @@  discard block
 block discarded – undo
951 951
 		}
952 952
 
953 953
 		// On vide le tableau pour qu'il se charge tout seul lors de l'appel à la fonction select_warehouses
954
-		$formproduct->cache_warehouses=array();
954
+		$formproduct->cache_warehouses = array();
955 955
 		// In warehouse
956 956
 		print '<td>';
957 957
 		print $formproduct->selectWarehouses(empty($fk_warehouse_source) ? $object->fk_warehouse_source : $fk_warehouse_source, 'fk_warehouse_source', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200', $TExcludedWarehouseSource);
958 958
 		print '</td>';
959 959
 
960 960
 		// On vide le tableau pour qu'il se charge tout seul lors de l'appel à la fonction select_warehouses
961
-		$formproduct->cache_warehouses=array();
961
+		$formproduct->cache_warehouses = array();
962 962
 		// Out warehouse
963 963
 		print '<td>';
964 964
 		print $formproduct->selectWarehouses(empty($fk_warehouse_destination) ? $object->fk_warehouse_destination : $fk_warehouse_destination, 'fk_warehouse_destination', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200', $TExcludedWarehouseDestination);
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
 		// PMP * Qty
976 976
 		print '<td></td>';
977 977
 		// Button to add line
978
-		print '<td class="right" colspan="2"><input type="submit" class="button" name="addline" value="' . dol_escape_htmltag($langs->trans('Add')) . '"></td>';
978
+		print '<td class="right" colspan="2"><input type="submit" class="button" name="addline" value="'.dol_escape_htmltag($langs->trans('Add')).'"></td>';
979 979
 		// Grad and drop lines
980 980
 		print '<td></td>';
981 981
 		print '</tr>';
@@ -1077,9 +1077,9 @@  discard block
 block discarded – undo
1077 1077
 		// Documents
1078 1078
 		if ($includedocgeneration) {
1079 1079
 			$objref = dol_sanitizeFileName($object->ref);
1080
-			$relativepath = $objref . '/' . $objref . '.pdf';
1080
+			$relativepath = $objref.'/'.$objref.'.pdf';
1081 1081
 			$filedir = $conf->stocktransfer->dir_output.'/'.$object->element.'/'.$objref;
1082
-			$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
1082
+			$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
1083 1083
 			$genallowed = $permissiontoread; // If you can read, you can build the PDF to read content
1084 1084
 			$delallowed = $permissiontoadd; // If you can create/edit, you can remove a file on card
1085 1085
 			print $formfile->showdocuments('stocktransfer:StockTransfer', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
Please login to merge, or discard this patch.
htdocs/core/modules/oauth/google_oauthcallback.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	// The redirect_uri is included into this $url
194 194
 
195 195
 	// Add more param
196
-	$url .= '&nonce='.bin2hex(random_bytes(64/8));
196
+	$url .= '&nonce='.bin2hex(random_bytes(64 / 8));
197 197
 
198 198
 	if ($forlogin) {
199 199
 		// TODO Add param hd. What is it for ?
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 					$storage->clearToken('Google');
323 323
 
324 324
 					$tmpuser = new User($db);
325
-					$res = $tmpuser->fetch(0, '', '', 0, $entitytosearchuser, $useremail, 0, 1);	// Load user. Can load with email_oauth2.
325
+					$res = $tmpuser->fetch(0, '', '', 0, $entitytosearchuser, $useremail, 0, 1); // Load user. Can load with email_oauth2.
326 326
 
327 327
 					if ($res > 0) {
328 328
 						$username = $tmpuser->login;
Please login to merge, or discard this patch.