Completed
Branch develop (2cf5b9)
by
unknown
16:22
created
htdocs/core/db/mysqli.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 					$clientmustbe = 'utf8';
120 120
 				}
121 121
 
122
-				$disableforcecharset = 0;	// Set to 1 to test without charset forcing
122
+				$disableforcecharset = 0; // Set to 1 to test without charset forcing
123 123
 				if (empty($disableforcecharset) && $this->db->character_set_name() != $clientmustbe) {
124 124
 					try {
125 125
 						//print "You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database ".$this->db->character_set_name();
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 				$sqlfields[$i] .= "(".$this->sanitize($field_desc['value']).")";
855 855
 			}
856 856
 			if (isset($field_desc['attribute']) && $field_desc['attribute'] !== '') {
857
-				$sqlfields[$i] .= " ".$this->sanitize($field_desc['attribute'], 0, 0, 1);	// Allow space to accept attributes like "ON UPDATE CURRENT_TIMESTAMP"
857
+				$sqlfields[$i] .= " ".$this->sanitize($field_desc['attribute'], 0, 0, 1); // Allow space to accept attributes like "ON UPDATE CURRENT_TIMESTAMP"
858 858
 			}
859 859
 			if (isset($field_desc['default']) && $field_desc['default'] !== '') {
860 860
 				if (in_array($field_desc['type'], array('tinyint', 'smallint', 'int', 'double'))) {
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
 				$sqlfields[$i] .= " ".$this->sanitize($field_desc['extra'], 0, 0, 1);
873 873
 			}
874 874
 			if (!empty($primary_key) && $primary_key == $field_name) {
875
-				$sqlfields[$i] .= " AUTO_INCREMENT PRIMARY KEY";	// mysql instruction that will be converted by driver late
875
+				$sqlfields[$i] .= " AUTO_INCREMENT PRIMARY KEY"; // mysql instruction that will be converted by driver late
876 876
 			}
877 877
 			$i++;
878 878
 		}
Please login to merge, or discard this patch.
htdocs/societe/admin/societe.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
 $action = GETPOST('action', 'aZ09');
40 40
 $value = GETPOST('value', 'alpha');
41
-$modulepart = GETPOST('modulepart', 'aZ09');	// Used by actions_setmoduleoptions.inc.php
41
+$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
42 42
 
43 43
 if (!$user->admin) {
44 44
 	accessforbidden();
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
 print '<td class="center">'.$langs->trans("MustBeInvoiceMandatory").'</td>';
682 682
 print "</tr>\n";
683 683
 
684
-$profid = array('IDPROF1' => array(), 'IDPROF2' => array(), 'IDPROF3' => array(), 'IDPROF4' => array(), 'IDPROF5' => array(),'IDPROF6' => array(), 'EMAIL' => array());
684
+$profid = array('IDPROF1' => array(), 'IDPROF2' => array(), 'IDPROF3' => array(), 'IDPROF4' => array(), 'IDPROF5' => array(), 'IDPROF6' => array(), 'EMAIL' => array());
685 685
 $profid['IDPROF1'][0] = $langs->trans("ProfId1");
686 686
 $profid['IDPROF1'][1] = $langs->transcountry('ProfId1', $mysoc->country_code);
687 687
 $profid['IDPROF2'][0] = $langs->trans("ProfId2");
@@ -949,7 +949,7 @@  discard block
 block discarded – undo
949 949
 		print "</td>";
950 950
 	} else {
951 951
 		print '<td width="60" class="right">';
952
-		$contact = new Contact($db);	// InfraS add
952
+		$contact = new Contact($db); // InfraS add
953 953
 		$contactType = $contact->listeTypeContacts('external', 0, 1);
954 954
 		$selected = explode(',', getDolGlobalString('CONTACTS_DEFAULT_ROLES'));
955 955
 		print $form->multiselectarray('activate_CONTACTS_DEFAULT_ROLES', $contactType, $selected, 0, 0, 'minwidth75imp');
Please login to merge, or discard this patch.
htdocs/societe/class/societe.class.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -990,8 +990,8 @@  discard block
 block discarded – undo
990 990
 			$sql .= ", '".$this->db->escape($this->multicurrency_code)."'";
991 991
 			if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
992 992
 				$sql .= ", ".(empty($this->vat_reverse_charge) ? '0' : '1');
993
-				$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
994
-				$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
993
+				$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
994
+				$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
995 995
 			}
996 996
 			$sql .= ")";
997 997
 
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
 				}
