@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | |
| 626 | 626 | // Add also company main email |
| 627 | 627 | if (getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')) { |
| 628 | - $s = (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? $conf->global->MAIN_INFO_SOCIETE_EMAIL : $conf->global->MAIN_INFO_SOCIETE_NOM).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
| 628 | + $s = (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? $conf->global->MAIN_INFO_SOCIETE_EMAIL : $conf->global->MAIN_INFO_SOCIETE_NOM).' <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
| 629 | 629 | $liste['company'] = array('label' => $s, 'data-html' => $s); |
| 630 | 630 | } |
| 631 | 631 | |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | if (getDolGlobalString('MAIN_MAIL_EMAIL_FROM') && getDolGlobalString('MAIN_MAIL_EMAIL_FROM') != getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')) { |
| 646 | 646 | $s = getDolGlobalString('MAIN_MAIL_EMAIL_FROM'); |
| 647 | 647 | if ($this->frommail) { |
| 648 | - $s .= ' <' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'>'; |
|
| 648 | + $s .= ' <'.getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'>'; |
|
| 649 | 649 | } |
| 650 | 650 | $liste['main_from'] = array('label' => $s, 'data-html' => $s); |
| 651 | 651 | } |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | $maxfilesizearray = getMaxFileSizeArray(); |
| 882 | 882 | $maxmin = $maxfilesizearray['maxmin']; |
| 883 | 883 | if ($maxmin > 0) { |
| 884 | - $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 884 | + $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 885 | 885 | } |
| 886 | 886 | // Can add other files |
| 887 | 887 | if (!getDolGlobalString('FROM_MAIL_DONT_USE_INPUT_FILE_MULTIPLE')) { |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 105 | 105 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
| 106 | 106 | $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); |
| 107 | -$confirm = GETPOST('confirm', 'alpha'); |
|
| 107 | +$confirm = GETPOST('confirm', 'alpha'); |
|
| 108 | 108 | |
| 109 | 109 | $dol_openinpopup = ''; |
| 110 | 110 | if (!empty($backtopagejsfields)) { |
@@ -155,12 +155,12 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | // Permissions |
| 158 | -$permissiontoread = $user->hasRight('societe', 'lire'); |
|
| 159 | -$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 158 | +$permissiontoread = $user->hasRight('societe', 'lire'); |
|
| 159 | +$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 160 | 160 | $permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0); |
| 161 | -$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
| 161 | +$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
| 162 | 162 | $permissiondellink = $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php |
| 163 | -$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
| 163 | +$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
| 164 | 164 | |
| 165 | 165 | // Security check |
| 166 | 166 | $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | if ($action == 'confirm_merge' && $confirm == 'yes' && $permissiontoadd) { |
| 205 | 205 | $soc_origin_id = GETPOSTINT('soc_origin'); |
| 206 | - $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
| 206 | + $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
| 207 | 207 | |
| 208 | 208 | if ($soc_origin_id <= 0) { |
| 209 | 209 | $langs->load('errors'); |
@@ -319,19 +319,19 @@ discard block |
||
| 319 | 319 | $object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml')); |
| 320 | 320 | $object->civility_id = GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int |
| 321 | 321 | // Add non official properties |
| 322 | - $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
| 323 | - $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
| 322 | + $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
| 323 | + $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
| 324 | 324 | } else { |
| 325 | - $object->name = GETPOST('name', 'alphanohtml'); |
|
| 325 | + $object->name = GETPOST('name', 'alphanohtml'); |
|
| 326 | 326 | } |
| 327 | 327 | $object->entity = ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity); |
| 328 | - $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
| 328 | + $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
| 329 | 329 | $object->parent = GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent; |
| 330 | 330 | $object->address = GETPOST('address', 'alphanohtml'); |
| 331 | - $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
| 332 | - $object->town = GETPOST('town', 'alphanohtml'); |
|
| 333 | - $object->country_id = GETPOSTINT('country_id'); |
|
| 334 | - $object->state_id = GETPOSTINT('state_id'); |
|
| 331 | + $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
| 332 | + $object->town = GETPOST('town', 'alphanohtml'); |
|
| 333 | + $object->country_id = GETPOSTINT('country_id'); |
|
| 334 | + $object->state_id = GETPOSTINT('state_id'); |
|
| 335 | 335 | |
| 336 | 336 | $object->socialnetworks = array(); |
| 337 | 337 | if (isModEnabled('socialnetworks')) { |
@@ -343,10 +343,10 @@ discard block |
||
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | $object->phone = GETPOST('phone', 'alpha'); |
| 346 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 346 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 347 | 347 | $object->fax = GETPOST('fax', 'alpha'); |
| 348 | 348 | $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); |
| 349 | - $object->no_email = GETPOSTINT("no_email"); |
|
| 349 | + $object->no_email = GETPOSTINT("no_email"); |
|
| 350 | 350 | $object->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); |
| 351 | 351 | $object->idprof1 = trim(GETPOST('idprof1', 'alphanohtml')); |
| 352 | 352 | $object->idprof2 = trim(GETPOST('idprof2', 'alphanohtml')); |
@@ -356,13 +356,13 @@ discard block |
||
| 356 | 356 | $object->idprof6 = trim(GETPOST('idprof6', 'alphanohtml')); |
| 357 | 357 | $object->prefix_comm = GETPOST('prefix_comm', 'alphanohtml'); |
| 358 | 358 | $object->code_client = GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha'); |
| 359 | - $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
| 359 | + $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
| 360 | 360 | $object->capital = GETPOST('capital', 'alphanohtml'); |
| 361 | 361 | $object->barcode = GETPOST('barcode', 'alphanohtml'); |
| 362 | 362 | |
| 363 | 363 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
| 364 | 364 | $object->tva_assuj = GETPOST('assujtva_value', 'alpha'); |
| 365 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 365 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 366 | 366 | $object->status = GETPOST('status', 'alpha'); |
| 367 | 367 | |
| 368 | 368 | // Local Taxes |
@@ -372,9 +372,9 @@ discard block |
||
| 372 | 372 | $object->localtax1_value = GETPOST('lt1', 'alpha'); |
| 373 | 373 | $object->localtax2_value = GETPOST('lt2', 'alpha'); |
| 374 | 374 | |
| 375 | - $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
| 375 | + $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
| 376 | 376 | $object->effectif_id = GETPOSTINT('effectif_id'); |
| 377 | - $object->typent_id = GETPOSTINT('typent_id'); |
|
| 377 | + $object->typent_id = GETPOSTINT('typent_id'); |
|
| 378 | 378 | |
| 379 | 379 | $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 |
| 380 | 380 | |
@@ -383,18 +383,18 @@ discard block |
||
| 383 | 383 | $prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0); |
| 384 | 384 | $prospectcustomer = $customer + $prospect; |
| 385 | 385 | |
| 386 | - $object->client = $prospectcustomer; |
|
| 387 | - $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
| 386 | + $object->client = $prospectcustomer; |
|
| 387 | + $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
| 388 | 388 | |
| 389 | - $object->commercial_id = GETPOSTINT('commercial_id'); |
|
| 390 | - $object->default_lang = GETPOST('default_lang'); |
|
| 389 | + $object->commercial_id = GETPOSTINT('commercial_id'); |
|
| 390 | + $object->default_lang = GETPOST('default_lang'); |
|
| 391 | 391 | |
| 392 | 392 | // Webservices url/key |
| 393 | 393 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
| 394 | 394 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
| 395 | 395 | |
| 396 | 396 | if (GETPOSTISSET('accountancy_code_sell')) { |
| 397 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 397 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 398 | 398 | |
| 399 | 399 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
| 400 | 400 | $object->accountancy_code_sell = ''; |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | } |
| 404 | 404 | } |
| 405 | 405 | if (GETPOSTISSET('accountancy_code_buy')) { |
| 406 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 406 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 407 | 407 | |
| 408 | 408 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
| 409 | 409 | $object->accountancy_code_buy = ''; |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | $action = ""; |
| 870 | 870 | |
| 871 | 871 | $mesg = $langs->trans("ErrorProductAlreadyExists", $clone->ref); |
| 872 | - $mesg .= ' <a href="' . $_SERVER["PHP_SELF"] . '?ref=' . $clone->ref . '">' . $langs->trans("ShowCardHere") . '</a>.'; |
|
| 872 | + $mesg .= ' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$clone->ref.'">'.$langs->trans("ShowCardHere").'</a>.'; |
|
| 873 | 873 | setEventMessages($mesg, null, 'errors'); |
| 874 | 874 | } else { |
| 875 | 875 | setEventMessages(empty($clone->error) ? '' : $langs->trans($clone->error), $clone->errors, 'errors'); |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | } else { |
| 885 | 885 | $db->commit(); |
| 886 | 886 | $db->close(); |
| 887 | - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); |
|
| 887 | + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); |
|
| 888 | 888 | exit; |
| 889 | 889 | } |
| 890 | 890 | } else { |
@@ -1063,7 +1063,7 @@ discard block |
||
| 1063 | 1063 | } |
| 1064 | 1064 | |
| 1065 | 1065 | $object->phone = GETPOST('phone', 'alpha'); |
| 1066 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 1066 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 1067 | 1067 | $object->fax = GETPOST('fax', 'alpha'); |
| 1068 | 1068 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
| 1069 | 1069 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
@@ -1080,7 +1080,7 @@ discard block |
||
| 1080 | 1080 | $object->civility_id = GETPOST('civility_id', 'alpha'); |
| 1081 | 1081 | |
| 1082 | 1082 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
| 1083 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 1083 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 1084 | 1084 | $object->status = GETPOSTINT('status'); |
| 1085 | 1085 | |
| 1086 | 1086 | //Local Taxes |
@@ -1096,7 +1096,7 @@ discard block |
||
| 1096 | 1096 | $object->default_lang = GETPOST('default_lang'); |
| 1097 | 1097 | |
| 1098 | 1098 | if (GETPOSTISSET('accountancy_code_sell')) { |
| 1099 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 1099 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 1100 | 1100 | |
| 1101 | 1101 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
| 1102 | 1102 | $object->accountancy_code_sell = ''; |
@@ -1105,7 +1105,7 @@ discard block |
||
| 1105 | 1105 | } |
| 1106 | 1106 | } |
| 1107 | 1107 | if (GETPOSTISSET('accountancy_code_buy')) { |
| 1108 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 1108 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 1109 | 1109 | |
| 1110 | 1110 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
| 1111 | 1111 | $object->accountancy_code_buy = ''; |
@@ -1230,7 +1230,7 @@ discard block |
||
| 1230 | 1230 | |
| 1231 | 1231 | print '<script type="text/javascript">'; |
| 1232 | 1232 | print '$(document).ready(function () { |
| 1233 | - var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . '; |
|
| 1233 | + var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').'; |
|
| 1234 | 1234 | |
| 1235 | 1235 | init_customer_categ(); |
| 1236 | 1236 | $("#customerprospect").change(function() { |
@@ -1302,7 +1302,7 @@ discard block |
||
| 1302 | 1302 | print '</td><td'.(!getDolGlobalString('SOCIETE_USEPREFIX') ? ' colspan="3"' : '').'>'; |
| 1303 | 1303 | |
| 1304 | 1304 | print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus">'; |
| 1305 | - print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
| 1305 | + print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
| 1306 | 1306 | // 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 |
| 1307 | 1307 | // 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. |
| 1308 | 1308 | /* |
@@ -1650,7 +1650,7 @@ discard block |
||
| 1650 | 1650 | print '<td></td>'; |
| 1651 | 1651 | print '<td></td>'; |
| 1652 | 1652 | } |
| 1653 | - print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
| 1653 | + print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
| 1654 | 1654 | 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>'; |
| 1655 | 1655 | print '</tr>'; |
| 1656 | 1656 | } |
@@ -1698,7 +1698,7 @@ discard block |
||
| 1698 | 1698 | // Vat is used |
| 1699 | 1699 | print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>'; |
| 1700 | 1700 | print '<td>'; |
| 1701 | - 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 |
|
| 1701 | + 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 |
|
| 1702 | 1702 | print '</td>'; |
| 1703 | 1703 | if ($conf->browser->layout == 'phone') { |
| 1704 | 1704 | print '</tr><tr>'; |
@@ -1739,7 +1739,7 @@ discard block |
||
| 1739 | 1739 | |
| 1740 | 1740 | // VAT reverse charge by default |
| 1741 | 1741 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
| 1742 | - print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">'; |
|
| 1742 | + print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">'; |
|
| 1743 | 1743 | print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
| 1744 | 1744 | print '</td></tr>'; |
| 1745 | 1745 | } |
@@ -1748,21 +1748,21 @@ discard block |
||
| 1748 | 1748 | //TODO: Place into a function to control showing by country or study better option |
| 1749 | 1749 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
| 1750 | 1750 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>'; |
| 1751 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1751 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
| 1752 | 1752 | print '</td>'; |
| 1753 | 1753 | if ($conf->browser->layout == 'phone') { |
| 1754 | 1754 | print '</tr><tr>'; |
| 1755 | 1755 | } |
| 1756 | 1756 | print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>'; |
| 1757 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1757 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
| 1758 | 1758 | print '</td></tr>'; |
| 1759 | 1759 | } elseif ($mysoc->localtax1_assuj == "1") { |
| 1760 | 1760 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
| 1761 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1761 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
| 1762 | 1762 | print '</td></tr>'; |
| 1763 | 1763 | } elseif ($mysoc->localtax2_assuj == "1") { |
| 1764 | 1764 | print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
| 1765 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1765 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
| 1766 | 1766 | print '</td></tr>'; |
| 1767 | 1767 | } |
| 1768 | 1768 | |
@@ -2003,10 +2003,10 @@ discard block |
||
| 2003 | 2003 | } |
| 2004 | 2004 | |
| 2005 | 2005 | $object->phone = GETPOST('phone', 'alpha'); |
| 2006 | - $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
| 2006 | + $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
| 2007 | 2007 | $object->fax = GETPOST('fax', 'alpha'); |
| 2008 | 2008 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
| 2009 | - $object->no_email = GETPOSTINT("no_email"); |
|
| 2009 | + $object->no_email = GETPOSTINT("no_email"); |
|
| 2010 | 2010 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
| 2011 | 2011 | $object->capital = GETPOST('capital', 'alphanohtml'); |
| 2012 | 2012 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
@@ -2022,16 +2022,16 @@ discard block |
||
| 2022 | 2022 | $object->default_lang = GETPOST('default_lang', 'alpha'); |
| 2023 | 2023 | |
| 2024 | 2024 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
| 2025 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 2025 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 2026 | 2026 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
| 2027 | - $object->status = GETPOSTINT('status'); |
|
| 2027 | + $object->status = GETPOSTINT('status'); |
|
| 2028 | 2028 | |
| 2029 | 2029 | // Webservices url/key |
| 2030 | 2030 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
| 2031 | 2031 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
| 2032 | 2032 | |
| 2033 | 2033 | if (GETPOSTISSET('accountancy_code_sell')) { |
| 2034 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 2034 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 2035 | 2035 | |
| 2036 | 2036 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
| 2037 | 2037 | $object->accountancy_code_sell = ''; |
@@ -2040,7 +2040,7 @@ discard block |
||
| 2040 | 2040 | } |
| 2041 | 2041 | } |
| 2042 | 2042 | if (GETPOSTISSET('accountancy_code_buy')) { |
| 2043 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 2043 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 2044 | 2044 | |
| 2045 | 2045 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
| 2046 | 2046 | $object->accountancy_code_buy = ''; |
@@ -2122,7 +2122,7 @@ discard block |
||
| 2122 | 2122 | } |
| 2123 | 2123 | }); |
| 2124 | 2124 | |
| 2125 | - var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . '; |
|
| 2125 | + var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').'; |
|
| 2126 | 2126 | |
| 2127 | 2127 | init_customer_categ(); |
| 2128 | 2128 | $("#customerprospect").change(function() { |
@@ -2471,14 +2471,14 @@ discard block |
||
| 2471 | 2471 | |
| 2472 | 2472 | // VAT is used |
| 2473 | 2473 | print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">'; |
| 2474 | - print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2474 | + print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2475 | 2475 | print '</td></tr>'; |
| 2476 | 2476 | |
| 2477 | 2477 | // Local Taxes |
| 2478 | 2478 | //TODO: Place into a function to control showing by country or study better option |
| 2479 | 2479 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
| 2480 | 2480 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>'; |
| 2481 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2481 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2482 | 2482 | if (!isOnlyOneLocalTax(1)) { |
| 2483 | 2483 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2484 | 2484 | $formcompany->select_localtax(1, $object->localtax1_value, "lt1"); |
@@ -2487,7 +2487,7 @@ discard block |
||
| 2487 | 2487 | print '</td>'; |
| 2488 | 2488 | print '</tr><tr>'; |
| 2489 | 2489 | print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>'; |
| 2490 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>'; |
|
| 2490 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>'; |
|
| 2491 | 2491 | if (!isOnlyOneLocalTax(2)) { |
| 2492 | 2492 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2493 | 2493 | $formcompany->select_localtax(2, $object->localtax2_value, "lt2"); |
@@ -2496,7 +2496,7 @@ discard block |
||
| 2496 | 2496 | print '</td></tr>'; |
| 2497 | 2497 | } elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") { |
| 2498 | 2498 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">'; |
| 2499 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2499 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2500 | 2500 | if (!isOnlyOneLocalTax(1)) { |
| 2501 | 2501 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2502 | 2502 | $formcompany->select_localtax(1, $object->localtax1_value, "lt1"); |
@@ -2505,7 +2505,7 @@ discard block |
||
| 2505 | 2505 | print '</td></tr>'; |
| 2506 | 2506 | } elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") { |
| 2507 | 2507 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">'; |
| 2508 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2508 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2509 | 2509 | if (!isOnlyOneLocalTax(2)) { |
| 2510 | 2510 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2511 | 2511 | $formcompany->select_localtax(2, $object->localtax2_value, "lt2"); |
@@ -2516,7 +2516,7 @@ discard block |
||
| 2516 | 2516 | |
| 2517 | 2517 | // VAT reverse charge by default |
| 2518 | 2518 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
| 2519 | - print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">'; |
|
| 2519 | + print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">'; |
|
| 2520 | 2520 | print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
| 2521 | 2521 | print '</td></tr>'; |
| 2522 | 2522 | } |
@@ -2685,7 +2685,7 @@ discard block |
||
| 2685 | 2685 | $maxfilesizearray = getMaxFileSizeArray(); |
| 2686 | 2686 | $maxmin = $maxfilesizearray['maxmin']; |
| 2687 | 2687 | if ($maxmin > 0) { |
| 2688 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 2688 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 2689 | 2689 | } |
| 2690 | 2690 | print '<input type="file" class="flat" name="photo" id="photoinput">'; |
| 2691 | 2691 | print '</td></tr>'; |
@@ -2916,7 +2916,7 @@ discard block |
||
| 2916 | 2916 | print '<tr><td>'; |
| 2917 | 2917 | print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc')); |
| 2918 | 2918 | print '</td><td>'; |
| 2919 | - print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>'; |
|
| 2919 | + print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>'; |
|
| 2920 | 2920 | print '</td>'; |
| 2921 | 2921 | print '</tr>'; |
| 2922 | 2922 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * \brief File of class with all html predefined components for WebPortal |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; |
|
| 29 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Class to manage generation of HTML components |
@@ -72,19 +72,19 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | $out = ''; |
| 74 | 74 | if ($label != '') { |
| 75 | - $out .= '<label for="' . $id . '">'; |
|
| 75 | + $out .= '<label for="'.$id.'">'; |
|
| 76 | 76 | } |
| 77 | - $out .= '<input type="' . $type . '"'; |
|
| 78 | - $out .= ($morecss ? ' class="' . $morecss . '"' : ''); |
|
| 77 | + $out .= '<input type="'.$type.'"'; |
|
| 78 | + $out .= ($morecss ? ' class="'.$morecss.'"' : ''); |
|
| 79 | 79 | if ($id != '') { |
| 80 | - $out .= ' id="' . $id . '"'; |
|
| 80 | + $out .= ' id="'.$id.'"'; |
|
| 81 | 81 | } |
| 82 | - $out .= ' name="' . $name . '"'; |
|
| 83 | - $out .= ' value="' . $value . '"'; |
|
| 84 | - $out .= ($moreparam ? ' ' . $moreparam : ''); |
|
| 85 | - $out .= ' />' . $addInputLabel; |
|
| 82 | + $out .= ' name="'.$name.'"'; |
|
| 83 | + $out .= ' value="'.$value.'"'; |
|
| 84 | + $out .= ($moreparam ? ' '.$moreparam : ''); |
|
| 85 | + $out .= ' />'.$addInputLabel; |
|
| 86 | 86 | if ($label != '') { |
| 87 | - $out .= $label . '</label>'; |
|
| 87 | + $out .= $label.'</label>'; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | return $out; |
@@ -164,16 +164,16 @@ discard block |
||
| 164 | 164 | $out = ''; |
| 165 | 165 | |
| 166 | 166 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
| 167 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '"' . ($disabled ? ' disabled="disabled"' : '') . ' class="' . ($morecss ? ' ' . $morecss : '') . '"'; |
|
| 168 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '"' . ($moreparam ? ' ' . $moreparam : ''); |
|
| 169 | - $out .= '>' . "\n"; |
|
| 167 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'"'.($disabled ? ' disabled="disabled"' : '').' class="'.($morecss ? ' '.$morecss : '').'"'; |
|
| 168 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'"'.($moreparam ? ' '.$moreparam : ''); |
|
| 169 | + $out .= '>'."\n"; |
|
| 170 | 170 | |
| 171 | 171 | if ($show_empty) { |
| 172 | 172 | $textforempty = ' '; |
| 173 | 173 | if (!is_numeric($show_empty)) { |
| 174 | 174 | $textforempty = $show_empty; |
| 175 | 175 | } |
| 176 | - $out .= '<option value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 176 | + $out .= '<option value="'.($show_empty < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | if (is_array($array)) { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | if ($key_in_label) { |
| 208 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 208 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 209 | 209 | } else { |
| 210 | 210 | $selectOptionValue = dol_escape_htmltag($maxlen ? dol_trunc($value, $maxlen) : $value); |
| 211 | 211 | if ($value == '' || $value == '-') { |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - $out .= '<option value="' . $key . '"'; |
|
| 216 | + $out .= '<option value="'.$key.'"'; |
|
| 217 | 217 | $out .= $disabled; |
| 218 | 218 | if (is_array($id)) { |
| 219 | 219 | if (in_array($key, $id) && !$disabled) { |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | if (is_array($tmpvalue)) { |
| 229 | 229 | foreach ($tmpvalue as $keyforvalue => $valueforvalue) { |
| 230 | 230 | if (preg_match('/^data-/', $keyforvalue)) { |
| 231 | - $out .= ' ' . $keyforvalue . '="' . dol_escape_htmltag($valueforvalue) . '"'; |
|
| 231 | + $out .= ' '.$keyforvalue.'="'.dol_escape_htmltag($valueforvalue).'"'; |
|
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | } |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = '', $morecss = '', $allfiles = 0) |
| 260 | 260 | { |
| 261 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 261 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 262 | 262 | |
| 263 | 263 | $out = ''; |
| 264 | 264 | |
@@ -274,21 +274,21 @@ discard block |
||
| 274 | 274 | // Get object entity |
| 275 | 275 | if (isModEnabled('multicompany')) { |
| 276 | 276 | $regs = array(); |
| 277 | - preg_match('/\/([0-9]+)\/[^\/]+\/' . preg_quote($modulesubdir, '/') . '$/', $filedir, $regs); |
|
| 277 | + preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir, '/').'$/', $filedir, $regs); |
|
| 278 | 278 | $entity = ((!empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | // Get list of files starting with name of ref (Note: files with '^ref\.extension' are generated files, files with '^ref-...' are uploaded files) |
| 282 | 282 | if ($allfiles || getDolGlobalString('MAIN_SHOW_ALL_FILES_ON_DOCUMENT_TOOLTIP')) { |
| 283 | - $filterforfilesearch = '^' . preg_quote(basename($modulesubdir), '/'); |
|
| 283 | + $filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/'); |
|
| 284 | 284 | } else { |
| 285 | - $filterforfilesearch = '^' . preg_quote(basename($modulesubdir), '/') . '\.'; |
|
| 285 | + $filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/').'\.'; |
|
| 286 | 286 | } |
| 287 | 287 | $file_list = dol_dir_list($filedir, 'files', 0, $filterforfilesearch, '\.meta$|\.png$'); // We also discard .meta and .png preview |
| 288 | 288 | |
| 289 | 289 | //var_dump($file_list); |
| 290 | 290 | // For ajax treatment |
| 291 | - $out .= '<!-- html.formwebportal::getDocumentsLink -->' . "\n"; |
|
| 291 | + $out .= '<!-- html.formwebportal::getDocumentsLink -->'."\n"; |
|
| 292 | 292 | if (!empty($file_list)) { |
| 293 | 293 | $tmpout = ''; |
| 294 | 294 | |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | $i = 0; |
| 298 | 298 | foreach ($file_list as $file) { |
| 299 | 299 | $i++; |
| 300 | - if ($filter && !preg_match('/' . $filter . '/i', $file["name"])) { |
|
| 300 | + if ($filter && !preg_match('/'.$filter.'/i', $file["name"])) { |
|
| 301 | 301 | continue; // Discard this. It does not match provided filter. |
| 302 | 302 | } |
| 303 | 303 | |
@@ -305,11 +305,11 @@ discard block |
||
| 305 | 305 | // Define relative path for download link (depends on module) |
| 306 | 306 | $relativepath = $file["name"]; // Cas general |
| 307 | 307 | if ($modulesubdir) { |
| 308 | - $relativepath = $modulesubdir . "/" . $file["name"]; // Cas propal, facture... |
|
| 308 | + $relativepath = $modulesubdir."/".$file["name"]; // Cas propal, facture... |
|
| 309 | 309 | } |
| 310 | 310 | // Autre cas |
| 311 | 311 | if ($modulepart == 'donation') { |
| 312 | - $relativepath = get_exdir($modulesubdir, 2, 0, 0, null, 'donation') . $file["name"]; |
|
| 312 | + $relativepath = get_exdir($modulesubdir, 2, 0, 0, null, 'donation').$file["name"]; |
|
| 313 | 313 | } |
| 314 | 314 | if ($modulepart == 'export') { |
| 315 | 315 | $relativepath = $file["name"]; |
@@ -325,8 +325,8 @@ discard block |
||
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | // Download |
| 328 | - $url = $context->getControllerUrl('document') . '&modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($relativepath) . '&soc_id=' . $context->logged_thirdparty->id; |
|
| 329 | - $tmpout .= '<a href="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . ' role="downloadlink"'; |
|
| 328 | + $url = $context->getControllerUrl('document').'&modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($relativepath).'&soc_id='.$context->logged_thirdparty->id; |
|
| 329 | + $tmpout .= '<a href="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').' role="downloadlink"'; |
|
| 330 | 330 | $mime = dol_mimetype($relativepath, '', 0); |
| 331 | 331 | if (preg_match('/text/', $mime)) { |
| 332 | 332 | $tmpout .= ' target="_blank" rel="noopener noreferrer"'; |
@@ -359,10 +359,10 @@ discard block |
||
| 359 | 359 | { |
| 360 | 360 | global $langs; |
| 361 | 361 | require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; |
| 362 | - $out = '<!-- html.formwebportal::getSignatureLink -->' . "\n"; |
|
| 362 | + $out = '<!-- html.formwebportal::getSignatureLink -->'."\n"; |
|
| 363 | 363 | $url = getOnlineSignatureUrl(0, $modulepart, $object->ref, 1, $object); |
| 364 | 364 | if (!empty($url)) { |
| 365 | - $out .= '<a target="_blank" rel="noopener noreferrer" href="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . ' role="signaturelink">'; |
|
| 365 | + $out .= '<a target="_blank" rel="noopener noreferrer" href="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').' role="signaturelink">'; |
|
| 366 | 366 | $out .= '<i class="fa fa-file-signature"></i>'; |
| 367 | 367 | $out .= $langs->trans("Sign"); |
| 368 | 368 | $out .= '</a>'; |
@@ -404,9 +404,9 @@ discard block |
||
| 404 | 404 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
| 405 | 405 | $reg = array(); |
| 406 | 406 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
| 407 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 407 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 408 | 408 | } |
| 409 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 409 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 410 | 410 | |
| 411 | 411 | $classname = $InfoFieldList[0]; |
| 412 | 412 | $classpath = $InfoFieldList[1]; |
@@ -429,11 +429,11 @@ discard block |
||
| 429 | 429 | } |
| 430 | 430 | } |
| 431 | 431 | if (!is_object($objecttmp)) { |
| 432 | - dol_syslog('Error bad setup of type for field ' . implode(',', $InfoFieldList), LOG_WARNING); |
|
| 433 | - return 'Error bad setup of type for field ' . implode(',', $InfoFieldList); |
|
| 432 | + dol_syslog('Error bad setup of type for field '.implode(',', $InfoFieldList), LOG_WARNING); |
|
| 433 | + return 'Error bad setup of type for field '.implode(',', $InfoFieldList); |
|
| 434 | 434 | } |
| 435 | 435 | |
| 436 | - dol_syslog(__METHOD__ . ' filter=' . $filter, LOG_DEBUG); |
|
| 436 | + dol_syslog(__METHOD__.' filter='.$filter, LOG_DEBUG); |
|
| 437 | 437 | $out = ''; |
| 438 | 438 | // Immediate load of table record. |
| 439 | 439 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | if ($prefixforautocompletemode == 'societe') { |
| 470 | 470 | $prefixforautocompletemode = 'company'; |
| 471 | 471 | } |
| 472 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 472 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 473 | 473 | |
| 474 | 474 | if (in_array($objecttmp->element, array('adherent_type'))) { |
| 475 | 475 | $fieldstoshow = 't.libelle'; |
@@ -477,11 +477,11 @@ discard block |
||
| 477 | 477 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
| 478 | 478 | $tmpfieldstoshow = ''; |
| 479 | 479 | foreach ($objecttmp->fields as $key => $val) { |
| 480 | - if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 480 | + if (!(int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 481 | 481 | continue; |
| 482 | 482 | } |
| 483 | 483 | if (!empty($val['showoncombobox'])) { |
| 484 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
| 484 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
| 485 | 485 | } |
| 486 | 486 | } |
| 487 | 487 | if ($tmpfieldstoshow) { |
@@ -509,11 +509,11 @@ discard block |
||
| 509 | 509 | $num = 0; |
| 510 | 510 | |
| 511 | 511 | // Search data |
| 512 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
| 512 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
| 513 | 513 | if (isset($objecttmp->ismultientitymanaged)) { |
| 514 | 514 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 515 | 515 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
| 516 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
| 516 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
| 517 | 517 | } |
| 518 | 518 | } |
| 519 | 519 | |
@@ -532,10 +532,10 @@ discard block |
||
| 532 | 532 | $sql .= " WHERE 1=1"; |
| 533 | 533 | if (isset($objecttmp->ismultientitymanaged)) { |
| 534 | 534 | if ($objecttmp->ismultientitymanaged == 1) { |
| 535 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
| 535 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
| 536 | 536 | } |
| 537 | 537 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 538 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
| 538 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
| 539 | 539 | } |
| 540 | 540 | } |
| 541 | 541 | if ($searchkey != '') { |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | $errormessage = ''; |
| 547 | 547 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
| 548 | 548 | if ($errormessage) { |
| 549 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
| 549 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
| 550 | 550 | } |
| 551 | 551 | } |
| 552 | 552 | } |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | $resql = $this->db->query($sql); |
| 557 | 557 | if ($resql) { |
| 558 | 558 | // Construct $out and $outarray |
| 559 | - $out .= '<select id="' . $htmlname . '" class="' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
| 559 | + $out .= '<select id="'.$htmlname.'" class="'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
| 560 | 560 | |
| 561 | 561 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
| 562 | 562 | $textifempty = ' '; |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | } |
| 571 | 571 | } |
| 572 | 572 | if ($showempty) { |
| 573 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
| 573 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | $num = $this->db->num_rows($resql); |
@@ -593,9 +593,9 @@ discard block |
||
| 593 | 593 | } |
| 594 | 594 | if (empty($outputmode)) { |
| 595 | 595 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
| 596 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 596 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 597 | 597 | } else { |
| 598 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 598 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 599 | 599 | } |
| 600 | 600 | } else { |
| 601 | 601 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | } |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | - $out .= '</select>' . "\n"; |
|
| 611 | + $out .= '</select>'."\n"; |
|
| 612 | 612 | } else { |
| 613 | 613 | dol_print_error($this->db); |
| 614 | 614 | } |
@@ -645,22 +645,22 @@ discard block |
||
| 645 | 645 | $size = !empty($val['size']) ? $val['size'] : 0; |
| 646 | 646 | // see common object class |
| 647 | 647 | if (preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 648 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N'); |
|
| 648 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); |
|
| 649 | 649 | $type = 'link'; |
| 650 | 650 | } elseif (preg_match('/^(integer|link):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 651 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
| 651 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
| 652 | 652 | $type = 'link'; |
| 653 | 653 | } elseif (preg_match('/^(integer|link):(.*):(.*)/i', $val['type'], $reg)) { |
| 654 | - $param['options'] = array($reg[2] . ':' . $reg[3] => 'N'); |
|
| 654 | + $param['options'] = array($reg[2].':'.$reg[3] => 'N'); |
|
| 655 | 655 | $type = 'link'; |
| 656 | 656 | } elseif (preg_match('/^(sellist):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 657 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N'); |
|
| 657 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); |
|
| 658 | 658 | $type = 'sellist'; |
| 659 | 659 | } elseif (preg_match('/^(sellist):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 660 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
| 660 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
| 661 | 661 | $type = 'sellist'; |
| 662 | 662 | } elseif (preg_match('/^(sellist):(.*):(.*)/i', $val['type'], $reg)) { |
| 663 | - $param['options'] = array($reg[2] . ':' . $reg[3] => 'N'); |
|
| 663 | + $param['options'] = array($reg[2].':'.$reg[3] => 'N'); |
|
| 664 | 664 | $type = 'sellist'; |
| 665 | 665 | } elseif (preg_match('/^varchar\((\d+)\)/', $val['type'], $reg)) { |
| 666 | 666 | $param['options'] = array(); |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | |
| 699 | 699 | if ($computed) { |
| 700 | 700 | if (!preg_match('/^search_/', $keyprefix)) { |
| 701 | - return '<span>' . $langs->trans("AutomaticallyCalculated") . '</span>'; |
|
| 701 | + return '<span>'.$langs->trans("AutomaticallyCalculated").'</span>'; |
|
| 702 | 702 | } else { |
| 703 | 703 | return ''; |
| 704 | 704 | } |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | $morecss = $val['css']; |
| 710 | 710 | } |
| 711 | 711 | |
| 712 | - $htmlName = $keyprefix . $key . $keysuffix; |
|
| 712 | + $htmlName = $keyprefix.$key.$keysuffix; |
|
| 713 | 713 | $htmlId = $htmlName; |
| 714 | 714 | //$moreparam .= (!empty($required) ? ' required' : ''); |
| 715 | 715 | switch ($type) { |
@@ -729,7 +729,7 @@ discard block |
||
| 729 | 729 | |
| 730 | 730 | if ($type == 'datetime') { |
| 731 | 731 | //$moreparam .= ' step="1"'; to show seconds |
| 732 | - $out .= ' ' . $this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam); |
|
| 732 | + $out .= ' '.$this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam); |
|
| 733 | 733 | } |
| 734 | 734 | break; |
| 735 | 735 | |
@@ -739,7 +739,7 @@ discard block |
||
| 739 | 739 | |
| 740 | 740 | case 'text': |
| 741 | 741 | case 'html': |
| 742 | - $moreparam .= ($size > 0 ? ' maxlength="' . $size . '"' : ''); |
|
| 742 | + $moreparam .= ($size > 0 ? ' maxlength="'.$size.'"' : ''); |
|
| 743 | 743 | $out = $this->inputType('text', $htmlName, dol_escape_htmltag($value), $htmlId, $morecss, $moreparam); |
| 744 | 744 | break; |
| 745 | 745 | |
@@ -759,7 +759,7 @@ discard block |
||
| 759 | 759 | if (!empty($value)) { |
| 760 | 760 | $value = price($value); // $value in memory is a php numeric, we format it into user number format. |
| 761 | 761 | } |
| 762 | - $addInputLabel = ' ' . $langs->getCurrencySymbol($conf->currency); |
|
| 762 | + $addInputLabel = ' '.$langs->getCurrencySymbol($conf->currency); |
|
| 763 | 763 | $out = $this->inputType('text', $htmlName, $value, $htmlId, $morecss, $moreparam, '', $addInputLabel); |
| 764 | 764 | break; |
| 765 | 765 | |
@@ -776,14 +776,14 @@ discard block |
||
| 776 | 776 | |
| 777 | 777 | case 'radio': |
| 778 | 778 | foreach ($param['options'] as $keyopt => $valopt) { |
| 779 | - $htmlId = $htmlName . '_' . $keyopt; |
|
| 780 | - $htmlMoreParam = $moreparam . ($value == $keyopt ? ' checked' : ''); |
|
| 781 | - $out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt) . '<br>'; |
|
| 779 | + $htmlId = $htmlName.'_'.$keyopt; |
|
| 780 | + $htmlMoreParam = $moreparam.($value == $keyopt ? ' checked' : ''); |
|
| 781 | + $out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt).'<br>'; |
|
| 782 | 782 | } |
| 783 | 783 | break; |
| 784 | 784 | |
| 785 | 785 | case 'select': |
| 786 | - $out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . ' >'; |
|
| 786 | + $out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').' >'; |
|
| 787 | 787 | if ($default == '' || $notNull != 1) { |
| 788 | 788 | $out .= '<option value="0"> </option>'; |
| 789 | 789 | } |
@@ -794,15 +794,15 @@ discard block |
||
| 794 | 794 | if (strpos($valb, "|") !== false) { |
| 795 | 795 | list($valb, $parent) = explode('|', $valb); |
| 796 | 796 | } |
| 797 | - $out .= '<option value="' . $keyb . '"'; |
|
| 797 | + $out .= '<option value="'.$keyb.'"'; |
|
| 798 | 798 | $out .= (((string) $value == $keyb) ? ' selected' : ''); |
| 799 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
| 800 | - $out .= '>' . $valb . '</option>'; |
|
| 799 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
| 800 | + $out .= '>'.$valb.'</option>'; |
|
| 801 | 801 | } |
| 802 | 802 | $out .= '</select>'; |
| 803 | 803 | break; |
| 804 | 804 | case 'sellist': |
| 805 | - $out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . '>'; |
|
| 805 | + $out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').'>'; |
|
| 806 | 806 | |
| 807 | 807 | $param_list = array_keys($param['options']); |
| 808 | 808 | $InfoFieldList = explode(":", $param_list[0]); |
@@ -815,18 +815,18 @@ discard block |
||
| 815 | 815 | // 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value |
| 816 | 816 | // 5 : id category type |
| 817 | 817 | // 6 : ids categories list separated by comma for category root |
| 818 | - $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2] . ' as rowid'); |
|
| 818 | + $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid'); |
|
| 819 | 819 | |
| 820 | 820 | if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { |
| 821 | 821 | if (strpos($InfoFieldList[4], 'extra.') !== false) { |
| 822 | - $keyList = 'main.' . $InfoFieldList[2] . ' as rowid'; |
|
| 822 | + $keyList = 'main.'.$InfoFieldList[2].' as rowid'; |
|
| 823 | 823 | } else { |
| 824 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
| 824 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
| 825 | 825 | } |
| 826 | 826 | } |
| 827 | 827 | if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) { |
| 828 | 828 | list($parentName, $parentField) = explode('|', $InfoFieldList[3]); |
| 829 | - $keyList .= ', ' . $parentField; |
|
| 829 | + $keyList .= ', '.$parentField; |
|
| 830 | 830 | } |
| 831 | 831 | |
| 832 | 832 | $filter_categorie = false; |
@@ -844,8 +844,8 @@ discard block |
||
| 844 | 844 | } |
| 845 | 845 | |
| 846 | 846 | $sqlwhere = ''; |
| 847 | - $sql = "SELECT " . $keyList; |
|
| 848 | - $sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0]; |
|
| 847 | + $sql = "SELECT ".$keyList; |
|
| 848 | + $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; |
|
| 849 | 849 | if (!empty($InfoFieldList[4])) { |
| 850 | 850 | // can use SELECT request |
| 851 | 851 | if (strpos($InfoFieldList[4], '$SEL$') !== false) { |
@@ -857,24 +857,24 @@ discard block |
||
| 857 | 857 | |
| 858 | 858 | //We have to join on extrafield table |
| 859 | 859 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 860 | - $sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra"; |
|
| 861 | - $sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4]; |
|
| 860 | + $sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra"; |
|
| 861 | + $sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4]; |
|
| 862 | 862 | } else { |
| 863 | - $sqlwhere .= " WHERE " . $InfoFieldList[4]; |
|
| 863 | + $sqlwhere .= " WHERE ".$InfoFieldList[4]; |
|
| 864 | 864 | } |
| 865 | 865 | } else { |
| 866 | 866 | $sqlwhere .= ' WHERE 1=1'; |
| 867 | 867 | } |
| 868 | 868 | // Some tables may have field, some other not. For the moment we disable it. |
| 869 | 869 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
| 870 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
| 870 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
| 871 | 871 | } |
| 872 | 872 | $sql .= $sqlwhere; |
| 873 | 873 | //print $sql; |
| 874 | 874 | |
| 875 | - $sql .= ' ORDER BY ' . implode(', ', $fields_label); |
|
| 875 | + $sql .= ' ORDER BY '.implode(', ', $fields_label); |
|
| 876 | 876 | |
| 877 | - dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); |
|
| 877 | + dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
|
| 878 | 878 | $resql = $this->db->query($sql); |
| 879 | 879 | if ($resql) { |
| 880 | 880 | $out .= '<option value="0"> </option>'; |
@@ -890,7 +890,7 @@ discard block |
||
| 890 | 890 | if (count($fields_label) > 1) { |
| 891 | 891 | $notrans = true; |
| 892 | 892 | foreach ($fields_label as $field_toshow) { |
| 893 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
| 893 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
| 894 | 894 | } |
| 895 | 895 | } else { |
| 896 | 896 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -901,12 +901,12 @@ discard block |
||
| 901 | 901 | foreach ($fields_label as $field_toshow) { |
| 902 | 902 | $translabel = $langs->trans($obj->$field_toshow); |
| 903 | 903 | if ($translabel != $obj->$field_toshow) { |
| 904 | - $labeltoshow = dol_trunc($translabel) . ' '; |
|
| 904 | + $labeltoshow = dol_trunc($translabel).' '; |
|
| 905 | 905 | } else { |
| 906 | - $labeltoshow = dol_trunc($obj->$field_toshow) . ' '; |
|
| 906 | + $labeltoshow = dol_trunc($obj->$field_toshow).' '; |
|
| 907 | 907 | } |
| 908 | 908 | } |
| 909 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
| 909 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
| 910 | 910 | } else { |
| 911 | 911 | if (!$notrans) { |
| 912 | 912 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
@@ -920,28 +920,28 @@ discard block |
||
| 920 | 920 | $labeltoshow = '(not defined)'; |
| 921 | 921 | } |
| 922 | 922 | if ($value == $obj->rowid) { |
| 923 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
| 923 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
| 924 | 924 | } |
| 925 | 925 | |
| 926 | 926 | if (!empty($InfoFieldList[3]) && $parentField) { |
| 927 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
| 927 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
| 928 | 928 | $isDependList = 1; |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 931 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 932 | 932 | $out .= ($value == $obj->rowid ? ' selected' : ''); |
| 933 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
| 934 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 933 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
| 934 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 935 | 935 | } |
| 936 | 936 | |
| 937 | 937 | $i++; |
| 938 | 938 | } |
| 939 | 939 | $this->db->free($resql); |
| 940 | 940 | } else { |
| 941 | - $out .= 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
| 941 | + $out .= 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
| 942 | 942 | } |
| 943 | 943 | } else { |
| 944 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 944 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 945 | 945 | $categorytype = $InfoFieldList[5]; |
| 946 | 946 | if (is_numeric($categorytype)) { |
| 947 | 947 | $categorytype = Categorie::$MAP_ID_TO_CODE[$categorytype]; // For backward compatibility |
@@ -949,9 +949,9 @@ discard block |
||
| 949 | 949 | $data = $this->select_all_categories($categorytype, '', 'parent', 64, $InfoFieldList[6], 1, 1); |
| 950 | 950 | $out .= '<option value="0"> </option>'; |
| 951 | 951 | foreach ($data as $data_key => $data_value) { |
| 952 | - $out .= '<option value="' . $data_key . '"'; |
|
| 952 | + $out .= '<option value="'.$data_key.'"'; |
|
| 953 | 953 | $out .= ($value == $data_key ? ' selected' : ''); |
| 954 | - $out .= '>' . $data_value . '</option>'; |
|
| 954 | + $out .= '>'.$data_value.'</option>'; |
|
| 955 | 955 | } |
| 956 | 956 | } |
| 957 | 957 | $out .= '</select>'; |
@@ -1024,19 +1024,19 @@ discard block |
||
| 1024 | 1024 | } |
| 1025 | 1025 | if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) { |
| 1026 | 1026 | $type = 'link'; |
| 1027 | - $stringforoptions = $reg[1] . ':' . $reg[2]; |
|
| 1027 | + $stringforoptions = $reg[1].':'.$reg[2]; |
|
| 1028 | 1028 | if ($reg[1] == 'User') { |
| 1029 | 1029 | $stringforoptions .= ':-1'; |
| 1030 | 1030 | } |
| 1031 | 1031 | $param['options'] = array($stringforoptions => $stringforoptions); |
| 1032 | 1032 | } elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 1033 | - $param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
| 1033 | + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
| 1034 | 1034 | $type = 'sellist'; |
| 1035 | 1035 | } elseif (preg_match('/^sellist:(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 1036 | - $param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] => 'N'); |
|
| 1036 | + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3] => 'N'); |
|
| 1037 | 1037 | $type = 'sellist'; |
| 1038 | 1038 | } elseif (preg_match('/^sellist:(.*):(.*)/i', $val['type'], $reg)) { |
| 1039 | - $param['options'] = array($reg[1] . ':' . $reg[2] => 'N'); |
|
| 1039 | + $param['options'] = array($reg[1].':'.$reg[2] => 'N'); |
|
| 1040 | 1040 | $type = 'sellist'; |
| 1041 | 1041 | } elseif (preg_match('/^chkbxlst:(.*)/i', $val['type'], $reg)) { |
| 1042 | 1042 | $param['options'] = array($reg[1] => 'N'); |
@@ -1089,7 +1089,7 @@ discard block |
||
| 1089 | 1089 | // |
| 1090 | 1090 | } elseif ($type == 'date') { |
| 1091 | 1091 | if (!empty($value)) { |
| 1092 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
| 1092 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
| 1093 | 1093 | } else { |
| 1094 | 1094 | $value = ''; |
| 1095 | 1095 | } |
@@ -1100,7 +1100,7 @@ discard block |
||
| 1100 | 1100 | $value = ''; |
| 1101 | 1101 | } |
| 1102 | 1102 | } elseif ($type == 'duration') { |
| 1103 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 1103 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 1104 | 1104 | if (!is_null($value) && $value !== '') { |
| 1105 | 1105 | $value = convertSecondToTime((int) $value, 'allhourmin'); |
| 1106 | 1106 | } |
@@ -1113,7 +1113,7 @@ discard block |
||
| 1113 | 1113 | if (!empty($value)) { |
| 1114 | 1114 | $checked = ' checked '; |
| 1115 | 1115 | } |
| 1116 | - $value = '<input type="checkbox" ' . $checked . ' ' . ($moreparam ? $moreparam : '') . ' readonly disabled>'; |
|
| 1116 | + $value = '<input type="checkbox" '.$checked.' '.($moreparam ? $moreparam : '').' readonly disabled>'; |
|
| 1117 | 1117 | } elseif ($type == 'mail' || $type == 'email') { |
| 1118 | 1118 | $value = dol_print_email($value, 0, 0, 0, 64, 1, 1); |
| 1119 | 1119 | } elseif ($type == 'url') { |
@@ -1137,7 +1137,7 @@ discard block |
||
| 1137 | 1137 | |
| 1138 | 1138 | if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { |
| 1139 | 1139 | $selectkey = $InfoFieldList[2]; |
| 1140 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
| 1140 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
| 1141 | 1141 | } |
| 1142 | 1142 | |
| 1143 | 1143 | $fields_label = explode('|', $InfoFieldList[1]); |
@@ -1153,20 +1153,20 @@ discard block |
||
| 1153 | 1153 | } |
| 1154 | 1154 | } |
| 1155 | 1155 | |
| 1156 | - $sql = "SELECT " . $keyList; |
|
| 1157 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
| 1156 | + $sql = "SELECT ".$keyList; |
|
| 1157 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
| 1158 | 1158 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 1159 | 1159 | $sql .= ' as main'; |
| 1160 | 1160 | } |
| 1161 | 1161 | if ($selectkey == 'rowid' && empty($value)) { |
| 1162 | - $sql .= " WHERE " . $selectkey . " = 0"; |
|
| 1162 | + $sql .= " WHERE ".$selectkey." = 0"; |
|
| 1163 | 1163 | } elseif ($selectkey == 'rowid') { |
| 1164 | - $sql .= " WHERE " . $selectkey . " = " . ((int) $value); |
|
| 1164 | + $sql .= " WHERE ".$selectkey." = ".((int) $value); |
|
| 1165 | 1165 | } else { |
| 1166 | - $sql .= " WHERE " . $selectkey . " = '" . $this->db->escape($value) . "'"; |
|
| 1166 | + $sql .= " WHERE ".$selectkey." = '".$this->db->escape($value)."'"; |
|
| 1167 | 1167 | } |
| 1168 | 1168 | |
| 1169 | - dol_syslog(__METHOD__ . ' type=sellist', LOG_DEBUG); |
|
| 1169 | + dol_syslog(__METHOD__.' type=sellist', LOG_DEBUG); |
|
| 1170 | 1170 | $resql = $this->db->query($sql); |
| 1171 | 1171 | if ($resql) { |
| 1172 | 1172 | if (!$filter_categorie) { |
@@ -1185,9 +1185,9 @@ discard block |
||
| 1185 | 1185 | $translabel = $langs->trans($obj->$field_toshow); |
| 1186 | 1186 | } |
| 1187 | 1187 | if ($translabel != $field_toshow) { |
| 1188 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
| 1188 | + $value .= dol_trunc($translabel, 18).' '; |
|
| 1189 | 1189 | } else { |
| 1190 | - $value .= $obj->$field_toshow . ' '; |
|
| 1190 | + $value .= $obj->$field_toshow.' '; |
|
| 1191 | 1191 | } |
| 1192 | 1192 | } |
| 1193 | 1193 | } else { |
@@ -1203,7 +1203,7 @@ discard block |
||
| 1203 | 1203 | } |
| 1204 | 1204 | } |
| 1205 | 1205 | } else { |
| 1206 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1206 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1207 | 1207 | |
| 1208 | 1208 | $toprint = array(); |
| 1209 | 1209 | $obj = $this->db->fetch_object($resql); |
@@ -1211,12 +1211,12 @@ discard block |
||
| 1211 | 1211 | $c->fetch($obj->rowid); |
| 1212 | 1212 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 1213 | 1213 | foreach ($ways as $way) { |
| 1214 | - $toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 1214 | + $toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 1215 | 1215 | } |
| 1216 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1216 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
| 1217 | 1217 | } |
| 1218 | 1218 | } else { |
| 1219 | - dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING); |
|
| 1219 | + dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING); |
|
| 1220 | 1220 | } |
| 1221 | 1221 | } elseif ($type == 'radio') { |
| 1222 | 1222 | $value = $param['options'][$value]; |
@@ -1227,11 +1227,11 @@ discard block |
||
| 1227 | 1227 | $toprint = array(); |
| 1228 | 1228 | foreach ($value_arr as $valueval) { |
| 1229 | 1229 | if (!empty($valueval)) { |
| 1230 | - $toprint[] = '<li>' . $param['options'][$valueval] . '</li>'; |
|
| 1230 | + $toprint[] = '<li>'.$param['options'][$valueval].'</li>'; |
|
| 1231 | 1231 | } |
| 1232 | 1232 | } |
| 1233 | 1233 | if (!empty($toprint)) { |
| 1234 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1234 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
| 1235 | 1235 | } |
| 1236 | 1236 | } |
| 1237 | 1237 | } elseif ($type == 'chkbxlst') { |
@@ -1245,7 +1245,7 @@ discard block |
||
| 1245 | 1245 | |
| 1246 | 1246 | if (count($InfoFieldList) >= 3) { |
| 1247 | 1247 | $selectkey = $InfoFieldList[2]; |
| 1248 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
| 1248 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
| 1249 | 1249 | } |
| 1250 | 1250 | |
| 1251 | 1251 | $fields_label = explode('|', $InfoFieldList[1]); |
@@ -1261,15 +1261,15 @@ discard block |
||
| 1261 | 1261 | } |
| 1262 | 1262 | } |
| 1263 | 1263 | |
| 1264 | - $sql = "SELECT " . $keyList; |
|
| 1265 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
| 1264 | + $sql = "SELECT ".$keyList; |
|
| 1265 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
| 1266 | 1266 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 1267 | 1267 | $sql .= ' as main'; |
| 1268 | 1268 | } |
| 1269 | 1269 | // $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'"; |
| 1270 | 1270 | // $sql.= ' AND entity = '.$conf->entity; |
| 1271 | 1271 | |
| 1272 | - dol_syslog(__METHOD__ . ' type=chkbxlst', LOG_DEBUG); |
|
| 1272 | + dol_syslog(__METHOD__.' type=chkbxlst', LOG_DEBUG); |
|
| 1273 | 1273 | $resql = $this->db->query($sql); |
| 1274 | 1274 | if ($resql) { |
| 1275 | 1275 | if (!$filter_categorie) { |
@@ -1286,9 +1286,9 @@ discard block |
||
| 1286 | 1286 | $translabel = $langs->trans($obj->$field_toshow); |
| 1287 | 1287 | } |
| 1288 | 1288 | if ($translabel != $field_toshow) { |
| 1289 | - $toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>'; |
|
| 1289 | + $toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>'; |
|
| 1290 | 1290 | } else { |
| 1291 | - $toprint[] = '<li>' . $obj->$field_toshow . '</li>'; |
|
| 1291 | + $toprint[] = '<li>'.$obj->$field_toshow.'</li>'; |
|
| 1292 | 1292 | } |
| 1293 | 1293 | } |
| 1294 | 1294 | } else { |
@@ -1297,15 +1297,15 @@ discard block |
||
| 1297 | 1297 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
| 1298 | 1298 | } |
| 1299 | 1299 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
| 1300 | - $toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>'; |
|
| 1300 | + $toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>'; |
|
| 1301 | 1301 | } else { |
| 1302 | - $toprint[] = '<li>' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
| 1302 | + $toprint[] = '<li>'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
| 1303 | 1303 | } |
| 1304 | 1304 | } |
| 1305 | 1305 | } |
| 1306 | 1306 | } |
| 1307 | 1307 | } else { |
| 1308 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1308 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1309 | 1309 | |
| 1310 | 1310 | $toprint = array(); |
| 1311 | 1311 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -1314,14 +1314,14 @@ discard block |
||
| 1314 | 1314 | $c->fetch($obj->rowid); |
| 1315 | 1315 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 1316 | 1316 | foreach ($ways as $way) { |
| 1317 | - $toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 1317 | + $toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 1318 | 1318 | } |
| 1319 | 1319 | } |
| 1320 | 1320 | } |
| 1321 | 1321 | } |
| 1322 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1322 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
| 1323 | 1323 | } else { |
| 1324 | - dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING); |
|
| 1324 | + dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING); |
|
| 1325 | 1325 | } |
| 1326 | 1326 | } elseif ($type == 'link') { |
| 1327 | 1327 | // only if something to display (perf) |
@@ -1348,7 +1348,7 @@ discard block |
||
| 1348 | 1348 | } |
| 1349 | 1349 | } |
| 1350 | 1350 | } else { |
| 1351 | - dol_syslog(__METHOD__ . ' Error bad setup of field', LOG_WARNING); |
|
| 1351 | + dol_syslog(__METHOD__.' Error bad setup of field', LOG_WARNING); |
|
| 1352 | 1352 | return 'Error bad setup of field'; |
| 1353 | 1353 | } |
| 1354 | 1354 | } else { |
@@ -26,9 +26,9 @@ discard block |
||
| 26 | 26 | * \brief File of class with all html predefined components for WebPortal |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | -require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; |
|
| 31 | -require_once DOL_DOCUMENT_ROOT . '/webportal/class/html.formwebportal.class.php'; |
|
| 29 | +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; |
|
| 31 | +require_once DOL_DOCUMENT_ROOT.'/webportal/class/html.formwebportal.class.php'; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Class to manage generation of HTML components |
@@ -135,10 +135,10 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // load module libraries |
| 138 | - dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php'); |
|
| 138 | + dol_include_once('/webportal/class/webportal'.$elementEn.'.class.php'); |
|
| 139 | 139 | |
| 140 | 140 | // Initialize a technical objects |
| 141 | - $objectclass = 'WebPortal' . ucfirst($elementEn); |
|
| 141 | + $objectclass = 'WebPortal'.ucfirst($elementEn); |
|
| 142 | 142 | $object = new $objectclass($this->db); |
| 143 | 143 | |
| 144 | 144 | // set form list |
@@ -148,14 +148,14 @@ discard block |
||
| 148 | 148 | $this->sortfield = GETPOST('sortfield', 'aZ09comma'); |
| 149 | 149 | $this->sortorder = GETPOST('sortorder', 'aZ09comma'); |
| 150 | 150 | $this->page = GETPOSTISSET('page') ? GETPOSTINT('page') : 1; |
| 151 | - $this->titleKey = $objectclass . 'ListTitle'; |
|
| 151 | + $this->titleKey = $objectclass.'ListTitle'; |
|
| 152 | 152 | |
| 153 | 153 | // Initialize array of search criteria |
| 154 | 154 | //$search_all = GETPOST('search_all', 'alphanohtml'); |
| 155 | 155 | $search = array(); |
| 156 | 156 | foreach ($object->fields as $key => $val) { |
| 157 | - if (GETPOST('search_' . $key, 'alpha') !== '') { |
|
| 158 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
| 157 | + if (GETPOST('search_'.$key, 'alpha') !== '') { |
|
| 158 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 159 | 159 | } |
| 160 | 160 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 161 | 161 | /* Fix: this is not compatible with multilangage date format, replaced with dolibarr method |
@@ -177,12 +177,12 @@ discard block |
||
| 177 | 177 | $search[$key . '_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear); |
| 178 | 178 | } |
| 179 | 179 | */ |
| 180 | - $search[$key . '_dtstartmonth'] = GETPOSTINT('search_' . $key . '_dtstartmonth'); |
|
| 181 | - $search[$key . '_dtstartday'] = GETPOSTINT('search_' . $key . '_dtstartday'); |
|
| 182 | - $search[$key . '_dtstartyear'] = GETPOSTINT('search_' . $key . '_dtstartyear'); |
|
| 183 | - $search[$key . '_dtendmonth'] = GETPOSTINT('search_' . $key . '_dtendmonth'); |
|
| 184 | - $search[$key . '_dtendday'] = GETPOSTINT('search_' . $key . '_dtendday'); |
|
| 185 | - $search[$key . '_dtendyear'] = GETPOSTINT('search_' . $key . '_dtendyear'); |
|
| 180 | + $search[$key.'_dtstartmonth'] = GETPOSTINT('search_'.$key.'_dtstartmonth'); |
|
| 181 | + $search[$key.'_dtstartday'] = GETPOSTINT('search_'.$key.'_dtstartday'); |
|
| 182 | + $search[$key.'_dtstartyear'] = GETPOSTINT('search_'.$key.'_dtstartyear'); |
|
| 183 | + $search[$key.'_dtendmonth'] = GETPOSTINT('search_'.$key.'_dtendmonth'); |
|
| 184 | + $search[$key.'_dtendday'] = GETPOSTINT('search_'.$key.'_dtendday'); |
|
| 185 | + $search[$key.'_dtendyear'] = GETPOSTINT('search_'.$key.'_dtendyear'); |
|
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | $this->search = $search; |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | // If $val['visible']==0, then we never show the field |
| 197 | 197 | if (!empty($val['visible'])) { |
| 198 | 198 | $visible = (int) dol_eval((string) $val['visible'], 1); |
| 199 | - $arrayfields['t.' . $key] = array( |
|
| 199 | + $arrayfields['t.'.$key] = array( |
|
| 200 | 200 | 'label' => $val['label'], |
| 201 | 201 | 'checked' => (($visible < 0) ? 0 : 1), |
| 202 | 202 | 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), |
@@ -237,12 +237,12 @@ discard block |
||
| 237 | 237 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 238 | 238 | //$search[$key . '_dtstart'] = ''; |
| 239 | 239 | //$search[$key . '_dtend'] = ''; |
| 240 | - $search[$key . '_dtstartmonth'] = ''; |
|
| 241 | - $search[$key . '_dtendmonth'] = ''; |
|
| 242 | - $search[$key . '_dtstartday'] = ''; |
|
| 243 | - $search[$key . '_dtendday'] = ''; |
|
| 244 | - $search[$key . '_dtstartyear'] = ''; |
|
| 245 | - $search[$key . '_dtendyear'] = ''; |
|
| 240 | + $search[$key.'_dtstartmonth'] = ''; |
|
| 241 | + $search[$key.'_dtendmonth'] = ''; |
|
| 242 | + $search[$key.'_dtstartday'] = ''; |
|
| 243 | + $search[$key.'_dtendday'] = ''; |
|
| 244 | + $search[$key.'_dtstartyear'] = ''; |
|
| 245 | + $search[$key.'_dtendyear'] = ''; |
|
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | $this->search = $search; |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | $offset = $limit * ($page - 1); |
| 298 | 298 | if (!$sortfield) { |
| 299 | 299 | reset($object->fields); // Reset is required to avoid key() to return null. |
| 300 | - $sortfield = 't.' . key($object->fields); // Set here default search field. By default 1st field in definition. |
|
| 300 | + $sortfield = 't.'.key($object->fields); // Set here default search field. By default 1st field in definition. |
|
| 301 | 301 | } |
| 302 | 302 | if (!$sortorder) { |
| 303 | 303 | $sortorder = 'DESC'; |
@@ -318,18 +318,18 @@ discard block |
||
| 318 | 318 | |
| 319 | 319 | $sqlfields = $sql; // $sql fields to remove for count total |
| 320 | 320 | |
| 321 | - $sql .= " FROM " . $this->db->prefix() . $object->table_element . " as t"; |
|
| 321 | + $sql .= " FROM ".$this->db->prefix().$object->table_element." as t"; |
|
| 322 | 322 | // Add table from hooks |
| 323 | 323 | $parameters = array(); |
| 324 | 324 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 325 | 325 | $sql .= $hookmanager->resPrint; |
| 326 | 326 | if ($object->ismultientitymanaged == 1) { |
| 327 | - $sql .= " WHERE t.entity IN (" . getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)) . ")"; |
|
| 327 | + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; |
|
| 328 | 328 | } else { |
| 329 | 329 | $sql .= " WHERE 1 = 1"; |
| 330 | 330 | } |
| 331 | 331 | // filter on logged third-party |
| 332 | - $sql .= " AND t.fk_soc = " . ((int) $socid); |
|
| 332 | + $sql .= " AND t.fk_soc = ".((int) $socid); |
|
| 333 | 333 | // discard record with status draft |
| 334 | 334 | $sql .= " AND t.fk_statut <> 0"; |
| 335 | 335 | |
@@ -346,17 +346,17 @@ discard block |
||
| 346 | 346 | $mode_search = 2; |
| 347 | 347 | } |
| 348 | 348 | if ($search[$key] != '') { |
| 349 | - $sql .= natural_search("t." . $this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
| 349 | + $sql .= natural_search("t.".$this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
| 350 | 350 | } |
| 351 | 351 | } else { |
| 352 | 352 | if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { |
| 353 | 353 | $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); |
| 354 | 354 | if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { |
| 355 | 355 | if (preg_match('/_dtstart$/', $key)) { |
| 356 | - $sql .= " AND t." . $this->db->escape($columnName) . " >= '" . $this->db->idate($search[$key]) . "'"; |
|
| 356 | + $sql .= " AND t.".$this->db->escape($columnName)." >= '".$this->db->idate($search[$key])."'"; |
|
| 357 | 357 | } |
| 358 | 358 | if (preg_match('/_dtend$/', $key)) { |
| 359 | - $sql .= " AND t." . $this->db->escape($columnName) . " <= '" . $this->db->idate($search[$key]) . "'"; |
|
| 359 | + $sql .= " AND t.".$this->db->escape($columnName)." <= '".$this->db->idate($search[$key])."'"; |
|
| 360 | 360 | } |
| 361 | 361 | } |
| 362 | 362 | } |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | $nbtotalofrecords = 0; |
| 375 | 375 | if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { |
| 376 | 376 | /* The fast and low memory method to get and count full list converts the sql into a sql count */ |
| 377 | - $sqlforcount = preg_replace('/^' . preg_quote($sqlfields, '/') . '/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
| 377 | + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
| 378 | 378 | $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); |
| 379 | 379 | $resql = $this->db->query($sqlforcount); |
| 380 | 380 | if ($resql) { |
@@ -427,21 +427,21 @@ discard block |
||
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | $param = ''; |
| 430 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
| 431 | - $param .= '&limit=' . $limit; |
|
| 430 | + $param .= '&contextpage='.urlencode($contextpage); |
|
| 431 | + $param .= '&limit='.$limit; |
|
| 432 | 432 | foreach ($search as $key => $val) { |
| 433 | 433 | if (is_array($search[$key])) { |
| 434 | 434 | foreach ($search[$key] as $skey) { |
| 435 | 435 | if ($skey != '') { |
| 436 | - $param .= '&search_' . $key . '[]=' . urlencode($skey); |
|
| 436 | + $param .= '&search_'.$key.'[]='.urlencode($skey); |
|
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { |
| 440 | - $param .= '&search_' . $key . 'month=' . (GETPOSTINT('search_' . $key . 'month')); |
|
| 441 | - $param .= '&search_' . $key . 'day=' . (GETPOSTINT('search_' . $key . 'day')); |
|
| 442 | - $param .= '&search_' . $key . 'year=' . (GETPOSTINT('search_' . $key . 'year')); |
|
| 440 | + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); |
|
| 441 | + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); |
|
| 442 | + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); |
|
| 443 | 443 | } elseif ($search[$key] != '') { |
| 444 | - $param .= '&search_' . $key . '=' . urlencode($search[$key]); |
|
| 444 | + $param .= '&search_'.$key.'='.urlencode($search[$key]); |
|
| 445 | 445 | } |
| 446 | 446 | } |
| 447 | 447 | // Add $param from hooks |
@@ -450,29 +450,29 @@ discard block |
||
| 450 | 450 | $param .= $hookmanager->resPrint; |
| 451 | 451 | |
| 452 | 452 | $url_file = $context->getControllerUrl($context->controller); |
| 453 | - $html .= '<form method="POST" id="searchFormList" action="' . $url_file . '">' . "\n"; |
|
| 453 | + $html .= '<form method="POST" id="searchFormList" action="'.$url_file.'">'."\n"; |
|
| 454 | 454 | $html .= $context->getFormToken(); |
| 455 | 455 | $html .= '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
| 456 | 456 | $html .= '<input type="hidden" name="action" value="list">'; |
| 457 | - $html .= '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
| 458 | - $html .= '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
| 459 | - $html .= '<input type="hidden" name="page" value="' . $page . '">'; |
|
| 460 | - $html .= '<input type="hidden" name="contextpage" value="' . $contextpage . '">'; |
|
| 457 | + $html .= '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
| 458 | + $html .= '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
| 459 | + $html .= '<input type="hidden" name="page" value="'.$page.'">'; |
|
| 460 | + $html .= '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; |
|
| 461 | 461 | |
| 462 | 462 | // pagination |
| 463 | - $pagination_param = $param . '&sortfield=' . $sortfield . '&sortorder=' . $sortorder; |
|
| 464 | - $html .= '<nav id="webportal-' . $elementEn . '-pagination">'; |
|
| 463 | + $pagination_param = $param.'&sortfield='.$sortfield.'&sortorder='.$sortorder; |
|
| 464 | + $html .= '<nav id="webportal-'.$elementEn.'-pagination">'; |
|
| 465 | 465 | $html .= '<ul>'; |
| 466 | - $html .= '<li><strong>' . $langs->trans($titleKey) . '</strong> (' . $nbtotalofrecords . ')</li>'; |
|
| 466 | + $html .= '<li><strong>'.$langs->trans($titleKey).'</strong> ('.$nbtotalofrecords.')</li>'; |
|
| 467 | 467 | $html .= '</ul>'; |
| 468 | 468 | |
| 469 | 469 | /* Generate pagination list */ |
| 470 | - $html .= static::generatePageListNav($url_file . $pagination_param, $nbpages, $page); |
|
| 470 | + $html .= static::generatePageListNav($url_file.$pagination_param, $nbpages, $page); |
|
| 471 | 471 | |
| 472 | 472 | $html .= '</nav>'; |
| 473 | 473 | |
| 474 | 474 | // table with search filters and column titles |
| 475 | - $html .= '<table id="webportal-' . $elementEn . '-list" responsive="scroll" role="grid">'; |
|
| 475 | + $html .= '<table id="webportal-'.$elementEn.'-list" responsive="scroll" role="grid">'; |
|
| 476 | 476 | // title and desc for table |
| 477 | 477 | //if ($titleKey != '') { |
| 478 | 478 | // $html .= '<caption id="table-collapse-responsive">'; |
@@ -496,22 +496,22 @@ discard block |
||
| 496 | 496 | $html .= '</td>'; |
| 497 | 497 | // } |
| 498 | 498 | foreach ($object->fields as $key => $val) { |
| 499 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 500 | - $html .= '<td data-label="' . $arrayfields['t.' . $key]['label'] . '" data-col="'.dol_escape_htmltag($key).'" >'; |
|
| 499 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 500 | + $html .= '<td data-label="'.$arrayfields['t.'.$key]['label'].'" data-col="'.dol_escape_htmltag($key).'" >'; |
|
| 501 | 501 | if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { |
| 502 | - $html .= $this->form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
| 502 | + $html .= $this->form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
| 503 | 503 | } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 504 | - $postDateStart = dol_mktime(0, 0, 0, $search[$key . '_dtstartmonth'], $search[$key . '_dtstartday'], $search[$key . '_dtstartyear']); |
|
| 505 | - $postDateEnd = dol_mktime(0, 0, 0, $search[$key . '_dtendmonth'], $search[$key . '_dtendday'], $search[$key . '_dtendyear']); |
|
| 504 | + $postDateStart = dol_mktime(0, 0, 0, $search[$key.'_dtstartmonth'], $search[$key.'_dtstartday'], $search[$key.'_dtstartyear']); |
|
| 505 | + $postDateEnd = dol_mktime(0, 0, 0, $search[$key.'_dtendmonth'], $search[$key.'_dtendday'], $search[$key.'_dtendyear']); |
|
| 506 | 506 | |
| 507 | 507 | $html .= '<div class="grid width150">'; |
| 508 | - $html .= $this->form->inputDate('search_' . $key . '_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
| 508 | + $html .= $this->form->inputDate('search_'.$key.'_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
| 509 | 509 | $html .= '</div>'; |
| 510 | 510 | $html .= '<div class="grid width150">'; |
| 511 | - $html .= $this->form->inputDate('search_' . $key . '_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
| 511 | + $html .= $this->form->inputDate('search_'.$key.'_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
| 512 | 512 | $html .= '</div>'; |
| 513 | 513 | } else { |
| 514 | - $html .= '<input type="text" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">'; |
|
| 514 | + $html .= '<input type="text" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">'; |
|
| 515 | 515 | } |
| 516 | 516 | $html .= '</td>'; |
| 517 | 517 | } |
@@ -522,18 +522,18 @@ discard block |
||
| 522 | 522 | $html .= $hookmanager->resPrint; |
| 523 | 523 | // Remain to pay |
| 524 | 524 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
| 525 | - $html .= '<td data-label="' . $arrayfields['remain_to_pay']['label'] . '">'; |
|
| 525 | + $html .= '<td data-label="'.$arrayfields['remain_to_pay']['label'].'">'; |
|
| 526 | 526 | $html .= '</td>'; |
| 527 | 527 | } |
| 528 | 528 | // Download link |
| 529 | 529 | if (!empty($arrayfields['download_link']['checked'])) { |
| 530 | - $html .= '<td data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
| 530 | + $html .= '<td data-label="'.$arrayfields['download_link']['label'].'">'; |
|
| 531 | 531 | $html .= '</td>'; |
| 532 | 532 | } |
| 533 | 533 | // Signature link |
| 534 | 534 | if ($elementEn == "propal" && getDolGlobalString("PROPOSAL_ALLOW_ONLINESIGN") != 0) { |
| 535 | 535 | if (!empty($arrayfields['signature_link']['checked'])) { |
| 536 | - $html .= '<td data-label="' . $arrayfields['signature_link']['label'] . '">'; |
|
| 536 | + $html .= '<td data-label="'.$arrayfields['signature_link']['label'].'">'; |
|
| 537 | 537 | $html .= '</td>'; |
| 538 | 538 | } |
| 539 | 539 | } |
@@ -551,16 +551,16 @@ discard block |
||
| 551 | 551 | $totalarray['nbfield']++; |
| 552 | 552 | // } |
| 553 | 553 | foreach ($object->fields as $key => $val) { |
| 554 | - $tableKey = 't.' . $key; |
|
| 554 | + $tableKey = 't.'.$key; |
|
| 555 | 555 | if (!empty($arrayfields[$tableKey]['checked'])) { |
| 556 | 556 | $tableOrder = ''; |
| 557 | 557 | if (array_key_exists($tableKey, $sortList)) { |
| 558 | 558 | $tableOrder = strtolower($sortList[$tableKey]); |
| 559 | 559 | } |
| 560 | - $url_param = $url_file . '&sortfield=' . $tableKey . '&sortorder=' . ($tableOrder == 'desc' ? 'asc' : 'desc') . $param; |
|
| 561 | - $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"' . ($tableOrder != '' ? ' table-order="' . $tableOrder . '"' : '') . '>'; |
|
| 562 | - $html .= '<a href="' . $url_param . '">'; |
|
| 563 | - $html .= $langs->trans($arrayfields['t.' . $key]['label']); |
|
| 560 | + $url_param = $url_file.'&sortfield='.$tableKey.'&sortorder='.($tableOrder == 'desc' ? 'asc' : 'desc').$param; |
|
| 561 | + $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"'.($tableOrder != '' ? ' table-order="'.$tableOrder.'"' : '').'>'; |
|
| 562 | + $html .= '<a href="'.$url_param.'">'; |
|
| 563 | + $html .= $langs->trans($arrayfields['t.'.$key]['label']); |
|
| 564 | 564 | $html .= '</a>'; |
| 565 | 565 | $html .= '</th>'; |
| 566 | 566 | $totalarray['nbfield']++; |
@@ -641,13 +641,13 @@ discard block |
||
| 641 | 641 | $remaintopay = 0; |
| 642 | 642 | } |
| 643 | 643 | if ($object->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1 && $discount) { |
| 644 | - $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source=' . $object->id); |
|
| 644 | + $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source='.$object->id); |
|
| 645 | 645 | $remaintopay = -$remaincreditnote; |
| 646 | 646 | } |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | // Show line of result |
| 650 | - $html .= '<tr data-rowid="' . $object->id . '">'; |
|
| 650 | + $html .= '<tr data-rowid="'.$object->id.'">'; |
|
| 651 | 651 | // if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 652 | 652 | $html .= '<td class="nowraponall">'; |
| 653 | 653 | $html .= '</td>'; |
@@ -656,8 +656,8 @@ discard block |
||
| 656 | 656 | } |
| 657 | 657 | // } |
| 658 | 658 | foreach ($object->fields as $key => $val) { |
| 659 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 660 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['t.' . $key]['label'] . '">'; |
|
| 659 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 660 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['t.'.$key]['label'].'">'; |
|
| 661 | 661 | if ($key == 'status' || $key == 'fk_statut') { |
| 662 | 662 | if ($elementEn == 'invoice') { |
| 663 | 663 | // specific to get invoice status (depends on payment) |
@@ -678,21 +678,21 @@ discard block |
||
| 678 | 678 | } |
| 679 | 679 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
| 680 | 680 | if (!$i) { |
| 681 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
| 681 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
| 682 | 682 | } |
| 683 | 683 | if (!isset($totalarray['val'])) { |
| 684 | 684 | $totalarray['val'] = array(); |
| 685 | 685 | } |
| 686 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
| 687 | - $totalarray['val']['t.' . $key] = 0; |
|
| 686 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
| 687 | + $totalarray['val']['t.'.$key] = 0; |
|
| 688 | 688 | } |
| 689 | - $totalarray['val']['t.' . $key] += $object->$key; |
|
| 689 | + $totalarray['val']['t.'.$key] += $object->$key; |
|
| 690 | 690 | } |
| 691 | 691 | } |
| 692 | 692 | } |
| 693 | 693 | // Remain to pay |
| 694 | 694 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
| 695 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['remain_to_pay']['label'] . '">'; |
|
| 695 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['remain_to_pay']['label'].'">'; |
|
| 696 | 696 | $html .= $this->form->showOutputFieldForObject($object, $arrayfields['remain_to_pay'], 'remain_to_pay', $remaintopay, ''); |
| 697 | 697 | //$html .= price($remaintopay); |
| 698 | 698 | $html .= '</td>'; |
@@ -703,9 +703,9 @@ discard block |
||
| 703 | 703 | // Download link |
| 704 | 704 | if (!empty($arrayfields['download_link']['checked'])) { |
| 705 | 705 | $element = $object->element; |
| 706 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
| 706 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['download_link']['label'].'">'; |
|
| 707 | 707 | $filename = dol_sanitizeFileName($obj->ref); |
| 708 | - $filedir = $conf->{$element}->multidir_output[$obj->element_entity] . '/' . dol_sanitizeFileName($obj->ref); |
|
| 708 | + $filedir = $conf->{$element}->multidir_output[$obj->element_entity].'/'.dol_sanitizeFileName($obj->ref); |
|
| 709 | 709 | $html .= $this->form->getDocumentsLink($element, $filename, $filedir); |
| 710 | 710 | $html .= '</td>'; |
| 711 | 711 | if (!$i) { |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | // Signature link |
| 716 | 716 | if ($elementEn == "propal" && getDolGlobalString("PROPOSAL_ALLOW_ONLINESIGN") != 0) { |
| 717 | 717 | if (!empty($arrayfields['signature_link']['checked'])) { |
| 718 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['signature_link']['label'] . '">'; |
|
| 718 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['signature_link']['label'].'">'; |
|
| 719 | 719 | if ($object->fk_statut == Propal::STATUS_VALIDATED) { |
| 720 | 720 | $html .= $this->form->getSignatureLink('proposal', $object); |
| 721 | 721 | } |
@@ -754,7 +754,7 @@ discard block |
||
| 754 | 754 | $html .= '</td>'; |
| 755 | 755 | } else { |
| 756 | 756 | if ($i == 1) { |
| 757 | - $html .= '<td>' . $langs->trans("Total") . '</td>'; |
|
| 757 | + $html .= '<td>'.$langs->trans("Total").'</td>'; |
|
| 758 | 758 | } else { |
| 759 | 759 | $html .= '<td></td>'; |
| 760 | 760 | } |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | $colspan++; |
| 772 | 772 | } |
| 773 | 773 | } |
| 774 | - $html .= '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
| 774 | + $html .= '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
| 775 | 775 | } |
| 776 | 776 | |
| 777 | 777 | $html .= '</tbody>'; |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | $html = '<ul class="pages-nav-list">'; |
| 812 | 812 | |
| 813 | 813 | if ($currentPage > 1) { |
| 814 | - $html .= '<li><a class="pages-nav-list__icon --prev" aria-label="' . dol_escape_htmltag($langs->trans('AriaPrevPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage - 1) . '" ' . ($currentPage <= 1 ? ' disabled' : '') . '></a></li>'; |
|
| 814 | + $html .= '<li><a class="pages-nav-list__icon --prev" aria-label="'.dol_escape_htmltag($langs->trans('AriaPrevPage')).'" href="'.$url.$pSep.'page='.($currentPage - 1).'" '.($currentPage <= 1 ? ' disabled' : '').'></a></li>'; |
|
| 815 | 815 | } |
| 816 | 816 | |
| 817 | 817 | $maxPaginItem = min($nbPages, 5); |
@@ -819,21 +819,21 @@ discard block |
||
| 819 | 819 | $maxPageNum = min($nbPages, $currentPage + 3); |
| 820 | 820 | |
| 821 | 821 | if ($minPageNum > 1) { |
| 822 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage == 1 ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', 1)) . '" href="' . $url . $pSep . 'page=1" >1</a></li>'; |
|
| 822 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage == 1 ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', 1)).'" href="'.$url.$pSep.'page=1" >1</a></li>'; |
|
| 823 | 823 | $html .= '<li>…</li>'; |
| 824 | 824 | } |
| 825 | 825 | |
| 826 | 826 | for ($p = $minPageNum; $p <= $maxPageNum; $p++) { |
| 827 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage === $p ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $p)) . '" href="' . $url . $pSep . 'page=' . $p . '">' . $p . '</a></li>'; |
|
| 827 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage === $p ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $p)).'" href="'.$url.$pSep.'page='.$p.'">'.$p.'</a></li>'; |
|
| 828 | 828 | } |
| 829 | 829 | |
| 830 | 830 | if ($maxPaginItem < $nbPages) { |
| 831 | 831 | $html .= '<li>…</li>'; |
| 832 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage == $nbPages ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)) . '" href="' . $url . $pSep . 'page=' . $nbPages . '">' . $nbPages . '</a></li>'; |
|
| 832 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage == $nbPages ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)).'" href="'.$url.$pSep.'page='.$nbPages.'">'.$nbPages.'</a></li>'; |
|
| 833 | 833 | } |
| 834 | 834 | |
| 835 | 835 | if ($currentPage < $nbPages) { |
| 836 | - $html .= '<li><a class="pages-nav-list__icon --next" aria-label="' . dol_escape_htmltag($langs->trans('AriaNextPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage + 1) . '" ' . ($currentPage >= $nbPages ? ' disabled' : '') . '></a></li>'; |
|
| 836 | + $html .= '<li><a class="pages-nav-list__icon --next" aria-label="'.dol_escape_htmltag($langs->trans('AriaNextPage')).'" href="'.$url.$pSep.'page='.($currentPage + 1).'" '.($currentPage >= $nbPages ? ' disabled' : '').'></a></li>'; |
|
| 837 | 837 | } |
| 838 | 838 | |
| 839 | 839 | $html .= '</ul>'; |
@@ -67,14 +67,14 @@ |
||
| 67 | 67 | $post = getNewsDetailsById($postId); |
| 68 | 68 | $newsList .= '<div style="display: flex; align-items: flex-start; justify-content: flex-start; width: 100%; max-width: 800px; margin-top: 20px;margin-bottom: 50px; padding: 20px;"> |
| 69 | 69 | <div style="flex-grow: 1; margin-right: 30px; max-width: 600px; margin-left: 100px;"> |
| 70 | - <h2 style="margin: 0; font-size: 1.5em;">' . htmlentities($post['title']) . '</h2> |
|
| 71 | - <p style="margin: 10px 0; color: #555;">' . htmlentities($post['description']) . '</p> |
|
| 72 | - <span style="display: block; margin-bottom: 5px; color: #888;">Created By: <strong>' . htmlentities($post['user_fullname']) . '</strong></span> |
|
| 70 | + <h2 style="margin: 0; font-size: 1.5em;">' . htmlentities($post['title']).'</h2> |
|
| 71 | + <p style="margin: 10px 0; color: #555;">' . htmlentities($post['description']).'</p> |
|
| 72 | + <span style="display: block; margin-bottom: 5px; color: #888;">Created By: <strong>' . htmlentities($post['user_fullname']).'</strong></span> |
|
| 73 | 73 | <br> |
| 74 | - <span style="display: block; color: #888;">' . dol_print_date($post['date_creation'], 'daytext', 'tzserver', $langs) . '</span> |
|
| 74 | + <span style="display: block; color: #888;">' . dol_print_date($post['date_creation'], 'daytext', 'tzserver', $langs).'</span> |
|
| 75 | 75 | </div> |
| 76 | 76 | <div style="flex-shrink: 0; margin-left: 100px; float: right;"> |
| 77 | - ' . ($post['image'] ? '<img alt="Image" width="130px" height="130px" style="border-radius: 10px;" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=medias&file=' . htmlentities($post['image']) . '">' : '<img alt="Gray rectangle" width="130px" height="130px" style="border-radius: 10px;" src="__GRAY_RECTANGLE__">') . ' |
|
| 77 | + ' . ($post['image'] ? '<img alt="Image" width="130px" height="130px" style="border-radius: 10px;" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=medias&file='.htmlentities($post['image']).'">' : '<img alt="Gray rectangle" width="130px" height="130px" style="border-radius: 10px;" src="__GRAY_RECTANGLE__">').' |
|
| 78 | 78 | </div> |
| 79 | 79 | </div>'; |
| 80 | 80 | } |
@@ -476,11 +476,11 @@ discard block |
||
| 476 | 476 | * |
| 477 | 477 | * Note: cond_reglement can not be aliased to cond_reglement!!! |
| 478 | 478 | */ |
| 479 | - private $cond_reglement; // Private to call DolDeprecationHandler |
|
| 479 | + private $cond_reglement; // Private to call DolDeprecationHandler |
|
| 480 | 480 | /** |
| 481 | 481 | * @var int|string Internal to detect deprecated access |
| 482 | 482 | */ |
| 483 | - protected $depr_cond_reglement; // Internal value for deprecation |
|
| 483 | + protected $depr_cond_reglement; // Internal value for deprecation |
|
| 484 | 484 | |
| 485 | 485 | /** |
| 486 | 486 | * @var int Delivery address ID |
@@ -537,12 +537,12 @@ discard block |
||
| 537 | 537 | /** |
| 538 | 538 | * @var float Multicurrency total localta1 |
| 539 | 539 | */ |
| 540 | - public $multicurrency_total_localtax1; // not in database |
|
| 540 | + public $multicurrency_total_localtax1; // not in database |
|
| 541 | 541 | |
| 542 | 542 | /** |
| 543 | 543 | * @var float Multicurrency total localtax2 |
| 544 | 544 | */ |
| 545 | - public $multicurrency_total_localtax2; // not in database |
|
| 545 | + public $multicurrency_total_localtax2; // not in database |
|
| 546 | 546 | |
| 547 | 547 | /** |
| 548 | 548 | * @var string |
@@ -1027,17 +1027,17 @@ discard block |
||
| 1027 | 1027 | } |
| 1028 | 1028 | $labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]); |
| 1029 | 1029 | if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') { |
| 1030 | - $data[$key] = '<br><b><u>'. $labelextra . '</u></b>'; |
|
| 1030 | + $data[$key] = '<br><b><u>'.$labelextra.'</u></b>'; |
|
| 1031 | 1031 | } else { |
| 1032 | - $value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]); |
|
| 1033 | - $data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element); |
|
| 1032 | + $value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]); |
|
| 1033 | + $data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element); |
|
| 1034 | 1034 | $count++; |
| 1035 | 1035 | } |
| 1036 | 1036 | } |
| 1037 | 1037 | $data['closedivextra'] = '</div>'; |
| 1038 | 1038 | } |
| 1039 | 1039 | |
| 1040 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 1040 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 1041 | 1041 | $parameters = array( |
| 1042 | 1042 | 'tooltipcontentarray' => &$data, |
| 1043 | 1043 | 'params' => $params, |
@@ -1536,7 +1536,7 @@ discard block |
||
| 1536 | 1536 | $sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")"; |
| 1537 | 1537 | } |
| 1538 | 1538 | if ($status >= 0) { |
| 1539 | - $sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople |
|
| 1539 | + $sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople |
|
| 1540 | 1540 | } |
| 1541 | 1541 | if ($statusoflink >= 0) { |
| 1542 | 1542 | $sql .= " AND ec.statut = ".((int) $statusoflink); |
@@ -1918,7 +1918,7 @@ discard block |
||
| 1918 | 1918 | } |
| 1919 | 1919 | |
| 1920 | 1920 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element; |
| 1921 | - $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
| 1921 | + $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
| 1922 | 1922 | $sql .= " LIMIT 1"; |
| 1923 | 1923 | |
| 1924 | 1924 | $query = $this->db->query($sql); |
@@ -2210,9 +2210,9 @@ discard block |
||
| 2210 | 2210 | |
| 2211 | 2211 | $oldvalue = null; |
| 2212 | 2212 | if ($trigkey) { |
| 2213 | - $sql = "SELECT " . $field; |
|
| 2214 | - $sql .= " FROM " . MAIN_DB_PREFIX . $table; |
|
| 2215 | - $sql .= " WHERE " . $id_field . " = " . ((int) $id); |
|
| 2213 | + $sql = "SELECT ".$field; |
|
| 2214 | + $sql .= " FROM ".MAIN_DB_PREFIX.$table; |
|
| 2215 | + $sql .= " WHERE ".$id_field." = ".((int) $id); |
|
| 2216 | 2216 | |
| 2217 | 2217 | $resql = $this->db->query($sql); |
| 2218 | 2218 | if ($resql) { |
@@ -2592,7 +2592,7 @@ discard block |
||
| 2592 | 2592 | // Triggers |
| 2593 | 2593 | if (!$error && !$notrigger) { |
| 2594 | 2594 | // Call triggers |
| 2595 | - $result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user); |
|
| 2595 | + $result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user); |
|
| 2596 | 2596 | if ($result < 0) { |
| 2597 | 2597 | $error++; |
| 2598 | 2598 | } //Do also here what you must do to rollback action if trigger fail |
@@ -2958,7 +2958,7 @@ discard block |
||
| 2958 | 2958 | $sql = 'UPDATE '.$this->db->prefix().$this->table_element; |
| 2959 | 2959 | $sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL'); |
| 2960 | 2960 | if (in_array($this->table_element, array('propal', 'commande', 'societe'))) { |
| 2961 | - $sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'"); |
|
| 2961 | + $sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'"); |
|
| 2962 | 2962 | } |
| 2963 | 2963 | $sql .= ' WHERE rowid='.((int) $this->id); |
| 2964 | 2964 | |
@@ -3306,10 +3306,10 @@ discard block |
||
| 3306 | 3306 | $sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line; |
| 3307 | 3307 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
| 3308 | 3308 | if (!$renum) { |
| 3309 | - $sql .= " AND " . $fieldposition . " = 0"; |
|
| 3309 | + $sql .= " AND ".$fieldposition." = 0"; |
|
| 3310 | 3310 | } |
| 3311 | 3311 | if ($renum) { |
| 3312 | - $sql .= " AND " . $fieldposition . " <> 0"; |
|
| 3312 | + $sql .= " AND ".$fieldposition." <> 0"; |
|
| 3313 | 3313 | } |
| 3314 | 3314 | |
| 3315 | 3315 | dol_syslog(get_class($this)."::line_order", LOG_DEBUG); |
@@ -3330,7 +3330,7 @@ discard block |
||
| 3330 | 3330 | if ($fk_parent_line) { |
| 3331 | 3331 | $sql .= ' AND fk_parent_line IS NULL'; |
| 3332 | 3332 | } |
| 3333 | - $sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder; |
|
| 3333 | + $sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder; |
|
| 3334 | 3334 | |
| 3335 | 3335 | dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG); |
| 3336 | 3336 | $resql = $this->db->query($sql); |
@@ -3381,7 +3381,7 @@ discard block |
||
| 3381 | 3381 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
| 3382 | 3382 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
| 3383 | 3383 | $sql .= ' AND fk_parent_line = '.((int) $id); |
| 3384 | - $sql .= " ORDER BY " . $fieldposition . " ASC"; |
|
| 3384 | + $sql .= " ORDER BY ".$fieldposition." ASC"; |
|
| 3385 | 3385 | |
| 3386 | 3386 | dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG); |
| 3387 | 3387 | |
@@ -3505,7 +3505,7 @@ discard block |
||
| 3505 | 3505 | |
| 3506 | 3506 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
| 3507 | 3507 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
| 3508 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1)); |
|
| 3508 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang - 1)); |
|
| 3509 | 3509 | if ($this->db->query($sql)) { |
| 3510 | 3510 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1)); |
| 3511 | 3511 | $sql .= ' WHERE rowid = '.((int) $rowid); |
@@ -3536,7 +3536,7 @@ discard block |
||
| 3536 | 3536 | |
| 3537 | 3537 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
| 3538 | 3538 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
| 3539 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1)); |
|
| 3539 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang + 1)); |
|
| 3540 | 3540 | if ($this->db->query($sql)) { |
| 3541 | 3541 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1)); |
| 3542 | 3542 | $sql .= ' WHERE rowid = '.((int) $rowid); |
@@ -3562,7 +3562,7 @@ discard block |
||
| 3562 | 3562 | $fieldposition = 'position'; |
| 3563 | 3563 | } |
| 3564 | 3564 | |
| 3565 | - $sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line; |
|
| 3565 | + $sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line; |
|
| 3566 | 3566 | $sql .= " WHERE rowid = ".((int) $rowid); |
| 3567 | 3567 | |
| 3568 | 3568 | dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG); |
@@ -3590,7 +3590,7 @@ discard block |
||
| 3590 | 3590 | |
| 3591 | 3591 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
| 3592 | 3592 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
| 3593 | - $sql .= " AND " . $fieldposition . " = ".((int) $rang); |
|
| 3593 | + $sql .= " AND ".$fieldposition." = ".((int) $rang); |
|
| 3594 | 3594 | $resql = $this->db->query($sql); |
| 3595 | 3595 | if ($resql) { |
| 3596 | 3596 | $row = $this->db->fetch_row($resql); |
@@ -3708,7 +3708,7 @@ discard block |
||
| 3708 | 3708 | $newsuffix = ''; |
| 3709 | 3709 | } |
| 3710 | 3710 | if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) { |
| 3711 | - $fieldusermod = "fk_user_mod"; |
|
| 3711 | + $fieldusermod = "fk_user_mod"; |
|
| 3712 | 3712 | } elseif ($this->table_element == 'ecm_files') { |
| 3713 | 3713 | $fieldusermod = "fk_user_m"; |
| 3714 | 3714 | } else { |
@@ -3750,7 +3750,7 @@ discard block |
||
| 3750 | 3750 | $trigger_name = 'EXPENSE_REPORT_MODIFY'; |
| 3751 | 3751 | break; |
| 3752 | 3752 | default: |
| 3753 | - $trigger_name = strtoupper($this->element) . '_MODIFY'; |
|
| 3753 | + $trigger_name = strtoupper($this->element).'_MODIFY'; |
|
| 3754 | 3754 | } |
| 3755 | 3755 | $ret = $this->call_trigger($trigger_name, $user); |
| 3756 | 3756 | if ($ret < 0) { |
@@ -4151,19 +4151,19 @@ discard block |
||
| 4151 | 4151 | $this->db->begin(); |
| 4152 | 4152 | $error = 0; |
| 4153 | 4153 | |
| 4154 | - $sql = "INSERT INTO " . $this->db->prefix() . "element_element ("; |
|
| 4154 | + $sql = "INSERT INTO ".$this->db->prefix()."element_element ("; |
|
| 4155 | 4155 | $sql .= "fk_source"; |
| 4156 | 4156 | $sql .= ", sourcetype"; |
| 4157 | 4157 | $sql .= ", fk_target"; |
| 4158 | 4158 | $sql .= ", targettype"; |
| 4159 | 4159 | $sql .= ") VALUES ("; |
| 4160 | 4160 | $sql .= ((int) $origin_id); |
| 4161 | - $sql .= ", '" . $this->db->escape($origin) . "'"; |
|
| 4162 | - $sql .= ", " . ((int) $this->id); |
|
| 4163 | - $sql .= ", '" . $this->db->escape($targettype) . "'"; |
|
| 4161 | + $sql .= ", '".$this->db->escape($origin)."'"; |
|
| 4162 | + $sql .= ", ".((int) $this->id); |
|
| 4163 | + $sql .= ", '".$this->db->escape($targettype)."'"; |
|
| 4164 | 4164 | $sql .= ")"; |
| 4165 | 4165 | |
| 4166 | - dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG); |
|
| 4166 | + dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG); |
|
| 4167 | 4167 | if ($this->db->query($sql)) { |
| 4168 | 4168 | if (!$notrigger) { |
| 4169 | 4169 | // Call trigger |
@@ -4415,20 +4415,20 @@ discard block |
||
| 4415 | 4415 | $this->db->begin(); |
| 4416 | 4416 | $error = 0; |
| 4417 | 4417 | |
| 4418 | - $sql = "UPDATE " . $this->db->prefix() . "element_element SET "; |
|
| 4418 | + $sql = "UPDATE ".$this->db->prefix()."element_element SET "; |
|
| 4419 | 4419 | if ($updatesource) { |
| 4420 | - $sql .= "fk_source = " . ((int) $sourceid); |
|
| 4421 | - $sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
| 4422 | - $sql .= " WHERE fk_target = " . ((int) $this->id); |
|
| 4423 | - $sql .= " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
| 4420 | + $sql .= "fk_source = ".((int) $sourceid); |
|
| 4421 | + $sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
| 4422 | + $sql .= " WHERE fk_target = ".((int) $this->id); |
|
| 4423 | + $sql .= " AND targettype = '".$this->db->escape($this->element)."'"; |
|
| 4424 | 4424 | } elseif ($updatetarget) { |
| 4425 | - $sql .= "fk_target = " . ((int) $targetid); |
|
| 4426 | - $sql .= ", targettype = '" . $this->db->escape($targettype) . "'"; |
|
| 4427 | - $sql .= " WHERE fk_source = " . ((int) $this->id); |
|
| 4428 | - $sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
| 4425 | + $sql .= "fk_target = ".((int) $targetid); |
|
| 4426 | + $sql .= ", targettype = '".$this->db->escape($targettype)."'"; |
|
| 4427 | + $sql .= " WHERE fk_source = ".((int) $this->id); |
|
| 4428 | + $sql .= " AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
| 4429 | 4429 | } |
| 4430 | 4430 | |
| 4431 | - dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG); |
|
| 4431 | + dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG); |
|
| 4432 | 4432 | if ($this->db->query($sql)) { |
| 4433 | 4433 | if (!$notrigger) { |
| 4434 | 4434 | // Call trigger |
@@ -4504,25 +4504,25 @@ discard block |
||
| 4504 | 4504 | } |
| 4505 | 4505 | |
| 4506 | 4506 | if (!$error) { |
| 4507 | - $sql = "DELETE FROM " . $this->db->prefix() . "element_element"; |
|
| 4507 | + $sql = "DELETE FROM ".$this->db->prefix()."element_element"; |
|
| 4508 | 4508 | $sql .= " WHERE"; |
| 4509 | 4509 | if ($rowid > 0) { |
| 4510 | - $sql .= " rowid = " . ((int) $rowid); |
|
| 4510 | + $sql .= " rowid = ".((int) $rowid); |
|
| 4511 | 4511 | } else { |
| 4512 | 4512 | if ($deletesource) { |
| 4513 | - $sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
| 4514 | - $sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
| 4513 | + $sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
| 4514 | + $sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'"; |
|
| 4515 | 4515 | } elseif ($deletetarget) { |
| 4516 | - $sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'"; |
|
| 4517 | - $sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
| 4516 | + $sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'"; |
|
| 4517 | + $sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
| 4518 | 4518 | } else { |
| 4519 | - $sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')"; |
|
| 4519 | + $sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')"; |
|
| 4520 | 4520 | $sql .= " OR"; |
| 4521 | - $sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')"; |
|
| 4521 | + $sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')"; |
|
| 4522 | 4522 | } |
| 4523 | 4523 | } |
| 4524 | 4524 | |
| 4525 | - dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG); |
|
| 4525 | + dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG); |
|
| 4526 | 4526 | if (!$this->db->query($sql)) { |
| 4527 | 4527 | $this->error = $this->db->lasterror(); |
| 4528 | 4528 | $this->errors[] = $this->error; |
@@ -4687,14 +4687,14 @@ discard block |
||
| 4687 | 4687 | $sql .= ", date_validation = '".$this->db->idate(dol_now())."'"; |
| 4688 | 4688 | } |
| 4689 | 4689 | $sql .= " WHERE rowid = ".((int) $elementId); |
| 4690 | - $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
| 4690 | + $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
| 4691 | 4691 | |
| 4692 | 4692 | dol_syslog(get_class($this)."::setStatut", LOG_DEBUG); |
| 4693 | 4693 | $resql = $this->db->query($sql); |
| 4694 | 4694 | if ($resql) { |
| 4695 | 4695 | $error = 0; |
| 4696 | 4696 | |
| 4697 | - $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
| 4697 | + $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
| 4698 | 4698 | |
| 4699 | 4699 | if ($nb_rows_affected > 0) { |
| 4700 | 4700 | if (empty($trigkey)) { |
@@ -4741,7 +4741,7 @@ discard block |
||
| 4741 | 4741 | if ($fieldstatus == 'tosell') { |
| 4742 | 4742 | $this->status = $status; |
| 4743 | 4743 | } elseif ($fieldstatus == 'tobuy') { |
| 4744 | - $this->status_buy = $status; // @phpstan-ignore-line |
|
| 4744 | + $this->status_buy = $status; // @phpstan-ignore-line |
|
| 4745 | 4745 | } else { |
| 4746 | 4746 | $this->status = $status; |
| 4747 | 4747 | } |
@@ -4849,7 +4849,7 @@ discard block |
||
| 4849 | 4849 | return -1; |
| 4850 | 4850 | } |
| 4851 | 4851 | |
| 4852 | - $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
| 4852 | + $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
| 4853 | 4853 | // For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...) |
| 4854 | 4854 | $tmparray = array_keys($this->childtables); |
| 4855 | 4855 | if (is_numeric($tmparray[0])) { |
@@ -5927,7 +5927,7 @@ discard block |
||
| 5927 | 5927 | $setsharekey = false; |
| 5928 | 5928 | if ($this->element == 'propal' || $this->element == 'proposal') { |
| 5929 | 5929 | if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) { |
| 5930 | - $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
| 5930 | + $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
| 5931 | 5931 | } |
| 5932 | 5932 | if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) { |
| 5933 | 5933 | $setsharekey = true; |
@@ -5985,7 +5985,7 @@ discard block |
||
| 5985 | 5985 | $ecmfile->gen_or_uploaded = 'generated'; |
| 5986 | 5986 | $ecmfile->description = ''; // indexed content |
| 5987 | 5987 | $ecmfile->keywords = ''; // keyword content |
| 5988 | - $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
| 5988 | + $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
| 5989 | 5989 | $ecmfile->src_object_id = $this->id; |
| 5990 | 5990 | |
| 5991 | 5991 | $result = $ecmfile->create($user); |
@@ -6037,7 +6037,7 @@ discard block |
||
| 6037 | 6037 | $maxwidthmini = $tmparraysize['maxwidthmini']; |
| 6038 | 6038 | $maxheightmini = $tmparraysize['maxheightmini']; |
| 6039 | 6039 | //$quality = $tmparraysize['quality']; |
| 6040 | - $quality = 50; // For thumbs, we force quality to 50 |
|
| 6040 | + $quality = 50; // For thumbs, we force quality to 50 |
|
| 6041 | 6041 | |
| 6042 | 6042 | // Create small thumbs for company (Ratio is near 16/9) |
| 6043 | 6043 | // Used on logon for example |
@@ -6137,8 +6137,8 @@ discard block |
||
| 6137 | 6137 | // phpcs:enable |
| 6138 | 6138 | global $langs, $conf; |
| 6139 | 6139 | |
| 6140 | - if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) { |
|
| 6141 | - dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.'); |
|
| 6140 | + if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) { |
|
| 6141 | + dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.'); |
|
| 6142 | 6142 | exit; |
| 6143 | 6143 | } |
| 6144 | 6144 | if (!is_object($langs)) { // If lang was not defined, we set it. It is required by run_triggers(). |
@@ -6330,7 +6330,7 @@ discard block |
||
| 6330 | 6330 | $savDisableCompute = $conf->disable_compute; |
| 6331 | 6331 | $conf->disable_compute = 1; |
| 6332 | 6332 | |
| 6333 | - $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
| 6333 | + $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
| 6334 | 6334 | |
| 6335 | 6335 | $conf->disable_compute = $savDisableCompute; |
| 6336 | 6336 | |
@@ -6392,7 +6392,7 @@ discard block |
||
| 6392 | 6392 | if (is_array($optionsArray) && count($optionsArray) > 0) { |
| 6393 | 6393 | $sql = "SELECT rowid"; |
| 6394 | 6394 | foreach ($optionsArray as $name => $label) { |
| 6395 | - if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) { |
|
| 6395 | + if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) { |
|
| 6396 | 6396 | $sql .= ", ".$name; |
| 6397 | 6397 | } |
| 6398 | 6398 | // use geo sql fonction to read as text |
@@ -6445,7 +6445,7 @@ discard block |
||
| 6445 | 6445 | **/ |
| 6446 | 6446 | if (is_array($extrafields->attributes[$this->table_element]['label'])) { |
| 6447 | 6447 | foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { |
| 6448 | - $this->array_options['options_' . $key] = null; |
|
| 6448 | + $this->array_options['options_'.$key] = null; |
|
| 6449 | 6449 | } |
| 6450 | 6450 | } |
| 6451 | 6451 | } |
@@ -6457,9 +6457,9 @@ discard block |
||
| 6457 | 6457 | if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) { |
| 6458 | 6458 | //var_dump($conf->disable_compute); |
| 6459 | 6459 | if (empty($conf->disable_compute)) { |
| 6460 | - global $objectoffield; // We set a global variable to $objectoffield so |
|
| 6461 | - $objectoffield = $this; // we can use it inside computed formula |
|
| 6462 | - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
| 6460 | + global $objectoffield; // We set a global variable to $objectoffield so |
|
| 6461 | + $objectoffield = $this; // we can use it inside computed formula |
|
| 6462 | + $this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
| 6463 | 6463 | } |
| 6464 | 6464 | } |
| 6465 | 6465 | } |
@@ -6640,7 +6640,7 @@ discard block |
||
| 6640 | 6640 | // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. |
| 6641 | 6641 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
| 6642 | 6642 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
| 6643 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
| 6643 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
| 6644 | 6644 | } else { |
| 6645 | 6645 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
| 6646 | 6646 | } |
@@ -6651,7 +6651,7 @@ discard block |
||
| 6651 | 6651 | // If value has changed |
| 6652 | 6652 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
| 6653 | 6653 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
| 6654 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
| 6654 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
| 6655 | 6655 | } else { |
| 6656 | 6656 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
| 6657 | 6657 | } |
@@ -6663,7 +6663,7 @@ discard block |
||
| 6663 | 6663 | //var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]); |
| 6664 | 6664 | // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value |
| 6665 | 6665 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) { // dolibarr reversible encryption |
| 6666 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
| 6666 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
| 6667 | 6667 | } else { |
| 6668 | 6668 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
| 6669 | 6669 | } |
@@ -7088,7 +7088,7 @@ discard block |
||
| 7088 | 7088 | if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) { // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. |
| 7089 | 7089 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
| 7090 | 7090 | if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { |
| 7091 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
| 7091 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
| 7092 | 7092 | } else { |
| 7093 | 7093 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
| 7094 | 7094 | } |
@@ -7108,7 +7108,7 @@ discard block |
||
| 7108 | 7108 | } |
| 7109 | 7109 | } else { |
| 7110 | 7110 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { // dolibarr reversible encryption |
| 7111 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
| 7111 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
| 7112 | 7112 | } else { |
| 7113 | 7113 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
| 7114 | 7114 | } |
@@ -7649,7 +7649,7 @@ discard block |
||
| 7649 | 7649 | // 7 : sort field |
| 7650 | 7650 | |
| 7651 | 7651 | // If there is filter |
| 7652 | - if (! empty($InfoFieldList[4])) { |
|
| 7652 | + if (!empty($InfoFieldList[4])) { |
|
| 7653 | 7653 | $pos = 0; |
| 7654 | 7654 | $parenthesisopen = 0; |
| 7655 | 7655 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -7713,8 +7713,8 @@ discard block |
||
| 7713 | 7713 | } |
| 7714 | 7714 | |
| 7715 | 7715 | $sqlwhere = ''; |
| 7716 | - $sql = "SELECT " . $keyList; |
|
| 7717 | - $sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0]; |
|
| 7716 | + $sql = "SELECT ".$keyList; |
|
| 7717 | + $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; |
|
| 7718 | 7718 | |
| 7719 | 7719 | if (!empty($InfoFieldList[4])) { |
| 7720 | 7720 | // can use SELECT request |
@@ -7732,11 +7732,11 @@ discard block |
||
| 7732 | 7732 | // We have to join on extrafield table |
| 7733 | 7733 | $errstr = ''; |
| 7734 | 7734 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 7735 | - $sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra"; |
|
| 7736 | - $sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]); |
|
| 7737 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 7735 | + $sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra"; |
|
| 7736 | + $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
|
| 7737 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 7738 | 7738 | } else { |
| 7739 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 7739 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 7740 | 7740 | } |
| 7741 | 7741 | } else { |
| 7742 | 7742 | $sqlwhere .= ' WHERE 1=1'; |
@@ -7757,7 +7757,7 @@ discard block |
||
| 7757 | 7757 | |
| 7758 | 7758 | // Some tables may have field, some other not. For the moment we disable it. |
| 7759 | 7759 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
| 7760 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
| 7760 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
| 7761 | 7761 | } |
| 7762 | 7762 | $sql .= $sqlwhere; |
| 7763 | 7763 | //print $sql; |
@@ -7769,7 +7769,7 @@ discard block |
||
| 7769 | 7769 | $sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label)); |
| 7770 | 7770 | } |
| 7771 | 7771 | |
| 7772 | - dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); |
|
| 7772 | + dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
|
| 7773 | 7773 | $resql = $this->db->query($sql); |
| 7774 | 7774 | if ($resql) { |
| 7775 | 7775 | $out .= '<option value="0"> </option>'; |
@@ -7785,7 +7785,7 @@ discard block |
||
| 7785 | 7785 | if (count($fields_label) > 1) { |
| 7786 | 7786 | $notrans = true; |
| 7787 | 7787 | foreach ($fields_label as $field_toshow) { |
| 7788 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
| 7788 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
| 7789 | 7789 | } |
| 7790 | 7790 | } else { |
| 7791 | 7791 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -7796,12 +7796,12 @@ discard block |
||
| 7796 | 7796 | foreach ($fields_label as $field_toshow) { |
| 7797 | 7797 | $translabel = $langs->trans($obj->$field_toshow); |
| 7798 | 7798 | if ($translabel != $obj->$field_toshow) { |
| 7799 | - $labeltoshow = dol_trunc($translabel) . ' '; |
|
| 7799 | + $labeltoshow = dol_trunc($translabel).' '; |
|
| 7800 | 7800 | } else { |
| 7801 | - $labeltoshow = dol_trunc($obj->$field_toshow) . ' '; |
|
| 7801 | + $labeltoshow = dol_trunc($obj->$field_toshow).' '; |
|
| 7802 | 7802 | } |
| 7803 | 7803 | } |
| 7804 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
| 7804 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
| 7805 | 7805 | } else { |
| 7806 | 7806 | if (!$notrans) { |
| 7807 | 7807 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
@@ -7815,34 +7815,34 @@ discard block |
||
| 7815 | 7815 | $labeltoshow = '(not defined)'; |
| 7816 | 7816 | } |
| 7817 | 7817 | if ($value == $obj->rowid) { |
| 7818 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
| 7818 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
| 7819 | 7819 | } |
| 7820 | 7820 | |
| 7821 | 7821 | if (!empty($InfoFieldList[3]) && $parentField) { |
| 7822 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
| 7822 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
| 7823 | 7823 | $isDependList = 1; |
| 7824 | 7824 | } |
| 7825 | 7825 | |
| 7826 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 7826 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 7827 | 7827 | $out .= ($value == $obj->rowid ? ' selected' : ''); |
| 7828 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
| 7829 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 7828 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
| 7829 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 7830 | 7830 | } |
| 7831 | 7831 | |
| 7832 | 7832 | $i++; |
| 7833 | 7833 | } |
| 7834 | 7834 | $this->db->free($resql); |
| 7835 | 7835 | } else { |
| 7836 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
| 7836 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
| 7837 | 7837 | } |
| 7838 | 7838 | } else { |
| 7839 | 7839 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
| 7840 | 7840 | $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
| 7841 | 7841 | $out .= '<option value="0"> </option>'; |
| 7842 | 7842 | foreach ($data as $data_key => $data_value) { |
| 7843 | - $out .= '<option value="' . $data_key . '"'; |
|
| 7843 | + $out .= '<option value="'.$data_key.'"'; |
|
| 7844 | 7844 | $out .= ($value == $data_key ? ' selected' : ''); |
| 7845 | - $out .= '>' . $data_value . '</option>'; |
|
| 7845 | + $out .= '>'.$data_value.'</option>'; |
|
| 7846 | 7846 | } |
| 7847 | 7847 | } |
| 7848 | 7848 | } |
@@ -7882,7 +7882,7 @@ discard block |
||
| 7882 | 7882 | // 7 : sort field |
| 7883 | 7883 | |
| 7884 | 7884 | // If there is a filter |
| 7885 | - if (! empty($InfoFieldList[4])) { |
|
| 7885 | + if (!empty($InfoFieldList[4])) { |
|
| 7886 | 7886 | $pos = 0; |
| 7887 | 7887 | $parenthesisopen = 0; |
| 7888 | 7888 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -7948,8 +7948,8 @@ discard block |
||
| 7948 | 7948 | } |
| 7949 | 7949 | |
| 7950 | 7950 | $sqlwhere = ''; |
| 7951 | - $sql = "SELECT " . $keyList; |
|
| 7952 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
| 7951 | + $sql = "SELECT ".$keyList; |
|
| 7952 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
| 7953 | 7953 | |
| 7954 | 7954 | if (!empty($InfoFieldList[4])) { |
| 7955 | 7955 | // can use SELECT request |
@@ -7967,11 +7967,11 @@ discard block |
||
| 7967 | 7967 | // We have to join on extrafield table |
| 7968 | 7968 | $errstr = ''; |
| 7969 | 7969 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 7970 | - $sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra'; |
|
| 7971 | - $sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]); |
|
| 7972 | - $sqlwhere .= " AND " . $InfoFieldList[4]; |
|
| 7970 | + $sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra'; |
|
| 7971 | + $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
|
| 7972 | + $sqlwhere .= " AND ".$InfoFieldList[4]; |
|
| 7973 | 7973 | } else { |
| 7974 | - $sqlwhere .= " WHERE " . $InfoFieldList[4]; |
|
| 7974 | + $sqlwhere .= " WHERE ".$InfoFieldList[4]; |
|
| 7975 | 7975 | } |
| 7976 | 7976 | } else { |
| 7977 | 7977 | $sqlwhere .= ' WHERE 1=1'; |
@@ -7992,14 +7992,14 @@ discard block |
||
| 7992 | 7992 | |
| 7993 | 7993 | // Some tables may have field, some other not. For the moment we disable it. |
| 7994 | 7994 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
| 7995 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
| 7995 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
| 7996 | 7996 | } |
| 7997 | 7997 | // $sql.=preg_replace('/^ AND /','',$sqlwhere); |
| 7998 | 7998 | // print $sql; |
| 7999 | 7999 | |
| 8000 | 8000 | $sql .= $sqlwhere; |
| 8001 | 8001 | |
| 8002 | - dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG); |
|
| 8002 | + dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG); |
|
| 8003 | 8003 | |
| 8004 | 8004 | $resql = $this->db->query($sql); |
| 8005 | 8005 | if ($resql) { |
@@ -8018,7 +8018,7 @@ discard block |
||
| 8018 | 8018 | if (count($fields_label) > 1) { |
| 8019 | 8019 | $notrans = true; |
| 8020 | 8020 | foreach ($fields_label as $field_toshow) { |
| 8021 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
| 8021 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
| 8022 | 8022 | } |
| 8023 | 8023 | } else { |
| 8024 | 8024 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -8029,9 +8029,9 @@ discard block |
||
| 8029 | 8029 | foreach ($fields_label as $field_toshow) { |
| 8030 | 8030 | $translabel = $langs->trans($obj->$field_toshow); |
| 8031 | 8031 | if ($translabel != $obj->$field_toshow) { |
| 8032 | - $labeltoshow = dol_trunc($translabel, 18) . ' '; |
|
| 8032 | + $labeltoshow = dol_trunc($translabel, 18).' '; |
|
| 8033 | 8033 | } else { |
| 8034 | - $labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' '; |
|
| 8034 | + $labeltoshow = dol_trunc($obj->$field_toshow, 18).' '; |
|
| 8035 | 8035 | } |
| 8036 | 8036 | } |
| 8037 | 8037 | |
@@ -8054,7 +8054,7 @@ discard block |
||
| 8054 | 8054 | } |
| 8055 | 8055 | |
| 8056 | 8056 | if (!empty($InfoFieldList[3]) && $parentField) { |
| 8057 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
| 8057 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
| 8058 | 8058 | $isDependList = 1; |
| 8059 | 8059 | } |
| 8060 | 8060 | |
@@ -8065,14 +8065,14 @@ discard block |
||
| 8065 | 8065 | } |
| 8066 | 8066 | $this->db->free($resql); |
| 8067 | 8067 | |
| 8068 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
| 8068 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
| 8069 | 8069 | } else { |
| 8070 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
| 8070 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
| 8071 | 8071 | } |
| 8072 | 8072 | } else { |
| 8073 | 8073 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
| 8074 | 8074 | $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
| 8075 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
| 8075 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
| 8076 | 8076 | } |
| 8077 | 8077 | } |
| 8078 | 8078 | } elseif ($type == 'link') { |
@@ -8303,7 +8303,7 @@ discard block |
||
| 8303 | 8303 | $value = $this->getLibStatut(3); |
| 8304 | 8304 | } elseif ($type == 'date') { |
| 8305 | 8305 | if (!empty($value)) { |
| 8306 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
| 8306 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
| 8307 | 8307 | } else { |
| 8308 | 8308 | $value = ''; |
| 8309 | 8309 | } |
@@ -8348,7 +8348,7 @@ discard block |
||
| 8348 | 8348 | $value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : ''; |
| 8349 | 8349 | if (strpos($value, "|") !== false) { |
| 8350 | 8350 | $value = $langs->trans(explode('|', $value)[0]); |
| 8351 | - } elseif (! is_numeric($value)) { |
|
| 8351 | + } elseif (!is_numeric($value)) { |
|
| 8352 | 8352 | $value = $langs->trans($value); |
| 8353 | 8353 | } |
| 8354 | 8354 | } elseif ($type == 'sellist') { |
@@ -8410,9 +8410,9 @@ discard block |
||
| 8410 | 8410 | $translabel = $langs->trans($obj->$field_toshow); |
| 8411 | 8411 | } |
| 8412 | 8412 | if ($translabel != $field_toshow) { |
| 8413 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
| 8413 | + $value .= dol_trunc($translabel, 18).' '; |
|
| 8414 | 8414 | } else { |
| 8415 | - $value .= $obj->$field_toshow . ' '; |
|
| 8415 | + $value .= $obj->$field_toshow.' '; |
|
| 8416 | 8416 | } |
| 8417 | 8417 | } |
| 8418 | 8418 | } else { |
@@ -8428,7 +8428,7 @@ discard block |
||
| 8428 | 8428 | } |
| 8429 | 8429 | } |
| 8430 | 8430 | } else { |
| 8431 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 8431 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 8432 | 8432 | |
| 8433 | 8433 | $toprint = array(); |
| 8434 | 8434 | $obj = $this->db->fetch_object($resql); |
@@ -8436,7 +8436,7 @@ discard block |
||
| 8436 | 8436 | $c->fetch($obj->rowid); |
| 8437 | 8437 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 8438 | 8438 | foreach ($ways as $way) { |
| 8439 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 8439 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 8440 | 8440 | } |
| 8441 | 8441 | $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
| 8442 | 8442 | } |
@@ -8452,11 +8452,11 @@ discard block |
||
| 8452 | 8452 | $toprint = array(); |
| 8453 | 8453 | foreach ($value_arr as $keyval => $valueval) { |
| 8454 | 8454 | if (!empty($valueval)) { |
| 8455 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>'; |
|
| 8455 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>'; |
|
| 8456 | 8456 | } |
| 8457 | 8457 | } |
| 8458 | 8458 | if (!empty($toprint)) { |
| 8459 | - $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
| 8459 | + $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 8460 | 8460 | } |
| 8461 | 8461 | } |
| 8462 | 8462 | } elseif ($type == 'chkbxlst') { |
@@ -8511,9 +8511,9 @@ discard block |
||
| 8511 | 8511 | $translabel = $langs->trans($obj->$field_toshow); |
| 8512 | 8512 | } |
| 8513 | 8513 | if ($translabel != $field_toshow) { |
| 8514 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
| 8514 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
| 8515 | 8515 | } else { |
| 8516 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>'; |
|
| 8516 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>'; |
|
| 8517 | 8517 | } |
| 8518 | 8518 | } |
| 8519 | 8519 | } else { |
@@ -8522,15 +8522,15 @@ discard block |
||
| 8522 | 8522 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
| 8523 | 8523 | } |
| 8524 | 8524 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
| 8525 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
| 8525 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
| 8526 | 8526 | } else { |
| 8527 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
| 8527 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
| 8528 | 8528 | } |
| 8529 | 8529 | } |
| 8530 | 8530 | } |
| 8531 | 8531 | } |
| 8532 | 8532 | } else { |
| 8533 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 8533 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 8534 | 8534 | |
| 8535 | 8535 | $toprint = array(); |
| 8536 | 8536 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -8539,7 +8539,7 @@ discard block |
||
| 8539 | 8539 | $c->fetch($obj->rowid); |
| 8540 | 8540 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 8541 | 8541 | foreach ($ways as $way) { |
| 8542 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 8542 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 8543 | 8543 | } |
| 8544 | 8544 | } |
| 8545 | 8545 | } |
@@ -8706,7 +8706,7 @@ discard block |
||
| 8706 | 8706 | global $langs; |
| 8707 | 8707 | |
| 8708 | 8708 | if (!class_exists('Validate')) { |
| 8709 | - require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php'; |
|
| 8709 | + require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php'; |
|
| 8710 | 8710 | } |
| 8711 | 8711 | |
| 8712 | 8712 | $this->clearFieldError($fieldKey); |
@@ -8945,7 +8945,7 @@ discard block |
||
| 8945 | 8945 | $out .= "\n"; |
| 8946 | 8946 | |
| 8947 | 8947 | $nbofextrafieldsshown = 0; |
| 8948 | - $e = 0; // var to manage the modulo (odd/even) |
|
| 8948 | + $e = 0; // var to manage the modulo (odd/even) |
|
| 8949 | 8949 | |
| 8950 | 8950 | $lastseparatorkeyfound = ''; |
| 8951 | 8951 | $extrafields_collapse_num = ''; |
@@ -10037,7 +10037,7 @@ discard block |
||
| 10037 | 10037 | continue; |
| 10038 | 10038 | } |
| 10039 | 10039 | } |
| 10040 | - $keys_with_alias[] = $alias . '.' . $fieldname; |
|
| 10040 | + $keys_with_alias[] = $alias.'.'.$fieldname; |
|
| 10041 | 10041 | } |
| 10042 | 10042 | return implode(',', $keys_with_alias); |
| 10043 | 10043 | } else { |
@@ -10172,7 +10172,7 @@ discard block |
||
| 10172 | 10172 | if (!$error) { |
| 10173 | 10173 | $sql = "INSERT INTO ".$this->db->prefix().$this->table_element; |
| 10174 | 10174 | $sql .= " (".implode(", ", $keys).')'; |
| 10175 | - $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
| 10175 | + $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
| 10176 | 10176 | |
| 10177 | 10177 | $res = $this->db->query($sql); |
| 10178 | 10178 | if (!$res) { |
@@ -10474,7 +10474,7 @@ discard block |
||
| 10474 | 10474 | |
| 10475 | 10475 | // Update extrafield |
| 10476 | 10476 | if (!$error) { |
| 10477 | - $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
| 10477 | + $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
| 10478 | 10478 | if ($result < 0) { |
| 10479 | 10479 | $error++; |
| 10480 | 10480 | } |
@@ -10676,12 +10676,12 @@ discard block |
||
| 10676 | 10676 | $error++; |
| 10677 | 10677 | } else { |
| 10678 | 10678 | while ($obj = $this->db->fetch_object($resql)) { |
| 10679 | - $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
| 10679 | + $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
| 10680 | 10680 | if ($result < 0) { |
| 10681 | 10681 | $error++; |
| 10682 | 10682 | $this->errors[] = $this->error; |
| 10683 | 10683 | } else { |
| 10684 | - $result = $this->delete($user); // @phpstan-ignore-line |
|
| 10684 | + $result = $this->delete($user); // @phpstan-ignore-line |
|
| 10685 | 10685 | if ($result < 0) { |
| 10686 | 10686 | $error++; |
| 10687 | 10687 | $this->errors[] = $this->error; |
@@ -10847,7 +10847,7 @@ discard block |
||
| 10847 | 10847 | ); |
| 10848 | 10848 | foreach ($fields as $key => $value) { |
| 10849 | 10849 | if (array_key_exists($key, $this->fields)) { |
| 10850 | - $this->{$key} = $value; // @phpstan-ignore-line |
|
| 10850 | + $this->{$key} = $value; // @phpstan-ignore-line |
|
| 10851 | 10851 | } |
| 10852 | 10852 | } |
| 10853 | 10853 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) { |
| 124 | 124 | if (!empty($perm)) { |
| 125 | 125 | $tmp = explode(':', $typeofdata); |
| 126 | - $ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">'; |
|
| 126 | + $ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">'; |
|
| 127 | 127 | if ($fieldrequired) { |
| 128 | 128 | $ret .= '<span class="fieldrequired">'; |
| 129 | 129 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | if ($fieldrequired) { |
| 136 | 136 | $ret .= '</span>'; |
| 137 | 137 | } |
| 138 | - $ret .= '</div>' . "\n"; |
|
| 138 | + $ret .= '</div>'."\n"; |
|
| 139 | 139 | } else { |
| 140 | 140 | if ($fieldrequired) { |
| 141 | 141 | $ret .= '<span class="fieldrequired">'; |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | if (empty($notabletag) && $perm) { |
| 174 | 174 | $ret .= '<td class="right">'; |
| 175 | 175 | } |
| 176 | - if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) { |
|
| 177 | - $ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>'; |
|
| 176 | + if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { |
|
| 177 | + $ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>'; |
|
| 178 | 178 | } |
| 179 | 179 | if (!empty($notabletag) && $notabletag == 1) { |
| 180 | 180 | if ($text) { |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | } elseif ($reg[1] == 'int') { |
| 242 | 242 | $typeofdata = 'numeric'; |
| 243 | 243 | } else { |
| 244 | - return 'ErrorBadParameter ' . $typeofdata; |
|
| 244 | + return 'ErrorBadParameter '.$typeofdata; |
|
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | 247 | |
@@ -252,13 +252,13 @@ discard block |
||
| 252 | 252 | if ($editaction == '') { |
| 253 | 253 | $editaction = GETPOST('action', 'aZ09'); |
| 254 | 254 | } |
| 255 | - $editmode = ($editaction == 'edit' . $htmlname); |
|
| 255 | + $editmode = ($editaction == 'edit'.$htmlname); |
|
| 256 | 256 | if ($editmode) { // edit mode |
| 257 | 257 | $ret .= "\n"; |
| 258 | - $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">'; |
|
| 259 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 260 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 261 | - $ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">'; |
|
| 258 | + $ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">'; |
|
| 259 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 260 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 261 | + $ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">'; |
|
| 262 | 262 | if (empty($notabletag)) { |
| 263 | 263 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 264 | 264 | } |
@@ -267,28 +267,28 @@ discard block |
||
| 267 | 267 | } |
| 268 | 268 | if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) { |
| 269 | 269 | $tmp = explode(':', $typeofdata); |
| 270 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 270 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 271 | 271 | } elseif (preg_match('/^(integer)/', $typeofdata)) { |
| 272 | 272 | $tmp = explode(':', $typeofdata); |
| 273 | 273 | $valuetoshow = price2num($editvalue ? $editvalue : $value, 0); |
| 274 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 274 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 275 | 275 | } elseif (preg_match('/^(numeric|amount)/', $typeofdata)) { |
| 276 | 276 | $tmp = explode(':', $typeofdata); |
| 277 | 277 | $valuetoshow = price2num($editvalue ? $editvalue : $value); |
| 278 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 278 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 279 | 279 | } elseif (preg_match('/^(checkbox)/', $typeofdata)) { |
| 280 | 280 | $tmp = explode(':', $typeofdata); |
| 281 | - $ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>'; |
|
| 281 | + $ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>'; |
|
| 282 | 282 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { // if wysiwyg is enabled $typeofdata = 'ckeditor' |
| 283 | 283 | $tmp = explode(':', $typeofdata); |
| 284 | 284 | $cols = (empty($tmp[2]) ? '' : $tmp[2]); |
| 285 | 285 | $morealt = ''; |
| 286 | 286 | if (preg_match('/%/', $cols)) { |
| 287 | - $morealt = ' style="width: ' . $cols . '"'; |
|
| 287 | + $morealt = ' style="width: '.$cols.'"'; |
|
| 288 | 288 | $cols = ''; |
| 289 | 289 | } |
| 290 | 290 | $valuetoshow = ($editvalue ? $editvalue : $value); |
| 291 | - $ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>'; |
|
| 291 | + $ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>'; |
|
| 292 | 292 | // textarea convert automatically entities chars into simple chars. |
| 293 | 293 | // So we convert & into & so a string like 'a < <b>b</b><br>é<br><script>alert('X');<script>' stay a correct html and is not converted by textarea component when wysiwyg is off. |
| 294 | 294 | $valuetoshow = str_replace('&', '&', $valuetoshow); |
@@ -298,12 +298,12 @@ discard block |
||
| 298 | 298 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 299 | 299 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 300 | 300 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 301 | - $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 301 | + $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 302 | 302 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 303 | 303 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 304 | 304 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 305 | 305 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 306 | - $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 306 | + $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 307 | 307 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 308 | 308 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 309 | 309 | $arraylist = array(); |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | // TODO Not yet implemented. See code for extrafields |
| 318 | 318 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
| 319 | 319 | $tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser |
| 320 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
| 320 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
| 321 | 321 | $doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? 100 : (int) $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? 20 : (int) $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7])); |
| 322 | 322 | $ret .= $doleditor->Create(1); |
| 323 | 323 | } elseif ($typeofdata == 'asis') { |
@@ -332,19 +332,19 @@ discard block |
||
| 332 | 332 | $ret .= '<td>'; |
| 333 | 333 | } |
| 334 | 334 | //else $ret.='<div class="clearboth"></div>'; |
| 335 | - $ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">'; |
|
| 335 | + $ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">'; |
|
| 336 | 336 | if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) { |
| 337 | - $ret .= '<br>' . "\n"; |
|
| 337 | + $ret .= '<br>'."\n"; |
|
| 338 | 338 | } |
| 339 | - $ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 339 | + $ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 340 | 340 | if (empty($notabletag)) { |
| 341 | 341 | $ret .= '</td>'; |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | if (empty($notabletag)) { |
| 345 | - $ret .= '</tr></table>' . "\n"; |
|
| 345 | + $ret .= '</tr></table>'."\n"; |
|
| 346 | 346 | } |
| 347 | - $ret .= '</form>' . "\n"; |
|
| 347 | + $ret .= '</form>'."\n"; |
|
| 348 | 348 | } else { // view mode |
| 349 | 349 | if (preg_match('/^email/', $typeofdata)) { |
| 350 | 350 | $ret .= dol_print_email($value, 0, 0, 0, 0, 1); |
@@ -356,15 +356,15 @@ discard block |
||
| 356 | 356 | $ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : ''); |
| 357 | 357 | } elseif (preg_match('/^checkbox/', $typeofdata)) { |
| 358 | 358 | $tmp = explode(':', $typeofdata); |
| 359 | - $ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>'; |
|
| 359 | + $ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>'; |
|
| 360 | 360 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { |
| 361 | 361 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1)); |
| 362 | 362 | } elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) { // 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring' |
| 363 | 363 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value)); |
| 364 | 364 | } elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') { |
| 365 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>'; |
|
| 365 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>'; |
|
| 366 | 366 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 367 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>'; |
|
| 367 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>'; |
|
| 368 | 368 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 369 | 369 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 370 | 370 | $arraylist = array(); |
@@ -375,9 +375,9 @@ discard block |
||
| 375 | 375 | $ret .= $arraylist[$value]; |
| 376 | 376 | if ($htmlname == 'fk_product_type') { |
| 377 | 377 | if ($value == 0) { |
| 378 | - $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 378 | + $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 379 | 379 | } else { |
| 380 | - $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 380 | + $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) { |
| 386 | 386 | $firstline = preg_replace('/<br>.*/', '', $tmpcontent); |
| 387 | 387 | $firstline = preg_replace('/[\n\r].*/', '', $firstline); |
| 388 | - $tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 388 | + $tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 389 | 389 | } |
| 390 | 390 | // We don't use dol_escape_htmltag to get the html formatting active, but this need we must also |
| 391 | 391 | // clean data from some dangerous html |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | if (empty($moreoptions['valuealreadyhtmlescaped'])) { |
| 395 | 395 | $ret .= dol_escape_htmltag($value); |
| 396 | 396 | } else { |
| 397 | - $ret .= $value; // $value must be already html escaped. |
|
| 397 | + $ret .= $value; // $value must be already html escaped. |
|
| 398 | 398 | } |
| 399 | 399 | } |
| 400 | 400 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | |
| 433 | 433 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 434 | 434 | if (!is_object($extralanguages)) { |
| 435 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 435 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 436 | 436 | $extralanguages = new ExtraLanguages($this->db); |
| 437 | 437 | } |
| 438 | 438 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -441,17 +441,17 @@ discard block |
||
| 441 | 441 | return ''; // No extralang field to show |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | - $result .= '<!-- Widget for translation -->' . "\n"; |
|
| 445 | - $result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">'; |
|
| 444 | + $result .= '<!-- Widget for translation -->'."\n"; |
|
| 445 | + $result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">'; |
|
| 446 | 446 | $s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang'); |
| 447 | 447 | $result .= $s; |
| 448 | 448 | $result .= '</div>'; |
| 449 | 449 | |
| 450 | - $result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">'; |
|
| 450 | + $result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">'; |
|
| 451 | 451 | |
| 452 | 452 | $resultforextrlang = ''; |
| 453 | 453 | foreach ($arrayoflangcode as $langcode) { |
| 454 | - $valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : ''; |
|
| 454 | + $valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : ''; |
|
| 455 | 455 | if (empty($valuetoshow)) { |
| 456 | 456 | $object->fetchValuesForExtraLanguages(); |
| 457 | 457 | //var_dump($object->array_languages); |
@@ -463,17 +463,17 @@ discard block |
||
| 463 | 463 | |
| 464 | 464 | // TODO Use the showInputField() method of ExtraLanguages object |
| 465 | 465 | if ($typeofdata == 'textarea') { |
| 466 | - $resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">'; |
|
| 466 | + $resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">'; |
|
| 467 | 467 | $resultforextrlang .= $valuetoshow; |
| 468 | 468 | $resultforextrlang .= '</textarea>'; |
| 469 | 469 | } else { |
| 470 | - $resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">'; |
|
| 470 | + $resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">'; |
|
| 471 | 471 | } |
| 472 | 472 | } |
| 473 | 473 | $result .= $resultforextrlang; |
| 474 | 474 | |
| 475 | 475 | $result .= '</div>'; |
| 476 | - $result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>'; |
|
| 476 | + $result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>'; |
|
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | return $result; |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | if (!empty($tmp[2])) { |
| 537 | 537 | $savemethod = $tmp[2]; |
| 538 | 538 | } |
| 539 | - $out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n"; |
|
| 539 | + $out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n"; |
|
| 540 | 540 | } elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) { |
| 541 | 541 | $tmp = explode(':', $inputType); |
| 542 | 542 | $inputType = $tmp[0]; |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | $savemethod = $tmp[2]; |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | - $out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format |
|
| 550 | + $out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format |
|
| 551 | 551 | } elseif (preg_match('/^(select|autocomplete)/', $inputType)) { |
| 552 | 552 | $tmp = explode(':', $inputType); |
| 553 | 553 | $inputType = $tmp[0]; |
@@ -578,40 +578,40 @@ discard block |
||
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | if (isModEnabled('fckeditor')) { |
| 581 | - $out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n"; |
|
| 581 | + $out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n"; |
|
| 582 | 582 | } else { |
| 583 | 583 | $inputType = 'textarea'; |
| 584 | 584 | } |
| 585 | 585 | } |
| 586 | 586 | |
| 587 | - $out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n"; |
|
| 588 | - $out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n"; |
|
| 589 | - $out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n"; |
|
| 590 | - $out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n"; |
|
| 587 | + $out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n"; |
|
| 588 | + $out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n"; |
|
| 589 | + $out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n"; |
|
| 590 | + $out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n"; |
|
| 591 | 591 | if (!empty($savemethod)) { |
| 592 | - $out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n"; |
|
| 592 | + $out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n"; |
|
| 593 | 593 | } |
| 594 | 594 | if (!empty($ext_element)) { |
| 595 | - $out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n"; |
|
| 595 | + $out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n"; |
|
| 596 | 596 | } |
| 597 | 597 | if (!empty($custommsg)) { |
| 598 | 598 | if (is_array($custommsg)) { |
| 599 | 599 | if (!empty($custommsg['success'])) { |
| 600 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n"; |
|
| 600 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n"; |
|
| 601 | 601 | } |
| 602 | 602 | if (!empty($custommsg['error'])) { |
| 603 | - $out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n"; |
|
| 603 | + $out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n"; |
|
| 604 | 604 | } |
| 605 | 605 | } else { |
| 606 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n"; |
|
| 606 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n"; |
|
| 607 | 607 | } |
| 608 | 608 | } |
| 609 | 609 | if ($inputType == 'textarea') { |
| 610 | - $out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n"; |
|
| 611 | - $out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n"; |
|
| 610 | + $out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n"; |
|
| 611 | + $out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n"; |
|
| 612 | 612 | } |
| 613 | - $out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n"; |
|
| 614 | - $out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n"; |
|
| 613 | + $out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n"; |
|
| 614 | + $out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n"; |
|
| 615 | 615 | } else { |
| 616 | 616 | $out = $value; |
| 617 | 617 | } |
@@ -640,12 +640,12 @@ discard block |
||
| 640 | 640 | public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) |
| 641 | 641 | { |
| 642 | 642 | if ($incbefore) { |
| 643 | - $text = $incbefore . $text; |
|
| 643 | + $text = $incbefore.$text; |
|
| 644 | 644 | } |
| 645 | 645 | if (!$htmltext) { |
| 646 | 646 | return $text; |
| 647 | 647 | } |
| 648 | - $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 648 | + $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 649 | 649 | |
| 650 | 650 | $tag = 'td'; |
| 651 | 651 | if ($notabs == 2) { |
@@ -659,11 +659,11 @@ discard block |
||
| 659 | 659 | |
| 660 | 660 | $extrastyle = ''; |
| 661 | 661 | if ($direction < 0) { |
| 662 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
| 662 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
| 663 | 663 | $extrastyle = 'padding: 0px; padding-left: 2px;'; |
| 664 | 664 | } |
| 665 | 665 | if ($direction > 0) { |
| 666 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
| 666 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
| 667 | 667 | $extrastyle = 'padding: 0px; padding-right: 2px;'; |
| 668 | 668 | } |
| 669 | 669 | |
@@ -676,53 +676,53 @@ discard block |
||
| 676 | 676 | $htmltext = str_replace('"', '"', $htmltext); |
| 677 | 677 | } else { |
| 678 | 678 | $classfortooltip = 'classfortooltiponclick'; |
| 679 | - $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>'; |
|
| 679 | + $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>'; |
|
| 680 | 680 | } |
| 681 | 681 | if ($tooltipon == 2 || $tooltipon == 3) { |
| 682 | - $paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"'; |
|
| 682 | + $paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"'; |
|
| 683 | 683 | if ($tooltiptrigger == '') { |
| 684 | - $paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip |
|
| 684 | + $paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip |
|
| 685 | 685 | } else { |
| 686 | - $paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 686 | + $paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 687 | 687 | } |
| 688 | 688 | } else { |
| 689 | - $paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
| 689 | + $paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
| 690 | 690 | } |
| 691 | 691 | if ($tooltipon == 1 || $tooltipon == 3) { |
| 692 | - $paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" '; |
|
| 692 | + $paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" '; |
|
| 693 | 693 | if ($tooltiptrigger == '') { |
| 694 | - $paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip |
|
| 694 | + $paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip |
|
| 695 | 695 | } else { |
| 696 | - $paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 696 | + $paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 697 | 697 | } |
| 698 | 698 | } else { |
| 699 | - $paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
| 699 | + $paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
| 700 | 700 | } |
| 701 | 701 | if (empty($notabs)) { |
| 702 | 702 | $s .= '<table class="nobordernopadding"><tr style="height: auto;">'; |
| 703 | 703 | } elseif ($notabs == 2) { |
| 704 | - $s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">'; |
|
| 704 | + $s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">'; |
|
| 705 | 705 | } |
| 706 | 706 | // Define value if value is before |
| 707 | 707 | if ($direction < 0) { |
| 708 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 708 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 709 | 709 | if ($tag == 'td') { |
| 710 | 710 | $s .= ' class="valigntop" width="14"'; |
| 711 | 711 | } |
| 712 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 712 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 713 | 713 | } |
| 714 | 714 | // Use another method to help avoid having a space in value in order to use this value with jquery |
| 715 | 715 | // Define label |
| 716 | 716 | if ((string) $text != '') { |
| 717 | - $s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>'; |
|
| 717 | + $s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>'; |
|
| 718 | 718 | } |
| 719 | 719 | // Define value if value is after |
| 720 | 720 | if ($direction > 0) { |
| 721 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 721 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 722 | 722 | if ($tag == 'td') { |
| 723 | 723 | $s .= ' class="valignmiddle" width="14"'; |
| 724 | 724 | } |
| 725 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 725 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 726 | 726 | } |
| 727 | 727 | if (empty($notabs)) { |
| 728 | 728 | $s .= '</tr></table>'; |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | |
| 830 | 830 | $disabled = 0; |
| 831 | 831 | $ret = '<div class="centpercent center">'; |
| 832 | - $ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>'; |
|
| 832 | + $ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>'; |
|
| 833 | 833 | |
| 834 | 834 | // Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks. |
| 835 | 835 | $parameters = array(); |
@@ -840,10 +840,10 @@ discard block |
||
| 840 | 840 | return; |
| 841 | 841 | } |
| 842 | 842 | if (empty($reshook)) { |
| 843 | - $ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>'; |
|
| 843 | + $ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>'; |
|
| 844 | 844 | if (is_array($arrayofaction)) { |
| 845 | 845 | foreach ($arrayofaction as $code => $label) { |
| 846 | - $ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>'; |
|
| 846 | + $ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>'; |
|
| 847 | 847 | } |
| 848 | 848 | } |
| 849 | 849 | } |
@@ -852,17 +852,17 @@ discard block |
||
| 852 | 852 | $ret .= '</select>'; |
| 853 | 853 | |
| 854 | 854 | if (empty($conf->dol_optimize_smallscreen)) { |
| 855 | - $ret .= ajax_combobox('.' . $name . 'select'); |
|
| 855 | + $ret .= ajax_combobox('.'.$name.'select'); |
|
| 856 | 856 | } |
| 857 | 857 | |
| 858 | 858 | // Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button |
| 859 | 859 | $ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER. |
| 860 | - $ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">'; |
|
| 860 | + $ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">'; |
|
| 861 | 861 | $ret .= '</div>'; |
| 862 | 862 | |
| 863 | 863 | if (!empty($conf->use_javascript_ajax)) { |
| 864 | 864 | $ret .= '<!-- JS CODE TO ENABLE mass action select --> |
| 865 | - <script nonce="' . getNonce() . '"> |
|
| 865 | + <script nonce="' . getNonce().'"> |
|
| 866 | 866 | function initCheckForSelect(mode, name, cssclass) /* mode is 0 during init of page or click all, 1 when we click on 1 checkboxi, "name" refers to the class of the massaction button, "cssclass" to the class of the checkfor select boxes */ |
| 867 | 867 | { |
| 868 | 868 | atleastoneselected=0; |
@@ -873,11 +873,11 @@ discard block |
||
| 873 | 873 | |
| 874 | 874 | console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected); |
| 875 | 875 | |
| 876 | - if (atleastoneselected || ' . $alwaysvisible . ') |
|
| 876 | + if (atleastoneselected || ' . $alwaysvisible.') |
|
| 877 | 877 | { |
| 878 | 878 | jQuery("."+name).show(); |
| 879 | - ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . ' |
|
| 880 | - ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . ' |
|
| 879 | + ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').' |
|
| 880 | + ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').' |
|
| 881 | 881 | } |
| 882 | 882 | else |
| 883 | 883 | { |
@@ -887,11 +887,11 @@ discard block |
||
| 887 | 887 | } |
| 888 | 888 | |
| 889 | 889 | jQuery(document).ready(function () { |
| 890 | - initCheckForSelect(0, "' . $name . '", "' . $cssclass . '"); |
|
| 891 | - jQuery(".' . $cssclass . '").click(function() { |
|
| 892 | - initCheckForSelect(1, "' . $name . '", "' . $cssclass . '"); |
|
| 890 | + initCheckForSelect(0, "' . $name.'", "'.$cssclass.'"); |
|
| 891 | + jQuery(".' . $cssclass.'").click(function() { |
|
| 892 | + initCheckForSelect(1, "' . $name.'", "'.$cssclass.'"); |
|
| 893 | 893 | }); |
| 894 | - jQuery(".' . $name . 'select").change(function() { |
|
| 894 | + jQuery(".' . $name.'select").change(function() { |
|
| 895 | 895 | var massaction = $( this ).val(); |
| 896 | 896 | var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); |
| 897 | 897 | if (massaction == "builddoc") |
@@ -899,18 +899,18 @@ discard block |
||
| 899 | 899 | urlform = urlform + "#show_files"; |
| 900 | 900 | } |
| 901 | 901 | $( this ).closest("form").attr("action", urlform); |
| 902 | - console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform); |
|
| 902 | + console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform); |
|
| 903 | 903 | /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */ |
| 904 | 904 | if ($(this).val() != \'0\') |
| 905 | 905 | { |
| 906 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', false); |
|
| 907 | - jQuery(".' . $name . 'other").hide(); /* To disable if another div was open */ |
|
| 908 | - jQuery(".' . $name . '"+massaction).show(); |
|
| 906 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', false); |
|
| 907 | + jQuery(".' . $name.'other").hide(); /* To disable if another div was open */ |
|
| 908 | + jQuery(".' . $name.'"+massaction).show(); |
|
| 909 | 909 | } |
| 910 | 910 | else |
| 911 | 911 | { |
| 912 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', true); |
|
| 913 | - jQuery(".' . $name . 'other").hide(); /* To disable any div open */ |
|
| 912 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', true); |
|
| 913 | + jQuery(".' . $name.'other").hide(); /* To disable any div open */ |
|
| 914 | 914 | } |
| 915 | 915 | }); |
| 916 | 916 | }); |
@@ -953,14 +953,14 @@ discard block |
||
| 953 | 953 | $atleastonefavorite = 0; |
| 954 | 954 | |
| 955 | 955 | $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec"; |
| 956 | - $sql .= " FROM " . $this->db->prefix() . "c_country"; |
|
| 956 | + $sql .= " FROM ".$this->db->prefix()."c_country"; |
|
| 957 | 957 | $sql .= " WHERE active > 0"; |
| 958 | 958 | //$sql.= " ORDER BY code ASC"; |
| 959 | 959 | |
| 960 | - dol_syslog(get_class($this) . "::select_country", LOG_DEBUG); |
|
| 960 | + dol_syslog(get_class($this)."::select_country", LOG_DEBUG); |
|
| 961 | 961 | $resql = $this->db->query($sql); |
| 962 | 962 | if ($resql) { |
| 963 | - $out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 963 | + $out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 964 | 964 | $num = $this->db->num_rows($resql); |
| 965 | 965 | $i = 0; |
| 966 | 966 | if ($num) { |
@@ -970,7 +970,7 @@ discard block |
||
| 970 | 970 | $countryArray[$i]['rowid'] = $obj->rowid; |
| 971 | 971 | $countryArray[$i]['code_iso'] = $obj->code_iso; |
| 972 | 972 | $countryArray[$i]['code_iso3'] = $obj->code_iso3; |
| 973 | - $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
| 973 | + $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
| 974 | 974 | $countryArray[$i]['favorite'] = $obj->favorite; |
| 975 | 975 | $countryArray[$i]['eec'] = $obj->eec; |
| 976 | 976 | $favorite[$i] = $obj->favorite; |
@@ -988,20 +988,20 @@ discard block |
||
| 988 | 988 | |
| 989 | 989 | if ($showempty) { |
| 990 | 990 | if (is_numeric($showempty)) { |
| 991 | - $out .= '<option value=""> </option>' . "\n"; |
|
| 991 | + $out .= '<option value=""> </option>'."\n"; |
|
| 992 | 992 | } else { |
| 993 | - $out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n"; |
|
| 993 | + $out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n"; |
|
| 994 | 994 | } |
| 995 | 995 | } |
| 996 | 996 | |
| 997 | 997 | if ($addspecialentries) { // Add dedicated entries for groups of countries |
| 998 | 998 | //if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>'; |
| 999 | - $out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 1000 | - $out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>'; |
|
| 999 | + $out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 1000 | + $out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>'; |
|
| 1001 | 1001 | if ($mysoc->isInEEC()) { |
| 1002 | - $out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 1002 | + $out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 1003 | 1003 | } |
| 1004 | - $out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>'; |
|
| 1004 | + $out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>'; |
|
| 1005 | 1005 | $out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>'; |
| 1006 | 1006 | } |
| 1007 | 1007 | |
@@ -1029,20 +1029,20 @@ discard block |
||
| 1029 | 1029 | $labeltoshow .= ' '; |
| 1030 | 1030 | } |
| 1031 | 1031 | if ($row['code_iso']) { |
| 1032 | - $labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>'; |
|
| 1032 | + $labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>'; |
|
| 1033 | 1033 | if (empty($hideflags)) { |
| 1034 | 1034 | $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1); |
| 1035 | - $labeltoshow = $tmpflag . ' ' . $labeltoshow; |
|
| 1035 | + $labeltoshow = $tmpflag.' '.$labeltoshow; |
|
| 1036 | 1036 | } |
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) { |
| 1040 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
| 1040 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
| 1041 | 1041 | } else { |
| 1042 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
| 1042 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
| 1043 | 1043 | } |
| 1044 | 1044 | $out .= $labeltoshow; |
| 1045 | - $out .= '</option>' . "\n"; |
|
| 1045 | + $out .= '</option>'."\n"; |
|
| 1046 | 1046 | } |
| 1047 | 1047 | } |
| 1048 | 1048 | $out .= '</select>'; |
@@ -1051,8 +1051,8 @@ discard block |
||
| 1051 | 1051 | } |
| 1052 | 1052 | |
| 1053 | 1053 | // Make select dynamic |
| 1054 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1055 | - $out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve'); |
|
| 1054 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1055 | + $out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve'); |
|
| 1056 | 1056 | |
| 1057 | 1057 | return $out; |
| 1058 | 1058 | } |
@@ -1084,25 +1084,25 @@ discard block |
||
| 1084 | 1084 | $incotermArray = array(); |
| 1085 | 1085 | |
| 1086 | 1086 | $sql = "SELECT rowid, code"; |
| 1087 | - $sql .= " FROM " . $this->db->prefix() . "c_incoterms"; |
|
| 1087 | + $sql .= " FROM ".$this->db->prefix()."c_incoterms"; |
|
| 1088 | 1088 | $sql .= " WHERE active > 0"; |
| 1089 | 1089 | $sql .= " ORDER BY code ASC"; |
| 1090 | 1090 | |
| 1091 | - dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG); |
|
| 1091 | + dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG); |
|
| 1092 | 1092 | $resql = $this->db->query($sql); |
| 1093 | 1093 | if ($resql) { |
| 1094 | 1094 | if ($conf->use_javascript_ajax && !$forcecombo) { |
| 1095 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1095 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1096 | 1096 | $out .= ajax_combobox($htmlname, $events); |
| 1097 | 1097 | } |
| 1098 | 1098 | |
| 1099 | 1099 | if (!empty($page)) { |
| 1100 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 1100 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 1101 | 1101 | $out .= '<input type="hidden" name="action" value="set_incoterms">'; |
| 1102 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1102 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | - $out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 1105 | + $out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 1106 | 1106 | $out .= '<option value="0"> </option>'; |
| 1107 | 1107 | $num = $this->db->num_rows($resql); |
| 1108 | 1108 | $i = 0; |
@@ -1116,9 +1116,9 @@ discard block |
||
| 1116 | 1116 | |
| 1117 | 1117 | foreach ($incotermArray as $row) { |
| 1118 | 1118 | if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) { |
| 1119 | - $out .= '<option value="' . $row['rowid'] . '" selected>'; |
|
| 1119 | + $out .= '<option value="'.$row['rowid'].'" selected>'; |
|
| 1120 | 1120 | } else { |
| 1121 | - $out .= '<option value="' . $row['rowid'] . '">'; |
|
| 1121 | + $out .= '<option value="'.$row['rowid'].'">'; |
|
| 1122 | 1122 | } |
| 1123 | 1123 | |
| 1124 | 1124 | if ($row['code']) { |
@@ -1131,13 +1131,13 @@ discard block |
||
| 1131 | 1131 | $out .= '</select>'; |
| 1132 | 1132 | |
| 1133 | 1133 | if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
| 1134 | - $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; |
|
| 1134 | + $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n"; |
|
| 1135 | 1135 | $moreattrib .= ' autocomplete="off"'; |
| 1136 | 1136 | } |
| 1137 | - $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n"; |
|
| 1137 | + $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n"; |
|
| 1138 | 1138 | |
| 1139 | 1139 | if (!empty($page)) { |
| 1140 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>'; |
|
| 1140 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>'; |
|
| 1141 | 1141 | } |
| 1142 | 1142 | } else { |
| 1143 | 1143 | dol_print_error($this->db); |
@@ -1169,9 +1169,9 @@ discard block |
||
| 1169 | 1169 | if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service")) |
| 1170 | 1170 | || (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) { |
| 1171 | 1171 | if (empty($hidetext)) { |
| 1172 | - print $langs->trans("Type") . ': '; |
|
| 1172 | + print $langs->trans("Type").': '; |
|
| 1173 | 1173 | } |
| 1174 | - print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 1174 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 1175 | 1175 | if ($showempty) { |
| 1176 | 1176 | print '<option value="-1"'; |
| 1177 | 1177 | if ($selected == -1) { |
@@ -1190,28 +1190,28 @@ discard block |
||
| 1190 | 1190 | if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) { |
| 1191 | 1191 | print ' selected'; |
| 1192 | 1192 | } |
| 1193 | - print '>' . $langs->trans("Product"); |
|
| 1193 | + print '>'.$langs->trans("Product"); |
|
| 1194 | 1194 | |
| 1195 | 1195 | print '<option value="1"'; |
| 1196 | 1196 | if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) { |
| 1197 | 1197 | print ' selected'; |
| 1198 | 1198 | } |
| 1199 | - print '>' . $langs->trans("Service"); |
|
| 1199 | + print '>'.$langs->trans("Service"); |
|
| 1200 | 1200 | |
| 1201 | 1201 | print '</select>'; |
| 1202 | - print ajax_combobox('select_' . $htmlname); |
|
| 1202 | + print ajax_combobox('select_'.$htmlname); |
|
| 1203 | 1203 | //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
| 1204 | 1204 | } |
| 1205 | 1205 | if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { |
| 1206 | 1206 | print $langs->trans("Service"); |
| 1207 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; |
|
| 1207 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; |
|
| 1208 | 1208 | } |
| 1209 | 1209 | if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) { |
| 1210 | 1210 | print $langs->trans("Product"); |
| 1211 | - print '<input type="hidden" name="' . $htmlname . '" value="0">'; |
|
| 1211 | + print '<input type="hidden" name="'.$htmlname.'" value="0">'; |
|
| 1212 | 1212 | } |
| 1213 | 1213 | if ($forceall < 0) { // This should happened only for contracts when both predefined product and service are disabled. |
| 1214 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
| 1214 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
| 1215 | 1215 | } |
| 1216 | 1216 | } |
| 1217 | 1217 | |
@@ -1237,7 +1237,7 @@ discard block |
||
| 1237 | 1237 | $langs->load("trips"); |
| 1238 | 1238 | |
| 1239 | 1239 | $sql = "SELECT c.code, c.label"; |
| 1240 | - $sql .= " FROM " . $this->db->prefix() . "c_type_fees as c"; |
|
| 1240 | + $sql .= " FROM ".$this->db->prefix()."c_type_fees as c"; |
|
| 1241 | 1241 | $sql .= " WHERE active > 0"; |
| 1242 | 1242 | |
| 1243 | 1243 | $resql = $this->db->query($sql); |
@@ -1278,11 +1278,11 @@ discard block |
||
| 1278 | 1278 | // phpcs:enable |
| 1279 | 1279 | global $user, $langs; |
| 1280 | 1280 | |
| 1281 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 1281 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 1282 | 1282 | |
| 1283 | 1283 | $this->load_cache_types_fees(); |
| 1284 | 1284 | |
| 1285 | - print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">'; |
|
| 1285 | + print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">'; |
|
| 1286 | 1286 | if ($showempty) { |
| 1287 | 1287 | print '<option value="-1"'; |
| 1288 | 1288 | if ($selected == -1) { |
@@ -1292,7 +1292,7 @@ discard block |
||
| 1292 | 1292 | } |
| 1293 | 1293 | |
| 1294 | 1294 | foreach ($this->cache_types_fees as $key => $value) { |
| 1295 | - print '<option value="' . $key . '"'; |
|
| 1295 | + print '<option value="'.$key.'"'; |
|
| 1296 | 1296 | if ($key == $selected) { |
| 1297 | 1297 | print ' selected'; |
| 1298 | 1298 | } |
@@ -1344,12 +1344,12 @@ discard block |
||
| 1344 | 1344 | $ajaxoptions = array(); |
| 1345 | 1345 | } |
| 1346 | 1346 | |
| 1347 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1347 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1348 | 1348 | |
| 1349 | 1349 | // No immediate load of all database |
| 1350 | 1350 | $placeholder = ''; |
| 1351 | 1351 | if ($selected && empty($selected_input_value)) { |
| 1352 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 1352 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 1353 | 1353 | $societetmp = new Societe($this->db); |
| 1354 | 1354 | $societetmp->fetch($selected); |
| 1355 | 1355 | $selected_input_value = $societetmp->name; |
@@ -1357,18 +1357,18 @@ discard block |
||
| 1357 | 1357 | } |
| 1358 | 1358 | |
| 1359 | 1359 | // mode 1 |
| 1360 | - $urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode((string) ($showtype)) : '') . ($showcode ? '&showcode=' . urlencode((string) ($showcode)) : ''); |
|
| 1360 | + $urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($excludeids) ? '' : '&excludeids='.implode(',', $excludeids)).($showtype ? '&showtype='.urlencode((string) ($showtype)) : '').($showcode ? '&showcode='.urlencode((string) ($showcode)) : ''); |
|
| 1361 | 1361 | |
| 1362 | 1362 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 1363 | 1363 | if (empty($hidelabel)) { |
| 1364 | - print $langs->trans("RefOrLabel") . ' : '; |
|
| 1364 | + print $langs->trans("RefOrLabel").' : '; |
|
| 1365 | 1365 | } elseif ($hidelabel > 1) { |
| 1366 | 1366 | $placeholder = $langs->trans("RefOrLabel"); |
| 1367 | 1367 | if ($hidelabel == 2) { |
| 1368 | 1368 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1369 | 1369 | } |
| 1370 | 1370 | } |
| 1371 | - $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 1371 | + $out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 1372 | 1372 | if ($hidelabel == 3) { |
| 1373 | 1373 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1374 | 1374 | } |
@@ -1430,12 +1430,12 @@ discard block |
||
| 1430 | 1430 | $events = array(); |
| 1431 | 1431 | } |
| 1432 | 1432 | |
| 1433 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1433 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1434 | 1434 | |
| 1435 | 1435 | // No immediate load of all database |
| 1436 | 1436 | $placeholder = ''; |
| 1437 | 1437 | if ($selected && empty($selected_input_value)) { |
| 1438 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 1438 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 1439 | 1439 | $contacttmp = new Contact($this->db); |
| 1440 | 1440 | $contacttmp->fetch($selected); |
| 1441 | 1441 | $selected_input_value = $contacttmp->getFullName($langs); |
@@ -1446,11 +1446,11 @@ discard block |
||
| 1446 | 1446 | } |
| 1447 | 1447 | |
| 1448 | 1448 | // mode 1 |
| 1449 | - $urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($exclude) ? '' : '&exclude=' . urlencode($exclude)) . ($showsoc ? '&showsoc=' . urlencode((string) ($showsoc)) : ''); |
|
| 1449 | + $urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($exclude) ? '' : '&exclude='.urlencode($exclude)).($showsoc ? '&showsoc='.urlencode((string) ($showsoc)) : ''); |
|
| 1450 | 1450 | |
| 1451 | 1451 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 1452 | 1452 | |
| 1453 | - $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 1453 | + $out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 1454 | 1454 | |
| 1455 | 1455 | $out .= ajax_event($htmlname, $events); |
| 1456 | 1456 | |
@@ -1547,30 +1547,30 @@ discard block |
||
| 1547 | 1547 | $sql .= ", s.address, s.zip, s.town"; |
| 1548 | 1548 | $sql .= ", dictp.code as country_code"; |
| 1549 | 1549 | } |
| 1550 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
| 1550 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
| 1551 | 1551 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1552 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1552 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1553 | 1553 | } |
| 1554 | 1554 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1555 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 1555 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 1556 | 1556 | } |
| 1557 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
| 1557 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
| 1558 | 1558 | if (!empty($user->socid)) { |
| 1559 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
| 1559 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
| 1560 | 1560 | } |
| 1561 | 1561 | if ($filter) { |
| 1562 | 1562 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
| 1563 | 1563 | // if not, by testSqlAndScriptInject() only. |
| 1564 | - $sql .= " AND (" . $filter . ")"; |
|
| 1564 | + $sql .= " AND (".$filter.")"; |
|
| 1565 | 1565 | } |
| 1566 | 1566 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1567 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 1567 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 1568 | 1568 | } |
| 1569 | 1569 | if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1570 | 1570 | $sql .= " AND s.status <> 0"; |
| 1571 | 1571 | } |
| 1572 | 1572 | if (!empty($excludeids)) { |
| 1573 | - $sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")"; |
|
| 1573 | + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")"; |
|
| 1574 | 1574 | } |
| 1575 | 1575 | // Add where from hooks |
| 1576 | 1576 | $parameters = array(); |
@@ -1590,17 +1590,17 @@ discard block |
||
| 1590 | 1590 | if ($i > 0) { |
| 1591 | 1591 | $sql .= " AND "; |
| 1592 | 1592 | } |
| 1593 | - $sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 1593 | + $sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 1594 | 1594 | $i++; |
| 1595 | 1595 | } |
| 1596 | 1596 | if (count($search_crit) > 1) { |
| 1597 | 1597 | $sql .= ")"; |
| 1598 | 1598 | } |
| 1599 | 1599 | if (isModEnabled('barcode')) { |
| 1600 | - $sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1600 | + $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1601 | 1601 | } |
| 1602 | - $sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1603 | - $sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1602 | + $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1603 | + $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1604 | 1604 | $sql .= ")"; |
| 1605 | 1605 | } |
| 1606 | 1606 | $sql .= $this->db->order("nom", "ASC"); |
@@ -1611,7 +1611,7 @@ discard block |
||
| 1611 | 1611 | $resql = $this->db->query($sql); |
| 1612 | 1612 | if ($resql) { |
| 1613 | 1613 | // Construct $out and $outarray |
| 1614 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n"; |
|
| 1614 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n"; |
|
| 1615 | 1615 | |
| 1616 | 1616 | $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); |
| 1617 | 1617 | if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) { |
@@ -1624,7 +1624,7 @@ discard block |
||
| 1624 | 1624 | } |
| 1625 | 1625 | } |
| 1626 | 1626 | if ($showempty) { |
| 1627 | - $out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : ' ') . '</span>') . '">' . $textifempty . '</option>' . "\n"; |
|
| 1627 | + $out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : ' ').'</span>').'">'.$textifempty.'</option>'."\n"; |
|
| 1628 | 1628 | } |
| 1629 | 1629 | |
| 1630 | 1630 | $companytemp = new Societe($this->db); |
@@ -1637,18 +1637,18 @@ discard block |
||
| 1637 | 1637 | $label = ''; |
| 1638 | 1638 | if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) { |
| 1639 | 1639 | if (($obj->client) && (!empty($obj->code_client))) { |
| 1640 | - $label = $obj->code_client . ' - '; |
|
| 1640 | + $label = $obj->code_client.' - '; |
|
| 1641 | 1641 | } |
| 1642 | 1642 | if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { |
| 1643 | - $label .= $obj->code_fournisseur . ' - '; |
|
| 1643 | + $label .= $obj->code_fournisseur.' - '; |
|
| 1644 | 1644 | } |
| 1645 | - $label .= ' ' . $obj->name; |
|
| 1645 | + $label .= ' '.$obj->name; |
|
| 1646 | 1646 | } else { |
| 1647 | 1647 | $label = $obj->name; |
| 1648 | 1648 | } |
| 1649 | 1649 | |
| 1650 | 1650 | if (!empty($obj->name_alias)) { |
| 1651 | - $label .= ' (' . $obj->name_alias . ')'; |
|
| 1651 | + $label .= ' ('.$obj->name_alias.')'; |
|
| 1652 | 1652 | } |
| 1653 | 1653 | |
| 1654 | 1654 | if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) { |
@@ -1663,7 +1663,7 @@ discard block |
||
| 1663 | 1663 | $companytemp->fournisseur = $obj->fournisseur; |
| 1664 | 1664 | $tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); |
| 1665 | 1665 | if ($tmptype) { |
| 1666 | - $labelhtml .= ' ' . $tmptype; |
|
| 1666 | + $labelhtml .= ' '.$tmptype; |
|
| 1667 | 1667 | } |
| 1668 | 1668 | |
| 1669 | 1669 | if ($obj->client || $obj->fournisseur) { |
@@ -1673,10 +1673,10 @@ discard block |
||
| 1673 | 1673 | $label .= $langs->trans("Customer"); |
| 1674 | 1674 | } |
| 1675 | 1675 | if ($obj->client == 2 || $obj->client == 3) { |
| 1676 | - $label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect"); |
|
| 1676 | + $label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect"); |
|
| 1677 | 1677 | } |
| 1678 | 1678 | if ($obj->fournisseur) { |
| 1679 | - $label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier"); |
|
| 1679 | + $label .= ($obj->client ? ', ' : '').$langs->trans("Supplier"); |
|
| 1680 | 1680 | } |
| 1681 | 1681 | if ($obj->client || $obj->fournisseur) { |
| 1682 | 1682 | $label .= ')'; |
@@ -1684,9 +1684,9 @@ discard block |
||
| 1684 | 1684 | } |
| 1685 | 1685 | |
| 1686 | 1686 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1687 | - $s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : ''); |
|
| 1687 | + $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); |
|
| 1688 | 1688 | if (!empty($obj->country_code)) { |
| 1689 | - $s .= ', ' . $langs->trans('Country' . $obj->country_code); |
|
| 1689 | + $s .= ', '.$langs->trans('Country'.$obj->country_code); |
|
| 1690 | 1690 | } |
| 1691 | 1691 | $label .= $s; |
| 1692 | 1692 | $labelhtml .= $s; |
@@ -1694,9 +1694,9 @@ discard block |
||
| 1694 | 1694 | |
| 1695 | 1695 | if (empty($outputmode)) { |
| 1696 | 1696 | if (in_array($obj->rowid, $selected)) { |
| 1697 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 1697 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 1698 | 1698 | } else { |
| 1699 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 1699 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 1700 | 1700 | } |
| 1701 | 1701 | } else { |
| 1702 | 1702 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml)); |
@@ -1708,9 +1708,9 @@ discard block |
||
| 1708 | 1708 | } |
| 1709 | 1709 | } |
| 1710 | 1710 | } |
| 1711 | - $out .= '</select>' . "\n"; |
|
| 1711 | + $out .= '</select>'."\n"; |
|
| 1712 | 1712 | if (!$forcecombo) { |
| 1713 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1713 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1714 | 1714 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("COMPANY_USE_SEARCH_TO_SELECT")); |
| 1715 | 1715 | } |
| 1716 | 1716 | } else { |
@@ -1799,7 +1799,7 @@ discard block |
||
| 1799 | 1799 | } |
| 1800 | 1800 | |
| 1801 | 1801 | if (!is_object($hookmanager)) { |
| 1802 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
| 1802 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
| 1803 | 1803 | $hookmanager = new HookManager($this->db); |
| 1804 | 1804 | } |
| 1805 | 1805 | |
@@ -1808,13 +1808,13 @@ discard block |
||
| 1808 | 1808 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1809 | 1809 | $sql .= ", s.nom as company, s.town AS company_town"; |
| 1810 | 1810 | } |
| 1811 | - $sql .= " FROM " . $this->db->prefix() . "socpeople as sp"; |
|
| 1811 | + $sql .= " FROM ".$this->db->prefix()."socpeople as sp"; |
|
| 1812 | 1812 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1813 | - $sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc"; |
|
| 1813 | + $sql .= " LEFT OUTER JOIN ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc"; |
|
| 1814 | 1814 | } |
| 1815 | - $sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")"; |
|
| 1815 | + $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
|
| 1816 | 1816 | if ($socid > 0 || $socid == -1) { |
| 1817 | - $sql .= " AND sp.fk_soc = " . ((int) $socid); |
|
| 1817 | + $sql .= " AND sp.fk_soc = ".((int) $socid); |
|
| 1818 | 1818 | } |
| 1819 | 1819 | if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1820 | 1820 | $sql .= " AND sp.statut <> 0"; |
@@ -1822,7 +1822,7 @@ discard block |
||
| 1822 | 1822 | if ($filter) { |
| 1823 | 1823 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
| 1824 | 1824 | // if not, by testSqlAndScriptInject() only. |
| 1825 | - $sql .= " AND (" . $filter . ")"; |
|
| 1825 | + $sql .= " AND (".$filter.")"; |
|
| 1826 | 1826 | } |
| 1827 | 1827 | // Add where from hooks |
| 1828 | 1828 | $parameters = array(); |
@@ -1830,30 +1830,30 @@ discard block |
||
| 1830 | 1830 | $sql .= $hookmanager->resPrint; |
| 1831 | 1831 | $sql .= " ORDER BY sp.lastname ASC"; |
| 1832 | 1832 | |
| 1833 | - dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG); |
|
| 1833 | + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); |
|
| 1834 | 1834 | $resql = $this->db->query($sql); |
| 1835 | 1835 | if ($resql) { |
| 1836 | 1836 | $num = $this->db->num_rows($resql); |
| 1837 | 1837 | |
| 1838 | 1838 | if ($htmlname != 'none' && !$options_only) { |
| 1839 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>'; |
|
| 1839 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; |
|
| 1840 | 1840 | } |
| 1841 | 1841 | |
| 1842 | 1842 | if ($showempty && !is_numeric($showempty)) { |
| 1843 | 1843 | $textforempty = $showempty; |
| 1844 | - $out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>'; |
|
| 1844 | + $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; |
|
| 1845 | 1845 | } else { |
| 1846 | 1846 | if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) { |
| 1847 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '> </option>'; |
|
| 1847 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>'; |
|
| 1848 | 1848 | } |
| 1849 | 1849 | if ($showempty == 2) { |
| 1850 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>'; |
|
| 1850 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; |
|
| 1851 | 1851 | } |
| 1852 | 1852 | } |
| 1853 | 1853 | |
| 1854 | 1854 | $i = 0; |
| 1855 | 1855 | if ($num) { |
| 1856 | - include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 1856 | + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 1857 | 1857 | $contactstatic = new Contact($this->db); |
| 1858 | 1858 | |
| 1859 | 1859 | while ($i < $num) { |
@@ -1889,7 +1889,7 @@ discard block |
||
| 1889 | 1889 | } |
| 1890 | 1890 | $extendedInfos = implode(' - ', $extendedInfos); |
| 1891 | 1891 | if (!empty($extendedInfos)) { |
| 1892 | - $extendedInfos = ' - ' . $extendedInfos; |
|
| 1892 | + $extendedInfos = ' - '.$extendedInfos; |
|
| 1893 | 1893 | } |
| 1894 | 1894 | } |
| 1895 | 1895 | |
@@ -1907,35 +1907,35 @@ discard block |
||
| 1907 | 1907 | $disabled = 1; |
| 1908 | 1908 | } |
| 1909 | 1909 | if (!empty($selected) && in_array($obj->rowid, $selected)) { |
| 1910 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1910 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1911 | 1911 | if ($disabled) { |
| 1912 | 1912 | $out .= ' disabled'; |
| 1913 | 1913 | } |
| 1914 | 1914 | $out .= ' selected>'; |
| 1915 | 1915 | |
| 1916 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1916 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1917 | 1917 | if ($showfunction && $obj->poste) { |
| 1918 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
| 1918 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
| 1919 | 1919 | } |
| 1920 | 1920 | if (($showsoc > 0) && $obj->company) { |
| 1921 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
| 1921 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
| 1922 | 1922 | } |
| 1923 | 1923 | |
| 1924 | 1924 | $out .= $tmplabel; |
| 1925 | 1925 | $out .= '</option>'; |
| 1926 | 1926 | } else { |
| 1927 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1927 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1928 | 1928 | if ($disabled) { |
| 1929 | 1929 | $out .= ' disabled'; |
| 1930 | 1930 | } |
| 1931 | 1931 | $out .= '>'; |
| 1932 | 1932 | |
| 1933 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1933 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1934 | 1934 | if ($showfunction && $obj->poste) { |
| 1935 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
| 1935 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
| 1936 | 1936 | } |
| 1937 | 1937 | if (($showsoc > 0) && $obj->company) { |
| 1938 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
| 1938 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
| 1939 | 1939 | } |
| 1940 | 1940 | |
| 1941 | 1941 | $out .= $tmplabel; |
@@ -1943,12 +1943,12 @@ discard block |
||
| 1943 | 1943 | } |
| 1944 | 1944 | } else { |
| 1945 | 1945 | if (in_array($obj->rowid, $selected)) { |
| 1946 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1946 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1947 | 1947 | if ($showfunction && $obj->poste) { |
| 1948 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
| 1948 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
| 1949 | 1949 | } |
| 1950 | 1950 | if (($showsoc > 0) && $obj->company) { |
| 1951 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
| 1951 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
| 1952 | 1952 | } |
| 1953 | 1953 | |
| 1954 | 1954 | $out .= $tmplabel; |
@@ -1963,7 +1963,7 @@ discard block |
||
| 1963 | 1963 | } |
| 1964 | 1964 | } else { |
| 1965 | 1965 | $labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); |
| 1966 | - $out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">'; |
|
| 1966 | + $out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">'; |
|
| 1967 | 1967 | $out .= $labeltoshow; |
| 1968 | 1968 | $out .= '</option>'; |
| 1969 | 1969 | } |
@@ -1984,7 +1984,7 @@ discard block |
||
| 1984 | 1984 | } |
| 1985 | 1985 | |
| 1986 | 1986 | if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { |
| 1987 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1987 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1988 | 1988 | $out .= ajax_combobox($htmlid, $events, getDolGlobalInt("CONTACT_USE_SEARCH_TO_SELECT")); |
| 1989 | 1989 | } |
| 1990 | 1990 | |
@@ -2023,18 +2023,18 @@ discard block |
||
| 2023 | 2023 | // On recherche les remises |
| 2024 | 2024 | $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
| 2025 | 2025 | $sql .= " re.description, re.fk_facture_source"; |
| 2026 | - $sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re"; |
|
| 2027 | - $sql .= " WHERE re.fk_soc = " . (int) $socid; |
|
| 2028 | - $sql .= " AND re.entity = " . $conf->entity; |
|
| 2026 | + $sql .= " FROM ".$this->db->prefix()."societe_remise_except as re"; |
|
| 2027 | + $sql .= " WHERE re.fk_soc = ".(int) $socid; |
|
| 2028 | + $sql .= " AND re.entity = ".$conf->entity; |
|
| 2029 | 2029 | if ($filter) { |
| 2030 | - $sql .= " AND " . $filter; |
|
| 2030 | + $sql .= " AND ".$filter; |
|
| 2031 | 2031 | } |
| 2032 | 2032 | $sql .= " ORDER BY re.description ASC"; |
| 2033 | 2033 | |
| 2034 | - dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG); |
|
| 2034 | + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); |
|
| 2035 | 2035 | $resql = $this->db->query($sql); |
| 2036 | 2036 | if ($resql) { |
| 2037 | - print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">'; |
|
| 2037 | + print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">'; |
|
| 2038 | 2038 | $num = $this->db->num_rows($resql); |
| 2039 | 2039 | |
| 2040 | 2040 | $qualifiedlines = $num; |
@@ -2072,16 +2072,16 @@ discard block |
||
| 2072 | 2072 | if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) { |
| 2073 | 2073 | $tmpfac = new Facture($this->db); |
| 2074 | 2074 | if ($tmpfac->fetch($obj->fk_facture_source) > 0) { |
| 2075 | - $desc = $desc . ' - ' . $tmpfac->ref; |
|
| 2075 | + $desc = $desc.' - '.$tmpfac->ref; |
|
| 2076 | 2076 | } |
| 2077 | 2077 | } |
| 2078 | 2078 | |
| 2079 | - print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; |
|
| 2079 | + print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>'; |
|
| 2080 | 2080 | $i++; |
| 2081 | 2081 | } |
| 2082 | 2082 | } |
| 2083 | 2083 | print '</select>'; |
| 2084 | - print ajax_combobox('select_' . $htmlname); |
|
| 2084 | + print ajax_combobox('select_'.$htmlname); |
|
| 2085 | 2085 | |
| 2086 | 2086 | return $qualifiedlines; |
| 2087 | 2087 | } else { |
@@ -2190,14 +2190,14 @@ discard block |
||
| 2190 | 2190 | if ($showlabelofentity) { |
| 2191 | 2191 | $sql .= ", e.label"; |
| 2192 | 2192 | } |
| 2193 | - $sql .= " FROM " . $this->db->prefix() . "user as u"; |
|
| 2193 | + $sql .= " FROM ".$this->db->prefix()."user as u"; |
|
| 2194 | 2194 | if ($showlabelofentity) { |
| 2195 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity"; |
|
| 2195 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; |
|
| 2196 | 2196 | } |
| 2197 | 2197 | // Condition here should be the same than into societe->getSalesRepresentatives(). |
| 2198 | 2198 | if ($userissuperadminentityone && $force_entity != 'default') { |
| 2199 | 2199 | if (!empty($force_entity)) { |
| 2200 | - $sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")"; |
|
| 2200 | + $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; |
|
| 2201 | 2201 | } else { |
| 2202 | 2202 | $sql .= " WHERE u.entity IS NOT NULL"; |
| 2203 | 2203 | } |
@@ -2205,18 +2205,18 @@ discard block |
||
| 2205 | 2205 | if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) { |
| 2206 | 2206 | $sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))"; |
| 2207 | 2207 | } else { |
| 2208 | - $sql .= " WHERE u.entity IN (" . getEntity('user') . ")"; |
|
| 2208 | + $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
|
| 2209 | 2209 | } |
| 2210 | 2210 | } |
| 2211 | 2211 | |
| 2212 | 2212 | if (!empty($user->socid)) { |
| 2213 | - $sql .= " AND u.fk_soc = " . ((int) $user->socid); |
|
| 2213 | + $sql .= " AND u.fk_soc = ".((int) $user->socid); |
|
| 2214 | 2214 | } |
| 2215 | 2215 | if (is_array($exclude) && $excludeUsers) { |
| 2216 | - $sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")"; |
|
| 2216 | + $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; |
|
| 2217 | 2217 | } |
| 2218 | 2218 | if ($includeUsers) { |
| 2219 | - $sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")"; |
|
| 2219 | + $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; |
|
| 2220 | 2220 | } |
| 2221 | 2221 | if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) { |
| 2222 | 2222 | $sql .= " AND u.statut <> 0"; |
@@ -2228,7 +2228,7 @@ discard block |
||
| 2228 | 2228 | $sql .= " AND u.fk_soc IS NULL"; |
| 2229 | 2229 | } |
| 2230 | 2230 | if (!empty($morefilter)) { |
| 2231 | - $sql .= " " . $morefilter; |
|
| 2231 | + $sql .= " ".$morefilter; |
|
| 2232 | 2232 | } |
| 2233 | 2233 | |
| 2234 | 2234 | //Add hook to filter on user (for example on usergroup define in custom modules) |
@@ -2243,7 +2243,7 @@ discard block |
||
| 2243 | 2243 | $sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC"; |
| 2244 | 2244 | } |
| 2245 | 2245 | |
| 2246 | - dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG); |
|
| 2246 | + dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); |
|
| 2247 | 2247 | |
| 2248 | 2248 | $resql = $this->db->query($sql); |
| 2249 | 2249 | if ($resql) { |
@@ -2251,7 +2251,7 @@ discard block |
||
| 2251 | 2251 | $i = 0; |
| 2252 | 2252 | if ($num) { |
| 2253 | 2253 | // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined |
| 2254 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 2254 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 2255 | 2255 | if ($show_empty && !$multiple) { |
| 2256 | 2256 | $textforempty = ' '; |
| 2257 | 2257 | if (!empty($conf->use_javascript_ajax)) { |
@@ -2260,7 +2260,7 @@ discard block |
||
| 2260 | 2260 | if (!is_numeric($show_empty)) { |
| 2261 | 2261 | $textforempty = $show_empty; |
| 2262 | 2262 | } |
| 2263 | - $out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 2263 | + $out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 2264 | 2264 | |
| 2265 | 2265 | $outarray[($show_empty < 0 ? $show_empty : -1)] = $textforempty; |
| 2266 | 2266 | $outarray2[($show_empty < 0 ? $show_empty : -1)] = array( |
@@ -2272,13 +2272,13 @@ discard block |
||
| 2272 | 2272 | ); |
| 2273 | 2273 | } |
| 2274 | 2274 | if ($show_every) { |
| 2275 | - $out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n"; |
|
| 2275 | + $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; |
|
| 2276 | 2276 | |
| 2277 | - $outarray[-2] = '-- ' . $langs->trans("Everybody") . ' --'; |
|
| 2277 | + $outarray[-2] = '-- '.$langs->trans("Everybody").' --'; |
|
| 2278 | 2278 | $outarray2[-2] = array( |
| 2279 | 2279 | 'id' => -2, |
| 2280 | - 'label' => '-- ' . $langs->trans("Everybody") . ' --', |
|
| 2281 | - 'labelhtml' => '-- ' . $langs->trans("Everybody") . ' --', |
|
| 2280 | + 'label' => '-- '.$langs->trans("Everybody").' --', |
|
| 2281 | + 'labelhtml' => '-- '.$langs->trans("Everybody").' --', |
|
| 2282 | 2282 | 'color' => '', |
| 2283 | 2283 | 'picto' => '' |
| 2284 | 2284 | ); |
@@ -2329,21 +2329,21 @@ discard block |
||
| 2329 | 2329 | } |
| 2330 | 2330 | if ($showstatus >= 0) { |
| 2331 | 2331 | if ($obj->status == 1 && $showstatus == 1) { |
| 2332 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled'); |
|
| 2333 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled'); |
|
| 2332 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); |
|
| 2333 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled'); |
|
| 2334 | 2334 | } |
| 2335 | 2335 | if ($obj->status == 0 && $showstatus == 1) { |
| 2336 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled'); |
|
| 2337 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled'); |
|
| 2336 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); |
|
| 2337 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled'); |
|
| 2338 | 2338 | } |
| 2339 | 2339 | } |
| 2340 | 2340 | if ($showlabelofentity) { |
| 2341 | 2341 | if (empty($obj->entity)) { |
| 2342 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities"); |
|
| 2343 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities"); |
|
| 2342 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); |
|
| 2343 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities"); |
|
| 2344 | 2344 | } else { |
| 2345 | 2345 | if ($obj->entity != $conf->entity) { |
| 2346 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2346 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2347 | 2347 | $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
| 2348 | 2348 | } |
| 2349 | 2349 | } |
@@ -2352,13 +2352,13 @@ discard block |
||
| 2352 | 2352 | $moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : ''); |
| 2353 | 2353 | if (!empty($disableline) && $disableline != '1') { |
| 2354 | 2354 | // Add text from $enableonlytext parameter |
| 2355 | - $moreinfo .= ' - ' . $disableline; |
|
| 2356 | - $moreinfohtml .= ' - ' . $disableline; |
|
| 2355 | + $moreinfo .= ' - '.$disableline; |
|
| 2356 | + $moreinfohtml .= ' - '.$disableline; |
|
| 2357 | 2357 | } |
| 2358 | 2358 | $labeltoshow .= $moreinfo; |
| 2359 | 2359 | $labeltoshowhtml .= $moreinfohtml; |
| 2360 | 2360 | |
| 2361 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2361 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2362 | 2362 | if (!empty($disableline)) { |
| 2363 | 2363 | $out .= ' disabled'; |
| 2364 | 2364 | } |
@@ -2367,7 +2367,7 @@ discard block |
||
| 2367 | 2367 | } |
| 2368 | 2368 | $out .= ' data-html="'; |
| 2369 | 2369 | |
| 2370 | - $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' '; |
|
| 2370 | + $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; |
|
| 2371 | 2371 | if ($showstatus >= 0 && $obj->status == 0) { |
| 2372 | 2372 | $outhtml .= '<strike class="opacitymediumxxx">'; |
| 2373 | 2373 | } |
@@ -2382,7 +2382,7 @@ discard block |
||
| 2382 | 2382 | $out .= $labeltoshow; |
| 2383 | 2383 | $out .= '</option>'; |
| 2384 | 2384 | |
| 2385 | - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo; |
|
| 2385 | + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; |
|
| 2386 | 2386 | $outarray2[$userstatic->id] = array( |
| 2387 | 2387 | 'id' => $userstatic->id, |
| 2388 | 2388 | 'label' => $labeltoshow, |
@@ -2394,14 +2394,14 @@ discard block |
||
| 2394 | 2394 | $i++; |
| 2395 | 2395 | } |
| 2396 | 2396 | } else { |
| 2397 | - $out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>'; |
|
| 2398 | - $out .= '<option value="">' . $langs->trans("None") . '</option>'; |
|
| 2397 | + $out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>'; |
|
| 2398 | + $out .= '<option value="">'.$langs->trans("None").'</option>'; |
|
| 2399 | 2399 | } |
| 2400 | 2400 | $out .= '</select>'; |
| 2401 | 2401 | |
| 2402 | 2402 | if ($num && !$forcecombo) { |
| 2403 | 2403 | // Enhance with select2 |
| 2404 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2404 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2405 | 2405 | $out .= ajax_combobox($htmlname); |
| 2406 | 2406 | } |
| 2407 | 2407 | } else { |
@@ -2477,16 +2477,16 @@ discard block |
||
| 2477 | 2477 | $out .= $userstatic->getNomUrl(-1); |
| 2478 | 2478 | if ($i == 0) { |
| 2479 | 2479 | $ownerid = $value['id']; |
| 2480 | - $out .= ' (' . $langs->trans("Owner") . ')'; |
|
| 2480 | + $out .= ' ('.$langs->trans("Owner").')'; |
|
| 2481 | 2481 | } |
| 2482 | 2482 | if ($nbassignetouser > 1 && $action != 'view') { |
| 2483 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $userstatic->id . '" class="removedassigned reposition" id="removedassigned_' . $userstatic->id . '" name="removedassigned_' . $userstatic->id . '">'; |
|
| 2483 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned reposition" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">'; |
|
| 2484 | 2484 | } |
| 2485 | 2485 | // Show my availability |
| 2486 | 2486 | if ($showproperties) { |
| 2487 | 2487 | if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) { |
| 2488 | 2488 | $out .= '<div class="myavailability inline-block">'; |
| 2489 | - $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">' . $langs->trans("Availability") . ':</span> </span><input id="transparency" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofuserid[$ownerid]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>'; |
|
| 2489 | + $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparency" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofuserid[$ownerid]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>'; |
|
| 2490 | 2490 | $out .= '</div>'; |
| 2491 | 2491 | } |
| 2492 | 2492 | } |
@@ -2503,15 +2503,15 @@ discard block |
||
| 2503 | 2503 | // Method with no ajax |
| 2504 | 2504 | if ($action != 'view') { |
| 2505 | 2505 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">'; |
| 2506 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2506 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2507 | 2507 | $out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });'; |
| 2508 | 2508 | $out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());'; |
| 2509 | - $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }'; |
|
| 2510 | - $out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }'; |
|
| 2509 | + $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }'; |
|
| 2510 | + $out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }'; |
|
| 2511 | 2511 | $out .= '});'; |
| 2512 | 2512 | $out .= '})</script>'; |
| 2513 | 2513 | $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2514 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2514 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2515 | 2515 | $out .= '<br>'; |
| 2516 | 2516 | } |
| 2517 | 2517 | |
@@ -2570,13 +2570,13 @@ discard block |
||
| 2570 | 2570 | $resourcestatic->fetch($value['id']); |
| 2571 | 2571 | $out .= $resourcestatic->getNomUrl(-1); |
| 2572 | 2572 | if ($nbassignetoresource > 1 && $action != 'view') { |
| 2573 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassigned reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">'; |
|
| 2573 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassigned reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">'; |
|
| 2574 | 2574 | } |
| 2575 | 2575 | // Show my availability |
| 2576 | 2576 | if ($showproperties) { |
| 2577 | 2577 | if (is_array($listofresourceid) && count($listofresourceid)) { |
| 2578 | 2578 | $out .= '<div class="myavailability inline-block">'; |
| 2579 | - $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">' . $langs->trans("Availability") . ':</span> </span><input id="transparencyresource" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofresourceid[$value['id']]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>'; |
|
| 2579 | + $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparencyresource" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofresourceid[$value['id']]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>'; |
|
| 2580 | 2580 | $out .= '</div>'; |
| 2581 | 2581 | } |
| 2582 | 2582 | } |
@@ -2593,11 +2593,11 @@ discard block |
||
| 2593 | 2593 | // Method with no ajax |
| 2594 | 2594 | if ($action != 'view') { |
| 2595 | 2595 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">'; |
| 2596 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2596 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2597 | 2597 | $out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });'; |
| 2598 | 2598 | $out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());'; |
| 2599 | - $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }'; |
|
| 2600 | - $out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }'; |
|
| 2599 | + $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }'; |
|
| 2600 | + $out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }'; |
|
| 2601 | 2601 | $out .= '});'; |
| 2602 | 2602 | $out .= '})</script>'; |
| 2603 | 2603 | |
@@ -2605,7 +2605,7 @@ discard block |
||
| 2605 | 2605 | $out .= img_picto('', 'resource', 'class="pictofixedwidth"'); |
| 2606 | 2606 | $out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0); |
| 2607 | 2607 | //$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2608 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2608 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2609 | 2609 | $out .= '<br>'; |
| 2610 | 2610 | } |
| 2611 | 2611 | |
@@ -2669,7 +2669,7 @@ discard block |
||
| 2669 | 2669 | $placeholder = ''; |
| 2670 | 2670 | |
| 2671 | 2671 | if ($selected && empty($selected_input_value)) { |
| 2672 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2672 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2673 | 2673 | $producttmpselect = new Product($this->db); |
| 2674 | 2674 | $producttmpselect->fetch($selected); |
| 2675 | 2675 | $selected_input_value = $producttmpselect->ref; |
@@ -2684,20 +2684,20 @@ discard block |
||
| 2684 | 2684 | } |
| 2685 | 2685 | } |
| 2686 | 2686 | // mode=1 means customers products |
| 2687 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=1&status=' . $status . '&status_purchase=' . $status_purchase . '&finished=' . $finished . '&hidepriceinlabel=' . $hidepriceinlabel . '&warehousestatus=' . $warehouseStatus; |
|
| 2688 | - if ((int) $warehouseId>0) { |
|
| 2689 | - $urloption .= '&warehouseid=' . (int) $warehouseId; |
|
| 2687 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&status_purchase='.$status_purchase.'&finished='.$finished.'&hidepriceinlabel='.$hidepriceinlabel.'&warehousestatus='.$warehouseStatus; |
|
| 2688 | + if ((int) $warehouseId > 0) { |
|
| 2689 | + $urloption .= '&warehouseid='.(int) $warehouseId; |
|
| 2690 | 2690 | } |
| 2691 | - $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 2691 | + $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 2692 | 2692 | |
| 2693 | 2693 | if (isModEnabled('variants') && is_array($selected_combinations)) { |
| 2694 | 2694 | // Code to automatically insert with javascript the select of attributes under the select of product |
| 2695 | 2695 | // when a parent of variant has been selected. |
| 2696 | 2696 | $out .= ' |
| 2697 | 2697 | <!-- script to auto show attributes select tags if a variant was selected --> |
| 2698 | - <script nonce="' . getNonce() . '"> |
|
| 2698 | + <script nonce="' . getNonce().'"> |
|
| 2699 | 2699 | // auto show attributes fields |
| 2700 | - selected = ' . json_encode($selected_combinations) . '; |
|
| 2700 | + selected = ' . json_encode($selected_combinations).'; |
|
| 2701 | 2701 | combvalues = {}; |
| 2702 | 2702 | |
| 2703 | 2703 | jQuery(document).ready(function () { |
@@ -2708,7 +2708,7 @@ discard block |
||
| 2708 | 2708 | } |
| 2709 | 2709 | }); |
| 2710 | 2710 | |
| 2711 | - jQuery("input#' . $htmlname . '").change(function () { |
|
| 2711 | + jQuery("input#' . $htmlname.'").change(function () { |
|
| 2712 | 2712 | |
| 2713 | 2713 | if (!jQuery(this).val()) { |
| 2714 | 2714 | jQuery(\'div#attributes_box\').empty(); |
@@ -2717,7 +2717,7 @@ discard block |
||
| 2717 | 2717 | |
| 2718 | 2718 | console.log("A change has started. We get variants fields to inject html select"); |
| 2719 | 2719 | |
| 2720 | - jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", { |
|
| 2720 | + jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { |
|
| 2721 | 2721 | id: jQuery(this).val() |
| 2722 | 2722 | }, function (data) { |
| 2723 | 2723 | jQuery(\'div#attributes_box\').empty(); |
@@ -2760,21 +2760,21 @@ discard block |
||
| 2760 | 2760 | }) |
| 2761 | 2761 | }); |
| 2762 | 2762 | |
| 2763 | - ' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . ' |
|
| 2763 | + ' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').' |
|
| 2764 | 2764 | }); |
| 2765 | 2765 | </script> |
| 2766 | 2766 | '; |
| 2767 | 2767 | } |
| 2768 | 2768 | |
| 2769 | 2769 | if (empty($hidelabel)) { |
| 2770 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 2770 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 2771 | 2771 | } elseif ($hidelabel > 1) { |
| 2772 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 2772 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 2773 | 2773 | if ($hidelabel == 2) { |
| 2774 | 2774 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2775 | 2775 | } |
| 2776 | 2776 | } |
| 2777 | - $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 2777 | + $out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 2778 | 2778 | if ($hidelabel == 3) { |
| 2779 | 2779 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2780 | 2780 | } |
@@ -2811,33 +2811,33 @@ discard block |
||
| 2811 | 2811 | // phpcs:enable |
| 2812 | 2812 | global $db; |
| 2813 | 2813 | |
| 2814 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2814 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2815 | 2815 | |
| 2816 | 2816 | $error = 0; |
| 2817 | 2817 | $out = ''; |
| 2818 | 2818 | |
| 2819 | 2819 | if (!$forcecombo) { |
| 2820 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2820 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2821 | 2821 | $events = array(); |
| 2822 | 2822 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 2823 | 2823 | } |
| 2824 | 2824 | |
| 2825 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 2825 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 2826 | 2826 | |
| 2827 | 2827 | $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product'; |
| 2828 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b'; |
|
| 2829 | - $sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')'; |
|
| 2828 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; |
|
| 2829 | + $sql .= ' WHERE b.entity IN ('.getEntity('bom').')'; |
|
| 2830 | 2830 | if (!empty($status)) { |
| 2831 | - $sql .= ' AND status = ' . (int) $status; |
|
| 2831 | + $sql .= ' AND status = '.(int) $status; |
|
| 2832 | 2832 | } |
| 2833 | 2833 | if (!empty($type)) { |
| 2834 | - $sql .= ' AND bomtype = ' . (int) $type; |
|
| 2834 | + $sql .= ' AND bomtype = '.(int) $type; |
|
| 2835 | 2835 | } |
| 2836 | 2836 | if (!empty($TProducts)) { |
| 2837 | - $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')'; |
|
| 2837 | + $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; |
|
| 2838 | 2838 | } |
| 2839 | 2839 | if (!empty($limit)) { |
| 2840 | - $sql .= ' LIMIT ' . (int) $limit; |
|
| 2840 | + $sql .= ' LIMIT '.(int) $limit; |
|
| 2841 | 2841 | } |
| 2842 | 2842 | $resql = $db->query($sql); |
| 2843 | 2843 | if ($resql) { |
@@ -2851,11 +2851,11 @@ discard block |
||
| 2851 | 2851 | while ($obj = $db->fetch_object($resql)) { |
| 2852 | 2852 | $product = new Product($db); |
| 2853 | 2853 | $res = $product->fetch($obj->fk_product); |
| 2854 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2854 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2855 | 2855 | if ($obj->rowid == $selected) { |
| 2856 | 2856 | $out .= 'selected'; |
| 2857 | 2857 | } |
| 2858 | - $out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>'; |
|
| 2858 | + $out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>'; |
|
| 2859 | 2859 | } |
| 2860 | 2860 | } else { |
| 2861 | 2861 | $error++; |
@@ -2913,7 +2913,7 @@ discard block |
||
| 2913 | 2913 | |
| 2914 | 2914 | $warehouseStatusArray = array(); |
| 2915 | 2915 | if (!empty($warehouseStatus)) { |
| 2916 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
| 2916 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
| 2917 | 2917 | if (preg_match('/warehouseclosed/', $warehouseStatus)) { |
| 2918 | 2918 | $warehouseStatusArray[] = Entrepot::STATUS_CLOSED; |
| 2919 | 2919 | } |
@@ -2927,9 +2927,9 @@ discard block |
||
| 2927 | 2927 | |
| 2928 | 2928 | $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_country, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.default_vat_code, p.duration, p.fk_price_expression"; |
| 2929 | 2929 | if (count($warehouseStatusArray)) { |
| 2930 | - $selectFieldsGrouped = ", sum(" . $this->db->ifsql("e.statut IS NULL", "0", "ps.reel") . ") as stock"; // e.statut is null if there is no record in stock |
|
| 2930 | + $selectFieldsGrouped = ", sum(".$this->db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock |
|
| 2931 | 2931 | } else { |
| 2932 | - $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; |
|
| 2932 | + $selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; |
|
| 2933 | 2933 | } |
| 2934 | 2934 | |
| 2935 | 2935 | $sql = "SELECT "; |
@@ -2945,9 +2945,9 @@ discard block |
||
| 2945 | 2945 | |
| 2946 | 2946 | if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) { |
| 2947 | 2947 | //Product category |
| 2948 | - $sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie |
|
| 2949 | - FROM " . $this->db->prefix() . "categorie_product |
|
| 2950 | - WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid |
|
| 2948 | + $sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie |
|
| 2949 | + FROM " . $this->db->prefix()."categorie_product |
|
| 2950 | + WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid |
|
| 2951 | 2951 | LIMIT 1 |
| 2952 | 2952 | ) AS categorie_product_id "; |
| 2953 | 2953 | } |
@@ -2973,15 +2973,15 @@ discard block |
||
| 2973 | 2973 | } |
| 2974 | 2974 | // Price by quantity |
| 2975 | 2975 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2976 | - $sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2976 | + $sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2977 | 2977 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2978 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2978 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2979 | 2979 | } |
| 2980 | 2980 | $sql .= " ORDER BY date_price"; |
| 2981 | 2981 | $sql .= " DESC LIMIT 1) as price_rowid"; |
| 2982 | - $sql .= ", (SELECT pp.price_by_qty FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
| 2982 | + $sql .= ", (SELECT pp.price_by_qty FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
| 2983 | 2983 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2984 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2984 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2985 | 2985 | } |
| 2986 | 2986 | $sql .= " ORDER BY date_price"; |
| 2987 | 2987 | $sql .= " DESC LIMIT 1) as price_by_qty"; |
@@ -2991,7 +2991,7 @@ discard block |
||
| 2991 | 2991 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
| 2992 | 2992 | |
| 2993 | 2993 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_FORCE_INDEX')) { |
| 2994 | - $sql .= " USE INDEX (" . $this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')) . ")"; |
|
| 2994 | + $sql .= " USE INDEX (".$this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')).")"; |
|
| 2995 | 2995 | } |
| 2996 | 2996 | |
| 2997 | 2997 | // Add from (left join) from hooks |
@@ -3000,53 +3000,53 @@ discard block |
||
| 3000 | 3000 | $sql .= $hookmanager->resPrint; |
| 3001 | 3001 | |
| 3002 | 3002 | if (count($warehouseStatusArray)) { |
| 3003 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid"; |
|
| 3004 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")"; |
|
| 3005 | - $sql .= ' AND e.statut IN (' . $this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))) . ')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
| 3003 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid"; |
|
| 3004 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; |
|
| 3005 | + $sql .= ' AND e.statut IN ('.$this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))).')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
| 3006 | 3006 | } |
| 3007 | 3007 | |
| 3008 | 3008 | // include search in supplier ref |
| 3009 | 3009 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 3010 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3010 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3011 | 3011 | } |
| 3012 | 3012 | |
| 3013 | 3013 | //Price by customer |
| 3014 | 3014 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) { |
| 3015 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid"; |
|
| 3015 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid"; |
|
| 3016 | 3016 | } |
| 3017 | 3017 | // Units |
| 3018 | 3018 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3019 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 3019 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 3020 | 3020 | } |
| 3021 | 3021 | // Multilang : we add translation |
| 3022 | 3022 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 3023 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 3023 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 3024 | 3024 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) { |
| 3025 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 3025 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 3026 | 3026 | $soc = new Societe($this->db); |
| 3027 | 3027 | $result = $soc->fetch($socid); |
| 3028 | 3028 | if ($result > 0 && !empty($soc->default_lang)) { |
| 3029 | - $sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'"; |
|
| 3029 | + $sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'"; |
|
| 3030 | 3030 | } else { |
| 3031 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 3031 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 3032 | 3032 | } |
| 3033 | 3033 | } else { |
| 3034 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 3034 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 3035 | 3035 | } |
| 3036 | 3036 | } |
| 3037 | 3037 | |
| 3038 | 3038 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 3039 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 3039 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 3040 | 3040 | } |
| 3041 | 3041 | |
| 3042 | - $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
| 3042 | + $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
|
| 3043 | 3043 | |
| 3044 | 3044 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 3045 | 3045 | $sql .= " AND pac.rowid IS NULL"; |
| 3046 | 3046 | } |
| 3047 | 3047 | |
| 3048 | 3048 | if ($finished == 0) { |
| 3049 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
| 3049 | + $sql .= " AND p.finished = ".((int) $finished); |
|
| 3050 | 3050 | } elseif ($finished == 1) { |
| 3051 | 3051 | $sql .= " AND p.finished = ".((int) $finished); |
| 3052 | 3052 | } |
@@ -3054,11 +3054,11 @@ discard block |
||
| 3054 | 3054 | $sql .= " AND p.tosell = ".((int) $status); |
| 3055 | 3055 | } |
| 3056 | 3056 | if ($status_purchase >= 0) { |
| 3057 | - $sql .= " AND p.tobuy = " . ((int) $status_purchase); |
|
| 3057 | + $sql .= " AND p.tobuy = ".((int) $status_purchase); |
|
| 3058 | 3058 | } |
| 3059 | 3059 | // Filter by product type |
| 3060 | 3060 | if (strval($filtertype) != '') { |
| 3061 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 3061 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 3062 | 3062 | } elseif (!isModEnabled('product')) { // when product module is disabled, show services only |
| 3063 | 3063 | $sql .= " AND p.fk_product_type = 1"; |
| 3064 | 3064 | } elseif (!isModEnabled('service')) { // when service module is disabled, show products only |
@@ -3066,7 +3066,7 @@ discard block |
||
| 3066 | 3066 | } |
| 3067 | 3067 | |
| 3068 | 3068 | if ((int) $warehouseId > 0) { |
| 3069 | - $sql .= " AND EXISTS (SELECT psw.fk_product FROM " . $this->db->prefix() . "product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)"; |
|
| 3069 | + $sql .= " AND EXISTS (SELECT psw.fk_product FROM ".$this->db->prefix()."product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)"; |
|
| 3070 | 3070 | } |
| 3071 | 3071 | |
| 3072 | 3072 | // Add where from hooks |
@@ -3087,21 +3087,21 @@ discard block |
||
| 3087 | 3087 | if ($i > 0) { |
| 3088 | 3088 | $sql .= " AND "; |
| 3089 | 3089 | } |
| 3090 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3090 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3091 | 3091 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 3092 | - $sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3092 | + $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3093 | 3093 | } |
| 3094 | 3094 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) { |
| 3095 | - $sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3095 | + $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3096 | 3096 | } |
| 3097 | 3097 | if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) { |
| 3098 | - $sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3098 | + $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3099 | 3099 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 3100 | - $sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3100 | + $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3101 | 3101 | } |
| 3102 | 3102 | } |
| 3103 | 3103 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 3104 | - $sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3104 | + $sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3105 | 3105 | } |
| 3106 | 3106 | $sql .= ")"; |
| 3107 | 3107 | $i++; |
@@ -3110,12 +3110,12 @@ discard block |
||
| 3110 | 3110 | $sql .= ")"; |
| 3111 | 3111 | } |
| 3112 | 3112 | if (isModEnabled('barcode')) { |
| 3113 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3113 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3114 | 3114 | } |
| 3115 | 3115 | $sql .= ')'; |
| 3116 | 3116 | } |
| 3117 | 3117 | if (count($warehouseStatusArray)) { |
| 3118 | - $sql .= " GROUP BY " . $selectFields; |
|
| 3118 | + $sql .= " GROUP BY ".$selectFields; |
|
| 3119 | 3119 | } |
| 3120 | 3120 | |
| 3121 | 3121 | //Sort by category |
@@ -3130,23 +3130,23 @@ discard block |
||
| 3130 | 3130 | $sql .= $this->db->plimit($limit, 0); |
| 3131 | 3131 | |
| 3132 | 3132 | // Build output string |
| 3133 | - dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG); |
|
| 3133 | + dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG); |
|
| 3134 | 3134 | $result = $this->db->query($sql); |
| 3135 | 3135 | if ($result) { |
| 3136 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 3137 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3138 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 3136 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 3137 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3138 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 3139 | 3139 | |
| 3140 | 3140 | $num = $this->db->num_rows($result); |
| 3141 | 3141 | |
| 3142 | 3142 | $events = array(); |
| 3143 | 3143 | |
| 3144 | 3144 | if (!$forcecombo) { |
| 3145 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 3145 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 3146 | 3146 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 3147 | 3147 | } |
| 3148 | 3148 | |
| 3149 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 3149 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 3150 | 3150 | |
| 3151 | 3151 | $textifempty = ''; |
| 3152 | 3152 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -3163,7 +3163,7 @@ discard block |
||
| 3163 | 3163 | } |
| 3164 | 3164 | } |
| 3165 | 3165 | if ($showempty) { |
| 3166 | - $out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : ' ') . '</option>'; |
|
| 3166 | + $out .= '<option value="-1" selected>'.($textifempty ? $textifempty : ' ').'</option>'; |
|
| 3167 | 3167 | } |
| 3168 | 3168 | |
| 3169 | 3169 | $i = 0; |
@@ -3174,11 +3174,11 @@ discard block |
||
| 3174 | 3174 | |
| 3175 | 3175 | if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product |
| 3176 | 3176 | $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; |
| 3177 | - $sql .= " FROM " . $this->db->prefix() . "product_price_by_qty"; |
|
| 3178 | - $sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid); |
|
| 3177 | + $sql .= " FROM ".$this->db->prefix()."product_price_by_qty"; |
|
| 3178 | + $sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid); |
|
| 3179 | 3179 | $sql .= " ORDER BY quantity ASC"; |
| 3180 | 3180 | |
| 3181 | - dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 3181 | + dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 3182 | 3182 | $result2 = $this->db->query($sql); |
| 3183 | 3183 | if ($result2) { |
| 3184 | 3184 | $nb_prices = $this->db->num_rows($result2); |
@@ -3216,7 +3216,7 @@ discard block |
||
| 3216 | 3216 | $price_product = new Product($this->db); |
| 3217 | 3217 | $price_product->fetch($objp->rowid, '', '', 1); |
| 3218 | 3218 | |
| 3219 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3219 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3220 | 3220 | $priceparser = new PriceParser($this->db); |
| 3221 | 3221 | $price_result = $priceparser->parseProduct($price_product); |
| 3222 | 3222 | if ($price_result >= 0) { |
@@ -3300,7 +3300,7 @@ discard block |
||
| 3300 | 3300 | $label = $objp->label_translated; |
| 3301 | 3301 | } |
| 3302 | 3302 | if (!empty($filterkey) && $filterkey != '') { |
| 3303 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3303 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3304 | 3304 | } |
| 3305 | 3305 | |
| 3306 | 3306 | $outkey = $objp->rowid; |
@@ -3321,32 +3321,32 @@ discard block |
||
| 3321 | 3321 | $outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : ''; |
| 3322 | 3322 | |
| 3323 | 3323 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3324 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 3324 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 3325 | 3325 | } |
| 3326 | 3326 | |
| 3327 | 3327 | // Units |
| 3328 | 3328 | $outvalUnits = ''; |
| 3329 | 3329 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3330 | 3330 | if (!empty($objp->unit_short)) { |
| 3331 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3331 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3332 | 3332 | } |
| 3333 | 3333 | } |
| 3334 | 3334 | if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) { |
| 3335 | 3335 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3336 | 3336 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3337 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3337 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3338 | 3338 | } |
| 3339 | 3339 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3340 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3341 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3340 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3341 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3342 | 3342 | } |
| 3343 | 3343 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3344 | 3344 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3345 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3345 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3346 | 3346 | } |
| 3347 | 3347 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3348 | 3348 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3349 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3349 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3350 | 3350 | } |
| 3351 | 3351 | } |
| 3352 | 3352 | if ($outdurationvalue && $outdurationunit) { |
@@ -3358,7 +3358,7 @@ discard block |
||
| 3358 | 3358 | 'y' => $langs->trans('Year') |
| 3359 | 3359 | ); |
| 3360 | 3360 | if (isset($da[$outdurationunit])) { |
| 3361 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3361 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3362 | 3362 | } |
| 3363 | 3363 | } |
| 3364 | 3364 | |
@@ -3378,31 +3378,31 @@ discard block |
||
| 3378 | 3378 | $labeltoshow = ''; |
| 3379 | 3379 | $labeltoshow .= $objp->ref; |
| 3380 | 3380 | if (!empty($objp->custref)) { |
| 3381 | - $labeltoshow .= ' (' . $objp->custref . ')'; |
|
| 3381 | + $labeltoshow .= ' ('.$objp->custref.')'; |
|
| 3382 | 3382 | } |
| 3383 | 3383 | if ($outbarcode) { |
| 3384 | - $labeltoshow .= ' (' . $outbarcode . ')'; |
|
| 3384 | + $labeltoshow .= ' ('.$outbarcode.')'; |
|
| 3385 | 3385 | } |
| 3386 | - $labeltoshow .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3386 | + $labeltoshow .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3387 | 3387 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3388 | - $labeltoshow .= ' (' . getCountry($outorigin, '1') . ')'; |
|
| 3388 | + $labeltoshow .= ' ('.getCountry($outorigin, '1').')'; |
|
| 3389 | 3389 | } |
| 3390 | 3390 | |
| 3391 | 3391 | // Set $labltoshowhtml |
| 3392 | 3392 | $labeltoshowhtml = ''; |
| 3393 | 3393 | $labeltoshowhtml .= $objp->ref; |
| 3394 | 3394 | if (!empty($objp->custref)) { |
| 3395 | - $labeltoshowhtml .= ' (' . $objp->custref . ')'; |
|
| 3395 | + $labeltoshowhtml .= ' ('.$objp->custref.')'; |
|
| 3396 | 3396 | } |
| 3397 | 3397 | if (!empty($filterkey) && $filterkey != '') { |
| 3398 | - $labeltoshowhtml = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $labeltoshowhtml, 1); |
|
| 3398 | + $labeltoshowhtml = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $labeltoshowhtml, 1); |
|
| 3399 | 3399 | } |
| 3400 | 3400 | if ($outbarcode) { |
| 3401 | - $labeltoshowhtml .= ' (' . $outbarcode . ')'; |
|
| 3401 | + $labeltoshowhtml .= ' ('.$outbarcode.')'; |
|
| 3402 | 3402 | } |
| 3403 | - $labeltoshowhtml .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3403 | + $labeltoshowhtml .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3404 | 3404 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3405 | - $labeltoshowhtml .= ' (' . getCountry($outorigin, '1') . ')'; |
|
| 3405 | + $labeltoshowhtml .= ' ('.getCountry($outorigin, '1').')'; |
|
| 3406 | 3406 | } |
| 3407 | 3407 | |
| 3408 | 3408 | // Stock |
@@ -3410,14 +3410,14 @@ discard block |
||
| 3410 | 3410 | $labeltoshowhtmlstock = ''; |
| 3411 | 3411 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 3412 | 3412 | if ($user->hasRight('stock', 'lire')) { |
| 3413 | - $labeltoshowstock .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3413 | + $labeltoshowstock .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3414 | 3414 | |
| 3415 | 3415 | if ($objp->stock > 0) { |
| 3416 | 3416 | $labeltoshowhtmlstock .= ' - <span class="product_line_stock_ok">'; |
| 3417 | 3417 | } elseif ($objp->stock <= 0) { |
| 3418 | 3418 | $labeltoshowhtmlstock .= ' - <span class="product_line_stock_too_low">'; |
| 3419 | 3419 | } |
| 3420 | - $labeltoshowhtmlstock .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3420 | + $labeltoshowhtmlstock .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3421 | 3421 | $labeltoshowhtmlstock .= '</span>'; |
| 3422 | 3422 | |
| 3423 | 3423 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
@@ -3428,9 +3428,9 @@ discard block |
||
| 3428 | 3428 | $tmpproduct->load_virtual_stock(); |
| 3429 | 3429 | $virtualstock = $tmpproduct->stock_theorique; |
| 3430 | 3430 | |
| 3431 | - $labeltoshowstock .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 3431 | + $labeltoshowstock .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 3432 | 3432 | |
| 3433 | - $labeltoshowhtmlstock .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 3433 | + $labeltoshowhtmlstock .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 3434 | 3434 | if ($virtualstock > 0) { |
| 3435 | 3435 | $labeltoshowhtmlstock .= '<span class="product_line_stock_ok">'; |
| 3436 | 3436 | } elseif ($virtualstock <= 0) { |
@@ -3451,35 +3451,35 @@ discard block |
||
| 3451 | 3451 | // If we need a particular price level (from 1 to n) |
| 3452 | 3452 | if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) { |
| 3453 | 3453 | $sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code"; |
| 3454 | - $sql .= " FROM " . $this->db->prefix() . "product_price"; |
|
| 3455 | - $sql .= " WHERE fk_product = " . ((int) $objp->rowid); |
|
| 3456 | - $sql .= " AND entity IN (" . getEntity('productprice') . ")"; |
|
| 3457 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 3454 | + $sql .= " FROM ".$this->db->prefix()."product_price"; |
|
| 3455 | + $sql .= " WHERE fk_product = ".((int) $objp->rowid); |
|
| 3456 | + $sql .= " AND entity IN (".getEntity('productprice').")"; |
|
| 3457 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 3458 | 3458 | $sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid. |
| 3459 | 3459 | $sql .= " LIMIT 1"; |
| 3460 | 3460 | |
| 3461 | - dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG); |
|
| 3461 | + dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG); |
|
| 3462 | 3462 | $result2 = $this->db->query($sql); |
| 3463 | 3463 | if ($result2) { |
| 3464 | 3464 | $objp2 = $this->db->fetch_object($result2); |
| 3465 | 3465 | if ($objp2) { |
| 3466 | 3466 | $found = 1; |
| 3467 | 3467 | if ($objp2->price_base_type == 'HT') { |
| 3468 | - $labeltoshowprice .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3469 | - $labeltoshowhtmlprice .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3468 | + $labeltoshowprice .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3469 | + $labeltoshowhtmlprice .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3470 | 3470 | } else { |
| 3471 | - $labeltoshowprice .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3472 | - $labeltoshowhtmlprice .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3471 | + $labeltoshowprice .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3472 | + $labeltoshowhtmlprice .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3473 | 3473 | } |
| 3474 | 3474 | $outprice_ht = price($objp2->price); |
| 3475 | 3475 | $outprice_ttc = price($objp2->price_ttc); |
| 3476 | 3476 | $outpricebasetype = $objp2->price_base_type; |
| 3477 | 3477 | if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility |
| 3478 | - $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3479 | - $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3478 | + $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3479 | + $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3480 | 3480 | } else { |
| 3481 | - $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3482 | - $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3481 | + $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3482 | + $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3483 | 3483 | } |
| 3484 | 3484 | } |
| 3485 | 3485 | } else { |
@@ -3493,13 +3493,13 @@ discard block |
||
| 3493 | 3493 | $outqty = $objp->quantity; |
| 3494 | 3494 | $outdiscount = $objp->remise_percent; |
| 3495 | 3495 | if ($objp->quantity == 1) { |
| 3496 | - $labeltoshowprice .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3497 | - $labeltoshowhtmlprice .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3496 | + $labeltoshowprice .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3497 | + $labeltoshowhtmlprice .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3498 | 3498 | $labeltoshowprice .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3499 | 3499 | $labeltoshowhtmlprice .= $langs->transnoentities("Unit"); |
| 3500 | 3500 | } else { |
| 3501 | - $labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3502 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3501 | + $labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3502 | + $labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3503 | 3503 | $labeltoshowprice .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
| 3504 | 3504 | $labeltoshowhtmlprice .= $langs->transnoentities("Units"); |
| 3505 | 3505 | } |
@@ -3507,16 +3507,16 @@ discard block |
||
| 3507 | 3507 | $outprice_ht = price($objp->unitprice); |
| 3508 | 3508 | $outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100))); |
| 3509 | 3509 | $outpricebasetype = $objp->price_base_type; |
| 3510 | - $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3511 | - $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3510 | + $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3511 | + $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3512 | 3512 | } |
| 3513 | 3513 | if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) { |
| 3514 | - $labeltoshowprice .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3515 | - $labeltoshowhtmlprice .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3514 | + $labeltoshowprice .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3515 | + $labeltoshowhtmlprice .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3516 | 3516 | } |
| 3517 | 3517 | if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) { |
| 3518 | - $labeltoshowprice .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3519 | - $labeltoshowhtmlprice .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3518 | + $labeltoshowprice .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3519 | + $labeltoshowhtmlprice .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3520 | 3520 | } |
| 3521 | 3521 | |
| 3522 | 3522 | // Price by customer |
@@ -3525,11 +3525,11 @@ discard block |
||
| 3525 | 3525 | $found = 1; |
| 3526 | 3526 | |
| 3527 | 3527 | if ($objp->custprice_base_type == 'HT') { |
| 3528 | - $labeltoshowprice .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3529 | - $labeltoshowhtmlprice .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3528 | + $labeltoshowprice .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3529 | + $labeltoshowhtmlprice .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3530 | 3530 | } else { |
| 3531 | - $labeltoshowprice .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3532 | - $labeltoshowhtmlprice .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3531 | + $labeltoshowprice .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3532 | + $labeltoshowhtmlprice .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3533 | 3533 | } |
| 3534 | 3534 | |
| 3535 | 3535 | $outprice_ht = price($objp->custprice); |
@@ -3543,11 +3543,11 @@ discard block |
||
| 3543 | 3543 | // If level no defined or multiprice not found, we used the default price |
| 3544 | 3544 | if (empty($hidepriceinlabel) && !$found) { |
| 3545 | 3545 | if ($objp->price_base_type == 'HT') { |
| 3546 | - $labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3547 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3546 | + $labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3547 | + $labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3548 | 3548 | } else { |
| 3549 | - $labeltoshowprice .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3550 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3549 | + $labeltoshowprice .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3550 | + $labeltoshowhtmlprice .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3551 | 3551 | } |
| 3552 | 3552 | $outprice_ht = price($objp->price); |
| 3553 | 3553 | $outprice_ttc = price($objp->price_ttc); |
@@ -3558,14 +3558,14 @@ discard block |
||
| 3558 | 3558 | |
| 3559 | 3559 | |
| 3560 | 3560 | // Build options |
| 3561 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 3561 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 3562 | 3562 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 3563 | 3563 | if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { |
| 3564 | - $opt .= ' pbq="' . $objp->price_by_qty_rowid . '" data-pbq="' . $objp->price_by_qty_rowid . '" data-pbqup="' . $objp->price_by_qty_unitprice . '" data-pbqbase="' . $objp->price_by_qty_price_base_type . '" data-pbqqty="' . $objp->price_by_qty_quantity . '" data-pbqpercent="' . $objp->price_by_qty_remise_percent . '"'; |
|
| 3564 | + $opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqup="'.$objp->price_by_qty_unitprice.'" data-pbqbase="'.$objp->price_by_qty_price_base_type.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"'; |
|
| 3565 | 3565 | } |
| 3566 | 3566 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) { |
| 3567 | - $opt .= ' data-labeltrans="' . $outlabel_translated . '"'; |
|
| 3568 | - $opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"'; |
|
| 3567 | + $opt .= ' data-labeltrans="'.$outlabel_translated.'"'; |
|
| 3568 | + $opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"'; |
|
| 3569 | 3569 | } |
| 3570 | 3570 | |
| 3571 | 3571 | if ($stocktag == 1) { |
@@ -3660,7 +3660,7 @@ discard block |
||
| 3660 | 3660 | $selected_input_value = ''; |
| 3661 | 3661 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) { |
| 3662 | 3662 | if ($selected > 0) { |
| 3663 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 3663 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 3664 | 3664 | $producttmpselect = new Product($this->db); |
| 3665 | 3665 | $producttmpselect->fetch($selected); |
| 3666 | 3666 | $selected_input_value = $producttmpselect->ref; |
@@ -3668,10 +3668,10 @@ discard block |
||
| 3668 | 3668 | } |
| 3669 | 3669 | |
| 3670 | 3670 | // mode=2 means suppliers products |
| 3671 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice; |
|
| 3672 | - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions); |
|
| 3671 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; |
|
| 3672 | + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions); |
|
| 3673 | 3673 | |
| 3674 | - print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="'.$morecss.'" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>'; |
|
| 3674 | + print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>'; |
|
| 3675 | 3675 | } else { |
| 3676 | 3676 | print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); |
| 3677 | 3677 | } |
@@ -3731,25 +3731,25 @@ discard block |
||
| 3731 | 3731 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3732 | 3732 | $sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units"; |
| 3733 | 3733 | } |
| 3734 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 3735 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )"; |
|
| 3734 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 3735 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; |
|
| 3736 | 3736 | if ($socid > 0) { |
| 3737 | - $sql .= " AND pfp.fk_soc = " . ((int) $socid); |
|
| 3737 | + $sql .= " AND pfp.fk_soc = ".((int) $socid); |
|
| 3738 | 3738 | } |
| 3739 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3739 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3740 | 3740 | // Units |
| 3741 | 3741 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3742 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 3742 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 3743 | 3743 | } |
| 3744 | - $sql .= " WHERE p.entity IN (" . getEntity('product') . ")"; |
|
| 3744 | + $sql .= " WHERE p.entity IN (".getEntity('product').")"; |
|
| 3745 | 3745 | if ($statut != -1) { |
| 3746 | - $sql .= " AND p.tobuy = " . ((int) $statut); |
|
| 3746 | + $sql .= " AND p.tobuy = ".((int) $statut); |
|
| 3747 | 3747 | } |
| 3748 | 3748 | if (strval($filtertype) != '') { |
| 3749 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 3749 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 3750 | 3750 | } |
| 3751 | 3751 | if (!empty($filtre)) { |
| 3752 | - $sql .= " " . $filtre; |
|
| 3752 | + $sql .= " ".$filtre; |
|
| 3753 | 3753 | } |
| 3754 | 3754 | // Add where from hooks |
| 3755 | 3755 | $parameters = array(); |
@@ -3769,9 +3769,9 @@ discard block |
||
| 3769 | 3769 | if ($i > 0) { |
| 3770 | 3770 | $sql .= " AND "; |
| 3771 | 3771 | } |
| 3772 | - $sql .= "(pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3772 | + $sql .= "(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3773 | 3773 | if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) { |
| 3774 | - $sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3774 | + $sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3775 | 3775 | } |
| 3776 | 3776 | $sql .= ")"; |
| 3777 | 3777 | $i++; |
@@ -3780,8 +3780,8 @@ discard block |
||
| 3780 | 3780 | $sql .= ")"; |
| 3781 | 3781 | } |
| 3782 | 3782 | if (isModEnabled('barcode')) { |
| 3783 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3784 | - $sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3783 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3784 | + $sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3785 | 3785 | } |
| 3786 | 3786 | $sql .= ')'; |
| 3787 | 3787 | } |
@@ -3790,20 +3790,20 @@ discard block |
||
| 3790 | 3790 | |
| 3791 | 3791 | // Build output string |
| 3792 | 3792 | |
| 3793 | - dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3793 | + dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3794 | 3794 | $result = $this->db->query($sql); |
| 3795 | 3795 | if ($result) { |
| 3796 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3797 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 3796 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3797 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 3798 | 3798 | |
| 3799 | 3799 | $num = $this->db->num_rows($result); |
| 3800 | 3800 | |
| 3801 | 3801 | //$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax |
| 3802 | - $out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 3802 | + $out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 3803 | 3803 | if (!$selected) { |
| 3804 | - $out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3804 | + $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3805 | 3805 | } else { |
| 3806 | - $out .= '<option value="-1">' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3806 | + $out .= '<option value="-1">'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3807 | 3807 | } |
| 3808 | 3808 | |
| 3809 | 3809 | $i = 0; |
@@ -3818,7 +3818,7 @@ discard block |
||
| 3818 | 3818 | |
| 3819 | 3819 | $outkey = $objp->idprodfournprice; // id in table of price |
| 3820 | 3820 | if (!$outkey && $alsoproductwithnosupplierprice) { |
| 3821 | - $outkey = 'idprod_' . $objp->rowid; // id of product |
|
| 3821 | + $outkey = 'idprod_'.$objp->rowid; // id of product |
|
| 3822 | 3822 | } |
| 3823 | 3823 | |
| 3824 | 3824 | $outref = $objp->ref; |
@@ -3833,23 +3833,23 @@ discard block |
||
| 3833 | 3833 | $outvalUnits = ''; |
| 3834 | 3834 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3835 | 3835 | if (!empty($objp->unit_short)) { |
| 3836 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3836 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3837 | 3837 | } |
| 3838 | 3838 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3839 | 3839 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3840 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3840 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3841 | 3841 | } |
| 3842 | 3842 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3843 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3844 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3843 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3844 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3845 | 3845 | } |
| 3846 | 3846 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3847 | 3847 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3848 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3848 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3849 | 3849 | } |
| 3850 | 3850 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3851 | 3851 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3852 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3852 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3853 | 3853 | } |
| 3854 | 3854 | if ($outdurationvalue && $outdurationunit) { |
| 3855 | 3855 | $da = array( |
@@ -3860,22 +3860,22 @@ discard block |
||
| 3860 | 3860 | 'y' => $langs->trans('Year') |
| 3861 | 3861 | ); |
| 3862 | 3862 | if (isset($da[$outdurationunit])) { |
| 3863 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3863 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3864 | 3864 | } |
| 3865 | 3865 | } |
| 3866 | 3866 | } |
| 3867 | 3867 | |
| 3868 | 3868 | $objRef = $objp->ref; |
| 3869 | 3869 | if ($filterkey && $filterkey != '') { |
| 3870 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3870 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3871 | 3871 | } |
| 3872 | 3872 | $objRefFourn = $objp->ref_fourn; |
| 3873 | 3873 | if ($filterkey && $filterkey != '') { |
| 3874 | - $objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3874 | + $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3875 | 3875 | } |
| 3876 | 3876 | $label = $objp->label; |
| 3877 | 3877 | if ($filterkey && $filterkey != '') { |
| 3878 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3878 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3879 | 3879 | } |
| 3880 | 3880 | |
| 3881 | 3881 | switch ($objp->fk_product_type) { |
@@ -3898,21 +3898,21 @@ discard block |
||
| 3898 | 3898 | |
| 3899 | 3899 | $optlabel .= $objp->ref; |
| 3900 | 3900 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3901 | - $optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>'; |
|
| 3901 | + $optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>'; |
|
| 3902 | 3902 | } |
| 3903 | 3903 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3904 | - $optlabel .= ' (' . $outbarcode . ')'; |
|
| 3904 | + $optlabel .= ' ('.$outbarcode.')'; |
|
| 3905 | 3905 | } |
| 3906 | - $optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3906 | + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3907 | 3907 | |
| 3908 | 3908 | $outvallabel = $objRef; |
| 3909 | 3909 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3910 | - $outvallabel .= ' (' . $objRefFourn . ')'; |
|
| 3910 | + $outvallabel .= ' ('.$objRefFourn.')'; |
|
| 3911 | 3911 | } |
| 3912 | 3912 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3913 | - $outvallabel .= ' (' . $outbarcode . ')'; |
|
| 3913 | + $outvallabel .= ' ('.$outbarcode.')'; |
|
| 3914 | 3914 | } |
| 3915 | - $outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3915 | + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3916 | 3916 | |
| 3917 | 3917 | // Units |
| 3918 | 3918 | $optlabel .= $outvalUnits; |
@@ -3929,7 +3929,7 @@ discard block |
||
| 3929 | 3929 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 3930 | 3930 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 3931 | 3931 | |
| 3932 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3932 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3933 | 3933 | $priceparser = new PriceParser($this->db); |
| 3934 | 3934 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 3935 | 3935 | if ($price_result >= 0) { |
@@ -3940,57 +3940,57 @@ discard block |
||
| 3940 | 3940 | } |
| 3941 | 3941 | } |
| 3942 | 3942 | if ($objp->quantity == 1) { |
| 3943 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3944 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3943 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3944 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3945 | 3945 | $optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3946 | 3946 | $outvallabel .= $langs->transnoentities("Unit"); |
| 3947 | 3947 | } else { |
| 3948 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3949 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3950 | - $optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3951 | - $outvallabel .= ' ' . $langs->transnoentities("Units"); |
|
| 3948 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3949 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3950 | + $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3951 | + $outvallabel .= ' '.$langs->transnoentities("Units"); |
|
| 3952 | 3952 | } |
| 3953 | 3953 | |
| 3954 | 3954 | if ($objp->quantity > 1) { |
| 3955 | - $optlabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3956 | - $outvallabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3955 | + $optlabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3956 | + $outvallabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3957 | 3957 | } |
| 3958 | 3958 | if ($objp->remise_percent >= 1) { |
| 3959 | - $optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3960 | - $outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3959 | + $optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3960 | + $outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3961 | 3961 | } |
| 3962 | 3962 | if ($objp->duration) { |
| 3963 | - $optlabel .= " - " . $objp->duration; |
|
| 3964 | - $outvallabel .= " - " . $objp->duration; |
|
| 3963 | + $optlabel .= " - ".$objp->duration; |
|
| 3964 | + $outvallabel .= " - ".$objp->duration; |
|
| 3965 | 3965 | } |
| 3966 | 3966 | if (!$socid) { |
| 3967 | - $optlabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3968 | - $outvallabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3967 | + $optlabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3968 | + $outvallabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3969 | 3969 | } |
| 3970 | 3970 | if ($objp->supplier_reputation) { |
| 3971 | 3971 | //TODO dictionary |
| 3972 | 3972 | $reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
| 3973 | 3973 | |
| 3974 | - $optlabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3975 | - $outvallabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3974 | + $optlabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3975 | + $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3976 | 3976 | } |
| 3977 | 3977 | } else { |
| 3978 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
| 3979 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3978 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
| 3979 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3980 | 3980 | } |
| 3981 | 3981 | |
| 3982 | 3982 | if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 3983 | 3983 | $novirtualstock = ($showstockinlist == 2); |
| 3984 | 3984 | |
| 3985 | 3985 | if ($user->hasRight('stock', 'lire')) { |
| 3986 | - $outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3986 | + $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3987 | 3987 | |
| 3988 | 3988 | if ($objp->stock > 0) { |
| 3989 | 3989 | $optlabel .= ' - <span class="product_line_stock_ok">'; |
| 3990 | 3990 | } elseif ($objp->stock <= 0) { |
| 3991 | 3991 | $optlabel .= ' - <span class="product_line_stock_too_low">'; |
| 3992 | 3992 | } |
| 3993 | - $optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS')); |
|
| 3993 | + $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); |
|
| 3994 | 3994 | $optlabel .= '</span>'; |
| 3995 | 3995 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
| 3996 | 3996 | $langs->load("stocks"); |
@@ -4000,9 +4000,9 @@ discard block |
||
| 4000 | 4000 | $tmpproduct->load_virtual_stock(); |
| 4001 | 4001 | $virtualstock = $tmpproduct->stock_theorique; |
| 4002 | 4002 | |
| 4003 | - $outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 4003 | + $outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 4004 | 4004 | |
| 4005 | - $optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 4005 | + $optlabel .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 4006 | 4006 | if ($virtualstock > 0) { |
| 4007 | 4007 | $optlabel .= '<span class="product_line_stock_ok">'; |
| 4008 | 4008 | } elseif ($virtualstock <= 0) { |
@@ -4016,7 +4016,7 @@ discard block |
||
| 4016 | 4016 | } |
| 4017 | 4017 | } |
| 4018 | 4018 | |
| 4019 | - $optstart = '<option value="' . $outkey . '"'; |
|
| 4019 | + $optstart = '<option value="'.$outkey.'"'; |
|
| 4020 | 4020 | if ($selected && $selected == $objp->idprodfournprice) { |
| 4021 | 4021 | $optstart .= ' selected'; |
| 4022 | 4022 | } |
@@ -4025,31 +4025,31 @@ discard block |
||
| 4025 | 4025 | } |
| 4026 | 4026 | |
| 4027 | 4027 | if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { |
| 4028 | - $optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"'; |
|
| 4029 | - $optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"'; |
|
| 4030 | - $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; |
|
| 4031 | - $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; |
|
| 4032 | - $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; |
|
| 4033 | - $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; |
|
| 4034 | - $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; |
|
| 4035 | - $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; |
|
| 4036 | - $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; |
|
| 4037 | - $optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"'; |
|
| 4028 | + $optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; |
|
| 4029 | + $optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; |
|
| 4030 | + $optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; |
|
| 4031 | + $optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; |
|
| 4032 | + $optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; |
|
| 4033 | + $optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; |
|
| 4034 | + $optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; |
|
| 4035 | + $optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; |
|
| 4036 | + $optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"'; |
|
| 4037 | + $optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"'; |
|
| 4038 | 4038 | if (isModEnabled('multicurrency')) { |
| 4039 | - $optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"'; |
|
| 4040 | - $optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"'; |
|
| 4039 | + $optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"'; |
|
| 4040 | + $optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"'; |
|
| 4041 | 4041 | } |
| 4042 | 4042 | } |
| 4043 | - $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; |
|
| 4043 | + $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; |
|
| 4044 | 4044 | |
| 4045 | 4045 | $outarrayentry = array( |
| 4046 | 4046 | 'key' => $outkey, |
| 4047 | 4047 | 'value' => $outref, |
| 4048 | 4048 | 'label' => $outvallabel, |
| 4049 | 4049 | 'qty' => $outqty, |
| 4050 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4051 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4052 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4050 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4051 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4052 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4053 | 4053 | 'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2), |
| 4054 | 4054 | 'tva_tx' => price2num($objp->tva_tx), |
| 4055 | 4055 | 'default_vat_code' => $objp->default_vat_code, |
@@ -4080,17 +4080,17 @@ discard block |
||
| 4080 | 4080 | // Add new entry |
| 4081 | 4081 | // "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax |
| 4082 | 4082 | // "label" value of json key array is used by jQuery automatically as text for combo box |
| 4083 | - $out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n"; |
|
| 4083 | + $out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n"; |
|
| 4084 | 4084 | $outarraypush = array( |
| 4085 | 4085 | 'key' => $outkey, |
| 4086 | 4086 | 'value' => $outref, |
| 4087 | 4087 | 'label' => $outvallabel, |
| 4088 | 4088 | 'qty' => $outqty, |
| 4089 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4089 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4090 | 4090 | 'price_qty_ht_locale' => price($objp->fprice), |
| 4091 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4091 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4092 | 4092 | 'price_unit_ht_locale' => price($objp->unitprice), |
| 4093 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4093 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4094 | 4094 | 'tva_tx_formated' => price($objp->tva_tx), |
| 4095 | 4095 | 'tva_tx' => price2num($objp->tva_tx), |
| 4096 | 4096 | 'default_vat_code' => $objp->default_vat_code, |
@@ -4123,7 +4123,7 @@ discard block |
||
| 4123 | 4123 | |
| 4124 | 4124 | $this->db->free($result); |
| 4125 | 4125 | |
| 4126 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 4126 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 4127 | 4127 | $out .= ajax_combobox($htmlname); |
| 4128 | 4128 | } else { |
| 4129 | 4129 | dol_print_error($this->db); |
@@ -4155,43 +4155,43 @@ discard block |
||
| 4155 | 4155 | $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; |
| 4156 | 4156 | $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; |
| 4157 | 4157 | $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; |
| 4158 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 4159 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 4160 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 4161 | - $sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")"; |
|
| 4158 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 4159 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 4160 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 4161 | + $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; |
|
| 4162 | 4162 | $sql .= " AND p.tobuy = 1"; |
| 4163 | 4163 | $sql .= " AND s.fournisseur = 1"; |
| 4164 | - $sql .= " AND p.rowid = " . ((int) $productid); |
|
| 4164 | + $sql .= " AND p.rowid = ".((int) $productid); |
|
| 4165 | 4165 | if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) { |
| 4166 | 4166 | $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; |
| 4167 | 4167 | } else { |
| 4168 | 4168 | $sql .= " ORDER BY pfp.unitprice ASC"; |
| 4169 | 4169 | } |
| 4170 | 4170 | |
| 4171 | - dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG); |
|
| 4171 | + dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); |
|
| 4172 | 4172 | $result = $this->db->query($sql); |
| 4173 | 4173 | |
| 4174 | 4174 | if ($result) { |
| 4175 | 4175 | $num = $this->db->num_rows($result); |
| 4176 | 4176 | |
| 4177 | - $form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4177 | + $form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4178 | 4178 | |
| 4179 | 4179 | if (!$num) { |
| 4180 | - $form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>'; |
|
| 4180 | + $form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>'; |
|
| 4181 | 4181 | } else { |
| 4182 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 4182 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 4183 | 4183 | $form .= '<option value="0"> </option>'; |
| 4184 | 4184 | |
| 4185 | 4185 | $i = 0; |
| 4186 | 4186 | while ($i < $num) { |
| 4187 | 4187 | $objp = $this->db->fetch_object($result); |
| 4188 | 4188 | |
| 4189 | - $opt = '<option value="' . $objp->idprodfournprice . '"'; |
|
| 4189 | + $opt = '<option value="'.$objp->idprodfournprice.'"'; |
|
| 4190 | 4190 | //if there is only one supplier, preselect it |
| 4191 | 4191 | if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) { |
| 4192 | 4192 | $opt .= ' selected'; |
| 4193 | 4193 | } |
| 4194 | - $opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - '; |
|
| 4194 | + $opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - '; |
|
| 4195 | 4195 | |
| 4196 | 4196 | if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) { |
| 4197 | 4197 | $prod_supplier = new ProductFournisseur($this->db); |
@@ -4201,7 +4201,7 @@ discard block |
||
| 4201 | 4201 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 4202 | 4202 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 4203 | 4203 | |
| 4204 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 4204 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 4205 | 4205 | $priceparser = new PriceParser($this->db); |
| 4206 | 4206 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 4207 | 4207 | if ($price_result >= 0) { |
@@ -4212,10 +4212,10 @@ discard block |
||
| 4212 | 4212 | } |
| 4213 | 4213 | } |
| 4214 | 4214 | if ($objp->quantity == 1) { |
| 4215 | - $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 4215 | + $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 4216 | 4216 | } |
| 4217 | 4217 | |
| 4218 | - $opt .= $objp->quantity . ' '; |
|
| 4218 | + $opt .= $objp->quantity.' '; |
|
| 4219 | 4219 | |
| 4220 | 4220 | if ($objp->quantity == 1) { |
| 4221 | 4221 | $opt .= $langs->trans("Unit"); |
@@ -4224,10 +4224,10 @@ discard block |
||
| 4224 | 4224 | } |
| 4225 | 4225 | if ($objp->quantity > 1) { |
| 4226 | 4226 | $opt .= " - "; |
| 4227 | - $opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit"); |
|
| 4227 | + $opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit"); |
|
| 4228 | 4228 | } |
| 4229 | 4229 | if ($objp->duration) { |
| 4230 | - $opt .= " - " . $objp->duration; |
|
| 4230 | + $opt .= " - ".$objp->duration; |
|
| 4231 | 4231 | } |
| 4232 | 4232 | $opt .= "</option>\n"; |
| 4233 | 4233 | |
@@ -4265,8 +4265,8 @@ discard block |
||
| 4265 | 4265 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 4266 | 4266 | |
| 4267 | 4267 | $sql = "SELECT rowid, code, libelle as label, deposit_percent"; |
| 4268 | - $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; |
|
| 4269 | - $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; |
|
| 4268 | + $sql .= " FROM ".$this->db->prefix().'c_payment_term'; |
|
| 4269 | + $sql .= " WHERE entity IN (".getEntity('c_payment_term').")"; |
|
| 4270 | 4270 | $sql .= " AND active > 0"; |
| 4271 | 4271 | $sql .= " ORDER BY sortorder"; |
| 4272 | 4272 | |
@@ -4278,7 +4278,7 @@ discard block |
||
| 4278 | 4278 | $obj = $this->db->fetch_object($resql); |
| 4279 | 4279 | |
| 4280 | 4280 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4281 | - $label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4281 | + $label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4282 | 4282 | $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; |
| 4283 | 4283 | $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; |
| 4284 | 4284 | $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; |
@@ -4306,7 +4306,7 @@ discard block |
||
| 4306 | 4306 | // phpcs:enable |
| 4307 | 4307 | global $langs; |
| 4308 | 4308 | |
| 4309 | - $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4309 | + $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4310 | 4310 | if ($num > 0) { |
| 4311 | 4311 | return 0; // Cache already loaded |
| 4312 | 4312 | } |
@@ -4316,7 +4316,7 @@ discard block |
||
| 4316 | 4316 | $langs->load('propal'); |
| 4317 | 4317 | |
| 4318 | 4318 | $sql = "SELECT rowid, code, label, position"; |
| 4319 | - $sql .= " FROM " . $this->db->prefix() . 'c_availability'; |
|
| 4319 | + $sql .= " FROM ".$this->db->prefix().'c_availability'; |
|
| 4320 | 4320 | $sql .= " WHERE active > 0"; |
| 4321 | 4321 | |
| 4322 | 4322 | $resql = $this->db->query($sql); |
@@ -4327,7 +4327,7 @@ discard block |
||
| 4327 | 4327 | $obj = $this->db->fetch_object($resql); |
| 4328 | 4328 | |
| 4329 | 4329 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4330 | - $label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4330 | + $label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4331 | 4331 | $this->cache_availability[$obj->rowid]['code'] = $obj->code; |
| 4332 | 4332 | $this->cache_availability[$obj->rowid]['label'] = $label; |
| 4333 | 4333 | $this->cache_availability[$obj->rowid]['position'] = $obj->position; |
@@ -4359,17 +4359,17 @@ discard block |
||
| 4359 | 4359 | |
| 4360 | 4360 | $this->load_cache_availability(); |
| 4361 | 4361 | |
| 4362 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4362 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4363 | 4363 | |
| 4364 | - print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4364 | + print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4365 | 4365 | if ($addempty) { |
| 4366 | 4366 | print '<option value="0"> </option>'; |
| 4367 | 4367 | } |
| 4368 | 4368 | foreach ($this->cache_availability as $id => $arrayavailability) { |
| 4369 | 4369 | if ($selected == $id) { |
| 4370 | - print '<option value="' . $id . '" selected>'; |
|
| 4370 | + print '<option value="'.$id.'" selected>'; |
|
| 4371 | 4371 | } else { |
| 4372 | - print '<option value="' . $id . '">'; |
|
| 4372 | + print '<option value="'.$id.'">'; |
|
| 4373 | 4373 | } |
| 4374 | 4374 | print dol_escape_htmltag($arrayavailability['label']); |
| 4375 | 4375 | print '</option>'; |
@@ -4390,13 +4390,13 @@ discard block |
||
| 4390 | 4390 | { |
| 4391 | 4391 | global $langs; |
| 4392 | 4392 | |
| 4393 | - $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4393 | + $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4394 | 4394 | if ($num > 0) { |
| 4395 | 4395 | return 0; // Cache already loaded |
| 4396 | 4396 | } |
| 4397 | 4397 | |
| 4398 | 4398 | $sql = "SELECT rowid, code, label"; |
| 4399 | - $sql .= " FROM " . $this->db->prefix() . 'c_input_reason'; |
|
| 4399 | + $sql .= " FROM ".$this->db->prefix().'c_input_reason'; |
|
| 4400 | 4400 | $sql .= " WHERE active > 0"; |
| 4401 | 4401 | |
| 4402 | 4402 | $resql = $this->db->query($sql); |
@@ -4409,8 +4409,8 @@ discard block |
||
| 4409 | 4409 | |
| 4410 | 4410 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4411 | 4411 | $label = ($obj->label != '-' ? $obj->label : ''); |
| 4412 | - if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) { |
|
| 4413 | - $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4412 | + if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) { |
|
| 4413 | + $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4414 | 4414 | } |
| 4415 | 4415 | if ($langs->trans($obj->code) != $obj->code) { |
| 4416 | 4416 | $label = $langs->trans($obj->code); // So translation key SRC_XXX will work |
@@ -4450,9 +4450,9 @@ discard block |
||
| 4450 | 4450 | |
| 4451 | 4451 | $this->loadCacheInputReason(); |
| 4452 | 4452 | |
| 4453 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4453 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4454 | 4454 | if ($addempty) { |
| 4455 | - print '<option value="0"' . (empty($selected) ? ' selected' : '') . '> </option>'; |
|
| 4455 | + print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>'; |
|
| 4456 | 4456 | } |
| 4457 | 4457 | foreach ($this->cache_demand_reason as $id => $arraydemandreason) { |
| 4458 | 4458 | if ($arraydemandreason['code'] == $exclude) { |
@@ -4460,9 +4460,9 @@ discard block |
||
| 4460 | 4460 | } |
| 4461 | 4461 | |
| 4462 | 4462 | if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { |
| 4463 | - print '<option value="' . $arraydemandreason['id'] . '" selected>'; |
|
| 4463 | + print '<option value="'.$arraydemandreason['id'].'" selected>'; |
|
| 4464 | 4464 | } else { |
| 4465 | - print '<option value="' . $arraydemandreason['id'] . '">'; |
|
| 4465 | + print '<option value="'.$arraydemandreason['id'].'">'; |
|
| 4466 | 4466 | } |
| 4467 | 4467 | $label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason |
| 4468 | 4468 | print $langs->trans($label); |
@@ -4472,7 +4472,7 @@ discard block |
||
| 4472 | 4472 | if ($user->admin && empty($notooltip)) { |
| 4473 | 4473 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4474 | 4474 | } |
| 4475 | - print ajax_combobox('select_' . $htmlname); |
|
| 4475 | + print ajax_combobox('select_'.$htmlname); |
|
| 4476 | 4476 | } |
| 4477 | 4477 | |
| 4478 | 4478 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
@@ -4487,7 +4487,7 @@ discard block |
||
| 4487 | 4487 | // phpcs:enable |
| 4488 | 4488 | global $langs; |
| 4489 | 4489 | |
| 4490 | - $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4490 | + $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4491 | 4491 | if ($num > 0) { |
| 4492 | 4492 | return $num; // Cache already loaded |
| 4493 | 4493 | } |
@@ -4497,8 +4497,8 @@ discard block |
||
| 4497 | 4497 | $this->cache_types_paiements = array(); |
| 4498 | 4498 | |
| 4499 | 4499 | $sql = "SELECT id, code, libelle as label, type, active"; |
| 4500 | - $sql .= " FROM " . $this->db->prefix() . "c_paiement"; |
|
| 4501 | - $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
| 4500 | + $sql .= " FROM ".$this->db->prefix()."c_paiement"; |
|
| 4501 | + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
|
| 4502 | 4502 | |
| 4503 | 4503 | $resql = $this->db->query($sql); |
| 4504 | 4504 | if ($resql) { |
@@ -4508,7 +4508,7 @@ discard block |
||
| 4508 | 4508 | $obj = $this->db->fetch_object($resql); |
| 4509 | 4509 | |
| 4510 | 4510 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4511 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4511 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4512 | 4512 | $this->cache_types_paiements[$obj->id]['id'] = $obj->id; |
| 4513 | 4513 | $this->cache_types_paiements[$obj->id]['code'] = $obj->code; |
| 4514 | 4514 | $this->cache_types_paiements[$obj->id]['label'] = $label; |
@@ -4580,17 +4580,17 @@ discard block |
||
| 4580 | 4580 | global $langs, $user, $conf; |
| 4581 | 4581 | |
| 4582 | 4582 | $out = ''; |
| 4583 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4583 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4584 | 4584 | |
| 4585 | 4585 | $this->load_cache_conditions_paiements(); |
| 4586 | 4586 | |
| 4587 | 4587 | // Set default value if not already set by caller |
| 4588 | 4588 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) { |
| 4589 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4589 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4590 | 4590 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
| 4591 | 4591 | } |
| 4592 | 4592 | |
| 4593 | - $out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4593 | + $out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4594 | 4594 | if ($addempty) { |
| 4595 | 4595 | $out .= '<option value="0"> </option>'; |
| 4596 | 4596 | } |
@@ -4604,9 +4604,9 @@ discard block |
||
| 4604 | 4604 | |
| 4605 | 4605 | if ($selected == $id) { |
| 4606 | 4606 | $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; |
| 4607 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>'; |
|
| 4607 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>'; |
|
| 4608 | 4608 | } else { |
| 4609 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">'; |
|
| 4609 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">'; |
|
| 4610 | 4610 | } |
| 4611 | 4611 | $label = $arrayconditions['label']; |
| 4612 | 4612 | |
@@ -4624,21 +4624,21 @@ discard block |
||
| 4624 | 4624 | $out .= ajax_combobox($htmlname); |
| 4625 | 4625 | |
| 4626 | 4626 | if ($deposit_percent >= 0) { |
| 4627 | - $out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>'; |
|
| 4628 | - $out .= $langs->trans('DepositPercent') . ' : '; |
|
| 4629 | - $out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />'; |
|
| 4627 | + $out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>'; |
|
| 4628 | + $out .= $langs->trans('DepositPercent').' : '; |
|
| 4629 | + $out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />'; |
|
| 4630 | 4630 | $out .= '</span>'; |
| 4631 | 4631 | $out .= ' |
| 4632 | - <script nonce="' . getNonce() . '"> |
|
| 4632 | + <script nonce="' . getNonce().'"> |
|
| 4633 | 4633 | $(document).ready(function () { |
| 4634 | - $("#' . $htmlname . '").change(function () { |
|
| 4634 | + $("#' . $htmlname.'").change(function () { |
|
| 4635 | 4635 | let $selected = $(this).find("option:selected"); |
| 4636 | 4636 | let depositPercent = $selected.attr("data-deposit_percent"); |
| 4637 | 4637 | |
| 4638 | 4638 | if (depositPercent.length > 0) { |
| 4639 | - $("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent); |
|
| 4639 | + $("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent); |
|
| 4640 | 4640 | } else { |
| 4641 | - $("#' . $htmlname . '_deposit_percent_container").hide(); |
|
| 4641 | + $("#' . $htmlname.'_deposit_percent_container").hide(); |
|
| 4642 | 4642 | } |
| 4643 | 4643 | |
| 4644 | 4644 | return true; |
@@ -4676,7 +4676,7 @@ discard block |
||
| 4676 | 4676 | |
| 4677 | 4677 | $out = ''; |
| 4678 | 4678 | |
| 4679 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG); |
|
| 4679 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); |
|
| 4680 | 4680 | |
| 4681 | 4681 | $filterarray = array(); |
| 4682 | 4682 | if ($filtertype == 'CRDT') { |
@@ -4691,11 +4691,11 @@ discard block |
||
| 4691 | 4691 | |
| 4692 | 4692 | // Set default value if not already set by caller |
| 4693 | 4693 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) { |
| 4694 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4694 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4695 | 4695 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
| 4696 | 4696 | } |
| 4697 | 4697 | |
| 4698 | - $out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4698 | + $out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4699 | 4699 | if ($empty) { |
| 4700 | 4700 | $out .= '<option value=""> </option>'; |
| 4701 | 4701 | } |
@@ -4716,13 +4716,13 @@ discard block |
||
| 4716 | 4716 | } |
| 4717 | 4717 | |
| 4718 | 4718 | if ($format == 0) { |
| 4719 | - $out .= '<option value="' . $id . '"'; |
|
| 4719 | + $out .= '<option value="'.$id.'"'; |
|
| 4720 | 4720 | } elseif ($format == 1) { |
| 4721 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4721 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4722 | 4722 | } elseif ($format == 2) { |
| 4723 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4723 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4724 | 4724 | } elseif ($format == 3) { |
| 4725 | - $out .= '<option value="' . $id . '"'; |
|
| 4725 | + $out .= '<option value="'.$id.'"'; |
|
| 4726 | 4726 | } |
| 4727 | 4727 | // Print attribute selected or not |
| 4728 | 4728 | if ($format == 1 || $format == 2) { |
@@ -4752,7 +4752,7 @@ discard block |
||
| 4752 | 4752 | if ($user->admin && !$noadmininfo) { |
| 4753 | 4753 | $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4754 | 4754 | } |
| 4755 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 4755 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 4756 | 4756 | |
| 4757 | 4757 | if (empty($nooutput)) { |
| 4758 | 4758 | print $out; |
@@ -4774,22 +4774,22 @@ discard block |
||
| 4774 | 4774 | { |
| 4775 | 4775 | global $langs; |
| 4776 | 4776 | |
| 4777 | - $return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4777 | + $return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4778 | 4778 | $options = array( |
| 4779 | 4779 | 'HT' => $langs->trans("HT"), |
| 4780 | 4780 | 'TTC' => $langs->trans("TTC") |
| 4781 | 4781 | ); |
| 4782 | 4782 | foreach ($options as $id => $value) { |
| 4783 | 4783 | if ($selected == $id) { |
| 4784 | - $return .= '<option value="' . $id . '" selected>' . $value; |
|
| 4784 | + $return .= '<option value="'.$id.'" selected>'.$value; |
|
| 4785 | 4785 | } else { |
| 4786 | - $return .= '<option value="' . $id . '">' . $value; |
|
| 4786 | + $return .= '<option value="'.$id.'">'.$value; |
|
| 4787 | 4787 | } |
| 4788 | 4788 | $return .= '</option>'; |
| 4789 | 4789 | } |
| 4790 | 4790 | $return .= '</select>'; |
| 4791 | 4791 | if ($addjscombo) { |
| 4792 | - $return .= ajax_combobox('select_' . $htmlname); |
|
| 4792 | + $return .= ajax_combobox('select_'.$htmlname); |
|
| 4793 | 4793 | } |
| 4794 | 4794 | |
| 4795 | 4795 | return $return; |
@@ -4807,7 +4807,7 @@ discard block |
||
| 4807 | 4807 | // phpcs:enable |
| 4808 | 4808 | global $langs; |
| 4809 | 4809 | |
| 4810 | - $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4810 | + $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4811 | 4811 | if ($num > 0) { |
| 4812 | 4812 | return $num; // Cache already loaded |
| 4813 | 4813 | } |
@@ -4817,8 +4817,8 @@ discard block |
||
| 4817 | 4817 | $this->cache_transport_mode = array(); |
| 4818 | 4818 | |
| 4819 | 4819 | $sql = "SELECT rowid, code, label, active"; |
| 4820 | - $sql .= " FROM " . $this->db->prefix() . "c_transport_mode"; |
|
| 4821 | - $sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")"; |
|
| 4820 | + $sql .= " FROM ".$this->db->prefix()."c_transport_mode"; |
|
| 4821 | + $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; |
|
| 4822 | 4822 | |
| 4823 | 4823 | $resql = $this->db->query($sql); |
| 4824 | 4824 | if ($resql) { |
@@ -4828,7 +4828,7 @@ discard block |
||
| 4828 | 4828 | $obj = $this->db->fetch_object($resql); |
| 4829 | 4829 | |
| 4830 | 4830 | // If traduction exist, we use it else we take the default label |
| 4831 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4831 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4832 | 4832 | $this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; |
| 4833 | 4833 | $this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; |
| 4834 | 4834 | $this->cache_transport_mode[$obj->rowid]['label'] = $label; |
@@ -4862,11 +4862,11 @@ discard block |
||
| 4862 | 4862 | { |
| 4863 | 4863 | global $langs, $user; |
| 4864 | 4864 | |
| 4865 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG); |
|
| 4865 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG); |
|
| 4866 | 4866 | |
| 4867 | 4867 | $this->load_cache_transport_mode(); |
| 4868 | 4868 | |
| 4869 | - print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4869 | + print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4870 | 4870 | if ($empty) { |
| 4871 | 4871 | print '<option value=""> </option>'; |
| 4872 | 4872 | } |
@@ -4882,13 +4882,13 @@ discard block |
||
| 4882 | 4882 | } |
| 4883 | 4883 | |
| 4884 | 4884 | if ($format == 0) { |
| 4885 | - print '<option value="' . $id . '"'; |
|
| 4885 | + print '<option value="'.$id.'"'; |
|
| 4886 | 4886 | } elseif ($format == 1) { |
| 4887 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4887 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4888 | 4888 | } elseif ($format == 2) { |
| 4889 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4889 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4890 | 4890 | } elseif ($format == 3) { |
| 4891 | - print '<option value="' . $id . '"'; |
|
| 4891 | + print '<option value="'.$id.'"'; |
|
| 4892 | 4892 | } |
| 4893 | 4893 | // If text is selected, we compare with code, else with id |
| 4894 | 4894 | if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { |
@@ -4936,31 +4936,31 @@ discard block |
||
| 4936 | 4936 | $langs->load("deliveries"); |
| 4937 | 4937 | |
| 4938 | 4938 | $sql = "SELECT rowid, code, libelle as label"; |
| 4939 | - $sql .= " FROM " . $this->db->prefix() . "c_shipment_mode"; |
|
| 4939 | + $sql .= " FROM ".$this->db->prefix()."c_shipment_mode"; |
|
| 4940 | 4940 | $sql .= " WHERE active > 0"; |
| 4941 | 4941 | if ($filtre) { |
| 4942 | - $sql .= " AND " . $filtre; |
|
| 4942 | + $sql .= " AND ".$filtre; |
|
| 4943 | 4943 | } |
| 4944 | 4944 | $sql .= " ORDER BY libelle ASC"; |
| 4945 | 4945 | |
| 4946 | - dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG); |
|
| 4946 | + dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG); |
|
| 4947 | 4947 | $result = $this->db->query($sql); |
| 4948 | 4948 | if ($result) { |
| 4949 | 4949 | $num = $this->db->num_rows($result); |
| 4950 | 4950 | $i = 0; |
| 4951 | 4951 | if ($num) { |
| 4952 | - print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 4952 | + print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 4953 | 4953 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 4954 | 4954 | print '<option value="-1"> </option>'; |
| 4955 | 4955 | } |
| 4956 | 4956 | while ($i < $num) { |
| 4957 | 4957 | $obj = $this->db->fetch_object($result); |
| 4958 | 4958 | if ($selected == $obj->rowid) { |
| 4959 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 4959 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 4960 | 4960 | } else { |
| 4961 | - print '<option value="' . $obj->rowid . '">'; |
|
| 4961 | + print '<option value="'.$obj->rowid.'">'; |
|
| 4962 | 4962 | } |
| 4963 | - print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label; |
|
| 4963 | + print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label; |
|
| 4964 | 4964 | print '</option>'; |
| 4965 | 4965 | $i++; |
| 4966 | 4966 | } |
@@ -4969,7 +4969,7 @@ discard block |
||
| 4969 | 4969 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4970 | 4970 | } |
| 4971 | 4971 | |
| 4972 | - print ajax_combobox('select' . $htmlname); |
|
| 4972 | + print ajax_combobox('select'.$htmlname); |
|
| 4973 | 4973 | } else { |
| 4974 | 4974 | print $langs->trans("NoShippingMethodDefined"); |
| 4975 | 4975 | } |
@@ -4994,16 +4994,16 @@ discard block |
||
| 4994 | 4994 | $langs->load("deliveries"); |
| 4995 | 4995 | |
| 4996 | 4996 | if ($htmlname != "none") { |
| 4997 | - print '<form method="POST" action="' . $page . '">'; |
|
| 4997 | + print '<form method="POST" action="'.$page.'">'; |
|
| 4998 | 4998 | print '<input type="hidden" name="action" value="setshippingmethod">'; |
| 4999 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 4999 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5000 | 5000 | $this->selectShippingMethod($selected, $htmlname, '', $addempty); |
| 5001 | - print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5001 | + print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5002 | 5002 | print '</form>'; |
| 5003 | 5003 | } else { |
| 5004 | 5004 | if ($selected) { |
| 5005 | 5005 | $code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code'); |
| 5006 | - print $langs->trans("SendingMethod" . strtoupper($code)); |
|
| 5006 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
| 5007 | 5007 | } else { |
| 5008 | 5008 | print " "; |
| 5009 | 5009 | } |
@@ -5026,10 +5026,10 @@ discard block |
||
| 5026 | 5026 | |
| 5027 | 5027 | $opt = '<option value="" selected></option>'; |
| 5028 | 5028 | $sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc"; |
| 5029 | - $sql .= ' FROM ' . $this->db->prefix() . 'facture'; |
|
| 5030 | - $sql .= ' WHERE entity IN (' . getEntity('invoice') . ')'; |
|
| 5029 | + $sql .= ' FROM '.$this->db->prefix().'facture'; |
|
| 5030 | + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; |
|
| 5031 | 5031 | $sql .= ' AND situation_counter >= 1'; |
| 5032 | - $sql .= ' AND fk_soc = ' . (int) $socid; |
|
| 5032 | + $sql .= ' AND fk_soc = '.(int) $socid; |
|
| 5033 | 5033 | $sql .= ' AND type <> 2'; |
| 5034 | 5034 | $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; |
| 5035 | 5035 | $resql = $this->db->query($sql); |
@@ -5047,19 +5047,19 @@ discard block |
||
| 5047 | 5047 | //Not prov? |
| 5048 | 5048 | if (substr($obj->ref, 1, 4) != 'PROV') { |
| 5049 | 5049 | if ($selected == $obj->rowid) { |
| 5050 | - $opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>'; |
|
| 5050 | + $opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>'; |
|
| 5051 | 5051 | } else { |
| 5052 | - $opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>'; |
|
| 5052 | + $opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>'; |
|
| 5053 | 5053 | } |
| 5054 | 5054 | } |
| 5055 | 5055 | } |
| 5056 | 5056 | } |
| 5057 | 5057 | } |
| 5058 | 5058 | } else { |
| 5059 | - dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR); |
|
| 5059 | + dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); |
|
| 5060 | 5060 | } |
| 5061 | 5061 | if ($opt == '<option value ="" selected></option>') { |
| 5062 | - $opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>'; |
|
| 5062 | + $opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>'; |
|
| 5063 | 5063 | } |
| 5064 | 5064 | return $opt; |
| 5065 | 5065 | } |
@@ -5079,12 +5079,12 @@ discard block |
||
| 5079 | 5079 | |
| 5080 | 5080 | $langs->load('products'); |
| 5081 | 5081 | |
| 5082 | - $return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 5082 | + $return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 5083 | 5083 | |
| 5084 | - $sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units"; |
|
| 5084 | + $sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units"; |
|
| 5085 | 5085 | $sql .= ' WHERE active > 0'; |
| 5086 | 5086 | if (!empty($unit_type)) { |
| 5087 | - $sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'"; |
|
| 5087 | + $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; |
|
| 5088 | 5088 | } |
| 5089 | 5089 | $sql .= " ORDER BY sortorder"; |
| 5090 | 5090 | |
@@ -5096,14 +5096,14 @@ discard block |
||
| 5096 | 5096 | |
| 5097 | 5097 | while ($res = $this->db->fetch_object($resql)) { |
| 5098 | 5098 | $unitLabel = $res->label; |
| 5099 | - if (!empty($langs->tab_translate['unit' . $res->code])) { // check if Translation is available before |
|
| 5100 | - $unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label; |
|
| 5099 | + if (!empty($langs->tab_translate['unit'.$res->code])) { // check if Translation is available before |
|
| 5100 | + $unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label; |
|
| 5101 | 5101 | } |
| 5102 | 5102 | |
| 5103 | 5103 | if ($selected == $res->rowid) { |
| 5104 | - $return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>'; |
|
| 5104 | + $return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>'; |
|
| 5105 | 5105 | } else { |
| 5106 | - $return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>'; |
|
| 5106 | + $return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>'; |
|
| 5107 | 5107 | } |
| 5108 | 5108 | } |
| 5109 | 5109 | $return .= '</select>'; |
@@ -5138,23 +5138,23 @@ discard block |
||
| 5138 | 5138 | $num = 0; |
| 5139 | 5139 | |
| 5140 | 5140 | $sql = "SELECT rowid, label, bank, clos as status, currency_code"; |
| 5141 | - $sql .= " FROM " . $this->db->prefix() . "bank_account"; |
|
| 5142 | - $sql .= " WHERE entity IN (" . getEntity('bank_account') . ")"; |
|
| 5141 | + $sql .= " FROM ".$this->db->prefix()."bank_account"; |
|
| 5142 | + $sql .= " WHERE entity IN (".getEntity('bank_account').")"; |
|
| 5143 | 5143 | if ($status != 2) { |
| 5144 | - $sql .= " AND clos = " . (int) $status; |
|
| 5144 | + $sql .= " AND clos = ".(int) $status; |
|
| 5145 | 5145 | } |
| 5146 | 5146 | if ($filtre) { // TODO Support USF |
| 5147 | - $sql .= " AND " . $filtre; |
|
| 5147 | + $sql .= " AND ".$filtre; |
|
| 5148 | 5148 | } |
| 5149 | 5149 | $sql .= " ORDER BY label"; |
| 5150 | 5150 | |
| 5151 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
| 5151 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
| 5152 | 5152 | $result = $this->db->query($sql); |
| 5153 | 5153 | if ($result) { |
| 5154 | 5154 | $num = $this->db->num_rows($result); |
| 5155 | 5155 | $i = 0; |
| 5156 | 5156 | if ($num) { |
| 5157 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 5157 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 5158 | 5158 | |
| 5159 | 5159 | if (!empty($useempty) && !is_numeric($useempty)) { |
| 5160 | 5160 | $out .= '<option value="-1">'.$langs->trans($useempty).'</option>'; |
@@ -5165,27 +5165,27 @@ discard block |
||
| 5165 | 5165 | while ($i < $num) { |
| 5166 | 5166 | $obj = $this->db->fetch_object($result); |
| 5167 | 5167 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
| 5168 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>'; |
|
| 5168 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>'; |
|
| 5169 | 5169 | } else { |
| 5170 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">'; |
|
| 5170 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">'; |
|
| 5171 | 5171 | } |
| 5172 | 5172 | $out .= trim($obj->label); |
| 5173 | 5173 | if ($showcurrency) { |
| 5174 | - $out .= ' (' . $obj->currency_code . ')'; |
|
| 5174 | + $out .= ' ('.$obj->currency_code.')'; |
|
| 5175 | 5175 | } |
| 5176 | 5176 | if ($status == 2 && $obj->status == 1) { |
| 5177 | - $out .= ' (' . $langs->trans("Closed") . ')'; |
|
| 5177 | + $out .= ' ('.$langs->trans("Closed").')'; |
|
| 5178 | 5178 | } |
| 5179 | 5179 | $out .= '</option>'; |
| 5180 | 5180 | $i++; |
| 5181 | 5181 | } |
| 5182 | 5182 | $out .= "</select>"; |
| 5183 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 5183 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 5184 | 5184 | } else { |
| 5185 | 5185 | if ($status == 0) { |
| 5186 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>'; |
|
| 5186 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; |
|
| 5187 | 5187 | } else { |
| 5188 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>'; |
|
| 5188 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>'; |
|
| 5189 | 5189 | } |
| 5190 | 5190 | } |
| 5191 | 5191 | } else { |
@@ -5221,23 +5221,23 @@ discard block |
||
| 5221 | 5221 | $num = 0; |
| 5222 | 5222 | |
| 5223 | 5223 | $sql = "SELECT rowid, name, fk_country, status, entity"; |
| 5224 | - $sql .= " FROM " . $this->db->prefix() . "establishment"; |
|
| 5224 | + $sql .= " FROM ".$this->db->prefix()."establishment"; |
|
| 5225 | 5225 | $sql .= " WHERE 1=1"; |
| 5226 | 5226 | if ($status != 2) { |
| 5227 | - $sql .= " AND status = " . (int) $status; |
|
| 5227 | + $sql .= " AND status = ".(int) $status; |
|
| 5228 | 5228 | } |
| 5229 | 5229 | if ($filtre) { // TODO Support USF |
| 5230 | - $sql .= " AND " . $filtre; |
|
| 5230 | + $sql .= " AND ".$filtre; |
|
| 5231 | 5231 | } |
| 5232 | 5232 | $sql .= " ORDER BY name"; |
| 5233 | 5233 | |
| 5234 | - dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG); |
|
| 5234 | + dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG); |
|
| 5235 | 5235 | $result = $this->db->query($sql); |
| 5236 | 5236 | if ($result) { |
| 5237 | 5237 | $num = $this->db->num_rows($result); |
| 5238 | 5238 | $i = 0; |
| 5239 | 5239 | if ($num) { |
| 5240 | - print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 5240 | + print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 5241 | 5241 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 5242 | 5242 | print '<option value="-1"> </option>'; |
| 5243 | 5243 | } |
@@ -5245,13 +5245,13 @@ discard block |
||
| 5245 | 5245 | while ($i < $num) { |
| 5246 | 5246 | $obj = $this->db->fetch_object($result); |
| 5247 | 5247 | if ($selected == $obj->rowid) { |
| 5248 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 5248 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 5249 | 5249 | } else { |
| 5250 | - print '<option value="' . $obj->rowid . '">'; |
|
| 5250 | + print '<option value="'.$obj->rowid.'">'; |
|
| 5251 | 5251 | } |
| 5252 | 5252 | print trim($obj->name); |
| 5253 | 5253 | if ($status == 2 && $obj->status == 1) { |
| 5254 | - print ' (' . $langs->trans("Closed") . ')'; |
|
| 5254 | + print ' ('.$langs->trans("Closed").')'; |
|
| 5255 | 5255 | } |
| 5256 | 5256 | print '</option>'; |
| 5257 | 5257 | $i++; |
@@ -5259,9 +5259,9 @@ discard block |
||
| 5259 | 5259 | print "</select>"; |
| 5260 | 5260 | } else { |
| 5261 | 5261 | if ($status == 0) { |
| 5262 | - print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>'; |
|
| 5262 | + print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; |
|
| 5263 | 5263 | } else { |
| 5264 | - print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>'; |
|
| 5264 | + print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; |
|
| 5265 | 5265 | } |
| 5266 | 5266 | } |
| 5267 | 5267 | |
@@ -5285,20 +5285,20 @@ discard block |
||
| 5285 | 5285 | { |
| 5286 | 5286 | global $langs; |
| 5287 | 5287 | if ($htmlname != "none") { |
| 5288 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5288 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5289 | 5289 | print '<input type="hidden" name="action" value="setbankaccount">'; |
| 5290 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5290 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5291 | 5291 | print img_picto('', 'bank_account', 'class="pictofixedwidth"'); |
| 5292 | 5292 | $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); |
| 5293 | 5293 | if ($nbaccountfound > 0) { |
| 5294 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5294 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5295 | 5295 | } |
| 5296 | 5296 | print '</form>'; |
| 5297 | 5297 | } else { |
| 5298 | 5298 | $langs->load('banks'); |
| 5299 | 5299 | |
| 5300 | 5300 | if ($selected) { |
| 5301 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
| 5301 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
| 5302 | 5302 | $bankstatic = new Account($this->db); |
| 5303 | 5303 | $result = $bankstatic->fetch($selected); |
| 5304 | 5304 | if ($result) { |
@@ -5337,19 +5337,19 @@ discard block |
||
| 5337 | 5337 | global $conf, $langs; |
| 5338 | 5338 | $langs->load("categories"); |
| 5339 | 5339 | |
| 5340 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 5340 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 5341 | 5341 | |
| 5342 | 5342 | // For backward compatibility |
| 5343 | 5343 | if (is_numeric($type)) { |
| 5344 | - dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5344 | + dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5345 | 5345 | } |
| 5346 | 5346 | |
| 5347 | 5347 | if ($type === Categorie::TYPE_BANK_LINE) { |
| 5348 | 5348 | // TODO Move this into common category feature |
| 5349 | 5349 | $cate_arbo = array(); |
| 5350 | 5350 | $sql = "SELECT c.label, c.rowid"; |
| 5351 | - $sql .= " FROM " . $this->db->prefix() . "category_bank as c"; |
|
| 5352 | - $sql .= " WHERE entity = " . $conf->entity; |
|
| 5351 | + $sql .= " FROM ".$this->db->prefix()."category_bank as c"; |
|
| 5352 | + $sql .= " WHERE entity = ".$conf->entity; |
|
| 5353 | 5353 | $sql .= " ORDER BY c.label"; |
| 5354 | 5354 | $result = $this->db->query($sql); |
| 5355 | 5355 | if ($result) { |
@@ -5375,12 +5375,12 @@ discard block |
||
| 5375 | 5375 | $outarrayrichhtml = array(); |
| 5376 | 5376 | |
| 5377 | 5377 | |
| 5378 | - $output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 5378 | + $output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 5379 | 5379 | if (is_array($cate_arbo)) { |
| 5380 | 5380 | $num = count($cate_arbo); |
| 5381 | 5381 | |
| 5382 | 5382 | if (!$num) { |
| 5383 | - $output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>'; |
|
| 5383 | + $output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>'; |
|
| 5384 | 5384 | } else { |
| 5385 | 5385 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 5386 | 5386 | $output .= '<option value="-1"> </option>'; |
@@ -5392,15 +5392,15 @@ discard block |
||
| 5392 | 5392 | $add = ''; |
| 5393 | 5393 | } |
| 5394 | 5394 | |
| 5395 | - $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"'); |
|
| 5395 | + $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"'); |
|
| 5396 | 5396 | $labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5397 | 5397 | |
| 5398 | 5398 | $outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel']; |
| 5399 | 5399 | |
| 5400 | 5400 | $outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow; |
| 5401 | 5401 | |
| 5402 | - $output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"'; |
|
| 5403 | - $output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"'; |
|
| 5402 | + $output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"'; |
|
| 5403 | + $output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"'; |
|
| 5404 | 5404 | $output .= '>'; |
| 5405 | 5405 | $output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5406 | 5406 | $output .= '</option>'; |
@@ -5444,7 +5444,7 @@ discard block |
||
| 5444 | 5444 | public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) |
| 5445 | 5445 | { |
| 5446 | 5446 | // phpcs:enable |
| 5447 | - dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5447 | + dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5448 | 5448 | print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); |
| 5449 | 5449 | } |
| 5450 | 5450 | |
@@ -5479,7 +5479,7 @@ discard block |
||
| 5479 | 5479 | { |
| 5480 | 5480 | global $langs, $conf; |
| 5481 | 5481 | |
| 5482 | - $more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->'; |
|
| 5482 | + $more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->'; |
|
| 5483 | 5483 | $formconfirm = ''; |
| 5484 | 5484 | $inputok = array(); |
| 5485 | 5485 | $inputko = array(); |
@@ -5503,27 +5503,27 @@ discard block |
||
| 5503 | 5503 | foreach ($formquestion as $key => $input) { |
| 5504 | 5504 | if (is_array($input) && !empty($input)) { |
| 5505 | 5505 | if ($input['type'] == 'hidden') { |
| 5506 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5507 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5506 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5507 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5508 | 5508 | |
| 5509 | - $more .= '<input type="hidden" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . dol_escape_htmltag($input['value']) . '" class="' . $morecss . '"' . $moreattr . '>' . "\n"; |
|
| 5509 | + $more .= '<input type="hidden" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'" value="'.dol_escape_htmltag($input['value']).'" class="'.$morecss.'"'.$moreattr.'>'."\n"; |
|
| 5510 | 5510 | } |
| 5511 | 5511 | } |
| 5512 | 5512 | } |
| 5513 | 5513 | |
| 5514 | 5514 | // Now add questions |
| 5515 | 5515 | $moreonecolumn = ''; |
| 5516 | - $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n"; |
|
| 5516 | + $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n"; |
|
| 5517 | 5517 | foreach ($formquestion as $key => $input) { |
| 5518 | 5518 | if (is_array($input) && !empty($input)) { |
| 5519 | - $size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : ''); // deprecated. Use morecss instead. |
|
| 5520 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5521 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5519 | + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. |
|
| 5520 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5521 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5522 | 5522 | |
| 5523 | 5523 | if ($input['type'] == 'text') { |
| 5524 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="text" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
| 5524 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
| 5525 | 5525 | } elseif ($input['type'] == 'password') { |
| 5526 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="password" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
| 5526 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
| 5527 | 5527 | } elseif ($input['type'] == 'textarea') { |
| 5528 | 5528 | /*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; |
| 5529 | 5529 | $more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; |
@@ -5531,8 +5531,8 @@ discard block |
||
| 5531 | 5531 | $more .= '</textarea>'; |
| 5532 | 5532 | $more .= '</div></div>'."\n";*/ |
| 5533 | 5533 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5534 | - $moreonecolumn .= $input['label'] . '<br>'; |
|
| 5535 | - $moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>'; |
|
| 5534 | + $moreonecolumn .= $input['label'].'<br>'; |
|
| 5535 | + $moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>'; |
|
| 5536 | 5536 | $moreonecolumn .= $input['value']; |
| 5537 | 5537 | $moreonecolumn .= '</textarea>'; |
| 5538 | 5538 | $moreonecolumn .= '</div>'; |
@@ -5549,20 +5549,20 @@ discard block |
||
| 5549 | 5549 | $disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; |
| 5550 | 5550 | $sort = isset($input['select_sort']) ? $input['select_sort'] : ''; |
| 5551 | 5551 | |
| 5552 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">'; |
|
| 5552 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
|
| 5553 | 5553 | if (!empty($input['label'])) { |
| 5554 | - $more .= $input['label'] . '</div><div class="tagtd left">'; |
|
| 5554 | + $more .= $input['label'].'</div><div class="tagtd left">'; |
|
| 5555 | 5555 | } |
| 5556 | 5556 | if ($input['type'] == 'select') { |
| 5557 | 5557 | $more .= $this->selectarray($input['name'], $input['values'], isset($input['default']) ? $input['default'] : '-1', $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss); |
| 5558 | 5558 | } else { |
| 5559 | 5559 | $more .= $this->multiselectarray($input['name'], $input['values'], is_array($input['default']) ? $input['default'] : [$input['default']], $key_in_label, $value_as_key, $morecss, $translate, $maxlen, $moreattr); |
| 5560 | 5560 | } |
| 5561 | - $more .= '</div></div>' . "\n"; |
|
| 5561 | + $more .= '</div></div>'."\n"; |
|
| 5562 | 5562 | } elseif ($input['type'] == 'checkbox') { |
| 5563 | 5563 | $more .= '<div class="tagtr">'; |
| 5564 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">'; |
|
| 5565 | - $more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr; |
|
| 5564 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">'; |
|
| 5565 | + $more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; |
|
| 5566 | 5566 | if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') { |
| 5567 | 5567 | $more .= ' checked'; |
| 5568 | 5568 | } |
@@ -5573,19 +5573,19 @@ discard block |
||
| 5573 | 5573 | $more .= ' disabled'; |
| 5574 | 5574 | } |
| 5575 | 5575 | $more .= ' /></div>'; |
| 5576 | - $more .= '</div>' . "\n"; |
|
| 5576 | + $more .= '</div>'."\n"; |
|
| 5577 | 5577 | } elseif ($input['type'] == 'radio') { |
| 5578 | 5578 | $i = 0; |
| 5579 | 5579 | foreach ($input['values'] as $selkey => $selval) { |
| 5580 | 5580 | $more .= '<div class="tagtr">'; |
| 5581 | 5581 | if (isset($input['label'])) { |
| 5582 | 5582 | if ($i == 0) { |
| 5583 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5583 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5584 | 5584 | } else { |
| 5585 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '"> </div>'; |
|
| 5585 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>'; |
|
| 5586 | 5586 | } |
| 5587 | 5587 | } |
| 5588 | - $more .= '<div class="tagtd' . ($i == 0 ? ' tdtop' : '') . '"><input type="radio" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name'] . $selkey) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . $selkey . '"' . $moreattr; |
|
| 5588 | + $more .= '<div class="tagtd'.($i == 0 ? ' tdtop' : '').'"><input type="radio" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name'].$selkey).'" name="'.dol_escape_htmltag($input['name']).'" value="'.$selkey.'"'.$moreattr; |
|
| 5589 | 5589 | if (!empty($input['disabled'])) { |
| 5590 | 5590 | $more .= ' disabled'; |
| 5591 | 5591 | } |
@@ -5593,12 +5593,12 @@ discard block |
||
| 5593 | 5593 | $more .= ' checked="checked"'; |
| 5594 | 5594 | } |
| 5595 | 5595 | $more .= ' /> '; |
| 5596 | - $more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>'; |
|
| 5597 | - $more .= '</div></div>' . "\n"; |
|
| 5596 | + $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>'; |
|
| 5597 | + $more .= '</div></div>'."\n"; |
|
| 5598 | 5598 | $i++; |
| 5599 | 5599 | } |
| 5600 | 5600 | } elseif ($input['type'] == 'date' || $input['type'] == 'datetime') { |
| 5601 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5601 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5602 | 5602 | $more .= '<div class="tagtd">'; |
| 5603 | 5603 | $addnowlink = (empty($input['datenow']) ? 0 : 1); |
| 5604 | 5604 | $h = $m = 0; |
@@ -5616,24 +5616,24 @@ discard block |
||
| 5616 | 5616 | } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not |
| 5617 | 5617 | $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
| 5618 | 5618 | if (!empty($input['label'])) { |
| 5619 | - $more .= $input['label'] . '</div><div class="tagtd">'; |
|
| 5619 | + $more .= $input['label'].'</div><div class="tagtd">'; |
|
| 5620 | 5620 | } |
| 5621 | 5621 | $more .= $input['value']; |
| 5622 | - $more .= '</div></div>' . "\n"; |
|
| 5622 | + $more .= '</div></div>'."\n"; |
|
| 5623 | 5623 | } elseif ($input['type'] == 'onecolumn') { |
| 5624 | 5624 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5625 | 5625 | $moreonecolumn .= $input['value']; |
| 5626 | - $moreonecolumn .= '</div>' . "\n"; |
|
| 5626 | + $moreonecolumn .= '</div>'."\n"; |
|
| 5627 | 5627 | } elseif ($input['type'] == 'hidden') { |
| 5628 | 5628 | // Do nothing more, already added by a previous loop |
| 5629 | 5629 | } elseif ($input['type'] == 'separator') { |
| 5630 | 5630 | $more .= '<br>'; |
| 5631 | 5631 | } else { |
| 5632 | - $more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type'; |
|
| 5632 | + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; |
|
| 5633 | 5633 | } |
| 5634 | 5634 | } |
| 5635 | 5635 | } |
| 5636 | - $more .= '</div>' . "\n"; |
|
| 5636 | + $more .= '</div>'."\n"; |
|
| 5637 | 5637 | $more .= $moreonecolumn; |
| 5638 | 5638 | } |
| 5639 | 5639 | |
@@ -5655,10 +5655,10 @@ discard block |
||
| 5655 | 5655 | $button = $useajax; |
| 5656 | 5656 | $useajax = 1; |
| 5657 | 5657 | $autoOpen = false; |
| 5658 | - $dialogconfirm .= '-' . $button; |
|
| 5658 | + $dialogconfirm .= '-'.$button; |
|
| 5659 | 5659 | } |
| 5660 | - $pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes'; |
|
| 5661 | - $pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : ''); |
|
| 5660 | + $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes'; |
|
| 5661 | + $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : ''); |
|
| 5662 | 5662 | |
| 5663 | 5663 | // Add input fields into list of fields to read during submit (inputok and inputko) |
| 5664 | 5664 | if (is_array($formquestion)) { |
@@ -5681,24 +5681,24 @@ discard block |
||
| 5681 | 5681 | } |
| 5682 | 5682 | |
| 5683 | 5683 | // Show JQuery confirm box. |
| 5684 | - $formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">'; |
|
| 5684 | + $formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; |
|
| 5685 | 5685 | if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
| 5686 | - $formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n"; |
|
| 5686 | + $formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n"; |
|
| 5687 | 5687 | } |
| 5688 | 5688 | if (!empty($more)) { |
| 5689 | - $formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n"; |
|
| 5689 | + $formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n"; |
|
| 5690 | 5690 | } |
| 5691 | - $formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : ''); |
|
| 5692 | - $formconfirm .= '</div>' . "\n"; |
|
| 5691 | + $formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : ''); |
|
| 5692 | + $formconfirm .= '</div>'."\n"; |
|
| 5693 | 5693 | |
| 5694 | - $formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n"; |
|
| 5695 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5694 | + $formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n"; |
|
| 5695 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5696 | 5696 | $formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n"; |
| 5697 | 5697 | $formconfirm .= 'jQuery(document).ready(function() { |
| 5698 | 5698 | $(function() { |
| 5699 | - $( "#' . $dialogconfirm . '" ).dialog( |
|
| 5699 | + $( "#' . $dialogconfirm.'" ).dialog( |
|
| 5700 | 5700 | { |
| 5701 | - autoOpen: ' . ($autoOpen ? "true" : "false") . ','; |
|
| 5701 | + autoOpen: ' . ($autoOpen ? "true" : "false").','; |
|
| 5702 | 5702 | if ($newselectedchoice == 'no') { |
| 5703 | 5703 | $formconfirm .= ' |
| 5704 | 5704 | open: function() { |
@@ -5708,24 +5708,24 @@ discard block |
||
| 5708 | 5708 | |
| 5709 | 5709 | $jsforcursor = ''; |
| 5710 | 5710 | if ($useajax == 1) { |
| 5711 | - $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n"; |
|
| 5712 | - $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n"; |
|
| 5711 | + $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; |
|
| 5712 | + $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; |
|
| 5713 | 5713 | } |
| 5714 | 5714 | |
| 5715 | 5715 | $postconfirmas = 'GET'; |
| 5716 | 5716 | |
| 5717 | 5717 | $formconfirm .= ' |
| 5718 | 5718 | resizable: false, |
| 5719 | - height: "' . $height . '", |
|
| 5720 | - width: "' . $width . '", |
|
| 5719 | + height: "' . $height.'", |
|
| 5720 | + width: "' . $width.'", |
|
| 5721 | 5721 | modal: true, |
| 5722 | 5722 | closeOnEscape: false, |
| 5723 | 5723 | buttons: { |
| 5724 | - "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() { |
|
| 5725 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5726 | - var inputok = ' . json_encode($inputok) . '; /* List of fields into form */ |
|
| 5727 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5728 | - var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '"; |
|
| 5724 | + "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { |
|
| 5725 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5726 | + var inputok = ' . json_encode($inputok).'; /* List of fields into form */ |
|
| 5727 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5728 | + var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; |
|
| 5729 | 5729 | |
| 5730 | 5730 | if (inputok.length > 0) { |
| 5731 | 5731 | $.each(inputok, function(i, inputname) { |
@@ -5759,11 +5759,11 @@ discard block |
||
| 5759 | 5759 | } |
| 5760 | 5760 | $(this).dialog("close"); |
| 5761 | 5761 | }, |
| 5762 | - "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() { |
|
| 5763 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5764 | - var inputko = ' . json_encode($inputko) . '; /* List of fields into form */ |
|
| 5765 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5766 | - var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '"; |
|
| 5762 | + "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { |
|
| 5763 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5764 | + var inputko = ' . json_encode($inputko).'; /* List of fields into form */ |
|
| 5765 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5766 | + var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'"; |
|
| 5767 | 5767 | if (inputko.length > 0) { |
| 5768 | 5768 | $.each(inputko, function(i, inputname) { |
| 5769 | 5769 | var more = ""; |
@@ -5795,10 +5795,10 @@ discard block |
||
| 5795 | 5795 | } |
| 5796 | 5796 | ); |
| 5797 | 5797 | |
| 5798 | - var button = "' . $button . '"; |
|
| 5798 | + var button = "' . $button.'"; |
|
| 5799 | 5799 | if (button.length > 0) { |
| 5800 | 5800 | $( "#" + button ).click(function() { |
| 5801 | - $("#' . $dialogconfirm . '").dialog("open"); |
|
| 5801 | + $("#' . $dialogconfirm.'").dialog("open"); |
|
| 5802 | 5802 | }); |
| 5803 | 5803 | } |
| 5804 | 5804 | }); |
@@ -5806,44 +5806,44 @@ discard block |
||
| 5806 | 5806 | </script>'; |
| 5807 | 5807 | $formconfirm .= "<!-- end ajax formconfirm -->\n"; |
| 5808 | 5808 | } else { |
| 5809 | - $formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n"; |
|
| 5809 | + $formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n"; |
|
| 5810 | 5810 | |
| 5811 | 5811 | if (empty($disableformtag)) { |
| 5812 | - $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n"; |
|
| 5812 | + $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n"; |
|
| 5813 | 5813 | } |
| 5814 | 5814 | |
| 5815 | - $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n"; |
|
| 5816 | - $formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n"; |
|
| 5815 | + $formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n"; |
|
| 5816 | + $formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
|
| 5817 | 5817 | |
| 5818 | - $formconfirm .= '<table class="valid centpercent">' . "\n"; |
|
| 5818 | + $formconfirm .= '<table class="valid centpercent">'."\n"; |
|
| 5819 | 5819 | |
| 5820 | 5820 | // Line title |
| 5821 | 5821 | $formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">'; |
| 5822 | - $formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title; |
|
| 5823 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5822 | + $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; |
|
| 5823 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5824 | 5824 | |
| 5825 | 5825 | // Line text |
| 5826 | 5826 | if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
| 5827 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n"; |
|
| 5827 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n"; |
|
| 5828 | 5828 | } |
| 5829 | 5829 | |
| 5830 | 5830 | // Line form fields |
| 5831 | 5831 | if ($more) { |
| 5832 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n"; |
|
| 5832 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n"; |
|
| 5833 | 5833 | $formconfirm .= $more; |
| 5834 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5834 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5835 | 5835 | } |
| 5836 | 5836 | |
| 5837 | 5837 | // Line with question |
| 5838 | 5838 | $formconfirm .= '<tr class="valid">'; |
| 5839 | - $formconfirm .= '<td class="valid">' . $question . '</td>'; |
|
| 5839 | + $formconfirm .= '<td class="valid">'.$question.'</td>'; |
|
| 5840 | 5840 | $formconfirm .= '<td class="valid center">'; |
| 5841 | 5841 | $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); |
| 5842 | - $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">'; |
|
| 5842 | + $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">'; |
|
| 5843 | 5843 | $formconfirm .= '</td>'; |
| 5844 | - $formconfirm .= '</tr>' . "\n"; |
|
| 5844 | + $formconfirm .= '</tr>'."\n"; |
|
| 5845 | 5845 | |
| 5846 | - $formconfirm .= '</table>' . "\n"; |
|
| 5846 | + $formconfirm .= '</table>'."\n"; |
|
| 5847 | 5847 | |
| 5848 | 5848 | if (empty($disableformtag)) { |
| 5849 | 5849 | $formconfirm .= "</form>\n"; |
@@ -5852,7 +5852,7 @@ discard block |
||
| 5852 | 5852 | |
| 5853 | 5853 | if (!empty($conf->use_javascript_ajax)) { |
| 5854 | 5854 | $formconfirm .= '<!-- code to disable button to avoid double clic -->'; |
| 5855 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5855 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5856 | 5856 | $formconfirm .= ' |
| 5857 | 5857 | $(document).ready(function () { |
| 5858 | 5858 | $(".confirmvalidatebutton").on("click", function() { |
@@ -5864,7 +5864,7 @@ discard block |
||
| 5864 | 5864 | }); |
| 5865 | 5865 | }); |
| 5866 | 5866 | '; |
| 5867 | - $formconfirm .= '</script>' . "\n"; |
|
| 5867 | + $formconfirm .= '</script>'."\n"; |
|
| 5868 | 5868 | } |
| 5869 | 5869 | |
| 5870 | 5870 | $formconfirm .= "<!-- end formconfirm -->\n"; |
@@ -5896,8 +5896,8 @@ discard block |
||
| 5896 | 5896 | // phpcs:enable |
| 5897 | 5897 | global $langs; |
| 5898 | 5898 | |
| 5899 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 5900 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 5899 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 5900 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 5901 | 5901 | |
| 5902 | 5902 | $out = ''; |
| 5903 | 5903 | |
@@ -5905,11 +5905,11 @@ discard block |
||
| 5905 | 5905 | |
| 5906 | 5906 | $langs->load("project"); |
| 5907 | 5907 | if ($htmlname != "none") { |
| 5908 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 5908 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 5909 | 5909 | $out .= '<input type="hidden" name="action" value="classin">'; |
| 5910 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5910 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5911 | 5911 | $out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss); |
| 5912 | - $out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5912 | + $out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5913 | 5913 | $out .= '</form>'; |
| 5914 | 5914 | } else { |
| 5915 | 5915 | $out .= '<span class="project_head_block">'; |
@@ -5918,7 +5918,7 @@ discard block |
||
| 5918 | 5918 | $projet->fetch($selected); |
| 5919 | 5919 | $out .= $projet->getNomUrl(0, '', 1); |
| 5920 | 5920 | } else { |
| 5921 | - $out .= '<span class="opacitymedium">' . $textifnoproject . '</span>'; |
|
| 5921 | + $out .= '<span class="opacitymedium">'.$textifnoproject.'</span>'; |
|
| 5922 | 5922 | } |
| 5923 | 5923 | $out .= '</span>'; |
| 5924 | 5924 | } |
@@ -5955,14 +5955,14 @@ discard block |
||
| 5955 | 5955 | $out = ''; |
| 5956 | 5956 | |
| 5957 | 5957 | if ($htmlname != "none") { |
| 5958 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 5958 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 5959 | 5959 | $out .= '<input type="hidden" name="action" value="setconditions">'; |
| 5960 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5960 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5961 | 5961 | if ($type) { |
| 5962 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5962 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5963 | 5963 | } |
| 5964 | 5964 | $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); |
| 5965 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5965 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5966 | 5966 | $out .= '</form>'; |
| 5967 | 5967 | } else { |
| 5968 | 5968 | if ($selected) { |
@@ -6007,12 +6007,12 @@ discard block |
||
| 6007 | 6007 | // phpcs:enable |
| 6008 | 6008 | global $langs; |
| 6009 | 6009 | if ($htmlname != "none") { |
| 6010 | - print '<form method="post" action="' . $page . '">'; |
|
| 6010 | + print '<form method="post" action="'.$page.'">'; |
|
| 6011 | 6011 | print '<input type="hidden" name="action" value="setavailability">'; |
| 6012 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6012 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6013 | 6013 | $this->selectAvailabilityDelay($selected, $htmlname, '', $addempty); |
| 6014 | - print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 6015 | - print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">'; |
|
| 6014 | + print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 6015 | + print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">'; |
|
| 6016 | 6016 | print '</form>'; |
| 6017 | 6017 | } else { |
| 6018 | 6018 | if ($selected) { |
@@ -6038,11 +6038,11 @@ discard block |
||
| 6038 | 6038 | { |
| 6039 | 6039 | global $langs; |
| 6040 | 6040 | if ($htmlname != "none") { |
| 6041 | - print '<form method="post" action="' . $page . '">'; |
|
| 6041 | + print '<form method="post" action="'.$page.'">'; |
|
| 6042 | 6042 | print '<input type="hidden" name="action" value="setdemandreason">'; |
| 6043 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6043 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6044 | 6044 | $this->selectInputReason($selected, $htmlname, '-1', $addempty); |
| 6045 | - print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 6045 | + print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 6046 | 6046 | print '</form>'; |
| 6047 | 6047 | } else { |
| 6048 | 6048 | if ($selected) { |
@@ -6082,17 +6082,17 @@ discard block |
||
| 6082 | 6082 | $ret = ''; |
| 6083 | 6083 | |
| 6084 | 6084 | if ($htmlname != "none") { |
| 6085 | - $ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 6086 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 6087 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6085 | + $ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 6086 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 6087 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6088 | 6088 | if ($type) { |
| 6089 | - $ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 6089 | + $ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 6090 | 6090 | } |
| 6091 | 6091 | $ret .= '<table class="nobordernopadding">'; |
| 6092 | 6092 | $ret .= '<tr><td>'; |
| 6093 | - $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0); |
|
| 6093 | + $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); |
|
| 6094 | 6094 | $ret .= '</td>'; |
| 6095 | - $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 6095 | + $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 6096 | 6096 | $ret .= '</tr></table></form>'; |
| 6097 | 6097 | } else { |
| 6098 | 6098 | if ($displayhour) { |
@@ -6127,15 +6127,15 @@ discard block |
||
| 6127 | 6127 | global $langs; |
| 6128 | 6128 | |
| 6129 | 6129 | if ($htmlname != "none") { |
| 6130 | - print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 6131 | - print '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 6132 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6130 | + print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 6131 | + print '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 6132 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6133 | 6133 | print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); |
| 6134 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6134 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6135 | 6135 | print '</form>'; |
| 6136 | 6136 | } else { |
| 6137 | 6137 | if ($selected) { |
| 6138 | - require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
| 6138 | + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
| 6139 | 6139 | $theuser = new User($this->db); |
| 6140 | 6140 | $theuser->fetch($selected); |
| 6141 | 6141 | print $theuser->getNomUrl(1); |
@@ -6168,14 +6168,14 @@ discard block |
||
| 6168 | 6168 | |
| 6169 | 6169 | $out = ''; |
| 6170 | 6170 | if ($htmlname != "none") { |
| 6171 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 6171 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 6172 | 6172 | $out .= '<input type="hidden" name="action" value="setmode">'; |
| 6173 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6173 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6174 | 6174 | if ($type) { |
| 6175 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 6175 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 6176 | 6176 | } |
| 6177 | 6177 | $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); |
| 6178 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6178 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6179 | 6179 | $out .= '</form>'; |
| 6180 | 6180 | } else { |
| 6181 | 6181 | if ($selected) { |
@@ -6208,11 +6208,11 @@ discard block |
||
| 6208 | 6208 | { |
| 6209 | 6209 | global $langs; |
| 6210 | 6210 | if ($htmlname != "none") { |
| 6211 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6211 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6212 | 6212 | print '<input type="hidden" name="action" value="settransportmode">'; |
| 6213 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6213 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6214 | 6214 | $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); |
| 6215 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6215 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6216 | 6216 | print '</form>'; |
| 6217 | 6217 | } else { |
| 6218 | 6218 | if ($selected) { |
@@ -6239,14 +6239,14 @@ discard block |
||
| 6239 | 6239 | // phpcs:enable |
| 6240 | 6240 | global $langs; |
| 6241 | 6241 | if ($htmlname != "none") { |
| 6242 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6242 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6243 | 6243 | print '<input type="hidden" name="action" value="setmulticurrencycode">'; |
| 6244 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6244 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6245 | 6245 | print $this->selectMultiCurrency($selected, $htmlname, 0); |
| 6246 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6246 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6247 | 6247 | print '</form>'; |
| 6248 | 6248 | } else { |
| 6249 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 6249 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 6250 | 6250 | print !empty($selected) ? currency_name($selected, 1) : ' '; |
| 6251 | 6251 | } |
| 6252 | 6252 | } |
@@ -6268,21 +6268,21 @@ discard block |
||
| 6268 | 6268 | global $langs, $mysoc, $conf; |
| 6269 | 6269 | |
| 6270 | 6270 | if ($htmlname != "none") { |
| 6271 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6271 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6272 | 6272 | print '<input type="hidden" name="action" value="setmulticurrencyrate">'; |
| 6273 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6274 | - print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> '; |
|
| 6273 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6274 | + print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> '; |
|
| 6275 | 6275 | print '<select name="calculation_mode">'; |
| 6276 | - print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>'; |
|
| 6277 | - print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>'; |
|
| 6276 | + print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>'; |
|
| 6277 | + print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>'; |
|
| 6278 | 6278 | print '</select> '; |
| 6279 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6279 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6280 | 6280 | print '</form>'; |
| 6281 | 6281 | } else { |
| 6282 | 6282 | if (!empty($rate)) { |
| 6283 | 6283 | print price($rate, 1, $langs, 0, 0); |
| 6284 | 6284 | if ($currency && $rate != 1) { |
| 6285 | - print ' (' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')'; |
|
| 6285 | + print ' ('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')'; |
|
| 6286 | 6286 | } |
| 6287 | 6287 | } else { |
| 6288 | 6288 | print 1; |
@@ -6313,9 +6313,9 @@ discard block |
||
| 6313 | 6313 | // phpcs:enable |
| 6314 | 6314 | global $conf, $langs; |
| 6315 | 6315 | if ($htmlname != "none") { |
| 6316 | - print '<form method="post" action="' . $page . '">'; |
|
| 6316 | + print '<form method="post" action="'.$page.'">'; |
|
| 6317 | 6317 | print '<input type="hidden" name="action" value="setabsolutediscount">'; |
| 6318 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6318 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6319 | 6319 | print '<div class="inline-block">'; |
| 6320 | 6320 | if (!empty($discount_type)) { |
| 6321 | 6321 | if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) { |
@@ -6353,24 +6353,24 @@ discard block |
||
| 6353 | 6353 | print '</div>'; |
| 6354 | 6354 | if (empty($hidelist)) { |
| 6355 | 6355 | print '<div class="inline-block" style="padding-right: 10px">'; |
| 6356 | - $newfilter = 'discount_type=' . intval($discount_type); |
|
| 6356 | + $newfilter = 'discount_type='.intval($discount_type); |
|
| 6357 | 6357 | if (!empty($discount_type)) { |
| 6358 | 6358 | $newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available |
| 6359 | 6359 | } else { |
| 6360 | 6360 | $newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available |
| 6361 | 6361 | } |
| 6362 | 6362 | if ($filter) { |
| 6363 | - $newfilter .= ' AND (' . $filter . ')'; |
|
| 6363 | + $newfilter .= ' AND ('.$filter.')'; |
|
| 6364 | 6364 | } |
| 6365 | 6365 | // output the combo of discounts |
| 6366 | 6366 | $nbqualifiedlines = $this->select_remises((string) $selected, $htmlname, $newfilter, $socid, $maxvalue); |
| 6367 | 6367 | if ($nbqualifiedlines > 0) { |
| 6368 | - print ' <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"'; |
|
| 6368 | + print ' <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; |
|
| 6369 | 6369 | if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") { |
| 6370 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6370 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6371 | 6371 | } |
| 6372 | 6372 | if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") { |
| 6373 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6373 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6374 | 6374 | } |
| 6375 | 6375 | |
| 6376 | 6376 | print '>'; |
@@ -6410,23 +6410,23 @@ discard block |
||
| 6410 | 6410 | global $langs; |
| 6411 | 6411 | |
| 6412 | 6412 | if ($htmlname != "none") { |
| 6413 | - print '<form method="post" action="' . $page . '">'; |
|
| 6413 | + print '<form method="post" action="'.$page.'">'; |
|
| 6414 | 6414 | print '<input type="hidden" name="action" value="set_contact">'; |
| 6415 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6415 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6416 | 6416 | print '<table class="nobordernopadding">'; |
| 6417 | 6417 | print '<tr><td>'; |
| 6418 | 6418 | print $this->selectcontacts($societe->id, $selected, $htmlname); |
| 6419 | 6419 | $num = $this->num; |
| 6420 | 6420 | if ($num == 0) { |
| 6421 | 6421 | $addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
| 6422 | - print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>'; |
|
| 6422 | + print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>'; |
|
| 6423 | 6423 | } |
| 6424 | 6424 | print '</td>'; |
| 6425 | - print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 6425 | + print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 6426 | 6426 | print '</tr></table></form>'; |
| 6427 | 6427 | } else { |
| 6428 | 6428 | if ($selected) { |
| 6429 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 6429 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 6430 | 6430 | $contact = new Contact($this->db); |
| 6431 | 6431 | $contact->fetch($selected); |
| 6432 | 6432 | print $contact->getFullName($langs); |
@@ -6461,20 +6461,20 @@ discard block |
||
| 6461 | 6461 | |
| 6462 | 6462 | $out = ''; |
| 6463 | 6463 | if ($htmlname != "none") { |
| 6464 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 6464 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 6465 | 6465 | $out .= '<input type="hidden" name="action" value="set_thirdparty">'; |
| 6466 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6466 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6467 | 6467 | $out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids); |
| 6468 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6468 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6469 | 6469 | $out .= '</form>'; |
| 6470 | 6470 | } else { |
| 6471 | 6471 | if ($selected) { |
| 6472 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 6472 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 6473 | 6473 | $soc = new Societe($this->db); |
| 6474 | 6474 | $soc->fetch($selected); |
| 6475 | 6475 | $out .= $soc->getNomUrl(0, ''); |
| 6476 | 6476 | } else { |
| 6477 | - $out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>'; |
|
| 6477 | + $out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>'; |
|
| 6478 | 6478 | } |
| 6479 | 6479 | } |
| 6480 | 6480 | |
@@ -6524,22 +6524,22 @@ discard block |
||
| 6524 | 6524 | $selected = 'EUR'; // Pour compatibilite |
| 6525 | 6525 | } |
| 6526 | 6526 | |
| 6527 | - $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6527 | + $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6528 | 6528 | if ($useempty) { |
| 6529 | 6529 | $out .= '<option value="-1" selected></option>'; |
| 6530 | 6530 | } |
| 6531 | 6531 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6532 | 6532 | $labeltoshow = $currency['label']; |
| 6533 | 6533 | if ($mode == 1) { |
| 6534 | - $labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>'; |
|
| 6534 | + $labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>'; |
|
| 6535 | 6535 | } else { |
| 6536 | - $labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>'; |
|
| 6536 | + $labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>'; |
|
| 6537 | 6537 | } |
| 6538 | 6538 | |
| 6539 | 6539 | if ($selected && $selected == $code_iso) { |
| 6540 | - $out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6540 | + $out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6541 | 6541 | } else { |
| 6542 | - $out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6542 | + $out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6543 | 6543 | } |
| 6544 | 6544 | $out .= $labeltoshow; |
| 6545 | 6545 | $out .= '</option>'; |
@@ -6550,7 +6550,7 @@ discard block |
||
| 6550 | 6550 | } |
| 6551 | 6551 | |
| 6552 | 6552 | // Make select dynamic |
| 6553 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6553 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6554 | 6554 | $out .= ajax_combobox($htmlname); |
| 6555 | 6555 | |
| 6556 | 6556 | return $out; |
@@ -6576,10 +6576,10 @@ discard block |
||
| 6576 | 6576 | |
| 6577 | 6577 | $TCurrency = array(); |
| 6578 | 6578 | |
| 6579 | - $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; |
|
| 6580 | - $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; |
|
| 6579 | + $sql = "SELECT code FROM ".$this->db->prefix()."multicurrency"; |
|
| 6580 | + $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; |
|
| 6581 | 6581 | if ($filter) { |
| 6582 | - $sql .= " AND " . $filter; |
|
| 6582 | + $sql .= " AND ".$filter; |
|
| 6583 | 6583 | } |
| 6584 | 6584 | $resql = $this->db->query($sql); |
| 6585 | 6585 | if ($resql) { |
@@ -6589,7 +6589,7 @@ discard block |
||
| 6589 | 6589 | } |
| 6590 | 6590 | |
| 6591 | 6591 | $out = ''; |
| 6592 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6592 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6593 | 6593 | if ($useempty) { |
| 6594 | 6594 | $out .= '<option value=""> </option>'; |
| 6595 | 6595 | } |
@@ -6601,13 +6601,13 @@ discard block |
||
| 6601 | 6601 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6602 | 6602 | if (isset($TCurrency[$code_iso])) { |
| 6603 | 6603 | if (!empty($selected) && $selected == $code_iso) { |
| 6604 | - $out .= '<option value="' . $code_iso . '" selected="selected">'; |
|
| 6604 | + $out .= '<option value="'.$code_iso.'" selected="selected">'; |
|
| 6605 | 6605 | } else { |
| 6606 | - $out .= '<option value="' . $code_iso . '">'; |
|
| 6606 | + $out .= '<option value="'.$code_iso.'">'; |
|
| 6607 | 6607 | } |
| 6608 | 6608 | |
| 6609 | 6609 | $out .= $currency['label']; |
| 6610 | - $out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')'; |
|
| 6610 | + $out .= ' ('.$langs->getCurrencySymbol($code_iso).')'; |
|
| 6611 | 6611 | $out .= '</option>'; |
| 6612 | 6612 | } |
| 6613 | 6613 | } |
@@ -6616,7 +6616,7 @@ discard block |
||
| 6616 | 6616 | $out .= '</select>'; |
| 6617 | 6617 | |
| 6618 | 6618 | // Make select dynamic |
| 6619 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6619 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6620 | 6620 | $out .= ajax_combobox($htmlname); |
| 6621 | 6621 | |
| 6622 | 6622 | return $out; |
@@ -6647,7 +6647,7 @@ discard block |
||
| 6647 | 6647 | $sql .= " WHERE t.fk_pays = c.rowid"; |
| 6648 | 6648 | $sql .= " AND t.active > 0"; |
| 6649 | 6649 | $sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
| 6650 | - $sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")"; |
|
| 6650 | + $sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")"; |
|
| 6651 | 6651 | $sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC"; |
| 6652 | 6652 | |
| 6653 | 6653 | $resql = $this->db->query($sql); |
@@ -6659,30 +6659,30 @@ discard block |
||
| 6659 | 6659 | |
| 6660 | 6660 | $tmparray = array(); |
| 6661 | 6661 | $tmparray['rowid'] = $obj->rowid; |
| 6662 | - $tmparray['type_vat'] = $obj->type_vat; |
|
| 6663 | - $tmparray['code'] = $obj->code; |
|
| 6662 | + $tmparray['type_vat'] = $obj->type_vat; |
|
| 6663 | + $tmparray['code'] = $obj->code; |
|
| 6664 | 6664 | $tmparray['txtva'] = $obj->taux; |
| 6665 | - $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6665 | + $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6666 | 6666 | $tmparray['localtax1'] = $obj->localtax1; |
| 6667 | 6667 | $tmparray['localtax1_type'] = $obj->localtax1_type; |
| 6668 | 6668 | $tmparray['localtax2'] = $obj->localtax2; |
| 6669 | 6669 | $tmparray['localtax2_type'] = $obj->localtax1_type; |
| 6670 | - $tmparray['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6671 | - $tmparray['labelallrates'] = $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
| 6670 | + $tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6671 | + $tmparray['labelallrates'] = $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
| 6672 | 6672 | $positiverates = ''; |
| 6673 | 6673 | if ($obj->taux) { |
| 6674 | - $positiverates .= ($positiverates ? '/' : '') . $obj->taux; |
|
| 6674 | + $positiverates .= ($positiverates ? '/' : '').$obj->taux; |
|
| 6675 | 6675 | } |
| 6676 | 6676 | if ($obj->localtax1) { |
| 6677 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax1; |
|
| 6677 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax1; |
|
| 6678 | 6678 | } |
| 6679 | 6679 | if ($obj->localtax2) { |
| 6680 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax2; |
|
| 6680 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax2; |
|
| 6681 | 6681 | } |
| 6682 | 6682 | if (empty($positiverates)) { |
| 6683 | 6683 | $positiverates = '0'; |
| 6684 | 6684 | } |
| 6685 | - $tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
| 6685 | + $tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
| 6686 | 6686 | |
| 6687 | 6687 | $this->cache_vatrates[$obj->rowid] = $tmparray; |
| 6688 | 6688 | } |
@@ -6702,7 +6702,7 @@ discard block |
||
| 6702 | 6702 | return -1; |
| 6703 | 6703 | } |
| 6704 | 6704 | } else { |
| 6705 | - $this->error = '<span class="error">' . $this->db->error() . '</span>'; |
|
| 6705 | + $this->error = '<span class="error">'.$this->db->error().'</span>'; |
|
| 6706 | 6706 | return -2; |
| 6707 | 6707 | } |
| 6708 | 6708 | } |
@@ -6755,9 +6755,9 @@ discard block |
||
| 6755 | 6755 | // Check parameters |
| 6756 | 6756 | if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { |
| 6757 | 6757 | if ($societe_vendeuse->id == $mysoc->id) { |
| 6758 | - $return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>'; |
|
| 6758 | + $return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>'; |
|
| 6759 | 6759 | } else { |
| 6760 | - $return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>'; |
|
| 6760 | + $return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>'; |
|
| 6761 | 6761 | } |
| 6762 | 6762 | return $return; |
| 6763 | 6763 | } |
@@ -6769,12 +6769,12 @@ discard block |
||
| 6769 | 6769 | // Define list of countries to use to search VAT rates to show |
| 6770 | 6770 | // First we defined code_country to use to find list |
| 6771 | 6771 | if (is_object($societe_vendeuse)) { |
| 6772 | - $code_country = "'" . $societe_vendeuse->country_code . "'"; |
|
| 6772 | + $code_country = "'".$societe_vendeuse->country_code."'"; |
|
| 6773 | 6773 | } else { |
| 6774 | - $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente |
|
| 6774 | + $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente |
|
| 6775 | 6775 | } |
| 6776 | 6776 | if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on |
| 6777 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 6777 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 6778 | 6778 | // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries |
| 6779 | 6779 | // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country |
| 6780 | 6780 | $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); |
@@ -6784,27 +6784,27 @@ discard block |
||
| 6784 | 6784 | if ($type == 1) { // We know product is a service |
| 6785 | 6785 | switch ($selectVatComboMode) { |
| 6786 | 6786 | case '1': |
| 6787 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6787 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6788 | 6788 | break; |
| 6789 | 6789 | case '2': |
| 6790 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 6790 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 6791 | 6791 | break; |
| 6792 | 6792 | } |
| 6793 | 6793 | } |
| 6794 | 6794 | } elseif (!$idprod) { // We don't know type of product |
| 6795 | 6795 | switch ($selectVatComboMode) { |
| 6796 | 6796 | case '1': |
| 6797 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6797 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6798 | 6798 | break; |
| 6799 | 6799 | case '2': |
| 6800 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 6800 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 6801 | 6801 | break; |
| 6802 | 6802 | } |
| 6803 | 6803 | } else { |
| 6804 | 6804 | $prodstatic = new Product($this->db); |
| 6805 | 6805 | $prodstatic->fetch($idprod); |
| 6806 | 6806 | if ($prodstatic->type == Product::TYPE_SERVICE) { // We know product is a service |
| 6807 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6807 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6808 | 6808 | } |
| 6809 | 6809 | } |
| 6810 | 6810 | } |
@@ -6866,13 +6866,13 @@ discard block |
||
| 6866 | 6866 | // Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead |
| 6867 | 6867 | // of using supplier invoices (this is a very bad idea !) |
| 6868 | 6868 | if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) { |
| 6869 | - $title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"'; |
|
| 6869 | + $title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"'; |
|
| 6870 | 6870 | $disabled = true; |
| 6871 | 6871 | } |
| 6872 | 6872 | } |
| 6873 | 6873 | |
| 6874 | 6874 | if (!$options_only) { |
| 6875 | - $return .= '<select class="flat minwidth75imp maxwidth100 right" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>'; |
|
| 6875 | + $return .= '<select class="flat minwidth75imp maxwidth100 right" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>'; |
|
| 6876 | 6876 | } |
| 6877 | 6877 | |
| 6878 | 6878 | $selectedfound = false; |
@@ -6886,13 +6886,13 @@ discard block |
||
| 6886 | 6886 | $key = $rate['txtva']; |
| 6887 | 6887 | $key .= $rate['nprtva'] ? '*' : ''; |
| 6888 | 6888 | if ($mode > 0 && $rate['code']) { |
| 6889 | - $key .= ' (' . $rate['code'] . ')'; |
|
| 6889 | + $key .= ' ('.$rate['code'].')'; |
|
| 6890 | 6890 | } |
| 6891 | 6891 | if ($mode < 0) { |
| 6892 | 6892 | $key = $rate['rowid']; |
| 6893 | 6893 | } |
| 6894 | 6894 | |
| 6895 | - $return .= '<option value="' . $key . '"'; |
|
| 6895 | + $return .= '<option value="'.$key.'"'; |
|
| 6896 | 6896 | if (!$selectedfound) { |
| 6897 | 6897 | if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag |
| 6898 | 6898 | if ($defaultcode == $rate['code']) { |
@@ -6963,7 +6963,7 @@ discard block |
||
| 6963 | 6963 | public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = 0, $addplusone = '', $adddateof = '') |
| 6964 | 6964 | { |
| 6965 | 6965 | // phpcs:enable |
| 6966 | - dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6966 | + dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6967 | 6967 | $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); |
| 6968 | 6968 | if (!empty($nooutput)) { |
| 6969 | 6969 | return $retstring; |
@@ -6992,11 +6992,11 @@ discard block |
||
| 6992 | 6992 | { |
| 6993 | 6993 | global $langs; |
| 6994 | 6994 | |
| 6995 | - $ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6995 | + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6996 | 6996 | if ($forcenewline) { |
| 6997 | 6997 | $ret .= '<br>'; |
| 6998 | 6998 | } |
| 6999 | - $ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 6999 | + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 7000 | 7000 | return $ret; |
| 7001 | 7001 | } |
| 7002 | 7002 | |
@@ -7062,7 +7062,7 @@ discard block |
||
| 7062 | 7062 | $orig_set_time = $set_time; |
| 7063 | 7063 | |
| 7064 | 7064 | if ($set_time === '' && $emptydate == 0) { |
| 7065 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 7065 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 7066 | 7066 | if ($gm == 'tzuser' || $gm == 'tzuserrel') { |
| 7067 | 7067 | $set_time = dol_now($gm); |
| 7068 | 7068 | } else { |
@@ -7134,38 +7134,38 @@ discard block |
||
| 7134 | 7134 | // Calendrier popup version eldy |
| 7135 | 7135 | if ($usecalendar == "eldy") { |
| 7136 | 7136 | // Input area to enter date manually |
| 7137 | - $retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate center" maxlength="11" value="' . $formated_date . '"'; |
|
| 7137 | + $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"'; |
|
| 7138 | 7138 | $retstring .= ($disabled ? ' disabled' : ''); |
| 7139 | - $retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7139 | + $retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7140 | 7140 | $retstring .= ' autocomplete="off">'; |
| 7141 | 7141 | |
| 7142 | 7142 | // Icon calendar |
| 7143 | 7143 | $retstringbuttom = ''; |
| 7144 | 7144 | if (!$disabled) { |
| 7145 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"'; |
|
| 7146 | - $base = DOL_URL_ROOT . '/core/'; |
|
| 7147 | - $retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"'; |
|
| 7148 | - $retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 7145 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"'; |
|
| 7146 | + $base = DOL_URL_ROOT.'/core/'; |
|
| 7147 | + $retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"'; |
|
| 7148 | + $retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 7149 | 7149 | } else { |
| 7150 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 7150 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 7151 | 7151 | } |
| 7152 | - $retstring = $retstringbuttom . $retstring; |
|
| 7152 | + $retstring = $retstringbuttom.$retstring; |
|
| 7153 | 7153 | |
| 7154 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 7155 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 7156 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 7154 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 7155 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 7156 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 7157 | 7157 | } elseif ($usecalendar == 'jquery' || $usecalendar == 'html') { |
| 7158 | 7158 | if (!$disabled && $usecalendar != 'html') { |
| 7159 | 7159 | // Output javascript for datepicker |
| 7160 | 7160 | $minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100)); |
| 7161 | 7161 | $maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100)); |
| 7162 | 7162 | |
| 7163 | - $retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">'; |
|
| 7164 | - $retstring .= "$(function(){ $('#" . $prefix . "').datepicker({ |
|
| 7165 | - dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "', |
|
| 7163 | + $retstring .= '<script nonce="'.getNonce().'" type="text/javascript">'; |
|
| 7164 | + $retstring .= "$(function(){ $('#".$prefix."').datepicker({ |
|
| 7165 | + dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."', |
|
| 7166 | 7166 | autoclose: true, |
| 7167 | 7167 | todayHighlight: true, |
| 7168 | - yearRange: '" . $minYear . ":" . $maxYear . "',"; |
|
| 7168 | + yearRange: '" . $minYear.":".$maxYear."',"; |
|
| 7169 | 7169 | if (!empty($conf->dol_use_jmobile)) { |
| 7170 | 7170 | $retstring .= " |
| 7171 | 7171 | beforeShow: function (input, datePicker) { |
@@ -7180,7 +7180,7 @@ discard block |
||
| 7180 | 7180 | if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) { |
| 7181 | 7181 | $retstring .= " |
| 7182 | 7182 | showOn: 'button', /* both has problem with autocompletion */ |
| 7183 | - buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png', |
|
| 7183 | + buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png', |
|
| 7184 | 7184 | buttonImageOnly: true"; |
| 7185 | 7185 | } |
| 7186 | 7186 | $retstring .= " |
@@ -7192,46 +7192,46 @@ discard block |
||
| 7192 | 7192 | $retstring .= '<div class="nowraponall inline-block divfordateinput">'; |
| 7193 | 7193 | $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"'; |
| 7194 | 7194 | $retstring .= ($disabled ? ' disabled' : ''); |
| 7195 | - $retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : ''); |
|
| 7196 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7195 | + $retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : ''); |
|
| 7196 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7197 | 7197 | $retstring .= ' autocomplete="off">'; |
| 7198 | 7198 | |
| 7199 | 7199 | // Icone calendrier |
| 7200 | 7200 | if ($disabled) { |
| 7201 | - $retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 7202 | - $retstring = $retstringbutton . $retstring; |
|
| 7201 | + $retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 7202 | + $retstring = $retstringbutton.$retstring; |
|
| 7203 | 7203 | } |
| 7204 | 7204 | |
| 7205 | 7205 | $retstring .= '</div>'; |
| 7206 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 7207 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 7208 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 7206 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 7207 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 7208 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 7209 | 7209 | } else { |
| 7210 | 7210 | $retstring .= "Bad value of MAIN_POPUP_CALENDAR"; |
| 7211 | 7211 | } |
| 7212 | 7212 | } else { |
| 7213 | 7213 | // Show date with combo selects |
| 7214 | 7214 | // Day |
| 7215 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">'; |
|
| 7215 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">'; |
|
| 7216 | 7216 | |
| 7217 | 7217 | if ($emptydate || $set_time == -1) { |
| 7218 | 7218 | $retstring .= '<option value="0" selected> </option>'; |
| 7219 | 7219 | } |
| 7220 | 7220 | |
| 7221 | 7221 | for ($day = 1; $day <= 31; $day++) { |
| 7222 | - $retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>'; |
|
| 7222 | + $retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>'; |
|
| 7223 | 7223 | } |
| 7224 | 7224 | |
| 7225 | 7225 | $retstring .= "</select>"; |
| 7226 | 7226 | |
| 7227 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">'; |
|
| 7227 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">'; |
|
| 7228 | 7228 | if ($emptydate || $set_time == -1) { |
| 7229 | 7229 | $retstring .= '<option value="0" selected> </option>'; |
| 7230 | 7230 | } |
| 7231 | 7231 | |
| 7232 | 7232 | // Month |
| 7233 | 7233 | for ($month = 1; $month <= 12; $month++) { |
| 7234 | - $retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>'; |
|
| 7234 | + $retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>'; |
|
| 7235 | 7235 | $retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b"); |
| 7236 | 7236 | $retstring .= "</option>"; |
| 7237 | 7237 | } |
@@ -7239,13 +7239,13 @@ discard block |
||
| 7239 | 7239 | |
| 7240 | 7240 | // Year |
| 7241 | 7241 | if ($emptydate || $set_time == -1) { |
| 7242 | - $retstring .= '<input' . ($disabled ? ' disabled' : '') . ' placeholder="' . dol_escape_htmltag($langs->trans("Year")) . '" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">'; |
|
| 7242 | + $retstring .= '<input'.($disabled ? ' disabled' : '').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'; |
|
| 7243 | 7243 | } else { |
| 7244 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">'; |
|
| 7244 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">'; |
|
| 7245 | 7245 | |
| 7246 | 7246 | $syear = (int) $syear; |
| 7247 | 7247 | for ($year = $syear - 10; $year < (int) $syear + 10; $year++) { |
| 7248 | - $retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>'; |
|
| 7248 | + $retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>'; |
|
| 7249 | 7249 | } |
| 7250 | 7250 | $retstring .= "</select>\n"; |
| 7251 | 7251 | } |
@@ -7269,15 +7269,15 @@ discard block |
||
| 7269 | 7269 | } |
| 7270 | 7270 | } |
| 7271 | 7271 | // Show hour |
| 7272 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">'; |
|
| 7272 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; |
|
| 7273 | 7273 | if ($emptyhours) { |
| 7274 | 7274 | $retstring .= '<option value="-1"> </option>'; |
| 7275 | 7275 | } |
| 7276 | 7276 | for ($hour = $hourstart; $hour < $hourend; $hour++) { |
| 7277 | 7277 | if (strlen($hour) < 2) { |
| 7278 | - $hour = "0" . $hour; |
|
| 7278 | + $hour = "0".$hour; |
|
| 7279 | 7279 | } |
| 7280 | - $retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour; |
|
| 7280 | + $retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour; |
|
| 7281 | 7281 | //$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H'); |
| 7282 | 7282 | $retstring .= '</option>'; |
| 7283 | 7283 | } |
@@ -7290,17 +7290,17 @@ discard block |
||
| 7290 | 7290 | |
| 7291 | 7291 | if ($m) { |
| 7292 | 7292 | // Show minutes |
| 7293 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">'; |
|
| 7293 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">'; |
|
| 7294 | 7294 | if ($emptyhours) { |
| 7295 | 7295 | $retstring .= '<option value="-1"> </option>'; |
| 7296 | 7296 | } |
| 7297 | 7297 | for ($min = 0; $min < 60; $min += $stepminutes) { |
| 7298 | 7298 | $min_str = sprintf("%02d", $min); |
| 7299 | - $retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>'; |
|
| 7299 | + $retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>'; |
|
| 7300 | 7300 | } |
| 7301 | 7301 | $retstring .= '</select>'; |
| 7302 | 7302 | |
| 7303 | - $retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">'; |
|
| 7303 | + $retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">'; |
|
| 7304 | 7304 | } |
| 7305 | 7305 | |
| 7306 | 7306 | if ($d && $h) { |
@@ -7323,10 +7323,10 @@ discard block |
||
| 7323 | 7323 | |
| 7324 | 7324 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7325 | 7325 | if ($addnowlink == 1) { // server time expressed in user time setup |
| 7326 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7327 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7328 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7329 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7326 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7327 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7328 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7329 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7330 | 7330 | } elseif ($addnowlink == 2) { |
| 7331 | 7331 | /* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix. |
| 7332 | 7332 | * This break application for foreign languages. |
@@ -7335,10 +7335,10 @@ discard block |
||
| 7335 | 7335 | $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);'; |
| 7336 | 7336 | $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());'; |
| 7337 | 7337 | */ |
| 7338 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7339 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7340 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7341 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7338 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7339 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7340 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7341 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7342 | 7342 | } |
| 7343 | 7343 | /*if ($usecalendar == "eldy") |
| 7344 | 7344 | { |
@@ -7358,11 +7358,11 @@ discard block |
||
| 7358 | 7358 | } |
| 7359 | 7359 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; |
| 7360 | 7360 | if ($addnowlink == 1) { |
| 7361 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7362 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7361 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7362 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7363 | 7363 | } elseif ($addnowlink == 2) { |
| 7364 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());'; |
|
| 7365 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7364 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; |
|
| 7365 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7366 | 7366 | } |
| 7367 | 7367 | |
| 7368 | 7368 | if ($fullday) { |
@@ -7376,11 +7376,11 @@ discard block |
||
| 7376 | 7376 | } |
| 7377 | 7377 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; |
| 7378 | 7378 | if ($addnowlink == 1) { |
| 7379 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7380 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7379 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7380 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7381 | 7381 | } elseif ($addnowlink == 2) { |
| 7382 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());'; |
|
| 7383 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7382 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; |
|
| 7383 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7384 | 7384 | } |
| 7385 | 7385 | if ($fullday) { |
| 7386 | 7386 | $reset_scripts .= ' } '; |
@@ -7388,7 +7388,7 @@ discard block |
||
| 7388 | 7388 | } |
| 7389 | 7389 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7390 | 7390 | if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 7391 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">'; |
|
| 7391 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">'; |
|
| 7392 | 7392 | $retstring .= $langs->trans("Now"); |
| 7393 | 7393 | $retstring .= '</button> '; |
| 7394 | 7394 | } |
@@ -7400,16 +7400,16 @@ discard block |
||
| 7400 | 7400 | $reset_scripts = ""; |
| 7401 | 7401 | |
| 7402 | 7402 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7403 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');'; |
|
| 7404 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7405 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7406 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7403 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');'; |
|
| 7404 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7405 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7406 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7407 | 7407 | // Update the hour part |
| 7408 | 7408 | if ($h) { |
| 7409 | 7409 | if ($fullday) { |
| 7410 | 7410 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7411 | 7411 | } |
| 7412 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7412 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7413 | 7413 | if ($fullday) { |
| 7414 | 7414 | $reset_scripts .= ' } '; |
| 7415 | 7415 | } |
@@ -7419,14 +7419,14 @@ discard block |
||
| 7419 | 7419 | if ($fullday) { |
| 7420 | 7420 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7421 | 7421 | } |
| 7422 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7422 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7423 | 7423 | if ($fullday) { |
| 7424 | 7424 | $reset_scripts .= ' } '; |
| 7425 | 7425 | } |
| 7426 | 7426 | } |
| 7427 | 7427 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7428 | 7428 | if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { |
| 7429 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">'; |
|
| 7429 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">'; |
|
| 7430 | 7430 | $retstring .= $langs->trans("DateStartPlusOne"); |
| 7431 | 7431 | $retstring .= '</button> '; |
| 7432 | 7432 | } |
@@ -7484,17 +7484,17 @@ discard block |
||
| 7484 | 7484 | unset($TDurationTypes[$value]); |
| 7485 | 7485 | } |
| 7486 | 7486 | |
| 7487 | - $retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">'; |
|
| 7487 | + $retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; |
|
| 7488 | 7488 | foreach ($TDurationTypes as $key => $typeduration) { |
| 7489 | - $retstring .= '<option value="' . $key . '"'; |
|
| 7489 | + $retstring .= '<option value="'.$key.'"'; |
|
| 7490 | 7490 | if ($key == $selected) { |
| 7491 | 7491 | $retstring .= " selected"; |
| 7492 | 7492 | } |
| 7493 | - $retstring .= ">" . $typeduration . "</option>"; |
|
| 7493 | + $retstring .= ">".$typeduration."</option>"; |
|
| 7494 | 7494 | } |
| 7495 | 7495 | $retstring .= "</select>"; |
| 7496 | 7496 | |
| 7497 | - $retstring .= ajax_combobox('select_' . $prefix . 'type_duration'); |
|
| 7497 | + $retstring .= ajax_combobox('select_'.$prefix.'type_duration'); |
|
| 7498 | 7498 | |
| 7499 | 7499 | return $retstring; |
| 7500 | 7500 | } |
@@ -7526,30 +7526,30 @@ discard block |
||
| 7526 | 7526 | |
| 7527 | 7527 | // Hours |
| 7528 | 7528 | if ($iSecond != '') { |
| 7529 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 7529 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 7530 | 7530 | |
| 7531 | 7531 | $hourSelected = convertSecondToTime($iSecond, 'allhour'); |
| 7532 | 7532 | $minSelected = convertSecondToTime($iSecond, 'min'); |
| 7533 | 7533 | } |
| 7534 | 7534 | |
| 7535 | 7535 | if ($typehour == 'select') { |
| 7536 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7536 | + $retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>'; |
|
| 7537 | 7537 | for ($hour = 0; $hour < 25; $hour++) { // For a duration, we allow 24 hours |
| 7538 | - $retstring .= '<option value="' . $hour . '"'; |
|
| 7538 | + $retstring .= '<option value="'.$hour.'"'; |
|
| 7539 | 7539 | if (is_numeric($hourSelected) && $hourSelected == $hour) { |
| 7540 | 7540 | $retstring .= " selected"; |
| 7541 | 7541 | } |
| 7542 | - $retstring .= ">" . $hour . "</option>"; |
|
| 7542 | + $retstring .= ">".$hour."</option>"; |
|
| 7543 | 7543 | } |
| 7544 | 7544 | $retstring .= "</select>"; |
| 7545 | 7545 | } elseif ($typehour == 'text' || $typehour == 'textselect') { |
| 7546 | - $retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">'; |
|
| 7546 | + $retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">'; |
|
| 7547 | 7547 | } else { |
| 7548 | 7548 | return 'BadValueForParameterTypeHour'; |
| 7549 | 7549 | } |
| 7550 | 7550 | |
| 7551 | 7551 | if ($typehour != 'text') { |
| 7552 | - $retstring .= ' ' . $langs->trans('HourShort'); |
|
| 7552 | + $retstring .= ' '.$langs->trans('HourShort'); |
|
| 7553 | 7553 | } else { |
| 7554 | 7554 | $retstring .= '<span class="">:</span>'; |
| 7555 | 7555 | } |
@@ -7564,21 +7564,21 @@ discard block |
||
| 7564 | 7564 | } |
| 7565 | 7565 | |
| 7566 | 7566 | if ($typehour == 'select' || $typehour == 'textselect') { |
| 7567 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7567 | + $retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>'; |
|
| 7568 | 7568 | for ($min = 0; $min <= 55; $min += 5) { |
| 7569 | - $retstring .= '<option value="' . $min . '"'; |
|
| 7569 | + $retstring .= '<option value="'.$min.'"'; |
|
| 7570 | 7570 | if (is_numeric($minSelected) && $minSelected == $min) { |
| 7571 | 7571 | $retstring .= ' selected'; |
| 7572 | 7572 | } |
| 7573 | - $retstring .= '>' . $min . '</option>'; |
|
| 7573 | + $retstring .= '>'.$min.'</option>'; |
|
| 7574 | 7574 | } |
| 7575 | 7575 | $retstring .= "</select>"; |
| 7576 | 7576 | } elseif ($typehour == 'text') { |
| 7577 | - $retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">'; |
|
| 7577 | + $retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">'; |
|
| 7578 | 7578 | } |
| 7579 | 7579 | |
| 7580 | 7580 | if ($typehour != 'text') { |
| 7581 | - $retstring .= ' ' . $langs->trans('MinuteShort'); |
|
| 7581 | + $retstring .= ' '.$langs->trans('MinuteShort'); |
|
| 7582 | 7582 | } |
| 7583 | 7583 | |
| 7584 | 7584 | $retstring .= "</span>"; |
@@ -7626,7 +7626,7 @@ discard block |
||
| 7626 | 7626 | $placeholder = ''; |
| 7627 | 7627 | |
| 7628 | 7628 | if ($selected && empty($selected_input_value)) { |
| 7629 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7629 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7630 | 7630 | $tickettmpselect = new Ticket($this->db); |
| 7631 | 7631 | $tickettmpselect->fetch($selected); |
| 7632 | 7632 | $selected_input_value = $tickettmpselect->ref; |
@@ -7634,17 +7634,17 @@ discard block |
||
| 7634 | 7634 | } |
| 7635 | 7635 | |
| 7636 | 7636 | $urloption = ''; |
| 7637 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7637 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7638 | 7638 | |
| 7639 | 7639 | if (empty($hidelabel)) { |
| 7640 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7640 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7641 | 7641 | } elseif ($hidelabel > 1) { |
| 7642 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7642 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7643 | 7643 | if ($hidelabel == 2) { |
| 7644 | 7644 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7645 | 7645 | } |
| 7646 | 7646 | } |
| 7647 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7647 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7648 | 7648 | if ($hidelabel == 3) { |
| 7649 | 7649 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7650 | 7650 | } |
@@ -7688,8 +7688,8 @@ discard block |
||
| 7688 | 7688 | |
| 7689 | 7689 | $sql = "SELECT "; |
| 7690 | 7690 | $sql .= $selectFields; |
| 7691 | - $sql .= " FROM " . $this->db->prefix() . "ticket as p"; |
|
| 7692 | - $sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')'; |
|
| 7691 | + $sql .= " FROM ".$this->db->prefix()."ticket as p"; |
|
| 7692 | + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; |
|
| 7693 | 7693 | |
| 7694 | 7694 | // Add criteria on ref/label |
| 7695 | 7695 | if ($filterkey != '') { |
@@ -7705,7 +7705,7 @@ discard block |
||
| 7705 | 7705 | if ($i > 0) { |
| 7706 | 7706 | $sql .= " AND "; |
| 7707 | 7707 | } |
| 7708 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7708 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7709 | 7709 | $sql .= ")"; |
| 7710 | 7710 | $i++; |
| 7711 | 7711 | } |
@@ -7718,22 +7718,22 @@ discard block |
||
| 7718 | 7718 | $sql .= $this->db->plimit($limit, 0); |
| 7719 | 7719 | |
| 7720 | 7720 | // Build output string |
| 7721 | - dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7721 | + dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7722 | 7722 | $result = $this->db->query($sql); |
| 7723 | 7723 | if ($result) { |
| 7724 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7725 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; |
|
| 7724 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7725 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; |
|
| 7726 | 7726 | |
| 7727 | 7727 | $num = $this->db->num_rows($result); |
| 7728 | 7728 | |
| 7729 | 7729 | $events = array(); |
| 7730 | 7730 | |
| 7731 | 7731 | if (!$forcecombo) { |
| 7732 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7732 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7733 | 7733 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt('TICKET_USE_SEARCH_TO_SELECT')); |
| 7734 | 7734 | } |
| 7735 | 7735 | |
| 7736 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7736 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7737 | 7737 | |
| 7738 | 7738 | $textifempty = ''; |
| 7739 | 7739 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7750,7 +7750,7 @@ discard block |
||
| 7750 | 7750 | } |
| 7751 | 7751 | } |
| 7752 | 7752 | if ($showempty) { |
| 7753 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7753 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7754 | 7754 | } |
| 7755 | 7755 | |
| 7756 | 7756 | $i = 0; |
@@ -7804,13 +7804,13 @@ discard block |
||
| 7804 | 7804 | $outkey = $objp->rowid; |
| 7805 | 7805 | $outref = $objp->ref; |
| 7806 | 7806 | |
| 7807 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 7807 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 7808 | 7808 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 7809 | 7809 | $opt .= '>'; |
| 7810 | 7810 | $opt .= $objp->ref; |
| 7811 | 7811 | $objRef = $objp->ref; |
| 7812 | 7812 | if (!empty($filterkey) && $filterkey != '') { |
| 7813 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7813 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7814 | 7814 | } |
| 7815 | 7815 | |
| 7816 | 7816 | $opt .= "</option>\n"; |
@@ -7851,7 +7851,7 @@ discard block |
||
| 7851 | 7851 | $placeholder = ''; |
| 7852 | 7852 | |
| 7853 | 7853 | if ($selected && empty($selected_input_value)) { |
| 7854 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7854 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7855 | 7855 | $projecttmpselect = new Project($this->db); |
| 7856 | 7856 | $projecttmpselect->fetch($selected); |
| 7857 | 7857 | $selected_input_value = $projecttmpselect->ref; |
@@ -7859,17 +7859,17 @@ discard block |
||
| 7859 | 7859 | } |
| 7860 | 7860 | |
| 7861 | 7861 | $urloption = ''; |
| 7862 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7862 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7863 | 7863 | |
| 7864 | 7864 | if (empty($hidelabel)) { |
| 7865 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7865 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7866 | 7866 | } elseif ($hidelabel > 1) { |
| 7867 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7867 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7868 | 7868 | if ($hidelabel == 2) { |
| 7869 | 7869 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7870 | 7870 | } |
| 7871 | 7871 | } |
| 7872 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7872 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7873 | 7873 | if ($hidelabel == 3) { |
| 7874 | 7874 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7875 | 7875 | } |
@@ -7912,8 +7912,8 @@ discard block |
||
| 7912 | 7912 | |
| 7913 | 7913 | $sql = "SELECT "; |
| 7914 | 7914 | $sql .= $selectFields; |
| 7915 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
| 7916 | - $sql .= ' WHERE p.entity IN (' . getEntity('project') . ')'; |
|
| 7915 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
| 7916 | + $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; |
|
| 7917 | 7917 | |
| 7918 | 7918 | // Add criteria on ref/label |
| 7919 | 7919 | if ($filterkey != '') { |
@@ -7929,7 +7929,7 @@ discard block |
||
| 7929 | 7929 | if ($i > 0) { |
| 7930 | 7930 | $sql .= " AND "; |
| 7931 | 7931 | } |
| 7932 | - $sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7932 | + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7933 | 7933 | $sql .= ""; |
| 7934 | 7934 | $i++; |
| 7935 | 7935 | } |
@@ -7942,22 +7942,22 @@ discard block |
||
| 7942 | 7942 | $sql .= $this->db->plimit($limit, 0); |
| 7943 | 7943 | |
| 7944 | 7944 | // Build output string |
| 7945 | - dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG); |
|
| 7945 | + dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); |
|
| 7946 | 7946 | $result = $this->db->query($sql); |
| 7947 | 7947 | if ($result) { |
| 7948 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7949 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 7948 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7949 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 7950 | 7950 | |
| 7951 | 7951 | $num = $this->db->num_rows($result); |
| 7952 | 7952 | |
| 7953 | 7953 | $events = array(); |
| 7954 | 7954 | |
| 7955 | 7955 | if (!$forcecombo) { |
| 7956 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7956 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7957 | 7957 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT')); |
| 7958 | 7958 | } |
| 7959 | 7959 | |
| 7960 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7960 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7961 | 7961 | |
| 7962 | 7962 | $textifempty = ''; |
| 7963 | 7963 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7974,7 +7974,7 @@ discard block |
||
| 7974 | 7974 | } |
| 7975 | 7975 | } |
| 7976 | 7976 | if ($showempty) { |
| 7977 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7977 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7978 | 7978 | } |
| 7979 | 7979 | |
| 7980 | 7980 | $i = 0; |
@@ -8032,13 +8032,13 @@ discard block |
||
| 8032 | 8032 | $outlabel = $objp->label; |
| 8033 | 8033 | $outtype = $objp->fk_product_type; |
| 8034 | 8034 | |
| 8035 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 8035 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 8036 | 8036 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 8037 | 8037 | $opt .= '>'; |
| 8038 | 8038 | $opt .= $objp->ref; |
| 8039 | 8039 | $objRef = $objp->ref; |
| 8040 | 8040 | if (!empty($filterkey) && $filterkey != '') { |
| 8041 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 8041 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 8042 | 8042 | } |
| 8043 | 8043 | |
| 8044 | 8044 | $opt .= "</option>\n"; |
@@ -8080,7 +8080,7 @@ discard block |
||
| 8080 | 8080 | $placeholder = ''; |
| 8081 | 8081 | |
| 8082 | 8082 | if ($selected && empty($selected_input_value)) { |
| 8083 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 8083 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 8084 | 8084 | $adherenttmpselect = new Adherent($this->db); |
| 8085 | 8085 | $adherenttmpselect->fetch($selected); |
| 8086 | 8086 | $selected_input_value = $adherenttmpselect->ref; |
@@ -8089,17 +8089,17 @@ discard block |
||
| 8089 | 8089 | |
| 8090 | 8090 | $urloption = ''; |
| 8091 | 8091 | |
| 8092 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 8092 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 8093 | 8093 | |
| 8094 | 8094 | if (empty($hidelabel)) { |
| 8095 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 8095 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 8096 | 8096 | } elseif ($hidelabel > 1) { |
| 8097 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 8097 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 8098 | 8098 | if ($hidelabel == 2) { |
| 8099 | 8099 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 8100 | 8100 | } |
| 8101 | 8101 | } |
| 8102 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 8102 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 8103 | 8103 | if ($hidelabel == 3) { |
| 8104 | 8104 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 8105 | 8105 | } |
@@ -8144,8 +8144,8 @@ discard block |
||
| 8144 | 8144 | |
| 8145 | 8145 | $sql = "SELECT "; |
| 8146 | 8146 | $sql .= $selectFields; |
| 8147 | - $sql .= " FROM " . $this->db->prefix() . "adherent as p"; |
|
| 8148 | - $sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')'; |
|
| 8147 | + $sql .= " FROM ".$this->db->prefix()."adherent as p"; |
|
| 8148 | + $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; |
|
| 8149 | 8149 | |
| 8150 | 8150 | // Add criteria on ref/label |
| 8151 | 8151 | if ($filterkey != '') { |
@@ -8161,8 +8161,8 @@ discard block |
||
| 8161 | 8161 | if ($i > 0) { |
| 8162 | 8162 | $sql .= " AND "; |
| 8163 | 8163 | } |
| 8164 | - $sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 8165 | - $sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 8164 | + $sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 8165 | + $sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 8166 | 8166 | $i++; |
| 8167 | 8167 | } |
| 8168 | 8168 | if (count($search_crit) > 1) { |
@@ -8171,27 +8171,27 @@ discard block |
||
| 8171 | 8171 | $sql .= ')'; |
| 8172 | 8172 | } |
| 8173 | 8173 | if ($status != -1) { |
| 8174 | - $sql .= ' AND statut = ' . ((int) $status); |
|
| 8174 | + $sql .= ' AND statut = '.((int) $status); |
|
| 8175 | 8175 | } |
| 8176 | 8176 | $sql .= $this->db->plimit($limit, 0); |
| 8177 | 8177 | |
| 8178 | 8178 | // Build output string |
| 8179 | - dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG); |
|
| 8179 | + dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); |
|
| 8180 | 8180 | $result = $this->db->query($sql); |
| 8181 | 8181 | if ($result) { |
| 8182 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 8183 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php'; |
|
| 8182 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 8183 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; |
|
| 8184 | 8184 | |
| 8185 | 8185 | $num = $this->db->num_rows($result); |
| 8186 | 8186 | |
| 8187 | 8187 | $events = array(); |
| 8188 | 8188 | |
| 8189 | 8189 | if (!$forcecombo) { |
| 8190 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8190 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8191 | 8191 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); |
| 8192 | 8192 | } |
| 8193 | 8193 | |
| 8194 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 8194 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 8195 | 8195 | |
| 8196 | 8196 | $textifempty = ''; |
| 8197 | 8197 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -8208,7 +8208,7 @@ discard block |
||
| 8208 | 8208 | } |
| 8209 | 8209 | } |
| 8210 | 8210 | if ($showempty) { |
| 8211 | - $out .= '<option value="-1" selected>' . $textifempty . '</option>'; |
|
| 8211 | + $out .= '<option value="-1" selected>'.$textifempty.'</option>'; |
|
| 8212 | 8212 | } |
| 8213 | 8213 | |
| 8214 | 8214 | $i = 0; |
@@ -8264,11 +8264,11 @@ discard block |
||
| 8264 | 8264 | $outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname); |
| 8265 | 8265 | $outtype = $objp->fk_adherent_type; |
| 8266 | 8266 | |
| 8267 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 8267 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 8268 | 8268 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 8269 | 8269 | $opt .= '>'; |
| 8270 | 8270 | if (!empty($filterkey) && $filterkey != '') { |
| 8271 | - $outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8271 | + $outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8272 | 8272 | } |
| 8273 | 8273 | $opt .= $outlabel; |
| 8274 | 8274 | $opt .= "</option>\n"; |
@@ -8323,8 +8323,8 @@ discard block |
||
| 8323 | 8323 | $objecttmp = null; |
| 8324 | 8324 | $InfoFieldList = array(); |
| 8325 | 8325 | $classname = ''; |
| 8326 | - $filter = ''; // Ensure filter has value (for static analysis) |
|
| 8327 | - $sortfield = ''; // Ensure filter has value (for static analysis) |
|
| 8326 | + $filter = ''; // Ensure filter has value (for static analysis) |
|
| 8327 | + $sortfield = ''; // Ensure filter has value (for static analysis) |
|
| 8328 | 8328 | |
| 8329 | 8329 | if ($objectfield) { // We must retrieve the objectdesc from the field or extrafield |
| 8330 | 8330 | // Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield' |
@@ -8368,9 +8368,9 @@ discard block |
||
| 8368 | 8368 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
| 8369 | 8369 | $reg = array(); |
| 8370 | 8370 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
| 8371 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8371 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8372 | 8372 | } |
| 8373 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8373 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8374 | 8374 | |
| 8375 | 8375 | $classname = $InfoFieldList[0]; |
| 8376 | 8376 | $classpath = empty($InfoFieldList[1]) ? '' : $InfoFieldList[1]; |
@@ -8401,8 +8401,8 @@ discard block |
||
| 8401 | 8401 | ); |
| 8402 | 8402 | |
| 8403 | 8403 | if (!is_object($objecttmp)) { |
| 8404 | - dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING); |
|
| 8405 | - return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc; |
|
| 8404 | + dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING); |
|
| 8405 | + return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc; |
|
| 8406 | 8406 | } |
| 8407 | 8407 | '@phan-var-force CommonObject $objecttmp'; |
| 8408 | 8408 | |
@@ -8414,9 +8414,9 @@ discard block |
||
| 8414 | 8414 | if ($prefixforautocompletemode == 'product') { |
| 8415 | 8415 | $prefixforautocompletemode = 'produit'; |
| 8416 | 8416 | } |
| 8417 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8417 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8418 | 8418 | |
| 8419 | - dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG); |
|
| 8419 | + dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG); |
|
| 8420 | 8420 | |
| 8421 | 8421 | // Generate the combo HTML component |
| 8422 | 8422 | $out = ''; |
@@ -8445,13 +8445,13 @@ discard block |
||
| 8445 | 8445 | } |
| 8446 | 8446 | |
| 8447 | 8447 | // Set url and param to call to get json of the search results |
| 8448 | - $urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php'; |
|
| 8449 | - $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); |
|
| 8448 | + $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; |
|
| 8449 | + $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : ''); |
|
| 8450 | 8450 | |
| 8451 | 8451 | // Activate the auto complete using ajax call. |
| 8452 | 8452 | $out .= ajax_autocompleter((string) $preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalInt($confkeyforautocompletemode), 0); |
| 8453 | 8453 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 8454 | - $out .= '<input type="text" class="' . $morecss . '"' . ($disabled ? ' disabled="disabled"' : '') . ' name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' />'; |
|
| 8454 | + $out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' />'; |
|
| 8455 | 8455 | } else { |
| 8456 | 8456 | // Immediate load of table record. |
| 8457 | 8457 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -8491,16 +8491,16 @@ discard block |
||
| 8491 | 8491 | if ($prefixforautocompletemode == 'societe') { |
| 8492 | 8492 | $prefixforautocompletemode = 'company'; |
| 8493 | 8493 | } |
| 8494 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8494 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8495 | 8495 | |
| 8496 | 8496 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
| 8497 | 8497 | $tmpfieldstoshow = ''; |
| 8498 | 8498 | foreach ($objecttmp->fields as $key => $val) { |
| 8499 | - if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 8499 | + if (!(int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 8500 | 8500 | continue; |
| 8501 | 8501 | } |
| 8502 | 8502 | if (!empty($val['showoncombobox'])) { |
| 8503 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
| 8503 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
| 8504 | 8504 | } |
| 8505 | 8505 | } |
| 8506 | 8506 | if ($tmpfieldstoshow) { |
@@ -8528,18 +8528,18 @@ discard block |
||
| 8528 | 8528 | $num = 0; |
| 8529 | 8529 | |
| 8530 | 8530 | // Search data |
| 8531 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
| 8531 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
| 8532 | 8532 | if (!empty($objecttmp->isextrafieldmanaged)) { |
| 8533 | - $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8533 | + $sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8534 | 8534 | } |
| 8535 | 8535 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8536 | 8536 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8537 | 8537 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
| 8538 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
| 8538 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
| 8539 | 8539 | } |
| 8540 | 8540 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8541 | 8541 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8542 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 8542 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 8543 | 8543 | } |
| 8544 | 8544 | } |
| 8545 | 8545 | } |
@@ -8559,21 +8559,21 @@ discard block |
||
| 8559 | 8559 | $sql .= " WHERE 1=1"; |
| 8560 | 8560 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8561 | 8561 | if ($objecttmp->ismultientitymanaged == 1) { |
| 8562 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
| 8562 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
| 8563 | 8563 | } |
| 8564 | 8564 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8565 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
| 8565 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
| 8566 | 8566 | } |
| 8567 | 8567 | if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { |
| 8568 | 8568 | if ($objecttmp->element == 'societe') { |
| 8569 | - $sql .= " AND t.rowid = " . ((int) $user->socid); |
|
| 8569 | + $sql .= " AND t.rowid = ".((int) $user->socid); |
|
| 8570 | 8570 | } else { |
| 8571 | - $sql .= " AND t.fk_soc = " . ((int) $user->socid); |
|
| 8571 | + $sql .= " AND t.fk_soc = ".((int) $user->socid); |
|
| 8572 | 8572 | } |
| 8573 | 8573 | } |
| 8574 | 8574 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8575 | 8575 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8576 | - $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 8576 | + $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 8577 | 8577 | } |
| 8578 | 8578 | } |
| 8579 | 8579 | } |
@@ -8585,7 +8585,7 @@ discard block |
||
| 8585 | 8585 | $errormessage = ''; |
| 8586 | 8586 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
| 8587 | 8587 | if ($errormessage) { |
| 8588 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
| 8588 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
| 8589 | 8589 | } |
| 8590 | 8590 | } |
| 8591 | 8591 | } |
@@ -8597,7 +8597,7 @@ discard block |
||
| 8597 | 8597 | $resql = $this->db->query($sql); |
| 8598 | 8598 | if ($resql) { |
| 8599 | 8599 | // Construct $out and $outarray |
| 8600 | - $out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
| 8600 | + $out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
| 8601 | 8601 | |
| 8602 | 8602 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
| 8603 | 8603 | $textifempty = ' '; |
@@ -8611,7 +8611,7 @@ discard block |
||
| 8611 | 8611 | } |
| 8612 | 8612 | } |
| 8613 | 8613 | if ($showempty) { |
| 8614 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
| 8614 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
| 8615 | 8615 | } |
| 8616 | 8616 | |
| 8617 | 8617 | $num = $this->db->num_rows($resql); |
@@ -8634,9 +8634,9 @@ discard block |
||
| 8634 | 8634 | } |
| 8635 | 8635 | if (empty($outputmode)) { |
| 8636 | 8636 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
| 8637 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 8637 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 8638 | 8638 | } else { |
| 8639 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 8639 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 8640 | 8640 | } |
| 8641 | 8641 | } else { |
| 8642 | 8642 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -8649,10 +8649,10 @@ discard block |
||
| 8649 | 8649 | } |
| 8650 | 8650 | } |
| 8651 | 8651 | |
| 8652 | - $out .= '</select>' . "\n"; |
|
| 8652 | + $out .= '</select>'."\n"; |
|
| 8653 | 8653 | |
| 8654 | 8654 | if (!$forcecombo) { |
| 8655 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8655 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8656 | 8656 | $out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0)); |
| 8657 | 8657 | } |
| 8658 | 8658 | } else { |
@@ -8716,8 +8716,8 @@ discard block |
||
| 8716 | 8716 | } |
| 8717 | 8717 | } |
| 8718 | 8718 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
| 8719 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"'; |
|
| 8720 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : ''); |
|
| 8719 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"'; |
|
| 8720 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); |
|
| 8721 | 8721 | $out .= '>'."\n"; |
| 8722 | 8722 | |
| 8723 | 8723 | if ($show_empty) { |
@@ -8728,7 +8728,7 @@ discard block |
||
| 8728 | 8728 | if (!is_numeric($show_empty)) { |
| 8729 | 8729 | $textforempty = $show_empty; |
| 8730 | 8730 | } |
| 8731 | - $out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 8731 | + $out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 8732 | 8732 | } |
| 8733 | 8733 | if (is_array($array)) { |
| 8734 | 8734 | // Translate |
@@ -8753,7 +8753,7 @@ discard block |
||
| 8753 | 8753 | $value = $tmpvalue['label']; |
| 8754 | 8754 | //$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html']; |
| 8755 | 8755 | $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; |
| 8756 | - $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; |
|
| 8756 | + $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; |
|
| 8757 | 8757 | } else { |
| 8758 | 8758 | $value = $tmpvalue; |
| 8759 | 8759 | //$valuehtml = $tmpvalue; |
@@ -8769,9 +8769,9 @@ discard block |
||
| 8769 | 8769 | } |
| 8770 | 8770 | if ($key_in_label) { |
| 8771 | 8771 | if (empty($nohtmlescape)) { |
| 8772 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8772 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8773 | 8773 | } else { |
| 8774 | - $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8774 | + $selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8775 | 8775 | } |
| 8776 | 8776 | } else { |
| 8777 | 8777 | if (empty($nohtmlescape)) { |
@@ -8783,8 +8783,8 @@ discard block |
||
| 8783 | 8783 | $selectOptionValue = ' '; |
| 8784 | 8784 | } |
| 8785 | 8785 | } |
| 8786 | - $out .= '<option value="' . $key . '"'; |
|
| 8787 | - $out .= $style . $disabled; |
|
| 8786 | + $out .= '<option value="'.$key.'"'; |
|
| 8787 | + $out .= $style.$disabled; |
|
| 8788 | 8788 | if (is_array($id)) { |
| 8789 | 8789 | if (in_array($key, $id) && !$disabled) { |
| 8790 | 8790 | $out .= ' selected'; // To preselect a value |
@@ -8796,7 +8796,7 @@ discard block |
||
| 8796 | 8796 | } |
| 8797 | 8797 | } |
| 8798 | 8798 | if (!empty($nohtmlescape)) { // deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content. |
| 8799 | - $out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"'; |
|
| 8799 | + $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"'; |
|
| 8800 | 8800 | } |
| 8801 | 8801 | |
| 8802 | 8802 | if (is_array($tmpvalue)) { |
@@ -8819,7 +8819,7 @@ discard block |
||
| 8819 | 8819 | // Add code for jquery to use multiselect |
| 8820 | 8820 | if ($addjscombo && $jsbeautify) { |
| 8821 | 8821 | // Enhance with select2 |
| 8822 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8822 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8823 | 8823 | $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss); |
| 8824 | 8824 | } |
| 8825 | 8825 | |
@@ -8847,28 +8847,28 @@ discard block |
||
| 8847 | 8847 | public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) |
| 8848 | 8848 | { |
| 8849 | 8849 | global $conf, $langs; |
| 8850 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8850 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8851 | 8851 | |
| 8852 | 8852 | // TODO Use an internal dolibarr component instead of select2 |
| 8853 | 8853 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8854 | 8854 | return ''; |
| 8855 | 8855 | } |
| 8856 | 8856 | |
| 8857 | - $out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>'; |
|
| 8857 | + $out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>'; |
|
| 8858 | 8858 | |
| 8859 | 8859 | $outdelayed = ''; |
| 8860 | 8860 | if (!empty($conf->use_javascript_ajax)) { |
| 8861 | 8861 | $tmpplugin = 'select2'; |
| 8862 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8863 | - <script nonce="' . getNonce() . '"> |
|
| 8862 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8863 | + <script nonce="' . getNonce().'"> |
|
| 8864 | 8864 | $(document).ready(function () { |
| 8865 | 8865 | |
| 8866 | - ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . ' |
|
| 8866 | + ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').' |
|
| 8867 | 8867 | |
| 8868 | - $(".' . $htmlname . '").select2({ |
|
| 8868 | + $(".' . $htmlname.'").select2({ |
|
| 8869 | 8869 | ajax: { |
| 8870 | 8870 | dir: "ltr", |
| 8871 | - url: "' . $url . '", |
|
| 8871 | + url: "' . $url.'", |
|
| 8872 | 8872 | dataType: \'json\', |
| 8873 | 8873 | delay: 250, |
| 8874 | 8874 | data: function (params) { |
@@ -8895,9 +8895,9 @@ discard block |
||
| 8895 | 8895 | }, |
| 8896 | 8896 | language: select2arrayoflanguage, |
| 8897 | 8897 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8898 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8898 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8899 | 8899 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8900 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
| 8900 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
| 8901 | 8901 | formatResult: function (result, container, query, escapeMarkup) { |
| 8902 | 8902 | return escapeMarkup(result.text); |
| 8903 | 8903 | }, |
@@ -8905,10 +8905,10 @@ discard block |
||
| 8905 | 8905 | |
| 8906 | 8906 | ' . ($callurlonselect ? ' |
| 8907 | 8907 | /* Code to execute a GET when we select a value */ |
| 8908 | - $(".' . $htmlname . '").change(function() { |
|
| 8909 | - var selected = $(".' . $htmlname . '").val(); |
|
| 8908 | + $(".' . $htmlname.'").change(function() { |
|
| 8909 | + var selected = $(".' . $htmlname.'").val(); |
|
| 8910 | 8910 | console.log("We select in selectArrayAjax the entry "+selected) |
| 8911 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 8911 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 8912 | 8912 | $.each( saveRemoteData, function( key, value ) { |
| 8913 | 8913 | if (key == selected) |
| 8914 | 8914 | { |
@@ -8916,7 +8916,7 @@ discard block |
||
| 8916 | 8916 | location.assign(value.url); |
| 8917 | 8917 | } |
| 8918 | 8918 | }); |
| 8919 | - });' : '') . ' |
|
| 8919 | + });' : '').' |
|
| 8920 | 8920 | |
| 8921 | 8921 | }); |
| 8922 | 8922 | </script>'; |
@@ -8952,14 +8952,14 @@ discard block |
||
| 8952 | 8952 | public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') |
| 8953 | 8953 | { |
| 8954 | 8954 | global $conf, $langs; |
| 8955 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8955 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8956 | 8956 | |
| 8957 | 8957 | // TODO Use an internal dolibarr component instead of select2 |
| 8958 | 8958 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8959 | 8959 | return ''; |
| 8960 | 8960 | } |
| 8961 | 8961 | |
| 8962 | - $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8962 | + $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8963 | 8963 | |
| 8964 | 8964 | $formattedarrayresult = array(); |
| 8965 | 8965 | |
@@ -8974,20 +8974,20 @@ discard block |
||
| 8974 | 8974 | $outdelayed = ''; |
| 8975 | 8975 | if (!empty($conf->use_javascript_ajax)) { |
| 8976 | 8976 | $tmpplugin = 'select2'; |
| 8977 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8978 | - <script nonce="' . getNonce() . '"> |
|
| 8977 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8978 | + <script nonce="' . getNonce().'"> |
|
| 8979 | 8979 | $(document).ready(function () { |
| 8980 | - var data = ' . json_encode($formattedarrayresult) . '; |
|
| 8980 | + var data = ' . json_encode($formattedarrayresult).'; |
|
| 8981 | 8981 | |
| 8982 | - ' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . ' |
|
| 8982 | + ' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').' |
|
| 8983 | 8983 | |
| 8984 | - $(".' . $htmlname . '").select2({ |
|
| 8984 | + $(".' . $htmlname.'").select2({ |
|
| 8985 | 8985 | data: data, |
| 8986 | 8986 | language: select2arrayoflanguage, |
| 8987 | 8987 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8988 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8988 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8989 | 8989 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8990 | - minimumInputLength: ' . $minimumInputLength . ', |
|
| 8990 | + minimumInputLength: ' . $minimumInputLength.', |
|
| 8991 | 8991 | formatResult: function (result, container, query, escapeMarkup) { |
| 8992 | 8992 | return escapeMarkup(result.text); |
| 8993 | 8993 | }, |
@@ -9026,11 +9026,11 @@ discard block |
||
| 9026 | 9026 | |
| 9027 | 9027 | ' . ($callurlonselect ? ' |
| 9028 | 9028 | /* Code to execute a GET when we select a value */ |
| 9029 | - $(".' . $htmlname . '").change(function() { |
|
| 9030 | - var selected = $(".' . $htmlname . '").val(); |
|
| 9029 | + $(".' . $htmlname.'").change(function() { |
|
| 9030 | + var selected = $(".' . $htmlname.'").val(); |
|
| 9031 | 9031 | console.log("We select "+selected) |
| 9032 | 9032 | |
| 9033 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 9033 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 9034 | 9034 | $.each( saveRemoteData, function( key, value ) { |
| 9035 | 9035 | if (key == selected) |
| 9036 | 9036 | { |
@@ -9038,7 +9038,7 @@ discard block |
||
| 9038 | 9038 | location.assign(value.url); |
| 9039 | 9039 | } |
| 9040 | 9040 | }); |
| 9041 | - });' : '') . ' |
|
| 9041 | + });' : '').' |
|
| 9042 | 9042 | |
| 9043 | 9043 | }); |
| 9044 | 9044 | </script>'; |
@@ -9087,7 +9087,7 @@ discard block |
||
| 9087 | 9087 | $useenhancedmultiselect = 0; |
| 9088 | 9088 | if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { |
| 9089 | 9089 | if ($addjscombo) { |
| 9090 | - $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 9090 | + $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 9091 | 9091 | } |
| 9092 | 9092 | } |
| 9093 | 9093 | |
@@ -9096,7 +9096,7 @@ discard block |
||
| 9096 | 9096 | // submitted to nothing. |
| 9097 | 9097 | $out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">'; |
| 9098 | 9098 | // Output select component |
| 9099 | - $out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', (string) $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n"; |
|
| 9099 | + $out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', (string) $width) ? $width : $width.'px').'"' : '').'>'."\n"; |
|
| 9100 | 9100 | if (is_array($array) && !empty($array)) { |
| 9101 | 9101 | if ($value_as_key) { |
| 9102 | 9102 | $array = array_combine($array, $array); |
@@ -9117,33 +9117,33 @@ discard block |
||
| 9117 | 9117 | $tmplabelhtml = empty($value['labelhtml']) ? (empty($value['data-html']) ? '' : $value['data-html']) : $value['labelhtml']; |
| 9118 | 9118 | } |
| 9119 | 9119 | $newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue); |
| 9120 | - $newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval); |
|
| 9120 | + $newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval); |
|
| 9121 | 9121 | |
| 9122 | - $out .= '<option value="' . $tmpkey . '"'; |
|
| 9122 | + $out .= '<option value="'.$tmpkey.'"'; |
|
| 9123 | 9123 | if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) { |
| 9124 | 9124 | $out .= ' selected'; |
| 9125 | 9125 | } |
| 9126 | 9126 | if (!empty($tmplabelhtml)) { |
| 9127 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 9127 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 9128 | 9128 | } else { |
| 9129 | - $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval; |
|
| 9130 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 9129 | + $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval; |
|
| 9130 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 9131 | 9131 | } |
| 9132 | 9132 | $out .= '>'; |
| 9133 | 9133 | $out .= dol_htmlentitiesbr($newval); |
| 9134 | - $out .= '</option>' . "\n"; |
|
| 9134 | + $out .= '</option>'."\n"; |
|
| 9135 | 9135 | } |
| 9136 | 9136 | } |
| 9137 | 9137 | } |
| 9138 | - $out .= '</select>' . "\n"; |
|
| 9138 | + $out .= '</select>'."\n"; |
|
| 9139 | 9139 | |
| 9140 | 9140 | // Add code for jquery to use multiselect |
| 9141 | 9141 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 9142 | - $out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->'; |
|
| 9143 | - $out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n"; |
|
| 9142 | + $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->'; |
|
| 9143 | + $out .= "\n".'<script nonce="'.getNonce().'">'."\n"; |
|
| 9144 | 9144 | if ($addjscombo == 1) { |
| 9145 | 9145 | $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
| 9146 | - $out .= 'function formatResult(record, container) {' . "\n"; |
|
| 9146 | + $out .= 'function formatResult(record, container) {'."\n"; |
|
| 9147 | 9147 | // If property data-html set, we decode html entities and use this. |
| 9148 | 9148 | // Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option. |
| 9149 | 9149 | $out .= ' if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {'; |
@@ -9151,26 +9151,26 @@ discard block |
||
| 9151 | 9151 | $out .= ' return htmlEntityDecodeJs($(record.element).attr("data-html"));'; |
| 9152 | 9152 | $out .= ' }'."\n"; |
| 9153 | 9153 | $out .= ' return record.text;'; |
| 9154 | - $out .= '}' . "\n"; |
|
| 9155 | - $out .= 'function formatSelection(record) {' . "\n"; |
|
| 9154 | + $out .= '}'."\n"; |
|
| 9155 | + $out .= 'function formatSelection(record) {'."\n"; |
|
| 9156 | 9156 | if ($elemtype == 'category') { |
| 9157 | - $out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 9157 | + $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 9158 | 9158 | } else { |
| 9159 | 9159 | $out .= 'return record.text;'; |
| 9160 | 9160 | } |
| 9161 | - $out .= '}' . "\n"; |
|
| 9161 | + $out .= '}'."\n"; |
|
| 9162 | 9162 | $out .= '$(document).ready(function () { |
| 9163 | - $(\'#' . $htmlname . '\').' . $tmpplugin . '({'; |
|
| 9163 | + $(\'#' . $htmlname.'\').'.$tmpplugin.'({'; |
|
| 9164 | 9164 | if ($placeholder) { |
| 9165 | 9165 | $out .= ' |
| 9166 | 9166 | placeholder: { |
| 9167 | 9167 | id: \'-1\', |
| 9168 | - text: \'' . dol_escape_js($placeholder) . '\' |
|
| 9168 | + text: \'' . dol_escape_js($placeholder).'\' |
|
| 9169 | 9169 | },'; |
| 9170 | 9170 | } |
| 9171 | 9171 | $out .= ' dir: \'ltr\', |
| 9172 | 9172 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */ |
| 9173 | - dropdownCssClass: \'' . $morecss . '\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
| 9173 | + dropdownCssClass: \'' . $morecss.'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
| 9174 | 9174 | // Specify format function for dropdown item |
| 9175 | 9175 | formatResult: formatResult, |
| 9176 | 9176 | templateResult: formatResult, /* For 4.0 */ |
@@ -9182,21 +9182,21 @@ discard block |
||
| 9182 | 9182 | |
| 9183 | 9183 | /* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set |
| 9184 | 9184 | the size only if component is not hidden by default on load */ |
| 9185 | - $(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\'); |
|
| 9185 | + $(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\'); |
|
| 9186 | 9186 | });' . "\n"; |
| 9187 | 9187 | } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) { |
| 9188 | 9188 | // Add other js lib |
| 9189 | 9189 | // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin |
| 9190 | 9190 | // ... |
| 9191 | - $out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');'; |
|
| 9191 | + $out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');'; |
|
| 9192 | 9192 | $out .= '$(document).ready(function () { |
| 9193 | - $(\'#' . $htmlname . '\').multiSelect({ |
|
| 9193 | + $(\'#' . $htmlname.'\').multiSelect({ |
|
| 9194 | 9194 | containerHTML: \'<div class="multi-select-container">\', |
| 9195 | 9195 | menuHTML: \'<div class="multi-select-menu">\', |
| 9196 | - buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\', |
|
| 9196 | + buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\', |
|
| 9197 | 9197 | menuItemHTML: \'<label class="multi-select-menuitem">\', |
| 9198 | 9198 | activeClass: \'multi-select-container--open\', |
| 9199 | - noneText: \'' . $placeholder . '\' |
|
| 9199 | + noneText: \'' . $placeholder.'\' |
|
| 9200 | 9200 | }); |
| 9201 | 9201 | })'; |
| 9202 | 9202 | } |
@@ -9229,7 +9229,7 @@ discard block |
||
| 9229 | 9229 | return ''; |
| 9230 | 9230 | } |
| 9231 | 9231 | |
| 9232 | - $tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show |
|
| 9232 | + $tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show |
|
| 9233 | 9233 | |
| 9234 | 9234 | if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user |
| 9235 | 9235 | $tmparray = explode(',', $user->conf->$tmpvar); |
@@ -9272,19 +9272,19 @@ discard block |
||
| 9272 | 9272 | } |
| 9273 | 9273 | |
| 9274 | 9274 | // Note: $val['checked'] <> 0 means we must show the field into the combo list @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset |
| 9275 | - $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>'; |
|
| 9276 | - $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); |
|
| 9275 | + $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>'; |
|
| 9276 | + $listcheckedstring .= (empty($val['checked']) ? '' : $key.','); |
|
| 9277 | 9277 | } |
| 9278 | 9278 | } |
| 9279 | 9279 | |
| 9280 | - $out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' --> |
|
| 9280 | + $out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' --> |
|
| 9281 | 9281 | |
| 9282 | 9282 | <dl class="dropdown"> |
| 9283 | 9283 | <dt> |
| 9284 | - <a href="#' . $htmlname . '"> |
|
| 9285 | - ' . img_picto('', 'list') . ' |
|
| 9284 | + <a href="#' . $htmlname.'"> |
|
| 9285 | + ' . img_picto('', 'list').' |
|
| 9286 | 9286 | </a> |
| 9287 | - <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> |
|
| 9287 | + <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> |
|
| 9288 | 9288 | </dt> |
| 9289 | 9289 | <dd class="dropdowndd"> |
| 9290 | 9290 | <div class="multiselectcheckbox'.$htmlname.'"> |
@@ -9296,19 +9296,19 @@ discard block |
||
| 9296 | 9296 | </dd> |
| 9297 | 9297 | </dl> |
| 9298 | 9298 | |
| 9299 | - <script nonce="' . getNonce() . '" type="text/javascript"> |
|
| 9299 | + <script nonce="' . getNonce().'" type="text/javascript"> |
|
| 9300 | 9300 | jQuery(document).ready(function () { |
| 9301 | - $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9301 | + $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9302 | 9302 | console.log("A new field was added/removed, we edit field input[name=formfilteraction]"); |
| 9303 | 9303 | |
| 9304 | 9304 | $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST |
| 9305 | 9305 | |
| 9306 | 9306 | var title = $(this).val() + ","; |
| 9307 | 9307 | if ($(this).is(\':checked\')) { |
| 9308 | - $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val()); |
|
| 9308 | + $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val()); |
|
| 9309 | 9309 | } |
| 9310 | 9310 | else { |
| 9311 | - $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') ) |
|
| 9311 | + $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') ) |
|
| 9312 | 9312 | } |
| 9313 | 9313 | // Now, we submit page |
| 9314 | 9314 | //$(this).parents(\'form:first\').submit(); |
@@ -9339,7 +9339,7 @@ discard block |
||
| 9339 | 9339 | */ |
| 9340 | 9340 | public function showCategories($id, $type, $rendermode = 0, $nolink = 0) |
| 9341 | 9341 | { |
| 9342 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 9342 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 9343 | 9343 | |
| 9344 | 9344 | $cat = new Categorie($this->db); |
| 9345 | 9345 | $categories = $cat->containing($id, $type); |
@@ -9349,13 +9349,13 @@ discard block |
||
| 9349 | 9349 | foreach ($categories as $c) { |
| 9350 | 9350 | $ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 9351 | 9351 | foreach ($ways as $way) { |
| 9352 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
| 9352 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
| 9353 | 9353 | } |
| 9354 | 9354 | } |
| 9355 | 9355 | if (empty($toprint)) { |
| 9356 | 9356 | return ''; |
| 9357 | 9357 | } else { |
| 9358 | - return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
| 9358 | + return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 9359 | 9359 | } |
| 9360 | 9360 | } |
| 9361 | 9361 | |
@@ -9404,15 +9404,15 @@ discard block |
||
| 9404 | 9404 | |
| 9405 | 9405 | |
| 9406 | 9406 | print '<div class="div-table-responsive-no-min">'; |
| 9407 | - print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '" data-elementid="' . $object->id . '" >'; |
|
| 9407 | + print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'" data-elementid="'.$object->id.'" >'; |
|
| 9408 | 9408 | |
| 9409 | 9409 | print '<tr class="liste_titre">'; |
| 9410 | - print '<td>' . $langs->trans("Type") . '</td>'; |
|
| 9411 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
| 9410 | + print '<td>'.$langs->trans("Type").'</td>'; |
|
| 9411 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
| 9412 | 9412 | print '<td class="center"></td>'; |
| 9413 | - print '<td class="center">' . $langs->trans("Date") . '</td>'; |
|
| 9414 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9415 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
| 9413 | + print '<td class="center">'.$langs->trans("Date").'</td>'; |
|
| 9414 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9415 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
| 9416 | 9416 | print '<td></td>'; |
| 9417 | 9417 | print '</tr>'; |
| 9418 | 9418 | |
@@ -9431,13 +9431,13 @@ discard block |
||
| 9431 | 9431 | if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) { |
| 9432 | 9432 | $element = $regs[1]; |
| 9433 | 9433 | $subelement = $regs[2]; |
| 9434 | - $tplpath = $element . '/' . $subelement; |
|
| 9434 | + $tplpath = $element.'/'.$subelement; |
|
| 9435 | 9435 | } |
| 9436 | 9436 | $tplname = 'linkedobjectblock'; |
| 9437 | 9437 | |
| 9438 | 9438 | // To work with non standard path |
| 9439 | 9439 | if ($objecttype == 'facture') { |
| 9440 | - $tplpath = 'compta/' . $element; |
|
| 9440 | + $tplpath = 'compta/'.$element; |
|
| 9441 | 9441 | if (!isModEnabled('invoice')) { |
| 9442 | 9442 | continue; // Do not show if module disabled |
| 9443 | 9443 | } |
@@ -9448,7 +9448,7 @@ discard block |
||
| 9448 | 9448 | continue; // Do not show if module disabled |
| 9449 | 9449 | } |
| 9450 | 9450 | } elseif ($objecttype == 'propal') { |
| 9451 | - $tplpath = 'comm/' . $element; |
|
| 9451 | + $tplpath = 'comm/'.$element; |
|
| 9452 | 9452 | if (!isModEnabled('propal')) { |
| 9453 | 9453 | continue; // Do not show if module disabled |
| 9454 | 9454 | } |
@@ -9501,7 +9501,7 @@ discard block |
||
| 9501 | 9501 | $linkedObjectBlock = $objects; |
| 9502 | 9502 | |
| 9503 | 9503 | // Output template part (modules that overwrite templates must declare this into descriptor) |
| 9504 | - $dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl')); |
|
| 9504 | + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); |
|
| 9505 | 9505 | foreach ($dirtpls as $reldir) { |
| 9506 | 9506 | $reldir = rtrim($reldir, '/'); |
| 9507 | 9507 | if ($nboftypesoutput == ($nbofdifferenttypes - 1)) { // No more type to show after |
@@ -9509,7 +9509,7 @@ discard block |
||
| 9509 | 9509 | $noMoreLinkedObjectBlockAfter = 1; |
| 9510 | 9510 | } |
| 9511 | 9511 | |
| 9512 | - $res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php'); |
|
| 9512 | + $res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); |
|
| 9513 | 9513 | if ($res) { |
| 9514 | 9514 | $nboftypesoutput++; |
| 9515 | 9515 | break; |
@@ -9518,7 +9518,7 @@ discard block |
||
| 9518 | 9518 | } |
| 9519 | 9519 | |
| 9520 | 9520 | if (!$nboftypesoutput) { |
| 9521 | - print '<tr><td colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
| 9521 | + print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
| 9522 | 9522 | } |
| 9523 | 9523 | |
| 9524 | 9524 | print '</table>'; |
@@ -9558,14 +9558,14 @@ discard block |
||
| 9558 | 9558 | if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
| 9559 | 9559 | $listofidcompanytoscan = $object->thirdparty->id; |
| 9560 | 9560 | if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) { |
| 9561 | - $listofidcompanytoscan .= ',' . $object->thirdparty->parent; |
|
| 9561 | + $listofidcompanytoscan .= ','.$object->thirdparty->parent; |
|
| 9562 | 9562 | } |
| 9563 | 9563 | if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) { |
| 9564 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 9564 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 9565 | 9565 | $tmpproject = new Project($this->db); |
| 9566 | 9566 | $tmpproject->fetch($object->fk_project); |
| 9567 | 9567 | if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { |
| 9568 | - $listofidcompanytoscan .= ',' . $tmpproject->socid; |
|
| 9568 | + $listofidcompanytoscan .= ','.$tmpproject->socid; |
|
| 9569 | 9569 | } |
| 9570 | 9570 | unset($tmpproject); |
| 9571 | 9571 | } |
@@ -9575,63 +9575,63 @@ discard block |
||
| 9575 | 9575 | 'enabled' => isModEnabled('propal'), |
| 9576 | 9576 | 'perms' => 1, |
| 9577 | 9577 | 'label' => 'LinkToProposal', |
| 9578 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'), |
|
| 9578 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('propal').')'), |
|
| 9579 | 9579 | 'shipping' => array( |
| 9580 | 9580 | 'enabled' => isModEnabled('shipping'), |
| 9581 | 9581 | 'perms' => 1, |
| 9582 | 9582 | 'label' => 'LinkToExpedition', |
| 9583 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'), |
|
| 9583 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('shipping').')'), |
|
| 9584 | 9584 | 'order' => array( |
| 9585 | 9585 | 'enabled' => isModEnabled('order'), |
| 9586 | 9586 | 'perms' => 1, |
| 9587 | 9587 | 'label' => 'LinkToOrder', |
| 9588 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'), |
|
| 9588 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'), |
|
| 9589 | 9589 | 'invoice' => array( |
| 9590 | 9590 | 'enabled' => isModEnabled('invoice'), |
| 9591 | 9591 | 'perms' => 1, |
| 9592 | 9592 | 'label' => 'LinkToInvoice', |
| 9593 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), |
|
| 9593 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), |
|
| 9594 | 9594 | 'invoice_template' => array( |
| 9595 | 9595 | 'enabled' => isModEnabled('invoice'), |
| 9596 | 9596 | 'perms' => 1, |
| 9597 | 9597 | 'label' => 'LinkToTemplateInvoice', |
| 9598 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), |
|
| 9598 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), |
|
| 9599 | 9599 | 'contrat' => array( |
| 9600 | 9600 | 'enabled' => isModEnabled('contract'), |
| 9601 | 9601 | 'perms' => 1, |
| 9602 | 9602 | 'label' => 'LinkToContract', |
| 9603 | 9603 | 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht |
| 9604 | - FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "contrat as t, " . $this->db->prefix() . "contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('contract') . ') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' |
|
| 9604 | + FROM " . $this->db->prefix()."societe as s, ".$this->db->prefix()."contrat as t, ".$this->db->prefix()."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' |
|
| 9605 | 9605 | ), |
| 9606 | 9606 | 'fichinter' => array( |
| 9607 | 9607 | 'enabled' => isModEnabled('intervention'), |
| 9608 | 9608 | 'perms' => 1, |
| 9609 | 9609 | 'label' => 'LinkToIntervention', |
| 9610 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('intervention') . ')'), |
|
| 9610 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), |
|
| 9611 | 9611 | 'supplier_proposal' => array( |
| 9612 | 9612 | 'enabled' => isModEnabled('supplier_proposal'), |
| 9613 | 9613 | 'perms' => 1, |
| 9614 | 9614 | 'label' => 'LinkToSupplierProposal', |
| 9615 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('supplier_proposal') . ')'), |
|
| 9615 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), |
|
| 9616 | 9616 | 'order_supplier' => array( |
| 9617 | 9617 | 'enabled' => isModEnabled("supplier_order"), |
| 9618 | 9618 | 'perms' => 1, |
| 9619 | 9619 | 'label' => 'LinkToSupplierOrder', |
| 9620 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande_fournisseur') . ')'), |
|
| 9620 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), |
|
| 9621 | 9621 | 'invoice_supplier' => array( |
| 9622 | 9622 | 'enabled' => isModEnabled("supplier_invoice"), |
| 9623 | 9623 | 'perms' => 1, 'label' => 'LinkToSupplierInvoice', |
| 9624 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('facture_fourn') . ')'), |
|
| 9624 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'), |
|
| 9625 | 9625 | 'ticket' => array( |
| 9626 | 9626 | 'enabled' => isModEnabled('ticket'), |
| 9627 | 9627 | 'perms' => 1, |
| 9628 | 9628 | 'label' => 'LinkToTicket', |
| 9629 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('ticket') . ')'), |
|
| 9629 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')'), |
|
| 9630 | 9630 | 'mo' => array( |
| 9631 | 9631 | 'enabled' => isModEnabled('mrp'), |
| 9632 | 9632 | 'perms' => 1, |
| 9633 | 9633 | 'label' => 'LinkToMo', |
| 9634 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM " . $this->db->prefix() . "societe as s INNER JOIN " . $this->db->prefix() . "mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('mo') . ')') |
|
| 9634 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".$this->db->prefix()."societe as s INNER JOIN ".$this->db->prefix()."mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')') |
|
| 9635 | 9635 | ); |
| 9636 | 9636 | } |
| 9637 | 9637 | |
@@ -9667,22 +9667,22 @@ discard block |
||
| 9667 | 9667 | } |
| 9668 | 9668 | |
| 9669 | 9669 | if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) { |
| 9670 | - print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>'; |
|
| 9670 | + print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>'; |
|
| 9671 | 9671 | |
| 9672 | 9672 | if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) { |
| 9673 | 9673 | print '<br>'."\n"; |
| 9674 | 9674 | print '<!-- form to add a link from anywhere -->'."\n"; |
| 9675 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">'; |
|
| 9676 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9675 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">'; |
|
| 9676 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9677 | 9677 | print '<input type="hidden" name="action" value="addlinkbyref">'; |
| 9678 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9679 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9678 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9679 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9680 | 9680 | print '<table class="noborder">'; |
| 9681 | 9681 | print '<tr>'; |
| 9682 | 9682 | //print '<td>' . $langs->trans("Ref") . '</td>'; |
| 9683 | - print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> '; |
|
| 9684 | - print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '"> '; |
|
| 9685 | - print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>'; |
|
| 9683 | + print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'"> '; |
|
| 9684 | + print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'"> '; |
|
| 9685 | + print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>'; |
|
| 9686 | 9686 | print '</tr>'; |
| 9687 | 9687 | print '</table>'; |
| 9688 | 9688 | print '</form>'; |
@@ -9697,48 +9697,48 @@ discard block |
||
| 9697 | 9697 | |
| 9698 | 9698 | print '<br>'; |
| 9699 | 9699 | print '<!-- form to add a link from object to same thirdparty -->'."\n"; |
| 9700 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">'; |
|
| 9700 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">'; |
|
| 9701 | 9701 | print '<input type="hidden" name="action" value="addlink">'; |
| 9702 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9703 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9704 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9702 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9703 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9704 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9705 | 9705 | print '<table class="noborder">'; |
| 9706 | 9706 | print '<tr class="liste_titre">'; |
| 9707 | 9707 | print '<td class="nowrap"></td>'; |
| 9708 | - print '<td class="center">' . $langs->trans("Ref") . '</td>'; |
|
| 9709 | - print '<td class="left">' . $langs->trans("RefCustomer") . '</td>'; |
|
| 9710 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9711 | - print '<td class="left">' . $langs->trans("Company") . '</td>'; |
|
| 9708 | + print '<td class="center">'.$langs->trans("Ref").'</td>'; |
|
| 9709 | + print '<td class="left">'.$langs->trans("RefCustomer").'</td>'; |
|
| 9710 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9711 | + print '<td class="left">'.$langs->trans("Company").'</td>'; |
|
| 9712 | 9712 | print '</tr>'; |
| 9713 | 9713 | while ($i < $num) { |
| 9714 | 9714 | $objp = $this->db->fetch_object($resqllist); |
| 9715 | 9715 | |
| 9716 | 9716 | print '<tr class="oddeven">'; |
| 9717 | 9717 | print '<td class="left">'; |
| 9718 | - print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">'; |
|
| 9718 | + print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">'; |
|
| 9719 | 9719 | print '</td>'; |
| 9720 | - print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>'; |
|
| 9721 | - print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>'; |
|
| 9720 | + print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>'; |
|
| 9721 | + print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>'; |
|
| 9722 | 9722 | print '<td class="right">'; |
| 9723 | 9723 | if ($possiblelink['label'] == 'LinkToContract') { |
| 9724 | 9724 | $form = new Form($this->db); |
| 9725 | - print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' '; |
|
| 9725 | + print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; |
|
| 9726 | 9726 | } |
| 9727 | - print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>'; |
|
| 9727 | + print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>'; |
|
| 9728 | 9728 | print '</td>'; |
| 9729 | - print '<td>' . $objp->name . '</td>'; |
|
| 9729 | + print '<td>'.$objp->name.'</td>'; |
|
| 9730 | 9730 | print '</tr>'; |
| 9731 | 9731 | $i++; |
| 9732 | 9732 | } |
| 9733 | 9733 | print '</table>'; |
| 9734 | 9734 | print '<div class="center">'; |
| 9735 | 9735 | if ($num) { |
| 9736 | - print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">'; |
|
| 9736 | + print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">'; |
|
| 9737 | 9737 | } |
| 9738 | 9738 | if (empty($conf->use_javascript_ajax)) { |
| 9739 | - print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 9739 | + print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 9740 | 9740 | } else { |
| 9741 | - print '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 9741 | + print '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 9742 | 9742 | } |
| 9743 | 9743 | print '</form>'; |
| 9744 | 9744 | $this->db->free($resqllist); |
@@ -9749,10 +9749,10 @@ discard block |
||
| 9749 | 9749 | |
| 9750 | 9750 | //$linktoelem.=($linktoelem?' ':''); |
| 9751 | 9751 | if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) { |
| 9752 | - $linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>'; |
|
| 9752 | + $linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>'; |
|
| 9753 | 9753 | // } else $linktoelem.=$langs->trans($possiblelink['label']); |
| 9754 | 9754 | } else { |
| 9755 | - $linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>'; |
|
| 9755 | + $linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>'; |
|
| 9756 | 9756 | } |
| 9757 | 9757 | } |
| 9758 | 9758 | } |
@@ -9762,11 +9762,11 @@ discard block |
||
| 9762 | 9762 | <dl class="dropdown" id="linktoobjectname"> |
| 9763 | 9763 | '; |
| 9764 | 9764 | if (!empty($conf->use_javascript_ajax)) { |
| 9765 | - $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>'; |
|
| 9765 | + $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>'; |
|
| 9766 | 9766 | } |
| 9767 | 9767 | $linktoelem .= '<dd> |
| 9768 | 9768 | <div class="multiselectlinkto"> |
| 9769 | - <ul class="ulselectedfields">' . $linktoelemlist . ' |
|
| 9769 | + <ul class="ulselectedfields">' . $linktoelemlist.' |
|
| 9770 | 9770 | </ul> |
| 9771 | 9771 | </div> |
| 9772 | 9772 | </dd> |
@@ -9777,7 +9777,7 @@ discard block |
||
| 9777 | 9777 | |
| 9778 | 9778 | if (!empty($conf->use_javascript_ajax)) { |
| 9779 | 9779 | print '<!-- Add js to show linkto box --> |
| 9780 | - <script nonce="' . getNonce() . '"> |
|
| 9780 | + <script nonce="' . getNonce().'"> |
|
| 9781 | 9781 | jQuery(document).ready(function() { |
| 9782 | 9782 | jQuery(".linkto").click(function() { |
| 9783 | 9783 | console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list"); |
@@ -9818,19 +9818,19 @@ discard block |
||
| 9818 | 9818 | |
| 9819 | 9819 | $disabled = ($disabled ? ' disabled' : ''); |
| 9820 | 9820 | |
| 9821 | - $resultyesno = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n"; |
|
| 9821 | + $resultyesno = '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; |
|
| 9822 | 9822 | if ($useempty) { |
| 9823 | - $resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 9823 | + $resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n"; |
|
| 9824 | 9824 | } |
| 9825 | 9825 | if (("$value" == 'yes') || ($value == 1)) { |
| 9826 | - $resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9827 | - $resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9826 | + $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9827 | + $resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9828 | 9828 | } else { |
| 9829 | 9829 | $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); |
| 9830 | - $resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9831 | - $resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9830 | + $resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9831 | + $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9832 | 9832 | } |
| 9833 | - $resultyesno .= '</select>' . "\n"; |
|
| 9833 | + $resultyesno .= '</select>'."\n"; |
|
| 9834 | 9834 | |
| 9835 | 9835 | if ($addjscombo) { |
| 9836 | 9836 | $resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss); |
@@ -9854,12 +9854,12 @@ discard block |
||
| 9854 | 9854 | { |
| 9855 | 9855 | // phpcs:enable |
| 9856 | 9856 | $sql = "SELECT rowid, label"; |
| 9857 | - $sql .= " FROM " . $this->db->prefix() . "export_model"; |
|
| 9858 | - $sql .= " WHERE type = '" . $this->db->escape($type) . "'"; |
|
| 9857 | + $sql .= " FROM ".$this->db->prefix()."export_model"; |
|
| 9858 | + $sql .= " WHERE type = '".$this->db->escape($type)."'"; |
|
| 9859 | 9859 | $sql .= " ORDER BY rowid"; |
| 9860 | 9860 | $result = $this->db->query($sql); |
| 9861 | 9861 | if ($result) { |
| 9862 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 9862 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 9863 | 9863 | if ($useempty) { |
| 9864 | 9864 | print '<option value="-1"> </option>'; |
| 9865 | 9865 | } |
@@ -9869,9 +9869,9 @@ discard block |
||
| 9869 | 9869 | while ($i < $num) { |
| 9870 | 9870 | $obj = $this->db->fetch_object($result); |
| 9871 | 9871 | if ($selected == $obj->rowid) { |
| 9872 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 9872 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 9873 | 9873 | } else { |
| 9874 | - print '<option value="' . $obj->rowid . '">'; |
|
| 9874 | + print '<option value="'.$obj->rowid.'">'; |
|
| 9875 | 9875 | } |
| 9876 | 9876 | print $obj->label; |
| 9877 | 9877 | print '</option>'; |
@@ -9962,8 +9962,8 @@ discard block |
||
| 9962 | 9962 | $stringforfirstkey .= ' CTL +'; |
| 9963 | 9963 | } |
| 9964 | 9964 | |
| 9965 | - $previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
| 9966 | - $next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
| 9965 | + $previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
| 9966 | + $next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
| 9967 | 9967 | } |
| 9968 | 9968 | |
| 9969 | 9969 | //print "xx".$previous_ref."x".$next_ref; |
@@ -9971,18 +9971,18 @@ discard block |
||
| 9971 | 9971 | |
| 9972 | 9972 | // Right part of banner |
| 9973 | 9973 | if ($morehtmlright) { |
| 9974 | - $ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>'; |
|
| 9974 | + $ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>'; |
|
| 9975 | 9975 | } |
| 9976 | 9976 | |
| 9977 | 9977 | if ($previous_ref || $next_ref || $morehtml) { |
| 9978 | 9978 | $ret .= '<div class="pagination paginationref"><ul class="right">'; |
| 9979 | 9979 | } |
| 9980 | 9980 | if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) { |
| 9981 | - $ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>'; |
|
| 9981 | + $ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>'; |
|
| 9982 | 9982 | } |
| 9983 | 9983 | if ($shownav && ($previous_ref || $next_ref)) { |
| 9984 | - $ret .= '<li class="pagination">' . $previous_ref . '</li>'; |
|
| 9985 | - $ret .= '<li class="pagination">' . $next_ref . '</li>'; |
|
| 9984 | + $ret .= '<li class="pagination">'.$previous_ref.'</li>'; |
|
| 9985 | + $ret .= '<li class="pagination">'.$next_ref.'</li>'; |
|
| 9986 | 9986 | } |
| 9987 | 9987 | if ($previous_ref || $next_ref || $morehtml) { |
| 9988 | 9988 | $ret .= '</ul></div>'; |
@@ -9997,7 +9997,7 @@ discard block |
||
| 9997 | 9997 | $morehtmlstatus = $hookmanager->resPrint; |
| 9998 | 9998 | } |
| 9999 | 9999 | if ($morehtmlstatus) { |
| 10000 | - $ret .= '<div class="statusref">' . $morehtmlstatus . '</div>'; |
|
| 10000 | + $ret .= '<div class="statusref">'.$morehtmlstatus.'</div>'; |
|
| 10001 | 10001 | } |
| 10002 | 10002 | |
| 10003 | 10003 | $parameters = array(); |
@@ -10011,14 +10011,14 @@ discard block |
||
| 10011 | 10011 | // Left part of banner |
| 10012 | 10012 | if ($morehtmlleft) { |
| 10013 | 10013 | if ($conf->browser->layout == 'phone') { |
| 10014 | - $ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>'; |
|
| 10014 | + $ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; |
|
| 10015 | 10015 | } else { |
| 10016 | - $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>'; |
|
| 10016 | + $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>'; |
|
| 10017 | 10017 | } |
| 10018 | 10018 | } |
| 10019 | 10019 | |
| 10020 | 10020 | //if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; |
| 10021 | - $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">'; |
|
| 10021 | + $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">'; |
|
| 10022 | 10022 | |
| 10023 | 10023 | // For thirdparty, contact, user, member, the ref is the id, so we show something else |
| 10024 | 10024 | if ($object->element == 'societe') { |
@@ -10032,7 +10032,7 @@ discard block |
||
| 10032 | 10032 | |
| 10033 | 10033 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 10034 | 10034 | if (!is_object($extralanguages)) { |
| 10035 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 10035 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 10036 | 10036 | $extralanguages = new ExtraLanguages($this->db); |
| 10037 | 10037 | } |
| 10038 | 10038 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -10047,29 +10047,29 @@ discard block |
||
| 10047 | 10047 | if ($object->array_languages['name'][$extralangcode]) { |
| 10048 | 10048 | $htmltext .= $object->array_languages['name'][$extralangcode]; |
| 10049 | 10049 | } else { |
| 10050 | - $htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>'; |
|
| 10050 | + $htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>'; |
|
| 10051 | 10051 | } |
| 10052 | 10052 | } |
| 10053 | - $ret .= '<!-- Show translations of name -->' . "\n"; |
|
| 10053 | + $ret .= '<!-- Show translations of name -->'."\n"; |
|
| 10054 | 10054 | $ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
| 10055 | 10055 | } |
| 10056 | 10056 | } |
| 10057 | 10057 | } elseif ($object->element == 'member') { |
| 10058 | 10058 | '@phan-var-force Adherent $object'; |
| 10059 | - $ret .= $object->ref . '<br>'; |
|
| 10059 | + $ret .= $object->ref.'<br>'; |
|
| 10060 | 10060 | $fullname = $object->getFullName($langs); |
| 10061 | 10061 | if ($object->morphy == 'mor' && $object->societe) { |
| 10062 | - $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); |
|
| 10062 | + $ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''); |
|
| 10063 | 10063 | } else { |
| 10064 | - $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); |
|
| 10064 | + $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); |
|
| 10065 | 10065 | } |
| 10066 | 10066 | } elseif (in_array($object->element, array('contact', 'user'))) { |
| 10067 | - $ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt; |
|
| 10067 | + $ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt; |
|
| 10068 | 10068 | } elseif ($object->element == 'usergroup') { |
| 10069 | 10069 | $ret .= dol_htmlentities($object->name); |
| 10070 | 10070 | } elseif (in_array($object->element, array('action', 'agenda'))) { |
| 10071 | 10071 | '@phan-var-force ActionComm $object'; |
| 10072 | - $ret .= $object->ref . '<br>' . $object->label; |
|
| 10072 | + $ret .= $object->ref.'<br>'.$object->label; |
|
| 10073 | 10073 | } elseif (in_array($object->element, array('adherent_type'))) { |
| 10074 | 10074 | $ret .= $object->label; |
| 10075 | 10075 | } elseif ($object->element == 'ecm_directories') { |
@@ -10122,9 +10122,9 @@ discard block |
||
| 10122 | 10122 | } |
| 10123 | 10123 | |
| 10124 | 10124 | // Barcode image @phan-suppress-next-line PhanUndeclaredProperty |
| 10125 | - $url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code); |
|
| 10126 | - $out = '<!-- url barcode = ' . $url . ' -->'; |
|
| 10127 | - $out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>'; |
|
| 10125 | + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); |
|
| 10126 | + $out = '<!-- url barcode = '.$url.' -->'; |
|
| 10127 | + $out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>'; |
|
| 10128 | 10128 | |
| 10129 | 10129 | return $out; |
| 10130 | 10130 | } |
@@ -10151,7 +10151,7 @@ discard block |
||
| 10151 | 10151 | global $conf, $langs; |
| 10152 | 10152 | |
| 10153 | 10153 | $entity = (empty($object->entity) ? $conf->entity : $object->entity); |
| 10154 | - $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
|
| 10154 | + $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
|
| 10155 | 10155 | |
| 10156 | 10156 | $dir = ''; |
| 10157 | 10157 | $file = ''; |
@@ -10164,28 +10164,28 @@ discard block |
||
| 10164 | 10164 | if (!empty($object->logo)) { |
| 10165 | 10165 | if (dolIsAllowedForPreview($object->logo)) { |
| 10166 | 10166 | if ((string) $imagesize == 'mini') { |
| 10167 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 10167 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 10168 | 10168 | } elseif ((string) $imagesize == 'small') { |
| 10169 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small'); |
|
| 10169 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); |
|
| 10170 | 10170 | } else { |
| 10171 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 10171 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 10172 | 10172 | } |
| 10173 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 10173 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 10174 | 10174 | } |
| 10175 | 10175 | } |
| 10176 | 10176 | $email = $object->email; |
| 10177 | 10177 | } elseif ($modulepart == 'contact') { |
| 10178 | - $dir = $conf->societe->multidir_output[$entity] . '/contact'; |
|
| 10178 | + $dir = $conf->societe->multidir_output[$entity].'/contact'; |
|
| 10179 | 10179 | if (!empty($object->photo)) { |
| 10180 | 10180 | if (dolIsAllowedForPreview($object->photo)) { |
| 10181 | 10181 | if ((string) $imagesize == 'mini') { |
| 10182 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 10182 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 10183 | 10183 | } elseif ((string) $imagesize == 'small') { |
| 10184 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 10184 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 10185 | 10185 | } else { |
| 10186 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 10186 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 10187 | 10187 | } |
| 10188 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 10188 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 10189 | 10189 | } |
| 10190 | 10190 | } |
| 10191 | 10191 | $email = $object->email; |
@@ -10195,17 +10195,17 @@ discard block |
||
| 10195 | 10195 | if (!empty($object->photo)) { |
| 10196 | 10196 | if (dolIsAllowedForPreview($object->photo)) { |
| 10197 | 10197 | if ((string) $imagesize == 'mini') { |
| 10198 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 10198 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 10199 | 10199 | } elseif ((string) $imagesize == 'small') { |
| 10200 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 10200 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 10201 | 10201 | } else { |
| 10202 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 10202 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 10203 | 10203 | } |
| 10204 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 10204 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 10205 | 10205 | } |
| 10206 | 10206 | } |
| 10207 | 10207 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 10208 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 10208 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 10209 | 10209 | } |
| 10210 | 10210 | $email = $object->email; |
| 10211 | 10211 | $capture = 'user'; |
@@ -10214,17 +10214,17 @@ discard block |
||
| 10214 | 10214 | if (!empty($object->photo)) { |
| 10215 | 10215 | if (dolIsAllowedForPreview($object->photo)) { |
| 10216 | 10216 | if ((string) $imagesize == 'mini') { |
| 10217 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 10217 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 10218 | 10218 | } elseif ((string) $imagesize == 'small') { |
| 10219 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 10219 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 10220 | 10220 | } else { |
| 10221 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 10221 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 10222 | 10222 | } |
| 10223 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 10223 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 10224 | 10224 | } |
| 10225 | 10225 | } |
| 10226 | 10226 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 10227 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 10227 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 10228 | 10228 | } |
| 10229 | 10229 | $email = $object->email; |
| 10230 | 10230 | $capture = 'user'; |
@@ -10250,35 +10250,35 @@ discard block |
||
| 10250 | 10250 | $ret = ''; |
| 10251 | 10251 | |
| 10252 | 10252 | if ($dir) { |
| 10253 | - if ($file && file_exists($dir . "/" . $file)) { |
|
| 10253 | + if ($file && file_exists($dir."/".$file)) { |
|
| 10254 | 10254 | if ($addlinktofullsize) { |
| 10255 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 10255 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 10256 | 10256 | if ($urladvanced) { |
| 10257 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 10257 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 10258 | 10258 | } else { |
| 10259 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 10259 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 10260 | 10260 | } |
| 10261 | 10261 | } |
| 10262 | - $ret .= '<img alt="" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">'; |
|
| 10262 | + $ret .= '<img alt="" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">'; |
|
| 10263 | 10263 | if ($addlinktofullsize) { |
| 10264 | 10264 | $ret .= '</a>'; |
| 10265 | 10265 | } |
| 10266 | - } elseif ($altfile && file_exists($dir . "/" . $altfile)) { |
|
| 10266 | + } elseif ($altfile && file_exists($dir."/".$altfile)) { |
|
| 10267 | 10267 | if ($addlinktofullsize) { |
| 10268 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 10268 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 10269 | 10269 | if ($urladvanced) { |
| 10270 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 10270 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 10271 | 10271 | } else { |
| 10272 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 10272 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 10273 | 10273 | } |
| 10274 | 10274 | } |
| 10275 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="Photo alt" id="photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" class="' . $cssclass . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($altfile) . '&cache=' . $cache . '">'; |
|
| 10275 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" class="'.$cssclass.'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">'; |
|
| 10276 | 10276 | if ($addlinktofullsize) { |
| 10277 | 10277 | $ret .= '</a>'; |
| 10278 | 10278 | } |
| 10279 | 10279 | } else { |
| 10280 | 10280 | $nophoto = '/public/theme/common/nophoto.png'; |
| 10281 | - $defaultimg = 'identicon'; // For gravatar |
|
| 10281 | + $defaultimg = 'identicon'; // For gravatar |
|
| 10282 | 10282 | if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found |
| 10283 | 10283 | if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) { |
| 10284 | 10284 | $nophoto = 'company'; |
@@ -10296,13 +10296,13 @@ discard block |
||
| 10296 | 10296 | if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { |
| 10297 | 10297 | // see https://gravatar.com/site/implement/images/php/ |
| 10298 | 10298 | $ret .= '<!-- Put link to gravatar -->'; |
| 10299 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" title="' . $email . ' Gravatar avatar" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="https://www.gravatar.com/avatar/' . dol_hash(strtolower(trim($email)), 'sha256', 1) . '?s=' . $width . '&d=' . $defaultimg . '">'; // gravatar need md5 hash |
|
| 10299 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)), 'sha256', 1).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash |
|
| 10300 | 10300 | } else { |
| 10301 | 10301 | if ($nophoto == 'company') { |
| 10302 | - $ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>'; |
|
| 10302 | + $ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>'; |
|
| 10303 | 10303 | //$ret .= '<div class="difforspanimgright"></div>'; |
| 10304 | 10304 | } else { |
| 10305 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">'; |
|
| 10305 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; |
|
| 10306 | 10306 | } |
| 10307 | 10307 | } |
| 10308 | 10308 | } |
@@ -10313,15 +10313,15 @@ discard block |
||
| 10313 | 10313 | } |
| 10314 | 10314 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 10315 | 10315 | if ($object->photo) { |
| 10316 | - $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>'; |
|
| 10316 | + $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>'; |
|
| 10317 | 10317 | } |
| 10318 | 10318 | $ret .= '<tr><td class="tdoverflow">'; |
| 10319 | 10319 | $maxfilesizearray = getMaxFileSizeArray(); |
| 10320 | 10320 | $maxmin = $maxfilesizearray['maxmin']; |
| 10321 | 10321 | if ($maxmin > 0) { |
| 10322 | - $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10322 | + $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10323 | 10323 | } |
| 10324 | - $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>'; |
|
| 10324 | + $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>'; |
|
| 10325 | 10325 | $ret .= '</td></tr>'; |
| 10326 | 10326 | $ret .= '</table>'; |
| 10327 | 10327 | } |
@@ -10375,38 +10375,38 @@ discard block |
||
| 10375 | 10375 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10376 | 10376 | $sql .= ", e.label"; |
| 10377 | 10377 | } |
| 10378 | - $sql .= " FROM " . $this->db->prefix() . "usergroup as ug "; |
|
| 10378 | + $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; |
|
| 10379 | 10379 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10380 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity"; |
|
| 10380 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; |
|
| 10381 | 10381 | if ($force_entity) { |
| 10382 | - $sql .= " WHERE ug.entity IN (0, " . $force_entity . ")"; |
|
| 10382 | + $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; |
|
| 10383 | 10383 | } else { |
| 10384 | 10384 | $sql .= " WHERE ug.entity IS NOT NULL"; |
| 10385 | 10385 | } |
| 10386 | 10386 | } else { |
| 10387 | - $sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")"; |
|
| 10387 | + $sql .= " WHERE ug.entity IN (0, ".$conf->entity.")"; |
|
| 10388 | 10388 | } |
| 10389 | 10389 | if (is_array($exclude) && $excludeGroups) { |
| 10390 | - $sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")"; |
|
| 10390 | + $sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")"; |
|
| 10391 | 10391 | } |
| 10392 | 10392 | if (is_array($include) && $includeGroups) { |
| 10393 | - $sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")"; |
|
| 10393 | + $sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")"; |
|
| 10394 | 10394 | } |
| 10395 | 10395 | $sql .= " ORDER BY ug.nom ASC"; |
| 10396 | 10396 | |
| 10397 | - dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG); |
|
| 10397 | + dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); |
|
| 10398 | 10398 | $resql = $this->db->query($sql); |
| 10399 | 10399 | if ($resql) { |
| 10400 | 10400 | // Enhance with select2 |
| 10401 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10401 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10402 | 10402 | |
| 10403 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 10403 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 10404 | 10404 | |
| 10405 | 10405 | $num = $this->db->num_rows($resql); |
| 10406 | 10406 | $i = 0; |
| 10407 | 10407 | if ($num) { |
| 10408 | 10408 | if ($show_empty && !$multiple) { |
| 10409 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 10409 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'> </option>'."\n"; |
|
| 10410 | 10410 | } |
| 10411 | 10411 | |
| 10412 | 10412 | while ($i < $num) { |
@@ -10419,11 +10419,11 @@ discard block |
||
| 10419 | 10419 | $label = $obj->name; |
| 10420 | 10420 | $labelhtml = $obj->name; |
| 10421 | 10421 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) { |
| 10422 | - $label .= " (" . $obj->label . ")"; |
|
| 10423 | - $labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>'; |
|
| 10422 | + $label .= " (".$obj->label.")"; |
|
| 10423 | + $labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>'; |
|
| 10424 | 10424 | } |
| 10425 | 10425 | |
| 10426 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 10426 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 10427 | 10427 | if ($disableline) { |
| 10428 | 10428 | $out .= ' disabled'; |
| 10429 | 10429 | } |
@@ -10439,9 +10439,9 @@ discard block |
||
| 10439 | 10439 | } |
| 10440 | 10440 | } else { |
| 10441 | 10441 | if ($show_empty) { |
| 10442 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n"; |
|
| 10442 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n"; |
|
| 10443 | 10443 | } |
| 10444 | - $out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>'; |
|
| 10444 | + $out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>'; |
|
| 10445 | 10445 | } |
| 10446 | 10446 | $out .= '</select>'; |
| 10447 | 10447 | |
@@ -10485,25 +10485,25 @@ discard block |
||
| 10485 | 10485 | $out = ''; |
| 10486 | 10486 | |
| 10487 | 10487 | if (!empty($conf->use_javascript_ajax)) { |
| 10488 | - $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>'; |
|
| 10488 | + $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>'; |
|
| 10489 | 10489 | } |
| 10490 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10490 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10491 | 10491 | $(document).ready(function() { |
| 10492 | - $("#' . $cssclass . 's").click(function() { |
|
| 10492 | + $("#' . $cssclass.'s").click(function() { |
|
| 10493 | 10493 | if($(this).is(\':checked\')){ |
| 10494 | - console.log("We check all ' . $cssclass . ' and trigger the change method"); |
|
| 10495 | - $(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\'); |
|
| 10494 | + console.log("We check all ' . $cssclass.' and trigger the change method"); |
|
| 10495 | + $(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\'); |
|
| 10496 | 10496 | } |
| 10497 | 10497 | else |
| 10498 | 10498 | { |
| 10499 | 10499 | console.log("We uncheck all"); |
| 10500 | - $(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\'); |
|
| 10500 | + $(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\'); |
|
| 10501 | 10501 | }' . "\n"; |
| 10502 | 10502 | if ($calljsfunction) { |
| 10503 | - $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10503 | + $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10504 | 10504 | } |
| 10505 | 10505 | $out .= ' }); |
| 10506 | - $(".' . $cssclass . '").change(function() { |
|
| 10506 | + $(".' . $cssclass.'").change(function() { |
|
| 10507 | 10507 | $(this).closest("tr").toggleClass("highlight", this.checked); |
| 10508 | 10508 | }); |
| 10509 | 10509 | }); |
@@ -10548,67 +10548,67 @@ discard block |
||
| 10548 | 10548 | global $langs, $user; |
| 10549 | 10549 | |
| 10550 | 10550 | $out = ''; |
| 10551 | - $sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1"; |
|
| 10552 | - $sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")"; |
|
| 10551 | + $sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1"; |
|
| 10552 | + $sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")"; |
|
| 10553 | 10553 | if (!empty($excludeid)) { |
| 10554 | - $sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")"; |
|
| 10554 | + $sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")"; |
|
| 10555 | 10555 | } |
| 10556 | 10556 | $sql .= " ORDER BY label"; |
| 10557 | 10557 | |
| 10558 | 10558 | $resql = $this->db->query($sql); |
| 10559 | 10559 | if ($resql) { |
| 10560 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">'; |
|
| 10560 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">'; |
|
| 10561 | 10561 | if ($useempty) { |
| 10562 | 10562 | $out .= '<option value="0"> </option>'; |
| 10563 | 10563 | } |
| 10564 | 10564 | |
| 10565 | 10565 | while ($obj = $this->db->fetch_object($resql)) { |
| 10566 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>'; |
|
| 10566 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>'; |
|
| 10567 | 10567 | } |
| 10568 | 10568 | $out .= '</select>'; |
| 10569 | - $out .= ajax_combobox('select_' . $htmlname); |
|
| 10569 | + $out .= ajax_combobox('select_'.$htmlname); |
|
| 10570 | 10570 | |
| 10571 | 10571 | if (!empty($htmlname) && $user->admin && $info_admin) { |
| 10572 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10572 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10573 | 10573 | } |
| 10574 | 10574 | |
| 10575 | 10575 | if (!empty($target)) { |
| 10576 | - $sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10576 | + $sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10577 | 10577 | $resql = $this->db->query($sql); |
| 10578 | 10578 | if ($resql) { |
| 10579 | 10579 | if ($this->db->num_rows($resql) > 0) { |
| 10580 | 10580 | $obj = $this->db->fetch_object($resql); |
| 10581 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10581 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10582 | 10582 | $(function() { |
| 10583 | - $("select[name=' . $target . ']").on("change", function() { |
|
| 10583 | + $("select[name=' . $target.']").on("change", function() { |
|
| 10584 | 10584 | var current_val = $(this).val(); |
| 10585 | - if (current_val == ' . $obj->id . ') {'; |
|
| 10585 | + if (current_val == ' . $obj->id.') {'; |
|
| 10586 | 10586 | if (!empty($default_selected) || !empty($selected)) { |
| 10587 | - $out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");'; |
|
| 10587 | + $out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");'; |
|
| 10588 | 10588 | } |
| 10589 | 10589 | |
| 10590 | 10590 | $out .= ' |
| 10591 | - $("select[name=' . $htmlname . ']").change(); |
|
| 10591 | + $("select[name=' . $htmlname.']").change(); |
|
| 10592 | 10592 | } |
| 10593 | 10593 | }); |
| 10594 | 10594 | |
| 10595 | - $("select[name=' . $htmlname . ']").change(function() { |
|
| 10595 | + $("select[name=' . $htmlname.']").change(function() { |
|
| 10596 | 10596 | |
| 10597 | - if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') { |
|
| 10597 | + if ($("select[name=' . $target.']").val() == '.$obj->id.') { |
|
| 10598 | 10598 | // get price of kilometer to fill the unit price |
| 10599 | 10599 | $.ajax({ |
| 10600 | 10600 | method: "POST", |
| 10601 | 10601 | dataType: "json", |
| 10602 | - data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' }, |
|
| 10603 | - url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '", |
|
| 10602 | + data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' }, |
|
| 10603 | + url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'", |
|
| 10604 | 10604 | }).done(function( data, textStatus, jqXHR ) { |
| 10605 | 10605 | console.log(data); |
| 10606 | 10606 | if (typeof data.up != "undefined") { |
| 10607 | 10607 | $("input[name=value_unit]").val(data.up); |
| 10608 | - $("select[name=' . $htmlname . ']").attr("title", data.title); |
|
| 10608 | + $("select[name=' . $htmlname.']").attr("title", data.title); |
|
| 10609 | 10609 | } else { |
| 10610 | 10610 | $("input[name=value_unit]").val(""); |
| 10611 | - $("select[name=' . $htmlname . ']").attr("title", ""); |
|
| 10611 | + $("select[name=' . $htmlname.']").attr("title", ""); |
|
| 10612 | 10612 | } |
| 10613 | 10613 | }); |
| 10614 | 10614 | } |
@@ -10638,18 +10638,18 @@ discard block |
||
| 10638 | 10638 | global $conf, $langs; |
| 10639 | 10639 | |
| 10640 | 10640 | $out = ''; |
| 10641 | - $sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range"; |
|
| 10642 | - $sql .= " WHERE entity = " . $conf->entity . " AND active = 1"; |
|
| 10641 | + $sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range"; |
|
| 10642 | + $sql .= " WHERE entity = ".$conf->entity." AND active = 1"; |
|
| 10643 | 10643 | |
| 10644 | 10644 | $resql = $this->db->query($sql); |
| 10645 | 10645 | if ($resql) { |
| 10646 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10646 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10647 | 10647 | if ($useempty) { |
| 10648 | 10648 | $out .= '<option value="0"></option>'; |
| 10649 | 10649 | } |
| 10650 | 10650 | |
| 10651 | 10651 | while ($obj = $this->db->fetch_object($resql)) { |
| 10652 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>'; |
|
| 10652 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>'; |
|
| 10653 | 10653 | } |
| 10654 | 10654 | $out .= '</select>'; |
| 10655 | 10655 | } else { |
@@ -10680,12 +10680,12 @@ discard block |
||
| 10680 | 10680 | |
| 10681 | 10681 | $resql = $this->db->query($sql); |
| 10682 | 10682 | if ($resql) { |
| 10683 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10683 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10684 | 10684 | if ($useempty) { |
| 10685 | 10685 | $out .= '<option value="0"></option>'; |
| 10686 | 10686 | } |
| 10687 | 10687 | if ($allchoice) { |
| 10688 | - $out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>'; |
|
| 10688 | + $out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>'; |
|
| 10689 | 10689 | } |
| 10690 | 10690 | |
| 10691 | 10691 | $field = 'code'; |
@@ -10695,7 +10695,7 @@ discard block |
||
| 10695 | 10695 | |
| 10696 | 10696 | while ($obj = $this->db->fetch_object($resql)) { |
| 10697 | 10697 | $key = $langs->trans($obj->code); |
| 10698 | - $out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>'; |
|
| 10698 | + $out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>'; |
|
| 10699 | 10699 | } |
| 10700 | 10700 | $out .= '</select>'; |
| 10701 | 10701 | |
@@ -10729,7 +10729,7 @@ discard block |
||
| 10729 | 10729 | { |
| 10730 | 10730 | global $user, $conf, $langs; |
| 10731 | 10731 | |
| 10732 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 10732 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 10733 | 10733 | |
| 10734 | 10734 | if (is_null($usertofilter)) { |
| 10735 | 10735 | $usertofilter = $user; |
@@ -10753,10 +10753,10 @@ discard block |
||
| 10753 | 10753 | $sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, |
| 10754 | 10754 | p.title, p.fk_soc, p.fk_statut, p.public,"; |
| 10755 | 10755 | $sql .= ' s.nom as name'; |
| 10756 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
| 10757 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10758 | - $sql .= ' ' . $this->db->prefix() . 'facture as f'; |
|
| 10759 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
| 10756 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
| 10757 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10758 | + $sql .= ' '.$this->db->prefix().'facture as f'; |
|
| 10759 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
| 10760 | 10760 | $sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement |
| 10761 | 10761 | //if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
| 10762 | 10762 | //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
@@ -10767,14 +10767,14 @@ discard block |
||
| 10767 | 10767 | if ($resql) { |
| 10768 | 10768 | // Use select2 selector |
| 10769 | 10769 | if (!empty($conf->use_javascript_ajax)) { |
| 10770 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10770 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10771 | 10771 | $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
| 10772 | 10772 | $out .= $comboenhancement; |
| 10773 | 10773 | $morecss = 'minwidth200imp maxwidth500'; |
| 10774 | 10774 | } |
| 10775 | 10775 | |
| 10776 | 10776 | if (empty($option_only)) { |
| 10777 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10777 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10778 | 10778 | } |
| 10779 | 10779 | if (!empty($show_empty)) { |
| 10780 | 10780 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10804,33 +10804,33 @@ discard block |
||
| 10804 | 10804 | if ($showproject == 'all') { |
| 10805 | 10805 | $labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref |
| 10806 | 10806 | if ($obj->name) { |
| 10807 | - $labeltoshow .= ' - ' . $obj->name; // Soc name |
|
| 10807 | + $labeltoshow .= ' - '.$obj->name; // Soc name |
|
| 10808 | 10808 | } |
| 10809 | 10809 | |
| 10810 | 10810 | $disabled = 0; |
| 10811 | 10811 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
| 10812 | 10812 | $disabled = 1; |
| 10813 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
| 10813 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
| 10814 | 10814 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
| 10815 | 10815 | if ($discard_closed == 2) { |
| 10816 | 10816 | $disabled = 1; |
| 10817 | 10817 | } |
| 10818 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10818 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10819 | 10819 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
| 10820 | 10820 | $disabled = 1; |
| 10821 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
| 10821 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
| 10822 | 10822 | } |
| 10823 | 10823 | } |
| 10824 | 10824 | |
| 10825 | 10825 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10826 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10826 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10827 | 10827 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10828 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10828 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10829 | 10829 | } else { |
| 10830 | 10830 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
| 10831 | 10831 | $resultat = ''; |
| 10832 | 10832 | } else { |
| 10833 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10833 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10834 | 10834 | if ($disabled) { |
| 10835 | 10835 | $resultat .= ' disabled'; |
| 10836 | 10836 | } |
@@ -10882,22 +10882,22 @@ discard block |
||
| 10882 | 10882 | |
| 10883 | 10883 | $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc'; |
| 10884 | 10884 | //$sql.= ', el.fk_source'; |
| 10885 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f'; |
|
| 10886 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
| 10885 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; |
|
| 10886 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
|
| 10887 | 10887 | $sql .= " ORDER BY f.titre ASC"; |
| 10888 | 10888 | |
| 10889 | 10889 | $resql = $this->db->query($sql); |
| 10890 | 10890 | if ($resql) { |
| 10891 | 10891 | // Use select2 selector |
| 10892 | 10892 | if (!empty($conf->use_javascript_ajax)) { |
| 10893 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10893 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10894 | 10894 | $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
| 10895 | 10895 | $out .= $comboenhancement; |
| 10896 | 10896 | $morecss = 'minwidth200imp maxwidth500'; |
| 10897 | 10897 | } |
| 10898 | 10898 | |
| 10899 | 10899 | if (empty($option_only)) { |
| 10900 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10900 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10901 | 10901 | } |
| 10902 | 10902 | if (!empty($show_empty)) { |
| 10903 | 10903 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10916,19 +10916,19 @@ discard block |
||
| 10916 | 10916 | $disabled = 0; |
| 10917 | 10917 | if (!empty($obj->suspended)) { |
| 10918 | 10918 | $disabled = 1; |
| 10919 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10919 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10920 | 10920 | } |
| 10921 | 10921 | |
| 10922 | 10922 | |
| 10923 | 10923 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10924 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10924 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10925 | 10925 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10926 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10926 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10927 | 10927 | } else { |
| 10928 | 10928 | if ($disabled && ($selected != $obj->rowid)) { |
| 10929 | 10929 | $resultat = ''; |
| 10930 | 10930 | } else { |
| 10931 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10931 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10932 | 10932 | if ($disabled) { |
| 10933 | 10933 | $resultat .= ' disabled'; |
| 10934 | 10934 | } |
@@ -10968,14 +10968,14 @@ discard block |
||
| 10968 | 10968 | global $langs; |
| 10969 | 10969 | |
| 10970 | 10970 | if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) { // If $search_component_params_hidden does not start and end with () |
| 10971 | - $search_component_params_hidden = '(' . $search_component_params_hidden . ')'; |
|
| 10971 | + $search_component_params_hidden = '('.$search_component_params_hidden.')'; |
|
| 10972 | 10972 | } |
| 10973 | 10973 | |
| 10974 | 10974 | $ret = ''; |
| 10975 | 10975 | |
| 10976 | 10976 | $ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">'; |
| 10977 | 10977 | $ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; |
| 10978 | - $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>'; |
|
| 10978 | + $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>'; |
|
| 10979 | 10979 | $ret .= '</a>'; |
| 10980 | 10980 | |
| 10981 | 10981 | $ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">'; |
@@ -11019,29 +11019,29 @@ discard block |
||
| 11019 | 11019 | $ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">'; |
| 11020 | 11020 | } |
| 11021 | 11021 | $ret .= "<!-- We store the full Universal Search String into this field. For example: (t.ref:like:'SO-%') AND ((t.ref:like:'CO-%') OR (t.ref:like:'AA%')) -->"; |
| 11022 | - $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">'; |
|
| 11022 | + $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">'; |
|
| 11023 | 11023 | // $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->"; |
| 11024 | 11024 | |
| 11025 | 11025 | // For compatibility with forms that show themself the search criteria in addition of this component, we output these fields |
| 11026 | 11026 | foreach ($arrayofcriterias as $criteria) { |
| 11027 | 11027 | foreach ($criteria as $criteriafamilykey => $criteriafamilyval) { |
| 11028 | - if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 11028 | + if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 11029 | 11029 | continue; |
| 11030 | 11030 | } |
| 11031 | 11031 | if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) { |
| 11032 | 11032 | continue; |
| 11033 | 11033 | } |
| 11034 | 11034 | if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { |
| 11035 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">'; |
|
| 11036 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">'; |
|
| 11037 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">'; |
|
| 11038 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">'; |
|
| 11039 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">'; |
|
| 11040 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">'; |
|
| 11041 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">'; |
|
| 11042 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">'; |
|
| 11035 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">'; |
|
| 11036 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">'; |
|
| 11037 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">'; |
|
| 11038 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">'; |
|
| 11039 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">'; |
|
| 11040 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">'; |
|
| 11041 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">'; |
|
| 11042 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">'; |
|
| 11043 | 11043 | } else { |
| 11044 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">'; |
|
| 11044 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">'; |
|
| 11045 | 11045 | } |
| 11046 | 11046 | } |
| 11047 | 11047 | } |
@@ -11049,7 +11049,7 @@ discard block |
||
| 11049 | 11049 | $ret .= '</div>'; |
| 11050 | 11050 | |
| 11051 | 11051 | $ret .= "<!-- Field to enter a generic filter string: t.ref:like:'SO-%', t.date_creation:<:'20160101', t.date_creation:<:'2016-01-01 12:30:00', t.nature:is:NULL, t.field2:isnot:NULL -->\n"; |
| 11052 | - $ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 11052 | + $ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 11053 | 11053 | |
| 11054 | 11054 | $ret .= '</div>'; |
| 11055 | 11055 | $ret .= '</div>'; |
@@ -11123,7 +11123,7 @@ discard block |
||
| 11123 | 11123 | |
| 11124 | 11124 | $TModels = array(); |
| 11125 | 11125 | |
| 11126 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 11126 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
| 11127 | 11127 | $formmail = new FormMail($this->db); |
| 11128 | 11128 | $result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); |
| 11129 | 11129 | |
@@ -11136,17 +11136,17 @@ discard block |
||
| 11136 | 11136 | } |
| 11137 | 11137 | } |
| 11138 | 11138 | |
| 11139 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">'; |
|
| 11139 | + $retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">'; |
|
| 11140 | 11140 | |
| 11141 | 11141 | foreach ($TModels as $id_model => $label_model) { |
| 11142 | - $retstring .= '<option value="' . $id_model . '"'; |
|
| 11143 | - $retstring .= ">" . $label_model . "</option>"; |
|
| 11142 | + $retstring .= '<option value="'.$id_model.'"'; |
|
| 11143 | + $retstring .= ">".$label_model."</option>"; |
|
| 11144 | 11144 | } |
| 11145 | 11145 | |
| 11146 | 11146 | $retstring .= "</select>"; |
| 11147 | 11147 | |
| 11148 | 11148 | if ($addjscombo) { |
| 11149 | - $retstring .= ajax_combobox('select_' . $prefix . 'model_mail'); |
|
| 11149 | + $retstring .= ajax_combobox('select_'.$prefix.'model_mail'); |
|
| 11150 | 11150 | } |
| 11151 | 11151 | |
| 11152 | 11152 | return $retstring; |
@@ -11197,16 +11197,16 @@ discard block |
||
| 11197 | 11197 | |
| 11198 | 11198 | foreach ($buttons as $button) { |
| 11199 | 11199 | $addclass = empty($button['addclass']) ? '' : $button['addclass']; |
| 11200 | - $retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">'; |
|
| 11200 | + $retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">'; |
|
| 11201 | 11201 | } |
| 11202 | 11202 | $retstring .= $withoutdiv ? '' : '</div>'; |
| 11203 | 11203 | |
| 11204 | 11204 | if ($dol_openinpopup) { |
| 11205 | - $retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . dol_escape_htmltag($dol_openinpopup) . ' context, so we enable the close of dialog on cancel -->' . "\n"; |
|
| 11206 | - $retstring .= '<script nonce="' . getNonce() . '">'; |
|
| 11205 | + $retstring .= '<!-- buttons are shown into a $dol_openinpopup='.dol_escape_htmltag($dol_openinpopup).' context, so we enable the close of dialog on cancel -->'."\n"; |
|
| 11206 | + $retstring .= '<script nonce="'.getNonce().'">'; |
|
| 11207 | 11207 | $retstring .= 'jQuery(".button-cancel").click(function(e) { |
| 11208 | - e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup) . '\'); |
|
| 11209 | - window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup) . '\').dialog(\'close\'); |
|
| 11208 | + e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup).'\'); |
|
| 11209 | + window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup).'\').dialog(\'close\'); |
|
| 11210 | 11210 | });'; |
| 11211 | 11211 | $retstring .= '</script>'; |
| 11212 | 11212 | } |
@@ -11235,7 +11235,7 @@ discard block |
||
| 11235 | 11235 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 11236 | 11236 | |
| 11237 | 11237 | $sql = "SELECT rowid, code, label as label"; |
| 11238 | - $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
| 11238 | + $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
|
| 11239 | 11239 | $sql .= " WHERE active = 1"; |
| 11240 | 11240 | |
| 11241 | 11241 | $resql = $this->db->query($sql); |
@@ -11246,7 +11246,7 @@ discard block |
||
| 11246 | 11246 | $obj = $this->db->fetch_object($resql); |
| 11247 | 11247 | |
| 11248 | 11248 | // If translation exists, we use it, otherwise we take the default wording |
| 11249 | - $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 11249 | + $label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 11250 | 11250 | $this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid; |
| 11251 | 11251 | $this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code; |
| 11252 | 11252 | $this->cache_invoice_subtype[$obj->rowid]['label'] = $label; |
@@ -11278,18 +11278,18 @@ discard block |
||
| 11278 | 11278 | global $langs, $user; |
| 11279 | 11279 | |
| 11280 | 11280 | $out = ''; |
| 11281 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 11281 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 11282 | 11282 | |
| 11283 | 11283 | $this->load_cache_invoice_subtype(); |
| 11284 | 11284 | |
| 11285 | - $out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 11285 | + $out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 11286 | 11286 | if ($addempty) { |
| 11287 | 11287 | $out .= '<option value="0"> </option>'; |
| 11288 | 11288 | } |
| 11289 | 11289 | |
| 11290 | 11290 | foreach ($this->cache_invoice_subtype as $rowid => $subtype) { |
| 11291 | 11291 | $label = $subtype['label']; |
| 11292 | - $out .= '<option value="' . $subtype['rowid'] . '"'; |
|
| 11292 | + $out .= '<option value="'.$subtype['rowid'].'"'; |
|
| 11293 | 11293 | if ($selected == $subtype['rowid']) { |
| 11294 | 11294 | $out .= ' selected="selected"'; |
| 11295 | 11295 | } |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | if (empty($error)) { |
| 574 | 574 | return $result; |
| 575 | 575 | } else { |
| 576 | - return $error*-1; |
|
| 576 | + return $error * -1; |
|
| 577 | 577 | } |
| 578 | 578 | } else { |
| 579 | 579 | return 0; |
@@ -1151,7 +1151,7 @@ discard block |
||
| 1151 | 1151 | 'start' => isset($value['start']) ? $value['start'] : '', |
| 1152 | 1152 | 'end' => isset($value['end']) ? $value['end'] : '' |
| 1153 | 1153 | ); |
| 1154 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
| 1154 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
| 1155 | 1155 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); |
| 1156 | 1156 | $out .= '</div><div class="nowrap">'; |
| 1157 | 1157 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); |
@@ -1176,7 +1176,7 @@ discard block |
||
| 1176 | 1176 | 'start' => isset($value['start']) ? $value['start'] : '', |
| 1177 | 1177 | 'end' => isset($value['end']) ? $value['end'] : '' |
| 1178 | 1178 | ); |
| 1179 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
| 1179 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
| 1180 | 1180 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel'); |
| 1181 | 1181 | $out .= '</div><div class="nowrap">'; |
| 1182 | 1182 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
@@ -1246,7 +1246,7 @@ discard block |
||
| 1246 | 1246 | } else { |
| 1247 | 1247 | $out = $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1, 1, 'width75 yesno'); |
| 1248 | 1248 | } |
| 1249 | - $out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1. |
|
| 1249 | + $out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1. |
|
| 1250 | 1250 | } elseif ($type == 'price') { |
| 1251 | 1251 | if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format. |
| 1252 | 1252 | $value = price($value); |
@@ -1346,8 +1346,8 @@ discard block |
||
| 1346 | 1346 | // 7 : sort field (not used here but used into format for commobject) |
| 1347 | 1347 | |
| 1348 | 1348 | // If there is a filter, we extract it by taking all content inside parenthesis. |
| 1349 | - if (! empty($InfoFieldList[4])) { |
|
| 1350 | - $pos = 0; // $pos will be position of ending filter |
|
| 1349 | + if (!empty($InfoFieldList[4])) { |
|
| 1350 | + $pos = 0; // $pos will be position of ending filter |
|
| 1351 | 1351 | $parenthesisopen = 0; |
| 1352 | 1352 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
| 1353 | 1353 | if (substr($InfoFieldList[4], $pos, 1) == '(') { |
@@ -1434,9 +1434,9 @@ discard block |
||
| 1434 | 1434 | if (strpos($InfoFieldList[4], 'extra.') !== false) { |
| 1435 | 1435 | $sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra'; |
| 1436 | 1436 | $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
| 1437 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1437 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1438 | 1438 | } else { |
| 1439 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1439 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1440 | 1440 | } |
| 1441 | 1441 | } else { |
| 1442 | 1442 | $sqlwhere .= ' WHERE 1=1'; |
@@ -1571,7 +1571,7 @@ discard block |
||
| 1571 | 1571 | // 7 : sort field (not used here but used into format for commobject) |
| 1572 | 1572 | |
| 1573 | 1573 | // If there is a filter, we extract it by taking all content inside parenthesis. |
| 1574 | - if (! empty($InfoFieldList[4])) { |
|
| 1574 | + if (!empty($InfoFieldList[4])) { |
|
| 1575 | 1575 | $pos = 0; |
| 1576 | 1576 | $parenthesisopen = 0; |
| 1577 | 1577 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -1707,9 +1707,9 @@ discard block |
||
| 1707 | 1707 | if (strpos($InfoFieldList[4], 'extra.') !== false) { |
| 1708 | 1708 | $sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra'; |
| 1709 | 1709 | $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
| 1710 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1710 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1711 | 1711 | } else { |
| 1712 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1712 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1713 | 1713 | } |
| 1714 | 1714 | } else { |
| 1715 | 1715 | $sqlwhere .= ' WHERE 1=1'; |
@@ -1824,7 +1824,7 @@ discard block |
||
| 1824 | 1824 | |
| 1825 | 1825 | $tmparray = explode(':', $param_list[0]); |
| 1826 | 1826 | |
| 1827 | - $element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element |
|
| 1827 | + $element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element |
|
| 1828 | 1828 | if ($element == 'socpeople') { |
| 1829 | 1829 | $element = 'contact'; |
| 1830 | 1830 | } elseif ($element == 'projet') { |
@@ -1832,8 +1832,8 @@ discard block |
||
| 1832 | 1832 | } |
| 1833 | 1833 | |
| 1834 | 1834 | //$objectdesc = $param_list[0]; // Example: 'ObjectName:classPath:1:(status:=:1)' Replaced by next line: this was propagated also a filter by ajax call that was blocked by some WAF |
| 1835 | - $objectdesc = $tmparray[0]; // Example: 'ObjectName:classPath' To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found. |
|
| 1836 | - $objectfield = $element.':options_'.$key; // Example: 'actioncomm:options_fff' To be used in priority to know object linked with all its definition (including filters) |
|
| 1835 | + $objectdesc = $tmparray[0]; // Example: 'ObjectName:classPath' To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found. |
|
| 1836 | + $objectfield = $element.':options_'.$key; // Example: 'actioncomm:options_fff' To be used in priority to know object linked with all its definition (including filters) |
|
| 1837 | 1837 | |
| 1838 | 1838 | $out = $form->selectForForms($objectdesc, $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, 0, '', $objectfield); |
| 1839 | 1839 | } elseif (in_array($type, ['point', 'multipts', 'linestrg', 'polygon'])) { |
@@ -1898,7 +1898,7 @@ discard block |
||
| 1898 | 1898 | |
| 1899 | 1899 | $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; |
| 1900 | 1900 | $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; |
| 1901 | - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
| 1901 | + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
| 1902 | 1902 | $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; |
| 1903 | 1903 | $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; |
| 1904 | 1904 | $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; |
@@ -1922,7 +1922,7 @@ discard block |
||
| 1922 | 1922 | if ($type == 'date') { |
| 1923 | 1923 | $showsize = 10; |
| 1924 | 1924 | if ($value !== '') { |
| 1925 | - $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
| 1925 | + $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
| 1926 | 1926 | } |
| 1927 | 1927 | } elseif ($type == 'datetime') { |
| 1928 | 1928 | $showsize = 19; |
@@ -2047,9 +2047,9 @@ discard block |
||
| 2047 | 2047 | $translabel = $outputlangs->trans($obj->$field_toshow); |
| 2048 | 2048 | |
| 2049 | 2049 | if ($translabel != $obj->$field_toshow) { |
| 2050 | - $value .= dol_trunc($translabel, 24) . ' '; |
|
| 2050 | + $value .= dol_trunc($translabel, 24).' '; |
|
| 2051 | 2051 | } else { |
| 2052 | - $value .= $obj->$field_toshow . ' '; |
|
| 2052 | + $value .= $obj->$field_toshow.' '; |
|
| 2053 | 2053 | } |
| 2054 | 2054 | } |
| 2055 | 2055 | } |
@@ -2070,13 +2070,13 @@ discard block |
||
| 2070 | 2070 | $toprint = array(); |
| 2071 | 2071 | $obj = $this->db->fetch_object($resql); |
| 2072 | 2072 | if ($obj->rowid) { |
| 2073 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 2073 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 2074 | 2074 | $c = new Categorie($this->db); |
| 2075 | 2075 | $result = $c->fetch($obj->rowid); |
| 2076 | 2076 | if ($result > 0) { |
| 2077 | 2077 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 2078 | 2078 | foreach ($ways as $way) { |
| 2079 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 2079 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 2080 | 2080 | } |
| 2081 | 2081 | } |
| 2082 | 2082 | } |
@@ -2229,7 +2229,7 @@ discard block |
||
| 2229 | 2229 | } else { |
| 2230 | 2230 | $value = ''; |
| 2231 | 2231 | } |
| 2232 | - } elseif (in_array($type, ['multipts','linestrg', 'polygon'])) { |
|
| 2232 | + } elseif (in_array($type, ['multipts', 'linestrg', 'polygon'])) { |
|
| 2233 | 2233 | if (!empty($value)) { |
| 2234 | 2234 | require_once DOL_DOCUMENT_ROOT.'/core/class/dolgeophp.class.php'; |
| 2235 | 2235 | $dolgeophp = new DolGeoPHP($this->db); |
@@ -2331,12 +2331,12 @@ discard block |
||
| 2331 | 2331 | if ($mode == 'create') { |
| 2332 | 2332 | // On create mode, force separator group to not be collapsible |
| 2333 | 2333 | $extrafield_collapse_display_value = 1; |
| 2334 | - $expand_display = true; // We force group to be shown expanded |
|
| 2334 | + $expand_display = true; // We force group to be shown expanded |
|
| 2335 | 2335 | $disabledcookiewrite = 1; // We keep status of group unchanged into the cookie |
| 2336 | 2336 | } |
| 2337 | 2337 | |
| 2338 | 2338 | $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">'; |
| 2339 | - $out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="' . $colspan . '"' : '').'>'; |
|
| 2339 | + $out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>'; |
|
| 2340 | 2340 | // Some js code will be injected here to manage the collapsing of extrafields |
| 2341 | 2341 | // Output the picto |
| 2342 | 2342 | $out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>'; |
@@ -2418,7 +2418,7 @@ discard block |
||
| 2418 | 2418 | continue; |
| 2419 | 2419 | } |
| 2420 | 2420 | |
| 2421 | - if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) { |
|
| 2421 | + if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) { |
|
| 2422 | 2422 | //when unticking boolean field, it's not set in POST |
| 2423 | 2423 | continue; |
| 2424 | 2424 | } |
@@ -2447,7 +2447,7 @@ discard block |
||
| 2447 | 2447 | $onlykey === '@GETPOSTISSET' |
| 2448 | 2448 | && in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')) |
| 2449 | 2449 | && in_array(abs($enabled), array(2, 5)) |
| 2450 | - && ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided |
|
| 2450 | + && !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided |
|
| 2451 | 2451 | ) |
| 2452 | 2452 | ) { |
| 2453 | 2453 | continue; |
@@ -2584,17 +2584,17 @@ discard block |
||
| 2584 | 2584 | } |
| 2585 | 2585 | |
| 2586 | 2586 | if (in_array($key_type, array('date'))) { |
| 2587 | - $dateparamname_start = $keyprefix . 'options_' . $key . $keysuffix . '_start'; |
|
| 2588 | - $dateparamname_end = $keyprefix . 'options_' . $key . $keysuffix . '_end'; |
|
| 2587 | + $dateparamname_start = $keyprefix.'options_'.$key.$keysuffix.'_start'; |
|
| 2588 | + $dateparamname_end = $keyprefix.'options_'.$key.$keysuffix.'_end'; |
|
| 2589 | 2589 | |
| 2590 | - if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) { |
|
| 2590 | + if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) { |
|
| 2591 | 2591 | $value_key = array(); |
| 2592 | 2592 | // values provided as a component year, month, day, etc. |
| 2593 | - if (GETPOST($dateparamname_start . 'year')) { |
|
| 2594 | - $value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year')); |
|
| 2593 | + if (GETPOST($dateparamname_start.'year')) { |
|
| 2594 | + $value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year')); |
|
| 2595 | 2595 | } |
| 2596 | - if (GETPOST($dateparamname_end . 'year')) { |
|
| 2597 | - $value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year')); |
|
| 2596 | + if (GETPOST($dateparamname_end.'year')) { |
|
| 2597 | + $value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year')); |
|
| 2598 | 2598 | } |
| 2599 | 2599 | } elseif (GETPOST($keyprefix."options_".$key.$keysuffix."year")) { |
| 2600 | 2600 | // Clean parameters |
@@ -2603,26 +2603,26 @@ discard block |
||
| 2603 | 2603 | continue; // Value was not provided, we should not set it. |
| 2604 | 2604 | } |
| 2605 | 2605 | } elseif (in_array($key_type, array('datetime', 'datetimegmt'))) { |
| 2606 | - $dateparamname_start = $keyprefix . 'options_' . $key . $keysuffix . '_start'; |
|
| 2607 | - $dateparamname_end = $keyprefix . 'options_' . $key . $keysuffix . '_end'; |
|
| 2606 | + $dateparamname_start = $keyprefix.'options_'.$key.$keysuffix.'_start'; |
|
| 2607 | + $dateparamname_end = $keyprefix.'options_'.$key.$keysuffix.'_end'; |
|
| 2608 | 2608 | |
| 2609 | - if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) { |
|
| 2609 | + if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) { |
|
| 2610 | 2610 | // values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc. |
| 2611 | - $dateparamname_start_hour = GETPOSTINT($dateparamname_start . 'hour') != '-1' ? GETPOSTINT($dateparamname_start . 'hour') : '00'; |
|
| 2612 | - $dateparamname_start_min = GETPOSTINT($dateparamname_start . 'min') != '-1' ? GETPOSTINT($dateparamname_start . 'min') : '00'; |
|
| 2613 | - $dateparamname_start_sec = GETPOSTINT($dateparamname_start . 'sec') != '-1' ? GETPOSTINT($dateparamname_start . 'sec') : '00'; |
|
| 2614 | - $dateparamname_end_hour = GETPOSTINT($dateparamname_end . 'hour') != '-1' ? GETPOSTINT($dateparamname_end . 'hour') : '23'; |
|
| 2615 | - $dateparamname_end_min = GETPOSTINT($dateparamname_end . 'min') != '-1' ? GETPOSTINT($dateparamname_end . 'min') : '59'; |
|
| 2616 | - $dateparamname_end_sec = GETPOSTINT($dateparamname_end . 'sec') != '-1' ? GETPOSTINT($dateparamname_end . 'sec') : '59'; |
|
| 2611 | + $dateparamname_start_hour = GETPOSTINT($dateparamname_start.'hour') != '-1' ? GETPOSTINT($dateparamname_start.'hour') : '00'; |
|
| 2612 | + $dateparamname_start_min = GETPOSTINT($dateparamname_start.'min') != '-1' ? GETPOSTINT($dateparamname_start.'min') : '00'; |
|
| 2613 | + $dateparamname_start_sec = GETPOSTINT($dateparamname_start.'sec') != '-1' ? GETPOSTINT($dateparamname_start.'sec') : '00'; |
|
| 2614 | + $dateparamname_end_hour = GETPOSTINT($dateparamname_end.'hour') != '-1' ? GETPOSTINT($dateparamname_end.'hour') : '23'; |
|
| 2615 | + $dateparamname_end_min = GETPOSTINT($dateparamname_end.'min') != '-1' ? GETPOSTINT($dateparamname_end.'min') : '59'; |
|
| 2616 | + $dateparamname_end_sec = GETPOSTINT($dateparamname_end.'sec') != '-1' ? GETPOSTINT($dateparamname_end.'sec') : '59'; |
|
| 2617 | 2617 | if ($key_type == 'datetimegmt') { |
| 2618 | 2618 | $value_key = array( |
| 2619 | - 'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'gmt'), |
|
| 2620 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'gmt') |
|
| 2619 | + 'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'gmt'), |
|
| 2620 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'gmt') |
|
| 2621 | 2621 | ); |
| 2622 | 2622 | } else { |
| 2623 | 2623 | $value_key = array( |
| 2624 | - 'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'tzuserrel'), |
|
| 2625 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'tzuserrel') |
|
| 2624 | + 'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'tzuserrel'), |
|
| 2625 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'tzuserrel') |
|
| 2626 | 2626 | ); |
| 2627 | 2627 | } |
| 2628 | 2628 | } elseif (GETPOST($keyprefix."options_".$key.$keysuffix."year")) { |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $htmlSuccess .= $useJNotify ? '' : '</div>'; |
| 41 | 41 | if ($useJNotify) { |
| 42 | 42 | $jsSuccess = ' |
| 43 | - jQuery.jnotify("' . dol_escape_js($htmlSuccess) . '", |
|
| 43 | + jQuery.jnotify("' . dol_escape_js($htmlSuccess).'", |
|
| 44 | 44 | "success", |
| 45 | 45 | 3000 |
| 46 | 46 | );'; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | $htmlWarning .= $useJNotify ? '' : '</div>'; |
| 61 | 61 | if ($useJNotify) { |
| 62 | - $jsWarning .= 'jQuery.jnotify("' . dol_escape_js($htmlWarning) . '", "warning", true);'; |
|
| 62 | + $jsWarning .= 'jQuery.jnotify("'.dol_escape_js($htmlWarning).'", "warning", true);'; |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | // alert error |
@@ -75,12 +75,12 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | $htmlError .= $useJNotify ? '' : '</div>'; |
| 77 | 77 | if ($useJNotify) { |
| 78 | - $jsError .= 'jQuery.jnotify("' . dol_escape_js($htmlError) . '", "error", true );'; |
|
| 78 | + $jsError .= 'jQuery.jnotify("'.dol_escape_js($htmlError).'", "error", true );'; |
|
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | -$html .= $htmlError . $htmlWarning . $htmlSuccess; |
|
| 81 | +$html .= $htmlError.$htmlWarning.$htmlSuccess; |
|
| 82 | 82 | if ($html) { |
| 83 | - $jsOut = $jsSuccess . $jsWarning . $jsError; |
|
| 83 | + $jsOut = $jsSuccess.$jsWarning.$jsError; |
|
| 84 | 84 | if ($jsOut == '') { |
| 85 | 85 | print $html; |
| 86 | 86 | } |
@@ -88,10 +88,10 @@ discard block |
||
| 88 | 88 | $context->clearEventMessages(); |
| 89 | 89 | |
| 90 | 90 | if ($context->getErrors()) { |
| 91 | - include __DIR__ . '/errors.tpl.php'; |
|
| 91 | + include __DIR__.'/errors.tpl.php'; |
|
| 92 | 92 | } |
| 93 | 93 | if ($jsOut) { |
| 94 | - $js = '<script nonce="' . getNonce() . '">'; |
|
| 94 | + $js = '<script nonce="'.getNonce().'">'; |
|
| 95 | 95 | $js .= 'jQuery(document).ready(function() {'; |
| 96 | 96 | $js .= $jsOut; |
| 97 | 97 | $js .= '});'; |