Completed
Branch develop (dee9f2)
by
unknown
24:57
created
htdocs/comm/action/index.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	$conf->global->AGENDA_EXT_NB = 5;
59 59
 }
60 60
 $MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB');
61
-$DELAYFORCACHE = 300;	// 300 seconds
61
+$DELAYFORCACHE = 300; // 300 seconds
62 62
 
63 63
 $disabledefaultvalues = GETPOSTINT('disabledefaultvalues');
64 64
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
 $mode = GETPOST('mode', 'aZ09');
117 117
 if (empty($mode) && preg_match('/show_/', $action)) {
118
-	$mode = $action;	// For backward compatibility
118
+	$mode = $action; // For backward compatibility
119 119
 }
120 120
 $resourceid = GETPOST("search_resourceid", 'int');
121 121
 $year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y");
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
 	$status = ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
153 153
 }
154 154
 
155
-$defaultview = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_month');	// default for app
156
-$defaultview = getDolUserString('AGENDA_DEFAULT_VIEW', $defaultview);	// default for user
155
+$defaultview = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_month'); // default for app
156
+$defaultview = getDolUserString('AGENDA_DEFAULT_VIEW', $defaultview); // default for user
157 157
 if (empty($mode) && !GETPOSTISSET('mode')) {
158 158
 	$mode = $defaultview;
159 159
 }
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 
564 564
 $viewmode .= '</div>';
565 565
 
566
-$viewmode .= '<span class="marginrightonly"></span>';	// To add a space before the navigation tools
566
+$viewmode .= '<span class="marginrightonly"></span>'; // To add a space before the navigation tools
567 567
 
568 568
 
569 569
 $newparam = '';
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 	$sql .= " ON bc.rowid = ba.fk_bookcal_calendar";
600 600
 	$sql .= " WHERE bc.status = 1";
601 601
 	$sql .= " AND ba.status = 1";
602
-	$sql .= " AND bc.entity IN (".getEntity('agenda').")";	// bookcal is a "virtual view" of agenda
602
+	$sql .= " AND bc.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda
603 603
 	if (!empty($filtert) && $filtert != '-1') {
604 604
 		$sql .= " AND bc.visibility IN (".$db->sanitize($filtert, 0, 0, 0, 0).")";
605 605
 	}
@@ -655,9 +655,9 @@  discard block
 block discarded – undo
655 655
 	if ($user->hasRight("holiday", "read")) {
656 656
 		$s .= '
657 657
             <div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" value="1" class="check_holiday"' . ($check_holiday
658
-					? ' checked' : '') . '>
658
+					? ' checked' : '').'>
659 659
                 <label for="check_holiday" class="labelcalendar">
660
-                    <span class="check_holiday_text">' . $langs->trans("Holidays") . '</span>
660
+                    <span class="check_holiday_text">' . $langs->trans("Holidays").'</span>
661 661
                 </label> &nbsp;
662 662
             </div>';
663 663
 	}
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 		$s .= '</script>'."\n";
684 684
 