1041 1041
 
1042 1042
 				if ($ret >= 0) {
1043
-					if (! $notrigger) {
1043
+					if (!$notrigger) {
1044 1044
 						// Call trigger
1045 1045
 						$result = $this->call_trigger('COMPANY_CREATE', $user);
1046 1046
 						if ($result < 0) {
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
 		$contact->town              = $this->town;
1118 1118
 		$this->setUpperOrLowerCase();
1119 1119
 		$contact->phone_pro         = $this->phone;
1120
-		$contact->roles				= explode(',', getDolGlobalString('CONTACTS_DEFAULT_ROLES'));
1120
+		$contact->roles = explode(',', getDolGlobalString('CONTACTS_DEFAULT_ROLES'));
1121 1121
 
1122 1122
 		$contactId = $contact->create($user, $notrigger);
1123 1123
 		if ($contactId < 0) {
@@ -1284,7 +1284,7 @@  discard block
 block discarded – undo
1284 1284
 						if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) {
1285 1285
 							$langs->loadLangs(array("errors", 'compta'));
1286 1286
 							$error++;
1287
-							$this->errors[] = $langs->trans('CustomerAccountancyCodeShort') . " " . $langs->trans("ErrorProdIdAlreadyExist", $vallabel) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')';
1287
+							$this->errors[] = $langs->trans('CustomerAccountancyCodeShort')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')';
1288 1288
 						}
1289 1289
 					}
1290 1290
 
@@ -1292,7 +1292,7 @@  discard block
 block discarded – undo
1292 1292
 					if (getDolGlobalString('SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_MANDATORY') && (!isset($vallabel) || trim($vallabel) === '')) {
1293 1293
 						$langs->loadLangs(array("errors", 'compta'));
1294 1294
 						$error++;
1295
-						$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('CustomerAccountancyCodeShort')) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')';
1295
+						$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('CustomerAccountancyCodeShort')).' ('.$langs->trans("ForbiddenBySetupRules").')';
1296 1296
 					}
1297 1297
 				} elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER' && !empty($this->fournisseur)) {
1298 1298
 					// Check for unicity
@@ -1300,7 +1300,7 @@  discard block
 block discarded – undo
1300 1300
 						if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) {
1301 1301
 							$langs->loadLangs(array("errors", 'compta'));
1302 1302
 							$error++;
1303
-							$this->errors[] = $langs->trans('SupplierAccountancyCodeShort') . " " . $langs->trans("ErrorProdIdAlreadyExist", $vallabel) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')';
1303
+							$this->errors[] = $langs->trans('SupplierAccountancyCodeShort')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')';
1304 1304
 						}
1305 1305
 					}
1306 1306
 
@@ -1308,7 +1308,7 @@  discard block
 block discarded – undo
1308 1308
 					if (getDolGlobalString('SOCIETE_ACCOUNTANCY_CODE_SUPPLIER_MANDATORY') && (!isset($vallabel) || trim($vallabel) === '')) {
1309 1309
 						$langs->loadLangs(array("errors", 'compta'));
1310 1310
 						$error++;
1311
-						$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('SupplierAccountancyCodeShort')) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')';
1311
+						$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('SupplierAccountancyCodeShort')).' ('.$langs->trans("ForbiddenBySetupRules").')';
1312 1312
 					}
1313 1313
 				}
1314 1314
 			}
@@ -1350,17 +1350,17 @@  discard block
 block discarded – undo
1350 1350
 		$now = dol_now();
1351 1351
 
1352 1352
 		// Clean parameters
1353
-		$this->id 			= $id;
1354
-		$this->entity 		= ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity);
1353
+		$this->id = $id;
1354
+		$this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity);
1355 1355
 		$this->name 		= $this->name ? trim($this->name) : trim((string) $this->nom);
