Completed
Branch develop (6c6adc)
by
unknown
15:34
created
htdocs/contrat/ticket.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
 
38 38
 $langs->loadLangs(array('companies', 'contracts', 'tickets'));
39 39
 
40
-$socid=GETPOST('socid', 'int');
41
-$id=GETPOST('id', 'int');
42
-$ref=GETPOST('ref', 'alpha');
43
-$action=GETPOST('action', 'alpha');
40
+$socid = GETPOST('socid', 'int');
41
+$id = GETPOST('id', 'int');
42
+$ref = GETPOST('ref', 'alpha');
43
+$action = GETPOST('action', 'alpha');
44 44
 
45 45
 if ($id == '' && $ref == '') {
46 46
 	dol_print_error(null, 'Bad parameter');
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
 }
49 49
 
50 50
 // Security check
51
-$socid=0;
51
+$socid = 0;
52 52
 if ($user->socid > 0) {
53
-	$socid=$user->socid;
53
+	$socid = $user->socid;
54 54
 }
55 55
 
56
-$result=restrictedArea($user, 'contrat', $id);
56
+$result = restrictedArea($user, 'contrat', $id);
57 57
 
58 58
 
59 59
 /*
@@ -63,25 +63,25 @@  discard block
 block discarded – undo
63 63
 llxHeader("", $langs->trans("Tickets"), "Contrat");
64 64
 
65 65
 $form = new Form($db);
66
-$userstatic=new User($db);
66
+$userstatic = new User($db);
67 67
 
68
-$object= new Contrat($db);
69
-$result=$object->fetch($id, $ref);
70
-$ret=$object->fetch_thirdparty();
68
+$object = new Contrat($db);
69
+$result = $object->fetch($id, $ref);
70
+$ret = $object->fetch_thirdparty();
71 71
 $head = contract_prepare_head($object);
72 72
 
73 73
 
74 74
 dol_fiche_head($head, 'ticket', $langs->trans("Contract"), -1, 'contract');
75 75
 
76
-$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php'.(! empty($socid) ? '?socid='.$socid : '').'">';
77
-$linkback.= $langs->trans("BackToList").'</a>';
76
+$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php'.(!empty($socid) ? '?socid='.$socid : '').'">';
77
+$linkback .= $langs->trans("BackToList").'</a>';
78 78
 
79
-$morehtmlref='';
80
-$morehtmlref.=$object->ref;
79
+$morehtmlref = '';
80
+$morehtmlref .= $object->ref;
81 81
 
82
-$morehtmlref.='<div class="refidno">';
82
+$morehtmlref .= '<div class="refidno">';
83 83
 // Ref customer
84
-$morehtmlref.=$form->editfieldkey(
84
+$morehtmlref .= $form->editfieldkey(
85 85
 	"RefCustomer",
86 86
 	'ref_customer',
87 87
 	$object->ref_customer,
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	0,
93 93
 	1
94 94
 );
95
-$morehtmlref.=$form->editfieldval(
95
+$morehtmlref .= $form->editfieldval(
96 96
 	"RefCustomer",
97 97
 	'ref_customer',
98 98
 	$object->ref_customer,
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
 	1
107 107
 );
108 108
 // Ref supplier
109
-$morehtmlref.='<br>';
110
-$morehtmlref.=$form->editfieldkey(
109
+$morehtmlref .= '<br>';
110
+$morehtmlref .= $form->editfieldkey(
111 111
 	"RefSupplier",
112 112
 	'ref_supplier',
113 113
 	$object->ref_supplier,
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	0,
119 119
 	1
120 120
 );
121
-$morehtmlref.=$form->editfieldval(
121
+$morehtmlref .= $form->editfieldval(
122 122
 	"RefSupplier",
123 123
 	'ref_supplier',
124 124
 	$object->ref_supplier,
@@ -132,25 +132,25 @@  discard block
 block discarded – undo
132 132
 	1
133 133
 );
134 134
 // Thirdparty
135
-$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
135
+$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
136 136
 // Project
137
-if (! empty($conf->projet->enabled)) {
137
+if (!empty($conf->projet->enabled)) {
138 138
 	require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
139 139
 
140 140
 	$langs->load("projects");
141
-	$morehtmlref.='<br>'.$langs->trans('Project') . ' : ';
142
-	if (! empty($object->fk_project)) {
141
+	$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
142
+	if (!empty($object->fk_project)) {
143 143
 		$proj = new Project($db);
144 144
 		$proj->fetch($object->fk_project);
145
-		$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=';
146
-		$morehtmlref.=$object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
147
-		$morehtmlref.=$proj->ref;
148
-		$morehtmlref.='</a>';
145
+		$morehtmlref .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id=';
146
+		$morehtmlref .= $object->fk_project.'" title="'.$langs->trans('ShowProject').'">';
147
+		$morehtmlref .= $proj->ref;
148
+		$morehtmlref .= '</a>';
149 149
 	} else {
150
-		$morehtmlref.='';
150
+		$morehtmlref .= '';
151 151
 	}
152 152
 }
153
-$morehtmlref.='</div>';
153
+$morehtmlref .= '</div>';
154 154
 
155 155
 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'none', $morehtmlref);
156 156
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
  * Referrers types
162 162
  */
163 163
 
164
-$title=$langs->trans("ListTicketsLinkToContract");
164
+$title = $langs->trans("ListTicketsLinkToContract");
165 165
 
166 166
 print '<table class="noborder" width="100%">';
167 167
 print '<tr class="liste_titre">';
Please login to merge, or discard this patch.
htdocs/includes/sabre/composer/autoload_real.php 2 patches
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -4,65 +4,65 @@  discard block
 block discarded – undo
4 4
 
5 5
 class ComposerAutoloaderInit51cd53f153efda61d1f1f814155d1c4a
6 6
 {
7
-    private static $loader;
7
+	private static $loader;
8 8
 
9
-    public static function loadClassLoader($class)
10
-    {
11
-        if ('Composer\Autoload\ClassLoader' === $class) {
12
-            require __DIR__ . '/ClassLoader.php';
13
-        }
14
-    }
9
+	public static function loadClassLoader($class)
10
+	{
11
+		if ('Composer\Autoload\ClassLoader' === $class) {
12
+			require __DIR__ . '/ClassLoader.php';
13
+		}
14
+	}
15 15
 
16
-    /**
17
-     * @return \Composer\Autoload\ClassLoader
18
-     */
19
-    public static function getLoader()
20
-    {
21
-        if (null !== self::$loader) {
22
-            return self::$loader;
23
-        }
16
+	/**
17
+	 * @return \Composer\Autoload\ClassLoader
18
+	 */
19
+	public static function getLoader()
20
+	{
21
+		if (null !== self::$loader) {
22
+			return self::$loader;
23
+		}
24 24
 
25
-        //require __DIR__ . '/platform_check.php';
25
+		//require __DIR__ . '/platform_check.php';
26 26
 
27
-        spl_autoload_register(array('ComposerAutoloaderInit51cd53f153efda61d1f1f814155d1c4a', 'loadClassLoader'), true, true);
28
-        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
-        spl_autoload_unregister(array('ComposerAutoloaderInit51cd53f153efda61d1f1f814155d1c4a', 'loadClassLoader'));
27
+		spl_autoload_register(array('ComposerAutoloaderInit51cd53f153efda61d1f1f814155d1c4a', 'loadClassLoader'), true, true);
28
+		self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
+		spl_autoload_unregister(array('ComposerAutoloaderInit51cd53f153efda61d1f1f814155d1c4a', 'loadClassLoader'));
30 30
 
31
-        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
-        if ($useStaticLoader) {
33
-            require __DIR__ . '/autoload_static.php';
31
+		$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
+		if ($useStaticLoader) {
33
+			require __DIR__ . '/autoload_static.php';
34 34
 
35
-            call_user_func(\Composer\Autoload\ComposerStaticInit51cd53f153efda61d1f1f814155d1c4a::getInitializer($loader));
36
-        } else {
37
-            $map = require __DIR__ . '/autoload_namespaces.php';
38
-            foreach ($map as $namespace => $path) {
39
-                $loader->set($namespace, $path);
40
-            }
35
+			call_user_func(\Composer\Autoload\ComposerStaticInit51cd53f153efda61d1f1f814155d1c4a::getInitializer($loader));
36
+		} else {
37
+			$map = require __DIR__ . '/autoload_namespaces.php';
38
+			foreach ($map as $namespace => $path) {
39
+				$loader->set($namespace, $path);
40
+			}
41 41
 
42
-            $map = require __DIR__ . '/autoload_psr4.php';
43
-            foreach ($map as $namespace => $path) {
44
-                $loader->setPsr4($namespace, $path);
45
-            }
42
+			$map = require __DIR__ . '/autoload_psr4.php';
43
+			foreach ($map as $namespace => $path) {
44
+				$loader->setPsr4($namespace, $path);
45
+			}
46 46
 
47
-            $classMap = require __DIR__ . '/autoload_classmap.php';
48
-            if ($classMap) {
49
-                $loader->addClassMap($classMap);
50
-            }
51
-        }
47
+			$classMap = require __DIR__ . '/autoload_classmap.php';
48
+			if ($classMap) {
49
+				$loader->addClassMap($classMap);
50
+			}
51
+		}
52 52
 
53
-        $loader->register(true);
53
+		$loader->register(true);
54 54
 
55
-        if ($useStaticLoader) {
56
-            $includeFiles = Composer\Autoload\ComposerStaticInit51cd53f153efda61d1f1f814155d1c4a::$files;
57
-        } else {
58
-            $includeFiles = require __DIR__ . '/autoload_files.php';
59
-        }
60
-        foreach ($includeFiles as $fileIdentifier => $file) {
61
-            composerRequire51cd53f153efda61d1f1f814155d1c4a($fileIdentifier, $file);
62
-        }
55
+		if ($useStaticLoader) {
56
+			$includeFiles = Composer\Autoload\ComposerStaticInit51cd53f153efda61d1f1f814155d1c4a::$files;
57
+		} else {
58
+			$includeFiles = require __DIR__ . '/autoload_files.php';
59
+		}
60
+		foreach ($includeFiles as $fileIdentifier => $file) {
61
+			composerRequire51cd53f153efda61d1f1f814155d1c4a($fileIdentifier, $file);
62
+		}
63 63
 
64
-        return $loader;
65
-    }
64
+		return $loader;
65
+	}
66 66
 }
67 67
 
68 68
 /**
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
  */
73 73
 function composerRequire51cd53f153efda61d1f1f814155d1c4a($fileIdentifier, $file)
74 74
 {
75
-    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
76
-        $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
75
+	if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
76
+		$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
77 77
 
78
-        require $file;
79
-    }
78
+		require $file;
79
+	}
80 80
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     public static function loadClassLoader($class)
10 10
     {
11 11
         if ('Composer\Autoload\ClassLoader' === $class) {
12
-            require __DIR__ . '/ClassLoader.php';
12
+            require __DIR__.'/ClassLoader.php';
13 13
         }
14 14
     }
15 15
 
@@ -30,21 +30,21 @@  discard block
 block discarded – undo
30 30
 