685 685
 		foreach ($showextcals as $val) {
686
-			$htmlname = md5($val['name']);	// not used for security purpose, only to get a string with no special char
686
+			$htmlname = md5($val['name']); // not used for security purpose, only to get a string with no special char
687 687
 
688 688
 			if (!empty($val['default']) || GETPOSTINT('check_ext'.$htmlname)) {
689 689
 				$default = "checked";
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
 	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
778 778
 }
779 779
 $sql .= ' WHERE a.fk_action = ca.id';
780
-$sql .= ' AND a.entity IN ('.getEntity('agenda').')';	// bookcal is a "virtual view" of agenda
780
+$sql .= ' AND a.entity IN ('.getEntity('agenda').')'; // bookcal is a "virtual view" of agenda
781 781
 // Condition on actioncode
782 782
 if (!empty($actioncode)) {
783 783
 	if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
 		// event->datep and event->datef must be GMT date.
933 933
 		if ($event->fulldayevent) {
934 934
 			$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
935
-			$event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver');	// If saved in $tzforfullday = gmt, we must invert date to be in user tz
935
+			$event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver'); // If saved in $tzforfullday = gmt, we must invert date to be in user tz
936 936
 			$event->datef = $db->jdate($obj->datep2, $tzforfullday ? 'tzuser' : 'tzserver');
937 937
 		} else {
938 938
 			// Example: $obj->datep = '1970-01-01 01:00:00', jdate will return 0 if TZ of PHP server is Europe/Berlin (+1)
@@ -1010,8 +1010,8 @@  discard block
 block discarded – undo
1010 1010
 			// Loop on each day covered by action to prepare an index to show on calendar
1011 1011
 			$loop = true;
1012 1012
 			$j = 0;
1013
-			$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');	// $mois, $jour, $annee has been set for user tz
1014
-			$daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt');	// $moisend, $jourend, $anneeend has been set for user tz
1013
+			$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); // $mois, $jour, $annee has been set for user tz
1014
+			$daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt'); // $moisend, $jourend, $anneeend has been set for user tz
1015 1015
 			/*
1016 1016
 			 print 'GMT '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt').'<br>';
1017 1017
 			 print 'TZSERVER '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzserver').'<br>';
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
 
1140 1140
 	if ($mode == 'show_day') {
1141 1141
 		// Request only leaves for the current selected day
1142
-		$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin";	// date_debut and date_fin are date without time
1142
+		$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time
1143 1143
 	} elseif ($mode == 'show_week') {
1144 1144
 		// Restrict on current month (we get more, but we will filter later)
1145 1145
 		$sql .= " AND date_debut < '".$db->idate(dol_get_last_day($year, $month))."'";
@@ -1685,7 +1685,7 @@  discard block
 block discarded – undo
1685 1685
 
1686 1686
 	for ($iter_day = 0; $iter_day < 7; $iter_day++) {
1687 1687
 		// Show days of the current week
1688
-		$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd');		// $firstdaytoshow is in timezone of server
1688
+		$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); // $firstdaytoshow is in timezone of server
1689 1689
 		$tmpday = (int) dol_print_date($curtime, '%d', 'tzuserrel');
1690 1690
 		$tmpmonth = (int) dol_print_date($curtime, '%m', 'tzuserrel');
1691 1691
 		$tmpyear = (int) dol_print_date($curtime, '%Y', 'tzuserrel');
@@ -1920,9 +1920,9 @@  discard block
 block discarded – undo
1920 1920
 	$tmpholiday = new Holiday($db);
1921 1921
 
1922 1922
 	foreach ($eventarray as $daykey => $notused) {		// daykey is the 'YYYYMMDD' to show according to user
1923
-		$annee = (int) dol_print_date($daykey, '%Y', 'gmt');	// We use gmt because we want the value represented by string 'YYYYMMDD'
1924
-		$mois =  (int) dol_print_date($daykey, '%m', 'gmt');	// We use gmt because we want the value represented by string 'YYYYMMDD'
1925
-		$jour =  (int) dol_print_date($daykey, '%d', 'gmt');	// We use gmt because we want the value represented by string 'YYYYMMDD'
1923
+		$annee = (int) dol_print_date($daykey, '%Y', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
1924
+		$mois = (int) dol_print_date($daykey, '%m', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
1925
+		$jour = (int) dol_print_date($daykey, '%d', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
1926 1926
 
1927 1927
 		//print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' jour='.$jour.' mois='.$mois.' annee='.$annee."<br>\n";
1928 1928
 		//print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' day='.$day.' month='.$month.' year='.$year."<br>\n";
@@ -2221,7 +2221,7 @@  discard block
 block discarded – undo
2221 2221
 								$event->label = $titletoshow;
2222 2222
 								// Note: List of users are inside $event->userassigned. Link may be clickable depending on permissions of user.
2223 2223
 								$titletoshow = (($event->type_picto || $event->type_code) ? $event->getTypePicto() : '');
2224
-								$titletoshow .= $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title valignmiddle', '', 0, 0);	// do not add 'inline-block' in css here: it makes the title transformed completely into '...'
2224
+								$titletoshow .= $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title valignmiddle', '', 0, 0); // do not add 'inline-block' in css here: it makes the title transformed completely into '...'
2225 2225
 								$event->label = $savlabel;
2226 2226
 							}
2227 2227
 
Please login to merge, or discard this patch.
htdocs/product/card.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 $formbarcode = null;
109 109
 
110 110
 // Get parameters
111
-$id  = GETPOSTINT('id');
111
+$id = GETPOSTINT('id');
112 112
 if (getDolGlobalString('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) {
113 113
 	$ref = (GETPOSTISSET('ref') ? GETPOST('ref', 'nohtml') : null);
114 114
 } else {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 $backtopage = GETPOST('backtopage', 'alpha');
121 121
 $confirm = GETPOST('confirm', 'alpha');
122 122
 $socid = GETPOSTINT('socid');
123
-$duration_value = GETPOST('duration_value');	// duration value can be an empty string
123
+$duration_value = GETPOST('duration_value'); // duration value can be an empty string
124 124
 $duration_unit = GETPOST('duration_unit', 'alpha');
125 125
 
126 126
 $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
@@ -520,11 +520,11 @@  discard block
 block discarded – undo
520 520
 		if (!$error) {
521 521
 			$units = GETPOSTINT('units');
522 522
 
523
-			$object->entity				= $conf->entity;
524
-			$object->ref				= (string) $ref;
525
-			$object->label				= GETPOST('label', $label_security_check);
526
-			$object->price_base_type	= GETPOST('price_base_type', 'aZ09');
527
-			$object->mandatory_period	= empty(GETPOST("mandatoryperiod", 'alpha')) ? 0 : 1;
523
+			$object->entity = $conf->entity;
524
+			$object->ref = (string) $ref;
525
+			$object->label = GETPOST('label', $label_security_check);
526
+			$object->price_base_type = GETPOST('price_base_type', 'aZ09');
527
+			$object->mandatory_period = empty(GETPOST("mandatoryperiod", 'alpha')) ? 0 : 1;
528 528
 			if ($object->price_base_type == 'TTC') {
529 529
 				$object->price_ttc = GETPOSTFLOAT('price');
530 530
 			} else {
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 			$object->duration_value     	 = $duration_value;
613 613
 			$object->duration_unit      	 = $duration_unit;
614 614
 			$object->fk_default_warehouse	 = GETPOSTINT('fk_default_warehouse');
615
-			$object->fk_default_workstation	 = GETPOSTINT('fk_default_workstation');
615
+			$object->fk_default_workstation = GETPOSTINT('fk_default_workstation');
616 616
 			$object->seuil_stock_alerte 	 = GETPOST('seuil_stock_alerte') ? GETPOST('seuil_stock_alerte') : 0;
617 617
 			$object->desiredstock          = GETPOST('desiredstock') ? GETPOST('desiredstock') : 0;
618 618
 			$object->canvas             	 = GETPOST('canvas');
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 				$object->oldcopy = dol_clone($object, 1);
762 762
 
763 763
 				if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) {
764
-					$object->ref                = (string) $ref;
764
+					$object->ref = (string) $ref;
765 765
 				}
766 766
 				$object->label                  = GETPOST('label', $label_security_check);
767 767
 
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 				$object->status_batch = GETPOSTINT('status_batch');
784 784
 				$object->sell_or_eat_by_mandatory = GETPOSTINT('sell_or_eat_by_mandatory');
785 785
 				$object->batch_mask = GETPOST('batch_mask', 'alpha');
786
-				$object->fk_default_warehouse   = GETPOSTINT('fk_default_warehouse');
786
+				$object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse');
787 787
 				$object->fk_default_workstation   = GETPOSTINT('fk_default_workstation');
788 788
 				// removed from update view so GETPOST always empty
789 789
 				/*
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
 					$object->accountancy_code_buy_export = $accountancy_code_buy_export;
884 884
 				}
885 885
 				if ($object->isService()) {
886
-					$object->mandatory_period =  (!empty($checkmandatory)) ? 1 : 0 ;
886
+					$object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0;
887 887
 				}
888 888
 
889 889
 
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
 							$action = "";
1019 1019
 
1020 1020
 							$mesg = $langs->trans("ErrorProductAlreadyExists", $clone->ref);
1021
-							$mesg .= ' <a href="' . $_SERVER["PHP_SELF"] . '?ref=' . $clone->ref . '">' . $langs->trans("ShowCardHere") . '</a>.';
1021
+							$mesg .= ' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$clone->ref.'">'.$langs->trans("ShowCardHere").'</a>.';
1022 1022
 							setEventMessages($mesg, null, 'errors');
1023 1023
 						} else {
1024 1024
 							setEventMessages(empty($clone->error) ? '' : $langs->trans($clone->error), $clone->errors, 'errors');
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 					} else {
1034 1034
 						$db->commit();
1035 1035
 						$db->close();
1036
-						header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
1036
+						header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
1037 1037
 						exit;
1038 1038
 					}
1039 1039
 				} else {
@@ -2782,7 +2782,7 @@  discard block
 block discarded – undo
2782 2782
 					$result = $measuringUnits->fetchAll('', 'scale', 0, 0, ['t.active' => 1, 't.unit_type' => 'time']);
2783 2783
 					if ($result !== -1) {
2784 2784
 						foreach ($measuringUnits->records as $record) {
2785
-							$durations[$record->short_label] = dol_ucfirst($record->label) . $plural;
2785
+							$durations[$record->short_label] = dol_ucfirst($record->label).$plural;
2786 2786
 						}
2787 2787
 					}
2788 2788
 					print '<tr><td class="titlefieldmiddle">'.$langs->trans("Duration").'</td><td>';
Please login to merge, or discard this patch.
htdocs/bookcal/availabilities_list.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
 // Default sort order (if not yet defined by previous GETPOST)
87 87
 if (!$sortfield) {
88
-	reset($object->fields);					// Reset is required to avoid key() to return null.
88
+	reset($object->fields); // Reset is required to avoid key() to return null.
89 89
 	$sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
90 90
 }
91 91
 if (!$sortorder) {
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 $sqlfields = $sql; // $sql fields to remove for count total
264 264
 
265 265
 $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
266
-if ($object->ismultientitymanaged == 1  || $object->ismultientitymanaged != '') { // value is fk_bookcal_calendar@bookcal_calendar
266
+if ($object->ismultientitymanaged == 1 || $object->ismultientitymanaged != '') { // value is fk_bookcal_calendar@bookcal_calendar
267 267
 	$sql .= ", ".MAIN_DB_PREFIX."bookcal_calendar as bc";
268 268
 }
269 269
 //$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."anothertable as rc ON rc.parent = t.rowid";
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 $parameters = array();
275 275
 $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
276 276
 $sql .= $hookmanager->resPrint;
277
-if ($object->ismultientitymanaged == 1  || $object->ismultientitymanaged != '') { // value is fk_bookcal_calendar@bookcal_calendar
277
+if ($object->ismultientitymanaged == 1 || $object->ismultientitymanaged != '') { // value is fk_bookcal_calendar@bookcal_calendar
278 278
 	$sql .= " WHERE bc.rowid = t.fk_bookcal_calendar";
279 279
 	$sql .= " AND bc.entity IN (".getEntity('calendar', (GETPOSTINT('search_current_entity') ? 0 : 1)).")";
280 280
 } else {
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 // Output page
394 394
 // --------------------------------------------------------------------
395 395
 
396
-llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-bookcal page-list_availabilities');	// Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
396
+llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-bookcal page-list_availabilities'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
397 397
 
398 398
 // Example : Adding jquery code
399 399
 // print '<script type="text/javascript">
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 }
522 522
 
523 523
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
524
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
524
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
525 525
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
526 526
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
527 527
 
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 	} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
616 616
 		$cssforfield .= ($cssforfield ? ' ' : '').'right';
617 617
 	}
618
-	$cssforfield = preg_replace('/small\s*/', '', $cssforfield);	// the 'small' css must not be used for the title label
618
+	$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
619 619
 	if (!empty($arrayfields['t.'.$key]['checked'])) {
620 620
 		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";
621 621
 		$totalarray['nbfield']++;
Please login to merge, or discard this patch.