From 4ff570571e46012f29c4bae291fdb2f985782b0b Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Wed, 29 Oct 2014 05:13:15 +0100 Subject: [PATCH 1/9] Added SOAP client for creating a client order in remote webservice that thirdparty might have. --- htdocs/fourn/commande/card.php | 507 ++++++++++++++++++++++++++------- 1 file changed, 400 insertions(+), 107 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index da4f13e6d53..72c091ff156 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -43,7 +43,9 @@ if (!empty($conf->produit->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (!empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP +$langs->load('admin'); $langs->load('orders'); $langs->load('sendings'); $langs->load('companies'); @@ -1044,6 +1046,91 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G } } +if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST('cancel')) +{ + $ws_host = GETPOST('ws_host','alpha'); + $ws_key = GETPOST('ws_key','alpha'); + $ws_user = GETPOST('ws_user','alpha'); + $ws_password = GETPOST('ws_password','alpha'); + $ws_entity = GETPOST('ws_entity','int'); + $ws_thirdparty = GETPOST('ws_thirdparty','int'); + + // NS and Authentication parameters + $ws_ns='http://www.dolibarr.org/ns/'; + $ws_authentication=array( + 'dolibarrkey'=>$ws_key, + 'sourceapplication'=>'DolibarrWebServiceClient', + 'login'=>$ws_user, + 'password'=>$ws_password, + 'entity'=>$ws_entity + ); + + //Is everything filled? + if ($mode != "init" && (empty($ws_host) || empty($ws_key) || empty($ws_user) || empty($ws_password) || empty($ws_thirdparty))) { + setEventMessage($langs->trans("ErrorFieldsRequired"), 'errors'); + } + else + { + //Create SOAP client and connect it to order + $soapclient_order = new nusoap_client($ws_host."/webservices/server_order.php"); + $soapclient_order->soap_defencoding='UTF-8'; + $soapclient_order->decodeUTF8(false); + + //Create SOAP client and connect it to product/service + $soapclient_product = new nusoap_client($ws_host."/webservices/server_productorservice.php"); + $soapclient_product->soap_defencoding='UTF-8'; + $soapclient_product->decodeUTF8(false); + + //Prepare the order lines from order + $order_lines = array(); + foreach ($object->lines as $line) + { + $ws_parameters = array('authentication' => $ws_authentication, 'id' => '', 'ref' => $line->ref_supplier); + $result_product = $soapclient_product->call("getProductOrService", $ws_parameters, $ws_ns, ''); + + if ($result_product["result"]["result_code"] == "OK") + { + $order_lines[] = array( + 'desc' => $line->product_desc, + 'type' => $line->product_type, + 'product_id' => $result_product["product"]["id"], + 'vat_rate' => $line->tva_tx, + 'qty' => $line->qty, + 'price' => $line->price, + 'unitprice' => $line->subprice, + 'total_net' => $line->total_ht, + 'total_vat' => $line->total_tva, + 'total' => $line->total_ttc, + 'date_start' => $line->date_start, + 'date_end' => $line->date_end, + ); + } + } + + //Prepare the order header + $order = array( + 'thirdparty_id' => $ws_thirdparty, + 'date' => dol_print_date(dol_now(),'dayrfc'), + 'total_net' => $object->total_ht, + 'total_var' => $object->total_tva, + 'total' => $object->total_ttc, + 'lines' => $order_lines + ); + + $ws_parameters = array('authentication'=>$ws_authentication, 'order' => $order); + $result_order = $soapclient_order->call("createOrder", $ws_parameters, $ws_ns, ''); + + if ($result_order["result"]["result_code"] != "OK") + { + setEventMessage($langs->trans("SOAPError").$result_order["result"]["result_code"]."' - '".$result_order["result"]["result_label"]."'", 'errors'); + } + else + { + setEventMessage($langs->trans("RemoteOrderRef").$result_order["ref"], 'mesgs'); + } + } +} + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fournisseur->commande->creer) { if ($action == 'addcontact') @@ -1769,7 +1856,313 @@ elseif (! empty($object->id)) dol_fiche_end(); - if ($action != 'presend') + /* + * Action presend + */ + if ($action == 'presend') + { + $ref = dol_sanitizeFileName($object->ref); + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/')); + $file=$fileparams['fullname']; + + // Define output language + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) + $newlang = $_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) + $newlang = $object->client->default_lang; + + if (!empty($newlang)) + { + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang($newlang); + $outputlangs->load('commercial'); + } + + // Build document if it not exists + if (! $file || ! is_readable($file)) + { + $result= $object->generateDocument(GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } + $fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/')); + $file=$fileparams['fullname']; + } + + print '
'; + + print_titre($langs->trans('SendOrderByMail')); + + // Cree l'objet formulaire mail + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); + $formmail->fromtype = 'user'; + $formmail->fromid = $user->id; + $formmail->fromname = $user->getFullName($langs); + $formmail->frommail = $user->email; + $formmail->withfrom=1; + $liste=array(); + foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; + $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; + $formmail->withtocc=$liste; + $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); + $formmail->withtopic=$outputlangs->trans('SendOrderRef','__ORDERREF__'); + $formmail->withfile=2; + $formmail->withbody=1; + $formmail->withdeliveryreceipt=1; + $formmail->withcancel=1; + // Tableau des substitutions + $formmail->substit['__ORDERREF__']=$object->ref; + $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__PERSONALIZED__']=''; + $formmail->substit['__CONTACTCIVNAME__']=''; + + //Find the good contact adress + $custcontact=''; + $contactarr=array(); + $contactarr=$object->liste_contact(-1,'external'); + + if (is_array($contactarr) && count($contactarr)>0) { + foreach($contactarr as $contact) { + if ($contact['libelle']==$langs->trans('TypeContact_order_supplier_external_BILLING')) { + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + $contactstatic=new Contact($db); + $contactstatic->fetch($contact['id']); + $custcontact=$contactstatic->getFullName($langs,1); + } + } + + if (!empty($custcontact)) { + $formmail->substit['__CONTACTCIVNAME__']=$custcontact; + } + } + + // Tableau des parametres complementaires + $formmail->param['action']='send'; + $formmail->param['models']='order_supplier_send'; + $formmail->param['orderid']=$object->id; + $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; + + // Init list of files + if (GETPOST("mode")=='init') + { + $formmail->clear_attached_files(); + $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); + } + + // Show form + print $formmail->get_form(); + + print '
'; + } + /* + * Action webservice + */ + elseif ($action == 'webservice' && GETPOST('mode', 'alpha') != "send" && ! GETPOST('cancel')) + { + $mode = GETPOST('mode', 'alpha'); + $ws_host = GETPOST('ws_host','alpha'); + $ws_key = GETPOST('ws_key','alpha'); + $ws_user = GETPOST('ws_user','alpha'); + $ws_password = GETPOST('ws_password','alpha'); + + // NS and Authentication parameters + $ws_ns = 'http://www.dolibarr.org/ns/'; + $ws_authentication = array( + 'dolibarrkey'=>$ws_key, + 'sourceapplication'=>'DolibarrWebServiceClient', + 'login'=>$ws_user, + 'password'=>$ws_password, + 'entity'=>'' + ); + + print_titre($langs->trans('CreateRemoteOrder')); + + //Is everything filled? + if ($mode != "init" && (empty($ws_host) || empty($ws_key) || empty($ws_user) || empty($ws_password))) { + setEventMessage($langs->trans("ErrorFieldsRequired"), 'errors'); + $mode = "init"; + } + + if ($mode == "init") + { + //Table/form header + print ''; + print ''; + print ''; + print ''; + print ''; + $textinput_size = "50"; + + //Remote Host URL + print ''; + + //Remote Webservices key + print ''; + + //Remote User + print ''; + + //Remote Password + print ''; + + //Submit and cancel buttons + print ''; + + //End table/form + print ''; + print '
'.$langs->trans("Host").'
'.$langs->trans("KeyForWebServicesAccess").'
'.$langs->trans("User").'
'.$langs->trans("Password").'
'; + print ''; + print '     '; + print ''; + print '
'; + } + elseif ($mode == "check") + { + $ws_entity = ''; + $ws_thirdparty = ''; + $error_occurred = false; + + //Check if has transport, without any the soap client will give error + if (strpos($ws_host, "http") === false) + { + $ws_host = "http://".$ws_host; + } + + //Create SOAP client and connect it to user + $soapclient_user = new nusoap_client($ws_host."/webservices/server_user.php"); + $soapclient_user->soap_defencoding='UTF-8'; + $soapclient_user->decodeUTF8(false); + + //Get the thirdparty associated to user + $ws_parameters = array('authentication'=>$ws_authentication, 'id' => '', 'ref'=>$ws_user); + $result_user = $soapclient_user->call("getUser", $ws_parameters, $ws_ns, ''); + $user_status_code = $result_user["result"]["result_code"]; + + if ($user_status_code == "OK") + { + //Fill the variables + $ws_entity = $result_user["user"]["entity"]; + $ws_authentication['entity'] = $ws_entity; + $ws_thirdparty = $result_user["user"]["fk_thirdparty"]; + if (empty($ws_thirdparty)) + { + setEventMessage($langs->trans("RemoteUserMissingAssociatedSoc"), 'errors'); + } + else + { + //Create SOAP client and connect it to product/service + $soapclient_product = new nusoap_client($ws_host."/webservices/server_productorservice.php"); + $soapclient_product->soap_defencoding='UTF-8'; + $soapclient_product->decodeUTF8(false); + + // Iterate each line and get the reference that uses the supplier of that product/service + $i = 0; + foreach ($object->lines as $line) { + $i = $i + 1; + $ref_supplier = $line->ref_supplier; + $line_id = $i."º) ".$line->product_ref.": "; + if (empty($ref_supplier)) { + continue; + } + $ws_parameters = array('authentication' => $ws_authentication, 'id' => '', 'ref' => $ref_supplier); + $result_product = $soapclient_product->call("getProductOrService", $ws_parameters, $ws_ns, ''); + if (!$result_product) + { + setEventMessage($line_id.$langs->trans("SOAPError")." ".$soapclient_product->error_str." - ".$soapclient_product->response, 'errors'); + $error_occurred = true; + break; + } + + // Check the result code + $status_code = $result_product["result"]["result_code"]; + if ($status_code != "OK") + { + if ($status_code == "NOT_FOUND") + { + setEventMessage($line_id.$langs->trans("SupplierMissingRef")." '".$ref_supplier."'", 'warnings'); + } + else + { + setEventMessage($line_id.$langs->trans("ResponseNonOK")." '".$status_code."' - '".$result_product["result"]["result_label"]."'", 'errors'); + $error_occurred = true; + break; + } + } + + + // Ensure that price is equal and warn user if it's not + $supplier_price = price($result_product["product"]["price_net"]); //Price of client tab in supplier dolibarr + $local_price = NULL; //Price of supplier as stated in product suppliers tab on this dolibarr, NULL if not found + + $product_fourn = new ProductFournisseur($db); + $product_fourn_list = $product_fourn->list_product_fournisseur_price($line->fk_product); + if (count($product_fourn_list)>0) + { + foreach($product_fourn_list as $product_fourn_line) + { + //Only accept the line where the supplier is the same at this order and has the same ref + if ($product_fourn_line->fourn_id == $object->socid && $product_fourn_line->fourn_ref == $ref_supplier) { + $local_price = price($product_fourn_line->fourn_price); + } + } + } + + if ($local_price != NULL && $local_price != $supplier_price) { + setEventMessage($line_id.$langs->trans("RemotePriceMismatch")." ".$supplier_price." - ".$local_price, 'warnings'); + } + + // Check if is in sale + if (empty($result_product["product"]["status_tosell"])) { + setEventMessage($line_id.$langs->trans("ProductStatusNotOnSellShort")." '".$ref_supplier."'", 'warnings'); + } + } + } + + } + elseif ($user_status_code == "PERMISSION_DENIED") + { + setEventMessage($langs->trans("RemoteUserNotPermission"), 'errors'); + } + else + { + setEventMessage($langs->trans("ResponseNonOK")." '".$user_status_code."'", 'errors'); + } + + //Form + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if ($error_occurred) + { + print "
".$langs->trans("ErrorOccurredReviseAndRetry")."
"; //TODO: Translate + } + else + { + print ''; + print '     '; + } + print ''; + print '
'; + } + } + /* + * Show buttons + */ + else { /** * Boutons actions @@ -1849,6 +2242,12 @@ elseif (! empty($object->id)) //} } + // Create a remote order using WebService + if ($object->statut >= 2) // 2 means accepted + { + print ''.$langs->trans('CreateRemoteOrder').''; + } + // Cancel if ($object->statut == 2) { @@ -1975,112 +2374,6 @@ elseif (! empty($object->id)) print ''; } - /* - * Action presend - */ - if ($action == 'presend') - { - $ref = dol_sanitizeFileName($object->ref); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/')); - $file=$fileparams['fullname']; - - // Define output language - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) - $newlang = $_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; - - if (!empty($newlang)) - { - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang($newlang); - $outputlangs->load('commercial'); - } - - // Build document if it not exists - if (! $file || ! is_readable($file)) - { - $result= $object->generateDocument(GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result <= 0) - { - dol_print_error($db,$result); - exit; - } - $fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/')); - $file=$fileparams['fullname']; - } - - print '
'; - - print_titre($langs->trans('SendOrderByMail')); - - // Cree l'objet formulaire mail - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); - $formmail->fromtype = 'user'; - $formmail->fromid = $user->id; - $formmail->fromname = $user->getFullName($langs); - $formmail->frommail = $user->email; - $formmail->withfrom=1; - $liste=array(); - foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; - $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; - $formmail->withtocc=$liste; - $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); - $formmail->withtopic=$outputlangs->trans('SendOrderRef','__ORDERREF__'); - $formmail->withfile=2; - $formmail->withbody=1; - $formmail->withdeliveryreceipt=1; - $formmail->withcancel=1; - // Tableau des substitutions - $formmail->substit['__ORDERREF__']=$object->ref; - $formmail->substit['__SIGNATURE__']=$user->signature; - $formmail->substit['__PERSONALIZED__']=''; - $formmail->substit['__CONTACTCIVNAME__']=''; - - //Find the good contact adress - $custcontact=''; - $contactarr=array(); - $contactarr=$object->liste_contact(-1,'external'); - - if (is_array($contactarr) && count($contactarr)>0) { - foreach($contactarr as $contact) { - if ($contact['libelle']==$langs->trans('TypeContact_order_supplier_external_BILLING')) { - require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; - $contactstatic=new Contact($db); - $contactstatic->fetch($contact['id']); - $custcontact=$contactstatic->getFullName($langs,1); - } - } - - if (!empty($custcontact)) { - $formmail->substit['__CONTACTCIVNAME__']=$custcontact; - } - } - - // Tableau des parametres complementaires - $formmail->param['action']='send'; - $formmail->param['models']='order_supplier_send'; - $formmail->param['orderid']=$object->id; - $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; - - // Init list of files - if (GETPOST("mode")=='init') - { - $formmail->clear_attached_files(); - $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); - } - - // Show form - print $formmail->get_form(); - - print '
'; - } - print ''; } From e875f0c2b8c402fd7f10a11f8b8e903f7380d6fb Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Wed, 29 Oct 2014 05:33:59 +0100 Subject: [PATCH 2/9] Fixed missing separator --- htdocs/fourn/commande/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 72c091ff156..b8d9d74e147 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1122,11 +1122,11 @@ if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST(' if ($result_order["result"]["result_code"] != "OK") { - setEventMessage($langs->trans("SOAPError").$result_order["result"]["result_code"]."' - '".$result_order["result"]["result_label"]."'", 'errors'); + setEventMessage($langs->trans("SOAPError")." '".$result_order["result"]["result_code"]."' - '".$result_order["result"]["result_label"]."'", 'errors'); } else { - setEventMessage($langs->trans("RemoteOrderRef").$result_order["ref"], 'mesgs'); + setEventMessage($langs->trans("RemoteOrderRef")." ".$result_order["ref"], 'mesgs'); } } } From 557cbaf3d7942e68b46e21dd24f18f8e4c78bcde Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Fri, 31 Oct 2014 04:59:57 +0100 Subject: [PATCH 3/9] Added module descriptor and activation checks Corrected 3 missing $error_occurred flags --- .../modSyncSupplierWebServices.class.php | 121 ++++++++++++++++++ htdocs/fourn/commande/card.php | 15 ++- 2 files changed, 132 insertions(+), 4 deletions(-) create mode 100755 htdocs/core/modules/modSyncSupplierWebServices.class.php diff --git a/htdocs/core/modules/modSyncSupplierWebServices.class.php b/htdocs/core/modules/modSyncSupplierWebServices.class.php new file mode 100755 index 00000000000..088989f9de4 --- /dev/null +++ b/htdocs/core/modules/modSyncSupplierWebServices.class.php @@ -0,0 +1,121 @@ + + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \defgroup webservices Module webservices + * \brief Module to enable client for supplier WebServices + * \file htdocs/core/modules/modSyncSupplierWebServices.class.php + * \ingroup webservices + * \brief File to describe client for supplier webservices module + */ +include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; + +/** + * Class to describe a WebServices module + */ +class modSyncSupplierWebServices extends DolibarrModules +{ + + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + $this->numero = 2650; + + $this->family = "technic"; + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) + $this->name = preg_replace('/^mod/i','',get_class($this)); + $this->description = "Enable the client for external supplier web services"; + $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) + $this->special = 1; + // Name of image file used for this module. + $this->picto='technic'; + + // Data directories to create when module is enabled + $this->dirs = array(); + + // Config pages + //------------- + //$this->config_page_url = array("webservices.php@webservices"); + + // Dependancies + //------------- + $this->depends = array(); + $this->requiredby = array(); + $this->langfiles = array("other"); + + // Constantes + //----------- + $this->const = array(); + + // New pages on tabs + // ----------------- + $this->tabs = array(); + + // Boxes + //------ + $this->boxes = array(); + + // Permissions + //------------ + $this->rights = array(); + $this->rights_class = 'syncsupplierwebservices'; + $r=0; + } + + + /** + * Function called when module is enabled. + * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. + * It also creates data directories + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + function init($options='') + { + // Prevent pb of modules not correctly disabled + //$this->remove($options); + + $sql = array(); + + return $this->_init($sql,$options); + } + + /** + * Function called when module is disabled. + * Remove from database constants, boxes and permissions from Dolibarr database. + * Data directories are not deleted + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + function remove($options='') + { + $sql = array(); + + return $this->_remove($sql,$options); + } + +} diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index b8d9d74e147..263a96bdca4 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -7,6 +7,7 @@ * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014 Ion Agorria * * 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 @@ -1065,8 +1066,10 @@ if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST(' 'entity'=>$ws_entity ); - //Is everything filled? - if ($mode != "init" && (empty($ws_host) || empty($ws_key) || empty($ws_user) || empty($ws_password) || empty($ws_thirdparty))) { + //Is sync supplier web services module activated? and everything filled? + if (empty($conf->syncsupplierwebservices->enabled)) { + setEventMessage($langs->trans("WarningModuleNotActive",$langs->transnoentities("Module2650Name"))); + } else if ($mode != "init" && (empty($ws_host) || empty($ws_key) || empty($ws_user) || empty($ws_password) || empty($ws_thirdparty))) { setEventMessage($langs->trans("ErrorFieldsRequired"), 'errors'); } else @@ -2054,6 +2057,7 @@ elseif (! empty($object->id)) if (empty($ws_thirdparty)) { setEventMessage($langs->trans("RemoteUserMissingAssociatedSoc"), 'errors'); + $error_occurred = true; } else { @@ -2129,10 +2133,12 @@ elseif (! empty($object->id)) elseif ($user_status_code == "PERMISSION_DENIED") { setEventMessage($langs->trans("RemoteUserNotPermission"), 'errors'); + $error_occurred = true; } else { setEventMessage($langs->trans("ResponseNonOK")." '".$user_status_code."'", 'errors'); + $error_occurred = true; } //Form @@ -2242,8 +2248,9 @@ elseif (! empty($object->id)) //} } - // Create a remote order using WebService - if ($object->statut >= 2) // 2 means accepted + + // Create a remote order using WebService only if module is activated + if (! empty($conf->syncsupplierwebservices->enabled) && $object->statut >= 2) // 2 means accepted { print ''.$langs->trans('CreateRemoteOrder').''; } From 82aa8458bf7d5f745bd21a6b7cc8d7924c236d0e Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Fri, 31 Oct 2014 17:46:11 +0100 Subject: [PATCH 4/9] Added ws url/key to thirdparty SQL table, class and info page --- htdocs/fourn/commande/card.php | 94 +++++++++++-------- .../install/mysql/migration/3.6.0-3.7.0.sql | 3 + htdocs/install/mysql/tables/llx_societe.sql | 2 + htdocs/societe/class/societe.class.php | 23 +++++ htdocs/societe/soc.php | 36 ++++++- 5 files changed, 117 insertions(+), 41 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 263a96bdca4..4ae8fb17754 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1049,8 +1049,8 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST('cancel')) { - $ws_host = GETPOST('ws_host','alpha'); - $ws_key = GETPOST('ws_key','alpha'); + $ws_url = $object->thirdparty->webservices_url; + $ws_key = $object->thirdparty->webservices_key; $ws_user = GETPOST('ws_user','alpha'); $ws_password = GETPOST('ws_password','alpha'); $ws_entity = GETPOST('ws_entity','int'); @@ -1069,18 +1069,20 @@ if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST(' //Is sync supplier web services module activated? and everything filled? if (empty($conf->syncsupplierwebservices->enabled)) { setEventMessage($langs->trans("WarningModuleNotActive",$langs->transnoentities("Module2650Name"))); - } else if ($mode != "init" && (empty($ws_host) || empty($ws_key) || empty($ws_user) || empty($ws_password) || empty($ws_thirdparty))) { + } else if (empty($ws_url) || empty($ws_key)) { + setEventMessage($langs->trans("ErrorWebServicesFieldsRequired"), 'errors'); + } else if (empty($ws_user) || empty($ws_password) || empty($ws_thirdparty)) { setEventMessage($langs->trans("ErrorFieldsRequired"), 'errors'); } else { //Create SOAP client and connect it to order - $soapclient_order = new nusoap_client($ws_host."/webservices/server_order.php"); + $soapclient_order = new nusoap_client($ws_url."/webservices/server_order.php"); $soapclient_order->soap_defencoding='UTF-8'; $soapclient_order->decodeUTF8(false); //Create SOAP client and connect it to product/service - $soapclient_product = new nusoap_client($ws_host."/webservices/server_productorservice.php"); + $soapclient_product = new nusoap_client($ws_url."/webservices/server_productorservice.php"); $soapclient_product->soap_defencoding='UTF-8'; $soapclient_product->decodeUTF8(false); @@ -1123,7 +1125,11 @@ if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST(' $ws_parameters = array('authentication'=>$ws_authentication, 'order' => $order); $result_order = $soapclient_order->call("createOrder", $ws_parameters, $ws_ns, ''); - if ($result_order["result"]["result_code"] != "OK") + if (empty($result_order["result"]["result_code"])) //No result, check error str + { + setEventMessage($langs->trans("SOAPError")." '".$soapclient_order->error_str."'", 'errors'); + } + else if ($result_order["result"]["result_code"] != "OK") //Something went wrong { setEventMessage($langs->trans("SOAPError")." '".$result_order["result"]["result_code"]."' - '".$result_order["result"]["result_label"]."'", 'errors'); } @@ -1970,8 +1976,8 @@ elseif (! empty($object->id)) elseif ($action == 'webservice' && GETPOST('mode', 'alpha') != "send" && ! GETPOST('cancel')) { $mode = GETPOST('mode', 'alpha'); - $ws_host = GETPOST('ws_host','alpha'); - $ws_key = GETPOST('ws_key','alpha'); + $ws_url = $object->thirdparty->webservices_url; + $ws_key = $object->thirdparty->webservices_key; $ws_user = GETPOST('ws_user','alpha'); $ws_password = GETPOST('ws_password','alpha'); @@ -1988,7 +1994,11 @@ elseif (! empty($object->id)) print_titre($langs->trans('CreateRemoteOrder')); //Is everything filled? - if ($mode != "init" && (empty($ws_host) || empty($ws_key) || empty($ws_user) || empty($ws_password))) { + if (empty($ws_url) || empty($ws_key)) { + setEventMessage($langs->trans("ErrorWebServicesFieldsRequired"), 'errors'); + $mode = "init"; + $error_occurred = true; //Don't allow to set the user/pass if thirdparty fields are not filled + } else if ($mode != "init" && (empty($ws_user) || empty($ws_password))) { setEventMessage($langs->trans("ErrorFieldsRequired"), 'errors'); $mode = "init"; } @@ -2001,26 +2011,29 @@ elseif (! empty($object->id)) print ''; print ''; print ''; - $textinput_size = "50"; - //Remote Host URL - print ''.$langs->trans("Host").''; - - //Remote Webservices key - print ''.$langs->trans("KeyForWebServicesAccess").''; - - //Remote User - print ''.$langs->trans("User").''; - - //Remote Password - print ''.$langs->trans("Password").''; - - //Submit and cancel buttons - print ''; - print ''; - print '     '; - print ''; - print ''; + if ($error_occurred) + { + print "
".$langs->trans("ErrorOccurredReviseAndRetry")."
"; + print ''; + } + else + { + $textinput_size = "50"; + // Webservice url + print ''.$langs->trans("WebServiceURL").''.dol_print_url($ws_url).''; + //Remote User + print ''.$langs->trans("User").''; + //Remote Password + print ''.$langs->trans("Password").''; + //Submit button + print ''; + print ''; + print '     '; + //Cancel button + print ''; + print ''; + } //End table/form print ''; @@ -2032,14 +2045,8 @@ elseif (! empty($object->id)) $ws_thirdparty = ''; $error_occurred = false; - //Check if has transport, without any the soap client will give error - if (strpos($ws_host, "http") === false) - { - $ws_host = "http://".$ws_host; - } - //Create SOAP client and connect it to user - $soapclient_user = new nusoap_client($ws_host."/webservices/server_user.php"); + $soapclient_user = new nusoap_client($ws_url."/webservices/server_user.php"); $soapclient_user->soap_defencoding='UTF-8'; $soapclient_user->decodeUTF8(false); @@ -2062,7 +2069,7 @@ elseif (! empty($object->id)) else { //Create SOAP client and connect it to product/service - $soapclient_product = new nusoap_client($ws_host."/webservices/server_productorservice.php"); + $soapclient_product = new nusoap_client($ws_url."/webservices/server_productorservice.php"); $soapclient_product->soap_defencoding='UTF-8'; $soapclient_product->decodeUTF8(false); @@ -2086,7 +2093,11 @@ elseif (! empty($object->id)) // Check the result code $status_code = $result_product["result"]["result_code"]; - if ($status_code != "OK") + if (empty($status_code)) //No result, check error str + { + setEventMessage($langs->trans("SOAPError")." '".$soapclient_order->error_str."'", 'errors'); + } + else if ($status_code != "OK") //Something went wrong { if ($status_code == "NOT_FOUND") { @@ -2135,6 +2146,11 @@ elseif (! empty($object->id)) setEventMessage($langs->trans("RemoteUserNotPermission"), 'errors'); $error_occurred = true; } + elseif ($user_status_code == "BAD_CREDENTIALS") + { + setEventMessage($langs->trans("RemoteUserBadCredentials"), 'errors'); + $error_occurred = true; + } else { setEventMessage($langs->trans("ResponseNonOK")." '".$user_status_code."'", 'errors'); @@ -2146,15 +2162,13 @@ elseif (! empty($object->id)) print ''; print ''; print ''; - print ''; - print ''; print ''; print ''; print ''; print ''; if ($error_occurred) { - print "
".$langs->trans("ErrorOccurredReviseAndRetry")."
"; //TODO: Translate + print "
".$langs->trans("ErrorOccurredReviseAndRetry")."
"; } else { diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index c2e10543b7a..552563db677 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -1110,3 +1110,6 @@ DELETE FROM llx_menu WHERE module = 'boutique'; -- Add option always editable on extrafield ALTER TABLE llx_extrafields ADD alwayseditable INTEGER DEFAULT 0 AFTER pos; +-- add supplier webservice fields +ALTER TABLE llx_societe ADD webservices_url varchar(255) DEFAULT NULL; +ALTER TABLE llx_societe ADD webservices_key varchar(128) DEFAULT NULL; diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index bfe69b0d5f8..b9327ba521c 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -92,4 +92,6 @@ create table llx_societe logo varchar(255), canvas varchar(32), -- type of canvas if used (null by default) import_key varchar(14) -- import key + webservices_url varchar(255), -- supplier webservice url + webservices_key varchar(128), -- supplier webservice key )ENGINE=innodb; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6d80189c7be..79d24a8d917 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -334,6 +334,18 @@ class Societe extends CommonObject */ var $import_key; + /** + * Supplier WebServices URL + * @var string + */ + var $webservices_url; + + /** + * Supplier WebServices Key + * @var string + */ + var $webservices_key; + var $logo; var $logo_small; var $logo_mini; @@ -715,6 +727,10 @@ class Societe extends CommonObject $supplier=true; } + //Web services + $this->webservices_url = $this->webservices_url?clean_url($this->webservices_url,0):''; + $this->webservices_key = trim($this->webservices_key); + $this->db->begin(); // Check name is required and codes are ok or unique. @@ -795,6 +811,9 @@ class Societe extends CommonObject $sql .= ",default_lang = ".(! empty($this->default_lang)?"'".$this->default_lang."'":"null"); $sql .= ",logo = ".(! empty($this->logo)?"'".$this->logo."'":"null"); + $sql .= ",webservices_url = ".(! empty($this->webservices_url)?"'".$this->db->escape($this->webservices_url)."'":"null"); + $sql .= ",webservices_key = ".(! empty($this->webservices_key)?"'".$this->db->escape($this->webservices_key)."'":"null"); + if ($customer) { $sql .= ", code_client = ".(! empty($this->code_client)?"'".$this->db->escape($this->code_client)."'":"null"); @@ -951,6 +970,7 @@ class Societe extends CommonObject $sql .= ', s.fk_typent as typent_id'; $sql .= ', s.fk_effectif as effectif_id'; $sql .= ', s.fk_forme_juridique as forme_juridique_code'; + $sql .= ', s.webservices_url, s.webservices_key'; $sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode'; $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.tva_assuj'; $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo'; @@ -1086,6 +1106,9 @@ class Societe extends CommonObject $this->default_lang = $obj->default_lang; $this->logo = $obj->logo; + $this->webservices_url = $obj->webservices_url; + $this->webservices_key = $obj->webservices_key; + $this->outstanding_limit = $obj->outstanding_limit; // multiprix diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index a0b9bda1c8e..8117de5f09b 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -119,7 +119,7 @@ if (empty($reshook)) $res=$object->setValueFrom('localtax2_value', $value); } - // Add new third party + // Add new or update third party if ((! GETPOST('getcustomercode') && ! GETPOST('getsuppliercode')) && ($action == 'add' || $action == 'update') && $user->rights->societe->creer) { @@ -189,6 +189,10 @@ if (empty($reshook)) $object->commercial_id = GETPOST('commercial_id', 'int'); $object->default_lang = GETPOST('default_lang'); + // Webservices url/key + $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); + $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -217,6 +221,18 @@ if (empty($reshook)) $error++; $errors[] = $langs->trans("ErrorSupplierModuleNotEnabled"); $action = ($action=='add'?'create':'edit'); } + if (! empty($object->webservices_url)) { + //Check if has transport, without any the soap client will give error + if (strpos($object->webservices_url, "http") === false) + { + $object->webservices_url = "http://".$object->webservices_url; + } + if (! isValidUrl($object->webservices_url)) { + $langs->load("errors"); + $error++; $errors[] = $langs->trans("ErrorBadUrl",$object->webservices_url); + $action = ($action=='add'?'create':'edit'); + } + } // We set country_id, country_code and country for the selected country $object->country_id=GETPOST('country_id')!=''?GETPOST('country_id'):$mysoc->country_id; @@ -1179,6 +1195,10 @@ else $object->tva_intra = GETPOST('tva_intra', 'alpha'); $object->status = GETPOST('status', 'int'); + // Webservices url/key + $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); + $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); + //Local Taxes $object->localtax1_assuj = GETPOST('localtax1assuj_value'); $object->localtax2_assuj = GETPOST('localtax2assuj_value'); @@ -1558,6 +1578,14 @@ else print $object->showOptionals($extrafields,'edit'); } + // Webservices url/key + if (!empty($conf->syncsupplierwebservices->enabled)) { + print ''; + print ''; + print ''; + print ''; + } + // Logo print ''; print ''; @@ -2014,6 +2042,12 @@ else print "\n"; } + // Webservices url/key + if (!empty($conf->syncsupplierwebservices->enabled)) { + print ''.$langs->trans("WebServiceURL").''.dol_print_url($object->webservices_url).''; + print ''.$langs->trans('WebServiceKey').''.$object->webservices_key.''; + } + print ''; dol_fiche_end(); From b8faed9fe80700c2be56ca3f7469277cf9a41352 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Nov 2014 19:50:56 +0100 Subject: [PATCH 5/9] Fix: translation --- htdocs/langs/en_US/admin.lang | 4 ++-- htdocs/langs/en_US/holiday.lang | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 59b31693b2b..82a80881fd0 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -514,8 +514,8 @@ Module5000Name=Multi-company Module5000Desc=Allows you to manage multiple companies Module6000Name=Workflow Module6000Desc=Workflow management -Module20000Name=Holidays -Module20000Desc=Declare and follow employees holidays +Module20000Name=Leave Requests management +Module20000Desc=Declare and follow employees leaves requests Module39000Name=Product batch Module39000Desc=Batch number, eat-by and sell-by date management on products Module50000Name=PayBox diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index c25abf6449c..698d34eb539 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -52,16 +52,16 @@ UpdateButtonCP=Update CantUpdate=You cannot update this leave request. NoDateDebut=You must select a start date. NoDateFin=You must select an end date. -ErrorDureeCP=Your request for holidays does not contain working day. -TitleValidCP=Approve the request holidays +ErrorDureeCP=Your leave request does not contain working day. +TitleValidCP=Approve the leave request ConfirmValidCP=Are you sure you want to approve the leave request? DateValidCP=Date approved TitleToValidCP=Send leave request ConfirmToValidCP=Are you sure you want to send the leave request? -TitleRefuseCP=Refuse the request holidays +TitleRefuseCP=Refuse the leave request ConfirmRefuseCP=Are you sure you want to refuse the leave request? NoMotifRefuseCP=You must choose a reason for refusing the request. -TitleCancelCP=Cancel the request holidays +TitleCancelCP=Cancel the leave request ConfirmCancelCP=Are you sure you want to cancel the leave request? DetailRefusCP=Reason for refusal DateRefusCP=Date of refusal @@ -78,7 +78,7 @@ ActionByCP=Performed by UserUpdateCP=For the user PrevSoldeCP=Previous Balance NewSoldeCP=New Balance -alreadyCPexist=A request for holidays has already been done on this period. +alreadyCPexist=A leave request has already been done on this period. UserName=Name Employee=Employee FirstDayOfHoliday=First day of vacation @@ -88,25 +88,25 @@ ManualUpdate=Manual update HolidaysCancelation=Leave request cancelation ## Configuration du Module ## -ConfCP=Configuration of holidays module +ConfCP=Configuration of leave request module DescOptionCP=Description of the option ValueOptionCP=Value -GroupToValidateCP=Group with the ability to approve vacation +GroupToValidateCP=Group with the ability to approve leave requests ConfirmConfigCP=Validate the configuration -LastUpdateCP=Last automatic update of vacation +LastUpdateCP=Last automatic update of leaves allocation UpdateConfCPOK=Updated successfully. ErrorUpdateConfCP=An error occurred during the update, please try again. -AddCPforUsers=Please add the balance of holidays of users by clicking here. -DelayForSubmitCP=Deadline to apply for holidays -AlertapprobatortorDelayCP=Prevent the approbator if the holiday request does not match the deadline +AddCPforUsers=Please add the balance of leaves allocation of users by clicking here. +DelayForSubmitCP=Deadline to make a leave requests +AlertapprobatortorDelayCP=Prevent the approbator if the leave request does not match the deadline AlertValidatorDelayCP=Préevent the approbator if the leave request exceed delay AlertValidorSoldeCP=Prevent the approbator if the leave request exceed the balance nbUserCP=Number of users supported in the module Leaves -nbHolidayDeductedCP=Number of holidays to be deducted per day of vacation taken -nbHolidayEveryMonthCP=Number of vacation days added every month +nbHolidayDeductedCP=Number of leave days to be deducted per day of vacation taken +nbHolidayEveryMonthCP=Number of leave days added every month Module27130Name= Management of leave requests Module27130Desc= Management of leave requests -TitleOptionMainCP=Main settings of Leave request +TitleOptionMainCP=Main settings of leave request TitleOptionEventCP=Settings of leave requets for events ValidEventCP=Validate UpdateEventCP=Update events From 762eb1cd48ad07ee4512391f2ac3cc551ad41aed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Nov 2014 20:04:01 +0100 Subject: [PATCH 6/9] Style were lost --- htdocs/langs/en_US/admin.lang | 4 ++-- htdocs/theme/eldy/img/background.png | Bin 0 -> 25628 bytes htdocs/theme/eldy/style.css.php | 31 ++++++++++++++++----------- 3 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 htdocs/theme/eldy/img/background.png diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 82a80881fd0..00f7ae43737 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -522,8 +522,8 @@ Module50000Name=PayBox Module50000Desc=Module to offer an online payment page by credit card with PayBox Module50100Name=Point of sales Module50100Desc=Point of sales module -Module50200Name= Paypal -Module50200Desc= Module to offer an online payment page by credit card with Paypal +Module50200Name=Paypal +Module50200Desc=Module to offer an online payment page by credit card with Paypal Module50400Name=Accounting (advanced) Module50400Desc=Accounting management (double parties) Module54000Name=PrintIPP diff --git a/htdocs/theme/eldy/img/background.png b/htdocs/theme/eldy/img/background.png new file mode 100644 index 0000000000000000000000000000000000000000..fb63f12299c1e94af1bdccaf930065b210b834dc GIT binary patch literal 25628 zcmWKXc{~&TAIG~(emW>B-LA@2Um_4%8+qP{omUnO2ZQHi}-*Nl4 zeLMdR@K>it|Hke6_a5C|US6J`pP!qXTUl9|ot<4>U7eYknVz0rTU(o&nwp%P6bJ+p z6BB$spUGq{EG+!_^Jj5!k;mh)*=#PCyR@{#;c#{Z1`hnY@c6UaPR||&`#gg^3H9D~ z!zZA8iLbYv_Y<$kr=8x$+qQW^EN|U-6tR8R#P%xhv8r929B3Vrmv#1W>f4aQ zt^3{rpxy#x-~_nRe!svpjFkwuC{}gS%#0scB;~IzIir(4s;ZJ$gJ0FW(w8KDj<0)Q zCm65#(hFV(q@&R>X=j~<_4DAb^(LdNhd#50Q@~Z`Y!sXFb{s#_B)n-W6?u??64#~@ zr>W_XYM9CG9G;da>kCFuqB);wZ9X{UZiijeb-tFiBhnU8#Hk%?h|GJ=bVFE}P5ONG>Dpz0R2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?V1WLBr!bsV2nb9&F$$>mUd`2Rx=#l6PHmXF@=13>LNJzC`^VS*F(Idq#>9aC zw!i9jyncObYIbI-Io@DpD!{Vzhl6z|ynMy^6L4Va_T~ckB=!B!gMysWHL_)dGFJVy zFEMn(RV$ra3kTEb%S>V!AZMYJHge3<$LQwM4N{TZSC&Tt?}hpx+D-p1Zo()SEe0Hc z%vVjW&?n0{CYv#v!hVwmw7KUehbLMITUB>iEF7<-Du-ZAxz8~I-ixTVkZ z7kiM9vn*6K;P}L-0cp1;%ff%#g34DVxxSidv3^~YLKt~zHpNGD%;t!W`15rveGrdU zEr&7KFNsDs2H7(Ofcb69>#mEk#I;1Zd`rujjjgA5ZmKdT=jfW2u5;5BIStBg3WlY U`K5o~IsRvV)%gm>_U@Da1L( background: ; - /* background-image: url(""); */ color: #101010; font-size: px; @@ -831,10 +830,10 @@ foreach($mainmenuusedarray as $val) .bodylogin { - background: #f0f0f0; - /*-moz-box-shadow: inset 0 0 10px #000000; + background: #fbfbfb; + /* -moz-box-shadow: inset 0 0 10px #000000; -webkit-box-shadow: inset 0 0 10px #000000; - box-shadow: inset 0 0 10px #000000;*/ + box-shadow: inset 0 0 10px #000000; */ } .login_vertical_align { padding: 10px; @@ -861,17 +860,23 @@ form#login { padding-top:12px; padding-bottom:12px; max-width: 540px; - border: 1px solid #A0A0A0; + + border: 1px solid #C0C0C0; + background-color: #E0E0E0; + + -moz-box-shadow: 3px 2px 20px #CCC; + -webkit-box-shadow: 3px 2px 20px #CCC; + box-shadow: 3px 2px 20px #CCC; border-radius: 8px; - border:solid 1px rgba(90,90,90,.4); - -moz-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); - -webkit-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); - box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); - - background-color: #FFFFFF; - background: -webkit-gradient(linear, center top, center bottom, color-stop(0%, #fff), color-stop(100%, #f8f8f8)); - background: -moz-linear-gradient(top, #fff, #f8f8f8); + border:solid 1px rgba(128,128,128,.4); + border-top:solid 1px f8f8f8; + background-color: #f8f8f8; + background-image: -o-linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); + background-image: -moz-linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); + background-image: -webkit-linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); + background-image: -ms-linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); + background-image: linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); } div#login_left, div#login_right { display: inline-block; From 167ec6917a30e8362860229d49d974a1eed746f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Nov 2014 20:15:51 +0100 Subject: [PATCH 7/9] Can add prefix into generated filename. This will save time for script to build kit of files for book keeper. --- htdocs/core/lib/invoice2.lib.php | 18 ++++++------------ scripts/invoices/rebuild_merge_pdf.php | 11 ++++++++++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index d5be39aff0f..ccc115b5b1d 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -41,12 +41,13 @@ require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'); * @param date $paymentdatebefore Payment before date (must includes hour) * @param int $usestdout Add information onto standard output * @param int $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template - * @param string $option Suffix to add into file name of generated PDF + * @param string $filesuffix Suffix to add into file name of generated PDF * @param string $paymentbankid Only if payment on this bank account id * @param array $thirdpartiesid List of thirdparties id when using filter excludethirdpartiesid or onlythirdpartiesid + * @param string $fileprefix Prefix to add into filename of generated PDF * @return int Error code */ -function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate=0, $option='', $paymentbankid='', $thirdpartiesid='') +function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate=0, $filesuffix='', $paymentbankid='', $thirdpartiesid='', $fileprefix='mergedpdf') { $sql = "SELECT DISTINCT f.rowid, f.facnumber"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; @@ -220,13 +221,6 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); //$pdf->SetCompression(false); - - //$pdf->Open(); - //$pdf->AddPage(); - //$title=$langs->trans("BillsCustomersUnpaid"); - //if ($option=='late') $title=$langs->trans("BillsCustomersUnpaid"); - //$pdf->MultiCell(100, 3, $title, 0, 'J'); - // Add all others foreach($files as $file) { @@ -248,9 +242,9 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte dol_mkdir($diroutputpdf); // Save merged file - $filename='mergedpdf'; - - if (! empty($option)) $filename.='_'.$option; + $filename=$fileprefix; + if (empty($filename)) $filename='mergedpdf'; + if (! empty($filesuffix)) $filename.='_'.$filesuffix; $file=$diroutputpdf.'/'.$filename.'.pdf'; if (! $error && $pagecount) diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php index 357a09ccdbe..6fbcdb59538 100755 --- a/scripts/invoices/rebuild_merge_pdf.php +++ b/scripts/invoices/rebuild_merge_pdf.php @@ -71,6 +71,7 @@ $newlangid='en_EN'; // To force a new lang id $filter=array(); $regenerate=''; // Ask regenerate (contains name of model to use) $option=''; +$fileprefix='mergedpdf'; foreach ($argv as $key => $value) { @@ -84,6 +85,13 @@ foreach ($argv as $key => $value) $newlangid=$valarray[1]; print 'Use language '.$newlangid.".\n"; } + if (preg_match('/^prefix=/i',$value)) + { + $found=true; + $valarray=explode('=',$value); + $fileprefix=$valarray[1]; + print 'Use prefix for filename '.$fileprefix.".\n"; + } if (preg_match('/^regenerate=(.*)/i',$value,$reg)) { @@ -232,7 +240,7 @@ if (in_array('bank',$filter) && in_array('nopayment',$filter)) // Define SQL and SQL request to select invoices // Use $filter, $dateafterdate, datebeforedate, $paymentdateafter, $paymentdatebefore -$result=rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, 1, $regenerate, $option, $paymentonbankid, $thirdpartiesid); +$result=rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, 1, $regenerate, $option, $paymentonbankid, $thirdpartiesid, $fileprefix); @@ -283,6 +291,7 @@ function usage() print "To limit to some thirdparties, use filter=onlythirdparties id1,id2...\n"; print "To regenerate existing PDF, use regenerate=crabe\n"; print "To generate invoices in a language, use lang=xx_XX\n"; + print "To set prefix of generated file name, use prefix=myfileprefix\n"; print "\n"; print "Example: ".$script_file." filter=payments 20080101 20081231 lang=fr_FR regenerate=crabe\n"; print "Example: ".$script_file." filter=all lang=en_US\n"; From b74bdb8f7d08bf192b129b514145cfdc48ca19f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Nov 2014 11:39:30 +0100 Subject: [PATCH 8/9] Fix: Bad error message --- htdocs/commande/card.php | 14 +++----------- htdocs/compta/facture.php | 18 ++++++------------ htdocs/core/lib/functions.lib.php | 6 +++++- 3 files changed, 14 insertions(+), 24 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 47dfb568c78..d575c8089f0 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1295,18 +1295,10 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G setEventMessage($mesg, 'errors'); } } - /* } - else - { - $langs->load("other"); - $mesg='
'.$langs->trans('ErrorMailRecipientIsEmpty').' !
'; - $action='presend'; - dol_syslog('Recipient email is empty'); - }*/ } else { - $langs->load("errors"); - setEventMessage($langs->trans('ErrorCantReadFile', $file), 'errors'); - dol_syslog('Failed to read file: ' . $file); + $langs->load("other"); + setEventMessage($langs->trans('ErrorMailRecipientIsEmpty') . '!', 'errors'); + dol_syslog($langs->trans('ErrorMailRecipientIsEmpty')); } } else { $langs->load("other"); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 58001d5c918..8e618663237 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1615,8 +1615,9 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $sendtoid = $_POST['receiver']; } } - - if (dol_strlen($sendto)) { + + if (dol_strlen($sendto)) + { $langs->load("commercial"); $from = $_POST['fromname'] . ' <' . $_POST['frommail'] . '>'; @@ -1715,17 +1716,10 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO setEventMessage($mesg, 'errors'); } } - /* } - else - { - $langs->load("other"); - $mesgs[]='
'.$langs->trans('ErrorMailRecipientIsEmpty').'
'; - dol_syslog('Recipient email is empty'); - }*/ } else { - $langs->load("errors"); - setEventMessage($langs->trans('ErrorCantReadFile', $file), 'errors'); - dol_syslog('Failed to read file: ' . $file); + $langs->load("other"); + setEventMessage($langs->trans('ErrorMailRecipientIsEmpty') . '!', 'errors'); + dol_syslog($langs->trans('ErrorMailRecipientIsEmpty')); } } else { $langs->load("other"); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 23092acfd0d..a94a77f1454 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2862,7 +2862,11 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou $listofcurrenciesbefore=array('USD'); if (in_array($currency_code,$listofcurrenciesbefore)) $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code); - else $cursymbolafter.=$outlangs->getCurrencySymbol($currency_code); + else + { + $tmpcur=$outlangs->getCurrencySymbol($currency_code); + $cursymbolafter.=($tmpcur == $currency_code ? ' '.$tmpcur : $tmpcur); + } } $output=$cursymbolbefore.$output.$end.$cursymbolafter; From 5086450f35176f392485ea4739ccf8ebae50e162 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Nov 2014 12:32:38 +0100 Subject: [PATCH 9/9] Fix: Forging email content must use dol_concatdesc. --- htdocs/comm/propal.php | 9 +++--- htdocs/commande/card.php | 9 +++--- htdocs/compta/facture.php | 32 ++++++------------- htdocs/compta/facture/impayees.php | 9 +++--- htdocs/core/actions_sendmails.inc.php | 11 ++++--- htdocs/core/class/interfaces.class.php | 3 +- .../core/triggers/dolibarrtriggers.class.php | 3 +- ...terface_50_modAgenda_ActionsAuto.class.php | 2 +- htdocs/expedition/card.php | 9 +++--- htdocs/fichinter/card.php | 9 +++--- htdocs/fourn/commande/card.php | 9 +++--- htdocs/fourn/facture/card.php | 9 +++--- 12 files changed, 56 insertions(+), 58 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 6281b1f25f4..189f1f9c041 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -617,11 +617,12 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G else $subject = $langs->transnoentities('Propal') . ' ' . $object->ref; $actiontypecode = 'AC_PROP'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto . ".\n"; + $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; if ($message) { - $actionmsg .= $langs->transnoentities('MailTopic') . ": " . $subject . "\n"; - $actionmsg .= $langs->transnoentities('TextUsedInTheMessageBody') . ":\n"; - $actionmsg .= $message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } $actionmsg2 = $langs->transnoentities('Action' . $actiontypecode); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index d575c8089f0..792da64a923 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1225,11 +1225,12 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G else $subject = $langs->transnoentities('Order') . ' ' . $object->ref; $actiontypecode = 'AC_COM'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto . ".\n"; + $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; if ($message) { - $actionmsg .= $langs->transnoentities('MailTopic') . ": " . $subject . "\n"; - $actionmsg .= $langs->transnoentities('TextUsedInTheMessageBody') . ":\n"; - $actionmsg .= $message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } $actionmsg2 = $langs->transnoentities('Action' . $actiontypecode); } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 8e618663237..2ba425f5a90 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1627,31 +1627,19 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); $deliveryreceipt = $_POST['deliveryreceipt']; - if ($action == 'send') { + if ($action == 'send' || $action == 'relance') + { if (dol_strlen($_POST['subject'])) $subject = $_POST['subject']; else $subject = $langs->transnoentities('Bill') . ' ' . $object->ref; $actiontypecode = 'AC_FAC'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto . ".\n"; + $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; if ($message) { - $actionmsg .= $langs->transnoentities('MailTopic') . ": " . $subject . "\n"; - $actionmsg .= $langs->transnoentities('TextUsedInTheMessageBody') . ":\n"; - $actionmsg .= $message; - } - // $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); - } - if ($action == 'relance') { - if (dol_strlen($_POST['subject'])) - $subject = $_POST['subject']; - else - $subject = $langs->transnoentities('Relance facture ' . $object->ref); - $actiontypecode = 'AC_FAC'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto . ".\n"; - if ($message) { - $actionmsg .= $langs->transnoentities('MailTopic') . ": " . $subject . "\n"; - $actionmsg .= $langs->transnoentities('TextUsedInTheMessageBody') . ":\n"; - $actionmsg .= $message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } // $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); } @@ -1661,9 +1649,9 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $formmail = new FormMail($db); $attachedfiles = $formmail->get_attached_files(); - $filepath = $attachedfiles ['paths']; - $filename = $attachedfiles ['names']; - $mimetype = $attachedfiles ['mimes']; + $filepath = $attachedfiles['paths']; + $filename = $attachedfiles['names']; + $mimetype = $attachedfiles['mimes']; // Send mail require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index ea0d896f5d1..320d86f3377 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -136,12 +136,13 @@ if ($action == 'presend' && GETPOST('sendmail')) $message=make_substitutions($message, $substitutionarray); $actiontypecode='AC_FAC'; - $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; if ($message) { - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } // Create form object diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 337cf59c9b0..625376ace58 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -126,13 +126,14 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO if ($action == 'send' || $action == 'relance') { if (dol_strlen($_POST['subject'])) $subject = $_POST['subject']; - $actionmsg2=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + $actionmsg2=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; if ($message) { - $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; + $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } } diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 407893021ef..199c342020d 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -31,7 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; */ class Interfaces { - var $dir; // Directory with all core and external triggers files + var $db; + var $dir; // Directory with all core and external triggers files var $errors = array(); // Array for errors /** diff --git a/htdocs/core/triggers/dolibarrtriggers.class.php b/htdocs/core/triggers/dolibarrtriggers.class.php index 1fd29359d74..0682bb76a71 100644 --- a/htdocs/core/triggers/dolibarrtriggers.class.php +++ b/htdocs/core/triggers/dolibarrtriggers.class.php @@ -83,7 +83,8 @@ abstract class DolibarrTriggers $this->db = $db; - if (!isset($this->name)) { + if (empty($this->name)) + { $this->name = preg_replace('/^Interface/i', '', get_class($this)); } } diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 632acf71b0e..d4fe47c0faa 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -222,7 +222,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg=$langs->transnoentities("InvoiceSentByEMail",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; } - + // Parameters $object->sendtoid defined by caller //$object->sendtoid=0; } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 7db0ecc56b1..8984e4c5424 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -462,12 +462,13 @@ if ($action == 'send' && ! GETPOST('addfile','alpha') && ! GETPOST('removedfile' if (dol_strlen(GETPOST('subject','alpha'))) $subject=GETPOST('subject','alpha'); else $subject = $langs->transnoentities('Shipping').' '.$object->ref; $actiontypecode='AC_SHIP'; - $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; if ($message) { - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index b5e874d03a6..77c7e17ffb5 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -745,12 +745,13 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA if (strlen(GETPOST('subject','alphs'))) $subject = GETPOST('subject','alpha'); else $subject = $langs->transnoentities('Intervention').' '.$object->ref; $actiontypecode='AC_OTH_AUTO'; - $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; if ($message) { - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } $actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref); } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 4ae8fb17754..0273dea94b9 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -944,12 +944,13 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G if (dol_strlen(GETPOST('subject'))) $subject=GETPOST('subject'); else $subject = $langs->transnoentities('CustomerOrder').' '.$object->ref; $actiontypecode='AC_SUP_ORD'; - $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; if ($message) { - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index e88b5a37945..b88fd582400 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -903,12 +903,13 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P if (dol_strlen($_POST['subject'])) $subject=$_POST['subject']; else $subject = $langs->transnoentities('CustomerOrder').' '.$object->ref; $actiontypecode='AC_SUP_INV'; - $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; if ($message) { - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); }