diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php index 4809a418861..2d4b2e6d128 100644 --- a/htdocs/admin/company_socialnetworks.php +++ b/htdocs/admin/company_socialnetworks.php @@ -74,6 +74,8 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))) { } } } + + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index dc801059e41..038d8d0915c 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -241,7 +241,7 @@ if ($defaultvalue) { } -print '
entity) && !empty($debug)) ? '?debug=1' : '').'" method="POST">'; +print ''; if ($optioncss != '') { print ''; } @@ -393,8 +393,8 @@ if (!is_array($result) && $result<0) { // Actions print ''; if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) { - print ''.img_edit().''; - print ''.img_delete().''; + print ''.img_edit().''; + print ''.img_delete().''; } else { print ''; print ''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index a0790ba23fe..1ae714afdc5 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -882,12 +882,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) { } if ($keycode == 'sortorder') { // For column name 'sortorder', we use the field name 'position' - $sql .= "'".(int) GETPOST('position', 'int')."'"; + $sql .= (int) GETPOST('position', 'int'); } elseif ($_POST[$keycode] == '' && !($keycode == 'code' && $id == 10)) { $sql .= "null"; // For vat, we want/accept code = '' } elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; - } elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { + } elseif (in_array($keycode, array('joinfile', 'private', 'pos', 'position', 'scale', 'use_default'))) { $sql .= (int) GETPOST($keycode, 'int'); } else { $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; @@ -898,8 +898,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) { $sql .= ",1)"; dol_syslog("actionadd", LOG_DEBUG); - $result = $db->query($sql); - if ($result) { // Add is ok + $resql = $db->query($sql); + if ($resql) { // Add is ok setEventMessages($langs->transnoentities("RecordCreatedSuccessfully"), null, 'mesgs'); // Clean $_POST array, we keep only id of dictionary @@ -956,7 +956,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) { $sql .= "null"; // For vat, we want/accept code = '' } elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; - } elseif (in_array($keycode, array('private', 'position', 'scale'))) { + } elseif (in_array($keycode, array('joinfile', 'private', 'pos', 'position', 'scale', 'use_default'))) { $sql .= (int) GETPOST($keycode, 'int'); } else { $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; @@ -1234,7 +1234,7 @@ if ($id) { $class = ''; if ($value == 'pos') { - $valuetoshow = $langs->trans("Position"); $class = 'maxwidth100'; + $valuetoshow = $langs->trans("Position"); $class = 'right'; } if ($value == 'source') { $valuetoshow = $langs->trans("Contact"); @@ -1623,11 +1623,8 @@ if ($id) { if ($value == 'code') { $valuetoshow = $langs->trans("Code"); } - if ($value == 'pos') { - $cssprefix = 'right '; $valuetoshow = $langs->trans("Position"); - } - if ($value == 'position') { - $cssprefix = 'right '; $valuetoshow = $langs->trans("Position"); + if (in_array($value, array('pos', 'position'))) { + $valuetoshow = $langs->trans("Position"); $cssprefix = 'right '; } if ($value == 'libelle' || $value == 'label') { $valuetoshow = $langs->trans("Label"); @@ -1992,7 +1989,7 @@ if ($id) { if ($value == 'tracking') { $class .= ' tdoverflowauto'; } - if ($value == 'position') { + if (in_array($value, array('pos', 'position'))) { $class .= ' right'; } if ($value == 'localtax1_type') { @@ -2001,10 +1998,7 @@ if ($id) { if ($value == 'localtax2_type') { $class .= ' nowrap'; } - if ($value == 'pos') { - $class .= ' right'; - } - if ($value == 'use_default') { + if (in_array($value, array('use_default', 'fk_parent'))) { $class .= ' center'; } if ($value == 'public') { @@ -2377,7 +2371,10 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if ($fieldlist[$field] == 'code') { $class = 'maxwidth100'; } - if (in_array($fieldlist[$field], array('dayrule', 'day', 'month', 'year', 'pos', 'use_default', 'affect', 'delay', 'position', 'public', 'sortorder', 'sens', 'category_type'))) { + if (in_array($fieldlist[$field], array('pos', 'position'))) { + $classtd = 'right'; $class = 'maxwidth50 right'; + } + if (in_array($fieldlist[$field], array('dayrule', 'day', 'month', 'year', 'use_default', 'affect', 'delay', 'public', 'sortorder', 'sens', 'category_type', 'fk_parent'))) { $class = 'maxwidth50 center'; } if (in_array($fieldlist[$field], array('use_default', 'public'))) { diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 987f435e38f..3388b649a67 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -117,7 +117,7 @@ if (GETPOST('save', 'alpha')) { $error++; } - $fckeditor_test = GETPOST('formtestfield'); + $fckeditor_test = GETPOST('formtestfield', 'restricthtml'); if (!empty($fckeditor_test)) { if (!dolibarr_set_const($db, 'FCKEDITOR_TEST', $fckeditor_test, 'chaine', 0, '', $conf->entity)) { $error++; diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index e27c48b0416..8ba5a990c33 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -499,7 +499,7 @@ foreach ($object->fields as $key => $val) { if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { print $form->selectarray('search_'.$key, $val['arrayofkeyval'], empty($search[$key]) ? '' : $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); } elseif (strpos($val['type'], 'integer:') === 0) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); + print $object->showInputField($val, $key, empty($search[$key]) ? '' : $search[$key], '', '', 'search_', 'maxwidth150', 1); } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) { print ''; } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 494dfc2f625..f60e011f41c 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -919,7 +919,6 @@ if ($mode == 'common' || $mode == 'commonkanban') { if ($objMod->needUpdate) { $versionTitle = $langs->trans('ModuleUpdateAvailable').' : '.$objMod->lastVersion; print ''.$versiontrans.''; - $foundoneexternalmodulewithupdate++; } else { print $versiontrans; } @@ -937,6 +936,9 @@ if ($mode == 'common' || $mode == 'commonkanban') { print "\n"; } + if ($objMod->needUpdate) { + $foundoneexternalmodulewithupdate++; + } } if ($action == 'checklastversion') { diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index f836b8f0f0c..ed14f2ac119 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -78,7 +78,8 @@ $head = pdf_admin_prepare_head(); print dol_get_fiche_head($head, 'other', $langs->trans("other"), -1, 'pdf'); -print ''.$form->textwithpicto($langs->trans("PDFOtherDesc"), $s)."
\n"; +$tooltiptext = ''; +print ''.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)."
\n"; print "
\n"; print load_fiche_titre($langs->trans("Proposal"), '', ''); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 9b76329d8da..c87af9558e8 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -138,16 +138,18 @@ if (empty($action) && !GETPOSTISSET('action')) { if ($action == 'default') { // When action is default, we want a calendar view and not the list $action = (($defaultview != 'show_list') ? $defaultview : 'show_month'); } -if (GETPOST('viewcal', 'restricthtml') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') { +if (GETPOST('viewcal', 'int') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') { $action = 'show_month'; $day = ''; } // View by month -if (GETPOST('viewweek', 'restricthtml') || GETPOST('action', 'alpha') == 'show_week') { +if (GETPOST('viewweek', 'int') || GETPOST('action', 'alpha') == 'show_week') { $action = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d")); } // View by week -if (GETPOST('viewday', 'restricthtml') || GETPOST('action', 'alpha') == 'show_day') { +if (GETPOST('viewday', 'int') || GETPOST('action', 'alpha') == 'show_day') { $action = 'show_day'; $day = ($day ? $day : date("d")); } // View by day +$object = new ActionComm($db); + // Load translation files required by the page $langs->loadLangs(array('agenda', 'other', 'commercial')); @@ -197,6 +199,7 @@ if (GETPOST("viewperuser", 'alpha') || $action == 'show_peruser') { exit; } +/* if ($action == 'delete_action') { $event = new ActionComm($db); $event->fetch($actionid); @@ -206,6 +209,7 @@ if ($action == 'delete_action') { $result = $event->delete(); } +*/ /* @@ -484,25 +488,25 @@ $viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoaction //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewWeek").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewDay").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); //$viewmode .= ''; @@ -939,6 +943,7 @@ if ($showbirthday) { } } +// LEAVE CALENDAR $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.rowid = x.fk_user"; @@ -1877,7 +1882,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $cacheusers[$tmpid] = $newuser; } - $listofusertoshow .= '
'.$cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom'); + $listofusertoshow = ''; + $listofusertoshow .= '
'.$cacheusers[$tmpid]->getNomUrl(-1, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom'); print $listofusertoshow; } else { // Other calendar // Picto diff --git a/htdocs/core/boxes/box_scheduled_jobs.php b/htdocs/core/boxes/box_scheduled_jobs.php index 793b0cc8c79..53cf5c79571 100644 --- a/htdocs/core/boxes/box_scheduled_jobs.php +++ b/htdocs/core/boxes/box_scheduled_jobs.php @@ -85,7 +85,7 @@ class box_scheduled_jobs extends ModeleBoxes $resultarray = array(); $result = 0; - $sql = "SELECT t.rowid, t.datelastrun, t.datenextrun,"; + $sql = "SELECT t.rowid, t.datelastrun, t.datenextrun, t.datestart,"; $sql .= " t.label, t.status, t.test, t.lastresult"; $sql .= " FROM " . MAIN_DB_PREFIX . "cronjob as t"; $sql .= " WHERE status <> ".$cronstatic::STATUS_DISABLED; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 64fdb956ab0..b3ae722a5d3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7492,6 +7492,9 @@ abstract class CommonObject if ($display_type == 'card') { $out .= ''; + if ( ! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ) { + $out .= ''; + } $out .= ''; diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index b1819e24ab0..17dcdd557a4 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -596,7 +596,7 @@ class DolGraph // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Get max value + * Get max value among all values of all series * * @return int Max value */ @@ -607,25 +607,26 @@ class DolGraph return 0; } - $k = 0; - $vals = array(); + $max = null; - $nblines = count($this->data); - $nbvalues = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1); + $nbseries = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1); - for ($j = 0; $j < $nblines; $j++) { - for ($i = 0; $i < $nbvalues; $i++) { - $vals[$k] = $this->data[$j][$i + 1]; - $k++; + foreach($this->data as $x) { // Loop on each x + for ($i = 0; $i < $nbseries; $i++) { // Loop on each serie + if (is_null($max)) { + $max = $x[$i + 1]; // $i+1 because the index 0 is the legend + } elseif ($max < $x[$i + 1]) { + $max = $x[$i + 1]; + } } } - rsort($vals); - return $vals[0]; + + return $max; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Return min value of all data + * Return min value of all values of all series * * @return int Min value of all data */ @@ -636,20 +637,21 @@ class DolGraph return 0; } - $k = 0; - $vals = array(); + $min = null; - $nblines = count($this->data); - $nbvalues = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1); + $nbseries = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1); - for ($j = 0; $j < $nblines; $j++) { - for ($i = 0; $i < $nbvalues; $i++) { - $vals[$k] = $this->data[$j][$i + 1]; - $k++; + foreach($this->data as $x) { // Loop on each x + for ($i = 0; $i < $nbseries; $i++) { // Loop on each serie + if (is_null($min)) { + $min = $x[$i + 1]; // $i+1 because the index 0 is the legend + } elseif ($min > $x[$i + 1]) { + $min = $x[$i + 1]; + } } } - sort($vals); - return $vals[0]; + + return $min; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 83f66b204ee..d7097587a73 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -589,6 +589,7 @@ class Form if (!$htmltext) { return $text; } + $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 $tag = 'td'; if ($notabs == 2) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 60ffa14b75d..721c553c291 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -779,17 +779,25 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options = do { $oldstringtoclean = $out; - if (!empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) && $check != 'restricthtmlallowunvalid') { + if (!empty($out) && !empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) && $check != 'restricthtmlallowunvalid') { try { $dom = new DOMDocument; + // Add a trick to solve pb with text without parent tag + // like '

Foo

bar

' that ends up with '

Foo

bar

' + // like 'abc' that ends up with '

abc

' + $out = '
'.$out.'
'; + $dom->loadHTML($out, LIBXML_ERR_NONE|LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD|LIBXML_NONET|LIBXML_NOWARNING|LIBXML_NOXMLDECL); + $out = trim($dom->saveHTML()); + + // Remove the trick added to solve pb with text without parent tag + $out = preg_replace('/^
/', '', $out); + $out = preg_replace('/<\/div>$/', '', $out); } catch (Exception $e) { //print $e->getMessage(); return 'InvalidHTMLString'; } - $out = $dom->saveHTML(); } - //var_dump($oldstringtoclean);var_dump($out); // Ckeditor use the numeric entitic for apostrophe so we force it to text entity (all other special chars are correctly // encoded using text entities). This is a fix for CKeditor. diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index cd9ae5ad297..29f208e5254 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -906,7 +906,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) } // Use MAIN_OPTIMIZEFORTEXTBROWSER - if ($foruserprofile) { + if ($foruserprofile && !empty($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) { //$default=yn($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER); $default = $langs->trans('No'); print ''; @@ -953,7 +953,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) // Use MAIN_OPTIMIZEFORTEXTBROWSER - if ($foruserprofile) { + if ($foruserprofile && !empty($fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND)) { //$default=yn($conf->global->MAIN_OPTIMIZEFORCOLORBLIND); $default = $langs->trans('No'); print ''; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index a89ac4f826a..3e8ef7ea411 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -135,7 +135,7 @@ if (($line->info_bits & 2) == 2) { $format = (!empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 'dayhour' : 'day'); if ($line->fk_product > 0) { - print $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); + print $form->textwithtooltip($text, $description, 3, 0, '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); } else { $type = (!empty($line->product_type) ? $line->product_type : $line->fk_product_type); if ($type == 1) { @@ -146,7 +146,7 @@ if (($line->info_bits & 2) == 2) { if (!empty($line->label)) { $text .= ' '.$line->label.''; - print $form->textwithtooltip($text, dol_htmlentitiesbr($line->description), 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); + print $form->textwithtooltip($text, dol_htmlentitiesbr($line->description), 3, 0, '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); } else { if (!empty($line->fk_parent_line)) { print img_picto('', 'rightarrow'); @@ -179,7 +179,7 @@ if (($line->info_bits & 2) == 2) { } } else { if ($line->date_start || $line->date_end) { - print '
'.get_date_range($line->date_start, $line->date_end, $format).'
'; + print '
'.get_date_range($line->date_start, $line->date_end, $format).'
'; } //print get_date_range($line->date_start, $line->date_end, $format); } diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index eb778f521ad..b0f4d831473 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4955,7 +4955,7 @@ function migrate_export_import_profiles($mode = 'export') if ($oldfield != $newfield || $oldfilter != $newfilter) { $sqlupd = 'UPDATE '.MAIN_DB_PREFIX.$mode."_model SET field = '".$db->escape($newfield)."'"; if ($mode == 'export') { - $sql .= ", filter = '".$db->escape($newfilter)."'"; + $sqlupd .= ", filter = '".$db->escape($newfilter)."'"; } $sqlupd .= ' WHERE rowid='.$obj->rowid; $resultstring .= ''.$sqlupd."\n"; diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index df7192bee25..a0b7942d446 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -115,7 +115,7 @@ TransferTo=To TransferFromToDone=A transfer from %s to %s of %s %s has been recorded. CheckTransmitter=Sender ValidateCheckReceipt=Validate this check receipt? -ConfirmValidateCheckReceipt=Are you sure that you want to submit this check receipt for validation? No changes are possible it's done. +ConfirmValidateCheckReceipt=Are you sure that you want to submit this check receipt for validation? No changes will be possible once validated. DeleteCheckReceipt=Delete this check receipt? ConfirmDeleteCheckReceipt=Are you sure you want to delete this check receipt? BankChecks=Bank checks diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index aba05d67fc8..86fdfd753a5 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -127,4 +127,4 @@ AllowDelayedPayment=Allow delayed payment PrintPaymentMethodOnReceipts=Print payment method on tickets|receipts WeighingScale=Weighing scale ShowPriceHT = Display the column with the price excluding tax (on screen) -ShowPriceHTOnReceipt = Display the column with the price excluding tax (on receipt) +ShowPriceHTOnReceipt = Display the column with the price excluding tax (on the receipt) diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index eea045bdc89..3c074688b8e 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -55,7 +55,7 @@ TypeContact_ticket_internal_SUPPORTTEC=Assigned user TypeContact_ticket_external_SUPPORTCLI=Customer contact / incident tracking TypeContact_ticket_external_CONTRIBUTOR=External contributor -OriginEmail=Email reporter +OriginEmail=Reporter Email Notify_TICKET_SENTBYMAIL=Send ticket message by email # Status diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e9f5b16b6a9..82ff19e3771 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -448,7 +448,7 @@ if (!defined('NOTOKENRENEWAL')) { } // Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken'] - $token = dol_hash(uniqid(mt_rand(), true)); // Generates a hash of a random number + $token = dol_hash(uniqid(mt_rand(), false), 'md5'); // Generates a hash of a random number. We don't need a secured hash, just a changing random value. $_SESSION['newtoken'] = $token; dol_syslog("NEW TOKEN generated by : " . $_SERVER['PHP_SELF'], LOG_DEBUG); } @@ -1854,7 +1854,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $conf->browser->layout != 'phone') { $qs = dol_escape_htmltag($_SERVER["QUERY_STRING"]); - if (is_array($_POST)) { + if (isset($_POST) && is_array($_POST)) { foreach ($_POST as $key => $value) { if ($key !== 'action' && $key !== 'password' && !is_array($value)) { $qs .= '&'.$key.'='.urlencode($value); @@ -2063,7 +2063,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '') $dropdownBody .= '
'.$langs->trans("ConnectedSince").': '.dol_print_date($user->datelastlogin, "dayhour", 'tzuser'); $dropdownBody .= '
'.$langs->trans("PreviousConnexion").': '.dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser'); $dropdownBody .= '
'.$langs->trans("CurrentTheme").': '.$conf->theme; - $dropdownBody .= '
'.$langs->trans("CurrentMenuManager").': '.$menumanager->name; + $dropdownBody .= '
'.$langs->trans("CurrentMenuManager").': '.(isset($menumanager) ? $menumanager->name : 'unknown'); $langFlag = picto_from_langcode($langs->getDefaultLang()); $dropdownBody .= '
'.$langs->trans("CurrentUserLanguage").': '.($langFlag ? $langFlag.' ' : '').$langs->getDefaultLang(); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 0ac8cba1391..28bf0288c7b 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5282,17 +5282,6 @@ class Product extends CommonObject } $stock_commande_fournisseur = $this->stats_commande_fournisseur['qty']; } - if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->enabled)) { - $filterStatus = '4'; - if (isset($includedraftpoforvirtual)) { - $filterStatus = '0,'.$filterStatus; - } - $result = $this->load_stats_reception(0, $filterStatus, 1); - if ($result < 0) { - dol_print_error($this->db, $this->error); - } - $stock_reception_fournisseur = $this->stats_reception['qty']; - } if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->enabled)) { $filterStatus = '4'; if (isset($includedraftpoforvirtual)) { diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 4aaaf3a0fa7..7069f21e459 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -105,7 +105,8 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be print ''.$langs->trans("Search").''; } print ''; - print ''; + print ''; + print ''; if ($i == 0) { print ''; } @@ -336,11 +337,11 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us $product_static->status_buy = $objp->tobuy; $product_static->status_batch = $objp->tobatch; - //Multilangs + // Multilangs if (!empty($conf->global->MAIN_MULTILANGS)) { $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; - $sql .= " WHERE fk_product=".$objp->rowid; + $sql .= " WHERE fk_product=".((int) $objp->rowid); $sql .= " AND lang='".$db->escape($langs->getDefaultLang())."'"; $resultd = $db->query($sql); @@ -357,7 +358,7 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us print ''; print $product_static->getNomUrl(1, '', 16); print "\n"; - print ''.dol_trunc($objp->label, 32).''; + print ''.$objp->label.''; print ""; print dol_print_date($db->jdate($objp->datem), 'day'); print ""; @@ -372,7 +373,7 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us $objp->price = $price_result; } } - print ''; + print ''; if (isset($objp->price_base_type) && $objp->price_base_type == 'TTC') { print price($objp->price_ttc).' '.$langs->trans("TTC"); } else { diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 0ccdeb86b9b..30635c58b8c 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -60,11 +60,11 @@ if (empty($user->rights->takepos->run)) { if ($action == 'getProducts') { $object = new Categorie($db); if ($category == "supplements") { - $category = $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY; + $category = getDolGlobalInt('TAKEPOS_SUPPLEMENTS_CATEGORY'); } $result = $object->fetch($category); if ($result > 0) { - $prods = $object->getObjectsInCateg("product", 0, 0, 0, $conf->global->TAKEPOS_SORTPRODUCTFIELD, 'ASC'); + $prods = $object->getObjectsInCateg("product", 0, 0, 0, getDolGlobalString('TAKEPOS_SORTPRODUCTFIELD'), 'ASC'); // Removed properties we don't need if (is_array($prods) && count($prods) > 0) { foreach ($prods as $prod) { diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 7e2a2d5c1e1..1ddab39dcbe 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -703,12 +703,12 @@ function TakeposPrintingTemp(){ } function OpenDrawer(){ - console.log("OpenDrawer call ajax url http://global->TAKEPOS_PRINT_SERVER; ?>:8111/print"); + console.log("OpenDrawer call ajax url http://:8111/print"); $.ajax({ type: "POST", data: { token: 'notrequired' }, global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { + if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { echo "url: '".$conf->global->TAKEPOS_PRINT_SERVER."/printer/drawer.php',"; } else { echo "url: 'http://".$conf->global->TAKEPOS_PRINT_SERVER.":8111/print',"; @@ -781,7 +781,7 @@ function WeighingScale(){ $.ajax({ type: "POST", data: { token: 'notrequired' }, - url: 'global->TAKEPOS_PRINT_SERVER; ?>/scale/index.php', + url: '/scale/index.php', }) .done(function( editnumber ) { $("#poslines").load("invoice.php?action=updateqty&place="+place+"&idline="+selectedline+"&number="+editnumber, function() { @@ -799,7 +799,7 @@ $( document ).ready(function() { if ($_SESSION["takeposterminal"] == "") { print "ModalBox('ModalTerminal');"; } - if ($conf->global->TAKEPOS_CONTROL_CASH_OPENING) { + if (getDolGlobalString('TAKEPOS_CONTROL_CASH_OPENING')) { $sql = "SELECT rowid, status FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE"; $sql .= " entity = ".$conf->entity." AND "; $sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'"; @@ -818,7 +818,7 @@ $( document ).ready(function() { global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']} > 0 ? $conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']} : ''; +$keyCodeForEnter = getDolGlobalInt('CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']) > 0 ? getDolGlobalInt('CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']) : ''; ?>
@@ -1036,41 +1036,41 @@ $menus[$r++] = array('title'=>' $menus[$r++] = array('title'=>'
'.$langs->trans("Reduction").'
', 'action'=>'Reduction();'); $menus[$r++] = array('title'=>'
'.$langs->trans("Payment").'
', 'action'=>'CloseBill();'); -if ($conf->global->TAKEPOS_DIRECT_PAYMENT) { +if (getDolGlobalString('TAKEPOS_DIRECT_PAYMENT')) { $menus[$r++] = array('title'=>'
'.$langs->trans("DirectPayment").' ('.$langs->trans("Cash").')
', 'action'=>'DirectPayment();'); } // BAR RESTAURANT specific menu -if ($conf->global->TAKEPOS_BAR_RESTAURANT) { +if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) { if ($conf->global->TAKEPOS_ORDER_PRINTERS) { $menus[$r++] = array('title'=>'
'.$langs->trans("Order").'', 'action'=>'TakeposPrintingOrder();'); } //Button to print receipt before payment - if ($conf->global->TAKEPOS_BAR_RESTAURANT) { - if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { - if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { + if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) { + if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { + if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposConnector(placeid);'); } else { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposPrinting(placeid);'); } - } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { + } elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'DolibarrTakeposPrinting(placeid);'); } else { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'Print(placeid);'); } } - if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && $conf->global->TAKEPOS_ORDER_NOTES == 1) { + if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector" && getDolGlobalString('TAKEPOS_ORDER_NOTES') == 1) { $menus[$r++] = array('title'=>'
'.$langs->trans("OrderNotes").'
', 'action'=>'TakeposOrderNotes();'); } - if ($conf->global->TAKEPOS_SUPPLEMENTS) { + if (getDolGlobalString('TAKEPOS_SUPPLEMENTS')) { $menus[$r++] = array('title'=>'
'.$langs->trans("ProductSupplements").'
', 'action'=>'LoadProducts(\'supplements\');'); } } -if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { +if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { $menus[$r++] = array('title'=>'
'.$langs->trans("DOL_OPEN_DRAWER").'
', 'action'=>'OpenDrawer();'); } -if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { +if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { $menus[$r++] = array( 'title' => '
'.$langs->trans("DOL_OPEN_DRAWER").'
', 'action' => 'DolibarrOpenDrawer();', @@ -1112,7 +1112,7 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { $menus[$r++] = array('title'=>'
'.$langs->trans("Logout").'
', 'action'=>'window.location.href=\''.DOL_URL_ROOT.'/user/logout.php\';'); } -if ($conf->global->TAKEPOS_WEIGHING_SCALE) { +if (!empty($conf->global->TAKEPOS_WEIGHING_SCALE)) { $menus[$r++] = array('title'=>'
'.$langs->trans("WeighingScale").'
', 'action'=>'WeighingScale();'); } @@ -1124,12 +1124,12 @@ if ($conf->global->TAKEPOS_WEIGHING_SCALE) { foreach ($menus as $menu) { $i++; if (count($menus) > 12 and $i == 12) { - echo ''; - echo ''; + echo ''; + echo ''; } elseif ($i > 12) { - echo ''; + echo ''; } else { - echo ''; + echo ''; } } @@ -1169,7 +1169,7 @@ if ($conf->global->TAKEPOS_WEIGHING_SCALE) { //echo ''; echo ''; } else { - if (!$conf->global->TAKEPOS_HIDE_CATEGORY_IMAGES) { + if (!getDolGlobalString('TAKEPOS_HIDE_CATEGORY_IMAGES')) { echo ''; } } @@ -1208,7 +1208,7 @@ if ($conf->global->TAKEPOS_WEIGHING_SCALE) { //echo ''; print ''; } else { - if ($conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES) { + if (getDolGlobalString('TAKEPOS_HIDE_PRODUCT_IMAGES')) { echo ''; } else { print '
'; @@ -1216,7 +1216,7 @@ if ($conf->global->TAKEPOS_WEIGHING_SCALE) { } } ?> - global->TAKEPOS_HIDE_PRODUCT_IMAGES) { ?> +
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index f55f84130b6..8cef291c2d7 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -70,10 +70,10 @@ if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLI * View */ -if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == 'phone') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { +if ((getDolGlobalString('TAKEPOS_PHONE_BASIC_LAYOUT') == 1 && $conf->browser->layout == 'phone') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { // DIRECT LINK TO THIS PAGE FROM MOBILE AND NO TERMINAL SELECTED if ($_SESSION["takeposterminal"] == "") { - if ($conf->global->TAKEPOS_NUM_TERMINALS == "1") { + if (getDolGlobalString('TAKEPOS_NUM_TERMINALS') == "1") { $_SESSION["takeposterminal"] = 1; } else { header("Location: ".DOL_URL_ROOT."/takepos/index.php"); @@ -94,6 +94,8 @@ if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == '/takepos/js/jquery.colorbox-min.js' ); $arrayofjs = array('/takepos/js/jquery.colorbox-min.js'); + $disablejs = 0; + $disablehead = 0; top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); } @@ -132,12 +134,19 @@ if ($pay == 'cheque') { } // Retrieve paiementid -$sql = "SELECT id FROM ".MAIN_DB_PREFIX."c_paiement"; -$sql .= " WHERE entity IN (".getEntity('c_paiement').")"; -$sql .= " AND code = '".$db->escape($paycode)."'"; -$resql = $db->query($sql); -$obj = $db->fetch_object($resql); -$paiementid = $obj->id; +$paiementid = 0; +if ($paycode) { + $sql = "SELECT id FROM ".MAIN_DB_PREFIX."c_paiement"; + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; + $sql .= " AND code = '".$db->escape($paycode)."'"; + $resql = $db->query($sql); + if ($resql) { + $obj = $db->fetch_object($resql); + if ($obj) { + $paiementid = $obj->id; + } + } +} $invoice = new Facture($db); if ($invoiceid > 0) { @@ -164,7 +173,7 @@ if ($invoice->socid > 0) { */ // Change the currency of invoice if it was modified -if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "") { +if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"])) { if ($invoice->multicurrency_code != $_SESSION["takeposcustomercurrency"]) { $invoice->setMulticurrencyCode($_SESSION["takeposcustomercurrency"]); } @@ -855,25 +864,25 @@ if ($action == "valid" || $action == "history" || $action == 'creditnote') { } } $sectionwithinvoicelink .= '
'; - if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { - if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { + if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { + if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { $sectionwithinvoicelink .= ' '; } else { $sectionwithinvoicelink .= ' '; } - } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { + } elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { $sectionwithinvoicelink .= ' '; } else { $sectionwithinvoicelink .= ' '; - if ($conf->global->TAKEPOS_GIFT_RECEIPT) { + if (getDolGlobalString('TAKEPOS_GIFT_RECEIPT')) { $sectionwithinvoicelink .= ' '; } } - if ($conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE > 0) { + if (getDolGlobalString('TAKEPOS_EMAIL_TEMPLATE_INVOICE') && $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE > 0) { $sectionwithinvoicelink .= ' '; } - if ($remaintopay <= 0 && $conf->global->TAKEPOS_AUTO_PRINT_TICKETS) { + if ($remaintopay <= 0 && getDolGlobalString('TAKEPOS_AUTO_PRINT_TICKETS')) { $sectionwithinvoicelink .= ''; } } @@ -891,7 +900,7 @@ var selectedline=0; var selectedtext=""; var placeid= 0 ? $placeid : 0); ?>; $(document).ready(function() { - var idoflineadded = ; + var idoflineadded = ; $('.posinvoiceline').click(function(){ console.log("Click done on "+this.id); @@ -1017,7 +1026,7 @@ function TakeposPrinting(id){ receipt=data.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, ''); $.ajax({ type: "POST", - url: 'http://global->TAKEPOS_PRINT_SERVER; ?>:8111/print', + url: 'http://:8111/print', data: receipt }); }); @@ -1028,7 +1037,7 @@ function TakeposConnector(id){ $.get("/takepos/ajax/ajax.php?action=printinvoiceticket&term=&id="+id+"&token=", function(data, status) { $.ajax({ type: "POST", - url: 'global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php', + url: '/printer/index.php', data: 'invoice='+data }); }); @@ -1083,6 +1092,7 @@ $( document ).ready(function() { $sql .= $db->order('datec', 'ASC'); $resql = $db->query($sql); if ($resql) { + $max_sale = 0; while ($obj = $db->fetch_object($resql)) { echo '$("#customerandsales").append(\''; echo '
jdate($obj->datec), '%H:%M', 'tzuser'))).'" onclick="place=\\\''; @@ -1173,10 +1183,10 @@ $( document ).ready(function() { // for tooltip and other js beautifiers must be reexecuted too. if (!empty($conf->use_javascript_ajax)) { print "\n".''."\n"; - print ''."\n"; + print ''."\n"; } -print ''."\n"; +print ''."\n"; print '
'; print ''; if ($sectionwithinvoicelink && ($mobilepage == "invoice" || $mobilepage == "")) { @@ -1189,10 +1199,10 @@ if ($sectionwithinvoicelink && ($mobilepage == "invoice" || $mobilepage == "")) print ''; print ''; -if ($_SESSION["basiclayout"] != 1) { +if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) { print ''; print ''; - if ($conf->global->TAKEPOS_SHOW_HT) { + if (getDolGlobalString('TAKEPOS_SHOW_HT')) { print '\n"; -if ($_SESSION["basiclayout"] == 1) { +if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) { if ($mobilepage == "cats") { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $categorie = new Categorie($db); @@ -1336,13 +1346,14 @@ if ($_SESSION["basiclayout"] == 1) { if ($placeid > 0) { //In Phone basic layout hide some content depends situation - if ($_SESSION["basiclayout"] == 1 && $mobilepage != "invoice" && $action != "order") { + if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1 && $mobilepage != "invoice" && $action != "order") { return; } if (is_array($invoice->lines) && count($invoice->lines)) { print ''."\n"; $tmplines = array_reverse($invoice->lines); + $htmlsupplements = array(); foreach ($tmplines as $line) { if ($line->fk_parent_line != false) { $htmlsupplements[$line->fk_parent_line] .= 'fk_parent_line] .= ''; $htmlsupplements[$line->fk_parent_line] .= ''; $htmlsupplements[$line->fk_parent_line] .= ''; @@ -1383,7 +1394,7 @@ if ($placeid > 0) { } $htmlforlines .= '" id="'.$line->id.'">'; $htmlforlines .= ''; - if ($conf->global->TAKEPOS_SHOW_HT) { + if (getDolGlobalString('TAKEPOS_SHOW_HT')) { $htmlforlines .= ''; } $htmlforlines .= ''."\n"; - $htmlforlines .= $htmlsupplements[$line->id]; + $htmlforlines .= empty($htmlsupplements[$line->id]) ? '' : empty($htmlsupplements[$line->id]); print $htmlforlines; } diff --git a/htdocs/theme/md/theme_vars.inc.php b/htdocs/theme/md/theme_vars.inc.php index 9e98a863737..fd37b6376dd 100644 --- a/htdocs/theme/md/theme_vars.inc.php +++ b/htdocs/theme/md/theme_vars.inc.php @@ -65,6 +65,9 @@ $colortext = '0,0,0'; $colortextlink = '0,0,120'; $fontsize = '14'; $fontsizesmaller = '11'; +$topMenuFontSize = '1.1em'; +$toolTipBgColor = 'rgba(255, 255, 255, 0.96)'; +$toolTipFontColor = '#333'; // text color $textSuccess = '#28a745'; @@ -83,9 +86,15 @@ $badgeInfo = '#17a2b8'; $badgeDark = '#343a40'; $badgeLight = '#f8f9fa'; +// badge color ajustement for color blind +$colorblind_deuteranopes_badgeSuccess = '#37de5d'; //! text color black +$colorblind_deuteranopes_badgeSuccess_textColor7 = '#000'; +$colorblind_deuteranopes_badgeWarning = '#e4e411'; +$colorblind_deuteranopes_badgeDanger = $badgeDanger; // currently not tested with a color blind people so use default color + /* default color for status : After a quick check, somme status can have oposite function according to objects * So this badges status uses default value according to theme eldy status img -* TODO: use color definition vars above for define badges color status X -> expemple $badgeStatusValidate, $badgeStatusClosed, $badgeStatusActive .... +* TODO: use color definition vars above for define badges color status X -> exemple $badgeStatusValidate, $badgeStatusClosed, $badgeStatusActive .... */ $badgeStatus0 = '#cbd3d3'; $badgeStatus1 = '#bc9526'; @@ -99,3 +108,9 @@ $badgeStatus8 = '#993013'; $badgeStatus9 = '#e7f0f0'; $badgeStatus10 = '#993013'; $badgeStatus11 = '#15a540'; + +// status color ajustement for color blind +$colorblind_deuteranopes_badgeStatus4 = $colorblind_deuteranopes_badgeStatus7 = $colorblind_deuteranopes_badgeSuccess; //! text color black +$colorblind_deuteranopes_badgeStatus_textColor4 = $colorblind_deuteranopes_badgeStatus_textColor7 = '#000'; +$colorblind_deuteranopes_badgeStatus1 = $colorblind_deuteranopes_badgeWarning; +$colorblind_deuteranopes_badgeStatus_textColor1 = '#000'; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index fc9002e13fb..0eaf3d533a9 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -506,7 +506,6 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac $exp->id = $objp->rowid; $exp->ref = $objp->ref; - $exp->fk_type = $objp->fk_type; $exp->status = $objp->status; print ''; @@ -557,7 +556,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print_liste_field_titre("RIB"); print_liste_field_titre("IBAN"); print_liste_field_titre("BIC"); - print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); + print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', '', '', 'maxwidthsearch '); print "\n"; if ($account->id > 0) { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 1efbdb18714..152c39f79ac 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1451,8 +1451,12 @@ if ($action == 'create' || $action == 'adduserldap') { print ''.$langs->trans("None").''; } else { $huser = new User($db); - $huser->fetch($object->fk_user); - print $huser->getNomUrl(1); + if ($object->fk_user > 0) { + $huser->fetch($object->fk_user); + print $huser->getNomUrl(1); + } else { + print ''.$langs->trans("None").''; + } } print ''; print "\n"; diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 0a9a65a2852..79450f2d811 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -150,7 +150,9 @@ if ($id > 0) { if (!empty($user->admin)) { print ''; print ''; print ''; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 2136d0f07c5..957c7a3a819 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -407,7 +407,7 @@ if ($result) { print ''; - } elseif (is_array($permsgroupbyentity[$entity])) { + } elseif (isset($permsgroupbyentity[$entity]) && is_array($permsgroupbyentity[$entity])) { if (in_array($obj->id, $permsgroupbyentity[$entity])) { // Permission granted by group if ($caneditperms) { print '
'; // In phone version only show when it is invoice page -if ($mobilepage == "invoice" || $mobilepage == "") { +if (empty($mobilepage) || $mobilepage == "invoice") { print ''; } -if ($conf->global->TAKEPOS_BAR_RESTAURANT) { +if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) { $sql = "SELECT floor, label FROM ".MAIN_DB_PREFIX."takepos_floor_tables where rowid=".((int) $place); $resql = $db->query($sql); $obj = $db->fetch_object($resql); @@ -1215,14 +1225,14 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) { print $langs->trans("Products"); } print ''.$langs->trans('ReductionShort').''.$langs->trans('Qty').''; print '' . $langs->trans('TotalHTShort') . '
'; // In phone version only show when it is invoice page - if ($mobilepage == "invoice" || $mobilepage == "") { + if (empty($mobilepage) || $mobilepage == "invoice") { print '' . price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency) . ''; if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) { //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency @@ -1238,9 +1248,9 @@ if ($_SESSION["basiclayout"] != 1) { print '
'; print ''.$langs->trans('TotalTTCShort').'
'; // In phone version only show when it is invoice page - if ($mobilepage == "invoice" || $mobilepage == "") { + if (empty($mobilepage) || $mobilepage == "invoice") { print ''.price($invoice->total_ttc, 1, '', 1, -1, -1, $conf->currency).''; - if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) { + if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) { //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; $multicurrency = new MultiCurrency($db); @@ -1256,7 +1266,7 @@ if ($_SESSION["basiclayout"] != 1) { print "
'.vatrate($line->remise_percent, true).''.$line->qty.''.price($line->total_ttc).''; - if ($_SESSION["basiclayout"] == 1) { + if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) { $htmlforlines .= ''.$line->qty." x "; } if (isset($line->product_type)) { @@ -1425,10 +1436,10 @@ if ($placeid > 0) { if (!empty($line->array_options['options_order_notes'])) { $htmlforlines .= "
(".$line->array_options['options_order_notes'].")"; } - if ($_SESSION["basiclayout"] == 1) { + if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) { $htmlforlines .= '
  '; } - if ($_SESSION["basiclayout"] != 1) { + if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) { $moreinfo = ''; $moreinfo .= $langs->transcountry("TotalHT", $mysoc->country_code).': '.price($line->total_ht); if ($line->vat_src_code) { @@ -1479,10 +1490,10 @@ if ($placeid > 0) { } $htmlforlines .= ''; $htmlforlines .= price($line->total_ht, 1, '', 1, -1, -1, $conf->currency); - if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) { + if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) { //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; $multicurrency = new MultiCurrency($db); @@ -1493,7 +1504,7 @@ if ($placeid > 0) { } $htmlforlines .= ''; $htmlforlines .= price($line->total_ttc, 1, '', 1, -1, -1, $conf->currency); - if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) { + if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) { //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; $multicurrency = new MultiCurrency($db); @@ -1503,7 +1514,7 @@ if ($placeid > 0) { $htmlforlines .= '
ClickToDial URL'; - $url = $conf->global->CLICKTODIAL_URL; + if (!empty($conf->global->CLICKTODIAL_URL)) { + $url = $conf->global->CLICKTODIAL_URL; + } if (!empty($object->clicktodial_url)) { $url = $object->clicktodial_url; } diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 493383076b0..04fa0035418 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -35,6 +35,7 @@ $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', $search_group = GETPOST('search_group'); $optioncss = GETPOST('optioncss', 'alpha'); $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$contextpage = GETPOST('optioncss', 'aZ09'); // Defini si peux lire/modifier utilisateurs et permisssions $caneditperms = ($user->admin || $user->rights->user->user->creer); @@ -168,7 +169,6 @@ if ($resql) { print ''; print ''; print ''; - print ''; print ''; print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'object_group', 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index 6073ca4c88f..0413fda69b0 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -42,9 +42,11 @@ if ($user->socid > 0) { $socid = $user->socid; } -$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -$search_user = GETPOST('search_user', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); +$contextpage = GETPOST('optioncss', 'aZ09'); +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); // Load mode employee $mode = GETPOST("mode", 'alpha'); @@ -94,7 +96,7 @@ if (!is_array($user_arbo) && $user_arbo < 0) { $data[] = array('rowid'=>0, 'fk_menu'=>-1, 'title'=>"racine", 'mainmenu'=>'', 'leftmenu'=>'', 'fk_mainmenu'=>'', 'fk_leftmenu'=>''); foreach ($fulltree as $key => $val) { $userstatic->id = $val['id']; - $userstatic->ref = $val['label']; + $userstatic->ref = $val['id']; $userstatic->login = $val['login']; $userstatic->firstname = $val['firstname']; $userstatic->lastname = $val['lastname']; @@ -146,6 +148,8 @@ if (!is_array($user_arbo) && $user_arbo < 0) { $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1' : '').'&leftmenu=', '', $canadduser); + $morehtmlright = ''; + $morehtmlright .= dolGetButtonTitle($langs->trans("List"), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : '')); $param = array('morecss'=>'marginleftonly btnTitleSelected'); $morehtmlright .= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $param); diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 978c2d990b7..3acad0ac0c3 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -437,7 +437,7 @@ if ($result > 0) { } print ''; - if ($optioncss != '') { + if (isset($optioncss) && $optioncss != '') { print ''; } print ''; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index b492e31177f..72f9b075be9 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -370,10 +370,12 @@ if ($action == 'edit') { print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; - if (!empty($tmparray[$object->conf->MAIN_LANDING_PAGE])) { - print $langs->trans($tmparray[$object->conf->MAIN_LANDING_PAGE]); - } else { - print $object->conf->MAIN_LANDING_PAGE; + if (!empty($object->conf->MAIN_LANDING_PAGE)) { + if (!empty($tmparray[$object->conf->MAIN_LANDING_PAGE])) { + print $langs->trans($tmparray[$object->conf->MAIN_LANDING_PAGE]); + } else { + print $object->conf->MAIN_LANDING_PAGE; + } } //print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (! empty($object->conf->MAIN_LANDING_PAGE)?$object->conf->MAIN_LANDING_PAGE:''), 0, 0, 0, '', 1); print '
'; print img_picto($langs->trans("Active"), 'tick'); print '';