diff --git a/dev/initdata/generate-commande.php b/dev/initdata/generate-commande.php index 9d13914ef33..a2f0078a71c 100644 --- a/dev/initdata/generate-commande.php +++ b/dev/initdata/generate-commande.php @@ -34,12 +34,12 @@ if (substr($sapi_type, 0, 3) == 'cgi') { // Recupere root dolibarr $path=preg_replace('/generate-commande.php/i','',$_SERVER["PHP_SELF"]); require ($path."../../htdocs/master.inc.php"); -include_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); -include_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); -include_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); -include_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); -include_once(DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php"); -include_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); +include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; +include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; /* diff --git a/dev/initdata/generate-produit.php b/dev/initdata/generate-produit.php index 5a35a3b116a..ba19e621b4f 100644 --- a/dev/initdata/generate-produit.php +++ b/dev/initdata/generate-produit.php @@ -34,12 +34,12 @@ if (substr($sapi_type, 0, 3) == 'cgi') { // Recupere root dolibarr $path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]); require ($path."../../htdocs/master.inc.php"); -include_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); -include_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); -include_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); -include_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); -include_once(DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php"); -include_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); +include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; +include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; /* diff --git a/dev/initdata/generate-societe.php b/dev/initdata/generate-societe.php index 3f265f2a181..4c0c04df0ab 100644 --- a/dev/initdata/generate-societe.php +++ b/dev/initdata/generate-societe.php @@ -34,12 +34,12 @@ if (substr($sapi_type, 0, 3) == 'cgi') { // Recupere root dolibarr $path=preg_replace('/generate-societe.php/i','',$_SERVER["PHP_SELF"]); require ($path."../../htdocs/master.inc.php"); -include_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); -include_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); -include_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); -include_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); -include_once(DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php"); -include_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); +include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; +include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $villes = array("Auray","Baden","Vannes","Pirouville","Haguenau","Souffelweiersheim","Illkirch-Graffenstaden","Lauterbourg","Picauville","Sainte-Mère Eglise","Le Bono"); $prenoms = array("Joe","Marc","Steve","Laurent","Nico","Isabelle","Dorothee","Saby","Brigitte","Karine","Jose-Anne","Celine","Virginie"); diff --git a/dev/skeletons/README b/dev/skeletons/README index 32924a36ac6..02a760a53dc 100644 --- a/dev/skeletons/README +++ b/dev/skeletons/README @@ -9,7 +9,7 @@ skeleton_*.php to build its generated code. modMyModule.class.php: -Is a sample of module descriptor you can use if you want to build a new module/plugin for +Is a sample of module descriptor that you can use if you want to build a new module/plugin for Dolibarr. @@ -20,11 +20,7 @@ skeleton_page.php: Is a sample you can use as an example if you need to build an HTML page to include in Dolibarr GUI. skeleton_class.class.php: -Is a sample you can use as an example if you need to build a class file to access a new table -required by a Dolibarr development. -However it is better to run the script build_class_from_table.php that accept a table name as a -parameter and will used table description in database and the skeleton_class.class.php file to -generate full code for your class file. -After running this script, the class to access your table (insert a record, update, delete and select) -is directly finished and can be used by your business code. No more coding for accesser on table -is needed with this script as the file is completely generated once. +Is a sample you can use as an example if you need to build a class file to access a new table required by a Dolibarr development. +However it is better to run the build_class_from_table.php script that accepts a table name as a parameter and will uses the description table within database and the skeleton_class.class.php file to generate full code for your class file. +After running this script, the class to access your table (insert a record, update, delete and select) is directly finished and can be used by your module's code. +No more coding is needed to get access to table with this script because the file is completely generated once. diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 71401511e7a..416b65150cb 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -25,7 +25,7 @@ * \ingroup mymodule * \brief Description and activation file for module MyModule */ -include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php"); +include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; /** diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php index f5de8e82f8c..de8ca3d11b4 100644 --- a/dev/skeletons/skeleton_class.class.php +++ b/dev/skeletons/skeleton_class.class.php @@ -61,7 +61,7 @@ class Skeleton_Class // extends CommonObject /** * Create object into database * - * @param User $user User that create + * @param User $user User that creates * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, Id of created object if OK */ @@ -102,10 +102,10 @@ class Skeleton_Class // extends CommonObject if (! $notrigger) { // Uncomment this and change MYOBJECT to your own tag if you - // want this action call a trigger. + // want this action calls a trigger. //// Call triggers - //include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; //$interface=new Interfaces($this->db); //$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf); //if ($result < 0) { $error++; $this->errors=$interface->errors; } @@ -133,7 +133,7 @@ class Skeleton_Class // extends CommonObject /** - * Load object in memory from database + * Load object in memory from the database * * @param int $id Id object * @return int <0 if KO, >0 if OK @@ -178,7 +178,7 @@ class Skeleton_Class // extends CommonObject /** * Update object into database * - * @param User $user User that modify + * @param User $user User that modifies * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ @@ -193,7 +193,7 @@ class Skeleton_Class // extends CommonObject //... // Check parameters - // Put here code to add control on parameters values + // Put here code to add a control on parameters values // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."mytable SET"; @@ -213,10 +213,10 @@ class Skeleton_Class // extends CommonObject if (! $notrigger) { // Uncomment this and change MYOBJECT to your own tag if you - // want this action call a trigger. + // want this action calls a trigger. //// Call triggers - //include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; //$interface=new Interfaces($this->db); //$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf); //if ($result < 0) { $error++; $this->errors=$interface->errors; } @@ -246,7 +246,7 @@ class Skeleton_Class // extends CommonObject /** * Delete object in database * - * @param User $user User that delete + * @param User $user User that deletes * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ @@ -262,10 +262,10 @@ class Skeleton_Class // extends CommonObject if (! $notrigger) { // Uncomment this and change MYOBJECT to your own tag if you - // want this action call a trigger. + // want this action calls a trigger. //// Call triggers - //include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; //$interface=new Interfaces($this->db); //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); //if ($result < 0) { $error++; $this->errors=$interface->errors; } diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index 82d6f74497c..13878312fce 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -36,15 +36,15 @@ // Change this following line to use the correct relative path (../, ../../, etc) $res=0; -if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php"); -if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php"); -if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php"); -if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@include("../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include("../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (! $res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) $res=@include("../../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only +if (! $res && file_exists("../main.inc.php")) $res=@include '../main.inc.php'; +if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; +if (! $res && file_exists("../../../main.inc.php")) $res=@include '../../../main.inc.php'; +if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only +if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only +if (! $res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only if (! $res) die("Include of main fails"); // Change this following line to use the correct relative path from htdocs -dol_include_once("/module/class/skeleton_class.class.php"); +dol_include_once('/module/class/skeleton_class.class.php'); // Load traductions files requiredby by page $langs->load("companies"); diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 885e5ebd37c..6cea7ce9389 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -27,9 +27,9 @@ * \brief Page to setup the module Foundation */ -require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/member.lib.php"); +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; $langs->load("admin"); $langs->load("members"); diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index 7f9d3fe1ca5..b14042a141e 100755 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -23,9 +23,9 @@ * \brief Page to setup extra fields of members */ -require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/member.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/extrafields.class.php"); +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->load("members"); $langs->load("admin"); @@ -52,7 +52,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require(DOL_DOCUMENT_ROOT."/core/admin_extrafields.inc.php"); +require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; diff --git a/htdocs/adherents/admin/mailman.php b/htdocs/adherents/admin/mailman.php index ce69c6a984d..5e7aa08f547 100644 --- a/htdocs/adherents/admin/mailman.php +++ b/htdocs/adherents/admin/mailman.php @@ -27,9 +27,9 @@ * \brief Page to setup the module MailmanSpip (Mailman) */ -require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/mailmanspip.lib.php"); +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/mailmanspip.lib.php'; $langs->load("admin"); $langs->load("members"); @@ -99,7 +99,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con } else { - include_once(DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'); + include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; $mailmanspip=new MailmanSpip($db); $object=new stdClass(); diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php index a716b92ba62..911b1e13f7f 100755 --- a/htdocs/adherents/admin/public.php +++ b/htdocs/adherents/admin/public.php @@ -24,10 +24,10 @@ * \author Laurent Destailleur */ -require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/member.lib.php"); +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; $langs->load("members"); $langs->load("admin"); diff --git a/htdocs/adherents/admin/spip.php b/htdocs/adherents/admin/spip.php index c6b3d282ab8..2d571d2c615 100644 --- a/htdocs/adherents/admin/spip.php +++ b/htdocs/adherents/admin/spip.php @@ -27,9 +27,9 @@ * \brief Page to setup the module MailmanSpip (SPIP) */ -require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/mailmanspip.lib.php"); +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/mailmanspip.lib.php'; $langs->load("admin"); $langs->load("members"); diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 360413b32f9..db8a055e32f 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -26,11 +26,11 @@ * \brief Page of members events */ -require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/member.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php"); +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; $langs->load("companies"); $langs->load("members"); @@ -72,8 +72,8 @@ $form = new Form($db); */ if ($id) { - require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"); - require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $langs->load("companies"); diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index deda22920df..ece8bcf5cd7 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -23,14 +23,14 @@ * \brief Onglet d'ajout, edition, suppression des adhesions d'un adherent */ -require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/member.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/cotisation.class.php"); -require_once(DOL_DOCUMENT_ROOT."/compta/bank/class/account.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/extrafields.class.php"); +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/cotisation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->load("companies"); $langs->load("bills"); @@ -281,7 +281,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ // Insert into bank account directlty (if option choosed for) + link to llx_cotisation if option is 'bankdirect' if ($option == 'bankdirect' && $accountid) { - require_once(DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'); + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acct=new Account($db); $result=$acct->fetch($accountid); @@ -322,8 +322,8 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ // If option choosed, we create invoice if (($option == 'bankviainvoice' && $accountid) || $option == 'invoiceonly') { - require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); - require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/paymentterm.class.php"); + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; $invoice=new Facture($db); $customer=new Societe($db); @@ -374,9 +374,9 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ // Add payment onto invoice if ($option == 'bankviainvoice' && $accountid) { - require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'); - require_once(DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'); - require_once(DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'); + require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; // Creation de la ligne paiement $amounts[$invoice->id] = price2num($cotisation); @@ -722,7 +722,7 @@ if ($rowid) // Link for paypal payment if ($conf->paypal->enabled) { - include_once(DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'); + include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; print showPaypalPaymentUrl('membersubscription',$object->ref); } diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 28475d03571..276d0d51116 100755 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -22,12 +22,12 @@ * \ingroup member * \brief Page to output members business cards */ -require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/modules/member/modules_cards.php"); -require_once(DOL_DOCUMENT_ROOT."/core/modules/printsheet/modules_labels.php"); +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/member/modules_cards.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/printsheet/modules_labels.php'; $langs->load("members"); $langs->load("errors"); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 1566b934afe..3c0290b4eeb 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -26,10 +26,10 @@ * \brief File of class to manage members of a foundation */ -require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/cotisation.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/cotisation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; /** @@ -162,7 +162,7 @@ class Adherent extends CommonObject $from=$conf->email_from; if ($conf->global->ADHERENT_MAIL_FROM) $from=$conf->global->ADHERENT_MAIL_FROM; - include_once(DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"); + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml); if ($mailfile->sendfile()) { @@ -345,7 +345,7 @@ class Adherent extends CommonObject if (! $notrigger) { // Appel des triggers - include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('MEMBER_CREATE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } @@ -462,7 +462,7 @@ class Adherent extends CommonObject $nbrowsaffected+=$this->db->affected_rows($resql); // Actions on extra fields (by external module) - include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $hookmanager=new HookManager($this->db); $hookmanager->initHooks(array('memberdao')); $parameters=array('id'=>$this->id); @@ -513,7 +513,7 @@ class Adherent extends CommonObject // Update information on linked user if it is an update if ($this->user_id > 0 && ! $nosyncuser) { - require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php"); + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; dol_syslog(get_class($this)."::update update linked user"); @@ -557,7 +557,7 @@ class Adherent extends CommonObject // Update information on linked thirdparty if it is an update if ($this->fk_soc > 0 && ! $nosyncthirdparty) { - require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; dol_syslog(get_class($this)."::update update linked thirdparty"); @@ -596,7 +596,7 @@ class Adherent extends CommonObject if (! $error && ! $notrigger) { // Appel des triggers - include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('MEMBER_MODIFY',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } @@ -721,37 +721,37 @@ class Adherent extends CommonObject $ret=$this->setUserId(0); if ($ret > 0) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent WHERE rowid = ".$rowid; - dol_syslog(get_class($this)."::delete sql=".$sql); - $resql=$this->db->query($sql); - if ($resql) - { - if ($this->db->affected_rows($resql)) - { - // Appel des triggers - include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('MEMBER_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers - - $this->db->commit(); - return 1; - } - else - { - // Rien a effacer - $this->db->rollback(); - return 0; - } - } - else + $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent WHERE rowid = ".$rowid; + dol_syslog(get_class($this)."::delete sql=".$sql); + $resql=$this->db->query($sql); + if ($resql) + { + if ($this->db->affected_rows($resql)) + { + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('MEMBER_DELETE',$this,$user,$langs,$conf); + if ($result < 0) { + $error++; $this->errors=$interface->errors; + } + // Fin appel triggers + + $this->db->commit(); + return 1; + } + else + { + // Rien a effacer + $this->db->rollback(); + return 0; + } + } + else { $this->error=$this->db->error(); - $this->db->rollback(); - return -3; + $this->db->rollback(); + return -3; } } } @@ -792,7 +792,7 @@ class Adherent extends CommonObject // If new password not provided, we generate one if (! $password) { - require_once(DOL_DOCUMENT_ROOT."/core/lib/security2.lib.php"); + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $password=getRandomPassword(''); } @@ -825,7 +825,7 @@ class Adherent extends CommonObject if ($this->user_id && ! $nosyncuser) { - require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php"); + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; // This member is linked with a user, so we also update users informations // if this is an update. @@ -852,7 +852,7 @@ class Adherent extends CommonObject if (! $error && ! $notrigger) { // Appel des triggers - include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('MEMBER_NEW_PASSWORD',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } @@ -1227,7 +1227,7 @@ class Adherent extends CommonObject $this->last_subscription_date_end=$datefin; // Appel des triggers - include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('MEMBER_SUBSCRIPTION',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } @@ -1288,7 +1288,7 @@ class Adherent extends CommonObject $this->statut=1; // Appel des triggers - include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('MEMBER_VALIDATE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } @@ -1338,7 +1338,7 @@ class Adherent extends CommonObject $this->statut=0; // Appel des triggers - include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('MEMBER_RESILIATE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } @@ -1366,7 +1366,7 @@ class Adherent extends CommonObject { global $conf; - include_once(DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'); + include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; $mailmanspip=new MailmanSpip($db); $err=0; @@ -1412,7 +1412,7 @@ class Adherent extends CommonObject { global $conf; - include_once(DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'); + include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; $mailmanspip=new MailmanSpip($db); $err=0; @@ -1510,7 +1510,7 @@ class Adherent extends CommonObject $ret=''; if ($withcountry && $this->country_id && (empty($this->country_code) || empty($this->country))) { - require_once(DOL_DOCUMENT_ROOT ."/core/lib/company.lib.php"); + require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php'; $tmparray=getCountry($this->country_id,'all'); $this->country_code=$tmparray['code']; $this->country =$tmparray['label']; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index ea2a6489f5b..d6a0ed1ce91 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -24,7 +24,7 @@ * \author Rodolphe Quiedeville */ -require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; /** diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index 4db3884cdad..52d73691cb8 100755 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -23,8 +23,8 @@ * \brief Fichier de la classe de gestion des stats des adhérents */ -include_once DOL_DOCUMENT_ROOT . "/core/class/stats.class.php"; -include_once DOL_DOCUMENT_ROOT . "/adherents/class/cotisation.class.php"; +include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php'; +include_once DOL_DOCUMENT_ROOT . '/adherents/class/cotisation.class.php'; /** diff --git a/htdocs/adherents/class/cotisation.class.php b/htdocs/adherents/class/cotisation.class.php index eb4624a4c40..75d2ffe2722 100644 --- a/htdocs/adherents/class/cotisation.class.php +++ b/htdocs/adherents/class/cotisation.class.php @@ -22,7 +22,7 @@ * \brief File of class to manage subscriptions of foundation members */ -require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; /** @@ -198,7 +198,7 @@ class Cotisation extends CommonObject // It subscription is linked to a bank transaction, we get it if ($this->fk_bank) { - require_once(DOL_DOCUMENT_ROOT."/compta/bank/class/account.class.php"); + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $accountline=new AccountLine($this->db); $result=$accountline->fetch($this->fk_bank); } @@ -213,7 +213,7 @@ class Cotisation extends CommonObject $num=$this->db->affected_rows($resql); if ($num) { - require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"); + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $member=new Adherent($this->db); $result=$member->fetch($this->fk_adherent); $result=$member->update_end_date($user); diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index ee05be2e5ba..b0a75427697 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -23,10 +23,10 @@ * \brief Page de consultation et insertion d'une cotisation */ -require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/cotisation.class.php"); -require_once(DOL_DOCUMENT_ROOT."/compta/bank/class/account.class.php"); +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/cotisation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("members"); diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 37bdd7c150b..17b653d6a55 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -24,13 +24,13 @@ * \ingroup societe */ -require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/member.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/images.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php"); +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; $langs->load("members"); $langs->load("companies"); @@ -70,7 +70,7 @@ $upload_dir = $conf->adherent->dir_output . "/" . get_exdir($id,2,0,1) . '/' . $ // Envoie fichier if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) { - require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_add_file_process($upload_dir,0,1,'userfile'); } diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 77421bdf6c4..75a9c9a60cf 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -24,17 +24,17 @@ * \brief Page of member */ -require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/member.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/images.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/extrafields.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/class/cotisation.class.php"); -require_once(DOL_DOCUMENT_ROOT."/compta/bank/class/account.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php"); +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/cotisation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $langs->load("companies"); $langs->load("bills"); @@ -85,7 +85,7 @@ if ($rowid) } // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); +include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $hookmanager=new HookManager($db); $hookmanager->initHooks(array('membercard')); @@ -213,7 +213,7 @@ if ($action == 'confirm_sendinfo' && $confirm == 'yes') if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) { - require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $datenaiss=''; if (isset($_POST["naissday"]) && $_POST["naissday"] @@ -755,7 +755,7 @@ if ($action == 'create') // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - require_once(DOL_DOCUMENT_ROOT."/core/lib/security2.lib.php"); + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $generated_password=getRandomPassword(''); print '