From a4126fae66d946d943f3776be6e343bd3bd8fb3e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 1 May 2014 18:13:01 +0200 Subject: [PATCH 01/24] [ bug #1341 ] Lastname not added by file or direct input in mass e-mailing --- ChangeLog | 1 + htdocs/core/modules/mailings/xinputfile.modules.php | 2 +- htdocs/core/modules/mailings/xinputuser.modules.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 455ba63c7ee..0af65fcc418 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ Fix: Error on field accountancy code for export profile of invoices. Fix: [ bug #1351 ] VIES verification link broken. Fix: [ bug #1352 ] Removing a shipping does not remove the delivery. Fix: Option MAIN_INVERT_SENDER_RECIPIENT broken with typhon template. +Fix: [ bug #1341 ] Lastname not added by file or direct input in mass e-mailing ***** ChangeLog for 3.5.2 compared to 3.5.1 ***** diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index f6f47db95bb..40fd949fd08 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -166,7 +166,7 @@ class mailing_xinputfile extends MailingTargets { $cibles[$j] = array( 'email' => $email, - 'name' => $name, + 'lastname' => $name, 'firstname' => $firstname, 'other' => $other, 'source_url' => '', diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index a1c60bf527c..c79054c63a7 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -134,7 +134,7 @@ class mailing_xinputuser extends MailingTargets { $cibles[] = array( 'email' => $email, - 'name' => $lastname, + 'lastname' => $lastname, 'firstname' => $firstname, 'other' => $other, 'source_url' => '', From 263730506520af702ca454b04f3cf9d63d387951 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 1 May 2014 18:15:32 +0200 Subject: [PATCH 02/24] same --- htdocs/core/modules/mailings/modules_mailings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 4f0599bfb3b..6f4a573ccfc 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -168,7 +168,7 @@ class MailingTargets // This can't be abstract as it is used for some method $sql.= "'".$this->db->escape($targetarray['other'])."',"; $sql.= "'".$this->db->escape($targetarray['source_url'])."',"; $sql.= (empty($targetarray['source_id']) ? 'null' : "'".$this->db->escape($targetarray['source_id'])."'").","; - $sql .= "'".$this->db->escape(dol_hash($targetarray['email'].';'.$targetarray['name'].';'.$mailing_id.';'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY))."',"; + $sql .= "'".$this->db->escape(dol_hash($targetarray['email'].';'.$targetarray['lastname'].';'.$mailing_id.';'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY))."',"; $sql .= "'".$this->db->escape($targetarray['source_type'])."')"; $result=$this->db->query($sql); if ($result) From 876a35d1a1e06cf57f3d5c5eb78548e402dd296b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 May 2014 00:08:19 +0200 Subject: [PATCH 03/24] Fix phpunit to be compatible with new version of phpunit --- test/phpunit/AdherentTest.php | 2 +- test/phpunit/AdminLibTest.php | 2 +- test/phpunit/AllTests.php | 2 +- test/phpunit/BankAccountTest.php | 2 +- test/phpunit/BuildDocTest.php | 2 +- test/phpunit/CMailFileTest.php | 2 +- test/phpunit/CategorieTest.php | 2 +- test/phpunit/ChargeSocialesTest.php | 2 +- test/phpunit/CommandeFournisseurTest.php | 2 +- test/phpunit/CommandeTest.php | 2 +- test/phpunit/CommonObjectTest.php | 2 +- test/phpunit/CompanyBankAccountTest.php | 2 +- test/phpunit/ContactTest.php | 2 +- test/phpunit/ContratTest.php | 2 +- test/phpunit/CoreTest.php | 2 +- test/phpunit/DateLibTest.php | 2 +- test/phpunit/DateLibTzFranceTest.php | 2 +- test/phpunit/DiscountTest.php | 2 +- test/phpunit/ExportTest.php | 2 +- test/phpunit/FactureFournisseurTest.php | 2 +- test/phpunit/FactureRecTest.php | 2 +- test/phpunit/FactureTest.php | 2 +- test/phpunit/FactureTestRounding.php | 2 +- test/phpunit/FilesLibTest.php | 2 +- test/phpunit/FormAdminTest.php | 2 +- test/phpunit/Functions2LibTest.php | 2 +- test/phpunit/FunctionsLibTest.php | 2 +- test/phpunit/HolidayTest.php | 2 +- test/phpunit/ImagesLibTest.php | 2 +- test/phpunit/ImportTest.php | 2 +- test/phpunit/JsonLibTest.php | 2 +- test/phpunit/LangTest.php | 2 +- test/phpunit/ModulesTest.php | 2 +- test/phpunit/NumberingModulesTest.php | 2 +- test/phpunit/PdfDocTest.php | 2 +- test/phpunit/PgsqlTest.php | 2 +- test/phpunit/PricesTest.php | 2 +- test/phpunit/ProductTest.php | 2 +- test/phpunit/PropalTest.php | 2 +- test/phpunit/ScriptsTest.php | 2 +- test/phpunit/SecurityTest.php | 2 +- test/phpunit/SocieteTest.php | 2 +- test/phpunit/UserGroupTest.php | 2 +- test/phpunit/UserTest.php | 2 +- test/phpunit/WebservicesInvoicesTest.php | 2 +- test/phpunit/WebservicesOrdersTest.php | 2 +- test/phpunit/WebservicesOtherTest.php | 2 +- test/phpunit/WebservicesThirdpartyTest.php | 2 +- test/phpunit/WebservicesUserTest.php | 2 +- test/phpunit/XCalLibTest.php | 2 +- 50 files changed, 50 insertions(+), 50 deletions(-) diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index aebd54f45f6..b0226a3ab4c 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -26,7 +26,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/adherents/class/adherent.class.php'; require_once dirname(__FILE__).'/../../htdocs/adherents/class/adherent_type.class.php'; diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php index 2850041e0a6..562a5d5c714 100644 --- a/test/phpunit/AdminLibTest.php +++ b/test/phpunit/AdminLibTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/admin.lib.php'; diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php index 65a373be905..f9bae36a568 100644 --- a/test/phpunit/AllTests.php +++ b/test/phpunit/AllTests.php @@ -28,7 +28,7 @@ print "Memory: ". ini_get('memory_limit')."\n"; global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; if ($langs->defaultlang != 'en_US') diff --git a/test/phpunit/BankAccountTest.php b/test/phpunit/BankAccountTest.php index 73067787e18..4999e7a2014 100644 --- a/test/phpunit/BankAccountTest.php +++ b/test/phpunit/BankAccountTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/compta/bank/class/account.class.php'; diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index 268c03f5d50..89da06c559e 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -26,7 +26,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php'; require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.facture.class.php'; diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php index 691abed0457..232d10c4e78 100755 --- a/test/phpunit/CMailFileTest.php +++ b/test/phpunit/CMailFileTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/class/CMailFile.class.php'; diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php index de99d38eb59..b4c3436b624 100755 --- a/test/phpunit/CategorieTest.php +++ b/test/phpunit/CategorieTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/categories/class/categorie.class.php'; require_once dirname(__FILE__).'/../../htdocs/product/class/product.class.php'; diff --git a/test/phpunit/ChargeSocialesTest.php b/test/phpunit/ChargeSocialesTest.php index 2367c6aadea..23df7ff09fd 100755 --- a/test/phpunit/ChargeSocialesTest.php +++ b/test/phpunit/ChargeSocialesTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/compta/sociales/class/chargesociales.class.php'; diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index ffc1776d559..74f048dece8 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.commande.class.php'; require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.product.class.php'; diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index 66e56407f45..c77dd39d0c2 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/commande/class/commande.class.php'; diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php index 35865bf712d..a01982508e3 100644 --- a/test/phpunit/CommonObjectTest.php +++ b/test/phpunit/CommonObjectTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/commande/class/commande.class.php'; require_once dirname(__FILE__).'/../../htdocs/projet/class/project.class.php'; diff --git a/test/phpunit/CompanyBankAccountTest.php b/test/phpunit/CompanyBankAccountTest.php index 04925ddd603..bb5e729c4de 100644 --- a/test/phpunit/CompanyBankAccountTest.php +++ b/test/phpunit/CompanyBankAccountTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/societe/class/companybankaccount.class.php'; diff --git a/test/phpunit/ContactTest.php b/test/phpunit/ContactTest.php index 844b36b311a..27610daa16b 100755 --- a/test/phpunit/ContactTest.php +++ b/test/phpunit/ContactTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/contact/class/contact.class.php'; $langs->load("dict"); diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php index 82e53fcb301..4a629ac3b16 100644 --- a/test/phpunit/ContratTest.php +++ b/test/phpunit/ContratTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/contrat/class/contrat.class.php'; diff --git a/test/phpunit/CoreTest.php b/test/phpunit/CoreTest.php index a75c9c5ef82..7ac69f9c4c8 100755 --- a/test/phpunit/CoreTest.php +++ b/test/phpunit/CoreTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; //require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 470b74df861..e285185fbbc 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; diff --git a/test/phpunit/DateLibTzFranceTest.php b/test/phpunit/DateLibTzFranceTest.php index 17db4e3e164..23947c0f753 100644 --- a/test/phpunit/DateLibTzFranceTest.php +++ b/test/phpunit/DateLibTzFranceTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; diff --git a/test/phpunit/DiscountTest.php b/test/phpunit/DiscountTest.php index 19debed0c30..80343da8083 100755 --- a/test/phpunit/DiscountTest.php +++ b/test/phpunit/DiscountTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/class/discount.class.php'; diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php index 021a736d63b..ca1c69da2e5 100755 --- a/test/phpunit/ExportTest.php +++ b/test/phpunit/ExportTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/exports/class/export.class.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/files.lib.php'; diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php index 120a77c7e93..7fe3dbd3214 100644 --- a/test/phpunit/FactureFournisseurTest.php +++ b/test/phpunit/FactureFournisseurTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.facture.class.php'; diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index f7183bc2634..4adace8ef9a 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php'; require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture-rec.class.php'; diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index f0c6539ea8d..1215dfba191 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php'; diff --git a/test/phpunit/FactureTestRounding.php b/test/phpunit/FactureTestRounding.php index c8f99b58502..9961c74c385 100644 --- a/test/phpunit/FactureTestRounding.php +++ b/test/phpunit/FactureTestRounding.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php'; diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index 1e8d91ed08d..21444d2a60a 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -26,7 +26,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/files.lib.php'; diff --git a/test/phpunit/FormAdminTest.php b/test/phpunit/FormAdminTest.php index 363fd4acf2e..0d204f3b365 100644 --- a/test/phpunit/FormAdminTest.php +++ b/test/phpunit/FormAdminTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/class/html.formadmin.class.php'; diff --git a/test/phpunit/Functions2LibTest.php b/test/phpunit/Functions2LibTest.php index 6ac87d0c165..e302e1858e7 100755 --- a/test/phpunit/Functions2LibTest.php +++ b/test/phpunit/Functions2LibTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/functions2.lib.php'; diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index c175a18a543..3707a875238 100755 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; diff --git a/test/phpunit/HolidayTest.php b/test/phpunit/HolidayTest.php index 42800adc2a2..d9b0b54b5f7 100644 --- a/test/phpunit/HolidayTest.php +++ b/test/phpunit/HolidayTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/holiday/class/holiday.class.php'; $langs->load("dict"); diff --git a/test/phpunit/ImagesLibTest.php b/test/phpunit/ImagesLibTest.php index 2e2bcec8123..e485e454516 100644 --- a/test/phpunit/ImagesLibTest.php +++ b/test/phpunit/ImagesLibTest.php @@ -26,7 +26,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/images.lib.php'; diff --git a/test/phpunit/ImportTest.php b/test/phpunit/ImportTest.php index 86d23a850e1..6cd5beecad7 100755 --- a/test/phpunit/ImportTest.php +++ b/test/phpunit/ImportTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); diff --git a/test/phpunit/JsonLibTest.php b/test/phpunit/JsonLibTest.php index 8110df2a6cf..ad7a31bb537 100755 --- a/test/phpunit/JsonLibTest.php +++ b/test/phpunit/JsonLibTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/json.lib.php'; diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index 35f3f979487..c6a30db68fc 100755 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php'; diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php index 7a398b905fa..26f76e942f9 100755 --- a/test/phpunit/ModulesTest.php +++ b/test/phpunit/ModulesTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; if (empty($user->id)) diff --git a/test/phpunit/NumberingModulesTest.php b/test/phpunit/NumberingModulesTest.php index 6d52e65910c..4b834bded69 100644 --- a/test/phpunit/NumberingModulesTest.php +++ b/test/phpunit/NumberingModulesTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; if (empty($user->id)) diff --git a/test/phpunit/PdfDocTest.php b/test/phpunit/PdfDocTest.php index 1b17a671dbb..ee1a8bdf599 100755 --- a/test/phpunit/PdfDocTest.php +++ b/test/phpunit/PdfDocTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php'; require_once dirname(__FILE__).'/../../htdocs/product/class/product.class.php'; diff --git a/test/phpunit/PgsqlTest.php b/test/phpunit/PgsqlTest.php index 78cc4c7129f..a3540715889 100755 --- a/test/phpunit/PgsqlTest.php +++ b/test/phpunit/PgsqlTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/db/pgsql.class.php'; $langs->load("dict"); diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index 0d4ddf140ad..7e403795182 100755 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/price.lib.php'; require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php'; diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php index 88b77f65aee..371bee4928b 100755 --- a/test/phpunit/ProductTest.php +++ b/test/phpunit/ProductTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/product/class/product.class.php'; diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php index d1d7429a91e..772a792e367 100644 --- a/test/phpunit/PropalTest.php +++ b/test/phpunit/PropalTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/comm/propal/class/propal.class.php'; diff --git a/test/phpunit/ScriptsTest.php b/test/phpunit/ScriptsTest.php index 19a10dc526b..72a4377ad6f 100755 --- a/test/phpunit/ScriptsTest.php +++ b/test/phpunit/ScriptsTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php'; diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 9d5b3699d45..e3717a7023f 100755 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php'; diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 4c512279476..5620479c44e 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/societe/class/societe.class.php'; $langs->load("dict"); diff --git a/test/phpunit/UserGroupTest.php b/test/phpunit/UserGroupTest.php index b413acb3942..5ab1976506f 100644 --- a/test/phpunit/UserGroupTest.php +++ b/test/phpunit/UserGroupTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/user/class/usergroup.class.php'; diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index 20a9ffd0cf3..d161b3ce395 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/user/class/user.class.php'; diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index 70b9612734d..1f619beae6b 100755 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP diff --git a/test/phpunit/WebservicesOrdersTest.php b/test/phpunit/WebservicesOrdersTest.php index 787a6086c27..e1ecca1371e 100755 --- a/test/phpunit/WebservicesOrdersTest.php +++ b/test/phpunit/WebservicesOrdersTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP diff --git a/test/phpunit/WebservicesOtherTest.php b/test/phpunit/WebservicesOtherTest.php index 6d666118079..005e3e9114e 100755 --- a/test/phpunit/WebservicesOtherTest.php +++ b/test/phpunit/WebservicesOtherTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index ed594735499..84c433f9716 100755 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP diff --git a/test/phpunit/WebservicesUserTest.php b/test/phpunit/WebservicesUserTest.php index 832fd1ea4cb..ee8cb68aee6 100755 --- a/test/phpunit/WebservicesUserTest.php +++ b/test/phpunit/WebservicesUserTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP diff --git a/test/phpunit/XCalLibTest.php b/test/phpunit/XCalLibTest.php index 8aa8217bb1f..ab16d4e3cb6 100644 --- a/test/phpunit/XCalLibTest.php +++ b/test/phpunit/XCalLibTest.php @@ -25,7 +25,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver -require_once 'PHPUnit/Autoload.php'; +//require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/xcal.lib.php'; From 4599b22cb57211a5eb827b6aebb6989955d8ff67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 2 May 2014 17:15:56 +0200 Subject: [PATCH 04/24] Fix: [ bug #1357 ] Invoice creator state not printed in generated invoice documents --- ChangeLog | 2 +- htdocs/societe/class/societe.class.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 455ba63c7ee..80173e42c65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,7 @@ Fix: Error on field accountancy code for export profile of invoices. Fix: [ bug #1351 ] VIES verification link broken. Fix: [ bug #1352 ] Removing a shipping does not remove the delivery. Fix: Option MAIN_INVERT_SENDER_RECIPIENT broken with typhon template. - +Fix: [ bug #1357 ] Invoice creator state not printed in generated invoice documents ***** ChangeLog for 3.5.2 compared to 3.5.1 ***** Fix: Can't add user for a task. diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 5d7ab58e39f..bbefb952c7a 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -10,6 +10,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2013 Peter Fontaine + * 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 @@ -2529,12 +2530,15 @@ class Societe extends CommonObject { global $langs; + require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php'; + $this->id=0; $this->name=empty($conf->global->MAIN_INFO_SOCIETE_NOM)?'':$conf->global->MAIN_INFO_SOCIETE_NOM; $this->address=empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS; $this->zip=empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP; $this->town=empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN; - $this->state_id=empty($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT)?'':$conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT; + $this->state_id=empty($conf->global->MAIN_INFO_SOCIETE_STATE)?'':$conf->global->MAIN_INFO_SOCIETE_STATE; + $this->state = getState($this->state_id); $this->note_private=empty($conf->global->MAIN_INFO_SOCIETE_NOTE)?'':$conf->global->MAIN_INFO_SOCIETE_NOTE; $this->nom=$this->name; // deprecated From 50c10d3d1e2ef1f10dadd64fe89a063af65a1221 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 May 2014 02:20:26 +0200 Subject: [PATCH 05/24] Fix: Can disable features with PHPEXCEL (no DLSF compatible). Fix: Can disable features with CKEDITOR. --- build/debian/install.forced.php.install | 2 +- htdocs/admin/modules.php | 35 +- .../modules/export/export_excel.modules.php | 10 +- .../export/export_excel2007.modules.php | 3 +- htdocs/core/modules/export/modules_export.php | 4 +- htdocs/core/modules/modFckeditor.class.php | 3 +- htdocs/exports/export.php | 14 +- htdocs/exports/index.php | 8 +- test/soapui/Dolibarr-soapui-project.xml | 559 +++++++++++++++--- 9 files changed, 535 insertions(+), 103 deletions(-) diff --git a/build/debian/install.forced.php.install b/build/debian/install.forced.php.install index 2785eaa21cd..a6347863b1d 100755 --- a/build/debian/install.forced.php.install +++ b/build/debian/install.forced.php.install @@ -36,7 +36,7 @@ $force_install_lockinstall='444'; //$force_dolibarr_lib_GEOIP_PATH=''; //$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; //$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; -//$force_dolibarr_lib_PHPEXCEL_PATH=''; +//$force_dolibarr_lib_PHPEXCEL_PATH=''; // Use '' or 'disabled' //$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; // Use '/javascript/ckeditor' or 'disabled' //$force_dolibarr_js_JQUERY='/javascript/jquery'; //$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 03d40dbb085..2ce81f966f1 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -416,24 +416,27 @@ if ($mode != 'marketplace') print "\n"; // Activate/Disable and Setup (2 columns) - if (! empty($conf->global->$const_name)) + if (! empty($conf->global->$const_name)) // If module is activated { $disableSetup = 0; print ''; - - if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1))) + if (! empty($objMod->disabled)) + { + print $langs->trans("Disabled"); + } + else if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1))) { print $langs->trans("Required"); if (! empty($conf->multicompany->enabled) && $user->entity) $disableSetup++; - print ''."\n"; } else { print ''; print img_picto($langs->trans("Activated"),'switch_on'); - print ''."\n"; + print ''; } + print ''."\n"; if (! empty($objMod->config_page_url) && !$disableSetup) { @@ -478,19 +481,25 @@ if ($mode != 'marketplace') } } - else + else // Module not activated { print ''; - - if (! empty($objMod->always_enabled)) + if (! empty($objMod->always_enabled)) { // Ne devrait pas arriver. } - - // Module non actif - print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); - print "\n  \n"; + else if (! empty($objMod->disabled)) + { + print $langs->trans("Disabled"); + } + else + { + // Module non actif + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print "\n"; + } + print "\n  "; } print "\n"; diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index 5a3f333577c..6e253cb4037 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -68,6 +68,8 @@ class ExportExcel extends ModeleExports $this->label_lib='PhpExcel'; $this->version_lib='1.7.2'; + $this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages) + $this->row=0; } @@ -181,14 +183,14 @@ class ExportExcel extends ModeleExports if ($this->id == 'excel2007') { - if (! class_exists('ZipArchive')) // For Excel2007, PHPExcel need ZipArchive + if (! class_exists('ZipArchive')) // For Excel2007, PHPExcel need ZipArchive { $langs->load("errors"); $this->error=$langs->trans('ErrorPHPNeedModule','zip'); - return -1; + return -1; } - } - + } + $this->workbook = new PHPExcel(); $this->workbook->getProperties()->setCreator($user->getFullName($outputlangs).' - Dolibarr '.DOL_VERSION); //$this->workbook->getProperties()->setLastModifiedBy('Dolibarr '.DOL_VERSION); diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 6d9a585e6be..9da49be9880 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -47,7 +47,6 @@ class ExportExcel2007 extends ExportExcel var $col; var $file; // To save filename - /** * Constructor * @@ -69,6 +68,8 @@ class ExportExcel2007 extends ExportExcel $this->label_lib='PhpExcel'; $this->version_lib='1.7.2'; + $this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages) + $this->row=0; } diff --git a/htdocs/core/modules/export/modules_export.php b/htdocs/core/modules/export/modules_export.php index b42f2a2dfa7..47ba1609f5d 100644 --- a/htdocs/core/modules/export/modules_export.php +++ b/htdocs/core/modules/export/modules_export.php @@ -44,7 +44,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac * * @param DoliDB $db Database handler * @param string $maxfilenamelength Max length of value to show - * @return array List of templates + * @return array List of templates (same content than array this->driverlabel) */ function liste_modeles($db,$maxfilenamelength=0) { @@ -74,7 +74,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac // Picto $this->picto[$module->id]=$module->picto; // Driver properties - $this->driverlabel[$module->id]=$module->getDriverLabel(); + $this->driverlabel[$module->id]=$module->getDriverLabel().(empty($module->disabled)?'':' __(Disabled)__'); // '__(Disabled)__' is a key $this->driverdesc[$module->id]=$module->getDriverDesc(); $this->driverversion[$module->id]=$module->getDriverVersion(); // If use an external lib diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index 2b60ea48025..c6240ce20cf 100644 --- a/htdocs/core/modules/modFckeditor.class.php +++ b/htdocs/core/modules/modFckeditor.class.php @@ -62,8 +62,7 @@ class modFckeditor extends DolibarrModules $this->config_page_url = array("fckeditor.php"); // Dependances - global $dolibarr_js_CKEDITOR; - $this->hidden = ($dolibarr_js_CKEDITOR == 'disabled'?1:0); // A condition to disable module (used for native debian packages) + $this->disabled = (in_array(constant('JS_CKEDITOR'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages) $this->depends = array(); $this->requiredby = array(); diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 9d8c59f8eaa..5a3e4485441 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -1029,7 +1029,7 @@ if ($step == 5 && $datatoexport) if ($action == 'remove_file') { print $form->formconfirm($_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport.'&file='.urlencode(GETPOST("file")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - + } print ''; @@ -1093,13 +1093,21 @@ if ($step == 5 && $datatoexport) print ''."\n"; $liste=$objmodelexport->liste_modeles($db); - foreach($liste as $key => $val) + $listeall=$liste; + foreach($listeall as $key => $val) { + if (preg_match('/__\(Disabled\)__/',$listeall[$key])) + { + $listeall[$key]=preg_replace('/__\(Disabled\)__/','('.$langs->transnoentitiesnoconv("Disabled").')',$listeall[$key]); + unset($liste[$key]); + } + $var=!$var; print ''; print ''; $text=$objmodelexport->getDriverDescForKey($key); - print ''; + $label=$listeall[$key]; + print ''; print ''."\n"; } print '
'.img_picto_common($key,$objmodelexport->getPictoForKey($key)).''.$form->textwithpicto($objmodelexport->getDriverLabelForKey($key),$text).''.$form->textwithpicto($label,$text).''.$objmodelexport->getLibLabelForKey($key).''.$objmodelexport->getLibVersionForKey($key).'
'; diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index c68d793185d..0184ed8ed68 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -129,11 +129,17 @@ $liste=$model->liste_modeles($db); // This is not a static method for exports $var=true; foreach($liste as $key => $val) { + if (preg_match('/__\(Disabled\)__/',$liste[$key])) + { + $liste[$key]=preg_replace('/__\(Disabled\)__/','('.$langs->transnoentitiesnoconv("Disabled").')',$liste[$key]); + } + $var=!$var; print ''; print ''.img_picto_common($model->getDriverLabelForKey($key),$model->getPictoForKey($key)).''; $text=$model->getDriverDescForKey($key); - print ''.$form->textwithpicto($model->getDriverLabelForKey($key),$text).''; + $label=$liste[$key]; + print ''.$form->textwithpicto($label,$text).''; print ''.$model->getLibLabelForKey($key).''; print ''.$model->getLibVersionForKey($key).''; print ''; diff --git a/test/soapui/Dolibarr-soapui-project.xml b/test/soapui/Dolibarr-soapui-project.xml index e880ef1f5ad..9d9e7890443 100755 --- a/test/soapui/Dolibarr-soapui-project.xml +++ b/test/soapui/Dolibarr-soapui-project.xml @@ -1,5 +1,5 @@ -http://localhostdolibarr/dolibarrnew/webservices/server_other.php?wsdl +http://localhostdolibarr/dolibarrnew/webservices/server_other.php?wsdl @@ -757,7 +757,7 @@ all -]]>http://localhost/dolibarr/htdocs/webservices/server_productorservice.php?wsdl +]]>http://localhost/dolibarr_new/webservices/server_productorservice.php?wsdl @@ -845,6 +845,7 @@ + @@ -866,6 +867,14 @@ + + + + + + + + @@ -877,6 +886,7 @@ + @@ -898,6 +908,11 @@ + + WS to delete a product or service + + + WS to get list of all products or services id and ref @@ -938,6 +953,15 @@ + + + + + + + + + @@ -959,48 +983,67 @@ - + -]]>http://schemas.xmlsoap.org/wsdl/http://localhost/dolibarr/htdocs/webservices/server_productorservice.phphttp://localhostdolibarr/dolibarrnew/webservices/server_productorservice.phphttp://localhost/dolibarr/htdocs/webservices/server_productorservice.php<xml-fragment/>UTF-8http://localhost/dolibarr/htdocs/webservices/server_productorservice.php - - - +]]>http://schemas.xmlsoap.org/wsdl/http://localhost/dolibarr_new/webservices/server_productorservice.phphttp://localhostdolibarr/dolibarrnew/webservices/server_productorservice.phphttp://localhost/dolibarr/htdocs/webservices/server_productorservice.phphttp://localhost/dolibarr_new/webservices/server_productorservice.php<xml-fragment/>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php + + + + + dolibarrkey - PRESTASHOP + DEMO admin admin - - - aaa - aaa - 0 - - les couteurs isolation sonore ergonomiques et l gers offrent la reproduction audio la plus fid le en provenance de sources audio st r o portables ou de salon. - 2013-03-06 09:24:51 - 2013-03-06 09:24:51 - imported from Prestashop - 0 - 1 - - upc - - - - - 149 - - - 0 - - - + + + ? + NewProductFromWS + ? + 1 + + This is a new product created from WS PHPUnit test case + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + + + + ? + ? + ? + ? + + - - -]]>UTF-8http://localhost/dolibarr/htdocs/webservices/server_productorservice.php + + +]]>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php @@ -1058,7 +1101,122 @@ -]]><xml-fragment/>UTF-8http://localhost/dolibarr/htdocs/webservices/server_productorservice.php +]]><xml-fragment/>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php + + + + + + dolibarrkey + DEMO + admin + admin + + + + + ? + ? + ? + ? + + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + + + + ? + ? + ? + ? + + + + + +]]>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php + + + + + + ? + ? + ? + ? + ? + + + + ? + ? + ? + ? + + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + + + + + ? + ? + ? + ? + + + + + +]]><xml-fragment/>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php @@ -1068,14 +1226,15 @@ ? admin admin - + 1 - - + + + ? -]]><xml-fragment/>UTF-8http://localhost/dolibarr/htdocs/webservices/server_productorservice.php +]]><xml-fragment/>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php @@ -1090,9 +1249,46 @@ ? ? ? + ? -]]>UTF-8http://localhost/dolibarr/htdocs/webservices/server_productorservice.php +]]><xml-fragment/>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php + + + + + + ? + ? + ? + ? + ? + + ? + ? + ? + ? + + +]]><xml-fragment/>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php + + + + + + ? + ? + ? + ? + ? + + ? + ? + ? + ? + + +]]>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php @@ -1112,7 +1308,47 @@ -]]><xml-fragment/>UTF-8http://localhost/dolibarr/htdocs/webservices/server_productorservice.php +]]>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php + + + + + + ? + ? + ? + ? + ? + + + + ? + ? + ? + + + +]]>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php + + + + + + ? + ? + ? + ? + ? + + + + ? + ? + ? + + + +]]><xml-fragment/>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php @@ -1122,12 +1358,45 @@ ? admin admin - + 5 + ? -]]><xml-fragment/>UTF-8http://localhost/dolibarr/htdocs/webservices/server_productorservice.php +]]>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php + + + + + + ? + ? + ? + ? + ? + + ? + ? + + +]]>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php + + + + + + ? + ? + ? + ? + ? + + ? + ? + + +]]><xml-fragment/>UTF-8http://localhost/dolibarr_new/webservices/server_productorservice.php @@ -1137,48 +1406,186 @@ aaa admin admin - + 1 - + 111 - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +