Completed
Branch develop (a4f94f)
by
unknown
17:59
created
htdocs/takepos/admin/setup.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 print '<tr class="oddeven"><td>';
265 265
 print $langs->trans("NumberOfTerminals");
266 266
 print '<td>';
267
-print '<input type="number" name="TAKEPOS_NUM_TERMINALS" min="1" value="' . (!getDolGlobalString('TAKEPOS_NUM_TERMINALS') ? '1' : $conf->global->TAKEPOS_NUM_TERMINALS)  . '">';
267
+print '<input type="number" name="TAKEPOS_NUM_TERMINALS" min="1" value="'.(!getDolGlobalString('TAKEPOS_NUM_TERMINALS') ? '1' : $conf->global->TAKEPOS_NUM_TERMINALS).'">';
268 268
 print "</td></tr>\n";
269 269
 
270 270
 // Services
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 	print '<tr class="oddeven"><td>';
405 405
 	print $form->textwithpicto($langs->trans("TakeposBarcodeRuleToInsertProduct"), $langs->trans("TakeposBarcodeRuleToInsertProductDesc"), 1, 'help', '', 0, 3, 'barcoderuleonsmartphone');
406 406
 	print '<td>';
407
-	print '<input type="text" name="TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT" value="' . (getDolGlobalString('TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT')) . '">';
407
+	print '<input type="text" name="TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT" value="'.(getDolGlobalString('TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT')).'">';
408 408
 	print "</td></tr>\n";
409 409
 }
410 410
 
@@ -483,12 +483,12 @@  discard block
 block discarded – undo
483 483
 	print '<tr class="oddeven"><td>';
484 484
 	print $langs->trans("SumupAffiliate");
485 485
 	print '<td colspan="2">';
486
-	print '<input type="text" name="TAKEPOS_SUMUP_AFFILIATE" value="' . getDolGlobalString('TAKEPOS_SUMUP_AFFILIATE').'"></input>';
486
+	print '<input type="text" name="TAKEPOS_SUMUP_AFFILIATE" value="'.getDolGlobalString('TAKEPOS_SUMUP_AFFILIATE').'"></input>';
487 487
 	print "</td></tr>\n";
488 488
 	print '<tr class="oddeven"><td>';
489 489
 	print $langs->trans("SumupAppId");
490 490
 	print '<td colspan="2">';
491
-	print '<input type="text" name="TAKEPOS_SUMUP_APPID" value="' . getDolGlobalString('TAKEPOS_SUMUP_APPID').'"></input>';
491
+	print '<input type="text" name="TAKEPOS_SUMUP_APPID" value="'.getDolGlobalString('TAKEPOS_SUMUP_APPID').'"></input>';
492 492
 	print "</td></tr>\n";
493 493
 
494 494
 	print '</table>';
Please login to merge, or discard this patch.
htdocs/projet/class/api_projects.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
124 124
 
125 125
 		$sql = "SELECT t.rowid";
126 126
 		$sql .= " FROM ".MAIN_DB_PREFIX."projet as t";
127
-		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_extrafields AS ef ON ef.fk_object = t.rowid";	// So we will be able to filter on extrafields
127
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields
128 128
 		if ($category > 0) {
129 129
 			$sql .= ", ".MAIN_DB_PREFIX."categorie_project as c";
130 130
 		}
Please login to merge, or discard this patch.
htdocs/fourn/class/api_supplier_invoices.class.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 
19 19
 use Luracast\Restler\RestException;
20 20
 
21
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
22
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php';
21
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
22
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
23 23
 