1356 1356
 		$this->nom 			= $this->name; // For backward compatibility
1357
-		$this->name_alias 	= trim((string) $this->name_alias);
1357
+		$this->name_alias = trim((string) $this->name_alias);
1358 1358
 		$this->ref_ext		= (empty($this->ref_ext) ? '' : trim($this->ref_ext));
1359 1359
 		$this->address		= trim((string) $this->address);
1360 1360
 		$this->zip 			= trim((string) $this->zip);
1361 1361
 		$this->town 		= trim((string) $this->town);
1362
-		$this->state_id 	= (is_numeric($this->state_id)) ? (int) trim((string) $this->state_id) : 0;
1363
-		$this->country_id 	= ($this->country_id > 0) ? $this->country_id : 0;
1362
+		$this->state_id = (is_numeric($this->state_id)) ? (int) trim((string) $this->state_id) : 0;
1363
+		$this->country_id = ($this->country_id > 0) ? $this->country_id : 0;
1364 1364
 		$this->phone		= trim((string) $this->phone);
1365 1365
 		$this->phone		= preg_replace("/\s/", "", $this->phone);
1366 1366
 		$this->phone		= preg_replace("/\./", "", $this->phone);
@@ -1370,7 +1370,7 @@  discard block
 block discarded – undo
1370 1370
 		$this->fax			= trim((string) $this->fax);
1371 1371
 		$this->fax			= preg_replace("/\s/", "", $this->fax);
1372 1372
 		$this->fax			= preg_replace("/\./", "", $this->fax);
1373
-		$this->email		= trim((string) $this->email);
1373
+		$this->email = trim((string) $this->email);
1374 1374
 		$this->url			= $this->url ? clean_url($this->url, 0) : '';
1375 1375
 		$this->note_private = (empty($this->note_private) ? '' : trim($this->note_private));
1376 1376
 		$this->note_public  = (empty($this->note_public) ? '' : trim($this->note_public));
@@ -1380,14 +1380,14 @@  discard block
 block discarded – undo
1380 1380
 		$this->idprof4		= trim((string) $this->idprof4);
1381 1381
 		$this->idprof5		= (!empty($this->idprof5) ? trim($this->idprof5) : '');
1382 1382
 		$this->idprof6		= (!empty($this->idprof6) ? trim($this->idprof6) : '');
1383
-		$this->prefix_comm 	= trim((string) $this->prefix_comm);
1383
+		$this->prefix_comm = trim((string) $this->prefix_comm);
1384 1384
 		$this->outstanding_limit = price2num($this->outstanding_limit);
1385 1385
 		$this->order_min_amount = price2num($this->order_min_amount);
1386 1386
 		$this->supplier_order_min_amount = price2num($this->supplier_order_min_amount);
1387 1387
 
1388 1388
 		$this->tva_assuj			= (is_numeric($this->tva_assuj)) ? (int) trim((string) $this->tva_assuj) : 0;
1389 1389
 		$this->tva_intra			= dol_sanitizeFileName($this->tva_intra, '');
1390
-		$this->vat_reverse_charge	= empty($this->vat_reverse_charge) ? 0 : 1;
1390
+		$this->vat_reverse_charge = empty($this->vat_reverse_charge) ? 0 : 1;
1391 1391
 		if (empty($this->status)) {
1392 1392
 			$this->status = 0;
1393 1393
 		}
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
 			$sql .= ",tva_assuj = ".($this->tva_assuj != '' ? "'".$this->db->escape($this->tva_assuj)."'" : "null");
1539 1539
 			$sql .= ",tva_intra = '".$this->db->escape($this->tva_intra)."'";
1540 1540
 			if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
1541
-				$sql .= ",vat_reverse_charge = " . ($this->vat_reverse_charge != '' ? "'" . $this->db->escape($this->vat_reverse_charge) . "'" : 0);
1541
+				$sql .= ",vat_reverse_charge = ".($this->vat_reverse_charge != '' ? "'".$this->db->escape($this->vat_reverse_charge)."'" : 0);
1542 1542
 			}
1543 1543
 			$sql .= ",status = ".((int) $this->status);
