From 45a6d12d65c93310dfb630b918c024e6f9022574 Mon Sep 17 00:00:00 2001 From: priojk Date: Sat, 18 Feb 2023 22:33:42 +0100 Subject: [PATCH 01/14] Fix: Original translation change misleading in many places --- htdocs/langs/de_DE/main.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/de_DE/main.lang b/htdocs/langs/de_DE/main.lang index 4aa75a20c80..56e9c337bfe 100644 --- a/htdocs/langs/de_DE/main.lang +++ b/htdocs/langs/de_DE/main.lang @@ -464,7 +464,7 @@ OtherStatistics=Weitere Statistiken Status=Status Favorite=Favorit ShortInfo=Info. -Ref=Artikelnummer +Ref=Ref.Nr. ExternalRef=Externe-ID RefSupplier=Lieferanten-Zeichen RefPayment=Zahlungsref.-Nr. From 4ce5d0f42d5d7a147f8e712f71aed43eae2ef04b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 01:34:45 +0100 Subject: [PATCH 02/14] Debug v17 --- htdocs/compta/facture/card.php | 51 +++++++++++---------------- htdocs/core/class/html.form.class.php | 16 +++++---- 2 files changed, 31 insertions(+), 36 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index c2469655df6..eaebb294cac 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3189,7 +3189,7 @@ if ($action == 'create') { $arrayoutstandingbills = $soc->getOutstandingBills(); $outstandingBills = $arrayoutstandingbills['opened']; print ' - '.$langs->trans('CurrentOutstandingBill').': '; - print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency); + print ''.price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency).''; if ($soc->outstanding_limit != '') { if ($outstandingBills > $soc->outstanding_limit) { print img_warning($langs->trans("OutstandingBillReached")); @@ -3308,7 +3308,7 @@ if ($action == 'create') { print '
'; $tmp = ' '; $tmp = $tmp.''; - $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3); + $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3, 'standardonsmartphone'); print ''; print ''; - print ''; + print ''; $datem = $db->jdate($obj->dp); print '
'; print $desc; @@ -3347,7 +3347,7 @@ if ($action == 'create') { jQuery("#radio_deposit").prop("checked", true); setRadioForTypeOfIncoice(); }); - jQuery("#radio_standard, #radio_deposit, #radio_replacement, #radio_template").change(function() { + jQuery("#radio_standard, #radio_deposit, #radio_replacement, #radio_creditnote, #radio_template").change(function() { setRadioForTypeOfIncoice(); }); function setRadioForTypeOfIncoice() { @@ -3363,10 +3363,10 @@ if ($action == 'create') { }); '; - $tmp = $tmp.''; - $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3); print ''; print ''; if (($origin == 'propal') || ($origin == 'commande')) { @@ -3405,7 +3405,7 @@ if ($action == 'create') { print '
'; $tmp = ' '; $tmp = $tmp.''; - $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); + $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3, 'firstsituationonsmartphone'); print $desc; print '
'; @@ -3418,7 +3418,7 @@ if ($action == 'create') { $tmp .= ' disabled'; } $tmp .= '> '; - $text = ' '; + $text = $tmp.' '; $text .= 'id > 0) { $text .= ' disabled'; @@ -3487,26 +3487,18 @@ if ($action == 'create') { if (!empty($conf->global->INVOICE_USE_SITUATION)) { print '
'; $tmp = ' '; - $text = ' '; + $text = $tmp.' '; $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); - print $desc; - print '
'; - - print '
'; - $tmp = ' '; - $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3, 'firstsituationonsmartphone'); print $desc; print '
'; } print '
'; $tmp = ' '; - $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc"), 1, 'help', '', 0, 3); + $text = $tmp.' '; + //$text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc").'

'.$langs->trans("YouMustCreateInvoiceFromThird"), 1, 'help', '', 0, 3, 'replacementonsmartphone'); print $desc; print '
'; } @@ -3566,7 +3558,6 @@ if ($action == 'create') { }); '; $text = ' '; - // $text.=''; $text .= ' 0 ? 'checked' : '').' /> "; print '
    0 ? 'checked' : '').' /> "; print ''; @@ -3596,9 +3587,9 @@ if ($action == 'create') { } else { $tmp = ' '; } - $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); + $text = $tmp.' '; + //$text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc").'

'.$langs->trans("YouMustCreateInvoiceFromThird"), 1, 'help', '', 0, 3, 'creditnoteonsmartphone'); print $desc; print ''."\n"; } @@ -3607,9 +3598,8 @@ if ($action == 'create') { // Template invoice print '
'; $tmp = ' '; - $text = ' '; - //$text.= '('.$langs->trans("YouMustCreateStandardInvoiceFirst").') '; - $desc = $form->textwithpicto($text, $langs->transnoentities("YouMustCreateStandardInvoiceFirstDesc"), 1, 'help', '', 0, 3); + $text = $tmp.' '; + $desc = $form->textwithpicto($text, $langs->transnoentities("YouMustCreateStandardInvoiceFirstDesc"), 1, 'help', '', 0, 3, 'templateonsmartphone'); print $desc; print '
'; @@ -3630,7 +3620,8 @@ if ($action == 'create') { $(document).ready(function() { var listType = {'.$jsListType.'}; $("[name=\'type\'").change(function() { - if($( this ).prop("checked")) + console.log("change name=type"); + if ($( this ).prop("checked")) { if(($( this ).val() in listType)) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a672709cc48..62fee2bc8ec 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -709,7 +709,7 @@ class Form * @param string $extracss Add a CSS style to td, div or span tag * @param int $noencodehtmltext Do not encode into html entity the htmltext * @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span - * @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none' or on both if $type='xxxclickable') + * @param string $tooltiptrigger ''=Tooltip on hover and hidden on smartphone, 'abconsmartphone'=Tooltip on hover and on click on smartphone, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none' or on both if $type='xxxclickable') * @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only) * @return string HTML code of text, picto, tooltip */ @@ -717,11 +717,6 @@ class Form { global $conf, $langs; - $alt = ''; - if ($tooltiptrigger) { - $alt = $langs->transnoentitiesnoconv("ClickToShowHelp"); - } - //For backwards compatibility if ($type == '0') { $type = 'info'; @@ -729,6 +724,15 @@ class Form $type = 'help'; } + if (preg_match('/onsmartphone$/', $tooltiptrigger) && empty($conf->dol_no_mouse_hover)) { + $tooltiptrigger = preg_replace('/^.*onsmartphone$/', '', $tooltiptrigger); + } + + $alt = ''; + if ($tooltiptrigger) { + $alt = $langs->transnoentitiesnoconv("ClickToShowHelp"); + } + // If info or help with no javascript, show only text if (empty($conf->use_javascript_ajax)) { if ($type == 'info' || $type == 'infoclickable' || $type == 'help' || $type == 'helpclickable') { From 760135a0bbc682423b40afea2294a6797c06759c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 12:10:59 +0100 Subject: [PATCH 03/14] Look and feel v18 --- htdocs/core/tpl/massactions_pre.tpl.php | 20 ++++++++++++-------- htdocs/langs/en_US/main.lang | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 5124a1dce35..67a2e1ebd01 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -63,15 +63,19 @@ if ($massaction == 'preaffecttag' && isModEnabled('category')) { if (!empty($categ_types)) { foreach ($categ_types as $categ_type) { $cate_arbo = $form->select_all_categories($categ_type['code'], null, 'parent', null, null, 1); - $formquestion[] = array('type' => 'other', - 'name' => 'affecttag_'.$categ_type['code'], - 'label' => $langs->trans("Tag").' '.$categ_type['label'], - 'value' => $form->multiselectarray('contcats_'.$categ_type['code'], $cate_arbo, GETPOST('contcats_'.$categ_type['code'], 'array'), null, null, null, null, '60%')); - } - $formquestion[] = array('type' => 'other', - 'name' => 'affecttag_type', + $formquestion[] = array( + 'type' => 'other', + 'name' => 'affecttag_'.$categ_type['code'], 'label' => '', - 'value' => ''); + 'value' => $form->multiselectarray('contcats_'.$categ_type['code'], $cate_arbo, GETPOST('contcats_'.$categ_type['code'], 'array'), null, null, '', 0, '60%', '', '', $langs->trans("SelectTheTagsToAssign")) + ); + } + $formquestion[] = array( + 'type' => 'other', + 'name' => 'affecttag_type', + 'label' => '', + 'value' => '' + ); print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmAffectTag"), $langs->trans("ConfirmAffectTagQuestion", count($toselect)), "affecttag", $formquestion, 1, 0, 200, 500, 1); } else { setEventMessage('CategTypeNotFound'); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index a79a5083b69..992eb91b050 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -513,6 +513,7 @@ NotYetAvailable=Not yet available NotAvailable=Not available Categories=Tags/categories Category=Tag/category +SelectTheTagsToAssign=Select the tags/categories to assign By=By From=From FromDate=From From 30c0b5e60e09b32caad6885134c4a618197e4c3d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 12:39:00 +0100 Subject: [PATCH 04/14] Debug Look and feel v17 --- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/functions.lib.php | 6 +++--- htdocs/core/tpl/massactions_pre.tpl.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 62fee2bc8ec..e04c0bddf11 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5354,7 +5354,7 @@ class Form // Line title $formconfirm .= ''."\n"; // Line text diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 79e3c3e05c7..7ca4b30e0a0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4109,7 +4109,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'github', 'google', 'jabber', 'microsoft', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies', 'generic', 'home', 'hrm', 'members', 'products', 'invoicing', - 'partnership', 'payment', 'payment_vat', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'question', 'refresh', 'region', + 'partnership', 'payment', 'payment_vat', 'pencil-ruler', 'pictoconfirm', 'preview', 'project', 'projectpub', 'projecttask', 'question', 'refresh', 'region', 'salary', 'shipment', 'state', 'supplier_invoice', 'supplier_invoicea', 'supplier_invoicer', 'supplier_invoiced', 'technic', 'ticket', 'error', 'warning', @@ -4158,8 +4158,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', 'other'=>'square', 'playdisabled'=>'play', 'pdf'=>'file-pdf', 'poll'=>'check-double', 'pos'=>'cash-register', 'preview'=>'binoculars', 'project'=>'project-diagram', 'projectpub'=>'project-diagram', 'projecttask'=>'tasks', 'propal'=>'file-signature', 'proposal'=>'file-signature', - 'partnership'=>'handshake', 'payment'=>'money-check-alt', 'payment_vat'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'puce'=>'angle-right', - 'recent' => 'question', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', + 'partnership'=>'handshake', 'payment'=>'money-check-alt', 'payment_vat'=>'money-check-alt', 'pictoconfirm'=>'check-square', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'puce'=>'angle-right', + 'recent' => 'check-square', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', 'refresh'=>'redo', 'region'=>'map-marked', 'replacement'=>'exchange-alt', 'resource'=>'laptop-house', 'recurring'=>'history', 'service'=>'concierge-bell', diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 67a2e1ebd01..24ec6665d03 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -62,12 +62,12 @@ if ($massaction == 'preaffecttag' && isModEnabled('category')) { $formquestion = array(); if (!empty($categ_types)) { foreach ($categ_types as $categ_type) { - $cate_arbo = $form->select_all_categories($categ_type['code'], null, 'parent', null, null, 1); + $categ_arbo_tmp = $form->select_all_categories($categ_type['code'], null, 'parent', null, null, 2); $formquestion[] = array( 'type' => 'other', 'name' => 'affecttag_'.$categ_type['code'], 'label' => '', - 'value' => $form->multiselectarray('contcats_'.$categ_type['code'], $cate_arbo, GETPOST('contcats_'.$categ_type['code'], 'array'), null, null, '', 0, '60%', '', '', $langs->trans("SelectTheTagsToAssign")) + 'value' => $form->multiselectarray('contcats_'.$categ_type['code'], $categ_arbo_tmp, GETPOST('contcats_'.$categ_type['code'], 'array'), null, null, '', 0, '60%', '', '', $langs->trans("SelectTheTagsToAssign")) ); } $formquestion[] = array( From b5ec68a1c3182f02f302e003fe84d2cf9735e98a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 13:05:35 +0100 Subject: [PATCH 05/14] Fix look and feel v17 --- htdocs/comm/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 5d71683a311..8f94f29f7ca 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -868,7 +868,7 @@ if (isModEnabled('contrat') && $user->hasRight("contrat", "lire") && 0) { // TOD print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -971,7 +971,7 @@ if (isModEnabled("propal") && $user->hasRight("propal", "lire")) { print '
'; + $tmp = $tmp.''; + $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3, 'depositonsmartphone'); print $desc; print '
'; - $formconfirm .= img_picto('', 'recent').' '.$title; + $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; $formconfirm .= '
'.$staticcontrat->getNomUrl(1).''.$companystatic->getNomUrl(1, 'customer', 44).''.$companystatic->getNomUrl(1, 'customer').''.$staticcontrat->LibStatut($obj->statut, 3).'
'; print '
'.$companystatic->getNomUrl(1, 'customer', 44).''.$companystatic->getNomUrl(1, 'customer').''; print dol_print_date($datem, 'day', 'tzserver'); @@ -1091,7 +1091,7 @@ if (isModEnabled('commande') && $user->rights->commande->lire) { print '
'; print ''; - print ''.$companystatic->getNomUrl(1, 'customer', 44).''; + print ''.$companystatic->getNomUrl(1, 'customer').''; $datem = $db->jdate($obj->dv); print ''; print dol_print_date($datem, 'day', 'tzserver'); From 56add74e71895008b86bd0130a0a04bb0e0e7f20 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 13:58:57 +0100 Subject: [PATCH 06/14] Debug v17 --- htdocs/comm/index.php | 2 +- htdocs/core/lib/project.lib.php | 41 +++++++++++++++++++----- htdocs/fourn/facture/list.php | 56 +++++++++++++++++---------------- htdocs/projet/card.php | 2 +- htdocs/projet/index.php | 3 +- 5 files changed, 65 insertions(+), 39 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 8f94f29f7ca..415728cb3e9 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -163,7 +163,7 @@ if (isModEnabled("propal") && $user->hasRight("propal", "lire")) { $obj = $db->fetch_object($resql); if ($i >= $max) { - $othernb += 1; + $othernb++; $i++; $total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc); continue; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index f144b97e922..cdffc5c1961 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2192,13 +2192,16 @@ function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole) * @param int $status -1=No filter on statut, 0 or 1 = Filter on status * @param array $listofoppstatus List of opportunity status * @param array $hiddenfields List of info to not show ('projectlabel', 'declaredprogress', '...', ) + * @param int $max Max nb of record to show in HTML list * @return void */ -function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $status = -1, $listofoppstatus = array(), $hiddenfields = array()) +function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $status = -1, $listofoppstatus = array(), $hiddenfields = array(), $max = 0) { global $langs, $conf, $user; global $theme_datacolor; + $maxofloop = (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD); + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $listofstatus = array_keys($listofoppstatus); @@ -2229,8 +2232,6 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $title = $langs->trans("Projects").' '.$langs->trans($projectstatic->statuts_long[$status]); } - $arrayidtypeofcontact = array(); - print ''; print '
'; print ''; @@ -2309,11 +2310,15 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $resql = $db->query($sql2); if ($resql) { + $othernb = 0; $total_task = 0; $total_opp_amount = 0; $ponderated_opp_amount = 0; + $total_plannedworkload = 0; + $total_declaredprogressworkload = 0; $num = $db->num_rows($resql); + $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); $i = 0; print ''; @@ -2340,11 +2345,23 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks } print "\n"; - $total_plannedworkload = 0; - $total_declaredprogressworkload = 0; - while ($i < $num) { + while ($i < $nbofloop) { $objp = $db->fetch_object($resql); + if ($max && $i >= $max) { + $othernb++; + $i++; + $total_task += $objp->nb; + $total_opp_amount += $objp->opp_amount; + $opp_weighted_amount = $objp->opp_percent * $objp->opp_amount / 100; + $ponderated_opp_amount += price2num($opp_weighted_amount); + $plannedworkload = $objp->planned_workload; + $total_plannedworkload += $plannedworkload; + $declaredprogressworkload = $objp->declared_progess_workload; + $total_declaredprogressworkload += $declaredprogressworkload; + continue; + } + $projectstatic->id = $objp->projectid; $projectstatic->user_author_id = $objp->fk_user_creat; $projectstatic->public = $objp->public; @@ -2451,13 +2468,21 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks print "\n"; - $total_task = $total_task + $objp->nb; - $total_opp_amount = $total_opp_amount + $objp->opp_amount; + $total_task += $objp->nb; + $total_opp_amount += $objp->opp_amount; } $i++; } + if ($othernb) { + print ''; + print ''; + print "\n"; + } + print ''; print '"; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index be215e891eb..ad03c48258b 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1028,17 +1028,17 @@ if (!empty($arrayfields['f.ref_supplier']['checked'])) { if (!empty($arrayfields['f.type']['checked'])) { print ''; @@ -1065,11 +1065,11 @@ if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1543,7 +1543,7 @@ if ($num > 0) { // Alias if (!empty($arrayfields['s.name_alias']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1551,8 +1551,8 @@ if ($num > 0) { } // Town if (!empty($arrayfields['s.town']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; @@ -1560,7 +1560,7 @@ if ($num > 0) { } // Zip if (!empty($arrayfields['s.zip']['checked'])) { - print ''; if (!$i) { @@ -1569,7 +1569,9 @@ if ($num > 0) { } // State if (!empty($arrayfields['state.nom']['checked'])) { - print "\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1620,14 +1622,14 @@ if ($num > 0) { // Amount HT if (!empty($arrayfields['f.total_ht']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ht'; } - $totalarray['val']['f.total_ht'] += $obj->total_ht; + $totalarray['val']['f.total_ht'] += $obj->total_ht; } // Amount VAT if (!empty($arrayfields['f.total_vat']['checked'])) { @@ -1726,7 +1728,7 @@ if ($num > 0) { // Currency if (!empty($arrayfields['f.multicurrency_code']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1734,16 +1736,16 @@ if ($num > 0) { // Currency rate if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } } // Amount HT if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e954f429781..4f743cc58f7 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1102,7 +1102,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; print ''; } if (!empty($arrayfields['p.fk_statut']['checked'])) { From c3da1554a7edb6cf59d83ee69b52141b08a1d7ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 16:28:04 +0100 Subject: [PATCH 08/14] Debug v17 --- htdocs/core/actions_massactions.inc.php | 9 ++- htdocs/projet/class/project.class.php | 76 +++++++++++++------------ htdocs/projet/list.php | 1 + 3 files changed, 49 insertions(+), 37 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index d5731f014af..3338acd1be4 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -958,7 +958,14 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) { foreach ($toselect as $toselectid) { $result = $objecttmp->fetch($toselectid); if ($result > 0) { - $result = $objecttmp->validate($user); + if (method_exists($objecttmp, 'validate')) { + $result = $objecttmp->validate($user); + } elseif (method_exists($objecttmp, 'setValid')) { + $result = $objecttmp->setValid($user); + } else { + $objecttmp->error = 'No method validate or setValid on this object'; + $result = -1; + } if ($result == 0) { $langs->load("errors"); setEventMessages($langs->trans("ErrorObjectMustHaveStatusDraftToBeValidated", $objecttmp->ref), null, 'errors'); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 0d6df2ddc98..5375a418ca2 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1098,7 +1098,7 @@ class Project extends CommonObject * * @param User $user User that validate * @param int $notrigger 1=Disable triggers - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, 0=Nothing done, >0 if KO */ public function setValid($user, $notrigger = 0) { @@ -1106,47 +1106,51 @@ class Project extends CommonObject $error = 0; - if ($this->statut != 1) { - // Check parameters - if (preg_match('/^'.preg_quote($langs->trans("CopyOf").' ').'/', $this->title)) { - $this->error = $langs->trans("ErrorFieldFormat", $langs->transnoentities("Label")).'. '.$langs->trans('RemoveString', $langs->transnoentitiesnoconv("CopyOf")); - return -1; + // Protection + if ($this->status == self::STATUS_VALIDATED) { + dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING); + return 0; + } + + // Check parameters + if (preg_match('/^'.preg_quote($langs->trans("CopyOf").' ').'/', $this->title)) { + $this->error = $langs->trans("ErrorFieldFormat", $langs->transnoentities("Label")).'. '.$langs->trans('RemoveString', $langs->transnoentitiesnoconv("CopyOf")); + return -1; + } + + $this->db->begin(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."projet"; + $sql .= " SET fk_statut = ".self::STATUS_VALIDATED; + $sql .= " WHERE rowid = ".((int) $this->id); + $sql .= " AND entity = ".((int) $conf->entity); + + dol_syslog(get_class($this)."::setValid", LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) { + // Call trigger + if (empty($notrigger)) { + $result = $this->call_trigger('PROJECT_VALIDATE', $user); + if ($result < 0) { + $error++; + } + // End call triggers } - $this->db->begin(); - - $sql = "UPDATE ".MAIN_DB_PREFIX."projet"; - $sql .= " SET fk_statut = 1"; - $sql .= " WHERE rowid = ".((int) $this->id); - $sql .= " AND entity = ".((int) $conf->entity); - - dol_syslog(get_class($this)."::setValid", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) { - // Call trigger - if (empty($notrigger)) { - $result = $this->call_trigger('PROJECT_VALIDATE', $user); - if ($result < 0) { - $error++; - } - // End call triggers - } - - if (!$error) { - $this->statut = 1; - $this->db->commit(); - return 1; - } else { - $this->db->rollback(); - $this->error = join(',', $this->errors); - dol_syslog(get_class($this)."::setValid ".$this->error, LOG_ERR); - return -1; - } + if (!$error) { + $this->statut = 1; + $this->db->commit(); + return 1; } else { $this->db->rollback(); - $this->error = $this->db->lasterror(); + $this->error = join(',', $this->errors); + dol_syslog(get_class($this)."::setValid ".$this->error, LOG_ERR); return -1; } + } else { + $this->db->rollback(); + $this->error = $this->db->lasterror(); + return -1; } } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index c50350c91cc..15fc35f9e84 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -888,6 +888,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( + 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), From 2cafd2cbc49268b1995f772ac416aab02a3a38aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 16:42:01 +0100 Subject: [PATCH 09/14] Debug v17 --- .../compta/paiement/cheque/class/remisecheque.class.php | 2 +- htdocs/core/actions_massactions.inc.php | 9 +++++++-- htdocs/don/class/don.class.php | 2 +- htdocs/projet/class/project.class.php | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 3fb82f05cb9..9895e583601 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -261,7 +261,7 @@ class RemiseCheque extends CommonObject $this->errno = $this->db->lasterrno(); } - if (!$this->errno && !empty($conf->global->MAIN_DISABLEDRAFTSTATUS)) { + if (!$this->errno && (getDolGlobalString('MAIN_DISABLEDRAFTSTATUS') || getDolGlobalString('MAIN_DISABLEDRAFTSTATUS_CHEQUE'))) { $res = $this->validate($user); //if ($res < 0) $error++; } diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 3338acd1be4..9afd82b7eaf 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -984,8 +984,13 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { - $newlang = $objecttmp->thirdparty->default_lang; + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && property_exists($objecttmp, 'thirdparty')) { + if ((property_exists($objecttmp, 'socid') || property_exists($objecttmp, 'fk_soc')) && empty($objecttmp->thirdparty)) { + $objecttmp->fetch_thirparty(); + } + if (!empty($objecttmp->thirdparty)) { + $newlang = $objecttmp->thirdparty->default_lang; + } } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index ceb5b95c1f3..35c5c5ff40a 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -438,7 +438,7 @@ class Don extends CommonObject } } - if (!$error && !empty($conf->global->MAIN_DISABLEDRAFTSTATUS)) { + if (!$error && (getDolGlobalString('MAIN_DISABLEDRAFTSTATUS') || getDolGlobalString('MAIN_DISABLEDRAFTSTATUS_DONATION'))) { //$res = $this->setValid($user); //if ($res < 0) $error++; } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 5375a418ca2..d6b0515eb1a 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -498,7 +498,7 @@ class Project extends CommonObject } } - if (!$error && !empty($conf->global->MAIN_DISABLEDRAFTSTATUS)) { + if (!$error && (getDolGlobalString('MAIN_DISABLEDRAFTSTATUS') || getDolGlobalString('MAIN_DISABLEDRAFTSTATUS_PROJECT'))) { $res = $this->setValid($user); if ($res < 0) { $error++; From 6224414b0d36d1c8fe7e0bbad83848ab78eeab88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 16:55:36 +0100 Subject: [PATCH 10/14] Debug v17 --- htdocs/projet/card.php | 44 +++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 4f743cc58f7..bbecfacdae4 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -99,6 +99,8 @@ if ($id == '' && $ref == '' && ($action != "create" && $action != "add" && $acti accessforbidden(); } +$permissiontoadd = $user->rights->projet->creer; +$permissiontodelete = $user->rights->projet->supprimer; $permissiondellink = $user->rights->projet->creer; // Used by the include of actions_dellink.inc.php @@ -152,7 +154,20 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once - if ($action == 'add' && $user->rights->projet->creer) { + // Action setdraft object + if ($action == 'confirm_setdraft' && $confirm == 'yes' && $permissiontoadd) { + $result = $object->setStatut($object::STATUS_DRAFT, null, '', 'PROJECT_MODIFY'); + if ($result >= 0) { + // Nothing else done + } else { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } + $action = ''; + } + + // Action add + if ($action == 'add' && $permissiontoadd) { $error = 0; if (!GETPOST('ref')) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); @@ -260,7 +275,7 @@ if (empty($reshook)) { } } - if ($action == 'update' && empty(GETPOST('cancel')) && $user->rights->projet->creer) { + if ($action == 'update' && empty(GETPOST('cancel')) && $permissiontoadd) { $error = 0; if (empty($ref)) { @@ -376,7 +391,7 @@ if (empty($reshook)) { } // Build doc - if ($action == 'builddoc' && $user->rights->projet->creer) { + if ($action == 'builddoc' && $permissiontoadd) { // Save last template used to generate document if (GETPOST('model')) { $object->setDocModel($user, GETPOST('model', 'alpha')); @@ -395,7 +410,7 @@ if (empty($reshook)) { } // Delete file in doc form - if ($action == 'remove_file' && $user->rights->projet->creer) { + if ($action == 'remove_file' && $permissiontoadd) { if ($object->id > 0) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -413,28 +428,28 @@ if (empty($reshook)) { } - if ($action == 'confirm_validate' && $confirm == 'yes') { + if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) { $result = $object->setValid($user); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); } } - if ($action == 'confirm_close' && $confirm == 'yes') { + if ($action == 'confirm_close' && $confirm == 'yes' && $permissiontoadd) { $result = $object->setClose($user); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); } } - if ($action == 'confirm_reopen' && $confirm == 'yes') { + if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) { $result = $object->setValid($user); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); } } - if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $user->rights->projet->supprimer) { + if ($action == 'confirm_delete' && $confirm == 'yes' && $permissiontodelete) { $object->fetch($id); $result = $object->delete($user); if ($result > 0) { @@ -447,7 +462,7 @@ if (empty($reshook)) { } } - if ($action == 'confirm_clone' && $user->rights->projet->creer && $confirm == 'yes') { + if ($action == 'confirm_clone' && $permissiontoadd && $confirm == 'yes') { $clone_contacts = GETPOST('clone_contacts') ? 1 : 0; $clone_tasks = GETPOST('clone_tasks') ? 1 : 0; $clone_project_files = GETPOST('clone_project_files') ? 1 : 0; @@ -1483,6 +1498,17 @@ if ($action == 'create' && $user->rights->projet->creer) { } */ + // Back to draft + if (!getDolGlobalString('MAIN_DISABLEDRAFTSTATUS') && !getDolGlobalString('MAIN_DISABLEDRAFTSTATUS_PROJECT')) { + if ($object->statut != Project::STATUS_DRAFT && $user->rights->projet->creer) { + if ($userWrite > 0) { + print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?action=confirm_setdraft&confirm=yes&token='.newToken().'&id='.$object->id, ''); + } else { + print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('SetToDraft'), 'default', $_SERVER['PHP_SELF']. '#', '', false); + } + } + } + // Modify if ($object->statut != Project::STATUS_CLOSED && $user->rights->projet->creer) { if ($userWrite > 0) { From 2b8b389bcfae99bfd31046d9e1de63bbd258545a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 17:00:40 +0100 Subject: [PATCH 11/14] Fix regression --- htdocs/core/actions_massactions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 9afd82b7eaf..6fe7ab2ac5d 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -986,7 +986,7 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) { } if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && property_exists($objecttmp, 'thirdparty')) { if ((property_exists($objecttmp, 'socid') || property_exists($objecttmp, 'fk_soc')) && empty($objecttmp->thirdparty)) { - $objecttmp->fetch_thirparty(); + $objecttmp->fetch_thirdparty(); } if (!empty($objecttmp->thirdparty)) { $newlang = $objecttmp->thirdparty->default_lang; From 8a283f4de4b5b066e51e79db95dedff49a66bb4c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 17:12:13 +0100 Subject: [PATCH 12/14] Fix missing extraparams column --- .../install/mysql/migration/16.0.0-17.0.0.sql | 4 ++ htdocs/install/mysql/tables/llx_commande.sql | 2 +- htdocs/install/mysql/tables/llx_projet.sql | 69 ++++++++++--------- 3 files changed, 40 insertions(+), 35 deletions(-) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 744c000294b..9d0a5a776d6 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -396,3 +396,7 @@ ALTER TABLE llx_c_tva ADD COLUMN use_default tinyint DEFAULT 0; ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN ref varchar(128); ALTER TABLE llx_facture_fourn_det MODIFY COLUMN ref varchar(128); + +ALTER TABLE llx_projet ADD COLUMN extraparams varchar(255); + + diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql index 67712178bd3..e64ce7ff14f 100644 --- a/htdocs/install/mysql/tables/llx_commande.sql +++ b/htdocs/install/mysql/tables/llx_commande.sql @@ -77,7 +77,7 @@ create table llx_commande fk_incoterms integer, -- for incoterms location_incoterms varchar(255), -- for incoterms import_key varchar(14), - extraparams varchar(255), -- for stock other parameters with json format + extraparams varchar(255), -- to save other parameters with json format fk_multicurrency integer, multicurrency_code varchar(3), diff --git a/htdocs/install/mysql/tables/llx_projet.sql b/htdocs/install/mysql/tables/llx_projet.sql index 3b8bf1be05b..531f0992f2c 100644 --- a/htdocs/install/mysql/tables/llx_projet.sql +++ b/htdocs/install/mysql/tables/llx_projet.sql @@ -19,45 +19,46 @@ create table llx_projet ( - rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_soc integer, - datec datetime, -- date creation project - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - dateo date, -- date start project - datee date, -- date end project - ref varchar(50), - entity integer DEFAULT 1 NOT NULL, -- multi company id - title varchar(255) NOT NULL, - description text, - fk_user_creat integer NOT NULL, -- createur du projet - fk_user_modif integer, - public integer, -- project is public or not - fk_statut integer DEFAULT 0 NOT NULL, -- open or close - fk_opp_status integer DEFAULT NULL, -- if project is used to manage opportunities - opp_percent double(5,2), - fk_opp_status_end integer DEFAULT NULL, -- if project is used to manage opportunities (the opportunity status the project has when set to lose) - date_close datetime DEFAULT NULL, - fk_user_close integer DEFAULT NULL, - note_private text, - note_public text, - email_msgid varchar(175), -- if project or lead is created by email collector, we store here MSG ID. Do not use a too large value, it generates trouble with unique index - --budget_days real, -- budget in days is sum of field planned_workload of tasks - opp_amount double(24,8), - budget_amount double(24,8), + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_soc integer, + datec datetime, -- date creation project + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + dateo date, -- date start project + datee date, -- date end project + ref varchar(50), + entity integer DEFAULT 1 NOT NULL, -- multi company id + title varchar(255) NOT NULL, + description text, + fk_user_creat integer NOT NULL, -- createur du projet + fk_user_modif integer, + public integer, -- project is public or not + fk_statut integer DEFAULT 0 NOT NULL, -- open or close + fk_opp_status integer DEFAULT NULL, -- if project is used to manage opportunities + opp_percent double(5,2), + fk_opp_status_end integer DEFAULT NULL, -- if project is used to manage opportunities (the opportunity status the project has when set to lose) + date_close datetime DEFAULT NULL, + fk_user_close integer DEFAULT NULL, + note_private text, + note_public text, + email_msgid varchar(175), -- if project or lead is created by email collector, we store here MSG ID. Do not use a too large value, it generates trouble with unique index + --budget_days real, -- budget in days is sum of field planned_workload of tasks + opp_amount double(24,8), + budget_amount double(24,8), usage_opportunity integer DEFAULT 0, -- Set to 1 if project is used to follow an opportunity usage_task integer DEFAULT 1, -- Set to 1 if project is used to manage tasks and/or record timesheet usage_bill_time integer DEFAULT 0, -- Set to 1 if time spent must be converted into invoices usage_organize_event integer DEFAULT 0, -- Set to 1 if you want to use project to organize an event or receive attendees registration - date_start_event datetime, -- date start event - date_end_event datetime, -- date end event - location varchar(255), -- location + date_start_event datetime, -- date start event + date_end_event datetime, -- date end event + location varchar(255), -- location accept_conference_suggestions integer DEFAULT 0, -- Set to 1 if you want to allow unknown people to suggest conferences - accept_booth_suggestions integer DEFAULT 0, -- Set to 1 if you want to Allow unknown people to suggest booth + accept_booth_suggestions integer DEFAULT 0, -- Set to 1 if you want to Allow unknown people to suggest booth max_attendees integer DEFAULT 0, price_registration double(24,8), - price_booth double(24,8), - model_pdf varchar(255), - ip varchar(250), --ip used to create record (for public submission page) - last_main_doc varchar(255), -- relative filepath+filename of last main generated document - import_key varchar(14) -- Import key + price_booth double(24,8), + model_pdf varchar(255), + ip varchar(250), -- ip used to create record (for public submission page) + last_main_doc varchar(255), -- relative filepath+filename of last main generated document + import_key varchar(14), -- Import key + extraparams varchar(255) -- to save other parameters with json format )ENGINE=innodb; From 9966d605a2c7505dab8e0b3016fb966536be5f94 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 17:20:51 +0100 Subject: [PATCH 13/14] Debug v17 --- htdocs/projet/class/project.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index d6b0515eb1a..c4303a73950 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1123,7 +1123,7 @@ class Project extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."projet"; $sql .= " SET fk_statut = ".self::STATUS_VALIDATED; $sql .= " WHERE rowid = ".((int) $this->id); - $sql .= " AND entity = ".((int) $conf->entity); + //$sql .= " AND entity = ".((int) $conf->entity); // Disabled, when we use the ID for the where, we must not add any other search condition dol_syslog(get_class($this)."::setValid", LOG_DEBUG); $resql = $this->db->query($sql); From 230c3d2752c7190325b99bcfdad882a1b3e9702c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 18:11:41 +0100 Subject: [PATCH 14/14] Debug v17 --- htdocs/bookmarks/bookmarks.lib.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 88cae3e4293..4141aa671a0 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -102,6 +102,7 @@ function printDropdownBookmarksList() $listbtn .= img_picto('', 'edit', 'class="paddingright opacitymedium"').$langs->trans('EditBookmarks').''; $bookmarkList = ''; + $bookmarkNb = 0; // Menu with list of bookmarks $sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark"; $sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)"; @@ -116,6 +117,7 @@ function printDropdownBookmarksList() $bookmarkList .= dol_escape_htmltag($obj->title); $bookmarkList .= ''; $i++; + $bookmarkNb++; } $bookmarkList .= ''; @@ -141,6 +143,7 @@ function printDropdownBookmarksList() $searchForm .= dol_escape_htmltag($obj->title); $searchForm .= ''; $i++; + $bookmarkNb++; } $searchForm .= ''; } @@ -200,13 +203,15 @@ function printDropdownBookmarksList() '; - $html .= ' - - - '; + if ($bookmarkNb) { + $html .= ' + + + '; + } $html .= '
'; + print ''.$langs->trans("More").'...'.($othernb < $maxofloop ? ' ('.$othernb.')' : '').''; + print '
'.$langs->trans("Total")."'; $listtype = array( - FactureFournisseur::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), - FactureFournisseur::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), - FactureFournisseur::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), - FactureFournisseur::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), + FactureFournisseur::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), + FactureFournisseur::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), + FactureFournisseur::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), + FactureFournisseur::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), ); /* - if (!empty($conf->global->INVOICE_USE_SITUATION)) - { - $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); - } - */ + if (!empty($conf->global->INVOICE_USE_SITUATION)) + { + $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); + } + */ //$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order. print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100'); print ''; print '
'; /* - print $langs->trans('From').' '; - print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1); - print '
'; - print '
'; - print $langs->trans('to').' ';*/ + print $langs->trans('From').' '; + print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1); + print '
'; + print '
'; + print $langs->trans('to').' ';*/ print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("Before")); print '
'.$langs->trans("Alert"); print '
'; @@ -1487,7 +1487,7 @@ if ($num > 0) { // Label if (!empty($arrayfields['f.label']['checked'])) { print '
'; - print $obj->label; + print dol_escape_htmltag($obj->label); print ''; - print $thirdparty->name_alias; + print dol_escape_htmltag($thirdparty->name_alias); print ''; - print $obj->town; + print ''; + print dol_escape_htmltag($obj->town); print ''; + print ''; print dol_escape_htmltag($obj->zip); print '".$obj->state_name."'; + print dol_escape_htmltag($obj->state_name); + print "'.price($obj->total_ht)."'.price($obj->total_ht)."'.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."'.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."'; - $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code); - print "'; + $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code); + print "'.price($obj->multicurrency_total_ht)."'.price($obj->multicurrency_total_ht)."
'.$langs->trans("OpportunityStatus").''; print '
'; - print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'inline-block valignmiddle', 1, 1); + print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'minwidth150 inline-block valignmiddle', 1, 1); // Opportunity probability print ' %'; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 2698a4b1a21..27885de31b9 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -193,9 +193,8 @@ print '
'; */ include DOL_DOCUMENT_ROOT.'/projet/graph_opportunities.inc.php'; - // List of draft projects -print_projecttasks_array($db, $form, $socid, $projectsListId, 0, 0, $listofoppstatus, array('projectlabel', 'plannedworkload', 'declaredprogress', 'prospectionstatus', 'projectstatus')); +print_projecttasks_array($db, $form, $socid, $projectsListId, 0, 0, $listofoppstatus, array('projectlabel', 'plannedworkload', 'declaredprogress', 'prospectionstatus', 'projectstatus'), $max); print '
'; From 93927cceff72b02fab0ed468346e45b901601cd7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 16:12:28 +0100 Subject: [PATCH 07/14] Debug v17 --- htdocs/core/lib/functions.lib.php | 86 +++++++++++++++++++++---------- htdocs/projet/list.php | 71 ++++++++++++++++--------- 2 files changed, 106 insertions(+), 51 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7ca4b30e0a0..0664bae3f58 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -784,6 +784,12 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null } } } else { + // If field name is 'search_xxx' then we force the add of space after each < and > (when following char is numeric) because it means + // we use the < or > to make a search on a numeric value to do higher or lower so we can add a space to break html tags + if (strpos($paramname, 'search_') === 0) { + $out = preg_replace('/([<>])([-+]?\d)/', '\1 \2', $out); + } + $out = sanitizeVal($out, $check, $filter, $options); } @@ -9751,7 +9757,7 @@ function dol_getmypid() * If param $mode is 0, can contains several keywords separated with a space or | * like "keyword1 keyword2" = We want record field like keyword1 AND field like keyword2 * or like "keyword1|keyword2" = We want record field like keyword1 OR field like keyword2 - * If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000" + * If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < -1000" * If param $mode is 2, can contains a list of int id separated by comma like "1,3,4" * If param $mode is 3, can contains a list of string separated by comma like "a,b,c" * @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of ID separated with comma (Example '1,3,4') @@ -9789,23 +9795,35 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) $newres = ''; foreach ($fields as $field) { if ($mode == 1) { - $operator = '='; - $newcrit = preg_replace('/([!<>=]+)/', '', $crit); - - $reg = array(); - preg_match('/([!<>=]+)/', $crit, $reg); - if (!empty($reg[1])) { - $operator = $reg[1]; - } - if ($newcrit != '') { - $numnewcrit = price2num($newcrit); - if (is_numeric($numnewcrit)) { - $newres .= ($i2 > 0 ? ' OR ' : '').$field.' '.$operator.' '.((float) $numnewcrit); // should be a numeric - } else { - $newres .= ($i2 > 0 ? ' OR ' : '').'1 = 2'; // force false + $tmpcrits = explode('|', $crit); + $i3 = 0; // count the nb of valid criteria added for this field + foreach ($tmpcrits as $tmpcrit) { + if ($tmpcrit !== '0' && empty($tmpcrit)) { + continue; + } + $tmpcrit = trim($tmpcrit); + + $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : ''); + + $operator = '='; + $newcrit = preg_replace('/([!<>=]+)/', '', $tmpcrit); + + $reg = array(); + preg_match('/([!<>=]+)/', $tmpcrit, $reg); + if (!empty($reg[1])) { + $operator = $reg[1]; + } + if ($newcrit != '') { + $numnewcrit = price2num($newcrit); + if (is_numeric($numnewcrit)) { + $newres .= $field.' '.$operator.' '.((float) $numnewcrit); // should be a numeric + } else { + $newres .= '1 = 2'; // force false, we received a corrupted data + } + $i3++; // a criteria was added to string } - $i2++; // a criteria was added to string } + $i2++; } elseif ($mode == 2 || $mode == -2) { $crit = preg_replace('/[^0-9,]/', '', $crit); // ID are always integer $newres .= ($i2 > 0 ? ' OR ' : '').$field." ".($mode == -2 ? 'NOT ' : ''); @@ -9847,28 +9865,36 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) } } } - } else // $mode=0 - { + } else { // $mode=0 $tmpcrits = explode('|', $crit); - $i3 = 0; + $i3 = 0; // count the nb of valid criteria added for this field foreach ($tmpcrits as $tmpcrit) { if ($tmpcrit !== '0' && empty($tmpcrit)) { continue; } + $tmpcrit = trim($tmpcrit); - $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : ''); + if ($tmpcrit == '^$') { // If we search empty, we must combined different fields with AND + $newres .= (($i2 > 0 || $i3 > 0) ? ' AND ' : ''); + } else { + $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : ''); + } if (preg_match('/\.(id|rowid)$/', $field)) { // Special case for rowid that is sometimes a ref so used as a search field - $newres .= $field." = ".(is_numeric(trim($tmpcrit)) ? ((float) trim($tmpcrit)) : '0'); + $newres .= $field." = ".(is_numeric($tmpcrit) ? ((float) $tmpcrit) : '0'); } else { - $tmpcrit = trim($tmpcrit); $tmpcrit2 = $tmpcrit; $tmpbefore = '%'; $tmpafter = '%'; + $tmps = ''; + if (preg_match('/^!/', $tmpcrit)) { - $newres .= $field." NOT LIKE '"; // ! as exclude character + $tmps .= $field." NOT LIKE "; // ! as exclude character $tmpcrit2 = preg_replace('/^!/', '', $tmpcrit2); - } else $newres .= $field." LIKE '"; + } else { + $tmps .= $field." LIKE "; + } + $tmps .= "'"; if (preg_match('/^[\^\$]/', $tmpcrit)) { $tmpbefore = ''; @@ -9878,12 +9904,17 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) $tmpafter = ''; $tmpcrit2 = preg_replace('/[\^\$]$/', '', $tmpcrit2); } + + if ($tmpcrit2 == '' || preg_match('/^!/', $tmpcrit)) { + $tmps = "(".$tmps; + } + $newres .= $tmps; $newres .= $tmpbefore; $newres .= $db->escape($tmpcrit2); $newres .= $tmpafter; $newres .= "'"; - if ($tmpcrit2 == '') { - $newres .= " OR ".$field." IS NULL"; + if ($tmpcrit2 == '' || preg_match('/^!/', $tmpcrit)) { + $newres .= " OR ".$field." IS NULL)"; } } @@ -9893,13 +9924,14 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) } $i++; } + if ($newres) { $res = $res.($res ? ' AND ' : '').($i2 > 1 ? '(' : '').$newres.($i2 > 1 ? ')' : ''); } $j++; } $res = ($nofirstand ? "" : " AND ")."(".$res.")"; - //print 'xx'.$res.'yy'; + return $res; } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index dea5848b469..c50350c91cc 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -54,6 +54,7 @@ $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); +$optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'projectlist'; $title = $langs->trans("Projects"); @@ -113,6 +114,7 @@ $search_accept_booth_suggestions = GETPOST('search_accept_booth_suggestions', 'i $search_price_registration = GETPOST("search_price_registration", 'alpha'); $search_price_booth = GETPOST("search_price_booth", 'alpha'); $search_login = GETPOST('search_login', 'alpha'); +$search_import_key = GETPOST('search_import_key', 'alpha'); $searchCategoryCustomerOperator = 0; if (GETPOSTISSET('formfilteraction')) { $searchCategoryCustomerOperator = GETPOST('search_category_customer_operator', 'int'); @@ -120,7 +122,7 @@ if (GETPOSTISSET('formfilteraction')) { $searchCategoryCustomerOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT; } $searchCategoryCustomerList = GETPOST('search_category_customer_list', 'array'); -$optioncss = GETPOST('optioncss', 'alpha'); + $mine = ((GETPOST('mode') == 'mine') ? 1 : 0); if ($mine) { @@ -134,7 +136,6 @@ $search_eday = GETPOST('search_eday', 'int'); $search_emonth = GETPOST('search_emonth', 'int'); $search_eyear = GETPOST('search_eyear', 'int'); - $search_date_start_startmonth = GETPOST('search_date_start_startmonth', 'int'); $search_date_start_startyear = GETPOST('search_date_start_startyear', 'int'); $search_date_start_startday = GETPOST('search_date_start_startday', 'int'); @@ -152,6 +153,7 @@ $search_date_end_endmonth = GETPOST('search_date_end_endmonth', 'int'); $search_date_end_endyear = GETPOST('search_date_end_endyear', 'int'); $search_date_end_endday = GETPOST('search_date_end_endday', 'int'); $search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver + if (isModEnabled('categorie')) { $search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); } @@ -301,6 +303,7 @@ if (empty($reshook)) { $search_price_registration = ''; $search_price_booth = ''; $search_login = ''; + $search_import_key = ''; $toselect = array(); $search_array_options = array(); $search_category_array = array(); @@ -368,6 +371,8 @@ if (empty($reshook)) { $form = new Form($db); $formcompany = new FormCompany($db); +$now = dol_now(); + $companystatic = new Societe($db); $taskstatic = new Task($db); $formother = new FormOther($db); @@ -415,7 +420,7 @@ if (count($listofprojectcontacttypeexternal) == 0) { $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields -$distinct = 'DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once. +$distinct = 'DISTINCT'; // We add distinct until we have added a protection to be sure a contact of a project and task is only once. $sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat,"; $sql .= " p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount,"; $sql .= " p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event,"; @@ -436,6 +441,9 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); + +$sqlfields = $sql; // $sql fields to remove for count total + $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as p"; if (!empty($extrafields->attributes[$object->table_element]['label']) &&is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)"; @@ -546,9 +554,11 @@ if ($search_sale > 0) { // No check is done on company permission because readability is managed by public status of project and assignement. //if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id).") OR (s.rowid IS NULL))"; if ($search_project_user > 0) { + // TODO Replace this with a EXISTS and remove the link to table + DISTINCT $sql .= " AND ecp.fk_c_type_contact IN (".$db->sanitize(join(',', array_keys($listofprojectcontacttype))).") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".((int) $search_project_user); } if ($search_project_contact > 0) { + // TODO Replace this with a EXISTS and remove the link to table + DISTINCT $sql .= " AND ecp_contact.fk_c_type_contact IN (".$db->sanitize(join(',', array_keys($listofprojectcontacttypeexternal))).") AND ecp_contact.element_id = p.rowid AND ecp_contact.fk_socpeople = ".((int) $search_project_contact); } if ($search_opp_amount != '') { @@ -584,6 +594,9 @@ if ($search_price_booth != '') { if ($search_login) { $sql .= natural_search(array('u.login', 'u.firstname', 'u.lastname'), $search_login); } +if ($search_import_key) { + $sql .= natural_search(array('p.import_key'), $search_import_key); +} // Search for tag/category ($searchCategoryProjectList is an array of ID) $searchCategoryProjectList = $search_category_array; $searchCategoryProjectOperator = 0; @@ -664,37 +677,45 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -$sql .= $db->order($sortfield, $sortorder); +//print $sql; // Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $resql = $db->query($sql); - $nbtotalofrecords = $db->num_rows($resql); - if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 + /* The fast and low memory method to get and count full list converts the sql into a sql count */ + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); + $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); + $resql = $db->query($sqlforcount); + if ($resql) { + $objforcount = $db->fetch_object($resql); + $nbtotalofrecords = $objforcount->nbtotalofrecords; + } else { + dol_print_error($db); + } + + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } + $db->free($resql); } -// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. -if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { - $num = $nbtotalofrecords; -} else { - if (!empty($limit)) { - $sql .= $db->plimit($limit + 1, $offset); - } - $resql = $db->query($sql); - if (!$resql) { - dol_print_error($db); - exit; - } - - $num = $db->num_rows($resql); +// Complete request and execute it with limit +$sql .= $db->order($sortfield, $sortorder); +if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); } +$resql = $db->query($sql); +if (!$resql) { + dol_print_error($db); + exit; +} + +$num = $db->num_rows($resql); + // Direct jump if only one record found -if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { $obj = $db->fetch_object($resql); header("Location: ".DOL_URL_ROOT.'/projet/card.php?id='.$obj->id); exit; @@ -704,8 +725,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -dol_syslog("list allowed project", LOG_DEBUG); - llxHeader('', $title, $help_url); $arrayofselected = is_array($toselect) ? $toselect : array(); @@ -855,6 +874,9 @@ if ($search_price_booth != '') { if ($search_login) { $param .= '&search_login='.urlencode($search_login); } +if ($search_import_key) { + $param .= '&search_import_key='.urlencode($search_import_key); +} if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } @@ -1186,6 +1208,7 @@ if (!empty($arrayfields['p.email_msgid']['checked'])) { if (!empty($arrayfields['p.import_key']['checked'])) { // Import key print '
'; + print ''; print '