diff --git a/ChangeLog b/ChangeLog index ef33f664d04..e4fbf63e758 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,8 +8,9 @@ For Users: NEW: Stable module: Website NEW: Stable module: WebDAV NEW: Stable module: Module Builder -NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more tools. +NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more services. NEW: Experimental module "TakePos" +NEW: Experimental module "Ticket" NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making Android application like DoliDroid able to provide native features for multicompany module. NEW: Compatibility with PHP 7.3 @@ -22,10 +23,10 @@ For developers: WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: -* If you use some links like viewimages.php?modulepart=mycompany&file=... in you external modules, you must +* If you use some links like viewimages.php?modulepart=mycompany&file=... in your external modules, you must replace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for modulepart=mycompany that now works like others). - +* Hidden option MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT has been renamed into SHIPPING_PDF_DISPLAY_AMOUNT_HT ***** ChangeLog for 8.0.3 compared to 8.0.2 ***** diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index fee1848b925..db6fb35206b 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -907,7 +907,7 @@ else // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print '
| '.$langs->trans("Label").' | |
| '.$langs->trans("Label").' | |
| '.$langs->trans("SubscriptionRequired").' | ';
print $form->selectyesno("subscription",1,1);
diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php
index 611f7578193..3280492701e 100644
--- a/htdocs/admin/emailcollector_card.php
+++ b/htdocs/admin/emailcollector_card.php
@@ -1,6 +1,5 @@
- * Copyright (C) ---Put here your own copyright and developer email---
+/* Copyright (C) 2018 Laurent Destailleur |
| '.$langs->trans("MailTitle").' | |||||||||||||||||||||||||||||||
| '.$langs->trans("MailTitle").' | |||||||||||||||||||||||||||||||
| '.$langs->trans("MailFrom").' | |||||||||||||||||||||||||||||||
| '.$langs->trans("MailErrorsTo").' | |||||||||||||||||||||||||||||||
| '.$langs->trans("ContributionsToPay").($num?' '.$num.'':'').' | '; + print ''.$langs->trans("ContributionsToPay").($num?' '.$num.'':'').' | '; print ''.$langs->trans("DateDue").' | '; print ''.$langs->trans("AmountTTC").' | '; print ''.$langs->trans("Paid").' | '; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 4d643536388..94426ed54eb 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -773,7 +773,7 @@ else print '|||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| '; - print " | ".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname." | \n"; + print "".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname." | \n"; if ($modecompta == 'CREANCES-DETTES') print ''.price(-$obj->amount).' | '; print ''.price(-$obj->amount).' | '; diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index f50d940a51a..76ab712bffd 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -174,7 +174,7 @@ if ($action == 'delete') if ($result >= 0) { $db->commit(); - header("Location: ".DOL_URL_ROOT.'/compta/salaries/index.php'); + header("Location: ".DOL_URL_ROOT.'/compta/salaries/list.php'); exit; } else @@ -365,7 +365,7 @@ if ($id) dol_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'payment'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='".$salstatic->getNomUrl(1)." | \n"; // Employee diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 4ffa1a2829f..d7d762464ee 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -481,7 +481,7 @@ if ($id > 0) } $morehtmlref.=''; // Type print ' | '; - $formsocialcontrib->select_type_socialcontrib($typeid,'typeid',1,0,0,'maxwidth100onsmartphone'); + $formsocialcontrib->select_type_socialcontrib($search_typeid,'search_typeid',1,0,0,'maxwidth100onsmartphone'); print ' | '; // Period end date print ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 52a2c4bbe7f..ed237c215bf 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -133,7 +133,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('contact'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 96f20fdaf67..3631effa7b8 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -100,7 +100,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('contrat'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 'c.ref'=>'Ref', diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 72b45f49db5..da484b31747 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -84,7 +84,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('contratdet'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Security check $contratid = GETPOST('id','int'); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 9ebdbd22836..5cb88c0e2ad 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1941,24 +1941,36 @@ class ExtraFields /** * return array_options array of data of extrafields value of object sent by a search form * - * @param array $extralabels $array of extrafields (@deprecated) - * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) - * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) - * @return array|int array_options set or 0 if no value + * @param array|string $extrafieldsobjectkey array of extrafields (old usage) or value of object->table_element (new usage) + * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) + * @return array|int array_options set or 0 if no value */ - function getOptionalsFromPost($extralabels,$keyprefix='',$keysuffix='') + function getOptionalsFromPost($extrafieldsobjectkey, $keyprefix='', $keysuffix='') { global $_POST; - if (is_array($this->attributes[$object->table_element]['label'])) $extralabels=$this->attributes[$object->table_element]['label']; + if (is_string($extrafieldsobjectkey) && is_array($this->attributes[$extrafieldsobjectkey]['label'])) + { + $extralabels = $this->attributes[$extrafieldsobjectkey]['label']; + } + else + { + $extralabels = $extrafieldsobjectkey; + } - $array_options = array(); if (is_array($extralabels)) { + $array_options = array(); + // Get extra fields foreach ($extralabels as $key => $value) { - $key_type = $this->attributes[$object->table_element]['type'][$key]; + $key_type = ''; + if (is_string($extrafieldsobjectkey)) + { + $key_type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; + } if (in_array($key_type,array('date','datetime'))) { @@ -1987,8 +1999,7 @@ class ExtraFields return $array_options; } - else { - return 0; - } + + return 0; } } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 5824d2ca5ec..41b74079948 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -132,6 +132,7 @@ class FormFile if ($maxmin > 0) { + // MAX_FILE_SIZE doit précéder le champ input de type file $out .= ''; } @@ -1017,7 +1018,7 @@ class FormFile global $form; $disablecrop=1; - if (in_array($modulepart, array('societe','product','produit','service','expensereport','holiday','member','project','ticket','user'))) $disablecrop=0; + if (in_array($modulepart, array('expensereport','holiday','member','project','product','produit','service','societe','tax','ticket','user'))) $disablecrop=0; // Define relative path used to store the file if (empty($relativepath)) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index bc62ebc7604..a33d77cc9cb 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -317,14 +317,20 @@ class FormProjets * @param string $morecss More css added to the select component * @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids. * @param string $showproject 'all' = Show project info, ''=Hide project info + * @param User $usertofilter User object to use for filtering * @return int Nbr of project if OK, <0 if KO */ - function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showproject='all') + function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showproject='all', $usertofilter=null) { global $user,$conf,$langs; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + if (is_null($usertofilter)) + { + $usertofilter = $user; + } + $out=''; $hideunselectables = false; @@ -332,10 +338,10 @@ class FormProjets if (empty($projectsListId)) { - if (empty($user->rights->projet->all->lire)) + if (empty($usertofilter->rights->projet->all->lire)) { $projectstatic=new Project($this->db); - $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); + $projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertofilter,0,1); } } @@ -381,7 +387,7 @@ class FormProjets { $obj = $this->db->fetch_object($resql); // If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project. - if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($user->rights->societe->lire)) + if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($usertofilter->rights->societe->lire)) { // Do nothing } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index fe9d15c8322..bcf8bfe14a8 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -908,7 +908,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') { if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); } - $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + $search_array_options=$extrafields->getOptionalsFromPost($contactstatic->table_element,'','search_'); // Purge search criteria if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 75cc6735fe4..ff5a9fa4776 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7288,7 +7288,8 @@ function dol_getmypid() * If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000" * If param $mode is 2, can contains a list of int id separated by comma like "1,3,4" * If param $mode is 3, can contains a list of string separated by comma like "a,b,c" - * @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4') + * @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of ID separated with comma (Example '1,3,4') + * 3=value is list of string separated with comma (Example 'text 1,text 2'), 4=value is a list of ID separated with comma (Example '1,3,4') for search into a multiselect string ('1,2') * @param integer $nofirstand 1=Do not output the first 'AND' * @return string $res The statement to append to the SQL query */ @@ -7372,11 +7373,9 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) else if ($mode == 4) { $tmparray=explode(',',trim($crit)); - if (count($tmparray)) { $listofcodes=''; - foreach($tmparray as $val) { if ($val) @@ -7385,7 +7384,7 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) $newres .= ' OR '. $field . ' = \'' . $db->escape(trim($val)) . '\''; $newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . '\''; $newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . ',%\''; - $newres .= ')'; + $newres .= ')'; $i2++; } } diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 682746b3412..8792d8b762a 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -205,15 +205,15 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?leftmenu=donations&mainmenu=billing', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); -- Special expenses insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax&mainmenu=billing', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/list.php?leftmenu=tax_salary&mainmenu=billing', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/card.php?leftmenu=tax_salary&action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->write', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/list.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/stats/index.php?leftmenu=tax_salary', 'Statistics', 2, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/index.php?leftmenu=tax_loan&mainmenu=billing', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/list.php?leftmenu=tax_loan&mainmenu=billing', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?leftmenu=tax_loan&action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/calc.php?leftmenu=tax_loan', 'Calculator', 2, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/index.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/list.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'billing', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index bb13a0c2265..2c2c2d999f7 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -906,9 +906,9 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Social contributions if (! empty($conf->tax->enabled)) { - $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); + $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("List"),2,$user->rights->tax->charges->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social",$langs->trans("List"),2,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire); // VAT if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) @@ -948,9 +948,9 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->salaries->enabled)) { $langs->load("salaries"); - $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->read, '', $mainmenu, 'tax_salary'); + $newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary&mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->read, '', $mainmenu, 'tax_salary'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create",$langs->trans("NewPayment"),2,$user->rights->salaries->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->read); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->read); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"),2,$user->rights->salaries->read); } @@ -958,7 +958,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->loan->enabled)) { $langs->load("loan"); - $newmenu->add("/loan/index.php?leftmenu=tax_loan&mainmenu=billing",$langs->trans("Loans"),1,$user->rights->loan->read, '', $mainmenu, 'tax_loan'); + $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing",$langs->trans("Loans"),1,$user->rights->loan->read, '', $mainmenu, 'tax_loan'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create",$langs->trans("NewLoan"),2,$user->rights->loan->write); //if (empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); } diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index daa8d67e5d1..28ec5935582 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -146,8 +146,7 @@ class pdf_rouget extends ModelePdfExpedition $this->posxqtytoship=$this->page_largeur - $this->marge_droite - 28; $this->posxpuht=$this->page_largeur - $this->marge_droite; - if (!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) { - + if (!empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT)) { // Show also the prices $this->posxweightvol=$this->page_largeur - $this->marge_droite - 118; $this->posxqtyordered=$this->page_largeur - $this->marge_droite - 96; $this->posxqtytoship=$this->page_largeur - $this->marge_droite - 68; @@ -173,7 +172,7 @@ class pdf_rouget extends ModelePdfExpedition } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build pdf onto disk * @@ -187,7 +186,7 @@ class pdf_rouget extends ModelePdfExpedition */ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { - // phpcs:enable + // phpcs:enable global $user,$conf,$langs,$hookmanager; $object->fetch_thirdparty(); @@ -533,8 +532,11 @@ class pdf_rouget extends ModelePdfExpedition $voltxt=round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuring_units_string($object->lines[$i]->volume_units?$object->lines[$i]->volume_units:0,"volume"); } - $pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?' | |||||||||||||||||||||||
| !!! | '; } - + // Date Max Payment if ($objp->dlr > 0 ) { print ''; print dol_print_date($db->jdate($objp->dlr), 'day'); - + if ($invoice->hasDelay()) { print img_warning($langs->trans('Late')); } - + print ' | '; } else { print '-- | '; } - + // Multicurrency if (!empty($conf->multicurrency->enabled)) { diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index f155f513a18..aecdce1ae06 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -78,7 +78,7 @@ $diroutputmassaction=$conf->holiday->dir_output . '/temp/massgeneration/'.$user- $hookmanager->initHooks(array('holidaylist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('holiday'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Default sort order (if not yet defined by previous GETPOST) if (! $sortfield) $sortfield="cp.rowid"; diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index d1e2d87b444..05106e475cd 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -206,6 +206,9 @@ ALTER TABLE llx_emailcollector_emailcollectoraction ADD INDEX idx_emailcollector ALTER TABLE llx_emailcollector_emailcollectoraction ADD CONSTRAINT fk_emailcollectoraction_fk_emailcollector FOREIGN KEY (fk_emailcollector) REFERENCES llx_emailcollector_emailcollector(rowid); +ALTER TABLE llx_emailcollector_emailcollectorfilter ADD UNIQUE INDEX uk_emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue); +ALTER TABLE llx_emailcollector_emailcollectoraction ADD UNIQUE INDEX uk_emailcollector_emailcollectoraction (fk_emailcollector, type); + diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.key.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.key.sql index 0ef98e90b41..ef8a91b5d31 100644 --- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.key.sql +++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.key.sql @@ -19,3 +19,4 @@ ALTER TABLE llx_emailcollector_emailcollectoraction ADD INDEX idx_emailcollector ALTER TABLE llx_emailcollector_emailcollectoraction ADD CONSTRAINT fk_emailcollectoraction_fk_emailcollector FOREIGN KEY (fk_emailcollector) REFERENCES llx_emailcollector_emailcollector(rowid); -- END MODULEBUILDER INDEXES +ALTER TABLE llx_emailcollector_emailcollectoraction ADD UNIQUE INDEX uk_emailcollector_emailcollectoraction (fk_emailcollector, type); diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.key.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.key.sql index fb65963b63a..e0eb095fad1 100644 --- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.key.sql +++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.key.sql @@ -19,3 +19,5 @@ ALTER TABLE llx_emailcollector_emailcollectorfilter ADD INDEX idx_emailcollector ALTER TABLE llx_emailcollector_emailcollectorfilter ADD CONSTRAINT fk_emailcollectorfilter_fk_emailcollector FOREIGN KEY (fk_emailcollector) REFERENCES llx_emailcollector_emailcollector(rowid); -- END MODULEBUILDER INDEXES +ALTER TABLE llx_emailcollector_emailcollectorfilter ADD UNIQUE INDEX uk_emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue); + diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 2294d540b22..d9be14b3cb7 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1815,10 +1815,13 @@ EnableFeatureFor=Enable features for %s VATIsUsedIsOff=Note: The option to use sales Tax or VAT has been set to Off in the menu %s - %s, so Sale tax or Vat used will always be 0 for sales. SwapSenderAndRecipientOnPDF=Swap sender and recipient address on PDF FeatureSupportedOnTextFieldsOnly=Warning, feature supported on text fields only +EmailCollector=Email collector +EmailCollectorDescription=Add a scheduled job and a setup page to scan regularly email boxes (using IMAP protocol) and record emails received into your application, at the right place and/or create some record automatically (like leads). NewEmailCollector=New Email Collector EMailHost=Host of email IMAP server MailboxSourceDirectory=Mailbox source directory MailboxTargetDirectory=Mailbox target directory +EmailcollectorOperations=Operations done by collector CollectNow=Collect now DateLastResult=Date last collect LastResult=Last result @@ -1827,6 +1830,8 @@ EmailCollectorConfirmCollect=Do you want to run the collect for this collector n NoNewEmailToProcess=No new email to process NothingProcessed=Nothing done XEmailsDoneYActionsDone=%s emails analyzed, %s record/actions done by collector +RecordEvent=Record event +CreateLeadAndThirdParty=Create lead (and thirdparty if necessary) ##### Resource #### ResourceSetup=Configuration du module Resource UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list). diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index fa74cfa44bc..100a249f418 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -635,6 +635,8 @@ SendMail=Send email EMail=E-mail NoEMail=No email Email=Email +AlreadyRead=Alreay read +NotRead=Not read NoMobilePhone=No mobile phone Owner=Owner FollowingConstantsWillBeSubstituted=The following constants will be replaced with the corresponding value. diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index e2491167ed8..242472aff0a 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -264,7 +264,7 @@ if ($action == 'create') print '||||||||||||||||||||
| '.$langs->trans("Label").' | ||||||||||||
| '.$langs->trans("Label").' | ||||||||||||
| '.$langs->trans("ResourceFormLabel_ref").' | '; - print ''; // Type print ' | |||||||||||
| '.$langs->trans("ResourceType").' | '; diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 4492d74be65..55dddcc0a48 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -50,7 +50,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); $search_ref=GETPOST("search_ref"); $search_type=GETPOST("search_type"); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 5935a1d01a1..2fc046b5fb8 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -417,8 +417,8 @@ if (empty($reshook)) $object->idprof5 = trim(GETPOST('idprof5', 'alpha')); $object->idprof6 = trim(GETPOST('idprof6', 'alpha')); $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); - $object->code_client = GETPOST('customer_code', 'alpha'); - $object->code_fournisseur = GETPOST('supplier_code', 'alpha'); + $object->code_client = GETPOSTISSET('customer_code')?GETPOST('customer_code', 'alpha'):GETPOST('code_client', 'alpha'); + $object->code_fournisseur = GETPOSTISSET('supplier_code')?GETPOST('supplier_code', 'alpha'):GETPOST('code_fournisseur', 'alpha'); $object->capital = GETPOST('capital', 'alpha'); $object->barcode = GETPOST('barcode', 'alpha'); diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 684f6f8c471..f5513cb6aa3 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -121,7 +121,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('societe'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 760bfef4d27..086a3db6d41 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -63,7 +63,7 @@ $diroutputmassaction=$conf->website->dir_output . '/temp/massgeneration/'.$user- $hookmanager->initHooks(array('websitethirdpartylist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('thirdpartyaccount'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost('thirdpartyaccount','','search_'); unset($objectwebsiteaccount->fields['fk_soc']); // Remove this field, we are already on the thirdparty diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 2fcb296b433..8a7266a4003 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -117,7 +117,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('supplier_proposal'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" diff --git a/htdocs/takepos/customers.php b/htdocs/takepos/customers.php index f5bcb8557cf..fc7fbc54d2f 100644 --- a/htdocs/takepos/customers.php +++ b/htdocs/takepos/customers.php @@ -144,7 +144,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('societe'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost('societe','','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index a58031b2889..ce2d5c28555 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -331,7 +331,7 @@ input, select { } /* Focus definitions must be after standard definition */ -textarea:focus, button:focus { +textarea:focus { /* v6 box-shadow: 0 0 4px #8091BF; */ border: 1px solid #aaa !important; } @@ -1074,6 +1074,9 @@ select.selectarrowonleft option { /* border-bottom: 1px solid #BBB; */ /* max-width: inherit; why this ? */ } + input[type=text], input[type=password] { + max-width: 180px; + } .hideonsmartphone { display: none; } .hideonsmartphoneimp { display: none !important; } @@ -3313,6 +3316,7 @@ ul.noborder li:nth-child(even):not(.liste_titre) { .thumbstat150 { flex: 1 1 110px; margin-bottom: 8px; + width: 160px; } .dashboardlineindicator { float: left; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index a246786a53a..9d5a518c4bf 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3249,7 +3249,7 @@ div .tdtop { margin: 3px; border: 1px solid #ddd; box-shadow: none; - background: #ddd; + background: #eee; } .thumbstat { flex: 1 1 110px; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index ef78b5eff45..ab16161e844 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -58,7 +58,7 @@ $object = new Ticket($db); $extrafields = new ExtraFields($db); // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Initialize array of search criterias $search_all=trim(GETPOST("search_all",'alpha')); diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 7e8ae39564a..6ee61de76b9 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -258,7 +258,7 @@ class ActionsTicket // Extrafields $extrafields = new ExtraFields($this->db); $extralabels = $extrafields->fetch_name_optionals_label($fichinter->table_element); - $array_options = $extrafields->getOptionalsFromPost($extralabels); + $array_options = $extrafields->getOptionalsFromPost($fichinter->table_element); $fichinter->array_options = $array_options; $id = $fichinter->create($user); diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 1b43d0054b7..545a5fcf1ed 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -77,7 +77,7 @@ else $hookmanager->initHooks(array('ticketlist')); // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('ticket'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Default sort order (if not yet defined by previous GETPOST) if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 13b555b6d5c..1cfb8fbb5d5 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -311,7 +311,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco print '||||||||||||
| |||||||||||