From 3f8d2cbef8dceb355c678cbd1de2dda0b6a5695d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Wed, 4 Jan 2012 21:23:50 +0100 Subject: [PATCH] Qual: Remove checkstyle warnings --- htdocs/cashdesk/class/Facturation.class.php | 4 +- htdocs/comm/action/class/ical.class.php | 2 +- htdocs/comm/action/fiche.php | 36 +- htdocs/comm/mailing/fiche.php | 7 +- .../class/paymentsocialcontribution.class.php | 93 ++-- htdocs/core/ajax/fileupload.php | 73 +++- htdocs/core/lib/company.lib.php | 3 +- htdocs/core/lib/phpbarcode.php | 13 +- htdocs/core/lib/sendings.lib.php | 2 +- htdocs/core/modules/action/rapport.pdf.php | 15 +- .../modules/fichinter/pdf_soleil.modules.php | 4 +- htdocs/core/modules/modAccounting.class.php | 6 +- htdocs/core/modules/modAdherent.class.php | 8 +- htdocs/core/modules/modAgenda.class.php | 6 +- htdocs/core/modules/modBanque.class.php | 12 +- htdocs/core/modules/modBarcode.class.php | 8 +- htdocs/core/modules/modBookmark.class.php | 6 +- htdocs/core/modules/modBoutique.class.php | 6 +- htdocs/core/modules/modCashDesk.class.php | 17 +- htdocs/core/modules/modCategorie.class.php | 20 +- htdocs/core/modules/modClickToDial.class.php | 22 +- htdocs/core/modules/modCommande.class.php | 20 +- htdocs/core/modules/modComptabilite.class.php | 22 +- htdocs/core/modules/modContrat.class.php | 20 +- htdocs/core/modules/modDeplacement.class.php | 12 +- htdocs/core/modules/modDocument.class.php | 20 +- htdocs/core/modules/modDon.class.php | 20 +- htdocs/core/modules/modECM.class.php | 19 +- htdocs/core/modules/modExpedition.class.php | 20 +- htdocs/core/modules/modExport.class.php | 18 +- htdocs/core/modules/modExternalRss.class.php | 18 +- htdocs/core/modules/modExternalSite.class.php | 19 +- htdocs/core/modules/modFTP.class.php | 19 +- htdocs/core/modules/modFacture.class.php | 15 +- htdocs/core/modules/modFckeditor.class.php | 20 +- htdocs/core/modules/modFicheinter.class.php | 22 +- htdocs/core/modules/modFournisseur.class.php | 398 +++++++++--------- htdocs/core/modules/modGeoIPMaxmind.class.php | 18 +- htdocs/core/modules/modGravatar.class.php | 20 +- htdocs/core/modules/modImport.class.php | 18 +- htdocs/core/modules/modLabel.class.php | 20 +- htdocs/core/modules/modLdap.class.php | 20 +- htdocs/core/modules/modMailing.class.php | 20 +- htdocs/core/modules/modNotification.class.php | 18 +- htdocs/core/modules/modPaybox.class.php | 20 +- htdocs/core/modules/modPaypal.class.php | 20 +- htdocs/core/modules/modPrelevement.class.php | 20 +- htdocs/core/modules/modProduct.class.php | 18 +- htdocs/core/modules/modProjet.class.php | 20 +- htdocs/core/modules/modPropale.class.php | 24 +- htdocs/core/modules/modService.class.php | 20 +- htdocs/core/modules/modSociete.class.php | 18 +- htdocs/core/modules/modStock.class.php | 20 +- htdocs/core/modules/modSyslog.class.php | 24 +- htdocs/core/modules/modTax.class.php | 342 +++++++-------- htdocs/core/modules/modUser.class.php | 21 +- htdocs/core/modules/modWebServices.class.php | 15 +- htdocs/core/modules/modWorkflow.class.php | 18 +- htdocs/product/stock/product.php | 42 +- test/phpunit/ModulesTest.php | 6 +- 60 files changed, 1002 insertions(+), 825 deletions(-) diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index 5a7e6b94871..c9f29fa9675 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -23,8 +23,8 @@ include_once(DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'); /** * Class ot manage invoices for pos module (cashdesk) */ -class Facturation { - +class Facturation +{ /** * Attributs "volatiles" : reinitialises apres chaque traitement d'un article * <p>Attributs "volatiles" : reinitialises apres chaque traitement d'un article</p> diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index 69f947f28be..6bb6ae8f557 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -64,7 +64,7 @@ class ical } /** - * Returns the number of ToDo + * Returns the number of to do * * @return int */ diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 79651130546..f33a72b9183 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -64,7 +64,7 @@ $contact = new Contact($db); if ($action == 'add_action') { $error=0; - + $backtopage=''; if (! empty($_POST["backtopage"])) $backtopage=$_POST["backtopage"]; if (! $backtopage) @@ -87,21 +87,8 @@ if ($action == 'add_action') $fulldayevent=$_POST["fullday"]; // Clean parameters - $datep=dol_mktime( - $fulldayevent?'00':$_POST["aphour"], - $fulldayevent?'00':$_POST["apmin"], - 0, - $_POST["apmonth"], - $_POST["apday"], - $_POST["apyear"]); - - $datef=dol_mktime( - $fulldayevent?'23':$_POST["p2hour"], - $fulldayevent?'59':$_POST["p2min"], - $fulldayevent?'59':'0', - $_POST["p2month"], - $_POST["p2day"], - $_POST["p2year"]); + $datep=dol_mktime($fulldayevent?'00':$_POST["aphour"], $fulldayevent?'00':$_POST["apmin"], 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); + $datef=dol_mktime($fulldayevent?'23':$_POST["p2hour"], $fulldayevent?'59':$_POST["p2min"], $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); // Check parameters if (! $datef && $_POST["percentage"] == 100) @@ -289,21 +276,8 @@ if ($action == 'update') $actioncomm = new Actioncomm($db); $actioncomm->fetch($id); - $datep=dol_mktime( - $fulldayevent?'00':$_POST["aphour"], - $fulldayevent?'00':$_POST["apmin"], - 0, - $_POST["apmonth"], - $_POST["apday"], - $_POST["apyear"]); - - $datef=dol_mktime( - $fulldayevent?'23':$_POST["p2hour"], - $fulldayevent?'59':$_POST["p2min"], - $fulldayevent?'59':'0', - $_POST["p2month"], - $_POST["p2day"], - $_POST["p2year"]); + $datep=dol_mktime($fulldayevent?'00':$_POST["aphour"], $fulldayevent?'00':$_POST["apmin"], 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); + $datef=dol_mktime($fulldayevent?'23':$_POST["p2hour"], $fulldayevent?'59':$_POST["p2min"], $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); $actioncomm->label = $_POST["label"]; $actioncomm->datep = $datep; diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 21c07e36fc0..e0560bd3130 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -209,9 +209,7 @@ if ($_REQUEST["action"] == 'sendallconfirmed' && $_REQUEST['confirm'] == 'yes') } // Fabrication du mail - $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, - $arr_file, $arr_mime, $arr_name, - '', '', 0, $msgishtml, $errorsto, $arr_css); + $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css); if ($mail->error) { @@ -342,8 +340,7 @@ if ($_POST["action"] == 'send' && empty($_POST["cancel"])) } } - $mailfile = new CMailFile($mil->sujet,$mil->sendto,$mil->email_from,$mil->body, - $arr_file,$arr_mime,$arr_name,'', '', 0, $msgishtml,$mil->email_errorsto,$arr_css); + $mailfile = new CMailFile($mil->sujet,$mil->sendto,$mil->email_from,$mil->body, $arr_file,$arr_mime,$arr_name,'', '', 0, $msgishtml,$mil->email_errorsto,$arr_css); $result=$mailfile->sendfile(); if ($result) diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index ab3dc275892..5a3b63bb89e 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -52,12 +52,11 @@ class PaymentSocialContribution extends CommonObject /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function PaymentSocialContribution($DB) + function PaymentSocialContribution($db) { - $this->db = $DB; - return 1; + $this->db = $db; } /** @@ -147,9 +146,10 @@ class PaymentSocialContribution extends CommonObject } /** - * \brief Load object in memory from database - * \param id id object - * \return int <0 if KO, >0 if OK + * Load object in memory from database + * + * @param int $id Id object + * @return int <0 if KO, >0 if OK */ function fetch($id) { @@ -216,10 +216,11 @@ class PaymentSocialContribution extends CommonObject /** - * \brief Update database - * \param user User that modify - * \param notrigger 0=launch triggers after, 1=disable triggers - * \return int <0 if KO, >0 if OK + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK */ function update($user=0, $notrigger=0) { @@ -302,10 +303,11 @@ class PaymentSocialContribution extends CommonObject /** - * \brief Delete object in database - * \param user User that delete - * \param notrigger 0=launch triggers after, 1=disable triggers - * \return int <0 if KO, >0 if OK + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK */ function delete($user, $notrigger=0) { @@ -371,9 +373,10 @@ class PaymentSocialContribution extends CommonObject /** - * \brief Load an object from its id and create a new one in database - * \param fromid Id of object to clone - * \return int New id of clone + * Load an object from its id and create a new one in database + * + * @param int $fromid Id of object to clone + * @return int New id of clone */ function createFromClone($fromid) { @@ -454,13 +457,14 @@ class PaymentSocialContribution extends CommonObject /** * Add record into bank for payment with links between this bank record and invoices of payment. * All payment properties must have been set first like after a call to create(). - * @param user Object of user making payment - * @param mode 'payment_sc' - * @param label Label to use in bank record - * @param accountid Id of bank account to do link with - * @param emetteur_nom Name of transmitter - * @param emetteur_banque Name of bank - * @return int <0 if KO, >0 if OK + * + * @param User $user Object of user making payment + * @param string $mode 'payment_sc' + * @param string $label Label to use in bank record + * @param int $accountid Id of bank account to do link with + * @param string $emetteur_nom Name of transmitter + * @param string $emetteur_banque Name of bank + * @return int <0 if KO, >0 if OK */ function addPaymentToBank($user,$mode,$label,$accountid,$emetteur_nom,$emetteur_banque) { @@ -479,15 +483,17 @@ class PaymentSocialContribution extends CommonObject if ($mode == 'payment_sc') $total=-$total; // Insert payment into llx_bank - $bank_line_id = $acc->addline($this->datepaye, - $this->paiementtype, // Payment mode id or code ("CHQ or VIR for example") - $label, - $total, - $this->num_paiement, - '', - $user, - $emetteur_nom, - $emetteur_banque); + $bank_line_id = $acc->addline( + $this->datepaye, + $this->paiementtype, // Payment mode id or code ("CHQ or VIR for example") + $label, + $total, + $this->num_paiement, + '', + $user, + $emetteur_nom, + $emetteur_banque + ); // Mise a jour fk_bank dans llx_paiement. // On connait ainsi le paiement qui a genere l'ecriture bancaire @@ -521,8 +527,7 @@ class PaymentSocialContribution extends CommonObject { $socialcontrib = new ChargeSociales($this->db); $socialcontrib->fetch($key); - $result=$acc->add_url_line($bank_line_id, $socialcontrib->id, - DOL_URL_ROOT.'/compta/charges.php?id=', $socialcontrib->type_libelle.(($socialcontrib->lib && $socialcontrib->lib!=$socialcontrib->type_libelle)?' ('.$socialcontrib->lib.')':''),'sc'); + $result=$acc->add_url_line($bank_line_id, $socialcontrib->id, DOL_URL_ROOT.'/compta/charges.php?id=', $socialcontrib->type_libelle.(($socialcontrib->lib && $socialcontrib->lib!=$socialcontrib->type_libelle)?' ('.$socialcontrib->lib.')':''),'sc'); if ($result <= 0) dol_print_error($this->db); } } @@ -546,9 +551,10 @@ class PaymentSocialContribution extends CommonObject /** - * \brief Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank generee - * \param id_bank Id de la banque - * \return int >0 si OK, <=0 si KO + * Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank generee + * + * @param int $id_bank Id if bank + * @return int >0 if OK, <=0 if KO */ function update_fk_bank($id_bank) { @@ -569,10 +575,11 @@ class PaymentSocialContribution extends CommonObject } /** - * \brief Renvoie nom clicable (avec eventuellement le picto) - * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul - * \param maxlen Longueur max libelle - * \return string Chaine avec URL + * Renvoie nom clicable (avec eventuellement le picto) + * + * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul + * @param int $maxlen Longueur max libelle + * @return string Chaine avec URL */ function getNomUrl($withpicto=0,$maxlen=0) { diff --git a/htdocs/core/ajax/fileupload.php b/htdocs/core/ajax/fileupload.php index 0d0820d3176..ec07af6971c 100644 --- a/htdocs/core/ajax/fileupload.php +++ b/htdocs/core/ajax/fileupload.php @@ -56,7 +56,15 @@ class UploadHandler private $fk_elment; private $element; - function __construct($options=null,$fk_element=null,$element=null) { + /** + * Constructor + * + * @param array $options Options array + * @param int $fk_element fk_element + * @param string $element element + */ + function __construct($options=null,$fk_element=null,$element=null) + { global $conf; @@ -96,9 +104,17 @@ class UploadHandler } } - private function get_file_object($file_name) { + /** + * Enter description here ... + * + * @param string $file_name + * @return stdClass|NULL + */ + private function get_file_object($file_name) + { $file_path = $this->options['upload_dir'].$file_name; - if (is_file($file_path) && $file_name[0] !== '.') { + if (is_file($file_path) && $file_name[0] !== '.') + { $file = new stdClass(); $file->name = $file_name; $file->mime = dol_mimetype($file_name,'',2); @@ -118,7 +134,11 @@ class UploadHandler return null; } - private function get_file_objects() { + /** + * Enter description here ... + */ + private function get_file_objects() + { return array_values(array_filter(array_map( array($this, 'get_file_object'), scandir($this->options['upload_dir']) @@ -129,7 +149,8 @@ class UploadHandler * Create thumbs * options is array('max_width', 'max_height') */ - private function create_scaled_image($file_name, $options) { + private function create_scaled_image($file_name, $options) + { global $maxwidthmini, $maxheightmini; $file_path = $this->options['upload_dir'].$file_name; $new_file_path = $options['upload_dir'].$file_name; @@ -153,7 +174,16 @@ class UploadHandler } } - private function has_error($uploaded_file, $file, $error) { + /** + * Enter description here ... + * + * @param unknown_type $uploaded_file + * @param unknown_type $file + * @param unknown_type $error + * @return unknown|string + */ + private function has_error($uploaded_file, $file, $error) + { if ($error) { return $error; } @@ -183,7 +213,18 @@ class UploadHandler return $error; } - private function handle_file_upload($uploaded_file, $name, $size, $type, $error) { + /** + * Enter description here ... + * + * @param unknown_type $uploaded_file + * @param unknown_type $name + * @param unknown_type $size + * @param unknown_type $type + * @param unknown_type $error + * @return stdClass + */ + private function handle_file_upload($uploaded_file, $name, $size, $type, $error) + { $file = new stdClass(); $file->name = basename(stripslashes($name)); $file->mime = dol_mimetype($file->name,'',2); @@ -242,7 +283,11 @@ class UploadHandler return $file; } - public function get() { + /** + * Enter description here ... + */ + public function get() + { $file_name = isset($_REQUEST['file']) ? basename(stripslashes($_REQUEST['file'])) : null; if ($file_name) { @@ -254,7 +299,11 @@ class UploadHandler echo json_encode($info); } - public function post() { + /** + * Enter description here ... + */ + public function post() + { $upload = isset($_FILES[$this->options['param_name']]) ? $_FILES[$this->options['param_name']] : array( 'tmp_name' => null, @@ -299,7 +348,11 @@ class UploadHandler echo json_encode($info); } - public function delete() { + /** + * Enter description here ... + */ + public function delete() + { $file_name = isset($_REQUEST['file']) ? basename(stripslashes($_REQUEST['file'])) : null; $file_path = $this->options['upload_dir'].$file_name; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 242ab7faa88..a6d96583054 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -111,7 +111,6 @@ function societe_prepare_head($object) $head[$h][2] = 'notify'; $h++; } - } // Log @@ -130,7 +129,7 @@ function societe_prepare_head($object) * Return array of tabs to used on page * * @param Object $object Object for tabs - * @return + * @return array Array of tabs */ function societe_prepare_head2($object) { diff --git a/htdocs/core/lib/phpbarcode.php b/htdocs/core/lib/phpbarcode.php index d1238d36bf0..5fbf7286927 100644 --- a/htdocs/core/lib/phpbarcode.php +++ b/htdocs/core/lib/phpbarcode.php @@ -177,7 +177,8 @@ function barcode_encode($code,$encoding) function barcode_gen_ean_sum($ean) { $even=true; $esum=0; $osum=0; - for ($i=strlen($ean)-1;$i>=0;$i--) + $ln=strlen($ean)-1; + for ($i=$ln; $i>=0; $i--) { if ($even) $esum+=$ean[$i]; else $osum+=$ean[$i]; $even=!$even; @@ -324,15 +325,16 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, /* set defaults */ if ($scale<1) $scale=2; - $total_y=(int)($total_y); - if ($total_y<1) $total_y=(int)$scale * 60; + $total_y=(int) $total_y; + if ($total_y<1) $total_y=(int) $scale * 60; if (!$space) $space=array('top'=>2*$scale,'bottom'=>2*$scale,'left'=>2*$scale,'right'=>2*$scale); /* count total width */ $xpos=0; $width=true; - for ($i=0;$i<strlen($bars);$i++) + $ln=strlen($bars); + for ($i=0; $i<$ln; $i++) { $val=strtolower($bars[$i]); if ($width) @@ -368,7 +370,8 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, /* paint the bars */ $width=true; - for ($i=0;$i<strlen($bars);$i++) + $ln=strlen($bars); + for ($i=0; $i<$ln; $i++) { $val=strtolower($bars[$i]); if ($width) diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 490fa576ace..857bc2e4653 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -95,7 +95,7 @@ function delivery_prepare_head($object) * @param string $origin Origin * @param int $origin_id Origin id * @param string $filter Filter - * @return + * @return int <0 if KO, >0 if OK */ function show_list_sending_receive($origin='commande',$origin_id,$filter='') { diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index e056ff1831b..f412518c4a2 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -168,7 +168,7 @@ class CommActionRapport $sql.= " AND '".$this->db->idate(dol_get_last_day($this->year,$this->month,false))."'"; $sql.= " ORDER BY a.datep DESC"; - dol_syslog("Rapport.pdf::_page sql=".$sql); + dol_syslog(get_class($this)."::_page sql=".$sql); $resql=$this->db->query($sql); if ($resql) { @@ -224,11 +224,12 @@ class CommActionRapport } /** - * Show page head + * Show page head * - * @param pdf Objet PDF - * @param outputlangs Objet lang cible - * @param pagenb Page nb + * @param PDF $pdf Objet PDF + * @param Translate $outputlangs Objet lang cible + * @param int $pagenb Page nb + * @return int Pos y */ function _pagehead(&$pdf, $outputlangs, $pagenb) { @@ -253,9 +254,7 @@ class CommActionRapport $y=$pdf->GetY()+2; - $pdf->Rect($this->marge_gauche, $y, - $this->page_largeur - $this->marge_gauche - $this->marge_droite, - $this->page_hauteur - $this->marge_haute - $this->marge_basse); + $pdf->Rect($this->marge_gauche, $y, ($this->page_largeur - $this->marge_gauche - $this->marge_droite), ($this->page_hauteur - $this->marge_haute - $this->marge_basse)); $y=$pdf->GetY()+1; return $y; diff --git a/htdocs/core/modules/fichinter/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/pdf_soleil.modules.php index 4e20b9b5749..5f2570fe10c 100644 --- a/htdocs/core/modules/fichinter/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/pdf_soleil.modules.php @@ -313,8 +313,8 @@ class pdf_soleil extends ModelePDFFicheinter $curY = $nexY+3; $pdf->SetXY($this->marge_gauche, $curY); - $pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, - dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($fichinterligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".ConvertSecondToTime($fichinterligne->duration),1,$outputlangs->charset_output), 0, 1, 0); + $txt=dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($fichinterligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".ConvertSecondToTime($fichinterligne->duration),1,$outputlangs->charset_output); + $pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $txt, 0, 1, 0); $nexY = $pdf->GetY(); $pdf->SetXY($this->marge_gauche, $curY + 3); diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index dfa07932052..4fe5ea60f01 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -39,13 +39,13 @@ class modAccounting extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modAccounting($DB) + function modAccounting($db) { global $conf; - $this->db = $DB ; + $this->db = $db; $this->numero = 50400 ; $this->family = "financial"; diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 0941f24ab19..99881fe4d0e 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -39,12 +39,12 @@ class modAdherent extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modAdherent($DB) + function modAdherent($db) { - $this->db = $DB; - $this->numero = 310 ; + $this->db = $db; + $this->numero = 310; $this->family = "hr"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index d079205b492..37cb02a7fa1 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -39,11 +39,11 @@ class modAgenda extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modAgenda($DB) + function modAgenda($db) { - $this->db = $DB; + $this->db = $db; $this->numero = 2400; $this->family = "projects"; diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index 2a5c285c430..0b00d208133 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -41,14 +41,14 @@ class modBanque extends DolibarrModules /** * Constructor. * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modBanque($DB) + function modBanque($db) { global $conf; - $this->db = $DB ; - $this->numero = 85 ; + $this->db = $db; + $this->numero = 85; $this->family = "financial"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -168,7 +168,7 @@ class modBanque extends DolibarrModules * 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. - * + * * @return int 1 if OK, 0 if KO */ function init() @@ -187,7 +187,7 @@ class modBanque extends DolibarrModules * Function called when module is disabled. * Remove from database constants, boxes and permissions from Dolibarr database. * Data directories are not deleted. - * + * * @return int 1 if OK, 0 if KO */ function remove() diff --git a/htdocs/core/modules/modBarcode.class.php b/htdocs/core/modules/modBarcode.class.php index baaea13e6c3..823b0a4bfd7 100644 --- a/htdocs/core/modules/modBarcode.class.php +++ b/htdocs/core/modules/modBarcode.class.php @@ -38,12 +38,12 @@ class modBarcode extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modBarcode($DB) + function modBarcode($db) { - $this->db = $DB ; - $this->numero = 55 ; + $this->db = $db; + $this->numero = 55; $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) diff --git a/htdocs/core/modules/modBookmark.class.php b/htdocs/core/modules/modBookmark.class.php index ffd4450cae5..4509242c973 100644 --- a/htdocs/core/modules/modBookmark.class.php +++ b/htdocs/core/modules/modBookmark.class.php @@ -38,11 +38,11 @@ class modBookmark extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modBookmark($DB) + function modBookmark($db) { - $this->db = $DB ; + $this->db = $db; $this->numero = 330; $this->family = "technic"; diff --git a/htdocs/core/modules/modBoutique.class.php b/htdocs/core/modules/modBoutique.class.php index 6c8f33ffd8d..a22039055c5 100644 --- a/htdocs/core/modules/modBoutique.class.php +++ b/htdocs/core/modules/modBoutique.class.php @@ -39,11 +39,11 @@ class modBoutique extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modBoutique($DB) + function modBoutique($db) { - $this->db = $DB ; + $this->db = $db; $this->numero = 800; $this->family = "products"; diff --git a/htdocs/core/modules/modCashDesk.class.php b/htdocs/core/modules/modCashDesk.class.php index f46cdfdca39..631a4a4227f 100644 --- a/htdocs/core/modules/modCashDesk.class.php +++ b/htdocs/core/modules/modCashDesk.class.php @@ -34,11 +34,11 @@ class modCashDesk extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modCashDesk ($DB) + function modCashDesk ($db) { - $this->db = $DB; + $this->db = $db; // Id for module (must be unique). // Use here a free id (See in Home -> System information -> Dolibarr for list of used module id). @@ -127,11 +127,12 @@ class modCashDesk extends DolibarrModules /** - * 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. - * - * @return int 1 if OK, 0 if KO + * 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='') { diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index eff35c10b4a..46da21f7b29 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -35,11 +35,11 @@ class modCategorie extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modCategorie ($DB) + function modCategorie($db) { - $this->db = $DB; + $this->db = $db; $this->numero = 1780; $this->family = "technic"; @@ -156,19 +156,21 @@ class modCategorie extends DolibarrModules /** - * 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. - * @return int 1 if OK, 0 if KO + * 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() + function init($options='') { // Permissions $this->remove(); $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modClickToDial.class.php b/htdocs/core/modules/modClickToDial.class.php index 173961fcc34..9470972b35e 100644 --- a/htdocs/core/modules/modClickToDial.class.php +++ b/htdocs/core/modules/modClickToDial.class.php @@ -38,12 +38,12 @@ class modClickToDial extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modClickToDial($DB) + function modClickToDial($db) { - $this->db = $DB ; - $this->numero = 58 ; + $this->db = $db; + $this->numero = 58; $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) @@ -78,18 +78,20 @@ class modClickToDial extends DolibarrModules } /** - * \brief 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. - * \return int 1 if OK, 0 if KO + * 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() + function init($options='') { global $conf; $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 36b07293dac..64ac2ec3c2b 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -41,14 +41,14 @@ class modCommande extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modCommande($DB) + function modCommande($db) { global $conf; - $this->db = $DB ; - $this->numero = 25 ; + $this->db = $db; + $this->numero = 25; $this->family = "crm"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -178,10 +178,14 @@ class modCommande extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { global $conf; @@ -193,7 +197,7 @@ class modCommande extends DolibarrModules "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES('".$this->const[0][2]."','order')" ); - return $this->_init($sql); + return $this->_init($sql,$options); } diff --git a/htdocs/core/modules/modComptabilite.class.php b/htdocs/core/modules/modComptabilite.class.php index 6bd9416babe..9a18a57c600 100644 --- a/htdocs/core/modules/modComptabilite.class.php +++ b/htdocs/core/modules/modComptabilite.class.php @@ -39,14 +39,14 @@ class modComptabilite extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modComptabilite($DB) + function modComptabilite($db) { global $conf; - $this->db = $DB ; - $this->numero = 10 ; + $this->db = $db; + $this->numero = 10; $this->family = "financial"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -122,10 +122,14 @@ class modComptabilite extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { global $conf; @@ -133,8 +137,8 @@ class modComptabilite extends DolibarrModules $this->remove(); $sql = array(); - - return $this->_init($sql); + + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index 323362bc461..d5c7d8a087c 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -39,12 +39,12 @@ class modContrat extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modContrat($DB) + function modContrat($db) { - $this->db = $DB ; - $this->numero = 54 ; + $this->db = $db; + $this->numero = 54; $this->family = "crm"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -119,10 +119,14 @@ class modContrat extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { global $conf; @@ -131,7 +135,7 @@ class modContrat extends DolibarrModules $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modDeplacement.class.php b/htdocs/core/modules/modDeplacement.class.php index 7803cc623b8..c75a4cc4abe 100644 --- a/htdocs/core/modules/modDeplacement.class.php +++ b/htdocs/core/modules/modDeplacement.class.php @@ -122,17 +122,21 @@ class modDeplacement extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { // Permissions $this->remove(); $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modDocument.class.php b/htdocs/core/modules/modDocument.class.php index b636f16ef52..94110b388be 100644 --- a/htdocs/core/modules/modDocument.class.php +++ b/htdocs/core/modules/modDocument.class.php @@ -39,12 +39,12 @@ class modDocument extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modDocument($DB) + function modDocument($db) { - $this->db = $DB ; - $this->numero = 51 ; + $this->db = $db; + $this->numero = 51; $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) @@ -98,10 +98,14 @@ class modDocument extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { global $conf; @@ -110,7 +114,7 @@ class modDocument extends DolibarrModules $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index e55afc88f89..8c1fd75598c 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -38,12 +38,12 @@ class modDon extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modDon($DB) + function modDon($db) { - $this->db = $DB ; - $this->numero = 700 ; + $this->db = $db; + $this->numero = 700; $this->family = "financial"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -106,10 +106,14 @@ class modDon extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { global $conf; @@ -118,7 +122,7 @@ class modDon extends DolibarrModules "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','donation',".$conf->entity.")", ); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php index 84383255941..b70a9a57a27 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -35,11 +35,11 @@ class modECM extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modECM($DB) + function modECM($db) { - $this->db = $DB; + $this->db = $db; // Id for module (must be unique). // Use here a free id. @@ -186,15 +186,18 @@ class modECM extends DolibarrModules } /** - * \brief Function called when module is enabled. - * The init function add previous constants, boxes and permissions into Dolibarr database. - * It also creates data directories. + * 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() + function init($options='') { $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 32f419e18d4..64f0ff0888e 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -39,12 +39,12 @@ class modExpedition extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modExpedition($DB) + function modExpedition($db) { - $this->db = $DB ; - $this->numero = 80 ; + $this->db = $db; + $this->numero = 80; $this->family = "crm"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -192,10 +192,14 @@ class modExpedition extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { global $conf; @@ -211,7 +215,7 @@ class modExpedition extends DolibarrModules "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[1][2]."','delivery',".$conf->entity.")", ); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modExport.class.php b/htdocs/core/modules/modExport.class.php index d3737d89969..9999ba9d5ca 100644 --- a/htdocs/core/modules/modExport.class.php +++ b/htdocs/core/modules/modExport.class.php @@ -37,11 +37,11 @@ class modExport extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modExport($DB) + function modExport($db) { - $this->db = $DB ; + $this->db = $db; $this->numero = 240; $this->family = "technic"; @@ -92,14 +92,18 @@ class modExport extends DolibarrModules } /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modExternalRss.class.php b/htdocs/core/modules/modExternalRss.class.php index 43e41cbbc1d..9ad8a6e9f90 100644 --- a/htdocs/core/modules/modExternalRss.class.php +++ b/htdocs/core/modules/modExternalRss.class.php @@ -37,13 +37,13 @@ class modExternalRss extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modExternalRss($DB) + function modExternalRss($db) { global $conf; - $this->db = $DB ; + $this->db = $db; $this->numero = 320; $this->family = "technic"; @@ -80,10 +80,14 @@ class modExternalRss extends DolibarrModules } /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { global $conf; @@ -112,7 +116,7 @@ class modExternalRss extends DolibarrModules $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modExternalSite.class.php b/htdocs/core/modules/modExternalSite.class.php index d29bef9cb24..7b7ec8307b4 100644 --- a/htdocs/core/modules/modExternalSite.class.php +++ b/htdocs/core/modules/modExternalSite.class.php @@ -38,11 +38,11 @@ class modExternalSite extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modExternalSite($DB) + function modExternalSite($db) { - $this->db = $DB; + $this->db = $db; // Id for module (must be unique). // Use here a free id. @@ -115,15 +115,18 @@ class modExternalSite extends DolibarrModules } /** - * \brief Function called when module is enabled. - * The init function add previous constants, boxes and permissions into Dolibarr database. - * It also creates data directories. + * 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() + function init($options='') { $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modFTP.class.php b/htdocs/core/modules/modFTP.class.php index 7976c1c9986..e6f5c6ddd60 100644 --- a/htdocs/core/modules/modFTP.class.php +++ b/htdocs/core/modules/modFTP.class.php @@ -36,11 +36,11 @@ class modFTP extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modFTP($DB) + function modFTP($db) { - $this->db = $DB; + $this->db = $db; // Id for module (must be unique). // Use here a free id. @@ -128,15 +128,18 @@ class modFTP extends DolibarrModules } /** - * \brief Function called when module is enabled. - * The init function add previous constants, boxes and permissions into Dolibarr database. - * It also creates data directories. + * 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() + function init($options='') { $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 86f5791dcea..6aa523b18cc 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -39,13 +39,13 @@ class modFacture extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modFacture($DB) + function modFacture($db) { global $conf; - $this->db = $DB; + $this->db = $db; $this->numero = 30; $this->family = "financial"; @@ -203,9 +203,12 @@ class modFacture extends DolibarrModules /** - * Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. - * @param options Options when enabling module + * 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='') { diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index 657822fdaec..53177eefee9 100644 --- a/htdocs/core/modules/modFckeditor.class.php +++ b/htdocs/core/modules/modFckeditor.class.php @@ -38,12 +38,12 @@ class modFckeditor extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modFckeditor($DB) + function modFckeditor($db) { - $this->db = $DB ; - $this->numero = 2000 ; + $this->db = $db; + $this->numero = 2000; $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) @@ -81,16 +81,20 @@ class modFckeditor extends DolibarrModules } /** - * \brief Fonction appele lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { global $conf; $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modFicheinter.class.php b/htdocs/core/modules/modFicheinter.class.php index 9ece4c3684b..ec22e3760df 100644 --- a/htdocs/core/modules/modFicheinter.class.php +++ b/htdocs/core/modules/modFicheinter.class.php @@ -35,20 +35,20 @@ include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php"); * \class modFicheinter * \brief Classe de description et activation du module Ficheinter */ -class modFicheinter extends DolibarrModules +class modFicheinter extends DolibarrModules { /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modFicheinter($DB) + function modFicheinter($db) { global $conf; - $this->db = $DB ; - $this->numero = 70 ; + $this->db = $db; + $this->numero = 70; $this->family = "crm"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -152,10 +152,14 @@ class modFicheinter extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { global $conf; @@ -167,7 +171,7 @@ class modFicheinter extends DolibarrModules "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','ficheinter',".$conf->entity.")", ); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 1cf445502fd..a4f1547c2bd 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -37,14 +37,14 @@ class modFournisseur extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modFournisseur($DB) + function modFournisseur($db) { global $conf; - $this->db = $DB ; - $this->numero = 40 ; + $this->db = $db; + $this->numero = 40; $this->family = "products"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -66,203 +66,207 @@ class modFournisseur extends DolibarrModules "/fournisseur/facture/temp" ); - // Dependances - $this->depends = array("modSociete"); - $this->requiredby = array(); - $this->langfiles = array("bills","companies","suppliers"); - - // Config pages - $this->config_page_url = array("fournisseur.php"); - - // Constantes - $this->const = array(); - $r=0; - - $this->const[$r][0] = "COMMANDE_SUPPLIER_ADDON_PDF"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "muscadet"; - $r++; - - $this->const[$r][0] = "COMMANDE_SUPPLIER_ADDON"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mod_commande_fournisseur_muguet"; - $r++; - - $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_PDF"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "canelle"; - $r++; - - // Boxes - $this->boxes = array(); - $r=0; - - $this->boxes[$r][1] = "box_fournisseurs.php"; - $r++; - - $this->boxes[$r][1] = "box_factures_fourn_imp.php"; - $r++; - - $this->boxes[$r][1] = "box_factures_fourn.php"; - $r++; - - // Permissions - $this->rights = array(); - $this->rights_class = 'fournisseur'; - $r=0; - - $r++; - $this->rights[$r][0] = 1181; - $this->rights[$r][1] = 'Consulter les fournisseurs'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; - $this->rights[$r][4] = 'lire'; - - $r++; - $this->rights[$r][0] = 1182; - $this->rights[$r][1] = 'Consulter les commandes fournisseur'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; - $this->rights[$r][4] = 'commande'; - $this->rights[$r][5] = 'lire'; - - $r++; - $this->rights[$r][0] = 1183; - $this->rights[$r][1] = 'Creer une commande fournisseur'; - $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'commande'; - $this->rights[$r][5] = 'creer'; - - $r++; - $this->rights[$r][0] = 1184; - $this->rights[$r][1] = 'Valider une commande fournisseur'; - $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'commande'; - $this->rights[$r][5] = 'valider'; - - $r++; - $this->rights[$r][0] = 1185; - $this->rights[$r][1] = 'Approuver une commande fournisseur'; - $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'commande'; - $this->rights[$r][5] = 'approuver'; - - $r++; - $this->rights[$r][0] = 1186; - $this->rights[$r][1] = 'Commander une commande fournisseur'; - $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'commande'; - $this->rights[$r][5] = 'commander'; - - $r++; - $this->rights[$r][0] = 1187; - $this->rights[$r][1] = 'Receptionner une commande fournisseur'; - $this->rights[$r][2] = 'd'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'commande'; - $this->rights[$r][5] = 'receptionner'; - - $r++; - $this->rights[$r][0] = 1188; - $this->rights[$r][1] = 'Supprimer une commande fournisseur'; - $this->rights[$r][2] = 'd'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'commande'; - $this->rights[$r][5] = 'supprimer'; - - $r++; - $this->rights[$r][0] = 1231; - $this->rights[$r][1] = 'Consulter les factures fournisseur'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; - $this->rights[$r][4] = 'facture'; - $this->rights[$r][5] = 'lire'; - - $r++; - $this->rights[$r][0] = 1232; - $this->rights[$r][1] = 'Creer une facture fournisseur'; - $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'facture'; - $this->rights[$r][5] = 'creer'; - - $r++; - $this->rights[$r][0] = 1233; - $this->rights[$r][1] = 'Valider une facture fournisseur'; - $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'facture'; - $this->rights[$r][5] = 'valider'; - - $r++; - $this->rights[$r][0] = 1234; - $this->rights[$r][1] = 'Supprimer une facture fournisseur'; - $this->rights[$r][2] = 'd'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'facture'; - $this->rights[$r][5] = 'supprimer'; - - $r++; - $this->rights[$r][0] = 1235; - $this->rights[$r][1] = 'Envoyer les factures par mail'; - $this->rights[$r][2] = 'a'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'supplier_invoice_advance'; - $this->rights[$r][5] = 'send'; - - $r++; - $this->rights[$r][0] = 1236; - $this->rights[$r][1] = 'Exporter les factures fournisseurs, attributs et reglements'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'facture'; - $this->rights[$r][5] = 'export'; - - - // Exports - //-------- - $r=0; - - $r++; - $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Factures fournisseurs et lignes de facture'; - $this->export_icon[$r]='bill'; - $this->export_permission[$r]=array(array("fournisseur","facture","export")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product'); - - $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn as f, '.MAIN_DB_PREFIX.'facture_fourn_det as fd)'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; - $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn'; - $this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; - - $r++; - $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Factures fournisseurs et reglements'; - $this->export_icon[$r]='bill'; - $this->export_permission[$r]=array(array("fournisseur","facture","export")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber'); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); - - $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn as f)'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid'; - $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; + // Dependances + $this->depends = array("modSociete"); + $this->requiredby = array(); + $this->langfiles = array("bills","companies","suppliers"); + + // Config pages + $this->config_page_url = array("fournisseur.php"); + + // Constantes + $this->const = array(); + $r=0; + + $this->const[$r][0] = "COMMANDE_SUPPLIER_ADDON_PDF"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "muscadet"; + $r++; + + $this->const[$r][0] = "COMMANDE_SUPPLIER_ADDON"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "mod_commande_fournisseur_muguet"; + $r++; + + $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_PDF"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "canelle"; + $r++; + + // Boxes + $this->boxes = array(); + $r=0; + + $this->boxes[$r][1] = "box_fournisseurs.php"; + $r++; + + $this->boxes[$r][1] = "box_factures_fourn_imp.php"; + $r++; + + $this->boxes[$r][1] = "box_factures_fourn.php"; + $r++; + + // Permissions + $this->rights = array(); + $this->rights_class = 'fournisseur'; + $r=0; + + $r++; + $this->rights[$r][0] = 1181; + $this->rights[$r][1] = 'Consulter les fournisseurs'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'lire'; + + $r++; + $this->rights[$r][0] = 1182; + $this->rights[$r][1] = 'Consulter les commandes fournisseur'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'commande'; + $this->rights[$r][5] = 'lire'; + + $r++; + $this->rights[$r][0] = 1183; + $this->rights[$r][1] = 'Creer une commande fournisseur'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'commande'; + $this->rights[$r][5] = 'creer'; + + $r++; + $this->rights[$r][0] = 1184; + $this->rights[$r][1] = 'Valider une commande fournisseur'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'commande'; + $this->rights[$r][5] = 'valider'; + + $r++; + $this->rights[$r][0] = 1185; + $this->rights[$r][1] = 'Approuver une commande fournisseur'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'commande'; + $this->rights[$r][5] = 'approuver'; + + $r++; + $this->rights[$r][0] = 1186; + $this->rights[$r][1] = 'Commander une commande fournisseur'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'commande'; + $this->rights[$r][5] = 'commander'; + + $r++; + $this->rights[$r][0] = 1187; + $this->rights[$r][1] = 'Receptionner une commande fournisseur'; + $this->rights[$r][2] = 'd'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'commande'; + $this->rights[$r][5] = 'receptionner'; + + $r++; + $this->rights[$r][0] = 1188; + $this->rights[$r][1] = 'Supprimer une commande fournisseur'; + $this->rights[$r][2] = 'd'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'commande'; + $this->rights[$r][5] = 'supprimer'; + + $r++; + $this->rights[$r][0] = 1231; + $this->rights[$r][1] = 'Consulter les factures fournisseur'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'facture'; + $this->rights[$r][5] = 'lire'; + + $r++; + $this->rights[$r][0] = 1232; + $this->rights[$r][1] = 'Creer une facture fournisseur'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'facture'; + $this->rights[$r][5] = 'creer'; + + $r++; + $this->rights[$r][0] = 1233; + $this->rights[$r][1] = 'Valider une facture fournisseur'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'facture'; + $this->rights[$r][5] = 'valider'; + + $r++; + $this->rights[$r][0] = 1234; + $this->rights[$r][1] = 'Supprimer une facture fournisseur'; + $this->rights[$r][2] = 'd'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'facture'; + $this->rights[$r][5] = 'supprimer'; + + $r++; + $this->rights[$r][0] = 1235; + $this->rights[$r][1] = 'Envoyer les factures par mail'; + $this->rights[$r][2] = 'a'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'supplier_invoice_advance'; + $this->rights[$r][5] = 'send'; + + $r++; + $this->rights[$r][0] = 1236; + $this->rights[$r][1] = 'Exporter les factures fournisseurs, attributs et reglements'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'facture'; + $this->rights[$r][5] = 'export'; + + + // Exports + //-------- + $r=0; + + $r++; + $this->export_code[$r]=$this->rights_class.'_'.$r; + $this->export_label[$r]='Factures fournisseurs et lignes de facture'; + $this->export_icon[$r]='bill'; + $this->export_permission[$r]=array(array("fournisseur","facture","export")); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); + $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product'); + + $this->export_sql_start[$r]='SELECT DISTINCT '; + $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn as f, '.MAIN_DB_PREFIX.'facture_fourn_det as fd)'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; + $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn'; + $this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; + + $r++; + $this->export_code[$r]=$this->rights_class.'_'.$r; + $this->export_label[$r]='Factures fournisseurs et reglements'; + $this->export_icon[$r]='bill'; + $this->export_permission[$r]=array(array("fournisseur","facture","export")); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber'); + $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); + + $this->export_sql_start[$r]='SELECT DISTINCT '; + $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn as f)'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid'; + $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; + $this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; } /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { global $conf; @@ -273,7 +277,7 @@ class modFournisseur extends DolibarrModules "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','order_supplier',".$conf->entity.")", ); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modGeoIPMaxmind.class.php b/htdocs/core/modules/modGeoIPMaxmind.class.php index 0acfc0790ad..fa49c845bc8 100644 --- a/htdocs/core/modules/modGeoIPMaxmind.class.php +++ b/htdocs/core/modules/modGeoIPMaxmind.class.php @@ -35,11 +35,11 @@ class modGeoIPMaxmind extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modGeoIPMaxmind($DB) + function modGeoIPMaxmind($db) { - $this->db = $DB ; + $this->db = $db; $this->numero = 2900; // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' @@ -87,14 +87,18 @@ class modGeoIPMaxmind extends DolibarrModules } /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modGravatar.class.php b/htdocs/core/modules/modGravatar.class.php index 8728440fcc6..dd54452ce44 100644 --- a/htdocs/core/modules/modGravatar.class.php +++ b/htdocs/core/modules/modGravatar.class.php @@ -34,11 +34,11 @@ class modGravatar extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modGravatar($DB) + function modGravatar($db) { - $this->db = $DB; + $this->db = $db; // Id for module (must be unique). // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). @@ -181,18 +181,20 @@ class modGravatar extends DolibarrModules } /** - * \brief 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. - * \return int 1 if OK, 0 if KO + * 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() + function init($options='') { $sql = array(); $result=$this->load_tables(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modImport.class.php b/htdocs/core/modules/modImport.class.php index 613f25d6800..0fe04143c05 100644 --- a/htdocs/core/modules/modImport.class.php +++ b/htdocs/core/modules/modImport.class.php @@ -36,11 +36,11 @@ class modImport extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modImport($DB) + function modImport($db) { - $this->db = $DB ; + $this->db = $db; $this->numero = 250; $this->family = "technic"; @@ -87,14 +87,18 @@ class modImport extends DolibarrModules } /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modLabel.class.php b/htdocs/core/modules/modLabel.class.php index 0d1a123c1d3..3a4b47c8cb5 100644 --- a/htdocs/core/modules/modLabel.class.php +++ b/htdocs/core/modules/modLabel.class.php @@ -38,12 +38,12 @@ class modLabel extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modLabel($DB) + function modLabel($db) { - $this->db = $DB ; - $this->numero = 60 ; + $this->db = $db; + $this->numero = 60; $this->family = "other"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -93,17 +93,21 @@ class modLabel extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { // Permissions $this->remove(); $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modLdap.class.php b/htdocs/core/modules/modLdap.class.php index 9334d648e77..f27b5f9adfe 100644 --- a/htdocs/core/modules/modLdap.class.php +++ b/htdocs/core/modules/modLdap.class.php @@ -36,12 +36,12 @@ class modLdap extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modLdap($DB) + function modLdap($db) { - $this->db = $DB ; - $this->numero = 200 ; + $this->db = $db; + $this->numero = 200; $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) @@ -93,14 +93,18 @@ class modLdap extends DolibarrModules } /** - * \brief Fonction appele lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modMailing.class.php b/htdocs/core/modules/modMailing.class.php index b822dd46fee..d3b54ce9fa1 100644 --- a/htdocs/core/modules/modMailing.class.php +++ b/htdocs/core/modules/modMailing.class.php @@ -38,12 +38,12 @@ class modMailing extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modMailing($DB) + function modMailing($db) { - $this->db = $DB ; - $this->numero = 22 ; + $this->db = $db; + $this->numero = 22; $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) @@ -103,17 +103,21 @@ class modMailing extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { // Permissions $this->remove(); $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modNotification.class.php b/htdocs/core/modules/modNotification.class.php index 1dbb3155ac1..210f75bbd07 100644 --- a/htdocs/core/modules/modNotification.class.php +++ b/htdocs/core/modules/modNotification.class.php @@ -36,11 +36,11 @@ class modNotification extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modNotification($DB) + function modNotification($db) { - $this->db = $DB ; + $this->db = $db; $this->numero = 600; $this->family = "technic"; @@ -76,17 +76,21 @@ class modNotification extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { // Permissions $this->remove(); $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modPaybox.class.php b/htdocs/core/modules/modPaybox.class.php index 60c9824a1fa..22dee45c8ff 100644 --- a/htdocs/core/modules/modPaybox.class.php +++ b/htdocs/core/modules/modPaybox.class.php @@ -34,11 +34,11 @@ class modPayBox extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modPayBox($DB) + function modPayBox($db) { - $this->db = $DB; + $this->db = $db; // Id for module (must be unique). // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). @@ -177,18 +177,20 @@ class modPayBox extends DolibarrModules } /** - * \brief 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. - * \return int 1 if OK, 0 if KO + * 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() + function init($options='') { $sql = array(); $result=$this->load_tables(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modPaypal.class.php b/htdocs/core/modules/modPaypal.class.php index 1afb7c4d215..308664136de 100644 --- a/htdocs/core/modules/modPaypal.class.php +++ b/htdocs/core/modules/modPaypal.class.php @@ -35,11 +35,11 @@ class modPaypal extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modPaypal($DB) + function modPaypal($db) { - $this->db = $DB; + $this->db = $db; // Id for module (must be unique). // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). @@ -169,18 +169,20 @@ class modPaypal extends DolibarrModules } /** - * \brief 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. - * \return int 1 if OK, 0 if KO + * 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() + function init($options='') { $sql = array(); $result=$this->load_tables(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modPrelevement.class.php b/htdocs/core/modules/modPrelevement.class.php index 87198e9641c..30ea097ca75 100644 --- a/htdocs/core/modules/modPrelevement.class.php +++ b/htdocs/core/modules/modPrelevement.class.php @@ -39,14 +39,14 @@ class modPrelevement extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modPrelevement($DB) + function modPrelevement($db) { global $conf; - $this->db = $DB ; - $this->numero = 57 ; + $this->db = $db; + $this->numero = 57; $this->family = "financial"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -124,10 +124,14 @@ class modPrelevement extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { global $conf; @@ -136,7 +140,7 @@ class modPrelevement extends DolibarrModules $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index c0510190c50..34af1fc11a7 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -39,13 +39,13 @@ class modProduct extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modProduct($DB) + function modProduct($db) { global $conf; - $this->db = $DB; + $this->db = $db; $this->numero = 50; $this->family = "products"; @@ -160,17 +160,21 @@ class modProduct extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { // Permissions $this->remove(); $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index a00d3d4b826..1e8927490d7 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -40,12 +40,12 @@ class modProjet extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modProjet($DB) + function modProjet($db) { - $this->db = $DB ; - $this->numero = 400 ; + $this->db = $db; + $this->numero = 400; $this->family = "projects"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -140,10 +140,14 @@ class modProjet extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { global $conf; @@ -155,7 +159,7 @@ class modProjet extends DolibarrModules "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','project',".$conf->entity.")", ); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index a45779a4f5c..6a0eabe0c6f 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -41,14 +41,14 @@ class modPropale extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modPropale($DB) + function modPropale($db) { global $conf; - $this->db = $DB ; - $this->numero = 20 ; + $this->db = $db; + $this->numero = 20; $this->family = "crm"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -95,7 +95,7 @@ class modPropale extends DolibarrModules $this->const[$r][3] = 'Duration of validity of business proposals'; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "PROPALE_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/proposals"; @@ -181,16 +181,20 @@ class modPropale extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { global $conf; // Remove permissions and default values $this->remove(); - + //ODT template require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'); $dirodt=DOL_DATA_ROOT.'/doctemplates/proposals'; @@ -202,7 +206,7 @@ class modPropale extends DolibarrModules "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','propal',".$conf->entity.")", ); - return $this->_init($sql); + return $this->_init($sql,$options); } diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 7a24697eb1a..9f6170cc2c3 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -40,14 +40,14 @@ class modService extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modService($DB) + function modService($db) { global $conf; - $this->db = $DB ; - $this->numero = 53 ; + $this->db = $db; + $this->numero = 53; $this->family = "products"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -134,17 +134,21 @@ class modService extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { // Permissions et valeurs par defaut $this->remove(); $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 9c5f89004f3..ac1109639a9 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -40,14 +40,14 @@ class modSociete extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modSociete($DB) + function modSociete($db) { global $conf; - $this->db = $DB ; - $this->numero = 1 ; + $this->db = $db; + $this->numero = 1; $this->family = "crm"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -293,10 +293,12 @@ class modSociete extends DolibarrModules /** - * 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. - * @return int 1 if OK, 0 if KO + * 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='') { diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index f1a5d89f0eb..d9a9e7671ff 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -38,14 +38,14 @@ class modStock extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modStock($DB) + function modStock($db) { global $conf; - $this->db = $DB ; - $this->numero = 52 ; + $this->db = $db; + $this->numero = 52; $this->family = "products"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -133,14 +133,18 @@ class modStock extends DolibarrModules } /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index 2a2c726fad4..f1e70434f7a 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -36,12 +36,12 @@ class modSyslog extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modSyslog($DB) + function modSyslog($db) { - $this->db = $DB ; - $this->numero = 42 ; + $this->db = $db; + $this->numero = 42; // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page @@ -84,20 +84,24 @@ class modSyslog extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** - \brief Fonction appelee lors de la desactivation d'un module. - Supprime de la base les constantes, boites et permissions du module. + * \brief Fonction appelee lors de la desactivation d'un module. + * Supprime de la base les constantes, boites et permissions du module. */ function remove() { diff --git a/htdocs/core/modules/modTax.class.php b/htdocs/core/modules/modTax.class.php index cae8d7d0c2d..0b2dbd11328 100644 --- a/htdocs/core/modules/modTax.class.php +++ b/htdocs/core/modules/modTax.class.php @@ -1,168 +1,174 @@ -<?php -/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> - * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> - * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> - * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> - * - * 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 2 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 <http://www.gnu.org/licenses/>. - * or see http://www.gnu.org/ - */ - -/** - * \defgroup tax Module taxes - * \brief Module pour inclure des fonctions de saisies des taxes (tva) et charges sociales - * \file htdocs/core/modules/modTax.class.php - * \ingroup tax - * \brief Fichier de description et activation du module Taxe - */ - -include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php"); - - -/** - \class modTax - \brief Classe de description et activation du module Tax - */ -class modTax extends DolibarrModules -{ - - /** - * Constructor. Define names, constants, directories, boxes, permissions - * - * @param DoliDB $DB Database handler - */ - function modTax($DB) - { - global $conf; - - $this->db = $DB ; - $this->numero = 500 ; - - $this->family = "financial"; - // 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)); - // Module description used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) - $this->description = "Gestion des taxes, charges sociales et dividendes"; - - // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = 'dolibarr'; - - $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - $this->special = 0; - $this->picto='bill'; - - // Data directories to create when module is enabled - $this->dirs = array("/tax/temp"); - - // Config pages - $this->config_page_url = array("taxes.php"); - - // Dependances - $this->depends = array(); - $this->requiredby = array(); - $this->conflictwith = array(); - $this->langfiles = array("compta","bills"); - - // Constantes - $this->const = array(); - - // Boites - $this->boxes = array(); - - // Permissions - $this->rights = array(); - $this->rights_class = 'tax'; - $r=0; - - $r++; - $this->rights[$r][0] = 91; - $this->rights[$r][1] = 'Lire les charges'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; - $this->rights[$r][4] = 'charges'; - $this->rights[$r][5] = 'lire'; - - $r++; - $this->rights[$r][0] = 92; - $this->rights[$r][1] = 'Creer/modifier les charges'; - $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'charges'; - $this->rights[$r][5] = 'creer'; - - $r++; - $this->rights[$r][0] = 93; - $this->rights[$r][1] = 'Supprimer les charges'; - $this->rights[$r][2] = 'd'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'charges'; - $this->rights[$r][5] = 'supprimer'; - - $r++; - $this->rights[$r][0] = 94; - $this->rights[$r][1] = 'Exporter les charges'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'charges'; - $this->rights[$r][5] = 'export'; - - - // Exports - //-------- - $r=0; - - $r++; - $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Taxes et charges sociales, et leurs reglements'; - $this->export_permission[$r]=array(array("tax","charges","export")); - $this->export_fields_array[$r]=array('cc.libelle'=>"Type",'c.rowid'=>"IdSocialContribution",'c.libelle'=>"Label",'c.date_ech'=>'DateDue','c.periode'=>'Period','c.amount'=>"AmountExpected","c.paye"=>"Status",'p.rowid'=>'PaymentId','p.datep'=>'DatePayment','p.amount'=>'AmountPayment','p.num_paiement'=>'Numero'); - $this->export_entities_array[$r]=array('cc.libelle'=>"tax_type",'c.rowid'=>"tax",'c.libelle'=>'tax','c.date_ech'=>'tax','c.periode'=>'tax','c.amount'=>"tax","c.paye"=>"tax",'p.rowid'=>'payment','p.datep'=>'payment','p.amount'=>'payment','p.num_paiement'=>'payment'); - - $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'c_chargesociales as cc, '.MAIN_DB_PREFIX.'chargesociales as c'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementcharge as p ON p.fk_charge = c.rowid'; - $this->export_sql_end[$r] .=' WHERE c.fk_type = cc.id'; - $this->export_sql_end[$r] .=' AND c.entity = '.$conf->entity; - } - - - /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. - */ - function init() - { - global $conf; - - // Nettoyage avant activation - $this->remove(); - - $sql = array(); - - return $this->_init($sql); - } - - /** - * \brief Fonction appelee lors de la desactivation d'un module. - * Supprime de la base les constantes, boites et permissions du module. - */ - function remove() - { - $sql = array(); - - return $this->_remove($sql); - } -} -?> +<?php +/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> + * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> + * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> + * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> + * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> + * + * 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 2 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 <http://www.gnu.org/licenses/>. + * or see http://www.gnu.org/ + */ + +/** + * \defgroup tax Module taxes + * \brief Module pour inclure des fonctions de saisies des taxes (tva) et charges sociales + * \file htdocs/core/modules/modTax.class.php + * \ingroup tax + * \brief Fichier de description et activation du module Taxe + */ + +include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php"); + + +/** + * \class modTax + * \brief Classe de description et activation du module Tax + */ +class modTax extends DolibarrModules +{ + + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + function modTax($db) + { + global $conf; + + $this->db = $db; + $this->numero = 500; + + $this->family = "financial"; + // 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)); + // Module description used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) + $this->description = "Gestion des taxes, charges sociales et dividendes"; + + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; + + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + $this->special = 0; + $this->picto='bill'; + + // Data directories to create when module is enabled + $this->dirs = array("/tax/temp"); + + // Config pages + $this->config_page_url = array("taxes.php"); + + // Dependances + $this->depends = array(); + $this->requiredby = array(); + $this->conflictwith = array(); + $this->langfiles = array("compta","bills"); + + // Constantes + $this->const = array(); + + // Boites + $this->boxes = array(); + + // Permissions + $this->rights = array(); + $this->rights_class = 'tax'; + $r=0; + + $r++; + $this->rights[$r][0] = 91; + $this->rights[$r][1] = 'Lire les charges'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'charges'; + $this->rights[$r][5] = 'lire'; + + $r++; + $this->rights[$r][0] = 92; + $this->rights[$r][1] = 'Creer/modifier les charges'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'charges'; + $this->rights[$r][5] = 'creer'; + + $r++; + $this->rights[$r][0] = 93; + $this->rights[$r][1] = 'Supprimer les charges'; + $this->rights[$r][2] = 'd'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'charges'; + $this->rights[$r][5] = 'supprimer'; + + $r++; + $this->rights[$r][0] = 94; + $this->rights[$r][1] = 'Exporter les charges'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'charges'; + $this->rights[$r][5] = 'export'; + + + // Exports + //-------- + $r=0; + + $r++; + $this->export_code[$r]=$this->rights_class.'_'.$r; + $this->export_label[$r]='Taxes et charges sociales, et leurs reglements'; + $this->export_permission[$r]=array(array("tax","charges","export")); + $this->export_fields_array[$r]=array('cc.libelle'=>"Type",'c.rowid'=>"IdSocialContribution",'c.libelle'=>"Label",'c.date_ech'=>'DateDue','c.periode'=>'Period','c.amount'=>"AmountExpected","c.paye"=>"Status",'p.rowid'=>'PaymentId','p.datep'=>'DatePayment','p.amount'=>'AmountPayment','p.num_paiement'=>'Numero'); + $this->export_entities_array[$r]=array('cc.libelle'=>"tax_type",'c.rowid'=>"tax",'c.libelle'=>'tax','c.date_ech'=>'tax','c.periode'=>'tax','c.amount'=>"tax","c.paye"=>"tax",'p.rowid'=>'payment','p.datep'=>'payment','p.amount'=>'payment','p.num_paiement'=>'payment'); + + $this->export_sql_start[$r]='SELECT DISTINCT '; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'c_chargesociales as cc, '.MAIN_DB_PREFIX.'chargesociales as c'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementcharge as p ON p.fk_charge = c.rowid'; + $this->export_sql_end[$r] .=' WHERE c.fk_type = cc.id'; + $this->export_sql_end[$r] .=' AND c.entity = '.$conf->entity; + } + + + /** + * 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='') + { + global $conf; + + // Nettoyage avant activation + $this->remove(); + + $sql = array(); + + return $this->_init($sql,$options); + } + + /** + * Fonction appelee lors de la desactivation d'un module. + * Supprime de la base les constantes, boites et permissions du module. + * + * @return int 1 if OK, 0 if KO + */ + function remove() + { + $sql = array(); + + return $this->_remove($sql); + } +} +?> diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 952efb9f25f..6a577ac8497 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -37,13 +37,13 @@ class modUser extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modUser($DB) + function modUser($db) { global $conf; - $this->db = $DB ; + $this->db = $db; $this->numero = 0; $this->family = "base"; // Family for module (or "base" if core module) @@ -224,13 +224,14 @@ class modUser extends DolibarrModules /** - * 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. - * - * @return int 1 if OK, 0 if KO + * 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() + function init($options='') { global $conf; @@ -239,7 +240,7 @@ class modUser extends DolibarrModules $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$options); } /** diff --git a/htdocs/core/modules/modWebServices.class.php b/htdocs/core/modules/modWebServices.class.php index 6b0cdf0d347..9469866bc2a 100644 --- a/htdocs/core/modules/modWebServices.class.php +++ b/htdocs/core/modules/modWebServices.class.php @@ -36,11 +36,11 @@ class modWebServices extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modWebServices($DB) + function modWebServices($db) { - $this->db = $DB; + $this->db = $db; $this->numero = 2600; $this->family = "technic"; @@ -89,9 +89,12 @@ class modWebServices extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. - * \param options Options when enabling module + * 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='') { diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index 0f9bce6998b..dfc6c2322f0 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -37,11 +37,11 @@ class modWorkflow extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function modWorkflow($DB) + function modWorkflow($db) { - $this->db = $DB ; + $this->db = $db; // Id for module (must be unique). // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). @@ -141,17 +141,21 @@ class modWorkflow extends DolibarrModules /** - * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. - * Definit egalement les repertoires de donnees a creer pour ce module. + * 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() + function init($options='') { // Permissions $this->remove(); $sql = array(); - return $this->_init($sql); + return $this->_init($sql,$option); } /** diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 3f2e0bfb660..d81c004c7d9 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -76,12 +76,14 @@ if ($_POST["action"] == "correct_stock" && ! $_POST["cancel"]) $product = new Product($db); $result=$product->fetch($_GET["id"]); - $result=$product->correct_stock($user, - $_POST["id_entrepot"], - $_POST["nbpiece"], - $_POST["mouvement"], - $_POST["label"], - 0); // We do not change value of stock for a correction + $result=$product->correct_stock( + $user, + $_POST["id_entrepot"], + $_POST["nbpiece"], + $_POST["mouvement"], + $_POST["label"], + 0 + ); // We do not change value of stock for a correction if ($result > 0) { @@ -113,20 +115,24 @@ if ($_POST["action"] == "transfert_stock" && ! $_POST["cancel"]) //print 'price src='.$pricesrc.', price dest='.$pricedest;exit; // Remove stock - $result1=$product->correct_stock($user, - $_POST["id_entrepot_source"], - $_POST["nbpiece"], - 1, - $_POST["label"], - $pricesrc); + $result1=$product->correct_stock( + $user, + $_POST["id_entrepot_source"], + $_POST["nbpiece"], + 1, + $_POST["label"], + $pricesrc + ); // Add stock - $result2=$product->correct_stock($user, - $_POST["id_entrepot_destination"], - $_POST["nbpiece"], - 0, - $_POST["label"], - $pricedest); + $result2=$product->correct_stock( + $user, + $_POST["id_entrepot_destination"], + $_POST["nbpiece"], + 0, + $_POST["label"], + $pricedest + ); if ($result1 >= 0 && $result2 >= 0) { diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php index a41779a9228..df27f147dc4 100755 --- a/test/phpunit/ModulesTest.php +++ b/test/phpunit/ModulesTest.php @@ -118,10 +118,10 @@ class ModulesTest extends PHPUnit_Framework_TestCase $modulelist=array('Accounting','Adherent','Agenda','Banque','Barcode','Bookmark','Boutique', 'CashDesk','Categorie','ClickToDial','Commande','Comptabilite','Contrat','Deplacement','Document','Don', - 'ECM','Expedition','Export','ExternalRss','ExternalSite','FTP','Facture', - 'Fckeditor','Ficheinter','Fournisseur','GeoIPMaxmind','Gravatar','Import','Label','Ldap','Mailing', + 'ECM','Expedition','Export','ExternalRss','ExternalSite','Facture', + 'Fckeditor','Ficheinter','Fournisseur','FTP','GeoIPMaxmind','Gravatar','Import','Label','Ldap','Mailing', 'Notification','Paybox','Paypal','Prelevement','Product','Projet','Propale', - 'Service','Societe','Stock','Syslog','Tax','User','WebServices'); + 'Service','Societe','Stock','Syslog','Tax','User','WebServices','Workflow'); foreach($modulelist as $modlabel) { require_once(DOL_DOCUMENT_ROOT.'/core/modules/mod'.$modlabel.'.class.php'); -- GitLab