24 24
 /**
25 25
  * API class for supplier invoices
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 		}
76 76
 
77 77
 		if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
78
-			throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
78
+			throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
79 79
 		}
80 80
 
81 81
 		$this->invoice->fetchObjectLinked();
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
 		}
120 120
 
121 121
 		$sql = "SELECT t.rowid";
122
-		$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn AS t";
123
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
124
-		$sql .= ' WHERE t.entity IN (' . getEntity('supplier_invoice') . ')';
122
+		$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn AS t";
123
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
124
+		$sql .= ' WHERE t.entity IN ('.getEntity('supplier_invoice').')';
125 125
 		if ($socids) {
126
-			$sql .= " AND t.fk_soc IN (" . $this->db->sanitize($socids) . ")";
126
+			$sql .= " AND t.fk_soc IN (".$this->db->sanitize($socids).")";
127 127
 		}
128 128
 		// Filter by status
129 129
 		if ($status == 'draft') {
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 			$errormessage = '';
152 152
 			$sql .= forgeSQLFromUniversalSearchCriteria($sqlfilters, $errormessage);
153 153
 			if ($errormessage) {
154
-				throw new RestException(400, 'Error when validating parameter sqlfilters -> ' . $errormessage);
154
+				throw new RestException(400, 'Error when validating parameter sqlfilters -> '.$errormessage);
155 155
 			}
156 156
 		}
157 157
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 				$i++;
180 180
 			}
181 181
 		} else {
182
-			throw new RestException(503, 'Error when retrieve supplier invoice list : ' . $this->db->lasterror());
182
+			throw new RestException(503, 'Error when retrieve supplier invoice list : '.$this->db->lasterror());
183 183
 		}
184 184
 
185 185
 		return $obj_ret;
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 		}
250 250
 
251 251
 		if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
252
-			throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
252
+			throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
253 253
 		}
254 254
 
255 255
 		foreach ($request_data as $field => $value) {
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 		}
295 295
 
296 296
 		if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
297
-			throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
297
+			throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
298 298
 		}
299 299
 
300 300
 		if ($this->invoice->delete(DolibarrApiAccess::$user) < 0) {
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 		}
338 338
 
339 339
 		if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
340
-			throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
340
+			throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
341 341
 		}
342 342
 
343 343
 		$result = $this->invoice->validate(DolibarrApiAccess::$user, '', $idwarehouse, $notrigger);
@@ -345,13 +345,13 @@  discard block
 block discarded – undo
345 345
 			throw new RestException(304, 'Error nothing done. The invoice is already validated');
346 346
 		}
347 347
 		if ($result < 0) {
348
-			throw new RestException(500, 'Error when validating Invoice: ' . $this->invoice->error);
348
+			throw new RestException(500, 'Error when validating Invoice: '.$this->invoice->error);
349 349
 		}
350 350
 
351 351
 		return array(
352 352
 			'success' => array(
353 353
 				'code' => 200,
354
-				'message' => 'Invoice validated (Ref=' . $this->invoice->ref . ')'
354
+				'message' => 'Invoice validated (Ref='.$this->invoice->ref.')'
355 355
 			)
356 356
 		);
357 357
 	}
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 		}
380 380
 
381 381
 		if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
382
-			throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
382
+			throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
383 383
 		}
384 384
 
385 385
 		$result = $this->invoice->fetch($id);
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 		}
430 430
 
431 431
 		if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
432
-			throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
432
+			throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
433 433
 		}
434 434
 
435 435
 		if (isModEnabled("banque")) {
@@ -484,14 +484,14 @@  discard block
 block discarded – undo
484 484
 		$paiement_id = $paiement->create(DolibarrApiAccess::$user, ($closepaidinvoices == 'yes' ? 1 : 0)); // This include closing invoices
485 485
 		if ($paiement_id < 0) {
486 486
 			$this->db->rollback();
487
-			throw new RestException(400, 'Payment error : ' . $paiement->error);
487
+			throw new RestException(400, 'Payment error : '.$paiement->error);
488 488
 		}
489 489
 
490 490
 		if (isModEnabled("banque")) {
491 491
 			$result = $paiement->addPaymentToBank(DolibarrApiAccess::$user, 'payment_supplier', '(SupplierInvoicePayment)', $accountid, $chqemetteur, $chqbank);
492 492
 			if ($result < 0) {
493 493
 				$this->db->rollback();
494
-				throw new RestException(400, 'Add payment to bank error : ' . $paiement->error);
494
+				throw new RestException(400, 'Add payment to bank error : '.$paiement->error);
495 495
 			}
496 496
 		}
497 497
 
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 		}
522 522
 
523 523
 		if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
524
-			throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
524
+			throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
525 525
 		}
526 526
 		$this->invoice->fetch_lines();
527 527
 		$result = array();
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 		}
558 558
 
559 559
 		if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
560
-			throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
560
+			throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
561 561
 		}
562 562
 
563 563
 		$request_data = (object) $request_data;
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 		);
592 592
 
593 593
 		if ($updateRes < 0) {
594
-			throw new RestException(400, 'Unable to insert the new line. Check your inputs. ' . $this->invoice->error);
594
+			throw new RestException(400, 'Unable to insert the new line. Check your inputs. '.$this->invoice->error);
595 595
 		}
596 596
 
597 597
 		return $updateRes;
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 		}
625 625
 
626 626
 		if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
627
-			throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
627
+			throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
628 628
 		}
629 629
 
630 630
 		$request_data = (object) $request_data;
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 		}
696 696
 
697 697
 		if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
698
-			throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
698
+			throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
699 699
 		}
700 700
 
701 701
 		// TODO Check the lineid $lineid is a line of ojbect
Please login to merge, or discard this patch.
htdocs/takepos/public/auto_order.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@
 block discarded – undo
38 38
 	accessforbidden('Auto order is not allwed'); // If Auto Order is disabled never allow access to this page (that is a NO LOGIN access)
39 39
 }
40 40
 
41
-$_SESSION["basiclayout"] = 1;	// For the simple layout for public submission
42
-$_SESSION["takeposterminal"] = getDolGlobalInt('TAKEPOS_TERMINAL_NB_FOR_PUBLIC', 1);	// Default terminal for public submission is 1
41
+$_SESSION["basiclayout"] = 1; // For the simple layout for public submission
42
+$_SESSION["takeposterminal"] = getDolGlobalInt('TAKEPOS_TERMINAL_NB_FOR_PUBLIC', 1); // Default terminal for public submission is 1
43 43
 
44 44
 define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1);
45 45
 if (GETPOSTISSET("mobilepage")) {
Please login to merge, or discard this patch.
htdocs/takepos/phone.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 $action = GETPOST('action', 'aZ09');
56 56
 $setterminal = GETPOST('setterminal', 'int');
57 57
 $idproduct = GETPOST('idproduct', 'int');
58
-$mobilepage = GETPOST('mobilepage', 'alphanohtml');	// Set when page is loaded by a js .load()
58
+$mobilepage = GETPOST('mobilepage', 'alphanohtml'); // Set when page is loaded by a js .load()
59 59
 
60 60
 if ($setterminal > 0) {
61 61
 	$_SESSION["takeposterminal"] = $setterminal;
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
 $title = 'TakePOS - Dolibarr '.DOL_VERSION;
76 76
 if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
77
-	$title = 'TakePOS - ' . getDolGlobalString('MAIN_APPLICATION_TITLE');
77
+	$title = 'TakePOS - '.getDolGlobalString('MAIN_APPLICATION_TITLE');
78 78
 }
79 79
 
80 80
 // llxHeader
Please login to merge, or discard this patch.
htdocs/takepos/invoice.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -134,13 +134,13 @@  discard block
 block discarded – undo
134 134
 if ($invoiceid > 0) {
135 135
 	$ret = $invoice->fetch($invoiceid);
136 136
 } else {
137
-	$ret = $invoice->fetch('', '(PROV-POS'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '') .'-'.$place.')');
137
+	$ret = $invoice->fetch('', '(PROV-POS'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '').'-'.$place.')');
138 138
 }
139 139
 if ($ret > 0) {
140 140
 	$placeid = $invoice->id;
141 141
 }
142 142
 
143
-$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
143
+$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
144 144
 
145 145
 $soc = new Societe($db);
146 146
 if ($invoice->socid > 0) {
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
  * Actions
162 162
  */
