diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php
index 5a7e6b9487137b78f60328c121804ee746731c70..c9f29fa967595f70a4be046f05f8d2f9431896ab 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 69f947f28be95417ae62f49e61b797edab5d1fc7..6bb6ae8f557fe125353cd48f424c15682699d471 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 7965113054678149953e171d8370d89b69ba658a..f33a72b91836adc77593de030acce7255dba02a6 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 21c07e36fc01ee336206ab6c971ab528465312ed..e0560bd3130ee7214b89e77d250f211725d77da9 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 ab3dc2758921f6e8f41b7d2fa96d31d2225de910..5a3b63bb89e8d78e17ad6764e01b56ba603771e4 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 0d0820d317604ed040581e97e7c7b44e6085120a..ec07af6971cf9c0dd66ade516fd34ebc09d33b57 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 242ab7faa88e1869f7a12c8b10f2b8544ebb68db..a6d965830545c5bc851acb74dcef7a0a8707e908 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 d1238d36bf008cbf267d76ebe0f5d93ebc6a87be..5fbf72869273dfd90135755b83d1bb937e623d90 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 490fa576aceb7938a6895a148d817cf0535d7f36..857bc2e4653c48d53ea993bae752faf27ba8463e 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 e056ff1831bb7ce6664852493d093f2a07888bc5..f412518c4a237a0d675f9f27672da58b2d9b5dea 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 4e20b9b57490ac06aa78c11aac38faa9e5047a5e..5f2570fe10c9dbf733e93808facd8ff17492ea63 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 dfa07932052c25fa8fff1b0359a812ef9da5451a..4fe5ea60f01e95ebfd3b9d6efcd1606b079bea13 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 0941f24ab190cd185e21d5e530e561a6f5a4225a..99881fe4d0eb3d9926f3a9ec4bf57d0370a08a91 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 d079205b492187d6ad45c13913f3a94280bddba6..37cb02a7fa16f3662b95b2153e1c8e2319e8feba 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 2a5c285c430d5d3319f4908f2ca164874b2ead6e..0b00d208133757abb466e69079a48f8c73e13072 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 baaea13e6c39ab7059e01d21250e89086d98ed4c..823b0a4bfd71dcd1dc5b2411df6ce3bb5143cbdb 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 ffd4450cae52b53a87b17de390fdb0d00297dc2b..4509242c973e89d7be88b38414b0c9d82bf04d72 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 6c8f33ffd8d839569a19573d5b5c569f914aba2a..a22039055c518dfde897da469390ed32740da2f0 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 f46cdfdca398b553d1616e3b28b2ffb8b095e109..631a4a4227ff2510892993228768e6fc5bf3b8f5 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 eff35c10b4a54272c6bf4a1536041ebdd7ed4957..46da21f7b29b9eef27e8f3b8892f8bf1f205eba0 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 173961fcc34174d9ad2a0094150c2d395017a842..9470972b35efe46fddc3bc367bf8566b3f28772b 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 36b07293dac924630d1a017450112bcc83a75d3b..64ac2ec3c2b6789bd5a05c8b995eccd9eb635305 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 6bd9416babe74ae8c4194ad1159784c97f2abad7..9a18a57c600ccc99aef740bc9fe94634b061304c 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 323362bc461acf586dd5ab56d2d14fd55dd01456..d5c7d8a087ca4189d658877ded764cfeb3d30e31 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 7803cc623b8212ff89ee085fd17bdefc7927d51b..c75a4cc4abe15c5d0151304db28db05286e4d7bd 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 b636f16ef52f9bb3d7b476091464196ab29ad795..94110b388bef6a836947502808a518919f4bcc8e 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 e55afc88f891658c19d6ec64966299d9716825c4..8c1fd75598cd0ca217a445bec295c6763dbc68d2 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 8438325594170b71f66b1d3b8329a74832f8aa77..b70a9a57a27859c1d372fafdbb25dae275185bb7 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 32f419e18d4111f9f30bc3ba76a96b656a94d564..64f0ff0888e9ad65b91ebed4e9053eb487a392a9 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 d3737d8996928473e04623b4b27b9173d2817e05..9999ba9d5ca5a3251fd811b5bf0d9d7f4c4615d7 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 43e41cbbc1dbbc1999ddc074def31badcd3ed87c..9ad8a6e9f903ebb559553fd9a5f0963ce4e241a4 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 d29bef9cb249b8974ee99845e2a44a84056a6bf8..7b7ec8307b45d7f6490dae19b94e0820abf004c1 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 7976c1c99863ae718065779a15efe590f6f458a4..e6f5c6ddd60d431e70a28f6ebe22eda6061451f2 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 86f5791dcea91802160abffb30dc477cbc910d8d..6aa523b18cc81a1d080b49236ce7b805933f2958 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 657822fdaecf81f554a3e3813085559c3d47c762..53177eefee9bdcc9ed17c89ec6bc433dc38b24fb 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 9ece4c3684b20559fc45586ada514fbe9007c907..ec22e3760df20eb36c8a3cd4bc43325675dbc956 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 1cf445502fdeb719ba56ced55f848d00e9e4be76..a4f1547c2bd8bcc4a2ac8e4b43f715c4b71db670 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 0acfc0790ad46c697657391996e7656a6bd99d0c..fa49c845bc8f4881e59e51661b1a31f8505750ab 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 8728440fcc6908ed7f3d086aace9cb816a3ae087..dd54452ce44b27e943cd93120eb37d09bb4846b0 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 613f25d6800994f3454d027d906ab731bdb06003..0fe04143c053b1c572215f708ea7efe0130a80d6 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 0d1a123c1d380625a8bfa1d9b0c93407730001a1..3a4b47c8cb58c8f736f2584d0f46e24fd9df131a 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 9334d648e77e2fe23507de2f6ac2a416a3b6ffbd..f27b5f9adfe3bec2da998dc05ab5f046930beae0 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 b822dd46fee7dfe725e88dd4d0ebd58268109d23..d3b54ce9fa18abacad1ee244299279f9fea85e9d 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 1dbb3155ac1ba94aac07964773e509f65e6d3d8c..210f75bbd071b5df3dacf9bfeead9e646a628e5f 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 60c9824a1faca2594fb1bcaa6e96ffc7d5a30abd..22dee45c8ff9ebd93434d78345b54daef4d3d43c 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 1afb7c4d215ef50481eab9b989c149030ea90ef2..308664136de731c56d8a6dfe1c4912dcf22e81d7 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 87198e9641c3b2c3325d9fa45bb7c8f13ca4be72..30ea097ca751567319e644d2fc658c9ac9bc70a8 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 c0510190c50d608d8aab93e520b0d08d4f80eda2..34af1fc11a7e29470b3a9ba5c546ba63081c464a 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 a00d3d4b8260cbd35627885b51b031d974586e67..1e8927490d725300067bc22f0f09fc60a118f162 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 a45779a4f5c46b567b25c9e82aa4f84e7d08b99d..6a0eabe0c6f8417a419739ab7e8efab433e72a1c 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 7a24697eb1aefdff599ef34d97ce4d838a494a5d..9f6170cc2c348f42b3d6be25837542c5758db243 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 9c5f89004f371acaa19ecd4ad8586811845a97e4..ac1109639a9a32ccf65bf1952fe1766045accd0d 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 f1a5d89f0eb93af8bd69ba33901183ea77b8cba6..d9a9e7671ffd316468da25821a07aea2315e75b0 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 2a2c726fad430178bbd75be020b49246cd8892dd..f1e70434f7afaf585f12cf7324150e44b5003f33 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 cae8d7d0c2d714010250f814244869a8f1a19da4..0b2dbd11328b7368afe6fd361b0ca61f3e92bed4 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 952efb9f25f81a2279025d30f7c53881ca3b3189..6a577ac8497c8921eb9281444b5307fddeb8a244 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 6b0cdf0d347f9aad1a84e852e0155c28ccb57fe8..9469866bc2a40af4ce7a309dfe60e0a429bd3a8c 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 0f9bce6998b33a460e1880bb4e84a4111b91e1f3..dfc6c2322f05c26fbb0c828c3405b2638c162d17 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 3f2e0bfb66070beb33be4241150824a969914994..d81c004c7d990ebea80e6ddc7530b8ee37d98a7c 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 a41779a9228718fd0644efd36f8f9bd42760b55a..df27f147dc418f2587a8cece40251cd76b61a3cc 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');