From 587766b39b835d029c5f3f1ecd12b3028d0ad9af Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 3 Oct 2018 10:38:47 +0200 Subject: [PATCH 1/7] FIX : wrong function name --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1d6c26caecd..36f1997ac85 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -440,7 +440,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Contact on a thirdparty that is a different thirdparty than the thirdparty of object if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { - $targetcontact->fetch_thirparty(); + $targetcontact->fetch_thirdparty(); $companytouseforaddress = $targetcontact->thirdparty; } From 583ea055671f27eaf845b8c9b5a7061e65ef816a Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 3 Oct 2018 12:13:53 +0200 Subject: [PATCH 2/7] fix missing letter... --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 66caf2ea23a..31c6b613e24 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -438,7 +438,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Contact on a thirdparty that is a different thirdparty than the thirdparty of object if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { - $targetcontact->fetch_thirparty(); + $targetcontact->fetch_thirdparty(); $companytouseforaddress = $targetcontact->thirdparty; } From 8ee7a48583378758cb7c5aa19be25e0eb0207b01 Mon Sep 17 00:00:00 2001 From: aplose Date: Wed, 3 Oct 2018 15:15:46 +0200 Subject: [PATCH 3/7] Fix issue #9434 : no array_options available when calling api : I replace the deprecated code by the fetch_optionnals() recommanded call. --- htdocs/commande/class/commande.class.php | 12 ++++++++---- htdocs/compta/facture/class/facture.class.php | 12 +++++++----- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 9007490d421..6677a9f08de 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1677,10 +1677,11 @@ class Commande extends CommonOrder // Retrieve all extrafields for invoice // fetch optionals attributes and labels - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafields=new ExtraFields($this->db); - $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); - $this->fetch_optionals($this->id,$extralabels); +// require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +// $extrafields=new ExtraFields($this->db); +// $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); +// $this->fetch_optionals($this->id,$extralabels); + $this->fetch_optionals(); $this->db->free($result); @@ -1882,6 +1883,9 @@ class Commande extends CommonOrder $line->multicurrency_total_tva = $objp->multicurrency_total_tva; $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; + $line->fetch_optionals(); + + $this->lines[$i] = $line; $i++; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index bc7a14c0c45..9bf6d4b876c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1353,10 +1353,12 @@ class Facture extends CommonInvoice // Retrieve all extrafield for invoice // fetch optionals attributes and labels - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafields=new ExtraFields($this->db); - $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); - $this->fetch_optionals($this->id,$extralabels); +// require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +// $extrafields=new ExtraFields($this->db); +// $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); +// $this->fetch_optionals($this->id,$extralabels); + $this->fetch_optionals(); + /* * Lines @@ -1477,7 +1479,7 @@ class Facture extends CommonInvoice $line->multicurrency_total_tva = $objp->multicurrency_total_tva; $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; - // TODO Fetch optional like done in fetch line of facture_rec ? + $line->fetch_optionals(); $this->lines[$i] = $line; From 2acd69033cf233d7716cdc1001f2b5ae9db419b0 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Wed, 3 Oct 2018 22:48:29 +0200 Subject: [PATCH 4/7] Fix minor error in dom --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1797617a26d..f760dd32cc1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2806,7 +2806,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if ($picto == 'off') { $fakey = 'fa-square-o'; $fasize='1.3em'; } if ($picto == 'on') { $fakey = 'fa-check-square-o'; $fasize='1.3em'; } $enabledisablehtml=''; - $enabledisablehtml.=''; + $enabledisablehtml.=''; if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $enabledisablehtml.=$titlealt; $enabledisablehtml.=''; return $enabledisablehtml; From c048f515624098ad0e8c19a66949cc3aa560aafc Mon Sep 17 00:00:00 2001 From: ATM-Nicolas Date: Thu, 4 Oct 2018 09:54:40 +0200 Subject: [PATCH 5/7] FIX : Wrong variable name --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 139fe355d3d..6c9822fd8a3 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -451,7 +451,7 @@ if ($search_month > 0) if ($search_year > 0 && empty($search_day)) $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; else if ($search_year > 0 && ! empty($search_day)) - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $serch_year))."'"; + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; else $sql.= " AND date_format(f.datef, '%m') = '".$month."'"; } From 58d1ac427e1af794e662327b999291319e70a142 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 4 Oct 2018 10:57:22 +0200 Subject: [PATCH 6/7] Fix missing hook on sellsjournal --- htdocs/accountancy/journal/sellsjournal.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index b10e0d37c75..2c0ab7c1a2f 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -59,11 +59,15 @@ $now = dol_now(); if ($user->societe_id > 0) accessforbidden(); +$hookmanager->initHooks(array('sellsjournal')); +$parameters=array(); /* * Actions */ +$reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks + // Get informations of journal $accountingjournalstatic = new AccountingJournal($db); $accountingjournalstatic->fetch($id_journal); From bfaf25ca2a0ace725b58ae45f92768dc7caded3e Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 4 Oct 2018 16:55:16 +0200 Subject: [PATCH 7/7] Fix wrong value for module part and return access denied --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 890996bddce..4afde1e0ac4 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1611,7 +1611,7 @@ if ($id > 0) $var=true; - print $formfile->showdocuments('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang); + print $formfile->showdocuments('actions',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang); print '
';