163 163
 
164
-$parameters=array();
165
-$reshook=$hookmanager->executeHooks('doActions', $parameters, $invoice, $action);    // Note that $action and $object may have been modified by some hooks
164
+$parameters = array();
165
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
166 166
 if ($reshook < 0) {
167 167
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
168 168
 }
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
 			$bankaccount = GETPOST('accountid', 'int');
178 178
 		} else {
179 179
 			if ($pay == 'LIQ') {
180
-				$bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]);            // For backward compatibility
180
+				$bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]); // For backward compatibility
181 181
 			} elseif ($pay == "CHQ") {
182
-				$bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]);    // For backward compatibility
182
+				$bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]); // For backward compatibility
183 183
 			} else {
184 184
 				$accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"];
185 185
 				$bankaccount = getDolGlobalString($accountname);
@@ -239,9 +239,9 @@  discard block
 block discarded – undo
239 239
 			$savconst = getDolGlobalString('STOCK_CALCULATE_ON_BILL');
240 240
 
241 241
 			if (isModEnabled('productbatch') && !getDolGlobalInt('CASHDESK_FORCE_DECREASE_STOCK')) {
242
-				$conf->global->STOCK_CALCULATE_ON_BILL = 0;	// To not change the stock (not yet compatible with batch management)
242
+				$conf->global->STOCK_CALCULATE_ON_BILL = 0; // To not change the stock (not yet compatible with batch management)
243 243
 			} else {
244
-				$conf->global->STOCK_CALCULATE_ON_BILL = 1;	// To force the change of stock
244
+				$conf->global->STOCK_CALCULATE_ON_BILL = 1; // To force the change of stock
245 245
 			}
246 246
 
247 247
 			$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 		}
316 316
 		// Update stock for batch products
