From 35fbc602ee8c7f8e8b4872d6efe3c57778374081 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 9 Oct 2020 09:22:26 +0200 Subject: [PATCH 01/17] Add global payment search --- htdocs/compta/paiement/list.php | 73 ++++++++++++++++++---------- htdocs/core/ajax/selectsearchbox.php | 22 +++++++++ htdocs/fourn/paiement/list.php | 27 ++++++++-- htdocs/langs/en_US/main.lang | 2 + 4 files changed, 94 insertions(+), 30 deletions(-) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index e2f3ea9012b..1fa8f8763ef 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -46,24 +46,24 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; $langs->loadLangs(array('bills', 'banks', 'compta', 'companies')); $action = GETPOST('action', 'alpha'); -$massaction = GETPOST('massaction', 'alpha'); +$massaction = GETPOST('massaction', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'paymentlist'; $facid = GETPOST('facid', 'int'); $socid = GETPOST('socid', 'int'); -$userid = GETPOST('userid', 'int'); -$day = GETPOST('day', 'int'); +$userid = GETPOST('userid', 'int'); +$day = GETPOST('day', 'int'); $month = GETPOST('month', 'int'); -$year = GETPOST('year', 'int'); +$year = GETPOST('year', 'int'); $search_ref = GETPOST("search_ref", "alpha"); -$search_account = GETPOST("search_account", "int"); -$search_paymenttype = GETPOST("search_paymenttype"); -$search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be able to search on "< x" $search_company = GETPOST("search_company", 'alpha'); +$search_paymenttype = GETPOST("search_paymenttype"); +$search_account = GETPOST("search_account", "int"); $search_payment_num = GETPOST('search_payment_num', 'alpha'); +$search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be able to search on "< x" $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -76,27 +76,35 @@ $pageprev = $page - 1; $pagenext = $page + 1; if (!$sortorder) $sortorder = "DESC"; -if (!$sortfield) $sortfield = "p.rowid"; +if (!$sortfield) $sortfield = "p.ref"; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$object = new Paiement($db); -$hookmanager->initHooks(array('paymentlist')); -$extrafields = new ExtraFields($db); +$search_all = trim(GETPOSTISSET("search_all") ? GETPOSTISSET("search_all", 'alpha') : GETPOST('sall')); + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'p.ref'=>"RefPayment", + 's.nom'=>"ThirdParty", + 'p.num_paiement'=>"Numero", + 'p.amount'=>"Amount", +); $arrayfields = array( - 'p.rowid' => array('label'=>"RefPayment", 'checked'=>1, 'position'=>10), + 'p.ref' => array('label'=>"RefPayment", 'checked'=>1, 'position'=>10), 'p.datep' => array('label'=>"Date", 'checked'=>1, 'position'=>20), 's.nom' => array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), 'c.libelle' => array('label'=>"Type", 'checked'=>1, 'position'=>40), 'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>(!empty($conf->banque->enabled))), 'ba.label' => array('label'=>"Account", 'checked'=>1, 'position'=>60, 'enabled'=>(!empty($conf->banque->enabled))), - 'p.num_payment' => array('label'=>"Numero", 'checked'=>1, 'position'=>70, 'tooltip'=>"ChequeOrTransferNumber"), + 'p.num_paiement' => array('label'=>"Numero", 'checked'=>1, 'position'=>70, 'tooltip'=>"ChequeOrTransferNumber"), 'p.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>80), 'p.statut' => array('label'=>"Status", 'checked'=>1, 'position'=>90, 'enabled'=>(!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))), ); - $arrayfields = dol_sort_array($arrayfields, 'position'); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('paymentlist')); +$object = new Paiement($db); + /* * Actions */ @@ -140,7 +148,7 @@ llxHeader('', $langs->trans('ListPayment')); if (GETPOST("orphelins", "alpha")) { // Payments not linked to an invoice. Should not happend. For debug only. - $sql = "SELECT p.rowid, p.ref, p.datep, p.amount, p.statut, p.num_paiement as num_payment"; + $sql = "SELECT p.ref, p.datep, p.amount, p.statut, p.num_paiement"; $sql .= ", c.code as paiement_code"; // Add fields from hooks @@ -158,7 +166,7 @@ if (GETPOST("orphelins", "alpha")) { $sql .= $hookmanager->resPrint; } else { // DISTINCT is to avoid duplicate when there is a link to sales representatives - $sql = "SELECT DISTINCT p.rowid, p.ref, p.datep, p.fk_bank, p.amount, p.statut, p.num_paiement as num_payment"; + $sql = "SELECT DISTINCT p.ref, p.datep, p.fk_bank, p.amount, p.statut, p.num_paiement"; $sql .= ", c.code as paiement_code"; $sql .= ", ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.fk_accountancy_journal as accountancy_journal"; $sql .= ", s.rowid as socid, s.nom as name, s.email"; @@ -198,6 +206,8 @@ if (GETPOST("orphelins", "alpha")) { if ($search_amount) $sql .= natural_search('p.amount', $search_amount, 1); if ($search_company) $sql .= natural_search('s.nom', $search_company); + if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all); + // Add where from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook @@ -251,6 +261,12 @@ print ''; print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit, 0, 0, 1); +if ($search_all) +{ + foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val); + print '
'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
'; +} + $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); @@ -268,7 +284,7 @@ if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) { } // Filter: Ref -if (!empty($arrayfields['p.rowid']['checked'])) { +if (!empty($arrayfields['p.ref']['checked'])) { print ''; print ''; print ''; @@ -305,7 +321,7 @@ if (!empty($arrayfields['transaction']['checked'])) { } // Filter: Cheque number (fund transfer) -if (!empty($arrayfields['p.num_payment']['checked'])) { +if (!empty($arrayfields['p.num_paiement']['checked'])) { print ''; print ''; } @@ -343,11 +359,11 @@ print ""; print ''; if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) print_liste_field_titre('#', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder); -if (!empty($arrayfields['p.rowid']['checked'])) print_liste_field_titre($arrayfields['p.rowid']['label'], $_SERVER["PHP_SELF"], "p.rowid", '', $param, '', $sortfield, $sortorder); +if (!empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder); if (!empty($arrayfields['p.datep']['checked'])) print_liste_field_titre($arrayfields['p.datep']['label'], $_SERVER["PHP_SELF"], "p.datep", '', $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder); if (!empty($arrayfields['c.libelle']['checked'])) print_liste_field_titre($arrayfields['c.libelle']['label'], $_SERVER["PHP_SELF"], "c.libelle", '', $param, '', $sortfield, $sortorder); -if (!empty($arrayfields['p.num_payment']['checked'])) print_liste_field_titre($arrayfields['p.num_payment']['label'], $_SERVER["PHP_SELF"], "p.num_payment", '', $param, '', $sortfield, $sortorder, '', $arrayfields['p.num_payment']['tooltip']); +if (!empty($arrayfields['p.num_paiement']['checked'])) print_liste_field_titre($arrayfields['p.num_paiement']['label'], $_SERVER["PHP_SELF"], "p.num_paiement", '', $param, '', $sortfield, $sortorder, '', $arrayfields['p.num_paiement']['tooltip']); if (!empty($arrayfields['transaction']['checked'])) print_liste_field_titre($arrayfields['transaction']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); if (!empty($arrayfields['ba.label']['checked'])) print_liste_field_titre($arrayfields['ba.label']['label'], $_SERVER["PHP_SELF"], "ba.label", '', $param, '', $sortfield, $sortorder); if (!empty($arrayfields['p.amount']['checked'])) print_liste_field_titre($arrayfields['p.amount']['label'], $_SERVER["PHP_SELF"], "p.amount", '', $param, 'class="right"', $sortfield, $sortorder); @@ -361,6 +377,13 @@ print $hookmanager->resPrint; print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print ""; +$checkedCount = 0; +foreach($arrayfields as $column) { + if($column['checked']) { + $checkedCount++; + } +} + $i = 0; $totalarray = array(); while ($i < min($num, $limit)) { @@ -382,7 +405,7 @@ while ($i < min($num, $limit)) { } // Ref - if (!empty($arrayfields['p.rowid']['checked'])) { + if (!empty($arrayfields['p.ref']['checked'])) { print ''.$object->getNomUrl(1).''; if (!$i) $totalarray['nbfield']++; } @@ -412,8 +435,8 @@ while ($i < min($num, $limit)) { } // Filter: Cheque number (fund transfer) - if (!empty($arrayfields['p.num_payment']['checked'])) { - print ''.$objp->num_payment.''; + if (!empty($arrayfields['p.num_paiement']['checked'])) { + print ''.$objp->num_paiement.''; if (!$i) $totalarray['nbfield']++; } @@ -448,7 +471,7 @@ while ($i < min($num, $limit)) { if (!empty($arrayfields['p.amount']['checked'])) { print ''.price($objp->amount).''; if (!$i) $totalarray['nbfield']++; - $totalarray['pos'][8] = 'amount'; + $totalarray['pos'][$checkedCount] = 'amount'; $totalarray['val']['amount'] += $objp->amount; } diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 29aeb9cc7eb..87b3a903343 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -119,6 +119,28 @@ if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFOR $arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } +// Customer payments +if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) +{ + $arrayresult['searchintocustomerpayments'] = array( + 'position'=>170, + 'img'=>'object_payment', + 'label'=>$langs->trans("SearchIntoCustomerPayments", $search_boxvalue), + 'text'=>img_picto('', 'object_payment').' '.$langs->trans("SearchIntoCustomerPayments", $search_boxvalue), + 'url'=>DOL_URL_ROOT.'/compta/paiement/list.php?leftmenu=customers_bills_payment'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); +} + +// Vendor payments +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || ! empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) +{ + $arrayresult['searchintovendorpayments'] = array( + 'position'=>175, + 'img'=>'object_payment', + 'label'=>$langs->trans("SearchIntoVendorPayments", $search_boxvalue), + 'text'=>img_picto('', 'object_payment').' '.$langs->trans("SearchIntoVendorPayments", $search_boxvalue), + 'url'=>DOL_URL_ROOT.'/fourn/paiement/list.php?leftmenu=suppliers_bills_payment'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); +} + // Miscellaneous payments if (!empty($conf->banque->enabled) && empty($conf->global->MAIN_SEARCHFORM_MISC_PAYMENTS_DISABLED) && $user->rights->banque->lire) { diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 1a89e7f6906..0310a75fe57 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -57,20 +57,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->loadLangs(array('companies', 'bills', 'banks', 'compta')); $action = GETPOST('action', 'alpha'); -$massaction = GETPOST('massaction', 'alpha'); +$massaction = GETPOST('massaction', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'vendorpaymentlist'; $socid = GETPOST('socid', 'int'); -$search_ref = GETPOST('search_ref', 'alpha'); +$search_ref = GETPOST('search_ref', 'alpha'); $search_day = GETPOST('search_day', 'int'); $search_month = GETPOST('search_month', 'int'); -$search_year = GETPOST('search_year', 'int'); +$search_year = GETPOST('search_year', 'int'); $search_company = GETPOST('search_company', 'alpha'); $search_payment_type = GETPOST('search_payment_type'); $search_cheque_num = GETPOST('search_cheque_num', 'alpha'); -$search_bank_account = GETPOST('search_bank_account', 'int'); +$search_bank_account = GETPOST('search_bank_account', 'int'); $search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x' $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -86,7 +86,15 @@ $pagenext = $page + 1; if (!$sortorder) $sortorder = "DESC"; if (!$sortfield) $sortfield = "p.datep"; -// TODO: add global search for this list +$search_all = trim(GETPOSTISSET("search_all") ? GETPOSTISSET("search_all", 'alpha') : GETPOST('sall')); + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'p.ref'=>"RefPayment", + 's.nom'=>"ThirdParty", + 'p.num_paiement'=>"Numero", + 'p.amount'=>"Amount", +); $arrayfields = array( 'p.ref' =>array('label'=>"RefPayment", 'checked'=>1, 'position'=>10), @@ -99,6 +107,7 @@ $arrayfields = array( ); $arrayfields = dol_sort_array($arrayfields, 'position'); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('paymentsupplierlist')); $object = new PaiementFourn($db); @@ -164,6 +173,8 @@ if ($search_cheque_num != '') $sql .= natural_search('p.num_paiement', $search_c if ($search_amount) $sql .= natural_search('p.amount', $search_amount, 1); if ($search_bank_account > 0) $sql .= ' AND b.fk_account='.$search_bank_account."'"; +if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all); + // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; @@ -223,6 +234,12 @@ print ''; print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'supplier_invoice', 0, '', '', $limit, 0, 0, 1); +if ($search_all) +{ + foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val); + print '
'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
'; +} + $moreforfilter = ''; $parameters = array(); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 427a5a80d45..789d3836e37 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1014,6 +1014,8 @@ SearchIntoCustomerShipments=Customer shipments SearchIntoExpenseReports=Expense reports SearchIntoLeaves=Leave SearchIntoTickets=Tickets +SearchIntoCustomerPayments=Customer payments +SearchIntoVendorPayments=Vendor payments SearchIntoMiscPayments=Miscellaneous payments CommentLink=Comments NbComments=Number of comments From 6b3f20dc6573e62b0687077a8fd366ae90067465 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 9 Oct 2020 07:29:25 +0000 Subject: [PATCH 02/17] Fixing style errors. --- htdocs/compta/paiement/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 1fa8f8763ef..f3ea57ea084 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -378,8 +378,8 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', 'alig print ""; $checkedCount = 0; -foreach($arrayfields as $column) { - if($column['checked']) { +foreach ($arrayfields as $column) { + if ($column['checked']) { $checkedCount++; } } From 5510f1feef7417205f8bf2da2ab9dd053aefa1e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Hahn?= Date: Fri, 9 Oct 2020 10:59:06 +0200 Subject: [PATCH 03/17] Fix for #14957 and probably a lot of other issues Convert special characters for a valid use in xml documents --- htdocs/includes/odtphp/odf.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 5ec9b8f8870..f6e15b2e8a2 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -156,6 +156,7 @@ class Odf */ public function convertVarToOdf($value, $encode = true, $charset = 'ISO-8859') { + $value = $encode ? htmlspecialchars($value) : $value; $value = ($charset == 'ISO-8859') ? utf8_encode($value) : $value; $convertedValue = $value; From b591e6510b787f2b5a16be6151fe28ff918d4703 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Oct 2020 11:01:08 +0200 Subject: [PATCH 04/17] FIX avoid warning "Parameter must be an array" --- htdocs/core/class/dolgraph.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 0a1686c3585..5d6327c63b0 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -533,7 +533,7 @@ class DolGraph $vals = array(); $nblines = count($this->data); - $nbvalues = count($this->data[0]) - 1; + $nbvalues = (! empty($this->data[0]) ? count($this->data[0]) - 1 : 0); for ($j = 0; $j < $nblines; $j++) { @@ -562,7 +562,7 @@ class DolGraph $vals = array(); $nblines = count($this->data); - $nbvalues = count($this->data[0]) - 1; + $nbvalues = (! empty($this->data[0]) ? count($this->data[0]) - 1 : 0); for ($j = 0; $j < $nblines; $j++) { From d789aaad7fd6643709108c29d079ac3f8248fbff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Hahn?= Date: Fri, 9 Oct 2020 11:29:39 +0200 Subject: [PATCH 05/17] Fix for #14239 Message: Error: Method printObjectLine was called on an object and object->fetch_thirdparty was not done before --- htdocs/commande/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 5de377930d7..3ee5b89e01a 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1863,6 +1863,7 @@ if ($action == 'create' && $usercancreate) $author = new User($db); $author->fetch($object->user_author_id); + $object->fetch_thirdparty(); $res = $object->fetch_optionals(); $head = commande_prepare_head($object); From efc5dedab4b5d62ff2819ae1d968b1db1bc5fcb2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Oct 2020 12:52:42 +0200 Subject: [PATCH 06/17] Fix format number on screen --- htdocs/accountancy/bookkeeping/balance.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 3608622916d..c3e225e5399 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -339,7 +339,7 @@ if ($action != 'export_csv') print ''.price($opening_balances["'".$line->numero_compte."'"]).''; print ''.price($line->debit).''; print ''.price($line->credit).''; - print ''.price($line->debit - $line->credit).''; + print ''.price(price2num($line->debit - $line->credit, 'MT')).''; print ''.$link; print ''; print "\n"; From 12391523681122caff3ec76176412eb531ba2957 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Oct 2020 13:54:47 +0200 Subject: [PATCH 07/17] Update dolgraph.class.php --- htdocs/core/class/dolgraph.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 5d6327c63b0..dee727cb596 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -533,7 +533,7 @@ class DolGraph $vals = array(); $nblines = count($this->data); - $nbvalues = (! empty($this->data[0]) ? count($this->data[0]) - 1 : 0); + $nbvalues = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1); for ($j = 0; $j < $nblines; $j++) { @@ -562,7 +562,7 @@ class DolGraph $vals = array(); $nblines = count($this->data); - $nbvalues = (! empty($this->data[0]) ? count($this->data[0]) - 1 : 0); + $nbvalues = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1); for ($j = 0; $j < $nblines; $j++) { From 4fb83a0dd6da2e8d2fe13c6a238d8db43eb55251 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 9 Oct 2020 15:35:09 +0200 Subject: [PATCH 08/17] Fix migration --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 6a34b69d1a2..78c7c2d1e2c 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -358,4 +358,7 @@ ALTER TABLE llx_website_page ADD COLUMN fk_object varchar(255); DELETE FROM llx_const WHERE name in ('MAIN_INCLUDE_ZERO_VAT_IN_REPORTS'); +UPDATE llx_projet_task_time SET tms = null WHERE tms = 0; +ALTER TABLE llx_projet_task_time MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; + ALTER TABLE llx_projet_task_time MODIFY COLUMN datec datetime; From 78654376ca78444537205999b9ff538eccf7c0b3 Mon Sep 17 00:00:00 2001 From: davidNDU Date: Fri, 9 Oct 2020 16:54:13 +0300 Subject: [PATCH 09/17] Fix: Module Builder creation and listing of events --- htdocs/modulebuilder/template/myobject_agenda.php | 8 +++++--- htdocs/modulebuilder/template/myobject_card.php | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index e05b4e93491..8d69d59c05d 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -223,13 +223,15 @@ if ($object->id > 0) $objthirdparty = $object; $objcon = new stdClass(); - $out = '&origin='.$object->element.'&originid='.$object->id; + $out = '&origin='.$object->element.'%40'.$object->module.'&originid='.$object->id; + $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; + $out .= '&backtopage='.urlencode($urlbacktopage); $permok = $user->rights->agenda->myactions->create; if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.='trans("AddAnAction"),'filenew'); //$out.=""; @@ -264,7 +266,7 @@ if ($object->id > 0) $filters['search_agenda_label'] = $search_agenda_label; // TODO Replace this with same code than into list.php - show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, 'mymmodule'); + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module); } } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index d97bc8f7f35..a56448c584c 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -569,7 +569,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, $object->element.'@mymodule', (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); print ''; } From 28e462e50719b32c572cbd35b32585a1fd0aa21e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Oct 2020 16:49:23 +0200 Subject: [PATCH 10/17] Debug a box with sql and performance errors --- htdocs/core/boxes/box_validated_projects.php | 71 +++++++++++--------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index 378aea61df5..b4eddf5f18d 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -46,6 +46,9 @@ class box_validated_projects extends ModeleBoxes public $info_box_head = array(); public $info_box_contents = array(); + public $enabled = 1; + + /** * Constructor * @@ -54,15 +57,17 @@ class box_validated_projects extends ModeleBoxes */ public function __construct($db, $param = '') { - global $user, $langs; + global $conf, $user, $langs; // Load translation files required by the page $langs->loadLangs(array('boxes', 'projects')); $this->db = $db; - $this->boxlabel = "ValidatedProjects"; + $this->boxlabel = "ProjectsWithTask"; $this->hidden = ! ($user->rights->projet->lire); + + if ($conf->global->MAIN_FEATURES_LEVEL < 2) $this->enabled = 0; } /** @@ -81,7 +86,7 @@ class box_validated_projects extends ModeleBoxes $totalnb = 0; $totalnbTask=0; - $textHead = $langs->trans("ValidatedProjects"); + $textHead = $langs->trans("ProjectTasksWithoutTimeSpent"); $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); // list the summary of the orders @@ -96,17 +101,19 @@ class box_validated_projects extends ModeleBoxes $projectsListId=''; if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid); - $sql = "SELECT p.rowid, p.ref as Ref, p.fk_soc as Client, p.dateo as startDate,"; - $sql.= " (SELECT COUNT(t.rowid) FROM ".MAIN_DB_PREFIX."projet_task AS t"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact AS c ON t.rowid = c.element_id"; - $sql.= " WHERE t.fk_projet = p.rowid AND c.fk_c_type_contact != 160 AND c.fk_socpeople = ".$user->id." AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_user =".$user->id.")) AS 'taskNumber'"; + // I tried to solve sql error and performance problem, rewriting sql request but it is not clear what we want. + // Count of tasks without time spent for tasks we are assigned too or + // Count of tasks without time spent for all tasks of projects we are allowed to read (what it does) ? + $sql = "SELECT p.rowid, p.ref, p.fk_soc, p.dateo as startdate,"; + $sql.= " COUNT(DISTINCT t.rowid) as tasknumber"; $sql.= " FROM ".MAIN_DB_PREFIX."projet AS p"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task AS t ON p.rowid = t.fk_projet"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact AS c ON t.rowid = c.element_id"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."projet_task AS t ON p.rowid = t.fk_projet"; + // TODO Replace -1, -2, -3 with ID used for type of contat project_task into llx_c_type_contact. Once done, we can switch widget as stable. + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."element_contact as ec ON ec.element_id = t.rowid AND fk_c_type_contact IN (-1, -2, -3)"; $sql.= " WHERE p.fk_statut = 1"; // Only open projects + if ($projectsListId) $sql .= ' AND p.rowid IN ('.$this->db->sanitize($projectsListId).')'; // Only project we ara allowed $sql.= " AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_user =".$user->id.")"; - $sql.= " AND c.fk_socpeople = ".$user->id; - $sql.= " GROUP BY p.ref"; + $sql.= " GROUP BY p.rowid, p.ref, p.fk_soc, p.dateo"; $sql.= " ORDER BY p.dateo ASC"; $result = $this->db->query($sql); @@ -135,10 +142,7 @@ class box_validated_projects extends ModeleBoxes $objp = $this->db->fetch_object($result); $projectstatic->id = $objp->rowid; - $projectstatic->ref = $objp->Ref; - $projectstatic->customer = $objp->Client; - $projectstatic->startDate = $objp->startDate; - $projectstatic->taskNumber = $objp->taskNumber; + $projectstatic->ref = $objp->ref; $this->info_box_contents[$i][] = array( 'td' => 'class="nowraponall"', @@ -146,21 +150,26 @@ class box_validated_projects extends ModeleBoxes 'asis' => 1 ); - $sql = 'SELECT rowid, nom FROM '.MAIN_DB_PREFIX.'societe WHERE rowid ='.$objp->Client; - $resql = $this->db->query($sql); - if ($resql){ - $socstatic = new Societe($this->db); - $obj = $this->db->fetch_object($resql); - $this->info_box_contents[$i][] = array( - 'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"', - 'text' => $obj->nom, - 'asis' => 1, - 'url' => DOL_URL_ROOT.'/societe/card.php?socid='.$obj->rowid - ); - } - else { - dol_print_error($this->db); - } + if ($objp->fk_soc > 0) { + $sql = 'SELECT rowid, nom as name FROM '.MAIN_DB_PREFIX.'societe WHERE rowid ='.$objp->fk_soc; + $resql = $this->db->query($sql); + //$socstatic = new Societe($this->db); + $obj2 = $this->db->fetch_object($resql); + $this->info_box_contents[$i][] = array( + 'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"', + 'text' => $obj2->name, + 'asis' => 1, + 'url' => DOL_URL_ROOT.'/societe/card.php?socid='.$obj2->rowid + ); + } + else { + $this->info_box_contents[$i][] = array( + 'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"', + 'text' => '', + 'asis' => 1, + 'url' => '' + ); + } $this->info_box_contents[$i][] = array( 'td' => 'class="center"', @@ -169,7 +178,7 @@ class box_validated_projects extends ModeleBoxes $this->info_box_contents[$i][] = array( 'td' => 'class="center"', - 'text' => $objp->taskNumber." ".$langs->trans("Tasks"), + 'text' => $objp->tasknumber." ".$langs->trans("Tasks"), 'asis' => 1, ); $i++; From 5e3df9442ff190ba9a633cd0d6f3eb5d550bfabb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Oct 2020 16:57:00 +0200 Subject: [PATCH 11/17] css --- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 5fe36e8687a..b9519eb50af 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -713,7 +713,7 @@ textarea.centpercent { .longmessagecut { max-height: 250px; max-width: 100%; - overflow-y: scroll; + overflow-y: auto; } body[class*="colorblind-"] .text-warning{ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index cdc50311d40..fb05def28da 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -795,7 +795,7 @@ textarea.centpercent { .longmessagecut { max-height: 250px; max-width: 100%; - overflow-y: scroll; + overflow-y: auto; } .text-warning{ From a3e3e0e45c012879360ab3059c1f17118fc11c72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Oct 2020 17:55:26 +0200 Subject: [PATCH 12/17] Navigation in chart of account --- htdocs/accountancy/admin/account.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 0ac79bcc3aa..9de166472bc 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -294,13 +294,11 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; $newcardbutton .= dolGetButtonTitle($langs->trans("New"), $langs->trans("Addanaccount"), 'fa fa-plus-circle', './card.php?action=create'); - - print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit); + print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1); // Box to select active chart of account print $langs->trans("Selectchartofaccounts")." : "; From 4188a21c6b62171f693cfef7dc8e646b113c45c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Oct 2020 17:59:22 +0200 Subject: [PATCH 13/17] css --- htdocs/accountancy/admin/account.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 9de166472bc..c495a42d69f 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -341,15 +341,15 @@ if ($resql) // Line for search fields print ''; - if (!empty($arrayfields['aa.account_number']['checked'])) print ''; - if (!empty($arrayfields['aa.label']['checked'])) print ''; - if (!empty($arrayfields['aa.labelshort']['checked'])) print ''; + if (!empty($arrayfields['aa.account_number']['checked'])) print ''; + if (!empty($arrayfields['aa.label']['checked'])) print ''; + if (!empty($arrayfields['aa.labelshort']['checked'])) print ''; if (!empty($arrayfields['aa.account_parent']['checked'])) { print ''; print $formaccounting->select_account($search_accountparent, 'search_accountparent', 2); print ''; } - if (!empty($arrayfields['aa.pcg_type']['checked'])) print ''; + if (!empty($arrayfields['aa.pcg_type']['checked'])) print ''; if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (!empty($arrayfields['aa.reconcilable']['checked'])) print ' '; } if (!empty($arrayfields['aa.active']['checked'])) print ' '; print ''; From 327ca5f59567262a96e870d28502acf504676ac0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Oct 2020 18:18:18 +0200 Subject: [PATCH 14/17] css --- htdocs/accountancy/admin/categories.php | 2 +- htdocs/accountancy/admin/subaccount.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index d605105f8e9..f68fbc18905 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -172,7 +172,7 @@ if ($action == 'display' || $action == 'delete') { print ''; print ''; print $langs->trans("DeleteFromCat"); - print img_picto($langs->trans("DeleteFromCat"), 'unlink'); + print img_picto($langs->trans("DeleteFromCat"), 'unlink', 'class="paddingleft"'); print ""; print ""; print "\n"; diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index a6f61283d75..c70f7730f89 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -335,17 +335,17 @@ if ($resql) // Customer if ($obj->type == 0) { - $s .= ''.$langs->trans("Customer").''; + $s .= ''.$langs->trans("Customer").''; } // Supplier elseif ($obj->type == 1) { - $s .= ''.$langs->trans("Supplier").''; + $s .= ''.$langs->trans("Supplier").''; } // User elseif ($obj->type == 2) { - $s .= ''.$langs->trans("Employee").''; + $s .= ''.$langs->trans("Employee").''; } print $s; print ''; From cc82a15688c9cfd5c6de8a53857d5793338a559c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Oct 2020 18:43:24 +0200 Subject: [PATCH 15/17] css --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 552ed8c4f4f..47a5d3d9330 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1605,7 +1605,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi if ($pdfexists && !$error) { - $heightforphotref = 70; + $heightforphotref = 80; if (!empty($conf->dol_optimize_smallscreen)) $heightforphotref = 60; // If the preview file is found if (file_exists($fileimage)) From 967e7997e6be6336d984e3b6a6c5ece479d87359 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Oct 2020 19:34:57 +0200 Subject: [PATCH 16/17] Trans and clean code --- htdocs/accountancy/admin/account.php | 16 +++++++++++----- htdocs/accountancy/admin/subaccount.php | 6 ++++-- htdocs/langs/en_US/accountancy.lang | 3 ++- htdocs/langs/en_US/admin.lang | 2 +- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index c495a42d69f..1798e8d3eb7 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -414,18 +414,24 @@ if ($resql) // Account parent if (!empty($arrayfields['aa.account_parent']['checked'])) { - if (!empty($obj->account_parent)) + // Note: obj->account_parent is a foreign key to a rowid. It is field in child table and obj->rowid2 is same, but in parent table. + // So for orphans, obj->account_parent is set but not obj->rowid2 + if (!empty($obj->account_parent) && !empty($obj->rowid2)) { + print ""; + print ''; $accountparent->id = $obj->rowid2; $accountparent->label = $obj->label2; - $accountparent->account_number = $obj->account_number2; - - print ""; + $accountparent->account_number = $obj->account_number2; // Sotre an account number for output print $accountparent->getNomUrl(1); print "\n"; if (!$i) $totalarray['nbfield']++; } else { - print ' '; + print ''; + if (!empty($obj->account_parent)) { + print ''; + } + print ''; if (!$i) $totalarray['nbfield']++; } } diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index c70f7730f89..4b44bd35149 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -100,7 +100,9 @@ if (empty($reshook)) $form = new Form($db); -llxHeader('', $langs->trans("ReportThirdParty")); +$title = $langs->trans('ChartOfIndividualAccountsOfSubsidiaryLedger'); + +llxHeader('', $title); // Customer $sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '0' as type, sa.entity"; @@ -268,7 +270,7 @@ if ($resql) print ''; print ''; - print_barre_liste($langs->trans('ReportThirdParty'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1); print '
'.$langs->trans("WarningCreateSubAccounts").'
'; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 0b6c90f23e5..24255577b11 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -24,7 +24,8 @@ Journals=Journals JournalFinancial=Financial journals BackToChartofaccounts=Return chart of accounts Chartofaccounts=Chart of accounts -ChartOfSubaccounts=Chart of subaccounts +ChartOfSubaccounts=Chart of individual accounts +ChartOfIndividualAccountsOfSubsidiaryLedger=Chart of individual accounts of the subsidiary ledger CurrentDedicatedAccountingAccount=Current dedicated account AssignDedicatedAccountingAccount=New account to assign InvoiceLabel=Invoice label diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 8d64fe1a8d6..f8912b87eeb 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -658,7 +658,7 @@ Module50200Desc=Offer customers a PayPal online payment page (PayPal account or Module50300Name=Stripe Module50300Desc=Offer customers a Stripe online payment page (credit/debit cards). This can be used to allow your customers to make ad-hoc payments or payments related to a specific Dolibarr object (invoice, order etc...) Module50400Name=Accounting (double entry) -Module50400Desc=Accounting management (double entries, support general and auxiliary ledgers). Export the ledger in several other accounting software formats. +Module50400Desc=Accounting management (double entries, support General and Subsidiary Ledgers). Export the ledger in several other accounting software formats. Module54000Name=PrintIPP Module54000Desc=Direct print (without opening the documents) using Cups IPP interface (Printer must be visible from server, and CUPS must be installed on server). Module55000Name=Poll, Survey or Vote From b1a838f19f1c2f8a165ae256e6910f28703cec92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Oct 2020 19:48:35 +0200 Subject: [PATCH 17/17] Update myobject_agenda.php --- htdocs/modulebuilder/template/myobject_agenda.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 8d69d59c05d..b5f6ef7f722 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -223,15 +223,15 @@ if ($object->id > 0) $objthirdparty = $object; $objcon = new stdClass(); - $out = '&origin='.$object->element.'%40'.$object->module.'&originid='.$object->id; + $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; - $out .= '&backtopage='.urlencode($urlbacktopage); + $out .= '&backtopage='.urlencode($urlbacktopage); $permok = $user->rights->agenda->myactions->create; if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.='trans("AddAnAction"),'filenew'); //$out.="";