From 8c1af0fdb8c9216ff2dbb873830dc500a801d815 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 24 Jun 2020 12:24:47 +0200 Subject: [PATCH 01/71] fix enbtoty on supplier order --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 538af54fe23..4b42665199f 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -273,7 +273,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; - $sql.= " WHERE c.entity = ".$conf->entity; + $sql.= " WHERE c.entity IN (".getEntity('order_invoice').")"; if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'"; else $sql.= " AND c.rowid=".$id; From 77868ad2a366b2d46cb01ab372e89ac02df788d1 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 24 Jun 2020 12:42:41 +0200 Subject: [PATCH 02/71] fix entity on supplier order --- htdocs/fourn/class/fournisseur.commande.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 2ad30a60b80..cc394804823 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -273,7 +273,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; - $sql.= " WHERE c.entity IN (".getEntity('order_invoice').")"; + $sql.= " WHERE c.entity IN (".getEntity('supplier_order').")"; if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'"; else $sql.= " AND c.rowid=".$id; @@ -528,6 +528,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " fk_user_valid = ".$user->id; $sql.= " WHERE rowid = ".$this->id; $sql.= " AND fk_statut = ".self::STATUS_DRAFT; + $sql.= " AND entity IN (".getEntity('supplier_order').")"; $resql=$this->db->query($sql); if (! $resql) @@ -844,6 +845,7 @@ class CommandeFournisseur extends CommonOrder $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur SET billed = 1'; $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT; + $sql .= " AND entity IN (".getEntity('supplier_order').")"; if ($this->db->query($sql)) { if (! $error) From dfb7c3e194092f493d0b47d9debad29ffbfa5549 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Jun 2020 21:14:49 +0200 Subject: [PATCH 03/71] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index cc394804823..dd8cb1fe722 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -528,7 +528,6 @@ class CommandeFournisseur extends CommonOrder $sql.= " fk_user_valid = ".$user->id; $sql.= " WHERE rowid = ".$this->id; $sql.= " AND fk_statut = ".self::STATUS_DRAFT; - $sql.= " AND entity IN (".getEntity('supplier_order').")"; $resql=$this->db->query($sql); if (! $resql) From 960512acd9176be205b18dd0cbda9bd92f4caf5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Jun 2020 21:21:35 +0200 Subject: [PATCH 04/71] Update fournisseur.commande.class.php Action with filter on rowid does not need to have test on entity --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index dd8cb1fe722..ef8d4b4d93f 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -844,7 +844,7 @@ class CommandeFournisseur extends CommonOrder $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur SET billed = 1'; $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT; - $sql .= " AND entity IN (".getEntity('supplier_order').")"; + if ($this->db->query($sql)) { if (! $error) From 335a767f22a6d07cf97753baa3c85cb0bbf21259 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sat, 4 Jul 2020 16:37:11 +0200 Subject: [PATCH 05/71] remove warning when date end contract line empty --- htdocs/core/boxes/box_services_contracts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 9d96d11f64d..32edd21b98d 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -142,8 +142,8 @@ class box_services_contracts extends ModeleBoxes $thirdpartytmp->code_compta = $objp->code_compta; $thirdpartytmp->code_compta_fournisseur = $objp->code_compta_fournisseur; - $dateline = $this->db->jdate($objp->date_line); - if ($contractstatic->statut == Contrat::STATUS_VALIDATED && $objp->statut == ContratLigne::STATUS_OPEN && ($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late")); + $dateline =$this->db->jdate($objp->date_line); + if ($contractstatic->statut == Contrat::STATUS_VALIDATED && $objp->statut == ContratLigne::STATUS_OPEN && !empty($dateline) && ($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late")); // Multilangs if (!empty($conf->global->MAIN_MULTILANGS) && $objp->product_id > 0) // if option multilang is on From 03ae31ecedb8db7fe40f318a8c810ce5fc63ea89 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sat, 4 Jul 2020 16:37:50 +0200 Subject: [PATCH 06/71] remove warning when date end contract line empty --- htdocs/core/boxes/box_services_contracts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 32edd21b98d..7d6d2b0ee10 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -142,7 +142,7 @@ class box_services_contracts extends ModeleBoxes $thirdpartytmp->code_compta = $objp->code_compta; $thirdpartytmp->code_compta_fournisseur = $objp->code_compta_fournisseur; - $dateline =$this->db->jdate($objp->date_line); + $dateline = $this->db->jdate($objp->date_line); if ($contractstatic->statut == Contrat::STATUS_VALIDATED && $objp->statut == ContratLigne::STATUS_OPEN && !empty($dateline) && ($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late")); // Multilangs From 9cd8c3738ff299624c91dab708dc23029d8aeea4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Jul 2020 23:18:19 +0200 Subject: [PATCH 07/71] Fix trans --- htdocs/compta/facture/class/facture-rec.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 71be89f30f5..8a13cf0f814 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1349,7 +1349,7 @@ class FactureRec extends CommonInvoice $result = ''; - $label = ''.$langs->trans("ShowInvoice").''; + $label = ''.$langs->trans("RepeatableInvoice").''; if (!empty($this->ref)) { $label .= '
'.$langs->trans('Ref').': '.$this->ref; } From b33e6390995583b4f04a046c8f806ebf779be0be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Jul 2020 23:21:59 +0200 Subject: [PATCH 08/71] Prepare 12.0.1 --- ChangeLog | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/ChangeLog b/ChangeLog index 19c77c702fd..88b73db8bee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,41 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 12.0.1 compared to 12.0.0 ***** +FIX: $_POST must be GETPOST +FIX: 10.0 - fatal with postgreSQL +FIX: #14109 +FIX: #14112 +FIX: #14142 +FIX: all extrafields cleared after update of one of them +FIX: Avoid warning when creating a module with already existing files +FIX: change selected fields on company card +FIX: Correct ModuleBuilder left menu +FIX: create a deposit with amount using comma didn't work +FIX: CSS +FIX: Entry from stripe intent were reported into SEPA payments +FIX: Filter on status, closing opening status +FIX: html lost on html extrafield +FIX: Label of popup on thirdparty +FIX: missing possibility to change entity when propal cloning +FIX: missing setup of extrafields for MO +FIX: Missing the tooltip when creating bank account +FIX: Missing token +FIX: non numeric value on comm/card.php +FIX: SQL Problem in customer invoice list +FIX: SQL Problem in social contribution list +FIX: SQL Problem in supplier invoice list +FIX: SQL syntax error when editing extrafields +FIX: Sql type +FIX: takepos 12 hook +FIX: Update form erased extrafields that were hidden +FIX: Update of extrafields date +FIX: Update of extrafiels on draft object +FIX: upload documents into manual ECM was reported a permission error +FIX: Use of office365 TLS with SMTPs method. +FIX: wrong origin +FIX: Permission error during import + ***** ChangeLog for 12.0.0 compared to 11.0.0 ***** For users: From b76828df9fb4674cf0d954e9f78a34d264dd8b21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 09:39:26 +0200 Subject: [PATCH 09/71] Fix use of newtoken() --- htdocs/projet/element.php | 4 ++-- htdocs/public/payment/newpayment.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index c6932e34f45..bafa9a0f30e 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -592,7 +592,7 @@ if (!$showdatefilter) { print '
'; print '
'; - print ''; + print ''; print ''; print ''; print ''; @@ -894,7 +894,7 @@ foreach ($listofreferent as $key => $value) // Define form with the combo list of elements to link $addform .= '
'; $addform .= ''; - $addform .= ''; + $addform .= ''; $addform .= ''; $addform .= ''; $addform .= ''; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index ea7fd71c9e6..bcee660a17d 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -2275,7 +2275,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment var hiddenInput2 = document.createElement('input'); hiddenInput2.setAttribute('type', 'hidden'); hiddenInput2.setAttribute('name', 'token'); - hiddenInput2.setAttribute('value', ''); + hiddenInput2.setAttribute('value', ''); form.appendChild(hiddenInput2); // Submit the form @@ -2299,7 +2299,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment var hiddenInput2 = document.createElement('input'); hiddenInput2.setAttribute('type', 'hidden'); hiddenInput2.setAttribute('name', 'token'); - hiddenInput2.setAttribute('value', ''); + hiddenInput2.setAttribute('value', ''); form.appendChild(hiddenInput2); // Submit the form From 466b7e84efbee9cebed5445e9aa58699bbde2a75 Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 6 Jul 2020 09:58:44 +0200 Subject: [PATCH 10/71] FIX : soc filter doesn't work on task list --- htdocs/projet/tasks/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index b97710ba7b6..36c06cd97f2 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -58,6 +58,7 @@ $search_task_label=GETPOST('search_task_label'); $search_task_description=GETPOST('search_task_description'); $search_project_user=GETPOST('search_project_user'); $search_task_user=GETPOST('search_task_user'); +$search_societe=GETPOST('search_societe'); $mine = $_REQUEST['mode']=='mine' ? 1 : 0; if ($mine) { $search_task_user = $user->id; $mine = 0; } From 056aa81ed392fca2ee75c5605e3e75370ba47cc7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 10:59:23 +0200 Subject: [PATCH 11/71] Fix responsive --- htdocs/langs/en_US/projects.lang | 1 + htdocs/projet/element.php | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index e61c86d2999..a068fe247fe 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -178,6 +178,7 @@ TypeContact_project_task_internal_TASKCONTRIBUTOR=Contributor TypeContact_project_task_external_TASKCONTRIBUTOR=Contributor SelectElement=Select element AddElement=Link to element +LinkToElementShort=Link to # Documents models DocumentModelBeluga=Project document template for linked objects overview DocumentModelBaleine=Project document template for tasks diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index bafa9a0f30e..5f400dfe7b7 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -884,7 +884,7 @@ foreach ($listofreferent as $key => $value) if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename, $exclude_select_element)) { - $selectList = $formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300', -2, !empty($project_field) ? $project_field : 'fk_projet'); + $selectList = $formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300 minwidth75imp', -2, !empty($project_field) ? $project_field : 'fk_projet'); if ($selectList < 0) { setEventMessages($formproject->error, $formproject->errors, 'errors'); @@ -899,9 +899,9 @@ foreach ($listofreferent as $key => $value) $addform .= ''; $addform .= ''; $addform .= ''; - $addform .= '
'; + $addform .= '
'.$langs->trans("SelectElement").'
'; $addform .= ''; - $addform .= ''; + $addform .= ''; $addform .= '
'.$langs->trans("SelectElement").''.$selectList.'
'; $addform .= '
'; $addform .= '
'; @@ -910,9 +910,9 @@ foreach ($listofreferent as $key => $value) if (empty($conf->global->PROJECT_CREATE_ON_OVERVIEW_DISABLED) && $urlnew) { $addform .= '
'; - if ($testnew) $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; + if ($testnew) $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { - $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; + $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; } $addform .= '
'; } @@ -920,6 +920,7 @@ foreach ($listofreferent as $key => $value) print load_fiche_titre($langs->trans($title), $addform, ''); print "\n".''."\n"; + print '
'; print ''; print ''; @@ -1038,7 +1039,7 @@ foreach ($listofreferent as $key => $value) print "\n"; // Ref - print '
'; + print ''; if ($tablename == 'expensereport_det') { print $expensereport->getNomUrl(1); @@ -1375,6 +1376,7 @@ foreach ($listofreferent as $key => $value) } } print "
"; + print '
'; print "
\n"; } } From 053a1a2230c2e90b01b58dd673fafe1a4839f865 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 11:22:30 +0200 Subject: [PATCH 12/71] Fix duplicate code --- htdocs/compta/resultat/index.php | 67 +------------------------------- 1 file changed, 2 insertions(+), 65 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 887412bc6a4..8c223e3615a 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -499,7 +499,7 @@ elseif ($modecompta=="BOOKKEEPING") } /* - * Charges sociales non deductibles + * Social contributions */ $subtotal_ht = 0; @@ -524,7 +524,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; $sql.= " WHERE p.fk_charge = cs.rowid"; $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } @@ -560,68 +559,6 @@ elseif ($modecompta=="BOOKKEEPING") } -/* - * Charges sociales deductibles - */ - -$subtotal_ht = 0; -$subtotal_ttc = 0; -if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) -{ - if ($modecompta == 'CREANCES-DETTES') - { - $sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; - } - elseif ($modecompta=="RECETTES-DEPENSES") - { - $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = cs.rowid"; - $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; - } - - $sql.= " AND cs.entity = ".$conf->entity; - $sql.= " GROUP BY c.libelle, dm"; - - dol_syslog("get social contributions paid deductible=1", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; - - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } - } - } else { - dol_print_error($db); - } -} -elseif ($modecompta=="BOOKKEEPING") -{ - // Nothing from this table -} - - /* * Salaries */ @@ -734,7 +671,7 @@ elseif ($modecompta == 'BOOKKEEPING') { /* - * Donation get dunning paiement + * Donation get dunning payments */ if (! empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) From 2629a98851bc0405e74de669fba17bc38effcb87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 11:31:05 +0200 Subject: [PATCH 13/71] Fix regression --- htdocs/compta/resultat/index.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 8c223e3615a..48ededa29bc 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -512,7 +512,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; } @@ -531,7 +530,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco $sql.= " AND cs.entity = ".$conf->entity; $sql.= " GROUP BY c.libelle, dm"; - dol_syslog("get social contributions deductible=0 ", LOG_DEBUG); + dol_syslog("get social contributions", LOG_DEBUG); $result=$db->query($sql); if ($result) { $num = $db->num_rows($result); From 9b1163cfb87c688cd75f4c6af3aecd9c590ddc03 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 11:52:28 +0200 Subject: [PATCH 14/71] Fix menu organisation. --- htdocs/compta/bank/various_payment/list.php | 2 +- htdocs/compta/charges/index.php | 2 ++ htdocs/core/menus/init_menu_auguria.sql | 29 ++++++++++++--------- htdocs/core/menus/standard/eldy.lib.php | 20 +++++++------- htdocs/langs/en_US/main.lang | 1 + 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 5f68440809c..4e836f10af0 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -180,7 +180,7 @@ if ($result) print ''; print ''; - print_barre_liste($langs->trans("VariousPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1); + print_barre_liste($langs->trans("MenuVariousPayment"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1); print '
'; print ''."\n"; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index c64797b801c..1f69a6aa1c8 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -465,6 +465,7 @@ while ($j < $numlt) // Payment Salary +/* if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) { if (!$mode || $mode != 'sconly') @@ -575,6 +576,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) } } } +*/ print ''; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index ede2a9f94d3..03f8951b0f8 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -222,27 +222,32 @@ 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', 2002__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/list.php?mainmenu=billing&leftmenu=donations', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 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->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?mainmenu=billing&leftmenu=donations', '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?mainmenu=billing&leftmenu=tax', '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__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', '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__, '/salaries/card.php?mainmenu=billing&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__, '/salaries/list.php?mainmenu=billing&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__, '/salaries/stats/index.php?mainmenu=billing&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/list.php?mainmenu=billing&leftmenu=tax_loan', '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?mainmenu=billing&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?mainmenu=billing&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?mainmenu=billing&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 || $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?mainmenu=billing&leftmenu=tax', 'MenuTaxesAndSpecialExpenses', 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__); +-- Social contributions 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?mainmenu=billing&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?mainmenu=billing&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?mainmenu=billing&leftmenu=tax_social&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); +-- VAT 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?mainmenu=billing&leftmenu=tax_vat', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __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) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?mainmenu=billing&leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __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) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/list.php?mainmenu=billing&leftmenu=tax_vat', 'List', 2, 'companies', '$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 && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/index.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByMonth', 2, 'companies', '$user->rights->tax->charges->lire', '', 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 && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$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) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2305__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 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->banque->enabled && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 2200__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'MenuVariousPayment', 1, 'banks', '$user->rights->banque->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->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/card.php?mainmenu=billing&leftmenu=tax_various&action=create', 'New', 2, 'various_payment', '$user->rights->banque->modifier', '', 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->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'List', 2, 'various_payment', '$user->rights->banque->lire', '', 0, 3, __ENTITY__); +-- Salary +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', 6__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Salaries', 0, 'salaries', '$user->rights->salaries->read', '', 0, 10, __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__, '/salaries/card.php?mainmenu=billing&leftmenu=tax_salary&action=create', 'NewPayment', 1, '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__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Payments', 1, '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__, '/salaries/stats/index.php?mainmenu=billing&leftmenu=tax_salary', 'Statistics', 1, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__); +-- Loan +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', 6__+MAX_llx_menu__, '/loan/list.php?mainmenu=billing&leftmenu=tax_loan', 'Loans', 0, 'loan', '$user->rights->loan->read', '', 0, 20, __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?mainmenu=billing&leftmenu=tax_loan&action=create', 'NewLoan', 1, '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?mainmenu=billing&leftmenu=tax_loan', 'Payments', 1, '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?mainmenu=billing&leftmenu=tax_loan', 'Calculator', 1, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); +-- Various payments +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->banque->enabled && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 6__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'MenuVariousPayment', 0, 'banks', '$user->rights->banque->lire', '', 0, 30, __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->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/card.php?mainmenu=billing&leftmenu=tax_various&action=create', 'New', 1, 'various_payment', '$user->rights->banque->modifier', '', 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->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'List', 1, 'various_payment', '$user->rights->banque->lire', '', 0, 3, __ENTITY__); -- Accounting (Double entries) 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->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accountancy', 9__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', 0, 'main', '! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__); -- Setup diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 0bfa4cfd2db..99c9a1002a5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1096,7 +1096,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM global $mysoc; $permtoshowmenu = ((!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)); - $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); + $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); // Social contributions if (!empty($conf->tax->enabled)) @@ -1151,11 +1151,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->salaries->enabled)) { $langs->load("salaries"); - $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 1, $user->rights->salaries->read, '', $mainmenu, 'tax_salary'); + $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->rights->salaries->read, '', $mainmenu, 'tax_salary'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) { - $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("NewPayment"), 2, $user->rights->salaries->write); - $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("Payments"), 2, $user->rights->salaries->read); - $newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 2, $user->rights->salaries->read); + $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("NewPayment"), 1, $user->rights->salaries->write); + $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("Payments"), 1, $user->rights->salaries->read); + $newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 1, $user->rights->salaries->read); } } @@ -1163,9 +1163,9 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->loan->enabled)) { $langs->load("loan"); - $newmenu->add("/loan/list.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"), 0, $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); + $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 1, $user->rights->loan->write); //$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); } } @@ -1174,10 +1174,10 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->banque->enabled) && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { $langs->load("banks"); - $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 1, $user->rights->banque->lire, '', $mainmenu, 'tax_various'); + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->rights->banque->lire, '', $mainmenu, 'tax_various'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) { - $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 2, $user->rights->banque->modifier); - $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 2, $user->rights->banque->lire); + $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 1, $user->rights->banque->modifier); + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 1, $user->rights->banque->lire); } } } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index dd250316bc7..ab9ead7e991 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -701,6 +701,7 @@ MenuECM=Documents MenuAWStats=AWStats MenuMembers=Members MenuAgendaGoogle=Google agenda +MenuTaxesAndSpecialExpenses=Taxes | Special expenses ThisLimitIsDefinedInSetup=Dolibarr limit (Menu home-setup-security): %s Kb, PHP limit: %s Kb NoFileFound=No documents saved in this directory CurrentUserLanguage=Current language From 7d7ef1e72afef36113bbd6eb5bf553c8c72f8da2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 15:34:26 +0200 Subject: [PATCH 15/71] FIX option PRODUIT_CUSTOMER_PRICES_BY_QTY Fix setup of product --- htdocs/core/lib/ajax.lib.php | 14 ++++++++-- htdocs/core/tpl/objectline_create.tpl.php | 16 ++++++++--- htdocs/product/admin/product.php | 9 ++++-- htdocs/product/price.php | 34 +++++++++++++++-------- 4 files changed, 53 insertions(+), 20 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 1d3e80b90be..fc481e70957 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -61,7 +61,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen $script .= ''."\n"; // Local calendar - $s .= '
'.$langs->trans("LocalAgenda").'  
'; + $s .= '
'.$langs->trans("LocalAgenda").'  
'; // External calendars if (is_array($showextcals) && count($showextcals) > 0) @@ -487,7 +534,7 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on $link .= ''; } -print load_fiche_titre($s, $link.'     '.$nav, '', 0, 0, 'tablelistofcalendars'); +//print load_fiche_titre($s, $link.'     '.$nav, '', 0, 0, 'tablelistofcalendars'); // Load events from database into $eventarray @@ -1109,6 +1156,11 @@ if (is_readable($color_file)) if (!is_array($theme_datacolor)) $theme_datacolor = array(array(120, 130, 150), array(200, 160, 180), array(190, 190, 220)); +print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1, 'object_action', 0, $nav.''.$newcardbutton, '', $limit, 0, 0, 1, $viewmode); + +print $s; + + if (empty($action) || $action == 'show_month') // View by month { $newparam = $param; // newparam is for birthday links @@ -1122,6 +1174,9 @@ if (empty($action) || $action == 'show_month') // View by month $newparam = preg_replace('/showbirthday_=/i', 'showbirthday=', $newparam); // Restore correct parameter $newparam .= '&viewcal=1'; + print '
'; + print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); + print '
'; print '
'; print '
'; @@ -1200,6 +1255,10 @@ if (empty($action) || $action == 'show_month') // View by month $newparam = preg_replace('/showbirthday_=/i', 'showbirthday=', $newparam); // Restore correct parameter $newparam .= '&viewweek=1'; + print '
'; + print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); + print '
'; + print '
'; print '
'; print ' '; @@ -1256,7 +1315,11 @@ if (empty($action) || $action == 'show_month') // View by month $timestamp = dol_mktime(12, 0, 0, $month, $day, $year); $arraytimestamp = dol_getdate($timestamp); - //echo '
'; + print '
'; + print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); + print '
'; + + print '
'; echo '
'; echo ' '; @@ -1274,6 +1337,7 @@ if (empty($action) || $action == 'show_month') // View by month */ echo '
'; + print '
'; /* WIP View per hour */ $useviewhour = 0; @@ -1301,9 +1365,8 @@ if (empty($action) || $action == 'show_month') // View by month { echo '
'."\n"; echo '
'.dol_print_date($i * 3600, 'hour', 'gmt').'
'; - echo '
'; - echo "
\n"; - echo "
\n"; + echo '
'."\n"; + echo '
'."\n"; $i++; $j++; } diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 20b756877cc..ee06b9d19f1 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -428,7 +428,9 @@ if ($resql) $arrayofselected = is_array($toselect) ? $toselect : array(); // Local calendar - $newtitle = '
'.$langs->trans("LocalAgenda").'  
'; + $newtitle = '
'; + $newtitle .= ' '.$langs->trans("LocalAgenda").'   '; + $newtitle .= '
'; //$newtitle=$langs->trans($title); $tabactive = 'cardlist'; @@ -450,9 +452,9 @@ if ($resql) if ($showbirthday) $nav .= ''; print $nav; - dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); - print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); - dol_fiche_end(); + //dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); + //print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); + //dol_fiche_end(); // Add link to show birthdays $link = ''; @@ -484,6 +486,39 @@ if ($resql) $s = $hookmanager->resPrint; } + $viewmode = ''; + $viewmode .= ''; + //$viewmode .= ''; + $viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); + //$viewmode .= ''; + $viewmode .= ''.$langs->trans("ViewList").''; + + $viewmode .= ''; + //$viewmode .= ''; + $viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); + //$viewmode .= ''; + $viewmode .= ''.$langs->trans("ViewCal").''; + + $viewmode .= ''; + //$viewmode .= ''; + $viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"'); + //$viewmode .= ''; + $viewmode .= ''.$langs->trans("ViewWeek").''; + + $viewmode .= ''; + //$viewmode .= ''; + $viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"'); + //$viewmode .= ''; + $viewmode .= ''.$langs->trans("ViewDay").''; + + $viewmode .= ''; + //$viewmode .= ''; + $viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); + //$viewmode .= ''; + $viewmode .= ''.$langs->trans("ViewPerUser").''; + + $viewmode .= ''; + $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { @@ -495,8 +530,12 @@ if ($resql) $hourminsec = '100000'; $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''))); } + $param .= '&action='.$action; - print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1); + + print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1 * $nbtotalofrecords, 'object_action', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1, $viewmode); + + print $s; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; @@ -506,6 +545,12 @@ if ($resql) $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); $i = 0; + + + print '
'; + print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); + print '
'; + print '
'; print ''."\n"; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 81028796dc2..39693dfa21a 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -284,7 +284,7 @@ $nav = "".dol_print_date(dol_mktime(0, 0, 0, $first_month, $first_day, $first_year), "%Y").", ".$langs->trans("Week")." ".$week; $nav .= " \n"; $nav .= "   trans("Next"))."\">\n"; -$nav .= "   (".$langs->trans("Today").")"; +$nav .= "   ".$langs->trans("Today")." "; /*$nav.='   '; $nav.=''; @@ -303,7 +303,8 @@ $nav.=''; $nav.=''; */ $nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0); -$nav .= ' '; +//$nav .= ' '; +$nav .= ' '; //$nav.=''; // Must be after the nav definition @@ -325,9 +326,9 @@ $head = calendars_prepare_head($paramnoaction); print ''."\n"; -dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); -print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, '', $resourceid); -dol_fiche_end(); +//dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); +//print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, '', $resourceid); +//dol_fiche_end(); $showextcals = $listofextcals; // Legend @@ -381,6 +382,41 @@ if ($conf->use_javascript_ajax) } } +$massactionbutton = ''; + +$viewmode = ''; +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewList").''; + +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewCal").''; + +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewWeek").''; + +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewDay").''; + +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewPerUser").''; + +$viewmode .= ''; + $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) @@ -394,8 +430,24 @@ if ($user->rights->agenda->myactions->create || $user->rights->agenda->allaction $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''))); } +print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1, 'object_action', 0, $nav.''.$newcardbutton, '', $limit, 0, 0, 1, $viewmode); + $link = ''; -print load_fiche_titre($s, $link.'     '.$nav.' '.$newcardbutton, ''); +//print load_fiche_titre('', $link.'     '.$nav.' '.$newcardbutton, ''); + +// Local calendar +$newtitle = '
'; +$newtitle .= ' '.$langs->trans("LocalAgenda").'   '; +$newtitle .= '
'; +//$newtitle=$langs->trans($title); + +$s = $newtitle; + +print $s; + +print '
'; +print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); +print '
'; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 3914f3d1e08..84e5bfb3f52 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -191,6 +191,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh if ($conf->browser->layout == 'phone') print ''; else print ''; + /* if ($conf->browser->layout == 'phone') print '
'; else print '
'; @@ -202,7 +203,9 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print '
'; if ($conf->browser->layout == 'phone') print '
'; - else print ''; + else print ''; + */ + if ($conf->browser->layout != 'phone') print ''; print '
'; // Close fichecenter print '
'; @@ -520,7 +523,7 @@ function calendars_prepare_head($param) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/comm/action/list.php'.($param ? '?'.$param : ''); + $head[$h][0] = DOL_URL_ROOT.'/comm/action/list.php?action=show_list'.($param ? '&'.$param : ''); $head[$h][1] = $langs->trans("ViewList"); $head[$h][2] = 'cardlist'; $h++; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 538bc20de20..6d43ba49cfa 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4189,15 +4189,16 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pict * @param int|string $totalnboflines Total number of records/lines for all pages (if known). Use a negative value of number to not show number. Use '' if unknown. * @param string $picto Icon to use before title (should be a 32x32 transparent png file) * @param int $pictoisfullpath 1=Icon name is a full absolute url of image - * @param string $morehtmlright More html to show + * @param string $morehtmlright More html to show (after arrows) * @param string $morecss More css to the table * @param int $limit Max number of lines (-1 = use default, 0 = no limit, > 0 = limit). * @param int $hideselectlimit Force to hide select limit * @param int $hidenavigation Force to hide all navigation tools * @param int $pagenavastextinput 1=Do not suggest list of pages to navigate but suggest the page number into an input field. + * @param string $morehtmlrightbeforearrow More html to show (before arrows) * @return void */ -function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', $sortorder = '', $morehtmlcenter = '', $num = -1, $totalnboflines = '', $picto = 'generic', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limit = -1, $hideselectlimit = 0, $hidenavigation = 0, $pagenavastextinput = 0) +function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', $sortorder = '', $morehtmlcenter = '', $num = -1, $totalnboflines = '', $picto = 'generic', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limit = -1, $hideselectlimit = 0, $hidenavigation = 0, $pagenavastextinput = 0, $morehtmlrightbeforearrow = '') { global $conf, $langs; @@ -4298,8 +4299,8 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', } } - if ($savlimit || $morehtmlright) { - print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit); // output the div and ul for previous/last completed with page numbers into $pagelist + if ($savlimit || $morehtmlright || $morehtmlrightbeforearrow) { + print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit, $morehtmlrightbeforearrow); // output the div and ul for previous/last completed with page numbers into $pagelist } // js to autoselect page field on focus @@ -4325,13 +4326,20 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', * @param int $limit Max nb of record to show (-1 = no combo with limit, 0 = no limit, > 0 = limit) * @param int $totalnboflines Total number of records/lines for all pages (if known) * @param int $hideselectlimit Force to hide select limit + * @param string $beforearrows HTML content to show before arrows. Must NOT contains '
  • ' tags. * @return void */ -function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $betweenarrows = '', $afterarrows = '', $limit = -1, $totalnboflines = 0, $hideselectlimit = 0) +function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $betweenarrows = '', $afterarrows = '', $limit = -1, $totalnboflines = 0, $hideselectlimit = 0, $beforearrows = '') { global $conf, $langs; print ''; - $title = $langs->trans("AccountStatement").' '.$num.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts'); + $title = $langs->trans("AccountStatement").' '.$numref.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts'); print load_fiche_titre($title,$morehtmlright, ''); print '
    '; @@ -185,9 +188,9 @@ if ($id > 0 || !empty($ref)) { $modulepart = 'bank'; $permission = $user->rights->banque->modifier; $permtoedit = $user->rights->banque->modifier; - $param = '&id='.$object->id.'&num='.urlencode($num); - $moreparam = '&num='.urlencode($num); ; - $relativepathwithnofile = $id."/statement/".dol_sanitizeFileName($num)."/"; + $param = '&id='.$object->id.'&num='.urlencode($numref); + $moreparam = '&num='.urlencode($numref); ; + $relativepathwithnofile = $id."/statement/".dol_sanitizeFileName($numref)."/"; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { dol_print_error($db); From a059154fdfe4d160d83959368fb97f0256392aae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jul 2020 13:59:54 +0200 Subject: [PATCH 65/71] FIX reposition --- htdocs/compta/bank/releve.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index fcf15f473fd..aee53fe3f23 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -620,7 +620,7 @@ if (empty($numref)) if ($user->rights->banque->modifier || $user->rights->banque->consolidate) { - print ''; + print ''; print img_edit(); print ""; } else { From a155b20b2fa4c6feaa31e209dcdc44e0520063f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jul 2020 16:27:59 +0200 Subject: [PATCH 66/71] Trans --- htdocs/langs/en_US/products.lang | 2 ++ htdocs/product/card.php | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index a1bbc45f970..7f82db63178 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -169,6 +169,8 @@ SuppliersPricesOfProductsOrServices=Vendor prices (of products or services) CustomCode=Customs / Commodity / HS code CountryOrigin=Origin country Nature=Nature of product (material/finished) +NatureOfProductShort=Nature of product +NatureOfProductDesc=Raw material or finished product ShortLabel=Short label Unit=Unit p=u. diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 385e656458a..67e6e9e70f3 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1054,7 +1054,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) if ($type != 1) // Nature, Weight and volume only applies to products and not to services { // Nature - print ''.$langs->trans("Nature").''; + print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).''; $statutarray = array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); print $form->selectarray('finished', $statutarray, GETPOST('finished', 'alpha'), 1); print ''; @@ -1470,7 +1470,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print ''; } else { // Nature - print ''.$langs->trans("Nature").''; + print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).''; $statutarray = array('-1'=>' ', '1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); print $form->selectarray('finished', $statutarray, $object->finished); print ''; @@ -1946,7 +1946,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print ''; } else { // Nature - print ''.$langs->trans("Nature").''; + print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).''; print $object->getLibFinished(); print ''; From c91236244e887d9e38f42092a58c71c2ef0f66c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jul 2020 20:33:06 +0200 Subject: [PATCH 67/71] Enhance Stock at date feature --- htdocs/langs/en_US/errors.lang | 3 +- htdocs/langs/en_US/stocks.lang | 2 + htdocs/product/stock/stockatdate.php | 65 +++++++++++++++++++++------- 3 files changed, 54 insertions(+), 16 deletions(-) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 75a12d517d0..f46307a21ae 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -136,7 +136,8 @@ ErrorNewValueCantMatchOldValue=New value can't be equal to old one ErrorFailedToValidatePasswordReset=Failed to reinit password. May be the reinit was already done (this link can be used only one time). If not, try to restart the reinit process. ErrorToConnectToMysqlCheckInstance=Connect to database fails. Check database server is running (for example, with mysql/mariadb, you can launch it from command line with 'sudo service mysql start'). ErrorFailedToAddContact=Failed to add contact -ErrorDateMustBeBeforeToday=The date cannot be greater than today +ErrorDateMustBeBeforeToday=The date must be lower than today +ErrorDateMustBeInFuture=The date must be greater than today ErrorPaymentModeDefinedToWithoutSetup=A payment mode was set to type %s but setup of module Invoice was not completed to define information to show for this payment mode. ErrorPHPNeedModule=Error, your PHP must have module %s installed to use this feature. ErrorOpenIDSetupNotComplete=You setup Dolibarr config file to allow OpenID authentication, but URL of OpenID service is not defined into constant %s diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 41c88747498..9ce03f64942 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -95,6 +95,8 @@ RealStock=Real Stock RealStockDesc=Physical/real stock is the stock currently in the warehouses. RealStockWillAutomaticallyWhen=The real stock will be modified according to this rule (as defined in the Stock module): VirtualStock=Virtual stock +VirtualStockAtDate=Virtual stock at date +VirtualStockAtDateDesc=Virtual stock atonce all pending orders that are planned to be done before the date will be finished VirtualStockDesc=Virtual stock is the calculated stock available once all open/pending actions (that affect stocks) are closed (purchase orders received, sales orders shipped, manufacturing orders produced, etc) IdWarehouse=Id warehouse DescWareHouse=Description warehouse diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 288db71fb15..9b03d5ecfc4 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2018 Laurent Destaileur + * Copyright (C) 2013-2020 Laurent Destaileur * Copyright (C) 2014 Regis Houssin * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2016 ATM Consulting @@ -59,9 +59,10 @@ if (GETPOSTISSET('dateday') && GETPOSTISSET('datemonth') && GETPOSTISSET('dateye $dateendofday = dol_mktime(23, 59, 59, GETPOST('datemonth', 'int'), GETPOST('dateday', 'int'), GETPOST('dateyear', 'int')); } +$now = dol_now(); + $productid = GETPOST('productid', 'int'); $fk_warehouse = GETPOST('fk_warehouse', 'int'); -$texte = ''; $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); @@ -80,6 +81,19 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +$dateIsValid= true; +if ($mode == 'future') { + if ($date && $date < $now) { + setEventMessages($langs->trans("ErrorDateMustBeInFuture"), null, 'errors'); + $dateIsValid= false; + } +} else { + if ($date && $date > $now) { + setEventMessages($langs->trans("ErrorDateMustBeBeforeToday"), null, 'errors'); + $dateIsValid= false; + } +} + /* * Actions @@ -99,11 +113,10 @@ if ($conf->global->ENTREPOT_EXTRA_STATUS) { $warehouseStatus[] = Entrepot::STATUS_OPEN_INTERNAL; } - // Get array with current stock per product, warehouse $stock_prod_warehouse = array(); $stock_prod = array(); -if ($date) { // Avoid heavy sql if mandatory date is not defined +if ($date && $dateIsValid) { // Avoid heavy sql if mandatory date is not defined $sql = "SELECT ps.fk_product, ps.fk_entrepot as fk_warehouse,"; $sql .= " SUM(ps.reel) AS stock"; $sql .= " FROM ".MAIN_DB_PREFIX."product_stock as ps"; @@ -146,13 +159,17 @@ if ($date) { // Avoid heavy sql if mandatory date is not defined dol_print_error($db); } //var_dump($stock_prod_warehouse); +} elseif ($action == 'filter') { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); } // Get array with list of stock movements between date and now (for product/warehouse= $movements_prod_warehouse = array(); $movements_prod = array(); -if ($date) { - $sql = "SELECT sm.fk_product, sm.fk_entrepot, SUM(sm.value) AS stock"; +$movements_prod_warehouse_nb = array(); +$movements_prod_nb = array(); +if ($date && $dateIsValid) { + $sql = "SELECT sm.fk_product, sm.fk_entrepot, SUM(sm.value) AS stock, COUNT(sm.rowid) AS nbofmovement"; $sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as sm"; $sql .= ", ".MAIN_DB_PREFIX."entrepot as w"; $sql .= " WHERE w.entity IN (".getEntity('stock').")"; @@ -184,12 +201,15 @@ if ($date) { $fk_product = $obj->fk_product; $fk_entrepot = $obj->fk_entrepot; $stock = $obj->stock; + $nbofmovement = $obj->nbofmovement; // Pour llx_product_stock.reel $movements_prod_warehouse[$fk_product][$fk_entrepot] = $stock; + $movements_prod_warehouse_nb[$fk_product][$fk_entrepot] = $nbofmovement; // Pour llx_product.stock $movements_prod[$fk_product] += $stock; + $movements_prod_nb[$fk_product] += $nbofmovement; $i++; } @@ -259,7 +279,7 @@ if ($sortfield == 'stock' && $fk_warehouse > 0) { } $sql .= $db->order($sortfield, $sortorder); -if ($date) { // We avoid a heavy sql if mandatory parameter date not yet defined +if ($date && $dateIsValid) { // We avoid a heavy sql if mandatory parameter date not yet defined $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { @@ -355,7 +375,7 @@ print '
    '; // You can use div-table-responsive- print ''; $stocklabel = $langs->trans('StockAtDate'); -if ($mode == 'future') $stocklabel = $langs->trans("VirtualStock"); +if ($mode == 'future') $stocklabel = $langs->trans("VirtualStockAtDate"); //print ''; print ''; @@ -371,6 +391,9 @@ print ''; print ''; print ''; +if ($mode == 'future') { + print ''; +} // Fields from hook $parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook @@ -394,7 +417,8 @@ print_liste_field_titre('Label', $_SERVER["PHP_SELF"], 'p.label', $param, '', '' if ($mode == 'future') { print_liste_field_titre('CurrentStock', $_SERVER["PHP_SELF"], $fieldtosortcurrentstock, $param, '', '', $sortfield, $sortorder, 'right '); print_liste_field_titre('', $_SERVER["PHP_SELF"]); - print_liste_field_titre($stocklabel, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right ', 'VirtualStockDesc'); + print_liste_field_titre($stocklabel, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right ', 'VirtualStockAtDateDesc'); + print_liste_field_titre('VirtualStock', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right ', 'VirtualStockDesc'); } else { print_liste_field_titre($stocklabel, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right '); print_liste_field_titre('', $_SERVER["PHP_SELF"]); @@ -453,18 +477,21 @@ while ($i < ($limit ? min($num, $limit) : $num)) } if ($mode == 'future') { - $prod->load_stock('warehouseopen, warehouseinternal', 0); + $prod->load_stock('warehouseopen, warehouseinternal', 0); // This call also ->load_virtual_stock() //$result = $prod->load_stats_reception(0, '4'); //print $prod->stats_commande_fournisseur['qty'].'
    '."\n"; //print $prod->stats_reception['qty']; - $stock = 123; + $stock = ''.$langs->trans("FeatureNotYetAvailable").''; + $virtualstock = $prod->stock_theorique; } else { if ($fk_warehouse > 0) { $stock = $currentstock - $movements_prod_warehouse[$objp->rowid][$fk_warehouse]; + $nbofmovement = $movements_prod_warehouse_nb[$objp->rowid][$fk_warehouse]; } else { $stock = $currentstock - $movements_prod[$objp->rowid]; + $nbofmovement = $movements_prod_nb[$objp->rowid]; } } @@ -485,16 +512,24 @@ while ($i < ($limit ? min($num, $limit) : $num)) print ''; - // Stock at date + // Virtual stock at date print ''; + + // Final virtual stock + print ''; } else { // Stock at date - print ''; + print ''; - print ''; + print ''; // Current stock - print ''; + print ''; } // Action From 8972271be0e4fe885770275757d45ba1096a02f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jul 2020 21:12:15 +0200 Subject: [PATCH 68/71] Add link to stock at date page --- htdocs/product/stock/product.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index d01de1a69a9..25d9528581a 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -631,6 +631,8 @@ if ($id > 0 || $ref) print ''; print ''; print ''; @@ -694,6 +696,7 @@ if ($id > 0 || $ref) //print (empty($stocktheo)?0:$stocktheo); print $form->textwithpicto((empty($stocktheo) ? 0 : $stocktheo), $helpondiff); if ($object->seuil_stock_alerte != '' && ($object->stock_theorique < $object->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockLowerThanLimit", $object->seuil_stock_alerte)); + print '    '.$langs->trans("VirtualStockAtDate").''; print ''; print ''; @@ -713,7 +716,7 @@ if ($id > 0 || $ref) print '
    '.$stock.''.$virtualstock.''.$stock.''.($stock ? $stock : ''.$stock.'').''.$langs->trans("Movements").''; + if ($nbofmovement > 0) { + print ''.$langs->trans("Movements").''; + print ' '.$nbofmovement.''; + } + print ''.$currentstock.''.($currentstock ? $currentstock : '0').''.price2num($object->stock_reel, 'MS'); if ($object->seuil_stock_alerte != '' && ($object->stock_reel < $object->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockLowerThanLimit", $object->seuil_stock_alerte)); + + print '    '.$langs->trans("StockAtDate").''; print '
    '.$langs->trans("LastMovement").''; if ($lastmovementdate) { print dol_print_date($lastmovementdate, 'dayhour').' '; - print '('.$langs->trans("FullList").')'; + print '    '.$langs->trans("FullList").''; } else { print ''.$langs->trans("None").''; } From 0d24b979c1f07375e0e08e5b461f36c278a66fb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Jul 2020 01:19:22 +0200 Subject: [PATCH 69/71] Fix phpcs --- htdocs/compta/bank/account_statement_document.php | 2 +- htdocs/core/class/commonobject.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/account_statement_document.php b/htdocs/compta/bank/account_statement_document.php index 29e87ca153b..1e9c6e3b358 100644 --- a/htdocs/compta/bank/account_statement_document.php +++ b/htdocs/compta/bank/account_statement_document.php @@ -170,7 +170,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlright .= ''; $title = $langs->trans("AccountStatement").' '.$numref.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts'); - print load_fiche_titre($title,$morehtmlright, ''); + print load_fiche_titre($title, $morehtmlright, ''); print '
    '; print '
    '; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6951a4df476..885dcb5c490 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6718,7 +6718,7 @@ abstract class CommonObject $out = ''; $parameters=array(); - $reshook=$hookmanager->executeHooks('showOptionals',$parameters,$this,$action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('showOptionals', $parameters, $this, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) From 276bc4f908012eb23ade1d0de1aef5264a26e213 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Jul 2020 11:21:28 +0200 Subject: [PATCH 70/71] Fix sql error --- htdocs/user/home.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 2fa6ec1e7ae..3e08fc7098a 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -102,7 +102,6 @@ $sql .= ", u.ldap_sid"; $sql .= ", u.photo"; $sql .= ", u.admin"; $sql .= ", u.email"; -$sql .= ", u.skype"; $sql .= ", s.nom as name"; $sql .= ", s.code_client"; $sql .= ", s.canvas"; @@ -144,7 +143,6 @@ if ($resql) $fuserstatic->photo = $obj->photo; $fuserstatic->admin = $obj->admin; $fuserstatic->email = $obj->email; - $fuserstatic->skype = $obj->skype; $fuserstatic->socid = $obj->fk_soc; $companystatic->id = $obj->fk_soc; From 8b5f4fe9a677b5e41ffa527290d898c7e83446c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Jul 2020 12:21:53 +0200 Subject: [PATCH 71/71] Fix massaction delete on events --- htdocs/comm/action/list.php | 5 +- htdocs/core/actions_massactions.inc.php | 1 + htdocs/core/lib/agenda.lib.php | 73 ++----------------------- 3 files changed, 8 insertions(+), 71 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index f24467b8c59..1c21140b12a 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -152,6 +152,7 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +//var_dump($_POST);exit; /* * Actions @@ -301,7 +302,7 @@ if ($user->rights->agenda->allactions->delete) { $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); } - +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $sql = "SELECT"; @@ -441,7 +442,6 @@ if ($resql) if ($optioncss != '') print ''; print ''; - print ''; print ''; print ''; print ''; @@ -546,7 +546,6 @@ if ($resql) if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); $i = 0; - print '
    '; print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); print '
    '; diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 067b92bfc38..612f988305f 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1173,6 +1173,7 @@ if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permissio } } +//var_dump($_POST);var_dump($massaction);exit; // Delete record from mass action (massaction = 'delete' for direct delete, action/confirm='delete'/'yes' with a confirmation step before) if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == 'yes')) && $permissiontodelete) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index a25c374c11b..444c14c41c4 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -51,6 +51,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { global $conf, $user, $langs, $db, $hookmanager; global $begin_h, $end_h, $begin_d, $end_d; + global $massaction; $langs->load("companies"); @@ -63,50 +64,35 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; print ''; print ''; - print ''; + if ($massaction != 'predelete') { // When $massaction == 'predelete', action may be already output to 'delete' by the mass action system. + print ''; + } print ''; - //print '
    '; - - //if ($conf->browser->layout == 'phone') print '
    '; - //else print ''; - - /* - if ($conf->browser->layout == 'phone') print '
    '; - else print '
    '; - */ - //if ($conf->browser->layout != 'phone') print '
    '; - - //print ''; - if ($canedit) { print '
    '; // Type - //print '
    '; - //print ''; print ''; // Assigned to print '
    '; - //print '
    '; - //print ''; print ''; if ($conf->resource->enabled) @@ -116,13 +102,9 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh // Resource print '
    '; - //print '
    '; - //print ''; print ''; } } @@ -130,13 +112,9 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh if (!empty($conf->societe->enabled) && $user->rights->societe->lire) { print '
    '; - //print '
    '; - //print ''; print ''; } @@ -146,13 +124,9 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh $formproject = new FormProjets($db); print '
    '; - //print '
    '; - //print ''; print ''; } @@ -160,13 +134,9 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { // Status print '
    '; - //print '
    '; - //print ''; print ''; } @@ -174,12 +144,8 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { print '
    '; // Filter on hours - //print '
    '; - //print ''; - //print "'; print ''; // Filter on days print '
    '; - //print '
    '; - //print ''; - //print "'; print ''; } // Hooks $parameters = array('canedit'=>$canedit, 'pid'=>$pid, 'socid'=>$socid); + $object = null; $reshook = $hookmanager->executeHooks('searchAgendaFrom', $parameters, $object, $action); // Note that $action and $object may have been - //print '
    '; print ''; print ''.$langs->trans("Type").''; - //print ''; $multiselect = 0; if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list" { $multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE)); } print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect, 0, 'maxwidth500'); - //print '
    '; print img_picto('', 'user', 'class="fawidth30 inline-block"'); print ''.$langs->trans("ActionsToDoBy").''; - //print ''; print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth500'); print ''; print '
    '; - //if (empty($conf->dol_optimize_smallscreen)) print ' '.$langs->trans("ToUserOfGroup").'   '; - //else print '
    '; print img_picto('', 'object_group', 'class="fawidth30 inline-block"'); print ''.$langs->trans("ToUserOfGroup").''; print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit, '', '', '0', false, 'maxwidth500'); - //print '
    '; print img_picto('', 'object_resource', 'class="fawidth30 inline-block"'); print ''.$langs->trans("Resource").''; - //print ''; print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2, 0, 'maxwidth500'); - //print '
    '; print img_picto('', 'company', 'class="fawidth30 inline-block"'); print ''.$langs->trans("ThirdParty").''; - //print ''; print $form->select_company($socid, 'search_socid', '', ' ', 0, 0, null, 0, 'minwidth100 maxwidth500'); - //print '
    '; print img_picto('', 'project', 'class="fawidth30 inline-block"'); print ''.$langs->trans("Project").''; - //print ''; print $formproject->select_projects($socid ? $socid : -1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500'); - //print '
    '; print img_picto('', 'setup', 'class="fawidth30 inline-block"'); print ''.$langs->trans("Status").''; - //print ''; $formactions->form_select_status_action('formaction', $status, 1, 'search_status', 1, 2, 'minwidth100'); - //print '
    '; print img_picto('', 'clock', 'class="fawidth30 inline-block"'); print ''.$langs->trans("VisibleTimeRange").''; - //print '"; print "\n".'
    '; print ''; if (empty($conf->dol_use_jmobile)) print ' - '; @@ -187,56 +153,27 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; if (empty($conf->dol_use_jmobile)) print ' '.$langs->trans("H"); print '
    '; - //print '
    '; print img_picto('', 'clock', 'class="fawidth30 inline-block"'); print ''.$langs->trans("VisibleDaysRange").''; - //print '"; print "\n".'
    '; print ''; if (empty($conf->dol_use_jmobile)) print ' - '; else print '
    '; print ''; print '
    '; - //print '
    '; - - //if ($conf->browser->layout == 'phone') print ''; - //else print '
    '; - - print ''; - print '
    '; - print '
    '; - print ''; - print '
    '; - print '
    '; - - if ($conf->browser->layout == 'phone') print ''; - else print '
    '; - - //print '
    '; // Close fichecenter print '
    '; - - //print ''; }