317 317
 		if (isModEnabled('productbatch')) {
318
-			require_once DOL_DOCUMENT_ROOT . "/product/stock/class/mouvementstock.class.php";
318
+			require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php";
319 319
 			$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
320 320
 			foreach ($invoice->lines as $line) {
321 321
 				if ($line->batch && $line->fk_warehouse > 0) {
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 		$creditnote->socid = $invoice->socid;
338 338
 		$creditnote->date = dol_now();
339 339
 		$creditnote->module_source = 'takepos';
340
-		$creditnote->pos_source =  isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ;
340
+		$creditnote->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '';
341 341
 		$creditnote->type = Facture::TYPE_CREDIT_NOTE;
342 342
 		$creditnote->fk_facture_source = $placeid;
343 343
 		//$creditnote->remise_absolue = $invoice->remise_absolue;
@@ -488,9 +488,9 @@  discard block
 block discarded – undo
488 488
 	// If we add a line and no invoice yet, we create the invoice
489 489
 	if (($action == "addline" || $action == "freezone") && $placeid == 0 && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
490 490
 		$invoice->socid = getDolGlobalString($constforcompanyid);
491
-		$invoice->date = dol_now('tzuserrel');		// We use the local date, only the day will be saved.
491
+		$invoice->date = dol_now('tzuserrel'); // We use the local date, only the day will be saved.
492 492
 		$invoice->module_source = 'takepos';
493
-		$invoice->pos_source =  isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ;
493
+		$invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '';
494 494
 		$invoice->entity = !empty($_SESSION["takeposinvoiceentity"]) ? $_SESSION["takeposinvoiceentity"] : $conf->entity;
495 495
 
496 496
 		if ($invoice->socid <= 0) {
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 			$batch = GETPOST('batch', 'alpha');
533 533
 
534 534
 			if (!empty($batch)) {
535
-				$action="setbatch";
535
+				$action = "setbatch";
536 536
 			} else {
537 537
 				$nbofsuggested = 0;
538 538
 				$prod->load_stock('warehouseopen');
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 				echo "}";
553 553
 				echo "</script>";
554 554
 
555
-				if ($nbofsuggested>0) {
555
+				if ($nbofsuggested > 0) {
556 556
 					echo "<center>".$langs->trans("SearchIntoBatch").": <b> $nbofsuggested </b></center><br><table>";
557 557
 					foreach ($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch as $dbatch) {	// $dbatch is instance of Productbatch
558 558
 						$batchStock = + $dbatch->qty; // To get a numeric
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 		if (getDolGlobalString('TAKEPOS_GROUP_SAME_PRODUCT')) {
614 614
 			foreach ($invoice->lines as $line) {
615 615
 				if ($line->product_ref == $prod->ref) {
616
-					if ($line->special_code==4) {
616
+					if ($line->special_code == 4) {
617 617
 						continue;
618 618
 					} // If this line is sended to printer create new line
619 619
 					// check if qty in stock
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 
664 664
 			// complete line by hook
665 665
 			$parameters = array('prod' => $prod, 'line' => $line);
666
-			$reshook=$hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action);    // Note that $action and $line may have been modified by some hooks
666
+			$reshook = $hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks
667 667
 			if ($reshook < 0) {
668 668
 				setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
669 669
 			}
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
 
719 719
 	if ($action == "addnote" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
720 720
 		$desc = GETPOST('addnote', 'alpha');
721
-		if ($idline==0) {
721
+		if ($idline == 0) {
722 722
 			$invoice->update_note($desc, '_public');
723 723
 		} else {
724 724
 			foreach ($invoice->lines as $line) {
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
 					}
852 852
 					if (!$permissiontoupdateline) {
853 853
 						dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos").' - No permission to updateprice', null, 1);
854
-					} elseif (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT')  == 1) {
854
+					} elseif (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') == 1) {
855 855
 						$result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
856 856
 					} else {
857 857
 						$result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
 		$invoice->fetch($placeid);
914 914
 	}
915 915
 
916
-	if ($action=="setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
916
+	if ($action == "setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
917 917
 		$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
918 918
 		$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set batch=".$db->escape($batch).", fk_warehouse=".getDolGlobalString($constantforkey)." where rowid=".((int) $idoflineadded);
919 919
 		$db->query($sql);
@@ -1060,7 +1060,7 @@  discard block
 block discarded – undo
1060 1060
 		}
1061 1061
 		$sectionwithinvoicelink .= '</span><br>';
1062 1062
 		if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) {
1063
-			$sectionwithinvoicelink .= ' <a target="_blank" class="button" href="' . DOL_URL_ROOT . '/document.php?token=' . newToken() . '&modulepart=facture&file=' . $invoice->ref . '/' . $invoice->ref . '.pdf">Invoice</a>';
1063
+			$sectionwithinvoicelink .= ' <a target="_blank" class="button" href="'.DOL_URL_ROOT.'/document.php?token='.newToken().'&modulepart=facture&file='.$invoice->ref.'/'.$invoice->ref.'.pdf">Invoice</a>';
1064 1064
 		} elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") {
1065 1065
 			if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
1066 1066
 				$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="TakeposConnector('.$placeid.')">'.$langs->trans('PrintTicket').'</button>';
@@ -1099,7 +1099,7 @@  discard block
 block discarded – undo
1099 1099
 if ((getDolGlobalString('TAKEPOS_PHONE_BASIC_LAYOUT') == 1 && $conf->browser->layout == 'phone') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
1100 1100
 	$title = 'TakePOS - Dolibarr '.DOL_VERSION;
1101 1101
 	if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
1102
-		$title = 'TakePOS - ' . getDolGlobalString('MAIN_APPLICATION_TITLE');
1102
+		$title = 'TakePOS - '.getDolGlobalString('MAIN_APPLICATION_TITLE');
1103 1103
 	}
1104 1104
 	$head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/>
1105 1105
 	<meta name="apple-mobile-web-app-capable" content="yes">
@@ -1123,7 +1123,7 @@  discard block
 block discarded – undo
1123 1123
 <script type="text/javascript">
1124 1124
 var selectedline=0;
1125 1125
 var selectedtext="";
1126
-<?php if ($action=="valid") {
1126
+<?php if ($action == "valid") {
1127 1127
 	echo "var place=0;";
1128 1128
 }?> // Set to default place after close sale
1129 1129
 var placeid=<?php echo($placeid > 0 ? $placeid : 0); ?>;
@@ -1321,7 +1321,7 @@  discard block
 block discarded – undo
1321 1321
 			if ($contactid > 0) {
1322 1322
 				$contact = new Contact($db);
1323 1323
 				$contact->fetch($contactid);
1324
-				$s .= " - " . $contact->getFullName($langs);
1324
+				$s .= " - ".$contact->getFullName($langs);
1325 1325
 			}
1326 1326
 		}
1327 1327
 	}
@@ -1382,10 +1382,10 @@  discard block
 block discarded – undo
1382 1382
 	$s = '';
1383 1383
 
1384 1384
 	$idwarehouse = 0;
1385
-	$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
1385
+	$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
1386 1386
 	if (isModEnabled('stock')) {
1387 1387
 		if (getDolGlobalString($constantforkey) != "1") {
1388
-			$constantforkey = 'CASHDESK_ID_WAREHOUSE'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
1388
+			$constantforkey = 'CASHDESK_ID_WAREHOUSE'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
1389 1389
 			$idwarehouse = getDolGlobalString($constantforkey);
1390 1390
 			if ($idwarehouse > 0) {
1391 1391
 				$s = '<span class="small">';
@@ -1532,8 +1532,8 @@  discard block
 block discarded – undo
1532 1532
 }
1533 1533
 
1534 1534
 // Complete header by hook
1535
-$parameters=array();
1536
-$reshook=$hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action);    // Note that $action and $object may have been modified by some hooks
1535
+$parameters = array();
1536
+$reshook = $hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
1537 1537
 if ($reshook < 0) {
1538 1538
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1539 1539
 }
@@ -1544,16 +1544,16 @@  discard block
 block discarded – undo
1544 1544
 	print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
1545 1545
 	if (getDolGlobalString('TAKEPOS_SHOW_HT')) {
1546 1546
 		print '<td class="linecolht right nowraponall">';
1547
-		print '<span class="opacitymedium small">' . $langs->trans('TotalHTShort') . '</span><br>';
1547
+		print '<span class="opacitymedium small">'.$langs->trans('TotalHTShort').'</span><br>';
1548 1548
 		// In phone version only show when it is invoice page
1549 1549
 		if (empty($mobilepage) || $mobilepage == "invoice") {
1550
-			print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">' . price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency) . '</span>';
1550
+			print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">'.price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency).'</span>';
1551 1551
 			if (isModEnabled('multicurrency') && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
1552 1552
 				//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
1553
-				include_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php';
1553
+				include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
1554 1554
 				$multicurrency = new MultiCurrency($db);
1555 1555
 				$multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
1556
-				print '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">(' . price($invoice->total_ht * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')</span>';
1556
+				print '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">('.price($invoice->total_ht * $multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')</span>';
1557 1557
 			}
1558 1558
 		}
1559 1559
 		print '</td>';
@@ -1694,8 +1694,8 @@  discard block
 block discarded – undo
1694 1694
 				$htmlsupplements[$line->fk_parent_line] .= '</td>';
1695 1695
 
1696 1696
 				// complete line by hook
1697
-				$parameters=array('line' => $line);
1698
-				$reshook=$hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action);    // Note that $action and $object may have been modified by some hooks
1697
+				$parameters = array('line' => $line);
1698
+				$reshook = $hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
1699 1699
 				if ($reshook < 0) {
1700 1700
 					setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1701 1701
 				}
@@ -1744,7 +1744,7 @@  discard block
 block discarded – undo
1744 1744
 					}
1745 1745
 				}
1746 1746
 				if (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 1) {
1747
-					$htmlforlines .= $form->textwithpicto($line->product_label ? '<b>' . $line->product_ref . '</b> - ' . $line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext);
1747
+					$htmlforlines .= $form->textwithpicto($line->product_label ? '<b>'.$line->product_ref.'</b> - '.$line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext);
1748 1748
 				} elseif (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 2) {
1749 1749
 					$htmlforlines .= $form->textwithpicto($line->product_ref ? '<b>'.$line->product_ref.'<b>' : dolGetFirstLineOfText($line->desc, 1), $tooltiptext);
1750 1750
 				} else {
@@ -1790,8 +1790,8 @@  discard block
 block discarded – undo
1790 1790
 				$htmlforlines .= '</td>';
1791 1791
 
1792 1792
 				// complete line by hook
1793
-				$parameters=array('line' => $line);
1794
-				$reshook=$hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action);    // Note that $action and $object may have been modified by some hooks
1793
+				$parameters = array('line' => $line);
1794
+				$reshook = $hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
1795 1795
 				if ($reshook < 0) {
1796 1796
 					setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1797 1797
 				}
@@ -1891,7 +1891,7 @@  discard block
 block discarded – undo
1891 1891
 if (($action == "valid" || $action == "history") && $invoice->type != Facture::TYPE_CREDIT_NOTE && !getDolGlobalString('TAKEPOS_NO_CREDITNOTE')) {
1892 1892
 	print '<button id="buttonprint" type="button" onclick="ModalBox(\'ModalCreditNote\')">'.$langs->trans('CreateCreditNote').'</button>';
1893 1893
 	if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) {
1894
-		print ' <a target="_blank" class="button" href="' . DOL_URL_ROOT . '/document.php?token=' . newToken() . '&modulepart=facture&file=' . $invoice->ref . '/' . $invoice->ref . '.pdf">Invoice</a>';
1894
+		print ' <a target="_blank" class="button" href="'.DOL_URL_ROOT.'/document.php?token='.newToken().'&modulepart=facture&file='.$invoice->ref.'/'.$invoice->ref.'.pdf">Invoice</a>';
1895 1895
 	}
1896 1896
 }
1897 1897
 
Please login to merge, or discard this patch.
htdocs/takepos/index.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
 $arrayofcss = array('/takepos/css/pos.css.php', '/takepos/css/colorbox.css');
121 121
 
122 122
 if (getDolGlobalInt('TAKEPOS_COLOR_THEME') == 1) {
123
-	$arrayofcss[] =  '/takepos/css/colorful.css';
123
+	$arrayofcss[] = '/takepos/css/colorful.css';
124 124
 }
125 125
 
126 126
 
127 127
 // Title
128 128
 $title = 'TakePOS - Dolibarr '.DOL_VERSION;
129 129
 if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
130
-	$title = 'TakePOS - ' . getDolGlobalString('MAIN_APPLICATION_TITLE');
130
+	$title = 'TakePOS - '.getDolGlobalString('MAIN_APPLICATION_TITLE');
131 131
 }
132 132
 $head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/>
133 133
 <meta name="apple-mobile-web-app-capable" content="yes">
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 		limit = maxproduct-1;
337 337
 	}
338 338
 	// Only show products for sale (tosell=1)
339
-	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken();?>&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&category='+currentcat+'&tosell=1&limit='+limit+'&offset=0', function(data) {
339
+	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken(); ?>&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&category='+currentcat+'&tosell=1&limit='+limit+'&offset=0', function(data) {
340 340
 		console.log("Call ajax.php (in LoadProducts) to get Products of category "+currentcat+" then loop on result to fill image thumbs");
341 341
 		console.log(data);
342 342
 		while (ishow < maxproduct) {
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 
393 393
 				<?php
394 394
 				// Add js from hooks
395
-				$parameters=array();
395
+				$parameters = array();
396 396
 				$parameters['caller'] = 'loadProducts';
397 397
 				$hookmanager->executeHooks('completeJSProductDisplay', $parameters);
398 398
 				print $hookmanager->resPrint;
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 	}
437 437
 	var offset = <?php echo($MAXPRODUCT - 2); ?> * pageproducts;
438 438
 	// Only show products for sale (tosell=1)
439
-	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken();?>&category='+currentcat+'&tosell=1&limit='+limit+'&offset='+offset, function(data) {
439
+	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken(); ?>&category='+currentcat+'&tosell=1&limit='+limit+'&offset='+offset, function(data) {
440 440
 		console.log("Call ajax.php (in MoreProducts) to get Products of category "+currentcat);
441 441
 
442 442
 		if (typeof (data[0]) == "undefined" && moreorless=="more"){ // Return if no more pages
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 function ChangeThirdparty(idcustomer) {
510 510
 	 console.log("ChangeThirdparty");
511 511
 		// Call page list.php to change customer
512
-		$("#poslines").load("<?php echo DOL_URL_ROOT ?>/societe/list.php?action=change&token=<?php echo newToken();?>&type=t&contextpage=poslist&idcustomer="+idcustomer+"&place="+place+"", function() {
512
+		$("#poslines").load("<?php echo DOL_URL_ROOT ?>/societe/list.php?action=change&token=<?php echo newToken(); ?>&type=t&contextpage=poslist&idcustomer="+idcustomer+"&place="+place+"", function() {
513 513
 		});
514 514
 
515 515
 	ClearSearch(false);
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 
595 595
 	console.log("New with place = <?php echo $place; ?>, js place="+place+", invoiceid="+invoiceid);
596 596
 
597
-	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&token=<?php echo newToken();?>&id='+invoiceid, function(data) {
597
+	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&token=<?php echo newToken(); ?>&id='+invoiceid, function(data) {
598 598
 		var r;
599 599
 
600 600
 		if (parseInt(data['paye']) === 1) {
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 			pageproducts = 0;
665 665
 			jQuery(".wrapper2 .catwatermark").hide();
666 666
 			var nbsearchresults = 0;
667
-			$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&token=<?php echo newToken();?>&term=' + search_term + '&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) {
667
+			$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&token=<?php echo newToken(); ?>&term=' + search_term + '&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) {
668 668
 				for (i = 0; i < <?php echo $MAXPRODUCT ?>; i++) {
669 669
 					if (typeof (data[i]) == "undefined") {
670 670
 						$("#prowatermark" + i).html("");
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 
709 709
 					<?php
710 710
 					// Add js from hooks
711
-					$parameters=array();
711
+					$parameters = array();
712 712
 					$parameters['caller'] = 'search2';
713 713
 					$hookmanager->executeHooks('completeJSProductDisplay', $parameters);
714 714
 					print $hookmanager->resPrint;
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 				}
747 747
 				else {
748 748
 					$("#prodiv<?php echo $MAXPRODUCT - 2; ?> span").show();
749
-					var search_start_less = Math.max(0, parseInt(search_start) - parseInt(<?php echo $MAXPRODUCT - 2;?>));
749
+					var search_start_less = Math.max(0, parseInt(search_start) - parseInt(<?php echo $MAXPRODUCT - 2; ?>));
750 750
 					$("#search_start_less").val(search_start_less);
751 751
 				}
752 752
 				if (nbsearchresults != <?php echo $MAXPRODUCT - 2; ?>) {
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
 				}
755 755
 				else {
756 756
 					$("#prodiv<?php echo $MAXPRODUCT - 1; ?> span").show();
757
-					var search_start_more = parseInt(search_start) + parseInt(<?php echo $MAXPRODUCT - 2;?>);
757
+					var search_start_more = parseInt(search_start) + parseInt(<?php echo $MAXPRODUCT - 2; ?>);
758 758
 					$("#search_start_more").val(search_start_more);
759 759
 				}
760 760
 			});
@@ -851,14 +851,14 @@  discard block
 block discarded – undo
851 851
 
852 852
 function TakeposPrintingOrder(){
853 853
 	console.log("TakeposPrintingOrder");
854
-	$("#poslines").load("invoice.php?action=order&token=<?php echo newToken();?>&place="+place, function() {
854
+	$("#poslines").load("invoice.php?action=order&token=<?php echo newToken(); ?>&place="+place, function() {
855 855
 		//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
856 856
 	});
857 857
 }
858 858
 
859 859
 function TakeposPrintingTemp(){
860 860
 	console.log("TakeposPrintingTemp");
861
-	$("#poslines").load("invoice.php?action=temp&token=<?php echo newToken();?>&place="+place, function() {
861
+	$("#poslines").load("invoice.php?action=temp&token=<?php echo newToken(); ?>&place="+place, function() {
862 862
 		//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
863 863
 	});
864 864
 }
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
 }
881 881
 
882 882
 function DolibarrOpenDrawer() {
883
-	console.log("DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&token=<?php echo newToken();?>&term=<?php print urlencode($_SESSION["takeposterminal"]); ?>");
883
+	console.log("DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&token=<?php echo newToken(); ?>&term=<?php print urlencode($_SESSION["takeposterminal"]); ?>");
884 884
 	$.ajax({
885 885
 		type: "GET",
886 886
 		data: { token: '<?php echo currentToken(); ?>' },
@@ -1220,8 +1220,8 @@  discard block
 block discarded – undo
1220 1220
 
1221 1221
 // TakePOS setup check
1222 1222
 if (isset($_SESSION["takeposterminal"]) && $_SESSION["takeposterminal"]) {
1223
-	$sql = "SELECT code, libelle FROM " . MAIN_DB_PREFIX . "c_paiement";
1224
-	$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
1223
+	$sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_paiement";
1224
+	$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
1225 1225
 	$sql .= " AND active = 1";
1226 1226
 	$sql .= " ORDER BY libelle";
1227 1227
 
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
 				$paycode = 'CHEQUE';
1238 1238
 			}
1239 1239
 
1240
-			$constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"];
1240
+			$constantforkey = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
1241 1241
 			//var_dump($constantforkey.' '.getDolGlobalInt($constantforkey));
1242 1242
 			if (getDolGlobalInt($constantforkey) > 0) {
1243 1243
 				array_push($paiementsModes, $obj);
@@ -1279,7 +1279,7 @@  discard block
 block discarded – undo
1279 1279
 		$menus[$r++] = array('title'=>'<span class="far fa-building paddingrightonly"></span><div class="trunc">'.$langs->trans("Customer").'</div>', 'action'=>'Customer();');
1280 1280
 	}
1281 1281
 }
1282
-if (! getDolGlobalString('TAKEPOS_HIDE_HISTORY')) {
1282
+if (!getDolGlobalString('TAKEPOS_HIDE_HISTORY')) {
1283 1283
 	$menus[$r++] = array('title'=>'<span class="fa fa-history paddingrightonly"></span><div class="trunc">'.$langs->trans("History").'</div>', 'action'=>'History();');
1284 1284
 }
1285 1285
 $menus[$r++] = array('title'=>'<span class="fa fa-cube paddingrightonly"></span><div class="trunc">'.$langs->trans("FreeZone").'</div>', 'action'=>'FreeZone();');
Please login to merge, or discard this patch.
htdocs/contact/list.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 
502 502
 // Add fields from hooks - ListFrom
503 503
 $parameters = array();
504
-$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action);    // Note that $action and $object may have been modified by hook
504
+$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
505 505
 $sql .= $hookmanager->resPrint;
506 506
 $sql .= ' WHERE p.entity IN ('.getEntity('contact').')';
507 507
 if (!$user->hasRight('societe', 'client', 'voir')) {
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 			if ($searchCategoryContactOperator == 0) {
545 545
 				$searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX."categorie_contact as ck WHERE p.rowid = ck.fk_socpeople AND ck.fk_categorie = ".((int) $searchCategoryContact).")";
546 546
 			} else {
547
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact);
547
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryContact);
548 548
 			}
549 549
 		}
550 550
 	}
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 			if ($searchCategoryCustomerOperator == 0) {
577 577
 				$searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")";
578 578
 			} else {
579
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer);
579
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer);
580 580
 			}
581 581
 		}
582 582
 	}
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 			if ($searchCategorySupplierOperator == 0) {
609 609
 				$searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).")";
610 610
 			} else {
611
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier);
611
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategorySupplier);
612 612
 			}
613 613
 		}
614 614
 	}
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
 if (isModEnabled('category') && $user->hasRight('societe', 'creer')) {
925 925
 	$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
926 926
 }
927
-if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
927
+if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
928 928
 	$arrayofmassactions = array();
929 929
 }
930 930
 if ($contextpage != 'poslist') {
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
 if ($contextpage != 'poslist') {
955 955
 	$newcardbutton .= dolGetButtonTitle($langs->trans('NewContactAddress'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create', '', $permissiontoadd);
956 956
 } elseif ($user->hasRight('societe', 'contact', 'creer')) {
957
-	$url = DOL_URL_ROOT . '/contact/card.php?action=create&type=t&contextpage=poslist&optioncss=print&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?token=' . newToken() . 'type=t&contextpage=poslist&nomassaction=1&optioncss=print&place='.$place);
957
+	$url = DOL_URL_ROOT.'/contact/card.php?action=create&type=t&contextpage=poslist&optioncss=print&backtopage='.urlencode($_SERVER["PHP_SELF"].'?token='.newToken().'type=t&contextpage=poslist&nomassaction=1&optioncss=print&place='.$place);
958 958
 	$label = 'MenuNewCustomer';
959 959
 	$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', $url);
960 960
 }
Please login to merge, or discard this patch.
htdocs/ticket/class/ticket.class.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -284,10 +284,10 @@  discard block
 block discarded – undo
284 284
 	const STATUS_READ = 1;
285 285
 	const STATUS_ASSIGNED = 2;
286 286
 	const STATUS_IN_PROGRESS = 3;
287
-	const STATUS_NEED_MORE_INFO = 5;	// waiting requester feedback
288
-	const STATUS_WAITING = 7;			// on hold
289
-	const STATUS_CLOSED = 8;			// Closed - Solved
290
-	const STATUS_CANCELED = 9;			// Closed - Not solved
287
+	const STATUS_NEED_MORE_INFO = 5; // waiting requester feedback
288
+	const STATUS_WAITING = 7; // on hold
289
+	const STATUS_CLOSED = 8; // Closed - Solved
290
+	const STATUS_CANCELED = 9; // Closed - Not solved
291 291
 
292 292
 
293 293
 	/**
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
 		$sql .= " t.tms,";
796 796
 		$sql .= " type.label as type_label, category.label as category_label, severity.label as severity_label";
797 797
 		// Add fields for extrafields
798
-		if ($extrafields->attributes[$this->table_element]['count']> 0) {
798
+		if ($extrafields->attributes[$this->table_element]['count'] > 0) {
799 799
 			foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
800 800
 				$sql .= ($extrafields->attributes[$this->table_element]['type'][$key] != 'separate' ? ",ef.".$key." as options_".$key : '');
801 801
 			}
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
 		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc";
808 808
 		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as uc ON uc.rowid = t.fk_user_create";
809 809
 		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as ua ON ua.rowid = t.fk_user_assign";
810
-		if ($extrafields->attributes[$this->table_element]['count']> 0) {
810
+		if ($extrafields->attributes[$this->table_element]['count'] > 0) {
811 811
 			if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label'])) {
812 812
 				$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."ticket_extrafields as ef on (t.rowid = ef.fk_object)";
813 813
 			}
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
 					$line->date_close = $this->db->jdate($obj->date_close);
913 913
 
914 914
 					// Extra fields
915
-					if ($extrafields->attributes[$this->table_element]['count']> 0) {
915
+					if ($extrafields->attributes[$this->table_element]['count'] > 0) {
916 916
 						if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label'])) {
917 917
 							foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
918 918
 								$tmpkey = 'options_'.$key;
@@ -1516,9 +1516,9 @@  discard block
 block discarded – undo
1516 1516
 		}
1517 1517
 		// show categories for this record only in ajax to not overload lists
1518 1518
 		if (isModEnabled('categorie') && !$nofetch) {
1519
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1519
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1520 1520
 			$form = new Form($this->db);
1521
-			$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_TICKET, 1);
1521
+			$datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_TICKET, 1);
1522 1522
 		}
1523 1523
 
1524 1524
 		return $datas;
@@ -1748,7 +1748,7 @@  discard block
 block discarded – undo
1748 1748
 		// Insert entry into agenda with code 'TICKET_MSG'
1749 1749
 		include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
1750 1750
 		$actioncomm = new ActionComm($this->db);
1751
-		$actioncomm->type_code = 'AC_OTH_AUTO';	// This is not an entry that must appears into manual calendar but only into CRM calendar
1751
+		$actioncomm->type_code = 'AC_OTH_AUTO'; // This is not an entry that must appears into manual calendar but only into CRM calendar
1752 1752
 		$actioncomm->code = 'TICKET_MSG';
1753 1753
 		if ($this->private) {
1754 1754
 			$actioncomm->code = 'TICKET_MSG_PRIVATE';
@@ -2398,7 +2398,7 @@  discard block
 block discarded – undo
2398 2398
 			if (is_resource($handle)) {
2399 2399
 				while (($file = readdir($handle)) !== false) {
2400 2400
 					if (!utf8_check($file)) {
2401
-						$file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1');	// To be sure data is stored in UTF8 in memory
2401
+						$file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in UTF8 in memory
2402 2402
 					}
2403 2403
 					if (dol_is_file($dir.$file)) {
2404 2404
 						return true;
@@ -2436,7 +2436,7 @@  discard block
 block discarded – undo
2436 2436
 		$formmail->trackid = (is_null($forcetrackid) ? 'tic'.$this->id : '');
2437 2437
 		$attachedfiles = $formmail->get_attached_files();
2438 2438
 
2439
-		$filepath = $attachedfiles['paths'];	// path is for example user->dir_temp.'/'.$user->id.'/'...
2439
+		$filepath = $attachedfiles['paths']; // path is for example user->dir_temp.'/'.$user->id.'/'...
2440 2440
 		$filename = $attachedfiles['names'];
2441 2441
 		$mimetype = $attachedfiles['mimes'];
2442 2442
 
@@ -2827,7 +2827,7 @@  discard block
 block discarded – undo
2827 2827
 
2828 2828
 								// If public interface is not enable, use link to internal page into mail
2829 2829
 								$url_public_ticket = (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE') ?
2830
-										(getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') !== '' ? getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') . '/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)).'?track_id='.$object->track_id;
2830
+										(getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') !== '' ? getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE').'/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)).'?track_id='.$object->track_id;
2831 2831
 								$message .= '<br>'.$langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer').' : <a href="'.$url_public_ticket.'">'.$object->track_id.'</a><br>';
2832 2832
 
2833 2833
 								// Build final message
@@ -2861,7 +2861,7 @@  discard block
 block discarded – undo
2861 2861
 									if ($result) {
2862 2862
 										// update last_msg_sent date (for last message sent to external users)
2863 2863
 										$this->date_last_msg_sent = dol_now();
2864
-										$this->update($user, 1);	// disable trigger when updating date_last_msg_sent. sendTicketMessageByEmail already create an event in actioncomm table.
2864
+										$this->update($user, 1); // disable trigger when updating date_last_msg_sent. sendTicketMessageByEmail already create an event in actioncomm table.
2865 2865
 									}
2866 2866
 								}
2867 2867
 							}
Please login to merge, or discard this patch.