diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml index 5b55cdc54c82c..633cc53437b7c 100644 --- a/.github/workflows/stale-issues.yml +++ b/.github/workflows/stale-issues.yml @@ -3,7 +3,7 @@ name: "Close stale issues (bugs and feature requests)" on: schedule: - - cron: "0 0 * * *" + - cron: "0 20 * * *" jobs: stale: diff --git a/dev/examples/ldap/ldapadd_sample1.txt b/dev/examples/ldap/ldapadd_sample1.txt index 8a28529acb811..e998d6013a39c 100644 --- a/dev/examples/ldap/ldapadd_sample1.txt +++ b/dev/examples/ldap/ldapadd_sample1.txt @@ -11,4 +11,4 @@ objectclass: dcObject objectClass: organization objectClass: top dc: my-domain -o: Mon organisation \ No newline at end of file +o: my organisation diff --git a/dev/examples/ldap/ldapmodify_sample1.txt b/dev/examples/ldap/ldapmodify_sample1.txt index e3a8361ca31f0..e95d1dc03a702 100644 --- a/dev/examples/ldap/ldapmodify_sample1.txt +++ b/dev/examples/ldap/ldapmodify_sample1.txt @@ -12,4 +12,4 @@ objectclass: dcObject objectClass: organization objectClass: top dc: my-domain -o: Mon organisation \ No newline at end of file +o: my organisation diff --git a/dev/resources/licence/Links on GPL.txt b/dev/resources/licence/Links on GPL.txt index bb9c1597f682d..0fb3b63c8519b 100644 --- a/dev/resources/licence/Links on GPL.txt +++ b/dev/resources/licence/Links on GPL.txt @@ -1,7 +1,7 @@ -* Page with licence compatibility +* Page with license compatibility https://www.gnu.org/licenses/quick-guide-gplv3.fr.html -* FAQ on GPL licence +* FAQ on GPL license https://www.fsf.org/licensing/licenses/gpl-faq.html * Questions/Answers on Fork for using Dolibarr as a SaaS diff --git a/dev/resources/sepa/text.txt b/dev/resources/sepa/text.txt index 0a5336a128eab..e6c05276be22e 100644 --- a/dev/resources/sepa/text.txt +++ b/dev/resources/sepa/text.txt @@ -1,2 +1,2 @@ -To test a SEPA file: -http://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa \ No newline at end of file +To test a SEPA file: +https://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa diff --git a/dev/translation/README b/dev/translation/README index b470e4228d8e3..9727f91e2e6f7 100644 --- a/dev/translation/README +++ b/dev/translation/README @@ -3,11 +3,12 @@ README (English) This directory contains tools to generate translation files for a new languages or to update translation files for existing languages. See Dolibarr Wiki page: -http://wiki.dolibarr.org/index.php/Translator_documentation +https://wiki.dolibarr.org/index.php/Translator_documentation For more information on how to use them. +for Linux OS: To install transifex client: sudo pip install --upgrade transifex-client To update transifex client: -sudo pip install --upgrade transifex-client \ No newline at end of file +sudo pip install --upgrade transifex-client diff --git a/doc/user/README-DE.md b/doc/user/README-DE.md new file mode 100644 index 0000000000000..ea9458f45639a --- /dev/null +++ b/doc/user/README-DE.md @@ -0,0 +1,12 @@ +README (german) +LiesMich (deutsch) + +-------------------------------- +Benutzeranleitung +-------------------------------- + +Alle Dolibarr-Informationen sind online verfuegbar ueber die Webseiten: +https://www.dolibarr.de +oder +https://www.dolibarr.org +https://wiki.dolibarr.org diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index c7681c6f9ca1d..1b83d5eb03f09 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -47,6 +47,8 @@ $search_pcgtype = GETPOST('search_pcgtype', 'alpha'); $search_pcgsubtype = GETPOST('search_pcgsubtype', 'alpha'); +$chartofaccounts = GETPOST('chartofaccounts', 'int'); + // Security check if ($user->socid > 0) accessforbidden(); if (!$user->rights->accounting->chartofaccount) accessforbidden(); @@ -104,11 +106,9 @@ $search_pcgsubtype = ""; $search_array_options = array(); } - - if (GETPOST('change_chart', 'alpha') && (GETPOST('valid_change_chart', 'int') || empty($conf->use_javascript_ajax))) + if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on + || (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) // a submit of form is done and chartofaccounts combo has been modified { - $chartofaccounts = GETPOST('chartofaccounts', 'int'); - if ($chartofaccounts > 0) { // Get language code for this $chartofaccounts @@ -279,21 +279,13 @@ if (!empty($conf->use_javascript_ajax)) { - print ' + print ' '; @@ -340,8 +332,7 @@ else dol_print_error($db); print ""; print ajax_combobox("chartofaccounts"); - print ''; - print ''; + print ''; print '
'; print '
'; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index b9a787cc67c87..b149173904bdc 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -573,6 +573,18 @@ function init_myfunc() 'recordevent'=>'RecordEvent'); if ($conf->projet->enabled) $arrayoftypes['project'] = 'CreateLeadAndThirdParty'; if ($conf->ticket->enabled) $arrayoftypes['ticket'] = 'CreateTicketAndThirdParty'; + + // support hook for add action + $parameters = array( 'arrayoftypes' => $arrayoftypes ) ; + $res = $hookmanager->executeHooks('addMoreActionsEmailCollector', $parameters, $object, $action); + + if($res) + $arrayoftypes = $hookmanager->resArray; + else + foreach($hookmanager->resArray as $k=>$desc) + $arrayoftypes[$k]=$desc; + + print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300'); print ''; print ''; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index de550c0ac12ab..b302500ce3542 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -58,6 +58,13 @@ $action=''; } +// Convert action set_XXX and del_XXX to set var (this is used when no javascript on for ajax_constantonoff) +$regs = array(); +if (preg_match('/^(set|del)_([A-Z_]+)$/', $action, $regs)) { + if ($regs[1] == 'set') dolibarr_set_const($db, $regs[2], 1, 'chaine', 0, '', $conf->entity); + else dolibarr_del_const($db, $regs[2], $conf->entity); +} + if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND)) { dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); @@ -81,15 +88,15 @@ if ($action == 'update') { - dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); //dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity); - $val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE'); + /*$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE'); if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity); - else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity); + else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity);*/ $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity); @@ -141,25 +148,27 @@ if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_USE_CHECKED', $conf->entity); else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $val, 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["MAIN_DISABLE_JAVASCRIPT"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"], 'chaine', 0, '', $conf->entity); - - dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities - dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities - dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("main_size_liste_limit", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity); + + //dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'int'), 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, "MAIN_SHOW_LOGO", GETPOST("MAIN_SHOW_LOGO", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity); + + dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", GETPOST('MAIN_HELPCENTER_DISABLELINK', 'aZ09'), 'chaine', 0, '', 0); // Param for all entities + dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'none')), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'none')), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities + dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST('MAIN_BUGTRACK_ENABLELINK', 'aZ09'), 'chaine', 0, '', $conf->entity); $varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; if ($_FILES[$varforimage]["tmp_name"]) { + $reg = array(); if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) { $original_file=$reg[1]; @@ -248,7 +257,7 @@ // Multilingual GUI print ''.$langs->trans("EnableMultilangInterface").''; -print ajax_constantonoff('MAIN_MULTILANGS'); +print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0); print ''; print ' '; print ''; @@ -267,7 +276,7 @@ // Disable javascript and ajax print ''.$langs->trans("DisableJavascript").''; -print $form->selectyesno('MAIN_DISABLE_JAVASCRIPT', isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0, 1); +print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0); print ''; print ' '; print ''; diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 828d2ecff50b8..5cd988a5bed1d 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -278,6 +278,7 @@ print '
'; print ''; print ''; +print ''; print '
'; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index f5efd124322a8..7db4d3c97677d 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -112,6 +112,10 @@ $permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +if (!empty($conf->expedition->enabled) && $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER = 1){ + if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $object->warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE; + if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $object->warehouse_id = $user->fk_warehouse; +} /* * Actions diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 447f5f47ecca7..c9a77e5cc266d 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -455,7 +455,7 @@ $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye"; $sql .= ", s.nom as name"; $sql .= ", s.rowid as socid"; - $sql .= ", s.code_fournisseur, s.code_compta_fournisseur"; + $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.email"; $sql .= ", SUM(pf.amount) as am"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn"; @@ -503,10 +503,14 @@ $thirdpartystatic->id = $obj->socid; $thirdpartystatic->name = $obj->name; + $thirdpartystatic->email = $obj->email; + $thirdpartystatic->country_id = 0; + $thirdpartystatic->country_code = ''; + $thirdpartystatic->client = 0; $thirdpartystatic->fournisseur = 1; - //$thirdpartystatic->code_client = $obj->code_client; + $thirdpartystatic->code_client = ''; $thirdpartystatic->code_fournisseur = $obj->code_fournisseur; - //$thirdpartystatic->code_compta = $obj->code_compta; + $thirdpartystatic->code_compta = ''; $thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur; print ''; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 5a64728029a42..86fb598fb8be7 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -279,7 +279,7 @@ if (! empty($conf->banque->enabled)) { print ''.$langs->trans("BankAccount").''; - $form->select_comptes($_POST["accountid"], "accountid", 0, "courant=1", 1); // Affiche liste des comptes courant + $form->select_comptes(GETPOST("accountid", 'int'), "accountid", 0, "courant=1", 2); // List of bank account available print ''; } diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 328507f672212..41834b8d0f665 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -741,7 +741,7 @@ // Date if (!empty($arrayfields['c.date_contrat']['checked'])) { - print ''.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzuser').''; + print ''.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzserver').''; } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index ed267493e9777..94983ef6bff99 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -127,15 +127,17 @@ public function loadBox($max = 5) $boxcontent .= ''; $boxcontent .= ''."\n"; $boxcontent .= '
'."\n"; - $boxcontent .= ''; - // set cookie by js - $boxcontent .= ''; + '; + // set cookie by js + $boxcontent .= ''; + } $this->info_box_contents[0][] = array( 'tr'=>'class="nohover showiffilter'.$this->boxcode.' hideobject"', 'td' => 'class="nohover"', diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index ca40910aacd96..725d4bbb76aff 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -604,14 +604,14 @@ public function getSumCreditNotesUsed($invoice, $multicurrency = 0) $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture as f'; $sql .= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id; - $sql .= ' AND (f.type = 2 OR f.type = 0)'; // Find discount coming from credit note or excess received + $sql .= ' AND f.type IN (' . Facture::TYPE_STANDARD . ', ' . Facture::TYPE_CREDIT_NOTE . ', ' . Facture::TYPE_SITUATION . ')'; // Find discount coming from credit note or excess received } elseif ($invoice->element == 'invoice_supplier') { $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture_fourn as f'; $sql .= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.$invoice->id; - $sql .= ' AND (f.type = 2 OR f.type = 0)'; // Find discount coming from credit note or excess paid + $sql .= ' f.type IN (' . Facture::TYPE_STANDARD . ', ' . Facture::TYPE_CREDIT_NOTE . ')'; // Find discount coming from credit note or excess paid } else { diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index c379d1912d199..3b5dbd664d6a4 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -742,7 +742,7 @@ public static function selectColor($set_color = '', $prefix = 'f_color', $form_n if (!is_array($arrayofcolors) || count($arrayofcolors) < 1) { $langs->load("other"); - if (empty($conf->dol_use_jmobile)) + if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax)) { $out .= ''; $out .= ''; @@ -788,7 +788,7 @@ public static function selectColor($set_color = '', $prefix = 'f_color', $form_n } else // In most cases, this is not used. We used instead function with no specific list of colors { - if (empty($conf->dol_use_jmobile)) + if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax)) { $out .= ''; $out .= ''; diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 0c27f71013551..b6a295949a734 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1793,6 +1793,39 @@ public function doCollectOneCollector() } $tickettocreate->ref = $defaultref; } + // Create event specific on hook + // this code action is hook..... for support this call + elseif (substr($operation['type'], 0, 4) == 'hook'){ + global $hookmanager; + + if(!is_object($hookmanager)) + $hookmanager->initHooks(array('emailcollectorcard')); + + $parameters = array( + 'connection'=> $connection, + 'imapemail'=>$imapemail, + 'overview'=>$overview, + + 'from' => $from , + 'fromtext' => $fromtext, + + 'actionparam'=> $operation['actionparam'], + + + + 'thirdpartyid' => $thirdpartyid , + 'objectid'=>@$objectid, + 'objectemail'=>@$objectemail, + + 'messagetext'=>$messagetext, + 'subject'=>$subject, + 'header'=>$header, + ) ; + $res = $hookmanager->executeHooks('doCollectOneCollector', $parameters, $this, $operation['type']); + + if($res < 0 ) + $this->error = $hookmanager->resPrint; + } if ($errorforthisaction) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6ab40c3924c80..f901500cc6fc5 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -657,7 +657,7 @@ $_GET['socid'] = $_POST['socid']; $error++; } - if (!($_POST['fac_replacement'] > 0)) { + if (! (GETPOST('fac_replacement', 'int') > 0)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors'); } @@ -870,7 +870,7 @@ if (!$error && $_POST['origin'] && $_POST['originid']) { // Parse element/subelement (ex: project_task) - $element = $subelement = GETPOST('origin'); + $element = $subelement = GETPOST('origin', 'alpha'); /*if (preg_match('/^([^_]+)_([^_]+)/i',$_POST['origin'],$regs)) { $element = $regs[1]; @@ -894,8 +894,8 @@ { $element = 'projet'; } - $object->origin = GETPOST('origin'); - $object->origin_id = GETPOST('originid'); + $object->origin = GETPOST('origin', 'alpha'); + $object->origin_id = GETPOST('originid', 'int'); require_once DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php'; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ef09674f8aa67..af0c6a7a5790d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1896,7 +1896,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '') '; - if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) // This may be set by some pages that use different jquery version to avoid errors + if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) // This may be set by some pages that use different jquery version to avoid errors { $btnUser .= ' @@ -1941,7 +1941,9 @@ function top_menu_bookmark() $html = ''; // Define $bookmarks - if (!empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) + if (empty($conf->bookmark->enabled) || empty($user->rights->bookmark->lire)) return $html; + + if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) // This may be set by some pages that use different jquery version to avoid errors { include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php'; $langs->load("bookmarks"); diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index af78ab5b59dfe..6443b0d03a3cc 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -254,6 +254,9 @@ public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $fil $out.= $comboenhancement; } + if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $selected = $conf->global->MAIN_DEFAULT_WAREHOUSE; + if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $selected = $user->fk_warehouse; + $out.=''; -print ''; - -print ''; -print ''; -print ''; - -print ''; -print ''; -print ''; +if (!empty($arrayfields['e.ref']['checked'])) +{ + print ''; + print ''; + print ''; +} +if (!empty($arrayfields['e.lieu']['checked'])) +{ + print ''; + print ''; + print ''; +} +if (!empty($arrayfields['e.description']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['e.address']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['e.zip']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['e.town']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['stockqty']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['estimatedvalue']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['sellvalue']['checked'])) +{ + print ''; +} // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; @@ -357,9 +389,12 @@ print $hookmanager->resPrint; // Status -print ''; -print $form->selectarray('search_status', $warehouse->statuts, $search_status, 1, 0, 0, '', 1); -print ''; +if (!empty($arrayfields['e.statut']['checked'])) +{ + print ''; + print $form->selectarray('search_status', $warehouse->statuts, $search_status, 1, 0, 0, '', 1); + print ''; +} // Action column print ''; @@ -371,18 +406,57 @@ // Fields title label // -------------------------------------------------------------------- print ''; -print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "e.ref", "", $param, "", $sortfield, $sortorder); -print_liste_field_titre("LocationSummary", $_SERVER["PHP_SELF"], "e.lieu", "", $param, "", $sortfield, $sortorder); -print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stockqty", '', $param, '', $sortfield, $sortorder, 'right '); -print_liste_field_titre("EstimatedStockValue", $_SERVER["PHP_SELF"], "estimatedvalue", '', $param, '', $sortfield, $sortorder, 'right '); -print_liste_field_titre("EstimatedStockValueSell", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right '); + +if (!empty($arrayfields['e.ref']['checked'])) +{ + print_liste_field_titre($arrayfields['e.ref']['label'], $_SERVER["PHP_SELF"], "e.ref", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['e.lieu']['checked'])) +{ + print_liste_field_titre($arrayfields['e.lieu']['label'], $_SERVER["PHP_SELF"], "e.lieu", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['e.description']['checked'])) +{ + print_liste_field_titre($arrayfields['e.description']['label'], $_SERVER["PHP_SELF"], "e.description", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['e.address']['checked'])) +{ + print_liste_field_titre($arrayfields['e.address']['label'], $_SERVER["PHP_SELF"], "e.address", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['e.zip']['checked'])) +{ + print_liste_field_titre($arrayfields['e.zip']['label'], $_SERVER["PHP_SELF"], "e.zip", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['e.town']['checked'])) +{ + print_liste_field_titre($arrayfields['e.town']['label'], $_SERVER["PHP_SELF"], "e.town", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['stockqty']['checked'])) +{ + print_liste_field_titre($arrayfields['stockqty']['label'], $_SERVER["PHP_SELF"], "stockqty", '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['estimatedvalue']['checked'])) +{ + print_liste_field_titre($arrayfields['estimatedvalue']['label'], $_SERVER["PHP_SELF"], "estimatedvalue", '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['sellvalue']['checked'])) +{ + print_liste_field_titre($arrayfields['sellvalue']['label'], $_SERVER["PHP_SELF"], "sellvalue", '', $param, '', $sortfield, $sortorder, 'right '); +} + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; + // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "e.statut", '', $param, '', $sortfield, $sortorder, 'right '); + +if (!empty($arrayfields['e.statut']['checked'])) +{ + print_liste_field_titre($arrayfields['e.statut']['label'], $_SERVER["PHP_SELF"], "e.statut", '', $param, '', $sortfield, $sortorder, 'right '); +} + // Action column print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; print ''."\n"; @@ -410,33 +484,84 @@ // Show here line of result print ''; - print ''.$warehouse->getNomUrl(1).''; - if (!$i) $totalarray['nbfield']++; + + //print_r($arrayfields[]); + + // Label (ref) + if (!empty($arrayfields['e.ref']['checked'])) + { + print ''.$warehouse->getNomUrl(1).''; + } + // Location - print ''.$obj->lieu.''; - if (!$i) $totalarray['nbfield']++; + if (!empty($arrayfields['e.lieu']['checked'])) + { + print ''.$obj->lieu.''; + } + + // Description + if (!empty($arrayfields['e.description']['checked'])) + { + print ''.$obj->description.''; + } + + // Address + if (!empty($arrayfields['e.address']['checked'])) + { + print ''.$obj->address.''; + } + + // Zip + if (!empty($arrayfields['e.zip']['checked'])) + { + print ''.$obj->zip.''; + } + + if (!empty($arrayfields['e.town']['checked'])) + { + print ''.$obj->town.''; + } // Stock qty - print ''.price2num($obj->stockqty, 5).''; - if (!$i) $totalarray['nbfield']++; + if (!empty($arrayfields['stockqty']['checked'])) + { + print ''.price2num($obj->stockqty, 5).''; + } // PMP value - print ''; - if (price2num($obj->estimatedvalue, 'MT')) print price(price2num($obj->estimatedvalue, 'MT'), 1); - else print ''; - print ''; - if (!$i) $totalarray['nbfield']++; + if (!empty($arrayfields['estimatedvalue']['checked'])) + { + print ''; + + if (price2num($obj->estimatedvalue, 'MT')) + { + print price(price2num($obj->estimatedvalue, 'MT'), 1); + } + else + { + print ''; + } + + print ''; + } // Selling value - print ''; - if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($obj->sellvalue, 'MT'), 1); - else + if (!empty($arrayfields['sellvalue']['checked'])) { - $htmltext = $langs->trans("OptionMULTIPRICESIsOn"); - print $form->textwithtooltip($langs->trans("Variable"), $htmltext); + print ''; + + if (empty($conf->global->PRODUIT_MULTIPRICES)) + { + print price(price2num($obj->sellvalue, 'MT'), 1); + } + else + { + $htmltext = $langs->trans("OptionMULTIPRICESIsOn"); + print $form->textwithtooltip($langs->trans("Variable"), $htmltext); + } + + print ''; } - print ''; - if (!$i) $totalarray['nbfield']++; // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; @@ -446,8 +571,10 @@ print $hookmanager->resPrint; // Status - print ''.$warehouse->LibStatut($obj->statut, 5).''; - if (!$i) $totalarray['nbfield']++; + if (!empty($arrayfields['e.statut']['checked'])) + { + print ''.$warehouse->LibStatut($obj->statut, 5).''; + } // Action column print ''; @@ -469,18 +596,81 @@ if ($totalnboflines - $offset <= $limit) { print ''; - print ''.$langs->trans("Total").''; - print ''.price2num($totalStock, 5).''; - print ''.price(price2num($total, 'MT'), 1, $langs, 0, 0, -1, $conf->currency).''; - print ''; - if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($totalsell, 'MT'), 1, $langs, 0, 0, -1, $conf->currency); - else + + $emptyColumn = -1; + + if (!empty($arrayfields['e.ref']['checked'])) { - $htmltext = $langs->trans("OptionMULTIPRICESIsOn"); - print $form->textwithtooltip($langs->trans("Variable"), $htmltext); + $emptyColumn++; } - print ''; - print ''; + if (!empty($arrayfields['e.lieu']['checked'])) + { + $emptyColumn++; + } + if (!empty($arrayfields['e.description']['checked'])) + { + $emptyColumn++; + } + if (!empty($arrayfields['e.address']['checked'])) + { + $emptyColumn++; + } + if (!empty($arrayfields['e.zip']['checked'])) + { + $emptyColumn++; + } + if (!empty($arrayfields['e.town']['checked'])) + { + $emptyColumn++; + } + + for ($i=0; $i < $emptyColumn; $i++) + { + print ''; + } + + print ''.$langs->trans("Total").''; + + if (!empty($arrayfields['stockqty']['checked'])) + { + print ''.price2num($totalStock, 5).''; + } + if (!empty($arrayfields['estimatedvalue']['checked'])) + { + print ''.price(price2num($total, 'MT'), 1, $langs, 0, 0, -1, $conf->currency).''; + } + + if (!empty($arrayfields['sellvalue']['checked'])) + { + print ''; + if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($totalsell, 'MT'), 1, $langs, 0, 0, -1, $conf->currency); + else + { + $htmltext = $langs->trans("OptionMULTIPRICESIsOn"); + print $form->textwithtooltip($langs->trans("Variable"), $htmltext); + } + print ''; + } + + if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey = $object->table_element; + if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) + { + if (empty($extrafieldsobjectprefix)) $extrafieldsobjectprefix = 'ef.'; + + foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) + { + if (!empty($arrayfields[$extrafieldsobjectprefix.$key]['checked'])) + { + print ''; + } + } + } + + if (!empty($arrayfields['e.statut']['checked'])) + { + print ''; + } + print ''; print "\n"; } diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index c3eb7523e7d3d..17004a39a7186 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; // Load translation files required by the page -$langs->loadLangs(array('stock', 'other', 'productbatch')); +$langs->loadLangs(array('stocks', 'other', 'productbatch')); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 85544d5b837b5..6a919054ee066 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -167,6 +167,13 @@ function fail($message) $invoice->fk_facture_source = $fk_source; $invoice->update($user); } + + $sav_FACTURE_ADDON=''; + if (! empty($conf->global->TAKEPOS_ADDON)) + { + $sav_FACTURE_ADDON = $conf->global->FACTURE_ADDON; + $conf->global->FACTURE_ADDON = $conf->global->TAKEPOS_ADDON; + } $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]; if ($invoice->statut != Facture::STATUS_DRAFT) @@ -204,6 +211,12 @@ function fail($message) $res = $invoice->validate($user); } + // Restore save values + if (! empty($sav_FACTURE_ADDON)) + { + $conf->global->FACTURE_ADDON = $sav_FACTURE_ADDON; + } + $remaintopay = $invoice->getRemainToPay(); // Add the payment diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 13011cbb5f7ab..34b232adc8b55 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1537,7 +1537,7 @@ } .pictotitle { margin-: 8px; - margin-bottom: 4px; + /* margin-bottom: 4px; */ } @media only screen and (max-width: 767px) { @@ -1638,9 +1638,9 @@ vertical-align: text-bottom; } img.photoref, div.photoref { - border: 1px solid #DDD; - -webkit-box-shadow: 0px 0px 6px #DDD; - box-shadow: 0px 0px 6px #DDD; + /* border: 1px solid #DDD; */ + -webkit-box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2), 0px 0px 2px rgba(0, 0, 0, 0.1); + box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2), 0px 0px 2px rgba(0, 0, 0, 0.1); padding: 4px; height: 80px; width: 80px;