@@ -275,7 +275,7 @@ |
||
275 | 275 | $socstatic = new Societe($db); |
276 | 276 | $elementtype = $socstatic->table_element; |
277 | 277 | // fetch optionals attributes and labels |
278 | - require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; |
|
278 | + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
|
279 | 279 | $extrafields = new ExtraFields($db); |
280 | 280 | $extrafields->fetch_name_optionals_label($elementtype); |
281 | 281 | foreach ($extrafields->attributes[$elementtype]['label'] as $key => $val) { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $offsetunit = GETPOST('offsetunittype_duration', 'aZ09'); |
75 | 75 | $remindertype = GETPOST('selectremindertype', 'aZ09'); |
76 | 76 | $modelmail = GETPOSTINT('actioncommsendmodel_mail'); |
77 | -$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed |
|
77 | +$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed |
|
78 | 78 | $private = GETPOST('private', 'alphanohtml'); |
79 | 79 | if ($complete == 'na' || $complete == -2) { |
80 | 80 | $complete = -1; |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | $datef = dol_mktime(GETPOSTINT("p2hour"), GETPOSTINT("p2min"), GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel'); |
333 | 333 | } |
334 | 334 | //set end date to now if percentage is set to 100 and end date not set |
335 | - $datef = (!$datef && $percentage == 100)?dol_now():$datef; |
|
335 | + $datef = (!$datef && $percentage == 100) ?dol_now() : $datef; |
|
336 | 336 | |
337 | 337 | // Check parameters |
338 | 338 | if (!$datef && $percentage == 100) { |
@@ -614,12 +614,12 @@ discard block |
||
614 | 614 | if ($selectedrecurrulefreq == 'WEEKLY' && !empty($selectedrecurrulebyday)) { |
615 | 615 | $firstdatearray = dol_get_first_day_week(GETPOSTINT("apday"), GETPOSTINT("apmonth"), GETPOSTINT("apyear")); |
616 | 616 | $datep = dol_mktime($fulldayevent ? '00' : GETPOSTINT("aphour"), $fulldayevent ? '00' : GETPOSTINT("apmin"), $fulldayevent ? '00' : GETPOSTINT("apsec"), $firstdatearray['month'], $firstdatearray['first_day'], $firstdatearray['year'], $tzforfullday ? $tzforfullday : 'tzuserrel'); |
617 | - $datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd');//We begin the week after |
|
617 | + $datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd'); //We begin the week after |
|
618 | 618 | $dayoffset = 7; |
619 | 619 | $monthoffset = 0; |
620 | 620 | } elseif ($selectedrecurrulefreq == 'MONTHLY' && !empty($selectedrecurrulebymonthday)) { |
621 | 621 | $firstday = $selectedrecurrulebymonthday; |
622 | - $firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOSTINT("apmonth") + 1 : GETPOSTINT("apmonth");//We begin the week after |
|
622 | + $firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOSTINT("apmonth") + 1 : GETPOSTINT("apmonth"); //We begin the week after |
|
623 | 623 | $datep = dol_mktime($fulldayevent ? '00' : GETPOSTINT("aphour"), $fulldayevent ? '00' : GETPOSTINT("apmin"), $fulldayevent ? '00' : GETPOSTINT("apsec"), $firstmonth, $firstday, GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel'); |
624 | 624 | $dayoffset = 0; |
625 | 625 | $monthoffset = 1; |
@@ -724,9 +724,9 @@ discard block |
||
724 | 724 | |
725 | 725 | // increment date for recurrent events |
726 | 726 | $datep = dol_time_plus_duree($datep, $dayoffset, 'd'); |
727 | - $datep = dol_time_plus_duree($datep, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder |
|
727 | + $datep = dol_time_plus_duree($datep, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder |
|
728 | 728 | $datef = dol_time_plus_duree($datef, $dayoffset, 'd'); |
729 | - $datef = dol_time_plus_duree($datef, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder |
|
729 | + $datef = dol_time_plus_duree($datef, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder |
|
730 | 730 | } |
731 | 731 | } |
732 | 732 | if (!empty($backtopage) && !$error) { |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') { |
1069 | 1069 | $error = 0; |
1070 | 1070 | |
1071 | - $shour = (int) dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user. |
|
1071 | + $shour = (int) dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user. |
|
1072 | 1072 | $smin = (int) dol_print_date($object->datep, "%M", 'tzuserrel'); |
1073 | 1073 | |
1074 | 1074 | $newdate = GETPOST('newdate', 'alpha'); |
@@ -1278,7 +1278,7 @@ discard block |
||
1278 | 1278 | $default = getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT', 'AC_RDV'); |
1279 | 1279 | print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); |
1280 | 1280 | $selectedvalue = GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default); |
1281 | - print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot |
|
1281 | + print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot |
|
1282 | 1282 | print '</td></tr>'; |
1283 | 1283 | } |
1284 | 1284 | |
@@ -1609,7 +1609,7 @@ discard block |
||
1609 | 1609 | } |
1610 | 1610 | //var_dump('origin='.$origin.' originid='.$originid.' hasPermissionOnLinkedObject='.$hasPermissionOnLinkedObject); |
1611 | 1611 | |
1612 | - if (! in_array($origin, array('societe', 'project', 'task', 'user'))) { |
|
1612 | + if (!in_array($origin, array('societe', 'project', 'task', 'user'))) { |
|
1613 | 1613 | // We do not use link for object that already contains a hard coded field to make links with agenda events |
1614 | 1614 | print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>'; |
1615 | 1615 | print '<td colspan="3">'; |
@@ -1760,7 +1760,7 @@ discard block |
||
1760 | 1760 | $object->socpeopleassigned[$id] = array('id' => $tmpid); |
1761 | 1761 | } |
1762 | 1762 | $object->contact_id = GETPOSTINT("contactid"); |
1763 | - $object->fk_project = GETPOSTINT("projectid"); |
|
1763 | + $object->fk_project = GETPOSTINT("projectid"); |
|
1764 | 1764 | |
1765 | 1765 | $object->note_private = GETPOST("note", 'restricthtml'); |
1766 | 1766 | } |
@@ -1836,7 +1836,7 @@ discard block |
||
1836 | 1836 | if ($backtopage) { |
1837 | 1837 | print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : '').'">'; |
1838 | 1838 | } |
1839 | - if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && ! preg_match('/^TICKET_MSG_PRIVATE/', $object->code)) { |
|
1839 | + if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && !preg_match('/^TICKET_MSG_PRIVATE/', $object->code)) { |
|
1840 | 1840 | print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">'; |
1841 | 1841 | } |
1842 | 1842 | |
@@ -2224,7 +2224,7 @@ discard block |
||
2224 | 2224 | })'; |
2225 | 2225 | print '</script>'."\n"; |
2226 | 2226 | |
2227 | - print '</div>'; // End of div for reminderparameters |
|
2227 | + print '</div>'; // End of div for reminderparameters |
|
2228 | 2228 | } |
2229 | 2229 | |
2230 | 2230 | print dol_get_fiche_end(); |
@@ -63,15 +63,14 @@ discard block |
||
63 | 63 | $dolibarr_main_cookie_cryptkey; // This is loaded by filefunc.inc.php |
64 | 64 | |
65 | 65 | $tmp_instance_unique_id = empty($dolibarr_main_instance_unique_id) ? |
66 | - (empty($dolibarr_main_cookie_cryptkey) ? '' : |
|
67 | - $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id; |
|
66 | + (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id; |
|
68 | 67 | // Unique id of instance |
69 | 68 | |
70 | 69 | // The recommended value (may be not defined for old versions) |
71 | 70 | if (!empty($tmp_instance_unique_id)) { |
72 | - return sha1('webportal' . $tmp_instance_unique_id); |
|
71 | + return sha1('webportal'.$tmp_instance_unique_id); |
|
73 | 72 | } else { |
74 | - return sha1('webportal' . $_SERVER['SERVER_NAME'].$_SERVER['DOCUMENT_ROOT'].DOL_DOCUMENT_ROOT); |
|
73 | + return sha1('webportal'.$_SERVER['SERVER_NAME'].$_SERVER['DOCUMENT_ROOT'].DOL_DOCUMENT_ROOT); |
|
75 | 74 | } |
76 | 75 | } |
77 | 76 | } |
@@ -82,19 +81,19 @@ discard block |
||
82 | 81 | } |
83 | 82 | include $relDir.'../../main.inc.php'; |
84 | 83 | |
85 | -require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
86 | -require_once DOL_DOCUMENT_ROOT . '/societe/class/societeaccount.class.php'; |
|
87 | -require_once DOL_DOCUMENT_ROOT . '/public/webportal/lib/webportal.lib.php'; |
|
88 | -require_once DOL_DOCUMENT_ROOT . '/webportal/class/context.class.php'; |
|
89 | -require_once DOL_DOCUMENT_ROOT . '/webportal/class/webportalmember.class.php'; |
|
90 | -require_once DOL_DOCUMENT_ROOT . '/webportal/class/webportalpartnership.class.php'; |
|
84 | +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
85 | +require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; |
|
86 | +require_once DOL_DOCUMENT_ROOT.'/public/webportal/lib/webportal.lib.php'; |
|
87 | +require_once DOL_DOCUMENT_ROOT.'/webportal/class/context.class.php'; |
|
88 | +require_once DOL_DOCUMENT_ROOT.'/webportal/class/webportalmember.class.php'; |
|
89 | +require_once DOL_DOCUMENT_ROOT.'/webportal/class/webportalpartnership.class.php'; |
|
91 | 90 | |
92 | 91 | // Init session. Name of session is specific to WEBPORTAL instance. |
93 | 92 | // Must be done after the include of filefunc.inc.php so global variables of conf file are defined (like $dolibarr_main_instance_unique_id or $dolibarr_main_force_https). |
94 | 93 | // Note: the function dol_getprefix is defined into functions.lib.php but may have been defined to return a different key to manage another area to protect. |
95 | 94 | $prefix = dol_getprefix(''); |
96 | -$sessionname = 'WEBPORTAL_SESSID_' . $prefix; |
|
97 | -$sessiontimeout = 'WEBPORTAL_SESSTIMEOUT_' . $prefix; |
|
95 | +$sessionname = 'WEBPORTAL_SESSID_'.$prefix; |
|
96 | +$sessiontimeout = 'WEBPORTAL_SESSTIMEOUT_'.$prefix; |
|
98 | 97 | if (!empty($_COOKIE[$sessiontimeout]) && session_status() === PHP_SESSION_NONE) { |
99 | 98 | ini_set('session.gc_maxlifetime', $_COOKIE[$sessiontimeout]); |
100 | 99 | } |
@@ -113,7 +112,7 @@ discard block |
||
113 | 112 | |
114 | 113 | if (!defined('WEBPORTAL_NOREQUIRETRAN') || (!defined('WEBPORTAL_NOLOGIN') && !empty($context->controllerInstance->accessNeedLoggedUser))) { |
115 | 114 | if (!is_object($langs)) { // This can occurs when calling page with NOREQUIRETRAN defined, however we need langs for error messages. |
116 | - include_once DOL_DOCUMENT_ROOT . '/core/class/translate.class.php'; |
|
115 | + include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; |
|
117 | 116 | $langs = new Translate("", $conf); |
118 | 117 | $langcode = (GETPOST('lang', 'aZ09', 1) ? GETPOST('lang', 'aZ09', 1) : (empty($logged_user->conf->MAIN_LANG_DEFAULT) ? (!getDolGlobalString('MAIN_LANG_DEFAULT') ? 'auto' : $conf->global->MAIN_LANG_DEFAULT) : $logged_user->conf->MAIN_LANG_DEFAULT)); |
119 | 118 | if (defined('MAIN_LANG_DEFAULT')) { |
@@ -274,7 +273,7 @@ discard block |
||
274 | 273 | if (!$error) { |
275 | 274 | if ($logged_thirdparty->default_lang != $langs->defaultlang && !defined('WEBPORTAL_NOREQUIRETRAN')) { |
276 | 275 | if (!is_object($langs)) { // This can occurs when calling page with NOREQUIRETRAN defined, however we need langs for error messages. |
277 | - include_once DOL_DOCUMENT_ROOT . '/core/class/translate.class.php'; |
|
276 | + include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; |
|
278 | 277 | $langs = new Translate("", $conf); |
279 | 278 | $langs->setDefaultLang($logged_thirdparty->default_lang); |
280 | 279 | } |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | } |
343 | 343 | } |
344 | 344 | |
345 | -$searchkey = GETPOST('searchstring', 'restricthtmlallowunvalid'); // or 'none', must be same then $searchstring |
|
345 | +$searchkey = GETPOST('searchstring', 'restricthtmlallowunvalid'); // or 'none', must be same then $searchstring |
|
346 | 346 | |
347 | 347 | if ($action == 'replacesite' || $mode == 'replacesite') { // Test on permission not required |
348 | 348 | $containertype = GETPOST('optioncontainertype', 'aZ09') != '-1' ? GETPOST('optioncontainertype', 'aZ09') : ''; |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | } |
357 | 357 | |
358 | 358 | $usercanedit = $user->hasRight('website', 'write'); |
359 | -$permissiontoadd = $user->hasRight('website', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
359 | +$permissiontoadd = $user->hasRight('website', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
360 | 360 | $permissiontodelete = $user->hasRight('website', 'delete'); |
361 | 361 | |
362 | 362 | |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | if ($sortorder) { |
424 | 424 | $backtopage .= '&sortorder='.urlencode($sortorder); |
425 | 425 | } |
426 | -include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file. |
|
426 | +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file. |
|
427 | 427 | |
428 | 428 | $backtopage = $savbacktopage; |
429 | 429 | //var_dump($backtopage); |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | |
584 | 584 | // Replacement of string into pages |
585 | 585 | if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) { |
586 | - $replacestring = GETPOST('replacestring', 'restricthtmlallowunvalid'); // or 'none', must be same then $searchstring |
|
586 | + $replacestring = GETPOST('replacestring', 'restricthtmlallowunvalid'); // or 'none', must be same then $searchstring |
|
587 | 587 | |
588 | 588 | $dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT); |
589 | 589 | $allowimportsite = true; |
@@ -1152,7 +1152,7 @@ discard block |
||
1152 | 1152 | $objectpage->image = GETPOST('WEBSITE_IMAGE', 'alpha'); |
1153 | 1153 | $objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml')); |
1154 | 1154 | $objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09'); |
1155 | - $objectpage->htmlheader = GETPOST('htmlheader', 'none'); // Must accept tags like '<script>' and '<link>' |
|
1155 | + $objectpage->htmlheader = GETPOST('htmlheader', 'none'); // Must accept tags like '<script>' and '<link>' |
|
1156 | 1156 | $objectpage->author_alias = GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml'); |
1157 | 1157 | $objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS'); |
1158 | 1158 | $objectpage->fk_object = GETPOST('WEBSITE_OBJECTID'); |
@@ -1185,7 +1185,7 @@ discard block |
||
1185 | 1185 | $content = ''; |
1186 | 1186 | if (GETPOSTISSET('content')) { |
1187 | 1187 | //$content = GETPOST('content', 'restricthtmlallowunvalid'); // @TODO Use a restricthtmlallowunvalidwithphp |
1188 | - $content = GETPOST('content', 'none'); // @TODO Use a restricthtmlallowunvalidwithphp |
|
1188 | + $content = GETPOST('content', 'none'); // @TODO Use a restricthtmlallowunvalidwithphp |
|
1189 | 1189 | |
1190 | 1190 | $objectpage->content = make_substitutions($content, $substitutionarray); |
1191 | 1191 | } else { |
@@ -1558,7 +1558,7 @@ discard block |
||
1558 | 1558 | $error++; |
1559 | 1559 | setEventMessages($langs->trans('ErrorFaviconMustBeASquaredImage'), array(), 'errors'); |
1560 | 1560 | } |
1561 | - if (! $error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) { |
|
1561 | + if (!$error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) { |
|
1562 | 1562 | $error++; |
1563 | 1563 | setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors'); |
1564 | 1564 | } |
@@ -1570,7 +1570,7 @@ discard block |
||
1570 | 1570 | if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect |
1571 | 1571 | $action = 'preview'; |
1572 | 1572 | if ($backtopage) { |
1573 | - $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1573 | + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1574 | 1574 | header("Location: ".$backtopage); |
1575 | 1575 | exit; |
1576 | 1576 | } |
@@ -1594,7 +1594,7 @@ discard block |
||
1594 | 1594 | } |
1595 | 1595 | |
1596 | 1596 | |
1597 | - $dataposted = trim(GETPOST('WEBSITE_HTML_HEADER', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>' |
|
1597 | + $dataposted = trim(GETPOST('WEBSITE_HTML_HEADER', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>' |
|
1598 | 1598 | $dataposted = preg_replace(array('/<html>\n*/ims', '/<\/html>\n*/ims'), array('', ''), $dataposted); |
1599 | 1599 | $dataposted = str_replace('<?=', '<?php', $dataposted); |
1600 | 1600 | |
@@ -1603,7 +1603,7 @@ discard block |
||
1603 | 1603 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1604 | 1604 | |
1605 | 1605 | // Security analysis |
1606 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1606 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1607 | 1607 | |
1608 | 1608 | if (!$errorphpcheck) { |
1609 | 1609 | $htmlheadercontent = ''; |
@@ -1641,7 +1641,7 @@ discard block |
||
1641 | 1641 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1642 | 1642 | |
1643 | 1643 | // Security analysis |
1644 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1644 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1645 | 1645 | |
1646 | 1646 | if (!$errorphpcheck) { |
1647 | 1647 | $csscontent = ''; |
@@ -1684,7 +1684,7 @@ discard block |
||
1684 | 1684 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1685 | 1685 | |
1686 | 1686 | // Security analysis |
1687 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1687 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1688 | 1688 | |
1689 | 1689 | if (!$errorphpcheck) { |
1690 | 1690 | $jscontent = ''; |
@@ -1722,7 +1722,7 @@ discard block |
||
1722 | 1722 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1723 | 1723 | |
1724 | 1724 | // Security analysis |
1725 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1725 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1726 | 1726 | |
1727 | 1727 | if (!$errorphpcheck) { |
1728 | 1728 | $robotcontent = ''; |
@@ -1760,7 +1760,7 @@ discard block |
||
1760 | 1760 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1761 | 1761 | |
1762 | 1762 | // Security analysis |
1763 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1763 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1764 | 1764 | |
1765 | 1765 | if (!$errorphpcheck) { |
1766 | 1766 | $htaccesscontent = ''; |
@@ -1784,7 +1784,7 @@ discard block |
||
1784 | 1784 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1785 | 1785 | |
1786 | 1786 | // Security analysis |
1787 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1787 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1788 | 1788 | |
1789 | 1789 | if (!$errorphpcheck) { |
1790 | 1790 | $manifestjsoncontent = ''; |
@@ -1823,7 +1823,7 @@ discard block |
||
1823 | 1823 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1824 | 1824 | |
1825 | 1825 | // Security analysis |
1826 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1826 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1827 | 1827 | |
1828 | 1828 | if (!$errorphpcheck) { |
1829 | 1829 | $readmecontent = ''; |
@@ -1862,7 +1862,7 @@ discard block |
||
1862 | 1862 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1863 | 1863 | |
1864 | 1864 | // Security analysis |
1865 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1865 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1866 | 1866 | |
1867 | 1867 | if (!$errorphpcheck) { |
1868 | 1868 | $licensecontent = ''; |
@@ -1904,7 +1904,7 @@ discard block |
||
1904 | 1904 | if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect |
1905 | 1905 | $action = 'preview'; |
1906 | 1906 | if ($backtopage) { |
1907 | - $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1907 | + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1908 | 1908 | header("Location: ".$backtopage); |
1909 | 1909 | exit; |
1910 | 1910 | } |
@@ -1923,7 +1923,7 @@ discard block |
||
1923 | 1923 | |
1924 | 1924 | $object->fk_default_home = $pageid; |
1925 | 1925 | $res = $object->update($user); |
1926 | - if (! ($res > 0)) { |
|
1926 | + if (!($res > 0)) { |
|
1927 | 1927 | $error++; |
1928 | 1928 | setEventMessages($object->error, $object->errors, 'errors'); |
1929 | 1929 | } |
@@ -2038,7 +2038,7 @@ discard block |
||
2038 | 2038 | $objectpage->image = GETPOST('WEBSITE_IMAGE', 'alpha'); |
2039 | 2039 | $objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml')); |
2040 | 2040 | $objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09'); |
2041 | - $objectpage->htmlheader = trim(GETPOST('htmlheader', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>' |
|
2041 | + $objectpage->htmlheader = trim(GETPOST('htmlheader', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>' |
|
2042 | 2042 | $objectpage->fk_page = (GETPOSTINT('pageidfortranslation') > 0 ? GETPOSTINT('pageidfortranslation') : 0); |
2043 | 2043 | $objectpage->author_alias = trim(GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml')); |
2044 | 2044 | $objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS', 'alpha'); |
@@ -2314,7 +2314,7 @@ discard block |
||
2314 | 2314 | |
2315 | 2315 | $phpfullcodestringold = dolKeepOnlyPhpCode($objectpage->content); |
2316 | 2316 | |
2317 | - $objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed |
|
2317 | + $objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed |
|
2318 | 2318 | |
2319 | 2319 | $phpfullcodestring = dolKeepOnlyPhpCode($objectpage->content); |
2320 | 2320 | |
@@ -2535,7 +2535,7 @@ discard block |
||
2535 | 2535 | $fileofzip = ''; |
2536 | 2536 | if (GETPOSTISSET('templateuserfile')) { |
2537 | 2537 | // Case we selected one template |
2538 | - $fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite() |
|
2538 | + $fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite() |
|
2539 | 2539 | } elseif (!empty($_FILES) && is_array($_FILES['userfile'])) { |
2540 | 2540 | // Case we upload a new template |
2541 | 2541 | if (is_array($_FILES['userfile']['tmp_name'])) { |
@@ -2617,7 +2617,7 @@ discard block |
||
2617 | 2617 | if ($website->virtualhost) { |
2618 | 2618 | $domainname = $website->virtualhost; |
2619 | 2619 | } |
2620 | - if (! preg_match('/^http/i', $domainname)) { |
|
2620 | + if (!preg_match('/^http/i', $domainname)) { |
|
2621 | 2621 | $domainname = 'https://'.$domainname; |
2622 | 2622 | } |
2623 | 2623 | |
@@ -2683,7 +2683,7 @@ discard block |
||
2683 | 2683 | $url->appendChild($lastmod); |
2684 | 2684 | // Add suggested frequency for refresh |
2685 | 2685 | if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) { |
2686 | - $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2686 | + $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2687 | 2687 | $url->appendChild($changefreq); |
2688 | 2688 | } |
2689 | 2689 | // Add higher priority for home page |
@@ -2788,7 +2788,7 @@ discard block |
||
2788 | 2788 | $url->appendChild($lastmod); |
2789 | 2789 | // Add suggested frequency for refresh |
2790 | 2790 | if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) { |
2791 | - $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2791 | + $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2792 | 2792 | $url->appendChild($changefreq); |
2793 | 2793 | } |
2794 | 2794 | |
@@ -3076,11 +3076,11 @@ discard block |
||
3076 | 3076 | |
3077 | 3077 | // // Export web site |
3078 | 3078 | $extraCssClass = getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE') ? 'hideobject' : ''; |
3079 | - print '<input type="submit" class="button bordertransp ' . $extraCssClass . '" ' . $disabledexport . ' value="' . dol_escape_htmltag($exportlabel) . '" name="exportsite">'; |
|
3079 | + print '<input type="submit" class="button bordertransp '.$extraCssClass.'" '.$disabledexport.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">'; |
|
3080 | 3080 | |
3081 | 3081 | if (getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')) { |
3082 | 3082 | // Overwrite template in sources |
3083 | - $overwriteGitUrl = $_SERVER["PHP_SELF"] . '?action=overwritesite&website=' . urlencode($website->ref); |
|
3083 | + $overwriteGitUrl = $_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref); |
|
3084 | 3084 | print dolButtonToOpenExportDialog('exportpopup', $langs->trans('ExportOptions'), $langs->trans('ExportSite'), 'exportsite', $overwriteGitUrl, $website); |
3085 | 3085 | //print '<a href="'.$_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref).'" class="button bordertransp hideobject" title="'.dol_escape_htmltag($langs->trans("ExportIntoGIT").". Directory ".getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')).'">'.dol_escape_htmltag($langs->trans("ExportIntoGIT")).'</a>'; |
3086 | 3086 | } |
@@ -3441,7 +3441,7 @@ discard block |
||
3441 | 3441 | print '<!-- button EditInLine and ShowSubcontainers -->'."\n"; |
3442 | 3442 | print '<div class="websiteselectionsection inline-block">'; |
3443 | 3443 | |
3444 | - print '<div class="inline-block marginrightonly">'; // Button includes dynamic content |
|
3444 | + print '<div class="inline-block marginrightonly">'; // Button includes dynamic content |
|
3445 | 3445 | print $langs->trans("ShowSubcontainers"); |
3446 | 3446 | if (!getDolGlobalString('WEBSITE_SUBCONTAINERSINLINE')) { |
3447 | 3447 | print '<a class="nobordertransp nohoverborder marginleftonlyshort valignmiddle"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers&token='.newToken().'">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').'</a>'; |
@@ -3450,7 +3450,7 @@ discard block |
||
3450 | 3450 | } |
3451 | 3451 | print '</div>'; |
3452 | 3452 | |
3453 | - print '<div class="inline-block marginrightonly">'; // Button edit inline |
|
3453 | + print '<div class="inline-block marginrightonly">'; // Button edit inline |
|
3454 | 3454 | |
3455 | 3455 | print '<span id="switchckeditorinline">'."\n"; |
3456 | 3456 | // Enable CKEditor inline with js on section and div with conteneditable=true |
@@ -3542,15 +3542,15 @@ discard block |
||
3542 | 3542 | // Sending data via AJAX |
3543 | 3543 | $.ajax({ |
3544 | 3544 | type: \'POST\', |
3545 | - url: \'' . DOL_URL_ROOT . '/core/ajax/editinline.php\', |
|
3545 | + url: \'' . DOL_URL_ROOT.'/core/ajax/editinline.php\', |
|
3546 | 3546 | data: { |
3547 | 3547 | website_ref: \''.$website->ref.'\', |
3548 | - page_id: \'' . $websitepage->id . '\', |
|
3548 | + page_id: \'' . $websitepage->id.'\', |
|
3549 | 3549 | content: content, |
3550 | 3550 | element_id: elementId, |
3551 | 3551 | element_type: elementType, |
3552 | 3552 | action: \'updatedElementContent\', |
3553 | - token: \'' . newToken() . '\' |
|
3553 | + token: \'' . newToken().'\' |
|
3554 | 3554 | }, |
3555 | 3555 | success: function(response) { |
3556 | 3556 | console.log(response); |
@@ -3636,7 +3636,7 @@ discard block |
||
3636 | 3636 | } else { |
3637 | 3637 | $disabled = ''; |
3638 | 3638 | $title = ''; |
3639 | - $url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website |
|
3639 | + $url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website |
|
3640 | 3640 | } |
3641 | 3641 | print '<a href="'.$url.'" class="button buttonDelete bordertransp'.($disabled ? ' disabled' : '').'"'.$disabled.' title="'.dol_escape_htmltag($title).'">'.img_picto('', 'delete', 'class=""').'<span class="hideonsmartphone paddingleft">'.$langs->trans("Delete").'</span></a>'; |
3642 | 3642 | print '</span>'; |
@@ -3825,7 +3825,7 @@ discard block |
||
3825 | 3825 | // Clean the php htmlheader file to remove php code and get only html part |
3826 | 3826 | $htmlheadercontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP( \?>)?\n*/ims', '', $htmlheadercontent); |
3827 | 3827 | } else { |
3828 | - $htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none'); // Must accept tags like '<script>' and '<link>' |
|
3828 | + $htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none'); // Must accept tags like '<script>' and '<link>' |
|
3829 | 3829 | } |
3830 | 3830 | if (!trim($htmlheadercontent)) { |
3831 | 3831 | $htmlheadercontent = "<html>\n"; |
@@ -3856,7 +3856,7 @@ discard block |
||
3856 | 3856 | // Clean the php htaccesscontent file to remove php code and get only html part |
3857 | 3857 | $htaccesscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP( \?>)?\n*/ims', '', $htaccesscontent); |
3858 | 3858 | } else { |
3859 | - $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " |
|
3859 | + $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " |
|
3860 | 3860 | } |
3861 | 3861 | if (!trim($htaccesscontent)) { |
3862 | 3862 | $htaccesscontent .= "# Order allow,deny\n"; |
@@ -3957,7 +3957,7 @@ discard block |
||
3957 | 3957 | $maxfilesizearray = getMaxFileSizeArray(); |
3958 | 3958 | $maxmin = $maxfilesizearray['maxmin']; |
3959 | 3959 | if ($maxmin > 0) { |
3960 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
3960 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
3961 | 3961 | } |
3962 | 3962 | print '<input type="file" class="flat minwidth300" name="addedfile" id="addedfile"/>'; |
3963 | 3963 | |
@@ -3999,7 +3999,7 @@ discard block |
||
3999 | 3999 | print '<tr><td class="tdtop">'; |
4000 | 4000 | print $langs->trans('WEBSITE_HTML_HEADER'); |
4001 | 4001 | $htmlhelp = $langs->trans("Example").' :<br>'; |
4002 | - $htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction. |
|
4002 | + $htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction. |
|
4003 | 4003 | $textwithhelp = $form->textwithpicto('', $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip'); |
4004 | 4004 | $htmlhelp2 = $langs->trans("LinkAndScriptsHereAreNotLoadedInEditor").'<br>'; |
4005 | 4005 | print $form->textwithpicto($textwithhelp, $htmlhelp2, 1, 'warning', '', 0, 2, 'htmlheadertooltip2'); |
@@ -4214,7 +4214,7 @@ discard block |
||
4214 | 4214 | $maxfilesizearray = getMaxFileSizeArray(); |
4215 | 4215 | $maxmin = $maxfilesizearray['maxmin']; |
4216 | 4216 | if ($maxmin > 0) { |
4217 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
4217 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
4218 | 4218 | } |
4219 | 4219 | print '<input class="flat minwidth400" type="file" name="userfile[]" accept=".zip">'; |
4220 | 4220 | print '<input type="submit" class="button small" name="buttonsubmitimportfile" value="'.dol_escape_htmltag($langs->trans("Upload")).'">'; |
@@ -4734,7 +4734,7 @@ discard block |
||
4734 | 4734 | print '<tr><td class="tdhtmlheader tdtop">'; |
4735 | 4735 | $htmlhelp = $langs->trans("EditTheWebSiteForACommonHeader").'<br><br>'; |
4736 | 4736 | $htmlhelp .= $langs->trans("Example").' :<br>'; |
4737 | - $htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction. |
|
4737 | + $htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction. |
|
4738 | 4738 | print $form->textwithpicto($langs->transnoentitiesnoconv('HtmlHeaderPage'), $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip'); |
4739 | 4739 | print '</td><td>'; |
4740 | 4740 | $poscursor = array('x' => GETPOST('htmlheader_x'), 'y' => GETPOST('htmlheader_y')); |
@@ -4873,7 +4873,7 @@ discard block |
||
4873 | 4873 | |
4874 | 4874 | |
4875 | 4875 | $module = 'medias'; |
4876 | - $formalreadyopen = 2; // So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php |
|
4876 | + $formalreadyopen = 2; // So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php |
|
4877 | 4877 | if (empty($url)) { |
4878 | 4878 | $url = DOL_URL_ROOT.'/website/index.php'; // Must be an url without param |
4879 | 4879 | } |
@@ -5110,8 +5110,8 @@ discard block |
||
5110 | 5110 | print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; |
5111 | 5111 | print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); |
5112 | 5112 | print getTitleFieldOfList("UserCreation", 0, $_SERVER['PHP_SELF'], 'fk_user_creat', '', $param, '', $sortfield, $sortorder, '')."\n"; |
5113 | - print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date creation |
|
5114 | - print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif |
|
5113 | + print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date creation |
|
5114 | + print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif |
|
5115 | 5115 | print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); |
5116 | 5116 | // Action column |
5117 | 5117 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | |
174 | 174 | $parameters = array(); |
175 | -$reshook = $hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
175 | +$reshook = $hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
176 | 176 | if ($reshook < 0) { |
177 | 177 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
178 | 178 | } |
@@ -187,9 +187,9 @@ discard block |
||
187 | 187 | $bankaccount = GETPOSTINT('accountid'); |
188 | 188 | } else { |
189 | 189 | if ($pay == 'LIQ') { |
190 | - $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
190 | + $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
191 | 191 | } elseif ($pay == "CHQ") { |
192 | - $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
192 | + $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
193 | 193 | } else { |
194 | 194 | $accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"]; |
195 | 195 | $bankaccount = getDolGlobalInt($accountname); |
@@ -255,14 +255,14 @@ discard block |
||
255 | 255 | // The case for isModEnabled('productbatch') is processed few lines later. |
256 | 256 | $savconst = getDolGlobalString('STOCK_CALCULATE_ON_BILL'); |
257 | 257 | |
258 | - $conf->global->STOCK_CALCULATE_ON_BILL = 1; // To force the change of stock during invoice validation |
|
258 | + $conf->global->STOCK_CALCULATE_ON_BILL = 1; // To force the change of stock during invoice validation |
|
259 | 259 | |
260 | 260 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; |
261 | 261 | dol_syslog("Validate invoice with stock change. Warehouse defined into constant ".$constantforkey." = ".getDolGlobalString($constantforkey)); |
262 | 262 | |
263 | 263 | // Validate invoice with stock change into warehouse getDolGlobalInt($constantforkey) |
264 | 264 | // Label of stock movement will be the same as when we validate invoice "Invoice XXXX validated" |
265 | - $batch_rule = 0; // Module productbatch is disabled here, so no need for a batch_rule. |
|
265 | + $batch_rule = 0; // Module productbatch is disabled here, so no need for a batch_rule. |
|
266 | 266 | $res = $invoice->validate($user, '', getDolGlobalInt($constantforkey), 0, $batch_rule); |
267 | 267 | |
268 | 268 | // Restore setup |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | dol_syslog("Now we record the stock movement for each qualified line"); |
334 | 334 | |
335 | 335 | // The case !isModEnabled('productbatch') was processed few lines before. |
336 | - require_once DOL_DOCUMENT_ROOT . "/product/stock/class/mouvementstock.class.php"; |
|
336 | + require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"; |
|
337 | 337 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; |
338 | 338 | $inventorycode = dol_print_date(dol_now(), 'dayhourlog'); |
339 | 339 | // Label of stock movement will be "TakePOS - Invoice XXXX" |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | $creditnote->socid = $invoice->socid; |
384 | 384 | $creditnote->date = dol_now(); |
385 | 385 | $creditnote->module_source = 'takepos'; |
386 | - $creditnote->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ; |
|
386 | + $creditnote->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''; |
|
387 | 387 | $creditnote->type = Facture::TYPE_CREDIT_NOTE; |
388 | 388 | $creditnote->fk_facture_source = $placeid; |
389 | 389 | //$creditnote->remise_absolue = $invoice->remise_absolue; |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | // If module stock is enabled and we do not setup takepo to disable stock decrease |
511 | 511 | // The case for isModEnabled('productbatch') is processed few lines later. |
512 | 512 | $savconst = getDolGlobalString('STOCK_CALCULATE_ON_BILL'); |
513 | - $conf->global->STOCK_CALCULATE_ON_BILL = 1; // We force setup to have update of stock on invoice validation/unvalidation |
|
513 | + $conf->global->STOCK_CALCULATE_ON_BILL = 1; // We force setup to have update of stock on invoice validation/unvalidation |
|
514 | 514 | |
515 | 515 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
516 | 516 | |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | |
519 | 519 | // Validate invoice with stock change into warehouse getDolGlobalInt($constantforkey) |
520 | 520 | // Label of stock movement will be the same as when we validate invoice "Invoice XXXX validated" |
521 | - $batch_rule = 0; // Module productbatch is disabled here, so no need for a batch_rule. |
|
521 | + $batch_rule = 0; // Module productbatch is disabled here, so no need for a batch_rule. |
|
522 | 522 | $res = $creditnote->validate($user, '', getDolGlobalString($constantforkey), 0, $batch_rule); |
523 | 523 | if ($res < 0) { |
524 | 524 | $error++; |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | dol_syslog("Now we record the stock movement for each qualified line"); |
539 | 539 | |
540 | 540 | // The case !isModEnabled('productbatch') was processed few lines before. |
541 | - require_once DOL_DOCUMENT_ROOT . "/product/stock/class/mouvementstock.class.php"; |
|
541 | + require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"; |
|
542 | 542 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; |
543 | 543 | $inventorycode = dol_print_date(dol_now(), 'dayhourlog'); |
544 | 544 | // Label of stock movement will be "TakePOS - Invoice XXXX" |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | if (!$error && $res >= 0) { |
579 | 579 | $db->commit(); |
580 | 580 | } else { |
581 | - $creditnote->id = $placeid; // Creation has failed, we reset to ID of source invoice so we go back to this one in action=history |
|
581 | + $creditnote->id = $placeid; // Creation has failed, we reset to ID of source invoice so we go back to this one in action=history |
|
582 | 582 | $db->rollback(); |
583 | 583 | } |
584 | 584 | } |
@@ -599,10 +599,10 @@ discard block |
||
599 | 599 | $invoice->socid = getDolGlobalInt($constforcompanyid); |
600 | 600 | |
601 | 601 | include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
602 | - $invoice->date = dol_get_first_hour(dol_now('tzuserrel')); // Invoice::create() needs a date with no hours |
|
602 | + $invoice->date = dol_get_first_hour(dol_now('tzuserrel')); // Invoice::create() needs a date with no hours |
|
603 | 603 | |
604 | 604 | $invoice->module_source = 'takepos'; |
605 | - $invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ; |
|
605 | + $invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''; |
|
606 | 606 | $invoice->entity = !empty($_SESSION["takeposinvoiceentity"]) ? $_SESSION["takeposinvoiceentity"] : $conf->entity; |
607 | 607 | |
608 | 608 | if ($invoice->socid <= 0) { |
@@ -812,7 +812,7 @@ discard block |
||
812 | 812 | |
813 | 813 | // complete line by hook |
814 | 814 | $parameters = array('prod' => $prod, 'line' => $line); |
815 | - $reshook = $hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks |
|
815 | + $reshook = $hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks |
|
816 | 816 | if ($reshook < 0) { |
817 | 817 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
818 | 818 | } |
@@ -1015,7 +1015,7 @@ discard block |
||
1015 | 1015 | } |
1016 | 1016 | if (!$permissiontoupdateline) { |
1017 | 1017 | dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos").' - No permission to updateprice', [], 1); |
1018 | - } elseif (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') == 1) { |
|
1018 | + } elseif (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') == 1) { |
|
1019 | 1019 | $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); |
1020 | 1020 | } else { |
1021 | 1021 | $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); |
@@ -1079,7 +1079,7 @@ discard block |
||
1079 | 1079 | |
1080 | 1080 | if ($action == "setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) { |
1081 | 1081 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; |
1082 | - $warehouseid = (GETPOSTINT('warehouseid') > 0 ? GETPOSTINT('warehouseid') : getDolGlobalInt($constantforkey)); // Get the warehouse id from GETPOSTINT('warehouseid'), otherwise use default setup. |
|
1082 | + $warehouseid = (GETPOSTINT('warehouseid') > 0 ? GETPOSTINT('warehouseid') : getDolGlobalInt($constantforkey)); // Get the warehouse id from GETPOSTINT('warehouseid'), otherwise use default setup. |
|
1083 | 1083 | $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET batch = '".$db->escape($batch)."', fk_warehouse = ".((int) $warehouseid); |
1084 | 1084 | $sql .= " WHERE rowid=".((int) $idoflineadded); |
1085 | 1085 | $db->query($sql); |
@@ -1227,7 +1227,7 @@ discard block |
||
1227 | 1227 | |
1228 | 1228 | $sectionwithinvoicelink .= '</span><br>'; |
1229 | 1229 | if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) { |
1230 | - $sectionwithinvoicelink .= ' <a target="_blank" class="button" href="' . DOL_URL_ROOT . '/document.php?token=' . newToken() . '&modulepart=facture&file=' . $invoice->ref . '/' . $invoice->ref . '.pdf">Invoice</a>'; |
|
1230 | + $sectionwithinvoicelink .= ' <a target="_blank" class="button" href="'.DOL_URL_ROOT.'/document.php?token='.newToken().'&modulepart=facture&file='.$invoice->ref.'/'.$invoice->ref.'.pdf">Invoice</a>'; |
|
1231 | 1231 | } elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { |
1232 | 1232 | if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { |
1233 | 1233 | $sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="TakeposConnector('.$placeid.')">'.$langs->trans('PrintTicket').'</button>'; |
@@ -1266,7 +1266,7 @@ discard block |
||
1266 | 1266 | if ((getDolGlobalString('TAKEPOS_PHONE_BASIC_LAYOUT') == 1 && $conf->browser->layout == 'phone') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { |
1267 | 1267 | $title = 'TakePOS - Dolibarr '.DOL_VERSION; |
1268 | 1268 | if (getDolGlobalString('MAIN_APPLICATION_TITLE')) { |
1269 | - $title = 'TakePOS - ' . getDolGlobalString('MAIN_APPLICATION_TITLE'); |
|
1269 | + $title = 'TakePOS - '.getDolGlobalString('MAIN_APPLICATION_TITLE'); |
|
1270 | 1270 | } |
1271 | 1271 | $head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/> |
1272 | 1272 | <meta name="apple-mobile-web-app-capable" content="yes"> |
@@ -1493,7 +1493,7 @@ discard block |
||
1493 | 1493 | if ($contactid > 0) { |
1494 | 1494 | $contact = new Contact($db); |
1495 | 1495 | $contact->fetch($contactid); |
1496 | - $s .= " - " . $contact->getFullName($langs); |
|
1496 | + $s .= " - ".$contact->getFullName($langs); |
|
1497 | 1497 | } |
1498 | 1498 | } |
1499 | 1499 | } |
@@ -1554,10 +1554,10 @@ discard block |
||
1554 | 1554 | $s = ''; |
1555 | 1555 | |
1556 | 1556 | $idwarehouse = 0; |
1557 | - $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
1557 | + $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
1558 | 1558 | if (isModEnabled('stock')) { |
1559 | 1559 | if (getDolGlobalString($constantforkey) != "1") { |
1560 | - $constantforkey = 'CASHDESK_ID_WAREHOUSE'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
1560 | + $constantforkey = 'CASHDESK_ID_WAREHOUSE'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
1561 | 1561 | $idwarehouse = getDolGlobalString($constantforkey); |
1562 | 1562 | if ($idwarehouse > 0) { |
1563 | 1563 | $s = '<span class="small">'; |
@@ -1705,7 +1705,7 @@ discard block |
||
1705 | 1705 | |
1706 | 1706 | // Complete header by hook |
1707 | 1707 | $parameters = array(); |
1708 | -$reshook = $hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
1708 | +$reshook = $hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
1709 | 1709 | if ($reshook < 0) { |
1710 | 1710 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
1711 | 1711 | } |
@@ -1719,16 +1719,16 @@ discard block |
||
1719 | 1719 | print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>'; |
1720 | 1720 | if (getDolGlobalString('TAKEPOS_SHOW_HT')) { |
1721 | 1721 | print '<td class="linecolht right nowraponall">'; |
1722 | - print '<span class="opacitymedium small">' . $langs->trans('TotalHTShort') . '</span><br>'; |
|
1722 | + print '<span class="opacitymedium small">'.$langs->trans('TotalHTShort').'</span><br>'; |
|
1723 | 1723 | // In phone version only show when it is invoice page |
1724 | 1724 | if (empty($mobilepage) || $mobilepage == "invoice") { |
1725 | - print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">' . price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency) . '</span>'; |
|
1725 | + print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">'.price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency).'</span>'; |
|
1726 | 1726 | if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) { |
1727 | 1727 | //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency |
1728 | - include_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php'; |
|
1728 | + include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; |
|
1729 | 1729 | $multicurrency = new MultiCurrency($db); |
1730 | 1730 | $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]); |
1731 | - print '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">(' . price($invoice->total_ht * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')</span>'; |
|
1731 | + print '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">('.price($invoice->total_ht * $multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')</span>'; |
|
1732 | 1732 | } |
1733 | 1733 | } |
1734 | 1734 | print '</td>'; |
@@ -1872,7 +1872,7 @@ discard block |
||
1872 | 1872 | |
1873 | 1873 | // complete line by hook |
1874 | 1874 | $parameters = array('line' => $line); |
1875 | - $reshook = $hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
1875 | + $reshook = $hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
1876 | 1876 | if ($reshook < 0) { |
1877 | 1877 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
1878 | 1878 | } |
@@ -1927,7 +1927,7 @@ discard block |
||
1927 | 1927 | } |
1928 | 1928 | } |
1929 | 1929 | if (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 1) { |
1930 | - $htmlforlines .= $form->textwithpicto($line->product_label ? '<b>' . $line->product_ref . '</b> - ' . $line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); |
|
1930 | + $htmlforlines .= $form->textwithpicto($line->product_label ? '<b>'.$line->product_ref.'</b> - '.$line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); |
|
1931 | 1931 | } elseif (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 2) { |
1932 | 1932 | $htmlforlines .= $form->textwithpicto($line->product_ref ? '<b>'.$line->product_ref.'<b>' : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); |
1933 | 1933 | } else { |
@@ -1985,7 +1985,7 @@ discard block |
||
1985 | 1985 | |
1986 | 1986 | // complete line by hook |
1987 | 1987 | $parameters = array('line' => $line); |
1988 | - $reshook = $hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
1988 | + $reshook = $hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
1989 | 1989 | if ($reshook < 0) { |
1990 | 1990 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
1991 | 1991 | } |
@@ -2096,7 +2096,7 @@ discard block |
||
2096 | 2096 | if (($action == "valid" || $action == "history") && $invoice->type != Facture::TYPE_CREDIT_NOTE && !getDolGlobalString('TAKEPOS_NO_CREDITNOTE')) { |
2097 | 2097 | print '<button id="buttonprint" type="button" onclick="ModalBox(\'ModalCreditNote\')">'.$langs->trans('CreateCreditNote').'</button>'; |
2098 | 2098 | if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) { |
2099 | - print ' <a target="_blank" class="button" href="' . DOL_URL_ROOT . '/document.php?token=' . newToken() . '&modulepart=facture&file=' . $invoice->ref . '/' . $invoice->ref . '.pdf">Invoice</a>'; |
|
2099 | + print ' <a target="_blank" class="button" href="'.DOL_URL_ROOT.'/document.php?token='.newToken().'&modulepart=facture&file='.$invoice->ref.'/'.$invoice->ref.'.pdf">Invoice</a>'; |
|
2100 | 2100 | } |
2101 | 2101 | } |
2102 | 2102 |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | if (getDolGlobalString('MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND') && !empty($objectobj->last_main_doc)) { |
395 | 395 | $file_check_list[] = array( |
396 | 396 | 'name' => basename($objectobj->last_main_doc), |
397 | - 'path' => DOL_DATA_ROOT . '/' . $objectobj->last_main_doc, |
|
397 | + 'path' => DOL_DATA_ROOT.'/'.$objectobj->last_main_doc, |
|
398 | 398 | ); |
399 | 399 | } |
400 | 400 | foreach ($file_check_list as $file_check_arr) { |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | if ($fromtype === 'user') { |
441 | 441 | $from = dol_string_nospecial($user->getFullName($langs), ' ', array(",")).' <'.$user->email.'>'; |
442 | 442 | } elseif ($fromtype === 'company') { |
443 | - $from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
443 | + $from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
444 | 444 | } elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) { |
445 | 445 | $tmp = explode(',', $user->email_aliases); |
446 | 446 | $from = trim($tmp[((int) $reg[1] - 1)]); |
@@ -464,25 +464,25 @@ discard block |
||
464 | 464 | |
465 | 465 | $sendtobcc = GETPOST('sendtoccc'); |
466 | 466 | if ($objectclass == 'Propal') { |
467 | - $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROPOSAL_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROPOSAL_TO'))); |
|
467 | + $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROPOSAL_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROPOSAL_TO'))); |
|
468 | 468 | } |
469 | 469 | if ($objectclass == 'Commande') { |
470 | - $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_ORDER_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_ORDER_TO'))); |
|
470 | + $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_ORDER_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_ORDER_TO'))); |
|
471 | 471 | } |
472 | 472 | if ($objectclass == 'Facture') { |
473 | - $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_INVOICE_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_INVOICE_TO'))); |
|
473 | + $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_INVOICE_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_INVOICE_TO'))); |
|
474 | 474 | } |
475 | 475 | if ($objectclass == 'SupplierProposal') { |
476 | - $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO'))); |
|
476 | + $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO'))); |
|
477 | 477 | } |
478 | 478 | if ($objectclass == 'CommandeFournisseur') { |
479 | - $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO'))); |
|
479 | + $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO'))); |
|
480 | 480 | } |
481 | 481 | if ($objectclass == 'FactureFournisseur') { |
482 | - $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO'))); |
|
482 | + $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO'))); |
|
483 | 483 | } |
484 | 484 | if ($objectclass == 'Project') { |
485 | - $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO'))); |
|
485 | + $sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO'))); |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | // $listofqualifiedobj is array with key = object id and value is instance of qualified objects, for the current thirdparty (but thirdparty property is not loaded yet) |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | $objectobj2->fk_element = $objid2; |
639 | 639 | $objectobj2->elementtype = $objectobj2->element; |
640 | 640 | if (getDolGlobalString('MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT')) { |
641 | - $objectobj2->actionmsg2 = $subjectreplaced; // Short text |
|
641 | + $objectobj2->actionmsg2 = $subjectreplaced; // Short text |
|
642 | 642 | } |
643 | 643 | |
644 | 644 | $triggername = strtoupper(get_class($objectobj2)).'_SENTBYMAIL'; |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | } elseif (getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) { |
695 | 695 | $resaction .= '<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>'; |
696 | 696 | } else { |
697 | - $resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto) . '<br><div class="error">(unhandled error)</div>'; |
|
697 | + $resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto).'<br><div class="error">(unhandled error)</div>'; |
|
698 | 698 | } |
699 | 699 | } |
700 | 700 | } |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | continue; |
1100 | 1100 | } |
1101 | 1101 | |
1102 | - if ($objectclass == 'Holiday' && ! in_array($objecttmp->statut, array(Holiday::STATUS_DRAFT, Holiday::STATUS_CANCELED, Holiday::STATUS_REFUSED))) { |
|
1102 | + if ($objectclass == 'Holiday' && !in_array($objecttmp->statut, array(Holiday::STATUS_DRAFT, Holiday::STATUS_CANCELED, Holiday::STATUS_REFUSED))) { |
|
1103 | 1103 | $langs->load("errors"); |
1104 | 1104 | $nbignored++; |
1105 | 1105 | $TMsg[] = '<div class="error">'.$langs->trans('ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted', $objecttmp->ref).'</div><br>'; |
@@ -1269,7 +1269,7 @@ discard block |
||
1269 | 1269 | //For each valid categ type set common categ |
1270 | 1270 | if (!empty($to_affecttag_type_array)) { |
1271 | 1271 | foreach ($to_affecttag_type_array as $categ_type) { |
1272 | - $contcats = GETPOST('contcats_' . $categ_type, 'array'); |
|
1272 | + $contcats = GETPOST('contcats_'.$categ_type, 'array'); |
|
1273 | 1273 | //var_dump($toselect);exit; |
1274 | 1274 | foreach ($toselect as $toselectid) { |
1275 | 1275 | $result = $object->fetch($toselectid); |
@@ -1513,7 +1513,7 @@ discard block |
||
1513 | 1513 | $db->begin(); |
1514 | 1514 | |
1515 | 1515 | $objecttmp = new $objectclass($db); |
1516 | - $e = new ExtraFields($db);// fetch optionals attributes and labels |
|
1516 | + $e = new ExtraFields($db); // fetch optionals attributes and labels |
|
1517 | 1517 | $e->fetch_name_optionals_label($objecttmp->table_element); |
1518 | 1518 | |
1519 | 1519 | $nbok = 0; |
@@ -1647,12 +1647,12 @@ discard block |
||
1647 | 1647 | continue; |
1648 | 1648 | } |
1649 | 1649 | if ($user->id == $objecttmp->fk_validator) { |
1650 | - $objecttmp->oldcopy = dol_clone($objecttmp, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
1650 | + $objecttmp->oldcopy = dol_clone($objecttmp, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
1651 | 1651 | |
1652 | 1652 | $objecttmp->date_valid = dol_now(); |
1653 | 1653 | $objecttmp->fk_user_valid = $user->id; |
1654 | 1654 | $objecttmp->status = Holiday::STATUS_APPROVED; |
1655 | - $objecttmp->statut = $objecttmp->status; // deprecated |
|
1655 | + $objecttmp->statut = $objecttmp->status; // deprecated |
|
1656 | 1656 | |
1657 | 1657 | $verif = $objecttmp->approve($user); |
1658 | 1658 | |
@@ -1755,12 +1755,12 @@ discard block |
||
1755 | 1755 | } |
1756 | 1756 | |
1757 | 1757 | if (!$error && ($massaction == 'increaseholiday' || ($action == 'increaseholiday' && $confirm == 'yes')) && $permissiontoapprove && is_array($toselect)) { |
1758 | - '@phan-var-force Holiday $holiday'; // Supposing that $holiday is set, it is needed. |
|
1758 | + '@phan-var-force Holiday $holiday'; // Supposing that $holiday is set, it is needed. |
|
1759 | 1759 | $db->begin(); |
1760 | 1760 | $objecttmp = new $objectclass($db); |
1761 | 1761 | $nbok = 0; |
1762 | 1762 | $typeholiday = GETPOST('typeholiday', 'alpha'); |
1763 | - $nbdaysholidays = GETPOSTFLOAT('nbdaysholidays'); // May be 1.5 |
|
1763 | + $nbdaysholidays = GETPOSTFLOAT('nbdaysholidays'); // May be 1.5 |
|
1764 | 1764 | |
1765 | 1765 | if ($nbdaysholidays <= 0) { |
1766 | 1766 | setEventMessages($langs->trans("WrongAmount"), null, 'errors'); |
@@ -1820,7 +1820,7 @@ discard block |
||
1820 | 1820 | // Check if current user is contact of the new project (necessary only if project is not public) |
1821 | 1821 | $iscontactofnewproject = 0; |
1822 | 1822 | if (empty($newproject->public)) { |
1823 | - $tmps = $newproject->getProjectsAuthorizedForUser($user, 0, 1, 0, '(fk_statut:=:1)'); // We check only open project (cloning on closed is not allowed) |
|
1823 | + $tmps = $newproject->getProjectsAuthorizedForUser($user, 0, 1, 0, '(fk_statut:=:1)'); // We check only open project (cloning on closed is not allowed) |
|
1824 | 1824 | $tmparray = explode(',', $tmps); |
1825 | 1825 | if (!in_array($newproject->id, $tmparray)) { |
1826 | 1826 | $iscontactofnewproject = 1; |
@@ -1839,8 +1839,8 @@ discard block |
||
1839 | 1839 | |
1840 | 1840 | $defaultref = ''; |
1841 | 1841 | $classnamemodtask = getDolGlobalString('PROJECT_TASK_ADDON', 'mod_task_simple'); |
1842 | - if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON') . ".php")) { |
|
1843 | - require_once DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON') . '.php'; |
|
1842 | + if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').".php")) { |
|
1843 | + require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').'.php'; |
|
1844 | 1844 | $modTask = new $classnamemodtask(); |
1845 | 1845 | '@phan-var-force ModeleNumRefTask $modTask'; |
1846 | 1846 | $defaultref = $modTask->getNextValue(null, $clone_task); |
@@ -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,26 +887,26 @@ 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") { |
898 | 898 | urlform = urlform + "#show_files"; |
899 | 899 | } |
900 | 900 | $( this ).closest("form").attr("action", urlform); |
901 | - console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform); |
|
901 | + console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform); |
|
902 | 902 | /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */ |
903 | 903 | if ($(this).val() != \'0\') { |
904 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', false); |
|
905 | - jQuery(".' . $name . 'other").hide(); /* To disable if another div was open */ |
|
906 | - jQuery(".' . $name . '"+massaction).show(); |
|
904 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', false); |
|
905 | + jQuery(".' . $name.'other").hide(); /* To disable if another div was open */ |
|
906 | + jQuery(".' . $name.'"+massaction).show(); |
|
907 | 907 | } else { |
908 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', true); |
|
909 | - jQuery(".' . $name . 'other").hide(); /* To disable any div open */ |
|
908 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', true); |
|
909 | + jQuery(".' . $name.'other").hide(); /* To disable any div open */ |
|
910 | 910 | } |
911 | 911 | }); |
912 | 912 | }); |
@@ -949,14 +949,14 @@ discard block |
||
949 | 949 | $atleastonefavorite = 0; |
950 | 950 | |
951 | 951 | $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec"; |
952 | - $sql .= " FROM " . $this->db->prefix() . "c_country"; |
|
952 | + $sql .= " FROM ".$this->db->prefix()."c_country"; |
|
953 | 953 | $sql .= " WHERE active > 0"; |
954 | 954 | //$sql.= " ORDER BY code ASC"; |
955 | 955 | |
956 | - dol_syslog(get_class($this) . "::select_country", LOG_DEBUG); |
|
956 | + dol_syslog(get_class($this)."::select_country", LOG_DEBUG); |
|
957 | 957 | $resql = $this->db->query($sql); |
958 | 958 | if ($resql) { |
959 | - $out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
959 | + $out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>'; |
|
960 | 960 | $num = $this->db->num_rows($resql); |
961 | 961 | $i = 0; |
962 | 962 | if ($num) { |
@@ -966,7 +966,7 @@ discard block |
||
966 | 966 | $countryArray[$i]['rowid'] = $obj->rowid; |
967 | 967 | $countryArray[$i]['code_iso'] = $obj->code_iso; |
968 | 968 | $countryArray[$i]['code_iso3'] = $obj->code_iso3; |
969 | - $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 : '')); |
|
969 | + $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 : '')); |
|
970 | 970 | $countryArray[$i]['favorite'] = $obj->favorite; |
971 | 971 | $countryArray[$i]['eec'] = $obj->eec; |
972 | 972 | $favorite[$i] = $obj->favorite; |
@@ -984,20 +984,20 @@ discard block |
||
984 | 984 | |
985 | 985 | if ($showempty) { |
986 | 986 | if (is_numeric($showempty)) { |
987 | - $out .= '<option value=""> </option>' . "\n"; |
|
987 | + $out .= '<option value=""> </option>'."\n"; |
|
988 | 988 | } else { |
989 | - $out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n"; |
|
989 | + $out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n"; |
|
990 | 990 | } |
991 | 991 | } |
992 | 992 | |
993 | 993 | if ($addspecialentries) { // Add dedicated entries for groups of countries |
994 | 994 | //if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>'; |
995 | - $out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
996 | - $out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>'; |
|
995 | + $out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
996 | + $out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>'; |
|
997 | 997 | if ($mysoc->isInEEC()) { |
998 | - $out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
998 | + $out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
999 | 999 | } |
1000 | - $out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>'; |
|
1000 | + $out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>'; |
|
1001 | 1001 | $out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>'; |
1002 | 1002 | } |
1003 | 1003 | |
@@ -1025,20 +1025,20 @@ discard block |
||
1025 | 1025 | $labeltoshow .= ' '; |
1026 | 1026 | } |
1027 | 1027 | if ($row['code_iso']) { |
1028 | - $labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>'; |
|
1028 | + $labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>'; |
|
1029 | 1029 | if (empty($hideflags)) { |
1030 | 1030 | $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1); |
1031 | - $labeltoshow = $tmpflag . ' ' . $labeltoshow; |
|
1031 | + $labeltoshow = $tmpflag.' '.$labeltoshow; |
|
1032 | 1032 | } |
1033 | 1033 | } |
1034 | 1034 | |
1035 | 1035 | if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) { |
1036 | - $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']) . '">'; |
|
1036 | + $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']).'">'; |
|
1037 | 1037 | } else { |
1038 | - $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']) . '">'; |
|
1038 | + $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']).'">'; |
|
1039 | 1039 | } |
1040 | 1040 | $out .= $labeltoshow; |
1041 | - $out .= '</option>' . "\n"; |
|
1041 | + $out .= '</option>'."\n"; |
|
1042 | 1042 | } |
1043 | 1043 | } |
1044 | 1044 | $out .= '</select>'; |
@@ -1047,8 +1047,8 @@ discard block |
||
1047 | 1047 | } |
1048 | 1048 | |
1049 | 1049 | // Make select dynamic |
1050 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1051 | - $out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve'); |
|
1050 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1051 | + $out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve'); |
|
1052 | 1052 | |
1053 | 1053 | return $out; |
1054 | 1054 | } |
@@ -1080,25 +1080,25 @@ discard block |
||
1080 | 1080 | $incotermArray = array(); |
1081 | 1081 | |
1082 | 1082 | $sql = "SELECT rowid, code"; |
1083 | - $sql .= " FROM " . $this->db->prefix() . "c_incoterms"; |
|
1083 | + $sql .= " FROM ".$this->db->prefix()."c_incoterms"; |
|
1084 | 1084 | $sql .= " WHERE active > 0"; |
1085 | 1085 | $sql .= " ORDER BY code ASC"; |
1086 | 1086 | |
1087 | - dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG); |
|
1087 | + dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG); |
|
1088 | 1088 | $resql = $this->db->query($sql); |
1089 | 1089 | if ($resql) { |
1090 | 1090 | if ($conf->use_javascript_ajax && !$forcecombo) { |
1091 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1091 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1092 | 1092 | $out .= ajax_combobox($htmlname, $events); |
1093 | 1093 | } |
1094 | 1094 | |
1095 | 1095 | if (!empty($page)) { |
1096 | - $out .= '<form method="post" action="' . $page . '">'; |
|
1096 | + $out .= '<form method="post" action="'.$page.'">'; |
|
1097 | 1097 | $out .= '<input type="hidden" name="action" value="set_incoterms">'; |
1098 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1098 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1099 | 1099 | } |
1100 | 1100 | |
1101 | - $out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
1101 | + $out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>'; |
|
1102 | 1102 | $out .= '<option value="0"> </option>'; |
1103 | 1103 | $num = $this->db->num_rows($resql); |
1104 | 1104 | $i = 0; |
@@ -1112,9 +1112,9 @@ discard block |
||
1112 | 1112 | |
1113 | 1113 | foreach ($incotermArray as $row) { |
1114 | 1114 | if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) { |
1115 | - $out .= '<option value="' . $row['rowid'] . '" selected>'; |
|
1115 | + $out .= '<option value="'.$row['rowid'].'" selected>'; |
|
1116 | 1116 | } else { |
1117 | - $out .= '<option value="' . $row['rowid'] . '">'; |
|
1117 | + $out .= '<option value="'.$row['rowid'].'">'; |
|
1118 | 1118 | } |
1119 | 1119 | |
1120 | 1120 | if ($row['code']) { |
@@ -1127,13 +1127,13 @@ discard block |
||
1127 | 1127 | $out .= '</select>'; |
1128 | 1128 | |
1129 | 1129 | if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
1130 | - $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; |
|
1130 | + $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n"; |
|
1131 | 1131 | $moreattrib .= ' autocomplete="off"'; |
1132 | 1132 | } |
1133 | - $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n"; |
|
1133 | + $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n"; |
|
1134 | 1134 | |
1135 | 1135 | if (!empty($page)) { |
1136 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>'; |
|
1136 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>'; |
|
1137 | 1137 | } |
1138 | 1138 | } else { |
1139 | 1139 | dol_print_error($this->db); |
@@ -1165,9 +1165,9 @@ discard block |
||
1165 | 1165 | if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service")) |
1166 | 1166 | || (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) { |
1167 | 1167 | if (empty($hidetext)) { |
1168 | - print $langs->trans("Type") . ': '; |
|
1168 | + print $langs->trans("Type").': '; |
|
1169 | 1169 | } |
1170 | - print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
1170 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
1171 | 1171 | if ($showempty) { |
1172 | 1172 | print '<option value="-1"'; |
1173 | 1173 | if ($selected == -1) { |
@@ -1186,28 +1186,28 @@ discard block |
||
1186 | 1186 | if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) { |
1187 | 1187 | print ' selected'; |
1188 | 1188 | } |
1189 | - print '>' . $langs->trans("Product"); |
|
1189 | + print '>'.$langs->trans("Product"); |
|
1190 | 1190 | |
1191 | 1191 | print '<option value="1"'; |
1192 | 1192 | if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) { |
1193 | 1193 | print ' selected'; |
1194 | 1194 | } |
1195 | - print '>' . $langs->trans("Service"); |
|
1195 | + print '>'.$langs->trans("Service"); |
|
1196 | 1196 | |
1197 | 1197 | print '</select>'; |
1198 | - print ajax_combobox('select_' . $htmlname); |
|
1198 | + print ajax_combobox('select_'.$htmlname); |
|
1199 | 1199 | //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
1200 | 1200 | } |
1201 | 1201 | if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { |
1202 | 1202 | print $langs->trans("Service"); |
1203 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; |
|
1203 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; |
|
1204 | 1204 | } |
1205 | 1205 | if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) { |
1206 | 1206 | print $langs->trans("Product"); |
1207 | - print '<input type="hidden" name="' . $htmlname . '" value="0">'; |
|
1207 | + print '<input type="hidden" name="'.$htmlname.'" value="0">'; |
|
1208 | 1208 | } |
1209 | 1209 | if ($forceall < 0) { // This should happened only for contracts when both predefined product and service are disabled. |
1210 | - 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 |
|
1210 | + 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 |
|
1211 | 1211 | } |
1212 | 1212 | } |
1213 | 1213 | |
@@ -1233,7 +1233,7 @@ discard block |
||
1233 | 1233 | $langs->load("trips"); |
1234 | 1234 | |
1235 | 1235 | $sql = "SELECT c.code, c.label"; |
1236 | - $sql .= " FROM " . $this->db->prefix() . "c_type_fees as c"; |
|
1236 | + $sql .= " FROM ".$this->db->prefix()."c_type_fees as c"; |
|
1237 | 1237 | $sql .= " WHERE active > 0"; |
1238 | 1238 | |
1239 | 1239 | $resql = $this->db->query($sql); |
@@ -1274,11 +1274,11 @@ discard block |
||
1274 | 1274 | // phpcs:enable |
1275 | 1275 | global $user, $langs; |
1276 | 1276 | |
1277 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
1277 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
1278 | 1278 | |
1279 | 1279 | $this->load_cache_types_fees(); |
1280 | 1280 | |
1281 | - print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">'; |
|
1281 | + print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">'; |
|
1282 | 1282 | if ($showempty) { |
1283 | 1283 | print '<option value="-1"'; |
1284 | 1284 | if ($selected == -1) { |
@@ -1288,7 +1288,7 @@ discard block |
||
1288 | 1288 | } |
1289 | 1289 | |
1290 | 1290 | foreach ($this->cache_types_fees as $key => $value) { |
1291 | - print '<option value="' . $key . '"'; |
|
1291 | + print '<option value="'.$key.'"'; |
|
1292 | 1292 | if ($key == $selected) { |
1293 | 1293 | print ' selected'; |
1294 | 1294 | } |
@@ -1340,12 +1340,12 @@ discard block |
||
1340 | 1340 | $ajaxoptions = array(); |
1341 | 1341 | } |
1342 | 1342 | |
1343 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1343 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1344 | 1344 | |
1345 | 1345 | // No immediate load of all database |
1346 | 1346 | $placeholder = ''; |
1347 | 1347 | if ($selected && empty($selected_input_value)) { |
1348 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
1348 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
1349 | 1349 | $societetmp = new Societe($this->db); |
1350 | 1350 | $societetmp->fetch($selected); |
1351 | 1351 | $selected_input_value = $societetmp->name; |
@@ -1353,18 +1353,18 @@ discard block |
||
1353 | 1353 | } |
1354 | 1354 | |
1355 | 1355 | // mode 1 |
1356 | - $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)) : ''); |
|
1356 | + $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)) : ''); |
|
1357 | 1357 | |
1358 | 1358 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
1359 | 1359 | if (empty($hidelabel)) { |
1360 | - print $langs->trans("RefOrLabel") . ' : '; |
|
1360 | + print $langs->trans("RefOrLabel").' : '; |
|
1361 | 1361 | } elseif ($hidelabel > 1) { |
1362 | 1362 | $placeholder = $langs->trans("RefOrLabel"); |
1363 | 1363 | if ($hidelabel == 2) { |
1364 | 1364 | $out .= img_picto($langs->trans("Search"), 'search'); |
1365 | 1365 | } |
1366 | 1366 | } |
1367 | - $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' : '') . ' />'; |
|
1367 | + $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' : '').' />'; |
|
1368 | 1368 | if ($hidelabel == 3) { |
1369 | 1369 | $out .= img_picto($langs->trans("Search"), 'search'); |
1370 | 1370 | } |
@@ -1426,12 +1426,12 @@ discard block |
||
1426 | 1426 | $events = array(); |
1427 | 1427 | } |
1428 | 1428 | |
1429 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1429 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1430 | 1430 | |
1431 | 1431 | // No immediate load of all database |
1432 | 1432 | $placeholder = ''; |
1433 | 1433 | if ($selected && empty($selected_input_value)) { |
1434 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
1434 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
1435 | 1435 | $contacttmp = new Contact($this->db); |
1436 | 1436 | $contacttmp->fetch($selected); |
1437 | 1437 | $selected_input_value = $contacttmp->getFullName($langs); |
@@ -1442,11 +1442,11 @@ discard block |
||
1442 | 1442 | } |
1443 | 1443 | |
1444 | 1444 | // mode 1 |
1445 | - $urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($exclude) ? '' : '&exclude=' . urlencode($exclude)) . ($showsoc ? '&showsoc=' . urlencode((string) ($showsoc)) : ''); |
|
1445 | + $urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($exclude) ? '' : '&exclude='.urlencode($exclude)).($showsoc ? '&showsoc='.urlencode((string) ($showsoc)) : ''); |
|
1446 | 1446 | |
1447 | 1447 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
1448 | 1448 | |
1449 | - $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' : '') . ' />'; |
|
1449 | + $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' : '').' />'; |
|
1450 | 1450 | |
1451 | 1451 | $out .= ajax_event($htmlname, $events); |
1452 | 1452 | |
@@ -1543,30 +1543,30 @@ discard block |
||
1543 | 1543 | $sql .= ", s.address, s.zip, s.town"; |
1544 | 1544 | $sql .= ", dictp.code as country_code"; |
1545 | 1545 | } |
1546 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
1546 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
1547 | 1547 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
1548 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
1548 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
1549 | 1549 | } |
1550 | 1550 | if (!$user->hasRight('societe', 'client', 'voir')) { |
1551 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
1551 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
1552 | 1552 | } |
1553 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
1553 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
1554 | 1554 | if (!empty($user->socid)) { |
1555 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
1555 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
1556 | 1556 | } |
1557 | 1557 | if ($filter) { |
1558 | 1558 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
1559 | 1559 | // if not, by testSqlAndScriptInject() only. |
1560 | - $sql .= " AND (" . $filter . ")"; |
|
1560 | + $sql .= " AND (".$filter.")"; |
|
1561 | 1561 | } |
1562 | 1562 | if (!$user->hasRight('societe', 'client', 'voir')) { |
1563 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
1563 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
1564 | 1564 | } |
1565 | 1565 | if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) { |
1566 | 1566 | $sql .= " AND s.status <> 0"; |
1567 | 1567 | } |
1568 | 1568 | if (!empty($excludeids)) { |
1569 | - $sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")"; |
|
1569 | + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")"; |
|
1570 | 1570 | } |
1571 | 1571 | // Add where from hooks |
1572 | 1572 | $parameters = array(); |
@@ -1586,17 +1586,17 @@ discard block |
||
1586 | 1586 | if ($i > 0) { |
1587 | 1587 | $sql .= " AND "; |
1588 | 1588 | } |
1589 | - $sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
1589 | + $sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
1590 | 1590 | $i++; |
1591 | 1591 | } |
1592 | 1592 | if (count($search_crit) > 1) { |
1593 | 1593 | $sql .= ")"; |
1594 | 1594 | } |
1595 | 1595 | if (isModEnabled('barcode')) { |
1596 | - $sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1596 | + $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
1597 | 1597 | } |
1598 | - $sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1599 | - $sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1598 | + $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
1599 | + $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
1600 | 1600 | $sql .= ")"; |
1601 | 1601 | } |
1602 | 1602 | $sql .= $this->db->order("nom", "ASC"); |
@@ -1607,7 +1607,7 @@ discard block |
||
1607 | 1607 | $resql = $this->db->query($sql); |
1608 | 1608 | if ($resql) { |
1609 | 1609 | // Construct $out and $outarray |
1610 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n"; |
|
1610 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n"; |
|
1611 | 1611 | |
1612 | 1612 | $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); |
1613 | 1613 | if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) { |
@@ -1620,7 +1620,7 @@ discard block |
||
1620 | 1620 | } |
1621 | 1621 | } |
1622 | 1622 | if ($showempty) { |
1623 | - $out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : ' ') . '</span>') . '">' . $textifempty . '</option>' . "\n"; |
|
1623 | + $out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : ' ').'</span>').'">'.$textifempty.'</option>'."\n"; |
|
1624 | 1624 | } |
1625 | 1625 | |
1626 | 1626 | $companytemp = new Societe($this->db); |
@@ -1633,18 +1633,18 @@ discard block |
||
1633 | 1633 | $label = ''; |
1634 | 1634 | if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) { |
1635 | 1635 | if (($obj->client) && (!empty($obj->code_client))) { |
1636 | - $label = $obj->code_client . ' - '; |
|
1636 | + $label = $obj->code_client.' - '; |
|
1637 | 1637 | } |
1638 | 1638 | if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { |
1639 | - $label .= $obj->code_fournisseur . ' - '; |
|
1639 | + $label .= $obj->code_fournisseur.' - '; |
|
1640 | 1640 | } |
1641 | - $label .= ' ' . $obj->name; |
|
1641 | + $label .= ' '.$obj->name; |
|
1642 | 1642 | } else { |
1643 | 1643 | $label = $obj->name; |
1644 | 1644 | } |
1645 | 1645 | |
1646 | 1646 | if (!empty($obj->name_alias)) { |
1647 | - $label .= ' (' . $obj->name_alias . ')'; |
|
1647 | + $label .= ' ('.$obj->name_alias.')'; |
|
1648 | 1648 | } |
1649 | 1649 | |
1650 | 1650 | if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) { |
@@ -1659,7 +1659,7 @@ discard block |
||
1659 | 1659 | $companytemp->fournisseur = $obj->fournisseur; |
1660 | 1660 | $tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); |
1661 | 1661 | if ($tmptype) { |
1662 | - $labelhtml .= ' ' . $tmptype; |
|
1662 | + $labelhtml .= ' '.$tmptype; |
|
1663 | 1663 | } |
1664 | 1664 | |
1665 | 1665 | if ($obj->client || $obj->fournisseur) { |
@@ -1669,10 +1669,10 @@ discard block |
||
1669 | 1669 | $label .= $langs->trans("Customer"); |
1670 | 1670 | } |
1671 | 1671 | if ($obj->client == 2 || $obj->client == 3) { |
1672 | - $label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect"); |
|
1672 | + $label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect"); |
|
1673 | 1673 | } |
1674 | 1674 | if ($obj->fournisseur) { |
1675 | - $label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier"); |
|
1675 | + $label .= ($obj->client ? ', ' : '').$langs->trans("Supplier"); |
|
1676 | 1676 | } |
1677 | 1677 | if ($obj->client || $obj->fournisseur) { |
1678 | 1678 | $label .= ')'; |
@@ -1680,9 +1680,9 @@ discard block |
||
1680 | 1680 | } |
1681 | 1681 | |
1682 | 1682 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
1683 | - $s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : ''); |
|
1683 | + $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); |
|
1684 | 1684 | if (!empty($obj->country_code)) { |
1685 | - $s .= ', ' . $langs->trans('Country' . $obj->country_code); |
|
1685 | + $s .= ', '.$langs->trans('Country'.$obj->country_code); |
|
1686 | 1686 | } |
1687 | 1687 | $label .= $s; |
1688 | 1688 | $labelhtml .= $s; |
@@ -1690,9 +1690,9 @@ discard block |
||
1690 | 1690 | |
1691 | 1691 | if (empty($outputmode)) { |
1692 | 1692 | if (in_array($obj->rowid, $selected)) { |
1693 | - $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>'; |
|
1693 | + $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>'; |
|
1694 | 1694 | } else { |
1695 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
1695 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
1696 | 1696 | } |
1697 | 1697 | } else { |
1698 | 1698 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml)); |
@@ -1704,9 +1704,9 @@ discard block |
||
1704 | 1704 | } |
1705 | 1705 | } |
1706 | 1706 | } |
1707 | - $out .= '</select>' . "\n"; |
|
1707 | + $out .= '</select>'."\n"; |
|
1708 | 1708 | if (!$forcecombo) { |
1709 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1709 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1710 | 1710 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("COMPANY_USE_SEARCH_TO_SELECT")); |
1711 | 1711 | } |
1712 | 1712 | } else { |
@@ -1795,7 +1795,7 @@ discard block |
||
1795 | 1795 | } |
1796 | 1796 | |
1797 | 1797 | if (!is_object($hookmanager)) { |
1798 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
1798 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
1799 | 1799 | $hookmanager = new HookManager($this->db); |
1800 | 1800 | } |
1801 | 1801 | |
@@ -1804,13 +1804,13 @@ discard block |
||
1804 | 1804 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
1805 | 1805 | $sql .= ", s.nom as company, s.town AS company_town"; |
1806 | 1806 | } |
1807 | - $sql .= " FROM " . $this->db->prefix() . "socpeople as sp"; |
|
1807 | + $sql .= " FROM ".$this->db->prefix()."socpeople as sp"; |
|
1808 | 1808 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
1809 | - $sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc"; |
|
1809 | + $sql .= " LEFT OUTER JOIN ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc"; |
|
1810 | 1810 | } |
1811 | - $sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")"; |
|
1811 | + $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
|
1812 | 1812 | if ($socid > 0 || $socid == -1) { |
1813 | - $sql .= " AND sp.fk_soc = " . ((int) $socid); |
|
1813 | + $sql .= " AND sp.fk_soc = ".((int) $socid); |
|
1814 | 1814 | } |
1815 | 1815 | if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) { |
1816 | 1816 | $sql .= " AND sp.statut <> 0"; |
@@ -1818,7 +1818,7 @@ discard block |
||
1818 | 1818 | if ($filter) { |
1819 | 1819 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
1820 | 1820 | // if not, by testSqlAndScriptInject() only. |
1821 | - $sql .= " AND (" . $filter . ")"; |
|
1821 | + $sql .= " AND (".$filter.")"; |
|
1822 | 1822 | } |
1823 | 1823 | // Add where from hooks |
1824 | 1824 | $parameters = array(); |
@@ -1826,30 +1826,30 @@ discard block |
||
1826 | 1826 | $sql .= $hookmanager->resPrint; |
1827 | 1827 | $sql .= " ORDER BY sp.lastname ASC"; |
1828 | 1828 | |
1829 | - dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG); |
|
1829 | + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); |
|
1830 | 1830 | $resql = $this->db->query($sql); |
1831 | 1831 | if ($resql) { |
1832 | 1832 | $num = $this->db->num_rows($resql); |
1833 | 1833 | |
1834 | 1834 | if ($htmlname != 'none' && !$options_only) { |
1835 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>'; |
|
1835 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; |
|
1836 | 1836 | } |
1837 | 1837 | |
1838 | 1838 | if ($showempty && !is_numeric($showempty)) { |
1839 | 1839 | $textforempty = $showempty; |
1840 | - $out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>'; |
|
1840 | + $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; |
|
1841 | 1841 | } else { |
1842 | 1842 | if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) { |
1843 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '> </option>'; |
|
1843 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>'; |
|
1844 | 1844 | } |
1845 | 1845 | if ($showempty == 2) { |
1846 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>'; |
|
1846 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; |
|
1847 | 1847 | } |
1848 | 1848 | } |
1849 | 1849 | |
1850 | 1850 | $i = 0; |
1851 | 1851 | if ($num) { |
1852 | - include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
1852 | + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
1853 | 1853 | $contactstatic = new Contact($this->db); |
1854 | 1854 | |
1855 | 1855 | while ($i < $num) { |
@@ -1885,7 +1885,7 @@ discard block |
||
1885 | 1885 | } |
1886 | 1886 | $extendedInfos = implode(' - ', $extendedInfos); |
1887 | 1887 | if (!empty($extendedInfos)) { |
1888 | - $extendedInfos = ' - ' . $extendedInfos; |
|
1888 | + $extendedInfos = ' - '.$extendedInfos; |
|
1889 | 1889 | } |
1890 | 1890 | } |
1891 | 1891 | |
@@ -1903,35 +1903,35 @@ discard block |
||
1903 | 1903 | $disabled = 1; |
1904 | 1904 | } |
1905 | 1905 | if (!empty($selected) && in_array($obj->rowid, $selected)) { |
1906 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
1906 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
1907 | 1907 | if ($disabled) { |
1908 | 1908 | $out .= ' disabled'; |
1909 | 1909 | } |
1910 | 1910 | $out .= ' selected>'; |
1911 | 1911 | |
1912 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
1912 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
1913 | 1913 | if ($showfunction && $obj->poste) { |
1914 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
1914 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
1915 | 1915 | } |
1916 | 1916 | if (($showsoc > 0) && $obj->company) { |
1917 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
1917 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
1918 | 1918 | } |
1919 | 1919 | |
1920 | 1920 | $out .= $tmplabel; |
1921 | 1921 | $out .= '</option>'; |
1922 | 1922 | } else { |
1923 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
1923 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
1924 | 1924 | if ($disabled) { |
1925 | 1925 | $out .= ' disabled'; |
1926 | 1926 | } |
1927 | 1927 | $out .= '>'; |
1928 | 1928 | |
1929 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
1929 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
1930 | 1930 | if ($showfunction && $obj->poste) { |
1931 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
1931 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
1932 | 1932 | } |
1933 | 1933 | if (($showsoc > 0) && $obj->company) { |
1934 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
1934 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
1935 | 1935 | } |
1936 | 1936 | |
1937 | 1937 | $out .= $tmplabel; |
@@ -1939,12 +1939,12 @@ discard block |
||
1939 | 1939 | } |
1940 | 1940 | } else { |
1941 | 1941 | if (in_array($obj->rowid, $selected)) { |
1942 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
1942 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
1943 | 1943 | if ($showfunction && $obj->poste) { |
1944 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
1944 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
1945 | 1945 | } |
1946 | 1946 | if (($showsoc > 0) && $obj->company) { |
1947 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
1947 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
1948 | 1948 | } |
1949 | 1949 | |
1950 | 1950 | $out .= $tmplabel; |
@@ -1959,7 +1959,7 @@ discard block |
||
1959 | 1959 | } |
1960 | 1960 | } else { |
1961 | 1961 | $labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); |
1962 | - $out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">'; |
|
1962 | + $out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">'; |
|
1963 | 1963 | $out .= $labeltoshow; |
1964 | 1964 | $out .= '</option>'; |
1965 | 1965 | } |
@@ -1980,7 +1980,7 @@ discard block |
||
1980 | 1980 | } |
1981 | 1981 | |
1982 | 1982 | if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { |
1983 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1983 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1984 | 1984 | $out .= ajax_combobox($htmlid, $events, getDolGlobalInt("CONTACT_USE_SEARCH_TO_SELECT")); |
1985 | 1985 | } |
1986 | 1986 | |
@@ -2019,18 +2019,18 @@ discard block |
||
2019 | 2019 | // On recherche les remises |
2020 | 2020 | $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
2021 | 2021 | $sql .= " re.description, re.fk_facture_source"; |
2022 | - $sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re"; |
|
2023 | - $sql .= " WHERE re.fk_soc = " . (int) $socid; |
|
2024 | - $sql .= " AND re.entity = " . $conf->entity; |
|
2022 | + $sql .= " FROM ".$this->db->prefix()."societe_remise_except as re"; |
|
2023 | + $sql .= " WHERE re.fk_soc = ".(int) $socid; |
|
2024 | + $sql .= " AND re.entity = ".$conf->entity; |
|
2025 | 2025 | if ($filter) { |
2026 | - $sql .= " AND " . $filter; |
|
2026 | + $sql .= " AND ".$filter; |
|
2027 | 2027 | } |
2028 | 2028 | $sql .= " ORDER BY re.description ASC"; |
2029 | 2029 | |
2030 | - dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG); |
|
2030 | + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); |
|
2031 | 2031 | $resql = $this->db->query($sql); |
2032 | 2032 | if ($resql) { |
2033 | - print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">'; |
|
2033 | + print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">'; |
|
2034 | 2034 | $num = $this->db->num_rows($resql); |
2035 | 2035 | |
2036 | 2036 | $qualifiedlines = $num; |
@@ -2068,16 +2068,16 @@ discard block |
||
2068 | 2068 | if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) { |
2069 | 2069 | $tmpfac = new Facture($this->db); |
2070 | 2070 | if ($tmpfac->fetch($obj->fk_facture_source) > 0) { |
2071 | - $desc = $desc . ' - ' . $tmpfac->ref; |
|
2071 | + $desc = $desc.' - '.$tmpfac->ref; |
|
2072 | 2072 | } |
2073 | 2073 | } |
2074 | 2074 | |
2075 | - print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; |
|
2075 | + print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>'; |
|
2076 | 2076 | $i++; |
2077 | 2077 | } |
2078 | 2078 | } |
2079 | 2079 | print '</select>'; |
2080 | - print ajax_combobox('select_' . $htmlname); |
|
2080 | + print ajax_combobox('select_'.$htmlname); |
|
2081 | 2081 | |
2082 | 2082 | return $qualifiedlines; |
2083 | 2083 | } else { |
@@ -2186,14 +2186,14 @@ discard block |
||
2186 | 2186 | if ($showlabelofentity) { |
2187 | 2187 | $sql .= ", e.label"; |
2188 | 2188 | } |
2189 | - $sql .= " FROM " . $this->db->prefix() . "user as u"; |
|
2189 | + $sql .= " FROM ".$this->db->prefix()."user as u"; |
|
2190 | 2190 | if ($showlabelofentity) { |
2191 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity"; |
|
2191 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; |
|
2192 | 2192 | } |
2193 | 2193 | // Condition here should be the same than into societe->getSalesRepresentatives(). |
2194 | 2194 | if ($userissuperadminentityone && $force_entity != 'default') { |
2195 | 2195 | if (!empty($force_entity)) { |
2196 | - $sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")"; |
|
2196 | + $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; |
|
2197 | 2197 | } else { |
2198 | 2198 | $sql .= " WHERE u.entity IS NOT NULL"; |
2199 | 2199 | } |
@@ -2201,18 +2201,18 @@ discard block |
||
2201 | 2201 | if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) { |
2202 | 2202 | $sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))"; |
2203 | 2203 | } else { |
2204 | - $sql .= " WHERE u.entity IN (" . getEntity('user') . ")"; |
|
2204 | + $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
|
2205 | 2205 | } |
2206 | 2206 | } |
2207 | 2207 | |
2208 | 2208 | if (!empty($user->socid)) { |
2209 | - $sql .= " AND u.fk_soc = " . ((int) $user->socid); |
|
2209 | + $sql .= " AND u.fk_soc = ".((int) $user->socid); |
|
2210 | 2210 | } |
2211 | 2211 | if (is_array($exclude) && $excludeUsers) { |
2212 | - $sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")"; |
|
2212 | + $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; |
|
2213 | 2213 | } |
2214 | 2214 | if ($includeUsers) { |
2215 | - $sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")"; |
|
2215 | + $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; |
|
2216 | 2216 | } |
2217 | 2217 | if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) { |
2218 | 2218 | $sql .= " AND u.statut <> 0"; |
@@ -2224,7 +2224,7 @@ discard block |
||
2224 | 2224 | $sql .= " AND u.fk_soc IS NULL"; |
2225 | 2225 | } |
2226 | 2226 | if (!empty($morefilter)) { |
2227 | - $sql .= " " . $morefilter; |
|
2227 | + $sql .= " ".$morefilter; |
|
2228 | 2228 | } |
2229 | 2229 | |
2230 | 2230 | //Add hook to filter on user (for example on usergroup define in custom modules) |
@@ -2239,7 +2239,7 @@ discard block |
||
2239 | 2239 | $sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC"; |
2240 | 2240 | } |
2241 | 2241 | |
2242 | - dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG); |
|
2242 | + dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); |
|
2243 | 2243 | |
2244 | 2244 | $resql = $this->db->query($sql); |
2245 | 2245 | if ($resql) { |
@@ -2247,7 +2247,7 @@ discard block |
||
2247 | 2247 | $i = 0; |
2248 | 2248 | if ($num) { |
2249 | 2249 | // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined |
2250 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
2250 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
2251 | 2251 | if ($show_empty && !$multiple) { |
2252 | 2252 | $textforempty = ' '; |
2253 | 2253 | if (!empty($conf->use_javascript_ajax)) { |
@@ -2256,7 +2256,7 @@ discard block |
||
2256 | 2256 | if (!is_numeric($show_empty)) { |
2257 | 2257 | $textforempty = $show_empty; |
2258 | 2258 | } |
2259 | - $out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
2259 | + $out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
2260 | 2260 | |
2261 | 2261 | $outarray[($show_empty < 0 ? $show_empty : -1)] = $textforempty; |
2262 | 2262 | $outarray2[($show_empty < 0 ? $show_empty : -1)] = array( |
@@ -2268,13 +2268,13 @@ discard block |
||
2268 | 2268 | ); |
2269 | 2269 | } |
2270 | 2270 | if ($show_every) { |
2271 | - $out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n"; |
|
2271 | + $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; |
|
2272 | 2272 | |
2273 | - $outarray[-2] = '-- ' . $langs->trans("Everybody") . ' --'; |
|
2273 | + $outarray[-2] = '-- '.$langs->trans("Everybody").' --'; |
|
2274 | 2274 | $outarray2[-2] = array( |
2275 | 2275 | 'id' => -2, |
2276 | - 'label' => '-- ' . $langs->trans("Everybody") . ' --', |
|
2277 | - 'labelhtml' => '-- ' . $langs->trans("Everybody") . ' --', |
|
2276 | + 'label' => '-- '.$langs->trans("Everybody").' --', |
|
2277 | + 'labelhtml' => '-- '.$langs->trans("Everybody").' --', |
|
2278 | 2278 | 'color' => '', |
2279 | 2279 | 'picto' => '' |
2280 | 2280 | ); |
@@ -2325,21 +2325,21 @@ discard block |
||
2325 | 2325 | } |
2326 | 2326 | if ($showstatus >= 0) { |
2327 | 2327 | if ($obj->status == 1 && $showstatus == 1) { |
2328 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled'); |
|
2329 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled'); |
|
2328 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); |
|
2329 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled'); |
|
2330 | 2330 | } |
2331 | 2331 | if ($obj->status == 0 && $showstatus == 1) { |
2332 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled'); |
|
2333 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled'); |
|
2332 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); |
|
2333 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled'); |
|
2334 | 2334 | } |
2335 | 2335 | } |
2336 | 2336 | if ($showlabelofentity) { |
2337 | 2337 | if (empty($obj->entity)) { |
2338 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities"); |
|
2339 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities"); |
|
2338 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); |
|
2339 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities"); |
|
2340 | 2340 | } else { |
2341 | 2341 | if ($obj->entity != $conf->entity) { |
2342 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
2342 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
2343 | 2343 | $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
2344 | 2344 | } |
2345 | 2345 | } |
@@ -2348,13 +2348,13 @@ discard block |
||
2348 | 2348 | $moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : ''); |
2349 | 2349 | if (!empty($disableline) && $disableline != '1') { |
2350 | 2350 | // Add text from $enableonlytext parameter |
2351 | - $moreinfo .= ' - ' . $disableline; |
|
2352 | - $moreinfohtml .= ' - ' . $disableline; |
|
2351 | + $moreinfo .= ' - '.$disableline; |
|
2352 | + $moreinfohtml .= ' - '.$disableline; |
|
2353 | 2353 | } |
2354 | 2354 | $labeltoshow .= $moreinfo; |
2355 | 2355 | $labeltoshowhtml .= $moreinfohtml; |
2356 | 2356 | |
2357 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
2357 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
2358 | 2358 | if (!empty($disableline)) { |
2359 | 2359 | $out .= ' disabled'; |
2360 | 2360 | } |
@@ -2363,7 +2363,7 @@ discard block |
||
2363 | 2363 | } |
2364 | 2364 | $out .= ' data-html="'; |
2365 | 2365 | |
2366 | - $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' '; |
|
2366 | + $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; |
|
2367 | 2367 | if ($showstatus >= 0 && $obj->status == 0) { |
2368 | 2368 | $outhtml .= '<strike class="opacitymediumxxx">'; |
2369 | 2369 | } |
@@ -2378,7 +2378,7 @@ discard block |
||
2378 | 2378 | $out .= $labeltoshow; |
2379 | 2379 | $out .= '</option>'; |
2380 | 2380 | |
2381 | - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo; |
|
2381 | + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; |
|
2382 | 2382 | $outarray2[$userstatic->id] = array( |
2383 | 2383 | 'id' => $userstatic->id, |
2384 | 2384 | 'label' => $labeltoshow, |
@@ -2390,14 +2390,14 @@ discard block |
||
2390 | 2390 | $i++; |
2391 | 2391 | } |
2392 | 2392 | } else { |
2393 | - $out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>'; |
|
2394 | - $out .= '<option value="">' . $langs->trans("None") . '</option>'; |
|
2393 | + $out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>'; |
|
2394 | + $out .= '<option value="">'.$langs->trans("None").'</option>'; |
|
2395 | 2395 | } |
2396 | 2396 | $out .= '</select>'; |
2397 | 2397 | |
2398 | 2398 | if ($num && !$forcecombo) { |
2399 | 2399 | // Enhance with select2 |
2400 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
2400 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
2401 | 2401 | $out .= ajax_combobox($htmlname); |
2402 | 2402 | } |
2403 | 2403 | } else { |
@@ -2473,16 +2473,16 @@ discard block |
||
2473 | 2473 | $out .= $userstatic->getNomUrl(-1); |
2474 | 2474 | if ($i == 0) { |
2475 | 2475 | $ownerid = $value['id']; |
2476 | - $out .= ' (' . $langs->trans("Owner") . ')'; |
|
2476 | + $out .= ' ('.$langs->trans("Owner").')'; |
|
2477 | 2477 | } |
2478 | 2478 | if ($nbassignetouser > 1 && $action != 'view') { |
2479 | - $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 . '">'; |
|
2479 | + $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.'">'; |
|
2480 | 2480 | } |
2481 | 2481 | // Show my availability |
2482 | 2482 | if ($showproperties) { |
2483 | 2483 | if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) { |
2484 | 2484 | $out .= '<div class="myavailability inline-block">'; |
2485 | - $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>'; |
|
2485 | + $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>'; |
|
2486 | 2486 | $out .= '</div>'; |
2487 | 2487 | } |
2488 | 2488 | } |
@@ -2499,15 +2499,15 @@ discard block |
||
2499 | 2499 | // Method with no ajax |
2500 | 2500 | if ($action != 'view') { |
2501 | 2501 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">'; |
2502 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
2502 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
2503 | 2503 | $out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });'; |
2504 | 2504 | $out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());'; |
2505 | - $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }'; |
|
2506 | - $out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }'; |
|
2505 | + $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }'; |
|
2506 | + $out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }'; |
|
2507 | 2507 | $out .= '});'; |
2508 | 2508 | $out .= '})</script>'; |
2509 | 2509 | $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
2510 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
2510 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
2511 | 2511 | $out .= '<br>'; |
2512 | 2512 | } |
2513 | 2513 | |
@@ -2566,13 +2566,13 @@ discard block |
||
2566 | 2566 | $resourcestatic->fetch($value['id']); |
2567 | 2567 | $out .= $resourcestatic->getNomUrl(-1); |
2568 | 2568 | if ($nbassignetoresource > 1 && $action != 'view') { |
2569 | - $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 . '">'; |
|
2569 | + $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.'">'; |
|
2570 | 2570 | } |
2571 | 2571 | // Show my availability |
2572 | 2572 | if ($showproperties) { |
2573 | 2573 | if (is_array($listofresourceid) && count($listofresourceid)) { |
2574 | 2574 | $out .= '<div class="myavailability inline-block">'; |
2575 | - $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>'; |
|
2575 | + $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>'; |
|
2576 | 2576 | $out .= '</div>'; |
2577 | 2577 | } |
2578 | 2578 | } |
@@ -2589,11 +2589,11 @@ discard block |
||
2589 | 2589 | // Method with no ajax |
2590 | 2590 | if ($action != 'view') { |
2591 | 2591 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">'; |
2592 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
2592 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
2593 | 2593 | $out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });'; |
2594 | 2594 | $out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());'; |
2595 | - $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }'; |
|
2596 | - $out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }'; |
|
2595 | + $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }'; |
|
2596 | + $out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }'; |
|
2597 | 2597 | $out .= '});'; |
2598 | 2598 | $out .= '})</script>'; |
2599 | 2599 | |
@@ -2601,7 +2601,7 @@ discard block |
||
2601 | 2601 | $out .= img_picto('', 'resource', 'class="pictofixedwidth"'); |
2602 | 2602 | $out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0); |
2603 | 2603 | //$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
2604 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
2604 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
2605 | 2605 | $out .= '<br>'; |
2606 | 2606 | } |
2607 | 2607 | |
@@ -2665,7 +2665,7 @@ discard block |
||
2665 | 2665 | $placeholder = ''; |
2666 | 2666 | |
2667 | 2667 | if ($selected && empty($selected_input_value)) { |
2668 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
2668 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
2669 | 2669 | $producttmpselect = new Product($this->db); |
2670 | 2670 | $producttmpselect->fetch($selected); |
2671 | 2671 | $selected_input_value = $producttmpselect->ref; |
@@ -2680,20 +2680,20 @@ discard block |
||
2680 | 2680 | } |
2681 | 2681 | } |
2682 | 2682 | // mode=1 means customers products |
2683 | - $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; |
|
2683 | + $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; |
|
2684 | 2684 | if ((int) $warehouseId > 0) { |
2685 | - $urloption .= '&warehouseid=' . (int) $warehouseId; |
|
2685 | + $urloption .= '&warehouseid='.(int) $warehouseId; |
|
2686 | 2686 | } |
2687 | - $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions); |
|
2687 | + $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions); |
|
2688 | 2688 | |
2689 | 2689 | if (isModEnabled('variants') && is_array($selected_combinations)) { |
2690 | 2690 | // Code to automatically insert with javascript the select of attributes under the select of product |
2691 | 2691 | // when a parent of variant has been selected. |
2692 | 2692 | $out .= ' |
2693 | 2693 | <!-- script to auto show attributes select tags if a variant was selected --> |
2694 | - <script nonce="' . getNonce() . '"> |
|
2694 | + <script nonce="' . getNonce().'"> |
|
2695 | 2695 | // auto show attributes fields |
2696 | - selected = ' . json_encode($selected_combinations) . '; |
|
2696 | + selected = ' . json_encode($selected_combinations).'; |
|
2697 | 2697 | combvalues = {}; |
2698 | 2698 | |
2699 | 2699 | jQuery(document).ready(function () { |
@@ -2704,7 +2704,7 @@ discard block |
||
2704 | 2704 | } |
2705 | 2705 | }); |
2706 | 2706 | |
2707 | - jQuery("input#' . $htmlname . '").change(function () { |
|
2707 | + jQuery("input#' . $htmlname.'").change(function () { |
|
2708 | 2708 | |
2709 | 2709 | if (!jQuery(this).val()) { |
2710 | 2710 | jQuery(\'div#attributes_box\').empty(); |
@@ -2713,7 +2713,7 @@ discard block |
||
2713 | 2713 | |
2714 | 2714 | console.log("A change has started. We get variants fields to inject html select"); |
2715 | 2715 | |
2716 | - jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", { |
|
2716 | + jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { |
|
2717 | 2717 | id: jQuery(this).val() |
2718 | 2718 | }, function (data) { |
2719 | 2719 | jQuery(\'div#attributes_box\').empty(); |
@@ -2756,21 +2756,21 @@ discard block |
||
2756 | 2756 | }) |
2757 | 2757 | }); |
2758 | 2758 | |
2759 | - ' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . ' |
|
2759 | + ' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').' |
|
2760 | 2760 | }); |
2761 | 2761 | </script> |
2762 | 2762 | '; |
2763 | 2763 | } |
2764 | 2764 | |
2765 | 2765 | if (empty($hidelabel)) { |
2766 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
2766 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
2767 | 2767 | } elseif ($hidelabel > 1) { |
2768 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
2768 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
2769 | 2769 | if ($hidelabel == 2) { |
2770 | 2770 | $out .= img_picto($langs->trans("Search"), 'search'); |
2771 | 2771 | } |
2772 | 2772 | } |
2773 | - $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
2773 | + $out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
2774 | 2774 | if ($hidelabel == 3) { |
2775 | 2775 | $out .= img_picto($langs->trans("Search"), 'search'); |
2776 | 2776 | } |
@@ -2807,33 +2807,33 @@ discard block |
||
2807 | 2807 | // phpcs:enable |
2808 | 2808 | global $db; |
2809 | 2809 | |
2810 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
2810 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
2811 | 2811 | |
2812 | 2812 | $error = 0; |
2813 | 2813 | $out = ''; |
2814 | 2814 | |
2815 | 2815 | if (!$forcecombo) { |
2816 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
2816 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
2817 | 2817 | $events = array(); |
2818 | 2818 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
2819 | 2819 | } |
2820 | 2820 | |
2821 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
2821 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
2822 | 2822 | |
2823 | 2823 | $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product'; |
2824 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b'; |
|
2825 | - $sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')'; |
|
2824 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; |
|
2825 | + $sql .= ' WHERE b.entity IN ('.getEntity('bom').')'; |
|
2826 | 2826 | if (!empty($status)) { |
2827 | - $sql .= ' AND status = ' . (int) $status; |
|
2827 | + $sql .= ' AND status = '.(int) $status; |
|
2828 | 2828 | } |
2829 | 2829 | if (!empty($type)) { |
2830 | - $sql .= ' AND bomtype = ' . (int) $type; |
|
2830 | + $sql .= ' AND bomtype = '.(int) $type; |
|
2831 | 2831 | } |
2832 | 2832 | if (!empty($TProducts)) { |
2833 | - $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')'; |
|
2833 | + $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; |
|
2834 | 2834 | } |
2835 | 2835 | if (!empty($limit)) { |
2836 | - $sql .= ' LIMIT ' . (int) $limit; |
|
2836 | + $sql .= ' LIMIT '.(int) $limit; |
|
2837 | 2837 | } |
2838 | 2838 | $resql = $db->query($sql); |
2839 | 2839 | if ($resql) { |
@@ -2847,11 +2847,11 @@ discard block |
||
2847 | 2847 | while ($obj = $db->fetch_object($resql)) { |
2848 | 2848 | $product = new Product($db); |
2849 | 2849 | $res = $product->fetch($obj->fk_product); |
2850 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
2850 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
2851 | 2851 | if ($obj->rowid == $selected) { |
2852 | 2852 | $out .= 'selected'; |
2853 | 2853 | } |
2854 | - $out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>'; |
|
2854 | + $out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>'; |
|
2855 | 2855 | } |
2856 | 2856 | } else { |
2857 | 2857 | $error++; |
@@ -2909,7 +2909,7 @@ discard block |
||
2909 | 2909 | |
2910 | 2910 | $warehouseStatusArray = array(); |
2911 | 2911 | if (!empty($warehouseStatus)) { |
2912 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
2912 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
2913 | 2913 | if (preg_match('/warehouseclosed/', $warehouseStatus)) { |
2914 | 2914 | $warehouseStatusArray[] = Entrepot::STATUS_CLOSED; |
2915 | 2915 | } |
@@ -2923,9 +2923,9 @@ discard block |
||
2923 | 2923 | |
2924 | 2924 | $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"; |
2925 | 2925 | if (count($warehouseStatusArray)) { |
2926 | - $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 |
|
2926 | + $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 |
|
2927 | 2927 | } else { |
2928 | - $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; |
|
2928 | + $selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; |
|
2929 | 2929 | } |
2930 | 2930 | |
2931 | 2931 | $sql = "SELECT "; |
@@ -2941,9 +2941,9 @@ discard block |
||
2941 | 2941 | |
2942 | 2942 | if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) { |
2943 | 2943 | //Product category |
2944 | - $sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie |
|
2945 | - FROM " . $this->db->prefix() . "categorie_product |
|
2946 | - WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid |
|
2944 | + $sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie |
|
2945 | + FROM " . $this->db->prefix()."categorie_product |
|
2946 | + WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid |
|
2947 | 2947 | LIMIT 1 |
2948 | 2948 | ) AS categorie_product_id "; |
2949 | 2949 | } |
@@ -2969,15 +2969,15 @@ discard block |
||
2969 | 2969 | } |
2970 | 2970 | // Price by quantity |
2971 | 2971 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
2972 | - $sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; |
|
2972 | + $sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; |
|
2973 | 2973 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
2974 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
2974 | + $sql .= " AND price_level = ".((int) $price_level); |
|
2975 | 2975 | } |
2976 | 2976 | $sql .= " ORDER BY date_price"; |
2977 | 2977 | $sql .= " DESC LIMIT 1) as price_rowid"; |
2978 | - $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 |
|
2978 | + $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 |
|
2979 | 2979 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
2980 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
2980 | + $sql .= " AND price_level = ".((int) $price_level); |
|
2981 | 2981 | } |
2982 | 2982 | $sql .= " ORDER BY date_price"; |
2983 | 2983 | $sql .= " DESC LIMIT 1) as price_by_qty"; |
@@ -2987,7 +2987,7 @@ discard block |
||
2987 | 2987 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
2988 | 2988 | |
2989 | 2989 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_FORCE_INDEX')) { |
2990 | - $sql .= " USE INDEX (" . $this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')) . ")"; |
|
2990 | + $sql .= " USE INDEX (".$this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')).")"; |
|
2991 | 2991 | } |
2992 | 2992 | |
2993 | 2993 | // Add from (left join) from hooks |
@@ -2996,53 +2996,53 @@ discard block |
||
2996 | 2996 | $sql .= $hookmanager->resPrint; |
2997 | 2997 | |
2998 | 2998 | if (count($warehouseStatusArray)) { |
2999 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid"; |
|
3000 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")"; |
|
3001 | - $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. |
|
2999 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid"; |
|
3000 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; |
|
3001 | + $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. |
|
3002 | 3002 | } |
3003 | 3003 | |
3004 | 3004 | // include search in supplier ref |
3005 | 3005 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
3006 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
3006 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
3007 | 3007 | } |
3008 | 3008 | |
3009 | 3009 | //Price by customer |
3010 | 3010 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) { |
3011 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid"; |
|
3011 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid"; |
|
3012 | 3012 | } |
3013 | 3013 | // Units |
3014 | 3014 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3015 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
3015 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
3016 | 3016 | } |
3017 | 3017 | // Multilang : we add translation |
3018 | 3018 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
3019 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid "; |
|
3019 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; |
|
3020 | 3020 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) { |
3021 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
3021 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
3022 | 3022 | $soc = new Societe($this->db); |
3023 | 3023 | $result = $soc->fetch($socid); |
3024 | 3024 | if ($result > 0 && !empty($soc->default_lang)) { |
3025 | - $sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'"; |
|
3025 | + $sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'"; |
|
3026 | 3026 | } else { |
3027 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
3027 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
3028 | 3028 | } |
3029 | 3029 | } else { |
3030 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
3030 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
3031 | 3031 | } |
3032 | 3032 | } |
3033 | 3033 | |
3034 | 3034 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
3035 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
3035 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
3036 | 3036 | } |
3037 | 3037 | |
3038 | - $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
3038 | + $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
|
3039 | 3039 | |
3040 | 3040 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
3041 | 3041 | $sql .= " AND pac.rowid IS NULL"; |
3042 | 3042 | } |
3043 | 3043 | |
3044 | 3044 | if ($finished == 0) { |
3045 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
3045 | + $sql .= " AND p.finished = ".((int) $finished); |
|
3046 | 3046 | } elseif ($finished == 1) { |
3047 | 3047 | $sql .= " AND p.finished = ".((int) $finished); |
3048 | 3048 | } |
@@ -3050,11 +3050,11 @@ discard block |
||
3050 | 3050 | $sql .= " AND p.tosell = ".((int) $status); |
3051 | 3051 | } |
3052 | 3052 | if ($status_purchase >= 0) { |
3053 | - $sql .= " AND p.tobuy = " . ((int) $status_purchase); |
|
3053 | + $sql .= " AND p.tobuy = ".((int) $status_purchase); |
|
3054 | 3054 | } |
3055 | 3055 | // Filter by product type |
3056 | 3056 | if (strval($filtertype) != '') { |
3057 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
3057 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
3058 | 3058 | } elseif (!isModEnabled('product')) { // when product module is disabled, show services only |
3059 | 3059 | $sql .= " AND p.fk_product_type = 1"; |
3060 | 3060 | } elseif (!isModEnabled('service')) { // when service module is disabled, show products only |
@@ -3062,7 +3062,7 @@ discard block |
||
3062 | 3062 | } |
3063 | 3063 | |
3064 | 3064 | if ((int) $warehouseId > 0) { |
3065 | - $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)"; |
|
3065 | + $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)"; |
|
3066 | 3066 | } |
3067 | 3067 | |
3068 | 3068 | // Add where from hooks |
@@ -3083,21 +3083,21 @@ discard block |
||
3083 | 3083 | if ($i > 0) { |
3084 | 3084 | $sql .= " AND "; |
3085 | 3085 | } |
3086 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3086 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3087 | 3087 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
3088 | - $sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3088 | + $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3089 | 3089 | } |
3090 | 3090 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) { |
3091 | - $sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3091 | + $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3092 | 3092 | } |
3093 | 3093 | if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) { |
3094 | - $sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3094 | + $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3095 | 3095 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
3096 | - $sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3096 | + $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3097 | 3097 | } |
3098 | 3098 | } |
3099 | 3099 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
3100 | - $sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3100 | + $sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3101 | 3101 | } |
3102 | 3102 | $sql .= ")"; |
3103 | 3103 | $i++; |
@@ -3106,12 +3106,12 @@ discard block |
||
3106 | 3106 | $sql .= ")"; |
3107 | 3107 | } |
3108 | 3108 | if (isModEnabled('barcode')) { |
3109 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
3109 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
3110 | 3110 | } |
3111 | 3111 | $sql .= ')'; |
3112 | 3112 | } |
3113 | 3113 | if (count($warehouseStatusArray)) { |
3114 | - $sql .= " GROUP BY " . $selectFields; |
|
3114 | + $sql .= " GROUP BY ".$selectFields; |
|
3115 | 3115 | } |
3116 | 3116 | |
3117 | 3117 | //Sort by category |
@@ -3126,23 +3126,23 @@ discard block |
||
3126 | 3126 | $sql .= $this->db->plimit($limit, 0); |
3127 | 3127 | |
3128 | 3128 | // Build output string |
3129 | - dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG); |
|
3129 | + dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG); |
|
3130 | 3130 | $result = $this->db->query($sql); |
3131 | 3131 | if ($result) { |
3132 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
3133 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3134 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
3132 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
3133 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3134 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
3135 | 3135 | |
3136 | 3136 | $num = $this->db->num_rows($result); |
3137 | 3137 | |
3138 | 3138 | $events = array(); |
3139 | 3139 | |
3140 | 3140 | if (!$forcecombo) { |
3141 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
3141 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
3142 | 3142 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
3143 | 3143 | } |
3144 | 3144 | |
3145 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
3145 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
3146 | 3146 | |
3147 | 3147 | $textifempty = ''; |
3148 | 3148 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -3159,7 +3159,7 @@ discard block |
||
3159 | 3159 | } |
3160 | 3160 | } |
3161 | 3161 | if ($showempty) { |
3162 | - $out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : ' ') . '</option>'; |
|
3162 | + $out .= '<option value="-1" selected>'.($textifempty ? $textifempty : ' ').'</option>'; |
|
3163 | 3163 | } |
3164 | 3164 | |
3165 | 3165 | $i = 0; |
@@ -3170,11 +3170,11 @@ discard block |
||
3170 | 3170 | |
3171 | 3171 | 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 |
3172 | 3172 | $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; |
3173 | - $sql .= " FROM " . $this->db->prefix() . "product_price_by_qty"; |
|
3174 | - $sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid); |
|
3173 | + $sql .= " FROM ".$this->db->prefix()."product_price_by_qty"; |
|
3174 | + $sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid); |
|
3175 | 3175 | $sql .= " ORDER BY quantity ASC"; |
3176 | 3176 | |
3177 | - dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG); |
|
3177 | + dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG); |
|
3178 | 3178 | $result2 = $this->db->query($sql); |
3179 | 3179 | if ($result2) { |
3180 | 3180 | $nb_prices = $this->db->num_rows($result2); |
@@ -3212,7 +3212,7 @@ discard block |
||
3212 | 3212 | $price_product = new Product($this->db); |
3213 | 3213 | $price_product->fetch($objp->rowid, '', '', 1); |
3214 | 3214 | |
3215 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3215 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3216 | 3216 | $priceparser = new PriceParser($this->db); |
3217 | 3217 | $price_result = $priceparser->parseProduct($price_product); |
3218 | 3218 | if ($price_result >= 0) { |
@@ -3296,7 +3296,7 @@ discard block |
||
3296 | 3296 | $label = $objp->label_translated; |
3297 | 3297 | } |
3298 | 3298 | if (!empty($filterkey) && $filterkey != '') { |
3299 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
3299 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
3300 | 3300 | } |
3301 | 3301 | |
3302 | 3302 | $outkey = $objp->rowid; |
@@ -3317,32 +3317,32 @@ discard block |
||
3317 | 3317 | $outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : ''; |
3318 | 3318 | |
3319 | 3319 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
3320 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
3320 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
3321 | 3321 | } |
3322 | 3322 | |
3323 | 3323 | // Units |
3324 | 3324 | $outvalUnits = ''; |
3325 | 3325 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3326 | 3326 | if (!empty($objp->unit_short)) { |
3327 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
3327 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
3328 | 3328 | } |
3329 | 3329 | } |
3330 | 3330 | if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) { |
3331 | 3331 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
3332 | 3332 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
3333 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3333 | + $outvalUnits .= ' - '.$unitToShow; |
|
3334 | 3334 | } |
3335 | 3335 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
3336 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
3337 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3336 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
3337 | + $outvalUnits .= ' - '.$unitToShow; |
|
3338 | 3338 | } |
3339 | 3339 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
3340 | 3340 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
3341 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3341 | + $outvalUnits .= ' - '.$unitToShow; |
|
3342 | 3342 | } |
3343 | 3343 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
3344 | 3344 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
3345 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3345 | + $outvalUnits .= ' - '.$unitToShow; |
|
3346 | 3346 | } |
3347 | 3347 | } |
3348 | 3348 | if ($outdurationvalue && $outdurationunit) { |
@@ -3354,7 +3354,7 @@ discard block |
||
3354 | 3354 | 'y' => $langs->trans('Year') |
3355 | 3355 | ); |
3356 | 3356 | if (isset($da[$outdurationunit])) { |
3357 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
3357 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
3358 | 3358 | } |
3359 | 3359 | } |
3360 | 3360 | |
@@ -3374,31 +3374,31 @@ discard block |
||
3374 | 3374 | $labeltoshow = ''; |
3375 | 3375 | $labeltoshow .= $objp->ref; |
3376 | 3376 | if (!empty($objp->custref)) { |
3377 | - $labeltoshow .= ' (' . $objp->custref . ')'; |
|
3377 | + $labeltoshow .= ' ('.$objp->custref.')'; |
|
3378 | 3378 | } |
3379 | 3379 | if ($outbarcode) { |
3380 | - $labeltoshow .= ' (' . $outbarcode . ')'; |
|
3380 | + $labeltoshow .= ' ('.$outbarcode.')'; |
|
3381 | 3381 | } |
3382 | - $labeltoshow .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3382 | + $labeltoshow .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3383 | 3383 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
3384 | - $labeltoshow .= ' (' . getCountry($outorigin, '1') . ')'; |
|
3384 | + $labeltoshow .= ' ('.getCountry($outorigin, '1').')'; |
|
3385 | 3385 | } |
3386 | 3386 | |
3387 | 3387 | // Set $labltoshowhtml |
3388 | 3388 | $labeltoshowhtml = ''; |
3389 | 3389 | $labeltoshowhtml .= $objp->ref; |
3390 | 3390 | if (!empty($objp->custref)) { |
3391 | - $labeltoshowhtml .= ' (' . $objp->custref . ')'; |
|
3391 | + $labeltoshowhtml .= ' ('.$objp->custref.')'; |
|
3392 | 3392 | } |
3393 | 3393 | if (!empty($filterkey) && $filterkey != '') { |
3394 | - $labeltoshowhtml = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $labeltoshowhtml, 1); |
|
3394 | + $labeltoshowhtml = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $labeltoshowhtml, 1); |
|
3395 | 3395 | } |
3396 | 3396 | if ($outbarcode) { |
3397 | - $labeltoshowhtml .= ' (' . $outbarcode . ')'; |
|
3397 | + $labeltoshowhtml .= ' ('.$outbarcode.')'; |
|
3398 | 3398 | } |
3399 | - $labeltoshowhtml .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3399 | + $labeltoshowhtml .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3400 | 3400 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
3401 | - $labeltoshowhtml .= ' (' . getCountry($outorigin, '1') . ')'; |
|
3401 | + $labeltoshowhtml .= ' ('.getCountry($outorigin, '1').')'; |
|
3402 | 3402 | } |
3403 | 3403 | |
3404 | 3404 | // Stock |
@@ -3406,14 +3406,14 @@ discard block |
||
3406 | 3406 | $labeltoshowhtmlstock = ''; |
3407 | 3407 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
3408 | 3408 | if ($user->hasRight('stock', 'lire')) { |
3409 | - $labeltoshowstock .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
3409 | + $labeltoshowstock .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
3410 | 3410 | |
3411 | 3411 | if ($objp->stock > 0) { |
3412 | 3412 | $labeltoshowhtmlstock .= ' - <span class="product_line_stock_ok">'; |
3413 | 3413 | } elseif ($objp->stock <= 0) { |
3414 | 3414 | $labeltoshowhtmlstock .= ' - <span class="product_line_stock_too_low">'; |
3415 | 3415 | } |
3416 | - $labeltoshowhtmlstock .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
3416 | + $labeltoshowhtmlstock .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
3417 | 3417 | $labeltoshowhtmlstock .= '</span>'; |
3418 | 3418 | |
3419 | 3419 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
@@ -3424,9 +3424,9 @@ discard block |
||
3424 | 3424 | $tmpproduct->load_virtual_stock(); |
3425 | 3425 | $virtualstock = $tmpproduct->stock_theorique; |
3426 | 3426 | |
3427 | - $labeltoshowstock .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
3427 | + $labeltoshowstock .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
3428 | 3428 | |
3429 | - $labeltoshowhtmlstock .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
3429 | + $labeltoshowhtmlstock .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
3430 | 3430 | if ($virtualstock > 0) { |
3431 | 3431 | $labeltoshowhtmlstock .= '<span class="product_line_stock_ok">'; |
3432 | 3432 | } elseif ($virtualstock <= 0) { |
@@ -3447,35 +3447,35 @@ discard block |
||
3447 | 3447 | // If we need a particular price level (from 1 to n) |
3448 | 3448 | if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) { |
3449 | 3449 | $sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code"; |
3450 | - $sql .= " FROM " . $this->db->prefix() . "product_price"; |
|
3451 | - $sql .= " WHERE fk_product = " . ((int) $objp->rowid); |
|
3452 | - $sql .= " AND entity IN (" . getEntity('productprice') . ")"; |
|
3453 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
3450 | + $sql .= " FROM ".$this->db->prefix()."product_price"; |
|
3451 | + $sql .= " WHERE fk_product = ".((int) $objp->rowid); |
|
3452 | + $sql .= " AND entity IN (".getEntity('productprice').")"; |
|
3453 | + $sql .= " AND price_level = ".((int) $price_level); |
|
3454 | 3454 | $sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid. |
3455 | 3455 | $sql .= " LIMIT 1"; |
3456 | 3456 | |
3457 | - dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG); |
|
3457 | + dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG); |
|
3458 | 3458 | $result2 = $this->db->query($sql); |
3459 | 3459 | if ($result2) { |
3460 | 3460 | $objp2 = $this->db->fetch_object($result2); |
3461 | 3461 | if ($objp2) { |
3462 | 3462 | $found = 1; |
3463 | 3463 | if ($objp2->price_base_type == 'HT') { |
3464 | - $labeltoshowprice .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
3465 | - $labeltoshowhtmlprice .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3464 | + $labeltoshowprice .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3465 | + $labeltoshowhtmlprice .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
3466 | 3466 | } else { |
3467 | - $labeltoshowprice .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
3468 | - $labeltoshowhtmlprice .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3467 | + $labeltoshowprice .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3468 | + $labeltoshowhtmlprice .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
3469 | 3469 | } |
3470 | 3470 | $outprice_ht = price($objp2->price); |
3471 | 3471 | $outprice_ttc = price($objp2->price_ttc); |
3472 | 3472 | $outpricebasetype = $objp2->price_base_type; |
3473 | 3473 | if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility |
3474 | - $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
3475 | - $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
3474 | + $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
3475 | + $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
3476 | 3476 | } else { |
3477 | - $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
3478 | - $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
3477 | + $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
3478 | + $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
3479 | 3479 | } |
3480 | 3480 | } |
3481 | 3481 | } else { |
@@ -3489,13 +3489,13 @@ discard block |
||
3489 | 3489 | $outqty = $objp->quantity; |
3490 | 3490 | $outdiscount = $objp->remise_percent; |
3491 | 3491 | if ($objp->quantity == 1) { |
3492 | - $labeltoshowprice .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3493 | - $labeltoshowhtmlprice .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3492 | + $labeltoshowprice .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3493 | + $labeltoshowhtmlprice .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3494 | 3494 | $labeltoshowprice .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
3495 | 3495 | $labeltoshowhtmlprice .= $langs->transnoentities("Unit"); |
3496 | 3496 | } else { |
3497 | - $labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3498 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3497 | + $labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3498 | + $labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3499 | 3499 | $labeltoshowprice .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
3500 | 3500 | $labeltoshowhtmlprice .= $langs->transnoentities("Units"); |
3501 | 3501 | } |
@@ -3503,16 +3503,16 @@ discard block |
||
3503 | 3503 | $outprice_ht = price($objp->unitprice); |
3504 | 3504 | $outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100))); |
3505 | 3505 | $outpricebasetype = $objp->price_base_type; |
3506 | - $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 |
|
3507 | - $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 |
|
3506 | + $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 |
|
3507 | + $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 |
|
3508 | 3508 | } |
3509 | 3509 | if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) { |
3510 | - $labeltoshowprice .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3511 | - $labeltoshowhtmlprice .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3510 | + $labeltoshowprice .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3511 | + $labeltoshowhtmlprice .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3512 | 3512 | } |
3513 | 3513 | if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) { |
3514 | - $labeltoshowprice .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3515 | - $labeltoshowhtmlprice .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3514 | + $labeltoshowprice .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3515 | + $labeltoshowhtmlprice .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3516 | 3516 | } |
3517 | 3517 | |
3518 | 3518 | // Price by customer |
@@ -3521,11 +3521,11 @@ discard block |
||
3521 | 3521 | $found = 1; |
3522 | 3522 | |
3523 | 3523 | if ($objp->custprice_base_type == 'HT') { |
3524 | - $labeltoshowprice .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
3525 | - $labeltoshowhtmlprice .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3524 | + $labeltoshowprice .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3525 | + $labeltoshowhtmlprice .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
3526 | 3526 | } else { |
3527 | - $labeltoshowprice .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
3528 | - $labeltoshowhtmlprice .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3527 | + $labeltoshowprice .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3528 | + $labeltoshowhtmlprice .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
3529 | 3529 | } |
3530 | 3530 | |
3531 | 3531 | $outprice_ht = price($objp->custprice); |
@@ -3539,11 +3539,11 @@ discard block |
||
3539 | 3539 | // If level no defined or multiprice not found, we used the default price |
3540 | 3540 | if (empty($hidepriceinlabel) && !$found) { |
3541 | 3541 | if ($objp->price_base_type == 'HT') { |
3542 | - $labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
3543 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3542 | + $labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3543 | + $labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
3544 | 3544 | } else { |
3545 | - $labeltoshowprice .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
3546 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3545 | + $labeltoshowprice .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3546 | + $labeltoshowhtmlprice .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
3547 | 3547 | } |
3548 | 3548 | $outprice_ht = price($objp->price); |
3549 | 3549 | $outprice_ttc = price($objp->price_ttc); |
@@ -3554,14 +3554,14 @@ discard block |
||
3554 | 3554 | |
3555 | 3555 | |
3556 | 3556 | // Build options |
3557 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
3557 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
3558 | 3558 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
3559 | 3559 | if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { |
3560 | - $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 . '"'; |
|
3560 | + $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.'"'; |
|
3561 | 3561 | } |
3562 | 3562 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) { |
3563 | - $opt .= ' data-labeltrans="' . $outlabel_translated . '"'; |
|
3564 | - $opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"'; |
|
3563 | + $opt .= ' data-labeltrans="'.$outlabel_translated.'"'; |
|
3564 | + $opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"'; |
|
3565 | 3565 | } |
3566 | 3566 | |
3567 | 3567 | if ($stocktag == 1) { |
@@ -3656,7 +3656,7 @@ discard block |
||
3656 | 3656 | $selected_input_value = ''; |
3657 | 3657 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) { |
3658 | 3658 | if ($selected > 0) { |
3659 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
3659 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
3660 | 3660 | $producttmpselect = new Product($this->db); |
3661 | 3661 | $producttmpselect->fetch($selected); |
3662 | 3662 | $selected_input_value = $producttmpselect->ref; |
@@ -3664,10 +3664,10 @@ discard block |
||
3664 | 3664 | } |
3665 | 3665 | |
3666 | 3666 | // mode=2 means suppliers products |
3667 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice; |
|
3668 | - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions); |
|
3667 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; |
|
3668 | + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions); |
|
3669 | 3669 | |
3670 | - print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="'.$morecss.'" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>'; |
|
3670 | + print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>'; |
|
3671 | 3671 | } else { |
3672 | 3672 | print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); |
3673 | 3673 | } |
@@ -3725,25 +3725,25 @@ discard block |
||
3725 | 3725 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3726 | 3726 | $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"; |
3727 | 3727 | } |
3728 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
3729 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )"; |
|
3728 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
3729 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; |
|
3730 | 3730 | if ($socid > 0) { |
3731 | - $sql .= " AND pfp.fk_soc = " . ((int) $socid); |
|
3731 | + $sql .= " AND pfp.fk_soc = ".((int) $socid); |
|
3732 | 3732 | } |
3733 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
3733 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
3734 | 3734 | // Units |
3735 | 3735 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3736 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
3736 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
3737 | 3737 | } |
3738 | - $sql .= " WHERE p.entity IN (" . getEntity('product') . ")"; |
|
3738 | + $sql .= " WHERE p.entity IN (".getEntity('product').")"; |
|
3739 | 3739 | if ($statut != -1) { |
3740 | - $sql .= " AND p.tobuy = " . ((int) $statut); |
|
3740 | + $sql .= " AND p.tobuy = ".((int) $statut); |
|
3741 | 3741 | } |
3742 | 3742 | if (strval($filtertype) != '') { |
3743 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
3743 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
3744 | 3744 | } |
3745 | 3745 | if (!empty($filtre)) { |
3746 | - $sql .= " " . $filtre; |
|
3746 | + $sql .= " ".$filtre; |
|
3747 | 3747 | } |
3748 | 3748 | // Add where from hooks |
3749 | 3749 | $parameters = array(); |
@@ -3763,9 +3763,9 @@ discard block |
||
3763 | 3763 | if ($i > 0) { |
3764 | 3764 | $sql .= " AND "; |
3765 | 3765 | } |
3766 | - $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) . "%'"; |
|
3766 | + $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)."%'"; |
|
3767 | 3767 | if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) { |
3768 | - $sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3768 | + $sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3769 | 3769 | } |
3770 | 3770 | $sql .= ")"; |
3771 | 3771 | $i++; |
@@ -3774,8 +3774,8 @@ discard block |
||
3774 | 3774 | $sql .= ")"; |
3775 | 3775 | } |
3776 | 3776 | if (isModEnabled('barcode')) { |
3777 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
3778 | - $sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
3777 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
3778 | + $sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
3779 | 3779 | } |
3780 | 3780 | $sql .= ')'; |
3781 | 3781 | } |
@@ -3784,20 +3784,20 @@ discard block |
||
3784 | 3784 | |
3785 | 3785 | // Build output string |
3786 | 3786 | |
3787 | - dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG); |
|
3787 | + dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); |
|
3788 | 3788 | $result = $this->db->query($sql); |
3789 | 3789 | if ($result) { |
3790 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3791 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
3790 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3791 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
3792 | 3792 | |
3793 | 3793 | $num = $this->db->num_rows($result); |
3794 | 3794 | |
3795 | 3795 | //$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax |
3796 | - $out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
3796 | + $out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
3797 | 3797 | if (!$selected) { |
3798 | - $out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
3798 | + $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : ' ').'</option>'; |
|
3799 | 3799 | } else { |
3800 | - $out .= '<option value="-1">' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
3800 | + $out .= '<option value="-1">'.($placeholder ? $placeholder : ' ').'</option>'; |
|
3801 | 3801 | } |
3802 | 3802 | |
3803 | 3803 | $i = 0; |
@@ -3812,7 +3812,7 @@ discard block |
||
3812 | 3812 | |
3813 | 3813 | $outkey = $objp->idprodfournprice; // id in table of price |
3814 | 3814 | if (!$outkey && $alsoproductwithnosupplierprice) { |
3815 | - $outkey = 'idprod_' . $objp->rowid; // id of product |
|
3815 | + $outkey = 'idprod_'.$objp->rowid; // id of product |
|
3816 | 3816 | } |
3817 | 3817 | |
3818 | 3818 | $outref = $objp->ref; |
@@ -3827,23 +3827,23 @@ discard block |
||
3827 | 3827 | $outvalUnits = ''; |
3828 | 3828 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3829 | 3829 | if (!empty($objp->unit_short)) { |
3830 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
3830 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
3831 | 3831 | } |
3832 | 3832 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
3833 | 3833 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
3834 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3834 | + $outvalUnits .= ' - '.$unitToShow; |
|
3835 | 3835 | } |
3836 | 3836 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
3837 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
3838 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3837 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
3838 | + $outvalUnits .= ' - '.$unitToShow; |
|
3839 | 3839 | } |
3840 | 3840 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
3841 | 3841 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
3842 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3842 | + $outvalUnits .= ' - '.$unitToShow; |
|
3843 | 3843 | } |
3844 | 3844 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
3845 | 3845 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
3846 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3846 | + $outvalUnits .= ' - '.$unitToShow; |
|
3847 | 3847 | } |
3848 | 3848 | if ($outdurationvalue && $outdurationunit) { |
3849 | 3849 | $da = array( |
@@ -3854,22 +3854,22 @@ discard block |
||
3854 | 3854 | 'y' => $langs->trans('Year') |
3855 | 3855 | ); |
3856 | 3856 | if (isset($da[$outdurationunit])) { |
3857 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
3857 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
3858 | 3858 | } |
3859 | 3859 | } |
3860 | 3860 | } |
3861 | 3861 | |
3862 | 3862 | $objRef = $objp->ref; |
3863 | 3863 | if ($filterkey && $filterkey != '') { |
3864 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
3864 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
3865 | 3865 | } |
3866 | 3866 | $objRefFourn = $objp->ref_fourn; |
3867 | 3867 | if ($filterkey && $filterkey != '') { |
3868 | - $objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
3868 | + $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
3869 | 3869 | } |
3870 | 3870 | $label = $objp->label; |
3871 | 3871 | if ($filterkey && $filterkey != '') { |
3872 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
3872 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
3873 | 3873 | } |
3874 | 3874 | |
3875 | 3875 | switch ($objp->fk_product_type) { |
@@ -3892,21 +3892,21 @@ discard block |
||
3892 | 3892 | |
3893 | 3893 | $optlabel .= $objp->ref; |
3894 | 3894 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
3895 | - $optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>'; |
|
3895 | + $optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>'; |
|
3896 | 3896 | } |
3897 | 3897 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
3898 | - $optlabel .= ' (' . $outbarcode . ')'; |
|
3898 | + $optlabel .= ' ('.$outbarcode.')'; |
|
3899 | 3899 | } |
3900 | - $optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3900 | + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3901 | 3901 | |
3902 | 3902 | $outvallabel = $objRef; |
3903 | 3903 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
3904 | - $outvallabel .= ' (' . $objRefFourn . ')'; |
|
3904 | + $outvallabel .= ' ('.$objRefFourn.')'; |
|
3905 | 3905 | } |
3906 | 3906 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
3907 | - $outvallabel .= ' (' . $outbarcode . ')'; |
|
3907 | + $outvallabel .= ' ('.$outbarcode.')'; |
|
3908 | 3908 | } |
3909 | - $outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3909 | + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3910 | 3910 | |
3911 | 3911 | // Units |
3912 | 3912 | $optlabel .= $outvalUnits; |
@@ -3923,7 +3923,7 @@ discard block |
||
3923 | 3923 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
3924 | 3924 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
3925 | 3925 | |
3926 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3926 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3927 | 3927 | $priceparser = new PriceParser($this->db); |
3928 | 3928 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
3929 | 3929 | if ($price_result >= 0) { |
@@ -3934,57 +3934,57 @@ discard block |
||
3934 | 3934 | } |
3935 | 3935 | } |
3936 | 3936 | if ($objp->quantity == 1) { |
3937 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3938 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3937 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3938 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3939 | 3939 | $optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
3940 | 3940 | $outvallabel .= $langs->transnoentities("Unit"); |
3941 | 3941 | } else { |
3942 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3943 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3944 | - $optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
3945 | - $outvallabel .= ' ' . $langs->transnoentities("Units"); |
|
3942 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3943 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3944 | + $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
3945 | + $outvallabel .= ' '.$langs->transnoentities("Units"); |
|
3946 | 3946 | } |
3947 | 3947 | |
3948 | 3948 | if ($objp->quantity > 1) { |
3949 | - $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 |
|
3950 | - $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 |
|
3949 | + $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 |
|
3950 | + $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 |
|
3951 | 3951 | } |
3952 | 3952 | if ($objp->remise_percent >= 1) { |
3953 | - $optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3954 | - $outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3953 | + $optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3954 | + $outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3955 | 3955 | } |
3956 | 3956 | if ($objp->duration) { |
3957 | - $optlabel .= " - " . $objp->duration; |
|
3958 | - $outvallabel .= " - " . $objp->duration; |
|
3957 | + $optlabel .= " - ".$objp->duration; |
|
3958 | + $outvallabel .= " - ".$objp->duration; |
|
3959 | 3959 | } |
3960 | 3960 | if (!$socid) { |
3961 | - $optlabel .= " - " . dol_trunc($objp->name, 8); |
|
3962 | - $outvallabel .= " - " . dol_trunc($objp->name, 8); |
|
3961 | + $optlabel .= " - ".dol_trunc($objp->name, 8); |
|
3962 | + $outvallabel .= " - ".dol_trunc($objp->name, 8); |
|
3963 | 3963 | } |
3964 | 3964 | if ($objp->supplier_reputation) { |
3965 | 3965 | //TODO dictionary |
3966 | 3966 | $reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
3967 | 3967 | |
3968 | - $optlabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
3969 | - $outvallabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
3968 | + $optlabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
3969 | + $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
3970 | 3970 | } |
3971 | 3971 | } else { |
3972 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
3973 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
3972 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
3973 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
3974 | 3974 | } |
3975 | 3975 | |
3976 | 3976 | if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
3977 | 3977 | $novirtualstock = ($showstockinlist == 2); |
3978 | 3978 | |
3979 | 3979 | if ($user->hasRight('stock', 'lire')) { |
3980 | - $outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
3980 | + $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
3981 | 3981 | |
3982 | 3982 | if ($objp->stock > 0) { |
3983 | 3983 | $optlabel .= ' - <span class="product_line_stock_ok">'; |
3984 | 3984 | } elseif ($objp->stock <= 0) { |
3985 | 3985 | $optlabel .= ' - <span class="product_line_stock_too_low">'; |
3986 | 3986 | } |
3987 | - $optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS')); |
|
3987 | + $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); |
|
3988 | 3988 | $optlabel .= '</span>'; |
3989 | 3989 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
3990 | 3990 | $langs->load("stocks"); |
@@ -3994,9 +3994,9 @@ discard block |
||
3994 | 3994 | $tmpproduct->load_virtual_stock(); |
3995 | 3995 | $virtualstock = $tmpproduct->stock_theorique; |
3996 | 3996 | |
3997 | - $outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
3997 | + $outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
3998 | 3998 | |
3999 | - $optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
3999 | + $optlabel .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
4000 | 4000 | if ($virtualstock > 0) { |
4001 | 4001 | $optlabel .= '<span class="product_line_stock_ok">'; |
4002 | 4002 | } elseif ($virtualstock <= 0) { |
@@ -4010,7 +4010,7 @@ discard block |
||
4010 | 4010 | } |
4011 | 4011 | } |
4012 | 4012 | |
4013 | - $optstart = '<option value="' . $outkey . '"'; |
|
4013 | + $optstart = '<option value="'.$outkey.'"'; |
|
4014 | 4014 | if ($selected && $selected == $objp->idprodfournprice) { |
4015 | 4015 | $optstart .= ' selected'; |
4016 | 4016 | } |
@@ -4019,31 +4019,31 @@ discard block |
||
4019 | 4019 | } |
4020 | 4020 | |
4021 | 4021 | if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { |
4022 | - $optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"'; |
|
4023 | - $optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"'; |
|
4024 | - $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; |
|
4025 | - $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; |
|
4026 | - $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; |
|
4027 | - $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; |
|
4028 | - $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; |
|
4029 | - $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; |
|
4030 | - $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; |
|
4031 | - $optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"'; |
|
4022 | + $optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; |
|
4023 | + $optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; |
|
4024 | + $optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; |
|
4025 | + $optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; |
|
4026 | + $optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; |
|
4027 | + $optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; |
|
4028 | + $optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; |
|
4029 | + $optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; |
|
4030 | + $optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"'; |
|
4031 | + $optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"'; |
|
4032 | 4032 | if (isModEnabled('multicurrency')) { |
4033 | - $optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"'; |
|
4034 | - $optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"'; |
|
4033 | + $optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"'; |
|
4034 | + $optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"'; |
|
4035 | 4035 | } |
4036 | 4036 | } |
4037 | - $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; |
|
4037 | + $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; |
|
4038 | 4038 | |
4039 | 4039 | $outarrayentry = array( |
4040 | 4040 | 'key' => $outkey, |
4041 | 4041 | 'value' => $outref, |
4042 | 4042 | 'label' => $outvallabel, |
4043 | 4043 | 'qty' => $outqty, |
4044 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
4045 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
4046 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
4044 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
4045 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
4046 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
4047 | 4047 | 'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2), |
4048 | 4048 | 'tva_tx' => price2num($objp->tva_tx), |
4049 | 4049 | 'default_vat_code' => $objp->default_vat_code, |
@@ -4074,17 +4074,17 @@ discard block |
||
4074 | 4074 | // Add new entry |
4075 | 4075 | // "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 |
4076 | 4076 | // "label" value of json key array is used by jQuery automatically as text for combo box |
4077 | - $out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n"; |
|
4077 | + $out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n"; |
|
4078 | 4078 | $outarraypush = array( |
4079 | 4079 | 'key' => $outkey, |
4080 | 4080 | 'value' => $outref, |
4081 | 4081 | 'label' => $outvallabel, |
4082 | 4082 | 'qty' => $outqty, |
4083 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
4083 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
4084 | 4084 | 'price_qty_ht_locale' => price($objp->fprice), |
4085 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
4085 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
4086 | 4086 | 'price_unit_ht_locale' => price($objp->unitprice), |
4087 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
4087 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
4088 | 4088 | 'tva_tx_formated' => price($objp->tva_tx), |
4089 | 4089 | 'tva_tx' => price2num($objp->tva_tx), |
4090 | 4090 | 'default_vat_code' => $objp->default_vat_code, |
@@ -4117,7 +4117,7 @@ discard block |
||
4117 | 4117 | |
4118 | 4118 | $this->db->free($result); |
4119 | 4119 | |
4120 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
4120 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
4121 | 4121 | $out .= ajax_combobox($htmlname); |
4122 | 4122 | } else { |
4123 | 4123 | dol_print_error($this->db); |
@@ -4149,43 +4149,43 @@ discard block |
||
4149 | 4149 | $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; |
4150 | 4150 | $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; |
4151 | 4151 | $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; |
4152 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
4153 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
4154 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
4155 | - $sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")"; |
|
4152 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
4153 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
4154 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
4155 | + $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; |
|
4156 | 4156 | $sql .= " AND p.tobuy = 1"; |
4157 | 4157 | $sql .= " AND s.fournisseur = 1"; |
4158 | - $sql .= " AND p.rowid = " . ((int) $productid); |
|
4158 | + $sql .= " AND p.rowid = ".((int) $productid); |
|
4159 | 4159 | if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) { |
4160 | 4160 | $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; |
4161 | 4161 | } else { |
4162 | 4162 | $sql .= " ORDER BY pfp.unitprice ASC"; |
4163 | 4163 | } |
4164 | 4164 | |
4165 | - dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG); |
|
4165 | + dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); |
|
4166 | 4166 | $result = $this->db->query($sql); |
4167 | 4167 | |
4168 | 4168 | if ($result) { |
4169 | 4169 | $num = $this->db->num_rows($result); |
4170 | 4170 | |
4171 | - $form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
4171 | + $form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
4172 | 4172 | |
4173 | 4173 | if (!$num) { |
4174 | - $form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>'; |
|
4174 | + $form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>'; |
|
4175 | 4175 | } else { |
4176 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
4176 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
4177 | 4177 | $form .= '<option value="0"> </option>'; |
4178 | 4178 | |
4179 | 4179 | $i = 0; |
4180 | 4180 | while ($i < $num) { |
4181 | 4181 | $objp = $this->db->fetch_object($result); |
4182 | 4182 | |
4183 | - $opt = '<option value="' . $objp->idprodfournprice . '"'; |
|
4183 | + $opt = '<option value="'.$objp->idprodfournprice.'"'; |
|
4184 | 4184 | //if there is only one supplier, preselect it |
4185 | 4185 | if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) { |
4186 | 4186 | $opt .= ' selected'; |
4187 | 4187 | } |
4188 | - $opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - '; |
|
4188 | + $opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - '; |
|
4189 | 4189 | |
4190 | 4190 | if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) { |
4191 | 4191 | $prod_supplier = new ProductFournisseur($this->db); |
@@ -4195,7 +4195,7 @@ discard block |
||
4195 | 4195 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
4196 | 4196 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
4197 | 4197 | |
4198 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
4198 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
4199 | 4199 | $priceparser = new PriceParser($this->db); |
4200 | 4200 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
4201 | 4201 | if ($price_result >= 0) { |
@@ -4206,10 +4206,10 @@ discard block |
||
4206 | 4206 | } |
4207 | 4207 | } |
4208 | 4208 | if ($objp->quantity == 1) { |
4209 | - $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
4209 | + $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
4210 | 4210 | } |
4211 | 4211 | |
4212 | - $opt .= $objp->quantity . ' '; |
|
4212 | + $opt .= $objp->quantity.' '; |
|
4213 | 4213 | |
4214 | 4214 | if ($objp->quantity == 1) { |
4215 | 4215 | $opt .= $langs->trans("Unit"); |
@@ -4218,10 +4218,10 @@ discard block |
||
4218 | 4218 | } |
4219 | 4219 | if ($objp->quantity > 1) { |
4220 | 4220 | $opt .= " - "; |
4221 | - $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"); |
|
4221 | + $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"); |
|
4222 | 4222 | } |
4223 | 4223 | if ($objp->duration) { |
4224 | - $opt .= " - " . $objp->duration; |
|
4224 | + $opt .= " - ".$objp->duration; |
|
4225 | 4225 | } |
4226 | 4226 | $opt .= "</option>\n"; |
4227 | 4227 | |
@@ -4259,8 +4259,8 @@ discard block |
||
4259 | 4259 | dol_syslog(__METHOD__, LOG_DEBUG); |
4260 | 4260 | |
4261 | 4261 | $sql = "SELECT rowid, code, libelle as label, deposit_percent"; |
4262 | - $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; |
|
4263 | - $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; |
|
4262 | + $sql .= " FROM ".$this->db->prefix().'c_payment_term'; |
|
4263 | + $sql .= " WHERE entity IN (".getEntity('c_payment_term').")"; |
|
4264 | 4264 | $sql .= " AND active > 0"; |
4265 | 4265 | $sql .= " ORDER BY sortorder"; |
4266 | 4266 | |
@@ -4272,7 +4272,7 @@ discard block |
||
4272 | 4272 | $obj = $this->db->fetch_object($resql); |
4273 | 4273 | |
4274 | 4274 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
4275 | - $label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4275 | + $label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4276 | 4276 | $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; |
4277 | 4277 | $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; |
4278 | 4278 | $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; |
@@ -4300,7 +4300,7 @@ discard block |
||
4300 | 4300 | // phpcs:enable |
4301 | 4301 | global $langs; |
4302 | 4302 | |
4303 | - $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
4303 | + $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
4304 | 4304 | if ($num > 0) { |
4305 | 4305 | return 0; // Cache already loaded |
4306 | 4306 | } |
@@ -4310,7 +4310,7 @@ discard block |
||
4310 | 4310 | $langs->load('propal'); |
4311 | 4311 | |
4312 | 4312 | $sql = "SELECT rowid, code, label, position"; |
4313 | - $sql .= " FROM " . $this->db->prefix() . 'c_availability'; |
|
4313 | + $sql .= " FROM ".$this->db->prefix().'c_availability'; |
|
4314 | 4314 | $sql .= " WHERE active > 0"; |
4315 | 4315 | |
4316 | 4316 | $resql = $this->db->query($sql); |
@@ -4321,7 +4321,7 @@ discard block |
||
4321 | 4321 | $obj = $this->db->fetch_object($resql); |
4322 | 4322 | |
4323 | 4323 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
4324 | - $label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4324 | + $label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4325 | 4325 | $this->cache_availability[$obj->rowid]['code'] = $obj->code; |
4326 | 4326 | $this->cache_availability[$obj->rowid]['label'] = $label; |
4327 | 4327 | $this->cache_availability[$obj->rowid]['position'] = $obj->position; |
@@ -4353,17 +4353,17 @@ discard block |
||
4353 | 4353 | |
4354 | 4354 | $this->load_cache_availability(); |
4355 | 4355 | |
4356 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
4356 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
4357 | 4357 | |
4358 | - print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4358 | + print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4359 | 4359 | if ($addempty) { |
4360 | 4360 | print '<option value="0"> </option>'; |
4361 | 4361 | } |
4362 | 4362 | foreach ($this->cache_availability as $id => $arrayavailability) { |
4363 | 4363 | if ($selected == $id) { |
4364 | - print '<option value="' . $id . '" selected>'; |
|
4364 | + print '<option value="'.$id.'" selected>'; |
|
4365 | 4365 | } else { |
4366 | - print '<option value="' . $id . '">'; |
|
4366 | + print '<option value="'.$id.'">'; |
|
4367 | 4367 | } |
4368 | 4368 | print dol_escape_htmltag($arrayavailability['label']); |
4369 | 4369 | print '</option>'; |
@@ -4384,13 +4384,13 @@ discard block |
||
4384 | 4384 | { |
4385 | 4385 | global $langs; |
4386 | 4386 | |
4387 | - $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
4387 | + $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
4388 | 4388 | if ($num > 0) { |
4389 | 4389 | return 0; // Cache already loaded |
4390 | 4390 | } |
4391 | 4391 | |
4392 | 4392 | $sql = "SELECT rowid, code, label"; |
4393 | - $sql .= " FROM " . $this->db->prefix() . 'c_input_reason'; |
|
4393 | + $sql .= " FROM ".$this->db->prefix().'c_input_reason'; |
|
4394 | 4394 | $sql .= " WHERE active > 0"; |
4395 | 4395 | |
4396 | 4396 | $resql = $this->db->query($sql); |
@@ -4403,8 +4403,8 @@ discard block |
||
4403 | 4403 | |
4404 | 4404 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
4405 | 4405 | $label = ($obj->label != '-' ? $obj->label : ''); |
4406 | - if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) { |
|
4407 | - $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
4406 | + if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) { |
|
4407 | + $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
4408 | 4408 | } |
4409 | 4409 | if ($langs->trans($obj->code) != $obj->code) { |
4410 | 4410 | $label = $langs->trans($obj->code); // So translation key SRC_XXX will work |
@@ -4444,9 +4444,9 @@ discard block |
||
4444 | 4444 | |
4445 | 4445 | $this->loadCacheInputReason(); |
4446 | 4446 | |
4447 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
4447 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
4448 | 4448 | if ($addempty) { |
4449 | - print '<option value="0"' . (empty($selected) ? ' selected' : '') . '> </option>'; |
|
4449 | + print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>'; |
|
4450 | 4450 | } |
4451 | 4451 | foreach ($this->cache_demand_reason as $id => $arraydemandreason) { |
4452 | 4452 | if ($arraydemandreason['code'] == $exclude) { |
@@ -4454,9 +4454,9 @@ discard block |
||
4454 | 4454 | } |
4455 | 4455 | |
4456 | 4456 | if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { |
4457 | - print '<option value="' . $arraydemandreason['id'] . '" selected>'; |
|
4457 | + print '<option value="'.$arraydemandreason['id'].'" selected>'; |
|
4458 | 4458 | } else { |
4459 | - print '<option value="' . $arraydemandreason['id'] . '">'; |
|
4459 | + print '<option value="'.$arraydemandreason['id'].'">'; |
|
4460 | 4460 | } |
4461 | 4461 | $label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason |
4462 | 4462 | print $langs->trans($label); |
@@ -4466,7 +4466,7 @@ discard block |
||
4466 | 4466 | if ($user->admin && empty($notooltip)) { |
4467 | 4467 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4468 | 4468 | } |
4469 | - print ajax_combobox('select_' . $htmlname); |
|
4469 | + print ajax_combobox('select_'.$htmlname); |
|
4470 | 4470 | } |
4471 | 4471 | |
4472 | 4472 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
@@ -4481,7 +4481,7 @@ discard block |
||
4481 | 4481 | // phpcs:enable |
4482 | 4482 | global $langs; |
4483 | 4483 | |
4484 | - $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
4484 | + $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
4485 | 4485 | if ($num > 0) { |
4486 | 4486 | return $num; // Cache already loaded |
4487 | 4487 | } |
@@ -4491,8 +4491,8 @@ discard block |
||
4491 | 4491 | $this->cache_types_paiements = array(); |
4492 | 4492 | |
4493 | 4493 | $sql = "SELECT id, code, libelle as label, type, active"; |
4494 | - $sql .= " FROM " . $this->db->prefix() . "c_paiement"; |
|
4495 | - $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
4494 | + $sql .= " FROM ".$this->db->prefix()."c_paiement"; |
|
4495 | + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
|
4496 | 4496 | |
4497 | 4497 | $resql = $this->db->query($sql); |
4498 | 4498 | if ($resql) { |
@@ -4502,7 +4502,7 @@ discard block |
||
4502 | 4502 | $obj = $this->db->fetch_object($resql); |
4503 | 4503 | |
4504 | 4504 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
4505 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4505 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4506 | 4506 | $this->cache_types_paiements[$obj->id]['id'] = $obj->id; |
4507 | 4507 | $this->cache_types_paiements[$obj->id]['code'] = $obj->code; |
4508 | 4508 | $this->cache_types_paiements[$obj->id]['label'] = $label; |
@@ -4574,17 +4574,17 @@ discard block |
||
4574 | 4574 | global $langs, $user, $conf; |
4575 | 4575 | |
4576 | 4576 | $out = ''; |
4577 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
4577 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
4578 | 4578 | |
4579 | 4579 | $this->load_cache_conditions_paiements(); |
4580 | 4580 | |
4581 | 4581 | // Set default value if not already set by caller |
4582 | 4582 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) { |
4583 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
4583 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
4584 | 4584 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
4585 | 4585 | } |
4586 | 4586 | |
4587 | - $out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4587 | + $out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4588 | 4588 | if ($addempty) { |
4589 | 4589 | $out .= '<option value="0"> </option>'; |
4590 | 4590 | } |
@@ -4598,9 +4598,9 @@ discard block |
||
4598 | 4598 | |
4599 | 4599 | if ($selected == $id) { |
4600 | 4600 | $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; |
4601 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>'; |
|
4601 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>'; |
|
4602 | 4602 | } else { |
4603 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">'; |
|
4603 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">'; |
|
4604 | 4604 | } |
4605 | 4605 | $label = $arrayconditions['label']; |
4606 | 4606 | |
@@ -4618,21 +4618,21 @@ discard block |
||
4618 | 4618 | $out .= ajax_combobox($htmlname); |
4619 | 4619 | |
4620 | 4620 | if ($deposit_percent >= 0) { |
4621 | - $out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>'; |
|
4622 | - $out .= $langs->trans('DepositPercent') . ' : '; |
|
4623 | - $out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />'; |
|
4621 | + $out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>'; |
|
4622 | + $out .= $langs->trans('DepositPercent').' : '; |
|
4623 | + $out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />'; |
|
4624 | 4624 | $out .= '</span>'; |
4625 | 4625 | $out .= ' |
4626 | - <script nonce="' . getNonce() . '"> |
|
4626 | + <script nonce="' . getNonce().'"> |
|
4627 | 4627 | $(document).ready(function () { |
4628 | - $("#' . $htmlname . '").change(function () { |
|
4628 | + $("#' . $htmlname.'").change(function () { |
|
4629 | 4629 | let $selected = $(this).find("option:selected"); |
4630 | 4630 | let depositPercent = $selected.attr("data-deposit_percent"); |
4631 | 4631 | |
4632 | 4632 | if (depositPercent.length > 0) { |
4633 | - $("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent); |
|
4633 | + $("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent); |
|
4634 | 4634 | } else { |
4635 | - $("#' . $htmlname . '_deposit_percent_container").hide(); |
|
4635 | + $("#' . $htmlname.'_deposit_percent_container").hide(); |
|
4636 | 4636 | } |
4637 | 4637 | |
4638 | 4638 | return true; |
@@ -4670,7 +4670,7 @@ discard block |
||
4670 | 4670 | |
4671 | 4671 | $out = ''; |
4672 | 4672 | |
4673 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG); |
|
4673 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); |
|
4674 | 4674 | |
4675 | 4675 | $filterarray = array(); |
4676 | 4676 | if ($filtertype == 'CRDT') { |
@@ -4685,11 +4685,11 @@ discard block |
||
4685 | 4685 | |
4686 | 4686 | // Set default value if not already set by caller |
4687 | 4687 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) { |
4688 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
4688 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
4689 | 4689 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
4690 | 4690 | } |
4691 | 4691 | |
4692 | - $out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4692 | + $out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4693 | 4693 | if ($empty) { |
4694 | 4694 | $out .= '<option value=""> </option>'; |
4695 | 4695 | } |
@@ -4710,13 +4710,13 @@ discard block |
||
4710 | 4710 | } |
4711 | 4711 | |
4712 | 4712 | if ($format == 0) { |
4713 | - $out .= '<option value="' . $id . '"'; |
|
4713 | + $out .= '<option value="'.$id.'"'; |
|
4714 | 4714 | } elseif ($format == 1) { |
4715 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
4715 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
4716 | 4716 | } elseif ($format == 2) { |
4717 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
4717 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
4718 | 4718 | } elseif ($format == 3) { |
4719 | - $out .= '<option value="' . $id . '"'; |
|
4719 | + $out .= '<option value="'.$id.'"'; |
|
4720 | 4720 | } |
4721 | 4721 | // Print attribute selected or not |
4722 | 4722 | if ($format == 1 || $format == 2) { |
@@ -4746,7 +4746,7 @@ discard block |
||
4746 | 4746 | if ($user->admin && !$noadmininfo) { |
4747 | 4747 | $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4748 | 4748 | } |
4749 | - $out .= ajax_combobox('select' . $htmlname); |
|
4749 | + $out .= ajax_combobox('select'.$htmlname); |
|
4750 | 4750 | |
4751 | 4751 | if (empty($nooutput)) { |
4752 | 4752 | print $out; |
@@ -4768,22 +4768,22 @@ discard block |
||
4768 | 4768 | { |
4769 | 4769 | global $langs; |
4770 | 4770 | |
4771 | - $return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
4771 | + $return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
4772 | 4772 | $options = array( |
4773 | 4773 | 'HT' => $langs->trans("HT"), |
4774 | 4774 | 'TTC' => $langs->trans("TTC") |
4775 | 4775 | ); |
4776 | 4776 | foreach ($options as $id => $value) { |
4777 | 4777 | if ($selected == $id) { |
4778 | - $return .= '<option value="' . $id . '" selected>' . $value; |
|
4778 | + $return .= '<option value="'.$id.'" selected>'.$value; |
|
4779 | 4779 | } else { |
4780 | - $return .= '<option value="' . $id . '">' . $value; |
|
4780 | + $return .= '<option value="'.$id.'">'.$value; |
|
4781 | 4781 | } |
4782 | 4782 | $return .= '</option>'; |
4783 | 4783 | } |
4784 | 4784 | $return .= '</select>'; |
4785 | 4785 | if ($addjscombo) { |
4786 | - $return .= ajax_combobox('select_' . $htmlname); |
|
4786 | + $return .= ajax_combobox('select_'.$htmlname); |
|
4787 | 4787 | } |
4788 | 4788 | |
4789 | 4789 | return $return; |
@@ -4801,7 +4801,7 @@ discard block |
||
4801 | 4801 | // phpcs:enable |
4802 | 4802 | global $langs; |
4803 | 4803 | |
4804 | - $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
4804 | + $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
4805 | 4805 | if ($num > 0) { |
4806 | 4806 | return $num; // Cache already loaded |
4807 | 4807 | } |
@@ -4811,8 +4811,8 @@ discard block |
||
4811 | 4811 | $this->cache_transport_mode = array(); |
4812 | 4812 | |
4813 | 4813 | $sql = "SELECT rowid, code, label, active"; |
4814 | - $sql .= " FROM " . $this->db->prefix() . "c_transport_mode"; |
|
4815 | - $sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")"; |
|
4814 | + $sql .= " FROM ".$this->db->prefix()."c_transport_mode"; |
|
4815 | + $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; |
|
4816 | 4816 | |
4817 | 4817 | $resql = $this->db->query($sql); |
4818 | 4818 | if ($resql) { |
@@ -4822,7 +4822,7 @@ discard block |
||
4822 | 4822 | $obj = $this->db->fetch_object($resql); |
4823 | 4823 | |
4824 | 4824 | // If traduction exist, we use it else we take the default label |
4825 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4825 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4826 | 4826 | $this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; |
4827 | 4827 | $this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; |
4828 | 4828 | $this->cache_transport_mode[$obj->rowid]['label'] = $label; |
@@ -4856,11 +4856,11 @@ discard block |
||
4856 | 4856 | { |
4857 | 4857 | global $langs, $user; |
4858 | 4858 | |
4859 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG); |
|
4859 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG); |
|
4860 | 4860 | |
4861 | 4861 | $this->load_cache_transport_mode(); |
4862 | 4862 | |
4863 | - print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4863 | + print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4864 | 4864 | if ($empty) { |
4865 | 4865 | print '<option value=""> </option>'; |
4866 | 4866 | } |
@@ -4876,13 +4876,13 @@ discard block |
||
4876 | 4876 | } |
4877 | 4877 | |
4878 | 4878 | if ($format == 0) { |
4879 | - print '<option value="' . $id . '"'; |
|
4879 | + print '<option value="'.$id.'"'; |
|
4880 | 4880 | } elseif ($format == 1) { |
4881 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
4881 | + print '<option value="'.$arraytypes['code'].'"'; |
|
4882 | 4882 | } elseif ($format == 2) { |
4883 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
4883 | + print '<option value="'.$arraytypes['code'].'"'; |
|
4884 | 4884 | } elseif ($format == 3) { |
4885 | - print '<option value="' . $id . '"'; |
|
4885 | + print '<option value="'.$id.'"'; |
|
4886 | 4886 | } |
4887 | 4887 | // If text is selected, we compare with code, else with id |
4888 | 4888 | if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { |
@@ -4930,31 +4930,31 @@ discard block |
||
4930 | 4930 | $langs->load("deliveries"); |
4931 | 4931 | |
4932 | 4932 | $sql = "SELECT rowid, code, libelle as label"; |
4933 | - $sql .= " FROM " . $this->db->prefix() . "c_shipment_mode"; |
|
4933 | + $sql .= " FROM ".$this->db->prefix()."c_shipment_mode"; |
|
4934 | 4934 | $sql .= " WHERE active > 0"; |
4935 | 4935 | if ($filtre) { |
4936 | - $sql .= " AND " . $filtre; |
|
4936 | + $sql .= " AND ".$filtre; |
|
4937 | 4937 | } |
4938 | 4938 | $sql .= " ORDER BY libelle ASC"; |
4939 | 4939 | |
4940 | - dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG); |
|
4940 | + dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG); |
|
4941 | 4941 | $result = $this->db->query($sql); |
4942 | 4942 | if ($result) { |
4943 | 4943 | $num = $this->db->num_rows($result); |
4944 | 4944 | $i = 0; |
4945 | 4945 | if ($num) { |
4946 | - print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
4946 | + print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
4947 | 4947 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
4948 | 4948 | print '<option value="-1"> </option>'; |
4949 | 4949 | } |
4950 | 4950 | while ($i < $num) { |
4951 | 4951 | $obj = $this->db->fetch_object($result); |
4952 | 4952 | if ($selected == $obj->rowid) { |
4953 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
4953 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
4954 | 4954 | } else { |
4955 | - print '<option value="' . $obj->rowid . '">'; |
|
4955 | + print '<option value="'.$obj->rowid.'">'; |
|
4956 | 4956 | } |
4957 | - print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label; |
|
4957 | + print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label; |
|
4958 | 4958 | print '</option>'; |
4959 | 4959 | $i++; |
4960 | 4960 | } |
@@ -4963,7 +4963,7 @@ discard block |
||
4963 | 4963 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4964 | 4964 | } |
4965 | 4965 | |
4966 | - print ajax_combobox('select' . $htmlname); |
|
4966 | + print ajax_combobox('select'.$htmlname); |
|
4967 | 4967 | } else { |
4968 | 4968 | print $langs->trans("NoShippingMethodDefined"); |
4969 | 4969 | } |
@@ -4988,16 +4988,16 @@ discard block |
||
4988 | 4988 | $langs->load("deliveries"); |
4989 | 4989 | |
4990 | 4990 | if ($htmlname != "none") { |
4991 | - print '<form method="POST" action="' . $page . '">'; |
|
4991 | + print '<form method="POST" action="'.$page.'">'; |
|
4992 | 4992 | print '<input type="hidden" name="action" value="setshippingmethod">'; |
4993 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
4993 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
4994 | 4994 | $this->selectShippingMethod($selected, $htmlname, '', $addempty); |
4995 | - print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
4995 | + print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
4996 | 4996 | print '</form>'; |
4997 | 4997 | } else { |
4998 | 4998 | if ($selected) { |
4999 | 4999 | $code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code'); |
5000 | - print $langs->trans("SendingMethod" . strtoupper($code)); |
|
5000 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
5001 | 5001 | } else { |
5002 | 5002 | print " "; |
5003 | 5003 | } |
@@ -5020,10 +5020,10 @@ discard block |
||
5020 | 5020 | |
5021 | 5021 | $opt = '<option value="" selected></option>'; |
5022 | 5022 | $sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc"; |
5023 | - $sql .= ' FROM ' . $this->db->prefix() . 'facture'; |
|
5024 | - $sql .= ' WHERE entity IN (' . getEntity('invoice') . ')'; |
|
5023 | + $sql .= ' FROM '.$this->db->prefix().'facture'; |
|
5024 | + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; |
|
5025 | 5025 | $sql .= ' AND situation_counter >= 1'; |
5026 | - $sql .= ' AND fk_soc = ' . (int) $socid; |
|
5026 | + $sql .= ' AND fk_soc = '.(int) $socid; |
|
5027 | 5027 | $sql .= ' AND type <> 2'; |
5028 | 5028 | $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; |
5029 | 5029 | $resql = $this->db->query($sql); |
@@ -5041,19 +5041,19 @@ discard block |
||
5041 | 5041 | //Not prov? |
5042 | 5042 | if (substr($obj->ref, 1, 4) != 'PROV') { |
5043 | 5043 | if ($selected == $obj->rowid) { |
5044 | - $opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>'; |
|
5044 | + $opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>'; |
|
5045 | 5045 | } else { |
5046 | - $opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>'; |
|
5046 | + $opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>'; |
|
5047 | 5047 | } |
5048 | 5048 | } |
5049 | 5049 | } |
5050 | 5050 | } |
5051 | 5051 | } |
5052 | 5052 | } else { |
5053 | - dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR); |
|
5053 | + dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); |
|
5054 | 5054 | } |
5055 | 5055 | if ($opt == '<option value ="" selected></option>') { |
5056 | - $opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>'; |
|
5056 | + $opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>'; |
|
5057 | 5057 | } |
5058 | 5058 | return $opt; |
5059 | 5059 | } |
@@ -5073,12 +5073,12 @@ discard block |
||
5073 | 5073 | |
5074 | 5074 | $langs->load('products'); |
5075 | 5075 | |
5076 | - $return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
5076 | + $return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
5077 | 5077 | |
5078 | - $sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units"; |
|
5078 | + $sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units"; |
|
5079 | 5079 | $sql .= ' WHERE active > 0'; |
5080 | 5080 | if (!empty($unit_type)) { |
5081 | - $sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'"; |
|
5081 | + $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; |
|
5082 | 5082 | } |
5083 | 5083 | $sql .= " ORDER BY sortorder"; |
5084 | 5084 | |
@@ -5090,14 +5090,14 @@ discard block |
||
5090 | 5090 | |
5091 | 5091 | while ($res = $this->db->fetch_object($resql)) { |
5092 | 5092 | $unitLabel = $res->label; |
5093 | - if (!empty($langs->tab_translate['unit' . $res->code])) { // check if Translation is available before |
|
5094 | - $unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label; |
|
5093 | + if (!empty($langs->tab_translate['unit'.$res->code])) { // check if Translation is available before |
|
5094 | + $unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label; |
|
5095 | 5095 | } |
5096 | 5096 | |
5097 | 5097 | if ($selected == $res->rowid) { |
5098 | - $return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>'; |
|
5098 | + $return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>'; |
|
5099 | 5099 | } else { |
5100 | - $return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>'; |
|
5100 | + $return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>'; |
|
5101 | 5101 | } |
5102 | 5102 | } |
5103 | 5103 | $return .= '</select>'; |
@@ -5132,23 +5132,23 @@ discard block |
||
5132 | 5132 | $num = 0; |
5133 | 5133 | |
5134 | 5134 | $sql = "SELECT rowid, label, bank, clos as status, currency_code"; |
5135 | - $sql .= " FROM " . $this->db->prefix() . "bank_account"; |
|
5136 | - $sql .= " WHERE entity IN (" . getEntity('bank_account') . ")"; |
|
5135 | + $sql .= " FROM ".$this->db->prefix()."bank_account"; |
|
5136 | + $sql .= " WHERE entity IN (".getEntity('bank_account').")"; |
|
5137 | 5137 | if ($status != 2) { |
5138 | - $sql .= " AND clos = " . (int) $status; |
|
5138 | + $sql .= " AND clos = ".(int) $status; |
|
5139 | 5139 | } |
5140 | 5140 | if ($filtre) { // TODO Support USF |
5141 | - $sql .= " AND " . $filtre; |
|
5141 | + $sql .= " AND ".$filtre; |
|
5142 | 5142 | } |
5143 | 5143 | $sql .= " ORDER BY label"; |
5144 | 5144 | |
5145 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
5145 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
5146 | 5146 | $result = $this->db->query($sql); |
5147 | 5147 | if ($result) { |
5148 | 5148 | $num = $this->db->num_rows($result); |
5149 | 5149 | $i = 0; |
5150 | 5150 | if ($num) { |
5151 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
5151 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
5152 | 5152 | |
5153 | 5153 | if (!empty($useempty) && !is_numeric($useempty)) { |
5154 | 5154 | $out .= '<option value="-1">'.$langs->trans($useempty).'</option>'; |
@@ -5159,27 +5159,27 @@ discard block |
||
5159 | 5159 | while ($i < $num) { |
5160 | 5160 | $obj = $this->db->fetch_object($result); |
5161 | 5161 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
5162 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>'; |
|
5162 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>'; |
|
5163 | 5163 | } else { |
5164 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">'; |
|
5164 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">'; |
|
5165 | 5165 | } |
5166 | 5166 | $out .= trim($obj->label); |
5167 | 5167 | if ($showcurrency) { |
5168 | - $out .= ' (' . $obj->currency_code . ')'; |
|
5168 | + $out .= ' ('.$obj->currency_code.')'; |
|
5169 | 5169 | } |
5170 | 5170 | if ($status == 2 && $obj->status == 1) { |
5171 | - $out .= ' (' . $langs->trans("Closed") . ')'; |
|
5171 | + $out .= ' ('.$langs->trans("Closed").')'; |
|
5172 | 5172 | } |
5173 | 5173 | $out .= '</option>'; |
5174 | 5174 | $i++; |
5175 | 5175 | } |
5176 | 5176 | $out .= "</select>"; |
5177 | - $out .= ajax_combobox('select' . $htmlname); |
|
5177 | + $out .= ajax_combobox('select'.$htmlname); |
|
5178 | 5178 | } else { |
5179 | 5179 | if ($status == 0) { |
5180 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>'; |
|
5180 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; |
|
5181 | 5181 | } else { |
5182 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>'; |
|
5182 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>'; |
|
5183 | 5183 | } |
5184 | 5184 | } |
5185 | 5185 | } else { |
@@ -5215,23 +5215,23 @@ discard block |
||
5215 | 5215 | $num = 0; |
5216 | 5216 | |
5217 | 5217 | $sql = "SELECT rowid, name, fk_country, status, entity"; |
5218 | - $sql .= " FROM " . $this->db->prefix() . "establishment"; |
|
5218 | + $sql .= " FROM ".$this->db->prefix()."establishment"; |
|
5219 | 5219 | $sql .= " WHERE 1=1"; |
5220 | 5220 | if ($status != 2) { |
5221 | - $sql .= " AND status = " . (int) $status; |
|
5221 | + $sql .= " AND status = ".(int) $status; |
|
5222 | 5222 | } |
5223 | 5223 | if ($filtre) { // TODO Support USF |
5224 | - $sql .= " AND " . $filtre; |
|
5224 | + $sql .= " AND ".$filtre; |
|
5225 | 5225 | } |
5226 | 5226 | $sql .= " ORDER BY name"; |
5227 | 5227 | |
5228 | - dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG); |
|
5228 | + dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG); |
|
5229 | 5229 | $result = $this->db->query($sql); |
5230 | 5230 | if ($result) { |
5231 | 5231 | $num = $this->db->num_rows($result); |
5232 | 5232 | $i = 0; |
5233 | 5233 | if ($num) { |
5234 | - print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
5234 | + print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
5235 | 5235 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
5236 | 5236 | print '<option value="-1"> </option>'; |
5237 | 5237 | } |
@@ -5239,13 +5239,13 @@ discard block |
||
5239 | 5239 | while ($i < $num) { |
5240 | 5240 | $obj = $this->db->fetch_object($result); |
5241 | 5241 | if ($selected == $obj->rowid) { |
5242 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
5242 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
5243 | 5243 | } else { |
5244 | - print '<option value="' . $obj->rowid . '">'; |
|
5244 | + print '<option value="'.$obj->rowid.'">'; |
|
5245 | 5245 | } |
5246 | 5246 | print trim($obj->name); |
5247 | 5247 | if ($status == 2 && $obj->status == 1) { |
5248 | - print ' (' . $langs->trans("Closed") . ')'; |
|
5248 | + print ' ('.$langs->trans("Closed").')'; |
|
5249 | 5249 | } |
5250 | 5250 | print '</option>'; |
5251 | 5251 | $i++; |
@@ -5253,9 +5253,9 @@ discard block |
||
5253 | 5253 | print "</select>"; |
5254 | 5254 | } else { |
5255 | 5255 | if ($status == 0) { |
5256 | - print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>'; |
|
5256 | + print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; |
|
5257 | 5257 | } else { |
5258 | - print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>'; |
|
5258 | + print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; |
|
5259 | 5259 | } |
5260 | 5260 | } |
5261 | 5261 | |
@@ -5279,20 +5279,20 @@ discard block |
||
5279 | 5279 | { |
5280 | 5280 | global $langs; |
5281 | 5281 | if ($htmlname != "none") { |
5282 | - print '<form method="POST" action="' . $page . '">'; |
|
5282 | + print '<form method="POST" action="'.$page.'">'; |
|
5283 | 5283 | print '<input type="hidden" name="action" value="setbankaccount">'; |
5284 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5284 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5285 | 5285 | print img_picto('', 'bank_account', 'class="pictofixedwidth"'); |
5286 | 5286 | $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); |
5287 | 5287 | if ($nbaccountfound > 0) { |
5288 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5288 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
5289 | 5289 | } |
5290 | 5290 | print '</form>'; |
5291 | 5291 | } else { |
5292 | 5292 | $langs->load('banks'); |
5293 | 5293 | |
5294 | 5294 | if ($selected) { |
5295 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
5295 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
5296 | 5296 | $bankstatic = new Account($this->db); |
5297 | 5297 | $result = $bankstatic->fetch($selected); |
5298 | 5298 | if ($result) { |
@@ -5331,19 +5331,19 @@ discard block |
||
5331 | 5331 | global $conf, $langs; |
5332 | 5332 | $langs->load("categories"); |
5333 | 5333 | |
5334 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
5334 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
5335 | 5335 | |
5336 | 5336 | // For backward compatibility |
5337 | 5337 | if (is_numeric($type)) { |
5338 | - dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
5338 | + dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
5339 | 5339 | } |
5340 | 5340 | |
5341 | 5341 | if ($type === Categorie::TYPE_BANK_LINE) { |
5342 | 5342 | // TODO Move this into common category feature |
5343 | 5343 | $cate_arbo = array(); |
5344 | 5344 | $sql = "SELECT c.label, c.rowid"; |
5345 | - $sql .= " FROM " . $this->db->prefix() . "category_bank as c"; |
|
5346 | - $sql .= " WHERE entity = " . $conf->entity; |
|
5345 | + $sql .= " FROM ".$this->db->prefix()."category_bank as c"; |
|
5346 | + $sql .= " WHERE entity = ".$conf->entity; |
|
5347 | 5347 | $sql .= " ORDER BY c.label"; |
5348 | 5348 | $result = $this->db->query($sql); |
5349 | 5349 | if ($result) { |
@@ -5369,12 +5369,12 @@ discard block |
||
5369 | 5369 | $outarrayrichhtml = array(); |
5370 | 5370 | |
5371 | 5371 | |
5372 | - $output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
5372 | + $output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
5373 | 5373 | if (is_array($cate_arbo)) { |
5374 | 5374 | $num = count($cate_arbo); |
5375 | 5375 | |
5376 | 5376 | if (!$num) { |
5377 | - $output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>'; |
|
5377 | + $output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>'; |
|
5378 | 5378 | } else { |
5379 | 5379 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
5380 | 5380 | $output .= '<option value="-1"> </option>'; |
@@ -5386,15 +5386,15 @@ discard block |
||
5386 | 5386 | $add = ''; |
5387 | 5387 | } |
5388 | 5388 | |
5389 | - $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"'); |
|
5389 | + $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"'); |
|
5390 | 5390 | $labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
5391 | 5391 | |
5392 | 5392 | $outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel']; |
5393 | 5393 | |
5394 | 5394 | $outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow; |
5395 | 5395 | |
5396 | - $output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"'; |
|
5397 | - $output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"'; |
|
5396 | + $output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"'; |
|
5397 | + $output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"'; |
|
5398 | 5398 | $output .= '>'; |
5399 | 5399 | $output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
5400 | 5400 | $output .= '</option>'; |
@@ -5438,7 +5438,7 @@ discard block |
||
5438 | 5438 | public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) |
5439 | 5439 | { |
5440 | 5440 | // phpcs:enable |
5441 | - dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
5441 | + dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
5442 | 5442 | print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); |
5443 | 5443 | } |
5444 | 5444 | |
@@ -5473,7 +5473,7 @@ discard block |
||
5473 | 5473 | { |
5474 | 5474 | global $langs, $conf; |
5475 | 5475 | |
5476 | - $more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->'; |
|
5476 | + $more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->'; |
|
5477 | 5477 | $formconfirm = ''; |
5478 | 5478 | $inputok = array(); |
5479 | 5479 | $inputko = array(); |
@@ -5497,27 +5497,27 @@ discard block |
||
5497 | 5497 | foreach ($formquestion as $key => $input) { |
5498 | 5498 | if (is_array($input) && !empty($input)) { |
5499 | 5499 | if ($input['type'] == 'hidden') { |
5500 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
5501 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
5500 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
5501 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
5502 | 5502 | |
5503 | - $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"; |
|
5503 | + $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"; |
|
5504 | 5504 | } |
5505 | 5505 | } |
5506 | 5506 | } |
5507 | 5507 | |
5508 | 5508 | // Now add questions |
5509 | 5509 | $moreonecolumn = ''; |
5510 | - $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n"; |
|
5510 | + $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n"; |
|
5511 | 5511 | foreach ($formquestion as $key => $input) { |
5512 | 5512 | if (is_array($input) && !empty($input)) { |
5513 | - $size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : ''); // deprecated. Use morecss instead. |
|
5514 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
5515 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
5513 | + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. |
|
5514 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
5515 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
5516 | 5516 | |
5517 | 5517 | if ($input['type'] == 'text') { |
5518 | - $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"; |
|
5518 | + $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"; |
|
5519 | 5519 | } elseif ($input['type'] == 'password') { |
5520 | - $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"; |
|
5520 | + $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"; |
|
5521 | 5521 | } elseif ($input['type'] == 'textarea') { |
5522 | 5522 | /*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; |
5523 | 5523 | $more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; |
@@ -5525,8 +5525,8 @@ discard block |
||
5525 | 5525 | $more .= '</textarea>'; |
5526 | 5526 | $more .= '</div></div>'."\n";*/ |
5527 | 5527 | $moreonecolumn .= '<div class="margintoponly">'; |
5528 | - $moreonecolumn .= $input['label'] . '<br>'; |
|
5529 | - $moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>'; |
|
5528 | + $moreonecolumn .= $input['label'].'<br>'; |
|
5529 | + $moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>'; |
|
5530 | 5530 | $moreonecolumn .= $input['value']; |
5531 | 5531 | $moreonecolumn .= '</textarea>'; |
5532 | 5532 | $moreonecolumn .= '</div>'; |
@@ -5543,20 +5543,20 @@ discard block |
||
5543 | 5543 | $disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; |
5544 | 5544 | $sort = isset($input['select_sort']) ? $input['select_sort'] : ''; |
5545 | 5545 | |
5546 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">'; |
|
5546 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
|
5547 | 5547 | if (!empty($input['label'])) { |
5548 | - $more .= $input['label'] . '</div><div class="tagtd left">'; |
|
5548 | + $more .= $input['label'].'</div><div class="tagtd left">'; |
|
5549 | 5549 | } |
5550 | 5550 | if ($input['type'] == 'select') { |
5551 | 5551 | $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); |
5552 | 5552 | } else { |
5553 | 5553 | $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); |
5554 | 5554 | } |
5555 | - $more .= '</div></div>' . "\n"; |
|
5555 | + $more .= '</div></div>'."\n"; |
|
5556 | 5556 | } elseif ($input['type'] == 'checkbox') { |
5557 | 5557 | $more .= '<div class="tagtr">'; |
5558 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">'; |
|
5559 | - $more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr; |
|
5558 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">'; |
|
5559 | + $more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; |
|
5560 | 5560 | if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') { |
5561 | 5561 | $more .= ' checked'; |
5562 | 5562 | } |
@@ -5567,19 +5567,19 @@ discard block |
||
5567 | 5567 | $more .= ' disabled'; |
5568 | 5568 | } |
5569 | 5569 | $more .= ' /></div>'; |
5570 | - $more .= '</div>' . "\n"; |
|
5570 | + $more .= '</div>'."\n"; |
|
5571 | 5571 | } elseif ($input['type'] == 'radio') { |
5572 | 5572 | $i = 0; |
5573 | 5573 | foreach ($input['values'] as $selkey => $selval) { |
5574 | 5574 | $more .= '<div class="tagtr">'; |
5575 | 5575 | if (isset($input['label'])) { |
5576 | 5576 | if ($i == 0) { |
5577 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
5577 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
5578 | 5578 | } else { |
5579 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '"> </div>'; |
|
5579 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>'; |
|
5580 | 5580 | } |
5581 | 5581 | } |
5582 | - $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; |
|
5582 | + $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; |
|
5583 | 5583 | if (!empty($input['disabled'])) { |
5584 | 5584 | $more .= ' disabled'; |
5585 | 5585 | } |
@@ -5587,12 +5587,12 @@ discard block |
||
5587 | 5587 | $more .= ' checked="checked"'; |
5588 | 5588 | } |
5589 | 5589 | $more .= ' /> '; |
5590 | - $more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>'; |
|
5591 | - $more .= '</div></div>' . "\n"; |
|
5590 | + $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>'; |
|
5591 | + $more .= '</div></div>'."\n"; |
|
5592 | 5592 | $i++; |
5593 | 5593 | } |
5594 | 5594 | } elseif ($input['type'] == 'date' || $input['type'] == 'datetime') { |
5595 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
5595 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
5596 | 5596 | $more .= '<div class="tagtd">'; |
5597 | 5597 | $addnowlink = (empty($input['datenow']) ? 0 : 1); |
5598 | 5598 | $h = $m = 0; |
@@ -5610,24 +5610,24 @@ discard block |
||
5610 | 5610 | } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not |
5611 | 5611 | $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
5612 | 5612 | if (!empty($input['label'])) { |
5613 | - $more .= $input['label'] . '</div><div class="tagtd">'; |
|
5613 | + $more .= $input['label'].'</div><div class="tagtd">'; |
|
5614 | 5614 | } |
5615 | 5615 | $more .= $input['value']; |
5616 | - $more .= '</div></div>' . "\n"; |
|
5616 | + $more .= '</div></div>'."\n"; |
|
5617 | 5617 | } elseif ($input['type'] == 'onecolumn') { |
5618 | 5618 | $moreonecolumn .= '<div class="margintoponly">'; |
5619 | 5619 | $moreonecolumn .= $input['value']; |
5620 | - $moreonecolumn .= '</div>' . "\n"; |
|
5620 | + $moreonecolumn .= '</div>'."\n"; |
|
5621 | 5621 | } elseif ($input['type'] == 'hidden') { |
5622 | 5622 | // Do nothing more, already added by a previous loop |
5623 | 5623 | } elseif ($input['type'] == 'separator') { |
5624 | 5624 | $more .= '<br>'; |
5625 | 5625 | } else { |
5626 | - $more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type'; |
|
5626 | + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; |
|
5627 | 5627 | } |
5628 | 5628 | } |
5629 | 5629 | } |
5630 | - $more .= '</div>' . "\n"; |
|
5630 | + $more .= '</div>'."\n"; |
|
5631 | 5631 | $more .= $moreonecolumn; |
5632 | 5632 | } |
5633 | 5633 | |
@@ -5649,10 +5649,10 @@ discard block |
||
5649 | 5649 | $button = $useajax; |
5650 | 5650 | $useajax = 1; |
5651 | 5651 | $autoOpen = false; |
5652 | - $dialogconfirm .= '-' . $button; |
|
5652 | + $dialogconfirm .= '-'.$button; |
|
5653 | 5653 | } |
5654 | - $pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes'; |
|
5655 | - $pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : ''); |
|
5654 | + $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes'; |
|
5655 | + $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : ''); |
|
5656 | 5656 | |
5657 | 5657 | // Add input fields into list of fields to read during submit (inputok and inputko) |
5658 | 5658 | if (is_array($formquestion)) { |
@@ -5675,24 +5675,24 @@ discard block |
||
5675 | 5675 | } |
5676 | 5676 | |
5677 | 5677 | // Show JQuery confirm box. |
5678 | - $formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">'; |
|
5678 | + $formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; |
|
5679 | 5679 | if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
5680 | - $formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n"; |
|
5680 | + $formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n"; |
|
5681 | 5681 | } |
5682 | 5682 | if (!empty($more)) { |
5683 | - $formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n"; |
|
5683 | + $formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n"; |
|
5684 | 5684 | } |
5685 | - $formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : ''); |
|
5686 | - $formconfirm .= '</div>' . "\n"; |
|
5685 | + $formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : ''); |
|
5686 | + $formconfirm .= '</div>'."\n"; |
|
5687 | 5687 | |
5688 | - $formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n"; |
|
5689 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
5688 | + $formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n"; |
|
5689 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
5690 | 5690 | $formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n"; |
5691 | 5691 | $formconfirm .= 'jQuery(document).ready(function() { |
5692 | 5692 | $(function() { |
5693 | - $( "#' . $dialogconfirm . '" ).dialog( |
|
5693 | + $( "#' . $dialogconfirm.'" ).dialog( |
|
5694 | 5694 | { |
5695 | - autoOpen: ' . ($autoOpen ? "true" : "false") . ','; |
|
5695 | + autoOpen: ' . ($autoOpen ? "true" : "false").','; |
|
5696 | 5696 | if ($newselectedchoice == 'no') { |
5697 | 5697 | $formconfirm .= ' |
5698 | 5698 | open: function() { |
@@ -5702,24 +5702,24 @@ discard block |
||
5702 | 5702 | |
5703 | 5703 | $jsforcursor = ''; |
5704 | 5704 | if ($useajax == 1) { |
5705 | - $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n"; |
|
5706 | - $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n"; |
|
5705 | + $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; |
|
5706 | + $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; |
|
5707 | 5707 | } |
5708 | 5708 | |
5709 | 5709 | $postconfirmas = 'GET'; |
5710 | 5710 | |
5711 | 5711 | $formconfirm .= ' |
5712 | 5712 | resizable: false, |
5713 | - height: "' . $height . '", |
|
5714 | - width: "' . $width . '", |
|
5713 | + height: "' . $height.'", |
|
5714 | + width: "' . $width.'", |
|
5715 | 5715 | modal: true, |
5716 | 5716 | closeOnEscape: false, |
5717 | 5717 | buttons: { |
5718 | - "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() { |
|
5719 | - var options = "token=' . urlencode(newToken()) . '"; |
|
5720 | - var inputok = ' . json_encode($inputok) . '; /* List of fields into form */ |
|
5721 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
5722 | - var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '"; |
|
5718 | + "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { |
|
5719 | + var options = "token=' . urlencode(newToken()).'"; |
|
5720 | + var inputok = ' . json_encode($inputok).'; /* List of fields into form */ |
|
5721 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
5722 | + var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; |
|
5723 | 5723 | |
5724 | 5724 | if (inputok.length > 0) { |
5725 | 5725 | $.each(inputok, function(i, inputname) { |
@@ -5753,11 +5753,11 @@ discard block |
||
5753 | 5753 | } |
5754 | 5754 | $(this).dialog("close"); |
5755 | 5755 | }, |
5756 | - "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() { |
|
5757 | - var options = "token=' . urlencode(newToken()) . '"; |
|
5758 | - var inputko = ' . json_encode($inputko) . '; /* List of fields into form */ |
|
5759 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
5760 | - var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '"; |
|
5756 | + "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { |
|
5757 | + var options = "token=' . urlencode(newToken()).'"; |
|
5758 | + var inputko = ' . json_encode($inputko).'; /* List of fields into form */ |
|
5759 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
5760 | + var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'"; |
|
5761 | 5761 | if (inputko.length > 0) { |
5762 | 5762 | $.each(inputko, function(i, inputname) { |
5763 | 5763 | var more = ""; |
@@ -5789,10 +5789,10 @@ discard block |
||
5789 | 5789 | } |
5790 | 5790 | ); |
5791 | 5791 | |
5792 | - var button = "' . $button . '"; |
|
5792 | + var button = "' . $button.'"; |
|
5793 | 5793 | if (button.length > 0) { |
5794 | 5794 | $( "#" + button ).click(function() { |
5795 | - $("#' . $dialogconfirm . '").dialog("open"); |
|
5795 | + $("#' . $dialogconfirm.'").dialog("open"); |
|
5796 | 5796 | }); |
5797 | 5797 | } |
5798 | 5798 | }); |
@@ -5800,44 +5800,44 @@ discard block |
||
5800 | 5800 | </script>'; |
5801 | 5801 | $formconfirm .= "<!-- end ajax formconfirm -->\n"; |
5802 | 5802 | } else { |
5803 | - $formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n"; |
|
5803 | + $formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n"; |
|
5804 | 5804 | |
5805 | 5805 | if (empty($disableformtag)) { |
5806 | - $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n"; |
|
5806 | + $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n"; |
|
5807 | 5807 | } |
5808 | 5808 | |
5809 | - $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n"; |
|
5810 | - $formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n"; |
|
5809 | + $formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n"; |
|
5810 | + $formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
|
5811 | 5811 | |
5812 | - $formconfirm .= '<table class="valid centpercent">' . "\n"; |
|
5812 | + $formconfirm .= '<table class="valid centpercent">'."\n"; |
|
5813 | 5813 | |
5814 | 5814 | // Line title |
5815 | 5815 | $formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">'; |
5816 | - $formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title; |
|
5817 | - $formconfirm .= '</td></tr>' . "\n"; |
|
5816 | + $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; |
|
5817 | + $formconfirm .= '</td></tr>'."\n"; |
|
5818 | 5818 | |
5819 | 5819 | // Line text |
5820 | 5820 | if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
5821 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n"; |
|
5821 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n"; |
|
5822 | 5822 | } |
5823 | 5823 | |
5824 | 5824 | // Line form fields |
5825 | 5825 | if ($more) { |
5826 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n"; |
|
5826 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n"; |
|
5827 | 5827 | $formconfirm .= $more; |
5828 | - $formconfirm .= '</td></tr>' . "\n"; |
|
5828 | + $formconfirm .= '</td></tr>'."\n"; |
|
5829 | 5829 | } |
5830 | 5830 | |
5831 | 5831 | // Line with question |
5832 | 5832 | $formconfirm .= '<tr class="valid">'; |
5833 | - $formconfirm .= '<td class="valid">' . $question . '</td>'; |
|
5833 | + $formconfirm .= '<td class="valid">'.$question.'</td>'; |
|
5834 | 5834 | $formconfirm .= '<td class="valid center">'; |
5835 | 5835 | $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); |
5836 | - $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">'; |
|
5836 | + $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">'; |
|
5837 | 5837 | $formconfirm .= '</td>'; |
5838 | - $formconfirm .= '</tr>' . "\n"; |
|
5838 | + $formconfirm .= '</tr>'."\n"; |
|
5839 | 5839 | |
5840 | - $formconfirm .= '</table>' . "\n"; |
|
5840 | + $formconfirm .= '</table>'."\n"; |
|
5841 | 5841 | |
5842 | 5842 | if (empty($disableformtag)) { |
5843 | 5843 | $formconfirm .= "</form>\n"; |
@@ -5846,7 +5846,7 @@ discard block |
||
5846 | 5846 | |
5847 | 5847 | if (!empty($conf->use_javascript_ajax)) { |
5848 | 5848 | $formconfirm .= '<!-- code to disable button to avoid double clic -->'; |
5849 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
5849 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
5850 | 5850 | $formconfirm .= ' |
5851 | 5851 | $(document).ready(function () { |
5852 | 5852 | $(".confirmvalidatebutton").on("click", function() { |
@@ -5858,7 +5858,7 @@ discard block |
||
5858 | 5858 | }); |
5859 | 5859 | }); |
5860 | 5860 | '; |
5861 | - $formconfirm .= '</script>' . "\n"; |
|
5861 | + $formconfirm .= '</script>'."\n"; |
|
5862 | 5862 | } |
5863 | 5863 | |
5864 | 5864 | $formconfirm .= "<!-- end formconfirm -->\n"; |
@@ -5890,8 +5890,8 @@ discard block |
||
5890 | 5890 | // phpcs:enable |
5891 | 5891 | global $langs; |
5892 | 5892 | |
5893 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
5894 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
5893 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
5894 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
5895 | 5895 | |
5896 | 5896 | $out = ''; |
5897 | 5897 | |
@@ -5899,11 +5899,11 @@ discard block |
||
5899 | 5899 | |
5900 | 5900 | $langs->load("project"); |
5901 | 5901 | if ($htmlname != "none") { |
5902 | - $out .= '<form method="post" action="' . $page . '">'; |
|
5902 | + $out .= '<form method="post" action="'.$page.'">'; |
|
5903 | 5903 | $out .= '<input type="hidden" name="action" value="classin">'; |
5904 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5904 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5905 | 5905 | $out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss); |
5906 | - $out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
5906 | + $out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
5907 | 5907 | $out .= '</form>'; |
5908 | 5908 | } else { |
5909 | 5909 | $out .= '<span class="project_head_block">'; |
@@ -5912,7 +5912,7 @@ discard block |
||
5912 | 5912 | $projet->fetch($selected); |
5913 | 5913 | $out .= $projet->getNomUrl(0, '', 1); |
5914 | 5914 | } else { |
5915 | - $out .= '<span class="opacitymedium">' . $textifnoproject . '</span>'; |
|
5915 | + $out .= '<span class="opacitymedium">'.$textifnoproject.'</span>'; |
|
5916 | 5916 | } |
5917 | 5917 | $out .= '</span>'; |
5918 | 5918 | } |
@@ -5949,14 +5949,14 @@ discard block |
||
5949 | 5949 | $out = ''; |
5950 | 5950 | |
5951 | 5951 | if ($htmlname != "none") { |
5952 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
5952 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
5953 | 5953 | $out .= '<input type="hidden" name="action" value="setconditions">'; |
5954 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5954 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5955 | 5955 | if ($type) { |
5956 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
5956 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
5957 | 5957 | } |
5958 | 5958 | $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); |
5959 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
5959 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
5960 | 5960 | $out .= '</form>'; |
5961 | 5961 | } else { |
5962 | 5962 | if ($selected) { |
@@ -6001,12 +6001,12 @@ discard block |
||
6001 | 6001 | // phpcs:enable |
6002 | 6002 | global $langs; |
6003 | 6003 | if ($htmlname != "none") { |
6004 | - print '<form method="post" action="' . $page . '">'; |
|
6004 | + print '<form method="post" action="'.$page.'">'; |
|
6005 | 6005 | print '<input type="hidden" name="action" value="setavailability">'; |
6006 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6006 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6007 | 6007 | $this->selectAvailabilityDelay($selected, $htmlname, '', $addempty); |
6008 | - print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
6009 | - print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">'; |
|
6008 | + print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
6009 | + print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">'; |
|
6010 | 6010 | print '</form>'; |
6011 | 6011 | } else { |
6012 | 6012 | if ($selected) { |
@@ -6032,11 +6032,11 @@ discard block |
||
6032 | 6032 | { |
6033 | 6033 | global $langs; |
6034 | 6034 | if ($htmlname != "none") { |
6035 | - print '<form method="post" action="' . $page . '">'; |
|
6035 | + print '<form method="post" action="'.$page.'">'; |
|
6036 | 6036 | print '<input type="hidden" name="action" value="setdemandreason">'; |
6037 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6037 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6038 | 6038 | $this->selectInputReason($selected, $htmlname, '-1', $addempty); |
6039 | - print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
6039 | + print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
6040 | 6040 | print '</form>'; |
6041 | 6041 | } else { |
6042 | 6042 | if ($selected) { |
@@ -6076,17 +6076,17 @@ discard block |
||
6076 | 6076 | $ret = ''; |
6077 | 6077 | |
6078 | 6078 | if ($htmlname != "none") { |
6079 | - $ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
6080 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
6081 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6079 | + $ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
6080 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
6081 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6082 | 6082 | if ($type) { |
6083 | - $ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
6083 | + $ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
6084 | 6084 | } |
6085 | 6085 | $ret .= '<table class="nobordernopadding">'; |
6086 | 6086 | $ret .= '<tr><td>'; |
6087 | - $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0); |
|
6087 | + $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); |
|
6088 | 6088 | $ret .= '</td>'; |
6089 | - $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
6089 | + $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
6090 | 6090 | $ret .= '</tr></table></form>'; |
6091 | 6091 | } else { |
6092 | 6092 | if ($displayhour) { |
@@ -6121,15 +6121,15 @@ discard block |
||
6121 | 6121 | global $langs; |
6122 | 6122 | |
6123 | 6123 | if ($htmlname != "none") { |
6124 | - print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
6125 | - print '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
6126 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6124 | + print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
6125 | + print '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
6126 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6127 | 6127 | print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); |
6128 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6128 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6129 | 6129 | print '</form>'; |
6130 | 6130 | } else { |
6131 | 6131 | if ($selected) { |
6132 | - require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
6132 | + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
6133 | 6133 | $theuser = new User($this->db); |
6134 | 6134 | $theuser->fetch($selected); |
6135 | 6135 | print $theuser->getNomUrl(1); |
@@ -6162,14 +6162,14 @@ discard block |
||
6162 | 6162 | |
6163 | 6163 | $out = ''; |
6164 | 6164 | if ($htmlname != "none") { |
6165 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
6165 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
6166 | 6166 | $out .= '<input type="hidden" name="action" value="setmode">'; |
6167 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6167 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6168 | 6168 | if ($type) { |
6169 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
6169 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
6170 | 6170 | } |
6171 | 6171 | $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); |
6172 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6172 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6173 | 6173 | $out .= '</form>'; |
6174 | 6174 | } else { |
6175 | 6175 | if ($selected) { |
@@ -6202,11 +6202,11 @@ discard block |
||
6202 | 6202 | { |
6203 | 6203 | global $langs; |
6204 | 6204 | if ($htmlname != "none") { |
6205 | - print '<form method="POST" action="' . $page . '">'; |
|
6205 | + print '<form method="POST" action="'.$page.'">'; |
|
6206 | 6206 | print '<input type="hidden" name="action" value="settransportmode">'; |
6207 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6207 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6208 | 6208 | $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); |
6209 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6209 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6210 | 6210 | print '</form>'; |
6211 | 6211 | } else { |
6212 | 6212 | if ($selected) { |
@@ -6233,14 +6233,14 @@ discard block |
||
6233 | 6233 | // phpcs:enable |
6234 | 6234 | global $langs; |
6235 | 6235 | if ($htmlname != "none") { |
6236 | - print '<form method="POST" action="' . $page . '">'; |
|
6236 | + print '<form method="POST" action="'.$page.'">'; |
|
6237 | 6237 | print '<input type="hidden" name="action" value="setmulticurrencycode">'; |
6238 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6238 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6239 | 6239 | print $this->selectMultiCurrency($selected, $htmlname, 0); |
6240 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6240 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6241 | 6241 | print '</form>'; |
6242 | 6242 | } else { |
6243 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
6243 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
6244 | 6244 | print !empty($selected) ? currency_name($selected, 1) : ' '; |
6245 | 6245 | } |
6246 | 6246 | } |
@@ -6262,21 +6262,21 @@ discard block |
||
6262 | 6262 | global $langs, $mysoc, $conf; |
6263 | 6263 | |
6264 | 6264 | if ($htmlname != "none") { |
6265 | - print '<form method="POST" action="' . $page . '">'; |
|
6265 | + print '<form method="POST" action="'.$page.'">'; |
|
6266 | 6266 | print '<input type="hidden" name="action" value="setmulticurrencyrate">'; |
6267 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6268 | - print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> '; |
|
6267 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6268 | + print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> '; |
|
6269 | 6269 | print '<select name="calculation_mode">'; |
6270 | - print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>'; |
|
6271 | - print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>'; |
|
6270 | + print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>'; |
|
6271 | + print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>'; |
|
6272 | 6272 | print '</select> '; |
6273 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6273 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6274 | 6274 | print '</form>'; |
6275 | 6275 | } else { |
6276 | 6276 | if (!empty($rate)) { |
6277 | 6277 | print price($rate, 1, $langs, 0, 0); |
6278 | 6278 | if ($currency && $rate != 1) { |
6279 | - print ' (' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')'; |
|
6279 | + print ' ('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')'; |
|
6280 | 6280 | } |
6281 | 6281 | } else { |
6282 | 6282 | print 1; |
@@ -6307,9 +6307,9 @@ discard block |
||
6307 | 6307 | // phpcs:enable |
6308 | 6308 | global $conf, $langs; |
6309 | 6309 | if ($htmlname != "none") { |
6310 | - print '<form method="post" action="' . $page . '">'; |
|
6310 | + print '<form method="post" action="'.$page.'">'; |
|
6311 | 6311 | print '<input type="hidden" name="action" value="setabsolutediscount">'; |
6312 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6312 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6313 | 6313 | print '<div class="inline-block">'; |
6314 | 6314 | if (!empty($discount_type)) { |
6315 | 6315 | if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) { |
@@ -6347,24 +6347,24 @@ discard block |
||
6347 | 6347 | print '</div>'; |
6348 | 6348 | if (empty($hidelist)) { |
6349 | 6349 | print '<div class="inline-block" style="padding-right: 10px">'; |
6350 | - $newfilter = 'discount_type=' . intval($discount_type); |
|
6350 | + $newfilter = 'discount_type='.intval($discount_type); |
|
6351 | 6351 | if (!empty($discount_type)) { |
6352 | 6352 | $newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available |
6353 | 6353 | } else { |
6354 | 6354 | $newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available |
6355 | 6355 | } |
6356 | 6356 | if ($filter) { |
6357 | - $newfilter .= ' AND (' . $filter . ')'; |
|
6357 | + $newfilter .= ' AND ('.$filter.')'; |
|
6358 | 6358 | } |
6359 | 6359 | // output the combo of discounts |
6360 | 6360 | $nbqualifiedlines = $this->select_remises((string) $selected, $htmlname, $newfilter, $socid, $maxvalue); |
6361 | 6361 | if ($nbqualifiedlines > 0) { |
6362 | - print ' <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"'; |
|
6362 | + print ' <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; |
|
6363 | 6363 | if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") { |
6364 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
6364 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
6365 | 6365 | } |
6366 | 6366 | if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") { |
6367 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
6367 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
6368 | 6368 | } |
6369 | 6369 | |
6370 | 6370 | print '>'; |
@@ -6404,23 +6404,23 @@ discard block |
||
6404 | 6404 | global $langs; |
6405 | 6405 | |
6406 | 6406 | if ($htmlname != "none") { |
6407 | - print '<form method="post" action="' . $page . '">'; |
|
6407 | + print '<form method="post" action="'.$page.'">'; |
|
6408 | 6408 | print '<input type="hidden" name="action" value="set_contact">'; |
6409 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6409 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6410 | 6410 | print '<table class="nobordernopadding">'; |
6411 | 6411 | print '<tr><td>'; |
6412 | 6412 | print $this->selectcontacts($societe->id, $selected, $htmlname); |
6413 | 6413 | $num = $this->num; |
6414 | 6414 | if ($num == 0) { |
6415 | 6415 | $addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
6416 | - print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>'; |
|
6416 | + print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>'; |
|
6417 | 6417 | } |
6418 | 6418 | print '</td>'; |
6419 | - print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
6419 | + print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
6420 | 6420 | print '</tr></table></form>'; |
6421 | 6421 | } else { |
6422 | 6422 | if ($selected) { |
6423 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
6423 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
6424 | 6424 | $contact = new Contact($this->db); |
6425 | 6425 | $contact->fetch($selected); |
6426 | 6426 | print $contact->getFullName($langs); |
@@ -6455,20 +6455,20 @@ discard block |
||
6455 | 6455 | |
6456 | 6456 | $out = ''; |
6457 | 6457 | if ($htmlname != "none") { |
6458 | - $out .= '<form method="post" action="' . $page . '">'; |
|
6458 | + $out .= '<form method="post" action="'.$page.'">'; |
|
6459 | 6459 | $out .= '<input type="hidden" name="action" value="set_thirdparty">'; |
6460 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6460 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6461 | 6461 | $out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids); |
6462 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6462 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6463 | 6463 | $out .= '</form>'; |
6464 | 6464 | } else { |
6465 | 6465 | if ($selected) { |
6466 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
6466 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
6467 | 6467 | $soc = new Societe($this->db); |
6468 | 6468 | $soc->fetch($selected); |
6469 | 6469 | $out .= $soc->getNomUrl(0, ''); |
6470 | 6470 | } else { |
6471 | - $out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>'; |
|
6471 | + $out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>'; |
|
6472 | 6472 | } |
6473 | 6473 | } |
6474 | 6474 | |
@@ -6518,22 +6518,22 @@ discard block |
||
6518 | 6518 | $selected = 'EUR'; // Pour compatibilite |
6519 | 6519 | } |
6520 | 6520 | |
6521 | - $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
6521 | + $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
6522 | 6522 | if ($useempty) { |
6523 | 6523 | $out .= '<option value="-1" selected></option>'; |
6524 | 6524 | } |
6525 | 6525 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
6526 | 6526 | $labeltoshow = $currency['label']; |
6527 | 6527 | if ($mode == 1) { |
6528 | - $labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>'; |
|
6528 | + $labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>'; |
|
6529 | 6529 | } else { |
6530 | - $labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>'; |
|
6530 | + $labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>'; |
|
6531 | 6531 | } |
6532 | 6532 | |
6533 | 6533 | if ($selected && $selected == $code_iso) { |
6534 | - $out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
6534 | + $out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
6535 | 6535 | } else { |
6536 | - $out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
6536 | + $out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
6537 | 6537 | } |
6538 | 6538 | $out .= $labeltoshow; |
6539 | 6539 | $out .= '</option>'; |
@@ -6544,7 +6544,7 @@ discard block |
||
6544 | 6544 | } |
6545 | 6545 | |
6546 | 6546 | // Make select dynamic |
6547 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
6547 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
6548 | 6548 | $out .= ajax_combobox($htmlname); |
6549 | 6549 | |
6550 | 6550 | return $out; |
@@ -6570,10 +6570,10 @@ discard block |
||
6570 | 6570 | |
6571 | 6571 | $TCurrency = array(); |
6572 | 6572 | |
6573 | - $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; |
|
6574 | - $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; |
|
6573 | + $sql = "SELECT code FROM ".$this->db->prefix()."multicurrency"; |
|
6574 | + $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; |
|
6575 | 6575 | if ($filter) { |
6576 | - $sql .= " AND " . $filter; |
|
6576 | + $sql .= " AND ".$filter; |
|
6577 | 6577 | } |
6578 | 6578 | $resql = $this->db->query($sql); |
6579 | 6579 | if ($resql) { |
@@ -6583,7 +6583,7 @@ discard block |
||
6583 | 6583 | } |
6584 | 6584 | |
6585 | 6585 | $out = ''; |
6586 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
6586 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
6587 | 6587 | if ($useempty) { |
6588 | 6588 | $out .= '<option value=""> </option>'; |
6589 | 6589 | } |
@@ -6595,13 +6595,13 @@ discard block |
||
6595 | 6595 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
6596 | 6596 | if (isset($TCurrency[$code_iso])) { |
6597 | 6597 | if (!empty($selected) && $selected == $code_iso) { |
6598 | - $out .= '<option value="' . $code_iso . '" selected="selected">'; |
|
6598 | + $out .= '<option value="'.$code_iso.'" selected="selected">'; |
|
6599 | 6599 | } else { |
6600 | - $out .= '<option value="' . $code_iso . '">'; |
|
6600 | + $out .= '<option value="'.$code_iso.'">'; |
|
6601 | 6601 | } |
6602 | 6602 | |
6603 | 6603 | $out .= $currency['label']; |
6604 | - $out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')'; |
|
6604 | + $out .= ' ('.$langs->getCurrencySymbol($code_iso).')'; |
|
6605 | 6605 | $out .= '</option>'; |
6606 | 6606 | } |
6607 | 6607 | } |
@@ -6610,7 +6610,7 @@ discard block |
||
6610 | 6610 | $out .= '</select>'; |
6611 | 6611 | |
6612 | 6612 | // Make select dynamic |
6613 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
6613 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
6614 | 6614 | $out .= ajax_combobox($htmlname); |
6615 | 6615 | |
6616 | 6616 | return $out; |
@@ -6641,7 +6641,7 @@ discard block |
||
6641 | 6641 | $sql .= " WHERE t.fk_pays = c.rowid"; |
6642 | 6642 | $sql .= " AND t.active > 0"; |
6643 | 6643 | $sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
6644 | - $sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")"; |
|
6644 | + $sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")"; |
|
6645 | 6645 | $sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC"; |
6646 | 6646 | |
6647 | 6647 | $resql = $this->db->query($sql); |
@@ -6653,30 +6653,30 @@ discard block |
||
6653 | 6653 | |
6654 | 6654 | $tmparray = array(); |
6655 | 6655 | $tmparray['rowid'] = $obj->rowid; |
6656 | - $tmparray['type_vat'] = $obj->type_vat; |
|
6657 | - $tmparray['code'] = $obj->code; |
|
6656 | + $tmparray['type_vat'] = $obj->type_vat; |
|
6657 | + $tmparray['code'] = $obj->code; |
|
6658 | 6658 | $tmparray['txtva'] = $obj->taux; |
6659 | - $tmparray['nprtva'] = $obj->recuperableonly; |
|
6659 | + $tmparray['nprtva'] = $obj->recuperableonly; |
|
6660 | 6660 | $tmparray['localtax1'] = $obj->localtax1; |
6661 | 6661 | $tmparray['localtax1_type'] = $obj->localtax1_type; |
6662 | 6662 | $tmparray['localtax2'] = $obj->localtax2; |
6663 | 6663 | $tmparray['localtax2_type'] = $obj->localtax1_type; |
6664 | - $tmparray['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or * |
|
6665 | - $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 |
|
6664 | + $tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or * |
|
6665 | + $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 |
|
6666 | 6666 | $positiverates = ''; |
6667 | 6667 | if ($obj->taux) { |
6668 | - $positiverates .= ($positiverates ? '/' : '') . $obj->taux; |
|
6668 | + $positiverates .= ($positiverates ? '/' : '').$obj->taux; |
|
6669 | 6669 | } |
6670 | 6670 | if ($obj->localtax1) { |
6671 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax1; |
|
6671 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax1; |
|
6672 | 6672 | } |
6673 | 6673 | if ($obj->localtax2) { |
6674 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax2; |
|
6674 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax2; |
|
6675 | 6675 | } |
6676 | 6676 | if (empty($positiverates)) { |
6677 | 6677 | $positiverates = '0'; |
6678 | 6678 | } |
6679 | - $tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
6679 | + $tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
6680 | 6680 | |
6681 | 6681 | $this->cache_vatrates[$obj->rowid] = $tmparray; |
6682 | 6682 | } |
@@ -6696,7 +6696,7 @@ discard block |
||
6696 | 6696 | return -1; |
6697 | 6697 | } |
6698 | 6698 | } else { |
6699 | - $this->error = '<span class="error">' . $this->db->error() . '</span>'; |
|
6699 | + $this->error = '<span class="error">'.$this->db->error().'</span>'; |
|
6700 | 6700 | return -2; |
6701 | 6701 | } |
6702 | 6702 | } |
@@ -6749,9 +6749,9 @@ discard block |
||
6749 | 6749 | // Check parameters |
6750 | 6750 | if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { |
6751 | 6751 | if ($societe_vendeuse->id == $mysoc->id) { |
6752 | - $return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>'; |
|
6752 | + $return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>'; |
|
6753 | 6753 | } else { |
6754 | - $return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>'; |
|
6754 | + $return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>'; |
|
6755 | 6755 | } |
6756 | 6756 | return $return; |
6757 | 6757 | } |
@@ -6763,12 +6763,12 @@ discard block |
||
6763 | 6763 | // Define list of countries to use to search VAT rates to show |
6764 | 6764 | // First we defined code_country to use to find list |
6765 | 6765 | if (is_object($societe_vendeuse)) { |
6766 | - $code_country = "'" . $societe_vendeuse->country_code . "'"; |
|
6766 | + $code_country = "'".$societe_vendeuse->country_code."'"; |
|
6767 | 6767 | } else { |
6768 | - $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente |
|
6768 | + $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente |
|
6769 | 6769 | } |
6770 | 6770 | if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on |
6771 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
6771 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
6772 | 6772 | // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries |
6773 | 6773 | // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country |
6774 | 6774 | $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); |
@@ -6778,27 +6778,27 @@ discard block |
||
6778 | 6778 | if ($type == 1) { // We know product is a service |
6779 | 6779 | switch ($selectVatComboMode) { |
6780 | 6780 | case '1': |
6781 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6781 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
6782 | 6782 | break; |
6783 | 6783 | case '2': |
6784 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
6784 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
6785 | 6785 | break; |
6786 | 6786 | } |
6787 | 6787 | } |
6788 | 6788 | } elseif (!$idprod) { // We don't know type of product |
6789 | 6789 | switch ($selectVatComboMode) { |
6790 | 6790 | case '1': |
6791 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6791 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
6792 | 6792 | break; |
6793 | 6793 | case '2': |
6794 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
6794 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
6795 | 6795 | break; |
6796 | 6796 | } |
6797 | 6797 | } else { |
6798 | 6798 | $prodstatic = new Product($this->db); |
6799 | 6799 | $prodstatic->fetch($idprod); |
6800 | 6800 | if ($prodstatic->type == Product::TYPE_SERVICE) { // We know product is a service |
6801 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6801 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
6802 | 6802 | } |
6803 | 6803 | } |
6804 | 6804 | } |
@@ -6860,13 +6860,13 @@ discard block |
||
6860 | 6860 | // Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead |
6861 | 6861 | // of using supplier invoices (this is a very bad idea !) |
6862 | 6862 | if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) { |
6863 | - $title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"'; |
|
6863 | + $title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"'; |
|
6864 | 6864 | $disabled = true; |
6865 | 6865 | } |
6866 | 6866 | } |
6867 | 6867 | |
6868 | 6868 | if (!$options_only) { |
6869 | - $return .= '<select class="flat minwidth75imp maxwidth100 right" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>'; |
|
6869 | + $return .= '<select class="flat minwidth75imp maxwidth100 right" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>'; |
|
6870 | 6870 | } |
6871 | 6871 | |
6872 | 6872 | $selectedfound = false; |
@@ -6880,13 +6880,13 @@ discard block |
||
6880 | 6880 | $key = $rate['txtva']; |
6881 | 6881 | $key .= $rate['nprtva'] ? '*' : ''; |
6882 | 6882 | if ($mode > 0 && $rate['code']) { |
6883 | - $key .= ' (' . $rate['code'] . ')'; |
|
6883 | + $key .= ' ('.$rate['code'].')'; |
|
6884 | 6884 | } |
6885 | 6885 | if ($mode < 0) { |
6886 | 6886 | $key = $rate['rowid']; |
6887 | 6887 | } |
6888 | 6888 | |
6889 | - $return .= '<option value="' . $key . '"'; |
|
6889 | + $return .= '<option value="'.$key.'"'; |
|
6890 | 6890 | if (!$selectedfound) { |
6891 | 6891 | if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag |
6892 | 6892 | if ($defaultcode == $rate['code']) { |
@@ -6957,7 +6957,7 @@ discard block |
||
6957 | 6957 | 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 = '') |
6958 | 6958 | { |
6959 | 6959 | // phpcs:enable |
6960 | - dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
6960 | + dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
6961 | 6961 | $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); |
6962 | 6962 | if (!empty($nooutput)) { |
6963 | 6963 | return $retstring; |
@@ -6986,11 +6986,11 @@ discard block |
||
6986 | 6986 | { |
6987 | 6987 | global $langs; |
6988 | 6988 | |
6989 | - $ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
6989 | + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
6990 | 6990 | if ($forcenewline) { |
6991 | 6991 | $ret .= '<br>'; |
6992 | 6992 | } |
6993 | - $ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
6993 | + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
6994 | 6994 | return $ret; |
6995 | 6995 | } |
6996 | 6996 | |
@@ -7056,7 +7056,7 @@ discard block |
||
7056 | 7056 | $orig_set_time = $set_time; |
7057 | 7057 | |
7058 | 7058 | if ($set_time === '' && $emptydate == 0) { |
7059 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
7059 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
7060 | 7060 | if ($gm == 'tzuser' || $gm == 'tzuserrel') { |
7061 | 7061 | $set_time = dol_now($gm); |
7062 | 7062 | } else { |
@@ -7128,38 +7128,38 @@ discard block |
||
7128 | 7128 | // Calendrier popup version eldy |
7129 | 7129 | if ($usecalendar == "eldy") { |
7130 | 7130 | // Input area to enter date manually |
7131 | - $retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate center" maxlength="11" value="' . $formated_date . '"'; |
|
7131 | + $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"'; |
|
7132 | 7132 | $retstring .= ($disabled ? ' disabled' : ''); |
7133 | - $retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
7133 | + $retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
7134 | 7134 | $retstring .= ' autocomplete="off">'; |
7135 | 7135 | |
7136 | 7136 | // Icon calendar |
7137 | 7137 | $retstringbuttom = ''; |
7138 | 7138 | if (!$disabled) { |
7139 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"'; |
|
7140 | - $base = DOL_URL_ROOT . '/core/'; |
|
7141 | - $retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"'; |
|
7142 | - $retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
7139 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"'; |
|
7140 | + $base = DOL_URL_ROOT.'/core/'; |
|
7141 | + $retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"'; |
|
7142 | + $retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>'; |
|
7143 | 7143 | } else { |
7144 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
7144 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
7145 | 7145 | } |
7146 | - $retstring = $retstringbuttom . $retstring; |
|
7146 | + $retstring = $retstringbuttom.$retstring; |
|
7147 | 7147 | |
7148 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
7149 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
7150 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
7148 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
7149 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
7150 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
7151 | 7151 | } elseif ($usecalendar == 'jquery' || $usecalendar == 'html') { |
7152 | 7152 | if (!$disabled && $usecalendar != 'html') { |
7153 | 7153 | // Output javascript for datepicker |
7154 | 7154 | $minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100)); |
7155 | 7155 | $maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100)); |
7156 | 7156 | |
7157 | - $retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">'; |
|
7158 | - $retstring .= "$(function(){ $('#" . $prefix . "').datepicker({ |
|
7159 | - dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "', |
|
7157 | + $retstring .= '<script nonce="'.getNonce().'" type="text/javascript">'; |
|
7158 | + $retstring .= "$(function(){ $('#".$prefix."').datepicker({ |
|
7159 | + dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."', |
|
7160 | 7160 | autoclose: true, |
7161 | 7161 | todayHighlight: true, |
7162 | - yearRange: '" . $minYear . ":" . $maxYear . "',"; |
|
7162 | + yearRange: '" . $minYear.":".$maxYear."',"; |
|
7163 | 7163 | if (!empty($conf->dol_use_jmobile)) { |
7164 | 7164 | $retstring .= " |
7165 | 7165 | beforeShow: function (input, datePicker) { |
@@ -7174,7 +7174,7 @@ discard block |
||
7174 | 7174 | if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) { |
7175 | 7175 | $retstring .= " |
7176 | 7176 | showOn: 'button', /* both has problem with autocompletion */ |
7177 | - buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png', |
|
7177 | + buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png', |
|
7178 | 7178 | buttonImageOnly: true"; |
7179 | 7179 | } |
7180 | 7180 | $retstring .= " |
@@ -7186,46 +7186,46 @@ discard block |
||
7186 | 7186 | $retstring .= '<div class="nowraponall inline-block divfordateinput">'; |
7187 | 7187 | $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"'; |
7188 | 7188 | $retstring .= ($disabled ? ' disabled' : ''); |
7189 | - $retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : ''); |
|
7190 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
7189 | + $retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : ''); |
|
7190 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
7191 | 7191 | $retstring .= ' autocomplete="off">'; |
7192 | 7192 | |
7193 | 7193 | // Icone calendrier |
7194 | 7194 | if ($disabled) { |
7195 | - $retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
7196 | - $retstring = $retstringbutton . $retstring; |
|
7195 | + $retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
7196 | + $retstring = $retstringbutton.$retstring; |
|
7197 | 7197 | } |
7198 | 7198 | |
7199 | 7199 | $retstring .= '</div>'; |
7200 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
7201 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
7202 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
7200 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
7201 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
7202 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
7203 | 7203 | } else { |
7204 | 7204 | $retstring .= "Bad value of MAIN_POPUP_CALENDAR"; |
7205 | 7205 | } |
7206 | 7206 | } else { |
7207 | 7207 | // Show date with combo selects |
7208 | 7208 | // Day |
7209 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">'; |
|
7209 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">'; |
|
7210 | 7210 | |
7211 | 7211 | if ($emptydate || $set_time == -1) { |
7212 | 7212 | $retstring .= '<option value="0" selected> </option>'; |
7213 | 7213 | } |
7214 | 7214 | |
7215 | 7215 | for ($day = 1; $day <= 31; $day++) { |
7216 | - $retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>'; |
|
7216 | + $retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>'; |
|
7217 | 7217 | } |
7218 | 7218 | |
7219 | 7219 | $retstring .= "</select>"; |
7220 | 7220 | |
7221 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">'; |
|
7221 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">'; |
|
7222 | 7222 | if ($emptydate || $set_time == -1) { |
7223 | 7223 | $retstring .= '<option value="0" selected> </option>'; |
7224 | 7224 | } |
7225 | 7225 | |
7226 | 7226 | // Month |
7227 | 7227 | for ($month = 1; $month <= 12; $month++) { |
7228 | - $retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>'; |
|
7228 | + $retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>'; |
|
7229 | 7229 | $retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b"); |
7230 | 7230 | $retstring .= "</option>"; |
7231 | 7231 | } |
@@ -7233,13 +7233,13 @@ discard block |
||
7233 | 7233 | |
7234 | 7234 | // Year |
7235 | 7235 | if ($emptydate || $set_time == -1) { |
7236 | - $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 . '">'; |
|
7236 | + $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.'">'; |
|
7237 | 7237 | } else { |
7238 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">'; |
|
7238 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">'; |
|
7239 | 7239 | |
7240 | 7240 | $syear = (int) $syear; |
7241 | 7241 | for ($year = $syear - 10; $year < (int) $syear + 10; $year++) { |
7242 | - $retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>'; |
|
7242 | + $retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>'; |
|
7243 | 7243 | } |
7244 | 7244 | $retstring .= "</select>\n"; |
7245 | 7245 | } |
@@ -7263,15 +7263,15 @@ discard block |
||
7263 | 7263 | } |
7264 | 7264 | } |
7265 | 7265 | // Show hour |
7266 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">'; |
|
7266 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; |
|
7267 | 7267 | if ($emptyhours) { |
7268 | 7268 | $retstring .= '<option value="-1"> </option>'; |
7269 | 7269 | } |
7270 | 7270 | for ($hour = $hourstart; $hour < $hourend; $hour++) { |
7271 | 7271 | if (strlen($hour) < 2) { |
7272 | - $hour = "0" . $hour; |
|
7272 | + $hour = "0".$hour; |
|
7273 | 7273 | } |
7274 | - $retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour; |
|
7274 | + $retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour; |
|
7275 | 7275 | //$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H'); |
7276 | 7276 | $retstring .= '</option>'; |
7277 | 7277 | } |
@@ -7284,17 +7284,17 @@ discard block |
||
7284 | 7284 | |
7285 | 7285 | if ($m) { |
7286 | 7286 | // Show minutes |
7287 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">'; |
|
7287 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">'; |
|
7288 | 7288 | if ($emptyhours) { |
7289 | 7289 | $retstring .= '<option value="-1"> </option>'; |
7290 | 7290 | } |
7291 | 7291 | for ($min = 0; $min < 60; $min += $stepminutes) { |
7292 | 7292 | $min_str = sprintf("%02d", $min); |
7293 | - $retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>'; |
|
7293 | + $retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>'; |
|
7294 | 7294 | } |
7295 | 7295 | $retstring .= '</select>'; |
7296 | 7296 | |
7297 | - $retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">'; |
|
7297 | + $retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">'; |
|
7298 | 7298 | } |
7299 | 7299 | |
7300 | 7300 | if ($d && $h) { |
@@ -7317,10 +7317,10 @@ discard block |
||
7317 | 7317 | |
7318 | 7318 | // Generate the date part, depending on the use or not of the javascript calendar |
7319 | 7319 | if ($addnowlink == 1) { // server time expressed in user time setup |
7320 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
7321 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
7322 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
7323 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
7320 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
7321 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
7322 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
7323 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
7324 | 7324 | } elseif ($addnowlink == 2) { |
7325 | 7325 | /* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix. |
7326 | 7326 | * This break application for foreign languages. |
@@ -7329,10 +7329,10 @@ discard block |
||
7329 | 7329 | $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);'; |
7330 | 7330 | $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());'; |
7331 | 7331 | */ |
7332 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
7333 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
7334 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
7335 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
7332 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
7333 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
7334 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
7335 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
7336 | 7336 | } |
7337 | 7337 | /*if ($usecalendar == "eldy") |
7338 | 7338 | { |
@@ -7352,11 +7352,11 @@ discard block |
||
7352 | 7352 | } |
7353 | 7353 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; |
7354 | 7354 | if ($addnowlink == 1) { |
7355 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
7356 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
7355 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
7356 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
7357 | 7357 | } elseif ($addnowlink == 2) { |
7358 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());'; |
|
7359 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
7358 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; |
|
7359 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
7360 | 7360 | } |
7361 | 7361 | |
7362 | 7362 | if ($fullday) { |
@@ -7370,11 +7370,11 @@ discard block |
||
7370 | 7370 | } |
7371 | 7371 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; |
7372 | 7372 | if ($addnowlink == 1) { |
7373 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
7374 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
7373 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
7374 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
7375 | 7375 | } elseif ($addnowlink == 2) { |
7376 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());'; |
|
7377 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
7376 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; |
|
7377 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
7378 | 7378 | } |
7379 | 7379 | if ($fullday) { |
7380 | 7380 | $reset_scripts .= ' } '; |
@@ -7382,7 +7382,7 @@ discard block |
||
7382 | 7382 | } |
7383 | 7383 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
7384 | 7384 | if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
7385 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">'; |
|
7385 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">'; |
|
7386 | 7386 | $retstring .= $langs->trans("Now"); |
7387 | 7387 | $retstring .= '</button> '; |
7388 | 7388 | } |
@@ -7394,16 +7394,16 @@ discard block |
||
7394 | 7394 | $reset_scripts = ""; |
7395 | 7395 | |
7396 | 7396 | // Generate the date part, depending on the use or not of the javascript calendar |
7397 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');'; |
|
7398 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
7399 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
7400 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
7397 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');'; |
|
7398 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
7399 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
7400 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
7401 | 7401 | // Update the hour part |
7402 | 7402 | if ($h) { |
7403 | 7403 | if ($fullday) { |
7404 | 7404 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
7405 | 7405 | } |
7406 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
7406 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
7407 | 7407 | if ($fullday) { |
7408 | 7408 | $reset_scripts .= ' } '; |
7409 | 7409 | } |
@@ -7413,14 +7413,14 @@ discard block |
||
7413 | 7413 | if ($fullday) { |
7414 | 7414 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
7415 | 7415 | } |
7416 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
7416 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
7417 | 7417 | if ($fullday) { |
7418 | 7418 | $reset_scripts .= ' } '; |
7419 | 7419 | } |
7420 | 7420 | } |
7421 | 7421 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
7422 | 7422 | if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { |
7423 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">'; |
|
7423 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">'; |
|
7424 | 7424 | $retstring .= $langs->trans("DateStartPlusOne"); |
7425 | 7425 | $retstring .= '</button> '; |
7426 | 7426 | } |
@@ -7478,17 +7478,17 @@ discard block |
||
7478 | 7478 | unset($TDurationTypes[$value]); |
7479 | 7479 | } |
7480 | 7480 | |
7481 | - $retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">'; |
|
7481 | + $retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; |
|
7482 | 7482 | foreach ($TDurationTypes as $key => $typeduration) { |
7483 | - $retstring .= '<option value="' . $key . '"'; |
|
7483 | + $retstring .= '<option value="'.$key.'"'; |
|
7484 | 7484 | if ($key == $selected) { |
7485 | 7485 | $retstring .= " selected"; |
7486 | 7486 | } |
7487 | - $retstring .= ">" . $typeduration . "</option>"; |
|
7487 | + $retstring .= ">".$typeduration."</option>"; |
|
7488 | 7488 | } |
7489 | 7489 | $retstring .= "</select>"; |
7490 | 7490 | |
7491 | - $retstring .= ajax_combobox('select_' . $prefix . 'type_duration'); |
|
7491 | + $retstring .= ajax_combobox('select_'.$prefix.'type_duration'); |
|
7492 | 7492 | |
7493 | 7493 | return $retstring; |
7494 | 7494 | } |
@@ -7520,30 +7520,30 @@ discard block |
||
7520 | 7520 | |
7521 | 7521 | // Hours |
7522 | 7522 | if ($iSecond != '') { |
7523 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
7523 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
7524 | 7524 | |
7525 | 7525 | $hourSelected = convertSecondToTime($iSecond, 'allhour'); |
7526 | 7526 | $minSelected = convertSecondToTime($iSecond, 'min'); |
7527 | 7527 | } |
7528 | 7528 | |
7529 | 7529 | if ($typehour == 'select') { |
7530 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>'; |
|
7530 | + $retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>'; |
|
7531 | 7531 | for ($hour = 0; $hour < 25; $hour++) { // For a duration, we allow 24 hours |
7532 | - $retstring .= '<option value="' . $hour . '"'; |
|
7532 | + $retstring .= '<option value="'.$hour.'"'; |
|
7533 | 7533 | if (is_numeric($hourSelected) && $hourSelected == $hour) { |
7534 | 7534 | $retstring .= " selected"; |
7535 | 7535 | } |
7536 | - $retstring .= ">" . $hour . "</option>"; |
|
7536 | + $retstring .= ">".$hour."</option>"; |
|
7537 | 7537 | } |
7538 | 7538 | $retstring .= "</select>"; |
7539 | 7539 | } elseif ($typehour == 'text' || $typehour == 'textselect') { |
7540 | - $retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">'; |
|
7540 | + $retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">'; |
|
7541 | 7541 | } else { |
7542 | 7542 | return 'BadValueForParameterTypeHour'; |
7543 | 7543 | } |
7544 | 7544 | |
7545 | 7545 | if ($typehour != 'text') { |
7546 | - $retstring .= ' ' . $langs->trans('HourShort'); |
|
7546 | + $retstring .= ' '.$langs->trans('HourShort'); |
|
7547 | 7547 | } else { |
7548 | 7548 | $retstring .= '<span class="">:</span>'; |
7549 | 7549 | } |
@@ -7558,21 +7558,21 @@ discard block |
||
7558 | 7558 | } |
7559 | 7559 | |
7560 | 7560 | if ($typehour == 'select' || $typehour == 'textselect') { |
7561 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>'; |
|
7561 | + $retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>'; |
|
7562 | 7562 | for ($min = 0; $min <= 55; $min += 5) { |
7563 | - $retstring .= '<option value="' . $min . '"'; |
|
7563 | + $retstring .= '<option value="'.$min.'"'; |
|
7564 | 7564 | if (is_numeric($minSelected) && $minSelected == $min) { |
7565 | 7565 | $retstring .= ' selected'; |
7566 | 7566 | } |
7567 | - $retstring .= '>' . $min . '</option>'; |
|
7567 | + $retstring .= '>'.$min.'</option>'; |
|
7568 | 7568 | } |
7569 | 7569 | $retstring .= "</select>"; |
7570 | 7570 | } elseif ($typehour == 'text') { |
7571 | - $retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">'; |
|
7571 | + $retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">'; |
|
7572 | 7572 | } |
7573 | 7573 | |
7574 | 7574 | if ($typehour != 'text') { |
7575 | - $retstring .= ' ' . $langs->trans('MinuteShort'); |
|
7575 | + $retstring .= ' '.$langs->trans('MinuteShort'); |
|
7576 | 7576 | } |
7577 | 7577 | |
7578 | 7578 | $retstring .= "</span>"; |
@@ -7620,7 +7620,7 @@ discard block |
||
7620 | 7620 | $placeholder = ''; |
7621 | 7621 | |
7622 | 7622 | if ($selected && empty($selected_input_value)) { |
7623 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
7623 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
7624 | 7624 | $tickettmpselect = new Ticket($this->db); |
7625 | 7625 | $tickettmpselect->fetch($selected); |
7626 | 7626 | $selected_input_value = $tickettmpselect->ref; |
@@ -7628,17 +7628,17 @@ discard block |
||
7628 | 7628 | } |
7629 | 7629 | |
7630 | 7630 | $urloption = ''; |
7631 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7631 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7632 | 7632 | |
7633 | 7633 | if (empty($hidelabel)) { |
7634 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
7634 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
7635 | 7635 | } elseif ($hidelabel > 1) { |
7636 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
7636 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
7637 | 7637 | if ($hidelabel == 2) { |
7638 | 7638 | $out .= img_picto($langs->trans("Search"), 'search'); |
7639 | 7639 | } |
7640 | 7640 | } |
7641 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
7641 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
7642 | 7642 | if ($hidelabel == 3) { |
7643 | 7643 | $out .= img_picto($langs->trans("Search"), 'search'); |
7644 | 7644 | } |
@@ -7682,8 +7682,8 @@ discard block |
||
7682 | 7682 | |
7683 | 7683 | $sql = "SELECT "; |
7684 | 7684 | $sql .= $selectFields; |
7685 | - $sql .= " FROM " . $this->db->prefix() . "ticket as p"; |
|
7686 | - $sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')'; |
|
7685 | + $sql .= " FROM ".$this->db->prefix()."ticket as p"; |
|
7686 | + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; |
|
7687 | 7687 | |
7688 | 7688 | // Add criteria on ref/label |
7689 | 7689 | if ($filterkey != '') { |
@@ -7699,7 +7699,7 @@ discard block |
||
7699 | 7699 | if ($i > 0) { |
7700 | 7700 | $sql .= " AND "; |
7701 | 7701 | } |
7702 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
7702 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
7703 | 7703 | $sql .= ")"; |
7704 | 7704 | $i++; |
7705 | 7705 | } |
@@ -7712,22 +7712,22 @@ discard block |
||
7712 | 7712 | $sql .= $this->db->plimit($limit, 0); |
7713 | 7713 | |
7714 | 7714 | // Build output string |
7715 | - dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG); |
|
7715 | + dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); |
|
7716 | 7716 | $result = $this->db->query($sql); |
7717 | 7717 | if ($result) { |
7718 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
7719 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; |
|
7718 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
7719 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; |
|
7720 | 7720 | |
7721 | 7721 | $num = $this->db->num_rows($result); |
7722 | 7722 | |
7723 | 7723 | $events = array(); |
7724 | 7724 | |
7725 | 7725 | if (!$forcecombo) { |
7726 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
7726 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
7727 | 7727 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt('TICKET_USE_SEARCH_TO_SELECT')); |
7728 | 7728 | } |
7729 | 7729 | |
7730 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
7730 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
7731 | 7731 | |
7732 | 7732 | $textifempty = ''; |
7733 | 7733 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7744,7 +7744,7 @@ discard block |
||
7744 | 7744 | } |
7745 | 7745 | } |
7746 | 7746 | if ($showempty) { |
7747 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
7747 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
7748 | 7748 | } |
7749 | 7749 | |
7750 | 7750 | $i = 0; |
@@ -7798,13 +7798,13 @@ discard block |
||
7798 | 7798 | $outkey = $objp->rowid; |
7799 | 7799 | $outref = $objp->ref; |
7800 | 7800 | |
7801 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
7801 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
7802 | 7802 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
7803 | 7803 | $opt .= '>'; |
7804 | 7804 | $opt .= $objp->ref; |
7805 | 7805 | $objRef = $objp->ref; |
7806 | 7806 | if (!empty($filterkey) && $filterkey != '') { |
7807 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
7807 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
7808 | 7808 | } |
7809 | 7809 | |
7810 | 7810 | $opt .= "</option>\n"; |
@@ -7845,7 +7845,7 @@ discard block |
||
7845 | 7845 | $placeholder = ''; |
7846 | 7846 | |
7847 | 7847 | if ($selected && empty($selected_input_value)) { |
7848 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
7848 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
7849 | 7849 | $projecttmpselect = new Project($this->db); |
7850 | 7850 | $projecttmpselect->fetch($selected); |
7851 | 7851 | $selected_input_value = $projecttmpselect->ref; |
@@ -7853,17 +7853,17 @@ discard block |
||
7853 | 7853 | } |
7854 | 7854 | |
7855 | 7855 | $urloption = ''; |
7856 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7856 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7857 | 7857 | |
7858 | 7858 | if (empty($hidelabel)) { |
7859 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
7859 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
7860 | 7860 | } elseif ($hidelabel > 1) { |
7861 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
7861 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
7862 | 7862 | if ($hidelabel == 2) { |
7863 | 7863 | $out .= img_picto($langs->trans("Search"), 'search'); |
7864 | 7864 | } |
7865 | 7865 | } |
7866 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
7866 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
7867 | 7867 | if ($hidelabel == 3) { |
7868 | 7868 | $out .= img_picto($langs->trans("Search"), 'search'); |
7869 | 7869 | } |
@@ -7906,8 +7906,8 @@ discard block |
||
7906 | 7906 | |
7907 | 7907 | $sql = "SELECT "; |
7908 | 7908 | $sql .= $selectFields; |
7909 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
7910 | - $sql .= ' WHERE p.entity IN (' . getEntity('project') . ')'; |
|
7909 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
7910 | + $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; |
|
7911 | 7911 | |
7912 | 7912 | // Add criteria on ref/label |
7913 | 7913 | if ($filterkey != '') { |
@@ -7923,7 +7923,7 @@ discard block |
||
7923 | 7923 | if ($i > 0) { |
7924 | 7924 | $sql .= " AND "; |
7925 | 7925 | } |
7926 | - $sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
7926 | + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
7927 | 7927 | $sql .= ""; |
7928 | 7928 | $i++; |
7929 | 7929 | } |
@@ -7936,22 +7936,22 @@ discard block |
||
7936 | 7936 | $sql .= $this->db->plimit($limit, 0); |
7937 | 7937 | |
7938 | 7938 | // Build output string |
7939 | - dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG); |
|
7939 | + dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); |
|
7940 | 7940 | $result = $this->db->query($sql); |
7941 | 7941 | if ($result) { |
7942 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
7943 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
7942 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
7943 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
7944 | 7944 | |
7945 | 7945 | $num = $this->db->num_rows($result); |
7946 | 7946 | |
7947 | 7947 | $events = array(); |
7948 | 7948 | |
7949 | 7949 | if (!$forcecombo) { |
7950 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
7950 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
7951 | 7951 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT')); |
7952 | 7952 | } |
7953 | 7953 | |
7954 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
7954 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
7955 | 7955 | |
7956 | 7956 | $textifempty = ''; |
7957 | 7957 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7968,7 +7968,7 @@ discard block |
||
7968 | 7968 | } |
7969 | 7969 | } |
7970 | 7970 | if ($showempty) { |
7971 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
7971 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
7972 | 7972 | } |
7973 | 7973 | |
7974 | 7974 | $i = 0; |
@@ -8026,13 +8026,13 @@ discard block |
||
8026 | 8026 | $outlabel = $objp->label; |
8027 | 8027 | $outtype = $objp->fk_product_type; |
8028 | 8028 | |
8029 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
8029 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
8030 | 8030 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
8031 | 8031 | $opt .= '>'; |
8032 | 8032 | $opt .= $objp->ref; |
8033 | 8033 | $objRef = $objp->ref; |
8034 | 8034 | if (!empty($filterkey) && $filterkey != '') { |
8035 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
8035 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
8036 | 8036 | } |
8037 | 8037 | |
8038 | 8038 | $opt .= "</option>\n"; |
@@ -8074,7 +8074,7 @@ discard block |
||
8074 | 8074 | $placeholder = ''; |
8075 | 8075 | |
8076 | 8076 | if ($selected && empty($selected_input_value)) { |
8077 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
8077 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
8078 | 8078 | $adherenttmpselect = new Adherent($this->db); |
8079 | 8079 | $adherenttmpselect->fetch($selected); |
8080 | 8080 | $selected_input_value = $adherenttmpselect->ref; |
@@ -8083,17 +8083,17 @@ discard block |
||
8083 | 8083 | |
8084 | 8084 | $urloption = ''; |
8085 | 8085 | |
8086 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
8086 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
8087 | 8087 | |
8088 | 8088 | if (empty($hidelabel)) { |
8089 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
8089 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
8090 | 8090 | } elseif ($hidelabel > 1) { |
8091 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
8091 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
8092 | 8092 | if ($hidelabel == 2) { |
8093 | 8093 | $out .= img_picto($langs->trans("Search"), 'search'); |
8094 | 8094 | } |
8095 | 8095 | } |
8096 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
8096 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
8097 | 8097 | if ($hidelabel == 3) { |
8098 | 8098 | $out .= img_picto($langs->trans("Search"), 'search'); |
8099 | 8099 | } |
@@ -8138,8 +8138,8 @@ discard block |
||
8138 | 8138 | |
8139 | 8139 | $sql = "SELECT "; |
8140 | 8140 | $sql .= $selectFields; |
8141 | - $sql .= " FROM " . $this->db->prefix() . "adherent as p"; |
|
8142 | - $sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')'; |
|
8141 | + $sql .= " FROM ".$this->db->prefix()."adherent as p"; |
|
8142 | + $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; |
|
8143 | 8143 | |
8144 | 8144 | // Add criteria on ref/label |
8145 | 8145 | if ($filterkey != '') { |
@@ -8155,8 +8155,8 @@ discard block |
||
8155 | 8155 | if ($i > 0) { |
8156 | 8156 | $sql .= " AND "; |
8157 | 8157 | } |
8158 | - $sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
8159 | - $sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
8158 | + $sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
8159 | + $sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
8160 | 8160 | $i++; |
8161 | 8161 | } |
8162 | 8162 | if (count($search_crit) > 1) { |
@@ -8165,27 +8165,27 @@ discard block |
||
8165 | 8165 | $sql .= ')'; |
8166 | 8166 | } |
8167 | 8167 | if ($status != -1) { |
8168 | - $sql .= ' AND statut = ' . ((int) $status); |
|
8168 | + $sql .= ' AND statut = '.((int) $status); |
|
8169 | 8169 | } |
8170 | 8170 | $sql .= $this->db->plimit($limit, 0); |
8171 | 8171 | |
8172 | 8172 | // Build output string |
8173 | - dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG); |
|
8173 | + dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); |
|
8174 | 8174 | $result = $this->db->query($sql); |
8175 | 8175 | if ($result) { |
8176 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
8177 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php'; |
|
8176 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
8177 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; |
|
8178 | 8178 | |
8179 | 8179 | $num = $this->db->num_rows($result); |
8180 | 8180 | |
8181 | 8181 | $events = array(); |
8182 | 8182 | |
8183 | 8183 | if (!$forcecombo) { |
8184 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
8184 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
8185 | 8185 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); |
8186 | 8186 | } |
8187 | 8187 | |
8188 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
8188 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
8189 | 8189 | |
8190 | 8190 | $textifempty = ''; |
8191 | 8191 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -8202,7 +8202,7 @@ discard block |
||
8202 | 8202 | } |
8203 | 8203 | } |
8204 | 8204 | if ($showempty) { |
8205 | - $out .= '<option value="-1" selected>' . $textifempty . '</option>'; |
|
8205 | + $out .= '<option value="-1" selected>'.$textifempty.'</option>'; |
|
8206 | 8206 | } |
8207 | 8207 | |
8208 | 8208 | $i = 0; |
@@ -8258,11 +8258,11 @@ discard block |
||
8258 | 8258 | $outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname); |
8259 | 8259 | $outtype = $objp->fk_adherent_type; |
8260 | 8260 | |
8261 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
8261 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
8262 | 8262 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
8263 | 8263 | $opt .= '>'; |
8264 | 8264 | if (!empty($filterkey) && $filterkey != '') { |
8265 | - $outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1); |
|
8265 | + $outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1); |
|
8266 | 8266 | } |
8267 | 8267 | $opt .= $outlabel; |
8268 | 8268 | $opt .= "</option>\n"; |
@@ -8317,8 +8317,8 @@ discard block |
||
8317 | 8317 | $objecttmp = null; |
8318 | 8318 | $InfoFieldList = array(); |
8319 | 8319 | $classname = ''; |
8320 | - $filter = ''; // Ensure filter has value (for static analysis) |
|
8321 | - $sortfield = ''; // Ensure filter has value (for static analysis) |
|
8320 | + $filter = ''; // Ensure filter has value (for static analysis) |
|
8321 | + $sortfield = ''; // Ensure filter has value (for static analysis) |
|
8322 | 8322 | |
8323 | 8323 | if ($objectfield) { // We must retrieve the objectdesc from the field or extrafield |
8324 | 8324 | // Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield' |
@@ -8362,9 +8362,9 @@ discard block |
||
8362 | 8362 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
8363 | 8363 | $reg = array(); |
8364 | 8364 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
8365 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
8365 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
8366 | 8366 | } |
8367 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
8367 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
8368 | 8368 | |
8369 | 8369 | $classname = $InfoFieldList[0]; |
8370 | 8370 | $classpath = empty($InfoFieldList[1]) ? '' : $InfoFieldList[1]; |
@@ -8395,8 +8395,8 @@ discard block |
||
8395 | 8395 | ); |
8396 | 8396 | |
8397 | 8397 | if (!is_object($objecttmp)) { |
8398 | - dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING); |
|
8399 | - return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc; |
|
8398 | + dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING); |
|
8399 | + return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc; |
|
8400 | 8400 | } |
8401 | 8401 | '@phan-var-force CommonObject $objecttmp'; |
8402 | 8402 | |
@@ -8408,9 +8408,9 @@ discard block |
||
8408 | 8408 | if ($prefixforautocompletemode == 'product') { |
8409 | 8409 | $prefixforautocompletemode = 'produit'; |
8410 | 8410 | } |
8411 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8411 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8412 | 8412 | |
8413 | - dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG); |
|
8413 | + dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG); |
|
8414 | 8414 | |
8415 | 8415 | // Generate the combo HTML component |
8416 | 8416 | $out = ''; |
@@ -8439,13 +8439,13 @@ discard block |
||
8439 | 8439 | } |
8440 | 8440 | |
8441 | 8441 | // Set url and param to call to get json of the search results |
8442 | - $urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php'; |
|
8443 | - $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); |
|
8442 | + $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; |
|
8443 | + $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : ''); |
|
8444 | 8444 | |
8445 | 8445 | // Activate the auto complete using ajax call. |
8446 | 8446 | $out .= ajax_autocompleter((string) $preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalInt($confkeyforautocompletemode), 0); |
8447 | 8447 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
8448 | - $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) . '"' : '') . ' />'; |
|
8448 | + $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).'"' : '').' />'; |
|
8449 | 8449 | } else { |
8450 | 8450 | // Immediate load of table record. |
8451 | 8451 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -8485,16 +8485,16 @@ discard block |
||
8485 | 8485 | if ($prefixforautocompletemode == 'societe') { |
8486 | 8486 | $prefixforautocompletemode = 'company'; |
8487 | 8487 | } |
8488 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8488 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8489 | 8489 | |
8490 | 8490 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
8491 | 8491 | $tmpfieldstoshow = ''; |
8492 | 8492 | foreach ($objecttmp->fields as $key => $val) { |
8493 | - if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
8493 | + if (!(int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
8494 | 8494 | continue; |
8495 | 8495 | } |
8496 | 8496 | if (!empty($val['showoncombobox'])) { |
8497 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
8497 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
8498 | 8498 | } |
8499 | 8499 | } |
8500 | 8500 | if ($tmpfieldstoshow) { |
@@ -8522,18 +8522,18 @@ discard block |
||
8522 | 8522 | $num = 0; |
8523 | 8523 | |
8524 | 8524 | // Search data |
8525 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
8525 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
8526 | 8526 | if (!empty($objecttmp->isextrafieldmanaged)) { |
8527 | - $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; |
|
8527 | + $sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object"; |
|
8528 | 8528 | } |
8529 | 8529 | if (isset($objecttmp->ismultientitymanaged)) { |
8530 | 8530 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
8531 | 8531 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
8532 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
8532 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
8533 | 8533 | } |
8534 | 8534 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
8535 | 8535 | if (!$user->hasRight('societe', 'client', 'voir')) { |
8536 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
8536 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
8537 | 8537 | } |
8538 | 8538 | } |
8539 | 8539 | } |
@@ -8553,21 +8553,21 @@ discard block |
||
8553 | 8553 | $sql .= " WHERE 1=1"; |
8554 | 8554 | if (isset($objecttmp->ismultientitymanaged)) { |
8555 | 8555 | if ($objecttmp->ismultientitymanaged == 1) { |
8556 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
8556 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
8557 | 8557 | } |
8558 | 8558 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
8559 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
8559 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
8560 | 8560 | } |
8561 | 8561 | if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { |
8562 | 8562 | if ($objecttmp->element == 'societe') { |
8563 | - $sql .= " AND t.rowid = " . ((int) $user->socid); |
|
8563 | + $sql .= " AND t.rowid = ".((int) $user->socid); |
|
8564 | 8564 | } else { |
8565 | - $sql .= " AND t.fk_soc = " . ((int) $user->socid); |
|
8565 | + $sql .= " AND t.fk_soc = ".((int) $user->socid); |
|
8566 | 8566 | } |
8567 | 8567 | } |
8568 | 8568 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
8569 | 8569 | if (!$user->hasRight('societe', 'client', 'voir')) { |
8570 | - $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
8570 | + $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
8571 | 8571 | } |
8572 | 8572 | } |
8573 | 8573 | } |
@@ -8579,7 +8579,7 @@ discard block |
||
8579 | 8579 | $errormessage = ''; |
8580 | 8580 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
8581 | 8581 | if ($errormessage) { |
8582 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
8582 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
8583 | 8583 | } |
8584 | 8584 | } |
8585 | 8585 | } |
@@ -8591,7 +8591,7 @@ discard block |
||
8591 | 8591 | $resql = $this->db->query($sql); |
8592 | 8592 | if ($resql) { |
8593 | 8593 | // Construct $out and $outarray |
8594 | - $out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
8594 | + $out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
8595 | 8595 | |
8596 | 8596 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
8597 | 8597 | $textifempty = ' '; |
@@ -8605,7 +8605,7 @@ discard block |
||
8605 | 8605 | } |
8606 | 8606 | } |
8607 | 8607 | if ($showempty) { |
8608 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
8608 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
8609 | 8609 | } |
8610 | 8610 | |
8611 | 8611 | $num = $this->db->num_rows($resql); |
@@ -8628,9 +8628,9 @@ discard block |
||
8628 | 8628 | } |
8629 | 8629 | if (empty($outputmode)) { |
8630 | 8630 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
8631 | - $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>'; |
|
8631 | + $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>'; |
|
8632 | 8632 | } else { |
8633 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
8633 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
8634 | 8634 | } |
8635 | 8635 | } else { |
8636 | 8636 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -8643,10 +8643,10 @@ discard block |
||
8643 | 8643 | } |
8644 | 8644 | } |
8645 | 8645 | |
8646 | - $out .= '</select>' . "\n"; |
|
8646 | + $out .= '</select>'."\n"; |
|
8647 | 8647 | |
8648 | 8648 | if (!$forcecombo) { |
8649 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
8649 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
8650 | 8650 | $out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0)); |
8651 | 8651 | } |
8652 | 8652 | } else { |
@@ -8710,8 +8710,8 @@ discard block |
||
8710 | 8710 | } |
8711 | 8711 | } |
8712 | 8712 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
8713 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"'; |
|
8714 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : ''); |
|
8713 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"'; |
|
8714 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); |
|
8715 | 8715 | $out .= '>'."\n"; |
8716 | 8716 | |
8717 | 8717 | if ($show_empty) { |
@@ -8722,7 +8722,7 @@ discard block |
||
8722 | 8722 | if (!is_numeric($show_empty)) { |
8723 | 8723 | $textforempty = $show_empty; |
8724 | 8724 | } |
8725 | - $out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
8725 | + $out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
8726 | 8726 | } |
8727 | 8727 | if (is_array($array)) { |
8728 | 8728 | // Translate |
@@ -8747,7 +8747,7 @@ discard block |
||
8747 | 8747 | $value = $tmpvalue['label']; |
8748 | 8748 | //$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html']; |
8749 | 8749 | $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; |
8750 | - $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; |
|
8750 | + $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; |
|
8751 | 8751 | } else { |
8752 | 8752 | $value = $tmpvalue; |
8753 | 8753 | //$valuehtml = $tmpvalue; |
@@ -8763,9 +8763,9 @@ discard block |
||
8763 | 8763 | } |
8764 | 8764 | if ($key_in_label) { |
8765 | 8765 | if (empty($nohtmlescape)) { |
8766 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
8766 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
8767 | 8767 | } else { |
8768 | - $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
8768 | + $selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
8769 | 8769 | } |
8770 | 8770 | } else { |
8771 | 8771 | if (empty($nohtmlescape)) { |
@@ -8777,8 +8777,8 @@ discard block |
||
8777 | 8777 | $selectOptionValue = ' '; |
8778 | 8778 | } |
8779 | 8779 | } |
8780 | - $out .= '<option value="' . $key . '"'; |
|
8781 | - $out .= $style . $disabled; |
|
8780 | + $out .= '<option value="'.$key.'"'; |
|
8781 | + $out .= $style.$disabled; |
|
8782 | 8782 | if (is_array($id)) { |
8783 | 8783 | if (in_array($key, $id) && !$disabled) { |
8784 | 8784 | $out .= ' selected'; // To preselect a value |
@@ -8790,7 +8790,7 @@ discard block |
||
8790 | 8790 | } |
8791 | 8791 | } |
8792 | 8792 | if (!empty($nohtmlescape)) { // deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content. |
8793 | - $out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"'; |
|
8793 | + $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"'; |
|
8794 | 8794 | } |
8795 | 8795 | |
8796 | 8796 | if (is_array($tmpvalue)) { |
@@ -8813,7 +8813,7 @@ discard block |
||
8813 | 8813 | // Add code for jquery to use multiselect |
8814 | 8814 | if ($addjscombo && $jsbeautify) { |
8815 | 8815 | // Enhance with select2 |
8816 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
8816 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
8817 | 8817 | $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss); |
8818 | 8818 | } |
8819 | 8819 | |
@@ -8841,28 +8841,28 @@ discard block |
||
8841 | 8841 | public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) |
8842 | 8842 | { |
8843 | 8843 | global $conf, $langs; |
8844 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
8844 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
8845 | 8845 | |
8846 | 8846 | // TODO Use an internal dolibarr component instead of select2 |
8847 | 8847 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
8848 | 8848 | return ''; |
8849 | 8849 | } |
8850 | 8850 | |
8851 | - $out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>'; |
|
8851 | + $out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>'; |
|
8852 | 8852 | |
8853 | 8853 | $outdelayed = ''; |
8854 | 8854 | if (!empty($conf->use_javascript_ajax)) { |
8855 | 8855 | $tmpplugin = 'select2'; |
8856 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
8857 | - <script nonce="' . getNonce() . '"> |
|
8856 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
8857 | + <script nonce="' . getNonce().'"> |
|
8858 | 8858 | $(document).ready(function () { |
8859 | 8859 | |
8860 | - ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . ' |
|
8860 | + ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').' |
|
8861 | 8861 | |
8862 | - $(".' . $htmlname . '").select2({ |
|
8862 | + $(".' . $htmlname.'").select2({ |
|
8863 | 8863 | ajax: { |
8864 | 8864 | dir: "ltr", |
8865 | - url: "' . $url . '", |
|
8865 | + url: "' . $url.'", |
|
8866 | 8866 | dataType: \'json\', |
8867 | 8867 | delay: 250, |
8868 | 8868 | data: function (params) { |
@@ -8889,9 +8889,9 @@ discard block |
||
8889 | 8889 | }, |
8890 | 8890 | language: select2arrayoflanguage, |
8891 | 8891 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
8892 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
8892 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
8893 | 8893 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
8894 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
8894 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
8895 | 8895 | formatResult: function (result, container, query, escapeMarkup) { |
8896 | 8896 | return escapeMarkup(result.text); |
8897 | 8897 | }, |
@@ -8899,10 +8899,10 @@ discard block |
||
8899 | 8899 | |
8900 | 8900 | ' . ($callurlonselect ? ' |
8901 | 8901 | /* Code to execute a GET when we select a value */ |
8902 | - $(".' . $htmlname . '").change(function() { |
|
8903 | - var selected = $(".' . $htmlname . '").val(); |
|
8902 | + $(".' . $htmlname.'").change(function() { |
|
8903 | + var selected = $(".' . $htmlname.'").val(); |
|
8904 | 8904 | console.log("We select in selectArrayAjax the entry "+selected) |
8905 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
8905 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
8906 | 8906 | $.each( saveRemoteData, function( key, value ) { |
8907 | 8907 | if (key == selected) |
8908 | 8908 | { |
@@ -8910,7 +8910,7 @@ discard block |
||
8910 | 8910 | location.assign(value.url); |
8911 | 8911 | } |
8912 | 8912 | }); |
8913 | - });' : '') . ' |
|
8913 | + });' : '').' |
|
8914 | 8914 | |
8915 | 8915 | }); |
8916 | 8916 | </script>'; |
@@ -8946,14 +8946,14 @@ discard block |
||
8946 | 8946 | public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') |
8947 | 8947 | { |
8948 | 8948 | global $conf, $langs; |
8949 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
8949 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
8950 | 8950 | |
8951 | 8951 | // TODO Use an internal dolibarr component instead of select2 |
8952 | 8952 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
8953 | 8953 | return ''; |
8954 | 8954 | } |
8955 | 8955 | |
8956 | - $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
8956 | + $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
8957 | 8957 | |
8958 | 8958 | $formattedarrayresult = array(); |
8959 | 8959 | |
@@ -8968,20 +8968,20 @@ discard block |
||
8968 | 8968 | $outdelayed = ''; |
8969 | 8969 | if (!empty($conf->use_javascript_ajax)) { |
8970 | 8970 | $tmpplugin = 'select2'; |
8971 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
8972 | - <script nonce="' . getNonce() . '"> |
|
8971 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
8972 | + <script nonce="' . getNonce().'"> |
|
8973 | 8973 | $(document).ready(function () { |
8974 | - var data = ' . json_encode($formattedarrayresult) . '; |
|
8974 | + var data = ' . json_encode($formattedarrayresult).'; |
|
8975 | 8975 | |
8976 | - ' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . ' |
|
8976 | + ' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').' |
|
8977 | 8977 | |
8978 | - $(".' . $htmlname . '").select2({ |
|
8978 | + $(".' . $htmlname.'").select2({ |
|
8979 | 8979 | data: data, |
8980 | 8980 | language: select2arrayoflanguage, |
8981 | 8981 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
8982 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
8982 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
8983 | 8983 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
8984 | - minimumInputLength: ' . $minimumInputLength . ', |
|
8984 | + minimumInputLength: ' . $minimumInputLength.', |
|
8985 | 8985 | formatResult: function (result, container, query, escapeMarkup) { |
8986 | 8986 | return escapeMarkup(result.text); |
8987 | 8987 | }, |
@@ -9020,11 +9020,11 @@ discard block |
||
9020 | 9020 | |
9021 | 9021 | ' . ($callurlonselect ? ' |
9022 | 9022 | /* Code to execute a GET when we select a value */ |
9023 | - $(".' . $htmlname . '").change(function() { |
|
9024 | - var selected = $(".' . $htmlname . '").val(); |
|
9023 | + $(".' . $htmlname.'").change(function() { |
|
9024 | + var selected = $(".' . $htmlname.'").val(); |
|
9025 | 9025 | console.log("We select "+selected) |
9026 | 9026 | |
9027 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
9027 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
9028 | 9028 | $.each( saveRemoteData, function( key, value ) { |
9029 | 9029 | if (key == selected) |
9030 | 9030 | { |
@@ -9032,7 +9032,7 @@ discard block |
||
9032 | 9032 | location.assign(value.url); |
9033 | 9033 | } |
9034 | 9034 | }); |
9035 | - });' : '') . ' |
|
9035 | + });' : '').' |
|
9036 | 9036 | |
9037 | 9037 | }); |
9038 | 9038 | </script>'; |
@@ -9081,7 +9081,7 @@ discard block |
||
9081 | 9081 | $useenhancedmultiselect = 0; |
9082 | 9082 | if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { |
9083 | 9083 | if ($addjscombo) { |
9084 | - $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
9084 | + $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
9085 | 9085 | } |
9086 | 9086 | } |
9087 | 9087 | |
@@ -9090,7 +9090,7 @@ discard block |
||
9090 | 9090 | // submitted to nothing. |
9091 | 9091 | $out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">'; |
9092 | 9092 | // Output select component |
9093 | - $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"; |
|
9093 | + $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"; |
|
9094 | 9094 | if (is_array($array) && !empty($array)) { |
9095 | 9095 | if ($value_as_key) { |
9096 | 9096 | $array = array_combine($array, $array); |
@@ -9111,33 +9111,33 @@ discard block |
||
9111 | 9111 | $tmplabelhtml = empty($value['labelhtml']) ? (empty($value['data-html']) ? '' : $value['data-html']) : $value['labelhtml']; |
9112 | 9112 | } |
9113 | 9113 | $newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue); |
9114 | - $newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval); |
|
9114 | + $newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval); |
|
9115 | 9115 | |
9116 | - $out .= '<option value="' . $tmpkey . '"'; |
|
9116 | + $out .= '<option value="'.$tmpkey.'"'; |
|
9117 | 9117 | if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) { |
9118 | 9118 | $out .= ' selected'; |
9119 | 9119 | } |
9120 | 9120 | if (!empty($tmplabelhtml)) { |
9121 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
9121 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
9122 | 9122 | } else { |
9123 | - $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval; |
|
9124 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
9123 | + $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval; |
|
9124 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
9125 | 9125 | } |
9126 | 9126 | $out .= '>'; |
9127 | 9127 | $out .= dol_htmlentitiesbr($newval); |
9128 | - $out .= '</option>' . "\n"; |
|
9128 | + $out .= '</option>'."\n"; |
|
9129 | 9129 | } |
9130 | 9130 | } |
9131 | 9131 | } |
9132 | - $out .= '</select>' . "\n"; |
|
9132 | + $out .= '</select>'."\n"; |
|
9133 | 9133 | |
9134 | 9134 | // Add code for jquery to use multiselect |
9135 | 9135 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) { |
9136 | - $out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->'; |
|
9137 | - $out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n"; |
|
9136 | + $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->'; |
|
9137 | + $out .= "\n".'<script nonce="'.getNonce().'">'."\n"; |
|
9138 | 9138 | if ($addjscombo == 1) { |
9139 | 9139 | $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
9140 | - $out .= 'function formatResult(record, container) {' . "\n"; |
|
9140 | + $out .= 'function formatResult(record, container) {'."\n"; |
|
9141 | 9141 | // If property data-html set, we decode html entities and use this. |
9142 | 9142 | // Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option. |
9143 | 9143 | $out .= ' if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {'; |
@@ -9145,26 +9145,26 @@ discard block |
||
9145 | 9145 | $out .= ' return htmlEntityDecodeJs($(record.element).attr("data-html"));'; |
9146 | 9146 | $out .= ' }'."\n"; |
9147 | 9147 | $out .= ' return record.text;'; |
9148 | - $out .= '}' . "\n"; |
|
9149 | - $out .= 'function formatSelection(record) {' . "\n"; |
|
9148 | + $out .= '}'."\n"; |
|
9149 | + $out .= 'function formatSelection(record) {'."\n"; |
|
9150 | 9150 | if ($elemtype == 'category') { |
9151 | - $out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
9151 | + $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
9152 | 9152 | } else { |
9153 | 9153 | $out .= 'return record.text;'; |
9154 | 9154 | } |
9155 | - $out .= '}' . "\n"; |
|
9155 | + $out .= '}'."\n"; |
|
9156 | 9156 | $out .= '$(document).ready(function () { |
9157 | - $(\'#' . $htmlname . '\').' . $tmpplugin . '({'; |
|
9157 | + $(\'#' . $htmlname.'\').'.$tmpplugin.'({'; |
|
9158 | 9158 | if ($placeholder) { |
9159 | 9159 | $out .= ' |
9160 | 9160 | placeholder: { |
9161 | 9161 | id: \'-1\', |
9162 | - text: \'' . dol_escape_js($placeholder) . '\' |
|
9162 | + text: \'' . dol_escape_js($placeholder).'\' |
|
9163 | 9163 | },'; |
9164 | 9164 | } |
9165 | 9165 | $out .= ' dir: \'ltr\', |
9166 | 9166 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */ |
9167 | - dropdownCssClass: \'' . $morecss . '\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
9167 | + dropdownCssClass: \'' . $morecss.'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
9168 | 9168 | // Specify format function for dropdown item |
9169 | 9169 | formatResult: formatResult, |
9170 | 9170 | templateResult: formatResult, /* For 4.0 */ |
@@ -9176,21 +9176,21 @@ discard block |
||
9176 | 9176 | |
9177 | 9177 | /* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set |
9178 | 9178 | the size only if component is not hidden by default on load */ |
9179 | - $(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\'); |
|
9179 | + $(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\'); |
|
9180 | 9180 | });' . "\n"; |
9181 | 9181 | } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) { |
9182 | 9182 | // Add other js lib |
9183 | 9183 | // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin |
9184 | 9184 | // ... |
9185 | - $out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');'; |
|
9185 | + $out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');'; |
|
9186 | 9186 | $out .= '$(document).ready(function () { |
9187 | - $(\'#' . $htmlname . '\').multiSelect({ |
|
9187 | + $(\'#' . $htmlname.'\').multiSelect({ |
|
9188 | 9188 | containerHTML: \'<div class="multi-select-container">\', |
9189 | 9189 | menuHTML: \'<div class="multi-select-menu">\', |
9190 | - buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\', |
|
9190 | + buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\', |
|
9191 | 9191 | menuItemHTML: \'<label class="multi-select-menuitem">\', |
9192 | 9192 | activeClass: \'multi-select-container--open\', |
9193 | - noneText: \'' . $placeholder . '\' |
|
9193 | + noneText: \'' . $placeholder.'\' |
|
9194 | 9194 | }); |
9195 | 9195 | })'; |
9196 | 9196 | } |
@@ -9223,7 +9223,7 @@ discard block |
||
9223 | 9223 | return ''; |
9224 | 9224 | } |
9225 | 9225 | |
9226 | - $tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show |
|
9226 | + $tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show |
|
9227 | 9227 | |
9228 | 9228 | if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user |
9229 | 9229 | $tmparray = explode(',', $user->conf->$tmpvar); |
@@ -9266,19 +9266,19 @@ discard block |
||
9266 | 9266 | } |
9267 | 9267 | |
9268 | 9268 | // Note: $val['checked'] <> 0 means we must show the field into the combo list @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset |
9269 | - $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>'; |
|
9270 | - $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); |
|
9269 | + $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>'; |
|
9270 | + $listcheckedstring .= (empty($val['checked']) ? '' : $key.','); |
|
9271 | 9271 | } |
9272 | 9272 | } |
9273 | 9273 | |
9274 | - $out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' --> |
|
9274 | + $out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' --> |
|
9275 | 9275 | |
9276 | 9276 | <dl class="dropdown"> |
9277 | 9277 | <dt> |
9278 | - <a href="#' . $htmlname . '"> |
|
9279 | - ' . img_picto('', 'list') . ' |
|
9278 | + <a href="#' . $htmlname.'"> |
|
9279 | + ' . img_picto('', 'list').' |
|
9280 | 9280 | </a> |
9281 | - <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> |
|
9281 | + <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> |
|
9282 | 9282 | </dt> |
9283 | 9283 | <dd class="dropdowndd"> |
9284 | 9284 | <div class="multiselectcheckbox'.$htmlname.'"> |
@@ -9290,19 +9290,19 @@ discard block |
||
9290 | 9290 | </dd> |
9291 | 9291 | </dl> |
9292 | 9292 | |
9293 | - <script nonce="' . getNonce() . '" type="text/javascript"> |
|
9293 | + <script nonce="' . getNonce().'" type="text/javascript"> |
|
9294 | 9294 | jQuery(document).ready(function () { |
9295 | - $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () { |
|
9295 | + $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () { |
|
9296 | 9296 | console.log("A new field was added/removed, we edit field input[name=formfilteraction]"); |
9297 | 9297 | |
9298 | 9298 | $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST |
9299 | 9299 | |
9300 | 9300 | var title = $(this).val() + ","; |
9301 | 9301 | if ($(this).is(\':checked\')) { |
9302 | - $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val()); |
|
9302 | + $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val()); |
|
9303 | 9303 | } |
9304 | 9304 | else { |
9305 | - $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') ) |
|
9305 | + $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') ) |
|
9306 | 9306 | } |
9307 | 9307 | // Now, we submit page |
9308 | 9308 | //$(this).parents(\'form:first\').submit(); |
@@ -9333,7 +9333,7 @@ discard block |
||
9333 | 9333 | */ |
9334 | 9334 | public function showCategories($id, $type, $rendermode = 0, $nolink = 0) |
9335 | 9335 | { |
9336 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
9336 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
9337 | 9337 | |
9338 | 9338 | $cat = new Categorie($this->db); |
9339 | 9339 | $categories = $cat->containing($id, $type); |
@@ -9343,13 +9343,13 @@ discard block |
||
9343 | 9343 | foreach ($categories as $c) { |
9344 | 9344 | $ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
9345 | 9345 | foreach ($ways as $way) { |
9346 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
9346 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
9347 | 9347 | } |
9348 | 9348 | } |
9349 | 9349 | if (empty($toprint)) { |
9350 | 9350 | return ''; |
9351 | 9351 | } else { |
9352 | - return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
9352 | + return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
9353 | 9353 | } |
9354 | 9354 | } |
9355 | 9355 | |
@@ -9398,15 +9398,15 @@ discard block |
||
9398 | 9398 | |
9399 | 9399 | |
9400 | 9400 | print '<div class="div-table-responsive-no-min">'; |
9401 | - print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '" data-elementid="' . $object->id . '" >'; |
|
9401 | + print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'" data-elementid="'.$object->id.'" >'; |
|
9402 | 9402 | |
9403 | 9403 | print '<tr class="liste_titre">'; |
9404 | - print '<td>' . $langs->trans("Type") . '</td>'; |
|
9405 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
9404 | + print '<td>'.$langs->trans("Type").'</td>'; |
|
9405 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
9406 | 9406 | print '<td class="center"></td>'; |
9407 | - print '<td class="center">' . $langs->trans("Date") . '</td>'; |
|
9408 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
9409 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
9407 | + print '<td class="center">'.$langs->trans("Date").'</td>'; |
|
9408 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
9409 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
9410 | 9410 | print '<td></td>'; |
9411 | 9411 | print '</tr>'; |
9412 | 9412 | |
@@ -9425,13 +9425,13 @@ discard block |
||
9425 | 9425 | if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) { |
9426 | 9426 | $element = $regs[1]; |
9427 | 9427 | $subelement = $regs[2]; |
9428 | - $tplpath = $element . '/' . $subelement; |
|
9428 | + $tplpath = $element.'/'.$subelement; |
|
9429 | 9429 | } |
9430 | 9430 | $tplname = 'linkedobjectblock'; |
9431 | 9431 | |
9432 | 9432 | // To work with non standard path |
9433 | 9433 | if ($objecttype == 'facture') { |
9434 | - $tplpath = 'compta/' . $element; |
|
9434 | + $tplpath = 'compta/'.$element; |
|
9435 | 9435 | if (!isModEnabled('invoice')) { |
9436 | 9436 | continue; // Do not show if module disabled |
9437 | 9437 | } |
@@ -9442,7 +9442,7 @@ discard block |
||
9442 | 9442 | continue; // Do not show if module disabled |
9443 | 9443 | } |
9444 | 9444 | } elseif ($objecttype == 'propal') { |
9445 | - $tplpath = 'comm/' . $element; |
|
9445 | + $tplpath = 'comm/'.$element; |
|
9446 | 9446 | if (!isModEnabled('propal')) { |
9447 | 9447 | continue; // Do not show if module disabled |
9448 | 9448 | } |
@@ -9495,7 +9495,7 @@ discard block |
||
9495 | 9495 | $linkedObjectBlock = $objects; |
9496 | 9496 | |
9497 | 9497 | // Output template part (modules that overwrite templates must declare this into descriptor) |
9498 | - $dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl')); |
|
9498 | + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); |
|
9499 | 9499 | foreach ($dirtpls as $reldir) { |
9500 | 9500 | $reldir = rtrim($reldir, '/'); |
9501 | 9501 | if ($nboftypesoutput == ($nbofdifferenttypes - 1)) { // No more type to show after |
@@ -9503,7 +9503,7 @@ discard block |
||
9503 | 9503 | $noMoreLinkedObjectBlockAfter = 1; |
9504 | 9504 | } |
9505 | 9505 | |
9506 | - $res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php'); |
|
9506 | + $res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); |
|
9507 | 9507 | if ($res) { |
9508 | 9508 | $nboftypesoutput++; |
9509 | 9509 | break; |
@@ -9512,7 +9512,7 @@ discard block |
||
9512 | 9512 | } |
9513 | 9513 | |
9514 | 9514 | if (!$nboftypesoutput) { |
9515 | - print '<tr><td colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
9515 | + print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
9516 | 9516 | } |
9517 | 9517 | |
9518 | 9518 | print '</table>'; |
@@ -9552,14 +9552,14 @@ discard block |
||
9552 | 9552 | if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
9553 | 9553 | $listofidcompanytoscan = $object->thirdparty->id; |
9554 | 9554 | if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) { |
9555 | - $listofidcompanytoscan .= ',' . $object->thirdparty->parent; |
|
9555 | + $listofidcompanytoscan .= ','.$object->thirdparty->parent; |
|
9556 | 9556 | } |
9557 | 9557 | if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) { |
9558 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
9558 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
9559 | 9559 | $tmpproject = new Project($this->db); |
9560 | 9560 | $tmpproject->fetch($object->fk_project); |
9561 | 9561 | if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { |
9562 | - $listofidcompanytoscan .= ',' . $tmpproject->socid; |
|
9562 | + $listofidcompanytoscan .= ','.$tmpproject->socid; |
|
9563 | 9563 | } |
9564 | 9564 | unset($tmpproject); |
9565 | 9565 | } |
@@ -9569,63 +9569,63 @@ discard block |
||
9569 | 9569 | 'enabled' => isModEnabled('propal'), |
9570 | 9570 | 'perms' => 1, |
9571 | 9571 | 'label' => 'LinkToProposal', |
9572 | - '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') . ')'), |
|
9572 | + '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').')'), |
|
9573 | 9573 | 'shipping' => array( |
9574 | 9574 | 'enabled' => isModEnabled('shipping'), |
9575 | 9575 | 'perms' => 1, |
9576 | 9576 | 'label' => 'LinkToExpedition', |
9577 | - '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') . ')'), |
|
9577 | + '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').')'), |
|
9578 | 9578 | 'order' => array( |
9579 | 9579 | 'enabled' => isModEnabled('order'), |
9580 | 9580 | 'perms' => 1, |
9581 | 9581 | 'label' => 'LinkToOrder', |
9582 | - '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') . ')'), |
|
9582 | + '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').')'), |
|
9583 | 9583 | 'invoice' => array( |
9584 | 9584 | 'enabled' => isModEnabled('invoice'), |
9585 | 9585 | 'perms' => 1, |
9586 | 9586 | 'label' => 'LinkToInvoice', |
9587 | - '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') . ')'), |
|
9587 | + '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').')'), |
|
9588 | 9588 | 'invoice_template' => array( |
9589 | 9589 | 'enabled' => isModEnabled('invoice'), |
9590 | 9590 | 'perms' => 1, |
9591 | 9591 | 'label' => 'LinkToTemplateInvoice', |
9592 | - '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') . ')'), |
|
9592 | + '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').')'), |
|
9593 | 9593 | 'contrat' => array( |
9594 | 9594 | 'enabled' => isModEnabled('contract'), |
9595 | 9595 | 'perms' => 1, |
9596 | 9596 | 'label' => 'LinkToContract', |
9597 | 9597 | '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 |
9598 | - 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' |
|
9598 | + 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' |
|
9599 | 9599 | ), |
9600 | 9600 | 'fichinter' => array( |
9601 | 9601 | 'enabled' => isModEnabled('intervention'), |
9602 | 9602 | 'perms' => 1, |
9603 | 9603 | 'label' => 'LinkToIntervention', |
9604 | - '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') . ')'), |
|
9604 | + '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').')'), |
|
9605 | 9605 | 'supplier_proposal' => array( |
9606 | 9606 | 'enabled' => isModEnabled('supplier_proposal'), |
9607 | 9607 | 'perms' => 1, |
9608 | 9608 | 'label' => 'LinkToSupplierProposal', |
9609 | - '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') . ')'), |
|
9609 | + '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').')'), |
|
9610 | 9610 | 'order_supplier' => array( |
9611 | 9611 | 'enabled' => isModEnabled("supplier_order"), |
9612 | 9612 | 'perms' => 1, |
9613 | 9613 | 'label' => 'LinkToSupplierOrder', |
9614 | - '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') . ')'), |
|
9614 | + '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').')'), |
|
9615 | 9615 | 'invoice_supplier' => array( |
9616 | 9616 | 'enabled' => isModEnabled("supplier_invoice"), |
9617 | 9617 | 'perms' => 1, 'label' => 'LinkToSupplierInvoice', |
9618 | - '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') . ')'), |
|
9618 | + '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').')'), |
|
9619 | 9619 | 'ticket' => array( |
9620 | 9620 | 'enabled' => isModEnabled('ticket'), |
9621 | 9621 | 'perms' => 1, |
9622 | 9622 | 'label' => 'LinkToTicket', |
9623 | - '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') . ')'), |
|
9623 | + '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').')'), |
|
9624 | 9624 | 'mo' => array( |
9625 | 9625 | 'enabled' => isModEnabled('mrp'), |
9626 | 9626 | 'perms' => 1, |
9627 | 9627 | 'label' => 'LinkToMo', |
9628 | - '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') . ')') |
|
9628 | + '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').')') |
|
9629 | 9629 | ); |
9630 | 9630 | } |
9631 | 9631 | |
@@ -9661,22 +9661,22 @@ discard block |
||
9661 | 9661 | } |
9662 | 9662 | |
9663 | 9663 | if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) { |
9664 | - print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>'; |
|
9664 | + print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>'; |
|
9665 | 9665 | |
9666 | 9666 | if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) { |
9667 | 9667 | print '<br>'."\n"; |
9668 | 9668 | print '<!-- form to add a link from anywhere -->'."\n"; |
9669 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">'; |
|
9670 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
9669 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">'; |
|
9670 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
9671 | 9671 | print '<input type="hidden" name="action" value="addlinkbyref">'; |
9672 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
9673 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
9672 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
9673 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
9674 | 9674 | print '<table class="noborder">'; |
9675 | 9675 | print '<tr>'; |
9676 | 9676 | //print '<td>' . $langs->trans("Ref") . '</td>'; |
9677 | - print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> '; |
|
9678 | - print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '"> '; |
|
9679 | - print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>'; |
|
9677 | + print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'"> '; |
|
9678 | + print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'"> '; |
|
9679 | + print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>'; |
|
9680 | 9680 | print '</tr>'; |
9681 | 9681 | print '</table>'; |
9682 | 9682 | print '</form>'; |
@@ -9691,48 +9691,48 @@ discard block |
||
9691 | 9691 | |
9692 | 9692 | print '<br>'; |
9693 | 9693 | print '<!-- form to add a link from object to same thirdparty -->'."\n"; |
9694 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">'; |
|
9694 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">'; |
|
9695 | 9695 | print '<input type="hidden" name="action" value="addlink">'; |
9696 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
9697 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
9698 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
9696 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
9697 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
9698 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
9699 | 9699 | print '<table class="noborder">'; |
9700 | 9700 | print '<tr class="liste_titre">'; |
9701 | 9701 | print '<td class="nowrap"></td>'; |
9702 | - print '<td class="center">' . $langs->trans("Ref") . '</td>'; |
|
9703 | - print '<td class="left">' . $langs->trans("RefCustomer") . '</td>'; |
|
9704 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
9705 | - print '<td class="left">' . $langs->trans("Company") . '</td>'; |
|
9702 | + print '<td class="center">'.$langs->trans("Ref").'</td>'; |
|
9703 | + print '<td class="left">'.$langs->trans("RefCustomer").'</td>'; |
|
9704 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
9705 | + print '<td class="left">'.$langs->trans("Company").'</td>'; |
|
9706 | 9706 | print '</tr>'; |
9707 | 9707 | while ($i < $num) { |
9708 | 9708 | $objp = $this->db->fetch_object($resqllist); |
9709 | 9709 | |
9710 | 9710 | print '<tr class="oddeven">'; |
9711 | 9711 | print '<td class="left">'; |
9712 | - print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">'; |
|
9712 | + print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">'; |
|
9713 | 9713 | print '</td>'; |
9714 | - print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>'; |
|
9715 | - print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>'; |
|
9714 | + print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>'; |
|
9715 | + print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>'; |
|
9716 | 9716 | print '<td class="right">'; |
9717 | 9717 | if ($possiblelink['label'] == 'LinkToContract') { |
9718 | 9718 | $form = new Form($this->db); |
9719 | - print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' '; |
|
9719 | + print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; |
|
9720 | 9720 | } |
9721 | - print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>'; |
|
9721 | + print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>'; |
|
9722 | 9722 | print '</td>'; |
9723 | - print '<td>' . $objp->name . '</td>'; |
|
9723 | + print '<td>'.$objp->name.'</td>'; |
|
9724 | 9724 | print '</tr>'; |
9725 | 9725 | $i++; |
9726 | 9726 | } |
9727 | 9727 | print '</table>'; |
9728 | 9728 | print '<div class="center">'; |
9729 | 9729 | if ($num) { |
9730 | - print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">'; |
|
9730 | + print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">'; |
|
9731 | 9731 | } |
9732 | 9732 | if (empty($conf->use_javascript_ajax)) { |
9733 | - print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
9733 | + print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
9734 | 9734 | } else { |
9735 | - 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>'; |
|
9735 | + 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>'; |
|
9736 | 9736 | } |
9737 | 9737 | print '</form>'; |
9738 | 9738 | $this->db->free($resqllist); |
@@ -9743,10 +9743,10 @@ discard block |
||
9743 | 9743 | |
9744 | 9744 | //$linktoelem.=($linktoelem?' ':''); |
9745 | 9745 | if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) { |
9746 | - $linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>'; |
|
9746 | + $linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>'; |
|
9747 | 9747 | // } else $linktoelem.=$langs->trans($possiblelink['label']); |
9748 | 9748 | } else { |
9749 | - $linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>'; |
|
9749 | + $linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>'; |
|
9750 | 9750 | } |
9751 | 9751 | } |
9752 | 9752 | } |
@@ -9756,11 +9756,11 @@ discard block |
||
9756 | 9756 | <dl class="dropdown" id="linktoobjectname"> |
9757 | 9757 | '; |
9758 | 9758 | if (!empty($conf->use_javascript_ajax)) { |
9759 | - $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>'; |
|
9759 | + $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>'; |
|
9760 | 9760 | } |
9761 | 9761 | $linktoelem .= '<dd> |
9762 | 9762 | <div class="multiselectlinkto"> |
9763 | - <ul class="ulselectedfields">' . $linktoelemlist . ' |
|
9763 | + <ul class="ulselectedfields">' . $linktoelemlist.' |
|
9764 | 9764 | </ul> |
9765 | 9765 | </div> |
9766 | 9766 | </dd> |
@@ -9771,7 +9771,7 @@ discard block |
||
9771 | 9771 | |
9772 | 9772 | if (!empty($conf->use_javascript_ajax)) { |
9773 | 9773 | print '<!-- Add js to show linkto box --> |
9774 | - <script nonce="' . getNonce() . '"> |
|
9774 | + <script nonce="' . getNonce().'"> |
|
9775 | 9775 | jQuery(document).ready(function() { |
9776 | 9776 | jQuery(".linkto").click(function() { |
9777 | 9777 | console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list"); |
@@ -9812,19 +9812,19 @@ discard block |
||
9812 | 9812 | |
9813 | 9813 | $disabled = ($disabled ? ' disabled' : ''); |
9814 | 9814 | |
9815 | - $resultyesno = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n"; |
|
9815 | + $resultyesno = '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; |
|
9816 | 9816 | if ($useempty) { |
9817 | - $resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '> </option>' . "\n"; |
|
9817 | + $resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n"; |
|
9818 | 9818 | } |
9819 | 9819 | if (("$value" == 'yes') || ($value == 1)) { |
9820 | - $resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
9821 | - $resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n"; |
|
9820 | + $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n"; |
|
9821 | + $resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n"; |
|
9822 | 9822 | } else { |
9823 | 9823 | $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); |
9824 | - $resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
9825 | - $resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n"; |
|
9824 | + $resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n"; |
|
9825 | + $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n"; |
|
9826 | 9826 | } |
9827 | - $resultyesno .= '</select>' . "\n"; |
|
9827 | + $resultyesno .= '</select>'."\n"; |
|
9828 | 9828 | |
9829 | 9829 | if ($addjscombo) { |
9830 | 9830 | $resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss); |
@@ -9848,12 +9848,12 @@ discard block |
||
9848 | 9848 | { |
9849 | 9849 | // phpcs:enable |
9850 | 9850 | $sql = "SELECT rowid, label"; |
9851 | - $sql .= " FROM " . $this->db->prefix() . "export_model"; |
|
9852 | - $sql .= " WHERE type = '" . $this->db->escape($type) . "'"; |
|
9851 | + $sql .= " FROM ".$this->db->prefix()."export_model"; |
|
9852 | + $sql .= " WHERE type = '".$this->db->escape($type)."'"; |
|
9853 | 9853 | $sql .= " ORDER BY rowid"; |
9854 | 9854 | $result = $this->db->query($sql); |
9855 | 9855 | if ($result) { |
9856 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
9856 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
9857 | 9857 | if ($useempty) { |
9858 | 9858 | print '<option value="-1"> </option>'; |
9859 | 9859 | } |
@@ -9863,9 +9863,9 @@ discard block |
||
9863 | 9863 | while ($i < $num) { |
9864 | 9864 | $obj = $this->db->fetch_object($result); |
9865 | 9865 | if ($selected == $obj->rowid) { |
9866 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
9866 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
9867 | 9867 | } else { |
9868 | - print '<option value="' . $obj->rowid . '">'; |
|
9868 | + print '<option value="'.$obj->rowid.'">'; |
|
9869 | 9869 | } |
9870 | 9870 | print $obj->label; |
9871 | 9871 | print '</option>'; |
@@ -9956,8 +9956,8 @@ discard block |
||
9956 | 9956 | $stringforfirstkey .= ' CTL +'; |
9957 | 9957 | } |
9958 | 9958 | |
9959 | - $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>'; |
|
9960 | - $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>'; |
|
9959 | + $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>'; |
|
9960 | + $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>'; |
|
9961 | 9961 | } |
9962 | 9962 | |
9963 | 9963 | //print "xx".$previous_ref."x".$next_ref; |
@@ -9965,18 +9965,18 @@ discard block |
||
9965 | 9965 | |
9966 | 9966 | // Right part of banner |
9967 | 9967 | if ($morehtmlright) { |
9968 | - $ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>'; |
|
9968 | + $ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>'; |
|
9969 | 9969 | } |
9970 | 9970 | |
9971 | 9971 | if ($previous_ref || $next_ref || $morehtml) { |
9972 | 9972 | $ret .= '<div class="pagination paginationref"><ul class="right">'; |
9973 | 9973 | } |
9974 | 9974 | if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) { |
9975 | - $ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>'; |
|
9975 | + $ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>'; |
|
9976 | 9976 | } |
9977 | 9977 | if ($shownav && ($previous_ref || $next_ref)) { |
9978 | - $ret .= '<li class="pagination">' . $previous_ref . '</li>'; |
|
9979 | - $ret .= '<li class="pagination">' . $next_ref . '</li>'; |
|
9978 | + $ret .= '<li class="pagination">'.$previous_ref.'</li>'; |
|
9979 | + $ret .= '<li class="pagination">'.$next_ref.'</li>'; |
|
9980 | 9980 | } |
9981 | 9981 | if ($previous_ref || $next_ref || $morehtml) { |
9982 | 9982 | $ret .= '</ul></div>'; |
@@ -9991,7 +9991,7 @@ discard block |
||
9991 | 9991 | $morehtmlstatus = $hookmanager->resPrint; |
9992 | 9992 | } |
9993 | 9993 | if ($morehtmlstatus) { |
9994 | - $ret .= '<div class="statusref">' . $morehtmlstatus . '</div>'; |
|
9994 | + $ret .= '<div class="statusref">'.$morehtmlstatus.'</div>'; |
|
9995 | 9995 | } |
9996 | 9996 | |
9997 | 9997 | $parameters = array(); |
@@ -10005,14 +10005,14 @@ discard block |
||
10005 | 10005 | // Left part of banner |
10006 | 10006 | if ($morehtmlleft) { |
10007 | 10007 | if ($conf->browser->layout == 'phone') { |
10008 | - $ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>'; |
|
10008 | + $ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; |
|
10009 | 10009 | } else { |
10010 | - $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>'; |
|
10010 | + $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>'; |
|
10011 | 10011 | } |
10012 | 10012 | } |
10013 | 10013 | |
10014 | 10014 | //if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; |
10015 | - $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">'; |
|
10015 | + $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">'; |
|
10016 | 10016 | |
10017 | 10017 | // For thirdparty, contact, user, member, the ref is the id, so we show something else |
10018 | 10018 | if ($object->element == 'societe') { |
@@ -10026,7 +10026,7 @@ discard block |
||
10026 | 10026 | |
10027 | 10027 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
10028 | 10028 | if (!is_object($extralanguages)) { |
10029 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
10029 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
10030 | 10030 | $extralanguages = new ExtraLanguages($this->db); |
10031 | 10031 | } |
10032 | 10032 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -10041,29 +10041,29 @@ discard block |
||
10041 | 10041 | if ($object->array_languages['name'][$extralangcode]) { |
10042 | 10042 | $htmltext .= $object->array_languages['name'][$extralangcode]; |
10043 | 10043 | } else { |
10044 | - $htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>'; |
|
10044 | + $htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>'; |
|
10045 | 10045 | } |
10046 | 10046 | } |
10047 | - $ret .= '<!-- Show translations of name -->' . "\n"; |
|
10047 | + $ret .= '<!-- Show translations of name -->'."\n"; |
|
10048 | 10048 | $ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
10049 | 10049 | } |
10050 | 10050 | } |
10051 | 10051 | } elseif ($object->element == 'member') { |
10052 | 10052 | '@phan-var-force Adherent $object'; |
10053 | - $ret .= $object->ref . '<br>'; |
|
10053 | + $ret .= $object->ref.'<br>'; |
|
10054 | 10054 | $fullname = $object->getFullName($langs); |
10055 | 10055 | if ($object->morphy == 'mor' && $object->societe) { |
10056 | - $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); |
|
10056 | + $ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''); |
|
10057 | 10057 | } else { |
10058 | - $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); |
|
10058 | + $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); |
|
10059 | 10059 | } |
10060 | 10060 | } elseif (in_array($object->element, array('contact', 'user'))) { |
10061 | - $ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt; |
|
10061 | + $ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt; |
|
10062 | 10062 | } elseif ($object->element == 'usergroup') { |
10063 | 10063 | $ret .= dol_htmlentities($object->name); |
10064 | 10064 | } elseif (in_array($object->element, array('action', 'agenda'))) { |
10065 | 10065 | '@phan-var-force ActionComm $object'; |
10066 | - $ret .= $object->ref . '<br>' . $object->label; |
|
10066 | + $ret .= $object->ref.'<br>'.$object->label; |
|
10067 | 10067 | } elseif (in_array($object->element, array('adherent_type'))) { |
10068 | 10068 | $ret .= $object->label; |
10069 | 10069 | } elseif ($object->element == 'ecm_directories') { |
@@ -10116,9 +10116,9 @@ discard block |
||
10116 | 10116 | } |
10117 | 10117 | |
10118 | 10118 | // Barcode image @phan-suppress-next-line PhanUndeclaredProperty |
10119 | - $url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code); |
|
10120 | - $out = '<!-- url barcode = ' . $url . ' -->'; |
|
10121 | - $out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>'; |
|
10119 | + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); |
|
10120 | + $out = '<!-- url barcode = '.$url.' -->'; |
|
10121 | + $out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>'; |
|
10122 | 10122 | |
10123 | 10123 | return $out; |
10124 | 10124 | } |
@@ -10145,7 +10145,7 @@ discard block |
||
10145 | 10145 | global $conf, $langs; |
10146 | 10146 | |
10147 | 10147 | $entity = (empty($object->entity) ? $conf->entity : $object->entity); |
10148 | - $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
|
10148 | + $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
|
10149 | 10149 | |
10150 | 10150 | $dir = ''; |
10151 | 10151 | $file = ''; |
@@ -10158,28 +10158,28 @@ discard block |
||
10158 | 10158 | if (!empty($object->logo)) { |
10159 | 10159 | if (dolIsAllowedForPreview($object->logo)) { |
10160 | 10160 | if ((string) $imagesize == 'mini') { |
10161 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
10161 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
10162 | 10162 | } elseif ((string) $imagesize == 'small') { |
10163 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small'); |
|
10163 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); |
|
10164 | 10164 | } else { |
10165 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
10165 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
10166 | 10166 | } |
10167 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
10167 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
10168 | 10168 | } |
10169 | 10169 | } |
10170 | 10170 | $email = $object->email; |
10171 | 10171 | } elseif ($modulepart == 'contact') { |
10172 | - $dir = $conf->societe->multidir_output[$entity] . '/contact'; |
|
10172 | + $dir = $conf->societe->multidir_output[$entity].'/contact'; |
|
10173 | 10173 | if (!empty($object->photo)) { |
10174 | 10174 | if (dolIsAllowedForPreview($object->photo)) { |
10175 | 10175 | if ((string) $imagesize == 'mini') { |
10176 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
10176 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
10177 | 10177 | } elseif ((string) $imagesize == 'small') { |
10178 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
10178 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
10179 | 10179 | } else { |
10180 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
10180 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
10181 | 10181 | } |
10182 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
10182 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
10183 | 10183 | } |
10184 | 10184 | } |
10185 | 10185 | $email = $object->email; |
@@ -10189,17 +10189,17 @@ discard block |
||
10189 | 10189 | if (!empty($object->photo)) { |
10190 | 10190 | if (dolIsAllowedForPreview($object->photo)) { |
10191 | 10191 | if ((string) $imagesize == 'mini') { |
10192 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
10192 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
10193 | 10193 | } elseif ((string) $imagesize == 'small') { |
10194 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
10194 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
10195 | 10195 | } else { |
10196 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
10196 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
10197 | 10197 | } |
10198 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
10198 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
10199 | 10199 | } |
10200 | 10200 | } |
10201 | 10201 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
10202 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
10202 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
10203 | 10203 | } |
10204 | 10204 | $email = $object->email; |
10205 | 10205 | $capture = 'user'; |
@@ -10208,17 +10208,17 @@ discard block |
||
10208 | 10208 | if (!empty($object->photo)) { |
10209 | 10209 | if (dolIsAllowedForPreview($object->photo)) { |
10210 | 10210 | if ((string) $imagesize == 'mini') { |
10211 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
10211 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
10212 | 10212 | } elseif ((string) $imagesize == 'small') { |
10213 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
10213 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
10214 | 10214 | } else { |
10215 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
10215 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
10216 | 10216 | } |
10217 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
10217 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
10218 | 10218 | } |
10219 | 10219 | } |
10220 | 10220 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
10221 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
10221 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
10222 | 10222 | } |
10223 | 10223 | $email = $object->email; |
10224 | 10224 | $capture = 'user'; |
@@ -10244,35 +10244,35 @@ discard block |
||
10244 | 10244 | $ret = ''; |
10245 | 10245 | |
10246 | 10246 | if ($dir) { |
10247 | - if ($file && file_exists($dir . "/" . $file)) { |
|
10247 | + if ($file && file_exists($dir."/".$file)) { |
|
10248 | 10248 | if ($addlinktofullsize) { |
10249 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
10249 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
10250 | 10250 | if ($urladvanced) { |
10251 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
10251 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
10252 | 10252 | } else { |
10253 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
10253 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
10254 | 10254 | } |
10255 | 10255 | } |
10256 | - $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 . '">'; |
|
10256 | + $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.'">'; |
|
10257 | 10257 | if ($addlinktofullsize) { |
10258 | 10258 | $ret .= '</a>'; |
10259 | 10259 | } |
10260 | - } elseif ($altfile && file_exists($dir . "/" . $altfile)) { |
|
10260 | + } elseif ($altfile && file_exists($dir."/".$altfile)) { |
|
10261 | 10261 | if ($addlinktofullsize) { |
10262 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
10262 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
10263 | 10263 | if ($urladvanced) { |
10264 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
10264 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
10265 | 10265 | } else { |
10266 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
10266 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
10267 | 10267 | } |
10268 | 10268 | } |
10269 | - $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 . '">'; |
|
10269 | + $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.'">'; |
|
10270 | 10270 | if ($addlinktofullsize) { |
10271 | 10271 | $ret .= '</a>'; |
10272 | 10272 | } |
10273 | 10273 | } else { |
10274 | 10274 | $nophoto = '/public/theme/common/nophoto.png'; |
10275 | - $defaultimg = 'identicon'; // For gravatar |
|
10275 | + $defaultimg = 'identicon'; // For gravatar |
|
10276 | 10276 | if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found |
10277 | 10277 | if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) { |
10278 | 10278 | $nophoto = 'company'; |
@@ -10290,13 +10290,13 @@ discard block |
||
10290 | 10290 | if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { |
10291 | 10291 | // see https://gravatar.com/site/implement/images/php/ |
10292 | 10292 | $ret .= '<!-- Put link to gravatar -->'; |
10293 | - $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 |
|
10293 | + $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 |
|
10294 | 10294 | } else { |
10295 | 10295 | if ($nophoto == 'company') { |
10296 | - $ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>'; |
|
10296 | + $ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>'; |
|
10297 | 10297 | //$ret .= '<div class="difforspanimgright"></div>'; |
10298 | 10298 | } else { |
10299 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">'; |
|
10299 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; |
|
10300 | 10300 | } |
10301 | 10301 | } |
10302 | 10302 | } |
@@ -10307,15 +10307,15 @@ discard block |
||
10307 | 10307 | } |
10308 | 10308 | $ret .= '<table class="nobordernopadding centpercent">'; |
10309 | 10309 | if ($object->photo) { |
10310 | - $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>'; |
|
10310 | + $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>'; |
|
10311 | 10311 | } |
10312 | 10312 | $ret .= '<tr><td class="tdoverflow">'; |
10313 | 10313 | $maxfilesizearray = getMaxFileSizeArray(); |
10314 | 10314 | $maxmin = $maxfilesizearray['maxmin']; |
10315 | 10315 | if ($maxmin > 0) { |
10316 | - $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
10316 | + $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
10317 | 10317 | } |
10318 | - $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>'; |
|
10318 | + $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>'; |
|
10319 | 10319 | $ret .= '</td></tr>'; |
10320 | 10320 | $ret .= '</table>'; |
10321 | 10321 | } |
@@ -10369,38 +10369,38 @@ discard block |
||
10369 | 10369 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
10370 | 10370 | $sql .= ", e.label"; |
10371 | 10371 | } |
10372 | - $sql .= " FROM " . $this->db->prefix() . "usergroup as ug "; |
|
10372 | + $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; |
|
10373 | 10373 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
10374 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity"; |
|
10374 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; |
|
10375 | 10375 | if ($force_entity) { |
10376 | - $sql .= " WHERE ug.entity IN (0, " . $force_entity . ")"; |
|
10376 | + $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; |
|
10377 | 10377 | } else { |
10378 | 10378 | $sql .= " WHERE ug.entity IS NOT NULL"; |
10379 | 10379 | } |
10380 | 10380 | } else { |
10381 | - $sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")"; |
|
10381 | + $sql .= " WHERE ug.entity IN (0, ".$conf->entity.")"; |
|
10382 | 10382 | } |
10383 | 10383 | if (is_array($exclude) && $excludeGroups) { |
10384 | - $sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")"; |
|
10384 | + $sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")"; |
|
10385 | 10385 | } |
10386 | 10386 | if (is_array($include) && $includeGroups) { |
10387 | - $sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")"; |
|
10387 | + $sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")"; |
|
10388 | 10388 | } |
10389 | 10389 | $sql .= " ORDER BY ug.nom ASC"; |
10390 | 10390 | |
10391 | - dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG); |
|
10391 | + dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); |
|
10392 | 10392 | $resql = $this->db->query($sql); |
10393 | 10393 | if ($resql) { |
10394 | 10394 | // Enhance with select2 |
10395 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
10395 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
10396 | 10396 | |
10397 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
10397 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
10398 | 10398 | |
10399 | 10399 | $num = $this->db->num_rows($resql); |
10400 | 10400 | $i = 0; |
10401 | 10401 | if ($num) { |
10402 | 10402 | if ($show_empty && !$multiple) { |
10403 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '> </option>' . "\n"; |
|
10403 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'> </option>'."\n"; |
|
10404 | 10404 | } |
10405 | 10405 | |
10406 | 10406 | while ($i < $num) { |
@@ -10413,11 +10413,11 @@ discard block |
||
10413 | 10413 | $label = $obj->name; |
10414 | 10414 | $labelhtml = $obj->name; |
10415 | 10415 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) { |
10416 | - $label .= " (" . $obj->label . ")"; |
|
10417 | - $labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>'; |
|
10416 | + $label .= " (".$obj->label.")"; |
|
10417 | + $labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>'; |
|
10418 | 10418 | } |
10419 | 10419 | |
10420 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
10420 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
10421 | 10421 | if ($disableline) { |
10422 | 10422 | $out .= ' disabled'; |
10423 | 10423 | } |
@@ -10433,9 +10433,9 @@ discard block |
||
10433 | 10433 | } |
10434 | 10434 | } else { |
10435 | 10435 | if ($show_empty) { |
10436 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n"; |
|
10436 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n"; |
|
10437 | 10437 | } |
10438 | - $out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>'; |
|
10438 | + $out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>'; |
|
10439 | 10439 | } |
10440 | 10440 | $out .= '</select>'; |
10441 | 10441 | |
@@ -10479,25 +10479,25 @@ discard block |
||
10479 | 10479 | $out = ''; |
10480 | 10480 | |
10481 | 10481 | if (!empty($conf->use_javascript_ajax)) { |
10482 | - $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>'; |
|
10482 | + $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>'; |
|
10483 | 10483 | } |
10484 | - $out .= '<script nonce="' . getNonce() . '"> |
|
10484 | + $out .= '<script nonce="'.getNonce().'"> |
|
10485 | 10485 | $(document).ready(function() { |
10486 | - $("#' . $cssclass . 's").click(function() { |
|
10486 | + $("#' . $cssclass.'s").click(function() { |
|
10487 | 10487 | if($(this).is(\':checked\')){ |
10488 | - console.log("We check all ' . $cssclass . ' and trigger the change method"); |
|
10489 | - $(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\'); |
|
10488 | + console.log("We check all ' . $cssclass.' and trigger the change method"); |
|
10489 | + $(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\'); |
|
10490 | 10490 | } |
10491 | 10491 | else |
10492 | 10492 | { |
10493 | 10493 | console.log("We uncheck all"); |
10494 | - $(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\'); |
|
10494 | + $(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\'); |
|
10495 | 10495 | }' . "\n"; |
10496 | 10496 | if ($calljsfunction) { |
10497 | - $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
10497 | + $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
10498 | 10498 | } |
10499 | 10499 | $out .= ' }); |
10500 | - $(".' . $cssclass . '").change(function() { |
|
10500 | + $(".' . $cssclass.'").change(function() { |
|
10501 | 10501 | $(this).closest("tr").toggleClass("highlight", this.checked); |
10502 | 10502 | }); |
10503 | 10503 | }); |
@@ -10542,67 +10542,67 @@ discard block |
||
10542 | 10542 | global $langs, $user; |
10543 | 10543 | |
10544 | 10544 | $out = ''; |
10545 | - $sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1"; |
|
10546 | - $sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")"; |
|
10545 | + $sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1"; |
|
10546 | + $sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")"; |
|
10547 | 10547 | if (!empty($excludeid)) { |
10548 | - $sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")"; |
|
10548 | + $sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")"; |
|
10549 | 10549 | } |
10550 | 10550 | $sql .= " ORDER BY label"; |
10551 | 10551 | |
10552 | 10552 | $resql = $this->db->query($sql); |
10553 | 10553 | if ($resql) { |
10554 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">'; |
|
10554 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">'; |
|
10555 | 10555 | if ($useempty) { |
10556 | 10556 | $out .= '<option value="0"> </option>'; |
10557 | 10557 | } |
10558 | 10558 | |
10559 | 10559 | while ($obj = $this->db->fetch_object($resql)) { |
10560 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>'; |
|
10560 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>'; |
|
10561 | 10561 | } |
10562 | 10562 | $out .= '</select>'; |
10563 | - $out .= ajax_combobox('select_' . $htmlname); |
|
10563 | + $out .= ajax_combobox('select_'.$htmlname); |
|
10564 | 10564 | |
10565 | 10565 | if (!empty($htmlname) && $user->admin && $info_admin) { |
10566 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
10566 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
10567 | 10567 | } |
10568 | 10568 | |
10569 | 10569 | if (!empty($target)) { |
10570 | - $sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
10570 | + $sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
10571 | 10571 | $resql = $this->db->query($sql); |
10572 | 10572 | if ($resql) { |
10573 | 10573 | if ($this->db->num_rows($resql) > 0) { |
10574 | 10574 | $obj = $this->db->fetch_object($resql); |
10575 | - $out .= '<script nonce="' . getNonce() . '"> |
|
10575 | + $out .= '<script nonce="'.getNonce().'"> |
|
10576 | 10576 | $(function() { |
10577 | - $("select[name=' . $target . ']").on("change", function() { |
|
10577 | + $("select[name=' . $target.']").on("change", function() { |
|
10578 | 10578 | var current_val = $(this).val(); |
10579 | - if (current_val == ' . $obj->id . ') {'; |
|
10579 | + if (current_val == ' . $obj->id.') {'; |
|
10580 | 10580 | if (!empty($default_selected) || !empty($selected)) { |
10581 | - $out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");'; |
|
10581 | + $out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");'; |
|
10582 | 10582 | } |
10583 | 10583 | |
10584 | 10584 | $out .= ' |
10585 | - $("select[name=' . $htmlname . ']").change(); |
|
10585 | + $("select[name=' . $htmlname.']").change(); |
|
10586 | 10586 | } |
10587 | 10587 | }); |
10588 | 10588 | |
10589 | - $("select[name=' . $htmlname . ']").change(function() { |
|
10589 | + $("select[name=' . $htmlname.']").change(function() { |
|
10590 | 10590 | |
10591 | - if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') { |
|
10591 | + if ($("select[name=' . $target.']").val() == '.$obj->id.') { |
|
10592 | 10592 | // get price of kilometer to fill the unit price |
10593 | 10593 | $.ajax({ |
10594 | 10594 | method: "POST", |
10595 | 10595 | dataType: "json", |
10596 | - data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' }, |
|
10597 | - url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '", |
|
10596 | + data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' }, |
|
10597 | + url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'", |
|
10598 | 10598 | }).done(function( data, textStatus, jqXHR ) { |
10599 | 10599 | console.log(data); |
10600 | 10600 | if (typeof data.up != "undefined") { |
10601 | 10601 | $("input[name=value_unit]").val(data.up); |
10602 | - $("select[name=' . $htmlname . ']").attr("title", data.title); |
|
10602 | + $("select[name=' . $htmlname.']").attr("title", data.title); |
|
10603 | 10603 | } else { |
10604 | 10604 | $("input[name=value_unit]").val(""); |
10605 | - $("select[name=' . $htmlname . ']").attr("title", ""); |
|
10605 | + $("select[name=' . $htmlname.']").attr("title", ""); |
|
10606 | 10606 | } |
10607 | 10607 | }); |
10608 | 10608 | } |
@@ -10632,18 +10632,18 @@ discard block |
||
10632 | 10632 | global $conf, $langs; |
10633 | 10633 | |
10634 | 10634 | $out = ''; |
10635 | - $sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range"; |
|
10636 | - $sql .= " WHERE entity = " . $conf->entity . " AND active = 1"; |
|
10635 | + $sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range"; |
|
10636 | + $sql .= " WHERE entity = ".$conf->entity." AND active = 1"; |
|
10637 | 10637 | |
10638 | 10638 | $resql = $this->db->query($sql); |
10639 | 10639 | if ($resql) { |
10640 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
10640 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
10641 | 10641 | if ($useempty) { |
10642 | 10642 | $out .= '<option value="0"></option>'; |
10643 | 10643 | } |
10644 | 10644 | |
10645 | 10645 | while ($obj = $this->db->fetch_object($resql)) { |
10646 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>'; |
|
10646 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>'; |
|
10647 | 10647 | } |
10648 | 10648 | $out .= '</select>'; |
10649 | 10649 | } else { |
@@ -10674,12 +10674,12 @@ discard block |
||
10674 | 10674 | |
10675 | 10675 | $resql = $this->db->query($sql); |
10676 | 10676 | if ($resql) { |
10677 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
10677 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
10678 | 10678 | if ($useempty) { |
10679 | 10679 | $out .= '<option value="0"></option>'; |
10680 | 10680 | } |
10681 | 10681 | if ($allchoice) { |
10682 | - $out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>'; |
|
10682 | + $out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>'; |
|
10683 | 10683 | } |
10684 | 10684 | |
10685 | 10685 | $field = 'code'; |
@@ -10689,7 +10689,7 @@ discard block |
||
10689 | 10689 | |
10690 | 10690 | while ($obj = $this->db->fetch_object($resql)) { |
10691 | 10691 | $key = $langs->trans($obj->code); |
10692 | - $out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>'; |
|
10692 | + $out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>'; |
|
10693 | 10693 | } |
10694 | 10694 | $out .= '</select>'; |
10695 | 10695 | |
@@ -10723,7 +10723,7 @@ discard block |
||
10723 | 10723 | { |
10724 | 10724 | global $user, $conf, $langs; |
10725 | 10725 | |
10726 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
10726 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
10727 | 10727 | |
10728 | 10728 | if (is_null($usertofilter)) { |
10729 | 10729 | $usertofilter = $user; |
@@ -10747,10 +10747,10 @@ discard block |
||
10747 | 10747 | $sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, |
10748 | 10748 | p.title, p.fk_soc, p.fk_statut, p.public,"; |
10749 | 10749 | $sql .= ' s.nom as name'; |
10750 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
10751 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,'; |
|
10752 | - $sql .= ' ' . $this->db->prefix() . 'facture as f'; |
|
10753 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
10750 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
10751 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,'; |
|
10752 | + $sql .= ' '.$this->db->prefix().'facture as f'; |
|
10753 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
10754 | 10754 | $sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement |
10755 | 10755 | //if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
10756 | 10756 | //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
@@ -10761,14 +10761,14 @@ discard block |
||
10761 | 10761 | if ($resql) { |
10762 | 10762 | // Use select2 selector |
10763 | 10763 | if (!empty($conf->use_javascript_ajax)) { |
10764 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
10764 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
10765 | 10765 | $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
10766 | 10766 | $out .= $comboenhancement; |
10767 | 10767 | $morecss = 'minwidth200imp maxwidth500'; |
10768 | 10768 | } |
10769 | 10769 | |
10770 | 10770 | if (empty($option_only)) { |
10771 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
10771 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
10772 | 10772 | } |
10773 | 10773 | if (!empty($show_empty)) { |
10774 | 10774 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10798,33 +10798,33 @@ discard block |
||
10798 | 10798 | if ($showproject == 'all') { |
10799 | 10799 | $labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref |
10800 | 10800 | if ($obj->name) { |
10801 | - $labeltoshow .= ' - ' . $obj->name; // Soc name |
|
10801 | + $labeltoshow .= ' - '.$obj->name; // Soc name |
|
10802 | 10802 | } |
10803 | 10803 | |
10804 | 10804 | $disabled = 0; |
10805 | 10805 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
10806 | 10806 | $disabled = 1; |
10807 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
10807 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
10808 | 10808 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
10809 | 10809 | if ($discard_closed == 2) { |
10810 | 10810 | $disabled = 1; |
10811 | 10811 | } |
10812 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
10812 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
10813 | 10813 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
10814 | 10814 | $disabled = 1; |
10815 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
10815 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
10816 | 10816 | } |
10817 | 10817 | } |
10818 | 10818 | |
10819 | 10819 | if (!empty($selected) && $selected == $obj->rowid) { |
10820 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
10820 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
10821 | 10821 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
10822 | - $out .= '>' . $labeltoshow . '</option>'; |
|
10822 | + $out .= '>'.$labeltoshow.'</option>'; |
|
10823 | 10823 | } else { |
10824 | 10824 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
10825 | 10825 | $resultat = ''; |
10826 | 10826 | } else { |
10827 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
10827 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
10828 | 10828 | if ($disabled) { |
10829 | 10829 | $resultat .= ' disabled'; |
10830 | 10830 | } |
@@ -10876,22 +10876,22 @@ discard block |
||
10876 | 10876 | |
10877 | 10877 | $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc'; |
10878 | 10878 | //$sql.= ', el.fk_source'; |
10879 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f'; |
|
10880 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
10879 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; |
|
10880 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
|
10881 | 10881 | $sql .= " ORDER BY f.titre ASC"; |
10882 | 10882 | |
10883 | 10883 | $resql = $this->db->query($sql); |
10884 | 10884 | if ($resql) { |
10885 | 10885 | // Use select2 selector |
10886 | 10886 | if (!empty($conf->use_javascript_ajax)) { |
10887 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
10887 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
10888 | 10888 | $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
10889 | 10889 | $out .= $comboenhancement; |
10890 | 10890 | $morecss = 'minwidth200imp maxwidth500'; |
10891 | 10891 | } |
10892 | 10892 | |
10893 | 10893 | if (empty($option_only)) { |
10894 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
10894 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
10895 | 10895 | } |
10896 | 10896 | if (!empty($show_empty)) { |
10897 | 10897 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10910,19 +10910,19 @@ discard block |
||
10910 | 10910 | $disabled = 0; |
10911 | 10911 | if (!empty($obj->suspended)) { |
10912 | 10912 | $disabled = 1; |
10913 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
10913 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
10914 | 10914 | } |
10915 | 10915 | |
10916 | 10916 | |
10917 | 10917 | if (!empty($selected) && $selected == $obj->rowid) { |
10918 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
10918 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
10919 | 10919 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
10920 | - $out .= '>' . $labeltoshow . '</option>'; |
|
10920 | + $out .= '>'.$labeltoshow.'</option>'; |
|
10921 | 10921 | } else { |
10922 | 10922 | if ($disabled && ($selected != $obj->rowid)) { |
10923 | 10923 | $resultat = ''; |
10924 | 10924 | } else { |
10925 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
10925 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
10926 | 10926 | if ($disabled) { |
10927 | 10927 | $resultat .= ' disabled'; |
10928 | 10928 | } |
@@ -10962,14 +10962,14 @@ discard block |
||
10962 | 10962 | global $langs; |
10963 | 10963 | |
10964 | 10964 | if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) { // If $search_component_params_hidden does not start and end with () |
10965 | - $search_component_params_hidden = '(' . $search_component_params_hidden . ')'; |
|
10965 | + $search_component_params_hidden = '('.$search_component_params_hidden.')'; |
|
10966 | 10966 | } |
10967 | 10967 | |
10968 | 10968 | $ret = ''; |
10969 | 10969 | |
10970 | 10970 | $ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">'; |
10971 | 10971 | $ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; |
10972 | - $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>'; |
|
10972 | + $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>'; |
|
10973 | 10973 | $ret .= '</a>'; |
10974 | 10974 | |
10975 | 10975 | $ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">'; |
@@ -11013,29 +11013,29 @@ discard block |
||
11013 | 11013 | $ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">'; |
11014 | 11014 | } |
11015 | 11015 | $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%')) -->"; |
11016 | - $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">'; |
|
11016 | + $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">'; |
|
11017 | 11017 | // $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->"; |
11018 | 11018 | |
11019 | 11019 | // For compatibility with forms that show themself the search criteria in addition of this component, we output these fields |
11020 | 11020 | foreach ($arrayofcriterias as $criteria) { |
11021 | 11021 | foreach ($criteria as $criteriafamilykey => $criteriafamilyval) { |
11022 | - if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
11022 | + if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
11023 | 11023 | continue; |
11024 | 11024 | } |
11025 | 11025 | if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) { |
11026 | 11026 | continue; |
11027 | 11027 | } |
11028 | 11028 | if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { |
11029 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">'; |
|
11030 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">'; |
|
11031 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">'; |
|
11032 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">'; |
|
11033 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">'; |
|
11034 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">'; |
|
11035 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">'; |
|
11036 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">'; |
|
11029 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">'; |
|
11030 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">'; |
|
11031 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">'; |
|
11032 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">'; |
|
11033 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">'; |
|
11034 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">'; |
|
11035 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">'; |
|
11036 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">'; |
|
11037 | 11037 | } else { |
11038 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">'; |
|
11038 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">'; |
|
11039 | 11039 | } |
11040 | 11040 | } |
11041 | 11041 | } |
@@ -11043,7 +11043,7 @@ discard block |
||
11043 | 11043 | $ret .= '</div>'; |
11044 | 11044 | |
11045 | 11045 | $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"; |
11046 | - $ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
11046 | + $ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
11047 | 11047 | |
11048 | 11048 | $ret .= '</div>'; |
11049 | 11049 | $ret .= '</div>'; |
@@ -11117,7 +11117,7 @@ discard block |
||
11117 | 11117 | |
11118 | 11118 | $TModels = array(); |
11119 | 11119 | |
11120 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
11120 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
11121 | 11121 | $formmail = new FormMail($this->db); |
11122 | 11122 | $result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); |
11123 | 11123 | |
@@ -11130,17 +11130,17 @@ discard block |
||
11130 | 11130 | } |
11131 | 11131 | } |
11132 | 11132 | |
11133 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">'; |
|
11133 | + $retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">'; |
|
11134 | 11134 | |
11135 | 11135 | foreach ($TModels as $id_model => $label_model) { |
11136 | - $retstring .= '<option value="' . $id_model . '"'; |
|
11137 | - $retstring .= ">" . $label_model . "</option>"; |
|
11136 | + $retstring .= '<option value="'.$id_model.'"'; |
|
11137 | + $retstring .= ">".$label_model."</option>"; |
|
11138 | 11138 | } |
11139 | 11139 | |
11140 | 11140 | $retstring .= "</select>"; |
11141 | 11141 | |
11142 | 11142 | if ($addjscombo) { |
11143 | - $retstring .= ajax_combobox('select_' . $prefix . 'model_mail'); |
|
11143 | + $retstring .= ajax_combobox('select_'.$prefix.'model_mail'); |
|
11144 | 11144 | } |
11145 | 11145 | |
11146 | 11146 | return $retstring; |
@@ -11191,16 +11191,16 @@ discard block |
||
11191 | 11191 | |
11192 | 11192 | foreach ($buttons as $button) { |
11193 | 11193 | $addclass = empty($button['addclass']) ? '' : $button['addclass']; |
11194 | - $retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">'; |
|
11194 | + $retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">'; |
|
11195 | 11195 | } |
11196 | 11196 | $retstring .= $withoutdiv ? '' : '</div>'; |
11197 | 11197 | |
11198 | 11198 | if ($dol_openinpopup) { |
11199 | - $retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . dol_escape_htmltag($dol_openinpopup) . ' context, so we enable the close of dialog on cancel -->' . "\n"; |
|
11200 | - $retstring .= '<script nonce="' . getNonce() . '">'; |
|
11199 | + $retstring .= '<!-- buttons are shown into a $dol_openinpopup='.dol_escape_htmltag($dol_openinpopup).' context, so we enable the close of dialog on cancel -->'."\n"; |
|
11200 | + $retstring .= '<script nonce="'.getNonce().'">'; |
|
11201 | 11201 | $retstring .= 'jQuery(".button-cancel").click(function(e) { |
11202 | - e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup) . '\'); |
|
11203 | - window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup) . '\').dialog(\'close\'); |
|
11202 | + e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup).'\'); |
|
11203 | + window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup).'\').dialog(\'close\'); |
|
11204 | 11204 | });'; |
11205 | 11205 | $retstring .= '</script>'; |
11206 | 11206 | } |
@@ -11229,7 +11229,7 @@ discard block |
||
11229 | 11229 | dol_syslog(__METHOD__, LOG_DEBUG); |
11230 | 11230 | |
11231 | 11231 | $sql = "SELECT rowid, code, label as label"; |
11232 | - $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
11232 | + $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
|
11233 | 11233 | $sql .= " WHERE active = 1"; |
11234 | 11234 | |
11235 | 11235 | $resql = $this->db->query($sql); |
@@ -11240,7 +11240,7 @@ discard block |
||
11240 | 11240 | $obj = $this->db->fetch_object($resql); |
11241 | 11241 | |
11242 | 11242 | // If translation exists, we use it, otherwise we take the default wording |
11243 | - $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
11243 | + $label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
11244 | 11244 | $this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid; |
11245 | 11245 | $this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code; |
11246 | 11246 | $this->cache_invoice_subtype[$obj->rowid]['label'] = $label; |
@@ -11272,18 +11272,18 @@ discard block |
||
11272 | 11272 | global $langs, $user; |
11273 | 11273 | |
11274 | 11274 | $out = ''; |
11275 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
11275 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
11276 | 11276 | |
11277 | 11277 | $this->load_cache_invoice_subtype(); |
11278 | 11278 | |
11279 | - $out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
11279 | + $out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
11280 | 11280 | if ($addempty) { |
11281 | 11281 | $out .= '<option value="0"> </option>'; |
11282 | 11282 | } |
11283 | 11283 | |
11284 | 11284 | foreach ($this->cache_invoice_subtype as $rowid => $subtype) { |
11285 | 11285 | $label = $subtype['label']; |
11286 | - $out .= '<option value="' . $subtype['rowid'] . '"'; |
|
11286 | + $out .= '<option value="'.$subtype['rowid'].'"'; |
|
11287 | 11287 | if ($selected == $subtype['rowid']) { |
11288 | 11288 | $out .= ' selected="selected"'; |
11289 | 11289 | } |
@@ -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,17 +356,17 @@ 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'); |
|
360 | - $object->capital = GETPOST('capital', 'alphanohtml'); |
|
359 | + $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
360 | + $object->capital = GETPOST('capital', 'alphanohtml'); |
|
361 | 361 | if ($action == 'add') { |
362 | 362 | $object->cond_reglement_id = GETPOSTINT('cond_reglement_id'); |
363 | 363 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
364 | 364 | } |
365 | - $object->barcode = GETPOST('barcode', 'alphanohtml'); |
|
365 | + $object->barcode = GETPOST('barcode', 'alphanohtml'); |
|
366 | 366 | |
367 | 367 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
368 | 368 | $object->tva_assuj = GETPOST('assujtva_value', 'alpha'); |
369 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
369 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
370 | 370 | $object->status = GETPOST('status', 'alpha'); |
371 | 371 | |
372 | 372 | // Local Taxes |
@@ -376,9 +376,9 @@ discard block |
||
376 | 376 | $object->localtax1_value = GETPOST('lt1', 'alpha'); |
377 | 377 | $object->localtax2_value = GETPOST('lt2', 'alpha'); |
378 | 378 | |
379 | - $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
379 | + $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
380 | 380 | $object->effectif_id = GETPOSTINT('effectif_id'); |
381 | - $object->typent_id = GETPOSTINT('typent_id'); |
|
381 | + $object->typent_id = GETPOSTINT('typent_id'); |
|
382 | 382 | |
383 | 383 | $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 |
384 | 384 | |
@@ -387,18 +387,18 @@ discard block |
||
387 | 387 | $prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0); |
388 | 388 | $prospectcustomer = $customer + $prospect; |
389 | 389 | |
390 | - $object->client = $prospectcustomer; |
|
391 | - $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
390 | + $object->client = $prospectcustomer; |
|
391 | + $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
392 | 392 | |
393 | - $object->commercial_id = GETPOSTINT('commercial_id'); |
|
394 | - $object->default_lang = GETPOST('default_lang'); |
|
393 | + $object->commercial_id = GETPOSTINT('commercial_id'); |
|
394 | + $object->default_lang = GETPOST('default_lang'); |
|
395 | 395 | |
396 | 396 | // Webservices url/key |
397 | 397 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
398 | 398 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
399 | 399 | |
400 | 400 | if (GETPOSTISSET('accountancy_code_sell')) { |
401 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
401 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
402 | 402 | |
403 | 403 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
404 | 404 | $object->accountancy_code_sell = ''; |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | } |
408 | 408 | } |
409 | 409 | if (GETPOSTISSET('accountancy_code_buy')) { |
410 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
410 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
411 | 411 | |
412 | 412 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
413 | 413 | $object->accountancy_code_buy = ''; |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | } else { |
879 | 879 | $db->commit(); |
880 | 880 | $db->close(); |
881 | - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); |
|
881 | + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); |
|
882 | 882 | exit; |
883 | 883 | } |
884 | 884 | } else { |
@@ -1057,21 +1057,21 @@ discard block |
||
1057 | 1057 | } |
1058 | 1058 | |
1059 | 1059 | $object->phone = GETPOST('phone', 'alpha'); |
1060 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
1060 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
1061 | 1061 | $object->fax = GETPOST('fax', 'alpha'); |
1062 | 1062 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
1063 | 1063 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
1064 | - $object->capital = GETPOST('capital', 'alphanohtml'); |
|
1064 | + $object->capital = GETPOST('capital', 'alphanohtml'); |
|
1065 | 1065 | $paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables |
1066 | 1066 | if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) { |
1067 | 1067 | $paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
1068 | 1068 | } |
1069 | - $object->cond_reglement_id = $paymentTermId; |
|
1069 | + $object->cond_reglement_id = $paymentTermId; |
|
1070 | 1070 | $paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables |
1071 | 1071 | if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) { |
1072 | 1072 | $paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
1073 | 1073 | } |
1074 | - $object->mode_reglement_id = $paymentTypeId; |
|
1074 | + $object->mode_reglement_id = $paymentTypeId; |
|
1075 | 1075 | $object->barcode = GETPOST('barcode', 'alphanohtml'); |
1076 | 1076 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
1077 | 1077 | $object->idprof2 = GETPOST('idprof2', 'alphanohtml'); |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | $object->civility_id = GETPOST('civility_id', 'alpha'); |
1085 | 1085 | |
1086 | 1086 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
1087 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
1087 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
1088 | 1088 | $object->status = GETPOSTINT('status'); |
1089 | 1089 | |
1090 | 1090 | //Local Taxes |
@@ -1100,7 +1100,7 @@ discard block |
||
1100 | 1100 | $object->default_lang = GETPOST('default_lang'); |
1101 | 1101 | |
1102 | 1102 | if (GETPOSTISSET('accountancy_code_sell')) { |
1103 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
1103 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
1104 | 1104 | |
1105 | 1105 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
1106 | 1106 | $object->accountancy_code_sell = ''; |
@@ -1109,7 +1109,7 @@ discard block |
||
1109 | 1109 | } |
1110 | 1110 | } |
1111 | 1111 | if (GETPOSTISSET('accountancy_code_buy')) { |
1112 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
1112 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
1113 | 1113 | |
1114 | 1114 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
1115 | 1115 | $object->accountancy_code_buy = ''; |
@@ -1234,7 +1234,7 @@ discard block |
||
1234 | 1234 | |
1235 | 1235 | print '<script type="text/javascript">'; |
1236 | 1236 | print '$(document).ready(function () { |
1237 | - var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . '; |
|
1237 | + var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').'; |
|
1238 | 1238 | |
1239 | 1239 | init_customer_categ(); |
1240 | 1240 | $("#customerprospect").change(function() { |
@@ -1306,7 +1306,7 @@ discard block |
||
1306 | 1306 | print '</td><td'.(!getDolGlobalString('SOCIETE_USEPREFIX') ? ' colspan="3"' : '').'>'; |
1307 | 1307 | |
1308 | 1308 | print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus">'; |
1309 | - print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
1309 | + print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
1310 | 1310 | // 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 |
1311 | 1311 | // 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. |
1312 | 1312 | /* |
@@ -1673,7 +1673,7 @@ discard block |
||
1673 | 1673 | print '<td></td>'; |
1674 | 1674 | print '<td></td>'; |
1675 | 1675 | } |
1676 | - print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
1676 | + print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
1677 | 1677 | 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>'; |
1678 | 1678 | print '</tr>'; |
1679 | 1679 | } |
@@ -1721,7 +1721,7 @@ discard block |
||
1721 | 1721 | // Vat is used |
1722 | 1722 | print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>'; |
1723 | 1723 | print '<td>'; |
1724 | - 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 |
|
1724 | + 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 |
|
1725 | 1725 | print '</td>'; |
1726 | 1726 | if ($conf->browser->layout == 'phone') { |
1727 | 1727 | print '</tr><tr>'; |
@@ -1762,7 +1762,7 @@ discard block |
||
1762 | 1762 | |
1763 | 1763 | // VAT reverse charge by default |
1764 | 1764 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
1765 | - print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">'; |
|
1765 | + print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">'; |
|
1766 | 1766 | print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
1767 | 1767 | print '</td></tr>'; |
1768 | 1768 | } |
@@ -1771,21 +1771,21 @@ discard block |
||
1771 | 1771 | //TODO: Place into a function to control showing by country or study better option |
1772 | 1772 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
1773 | 1773 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>'; |
1774 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
1774 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
1775 | 1775 | print '</td>'; |
1776 | 1776 | if ($conf->browser->layout == 'phone') { |
1777 | 1777 | print '</tr><tr>'; |
1778 | 1778 | } |
1779 | 1779 | print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>'; |
1780 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
1780 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
1781 | 1781 | print '</td></tr>'; |
1782 | 1782 | } elseif ($mysoc->localtax1_assuj == "1") { |
1783 | 1783 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
1784 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
1784 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
1785 | 1785 | print '</td></tr>'; |
1786 | 1786 | } elseif ($mysoc->localtax2_assuj == "1") { |
1787 | 1787 | print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
1788 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
1788 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
1789 | 1789 | print '</td></tr>'; |
1790 | 1790 | } |
1791 | 1791 | |
@@ -2040,10 +2040,10 @@ discard block |
||
2040 | 2040 | } |
2041 | 2041 | |
2042 | 2042 | $object->phone = GETPOST('phone', 'alpha'); |
2043 | - $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
2043 | + $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
2044 | 2044 | $object->fax = GETPOST('fax', 'alpha'); |
2045 | 2045 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
2046 | - $object->no_email = GETPOSTINT("no_email"); |
|
2046 | + $object->no_email = GETPOSTINT("no_email"); |
|
2047 | 2047 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
2048 | 2048 | $object->capital = GETPOST('capital', 'alphanohtml'); |
2049 | 2049 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
@@ -2059,16 +2059,16 @@ discard block |
||
2059 | 2059 | $object->default_lang = GETPOST('default_lang', 'alpha'); |
2060 | 2060 | |
2061 | 2061 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
2062 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
2062 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
2063 | 2063 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
2064 | - $object->status = GETPOSTINT('status'); |
|
2064 | + $object->status = GETPOSTINT('status'); |
|
2065 | 2065 | |
2066 | 2066 | // Webservices url/key |
2067 | 2067 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
2068 | 2068 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
2069 | 2069 | |
2070 | 2070 | if (GETPOSTISSET('accountancy_code_sell')) { |
2071 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
2071 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
2072 | 2072 | |
2073 | 2073 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
2074 | 2074 | $object->accountancy_code_sell = ''; |
@@ -2077,7 +2077,7 @@ discard block |
||
2077 | 2077 | } |
2078 | 2078 | } |
2079 | 2079 | if (GETPOSTISSET('accountancy_code_buy')) { |
2080 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
2080 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
2081 | 2081 | |
2082 | 2082 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
2083 | 2083 | $object->accountancy_code_buy = ''; |
@@ -2159,7 +2159,7 @@ discard block |
||
2159 | 2159 | } |
2160 | 2160 | }); |
2161 | 2161 | |
2162 | - var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . '; |
|
2162 | + var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').'; |
|
2163 | 2163 | |
2164 | 2164 | init_customer_categ(); |
2165 | 2165 | $("#customerprospect").change(function() { |
@@ -2526,14 +2526,14 @@ discard block |
||
2526 | 2526 | |
2527 | 2527 | // VAT is used |
2528 | 2528 | print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">'; |
2529 | - print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2529 | + print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2530 | 2530 | print '</td></tr>'; |
2531 | 2531 | |
2532 | 2532 | // Local Taxes |
2533 | 2533 | //TODO: Place into a function to control showing by country or study better option |
2534 | 2534 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
2535 | 2535 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>'; |
2536 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2536 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2537 | 2537 | if (!isOnlyOneLocalTax(1)) { |
2538 | 2538 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2539 | 2539 | $formcompany->select_localtax(1, $object->localtax1_value, "lt1"); |
@@ -2542,7 +2542,7 @@ discard block |
||
2542 | 2542 | print '</td>'; |
2543 | 2543 | print '</tr><tr>'; |
2544 | 2544 | print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>'; |
2545 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>'; |
|
2545 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>'; |
|
2546 | 2546 | if (!isOnlyOneLocalTax(2)) { |
2547 | 2547 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2548 | 2548 | $formcompany->select_localtax(2, $object->localtax2_value, "lt2"); |
@@ -2551,7 +2551,7 @@ discard block |
||
2551 | 2551 | print '</td></tr>'; |
2552 | 2552 | } elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") { |
2553 | 2553 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">'; |
2554 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2554 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2555 | 2555 | if (!isOnlyOneLocalTax(1)) { |
2556 | 2556 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2557 | 2557 | $formcompany->select_localtax(1, $object->localtax1_value, "lt1"); |
@@ -2560,7 +2560,7 @@ discard block |
||
2560 | 2560 | print '</td></tr>'; |
2561 | 2561 | } elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") { |
2562 | 2562 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">'; |
2563 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2563 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2564 | 2564 | if (!isOnlyOneLocalTax(2)) { |
2565 | 2565 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2566 | 2566 | $formcompany->select_localtax(2, $object->localtax2_value, "lt2"); |
@@ -2571,7 +2571,7 @@ discard block |
||
2571 | 2571 | |
2572 | 2572 | // VAT reverse charge by default |
2573 | 2573 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
2574 | - print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">'; |
|
2574 | + print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">'; |
|
2575 | 2575 | print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
2576 | 2576 | print '</td></tr>'; |
2577 | 2577 | } |
@@ -2740,7 +2740,7 @@ discard block |
||
2740 | 2740 | $maxfilesizearray = getMaxFileSizeArray(); |
2741 | 2741 | $maxmin = $maxfilesizearray['maxmin']; |
2742 | 2742 | if ($maxmin > 0) { |
2743 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
2743 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
2744 | 2744 | } |
2745 | 2745 | print '<input type="file" class="flat" name="photo" id="photoinput">'; |
2746 | 2746 | print '</td></tr>'; |
@@ -2971,7 +2971,7 @@ discard block |
||
2971 | 2971 | print '<tr><td>'; |
2972 | 2972 | print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc')); |
2973 | 2973 | print '</td><td>'; |
2974 | - print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>'; |
|
2974 | + print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>'; |
|
2975 | 2975 | print '</td>'; |
2976 | 2976 | print '</tr>'; |
2977 | 2977 | } |
@@ -833,7 +833,7 @@ discard block |
||
833 | 833 | print '<tr class="liste_titre">'; |
834 | 834 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
835 | 835 | print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; |
836 | - $totalarray['nbfield']++; // For the column action |
|
836 | + $totalarray['nbfield']++; // For the column action |
|
837 | 837 | } |
838 | 838 | foreach ($all_fields_list as $key => $val) { |
839 | 839 | $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
847 | 847 | $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
848 | 848 | } |
849 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
849 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
850 | 850 | if (!empty($arrayfields['t.'.$key]['checked'])) { |
851 | 851 | print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; |
852 | 852 | $totalarray['nbfield']++; |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | // Action column |
868 | 868 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
869 | 869 | print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; |
870 | - $totalarray['nbfield']++; // For the column action |
|
870 | + $totalarray['nbfield']++; // For the column action |
|
871 | 871 | } |
872 | 872 | print '</tr>'."\n"; |
873 | 873 |