From 94eeaf9ed05cb70bb79897363283626bc5549569 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Dec 2016 18:47:21 +0100 Subject: [PATCH 01/17] Fix typo error --- htdocs/langs/en_US/errors.lang | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 5727c0edb11..8635b3e2d88 100755 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -176,10 +176,10 @@ ErrorWarehouseRequiredIntoShipmentLine=Warehouse is required on the line to ship ErrorFileMustHaveFormat=File must have format %s ErrorSupplierCountryIsNotDefined=Country for this supplier is not defined. Correct this first. ErrorsThirdpartyMerge=Failed to merge the two records. Request canceled. -ErrorStockIsNotEnoughToAddProductOnOrder=Stock is not enougth for product %s to add it into a new order. -ErrorStockIsNotEnoughToAddProductOnInvoice=Stock is not enougth for product %s to add it into a new invoice. -ErrorStockIsNotEnoughToAddProductOnShipment=Stock is not enougth for product %s to add it into a new shipment. -ErrorStockIsNotEnoughToAddProductOnProposal=Stock is not enougth for product %s to add it into a new proposal. +ErrorStockIsNotEnoughToAddProductOnOrder=Stock is not enough for product %s to add it into a new order. +ErrorStockIsNotEnoughToAddProductOnInvoice=Stock is not enough for product %s to add it into a new invoice. +ErrorStockIsNotEnoughToAddProductOnShipment=Stock is not enough for product %s to add it into a new shipment. +ErrorStockIsNotEnoughToAddProductOnProposal=Stock is not enough for product %s to add it into a new proposal. ErrorPhpMailDelivery=Check that you don't use a too high number of recipients and that your email content is not similar to a Spam. Ask also your administrator to check firewall and server logs files for a more complete information. # Warnings From f7e5898b4ad79393ffe300b91b42fb580050ee3f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Dec 2016 10:58:31 +0100 Subject: [PATCH 02/17] Fix show a more accurate translation --- htdocs/langs/en_US/mails.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index f682df02406..67a8a24c04d 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -42,7 +42,7 @@ MailingStatusSentPartialy=Sent partialy MailingStatusSentCompletely=Sent completely MailingStatusError=Error MailingStatusNotSent=Not sent -MailSuccessfulySent=Email successfully sent (from %s to %s) +MailSuccessfulySent=Email successfully accepted for delivery (from %s to %s) MailingSuccessfullyValidated=EMailing successfully validated MailUnsubcribe=Unsubscribe Unsuscribe=Unsubscribe From 9cc2a7422154fba8bfc152bba5d5d7613c31f25a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Dec 2016 16:29:15 +0100 Subject: [PATCH 03/17] Update changelog --- ChangeLog | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/ChangeLog b/ChangeLog index d3274e1048d..1ad2ff66841 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,61 @@ during migration. Upgrading to any other version or any other database system is abolutely required BEFORE trying make a Dolibarr upgrade. + +***** ChangeLog for 3.9.4 compared to 3.9.3 ***** +FIX: #2853 +FIX: #3128 +FIX: #4447 +FIX: #5128 if create method return duplicated code error not use GETPOST in order to get a new code +FIX: #5340 +FIX: #5473 +FIX: #5474 Country_id of "Don" object is still empty +FIX: #5534 +FIX: #5535 bad dependency. +FIX: #5537 AJAX project search does not work properly +FIX: #5540 getFormMail is not registered as addReplace hook +FIX: #5544 Disabled Contact still appear in lists to send emails +FIX: #5549 getNomUrl tooltips show Order info even if user has no rights to read them +FIX: #5568 +FIX: #5594 +FIX: #5629 PgSQL Interger string stylish error +FIX: #5651 +FIX: #5660 +FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1 +FIX: #5907 +FIX: #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them +FIX: #6051 +FIX: #6088 +FIX: Can correct stock of lot using eatby or sell by date +FIX: Can make a movement on "out of sell" products +FIX: cannot update bank account on invoice if module order not activated +FIX: Can't create withdrawal document +FIX: delete contract extrafields on contract deletion +FIX: Direction of movement lost if an error occurs +FIX: Error when CATEGORIE_RECURSIV_ADD is enabled and new category is daughter of an already linked to object +FIX: export extrafields must not include separe type +FIX: External user must not be able to edit its discounts +FIX: Failed to export contact categories with contact extra fields +FIX: header title in commercial area +FIX: HT and TTC price should always be displayed together +FIX: incoterms +FIX: incoterms do not output into crabe invoice PDF +FIX: in PgSQL no quote "word style" is permitted around column name +FIX: Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email. +FIX: margin tab on customer card must filter on current entity invoices +FIX: missing column into SQL on thridparty list +FIX: only show projects of related third if external user +FIX: PgSQL Module Ressource list crash #5637 +FIX: php Strict +FIX: Regression when deleting product +FIX: Security to restrict email sending was not efficient +FIX: tag for date rfc in odt substitution +FIX: Update intervention lline crash with PgSQL +FIX: update limit stock on product stock +FIX: vat dictionary should allow enter and edit multiple values for localtaxes, separated by: (ex -19:-15) +FIX: wrong test on dict.php + + ***** ChangeLog for 3.9.3 compared to 3.9.2 ***** FIX: #4383 $userid not defined FIX: #4448 $filebonprev is not used, $this->filename now From cdcbf58ca860bc2eaffa18e600891c60eb59aafb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Dec 2016 17:33:54 +0100 Subject: [PATCH 04/17] Prepare 3.9.5 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 7de3a9f9377..42df075fa17 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.9.4'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.9.5'); if (! defined('EURO')) define('EURO',chr(128)); From 98599b0bbfde042e3ee25636e1ed391080995d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 27 Dec 2016 12:56:49 +0100 Subject: [PATCH 05/17] FIX #6227 Document models table header "Unit" is shown in 2 lines in Spanish --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 4 ++-- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 4 ++-- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 4 ++-- .../core/modules/supplier_invoice/pdf/pdf_canelle.modules.php | 4 ++-- .../core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 36f62be3833..286038f1b22 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -110,8 +110,8 @@ class pdf_einstein extends ModelePDFCommandes { $this->posxtva=99; $this->posxup=114; - $this->posxqty=133; - $this->posxunit=150; + $this->posxqty=130; + $this->posxunit=147; } else { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ff8a73c527d..6d7b22613f7 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -120,8 +120,8 @@ class pdf_crabe extends ModelePDFFactures { $this->posxtva=99; $this->posxup=114; - $this->posxqty=133; - $this->posxunit=150; + $this->posxqty=130; + $this->posxunit=147; } else { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 52f9a09ae9f..0c0728093ac 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -108,8 +108,8 @@ class pdf_azur extends ModelePDFPropales { $this->posxtva=99; $this->posxup=114; - $this->posxqty=133; - $this->posxunit=150; + $this->posxqty=130; + $this->posxunit=147; } else { diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 6b89ef7f5c8..c368ca52ca9 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -102,8 +102,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices if($conf->global->PRODUCT_USE_UNITS) { $this->posxtva=99; $this->posxup=114; - $this->posxqty=133; - $this->posxunit=150; + $this->posxqty=130; + $this->posxunit=147; } //if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 95b0c00ff5b..3117b6a9e55 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -111,8 +111,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $this->posxtva=99; $this->posxup=114; - $this->posxqty=133; - $this->posxunit=150; + $this->posxqty=130; + $this->posxunit=147; } else { $this->posxtva=112; $this->posxup=126; From d986247e0f0acce1d116401c8632be28ce70d7ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Jan 2017 19:53:05 +0100 Subject: [PATCH 06/17] Fix dol_banner --- htdocs/compta/recap-compta.php | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 3f952ef15c6..aec371ac0b3 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -30,14 +30,14 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; $langs->load("companies"); if (! empty($conf->facture->enabled)) $langs->load("bills"); -// Security check -$socid = GETPOST("socid",'int'); -if ($user->societe_id > 0) -{ - $action = ''; - $socid = $user->societe_id; -} +$id = GETPOST('id')?GETPOST('id','int'):GETPOST('socid','int'); +// Security check +if ($user->societe_id) $id=$user->societe_id; +$result = restrictedArea($user, 'societe', $id, '&societe'); + +$object = new Societe($db); +if ($id > 0) $object->fetch($id); /* @@ -47,20 +47,21 @@ if ($user->societe_id > 0) $form = new Form($db); $userstatic=new User($db); -llxHeader(); +$title=$langs->trans("ThirdParty").' - '.$langs->trans("Summary"); +if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Symmary"); +$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -if ($socid > 0) +llxHeader('',$title,$help_url); + +if ($id > 0) { - $societe = new Societe($db); - $societe->fetch($socid); - /* * Affichage onglets */ - $head = societe_prepare_head($societe); + $head = societe_prepare_head($object); dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), 0, 'company'); - dol_banner_tab($societe, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom', '', '', 0, '', '', 1); dol_fiche_end(); if (! empty($conf->facture->enabled) && $user->rights->facture->lire) @@ -86,7 +87,7 @@ if ($socid > 0) $sql.= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,"; $sql.= " u.login, u.rowid as userid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."user as u"; - $sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$societe->id; + $sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id; $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND f.fk_user_valid = u.rowid"; $sql.= " ORDER BY f.datef ASC"; From f07c741176adc64e45bc075d0cb324e700c0776a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Jan 2017 11:31:21 +0100 Subject: [PATCH 07/17] Fix missing error message on invoice creation --- htdocs/compta/facture.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index eb8a7f4cfa4..91267578197 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1345,8 +1345,16 @@ if (empty($reshook)) setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); $error ++; } + if (! GETPOST('prod_entry_mode')) + { + if (GETPOST('type') < 0 && ! GETPOST('search_idprod')) + { + setEventMessages($langs->trans('ErrorChooseBetweenFreeAntryOrPredefinedProduct'), null, 'errors'); + $error ++; + } + } if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); $error ++; } if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not '' From 064f38b89e65048de2ef94427c7d9b4273f465c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Jan 2017 12:17:27 +0100 Subject: [PATCH 08/17] Fix condition to show time spent on project overview --- htdocs/langs/en_US/projects.lang | 1 + htdocs/projet/class/task.class.php | 6 +++-- htdocs/projet/element.php | 43 +++++++++++++++++------------- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index ecf61d17d36..392e20697aa 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -58,6 +58,7 @@ TaskDateEnd=Task end date TaskDescription=Task description NewTask=New task AddTask=Create task +AddTimeSpent=Create time spent Activity=Activity Activities=Tasks/activities MyActivities=My tasks/activities diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 15e3b154b20..ec180704563 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1039,12 +1039,12 @@ class Task extends CommonObject } /** - * Calculate value of time consumed using the thm (hourly amount value of work for user entering time) + * Calculate quantity and value of time consumed using the thm (hourly amount value of work for user entering time) * * @param User $fuser Filter on a dedicated user * @param string $dates Start date (ex 00:00:00) * @param string $datee End date (ex 23:59:59) - * @return array Array of info for task array('amount') + * @return array Array of info for task array('amount','nbseconds','nblinesnull') */ function getSumOfAmount($fuser='', $dates='', $datee='') { @@ -1055,6 +1055,7 @@ class Task extends CommonObject $result=array(); $sql = "SELECT"; + $sql.= " SUM(t.task_duration) as nbseconds,"; $sql.= " SUM(t.task_duration / 3600 * ".$this->db->ifsql("t.thm IS NULL", 0, "t.thm").") as amount, SUM(".$this->db->ifsql("t.thm IS NULL", 1, 0).") as nblinesnull"; $sql.= " FROM ".MAIN_DB_PREFIX."projet_task_time as t"; $sql.= " WHERE t.fk_task = ".$id; @@ -1081,6 +1082,7 @@ class Task extends CommonObject $obj = $this->db->fetch_object($resql); $result['amount'] = $obj->amount; + $result['nbseconds'] = $obj->nbseconds; $result['nblinesnull'] = $obj->nblinesnull; $this->db->free($resql); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 710807dcdec..1916405fde4 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -370,6 +370,18 @@ $listofreferent=array( 'buttonnew'=>'AddDonation', 'testnew'=>$user->rights->don->creer, 'test'=>$conf->don->enabled && $user->rights->don->lire), +'project_task'=>array( + 'name'=>"TaskTimeValorised", + 'title'=>"ListTaskTimeUserProject", + 'class'=>'Task', + 'margin'=>'minus', + 'table'=>'projet_task', + 'datefieldname'=>'task_date', + 'disableamount'=>0, + 'urlnew'=>DOL_URL_ROOT.'/projet/tasks.php?id='.$id, + 'buttonnew'=>'AddTimeSpent', + 'testnew'=>$user->rights->projet->creer, + 'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))), 'agenda'=>array( 'name'=>"Agenda", 'title'=>"ListActionsAssociatedProject", @@ -382,15 +394,6 @@ $listofreferent=array( 'buttonnew'=>'AddEvent', 'testnew'=>$user->rights->agenda->myactions->create, 'test'=>$conf->agenda->enabled && $user->rights->agenda->myactions->read), -'project_task'=>array( - 'name'=>"TaskTimeValorised", - 'title'=>"ListTaskTimeUserProject", - 'class'=>'Task', - 'margin'=>'minus', - 'table'=>'projet_task', - 'datefieldname'=>'task_date', - 'disableamount'=>0, - 'test'=>$conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS)), ); $parameters=array('listofreferent'=>$listofreferent); @@ -691,6 +694,7 @@ foreach ($listofreferent as $key => $value) print ''.$langs->trans("Ref").''; // Date print ''; + if (in_array($tablename, array('projet_task'))) print $langs->trans("TimeSpent"); if (! in_array($tablename, array('projet_task'))) print $langs->trans("Date"); print ''; // Thirdparty or user @@ -784,9 +788,9 @@ foreach ($listofreferent as $key => $value) print '' . img_picto($langs->trans('Unlink'), 'editdelete') . ''; } print "\n"; + // Ref print ''; - if ($tablename == 'expensereport_det') { print $expensereport->getNomUrl(1); @@ -822,10 +826,9 @@ foreach ($listofreferent as $key => $value) // Show customer ref if (! empty($element->ref_customer)) print ' - '.$element->ref_customer; } - print "\n"; - // Date + // Date or TimeSpent $date=''; if ($tablename == 'expensereport_det') $date = $element->date; // No draft status on lines elseif (! empty($element->status) || ! empty($element->statut) || ! empty($element->fk_status)) @@ -851,7 +854,12 @@ foreach ($listofreferent as $key => $value) print dol_print_date($element->datep,'dayhour'); if ($element->datef && $element->datef > $element->datep) print " - ".dol_print_date($element->datef,'dayhour'); } - else print dol_print_date($date,'day'); + else if (in_array($tablename, array('projet_task'))) + { + $tmpprojtime = $element->getSumOfAmount($elementuser, $dates, $datee); // $element is a task. $elementuser may be empty + print convertSecondToTime($tmpprojtime['nbseconds'], 'allhourmin'); + } + else print 'e'.dol_print_date($date,'day'); print ''; // Third party or user @@ -885,14 +893,13 @@ foreach ($listofreferent as $key => $value) $total_ht_by_line=null; $othermessage=''; if ($tablename == 'don') $total_ht_by_line=$element->amount; - elseif ($tablename == 'projet_task') + elseif (in_array($tablename, array('projet_task'))) { if (! empty($conf->salaries->enabled)) { - // TODO Permission to read daily rate - $tmp = $element->getSumOfAmount($elementuser, $dates, $datee); // $element is a task. $elementuser may be empty - $total_ht_by_line = price2num($tmp['amount'],'MT'); - if ($tmp['nblinesnull'] > 0) + // TODO Permission to read daily rate to show value + $total_ht_by_line = price2num($tmpprojtime['amount'],'MT'); + if ($tmpprojtime['nblinesnull'] > 0) { $langs->load("errors"); $warning=$langs->trans("WarningSomeLinesWithNullHourlyRate", $conf->currency); From 1b352768c292f2fd997d0d7c8525fce796abba33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Jan 2017 12:18:17 +0100 Subject: [PATCH 09/17] Fix remove debug info --- htdocs/projet/element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 1916405fde4..199d2c3a1c6 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -859,7 +859,7 @@ foreach ($listofreferent as $key => $value) $tmpprojtime = $element->getSumOfAmount($elementuser, $dates, $datee); // $element is a task. $elementuser may be empty print convertSecondToTime($tmpprojtime['nbseconds'], 'allhourmin'); } - else print 'e'.dol_print_date($date,'day'); + else print dol_print_date($date,'day'); print ''; // Third party or user From 40fa816b997be753c2424570a4cb8af92327a8f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Jan 2017 12:27:34 +0100 Subject: [PATCH 10/17] Fix missing total of timespent --- htdocs/projet/element.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 199d2c3a1c6..3fd6bdbcd56 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -829,7 +829,7 @@ foreach ($listofreferent as $key => $value) print "\n"; // Date or TimeSpent - $date=''; + $date=''; $total_time_by_line = null; if ($tablename == 'expensereport_det') $date = $element->date; // No draft status on lines elseif (! empty($element->status) || ! empty($element->statut) || ! empty($element->fk_status)) { @@ -858,6 +858,7 @@ foreach ($listofreferent as $key => $value) { $tmpprojtime = $element->getSumOfAmount($elementuser, $dates, $datee); // $element is a task. $elementuser may be empty print convertSecondToTime($tmpprojtime['nbseconds'], 'allhourmin'); + $total_time_by_line = $tmpprojtime['nbseconds']; } else print dol_print_date($date,'day'); print ''; @@ -995,6 +996,8 @@ foreach ($listofreferent as $key => $value) $total_ht_by_third += $total_ht_by_line; $total_ttc_by_third += $total_ttc_by_line; + + $total_time = $total_time + $total_time_by_line; } if (canApplySubtotalOn($tablename)) @@ -1020,7 +1023,17 @@ foreach ($listofreferent as $key => $value) if ($breakline) print $breakline; // Total - print ''.$langs->trans("Number").': '.$i.''; + $colspan=4; + if (in_array($tablename, array('projet_task'))) $colspan=2; + print ''.$langs->trans("Number").': '.$i.''; + if (in_array($tablename, array('projet_task'))) + { + print ''; + print convertSecondToTime($total_time, 'allhourmin'); + print ''; + print ''; + print ''; + } //if (empty($value['disableamount']) && ! in_array($tablename, array('projet_task'))) print ''.$langs->trans("TotalHT").' : '.price($total_ht).''; //elseif (empty($value['disableamount']) && in_array($tablename, array('projet_task'))) print ''.$langs->trans("Total").' : '.price($total_ht).''; print ''; From 477b9c8338db343f810dcf545fc58bed6a86df37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Jan 2017 12:34:23 +0100 Subject: [PATCH 11/17] Fix duplicate view of agenda/events for projects --- htdocs/projet/class/project.class.php | 2 +- htdocs/projet/element.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 7a88fc3112c..460e698e432 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1498,7 +1498,7 @@ class Project extends CommonObject { $sql="UPDATE ".MAIN_DB_PREFIX.$tableName; - if ($TableName=="actioncomm") + if ($tableName == "actioncomm") { $sql.= " SET fk_project=".$this->id; $sql.= " WHERE id=".$elementSelectId; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 3fd6bdbcd56..231765cd7c6 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -382,6 +382,7 @@ $listofreferent=array( 'buttonnew'=>'AddTimeSpent', 'testnew'=>$user->rights->projet->creer, 'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))), +/* No need for this, available on dedicated tab "Agenda/Events" 'agenda'=>array( 'name'=>"Agenda", 'title'=>"ListActionsAssociatedProject", @@ -394,6 +395,7 @@ $listofreferent=array( 'buttonnew'=>'AddEvent', 'testnew'=>$user->rights->agenda->myactions->create, 'test'=>$conf->agenda->enabled && $user->rights->agenda->myactions->read), +*/ ); $parameters=array('listofreferent'=>$listofreferent); From 9694a001792d8060b29cf79f35ebb3dd6531339d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Jan 2017 12:39:12 +0100 Subject: [PATCH 12/17] Fix sort is lost on agenda/event of projects --- htdocs/core/lib/company.lib.php | 4 ++-- htdocs/projet/info.php | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index ccec6af47d0..f5f8ec5456d 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -965,7 +965,7 @@ function show_actions_todo($conf,$langs,$db,$filterobj,$objcon='',$noprint=0,$ac * @return mixed Return html part or void if noprint is 1 * TODO change function to be able to list event linked to an object. */ -function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done', $filters=array(), $sortfield='a.datep, a.id', $sortorder='DESC') +function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done', $filters=array(), $sortfield='a.datep,a.id', $sortorder='DESC') { global $bc,$user,$conf; global $form; @@ -1183,7 +1183,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= } $out.=getTitleFieldOfList($langs->trans("Ref"), 0, $_SERVER["PHP_SELF"], 'a.id', '', $param, '', $sortfield, $sortorder); $out.=''.$langs->trans("Label").''; - $out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep, a.id', '', $param, '', $sortfield, $sortorder); + $out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, '', $sortfield, $sortorder); $out.=''.$langs->trans("Type").''; $out.=''; $out.=''; diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index 0c37f999259..3f9d9ee1275 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -35,6 +35,18 @@ $ref = GETPOST('ref','alpha'); $socid = GETPOST('socid','int'); $action = GETPOST('action','alpha'); +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; +$sortfield = GETPOST("sortfield","alpha"); +$sortorder = GETPOST("sortorder"); +$page = GETPOST("page"); +$page = is_numeric($page) ? $page : 0; +$page = $page == -1 ? 0 : $page; +if (! $sortfield) $sortfield="a.datep,a.id"; +if (! $sortorder) $sortorder="ASC"; +$offset = $limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + if (GETPOST('actioncode','array')) { $actioncode=GETPOST('actioncode','array',3); @@ -181,7 +193,7 @@ if (!empty($object->id)) // List of all actions $filters=array(); $filters['search_agenda_label']=$search_agenda_label; - show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters); + show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder); } From e4a5302f5186de7c73aa233625beba4eb4434a59 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Jan 2017 12:41:33 +0100 Subject: [PATCH 13/17] Fix bad sort order --- htdocs/projet/info.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index 3f9d9ee1275..e3c151df7a6 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -42,7 +42,7 @@ $page = GETPOST("page"); $page = is_numeric($page) ? $page : 0; $page = $page == -1 ? 0 : $page; if (! $sortfield) $sortfield="a.datep,a.id"; -if (! $sortorder) $sortorder="ASC"; +if (! $sortorder) $sortorder="DESC"; $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; From fd09a3d35e92c753b5441d3ffdf108b8002e030a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Jan 2017 13:51:05 +0100 Subject: [PATCH 14/17] Fix link to notes and download pdf not visible on list of expense report --- htdocs/commande/list.php | 7 ++++--- htdocs/expensereport/list.php | 29 ++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 9ca79421f20..6e304a019d0 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1061,7 +1061,8 @@ if ($resql) $text_info=''; $text_warning=''; $nbprod=0; - + + // Ref if (! empty($arrayfields['c.ref']['checked'])) { print ''; @@ -1186,12 +1187,12 @@ if ($resql) print ''; } - // Warning late icon + // Warning late icon and note print ''; if ($generic_commande->hasDelay()) { print img_picto($langs->trans("Late").' : '.$generic_commande->showDelay(), "warning"); } - if(!empty($obj->note_private)) + if (!empty($obj->note_private) || !empty($obj->note_public)) { print ' '; print ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').''; diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index ce682273b6e..3b995173826 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -183,7 +183,7 @@ $min_year = 5; $sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.total_ttc, d.fk_statut as status,"; -$sql.= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve,"; +$sql.= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve, d.note_private, d.note_public,"; $sql.= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.statut, u.photo"; // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); @@ -524,17 +524,40 @@ if ($resql) $expensereportstatic->date_modif=$db->jdate($obj->date_modif); $expensereportstatic->date_valid=$db->jdate($obj->date_valid); $expensereportstatic->date_approve=$db->jdate($obj->date_approve); + $expensereportstatic->note_private=$obj->note_private; + $expensereportstatic->note_public=$obj->note_public; $var=!$var; print ""; + // Ref if (! empty($arrayfields['d.ref']['checked'])) { print ''; + print ''; + print ''; + // Warning late icon and note + print ''; + print ''; + print '
'; print $expensereportstatic->getNomUrl(1); + print ''; if ($expensereportstatic->status == 2 && $expensereportstatic->hasDelay('toappove')) print img_warning($langs->trans("Late")); if ($expensereportstatic->status == 5 && $expensereportstatic->hasDelay('topay')) print img_warning($langs->trans("Late")); + if (!empty($obj->note_private) || !empty($obj->note_public)) + { + print ' '; + print ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').''; + print ''; + } + print ''; + $filename=dol_sanitizeFileName($obj->ref); + $filedir=$conf->expensereport->dir_output . '/' . dol_sanitizeFileName($obj->ref); + $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; + print $formfile->getDocumentsLink($expensereport->element, $filename, $filedir); + print '
'; print ''; if (! $i) $totalarray['nbfield']++; } + // User if (! empty($arrayfields['user']['checked'])) { print ''; $usertmp->id=$obj->id_user; @@ -547,18 +570,22 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } + // Start date if (! empty($arrayfields['d.date_debut']['checked'])) { print ''.($obj->date_debut > 0 ? dol_print_date($obj->date_debut, 'day') : '').''; if (! $i) $totalarray['nbfield']++; } + // End date if (! empty($arrayfields['d.date_fin']['checked'])) { print ''.($obj->date_fin > 0 ? dol_print_date($obj->date_fin, 'day') : '').''; if (! $i) $totalarray['nbfield']++; } + // Date validation if (! empty($arrayfields['d.date_valid']['checked'])) { print ''.($obj->date_valid > 0 ? dol_print_date($obj->date_valid, 'day') : '').''; if (! $i) $totalarray['nbfield']++; } + // Date approval if (! empty($arrayfields['d.date_approve']['checked'])) { print ''.($obj->date_approve > 0 ? dol_print_date($obj->date_approve, 'day') : '').''; if (! $i) $totalarray['nbfield']++; From 85f9da77186f9c9a93612291fd13ae0469e182e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Jan 2017 13:52:32 +0100 Subject: [PATCH 15/17] Fix link --- htdocs/expensereport/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 3b995173826..00b6343bf97 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -551,7 +551,7 @@ if ($resql) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->expensereport->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - print $formfile->getDocumentsLink($expensereport->element, $filename, $filedir); + print $formfile->getDocumentsLink($expensereportstatic->element, $filename, $filedir); print ''; print ''; print ''; From 7dc55daf380c8c31d9932b6100508b2e1fb3ce80 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Jan 2017 14:37:07 +0100 Subject: [PATCH 16/17] FIX #6229 --- htdocs/install/mysql/tables/llx_c_typent.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_c_typent.sql b/htdocs/install/mysql/tables/llx_c_typent.sql index d492c41ff13..ae89faf5c74 100644 --- a/htdocs/install/mysql/tables/llx_c_typent.sql +++ b/htdocs/install/mysql/tables/llx_c_typent.sql @@ -21,7 +21,7 @@ create table llx_c_typent ( id integer PRIMARY KEY, code varchar(12) NOT NULL, - libelle varchar(30), + libelle varchar(48), fk_country integer NULL, -- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B) active tinyint DEFAULT 1 NOT NULL, module varchar(32) NULL, From ecab8d874bac78cc71eef09d67d4410162022c61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Jan 2017 01:30:07 +0100 Subject: [PATCH 17/17] Merge changelog --- ChangeLog | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/ChangeLog b/ChangeLog index 00d654010c9..28917d2bd40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -267,6 +267,60 @@ So if you included it into your module, change your code like this to be compati if (! $res) include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; + +***** ChangeLog for 3.9.4 compared to 3.9.3 ***** +FIX: #2853 +FIX: #3128 +FIX: #4447 +FIX: #5128 if create method return duplicated code error not use GETPOST in order to get a new code +FIX: #5340 +FIX: #5473 +FIX: #5474 Country_id of "Don" object is still empty +FIX: #5534 +FIX: #5535 bad dependency. +FIX: #5537 AJAX project search does not work properly +FIX: #5540 getFormMail is not registered as addReplace hook +FIX: #5544 Disabled Contact still appear in lists to send emails +FIX: #5549 getNomUrl tooltips show Order info even if user has no rights to read them +FIX: #5568 +FIX: #5594 +FIX: #5629 PgSQL Interger string stylish error +FIX: #5651 +FIX: #5660 +FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1 +FIX: #5907 +FIX: #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them +FIX: #6051 +FIX: #6088 +FIX: Can correct stock of lot using eatby or sell by date +FIX: Can make a movement on "out of sell" products +FIX: cannot update bank account on invoice if module order not activated +FIX: Can't create withdrawal document +FIX: delete contract extrafields on contract deletion +FIX: Direction of movement lost if an error occurs +FIX: Error when CATEGORIE_RECURSIV_ADD is enabled and new category is daughter of an already linked to object +FIX: export extrafields must not include separe type +FIX: External user must not be able to edit its discounts +FIX: Failed to export contact categories with contact extra fields +FIX: header title in commercial area +FIX: HT and TTC price should always be displayed together +FIX: incoterms +FIX: incoterms do not output into crabe invoice PDF +FIX: in PgSQL no quote "word style" is permitted around column name +FIX: Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email. +FIX: margin tab on customer card must filter on current entity invoices +FIX: missing column into SQL on thridparty list +FIX: only show projects of related third if external user +FIX: PgSQL Module Ressource list crash #5637 +FIX: php Strict +FIX: Regression when deleting product +FIX: Security to restrict email sending was not efficient +FIX: tag for date rfc in odt substitution +FIX: Update intervention lline crash with PgSQL +FIX: update limit stock on product stock +FIX: vat dictionary should allow enter and edit multiple values for localtaxes, separated by: (ex -19:-15) +FIX: wrong test on dict.php + ***** ChangeLog for 3.9.3 compared to 3.9.2 ***** FIX: #4383 $userid not defined FIX: #4448 $filebonprev is not used, $this->filename now