Qual: Remove checkstyle warnings

This commit is contained in:
Laurent Destailleur 2012-01-04 21:23:50 +01:00
parent 69c4cbd872
commit 3f8d2cbef8
60 changed files with 972 additions and 795 deletions

View File

@ -23,8 +23,8 @@ include_once(DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php');
/** /**
* Class ot manage invoices for pos module (cashdesk) * Class ot manage invoices for pos module (cashdesk)
*/ */
class Facturation { class Facturation
{
/** /**
* Attributs "volatiles" : reinitialises apres chaque traitement d'un article * Attributs "volatiles" : reinitialises apres chaque traitement d'un article
* <p>Attributs "volatiles" : reinitialises apres chaque traitement d'un article</p> * <p>Attributs "volatiles" : reinitialises apres chaque traitement d'un article</p>

View File

@ -64,7 +64,7 @@ class ical
} }
/** /**
* Returns the number of ToDo * Returns the number of to do
* *
* @return int * @return int
*/ */

View File

@ -87,21 +87,8 @@ if ($action == 'add_action')
$fulldayevent=$_POST["fullday"]; $fulldayevent=$_POST["fullday"];
// Clean parameters // Clean parameters
$datep=dol_mktime( $datep=dol_mktime($fulldayevent?'00':$_POST["aphour"], $fulldayevent?'00':$_POST["apmin"], 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
$fulldayevent?'00':$_POST["aphour"], $datef=dol_mktime($fulldayevent?'23':$_POST["p2hour"], $fulldayevent?'59':$_POST["p2min"], $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
$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 // Check parameters
if (! $datef && $_POST["percentage"] == 100) if (! $datef && $_POST["percentage"] == 100)
@ -289,21 +276,8 @@ if ($action == 'update')
$actioncomm = new Actioncomm($db); $actioncomm = new Actioncomm($db);
$actioncomm->fetch($id); $actioncomm->fetch($id);
$datep=dol_mktime( $datep=dol_mktime($fulldayevent?'00':$_POST["aphour"], $fulldayevent?'00':$_POST["apmin"], 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
$fulldayevent?'00':$_POST["aphour"], $datef=dol_mktime($fulldayevent?'23':$_POST["p2hour"], $fulldayevent?'59':$_POST["p2min"], $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
$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->label = $_POST["label"];
$actioncomm->datep = $datep; $actioncomm->datep = $datep;

View File

@ -209,9 +209,7 @@ if ($_REQUEST["action"] == 'sendallconfirmed' && $_REQUEST['confirm'] == 'yes')
} }
// Fabrication du mail // Fabrication du mail
$mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css);
$arr_file, $arr_mime, $arr_name,
'', '', 0, $msgishtml, $errorsto, $arr_css);
if ($mail->error) 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, $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);
$arr_file,$arr_mime,$arr_name,'', '', 0, $msgishtml,$mil->email_errorsto,$arr_css);
$result=$mailfile->sendfile(); $result=$mailfile->sendfile();
if ($result) if ($result)

View File

@ -52,12 +52,11 @@ class PaymentSocialContribution extends CommonObject
/** /**
* Constructor * Constructor
* *
* @param DoliDB $DB Database handler * @param DoliDB $db Database handler
*/ */
function PaymentSocialContribution($DB) function PaymentSocialContribution($db)
{ {
$this->db = $DB; $this->db = $db;
return 1;
} }
/** /**
@ -147,9 +146,10 @@ class PaymentSocialContribution extends CommonObject
} }
/** /**
* \brief Load object in memory from database * Load object in memory from database
* \param id id object *
* \return int <0 if KO, >0 if OK * @param int $id Id object
* @return int <0 if KO, >0 if OK
*/ */
function fetch($id) function fetch($id)
{ {
@ -216,10 +216,11 @@ class PaymentSocialContribution extends CommonObject
/** /**
* \brief Update database * Update database
* \param user User that modify *
* \param notrigger 0=launch triggers after, 1=disable triggers * @param User $user User that modify
* \return int <0 if KO, >0 if OK * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=0, $notrigger=0)
{ {
@ -302,10 +303,11 @@ class PaymentSocialContribution extends CommonObject
/** /**
* \brief Delete object in database * Delete object in database
* \param user User that delete *
* \param notrigger 0=launch triggers after, 1=disable triggers * @param User $user User that delete
* \return int <0 if KO, >0 if OK * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger=0) 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 * 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 * @param int $fromid Id of object to clone
* @return int New id of clone
*/ */
function createFromClone($fromid) 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. * 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(). * 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 User $user Object of user making payment
* @param label Label to use in bank record * @param string $mode 'payment_sc'
* @param accountid Id of bank account to do link with * @param string $label Label to use in bank record
* @param emetteur_nom Name of transmitter * @param int $accountid Id of bank account to do link with
* @param emetteur_banque Name of bank * @param string $emetteur_nom Name of transmitter
* @return int <0 if KO, >0 if OK * @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) function addPaymentToBank($user,$mode,$label,$accountid,$emetteur_nom,$emetteur_banque)
{ {
@ -479,15 +483,17 @@ class PaymentSocialContribution extends CommonObject
if ($mode == 'payment_sc') $total=-$total; if ($mode == 'payment_sc') $total=-$total;
// Insert payment into llx_bank // Insert payment into llx_bank
$bank_line_id = $acc->addline($this->datepaye, $bank_line_id = $acc->addline(
$this->paiementtype, // Payment mode id or code ("CHQ or VIR for example") $this->datepaye,
$label, $this->paiementtype, // Payment mode id or code ("CHQ or VIR for example")
$total, $label,
$this->num_paiement, $total,
'', $this->num_paiement,
$user, '',
$emetteur_nom, $user,
$emetteur_banque); $emetteur_nom,
$emetteur_banque
);
// Mise a jour fk_bank dans llx_paiement. // Mise a jour fk_bank dans llx_paiement.
// On connait ainsi le paiement qui a genere l'ecriture bancaire // 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 = new ChargeSociales($this->db);
$socialcontrib->fetch($key); $socialcontrib->fetch($key);
$result=$acc->add_url_line($bank_line_id, $socialcontrib->id, $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');
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); 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 * 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 * @param int $id_bank Id if bank
* @return int >0 if OK, <=0 if KO
*/ */
function update_fk_bank($id_bank) function update_fk_bank($id_bank)
{ {
@ -569,10 +575,11 @@ class PaymentSocialContribution extends CommonObject
} }
/** /**
* \brief Renvoie nom clicable (avec eventuellement le picto) * 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 * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* \return string Chaine avec URL * @param int $maxlen Longueur max libelle
* @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0,$maxlen=0) function getNomUrl($withpicto=0,$maxlen=0)
{ {

View File

@ -56,7 +56,15 @@ class UploadHandler
private $fk_elment; private $fk_elment;
private $element; 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; 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; $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 = new stdClass();
$file->name = $file_name; $file->name = $file_name;
$file->mime = dol_mimetype($file_name,'',2); $file->mime = dol_mimetype($file_name,'',2);
@ -118,7 +134,11 @@ class UploadHandler
return null; return null;
} }
private function get_file_objects() { /**
* Enter description here ...
*/
private function get_file_objects()
{
return array_values(array_filter(array_map( return array_values(array_filter(array_map(
array($this, 'get_file_object'), array($this, 'get_file_object'),
scandir($this->options['upload_dir']) scandir($this->options['upload_dir'])
@ -129,7 +149,8 @@ class UploadHandler
* Create thumbs * Create thumbs
* options is array('max_width', 'max_height') * 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; global $maxwidthmini, $maxheightmini;
$file_path = $this->options['upload_dir'].$file_name; $file_path = $this->options['upload_dir'].$file_name;
$new_file_path = $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) { if ($error) {
return $error; return $error;
} }
@ -183,7 +213,18 @@ class UploadHandler
return $error; 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 = new stdClass();
$file->name = basename(stripslashes($name)); $file->name = basename(stripslashes($name));
$file->mime = dol_mimetype($file->name,'',2); $file->mime = dol_mimetype($file->name,'',2);
@ -242,7 +283,11 @@ class UploadHandler
return $file; return $file;
} }
public function get() { /**
* Enter description here ...
*/
public function get()
{
$file_name = isset($_REQUEST['file']) ? $file_name = isset($_REQUEST['file']) ?
basename(stripslashes($_REQUEST['file'])) : null; basename(stripslashes($_REQUEST['file'])) : null;
if ($file_name) { if ($file_name) {
@ -254,7 +299,11 @@ class UploadHandler
echo json_encode($info); echo json_encode($info);
} }
public function post() { /**
* Enter description here ...
*/
public function post()
{
$upload = isset($_FILES[$this->options['param_name']]) ? $upload = isset($_FILES[$this->options['param_name']]) ?
$_FILES[$this->options['param_name']] : array( $_FILES[$this->options['param_name']] : array(
'tmp_name' => null, 'tmp_name' => null,
@ -299,7 +348,11 @@ class UploadHandler
echo json_encode($info); echo json_encode($info);
} }
public function delete() { /**
* Enter description here ...
*/
public function delete()
{
$file_name = isset($_REQUEST['file']) ? $file_name = isset($_REQUEST['file']) ?
basename(stripslashes($_REQUEST['file'])) : null; basename(stripslashes($_REQUEST['file'])) : null;
$file_path = $this->options['upload_dir'].$file_name; $file_path = $this->options['upload_dir'].$file_name;

View File

@ -111,7 +111,6 @@ function societe_prepare_head($object)
$head[$h][2] = 'notify'; $head[$h][2] = 'notify';
$h++; $h++;
} }
} }
// Log // Log
@ -130,7 +129,7 @@ function societe_prepare_head($object)
* Return array of tabs to used on page * Return array of tabs to used on page
* *
* @param Object $object Object for tabs * @param Object $object Object for tabs
* @return * @return array Array of tabs
*/ */
function societe_prepare_head2($object) function societe_prepare_head2($object)
{ {

View File

@ -177,7 +177,8 @@ function barcode_encode($code,$encoding)
function barcode_gen_ean_sum($ean) function barcode_gen_ean_sum($ean)
{ {
$even=true; $esum=0; $osum=0; $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]; if ($even) $esum+=$ean[$i]; else $osum+=$ean[$i];
$even=!$even; $even=!$even;
@ -324,15 +325,16 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0,
/* set defaults */ /* set defaults */
if ($scale<1) $scale=2; if ($scale<1) $scale=2;
$total_y=(int)($total_y); $total_y=(int) $total_y;
if ($total_y<1) $total_y=(int)$scale * 60; if ($total_y<1) $total_y=(int) $scale * 60;
if (!$space) if (!$space)
$space=array('top'=>2*$scale,'bottom'=>2*$scale,'left'=>2*$scale,'right'=>2*$scale); $space=array('top'=>2*$scale,'bottom'=>2*$scale,'left'=>2*$scale,'right'=>2*$scale);
/* count total width */ /* count total width */
$xpos=0; $xpos=0;
$width=true; $width=true;
for ($i=0;$i<strlen($bars);$i++) $ln=strlen($bars);
for ($i=0; $i<$ln; $i++)
{ {
$val=strtolower($bars[$i]); $val=strtolower($bars[$i]);
if ($width) if ($width)
@ -368,7 +370,8 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0,
/* paint the bars */ /* paint the bars */
$width=true; $width=true;
for ($i=0;$i<strlen($bars);$i++) $ln=strlen($bars);
for ($i=0; $i<$ln; $i++)
{ {
$val=strtolower($bars[$i]); $val=strtolower($bars[$i]);
if ($width) if ($width)

View File

@ -95,7 +95,7 @@ function delivery_prepare_head($object)
* @param string $origin Origin * @param string $origin Origin
* @param int $origin_id Origin id * @param int $origin_id Origin id
* @param string $filter Filter * @param string $filter Filter
* @return * @return int <0 if KO, >0 if OK
*/ */
function show_list_sending_receive($origin='commande',$origin_id,$filter='') function show_list_sending_receive($origin='commande',$origin_id,$filter='')
{ {

View File

@ -168,7 +168,7 @@ class CommActionRapport
$sql.= " AND '".$this->db->idate(dol_get_last_day($this->year,$this->month,false))."'"; $sql.= " AND '".$this->db->idate(dol_get_last_day($this->year,$this->month,false))."'";
$sql.= " ORDER BY a.datep DESC"; $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); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -224,11 +224,12 @@ class CommActionRapport
} }
/** /**
* Show page head * Show page head
* *
* @param pdf Objet PDF * @param PDF $pdf Objet PDF
* @param outputlangs Objet lang cible * @param Translate $outputlangs Objet lang cible
* @param pagenb Page nb * @param int $pagenb Page nb
* @return int Pos y
*/ */
function _pagehead(&$pdf, $outputlangs, $pagenb) function _pagehead(&$pdf, $outputlangs, $pagenb)
{ {
@ -253,9 +254,7 @@ class CommActionRapport
$y=$pdf->GetY()+2; $y=$pdf->GetY()+2;
$pdf->Rect($this->marge_gauche, $y, $pdf->Rect($this->marge_gauche, $y, ($this->page_largeur - $this->marge_gauche - $this->marge_droite), ($this->page_hauteur - $this->marge_haute - $this->marge_basse));
$this->page_largeur - $this->marge_gauche - $this->marge_droite,
$this->page_hauteur - $this->marge_haute - $this->marge_basse);
$y=$pdf->GetY()+1; $y=$pdf->GetY()+1;
return $y; return $y;

View File

@ -313,8 +313,8 @@ class pdf_soleil extends ModelePDFFicheinter
$curY = $nexY+3; $curY = $nexY+3;
$pdf->SetXY($this->marge_gauche, $curY); $pdf->SetXY($this->marge_gauche, $curY);
$pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $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);
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); $pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $txt, 0, 1, 0);
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
$pdf->SetXY($this->marge_gauche, $curY + 3); $pdf->SetXY($this->marge_gauche, $curY + 3);

View File

@ -39,13 +39,13 @@ class modAccounting extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 50400 ; $this->numero = 50400 ;
$this->family = "financial"; $this->family = "financial";

View File

@ -39,12 +39,12 @@ class modAdherent extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->db = $db;
$this->numero = 310 ; $this->numero = 310;
$this->family = "hr"; $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) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)

View File

@ -39,11 +39,11 @@ class modAgenda extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->numero = 2400;
$this->family = "projects"; $this->family = "projects";

View File

@ -41,14 +41,14 @@ class modBanque extends DolibarrModules
/** /**
* Constructor. * Constructor.
* *
* @param DoliDB $DB Database handler * @param DoliDB $db Database handler
*/ */
function modBanque($DB) function modBanque($db)
{ {
global $conf; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 85 ; $this->numero = 85;
$this->family = "financial"; $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) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)

View File

@ -38,12 +38,12 @@ class modBarcode extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->db = $db;
$this->numero = 55 ; $this->numero = 55;
$this->family = "technic"; $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) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)

View File

@ -38,11 +38,11 @@ class modBookmark extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->numero = 330;
$this->family = "technic"; $this->family = "technic";

View File

@ -39,11 +39,11 @@ class modBoutique extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->numero = 800;
$this->family = "products"; $this->family = "products";

View File

@ -34,11 +34,11 @@ class modCashDesk extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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). // Id for module (must be unique).
// Use here a free id (See in Home -> System information -> Dolibarr for list of used module id). // 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. * Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories. * It also creates data directories
* *
* @return int 1 if OK, 0 if KO * @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/ */
function init($options='') function init($options='')
{ {

View File

@ -35,11 +35,11 @@ class modCategorie extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->numero = 1780;
$this->family = "technic"; $this->family = "technic";
@ -156,19 +156,21 @@ class modCategorie extends DolibarrModules
/** /**
* Function called when module is enabled. * Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories. * It also creates data directories
* @return int 1 if OK, 0 if KO *
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/ */
function init() function init($options='')
{ {
// Permissions // Permissions
$this->remove(); $this->remove();
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -38,12 +38,12 @@ class modClickToDial extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->db = $db;
$this->numero = 58 ; $this->numero = 58;
$this->family = "technic"; $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) // 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. * Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories. * It also creates data directories
* \return int 1 if OK, 0 if KO *
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/ */
function init() function init($options='')
{ {
global $conf; global $conf;
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -41,14 +41,14 @@ class modCommande extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 25 ; $this->numero = 25;
$this->family = "crm"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; 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')" "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES('".$this->const[0][2]."','order')"
); );
return $this->_init($sql); return $this->_init($sql,$options);
} }

View File

@ -39,14 +39,14 @@ class modComptabilite extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 10 ; $this->numero = 10;
$this->family = "financial"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; global $conf;
@ -134,7 +138,7 @@ class modComptabilite extends DolibarrModules
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -39,12 +39,12 @@ class modContrat extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->db = $db;
$this->numero = 54 ; $this->numero = 54;
$this->family = "crm"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; global $conf;
@ -131,7 +135,7 @@ class modContrat extends DolibarrModules
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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 // Permissions
$this->remove(); $this->remove();
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -39,12 +39,12 @@ class modDocument extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->db = $db;
$this->numero = 51 ; $this->numero = 51;
$this->family = "technic"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; global $conf;
@ -110,7 +114,7 @@ class modDocument extends DolibarrModules
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }

View File

@ -38,12 +38,12 @@ class modDon extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->db = $db;
$this->numero = 700 ; $this->numero = 700;
$this->family = "financial"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; 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.")", "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);
} }
/** /**

View File

@ -35,11 +35,11 @@ class modECM extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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). // Id for module (must be unique).
// Use here a free id. // Use here a free id.
@ -186,15 +186,18 @@ class modECM extends DolibarrModules
} }
/** /**
* \brief Function called when module is enabled. * Function called when module is enabled.
* The init function add previous constants, boxes and permissions into Dolibarr database. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories. * 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(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -39,12 +39,12 @@ class modExpedition extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->db = $db;
$this->numero = 80 ; $this->numero = 80;
$this->family = "crm"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; 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.")", "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);
} }
/** /**

View File

@ -37,11 +37,11 @@ class modExport extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->numero = 240;
$this->family = "technic"; $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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -37,13 +37,13 @@ class modExternalRss extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 320; $this->numero = 320;
$this->family = "technic"; $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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; global $conf;
@ -112,7 +116,7 @@ class modExternalRss extends DolibarrModules
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -38,11 +38,11 @@ class modExternalSite extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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). // Id for module (must be unique).
// Use here a free id. // Use here a free id.
@ -115,15 +115,18 @@ class modExternalSite extends DolibarrModules
} }
/** /**
* \brief Function called when module is enabled. * Function called when module is enabled.
* The init function add previous constants, boxes and permissions into Dolibarr database. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories. * 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(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -36,11 +36,11 @@ class modFTP extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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). // Id for module (must be unique).
// Use here a free id. // Use here a free id.
@ -128,15 +128,18 @@ class modFTP extends DolibarrModules
} }
/** /**
* \brief Function called when module is enabled. * Function called when module is enabled.
* The init function add previous constants, boxes and permissions into Dolibarr database. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories. * 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(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -39,13 +39,13 @@ class modFacture extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB; $this->db = $db;
$this->numero = 30; $this->numero = 30;
$this->family = "financial"; $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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* @param options Options when enabling module * It also creates data directories
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/ */
function init($options='') function init($options='')
{ {

View File

@ -38,12 +38,12 @@ class modFckeditor extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->db = $db;
$this->numero = 2000 ; $this->numero = 2000;
$this->family = "technic"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; global $conf;
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -35,20 +35,20 @@ include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");
* \class modFicheinter * \class modFicheinter
* \brief Classe de description et activation du module Ficheinter * \brief Classe de description et activation du module Ficheinter
*/ */
class modFicheinter extends DolibarrModules class modFicheinter extends DolibarrModules
{ {
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 70 ; $this->numero = 70;
$this->family = "crm"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; 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.")", "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);
} }
/** /**

View File

@ -37,14 +37,14 @@ class modFournisseur extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 40 ; $this->numero = 40;
$this->family = "products"; $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) // 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" "/fournisseur/facture/temp"
); );
// Dependances // Dependances
$this->depends = array("modSociete"); $this->depends = array("modSociete");
$this->requiredby = array(); $this->requiredby = array();
$this->langfiles = array("bills","companies","suppliers"); $this->langfiles = array("bills","companies","suppliers");
// Config pages // Config pages
$this->config_page_url = array("fournisseur.php"); $this->config_page_url = array("fournisseur.php");
// Constantes // Constantes
$this->const = array(); $this->const = array();
$r=0; $r=0;
$this->const[$r][0] = "COMMANDE_SUPPLIER_ADDON_PDF"; $this->const[$r][0] = "COMMANDE_SUPPLIER_ADDON_PDF";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "muscadet"; $this->const[$r][2] = "muscadet";
$r++; $r++;
$this->const[$r][0] = "COMMANDE_SUPPLIER_ADDON"; $this->const[$r][0] = "COMMANDE_SUPPLIER_ADDON";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_commande_fournisseur_muguet"; $this->const[$r][2] = "mod_commande_fournisseur_muguet";
$r++; $r++;
$this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_PDF"; $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_PDF";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "canelle"; $this->const[$r][2] = "canelle";
$r++; $r++;
// Boxes // Boxes
$this->boxes = array(); $this->boxes = array();
$r=0; $r=0;
$this->boxes[$r][1] = "box_fournisseurs.php"; $this->boxes[$r][1] = "box_fournisseurs.php";
$r++; $r++;
$this->boxes[$r][1] = "box_factures_fourn_imp.php"; $this->boxes[$r][1] = "box_factures_fourn_imp.php";
$r++; $r++;
$this->boxes[$r][1] = "box_factures_fourn.php"; $this->boxes[$r][1] = "box_factures_fourn.php";
$r++; $r++;
// Permissions // Permissions
$this->rights = array(); $this->rights = array();
$this->rights_class = 'fournisseur'; $this->rights_class = 'fournisseur';
$r=0; $r=0;
$r++; $r++;
$this->rights[$r][0] = 1181; $this->rights[$r][0] = 1181;
$this->rights[$r][1] = 'Consulter les fournisseurs'; $this->rights[$r][1] = 'Consulter les fournisseurs';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1; $this->rights[$r][3] = 1;
$this->rights[$r][4] = 'lire'; $this->rights[$r][4] = 'lire';
$r++; $r++;
$this->rights[$r][0] = 1182; $this->rights[$r][0] = 1182;
$this->rights[$r][1] = 'Consulter les commandes fournisseur'; $this->rights[$r][1] = 'Consulter les commandes fournisseur';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1; $this->rights[$r][3] = 1;
$this->rights[$r][4] = 'commande'; $this->rights[$r][4] = 'commande';
$this->rights[$r][5] = 'lire'; $this->rights[$r][5] = 'lire';
$r++; $r++;
$this->rights[$r][0] = 1183; $this->rights[$r][0] = 1183;
$this->rights[$r][1] = 'Creer une commande fournisseur'; $this->rights[$r][1] = 'Creer une commande fournisseur';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'commande'; $this->rights[$r][4] = 'commande';
$this->rights[$r][5] = 'creer'; $this->rights[$r][5] = 'creer';
$r++; $r++;
$this->rights[$r][0] = 1184; $this->rights[$r][0] = 1184;
$this->rights[$r][1] = 'Valider une commande fournisseur'; $this->rights[$r][1] = 'Valider une commande fournisseur';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'commande'; $this->rights[$r][4] = 'commande';
$this->rights[$r][5] = 'valider'; $this->rights[$r][5] = 'valider';
$r++; $r++;
$this->rights[$r][0] = 1185; $this->rights[$r][0] = 1185;
$this->rights[$r][1] = 'Approuver une commande fournisseur'; $this->rights[$r][1] = 'Approuver une commande fournisseur';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'commande'; $this->rights[$r][4] = 'commande';
$this->rights[$r][5] = 'approuver'; $this->rights[$r][5] = 'approuver';
$r++; $r++;
$this->rights[$r][0] = 1186; $this->rights[$r][0] = 1186;
$this->rights[$r][1] = 'Commander une commande fournisseur'; $this->rights[$r][1] = 'Commander une commande fournisseur';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'commande'; $this->rights[$r][4] = 'commande';
$this->rights[$r][5] = 'commander'; $this->rights[$r][5] = 'commander';
$r++; $r++;
$this->rights[$r][0] = 1187; $this->rights[$r][0] = 1187;
$this->rights[$r][1] = 'Receptionner une commande fournisseur'; $this->rights[$r][1] = 'Receptionner une commande fournisseur';
$this->rights[$r][2] = 'd'; $this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'commande'; $this->rights[$r][4] = 'commande';
$this->rights[$r][5] = 'receptionner'; $this->rights[$r][5] = 'receptionner';
$r++; $r++;
$this->rights[$r][0] = 1188; $this->rights[$r][0] = 1188;
$this->rights[$r][1] = 'Supprimer une commande fournisseur'; $this->rights[$r][1] = 'Supprimer une commande fournisseur';
$this->rights[$r][2] = 'd'; $this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'commande'; $this->rights[$r][4] = 'commande';
$this->rights[$r][5] = 'supprimer'; $this->rights[$r][5] = 'supprimer';
$r++; $r++;
$this->rights[$r][0] = 1231; $this->rights[$r][0] = 1231;
$this->rights[$r][1] = 'Consulter les factures fournisseur'; $this->rights[$r][1] = 'Consulter les factures fournisseur';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1; $this->rights[$r][3] = 1;
$this->rights[$r][4] = 'facture'; $this->rights[$r][4] = 'facture';
$this->rights[$r][5] = 'lire'; $this->rights[$r][5] = 'lire';
$r++; $r++;
$this->rights[$r][0] = 1232; $this->rights[$r][0] = 1232;
$this->rights[$r][1] = 'Creer une facture fournisseur'; $this->rights[$r][1] = 'Creer une facture fournisseur';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'facture'; $this->rights[$r][4] = 'facture';
$this->rights[$r][5] = 'creer'; $this->rights[$r][5] = 'creer';
$r++; $r++;
$this->rights[$r][0] = 1233; $this->rights[$r][0] = 1233;
$this->rights[$r][1] = 'Valider une facture fournisseur'; $this->rights[$r][1] = 'Valider une facture fournisseur';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'facture'; $this->rights[$r][4] = 'facture';
$this->rights[$r][5] = 'valider'; $this->rights[$r][5] = 'valider';
$r++; $r++;
$this->rights[$r][0] = 1234; $this->rights[$r][0] = 1234;
$this->rights[$r][1] = 'Supprimer une facture fournisseur'; $this->rights[$r][1] = 'Supprimer une facture fournisseur';
$this->rights[$r][2] = 'd'; $this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'facture'; $this->rights[$r][4] = 'facture';
$this->rights[$r][5] = 'supprimer'; $this->rights[$r][5] = 'supprimer';
$r++; $r++;
$this->rights[$r][0] = 1235; $this->rights[$r][0] = 1235;
$this->rights[$r][1] = 'Envoyer les factures par mail'; $this->rights[$r][1] = 'Envoyer les factures par mail';
$this->rights[$r][2] = 'a'; $this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'supplier_invoice_advance'; $this->rights[$r][4] = 'supplier_invoice_advance';
$this->rights[$r][5] = 'send'; $this->rights[$r][5] = 'send';
$r++; $r++;
$this->rights[$r][0] = 1236; $this->rights[$r][0] = 1236;
$this->rights[$r][1] = 'Exporter les factures fournisseurs, attributs et reglements'; $this->rights[$r][1] = 'Exporter les factures fournisseurs, attributs et reglements';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'facture'; $this->rights[$r][4] = 'facture';
$this->rights[$r][5] = 'export'; $this->rights[$r][5] = 'export';
// Exports // Exports
//-------- //--------
$r=0; $r=0;
$r++; $r++;
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Factures fournisseurs et lignes de facture'; $this->export_label[$r]='Factures fournisseurs et lignes de facture';
$this->export_icon[$r]='bill'; $this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("fournisseur","facture","export")); $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_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_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_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] =' 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] .=' 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] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn';
$this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity;
$r++; $r++;
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Factures fournisseurs et reglements'; $this->export_label[$r]='Factures fournisseurs et reglements';
$this->export_icon[$r]='bill'; $this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("fournisseur","facture","export")); $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_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_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_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] =' 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_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] .=' 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] .=' WHERE f.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; $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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; 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.")", "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);
} }
/** /**

View File

@ -35,11 +35,11 @@ class modGeoIPMaxmind extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; $this->numero = 2900;
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -34,11 +34,11 @@ class modGravatar extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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). // Id for module (must be unique).
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). // 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. * Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories. * It also creates data directories
* \return int 1 if OK, 0 if KO *
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/ */
function init() function init($options='')
{ {
$sql = array(); $sql = array();
$result=$this->load_tables(); $result=$this->load_tables();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -36,11 +36,11 @@ class modImport extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->numero = 250;
$this->family = "technic"; $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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -38,12 +38,12 @@ class modLabel extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->db = $db;
$this->numero = 60 ; $this->numero = 60;
$this->family = "other"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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 // Permissions
$this->remove(); $this->remove();
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -36,12 +36,12 @@ class modLdap extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->db = $db;
$this->numero = 200 ; $this->numero = 200;
$this->family = "technic"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -38,12 +38,12 @@ class modMailing extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->db = $db;
$this->numero = 22 ; $this->numero = 22;
$this->family = "technic"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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 // Permissions
$this->remove(); $this->remove();
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -36,11 +36,11 @@ class modNotification extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->numero = 600;
$this->family = "technic"; $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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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 // Permissions
$this->remove(); $this->remove();
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -34,11 +34,11 @@ class modPayBox extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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). // Id for module (must be unique).
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). // 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. * Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories. * It also creates data directories
* \return int 1 if OK, 0 if KO *
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/ */
function init() function init($options='')
{ {
$sql = array(); $sql = array();
$result=$this->load_tables(); $result=$this->load_tables();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -35,11 +35,11 @@ class modPaypal extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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). // Id for module (must be unique).
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). // 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. * Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories. * It also creates data directories
* \return int 1 if OK, 0 if KO *
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/ */
function init() function init($options='')
{ {
$sql = array(); $sql = array();
$result=$this->load_tables(); $result=$this->load_tables();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -39,14 +39,14 @@ class modPrelevement extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 57 ; $this->numero = 57;
$this->family = "financial"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; global $conf;
@ -136,7 +140,7 @@ class modPrelevement extends DolibarrModules
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -39,13 +39,13 @@ class modProduct extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB; $this->db = $db;
$this->numero = 50; $this->numero = 50;
$this->family = "products"; $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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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 // Permissions
$this->remove(); $this->remove();
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -40,12 +40,12 @@ class modProjet extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->db = $db;
$this->numero = 400 ; $this->numero = 400;
$this->family = "projects"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; 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.")", "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);
} }
/** /**

View File

@ -41,14 +41,14 @@ class modPropale extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 20 ; $this->numero = 20;
$this->family = "crm"; $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) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
@ -181,10 +181,14 @@ class modPropale extends DolibarrModules
/** /**
* \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; global $conf;
@ -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.")", "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);
} }

View File

@ -40,14 +40,14 @@ class modService extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 53 ; $this->numero = 53;
$this->family = "products"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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 // Permissions et valeurs par defaut
$this->remove(); $this->remove();
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -40,14 +40,14 @@ class modSociete extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 1 ; $this->numero = 1;
$this->family = "crm"; $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) // 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. * Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories. * It also creates data directories
* @return int 1 if OK, 0 if KO *
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/ */
function init($options='') function init($options='')
{ {

View File

@ -38,14 +38,14 @@ class modStock extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 52 ; $this->numero = 52;
$this->family = "products"; $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) // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -36,12 +36,12 @@ class modSyslog extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->db = $db;
$this->numero = 42 ; $this->numero = 42;
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**
\brief Fonction appelee lors de la desactivation d'un module. * \brief Fonction appelee lors de la desactivation d'un module.
Supprime de la base les constantes, boites et permissions du module. * Supprime de la base les constantes, boites et permissions du module.
*/ */
function remove() function remove()
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
@ -32,8 +32,8 @@ include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");
/** /**
\class modTax * \class modTax
\brief Classe de description et activation du module Tax * \brief Classe de description et activation du module Tax
*/ */
class modTax extends DolibarrModules class modTax extends DolibarrModules
{ {
@ -41,14 +41,14 @@ class modTax extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * Constructor. Define names, constants, directories, boxes, permissions
* *
* @param DoliDB $DB Database handler * @param DoliDB $db Database handler
*/ */
function modTax($DB) function modTax($db)
{ {
global $conf; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 500 ; $this->numero = 500;
$this->family = "financial"; $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) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
@ -139,10 +139,14 @@ class modTax extends DolibarrModules
/** /**
* \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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; global $conf;
@ -151,12 +155,14 @@ class modTax extends DolibarrModules
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**
* \brief Fonction appelee lors de la desactivation d'un module. * Fonction appelee lors de la desactivation d'un module.
* Supprime de la base les constantes, boites et permissions du module. * Supprime de la base les constantes, boites et permissions du module.
*
* @return int 1 if OK, 0 if KO
*/ */
function remove() function remove()
{ {

View File

@ -37,13 +37,13 @@ class modUser extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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; global $conf;
$this->db = $DB ; $this->db = $db;
$this->numero = 0; $this->numero = 0;
$this->family = "base"; // Family for module (or "base" if core module) $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. * Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories. * It also creates data directories
* *
* @return int 1 if OK, 0 if KO * @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/ */
function init() function init($options='')
{ {
global $conf; global $conf;
@ -239,7 +240,7 @@ class modUser extends DolibarrModules
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$options);
} }
/** /**

View File

@ -36,11 +36,11 @@ class modWebServices extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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->numero = 2600;
$this->family = "technic"; $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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* \param options Options when enabling module * It also creates data directories
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/ */
function init($options='') function init($options='')
{ {

View File

@ -37,11 +37,11 @@ class modWorkflow extends DolibarrModules
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * 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). // Id for module (must be unique).
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). // 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. * Function called when module is enabled.
* Definit egalement les repertoires de donnees a creer pour ce module. * 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 // Permissions
$this->remove(); $this->remove();
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql,$option);
} }
/** /**

View File

@ -76,12 +76,14 @@ if ($_POST["action"] == "correct_stock" && ! $_POST["cancel"])
$product = new Product($db); $product = new Product($db);
$result=$product->fetch($_GET["id"]); $result=$product->fetch($_GET["id"]);
$result=$product->correct_stock($user, $result=$product->correct_stock(
$_POST["id_entrepot"], $user,
$_POST["nbpiece"], $_POST["id_entrepot"],
$_POST["mouvement"], $_POST["nbpiece"],
$_POST["label"], $_POST["mouvement"],
0); // We do not change value of stock for a correction $_POST["label"],
0
); // We do not change value of stock for a correction
if ($result > 0) if ($result > 0)
{ {
@ -113,20 +115,24 @@ if ($_POST["action"] == "transfert_stock" && ! $_POST["cancel"])
//print 'price src='.$pricesrc.', price dest='.$pricedest;exit; //print 'price src='.$pricesrc.', price dest='.$pricedest;exit;
// Remove stock // Remove stock
$result1=$product->correct_stock($user, $result1=$product->correct_stock(
$_POST["id_entrepot_source"], $user,
$_POST["nbpiece"], $_POST["id_entrepot_source"],
1, $_POST["nbpiece"],
$_POST["label"], 1,
$pricesrc); $_POST["label"],
$pricesrc
);
// Add stock // Add stock
$result2=$product->correct_stock($user, $result2=$product->correct_stock(
$_POST["id_entrepot_destination"], $user,
$_POST["nbpiece"], $_POST["id_entrepot_destination"],
0, $_POST["nbpiece"],
$_POST["label"], 0,
$pricedest); $_POST["label"],
$pricedest
);
if ($result1 >= 0 && $result2 >= 0) if ($result1 >= 0 && $result2 >= 0)
{ {

View File

@ -118,10 +118,10 @@ class ModulesTest extends PHPUnit_Framework_TestCase
$modulelist=array('Accounting','Adherent','Agenda','Banque','Barcode','Bookmark','Boutique', $modulelist=array('Accounting','Adherent','Agenda','Banque','Barcode','Bookmark','Boutique',
'CashDesk','Categorie','ClickToDial','Commande','Comptabilite','Contrat','Deplacement','Document','Don', 'CashDesk','Categorie','ClickToDial','Commande','Comptabilite','Contrat','Deplacement','Document','Don',
'ECM','Expedition','Export','ExternalRss','ExternalSite','FTP','Facture', 'ECM','Expedition','Export','ExternalRss','ExternalSite','Facture',
'Fckeditor','Ficheinter','Fournisseur','GeoIPMaxmind','Gravatar','Import','Label','Ldap','Mailing', 'Fckeditor','Ficheinter','Fournisseur','FTP','GeoIPMaxmind','Gravatar','Import','Label','Ldap','Mailing',
'Notification','Paybox','Paypal','Prelevement','Product','Projet','Propale', '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) foreach($modulelist as $modlabel)
{ {
require_once(DOL_DOCUMENT_ROOT.'/core/modules/mod'.$modlabel.'.class.php'); require_once(DOL_DOCUMENT_ROOT.'/core/modules/mod'.$modlabel.'.class.php');