From f0bfe46ebc371535adcb8ba09fa750712fbb3345 Mon Sep 17 00:00:00 2001 From: frederic34 Date: Mon, 21 Jul 2014 19:19:04 +0200 Subject: [PATCH 01/11] Update main.lang --- htdocs/langs/en_US/main.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 0f8851792b3..f5a964c5610 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -672,6 +672,7 @@ HelpCopyToClipboard=Use Ctrl+C to copy to clipboard SaveUploadedFileWithMask=Save file on server with name "%s" (otherwise "%s") OriginFileName=Original filename SetDemandReason=Set source +SetBankAccount=Define Bank Account ViewPrivateNote=View notes XMoreLines=%s line(s) hidden PublicUrl=Public URL From a01c985018fa3dd16c747ea1205f8e5b4dc6352c Mon Sep 17 00:00:00 2001 From: frederic34 Date: Mon, 21 Jul 2014 19:21:08 +0200 Subject: [PATCH 02/11] Update main.lang --- htdocs/langs/fr_FR/main.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 09e16355dce..d309462c293 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -672,6 +672,7 @@ HelpCopyToClipboard=Utilisez Ctrl+C pour copier dans le presse-papier SaveUploadedFileWithMask=Sauver le fichier sur le serveur sous le nom "%s" (sinon "%s") OriginFileName=nom du fichier source SetDemandReason=Définir la source +SetBankAccount=Définir le compte bancaire ViewPrivateNote=Voir les notes XMoreLines=%s ligne(s) cachées PublicUrl=URL publique From 4f582609f42fd649ae74bd644bfa77014dded6c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 22 Jul 2014 04:24:08 +0200 Subject: [PATCH 03/11] Added formConfirm and doAction for supplier invoice card --- ChangeLog | 2 ++ htdocs/fourn/facture/fiche.php | 23 ++++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc29d46bd26..d3a8088df85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -56,6 +56,8 @@ For developers: - LINEBILL_DELETE, LINK_DELETE, ORDER_SUPPLIER_DELETE, RESOURCE_DELETE trigger called before SQL delete - New: [ Task #1481 ] Add trigger BILL_SUPPLIER_UPDATE. - New: [ Task #1495 ] Add trigger LINECONTRACT_CREATE. +- New: Added hook "formConfirm" and "doActions" for supplier invoice card +- New: Added hook "doActions" for supplier order card WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index d981f5b6afc..f017aef3c88 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -7,6 +7,7 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013 Philippe Grand * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014 Marcos García * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -85,6 +86,9 @@ $permissionnote=$user->rights->fournisseur->facture->creer; // Used by the inclu * Actions */ +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once // Action clone object @@ -1476,7 +1480,7 @@ else // Confirmation de la suppression d'une ligne produit if ($action == 'confirm_delete_line') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_delete_line', '', 1, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_delete_line', '', 1, 1); } // Clone confirmation @@ -1488,7 +1492,7 @@ else //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) ); // Paiement incomplet. On demande si motif = escompte ou autre - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$object->ref),'confirm_clone',$formquestion,'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$object->ref),'confirm_clone',$formquestion,'yes', 1); } // Confirmation de la validation @@ -1544,24 +1548,33 @@ else array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); } - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1, 240); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1, 240); } // Confirmation set paid if ($action == 'paid') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1); } // Confirmation de la suppression de la facture fournisseur if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1); } + if (! $formconfirm) + { + $parameters=array('lineid'=>$lineid); + $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + } + + // Print form confirm + print $formconfirm; + /** * Invoice From c813077f82e7bed6eee51ca9974f80352f7f0367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 22 Jul 2014 04:25:44 +0200 Subject: [PATCH 04/11] Corrected indentation --- htdocs/fourn/facture/fiche.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index f017aef3c88..5507147496a 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1566,11 +1566,10 @@ else } - if (! $formconfirm) - { - $parameters=array('lineid'=>$lineid); - $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - } + if (!$formconfirm) { + $parameters=array('lineid'=>$lineid); + $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + } // Print form confirm print $formconfirm; From f5d1d1563b446e0d4a461364621b509cc035439a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 22 Jul 2014 04:27:41 +0200 Subject: [PATCH 05/11] Corrected indentation (again) --- htdocs/fourn/facture/fiche.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 5507147496a..df1cc8ee5d0 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1480,7 +1480,7 @@ else // Confirmation de la suppression d'une ligne produit if ($action == 'confirm_delete_line') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_delete_line', '', 1, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_delete_line', '', 1, 1); } // Clone confirmation @@ -1492,7 +1492,7 @@ else //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) ); // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$object->ref),'confirm_clone',$formquestion,'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$object->ref),'confirm_clone',$formquestion,'yes', 1); } // Confirmation de la validation @@ -1548,21 +1548,21 @@ else array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); } - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1, 240); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1, 240); } // Confirmation set paid if ($action == 'paid') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1); } // Confirmation de la suppression de la facture fournisseur if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1); } @@ -1572,7 +1572,7 @@ else } // Print form confirm - print $formconfirm; + print $formconfirm; /** From f3cbe1beac5771424b79c7dc9f3814460302a0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 23 Jul 2014 06:20:17 +0200 Subject: [PATCH 06/11] Task #1511 and updated changelog --- ChangeLog | 2 +- htdocs/fourn/fiche.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d3a8088df85..057a46757b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -57,7 +57,7 @@ For developers: - New: [ Task #1481 ] Add trigger BILL_SUPPLIER_UPDATE. - New: [ Task #1495 ] Add trigger LINECONTRACT_CREATE. - New: Added hook "formConfirm" and "doActions" for supplier invoice card -- New: Added hook "doActions" for supplier order card +- New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 8d8faa7d532..11e505334cd 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -52,6 +52,9 @@ $object = new Fournisseur($db); * Action */ +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + if ($action == 'setsupplieraccountancycode') { $result=$object->fetch($id); From 5ef626813c2a5bddaa4de65ba4f3b6a65f16fb9e Mon Sep 17 00:00:00 2001 From: frederic34 Date: Wed, 23 Jul 2014 09:49:58 +0200 Subject: [PATCH 07/11] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 010e023b285..25f708e8c37 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2512,7 +2512,7 @@ class Form require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php'; $bankstatic=new Account($this->db); $bankstatic->fetch($selected); - print $bankstatic->label.' ('.$bankstatic->currency_code.')'; + print $this->textwithpicto($bankstatic->label,$langs->trans("AccountCurrency").' '.$bankstatic->currency_code); } else { print " "; } From c28c6e578ea17dae0ec2518e26b62c6861da6a04 Mon Sep 17 00:00:00 2001 From: frederic34 Date: Wed, 23 Jul 2014 10:00:32 +0200 Subject: [PATCH 08/11] Update main.lang --- htdocs/langs/en_US/main.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index f5a964c5610..f2ef1727ef7 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -673,6 +673,7 @@ SaveUploadedFileWithMask=Save file on server with name "%s" (ot OriginFileName=Original filename SetDemandReason=Set source SetBankAccount=Define Bank Account +AccountCurrency=Account Currency ViewPrivateNote=View notes XMoreLines=%s line(s) hidden PublicUrl=Public URL From 5239620356e9194cee7b3dcbd0f02e04128dd8c3 Mon Sep 17 00:00:00 2001 From: frederic34 Date: Wed, 23 Jul 2014 10:02:33 +0200 Subject: [PATCH 09/11] Update main.lang --- htdocs/langs/fr_FR/main.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index d309462c293..d42b6f82873 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -673,6 +673,7 @@ SaveUploadedFileWithMask=Sauver le fichier sur le serveur sous le nom "% OriginFileName=nom du fichier source SetDemandReason=Définir la source SetBankAccount=Définir le compte bancaire +AccountCurrency=Devise du compte ViewPrivateNote=Voir les notes XMoreLines=%s ligne(s) cachées PublicUrl=URL publique From f96f8384e682b19d1669c3fd91e39eccd92234bf Mon Sep 17 00:00:00 2001 From: mika31 Date: Wed, 23 Jul 2014 20:23:37 +0200 Subject: [PATCH 10/11] Webservice thirdparty / sale representative Little patch to add capability to associate (one) sale representative on thirdparty creation. --- htdocs/webservices/server_thirdparty.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 632a4c164e5..e5ae9a61e64 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -471,6 +471,11 @@ function createThirdParty($authentication,$thirdparty) if (! $error) { $db->commit(); + + // Patch to add capability to associate (one) sale representative + if($thirdparty['commid'] && $thirdparty['commid']>0) + $newobject->add_commercial($fuser, $thirdparty["commid"]); + $objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>''),'id'=>$newobject->id,'ref'=>$newobject->ref); } else From d61d4778fb2e228cf44cf62a83f12c123d7ba83d Mon Sep 17 00:00:00 2001 From: icfr Date: Fri, 25 Jul 2014 19:03:31 +0200 Subject: [PATCH 11/11] erreur de frappe --- htdocs/comm/mailing/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 6f2f5928925..d64d9188de8 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -481,7 +481,7 @@ if ($action == 'add') } // Action update description of emailing -if ($action == 'settitre' || $action == 'setemail_from' || $actino == 'setreplyto' || $action == 'setemail_errorsto') +if ($action == 'settitre' || $action == 'setemail_from' || $action == 'setreplyto' || $action == 'setemail_errorsto') { $upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);