31 31
         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32 32
         if ($useStaticLoader) {
33
-            require __DIR__ . '/autoload_static.php';
33
+            require __DIR__.'/autoload_static.php';
34 34
 
35 35
             call_user_func(\Composer\Autoload\ComposerStaticInit51cd53f153efda61d1f1f814155d1c4a::getInitializer($loader));
36 36
         } else {
37
-            $map = require __DIR__ . '/autoload_namespaces.php';
37
+            $map = require __DIR__.'/autoload_namespaces.php';
38 38
             foreach ($map as $namespace => $path) {
39 39
                 $loader->set($namespace, $path);
40 40
             }
41 41
 
42
-            $map = require __DIR__ . '/autoload_psr4.php';
42
+            $map = require __DIR__.'/autoload_psr4.php';
43 43
             foreach ($map as $namespace => $path) {
44 44
                 $loader->setPsr4($namespace, $path);
45 45
             }
46 46
 
47
-            $classMap = require __DIR__ . '/autoload_classmap.php';
47
+            $classMap = require __DIR__.'/autoload_classmap.php';
48 48
             if ($classMap) {
49 49
                 $loader->addClassMap($classMap);
50 50
             }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         if ($useStaticLoader) {
56 56
             $includeFiles = Composer\Autoload\ComposerStaticInit51cd53f153efda61d1f1f814155d1c4a::$files;
57 57
         } else {
58
-            $includeFiles = require __DIR__ . '/autoload_files.php';
58
+            $includeFiles = require __DIR__.'/autoload_files.php';
59 59
         }
60 60
         foreach ($includeFiles as $fileIdentifier => $file) {
61 61
             composerRequire51cd53f153efda61d1f1f814155d1c4a($fileIdentifier, $file);
Please login to merge, or discard this patch.
htdocs/product/card.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 $refalreadyexists = 0;
96 96
 
97 97
 // Get parameters
98
-$id  = GETPOST('id', 'int');
98
+$id = GETPOST('id', 'int');
99 99
 if (getDolGlobalString('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) {
100 100
 	$ref = (GETPOSTISSET('ref') ? GETPOST('ref', 'nohtml') : null);
101 101
 } else {
@@ -507,11 +507,11 @@  discard block
 block discarded – undo
507 507
 		if (!$error) {
508 508
 			$units = GETPOST('units', 'int');
509 509
 
510
-			$object->entity				= $conf->entity;
511
-			$object->ref				= $ref;
512
-			$object->label				= GETPOST('label', $label_security_check);
513
-			$object->price_base_type	= GETPOST('price_base_type', 'aZ09');
514
-			$object->mandatory_period	= !empty(GETPOST("mandatoryperiod", 'alpha')) ? 1 : 0;
510
+			$object->entity = $conf->entity;
511
+			$object->ref = $ref;
512
+			$object->label = GETPOST('label', $label_security_check);
513
+			$object->price_base_type = GETPOST('price_base_type', 'aZ09');
514
+			$object->mandatory_period = !empty(GETPOST("mandatoryperiod", 'alpha')) ? 1 : 0;
515 515
 			if ($object->price_base_type == 'TTC') {
516 516
 				$object->price_ttc = GETPOST('price');
517 517
 			} else {
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 			$object->duration_value     	 = $duration_value;
600 600
 			$object->duration_unit      	 = $duration_unit;
601 601
 			$object->fk_default_warehouse	 = GETPOST('fk_default_warehouse', 'int');
602
-			$object->fk_default_workstation	 = GETPOST('fk_default_workstation', 'int');
602
+			$object->fk_default_workstation = GETPOST('fk_default_workstation', 'int');
603 603
 			$object->seuil_stock_alerte 	 = GETPOST('seuil_stock_alerte') ? GETPOST('seuil_stock_alerte') : 0;
604 604
 			$object->desiredstock          = GETPOST('desiredstock') ? GETPOST('desiredstock') : 0;
605 605
 			$object->canvas             	 = GETPOST('canvas');
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 				$object->oldcopy = dol_clone($object, 1);
747 747
 
748 748
 				if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) {
749
-					$object->ref                = $ref;
749
+					$object->ref = $ref;
750 750
 				}
751 751
 				$object->label                  = GETPOST('label', $label_security_check);
752 752
 
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
 				$object->status_batch = GETPOST('status_batch', 'aZ09');
769 769
 				$object->sell_or_eat_by_mandatory = GETPOST('sell_or_eat_by_mandatory', 'int');
770 770
 				$object->batch_mask = GETPOST('batch_mask', 'alpha');
771
-				$object->fk_default_warehouse   = GETPOST('fk_default_warehouse', 'int');
771
+				$object->fk_default_warehouse = GETPOST('fk_default_warehouse', 'int');
772 772
 				$object->fk_default_workstation   = GETPOST('fk_default_workstation', 'int');
773 773
 				// removed from update view so GETPOST always empty
774 774
 				/*
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 					$object->accountancy_code_buy_export = $accountancy_code_buy_export;
869 869
 				}
870 870
 				if ($object->isService()) {
871
-					$object->mandatory_period =  (!empty($checkmandatory)) ? 1 : 0 ;
871
+					$object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0;
872 872
 				}
873 873
 
874 874
 
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
 							$action = "";
967 967
 
968 968
 							$mesg = $langs->trans("ErrorProductAlreadyExists", $clone->ref);
969
-							$mesg .= ' <a href="' . $_SERVER["PHP_SELF"] . '?ref=' . $clone->ref . '">' . $langs->trans("ShowCardHere") . '</a>.';
969
+							$mesg .= ' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$clone->ref.'">'.$langs->trans("ShowCardHere").'</a>.';
970 970
 							setEventMessages($mesg, null, 'errors');
971 971
 						} else {
972 972
 							if (count($clone->errors)) {
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
 					} else {
988 988
 						$db->commit();
989 989
 						$db->close();
990
-						header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
990
+						header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
991 991
 						exit;
992 992
 					}
993 993
 				} else {
@@ -1480,7 +1480,7 @@  discard block
 block discarded – undo
1480 1480
 					if (empty($fk_barcode_type) && getDolGlobalString('PRODUIT_DEFAULT_BARCODE_TYPE')) {
1481 1481
 						$fk_barcode_type = getDolGlobalInt("PRODUIT_DEFAULT_BARCODE_TYPE");
1482 1482
 					} else {
1483
-						$fk_barcode_type=0;
1483
+						$fk_barcode_type = 0;
1484 1484
 					}
1485 1485
 				}
1486 1486
 				require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
Please login to merge, or discard this patch.
htdocs/product/stock/productlot_card.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
 	$backurlforlist = dol_buildpath('/product/stock/productlot_list.php', 1);
154 154
 
155
-	if ($action == 'seteatby' && $user->hasRight('stock', 'creer') && ! GETPOST('cancel', 'alpha')) {
155
+	if ($action == 'seteatby' && $user->hasRight('stock', 'creer') && !GETPOST('cancel', 'alpha')) {
156 156
 		$newvalue = dol_mktime(12, 0, 0, GETPOST('eatbymonth', 'int'), GETPOST('eatbyday', 'int'), GETPOST('eatbyyear', 'int'));
157 157
 
158 158
 		// check parameters
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		}
178 178
 	}
179 179
 
180
-	if ($action == 'setsellby' && $user->hasRight('stock', 'creer') && ! GETPOST('cancel', 'alpha')) {
180
+	if ($action == 'setsellby' && $user->hasRight('stock', 'creer') && !GETPOST('cancel', 'alpha')) {
181 181
 		$newvalue = dol_mktime(12, 0, 0, GETPOST('sellbymonth', 'int'), GETPOST('sellbyday', 'int'), GETPOST('sellbyyear', 'int'));
182 182
 
183 183
 		// check parameters
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 		}
203 203
 	}
204 204
 
205
-	if ($action == 'seteol_date' && $user->hasRight('stock', 'creer') && ! GETPOST('cancel', 'alpha')) {
205
+	if ($action == 'seteol_date' && $user->hasRight('stock', 'creer') && !GETPOST('cancel', 'alpha')) {
206 206
 		$newvalue = dol_mktime(12, 0, 0, GETPOST('eol_datemonth', 'int'), GETPOST('eol_dateday', 'int'), GETPOST('eol_dateyear', 'int'));
207 207
 		$result = $object->setValueFrom('eol_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
208 208
 		if ($result < 0) {
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 		}
214 214
 	}
215 215
 
216
-	if ($action == 'setmanufacturing_date' && $user->hasRight('stock', 'creer') && ! GETPOST('cancel', 'alpha')) {
216
+	if ($action == 'setmanufacturing_date' && $user->hasRight('stock', 'creer') && !GETPOST('cancel', 'alpha')) {
217 217
 		$newvalue = dol_mktime(12, 0, 0, GETPOST('manufacturing_datemonth', 'int'), GETPOST('manufacturing_dateday', 'int'), GETPOST('manufacturing_dateyear', 'int'));
218 218
 		$result = $object->setValueFrom('manufacturing_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
219 219
 		if ($result < 0) {
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 		}
225 225
 	}
226 226
 
227
-	if ($action == 'setscrapping_date' && $user->hasRight('stock', 'creer') && ! GETPOST('cancel', 'alpha')) {
227
+	if ($action == 'setscrapping_date' && $user->hasRight('stock', 'creer') && !GETPOST('cancel', 'alpha')) {
228 228
 		$newvalue = dol_mktime(12, 0, 0, GETPOST('scrapping_datemonth', 'int'), GETPOST('scrapping_dateday', 'int'), GETPOST('scrapping_dateyear', 'int'));
229 229
 		$result = $object->setValueFrom('scrapping_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY');
230 230
 		if ($result < 0) {
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 		}
247 247
 	} */
248 248
 
249
-	if ($action == 'setqc_frequency' && $user->hasRight('stock', 'creer') && ! GETPOST('cancel', 'alpha')) {
249
+	if ($action == 'setqc_frequency' && $user->hasRight('stock', 'creer') && !GETPOST('cancel', 'alpha')) {
250 250
 		$result = $object->setValueFrom('qc_frequency', GETPOST('qc_frequency'), '', null, 'int', '', $user, 'PRODUCT_MODIFY');
251 251
 		if ($result < 0) { // Prévoir un test de format de durée
252 252
 			setEventMessages($object->error, null, 'errors');
Please login to merge, or discard this patch.
htdocs/product/stock/class/productlot.class.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	 */
163 163
 	public $import_key;
164 164
 
165
-	public $stats_supplier_order=array();
165
+	public $stats_supplier_order = array();
166 166
 
167 167
 
168 168
 	/**
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
 		if (!$error) {
346 346
 			// Insert request
347
-			$sql = 'INSERT INTO ' . $this->db->prefix() . $this->table_element . '(';
347
+			$sql = 'INSERT INTO '.$this->db->prefix().$this->table_element.'(';
348 348
 			$sql .= 'entity,';
349 349
 			$sql .= 'fk_product,';
350 350
 			$sql .= 'batch,';
@@ -361,21 +361,21 @@  discard block
 block discarded – undo
361 361
 			$sql .= 'fk_user_modif,';
362 362
 			$sql .= 'import_key';
363 363
 			$sql .= ') VALUES (';
364
-			$sql .= ' ' . (!isset($this->entity) ? $conf->entity : $this->entity) . ',';
365
-			$sql .= ' ' . (!isset($this->fk_product) ? 'NULL' : $this->fk_product) . ',';
366
-			$sql .= ' ' . (!isset($this->batch) ? 'NULL' : "'" . $this->db->escape($this->batch) . "'") . ',';
367
-			$sql .= ' ' . (!isset($this->eatby) || dol_strlen($this->eatby) == 0 ? 'NULL' : "'" . $this->db->idate($this->eatby) . "'") . ',';
368
-			$sql .= ' ' . (!isset($this->sellby) || dol_strlen($this->sellby) == 0 ? 'NULL' : "'" . $this->db->idate($this->sellby) . "'") . ',';
369
-			$sql .= ' ' . (!isset($this->eol_date) || dol_strlen($this->eol_date) == 0 ? 'NULL' : "'" . $this->db->idate($this->eol_date) . "'") . ',';
370
-			$sql .= ' ' . (!isset($this->manufacturing_date) || dol_strlen($this->manufacturing_date) == 0 ? 'NULL' : "'" . $this->db->idate($this->manufacturing_date) . "'") . ',';
371
-			$sql .= ' ' . (!isset($this->scrapping_date) || dol_strlen($this->scrapping_date) == 0 ? 'NULL' : "'" . $this->db->idate($this->scrapping_date) . "'") . ',';
364
+			$sql .= ' '.(!isset($this->entity) ? $conf->entity : $this->entity).',';
365
+			$sql .= ' '.(!isset($this->fk_product) ? 'NULL' : $this->fk_product).',';
366
+			$sql .= ' '.(!isset($this->batch) ? 'NULL' : "'".$this->db->escape($this->batch)."'").',';
367
+			$sql .= ' '.(!isset($this->eatby) || dol_strlen($this->eatby) == 0 ? 'NULL' : "'".$this->db->idate($this->eatby)."'").',';
368
+			$sql .= ' '.(!isset($this->sellby) || dol_strlen($this->sellby) == 0 ? 'NULL' : "'".$this->db->idate($this->sellby)."'").',';
369
+			$sql .= ' '.(!isset($this->eol_date) || dol_strlen($this->eol_date) == 0 ? 'NULL' : "'".$this->db->idate($this->eol_date)."'").',';
370
+			$sql .= ' '.(!isset($this->manufacturing_date) || dol_strlen($this->manufacturing_date) == 0 ? 'NULL' : "'".$this->db->idate($this->manufacturing_date)."'").',';
371
+			$sql .= ' '.(!isset($this->scrapping_date) || dol_strlen($this->scrapping_date) == 0 ? 'NULL' : "'".$this->db->idate($this->scrapping_date)."'").',';
372 372
 			//$sql .= ' '.(!isset($this->commissionning_date) || dol_strlen($this->commissionning_date) == 0 ? 'NULL' : "'".$this->db->idate($this->commissionning_date)."'").',';
373 373
 			$sql .= ' '.(empty($this->qc_frequency) ? 'NULL' : $this->qc_frequency).',';
374 374
 			$sql .= ' '.(empty($this->lifetime) ? 'NULL' : $this->lifetime).',';
375
-			$sql .= ' ' . "'" . $this->db->idate(dol_now()) . "'" . ',';
376
-			$sql .= ' ' . (!isset($this->fk_user_creat) ? 'NULL' : $this->fk_user_creat) . ',';
377
-			$sql .= ' ' . (!isset($this->fk_user_modif) ? 'NULL' : $this->fk_user_modif) . ',';
378
-			$sql .= ' ' . (!isset($this->import_key) ? 'NULL' : $this->import_key);
375
+			$sql .= ' '."'".$this->db->idate(dol_now())."'".',';
376
+			$sql .= ' '.(!isset($this->fk_user_creat) ? 'NULL' : $this->fk_user_creat).',';
377
+			$sql .= ' '.(!isset($this->fk_user_modif) ? 'NULL' : $this->fk_user_modif).',';
378
+			$sql .= ' '.(!isset($this->import_key) ? 'NULL' : $this->import_key);
379 379
 			$sql .= ')';
380 380
 
381 381
 			$this->db->begin();
@@ -383,11 +383,11 @@  discard block
 block discarded – undo
383 383
 			$resql = $this->db->query($sql);
384 384
 			if (!$resql) {
385 385
 				$error++;
386
-				$this->errors[] = 'Error ' . $this->db->lasterror();
386
+				$this->errors[] = 'Error '.$this->db->lasterror();
387 387
 			}
388 388
 
389 389
 			if (!$error) {
390
-				$this->id = $this->db->last_insert_id($this->db->prefix() . $this->table_element);
390
+				$this->id = $this->db->last_insert_id($this->db->prefix().$this->table_element);
391 391
 
392 392
 				// Actions on extra fields
393 393
 				if (!$error) {
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 		}
417 417
 
418 418
 		if ($error) {
419
-			dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
419
+			dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
420 420
 			return -1 * $error;
421 421
 		} else {
422 422
 			return $this->id;
@@ -565,31 +565,31 @@  discard block
 block discarded – undo
565 565
 
566 566
 		if (!$error) {
567 567
 			// Update request
568
-			$sql = 'UPDATE ' . $this->db->prefix() . $this->table_element . ' SET';
569
-			$sql .= ' entity = ' . (isset($this->entity) ? $this->entity : "null") . ',';
570
-			$sql .= ' fk_product = ' . (isset($this->fk_product) ? $this->fk_product : "null") . ',';
571
-			$sql .= ' batch = ' . (isset($this->batch) ? "'" . $this->db->escape($this->batch) . "'" : "null") . ',';
572
-			$sql .= ' eatby = ' . (!isset($this->eatby) || dol_strlen($this->eatby) != 0 ? "'" . $this->db->idate($this->eatby) . "'" : 'null') . ',';
573
-			$sql .= ' sellby = ' . (!isset($this->sellby) || dol_strlen($this->sellby) != 0 ? "'" . $this->db->idate($this->sellby) . "'" : 'null') . ',';
574
-			$sql .= ' eol_date = ' . (!isset($this->eol_date) || dol_strlen($this->eol_date) != 0 ? "'" . $this->db->idate($this->eol_date) . "'" : 'null') . ',';
575
-			$sql .= ' manufacturing_date = ' . (!isset($this->manufacturing_date) || dol_strlen($this->manufacturing_date) != 0 ? "'" . $this->db->idate($this->manufacturing_date) . "'" : 'null') . ',';
576
-			$sql .= ' scrapping_date = ' . (!isset($this->scrapping_date) || dol_strlen($this->scrapping_date) != 0 ? "'" . $this->db->idate($this->scrapping_date) . "'" : 'null') . ',';
568
+			$sql = 'UPDATE '.$this->db->prefix().$this->table_element.' SET';
569
+			$sql .= ' entity = '.(isset($this->entity) ? $this->entity : "null").',';
570
+			$sql .= ' fk_product = '.(isset($this->fk_product) ? $this->fk_product : "null").',';
571
+			$sql .= ' batch = '.(isset($this->batch) ? "'".$this->db->escape($this->batch)."'" : "null").',';
572
+			$sql .= ' eatby = '.(!isset($this->eatby) || dol_strlen($this->eatby) != 0 ? "'".$this->db->idate($this->eatby)."'" : 'null').',';
573
+			$sql .= ' sellby = '.(!isset($this->sellby) || dol_strlen($this->sellby) != 0 ? "'".$this->db->idate($this->sellby)."'" : 'null').',';
574
+			$sql .= ' eol_date = '.(!isset($this->eol_date) || dol_strlen($this->eol_date) != 0 ? "'".$this->db->idate($this->eol_date)."'" : 'null').',';
575
+			$sql .= ' manufacturing_date = '.(!isset($this->manufacturing_date) || dol_strlen($this->manufacturing_date) != 0 ? "'".$this->db->idate($this->manufacturing_date)."'" : 'null').',';
576
+			$sql .= ' scrapping_date = '.(!isset($this->scrapping_date) || dol_strlen($this->scrapping_date) != 0 ? "'".$this->db->idate($this->scrapping_date)."'" : 'null').',';
577 577
 			//$sql .= ' commissionning_date = '.(!isset($this->first_use_date) || dol_strlen($this->first_use_date) != 0 ? "'".$this->db->idate($this->first_use_date)."'" : 'null').',';
578 578
 			$sql .= ' qc_frequency = '.(!empty($this->qc_frequency) ? (int) $this->qc_frequency : 'null').',';
579 579
 			$sql .= ' lifetime = '.(!empty($this->lifetime) ? (int) $this->lifetime : 'null').',';
580
-			$sql .= ' datec = ' . (!isset($this->datec) || dol_strlen($this->datec) != 0 ? "'" . $this->db->idate($this->datec) . "'" : 'null') . ',';
581
-			$sql .= ' tms = ' . (dol_strlen($this->tms) != 0 ? "'" . $this->db->idate($this->tms) . "'" : "'" . $this->db->idate(dol_now()) . "'") . ',';
582
-			$sql .= ' fk_user_creat = ' . (isset($this->fk_user_creat) ? $this->fk_user_creat : "null") . ',';
583
-			$sql .= ' fk_user_modif = ' . (isset($this->fk_user_modif) ? $this->fk_user_modif : "null") . ',';
584
-			$sql .= ' import_key = ' . (isset($this->import_key) ? $this->import_key : "null");
585
-			$sql .= ' WHERE rowid=' . ((int) $this->id);
580
+			$sql .= ' datec = '.(!isset($this->datec) || dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').',';
581
+			$sql .= ' tms = '.(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : "'".$this->db->idate(dol_now())."'").',';
582
+			$sql .= ' fk_user_creat = '.(isset($this->fk_user_creat) ? $this->fk_user_creat : "null").',';
583
+			$sql .= ' fk_user_modif = '.(isset($this->fk_user_modif) ? $this->fk_user_modif : "null").',';
584
+			$sql .= ' import_key = '.(isset($this->import_key) ? $this->import_key : "null");
585
+			$sql .= ' WHERE rowid='.((int) $this->id);
586 586
 
587 587
 			$this->db->begin();
588 588
 
589 589
 			$resql = $this->db->query($sql);
590 590
 			if (!$resql) {
591 591
 				$error++;
592
-				$this->errors[] = 'Error ' . $this->db->lasterror();
592
+				$this->errors[] = 'Error '.$this->db->lasterror();
593 593
 			}
594 594
 
595 595
 			// Actions on extra fields
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 		}
619 619
 
620 620
 		if ($error) {
621
-			dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
621
+			dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
622 622
 			return -1 * $error;
623 623
 		} else {
624 624
 			return 1;
@@ -1029,7 +1029,7 @@  discard block
 block discarded – undo
1029 1029
 				$obj = $this->db->fetch_object($result);
1030 1030
 				$this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0;
1031 1031
 				$this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0;
1032
-				$this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0;		// qty may be a float due to the SUM()
1032
+				$this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM()
1033 1033
 			} else {
1034 1034
 				$this->error = $this->db->error();
1035 1035
 				$error++;
Please login to merge, or discard this patch.
htdocs/fourn/facture/card-rec.php 1 patch
Spacing   +170 added lines, -170 removed lines patch added patch discarded remove patch
@@ -32,17 +32,17 @@  discard block
 block discarded – undo
32 32
 
33 33
 // Load Dolibarr environment
34 34
 require '../../main.inc.php';
35
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
39 39
 if (isModEnabled('project')) {
40
-	include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
40
+	include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
41 41
 }
42
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
43
-require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
44
-require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php';
45
-require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
42
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
43
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
44
+require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
45
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
46 46
 
47 47
 // Load translation files required by the page
48 48
 $langs->loadLangs(array('bills', 'companies', 'compta', 'admin', 'other', 'products', 'banks', 'suppliers'));
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
 	$page = 0;
84 84
 }     // If $page is not defined, or '' or -1
85 85
 $offset = $limit * $page;
86
-if (! $sortorder) {
86
+if (!$sortorder) {
87 87
 	$sortorder = 'DESC';
88 88
 }
89
-if (! $sortfield) {
89
+if (!$sortfield) {
90 90
 	$sortfield = 'f.titre';
91 91
 }
92 92
 $pageprev = $page - 1;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 $object = new FactureFournisseurRec($db);
96 96
 if (($id > 0 || $title) && $action != 'create' && $action != 'add') {
97 97
 	$ret = $object->fetch($id, $title);
98
-	if (! $ret) {
98
+	if (!$ret) {
99 99
 		setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors');
100 100
 	}
101 101
 }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	$action = 'list';
140 140
 	$massaction = '';
141 141
 }
142
-if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
142
+if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
143 143
 	$massaction = '';
144 144
 }
145 145
 
@@ -155,18 +155,18 @@  discard block
 block discarded – undo
155 155
 	}
156 156
 
157 157
 	// Selection of new fields
158
-	include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
158
+	include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
159 159
 
160 160
 	// Set note
161
-	include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not include_once
161
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
162 162
 
163
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be include, not include_once
163
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
164 164
 
165
-	include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be include, not include_once
165
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
166 166
 
167 167
 	// Create predefined invoice
168 168
 	if ($action == 'add') {
169
-		if (! GETPOST('title', 'alphanohtml')) {
169
+		if (!GETPOST('title', 'alphanohtml')) {
170 170
 			setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Title")), null, 'errors');
171 171
 			$action = "create";
172 172
 			$error++;
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
 			}
190 190
 		}
191 191
 
192
-		if (! $error) {
192
+		if (!$error) {
193 193
 			$object->titre = GETPOST('title', 'alphanohtml'); // deprecated
194 194
 			$object->title = GETPOST('title', 'alphanohtml');
195
-			$object->libelle = GETPOST('libelle', 'alpha');	// deprecated
195
+			$object->libelle = GETPOST('libelle', 'alpha'); // deprecated
196 196
 			$object->label = GETPOST('libelle', 'alpha');
197 197
 			$object->fk_project = GETPOSTINT('projectid');
198 198
 			$object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml');
@@ -238,10 +238,10 @@  discard block
 block discarded – undo
238 238
 				$action = "create";
239 239
 			}
240 240
 
241
-			if (! $error) {
241
+			if (!$error) {
242 242
 				$db->commit();
243 243
 
244
-				header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $object->id);
244
+				header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$object->id);
245 245
 				exit;
246 246
 			} else {
247 247
 				$db->rollback();
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && ($user->hasRight("fournisseur", "facture", "supprimer") || $user->hasRight("supplier_invoice", "supprimer"))) {
259 259
 		$object->delete($user);
260 260
 
261
-		header('Location: ' . DOL_URL_ROOT . '/fourn/facture/list-rec.php');
261
+		header('Location: '.DOL_URL_ROOT.'/fourn/facture/list-rec.php');
262 262
 		exit;
263 263
 	}
264 264
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 		$result = $object->setValueFrom('titre', $title, '', null, 'text', '', $user);
289 289
 
290 290
 		if ($result > 0) {
291
-			$object->titre = $title;	// deprecated
291
+			$object->titre = $title; // deprecated
292 292
 			$object->title = $title;
293 293
 			$object->ref = $object->title;
294 294
 		} else {
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 			$error++;
336 336
 		}
337 337
 
338
-		if (! $error) {
338
+		if (!$error) {
339 339
 			$db->commit();
340 340
 		} else {
341 341
 			$db->rollback();
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 			$error++;
353 353
 		}
354 354
 
355
-		if (! $error) {
355
+		if (!$error) {
356 356
 			$db->commit();
357 357
 		} else {
358 358
 			$db->rollback();
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 			$error++;
412 412
 		}
413 413
 
414
-		if (! $error) {
414
+		if (!$error) {
415 415
 			$result = $object->insertExtraFields('BILLREC_MODIFY');
416 416
 			if ($result < 0) {
417 417
 				setEventMessages($object->error, $object->errors, 'errors');
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
 			$tva_tx = '';
441 441
 		}
442 442
 
443
-		$qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2);
444
-		$remise_percent = price2num(GETPOST('remise_percent' . $predef), '', 2);
443
+		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
444
+		$remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2);
445 445
 
446 446
 		// Extrafields
447 447
 		$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 		if (is_array($extralabelsline)) {
451 451
 			// Get extra fields
452 452
 			foreach ($extralabelsline as $key => $value) {
453
-				unset($_POST["options_" . $key . $predef]);
453
+				unset($_POST["options_".$key.$predef]);
454 454
 			}
455 455
 		}
456 456
 
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 			setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
463 463
 			$error++;
464 464
 		}
465
-		if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (! ($price_ht >= 0) || $price_ht == '')) {    // Unit price can be 0 but not ''
465
+		if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (!($price_ht >= 0) || $price_ht == '')) {    // Unit price can be 0 but not ''
466 466
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
467 467
 			$error++;
468 468
 		}
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 			}
512 512
 		}
513 513
 
514
-		if (! $error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) {
514
+		if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) {
515 515
 			$ret = $object->fetch($id);
516 516
 			if ($ret < 0) {
517 517
 				dol_print_error($db, $object->error);
@@ -520,8 +520,8 @@  discard block
 block discarded – undo
520 520
 			$ret = $object->fetch_thirdparty();
521 521
 
522 522
 			// Clean parameters
523
-			$date_start = dol_mktime(GETPOST('date_start' . $predef . 'hour'), GETPOST('date_start' . $predef . 'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year'));
524
-			$date_end = dol_mktime(GETPOST('date_end' . $predef . 'hour'), GETPOST('date_end' . $predef . 'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year'));
523
+			$date_start = dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
524
+			$date_end = dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
525 525
 			$price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT');
526 526
 
527 527
 			// Define special_code for special lines
@@ -618,23 +618,23 @@  discard block
 block discarded – undo
618 618
 							$outputlangs->load('products');
619 619
 						}
620 620
 						if (!empty($prod->customcode)) {
621
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
621
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
622 622
 						}
623 623
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
624 624
 							$tmptxt .= ' - ';
625 625
 						}
626 626
 						if (!empty($prod->country_code)) {
627
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
627
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $outputlangs, 0);
628 628
 						}
629 629
 					} else {
630 630
 						if (!empty($prod->customcode)) {
631
-							$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
631
+							$tmptxt .= $langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
632 632
 						}
633 633
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
634 634
 							$tmptxt .= ' - ';
635 635
 						}
636 636
 						if (!empty($prod->country_code)) {
637
-							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
637
+							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $langs, 0);
638 638
 						}
639 639
 					}
640 640
 					$tmptxt .= ')';
@@ -660,8 +660,8 @@  discard block
 block discarded – undo
660 660
 			$date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : null;
661 661
 
662 662
 			// Margin
663
-			$fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : '');
664
-			$buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value
663
+			$fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : '');
664
+			$buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value
665 665
 
666 666
 			// Local Taxes
667 667
 			$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc, $tva_npr);
@@ -727,8 +727,8 @@  discard block
 block discarded – undo
727 727
 				$action = '';
728 728
 			}
729 729
 		}
730
-	} elseif ($action == 'updateline' && $usercancreate && ! GETPOST('cancel', 'alpha')) {
731
-		if (! $object->fetch($id) > 0) {
730
+	} elseif ($action == 'updateline' && $usercancreate && !GETPOST('cancel', 'alpha')) {
731
+		if (!$object->fetch($id) > 0) {
732 732
 			dol_print_error($db);
733 733
 		}
734 734
 		$object->fetch_thirdparty();
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
 			$objectline->array_options = $array_options;
764 764
 			$result = $objectline->insertExtraFields();
765 765
 			if ($result < 0) {
766
-				setEventMessages($langs->trans('Error') . $result, null, 'errors');
766
+				setEventMessages($langs->trans('Error').$result, null, 'errors');
767 767
 			}
768 768
 		}
769 769
 
@@ -773,13 +773,13 @@  discard block
 block discarded – undo
773 773
 		if (is_array($extralabelsline)) {
774 774
 			// Get extra fields
775 775
 			foreach ($extralabelsline as $key => $value) {
776
-				unset($_POST["options_" . $key]);
776
+				unset($_POST["options_".$key]);
777 777
 			}
778 778
 		}
779 779
 
780 780
 		// Define special_code for special lines
781 781
 		$special_code = GETPOST('special_code', 'int');
782
-		if (! GETPOST('qty', 'alpha')) {
782
+		if (!GETPOST('qty', 'alpha')) {
783 783
 			$special_code = 3;
784 784
 		}
785 785
 
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 		$date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : 'NULL';
826 826
 
827 827
 		// Update line
828
-		if (! $error) {
828
+		if (!$error) {
829 829
 			$result = $object->updateline(GETPOST('lineid', 'int'), GETPOST('productid', 'int'), $ref_fourn, $label, $description, $pu_ht, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax1_rate, 'HT', $type, $date_start_fill, $date_end_fill, $info_bits, $special_code, -1);
830 830
 			if ($result >= 0) {
831 831
 				$object->fetch($object->id); // Reload lines
@@ -899,10 +899,10 @@  discard block
 block discarded – undo
899 899
 	if ($object->fetch($id) > 0) {
900 900
 		$result = $object->fetch_lines();
901 901
 
902
-		print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
903
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
902
+		print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
903
+		print '<input type="hidden" name="token" value="'.newToken().'">';
904 904
 		print '<input type="hidden" name="action" value="add">';
905
-		print '<input type="hidden" name="facid" value="' . $object->id . '">';
905
+		print '<input type="hidden" name="facid" value="'.$object->id.'">';
906 906
 
907 907
 		print dol_get_fiche_head(null, '', '', 0);
908 908
 
@@ -919,17 +919,17 @@  discard block
 block discarded – undo
919 919
 		$object->fetch_thirdparty();
920 920
 
921 921
 		// Title
922
-		print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("Title") . '</td><td>';
923
-		print '<input class="flat quatrevingtpercent" type="text" name="title" value="' . dol_escape_htmltag(GETPOST("title", 'alphanohtml')) . '" autofocus>';
922
+		print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Title").'</td><td>';
923
+		print '<input class="flat quatrevingtpercent" type="text" name="title" value="'.dol_escape_htmltag(GETPOST("title", 'alphanohtml')).'" autofocus>';
924 924
 		print '</td></tr>';
925 925
 
926 926
 		// Ref supplier
927
-		print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("RefSupplier") . '</td><td>';
928
-		print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="' . $object->ref_supplier . '">';
927
+		print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("RefSupplier").'</td><td>';
928
+		print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="'.$object->ref_supplier.'">';
929 929
 		print '</td></tr>';
930 930
 
931 931
 		// Third party
932
-		print '<tr><td class="titlefieldcreate">' . $langs->trans("Customer") . '</td><td>' . $object->thirdparty->getNomUrl(1, 'customer') . '</td>';
932
+		print '<tr><td class="titlefieldcreate">'.$langs->trans("Customer").'</td><td>'.$object->thirdparty->getNomUrl(1, 'customer').'</td>';
933 933
 		print '</tr>';
934 934
 
935 935
 		$note_public = GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : $object->note_public;
@@ -938,30 +938,30 @@  discard block
 block discarded – undo
938 938
 		// Help of substitution key
939 939
 		$substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object);
940 940
 
941
-		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m') . ')';
942
-		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%m') . ')';
943
-		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m') . ')';
944
-		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B') . ')';
945
-		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%B') . ')';
946
-		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B') . ')';
947
-		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y') . ')';
948
-		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%Y') . ')';
949
-		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y') . ')';
941
+		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m').')';
942
+		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%m').')';
943
+		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m').')';
944
+		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B').')';
945
+		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%B').')';
946
+		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B').')';
947
+		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y').')';
948
+		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%Y').')';
949
+		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y').')';
950 950
 		// Only on template invoices
951
-		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' .dol_print_date($object->date_when, 'dayhour') . ')' : '');
952
-		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour') . ')' : '');
951
+		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')' : '');
952
+		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour').')' : '');
953 953
 		$substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $langs->trans("Count");
954 954
 		$substitutionarray['__INVOICE_COUNTER_MAX__'] = $langs->trans("MaxPeriodNumber");
955 955
 
956
-		$htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>';
956
+		$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
957 957
 		foreach ($substitutionarray as $key => $val) {
958
-			$htmltext .= $key . ' = ' . $langs->trans($val) . '<br>';
958
+			$htmltext .= $key.' = '.$langs->trans($val).'<br>';
959 959
 		}
960 960
 		$htmltext .= '</i>';
961 961
 
962 962
 		// Label
963
-		print '<tr><td class="titlefieldcreate">' . $langs->trans("Label") . '</td><td>';
964
-		print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="' . $object->label . '">';
963
+		print '<tr><td class="titlefieldcreate">'.$langs->trans("Label").'</td><td>';
964
+		print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="'.$object->label.'">';
965 965
 		print '</td></tr>';
966 966
 
967 967
 		// Public note
@@ -986,38 +986,38 @@  discard block
 block discarded – undo
986 986
 		}
987 987
 
988 988
 		// Author
989
-		print "<tr><td>" . $langs->trans("Author") . "</td><td>" . $user->getFullName($langs) . "</td></tr>";
989
+		print "<tr><td>".$langs->trans("Author")."</td><td>".$user->getFullName($langs)."</td></tr>";
990 990
 
991 991
 		// Payment term
992
-		print "<tr><td>" . $langs->trans("PaymentConditions") . "</td><td>";
993
-		$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->cond_reglement_id, 'none');
992
+		print "<tr><td>".$langs->trans("PaymentConditions")."</td><td>";
993
+		$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none');
994 994
 		print "</td></tr>";
995 995
 
996 996
 		// Payment mode
997
-		print "<tr><td>" . $langs->trans("PaymentMode") . "</td><td>";
998
-		$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none', '', 1);
997
+		print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
998
+		$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none', '', 1);
999 999
 		print "</td></tr>";
1000 1000
 
1001 1001
 		// Project
1002 1002
 		if (isModEnabled('project') && is_object($object->thirdparty) && $object->thirdparty->id > 0) {
1003 1003
 			$projectid = GETPOST('projectid') ? GETPOST('projectid') : $object->fk_project;
1004 1004
 			$langs->load('projects');
1005
-			print '<tr><td>' . $langs->trans('Project') . '</td><td>';
1005
+			print '<tr><td>'.$langs->trans('Project').'</td><td>';
1006 1006
 			$numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, '');
1007
-			print ' &nbsp; <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $object->thirdparty->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $object->thirdparty->id . (!empty($id) ? '&id=' . $id : '')) . '">' . $langs->trans("AddProject") . '</a>';
1007
+			print ' &nbsp; <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->thirdparty->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$object->thirdparty->id.(!empty($id) ? '&id='.$id : '')).'">'.$langs->trans("AddProject").'</a>';
1008 1008
 			print '</td></tr>';
1009 1009
 		}
1010 1010
 
1011 1011
 		// Bank account
1012 1012
 		if ($object->fk_account > 0) {
1013
-			print "<tr><td>" . $langs->trans('BankAccount') . "</td><td>";
1014
-			$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'none');
1013
+			print "<tr><td>".$langs->trans('BankAccount')."</td><td>";
1014
+			$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none');
1015 1015
 			print "</td></tr>";
1016 1016
 		}
1017 1017
 
1018 1018
 		// Model pdf
1019
-		print "<tr><td>" . $langs->trans('Model') . "</td><td>";
1020
-		include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php';
1019
+		print "<tr><td>".$langs->trans('Model')."</td><td>";
1020
+		include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php';
1021 1021
 		$list = ModelePDFSuppliersInvoices::liste_modeles($db);
1022 1022
 		print $form->selectarray('modelpdf', $list, $conf->global->INVOICE_SUPPLIER_ADDON_PDF);
1023 1023
 		print "</td></tr>";
@@ -1028,7 +1028,7 @@  discard block
 block discarded – undo
1028 1028
 
1029 1029
 		// Autogeneration
1030 1030
 		$title = $langs->trans("Recurrence");
1031
-		print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"') . $title, '', '');
1031
+		print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"').$title, '', '');
1032 1032
 
1033 1033
 		print '<span class="opacitymedium">'.$langs->trans("ToCreateARecurringInvoiceGeneAuto", $langs->transnoentitiesnoconv('Module2300Name')).'</span><br><br>';
1034 1034
 
@@ -1037,30 +1037,30 @@  discard block
 block discarded – undo
1037 1037
 		print '<table class="border centpercent">';
1038 1038
 
1039 1039
 		// Frequency + unit
1040
-		print '<tr><td class="titlefieldcreate">' . $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')) . "</td><td>";
1041
-		print "<input type='text' name='frequency' value='" . GETPOST('frequency', 'int') . "' size='4' />&nbsp;" . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm'));
1040
+		print '<tr><td class="titlefieldcreate">'.$form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency'))."</td><td>";
1041
+		print "<input type='text' name='frequency' value='".GETPOST('frequency', 'int')."' size='4' />&nbsp;".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm'));
1042 1042
 		print "</td></tr>";
1043 1043
 
1044 1044
 		// Date next run
1045
-		print "<tr><td>" . $langs->trans('NextDateToExecution') . "</td><td>";
1045
+		print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>";
1046 1046
 		$date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1);
1047 1047
 		print $form->selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1);
1048 1048
 		print "</td></tr>";
1049 1049
 
1050 1050
 		// Number max of generation
1051
-		print "<tr><td>" . $langs->trans("MaxPeriodNumber") . "</td><td>";
1052
-		print '<input type="text" name="nb_gen_max" value="' . GETPOST('nb_gen_max') . '" size="5" />';
1051
+		print "<tr><td>".$langs->trans("MaxPeriodNumber")."</td><td>";
1052
+		print '<input type="text" name="nb_gen_max" value="'.GETPOST('nb_gen_max').'" size="5" />';
1053 1053
 		print "</td></tr>";
1054 1054
 
1055 1055
 		// Auto validate the invoice
1056
-		print "<tr><td>" . $langs->trans("StatusOfGeneratedInvoices") . "</td><td>";
1056
+		print "<tr><td>".$langs->trans("StatusOfGeneratedInvoices")."</td><td>";
1057 1057
 		$select = array('0' => $langs->trans('BillStatusDraft'), '1' => $langs->trans('BillStatusValidated'));
1058 1058
 		print $form->selectarray('auto_validate', $select, GETPOST('auto_validate'));
1059 1059
 		print "</td></tr>";
1060 1060
 
1061 1061
 		// Auto generate document
1062 1062
 		if (getDolGlobalString('INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION')) {
1063
-			print "<tr><td>" . $langs->trans("StatusOfAutoGeneratedDocuments") . "</td><td>";
1063
+			print "<tr><td>".$langs->trans("StatusOfAutoGeneratedDocuments")."</td><td>";
1064 1064
 			$select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc'));
1065 1065
 			print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf'));
1066 1066
 			print "</td></tr>";
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 
1104 1104
 		print "</form>\n";
1105 1105
 	} else {
1106
-		dol_print_error(null, "Error, no invoice " . $object->id);
1106
+		dol_print_error(null, "Error, no invoice ".$object->id);
1107 1107
 	}
1108 1108
 } else {
1109 1109
 	/*
@@ -1117,12 +1117,12 @@  discard block
 block discarded – undo
1117 1117
 
1118 1118
 		// Confirmation de la suppression d'une ligne produit
1119 1119
 		if ($action == 'ask_deleteline') {
1120
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1);
1120
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1);
1121 1121
 		}
1122 1122
 
1123 1123
 		// Confirm delete of repeatable invoice
1124 1124
 		if ($action == 'ask_deleteinvoice') {
1125
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1);
1125
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1);
1126 1126
 		}
1127 1127
 
1128 1128
 		print $formconfirm;
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
 
1137 1137
 		// Recurring invoice content
1138 1138
 
1139
-		$linkback = '<a href="' . DOL_URL_ROOT . '/fourn/facture/list-rec.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans('BackToList') . '</a>';
1139
+		$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list-rec.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans('BackToList').'</a>';
1140 1140
 
1141 1141
 		$morehtmlref = '';
1142 1142
 		if ($action != 'edittitle') {
@@ -1149,33 +1149,33 @@  discard block
 block discarded – undo
1149 1149
 		$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1);
1150 1150
 		$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1);
1151 1151
 		// Thirdparty
1152
-		$morehtmlref .= '<br>' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
1152
+		$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
1153 1153
 
1154 1154
 		// Project
1155 1155
 		if (isModEnabled('project')) {
1156 1156
 			$langs->load('projects');
1157
-			$morehtmlref .= '<br>' . $langs->trans('Project') . ' ';
1157
+			$morehtmlref .= '<br>'.$langs->trans('Project').' ';
1158 1158
 			if ($usercancreate) {
1159 1159
 				if ($action != 'classify') {
1160
-					$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
1160
+					$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
1161 1161
 				}
1162 1162
 				if ($action == 'classify') {
1163
-					$morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">';
1163
+					$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
1164 1164
 					$morehtmlref .= '<input type="hidden" name="action" value="classin">';
1165
-					$morehtmlref .= '<input type="hidden" name="token" value="' . newToken() . '">';
1165
+					$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
1166 1166
 					$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
1167
-					$morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
1167
+					$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
1168 1168
 					$morehtmlref .= '</form>';
1169 1169
 				} else {
1170
-					$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
1170
+					$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
1171 1171
 				}
1172 1172
 			} else {
1173 1173
 				if (!empty($object->fk_project)) {
1174 1174
 					$project = new Project($db);
1175 1175
 					$project->fetch($object->fk_project);
1176
-					$morehtmlref .= ' : ' . $project->getNomUrl(1);
1176
+					$morehtmlref .= ' : '.$project->getNomUrl(1);
1177 1177
 					if ($project->title) {
1178
-						$morehtmlref .= ' - ' . $project->title;
1178
+						$morehtmlref .= ' - '.$project->title;
1179 1179
 					}
1180 1180
 				} else {
1181 1181
 					$morehtmlref .= '';
@@ -1194,34 +1194,34 @@  discard block
 block discarded – undo
1194 1194
 
1195 1195
 		print '<table class="border centpercent tableforfield">';
1196 1196
 
1197
-		print '<tr><td class="titlefield">' . $langs->trans('Author') . '</td><td>';
1197
+		print '<tr><td class="titlefield">'.$langs->trans('Author').'</td><td>';
1198 1198
 		print $author->getNomUrl(-1);
1199 1199
 		print "</td></tr>";
1200 1200
 
1201 1201
 		// Label
1202 1202
 		print '<tr>';
1203
-		print '<td>' . $form->editfieldkey("Label", 'libelle', $object->libelle, $object, $usercancreate) . '</td>';
1204
-		print '<td>' . $form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate) . '</td>';
1203
+		print '<td>'.$form->editfieldkey("Label", 'libelle', $object->libelle, $object, $usercancreate).'</td>';
1204
+		print '<td>'.$form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate).'</td>';
1205 1205
 		print '</tr>';
1206 1206
 
1207
-		print '<tr><td>' . $langs->trans('AmountHT') . '</td>';
1208
-		print '<td>' . price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency) . '</td>';
1207
+		print '<tr><td>'.$langs->trans('AmountHT').'</td>';
1208
+		print '<td>'.price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency).'</td>';
1209 1209
 		print '</tr>';
1210 1210
 
1211
-		print '<tr><td>' . $langs->trans("AmountVAT") . '</td><td>' . price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency) . '</td>';
1211
+		print '<tr><td>'.$langs->trans("AmountVAT").'</td><td>'.price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency).'</td>';
1212 1212
 		print '</tr>';
1213 1213
 
1214 1214
 		// Amount Local Taxes
1215 1215
 		if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {    // Localtax1
1216
-			print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
1217
-			print '<td class="nowrap">' . price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>';
1216
+			print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
1217
+			print '<td class="nowrap">'.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
1218 1218
 		}
1219 1219
 		if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {    // Localtax2
1220
-			print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
1221
-			print '<td class=nowrap">' . price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>';
1220
+			print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
1221
+			print '<td class=nowrap">'.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
1222 1222
 		}
1223 1223
 
1224
-		print '<tr><td>' . $langs->trans("AmountTTC") . '</td><td colspan="3">' . price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency) . '</td>';
1224
+		print '<tr><td>'.$langs->trans("AmountTTC").'</td><td colspan="3">'.price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency).'</td>';
1225 1225
 		print '</tr>';
1226 1226
 
1227 1227
 		// Payment term
@@ -1230,14 +1230,14 @@  discard block
 block discarded – undo
1230 1230
 		print $langs->trans('PaymentConditionsShort');
1231 1231
 		print '</td>';
1232 1232
 		if ($action != 'editconditions' && $usercancreate) {
1233
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
1233
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
1234 1234
 		}
1235 1235
 		print '</tr></table>';
1236 1236
 		print '</td><td>';
1237 1237
 		if ($action == 'editconditions') {
1238
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'cond_reglement_id');
1238
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
1239 1239
 		} else {
1240
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'none');
1240
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none');
1241 1241
 		}
1242 1242
 
1243 1243
 		print '</td></tr>';
@@ -1248,14 +1248,14 @@  discard block
 block discarded – undo
1248 1248
 		print $langs->trans('PaymentMode');
1249 1249
 		print '</td>';
1250 1250
 		if ($action != 'editmode' && $usercancreate) {
1251
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>';
1251
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
1252 1252
 		}
1253 1253
 		print '</tr></table>';
1254 1254
 		print '</td><td>';
1255 1255
 		if ($action == 'editmode') {
1256
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
1256
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
1257 1257
 		} else {
1258
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'none');
1258
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none');
1259 1259
 		}
1260 1260
 		print '</td></tr>';
1261 1261
 
@@ -1268,12 +1268,12 @@  discard block
 block discarded – undo
1268 1268
 			print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
1269 1269
 			print '</td>';
1270 1270
 			if ($usercancreate && $action != 'editmulticurrencycode' && $object->suspended == $object::STATUS_SUSPENDED) {
1271
-				print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
1271
+				print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
1272 1272
 			}
1273 1273
 			print '</tr></table>';
1274 1274
 			print '</td><td>';
1275 1275
 			$htmlname = (($usercancreate && $action == 'editmulticurrencycode') ? 'multicurrency_code' : 'none');
1276
-			$form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, $htmlname);
1276
+			$form->form_multicurrency_code($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_code, $htmlname);
1277 1277
 			print '</td></tr>';
1278 1278
 
1279 1279
 			// Multicurrency rate
@@ -1284,7 +1284,7 @@  discard block
 block discarded – undo
1284 1284
 				print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
1285 1285
 				print '</td>';
1286 1286
 				if ($usercancreate && $action != 'editmulticurrencyrate' && $object->suspended == $object::STATUS_SUSPENDED && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
1287
-					print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
1287
+					print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
1288 1288
 				}
1289 1289
 				print '</tr></table>';
1290 1290
 				print '</td><td>';
@@ -1292,12 +1292,12 @@  discard block
 block discarded – undo
1292 1292
 					if ($action == 'actualizemulticurrencyrate') {
1293 1293
 						list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
1294 1294
 					}
1295
-					$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, ($usercancreate ? 'multicurrency_tx' : 'none'), $object->multicurrency_code);
1295
+					$form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, ($usercancreate ? 'multicurrency_tx' : 'none'), $object->multicurrency_code);
1296 1296
 				} else {
1297
-					$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
1297
+					$form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
1298 1298
 					if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
1299 1299
 						print '<div class="inline-block"> &nbsp; &nbsp; &nbsp; &nbsp; ';
1300
-						print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=actualizemulticurrencyrate">' . $langs->trans("ActualizeCurrency") . '</a>';
1300
+						print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
1301 1301
 						print '</div>';
1302 1302
 					}
1303 1303
 				}
@@ -1313,24 +1313,24 @@  discard block
 block discarded – undo
1313 1313
 
1314 1314
 		$substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object);
1315 1315
 
1316
-		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m') . ')';
1317
-		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%m') . ')';
1318
-		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m') . ')';
1319
-		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B') . ')';
1320
-		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%B') . ')';
1321
-		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B') . ')';
1322
-		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y') . ')';
1323
-		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%Y') . ')';
1324
-		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y') . ')';
1316
+		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m').')';
1317
+		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%m').')';
1318
+		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m').')';
1319
+		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B').')';
1320
+		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%B').')';
1321
+		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B').')';
1322
+		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y').')';
1323
+		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%Y').')';
1324
+		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y').')';
1325 1325
 		// Only on template invoices
1326
-		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour') . ')';
1327
-		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour') . ')';
1326
+		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour').')';
1327
+		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour').')';
1328 1328
 		$substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $object->nb_gen_done;
1329 1329
 		$substitutionarray['__INVOICE_COUNTER_MAX__'] = $object->nb_gen_max;
1330 1330
 
1331
-		$htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>';
1331
+		$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
1332 1332
 		foreach ($substitutionarray as $key => $val) {
1333
-			$htmltext .= $key . ' = ' . $langs->trans($val) . '<br>';
1333
+			$htmltext .= $key.' = '.$langs->trans($val).'<br>';
1334 1334
 		}
1335 1335
 		$htmltext .= '</i>';
1336 1336
 
@@ -1338,7 +1338,7 @@  discard block
 block discarded – undo
1338 1338
 		print '<tr><td>';
1339 1339
 		print $form->editfieldkey($form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic'), 'note_public', $object->note_public, $object, $usercancreate);
1340 1340
 		print '</td><td class="wordbreak">';
1341
-		print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $usercancreate, 'textarea:' . ROWS_4 . ':90%', '', null, null, '', 1);
1341
+		print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $usercancreate, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1);
1342 1342
 		print '</td>';
1343 1343
 		print '</tr>';
1344 1344
 
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 		print '<tr><td>';
1347 1347
 		print $form->editfieldkey($form->textwithpicto($langs->trans("NotePrivate"), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'), 'note_private', $object->note_private, $object, $usercancreate);
1348 1348
 		print '</td><td class="wordbreak">';
1349
-		print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $usercancreate, 'textarea:' . ROWS_4 . ':90%', '', null, null, '', 1);
1349
+		print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $usercancreate, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1);
1350 1350
 		print '</td>';
1351 1351
 		print '</tr>';
1352 1352
 
@@ -1356,14 +1356,14 @@  discard block
 block discarded – undo
1356 1356
 		print $langs->trans('BankAccount');
1357 1357
 		print '<td>';
1358 1358
 		if ($action != 'editbankaccount' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) {
1359
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=editbankaccount&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetBankAccount'), 1) . '</a></td>';
1359
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
1360 1360
 		}
1361 1361
 		print '</tr></table>';
1362 1362
 		print '</td><td>';
1363 1363
 		if ($action == 'editbankaccount') {
1364
-			$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'fk_account', 1);
1364
+			$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1);
1365 1365
 		} else {
1366
-			$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'none');
1366
+			$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none');
1367 1367
 		}
1368 1368
 		print "</td>";
1369 1369
 		print '</tr>';
@@ -1374,18 +1374,18 @@  discard block
 block discarded – undo
1374 1374
 		print $langs->trans('Model');
1375 1375
 		print '<td>';
1376 1376
 		if ($action != 'editmodelpdf' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) {
1377
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=editmodelpdf&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetModel'), 1) . '</a></td>';
1377
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=editmodelpdf&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetModel'), 1).'</a></td>';
1378 1378
 		}
1379 1379
 		print '</tr></table>';
1380 1380
 		print '</td><td>';
1381 1381
 		if ($action == 'editmodelpdf') {
1382
-			include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php';
1382
+			include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php';
1383 1383
 			$list = array();
1384 1384
 			$models = ModelePDFSuppliersInvoices::liste_modeles($db);
1385 1385
 			foreach ($models as $k => $model) {
1386
-				$list[] = str_replace(':', '|', $k) . ':' . $model;
1386
+				$list[] = str_replace(':', '|', $k).':'.$model;
1387 1387
 			}
1388
-			$select = 'select;' . implode(',', $list);
1388
+			$select = 'select;'.implode(',', $list);
1389 1389
 			//TODO : Droits
1390 1390
 			print $form->editfieldval($langs->trans('Model'), 'modelpdf', $object->model_pdf, $object, $usercancreate, $select);
1391 1391
 		} else {
@@ -1396,7 +1396,7 @@  discard block
 block discarded – undo
1396 1396
 
1397 1397
 		// Other attributes
1398 1398
 		$cols = 2;
1399
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
1399
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
1400 1400
 
1401 1401
 		print '</table>';
1402 1402
 
@@ -1412,7 +1412,7 @@  discard block
 block discarded – undo
1412 1412
 
1413 1413
 		print '<table class="border centpercent tableforfield">';
1414 1414
 
1415
-		print '<tr><td colspan="2">' . img_picto('', 'recurring', 'class="pictofixedwidth"') . $title . '</td></tr>';
1415
+		print '<tr><td colspan="2">'.img_picto('', 'recurring', 'class="pictofixedwidth"').$title.'</td></tr>';
1416 1416
 
1417 1417
 		// if "frequency" is empty or = 0, the recurrence is disabled
1418 1418
 		print '<tr><td style="width: 50%">';
@@ -1420,23 +1420,23 @@  discard block
 block discarded – undo
1420 1420
 		print $langs->trans('Frequency');
1421 1421
 		print '</td>';
1422 1422
 		if ($action != 'editfrequency' && $usercancreate) {
1423
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editfrequency&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('Edit'), 1) . '</a></td>';
1423
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('Edit'), 1).'</a></td>';
1424 1424
 		}
1425 1425
 		print '</tr></table>';
1426 1426
 		print '</td><td>';
1427 1427
 		if ($action == 'editfrequency') {
1428
-			print '<form method="post" action="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '">';
1428
+			print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'">';
1429 1429
 			print '<input type="hidden" name="action" value="setfrequency">';
1430
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
1430
+			print '<input type="hidden" name="token" value="'.newToken().'">';
1431 1431
 			print '<table class="nobordernopadding">';
1432 1432
 			print '<tr><td>';
1433
-			print "<input type='text' name='frequency' value='" . $object->frequency . "' size='5' />&nbsp;" . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm'));
1433
+			print "<input type='text' name='frequency' value='".$object->frequency."' size='5' />&nbsp;".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm'));
1434 1434
 			print '</td>';
1435
-			print '<td class="left"><input type="submit" class="button button-edit" value="' . $langs->trans("Modify") . '"></td>';
1435
+			print '<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
1436 1436
 			print '</tr></table></form>';
1437 1437
 		} else {
1438 1438
 			if ($object->frequency > 0) {
1439
-				print $langs->trans('FrequencyPer_' . $object->unit_frequency, $object->frequency);
1439
+				print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency);
1440 1440
 			} else {
1441 1441
 				print $langs->trans("NotARecurringInvoiceTemplate");
1442 1442
 			}
@@ -1455,8 +1455,8 @@  discard block
 block discarded – undo
1455 1455
 			print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $usercancreate, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached');
1456 1456
 		}
1457 1457
 		//var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour'));
1458
-		if (! $object->isMaxNbGenReached()) {
1459
-			if (! $object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) {
1458
+		if (!$object->isMaxNbGenReached()) {
1459
+			if (!$object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) {
1460 1460
 				print img_warning($langs->trans("Late"));
1461 1461
 			}
1462 1462
 		} else {
@@ -1489,7 +1489,7 @@  discard block
 block discarded – undo
1489 1489
 			print $langs->trans("StatusOfGeneratedInvoices");
1490 1490
 		}
1491 1491
 		print '</td><td>';
1492
-		$select = 'select;0:' . $langs->trans('BillStatusDraft') . ',1:' . $langs->trans('BillStatusValidated');
1492
+		$select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated');
1493 1493
 		if ($action == 'auto_validate' || $object->frequency > 0) {
1494 1494
 			print $form->editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate, $select);
1495 1495
 		}
@@ -1505,7 +1505,7 @@  discard block
 block discarded – undo
1505 1505
 			}
1506 1506
 			print '</td>';
1507 1507
 			print '<td>';
1508
-			$select = 'select;0:' . $langs->trans('DoNotGenerateDoc') . ',1:' . $langs->trans('AutogenerateDoc');
1508
+			$select = 'select;0:'.$langs->trans('DoNotGenerateDoc').',1:'.$langs->trans('AutogenerateDoc');
1509 1509
 			if ($action == 'generate_pdf' || $object->frequency > 0) {
1510 1510
 				print $form->editfieldval($langs->trans("StatusOfGeneratedDocuments"), 'generate_pdf', $object->generate_pdf, $object, $usercancreate, $select);
1511 1511
 			}
@@ -1529,7 +1529,7 @@  discard block
 block discarded – undo
1529 1529
 			print '<table class="border centpercent tableforfield">';
1530 1530
 
1531 1531
 			// Nb of generation already done
1532
-			print '<tr><td style="width: 50%">' . $langs->trans("NbOfGenerationDone") . '</td>';
1532
+			print '<tr><td style="width: 50%">'.$langs->trans("NbOfGenerationDone").'</td>';
1533 1533
 			print '<td>';
1534 1534
 			print $object->nb_gen_done ? $object->nb_gen_done : '0';
1535 1535
 			print '</td>';
@@ -1554,15 +1554,15 @@  discard block
 block discarded – undo
1554 1554
 		print '<div class="clearboth"></div><br>';
1555 1555
 
1556 1556
 		// Lines
1557
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid', 'int')) . '" method="POST">
1558
-        	<input type="hidden" name="token" value="' . newToken() . '">
1559
-        	<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
1557
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
1558
+        	<input type="hidden" name="token" value="' . newToken().'">
1559
+        	<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
1560 1560
         	<input type="hidden" name="mode" value="">
1561
-        	<input type="hidden" name="id" value="' . $object->id . '">
1561
+        	<input type="hidden" name="id" value="' . $object->id.'">
1562 1562
         	';
1563 1563
 
1564 1564
 		if (!empty($conf->use_javascript_ajax) && $object->statut == 0) {
1565
-			include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
1565
+			include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
1566 1566
 		}
1567 1567
 
1568 1568
 		print '<div class="div-table-responsive-no-min">';
@@ -1619,24 +1619,24 @@  discard block
 block discarded – undo
1619 1619
 		if (empty($object->suspended)) {
1620 1620
 			if ($usercancreate) {
1621 1621
 				if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) {
1622
-					print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("MaxGenerationReached")) . '">' . $langs->trans("CreateBill") . '</a></div>';
1622
+					print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("MaxGenerationReached")).'">'.$langs->trans("CreateBill").'</a></div>';
1623 1623
 				} else {
1624 1624
 					if (empty($object->frequency) || $object->date_when <= $nowlasthour) {
1625
-						print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/facture/card.php?action=create&socid=' . $object->thirdparty->id . '&fac_rec=' . $object->id . '">' . $langs->trans("CreateBill") . '</a></div>';
1625
+						print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->thirdparty->id.'&fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>';
1626 1626
 					} else {
1627
-						print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("DateIsNotEnough")) . '">' . $langs->trans("CreateBill") . '</a></div>';
1627
+						print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>';
1628 1628
 					}
1629 1629
 				}
1630 1630
 			} else {
1631
-				print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans("CreateBill") . '</a></div>';
1631
+				print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateBill").'</a></div>';
1632 1632
 			}
1633 1633
 		}
1634 1634
 
1635 1635
 		if ($usercancreate) {
1636 1636
 			if (empty($object->suspended)) {
1637
-				print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=disable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Disable") . '</a></div>';
1637
+				print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=disable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Disable").'</a></div>';
1638 1638
 			} else {
1639
-				print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=enable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Enable") . '</a></div>';
1639
+				print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=enable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Enable").'</a></div>';
1640 1640
 			}
1641 1641
 		}
1642 1642
 
Please login to merge, or discard this patch.
htdocs/reception/class/reception.class.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 		if (getDolGlobalString('RECEPTION_ADDON_NUMBER')) {
170 170
 			$mybool = false;
171 171
 
172
-			$file = getDolGlobalString('RECEPTION_ADDON_NUMBER') . ".php";
172
+			$file = getDolGlobalString('RECEPTION_ADDON_NUMBER').".php";
173 173
 			$classname = getDolGlobalString('RECEPTION_ADDON_NUMBER');
174 174
 
175 175
 			// Include file with class
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 				$this->fetch_origin();
732 732
 				if (empty($this->origin_object->lines)) {
733 733
 					$res = $this->origin_object->fetch_lines();
734
-					$this->commandeFournisseur = $this->origin_object;	// deprecated
734
+					$this->commandeFournisseur = $this->origin_object; // deprecated
735 735
 					if ($res < 0) {
736 736
 						return $res;
737 737
 					}
@@ -867,10 +867,10 @@  discard block
 block discarded – undo
867 867
 			// check sell-by / eat-by date is mandatory
868 868
 			$errorMsgArr = Productlot::checkSellOrEatByMandatoryFromProductAndDates($product, $sellby, $eatby);
869 869
 			if (!empty($errorMsgArr)) {
870
-				$errorMessage = '<b>' . $product->ref . '</b> : ';
870
+				$errorMessage = '<b>'.$product->ref.'</b> : ';
871 871
 				$errorMessage .= '<ul>';
872 872
 				foreach ($errorMsgArr as $errorMsg) {
873
-					$errorMessage .= '<li>' . $errorMsg . '</li>';
873
+					$errorMessage .= '<li>'.$errorMsg.'</li>';
874 874
 				}
875 875
 				$errorMessage .= '</ul>';
876 876
 				$this->error = $errorMessage;
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
 		$result .= $linkend;
1305 1305
 
1306 1306
 		global $action;
1307
-		$hookmanager->initHooks(array($this->element . 'dao'));
1307
+		$hookmanager->initHooks(array($this->element.'dao'));
1308 1308
 		$parameters = array('id'=>$this->id, 'getnomurl' => &$result);
1309 1309
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
1310 1310
 		if ($reshook > 0) {
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
 		if (getDolGlobalInt("STOCK_CALCULATE_ON_RECEPTION_CLOSE")) {
1351 1351
 			$this->labelStatus[1]  = 'StatusReceptionValidatedToReceive';
1352 1352
 		}
1353
-		$this->labelStatus[2]  = 'StatusReceptionProcessed';
1353
+		$this->labelStatus[2] = 'StatusReceptionProcessed';
1354 1354
 
1355 1355
 		// List of short language codes for status
1356 1356
 		$this->labelStatusShort[-1] = 'StatusReceptionCanceledShort';
@@ -1446,7 +1446,7 @@  discard block
 block discarded – undo
1446 1446
 		$this->origin_id            = 1;
1447 1447
 		$this->origin               = 'commande';
1448 1448
 		$this->origin_object        = $order;
1449
-		$this->commandeFournisseur  = $order;	// deprecated
1449
+		$this->commandeFournisseur  = $order; // deprecated
1450 1450
 
1451 1451
 		$this->note_private = 'Private note';
1452 1452
 		$this->note_public = 'Public note';
@@ -1456,7 +1456,7 @@  discard block
 block discarded – undo
1456 1456
 		while ($xnbp < $nbp) {
1457 1457
 			$line = new CommandeFournisseurDispatch($this->db);
1458 1458
 			$line->desc = $langs->trans("Description")." ".$xnbp;
1459
-			$line->libelle = $langs->trans("Description")." ".$xnbp;	// deprecated
1459
+			$line->libelle = $langs->trans("Description")." ".$xnbp; // deprecated
1460 1460
 			$line->label = $langs->trans("Description")." ".$xnbp;
1461 1461
 			$line->qty = 10;
1462 1462
 
Please login to merge, or discard this patch.
htdocs/core/modules/import/import_xlsx.modules.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 use PhpOffice\PhpSpreadsheet\Spreadsheet;
30 30
 use PhpOffice\PhpSpreadsheet\Style\Alignment;
31 31
 
32
-require_once DOL_DOCUMENT_ROOT . '/core/modules/import/modules_import.php';
32
+require_once DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php';
33 33
 
34 34
 
35 35
 /**
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 		// phpcs:enable
141 141
 		global $user, $conf, $langs, $file;
142 142
 		// create a temporary object, the final output will be generated in footer
143
-		$this->workbook->getProperties()->setCreator($user->getFullName($outputlangs) . ' - Dolibarr ' . DOL_VERSION);
144
-		$this->workbook->getProperties()->setTitle($outputlangs->trans("Import") . ' - ' . $file);
145
-		$this->workbook->getProperties()->setSubject($outputlangs->trans("Import") . ' - ' . $file);
146
-		$this->workbook->getProperties()->setDescription($outputlangs->trans("Import") . ' - ' . $file);
143
+		$this->workbook->getProperties()->setCreator($user->getFullName($outputlangs).' - Dolibarr '.DOL_VERSION);
144
+		$this->workbook->getProperties()->setTitle($outputlangs->trans("Import").' - '.$file);
145
+		$this->workbook->getProperties()->setSubject($outputlangs->trans("Import").' - '.$file);
146
+		$this->workbook->getProperties()->setDescription($outputlangs->trans("Import").' - '.$file);
147 147
 
148 148
 		$this->workbook->setActiveSheetIndex(0);
149 149
 		$this->workbook->getActiveSheet()->setTitle($outputlangs->trans("Sheet"));
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 		global $langs;
237 237
 		$ret = 1;
238 238
 
239
-		dol_syslog(get_class($this) . "::open_file file=" . $file);
239
+		dol_syslog(get_class($this)."::open_file file=".$file);
240 240
 
241 241
 		$reader = new Xlsx();
242 242
 		$this->workbook = $reader->load($file);
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 
390 390
 				// Define $tablewithentity_cache[$tablename] if not already defined
391 391
 				if (!isset($tablewithentity_cache[$tablename])) {	// keep this test with "isset"
392
-					dol_syslog("Check if table " . $tablename . " has an entity field");
392
+					dol_syslog("Check if table ".$tablename." has an entity field");
393 393
 					$resql = $this->db->DDLDescTable($tablename, 'entity');
394 394
 					if ($resql) {
395 395
 						$obj = $this->db->fetch_object($resql);
@@ -462,12 +462,12 @@  discard block
 block discarded – undo
462 462
 										$file = (empty($objimport->array_import_convertvalue[0][$val]['classfile']) ? $objimport->array_import_convertvalue[0][$val]['file'] : $objimport->array_import_convertvalue[0][$val]['classfile']);
463 463
 										$class = $objimport->array_import_convertvalue[0][$val]['class'];
464 464
 										$method = $objimport->array_import_convertvalue[0][$val]['method'];
465
-										if ($this->cacheconvert[$file . '_' . $class . '_' . $method . '_'][$newval] != '') {
466
-											$newval = $this->cacheconvert[$file . '_' . $class . '_' . $method . '_'][$newval];
465
+										if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] != '') {
466
+											$newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval];
467 467
 										} else {
468 468
 											$resultload = dol_include_once($file);
469 469
 											if (empty($resultload)) {
470
-												dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method);
470
+												dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method);
471 471
 												break;
472 472
 											}
473 473
 											$classinstance = new $class($this->db);
@@ -509,12 +509,12 @@  discard block
 block discarded – undo
509 509
 												$param_array = array('', '', $newval);
510 510
 												call_user_func_array(array($classinstance, $method), $param_array);
511 511
 											}
512
-											$this->cacheconvert[$file . '_' . $class . '_' . $method . '_'][$newval] = $classinstance->id;
512
+											$this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] = $classinstance->id;
513 513
 
514 514
 											//print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. ';
515 515
 											if ($classinstance->id != '') {	// id may be 0, it is a found value
516 516
 												$newval = $classinstance->id;
517
-											} elseif (! $error) {
517
+											} elseif (!$error) {
518 518
 												if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) {
519 519
 													$this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));
520 520
 												} elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) {
@@ -541,19 +541,19 @@  discard block
 block discarded – undo
541 541
 										$method = $objimport->array_import_convertvalue[0][$val]['method'];
542 542
 										$codefromfield = $objimport->array_import_convertvalue[0][$val]['codefromfield'];
543 543
 										$code = $arrayrecord[$arrayfield[$codefromfield]]['val'];
544
-										if ($this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $code][$newval] != '') {
545
-											$newval = $this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $code][$newval];
544
+										if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$code][$newval] != '') {
545
+											$newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$code][$newval];
546 546
 										} else {
547 547
 											$resultload = dol_include_once($file);
548 548
 											if (empty($resultload)) {
549
-												dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method . ', code=' . $code);
549
+												dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method.', code='.$code);
550 550
 												break;
551 551
 											}
552 552
 											$classinstance = new $class($this->db);
553 553
 											// Try the fetch from code and ref
554 554
 											$param_array = array('', $newval, $code);
555 555
 											call_user_func_array(array($classinstance, $method), $param_array);
556
-											$this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $code][$newval] = $classinstance->id;
556
+											$this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$code][$newval] = $classinstance->id;
557 557
 											if ($classinstance->id > 0) {    // we found record
558 558
 												$newval = $classinstance->id;
559 559
 											} else {
@@ -577,19 +577,19 @@  discard block
 block discarded – undo
577 577
 									$class = $objimport->array_import_convertvalue[0][$val]['class'];
578 578
 									$method = $objimport->array_import_convertvalue[0][$val]['method'];
579 579
 									$units = $objimport->array_import_convertvalue[0][$val]['units'];
580
-									if ($this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $units][$newval] != '') {
581
-										$newval = $this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $units][$newval];
580
+									if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval] != '') {
581
+										$newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval];
582 582
 									} else {
583 583
 										$resultload = dol_include_once($file);
584 584
 										if (empty($resultload)) {
585
-											dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method . ', units=' . $units);
585
+											dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method.', units='.$units);
586 586
 											break;
587 587
 										}
588 588
 										$classinstance = new $class($this->db);
589 589
 										// Try the fetch from code or ref
590 590
 										call_user_func_array(array($classinstance, $method), array('', '', $newval, $units));
591 591
 										$scaleorid = (($objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeunits') ? $classinstance->id : $classinstance->scale);
592
-										$this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $units][$newval] = $scaleorid;
592
+										$this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval] = $scaleorid;
593 593
 										//print 'We have made a '.$class.'->'.$method." to get a value from key '".$newval."' and we got '".$scaleorid."'.";exit;
594 594
 										if ($classinstance->id > 0) {	// we found record
595 595
 											$newval = $scaleorid ? $scaleorid : 0;
@@ -681,13 +681,13 @@  discard block
 block discarded – undo
681 681
 									$method = $objimport->array_import_convertvalue[0][$val]['method'];
682 682
 									$resultload = dol_include_once($file);
683 683
 									if (empty($resultload)) {
684
-										dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method);
684
+										dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method);
685 685
 										break;
686 686
 									}
687 687
 									$classinstance = new $class($this->db);
688 688
 									$res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord, $arrayfield, $key));
689 689
 									if (empty($classinstance->error) && empty($classinstance->errors)) {
690
-										$newval = $res; 	// We get new value computed.
690
+										$newval = $res; // We get new value computed.
691 691
 									} else {
692 692
 										$this->errors[$error]['type'] = 'CLASSERROR';
693 693
 										$this->errors[$error]['lib'] = implode(
@@ -719,16 +719,16 @@  discard block
 block discarded – undo
719 719
 									$table = $reg[2];
720 720
 									$filter = !empty($reg[3]) ? substr($reg[3], 1) : '';
721 721
 
722
-									$cachekey = $field . '@' . $table;
722
+									$cachekey = $field.'@'.$table;
723 723
 									if (!empty($filter)) {
724
-										$cachekey .= ':' . $filter;
724
+										$cachekey .= ':'.$filter;
725 725
 									}
726 726
 
727 727
 									// Load content of field@table into cache array
728 728
 									if (!is_array($this->cachefieldtable[$cachekey])) { // If content of field@table not already loaded into cache
729
-										$sql = "SELECT " . $field . " as aliasfield FROM " . $table;
729
+										$sql = "SELECT ".$field." as aliasfield FROM ".$table;
730 730
 										if (!empty($filter)) {
731
-											$sql .= ' WHERE ' . $filter;
731
+											$sql .= ' WHERE '.$filter;
732 732
 										}
733 733
 
734 734
 										$resql = $this->db->query($sql);
@@ -751,14 +751,14 @@  discard block
 block discarded – undo
751 751
 									if (!is_array($this->cachefieldtable[$cachekey]) || !in_array($newval, $this->cachefieldtable[$cachekey])) {
752 752
 										$tableforerror = $table;
753 753
 										if (!empty($filter)) {
754
-											$tableforerror .= ':' . $filter;
754
+											$tableforerror .= ':'.$filter;
755 755
 										}
756 756
 										$this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorFieldValueNotIn', $key, $newval, $field, $tableforerror);
757 757
 										$this->errors[$error]['type'] = 'FOREIGNKEY';
758 758
 										$errorforthistable++;
759 759
 										$error++;
760 760
 									}
761
-								} elseif (!preg_match('/' . $objimport->array_import_regex[0][$val] . '/i', $newval)) {
761
+								} elseif (!preg_match('/'.$objimport->array_import_regex[0][$val].'/i', $newval)) {
762 762
 									// If test is just a static regex
763 763
 									//if ($key == 19) print "xxx".$newval."zzz".$objimport->array_import_regex[0][$val]."<br>";
764 764
 									$this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorWrongValueForField', $key, $newval, $objimport->array_import_regex[0][$val]);
@@ -785,11 +785,11 @@  discard block
 block discarded – undo
785 785
 						if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) {
786 786
 							if (!in_array("socialnetworks", $listfields)) {
787 787
 								$listfields[] = "socialnetworks";
788
-								$socialkey = array_search("socialnetworks", $listfields);	// Return position of 'socialnetworks' key in array. Example socialkey=19
788
+								$socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array. Example socialkey=19
789 789
 								$listvalues[$socialkey] = '';
790 790
 							}
791 791
 							if (!empty($newval) && $arrayrecord[($key)]['type'] > 0) {
792
-								$socialkey = array_search("socialnetworks", $listfields);	// Return position of 'socialnetworks' key in array. Example socialkey=19
792
+								$socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array. Example socialkey=19
793 793
 								$socialnetwork = explode("_", $fieldname)[1];
794 794
 								if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") {
795 795
 									$json = new stdClass();
@@ -828,18 +828,18 @@  discard block
 block discarded – undo
828 828
 							continue; // Not a field of current table
829 829
 						}
830 830
 						if ($val == 'user->id') {
831
-							$listfields[] = preg_replace('/^' . preg_quote($alias, '/') . '\./', '', $key);
831
+							$listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key);
832 832
 							$listvalues[] = ((int) $user->id);
833 833
 						} elseif (preg_match('/^lastrowid-/', $val)) {
834 834
 							$tmp = explode('-', $val);
835 835
 							$lastinsertid = (isset($last_insert_id_array[$tmp[1]])) ? $last_insert_id_array[$tmp[1]] : 0;
836
-							$keyfield = preg_replace('/^' . preg_quote($alias, '/') . '\./', '', $key);
836
+							$keyfield = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key);
837 837
 							$listfields[] = $keyfield;
838 838
 							$listvalues[] = $lastinsertid;
839 839
 							//print $key."-".$val."-".$listfields."-".$listvalues."<br>";exit;
840 840
 						} elseif (preg_match('/^const-/', $val)) {
841 841
 							$tmp = explode('-', $val, 2);
842
-							$listfields[] = preg_replace('/^' . preg_quote($alias, '/') . '\./', '', $key);
842
+							$listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key);
843 843
 							$listvalues[] = "'".$this->db->escape($tmp[1])."'";
844 844
 						} elseif (preg_match('/^rule-/', $val)) {
845 845
 							$fieldname = $key;
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
 									$method = $objimport->array_import_convertvalue[0][$fieldname]['method'];
851 851
 									$resultload = dol_include_once($file);
852 852
 									if (empty($resultload)) {
853
-										dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method);
853
+										dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method);
854 854
 										break;
855 855
 									}
856 856
 									$classinstance = new $class($this->db);
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
 								}
873 873
 							}
874 874
 						} else {
875
-							$this->errors[$error]['lib'] = 'Bad value of profile setup ' . $val . ' for array_import_fieldshidden';
875
+							$this->errors[$error]['lib'] = 'Bad value of profile setup '.$val.' for array_import_fieldshidden';
876 876
 							$this->errors[$error]['type'] = 'Import profile setup';
877 877
 							$error++;
878 878
 						}
@@ -892,19 +892,19 @@  discard block
 block discarded – undo
892 892
 						$fname = 'rowid';
893 893
 						if (strpos($tablename, '_categorie_') !== false) {
894 894
 							$is_table_category_link = true;
895
-							$fname='*';
895
+							$fname = '*';
896 896
 						}
897 897
 
898 898
 						if (!empty($updatekeys)) {
899 899
 							// We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields)
900 900
 
901 901
 							if (empty($lastinsertid)) {	// No insert done yet for a parent table
902
-								$sqlSelect = "SELECT ".$fname." FROM " . $tablename;
902
+								$sqlSelect = "SELECT ".$fname." FROM ".$tablename;
903 903
 
904 904
 								$data = array_combine($listfields, $listvalues);
905 905
 
906
-								$where = array();	// filters to forge SQL request
907
-								$filters = array();	// filters to forge output error message
906
+								$where = array(); // filters to forge SQL request
907
+								$filters = array(); // filters to forge output error message
908 908
 								foreach ($updatekeys as $key) {
909 909
 									$col = $objimport->array_import_updatekeys[0][$key];
910 910
 									$key = preg_replace('/^.*\./i', '', $key);
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
 									$where[] = "entity IN (".getEntity($this->getElementFromTableWithPrefix($tablename)).")";
930 930
 									$filters[] = "entity IN (".getEntity($this->getElementFromTableWithPrefix($tablename)).")";
931 931
 								}
932
-								$sqlSelect .= " WHERE " . implode(' AND ', $where);
932
+								$sqlSelect .= " WHERE ".implode(' AND ', $where);
933 933
 
934 934
 								$resql = $this->db->query($sqlSelect);
935 935
 								if ($resql) {
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
 								// a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record
961 961
 								// may already exists. So we rescan the extrafield table to know if record exists or not for the rowid.
962 962
 								// Note: For extrafield tablename, we have in importfieldshidden_array an entry 'extra.fk_object'=>'lastrowid-tableparent' so $keyfield is 'fk_object'
963
-								$sqlSelect = "SELECT rowid FROM " . $tablename;
963
+								$sqlSelect = "SELECT rowid FROM ".$tablename;
964 964
 
965 965
 
966 966
 								if (empty($keyfield)) {
@@ -994,34 +994,34 @@  discard block
 block discarded – undo
994 994
 								// We db escape social network field because he isn't in field creation
995 995
 								if (in_array("socialnetworks", $listfields)) {
996 996
 									$socialkey = array_search("socialnetworks", $listfields);
997
-									$tmpsql =  $listvalues[$socialkey];
997
+									$tmpsql = $listvalues[$socialkey];
998 998
 									$listvalues[$socialkey] = "'".$this->db->escape($tmpsql)."'";
999 999
 								}
1000 1000
 
1001 1001
 								// Build SQL UPDATE request
1002
-								$sqlstart = "UPDATE " . $tablename;
1002
+								$sqlstart = "UPDATE ".$tablename;
1003 1003
 
1004 1004
 								$data = array_combine($listfields, $listvalues);
1005 1005
 								$set = array();
1006 1006
 								foreach ($data as $key => $val) {
1007 1007
 									$set[] = $key." = ".$val;
1008 1008
 								}
1009
-								$sqlstart .= " SET " . implode(', ', $set);
1009
+								$sqlstart .= " SET ".implode(', ', $set);
1010 1010
 
1011 1011
 								if (empty($keyfield)) {
1012 1012
 									$keyfield = 'rowid';
1013 1013
 								}
1014
-								$sqlend = " WHERE " . $keyfield . " = ".((int) $lastinsertid);
1014
+								$sqlend = " WHERE ".$keyfield." = ".((int) $lastinsertid);
1015 1015
 
1016 1016
 								if ($is_table_category_link) {
1017
-									$sqlend = " WHERE " . implode(' AND ', $where);
1017
+									$sqlend = " WHERE ".implode(' AND ', $where);
1018 1018
 								}
1019 1019
 
1020 1020
 								if (!empty($tablewithentity_cache[$tablename])) {
1021 1021
 									$sqlend .= " AND entity IN (".getEntity($this->getElementFromTableWithPrefix($tablename)).")";
1022 1022
 								}
1023 1023
 
1024
-								$sql = $sqlstart . $sqlend;
1024
+								$sql = $sqlstart.$sqlend;
1025 1025
 
1026 1026
 								// Run update request
1027 1027
 								$resql = $this->db->query($sql);
@@ -1042,22 +1042,22 @@  discard block
 block discarded – undo
1042 1042
 							// We db escape social network field because he isn't in field creation
1043 1043
 							if (in_array("socialnetworks", $listfields)) {
1044 1044
 								$socialkey = array_search("socialnetworks", $listfields);
1045
-								$tmpsql =  $listvalues[$socialkey];
1045
+								$tmpsql = $listvalues[$socialkey];
1046 1046
 								$listvalues[$socialkey] = "'".$this->db->escape($tmpsql)."'";
1047 1047
 							}
1048 1048
 
1049 1049
 							// Build SQL INSERT request
1050
-							$sqlstart = "INSERT INTO " . $tablename . "(" . implode(", ", $listfields) . ", import_key";
1051
-							$sqlend = ") VALUES(" . implode(', ', $listvalues) . ", '" . $this->db->escape($importid) . "'";
1050
+							$sqlstart = "INSERT INTO ".$tablename."(".implode(", ", $listfields).", import_key";
1051
+							$sqlend = ") VALUES(".implode(', ', $listvalues).", '".$this->db->escape($importid)."'";
1052 1052
 							if (!empty($tablewithentity_cache[$tablename])) {
1053 1053
 								$sqlstart .= ", entity";
1054
-								$sqlend .= ", " . $conf->entity;
1054
+								$sqlend .= ", ".$conf->entity;
1055 1055
 							}
1056 1056
 							if (!empty($objimport->array_import_tables_creator[0][$alias])) {
1057
-								$sqlstart .= ", " . $objimport->array_import_tables_creator[0][$alias];
1058
-								$sqlend .= ", " . $user->id;
1057
+								$sqlstart .= ", ".$objimport->array_import_tables_creator[0][$alias];
1058
+								$sqlend .= ", ".$user->id;
1059 1059
 							}
1060
-							$sql = $sqlstart . $sqlend . ")";
1060
+							$sql = $sqlstart.$sqlend.")";
1061 1061
 							//dol_syslog("import_xlsx.modules", LOG_DEBUG);
1062 1062
 
1063 1063
 							// Run insert request
Please login to merge, or discard this patch.
htdocs/core/modules/import/import_csv.modules.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 											//print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. ';
472 472
 											if ($classinstance->id != '') {	// id may be 0, it is a found value
473 473
 												$newval = $classinstance->id;
474
-											} elseif (! $error) {
474
+											} elseif (!$error) {
475 475
 												if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) {
476 476
 													$this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', num2Alpha($key - 1), $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));
477 477
 												} elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) {
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
 									$classinstance = new $class($this->db);
645 645
 									$res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord, $arrayfield, ($key - 1)));
646 646
 									if (empty($classinstance->error) && empty($classinstance->errors)) {
647
-										$newval = $res; 	// We get new value computed.
647
+										$newval = $res; // We get new value computed.
648 648
 									} else {
649 649
 										$this->errors[$error]['type'] = 'CLASSERROR';
650 650
 										$this->errors[$error]['lib'] = implode(
@@ -742,12 +742,12 @@  discard block
 block discarded – undo
742 742
 						if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) {
743 743
 							if (!in_array("socialnetworks", $listfields)) {
744 744
 								$listfields[] = "socialnetworks";
745
-								$socialkey = array_search("socialnetworks", $listfields);	// Return position of 'socialnetworks' key in array
745
+								$socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array
746 746
 								$listvalues[$socialkey] = '';
747 747
 							}
748 748
 							//var_dump($newval); var_dump($arrayrecord[($key - 1)]['type']);
749 749
 							if (!empty($newval) && $arrayrecord[($key - 1)]['type'] > 0) {
750
-								$socialkey = array_search("socialnetworks", $listfields);	// Return position of 'socialnetworks' key in array
750
+								$socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array
751 751
 								//var_dump('sk='.$socialkey);	// socialkey=19
752 752
 								$socialnetwork = explode("_", $fieldname)[1];
753 753
 								if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") {
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 									$method = $objimport->array_import_convertvalue[0][$fieldname]['method'];
809 809
 									$resultload = dol_include_once($file);
810 810
 									if (empty($resultload)) {
811
-										dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method);
811
+										dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method);
812 812
 										break;
813 813
 									}
814 814
 									$classinstance = new $class($this->db);
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
 						$fname = 'rowid';
853 853
 						if (strpos($tablename, '_categorie_') !== false) {
854 854
 							$is_table_category_link = true;
855
-							$fname='*';
855
+							$fname = '*';
856 856
 						}
857 857
 
858 858
 						if (!empty($updatekeys)) {
@@ -861,8 +861,8 @@  discard block
 block discarded – undo
861 861
 							if (empty($lastinsertid)) {	// No insert done yet for a parent table
862 862
 								$sqlSelect = "SELECT ".$fname." FROM ".$tablename;
863 863
 								$data = array_combine($listfields, $listvalues);
864
-								$where = array();	// filters to forge SQL request
865
-								$filters = array();	// filters to forge output error message
864
+								$where = array(); // filters to forge SQL request
865
+								$filters = array(); // filters to forge output error message
866 866
 								foreach ($updatekeys as $key) {
867 867
 									$col = $objimport->array_import_updatekeys[0][$key];
868 868
 									$key = preg_replace('/^.*\./i', '', $key);
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 								// We db escape social network field because he isn't in field creation
952 952
 								if (in_array("socialnetworks", $listfields)) {
953 953
 									$socialkey = array_search("socialnetworks", $listfields);
954
-									$tmpsql =  $listvalues[$socialkey];
954
+									$tmpsql = $listvalues[$socialkey];
955 955
 									$listvalues[$socialkey] = "'".$this->db->escape($tmpsql)."'";
956 956
 								}
957 957
 
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
 								$sqlend = " WHERE ".$keyfield." = ".((int) $lastinsertid);
972 972
 
973 973
 								if ($is_table_category_link) {
974
-									$sqlend = " WHERE " . implode(' AND ', $where);
974
+									$sqlend = " WHERE ".implode(' AND ', $where);
975 975
 								}
976 976
 
977 977
 								if (!empty($tablewithentity_cache[$tablename])) {
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
 							// We db escape social network field because he isn't in field creation
1000 1000
 							if (in_array("socialnetworks", $listfields)) {
1001 1001
 								$socialkey = array_search("socialnetworks", $listfields);
1002
-								$tmpsql =  $listvalues[$socialkey];
1002
+								$tmpsql = $listvalues[$socialkey];
1003 1003
 								$listvalues[$socialkey] = "'".$this->db->escape($tmpsql)."'";
1004 1004
 							}
1005 1005
 
Please login to merge, or discard this patch.