1544 1544
 
@@ -1599,8 +1599,8 @@  discard block
 block discarded – undo
1599 1599
 			$sql .= ",supplier_order_min_amount= ".($this->supplier_order_min_amount != '' ? $this->supplier_order_min_amount : 'null');
1600 1600
 			$sql .= ",fk_prospectlevel='".$this->db->escape($this->fk_prospectlevel)."'";
1601 1601
 			if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
1602
-				$sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'";
1603
-				$sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'";
1602
+				$sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'";
1603
+				$sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'";
1604 1604
 				if ($customer) {
1605 1605
 					$sql .= ", code_compta = ".(!empty($this->code_compta_client) ? "'".$this->db->escape($this->code_compta_client)."'" : "null");
1606 1606
 				}
@@ -1970,7 +1970,7 @@  discard block
 block discarded – undo
1970 1970
 				$this->code_client = $obj->code_client;
1971 1971
 				$this->code_fournisseur = $obj->code_fournisseur;
1972 1972
 
1973
-				$this->code_compta = $obj->code_compta;			// For backward compatibility
1973
+				$this->code_compta = $obj->code_compta; // For backward compatibility
1974 1974
 				$this->code_compta_client = $obj->code_compta;
1975 1975
 				$this->code_compta_fournisseur = $obj->code_compta_fournisseur;
1976 1976
 
@@ -1987,7 +1987,7 @@  discard block
 block discarded – undo
1987 1987
 					$this->vat_reverse_charge = 0;
1988 1988
 				}
1989 1989
 
1990
-				$this->status				= $obj->status;
1990
+				$this->status = $obj->status;
1991 1991
 
1992 1992
 				// Local Taxes
1993 1993
 				$this->localtax1_assuj      = $obj->localtax1_assuj;
@@ -2014,7 +2014,7 @@  discard block
 block discarded – undo
2014 2014
 
2015 2015
 				$this->mode_reglement_id 	= $obj->mode_reglement;
2016 2016
 				$this->cond_reglement_id 	= $obj->cond_reglement;
2017
-				$this->deposit_percent		= $obj->deposit_percent;
2017
+				$this->deposit_percent = $obj->deposit_percent;
2018 2018
 				$this->transport_mode_id 	= $obj->transport_mode;
2019 2019
 				$this->mode_reglement_supplier_id 	= $obj->mode_reglement_supplier;
2020 2020
 				$this->cond_reglement_supplier_id 	= $obj->cond_reglement_supplier;
@@ -2545,10 +2545,10 @@  discard block
 block discarded – undo
2545 2545
 					$reparray[$i]['firstname'] = $obj->firstname;
2546 2546
 					$reparray[$i]['email'] = $obj->email;
2547 2547
 					$reparray[$i]['phone'] = $obj->office_phone;
2548
-					$reparray[$i]['office_phone'] = $obj->office_phone;			// Pro phone
2548
+					$reparray[$i]['office_phone'] = $obj->office_phone; // Pro phone
2549 2549
 					$reparray[$i]['office_fax'] = $obj->office_fax;
2550
-					$reparray[$i]['user_mobile'] = $obj->user_mobile;			// Pro mobile
2551
-					$reparray[$i]['personal_mobile'] = $obj->personal_mobile;	// Personal mobile
2550
+					$reparray[$i]['user_mobile'] = $obj->user_mobile; // Pro mobile
2551
+					$reparray[$i]['personal_mobile'] = $obj->personal_mobile; // Personal mobile
2552 2552
 					$reparray[$i]['job'] = $obj->job;
2553 2553
 					$reparray[$i]['statut'] = $obj->status; // deprecated
2554 2554
 					$reparray[$i]['status'] = $obj->status;
@@ -2761,7 +2761,7 @@  discard block
 block discarded – undo
2761 2761
 			$datas['status'] = ' '.$this->getLibStatut(5);
2762 2762
 		}
2763 2763
 		if (isset($this->client) && isset($this->fournisseur)) {
2764
-			$datas['type'] = ' &nbsp; ' . $this->getTypeUrl(1);
2764
+			$datas['type'] = ' &nbsp; '.$this->getTypeUrl(1);
2765 2765
 		}
