@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | /** |
94 | 94 | * @var int |
95 | 95 | */ |
96 | - public $type_payment; // TODO Rename into type_payment_id |
|
96 | + public $type_payment; // TODO Rename into type_payment_id |
|
97 | 97 | /** |
98 | 98 | * @var string |
99 | 99 | */ |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 12, 'notnull' => 0, 'visible' => 1), |
165 | 165 | 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => 0, 'position' => 30), |
166 | 166 | 'datep' => array('type' => 'date', 'label' => 'Date', 'enabled' => 1, 'visible' => 0, 'position' => 40, 'comment' => 'Date'), |
167 | - 'datev' => array('type' => 'date', 'label' => 'Date', 'enabled' => 1, 'visible' => 0, 'position' => 50, 'comment' => 'Date'), |
|
167 | + 'datev' => array('type' => 'date', 'label' => 'Date', 'enabled' => 1, 'visible' => 0, 'position' => 50, 'comment' => 'Date'), |
|
168 | 168 | 'fk_user' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Employee', 'enabled' => 1, 'position' => 15, 'notnull' => 1, 'visible' => 1, 'picto' => 'user'), |
169 | 169 | 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 20), |
170 | 170 | 'salary' => array('type' => 'double(24,8)', 'label' => 'salary', 'enabled' => 1, 'visible' => 0, 'position' => 70), |
@@ -330,10 +330,10 @@ discard block |
||
330 | 330 | $this->datesp = $this->db->jdate($obj->datesp); |
331 | 331 | $this->dateep = $this->db->jdate($obj->dateep); |
332 | 332 | $this->note = $obj->note_private; |
333 | - $this->note_private = $obj->note_private; |
|
334 | - $this->note_public = $obj->note_public; |
|
333 | + $this->note_private = $obj->note_private; |
|
334 | + $this->note_public = $obj->note_public; |
|
335 | 335 | $this->paye = $obj->paye; |
336 | - $this->status = $obj->paye; |
|
336 | + $this->status = $obj->paye; |
|
337 | 337 | $this->fk_bank = $obj->fk_bank; |
338 | 338 | $this->fk_user_author = $obj->fk_user_author; |
339 | 339 | $this->fk_user_modif = $obj->fk_user_modif; |
@@ -678,11 +678,11 @@ discard block |
||
678 | 678 | //$this->sumpayed = $obj->amount; |
679 | 679 | //$this->sumpayed_multicurrency = $obj->multicurrency_amount; |
680 | 680 | //return array('alreadypaid'=>(float) $obj->amount, 'alreadypaid_multicurrency'=>(float) $obj->multicurrency_amount); |
681 | - return array(); // Not yet supported |
|
681 | + return array(); // Not yet supported |
|
682 | 682 | } elseif ($multicurrency) { |
683 | 683 | //$this->sumpayed_multicurrency = $obj->multicurrency_amount; |
684 | 684 | //return (float) $obj->multicurrency_amount; |
685 | - return -1; // Not yet supported |
|
685 | + return -1; // Not yet supported |
|
686 | 686 | } else { |
687 | 687 | //$this->sumpayed = $obj->amount; |
688 | 688 | return (float) $obj->amount; |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | { |
110 | 110 | global $db, $conf, $langs; |
111 | 111 | |
112 | - require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; |
|
113 | - require_once DOL_DOCUMENT_ROOT . '/hrm/class/skilldet.class.php'; |
|
112 | + require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php'; |
|
113 | + require_once DOL_DOCUMENT_ROOT.'/hrm/class/skilldet.class.php'; |
|
114 | 114 | |
115 | 115 | // On charge les différentes notes possibles pour la compétence $fk_skill |
116 | 116 | $skilldet = new Skilldet($db); |
@@ -133,29 +133,29 @@ discard block |
||
133 | 133 | continue; |
134 | 134 | } |
135 | 135 | |
136 | - $ret .= '<span title="' . $line->description . '" class="radio_js_bloc_number ' . $inputname . '_' . $line->fk_skill; |
|
136 | + $ret .= '<span title="'.$line->description.'" class="radio_js_bloc_number '.$inputname.'_'.$line->fk_skill; |
|
137 | 137 | $ret .= $line->rankorder == $selected_rank ? ' selected' : ''; |
138 | - $ret .= '">' . $line->rankorder . '</span>'; |
|
138 | + $ret .= '">'.$line->rankorder.'</span>'; |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | if ($mode == 'edit') { |
142 | 142 | $ret .= ' |
143 | - <input type="hidden" id="' . $inputname . '_' . $fk_skill . '" name="' . $inputname . '[' . $fk_skill . ']" value="' . $selected_rank . '"> |
|
143 | + <input type="hidden" id="' . $inputname.'_'.$fk_skill.'" name="'.$inputname.'['.$fk_skill.']" value="'.$selected_rank.'"> |
|
144 | 144 | <script type="text/javascript"> |
145 | 145 | $(document).ready(function(){ |
146 | 146 | $(".radio_js_bloc_number").tooltip(); |
147 | 147 | var error,same; |
148 | - $(".' . $inputname . '_' . $fk_skill . '").on("click",function(){ |
|
148 | + $(".' . $inputname.'_'.$fk_skill.'").on("click",function(){ |
|
149 | 149 | same=false; |
150 | 150 | val = $(this).html(); |
151 | 151 | if($(this).hasClass("selected"))same=true; |
152 | - $(".' . $inputname . '_' . $fk_skill . '").removeClass("selected"); |
|
152 | + $(".' . $inputname.'_'.$fk_skill.'").removeClass("selected"); |
|
153 | 153 | if(same) |
154 | 154 | { |
155 | - $("#' . $inputname . '_' . $fk_skill . '").val(""); |
|
155 | + $("#' . $inputname.'_'.$fk_skill.'").val(""); |
|
156 | 156 | }else { |
157 | 157 | $(this).addClass("selected"); |
158 | - $("#' . $inputname . '_' . $fk_skill . '").val(val); |
|
158 | + $("#' . $inputname.'_'.$fk_skill.'").val(val); |
|
159 | 159 | } |
160 | 160 | }); |
161 | 161 |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $backtopage = GETPOST('backtopage', 'alpha'); |
109 | 109 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
110 | 110 | $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); |
111 | -$confirm = GETPOST('confirm', 'alpha'); |
|
111 | +$confirm = GETPOST('confirm', 'alpha'); |
|
112 | 112 | |
113 | 113 | $dol_openinpopup = ''; |
114 | 114 | if (!empty($backtopagejsfields)) { |
@@ -159,12 +159,12 @@ discard block |
||
159 | 159 | } |
160 | 160 | |
161 | 161 | // Permissions |
162 | -$permissiontoread = $user->hasRight('societe', 'lire'); |
|
163 | -$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
162 | +$permissiontoread = $user->hasRight('societe', 'lire'); |
|
163 | +$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
164 | 164 | $permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0); |
165 | -$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
165 | +$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
166 | 166 | $permissiondellink = $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php |
167 | -$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
167 | +$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
168 | 168 | |
169 | 169 | // Security check |
170 | 170 | $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | |
209 | 209 | if ($action == 'confirm_merge' && $confirm == 'yes' && $permissiontoadd) { |
210 | 210 | $soc_origin_id = GETPOSTINT('soc_origin'); |
211 | - $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
211 | + $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
212 | 212 | |
213 | 213 | if ($soc_origin_id <= 0) { |
214 | 214 | $langs->load('errors'); |
@@ -324,19 +324,19 @@ discard block |
||
324 | 324 | $object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml')); |
325 | 325 | $object->civility_id = GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int |
326 | 326 | // Add non official properties |
327 | - $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
328 | - $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
327 | + $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
328 | + $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
329 | 329 | } else { |
330 | - $object->name = GETPOST('name', 'alphanohtml'); |
|
330 | + $object->name = GETPOST('name', 'alphanohtml'); |
|
331 | 331 | } |
332 | 332 | $object->entity = ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity); |
333 | - $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
333 | + $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
334 | 334 | $object->parent = GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent; |
335 | 335 | $object->address = GETPOST('address', 'alphanohtml'); |
336 | - $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
337 | - $object->town = GETPOST('town', 'alphanohtml'); |
|
338 | - $object->country_id = GETPOSTINT('country_id'); |
|
339 | - $object->state_id = GETPOSTINT('state_id'); |
|
336 | + $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
337 | + $object->town = GETPOST('town', 'alphanohtml'); |
|
338 | + $object->country_id = GETPOSTINT('country_id'); |
|
339 | + $object->state_id = GETPOSTINT('state_id'); |
|
340 | 340 | |
341 | 341 | $object->socialnetworks = array(); |
342 | 342 | if (isModEnabled('socialnetworks')) { |
@@ -348,10 +348,10 @@ discard block |
||
348 | 348 | } |
349 | 349 | |
350 | 350 | $object->phone = GETPOST('phone', 'alpha'); |
351 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
351 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
352 | 352 | $object->fax = GETPOST('fax', 'alpha'); |
353 | 353 | $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); |
354 | - $object->no_email = GETPOSTINT("no_email"); |
|
354 | + $object->no_email = GETPOSTINT("no_email"); |
|
355 | 355 | $object->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); |
356 | 356 | $object->idprof1 = trim(GETPOST('idprof1', 'alphanohtml')); |
357 | 357 | $object->idprof2 = trim(GETPOST('idprof2', 'alphanohtml')); |
@@ -361,13 +361,13 @@ discard block |
||
361 | 361 | $object->idprof6 = trim(GETPOST('idprof6', 'alphanohtml')); |
362 | 362 | $object->prefix_comm = GETPOST('prefix_comm', 'alphanohtml'); |
363 | 363 | $object->code_client = GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha'); |
364 | - $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
364 | + $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
365 | 365 | $object->capital = GETPOSTFLOAT('capital'); |
366 | 366 | $object->barcode = GETPOST('barcode', 'alphanohtml'); |
367 | 367 | |
368 | 368 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
369 | 369 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
370 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
370 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
371 | 371 | $object->status = GETPOSTINT('status'); |
372 | 372 | |
373 | 373 | // Local Taxes |
@@ -377,9 +377,9 @@ discard block |
||
377 | 377 | $object->localtax1_value = GETPOST('lt1', 'alpha'); |
378 | 378 | $object->localtax2_value = GETPOST('lt2', 'alpha'); |
379 | 379 | |
380 | - $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
380 | + $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
381 | 381 | $object->effectif_id = GETPOSTINT('effectif_id'); |
382 | - $object->typent_id = GETPOSTINT('typent_id'); |
|
382 | + $object->typent_id = GETPOSTINT('typent_id'); |
|
383 | 383 | |
384 | 384 | $object->typent_code = dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type |
385 | 385 | |
@@ -388,8 +388,8 @@ discard block |
||
388 | 388 | $prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0); |
389 | 389 | $prospectcustomer = $customer + $prospect; |
390 | 390 | |
391 | - $object->client = $prospectcustomer; |
|
392 | - $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
391 | + $object->client = $prospectcustomer; |
|
392 | + $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
393 | 393 | |
394 | 394 | if ($action == 'add') { |
395 | 395 | // for prospect, customer or supplier |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | } |
410 | 410 | |
411 | 411 | if ($object->fournisseur > 0) { |
412 | - $object->cond_reglement_supplier_id = $paymentTermId; |
|
412 | + $object->cond_reglement_supplier_id = $paymentTermId; |
|
413 | 413 | |
414 | 414 | $filterPaymentTypeIdArr = array(1, 2, 3); // allow payment type for supplier (filter is "DBIT" in "Form::select_types_paiements()" method) |
415 | 415 | if (!empty($form->cache_types_paiements[$paymentTypeId]) && isset($form->cache_types_paiements[$paymentTypeId]['type']) && in_array($form->cache_types_paiements[$paymentTypeId]['type'], $filterPaymentTypeIdArr)) { |
@@ -419,15 +419,15 @@ discard block |
||
419 | 419 | } |
420 | 420 | } |
421 | 421 | |
422 | - $object->commercial_id = GETPOSTINT('commercial_id'); |
|
423 | - $object->default_lang = GETPOST('default_lang'); |
|
422 | + $object->commercial_id = GETPOSTINT('commercial_id'); |
|
423 | + $object->default_lang = GETPOST('default_lang'); |
|
424 | 424 | |
425 | 425 | // Webservices url/key |
426 | 426 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
427 | 427 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
428 | 428 | |
429 | 429 | if (GETPOSTISSET('accountancy_code_sell')) { |
430 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
430 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
431 | 431 | |
432 | 432 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
433 | 433 | $object->accountancy_code_sell = ''; |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | } |
437 | 437 | } |
438 | 438 | if (GETPOSTISSET('accountancy_code_buy')) { |
439 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
439 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
440 | 440 | |
441 | 441 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
442 | 442 | $object->accountancy_code_buy = ''; |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | } else { |
908 | 908 | $db->commit(); |
909 | 909 | $db->close(); |
910 | - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); |
|
910 | + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); |
|
911 | 911 | exit; |
912 | 912 | } |
913 | 913 | } else { |
@@ -1088,21 +1088,21 @@ discard block |
||
1088 | 1088 | } |
1089 | 1089 | |
1090 | 1090 | $object->phone = GETPOST('phone', 'alpha'); |
1091 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
1091 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
1092 | 1092 | $object->fax = GETPOST('fax', 'alpha'); |
1093 | 1093 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
1094 | 1094 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
1095 | - $object->capital = GETPOSTFLOAT('capital'); |
|
1095 | + $object->capital = GETPOSTFLOAT('capital'); |
|
1096 | 1096 | $paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables |
1097 | 1097 | if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) { |
1098 | 1098 | $paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
1099 | 1099 | } |
1100 | - $object->cond_reglement_id = $paymentTermId; |
|
1100 | + $object->cond_reglement_id = $paymentTermId; |
|
1101 | 1101 | $paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables |
1102 | 1102 | if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) { |
1103 | 1103 | $paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
1104 | 1104 | } |
1105 | - $object->mode_reglement_id = $paymentTypeId; |
|
1105 | + $object->mode_reglement_id = $paymentTypeId; |
|
1106 | 1106 | $object->barcode = GETPOST('barcode', 'alphanohtml'); |
1107 | 1107 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
1108 | 1108 | $object->idprof2 = GETPOST('idprof2', 'alphanohtml'); |
@@ -1115,7 +1115,7 @@ discard block |
||
1115 | 1115 | $object->civility_id = GETPOST('civility_id', 'alpha'); |
1116 | 1116 | |
1117 | 1117 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
1118 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
1118 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
1119 | 1119 | $object->status = GETPOSTINT('status'); |
1120 | 1120 | |
1121 | 1121 | //Local Taxes |
@@ -1131,7 +1131,7 @@ discard block |
||
1131 | 1131 | $object->default_lang = GETPOST('default_lang'); |
1132 | 1132 | |
1133 | 1133 | if (GETPOSTISSET('accountancy_code_sell')) { |
1134 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
1134 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
1135 | 1135 | |
1136 | 1136 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
1137 | 1137 | $object->accountancy_code_sell = ''; |
@@ -1140,7 +1140,7 @@ discard block |
||
1140 | 1140 | } |
1141 | 1141 | } |
1142 | 1142 | if (GETPOSTISSET('accountancy_code_buy')) { |
1143 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
1143 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
1144 | 1144 | |
1145 | 1145 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
1146 | 1146 | $object->accountancy_code_buy = ''; |
@@ -1265,7 +1265,7 @@ discard block |
||
1265 | 1265 | |
1266 | 1266 | print '<script type="text/javascript">'; |
1267 | 1267 | print '$(document).ready(function () { |
1268 | - var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . '; |
|
1268 | + var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').'; |
|
1269 | 1269 | |
1270 | 1270 | init_customer_categ(); |
1271 | 1271 | $("#customerprospect").change(function() { |
@@ -1338,7 +1338,7 @@ discard block |
||
1338 | 1338 | print '</td><td'.(!getDolGlobalString('SOCIETE_USEPREFIX') ? ' colspan="3"' : '').'>'; |
1339 | 1339 | |
1340 | 1340 | print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus">'; |
1341 | - print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
1341 | + print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
1342 | 1342 | // This implementation of the feature to search already existing company has been disabled. It must be implemented by keeping the "input text" and we must call the search ajax societe/ajax/ajaxcompanies.php |
1343 | 1343 | // on a keydown of the input. We should show data about a duplicate found if we found less than 5 answers into a div under the input. |
1344 | 1344 | /* |
@@ -1705,7 +1705,7 @@ discard block |
||
1705 | 1705 | print '<td></td>'; |
1706 | 1706 | print '<td></td>'; |
1707 | 1707 | } |
1708 | - print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
1708 | + print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
1709 | 1709 | print '<td class="individualline" '.(($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1).'</td>'; |
1710 | 1710 | print '</tr>'; |
1711 | 1711 | } |
@@ -1753,7 +1753,7 @@ discard block |
||
1753 | 1753 | // Vat is used |
1754 | 1754 | print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>'; |
1755 | 1755 | print '<td>'; |
1756 | - print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . (GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"') . ' value="1">'; // Assujeti par default en creation |
|
1756 | + print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.(GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"').' value="1">'; // Assujeti par default en creation |
|
1757 | 1757 | print '</td>'; |
1758 | 1758 | if ($conf->browser->layout == 'phone') { |
1759 | 1759 | print '</tr><tr>'; |
@@ -1794,7 +1794,7 @@ discard block |
||
1794 | 1794 | |
1795 | 1795 | // VAT reverse charge by default |
1796 | 1796 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
1797 | - print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">'; |
|
1797 | + print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">'; |
|
1798 | 1798 | print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
1799 | 1799 | print '</td></tr>'; |
1800 | 1800 | } |
@@ -1803,21 +1803,21 @@ discard block |
||
1803 | 1803 | //TODO: Place into a function to control showing by country or study better option |
1804 | 1804 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
1805 | 1805 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>'; |
1806 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
1806 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
1807 | 1807 | print '</td>'; |
1808 | 1808 | if ($conf->browser->layout == 'phone') { |
1809 | 1809 | print '</tr><tr>'; |
1810 | 1810 | } |
1811 | 1811 | print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>'; |
1812 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
1812 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
1813 | 1813 | print '</td></tr>'; |
1814 | 1814 | } elseif ($mysoc->localtax1_assuj == "1") { |
1815 | 1815 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
1816 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
1816 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
1817 | 1817 | print '</td></tr>'; |
1818 | 1818 | } elseif ($mysoc->localtax2_assuj == "1") { |
1819 | 1819 | print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
1820 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
1820 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
1821 | 1821 | print '</td></tr>'; |
1822 | 1822 | } |
1823 | 1823 | |
@@ -2084,10 +2084,10 @@ discard block |
||
2084 | 2084 | } |
2085 | 2085 | |
2086 | 2086 | $object->phone = GETPOST('phone', 'alpha'); |
2087 | - $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
2087 | + $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
2088 | 2088 | $object->fax = GETPOST('fax', 'alpha'); |
2089 | 2089 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
2090 | - $object->no_email = GETPOSTINT("no_email"); |
|
2090 | + $object->no_email = GETPOSTINT("no_email"); |
|
2091 | 2091 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
2092 | 2092 | $object->capital = GETPOSTFLOAT('capital'); |
2093 | 2093 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
@@ -2103,16 +2103,16 @@ discard block |
||
2103 | 2103 | $object->default_lang = GETPOST('default_lang', 'alpha'); |
2104 | 2104 | |
2105 | 2105 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
2106 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
2106 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
2107 | 2107 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
2108 | - $object->status = GETPOSTINT('status'); |
|
2108 | + $object->status = GETPOSTINT('status'); |
|
2109 | 2109 | |
2110 | 2110 | // Webservices url/key |
2111 | 2111 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
2112 | 2112 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
2113 | 2113 | |
2114 | 2114 | if (GETPOSTISSET('accountancy_code_sell')) { |
2115 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
2115 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
2116 | 2116 | |
2117 | 2117 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
2118 | 2118 | $object->accountancy_code_sell = ''; |
@@ -2121,7 +2121,7 @@ discard block |
||
2121 | 2121 | } |
2122 | 2122 | } |
2123 | 2123 | if (GETPOSTISSET('accountancy_code_buy')) { |
2124 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
2124 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
2125 | 2125 | |
2126 | 2126 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
2127 | 2127 | $object->accountancy_code_buy = ''; |
@@ -2203,7 +2203,7 @@ discard block |
||
2203 | 2203 | } |
2204 | 2204 | }); |
2205 | 2205 | |
2206 | - var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . '; |
|
2206 | + var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').'; |
|
2207 | 2207 | |
2208 | 2208 | init_customer_categ(); |
2209 | 2209 | $("#customerprospect").change(function() { |
@@ -2576,14 +2576,14 @@ discard block |
||
2576 | 2576 | |
2577 | 2577 | // VAT is used |
2578 | 2578 | print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">'; |
2579 | - print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2579 | + print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2580 | 2580 | print '</td></tr>'; |
2581 | 2581 | |
2582 | 2582 | // Local Taxes |
2583 | 2583 | //TODO: Place into a function to control showing by country or study better option |
2584 | 2584 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
2585 | 2585 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>'; |
2586 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2586 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2587 | 2587 | if (!isOnlyOneLocalTax(1)) { |
2588 | 2588 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2589 | 2589 | $formcompany->select_localtax(1, $object->localtax1_value, "lt1"); |
@@ -2592,7 +2592,7 @@ discard block |
||
2592 | 2592 | print '</td>'; |
2593 | 2593 | print '</tr><tr>'; |
2594 | 2594 | print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>'; |
2595 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>'; |
|
2595 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>'; |
|
2596 | 2596 | if (!isOnlyOneLocalTax(2)) { |
2597 | 2597 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2598 | 2598 | $formcompany->select_localtax(2, $object->localtax2_value, "lt2"); |
@@ -2601,7 +2601,7 @@ discard block |
||
2601 | 2601 | print '</td></tr>'; |
2602 | 2602 | } elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") { |
2603 | 2603 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">'; |
2604 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2604 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2605 | 2605 | if (!isOnlyOneLocalTax(1)) { |
2606 | 2606 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2607 | 2607 | $formcompany->select_localtax(1, $object->localtax1_value, "lt1"); |
@@ -2610,7 +2610,7 @@ discard block |
||
2610 | 2610 | print '</td></tr>'; |
2611 | 2611 | } elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") { |
2612 | 2612 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">'; |
2613 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2613 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2614 | 2614 | if (!isOnlyOneLocalTax(2)) { |
2615 | 2615 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2616 | 2616 | $formcompany->select_localtax(2, $object->localtax2_value, "lt2"); |
@@ -2621,7 +2621,7 @@ discard block |
||
2621 | 2621 | |
2622 | 2622 | // VAT reverse charge by default |
2623 | 2623 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
2624 | - print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">'; |
|
2624 | + print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">'; |
|
2625 | 2625 | print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
2626 | 2626 | print '</td></tr>'; |
2627 | 2627 | } |
@@ -2790,7 +2790,7 @@ discard block |
||
2790 | 2790 | $maxfilesizearray = getMaxFileSizeArray(); |
2791 | 2791 | $maxmin = $maxfilesizearray['maxmin']; |
2792 | 2792 | if ($maxmin > 0) { |
2793 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
2793 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
2794 | 2794 | } |
2795 | 2795 | print '<input type="file" class="flat" name="photo" id="photoinput">'; |
2796 | 2796 | print '</td></tr>'; |
@@ -3021,7 +3021,7 @@ discard block |
||
3021 | 3021 | print '<tr><td>'; |
3022 | 3022 | print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc')); |
3023 | 3023 | print '</td><td>'; |
3024 | - print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>'; |
|
3024 | + print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>'; |
|
3025 | 3025 | print '</td>'; |
3026 | 3026 | print '</tr>'; |
3027 | 3027 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | if (isset($CurrentBlock['continuable'])) |
207 | 207 | { |
208 | - $methodName = 'block' . $CurrentBlock['type'] . 'Continue'; |
|
208 | + $methodName = 'block'.$CurrentBlock['type'].'Continue'; |
|
209 | 209 | $Block = $this->$methodName($Line, $CurrentBlock); |
210 | 210 | |
211 | 211 | if (isset($Block)) |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | { |
219 | 219 | if ($this->isBlockCompletable($CurrentBlock['type'])) |
220 | 220 | { |
221 | - $methodName = 'block' . $CurrentBlock['type'] . 'Complete'; |
|
221 | + $methodName = 'block'.$CurrentBlock['type'].'Complete'; |
|
222 | 222 | $CurrentBlock = $this->$methodName($CurrentBlock); |
223 | 223 | } |
224 | 224 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | { |
237 | 237 | foreach ($this->BlockTypes[$marker] as $blockType) |
238 | 238 | { |
239 | - $blockTypes []= $blockType; |
|
239 | + $blockTypes [] = $blockType; |
|
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | { |
252 | 252 | $Block['type'] = $blockType; |
253 | 253 | |
254 | - if ( ! isset($Block['identified'])) |
|
254 | + if (!isset($Block['identified'])) |
|
255 | 255 | { |
256 | 256 | if (isset($CurrentBlock)) |
257 | 257 | { |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | |
301 | 301 | if (isset($CurrentBlock['continuable']) and $this->isBlockCompletable($CurrentBlock['type'])) |
302 | 302 | { |
303 | - $methodName = 'block' . $CurrentBlock['type'] . 'Complete'; |
|
303 | + $methodName = 'block'.$CurrentBlock['type'].'Complete'; |
|
304 | 304 | $CurrentBlock = $this->$methodName($CurrentBlock); |
305 | 305 | } |
306 | 306 | |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | |
319 | 319 | protected function extractElement(array $Component) |
320 | 320 | { |
321 | - if ( ! isset($Component['element'])) |
|
321 | + if (!isset($Component['element'])) |
|
322 | 322 | { |
323 | 323 | if (isset($Component['markup'])) |
324 | 324 | { |
@@ -335,12 +335,12 @@ discard block |
||
335 | 335 | |
336 | 336 | protected function isBlockContinuable($Type) |
337 | 337 | { |
338 | - return method_exists($this, 'block' . $Type . 'Continue'); |
|
338 | + return method_exists($this, 'block'.$Type.'Continue'); |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | protected function isBlockCompletable($Type) |
342 | 342 | { |
343 | - return method_exists($this, 'block' . $Type . 'Complete'); |
|
343 | + return method_exists($this, 'block'.$Type.'Complete'); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | # |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | |
349 | 349 | protected function blockCode($Line, $Block = null) |
350 | 350 | { |
351 | - if (isset($Block) and $Block['type'] === 'Paragraph' and ! isset($Block['interrupted'])) |
|
351 | + if (isset($Block) and $Block['type'] === 'Paragraph' and !isset($Block['interrupted'])) |
|
352 | 352 | { |
353 | 353 | return; |
354 | 354 | } |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | return; |
433 | 433 | } |
434 | 434 | |
435 | - $Block['element']['rawHtml'] .= "\n" . $Line['body']; |
|
435 | + $Block['element']['rawHtml'] .= "\n".$Line['body']; |
|
436 | 436 | |
437 | 437 | if (strpos($Line['text'], '-->') !== false) |
438 | 438 | { |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | return $Block; |
524 | 524 | } |
525 | 525 | |
526 | - $Block['element']['element']['text'] .= "\n" . $Line['body']; |
|
526 | + $Block['element']['element']['text'] .= "\n".$Line['body']; |
|
527 | 527 | |
528 | 528 | return $Block; |
529 | 529 | } |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | |
557 | 557 | $Block = array( |
558 | 558 | 'element' => array( |
559 | - 'name' => 'h' . $level, |
|
559 | + 'name' => 'h'.$level, |
|
560 | 560 | 'handler' => array( |
561 | 561 | 'function' => 'lineElements', |
562 | 562 | 'argument' => $text, |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | { |
584 | 584 | $contentIndent -= 1; |
585 | 585 | $matches[1] = substr($matches[1], 0, -$contentIndent); |
586 | - $matches[3] = str_repeat(' ', $contentIndent) . $matches[3]; |
|
586 | + $matches[3] = str_repeat(' ', $contentIndent).$matches[3]; |
|
587 | 587 | } |
588 | 588 | elseif ($contentIndent === 0) |
589 | 589 | { |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | if ( |
617 | 617 | isset($CurrentBlock) |
618 | 618 | and $CurrentBlock['type'] === 'Paragraph' |
619 | - and ! isset($CurrentBlock['interrupted']) |
|
619 | + and !isset($CurrentBlock['interrupted']) |
|
620 | 620 | ) { |
621 | 621 | return; |
622 | 622 | } |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | ) |
635 | 635 | ); |
636 | 636 | |
637 | - $Block['element']['elements'] []= & $Block['li']; |
|
637 | + $Block['element']['elements'] [] = & $Block['li']; |
|
638 | 638 | |
639 | 639 | return $Block; |
640 | 640 | } |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | ) { |
663 | 663 | if (isset($Block['interrupted'])) |
664 | 664 | { |
665 | - $Block['li']['handler']['argument'] []= ''; |
|
665 | + $Block['li']['handler']['argument'] [] = ''; |
|
666 | 666 | |
667 | 667 | $Block['loose'] = true; |
668 | 668 | |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | ) |
685 | 685 | ); |
686 | 686 | |
687 | - $Block['element']['elements'] []= & $Block['li']; |
|
687 | + $Block['element']['elements'] [] = & $Block['li']; |
|
688 | 688 | |
689 | 689 | return $Block; |
690 | 690 | } |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | { |
703 | 703 | if (isset($Block['interrupted'])) |
704 | 704 | { |
705 | - $Block['li']['handler']['argument'] []= ''; |
|
705 | + $Block['li']['handler']['argument'] [] = ''; |
|
706 | 706 | |
707 | 707 | $Block['loose'] = true; |
708 | 708 | |
@@ -711,16 +711,16 @@ discard block |
||
711 | 711 | |
712 | 712 | $text = substr($Line['body'], $requiredIndent); |
713 | 713 | |
714 | - $Block['li']['handler']['argument'] []= $text; |
|
714 | + $Block['li']['handler']['argument'] [] = $text; |
|
715 | 715 | |
716 | 716 | return $Block; |
717 | 717 | } |
718 | 718 | |
719 | - if ( ! isset($Block['interrupted'])) |
|
719 | + if (!isset($Block['interrupted'])) |
|
720 | 720 | { |
721 | 721 | $text = preg_replace('/^[ ]{0,'.$requiredIndent.'}+/', '', $Line['body']); |
722 | 722 | |
723 | - $Block['li']['handler']['argument'] []= $text; |
|
723 | + $Block['li']['handler']['argument'] [] = $text; |
|
724 | 724 | |
725 | 725 | return $Block; |
726 | 726 | } |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | { |
735 | 735 | if (end($li['handler']['argument']) !== '') |
736 | 736 | { |
737 | - $li['handler']['argument'] []= ''; |
|
737 | + $li['handler']['argument'] [] = ''; |
|
738 | 738 | } |
739 | 739 | } |
740 | 740 | } |
@@ -773,14 +773,14 @@ discard block |
||
773 | 773 | |
774 | 774 | if ($Line['text'][0] === '>' and preg_match('/^>[ ]?+(.*+)/', $Line['text'], $matches)) |
775 | 775 | { |
776 | - $Block['element']['handler']['argument'] []= $matches[1]; |
|
776 | + $Block['element']['handler']['argument'] [] = $matches[1]; |
|
777 | 777 | |
778 | 778 | return $Block; |
779 | 779 | } |
780 | 780 | |
781 | - if ( ! isset($Block['interrupted'])) |
|
781 | + if (!isset($Block['interrupted'])) |
|
782 | 782 | { |
783 | - $Block['element']['handler']['argument'] []= $Line['text']; |
|
783 | + $Block['element']['handler']['argument'] [] = $Line['text']; |
|
784 | 784 | |
785 | 785 | return $Block; |
786 | 786 | } |
@@ -810,7 +810,7 @@ discard block |
||
810 | 810 | |
811 | 811 | protected function blockSetextHeader($Line, ?array $Block = null) |
812 | 812 | { |
813 | - if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) |
|
813 | + if (!isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) |
|
814 | 814 | { |
815 | 815 | return; |
816 | 816 | } |
@@ -861,7 +861,7 @@ discard block |
||
861 | 861 | return; |
862 | 862 | } |
863 | 863 | |
864 | - $Block['element']['rawHtml'] .= "\n" . $Line['body']; |
|
864 | + $Block['element']['rawHtml'] .= "\n".$Line['body']; |
|
865 | 865 | |
866 | 866 | return $Block; |
867 | 867 | } |
@@ -896,7 +896,7 @@ discard block |
||
896 | 896 | |
897 | 897 | protected function blockTable($Line, ?array $Block = null) |
898 | 898 | { |
899 | - if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) |
|
899 | + if (!isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) |
|
900 | 900 | { |
901 | 901 | return; |
902 | 902 | } |
@@ -945,7 +945,7 @@ discard block |
||
945 | 945 | $alignment = $alignment === 'left' ? 'center' : 'right'; |
946 | 946 | } |
947 | 947 | |
948 | - $alignments []= $alignment; |
|
948 | + $alignments [] = $alignment; |
|
949 | 949 | } |
950 | 950 | |
951 | 951 | # ~ |
@@ -986,7 +986,7 @@ discard block |
||
986 | 986 | ); |
987 | 987 | } |
988 | 988 | |
989 | - $HeaderElements []= $HeaderElement; |
|
989 | + $HeaderElements [] = $HeaderElement; |
|
990 | 990 | } |
991 | 991 | |
992 | 992 | # ~ |
@@ -1000,16 +1000,16 @@ discard block |
||
1000 | 1000 | ), |
1001 | 1001 | ); |
1002 | 1002 | |
1003 | - $Block['element']['elements'] []= array( |
|
1003 | + $Block['element']['elements'] [] = array( |
|
1004 | 1004 | 'name' => 'thead', |
1005 | 1005 | ); |
1006 | 1006 | |
1007 | - $Block['element']['elements'] []= array( |
|
1007 | + $Block['element']['elements'] [] = array( |
|
1008 | 1008 | 'name' => 'tbody', |
1009 | 1009 | 'elements' => array(), |
1010 | 1010 | ); |
1011 | 1011 | |
1012 | - $Block['element']['elements'][0]['elements'] []= array( |
|
1012 | + $Block['element']['elements'][0]['elements'] [] = array( |
|
1013 | 1013 | 'name' => 'tr', |
1014 | 1014 | 'elements' => $HeaderElements, |
1015 | 1015 | ); |
@@ -1053,11 +1053,11 @@ discard block |
||
1053 | 1053 | if (isset($Block['alignments'][$index])) |
1054 | 1054 | { |
1055 | 1055 | $Element['attributes'] = array( |
1056 | - 'style' => 'text-align: ' . $Block['alignments'][$index] . ';', |
|
1056 | + 'style' => 'text-align: '.$Block['alignments'][$index].';', |
|
1057 | 1057 | ); |
1058 | 1058 | } |
1059 | 1059 | |
1060 | - $Elements []= $Element; |
|
1060 | + $Elements [] = $Element; |
|
1061 | 1061 | } |
1062 | 1062 | |
1063 | 1063 | $Element = array( |
@@ -1065,7 +1065,7 @@ discard block |
||
1065 | 1065 | 'elements' => $Elements, |
1066 | 1066 | ); |
1067 | 1067 | |
1068 | - $Block['element']['elements'][1]['elements'] []= $Element; |
|
1068 | + $Block['element']['elements'][1]['elements'] [] = $Element; |
|
1069 | 1069 | |
1070 | 1070 | return $Block; |
1071 | 1071 | } |
@@ -1165,7 +1165,7 @@ discard block |
||
1165 | 1165 | |
1166 | 1166 | $Inline = $this->{"inline$inlineType"}($Excerpt); |
1167 | 1167 | |
1168 | - if ( ! isset($Inline)) |
|
1168 | + if (!isset($Inline)) |
|
1169 | 1169 | { |
1170 | 1170 | continue; |
1171 | 1171 | } |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | |
1180 | 1180 | # sets a default inline position |
1181 | 1181 | |
1182 | - if ( ! isset($Inline['position'])) |
|
1182 | + if (!isset($Inline['position'])) |
|
1183 | 1183 | { |
1184 | 1184 | $Inline['position'] = $markerPosition; |
1185 | 1185 | } |
@@ -1223,7 +1223,7 @@ discard block |
||
1223 | 1223 | |
1224 | 1224 | foreach ($Elements as &$Element) |
1225 | 1225 | { |
1226 | - if ( ! isset($Element['autobreak'])) |
|
1226 | + if (!isset($Element['autobreak'])) |
|
1227 | 1227 | { |
1228 | 1228 | $Element['autobreak'] = false; |
1229 | 1229 | } |
@@ -1279,14 +1279,14 @@ discard block |
||
1279 | 1279 | $hostnameLabel = '[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?'; |
1280 | 1280 | |
1281 | 1281 | $commonMarkEmail = '[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]++@' |
1282 | - . $hostnameLabel . '(?:\.' . $hostnameLabel . ')*'; |
|
1282 | + . $hostnameLabel.'(?:\.'.$hostnameLabel.')*'; |
|
1283 | 1283 | |
1284 | 1284 | if (strpos($Excerpt['text'], '>') !== false |
1285 | 1285 | and preg_match("/^<((mailto:)?$commonMarkEmail)>/i", $Excerpt['text'], $matches) |
1286 | - ){ |
|
1286 | + ) { |
|
1287 | 1287 | $url = $matches[1]; |
1288 | 1288 | |
1289 | - if ( ! isset($matches[2])) |
|
1289 | + if (!isset($matches[2])) |
|
1290 | 1290 | { |
1291 | 1291 | $url = "mailto:$url"; |
1292 | 1292 | } |
@@ -1306,7 +1306,7 @@ discard block |
||
1306 | 1306 | |
1307 | 1307 | protected function inlineEmphasis($Excerpt) |
1308 | 1308 | { |
1309 | - if ( ! isset($Excerpt['text'][1])) |
|
1309 | + if (!isset($Excerpt['text'][1])) |
|
1310 | 1310 | { |
1311 | 1311 | return; |
1312 | 1312 | } |
@@ -1352,12 +1352,12 @@ discard block |
||
1352 | 1352 | |
1353 | 1353 | protected function inlineImage($Excerpt) |
1354 | 1354 | { |
1355 | - if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[') |
|
1355 | + if (!isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[') |
|
1356 | 1356 | { |
1357 | 1357 | return; |
1358 | 1358 | } |
1359 | 1359 | |
1360 | - $Excerpt['text']= substr($Excerpt['text'], 1); |
|
1360 | + $Excerpt['text'] = substr($Excerpt['text'], 1); |
|
1361 | 1361 | |
1362 | 1362 | $Link = $this->inlineLink($Excerpt); |
1363 | 1363 | |
@@ -1443,7 +1443,7 @@ discard block |
||
1443 | 1443 | $definition = strtolower($Element['handler']['argument']); |
1444 | 1444 | } |
1445 | 1445 | |
1446 | - if ( ! isset($this->DefinitionData['Reference'][$definition])) |
|
1446 | + if (!isset($this->DefinitionData['Reference'][$definition])) |
|
1447 | 1447 | { |
1448 | 1448 | return; |
1449 | 1449 | } |
@@ -1498,7 +1498,7 @@ discard block |
||
1498 | 1498 | and preg_match('/^&(#?+[0-9a-zA-Z]++);/', $Excerpt['text'], $matches) |
1499 | 1499 | ) { |
1500 | 1500 | return array( |
1501 | - 'element' => array('rawHtml' => '&' . $matches[1] . ';'), |
|
1501 | + 'element' => array('rawHtml' => '&'.$matches[1].';'), |
|
1502 | 1502 | 'extent' => strlen($matches[0]), |
1503 | 1503 | ); |
1504 | 1504 | } |
@@ -1508,7 +1508,7 @@ discard block |
||
1508 | 1508 | |
1509 | 1509 | protected function inlineStrikethrough($Excerpt) |
1510 | 1510 | { |
1511 | - if ( ! isset($Excerpt['text'][1])) |
|
1511 | + if (!isset($Excerpt['text'][1])) |
|
1512 | 1512 | { |
1513 | 1513 | return; |
1514 | 1514 | } |
@@ -1531,7 +1531,7 @@ discard block |
||
1531 | 1531 | |
1532 | 1532 | protected function inlineUrl($Excerpt) |
1533 | 1533 | { |
1534 | - if ($this->urlsLinked !== true or ! isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') |
|
1534 | + if ($this->urlsLinked !== true or !isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') |
|
1535 | 1535 | { |
1536 | 1536 | return; |
1537 | 1537 | } |
@@ -1702,7 +1702,7 @@ discard block |
||
1702 | 1702 | |
1703 | 1703 | if ($hasName) |
1704 | 1704 | { |
1705 | - $markup .= '<' . $Element['name']; |
|
1705 | + $markup .= '<'.$Element['name']; |
|
1706 | 1706 | |
1707 | 1707 | if (isset($Element['attributes'])) |
1708 | 1708 | { |
@@ -1760,7 +1760,7 @@ discard block |
||
1760 | 1760 | } |
1761 | 1761 | } |
1762 | 1762 | |
1763 | - $markup .= $hasName ? '</' . $Element['name'] . '>' : ''; |
|
1763 | + $markup .= $hasName ? '</'.$Element['name'].'>' : ''; |
|
1764 | 1764 | } |
1765 | 1765 | elseif ($hasName) |
1766 | 1766 | { |
@@ -1789,7 +1789,7 @@ discard block |
||
1789 | 1789 | // (autobreak === false) covers both sides of an element |
1790 | 1790 | $autoBreak = !$autoBreak ? $autoBreak : $autoBreakNext; |
1791 | 1791 | |
1792 | - $markup .= ($autoBreak ? "\n" : '') . $this->element($Element); |
|
1792 | + $markup .= ($autoBreak ? "\n" : '').$this->element($Element); |
|
1793 | 1793 | $autoBreak = $autoBreakNext; |
1794 | 1794 | } |
1795 | 1795 | |
@@ -1804,7 +1804,7 @@ discard block |
||
1804 | 1804 | { |
1805 | 1805 | $Elements = $this->linesElements($lines); |
1806 | 1806 | |
1807 | - if ( ! in_array('', $lines) |
|
1807 | + if (!in_array('', $lines) |
|
1808 | 1808 | and isset($Elements[0]) and isset($Elements[0]['name']) |
1809 | 1809 | and $Elements[0]['name'] === 'p' |
1810 | 1810 | ) { |
@@ -1861,12 +1861,12 @@ discard block |
||
1861 | 1861 | protected function sanitiseElement(array $Element) |
1862 | 1862 | { |
1863 | 1863 | static $goodAttribute = '/^[a-zA-Z0-9][a-zA-Z0-9-_]*+$/'; |
1864 | - static $safeUrlNameToAtt = array( |
|
1864 | + static $safeUrlNameToAtt = array( |
|
1865 | 1865 | 'a' => 'href', |
1866 | 1866 | 'img' => 'src', |
1867 | 1867 | ); |
1868 | 1868 | |
1869 | - if ( ! isset($Element['name'])) |
|
1869 | + if (!isset($Element['name'])) |
|
1870 | 1870 | { |
1871 | 1871 | unset($Element['attributes']); |
1872 | 1872 | return $Element; |
@@ -1877,12 +1877,12 @@ discard block |
||
1877 | 1877 | $Element = $this->filterUnsafeUrlInAttribute($Element, $safeUrlNameToAtt[$Element['name']]); |
1878 | 1878 | } |
1879 | 1879 | |
1880 | - if ( ! empty($Element['attributes'])) |
|
1880 | + if (!empty($Element['attributes'])) |
|
1881 | 1881 | { |
1882 | 1882 | foreach ($Element['attributes'] as $att => $val) |
1883 | 1883 | { |
1884 | 1884 | # filter out badly parsed attribute |
1885 | - if ( ! preg_match($goodAttribute, $att)) |
|
1885 | + if (!preg_match($goodAttribute, $att)) |
|
1886 | 1886 | { |
1887 | 1887 | unset($Element['attributes'][$att]); |
1888 | 1888 | } |
@@ -1983,8 +1983,8 @@ discard block |
||
1983 | 1983 | protected $textLevelElements = array( |
1984 | 1984 | 'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont', |
1985 | 1985 | 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing', |
1986 | - 'i', 'rp', 'del', 'code', 'strike', 'marquee', |
|
1987 | - 'q', 'rt', 'ins', 'font', 'strong', |
|
1986 | + 'i', 'rp', 'del', 'code', 'strike', 'marquee', |
|
1987 | + 'q', 'rt', 'ins', 'font', 'strong', |
|
1988 | 1988 | 's', 'tt', 'kbd', 'mark', |
1989 | 1989 | 'u', 'xm', 'sub', 'nobr', |
1990 | 1990 | 'sup', 'ruby', |
@@ -213,8 +213,7 @@ discard block |
||
213 | 213 | $CurrentBlock = $Block; |
214 | 214 | |
215 | 215 | continue; |
216 | - } |
|
217 | - else |
|
216 | + } else |
|
218 | 217 | { |
219 | 218 | if ($this->isBlockCompletable($CurrentBlock['type'])) |
220 | 219 | { |
@@ -282,8 +281,7 @@ discard block |
||
282 | 281 | if (isset($Block)) |
283 | 282 | { |
284 | 283 | $CurrentBlock = $Block; |
285 | - } |
|
286 | - else |
|
284 | + } else |
|
287 | 285 | { |
288 | 286 | if (isset($CurrentBlock)) |
289 | 287 | { |
@@ -323,8 +321,7 @@ discard block |
||
323 | 321 | if (isset($Component['markup'])) |
324 | 322 | { |
325 | 323 | $Component['element'] = array('rawHtml' => $Component['markup']); |
326 | - } |
|
327 | - elseif (isset($Component['hidden'])) |
|
324 | + } elseif (isset($Component['hidden'])) |
|
328 | 325 | { |
329 | 326 | $Component['element'] = array(); |
330 | 327 | } |
@@ -584,8 +581,7 @@ discard block |
||
584 | 581 | $contentIndent -= 1; |
585 | 582 | $matches[1] = substr($matches[1], 0, -$contentIndent); |
586 | 583 | $matches[3] = str_repeat(' ', $contentIndent) . $matches[3]; |
587 | - } |
|
588 | - elseif ($contentIndent === 0) |
|
584 | + } elseif ($contentIndent === 0) |
|
589 | 585 | { |
590 | 586 | $matches[1] .= ' '; |
591 | 587 | } |
@@ -687,8 +683,7 @@ discard block |
||
687 | 683 | $Block['element']['elements'] []= & $Block['li']; |
688 | 684 | |
689 | 685 | return $Block; |
690 | - } |
|
691 | - elseif ($Line['indent'] < $requiredIndent and $this->blockList($Line)) |
|
686 | + } elseif ($Line['indent'] < $requiredIndent and $this->blockList($Line)) |
|
692 | 687 | { |
693 | 688 | return null; |
694 | 689 | } |
@@ -1316,12 +1311,10 @@ discard block |
||
1316 | 1311 | if ($Excerpt['text'][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt['text'], $matches)) |
1317 | 1312 | { |
1318 | 1313 | $emphasis = 'strong'; |
1319 | - } |
|
1320 | - elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches)) |
|
1314 | + } elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches)) |
|
1321 | 1315 | { |
1322 | 1316 | $emphasis = 'em'; |
1323 | - } |
|
1324 | - else |
|
1317 | + } else |
|
1325 | 1318 | { |
1326 | 1319 | return; |
1327 | 1320 | } |
@@ -1412,8 +1405,7 @@ discard block |
||
1412 | 1405 | $extent += strlen($matches[0]); |
1413 | 1406 | |
1414 | 1407 | $remainder = substr($remainder, $extent); |
1415 | - } |
|
1416 | - else |
|
1408 | + } else |
|
1417 | 1409 | { |
1418 | 1410 | return; |
1419 | 1411 | } |
@@ -1428,8 +1420,7 @@ discard block |
||
1428 | 1420 | } |
1429 | 1421 | |
1430 | 1422 | $extent += strlen($matches[0]); |
1431 | - } |
|
1432 | - else |
|
1423 | + } else |
|
1433 | 1424 | { |
1434 | 1425 | if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches)) |
1435 | 1426 | { |
@@ -1437,8 +1428,7 @@ discard block |
||
1437 | 1428 | $definition = strtolower($definition); |
1438 | 1429 | |
1439 | 1430 | $extent += strlen($matches[0]); |
1440 | - } |
|
1441 | - else |
|
1431 | + } else |
|
1442 | 1432 | { |
1443 | 1433 | $definition = strtolower($Element['handler']['argument']); |
1444 | 1434 | } |
@@ -1603,8 +1593,7 @@ discard block |
||
1603 | 1593 | $argument = $Element['text']; |
1604 | 1594 | unset($Element['text']); |
1605 | 1595 | $destination = 'rawHtml'; |
1606 | - } |
|
1607 | - else |
|
1596 | + } else |
|
1608 | 1597 | { |
1609 | 1598 | $function = $Element['handler']['function']; |
1610 | 1599 | $argument = $Element['handler']['argument']; |
@@ -1641,8 +1630,7 @@ discard block |
||
1641 | 1630 | if (isset($Element['elements'])) |
1642 | 1631 | { |
1643 | 1632 | $Element['elements'] = $this->elementsApplyRecursive($closure, $Element['elements']); |
1644 | - } |
|
1645 | - elseif (isset($Element['element'])) |
|
1633 | + } elseif (isset($Element['element'])) |
|
1646 | 1634 | { |
1647 | 1635 | $Element['element'] = $this->elementApplyRecursive($closure, $Element['element']); |
1648 | 1636 | } |
@@ -1655,8 +1643,7 @@ discard block |
||
1655 | 1643 | if (isset($Element['elements'])) |
1656 | 1644 | { |
1657 | 1645 | $Element['elements'] = $this->elementsApplyRecursiveDepthFirst($closure, $Element['elements']); |
1658 | - } |
|
1659 | - elseif (isset($Element['element'])) |
|
1646 | + } elseif (isset($Element['element'])) |
|
1660 | 1647 | { |
1661 | 1648 | $Element['element'] = $this->elementsApplyRecursiveDepthFirst($closure, $Element['element']); |
1662 | 1649 | } |
@@ -1743,26 +1730,22 @@ discard block |
||
1743 | 1730 | if (isset($Element['elements'])) |
1744 | 1731 | { |
1745 | 1732 | $markup .= $this->elements($Element['elements']); |
1746 | - } |
|
1747 | - elseif (isset($Element['element'])) |
|
1733 | + } elseif (isset($Element['element'])) |
|
1748 | 1734 | { |
1749 | 1735 | $markup .= $this->element($Element['element']); |
1750 | - } |
|
1751 | - else |
|
1736 | + } else |
|
1752 | 1737 | { |
1753 | 1738 | if (!$permitRawHtml) |
1754 | 1739 | { |
1755 | 1740 | $markup .= self::escape($text, true); |
1756 | - } |
|
1757 | - else |
|
1741 | + } else |
|
1758 | 1742 | { |
1759 | 1743 | $markup .= $text; |
1760 | 1744 | } |
1761 | 1745 | } |
1762 | 1746 | |
1763 | 1747 | $markup .= $hasName ? '</' . $Element['name'] . '>' : ''; |
1764 | - } |
|
1765 | - elseif ($hasName) |
|
1748 | + } elseif ($hasName) |
|
1766 | 1749 | { |
1767 | 1750 | $markup .= ' />'; |
1768 | 1751 | } |
@@ -1928,8 +1911,7 @@ discard block |
||
1928 | 1911 | if ($len > strlen($string)) |
1929 | 1912 | { |
1930 | 1913 | return false; |
1931 | - } |
|
1932 | - else |
|
1914 | + } else |
|
1933 | 1915 | { |
1934 | 1916 | return strtolower(substr($string, 0, $len)) === strtolower($needle); |
1935 | 1917 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | $object->fields = dol_sort_array($object->fields, 'position'); |
144 | 144 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
145 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
145 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
146 | 146 | |
147 | 147 | $permissiontoread = $user->hasRight('variants', 'read'); |
148 | 148 | $permissiontoadd = $user->hasRight('variants', 'write'); |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | } |
325 | 325 | // Add where from hooks |
326 | 326 | $parameters = array(); |
327 | -$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
|
327 | +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
|
328 | 328 | $sql .= $hookmanager->resPrint; |
329 | 329 | $sql = preg_replace("/,\s*$/", "", $sql); |
330 | 330 | |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { |
392 | 392 | $obj = $db->fetch_object($resql); |
393 | 393 | $id = $obj->rowid; |
394 | - header("Location: " . dol_buildpath('/variants/card.php', 2) . '?id='.((int) $id)); |
|
394 | + header("Location: ".dol_buildpath('/variants/card.php', 2).'?id='.((int) $id)); |
|
395 | 395 | exit; |
396 | 396 | } |
397 | 397 | |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | } |
518 | 518 | |
519 | 519 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
520 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
520 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
521 | 521 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
522 | 522 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
523 | 523 | |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
623 | 623 | $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
624 | 624 | } |
625 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
625 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
626 | 626 | if (!empty($arrayfields['t.'.$key]['checked'])) { |
627 | 627 | print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, '', $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; |
628 | 628 | $totalarray['nbfield']++; |
@@ -726,23 +726,23 @@ discard block |
||
726 | 726 | foreach ($object->fields as $key => $val) { |
727 | 727 | $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); |
728 | 728 | if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { |
729 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
729 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
730 | 730 | } elseif ($key == 'status') { |
731 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
731 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
732 | 732 | } |
733 | 733 | |
734 | 734 | if (in_array($val['type'], array('timestamp'))) { |
735 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowraponall'; |
|
735 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall'; |
|
736 | 736 | } elseif ($key == 'ref') { |
737 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowraponall'; |
|
737 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall'; |
|
738 | 738 | } |
739 | 739 | |
740 | 740 | if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && empty($val['arrayofkeyval'])) { |
741 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
|
741 | + $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
|
742 | 742 | } |
743 | 743 | //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; |
744 | 744 | |
745 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
745 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
746 | 746 | print '<td'.($cssforfield ? ' class="'.$cssforfield.((preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) ? ' classfortooltip' : '').'"' : ''); |
747 | 747 | if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) { |
748 | 748 | print ' title="'.dol_escape_htmltag($object->$key).'"'; |
@@ -761,15 +761,15 @@ discard block |
||
761 | 761 | } |
762 | 762 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
763 | 763 | if (!$i) { |
764 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
764 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
765 | 765 | } |
766 | 766 | if (!isset($totalarray['val'])) { |
767 | 767 | $totalarray['val'] = array(); |
768 | 768 | } |
769 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
770 | - $totalarray['val']['t.' . $key] = 0; |
|
769 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
770 | + $totalarray['val']['t.'.$key] = 0; |
|
771 | 771 | } |
772 | - $totalarray['val']['t.' . $key] += $object->$key; |
|
772 | + $totalarray['val']['t.'.$key] += $object->$key; |
|
773 | 773 | } |
774 | 774 | } |
775 | 775 | } |
@@ -816,17 +816,17 @@ discard block |
||
816 | 816 | // Move |
817 | 817 | print '<td class="center linecolmove tdlineupdown">'; |
818 | 818 | if ($i > 0) { |
819 | - print '<a class="lineupdown" href="' . $_SERVER['PHP_SELF'] . '?action=up&rowid=' . $obj->rowid . '">' . img_up('default', 0, 'imgupforline') . '</a>'; |
|
819 | + print '<a class="lineupdown" href="'.$_SERVER['PHP_SELF'].'?action=up&rowid='.$obj->rowid.'">'.img_up('default', 0, 'imgupforline').'</a>'; |
|
820 | 820 | } |
821 | 821 | if ($i < $num - 1) { |
822 | - print '<a class="lineupdown" href="' . $_SERVER['PHP_SELF'] . '?action=down&rowid=' . $obj->rowid . '">' . img_down('default', 0, 'imgdownforline') . '</a>'; |
|
822 | + print '<a class="lineupdown" href="'.$_SERVER['PHP_SELF'].'?action=down&rowid='.$obj->rowid.'">'.img_down('default', 0, 'imgdownforline').'</a>'; |
|
823 | 823 | } |
824 | 824 | print '</td>'; |
825 | 825 | if (!$i) { |
826 | 826 | $totalarray['nbfield']++; |
827 | 827 | } |
828 | 828 | |
829 | - print '</tr>' . "\n"; |
|
829 | + print '</tr>'."\n"; |
|
830 | 830 | } |
831 | 831 | |
832 | 832 | $i++; |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | $colspan++; |
844 | 844 | } |
845 | 845 | } |
846 | - $colspan++; // For the move column |
|
846 | + $colspan++; // For the move column |
|
847 | 847 | print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
848 | 848 | } |
849 | 849 |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; |
104 | 104 | if ($cancel) { |
105 | 105 | if (!empty($backtopage)) { |
106 | - header("Location: " . $backtopage); |
|
106 | + header("Location: ".$backtopage); |
|
107 | 107 | exit; |
108 | 108 | } |
109 | 109 | $action = ''; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $result = $object->addLine($line_ref, $line_value); |
133 | 133 | if ($result > 0) { |
134 | 134 | setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); |
135 | - header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $object->id); |
|
135 | + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$object->id); |
|
136 | 136 | exit(); |
137 | 137 | } else { |
138 | 138 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $result = $object->updateLine($lineid, $line_ref, $line_value); |
146 | 146 | if ($result > 0) { |
147 | 147 | setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); |
148 | - header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $object->id); |
|
148 | + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$object->id); |
|
149 | 149 | exit(); |
150 | 150 | } else { |
151 | 151 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -165,36 +165,36 @@ discard block |
||
165 | 165 | |
166 | 166 | // Part to create |
167 | 167 | if ($action == 'create') { |
168 | - print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ProductAttribute")), '', 'object_' . $object->picto); |
|
168 | + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ProductAttribute")), '', 'object_'.$object->picto); |
|
169 | 169 | |
170 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
171 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
170 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
171 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
172 | 172 | print '<input type="hidden" name="action" value="add">'; |
173 | 173 | if ($backtopage) { |
174 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
174 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
175 | 175 | } |
176 | 176 | if ($backtopageforcancel) { |
177 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
177 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | print dol_get_fiche_head(array(), ''); |
181 | 181 | |
182 | - print '<table class="border centpercent tableforfieldcreate">' . "\n"; |
|
182 | + print '<table class="border centpercent tableforfieldcreate">'."\n"; |
|
183 | 183 | |
184 | 184 | // Common attributes |
185 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; |
|
185 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; |
|
186 | 186 | |
187 | 187 | // Other attributes |
188 | 188 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
189 | 189 | |
190 | - print '</table>' . "\n"; |
|
190 | + print '</table>'."\n"; |
|
191 | 191 | |
192 | 192 | print dol_get_fiche_end(); |
193 | 193 | |
194 | 194 | print '<div class="center">'; |
195 | - print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">'; |
|
195 | + print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">'; |
|
196 | 196 | print ' '; |
197 | - print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="history.go(-1)"') . '>'; // Cancel for create does not post form if we don't know the backtopage |
|
197 | + print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage |
|
198 | 198 | print '</div>'; |
199 | 199 | |
200 | 200 | print '</form>'; |
@@ -202,25 +202,25 @@ discard block |
||
202 | 202 | dol_set_focus('input[name="ref"]'); |
203 | 203 | } elseif (($id || $ref) && $action == 'edit') { |
204 | 204 | // Part to edit record |
205 | - print load_fiche_titre($langs->trans("ProductAttribute"), '', 'object_' . $object->picto); |
|
205 | + print load_fiche_titre($langs->trans("ProductAttribute"), '', 'object_'.$object->picto); |
|
206 | 206 | |
207 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
208 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
207 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
208 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
209 | 209 | print '<input type="hidden" name="action" value="update">'; |
210 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
210 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
211 | 211 | if ($backtopage) { |
212 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
212 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
213 | 213 | } |
214 | 214 | if ($backtopageforcancel) { |
215 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
215 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | print dol_get_fiche_head(); |
219 | 219 | |
220 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
220 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
221 | 221 | |
222 | 222 | // Common attributes |
223 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
223 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
224 | 224 | |
225 | 225 | // Other attributes |
226 | 226 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | |
233 | 233 | print dol_get_fiche_end(); |
234 | 234 | |
235 | - print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">'; |
|
236 | - print ' <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
235 | + print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">'; |
|
236 | + print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
237 | 237 | print '</div>'; |
238 | 238 | |
239 | 239 | print '</form>'; |
@@ -248,12 +248,12 @@ discard block |
||
248 | 248 | |
249 | 249 | // Confirmation to delete |
250 | 250 | if ($action == 'delete') { |
251 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyObject'), $langs->trans('ProductAttributeDeleteDialog'), 'confirm_delete', '', 0, 1); |
|
251 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteMyObject'), $langs->trans('ProductAttributeDeleteDialog'), 'confirm_delete', '', 0, 1); |
|
252 | 252 | } elseif ($action == 'ask_deleteline') { |
253 | 253 | // Confirmation to delete line |
254 | 254 | $object_value = new ProductAttributeValue($db); |
255 | 255 | if ($object_value->fetch($lineid) > 0) { |
256 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ProductAttributeValueDeleteDialog', dol_htmlentities($object_value->value), dol_htmlentities($object_value->ref)), 'confirm_deleteline', '', 0, 1); |
|
256 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ProductAttributeValueDeleteDialog', dol_htmlentities($object_value->value), dol_htmlentities($object_value->ref)), 'confirm_deleteline', '', 0, 1); |
|
257 | 257 | } |
258 | 258 | } |
259 | 259 | |
@@ -271,18 +271,18 @@ discard block |
||
271 | 271 | |
272 | 272 | // Object card |
273 | 273 | // ------------------------------------------------------------ |
274 | - $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT . '/variants/list.php?leftmenu=?restore_lastsearch_values=1'); |
|
275 | - $linkback = '<a href="' . dol_sanitizeUrl($backtolist) . '">' . $langs->trans("BackToList") . '</a>'; |
|
274 | + $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/variants/list.php?leftmenu=?restore_lastsearch_values=1'); |
|
275 | + $linkback = '<a href="'.dol_sanitizeUrl($backtolist).'">'.$langs->trans("BackToList").'</a>'; |
|
276 | 276 | |
277 | 277 | dol_banner_tab($object, 'id', $linkback); |
278 | 278 | |
279 | 279 | print '<div class="fichecenter">'; |
280 | 280 | print '<div class="fichehalfleft">'; |
281 | 281 | print '<div class="underbanner clearboth"></div>'; |
282 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
282 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
283 | 283 | |
284 | 284 | // Common attributes |
285 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
285 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
286 | 286 | |
287 | 287 | // Other attributes |
288 | 288 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
@@ -297,21 +297,21 @@ discard block |
||
297 | 297 | |
298 | 298 | // Buttons for actions |
299 | 299 | if ($action != 'editline') { |
300 | - print '<div class="tabsAction">' . "\n"; |
|
300 | + print '<div class="tabsAction">'."\n"; |
|
301 | 301 | $parameters = array(); |
302 | - $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
|
302 | + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
|
303 | 303 | if ($reshook < 0) { |
304 | 304 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
305 | 305 | } |
306 | 306 | |
307 | 307 | if (empty($reshook)) { |
308 | 308 | // Modify |
309 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit', '', $permissiontoedit); |
|
309 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit', '', $permissiontoedit); |
|
310 | 310 | |
311 | 311 | // Delete (need delete permission, or if draft, just need create/modify permission) |
312 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete', '', $permissiontodelete); |
|
312 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete', '', $permissiontodelete); |
|
313 | 313 | } |
314 | - print '</div>' . "\n"; |
|
314 | + print '</div>'."\n"; |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | /* |
@@ -321,24 +321,24 @@ discard block |
||
321 | 321 | // Show object lines |
322 | 322 | $result = $object->getLinesArray(); |
323 | 323 | |
324 | - print load_fiche_titre($langs->trans("PossibleValues") . (!empty($object->lines) ? '<span class="opacitymedium colorblack paddingleft">(' . count($object->lines) . ')</span>' : '')); |
|
324 | + print load_fiche_titre($langs->trans("PossibleValues").(!empty($object->lines) ? '<span class="opacitymedium colorblack paddingleft">('.count($object->lines).')</span>' : '')); |
|
325 | 325 | |
326 | - print '<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '#line_' . GETPOSTINT('lineid')) . '" method="POST"> |
|
327 | - <input type="hidden" name="token" value="' . newToken() . '"> |
|
328 | - <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> |
|
326 | + print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOSTINT('lineid')).'" method="POST"> |
|
327 | + <input type="hidden" name="token" value="' . newToken().'"> |
|
328 | + <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'"> |
|
329 | 329 | <input type="hidden" name="mode" value=""> |
330 | 330 | <input type="hidden" name="page_y" value=""> |
331 | - <input type="hidden" name="id" value="' . $object->id . '"> |
|
331 | + <input type="hidden" name="id" value="' . $object->id.'"> |
|
332 | 332 | '; |
333 | 333 | if ($backtopage) { |
334 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
334 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
335 | 335 | } |
336 | 336 | if ($backtopageforcancel) { |
337 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
337 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | if (!empty($conf->use_javascript_ajax)) { |
341 | - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; |
|
341 | + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | print '<div class="div-table-responsive-no-min">'; |
@@ -183,32 +183,32 @@ discard block |
||
183 | 183 | $this->position = $positionmax + 1; |
184 | 184 | } |
185 | 185 | if ($error) { |
186 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
186 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
187 | 187 | return -1; |
188 | 188 | } |
189 | 189 | |
190 | 190 | $this->db->begin(); |
191 | 191 | |
192 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . $this->table_element . " ("; |
|
192 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element." ("; |
|
193 | 193 | $sql .= " fk_product_attribute, ref, value, entity, position"; |
194 | 194 | $sql .= ")"; |
195 | 195 | $sql .= " VALUES ("; |
196 | - $sql .= " " . ((int) $this->fk_product_attribute); |
|
197 | - $sql .= ", '" . $this->db->escape($this->ref) . "'"; |
|
198 | - $sql .= ", '" . $this->db->escape($this->value) . "'"; |
|
199 | - $sql .= ", " . ((int) $this->entity); |
|
200 | - $sql .= ", " . ((int) $this->position); |
|
196 | + $sql .= " ".((int) $this->fk_product_attribute); |
|
197 | + $sql .= ", '".$this->db->escape($this->ref)."'"; |
|
198 | + $sql .= ", '".$this->db->escape($this->value)."'"; |
|
199 | + $sql .= ", ".((int) $this->entity); |
|
200 | + $sql .= ", ".((int) $this->position); |
|
201 | 201 | $sql .= ")"; |
202 | 202 | |
203 | 203 | dol_syslog(__METHOD__, LOG_DEBUG); |
204 | 204 | $resql = $this->db->query($sql); |
205 | 205 | if (!$resql) { |
206 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
206 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
207 | 207 | $error++; |
208 | 208 | } |
209 | 209 | |
210 | 210 | if (!$error) { |
211 | - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); |
|
211 | + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element); |
|
212 | 212 | $result = $this->insertExtraFields(); |
213 | 213 | if ($result < 0) { |
214 | 214 | $error++; |
@@ -253,20 +253,20 @@ discard block |
||
253 | 253 | $error++; |
254 | 254 | } |
255 | 255 | if ($error) { |
256 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
256 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
257 | 257 | return -1; |
258 | 258 | } |
259 | 259 | |
260 | 260 | $sql = "SELECT rowid, fk_product_attribute, ref, value"; |
261 | - $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element; |
|
262 | - $sql .= " WHERE rowid = " . ((int) $id); |
|
263 | - $sql .= " AND entity IN (" . getEntity('product') . ")"; |
|
261 | + $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; |
|
262 | + $sql .= " WHERE rowid = ".((int) $id); |
|
263 | + $sql .= " AND entity IN (".getEntity('product').")"; |
|
264 | 264 | |
265 | 265 | dol_syslog(__METHOD__, LOG_DEBUG); |
266 | 266 | $resql = $this->db->query($sql); |
267 | 267 | if (!$resql) { |
268 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
269 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
268 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
269 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
270 | 270 | return -1; |
271 | 271 | } |
272 | 272 | |
@@ -303,15 +303,15 @@ discard block |
||
303 | 303 | $sql .= "DISTINCT "; |
304 | 304 | } |
305 | 305 | |
306 | - $sql .= "v.fk_product_attribute, v.rowid, v.ref, v.value FROM " . MAIN_DB_PREFIX . "product_attribute_value v "; |
|
306 | + $sql .= "v.fk_product_attribute, v.rowid, v.ref, v.value FROM ".MAIN_DB_PREFIX."product_attribute_value v "; |
|
307 | 307 | |
308 | 308 | if ($only_used) { |
309 | - $sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product_attribute_combination2val c2v ON c2v.fk_prod_attr_val = v.rowid "; |
|
310 | - $sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product_attribute_combination c ON c.rowid = c2v.fk_prod_combination "; |
|
311 | - $sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product p ON p.rowid = c.fk_product_child "; |
|
309 | + $sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination2val c2v ON c2v.fk_prod_attr_val = v.rowid "; |
|
310 | + $sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination c ON c.rowid = c2v.fk_prod_combination "; |
|
311 | + $sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = c.fk_product_child "; |
|
312 | 312 | } |
313 | 313 | |
314 | - $sql .= "WHERE v.fk_product_attribute = " . ((int) $prodattr_id); |
|
314 | + $sql .= "WHERE v.fk_product_attribute = ".((int) $prodattr_id); |
|
315 | 315 | |
316 | 316 | if ($only_used) { |
317 | 317 | $sql .= " AND c2v.rowid IS NOT NULL AND p.tosell = 1"; |
@@ -370,25 +370,25 @@ discard block |
||
370 | 370 | $error++; |
371 | 371 | } |
372 | 372 | if ($error) { |
373 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
373 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
374 | 374 | return -1; |
375 | 375 | } |
376 | 376 | |
377 | 377 | $this->db->begin(); |
378 | 378 | |
379 | - $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . " SET"; |
|
379 | + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; |
|
380 | 380 | |
381 | - $sql .= " fk_product_attribute = " . ((int) $this->fk_product_attribute); |
|
382 | - $sql .= ", ref = '" . $this->db->escape($this->ref) . "'"; |
|
383 | - $sql .= ", value = '" . $this->db->escape($this->value) . "'"; |
|
384 | - $sql .= ", position = " . ((int) $this->position); |
|
381 | + $sql .= " fk_product_attribute = ".((int) $this->fk_product_attribute); |
|
382 | + $sql .= ", ref = '".$this->db->escape($this->ref)."'"; |
|
383 | + $sql .= ", value = '".$this->db->escape($this->value)."'"; |
|
384 | + $sql .= ", position = ".((int) $this->position); |
|
385 | 385 | |
386 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
386 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
387 | 387 | |
388 | 388 | dol_syslog(__METHOD__, LOG_DEBUG); |
389 | 389 | $resql = $this->db->query($sql); |
390 | 390 | if (!$resql) { |
391 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
391 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
392 | 392 | $error++; |
393 | 393 | } |
394 | 394 | |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | $error++; |
432 | 432 | } |
433 | 433 | if ($error) { |
434 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
434 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
435 | 435 | return -1; |
436 | 436 | } |
437 | 437 | |
@@ -455,12 +455,12 @@ discard block |
||
455 | 455 | } |
456 | 456 | |
457 | 457 | if (!$error) { |
458 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . $this->table_element . " WHERE rowid = " . ((int) $this->id); |
|
458 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".((int) $this->id); |
|
459 | 459 | |
460 | 460 | dol_syslog(__METHOD__, LOG_DEBUG); |
461 | 461 | $resql = $this->db->query($sql); |
462 | 462 | if (!$resql) { |
463 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
463 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
464 | 464 | $error++; |
465 | 465 | } |
466 | 466 | } |
@@ -488,8 +488,8 @@ discard block |
||
488 | 488 | public function getMaxAttributesValuesPosition($fk_product_attribute) |
489 | 489 | { |
490 | 490 | // Search the last position of attributes |
491 | - $sql = "SELECT max(position) FROM " . MAIN_DB_PREFIX . $this->table_element; |
|
492 | - $sql .= " WHERE entity IN (" . getEntity('product') . ")"; |
|
491 | + $sql = "SELECT max(position) FROM ".MAIN_DB_PREFIX.$this->table_element; |
|
492 | + $sql .= " WHERE entity IN (".getEntity('product').")"; |
|
493 | 493 | $sql .= ' AND fk_product_attribute='.(int) $fk_product_attribute; |
494 | 494 | dol_syslog(__METHOD__, LOG_DEBUG); |
495 | 495 | $resql = $this->db->query($sql); |
@@ -519,16 +519,16 @@ discard block |
||
519 | 519 | $error++; |
520 | 520 | } |
521 | 521 | if ($error) { |
522 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
522 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
523 | 523 | return -1; |
524 | 524 | } |
525 | 525 | |
526 | - $sql = "SELECT COUNT(*) AS nb FROM " . MAIN_DB_PREFIX . "product_attribute_combination2val WHERE fk_prod_attr_val = " . ((int) $this->id); |
|
526 | + $sql = "SELECT COUNT(*) AS nb FROM ".MAIN_DB_PREFIX."product_attribute_combination2val WHERE fk_prod_attr_val = ".((int) $this->id); |
|
527 | 527 | |
528 | 528 | dol_syslog(__METHOD__, LOG_DEBUG); |
529 | 529 | $resql = $this->db->query($sql); |
530 | 530 | if (!$resql) { |
531 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
531 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
532 | 532 | return -1; |
533 | 533 | } |
534 | 534 |
@@ -229,32 +229,32 @@ discard block |
||
229 | 229 | $error++; |
230 | 230 | } |
231 | 231 | if ($error) { |
232 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
232 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
233 | 233 | return -1; |
234 | 234 | } |
235 | 235 | |
236 | 236 | $this->db->begin(); |
237 | 237 | |
238 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . $this->table_element . " ("; |
|
238 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element." ("; |
|
239 | 239 | $sql .= " ref, ref_ext, label, entity, position"; |
240 | 240 | $sql .= ")"; |
241 | 241 | $sql .= " VALUES ("; |
242 | - $sql .= " '" . $this->db->escape($this->ref) . "'"; |
|
243 | - $sql .= ", '" . $this->db->escape($this->ref_ext) . "'"; |
|
244 | - $sql .= ", '" . $this->db->escape($this->label) . "'"; |
|
245 | - $sql .= ", " . ((int) $this->entity); |
|
246 | - $sql .= ", " . ((int) $this->position); |
|
242 | + $sql .= " '".$this->db->escape($this->ref)."'"; |
|
243 | + $sql .= ", '".$this->db->escape($this->ref_ext)."'"; |
|
244 | + $sql .= ", '".$this->db->escape($this->label)."'"; |
|
245 | + $sql .= ", ".((int) $this->entity); |
|
246 | + $sql .= ", ".((int) $this->position); |
|
247 | 247 | $sql .= ")"; |
248 | 248 | |
249 | 249 | dol_syslog(__METHOD__, LOG_DEBUG); |
250 | 250 | $resql = $this->db->query($sql); |
251 | 251 | if (!$resql) { |
252 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
252 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
253 | 253 | $error++; |
254 | 254 | } |
255 | 255 | |
256 | 256 | if (!$error) { |
257 | - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); |
|
257 | + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element); |
|
258 | 258 | $result = $this->insertExtraFields(); |
259 | 259 | if ($result < 0) { |
260 | 260 | $error++; |
@@ -299,20 +299,20 @@ discard block |
||
299 | 299 | $error++; |
300 | 300 | } |
301 | 301 | if ($error) { |
302 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
302 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
303 | 303 | return -1; |
304 | 304 | } |
305 | 305 | |
306 | 306 | $sql = "SELECT rowid, ref, ref_ext, label, position"; |
307 | - $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element; |
|
308 | - $sql .= " WHERE rowid = " . ((int) $id); |
|
309 | - $sql .= " AND entity IN (" . getEntity('product') . ")"; |
|
307 | + $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; |
|
308 | + $sql .= " WHERE rowid = ".((int) $id); |
|
309 | + $sql .= " AND entity IN (".getEntity('product').")"; |
|
310 | 310 | |
311 | 311 | dol_syslog(__METHOD__, LOG_DEBUG); |
312 | 312 | $resql = $this->db->query($sql); |
313 | 313 | if (!$resql) { |
314 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
315 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
314 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
315 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
316 | 316 | return -1; |
317 | 317 | } |
318 | 318 | |
@@ -343,14 +343,14 @@ discard block |
||
343 | 343 | $return = array(); |
344 | 344 | |
345 | 345 | $sql = "SELECT rowid, ref, ref_ext, label, position"; |
346 | - $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element; |
|
347 | - $sql .= " WHERE entity IN (" . getEntity('product') . ")"; |
|
346 | + $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; |
|
347 | + $sql .= " WHERE entity IN (".getEntity('product').")"; |
|
348 | 348 | $sql .= $this->db->order("position", "asc"); |
349 | 349 | |
350 | 350 | dol_syslog(__METHOD__, LOG_DEBUG); |
351 | 351 | $resql = $this->db->query($sql); |
352 | 352 | if (!$resql) { |
353 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
353 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
354 | 354 | dol_print_error($this->db); |
355 | 355 | return $return; |
356 | 356 | } |
@@ -402,25 +402,25 @@ discard block |
||
402 | 402 | $error++; |
403 | 403 | } |
404 | 404 | if ($error) { |
405 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
405 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
406 | 406 | return -1; |
407 | 407 | } |
408 | 408 | |
409 | 409 | $this->db->begin(); |
410 | 410 | |
411 | - $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . " SET"; |
|
411 | + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; |
|
412 | 412 | |
413 | - $sql .= " ref = '" . $this->db->escape($this->ref) . "'"; |
|
414 | - $sql .= ", ref_ext = '" . $this->db->escape($this->ref_ext) . "'"; |
|
415 | - $sql .= ", label = '" . $this->db->escape($this->label) . "'"; |
|
416 | - $sql .= ", position = " . ((int) $this->position); |
|
413 | + $sql .= " ref = '".$this->db->escape($this->ref)."'"; |
|
414 | + $sql .= ", ref_ext = '".$this->db->escape($this->ref_ext)."'"; |
|
415 | + $sql .= ", label = '".$this->db->escape($this->label)."'"; |
|
416 | + $sql .= ", position = ".((int) $this->position); |
|
417 | 417 | |
418 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
418 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
419 | 419 | |
420 | 420 | dol_syslog(__METHOD__, LOG_DEBUG); |
421 | 421 | $resql = $this->db->query($sql); |
422 | 422 | if (!$resql) { |
423 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
423 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
424 | 424 | $error++; |
425 | 425 | } |
426 | 426 | if (!$error) { |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | $error++; |
469 | 469 | } |
470 | 470 | if ($error) { |
471 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
471 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
472 | 472 | return -1; |
473 | 473 | } |
474 | 474 | |
@@ -493,25 +493,25 @@ discard block |
||
493 | 493 | |
494 | 494 | if (!$error) { |
495 | 495 | // Delete values |
496 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . $this->table_element_line; |
|
497 | - $sql .= " WHERE " . $this->fk_element . " = " . ((int) $this->id); |
|
496 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element_line; |
|
497 | + $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
|
498 | 498 | |
499 | - dol_syslog(__METHOD__ . ' - Delete values', LOG_DEBUG); |
|
499 | + dol_syslog(__METHOD__.' - Delete values', LOG_DEBUG); |
|
500 | 500 | $resql = $this->db->query($sql); |
501 | 501 | if (!$resql) { |
502 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
502 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
503 | 503 | $error++; |
504 | 504 | } |
505 | 505 | } |
506 | 506 | |
507 | 507 | if (!$error) { |
508 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . $this->table_element; |
|
509 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
508 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element; |
|
509 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
510 | 510 | |
511 | - dol_syslog(__METHOD__ . ' - Delete attribute', LOG_DEBUG); |
|
511 | + dol_syslog(__METHOD__.' - Delete attribute', LOG_DEBUG); |
|
512 | 512 | $resql = $this->db->query($sql); |
513 | 513 | if (!$resql) { |
514 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
514 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
515 | 515 | $error++; |
516 | 516 | } |
517 | 517 | } |
@@ -550,15 +550,15 @@ discard block |
||
550 | 550 | $error++; |
551 | 551 | } |
552 | 552 | if ($error) { |
553 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
553 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
554 | 554 | return -1; |
555 | 555 | } |
556 | 556 | |
557 | 557 | $sql = "SELECT td.rowid, td.fk_product_attribute, td.ref, td.value, td.position"; |
558 | - $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element_line . " AS td"; |
|
559 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $this->table_element . " AS t ON t.rowid = td." . $this->fk_element; |
|
560 | - $sql .= " WHERE t.rowid = " . ((int) $this->id); |
|
561 | - $sql .= " AND t.entity IN (" . getEntity('product') . ")"; |
|
558 | + $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element_line." AS td"; |
|
559 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$this->table_element." AS t ON t.rowid = td.".$this->fk_element; |
|
560 | + $sql .= " WHERE t.rowid = ".((int) $this->id); |
|
561 | + $sql .= " AND t.entity IN (".getEntity('product').")"; |
|
562 | 562 | if ($filters) { |
563 | 563 | $sql .= $filters; |
564 | 564 | } |
@@ -567,8 +567,8 @@ discard block |
||
567 | 567 | dol_syslog(__METHOD__, LOG_DEBUG); |
568 | 568 | $resql = $this->db->query($sql); |
569 | 569 | if (!$resql) { |
570 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
571 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
570 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
571 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
572 | 572 | return -3; |
573 | 573 | } |
574 | 574 | |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | public function addLine($ref, $value, $position = -1, $notrigger = 0) |
624 | 624 | { |
625 | 625 | global $langs, $user; |
626 | - dol_syslog(__METHOD__ . " id=".$this->id.", ref=".$ref.", value=".$value.", notrigger=".$notrigger); |
|
626 | + dol_syslog(__METHOD__." id=".$this->id.", ref=".$ref.", value=".$value.", notrigger=".$notrigger); |
|
627 | 627 | $error = 0; |
628 | 628 | |
629 | 629 | // Clean parameters |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | $error++; |
636 | 636 | } |
637 | 637 | if ($error) { |
638 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
638 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
639 | 639 | return -1; |
640 | 640 | } |
641 | 641 | |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | { |
685 | 685 | global $user; |
686 | 686 | |
687 | - dol_syslog(__METHOD__ . " lineid=$lineid, ref=$ref, value=$value, notrigger=$notrigger"); |
|
687 | + dol_syslog(__METHOD__." lineid=$lineid, ref=$ref, value=$value, notrigger=$notrigger"); |
|
688 | 688 | |
689 | 689 | // Clean parameters |
690 | 690 | $lineid = $lineid > 0 ? $lineid : 0; |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | */ |
726 | 726 | public function deleteLine(User $user, $lineid, $notrigger = 0) |
727 | 727 | { |
728 | - dol_syslog(__METHOD__ . " lineid=$lineid, notrigger=$notrigger"); |
|
728 | + dol_syslog(__METHOD__." lineid=$lineid, notrigger=$notrigger"); |
|
729 | 729 | |
730 | 730 | // Clean parameters |
731 | 731 | $lineid = $lineid > 0 ? $lineid : 0; |
@@ -772,19 +772,19 @@ discard block |
||
772 | 772 | $error++; |
773 | 773 | } |
774 | 774 | if ($error) { |
775 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
775 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
776 | 776 | return -1; |
777 | 777 | } |
778 | 778 | |
779 | 779 | $sql = "SELECT COUNT(*) AS count"; |
780 | - $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element_line; |
|
781 | - $sql .= " WHERE " . $this->fk_element . " = " . ((int) $this->id); |
|
780 | + $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element_line; |
|
781 | + $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
|
782 | 782 | |
783 | 783 | dol_syslog(__METHOD__, LOG_DEBUG); |
784 | 784 | $resql = $this->db->query($sql); |
785 | 785 | if (!$resql) { |
786 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
787 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
786 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
787 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
788 | 788 | return -1; |
789 | 789 | } |
790 | 790 | |
@@ -815,21 +815,21 @@ discard block |
||
815 | 815 | $error++; |
816 | 816 | } |
817 | 817 | if ($error) { |
818 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
818 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
819 | 819 | return -1; |
820 | 820 | } |
821 | 821 | |
822 | 822 | $sql = "SELECT COUNT(*) AS count"; |
823 | - $sql .= " FROM " . MAIN_DB_PREFIX . "product_attribute_combination2val AS pac2v"; |
|
824 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_attribute_combination AS pac ON pac2v.fk_prod_combination = pac.rowid"; |
|
825 | - $sql .= " WHERE pac2v.fk_prod_attr = " . ((int) $this->id); |
|
826 | - $sql .= " AND pac.entity IN (" . getEntity('product') . ")"; |
|
823 | + $sql .= " FROM ".MAIN_DB_PREFIX."product_attribute_combination2val AS pac2v"; |
|
824 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination AS pac ON pac2v.fk_prod_combination = pac.rowid"; |
|
825 | + $sql .= " WHERE pac2v.fk_prod_attr = ".((int) $this->id); |
|
826 | + $sql .= " AND pac.entity IN (".getEntity('product').")"; |
|
827 | 827 | |
828 | 828 | dol_syslog(__METHOD__, LOG_DEBUG); |
829 | 829 | $resql = $this->db->query($sql); |
830 | 830 | if (!$resql) { |
831 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
832 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
831 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
832 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
833 | 833 | return -1; |
834 | 834 | } |
835 | 835 | |
@@ -859,16 +859,16 @@ discard block |
||
859 | 859 | $error++; |
860 | 860 | } |
861 | 861 | if ($error) { |
862 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
862 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
863 | 863 | return -1; |
864 | 864 | } |
865 | 865 | |
866 | - $sql = "SELECT COUNT(*) AS nb FROM " . MAIN_DB_PREFIX . "product_attribute_combination2val WHERE fk_prod_attr = " . ((int) $this->id); |
|
866 | + $sql = "SELECT COUNT(*) AS nb FROM ".MAIN_DB_PREFIX."product_attribute_combination2val WHERE fk_prod_attr = ".((int) $this->id); |
|
867 | 867 | |
868 | 868 | dol_syslog(__METHOD__, LOG_DEBUG); |
869 | 869 | $resql = $this->db->query($sql); |
870 | 870 | if (!$resql) { |
871 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
871 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
872 | 872 | return -1; |
873 | 873 | } |
874 | 874 | |
@@ -892,8 +892,8 @@ discard block |
||
892 | 892 | { |
893 | 893 | // Count number of attributes to reorder (according to choice $renum) |
894 | 894 | $nl = 0; |
895 | - $sql = "SELECT count(rowid) FROM " . MAIN_DB_PREFIX . $this->table_element; |
|
896 | - $sql .= " WHERE entity IN (" . getEntity('product') . ")"; |
|
895 | + $sql = "SELECT count(rowid) FROM ".MAIN_DB_PREFIX.$this->table_element; |
|
896 | + $sql .= " WHERE entity IN (".getEntity('product').")"; |
|
897 | 897 | if (!$renum) { |
898 | 898 | $sql .= " AND position = 0"; |
899 | 899 | } else { |
@@ -913,11 +913,11 @@ discard block |
||
913 | 913 | $rows = array(); |
914 | 914 | |
915 | 915 | // We first search all attributes |
916 | - $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $this->table_element; |
|
917 | - $sql .= " WHERE entity IN (" . getEntity('product') . ")"; |
|
918 | - $sql .= " ORDER BY position ASC, rowid " . $rowidorder; |
|
916 | + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$this->table_element; |
|
917 | + $sql .= " WHERE entity IN (".getEntity('product').")"; |
|
918 | + $sql .= " ORDER BY position ASC, rowid ".$rowidorder; |
|
919 | 919 | |
920 | - dol_syslog(__METHOD__ . " search all attributes", LOG_DEBUG); |
|
920 | + dol_syslog(__METHOD__." search all attributes", LOG_DEBUG); |
|
921 | 921 | $resql = $this->db->query($sql); |
922 | 922 | if ($resql) { |
923 | 923 | $i = 0; |
@@ -952,8 +952,8 @@ discard block |
||
952 | 952 | { |
953 | 953 | global $hookmanager; |
954 | 954 | |
955 | - $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . " SET position = " . ((int) $position); |
|
956 | - $sql .= " WHERE rowid = " . ((int) $rowid); |
|
955 | + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET position = ".((int) $position); |
|
956 | + $sql .= " WHERE rowid = ".((int) $rowid); |
|
957 | 957 | |
958 | 958 | dol_syslog(__METHOD__, LOG_DEBUG); |
959 | 959 | if (!$this->db->query($sql)) { |
@@ -975,8 +975,8 @@ discard block |
||
975 | 975 | */ |
976 | 976 | public function getPositionOfAttribute($rowid) |
977 | 977 | { |
978 | - $sql = "SELECT position FROM " . MAIN_DB_PREFIX . $this->table_element; |
|
979 | - $sql .= " WHERE entity IN (" . getEntity('product') . ")"; |
|
978 | + $sql = "SELECT position FROM ".MAIN_DB_PREFIX.$this->table_element; |
|
979 | + $sql .= " WHERE entity IN (".getEntity('product').")"; |
|
980 | 980 | |
981 | 981 | dol_syslog(__METHOD__, LOG_DEBUG); |
982 | 982 | $resql = $this->db->query($sql); |
@@ -1039,12 +1039,12 @@ discard block |
||
1039 | 1039 | public function updateAttributePositionUp($rowid, $position) |
1040 | 1040 | { |
1041 | 1041 | if ($position > 1) { |
1042 | - $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . " SET position = " . ((int) $position); |
|
1043 | - $sql .= " WHERE entity IN (" . getEntity('product') . ")"; |
|
1044 | - $sql .= " AND position = " . ((int) ($position - 1)); |
|
1042 | + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET position = ".((int) $position); |
|
1043 | + $sql .= " WHERE entity IN (".getEntity('product').")"; |
|
1044 | + $sql .= " AND position = ".((int) ($position - 1)); |
|
1045 | 1045 | if ($this->db->query($sql)) { |
1046 | - $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . " SET position = " . ((int) ($position - 1)); |
|
1047 | - $sql .= " WHERE rowid = " . ((int) $rowid); |
|
1046 | + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET position = ".((int) ($position - 1)); |
|
1047 | + $sql .= " WHERE rowid = ".((int) $rowid); |
|
1048 | 1048 | if (!$this->db->query($sql)) { |
1049 | 1049 | dol_print_error($this->db); |
1050 | 1050 | } |
@@ -1065,12 +1065,12 @@ discard block |
||
1065 | 1065 | public function updateAttributePositionDown($rowid, $position, $max) |
1066 | 1066 | { |
1067 | 1067 | if ($position < $max) { |
1068 | - $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . " SET position = " . ((int) $position); |
|
1069 | - $sql .= " WHERE entity IN (" . getEntity('product') . ")"; |
|
1070 | - $sql .= " AND position = " . ((int) ($position + 1)); |
|
1068 | + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET position = ".((int) $position); |
|
1069 | + $sql .= " WHERE entity IN (".getEntity('product').")"; |
|
1070 | + $sql .= " AND position = ".((int) ($position + 1)); |
|
1071 | 1071 | if ($this->db->query($sql)) { |
1072 | - $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . " SET position = " . ((int) ($position + 1)); |
|
1073 | - $sql .= " WHERE rowid = " . ((int) $rowid); |
|
1072 | + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET position = ".((int) ($position + 1)); |
|
1073 | + $sql .= " WHERE rowid = ".((int) $rowid); |
|
1074 | 1074 | if (!$this->db->query($sql)) { |
1075 | 1075 | dol_print_error($this->db); |
1076 | 1076 | } |
@@ -1088,8 +1088,8 @@ discard block |
||
1088 | 1088 | public function getMaxAttributesPosition() |
1089 | 1089 | { |
1090 | 1090 | // Search the last position of attributes |
1091 | - $sql = "SELECT max(position) FROM " . MAIN_DB_PREFIX . $this->table_element; |
|
1092 | - $sql .= " WHERE entity IN (" . getEntity('product') . ")"; |
|
1091 | + $sql = "SELECT max(position) FROM ".MAIN_DB_PREFIX.$this->table_element; |
|
1092 | + $sql .= " WHERE entity IN (".getEntity('product').")"; |
|
1093 | 1093 | |
1094 | 1094 | dol_syslog(__METHOD__, LOG_DEBUG); |
1095 | 1095 | $resql = $this->db->query($sql); |
@@ -1135,17 +1135,17 @@ discard block |
||
1135 | 1135 | |
1136 | 1136 | $result = ''; |
1137 | 1137 | |
1138 | - $label = img_picto('', $this->picto) . ' <u>' . $langs->trans("ProductAttribute") . '</u>'; |
|
1138 | + $label = img_picto('', $this->picto).' <u>'.$langs->trans("ProductAttribute").'</u>'; |
|
1139 | 1139 | if (isset($this->status)) { |
1140 | - $label .= ' ' . $this->getLibStatut(5); |
|
1140 | + $label .= ' '.$this->getLibStatut(5); |
|
1141 | 1141 | } |
1142 | 1142 | $label .= '<br>'; |
1143 | - $label .= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref; |
|
1143 | + $label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref; |
|
1144 | 1144 | if (!empty($this->label)) { |
1145 | - $label .= '<br><b>' . $langs->trans('Label') . ':</b> ' . $this->label; |
|
1145 | + $label .= '<br><b>'.$langs->trans('Label').':</b> '.$this->label; |
|
1146 | 1146 | } |
1147 | 1147 | |
1148 | - $url = dol_buildpath('/variants/card.php', 1) . '?id=' . $this->id; |
|
1148 | + $url = dol_buildpath('/variants/card.php', 1).'?id='.$this->id; |
|
1149 | 1149 | |
1150 | 1150 | if ($option != 'nolink') { |
1151 | 1151 | // Add param to save lastsearch_values or not |
@@ -1162,20 +1162,20 @@ discard block |
||
1162 | 1162 | if (empty($notooltip)) { |
1163 | 1163 | if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
1164 | 1164 | $label = $langs->trans("ShowProductAttribute"); |
1165 | - $linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"'; |
|
1165 | + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
|
1166 | 1166 | } |
1167 | - $linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"'; |
|
1168 | - $linkclose .= ' class="classfortooltip' . ($morecss ? ' ' . $morecss : '') . '"'; |
|
1167 | + $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; |
|
1168 | + $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; |
|
1169 | 1169 | } else { |
1170 | - $linkclose = ($morecss ? ' class="' . $morecss . '"' : ''); |
|
1170 | + $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
|
1171 | 1171 | } |
1172 | 1172 | |
1173 | 1173 | if ($option == 'nolink' || empty($url)) { |
1174 | 1174 | $linkstart = '<span'; |
1175 | 1175 | } else { |
1176 | - $linkstart = '<a href="' . $url . '"'; |
|
1176 | + $linkstart = '<a href="'.$url.'"'; |
|
1177 | 1177 | } |
1178 | - $linkstart .= $linkclose . '>'; |
|
1178 | + $linkstart .= $linkclose.'>'; |
|
1179 | 1179 | if ($option == 'nolink' || empty($url)) { |
1180 | 1180 | $linkend = '</span>'; |
1181 | 1181 | } else { |
@@ -1186,29 +1186,29 @@ discard block |
||
1186 | 1186 | |
1187 | 1187 | if (empty($this->showphoto_on_popup)) { |
1188 | 1188 | if ($withpicto) { |
1189 | - $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="' . (($withpicto != 2) ? 'paddingright ' : '') . 'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
1189 | + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
1190 | 1190 | } |
1191 | 1191 | } else { |
1192 | 1192 | if ($withpicto) { |
1193 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
1193 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
1194 | 1194 | |
1195 | 1195 | list($class, $module) = explode('@', $this->picto); |
1196 | - $upload_dir = $conf->$module->multidir_output[$conf->entity] . "/$class/" . dol_sanitizeFileName($this->ref); |
|
1196 | + $upload_dir = $conf->$module->multidir_output[$conf->entity]."/$class/".dol_sanitizeFileName($this->ref); |
|
1197 | 1197 | $filearray = dol_dir_list($upload_dir, "files"); |
1198 | 1198 | $filename = $filearray[0]['name']; |
1199 | 1199 | if (!empty($filename)) { |
1200 | 1200 | $pospoint = strpos($filearray[0]['name'], '.'); |
1201 | 1201 | |
1202 | - $pathtophoto = $class . '/' . $this->ref . '/thumbs/' . substr($filename, 0, $pospoint) . '_mini' . substr($filename, $pospoint); |
|
1203 | - if (!getDolGlobalString(strtoupper($module . '_' . $class) . '_FORMATLISTPHOTOSASUSERS')) { |
|
1204 | - $result .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo' . $module . '" alt="No photo" border="0" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $module . '&entity=' . $conf->entity . '&file=' . urlencode($pathtophoto) . '"></div></div>'; |
|
1202 | + $pathtophoto = $class.'/'.$this->ref.'/thumbs/'.substr($filename, 0, $pospoint).'_mini'.substr($filename, $pospoint); |
|
1203 | + if (!getDolGlobalString(strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS')) { |
|
1204 | + $result .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$module.'" alt="No photo" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$module.'&entity='.$conf->entity.'&file='.urlencode($pathtophoto).'"></div></div>'; |
|
1205 | 1205 | } else { |
1206 | - $result .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $module . '&entity=' . $conf->entity . '&file=' . urlencode($pathtophoto) . '"></div>'; |
|
1206 | + $result .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$module.'&entity='.$conf->entity.'&file='.urlencode($pathtophoto).'"></div>'; |
|
1207 | 1207 | } |
1208 | 1208 | |
1209 | 1209 | $result .= '</div>'; |
1210 | 1210 | } else { |
1211 | - $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="' . (($withpicto != 2) ? 'paddingright ' : '') . 'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
1211 | + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
1212 | 1212 | } |
1213 | 1213 | } |
1214 | 1214 | } |
@@ -1332,9 +1332,9 @@ discard block |
||
1332 | 1332 | $dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir)); |
1333 | 1333 | foreach ($dirtpls as $module => $reldir) { |
1334 | 1334 | if (!empty($module)) { |
1335 | - $tpl = dol_buildpath($reldir . '/productattributevalueline_create.tpl.php'); |
|
1335 | + $tpl = dol_buildpath($reldir.'/productattributevalueline_create.tpl.php'); |
|
1336 | 1336 | } else { |
1337 | - $tpl = DOL_DOCUMENT_ROOT . $reldir . '/productattributevalueline_create.tpl.php'; |
|
1337 | + $tpl = DOL_DOCUMENT_ROOT.$reldir.'/productattributevalueline_create.tpl.php'; |
|
1338 | 1338 | } |
1339 | 1339 | |
1340 | 1340 | if (empty($conf->file->strict_mode)) { |
@@ -1383,9 +1383,9 @@ discard block |
||
1383 | 1383 | $dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir)); |
1384 | 1384 | foreach ($dirtpls as $module => $reldir) { |
1385 | 1385 | if (!empty($module)) { |
1386 | - $tpl = dol_buildpath($reldir . '/productattributevalueline_title.tpl.php'); |
|
1386 | + $tpl = dol_buildpath($reldir.'/productattributevalueline_title.tpl.php'); |
|
1387 | 1387 | } else { |
1388 | - $tpl = DOL_DOCUMENT_ROOT . $reldir . '/productattributevalueline_title.tpl.php'; |
|
1388 | + $tpl = DOL_DOCUMENT_ROOT.$reldir.'/productattributevalueline_title.tpl.php'; |
|
1389 | 1389 | } |
1390 | 1390 | if (empty($conf->file->strict_mode)) { |
1391 | 1391 | $res = @include $tpl; |
@@ -1465,9 +1465,9 @@ discard block |
||
1465 | 1465 | $dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir)); |
1466 | 1466 | foreach ($dirtpls as $module => $reldir) { |
1467 | 1467 | if (!empty($module)) { |
1468 | - $tpl = dol_buildpath($reldir . '/productattributevalueline_view.tpl.php'); |
|
1468 | + $tpl = dol_buildpath($reldir.'/productattributevalueline_view.tpl.php'); |
|
1469 | 1469 | } else { |
1470 | - $tpl = DOL_DOCUMENT_ROOT . $reldir . '/productattributevalueline_view.tpl.php'; |
|
1470 | + $tpl = DOL_DOCUMENT_ROOT.$reldir.'/productattributevalueline_view.tpl.php'; |
|
1471 | 1471 | } |
1472 | 1472 | |
1473 | 1473 | if (empty($conf->file->strict_mode)) { |
@@ -1489,9 +1489,9 @@ discard block |
||
1489 | 1489 | $dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir)); |
1490 | 1490 | foreach ($dirtpls as $module => $reldir) { |
1491 | 1491 | if (!empty($module)) { |
1492 | - $tpl = dol_buildpath($reldir . '/productattributevalueline_edit.tpl.php'); |
|
1492 | + $tpl = dol_buildpath($reldir.'/productattributevalueline_edit.tpl.php'); |
|
1493 | 1493 | } else { |
1494 | - $tpl = DOL_DOCUMENT_ROOT . $reldir . '/productattributevalueline_edit.tpl.php'; |
|
1494 | + $tpl = DOL_DOCUMENT_ROOT.$reldir.'/productattributevalueline_edit.tpl.php'; |
|
1495 | 1495 | } |
1496 | 1496 | |
1497 | 1497 | if (empty($conf->file->strict_mode)) { |
@@ -67,7 +67,7 @@ |
||
67 | 67 | * View |
68 | 68 | */ |
69 | 69 | |
70 | -$title = $langs->trans("ProductAttributeExtrafieldsSetup"); |
|
70 | +$title = $langs->trans("ProductAttributeExtrafieldsSetup"); |
|
71 | 71 | llxHeader('', $title); |
72 | 72 | |
73 | 73 | $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>'; |