2766 2766
 		$datas['name'] = '<br><b>'.$langs->trans('Name').':</b> '.dol_escape_htmltag(dol_string_nohtmltag($this->name));
2767 2767
 		if (!empty($this->name_alias) && empty($noaliasinname)) {
@@ -2829,9 +2829,9 @@  discard block
 block discarded – undo
2829 2829
 		}
2830 2830
 		// show categories for this record only in ajax to not overload lists
2831 2831
 		if (!$nofetch && isModEnabled('category') && $this->client) {
2832
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
2832
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
2833 2833
 			$form = new Form($this->db);
2834
-			$datas['categories_customer'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1);
2834
+			$datas['categories_customer'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1);
2835 2835
 		}
2836 2836
 		if (!empty($this->code_fournisseur) && $this->fournisseur) {
2837 2837
 			$datas['suppliercode'] = '<br><b>'.$langs->trans('SupplierCode').':</b> '.$this->code_fournisseur;
@@ -2842,9 +2842,9 @@  discard block
 block discarded – undo
2842 2842
 		}
2843 2843
 		// show categories for this record only in ajax to not overload lists
2844 2844
 		if (!$nofetch && isModEnabled('category') && $this->fournisseur) {
2845
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
2845
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
2846 2846
 			$form = new Form($this->db);
2847
-			$datas['categories_supplier'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1);
2847
+			$datas['categories_supplier'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1);
2848 2848
 		}
2849 2849
 
2850 2850
 		$datas['divclose'] = '</div>';
@@ -3743,7 +3743,7 @@  discard block
 block discarded – undo
3743 3743
 		global $langs;
3744 3744
 
3745 3745
 		if ($company_id > 0) {
3746
-			$sql = "SELECT parent FROM " . MAIN_DB_PREFIX . "societe WHERE rowid = ".((int) $company_id);
3746
+			$sql = "SELECT parent FROM ".MAIN_DB_PREFIX."societe WHERE rowid = ".((int) $company_id);
3747 3747
 			$resql = $this->db->query($sql);
3748 3748
 			if ($resql) {
3749 3749
 				if ($obj = $this->db->fetch_object($resql)) {
@@ -4359,7 +4359,7 @@  discard block
 block discarded – undo
4359 4359
 		$country_code = $country_label = '';
4360 4360
 		if (getDolGlobalString('MAIN_INFO_SOCIETE_COUNTRY')) {
4361 4361
 			$tmp = explode(':', getDolGlobalString('MAIN_INFO_SOCIETE_COUNTRY'));
4362
-			$country_id =  (is_numeric($tmp[0])) ? (int) $tmp[0] : 0;
4362
+			$country_id = (is_numeric($tmp[0])) ? (int) $tmp[0] : 0;
4363 4363
 			if (!empty($tmp[1])) {   // If $conf->global->MAIN_INFO_SOCIETE_COUNTRY is "id:code:label"
4364 4364
 				$country_code = $tmp[1];
4365 4365
 				$country_label = $tmp[2];
@@ -5233,7 +5233,7 @@  discard block
 block discarded – undo
5233 5233
 		if (method_exists($this, 'getLibStatut')) {
5234 5234
 			$return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';
5235 5235
 		}
5236
-		$return .= '</div>';	// end info-box-content
5236
+		$return .= '</div>'; // end info-box-content
5237 5237
 		$return .= '</div>';
5238 5238
 		$return .= '</div>';
5239 5239
 
@@ -5337,7 +5337,7 @@  discard block
 block discarded – undo
5337 5337
 		global $conf, $langs, $hookmanager, $user, $action;
5338 5338
 
5339 5339
 		$error = 0;
5340
-		$soc_origin = new Societe($this->db);		// The thirdparty that we will delete
5340
+		$soc_origin = new Societe($this->db); // The thirdparty that we will delete
5341 5341
 
5342 5342
 		dol_syslog("mergeCompany merge thirdparty id=".$soc_origin_id." (will be deleted) into the thirdparty id=".$this->id);
5343 5343
 
Please login to merge, or discard this patch.