2
0
forked from Wavyzz/dolibarr

Qual: Fix a ton of CheckStyle errors

This commit is contained in:
Laurent Destailleur
2012-03-18 19:23:01 +01:00
parent d6a60c085a
commit ed41e03589
46 changed files with 3254 additions and 3017 deletions

View File

@@ -1,8 +1,8 @@
<?php <?php
# //
# Take a look at conf.php.example file for an example of conf.php file // Take a look at conf.php.example file for an example of conf.php file
# and explanations for all possibles parameters. // and explanations for all possibles parameters.
# //
# This file will be filled by installer // This file will be filled by installer
# //
?> ?>

View File

@@ -75,7 +75,7 @@ class Facturation
public function Facturation() public function Facturation()
{ {
$this->raz(); $this->raz();
$this->raz_pers(); $this->razPers();
} }
@@ -115,7 +115,7 @@ class Facturation
// Define part of HT, VAT, TTC // Define part of HT, VAT, TTC
$resultarray=calcul_price_total($this->qte,$this->prix(),$this->remise_percent(),$vat_rate,0,0,0,'HT',0); $resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',0);
// Calcul du total ht sans remise // Calcul du total ht sans remise
$total_ht = $resultarray[0]; $total_ht = $resultarray[0];
@@ -123,14 +123,14 @@ class Facturation
$total_ttc = $resultarray[2]; $total_ttc = $resultarray[2];
// Calcul du montant de la remise // Calcul du montant de la remise
if ($this->remise_percent()) if ($this->remisePercent())
{ {
$remise_percent = $this->remise_percent(); $remise_percent = $this->remisePercent();
} else { } else {
$remise_percent = 0; $remise_percent = 0;
} }
$montant_remise_ht = ($resultarray[6] - $resultarray[0]); $montant_remise_ht = ($resultarray[6] - $resultarray[0]);
$this->montant_remise($montant_remise_ht); $this->montantRemise($montant_remise_ht);
$product = new Product($db); $product = new Product($db);
$product->fetch($this->id); $product->fetch($this->id);
@@ -234,8 +234,8 @@ class Facturation
$this->ref('RESET'); $this->ref('RESET');
$this->qte('RESET'); $this->qte('RESET');
$this->stock('RESET'); $this->stock('RESET');
$this->remise_percent('RESET'); $this->remisePercent('RESET');
$this->montant_remise('RESET'); $this->montantRemise('RESET');
$this->prix('RESET'); $this->prix('RESET');
$this->tva('RESET'); $this->tva('RESET');
} }
@@ -245,13 +245,13 @@ class Facturation
* *
* @return void * @return void
*/ */
public function raz_pers() private function razPers()
{ {
$this->num_facture('RESET'); $this->numInvoice('RESET');
$this->getSetPaymentMode('RESET'); $this->getSetPaymentMode('RESET');
$this->montant_encaisse('RESET'); $this->montantEncaisse('RESET');
$this->montant_rendu('RESET'); $this->montantRendu('RESET');
$this->paiement_le('RESET'); $this->paiementLe('RESET');
$this->prix_total_ht('RESET'); $this->prix_total_ht('RESET');
$this->montant_tva('RESET'); $this->montant_tva('RESET');
@@ -368,7 +368,7 @@ class Facturation
* @param string $aRemisePercent Discount * @param string $aRemisePercent Discount
* @return string Discount * @return string Discount
*/ */
public function remise_percent($aRemisePercent=null) public function remisePercent($aRemisePercent=null)
{ {
if ( !$aRemisePercent ) if ( !$aRemisePercent )
@@ -392,7 +392,7 @@ class Facturation
* @param int $aMontantRemise Amount * @param int $aMontantRemise Amount
* @return string Amount * @return string Amount
*/ */
public function montant_remise($aMontantRemise=null) public function montantRemise($aMontantRemise=null)
{ {
if ( !$aMontantRemise ) { if ( !$aMontantRemise ) {
@@ -467,7 +467,7 @@ class Facturation
* @param string $aNumFacture Invoice ref * @param string $aNumFacture Invoice ref
* @return string Invoice ref * @return string Invoice ref
*/ */
public function num_facture( $aNumFacture=null ) public function numInvoice( $aNumFacture=null )
{ {
if ( !$aNumFacture ) { if ( !$aNumFacture ) {
@@ -516,7 +516,7 @@ class Facturation
* @param int $aMontantEncaisse Amount * @param int $aMontantEncaisse Amount
* @return int Amount * @return int Amount
*/ */
public function montant_encaisse( $aMontantEncaisse=null ) public function montantEncaisse( $aMontantEncaisse=null )
{ {
if ( !$aMontantEncaisse ) { if ( !$aMontantEncaisse ) {
@@ -541,7 +541,7 @@ class Facturation
* @param int $aMontantRendu Amount * @param int $aMontantRendu Amount
* @return int Amount * @return int Amount
*/ */
public function montant_rendu( $aMontantRendu=null ) public function montantRendu( $aMontantRendu=null )
{ {
if ( !$aMontantRendu ) { if ( !$aMontantRendu ) {
@@ -565,7 +565,7 @@ class Facturation
* @param date $aPaiementLe Date * @param date $aPaiementLe Date
* @return date Date * @return date Date
*/ */
public function paiement_le( $aPaiementLe=null ) public function paiementLe( $aPaiementLe=null )
{ {
if ( !$aPaiementLe ) { if ( !$aPaiementLe ) {

View File

@@ -154,9 +154,9 @@ $tab_tva = $ret;
// Reinitialisation du mode de paiement, en cas de retour aux achats apres validation // Reinitialisation du mode de paiement, en cas de retour aux achats apres validation
$obj_facturation->getSetPaymentMode('RESET'); $obj_facturation->getSetPaymentMode('RESET');
$obj_facturation->montant_encaisse('RESET'); $obj_facturation->montantEncaisse('RESET');
$obj_facturation->montant_rendu('RESET'); $obj_facturation->montantRendu('RESET');
$obj_facturation->paiement_le('RESET'); $obj_facturation->paiementLe('RESET');
// Affichage des templates // Affichage des templates

View File

@@ -36,7 +36,7 @@ switch ( $_GET['action'] )
$sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p";
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot; if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot;
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; $sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
// Recuperation des donnees en fonction de la source (liste deroulante ou champ texte) ... // Recuperation des donnees en fonction de la source (liste deroulante ou champ texte) ...
if ( $_POST['hdnSource'] == 'LISTE' ) if ( $_POST['hdnSource'] == 'LISTE' )
{ {
@@ -138,7 +138,7 @@ switch ( $_GET['action'] )
{ {
$obj_facturation->qte($_POST['txtQte']); $obj_facturation->qte($_POST['txtQte']);
$obj_facturation->tva($_POST['selTva']); $obj_facturation->tva($_POST['selTva']);
$obj_facturation->remise_percent($_POST['txtRemise']); $obj_facturation->remisePercent($_POST['txtRemise']);
$obj_facturation->ajoutArticle(); $obj_facturation->ajoutArticle();
} }

View File

@@ -25,7 +25,7 @@ $langs->load("main");
<table class="table_resume"> <table class="table_resume">
<tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->num_facture(); ?></td></tr> <tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->numInvoice(); ?></td></tr>
<tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price2num($obj_facturation->prix_total_ht(),'MT').' '.$conf->currency; ?></td></tr> <tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price2num($obj_facturation->prix_total_ht(),'MT').' '.$conf->currency; ?></td></tr>
<?php <?php
// Affichage de la tva par taux // Affichage de la tva par taux
@@ -81,18 +81,18 @@ $langs->load("main");
// Affichage des infos en fonction du mode de paiement // Affichage des infos en fonction du mode de paiement
if ( $obj_facturation->getsetPaymentMode() == 'DIF' ) { if ( $obj_facturation->getsetPaymentMode() == 'DIF' ) {
echo ('<tr><td class="resume_label">'.$langs->trans("DateEcheance").'</td><td>'.$obj_facturation->paiement_le().'</td></tr>'); echo ('<tr><td class="resume_label">'.$langs->trans("DateEcheance").'</td><td>'.$obj_facturation->paiementLe().'</td></tr>');
} else { } else {
echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price2num($obj_facturation->montant_encaisse(),'MT').' '.$conf->currency.'</td></tr>'); echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price2num($obj_facturation->montantEncaisse(),'MT').' '.$conf->currency.'</td></tr>');
} }
// Affichage du montant rendu (reglement en especes) // Affichage du montant rendu (reglement en especes)
if ( $obj_facturation->montant_rendu() ) { if ( $obj_facturation->montantRendu() ) {
echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price2num($obj_facturation->montant_rendu(),'MT').' '.$conf->currency.'</td></tr>'); echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price2num($obj_facturation->montantRendu(),'MT').' '.$conf->currency.'</td></tr>');
} }

View File

@@ -50,7 +50,7 @@ switch ($action)
$invoice->type=0; $invoice->type=0;
$num=$invoice->getNextNumRef($company); $num=$invoice->getNextNumRef($company);
$obj_facturation->num_facture($num); $obj_facturation->numInvoice($num);
$obj_facturation->getSetPaymentMode($_POST['hdnChoix']); $obj_facturation->getSetPaymentMode($_POST['hdnChoix']);
@@ -63,20 +63,20 @@ switch ($action)
} }
if ( $mode_reglement != 'DIF') { if ( $mode_reglement != 'DIF') {
$obj_facturation->montant_encaisse($montant); $obj_facturation->montantEncaisse($montant);
//Determination de la somme rendue //Determination de la somme rendue
$total = $obj_facturation->prix_total_ttc(); $total = $obj_facturation->prix_total_ttc();
$encaisse = $obj_facturation->montant_encaisse(); $encaisse = $obj_facturation->montantEncaisse();
$obj_facturation->montant_rendu($encaisse - $total); $obj_facturation->montantRendu($encaisse - $total);
} }
else else
{ {
//$txtDatePaiement=$_POST['txtDatePaiement']; //$txtDatePaiement=$_POST['txtDatePaiement'];
$datePaiement=dol_mktime(0,0,0,$_POST['txtDatePaiementmonth'],$_POST['txtDatePaiementday'],$_POST['txtDatePaiementyear']); $datePaiement=dol_mktime(0,0,0,$_POST['txtDatePaiementmonth'],$_POST['txtDatePaiementday'],$_POST['txtDatePaiementyear']);
$txtDatePaiement=dol_print_date($datePaiement,'dayrfc'); $txtDatePaiement=dol_print_date($datePaiement,'dayrfc');
$obj_facturation->paiement_le($txtDatePaiement); $obj_facturation->paiementLe($txtDatePaiement);
} }
$redirection = 'affIndex.php?menu=validation'; $redirection = 'affIndex.php?menu=validation';
@@ -115,8 +115,8 @@ switch ($action)
$mode_reglement_id = dol_getIdFromCode($db,'LIQ','c_paiement'); $mode_reglement_id = dol_getIdFromCode($db,'LIQ','c_paiement');
$cond_reglement_id = 0; $cond_reglement_id = 0;
$note .= $langs->trans("Cash")."\n"; $note .= $langs->trans("Cash")."\n";
$note .= $langs->trans("Received").' : '.$obj_facturation->montant_encaisse()." ".$conf->currency."\n"; $note .= $langs->trans("Received").' : '.$obj_facturation->montantEncaisse()." ".$conf->currency."\n";
$note .= $langs->trans("Rendu").' : '.$obj_facturation->montant_rendu()." ".$conf->currency."\n"; $note .= $langs->trans("Rendu").' : '.$obj_facturation->montantRendu()." ".$conf->currency."\n";
$note .= "\n"; $note .= "\n";
$note .= '--------------------------------------'."\n\n"; $note .= '--------------------------------------'."\n\n";
break; break;
@@ -209,10 +209,10 @@ switch ($action)
// Si paiement differe ... // Si paiement differe ...
if ( $obj_facturation->getSetPaymentMode() == 'DIF' ) if ( $obj_facturation->getSetPaymentMode() == 'DIF' )
{ {
$resultcreate=$invoice->create($user,0,dol_stringtotime($obj_facturation->paiement_le())); $resultcreate=$invoice->create($user,0,dol_stringtotime($obj_facturation->paiementLe()));
if ($resultcreate > 0) if ($resultcreate > 0)
{ {
$resultvalid=$invoice->validate($user,$obj_facturation->num_facture()); $resultvalid=$invoice->validate($user,$obj_facturation->numInvoice());
} }
else else
{ {
@@ -226,7 +226,7 @@ switch ($action)
$resultcreate=$invoice->create($user,0,0); $resultcreate=$invoice->create($user,0,0);
if ($resultcreate > 0) if ($resultcreate > 0)
{ {
$resultvalid=$invoice->validate($user, $obj_facturation->num_facture(), (isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0)); $resultvalid=$invoice->validate($user, $obj_facturation->numInvoice(), (isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0));
$id = $invoice->id; $id = $invoice->id;
@@ -235,7 +235,7 @@ switch ($action)
$payment->datepaye=$now; $payment->datepaye=$now;
$payment->bank_account=$conf_fkaccount; $payment->bank_account=$conf_fkaccount;
$payment->amounts[$invoice->id]=$obj_facturation->prix_total_ttc(); $payment->amounts[$invoice->id]=$obj_facturation->prix_total_ttc();
$payment->note=$langs->trans("Payment").' '.$langs->trans("Invoice").' '.$obj_facturation->num_facture(); $payment->note=$langs->trans("Payment").' '.$langs->trans("Invoice").' '.$obj_facturation->numInvoice();
$payment->paiementid=$invoice->mode_reglement_id; $payment->paiementid=$invoice->mode_reglement_id;
$payment->num_paiement=''; $payment->num_paiement='';

View File

@@ -77,9 +77,10 @@ class Mailing extends CommonObject
} }
/** /**
* \brief Create an EMailing * Create an EMailing
* \param user Object of user making creation *
* \return -1 if error, Id of created object if OK * @param User $user Object of user making creation
* @return int -1 if error, Id of created object if OK
*/ */
function create($user) function create($user)
{ {
@@ -133,9 +134,10 @@ class Mailing extends CommonObject
} }
/** /**
* \brief Update emailing record * Update emailing record
* \param user Object of user making change *
* \return < 0 if KO, > 0 if OK * @param User $user Object of user making change
* @return int < 0 if KO, > 0 if OK
*/ */
function update($user) function update($user)
{ {
@@ -165,9 +167,10 @@ class Mailing extends CommonObject
} }
/** /**
* \brief Get object from database * Get object from database
* \param rowid id du mailing *
* \return int * @param int $rowid Id of emailing
* @return int <0 if KO, >0 if OK
*/ */
function fetch($rowid) function fetch($rowid)
{ {
@@ -227,9 +230,10 @@ class Mailing 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,$option1,$option2) function createFromClone($fromid,$option1,$option2)
{ {
@@ -303,9 +307,10 @@ class Mailing extends CommonObject
} }
/** /**
* \brief Validate emailing * Validate emailing
* \param user Objet user qui valide *
* \return int <0 if KO, >0 if OK * @param User $user Objet user qui valide
* @return int <0 if KO, >0 if OK
*/ */
function valid($user) function valid($user)
{ {
@@ -328,9 +333,10 @@ class Mailing extends CommonObject
/** /**
* \brief Delete emailing * Delete emailing
* \param rowid id du mailing a supprimer *
* \return int 1 en cas de succes * @param int $rowid id du mailing a supprimer
* @return int 1 en cas de succes
*/ */
function delete($rowid) function delete($rowid)
{ {
@@ -353,9 +359,10 @@ class Mailing extends CommonObject
/** /**
* \brief Change status of each recipient * Change status of each recipient
* \param user Objet user qui valide *
* \return int <0 if KO, >0 if OK * @param User $user Objet user qui valide
* @return int <0 if KO, >0 if OK
*/ */
function reset_targets_status($user) function reset_targets_status($user)
{ {
@@ -379,9 +386,10 @@ class Mailing extends CommonObject
/** /**
* \brief Retourne le libelle du statut d'un mailing (brouillon, validee, ... * Retourne le libelle du statut d'un mailing (brouillon, validee, ...
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long *
* \return string Libelle * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
* @return string Label
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
{ {
@@ -389,10 +397,11 @@ class Mailing extends CommonObject
} }
/** /**
* \brief Renvoi le libelle d'un statut donn<EFBFBD> * Renvoi le libelle d'un statut donne
* \param statut Id statut *
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $statut Id statut
* \return string Libelle du statut * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label
*/ */
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {

File diff suppressed because it is too large Load Diff

View File

@@ -50,8 +50,9 @@ class Prospect extends Societe
/** /**
* \brief Charge indicateurs this->nb de tableau de bord * Charge indicateurs this->nb de tableau de bord
* \return int <0 if KO, >0 if OK *
* @return int <0 if KO, >0 if OK
*/ */
function load_state_board() function load_state_board()
{ {
@@ -92,9 +93,10 @@ class Prospect extends Societe
/** /**
* \brief Return status of prospect * Return status of prospect
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long *
* \return string Libelle * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
* @return string Libelle
*/ */
function getLibProspStatut($mode=0) function getLibProspStatut($mode=0)
{ {
@@ -102,10 +104,11 @@ class Prospect extends Societe
} }
/** /**
* \brief Return label of a given status * Return label of a given status
* \param statut Id statut *
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @param int $statut Id statut
* \return string Libelle du statut * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Libelle du statut
*/ */
function LibProspStatut($statut,$mode=0) function LibProspStatut($statut,$mode=0)
{ {
@@ -141,8 +144,9 @@ class Prospect extends Societe
} }
/** /**
* \brief Renvoi le libelle du niveau * Renvoi le libelle du niveau
* \return string Libelle *
* @return string Libelle
*/ */
function getLibLevel() function getLibLevel()
{ {
@@ -150,9 +154,10 @@ class Prospect extends Societe
} }
/** /**
* \brief Renvoi le libelle du niveau * Renvoi le libelle du niveau
* \param fk_prospectlevel Prospect level *
* \return string Libelle du niveau * @param int $fk_prospectlevel Prospect level
* @return string Libelle du niveau
*/ */
function LibLevel($fk_prospectlevel) function LibLevel($fk_prospectlevel)
{ {

View File

@@ -510,6 +510,7 @@ class Commande extends CommonObject
* Cancel an order * Cancel an order
* If stock is decremented on order validation, we must reincrement it * If stock is decremented on order validation, we must reincrement it
* *
* @param User $user Object user
* @param int $idwarehouse Id warehouse to use for stock change. * @param int $idwarehouse Id warehouse to use for stock change.
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
@@ -588,7 +589,7 @@ class Commande extends CommonObject
* Note that this->ref can be set or empty. If empty, we will use "(PROV)" * Note that this->ref can be set or empty. If empty, we will use "(PROV)"
* *
* @param User $user Objet user that make creation * @param User $user Objet user that make creation
* @param int notrigger Disable all triggers * @param int $notrigger Disable all triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function create($user, $notrigger=0) function create($user, $notrigger=0)
@@ -671,25 +672,25 @@ class Commande extends CommonObject
} }
$result = $this->addline( $result = $this->addline(
$this->id, $this->id,
$this->lines[$i]->desc, $this->lines[$i]->desc,
$this->lines[$i]->subprice, $this->lines[$i]->subprice,
$this->lines[$i]->qty, $this->lines[$i]->qty,
$this->lines[$i]->tva_tx, $this->lines[$i]->tva_tx,
$this->lines[$i]->localtax1_tx, $this->lines[$i]->localtax1_tx,
$this->lines[$i]->localtax2_tx, $this->lines[$i]->localtax2_tx,
$this->lines[$i]->fk_product, $this->lines[$i]->fk_product,
$this->lines[$i]->remise_percent, $this->lines[$i]->remise_percent,
$this->lines[$i]->info_bits, $this->lines[$i]->info_bits,
$this->lines[$i]->fk_remise_except, $this->lines[$i]->fk_remise_except,
'HT', 'HT',
0, 0,
$this->lines[$i]->date_start, $this->lines[$i]->date_start,
$this->lines[$i]->date_end, $this->lines[$i]->date_end,
$this->lines[$i]->product_type, $this->lines[$i]->product_type,
$this->lines[$i]->rang, $this->lines[$i]->rang,
$this->lines[$i]->special_code, $this->lines[$i]->special_code,
$fk_parent_line $fk_parent_line
); );
if ($result < 0) if ($result < 0)
{ {
@@ -711,7 +712,7 @@ class Commande extends CommonObject
if ($this->id) if ($this->id)
{ {
$this->ref="(PROV".$this->id.")"; $this->ref="(PROV".$this->id.")";
// Add object linked // Add object linked
if (is_array($this->linked_objects) && ! empty($this->linked_objects)) if (is_array($this->linked_objects) && ! empty($this->linked_objects))
{ {
@@ -723,25 +724,25 @@ class Commande extends CommonObject
dol_print_error($this->db); dol_print_error($this->db);
$error++; $error++;
} }
// TODO mutualiser // TODO mutualiser
if ($origin == 'propal' && $origin_id) if ($origin == 'propal' && $origin_id)
{ {
// On recupere les differents contact interne et externe // On recupere les differents contact interne et externe
$prop = new Propal($this->db, $this->socid, $origin_id); $prop = new Propal($this->db, $this->socid, $origin_id);
// On recupere le commercial suivi propale // On recupere le commercial suivi propale
$this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL'); $this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL');
if ($this->userid) if ($this->userid)
{ {
//On passe le commercial suivi propale en commercial suivi commande //On passe le commercial suivi propale en commercial suivi commande
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal'); $this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
} }
// On recupere le contact client suivi propale // On recupere le contact client suivi propale
$this->contactid = $prop->getIdcontact('external', 'CUSTOMER'); $this->contactid = $prop->getIdcontact('external', 'CUSTOMER');
if ($this->contactid) if ($this->contactid)
{ {
//On passe le contact client suivi propale en contact client suivi commande //On passe le contact client suivi propale en contact client suivi commande
@@ -922,7 +923,7 @@ class Commande extends CommonObject
$this->origin = $object->element; $this->origin = $object->element;
$this->origin_id = $object->id; $this->origin_id = $object->id;
// Possibility to add external linked objects with hooks // Possibility to add external linked objects with hooks
$this->linked_objects[$this->origin] = $this->origin_id; $this->linked_objects[$this->origin] = $this->origin_id;
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects)) if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
@@ -985,6 +986,8 @@ class Commande extends CommonObject
* @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) * @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* @param int $type Type of line (0=product, 1=service) * @param int $type Type of line (0=product, 1=service)
* @param int $rang Position of line * @param int $rang Position of line
* @param int $special_code Special code
* @param int $fk_parent_line Parent line
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
* *
* @see add_product * @see add_product
@@ -1289,7 +1292,7 @@ class Commande extends CommonObject
$this->date_livraison = $this->db->jdate($obj->date_livraison); $this->date_livraison = $this->db->jdate($obj->date_livraison);
$this->fk_delivery_address = $obj->fk_adresse_livraison; $this->fk_delivery_address = $obj->fk_adresse_livraison;
$this->propale_id = $obj->fk_source; $this->propale_id = $obj->fk_source;
$this->extraparams = (array) dol_json_decode($obj->extraparams, true); $this->extraparams = (array) dol_json_decode($obj->extraparams, true);
$this->lines = array(); $this->lines = array();
@@ -1571,6 +1574,8 @@ class Commande extends CommonObject
/** /**
* Returns a array with expeditions lines number * Returns a array with expeditions lines number
* *
* @return int Nb of shipments
*
* TODO deprecated, move to Shipping class * TODO deprecated, move to Shipping class
*/ */
function nb_expedition() function nb_expedition()
@@ -2035,6 +2040,7 @@ class Commande extends CommonObject
/** /**
* Set customer ref * Set customer ref
*
* @param User $user User that make change * @param User $user User that make change
* @param string $ref_client Customer ref * @param string $ref_client Customer ref
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
@@ -2113,6 +2119,8 @@ class Commande extends CommonObject
* @param timestamp $date_start Start date of the line * @param timestamp $date_start Start date of the line
* @param timestamp $date_end End date of the line * @param timestamp $date_end End date of the line
* @param int $type Type of line (0=product, 1=service) * @param int $type Type of line (0=product, 1=service)
* @param int $fk_parent_line Parent line id
* @param int $skip_update_total Skip update of total
* @return int < 0 if KO, > 0 if OK * @return int < 0 if KO, > 0 if OK
*/ */
function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0) function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0)
@@ -2244,7 +2252,7 @@ class Commande extends CommonObject
$error = 0; $error = 0;
$this->db->begin(); $this->db->begin();
if (! $error && ! $notrigger) if (! $error && ! $notrigger)
{ {
// Appel des triggers // Appel des triggers
@@ -2256,7 +2264,7 @@ class Commande extends CommonObject
} }
// Fin appel triggers // Fin appel triggers
} }
if (! $error) if (! $error)
{ {
// Delete order details // Delete order details
@@ -2267,7 +2275,7 @@ class Commande extends CommonObject
dol_syslog(get_class($this)."::delete error", LOG_ERR); dol_syslog(get_class($this)."::delete error", LOG_ERR);
$error++; $error++;
} }
// Delete order // Delete order
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande WHERE rowid = ".$this->id; $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
@@ -2276,15 +2284,15 @@ class Commande extends CommonObject
dol_syslog(get_class($this)."::delete error", LOG_ERR); dol_syslog(get_class($this)."::delete error", LOG_ERR);
$error++; $error++;
} }
// Delete linked object // Delete linked object
$res = $this->deleteObjectLinked(); $res = $this->deleteObjectLinked();
if ($res < 0) $error++; if ($res < 0) $error++;
// Delete linked contacts // Delete linked contacts
$res = $this->delete_linked_contact(); $res = $this->delete_linked_contact();
if ($res < 0) $error++; if ($res < 0) $error++;
// On efface le repertoire de pdf provisoire // On efface le repertoire de pdf provisoire
$comref = dol_sanitizeFileName($this->ref); $comref = dol_sanitizeFileName($this->ref);
if ($conf->commande->dir_output) if ($conf->commande->dir_output)
@@ -2294,7 +2302,7 @@ class Commande extends CommonObject
if (file_exists($file)) // We must delete all files before deleting directory if (file_exists($file)) // We must delete all files before deleting directory
{ {
dol_delete_preview($this); dol_delete_preview($this);
if (!dol_delete_file($file)) if (!dol_delete_file($file))
{ {
$this->error=$langs->trans("ErrorCanNotDeleteFile",$file); $this->error=$langs->trans("ErrorCanNotDeleteFile",$file);
@@ -2313,7 +2321,7 @@ class Commande extends CommonObject
} }
} }
} }
if (! $error) if (! $error)
{ {
dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG); dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG);
@@ -2421,7 +2429,7 @@ class Commande extends CommonObject
if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBill'); if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBill');
if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessed'); if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessed');
} }
if ($mode == 1) elseif ($mode == 1)
{ {
if ($statut==-1) return $langs->trans('StatusOrderCanceledShort'); if ($statut==-1) return $langs->trans('StatusOrderCanceledShort');
if ($statut==0) return $langs->trans('StatusOrderDraftShort'); if ($statut==0) return $langs->trans('StatusOrderDraftShort');
@@ -2430,7 +2438,7 @@ class Commande extends CommonObject
if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBillShort'); if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBillShort');
if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessed'); if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessed');
} }
if ($mode == 2) elseif ($mode == 2)
{ {
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5').' '.$langs->trans('StatusOrderCanceledShort'); if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5').' '.$langs->trans('StatusOrderCanceledShort');
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$langs->trans('StatusOrderDraftShort'); if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$langs->trans('StatusOrderDraftShort');
@@ -2439,7 +2447,7 @@ class Commande extends CommonObject
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7').' '.$langs->trans('StatusOrderToBillShort'); if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7').' '.$langs->trans('StatusOrderToBillShort');
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$langs->trans('StatusOrderProcessedShort'); if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$langs->trans('StatusOrderProcessedShort');
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5'); if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5');
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0'); if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0');
@@ -2448,7 +2456,7 @@ class Commande extends CommonObject
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7'); if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7');
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6'); if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6');
} }
if ($mode == 4) elseif ($mode == 4)
{ {
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5').' '.$langs->trans('StatusOrderCanceled'); if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5').' '.$langs->trans('StatusOrderCanceled');
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$langs->trans('StatusOrderDraft'); if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$langs->trans('StatusOrderDraft');
@@ -2457,7 +2465,7 @@ class Commande extends CommonObject
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7').' '.$langs->trans('StatusOrderToBill'); if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7').' '.$langs->trans('StatusOrderToBill');
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$langs->trans('StatusOrderProcessed'); if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$langs->trans('StatusOrderProcessed');
} }
if ($mode == 5) elseif ($mode == 5)
{ {
if ($statut==-1) return $langs->trans('StatusOrderCanceledShort').' '.img_picto($langs->trans('StatusOrderCanceled'),'statut5'); if ($statut==-1) return $langs->trans('StatusOrderCanceledShort').' '.img_picto($langs->trans('StatusOrderCanceled'),'statut5');
if ($statut==0) return $langs->trans('StatusOrderDraftShort').' '.img_picto($langs->trans('StatusOrderDraft'),'statut0'); if ($statut==0) return $langs->trans('StatusOrderDraftShort').' '.img_picto($langs->trans('StatusOrderDraft'),'statut0');
@@ -2505,7 +2513,8 @@ class Commande extends CommonObject
/** /**
* Charge les informations d'ordre info dans l'objet commande * Charge les informations d'ordre info dans l'objet commande
* *
* @param int $id Id of order * @param int $id Id of order
* @return void
*/ */
function info($id) function info($id)
{ {
@@ -2820,7 +2829,8 @@ class OrderLine
/** /**
* Load line order * Load line order
* *
* @param rowid id line order * @param int $rowid Id line order
* @return int <0 if KO, >0 if OK
*/ */
function fetch($rowid) function fetch($rowid)
{ {

View File

@@ -51,11 +51,11 @@ class CommandeStats extends Stats
* @param string $mode Option * @param string $mode Option
* @param int $userid Id user for filter * @param int $userid Id user for filter
*/ */
function CommandeStats($DB, $socid=0, $mode, $userid=0) function CommandeStats($db, $socid, $mode, $userid=0)
{ {
global $user, $conf; global $user, $conf;
$this->db = $DB; $this->db = $db;
$this->socid = $socid; $this->socid = $socid;
$this->userid = $userid; $this->userid = $userid;
@@ -88,7 +88,7 @@ class CommandeStats extends Stats
/** /**
* Return orders number by month for a year * Return orders number by month for a year
* *
* @param int $year year for stats * @param int $year year for stats
* @return array array with number by month * @return array array with number by month
*/ */
@@ -110,7 +110,7 @@ class CommandeStats extends Stats
/** /**
* Return orders number by year * Return orders number by year
* *
* @return array array with number by year * @return array array with number by year
* *
*/ */
@@ -175,7 +175,7 @@ class CommandeStats extends Stats
/** /**
* Return nb, total and average * Return nb, total and average
* *
* @return array Array of values * @return array Array of values
*/ */
function getAllByYear() function getAllByYear()

View File

@@ -28,6 +28,12 @@ if (!$user->rights->banque->lire)
accessforbidden(); accessforbidden();
/**
* Get result of sql for field amount
*
* @param string $sql SQL string
* @return int Amount
*/
function valeur($sql) function valeur($sql)
{ {
global $db; global $db;

View File

@@ -130,12 +130,12 @@ class Account extends CommonObject
/** /**
* Add a link between bank line record and its source * Add a link between bank line record and its source
* *
* @param line_id Id ecriture bancaire * @param int $line_id Id ecriture bancaire
* @param url_id Id parametre url * @param int $url_id Id parametre url
* @param url Url * @param string $url Url
* @param label Link label * @param string $label Link label
* @param type Type of link ('payment', 'company', 'member', ...) * @param string $type Type of link ('payment', 'company', 'member', ...)
* @return int <0 if KO, id line if OK * @return int <0 if KO, id line if OK
*/ */
function add_url_line($line_id, $url_id, $url, $label, $type) function add_url_line($line_id, $url_id, $url, $label, $type)
{ {
@@ -171,10 +171,10 @@ class Account extends CommonObject
* TODO Move this into AccountLine * TODO Move this into AccountLine
* Return array with links from llx_bank_url * Return array with links from llx_bank_url
* *
* @param fk_bank To search using bank transaction id * @param int $fk_bank To search using bank transaction id
* @param url_id To search using link to * @param int $url_id To search using link to
* @param type To search using type * @param string $type To search using type
* @return array Array of links * @return array Array of links
*/ */
function get_url($fk_bank='', $url_id='', $type='') function get_url($fk_bank='', $url_id='', $type='')
{ {
@@ -227,18 +227,18 @@ class Account extends CommonObject
/** /**
* Add an entry into table ".MAIN_DB_PREFIX."bank * Add an entry into table ".MAIN_DB_PREFIX."bank
* *
* @param $date Date operation * @param timsestmap $date Date operation
* @param $oper 1,2,3,4... (deprecated) or TYP,VIR,PRE,LIQ,VAD,CB,CHQ... * @param string $oper 1,2,3,4... (deprecated) or TYP,VIR,PRE,LIQ,VAD,CB,CHQ...
* @param $label Descripton * @param string $label Descripton
* @param $amount Amount * @param float $amount Amount
* @param $num_chq Numero cheque ou virement * @param string $num_chq Numero cheque ou virement
* @param $categorie Categorie optionnelle * @param string $categorie Categorie optionnelle
* @param $user User that create * @param User $user User that create
* @param $emetteur Name of cheque writer * @param string $emetteur Name of cheque writer
* @param $banque Bank of cheque writer * @param string $banque Bank of cheque writer
* @return int Rowid of added entry, <0 if KO * @return int Rowid of added entry, <0 if KO
*/ */
function addline($date, $oper, $label, $amount, $num_chq='', $categorie='', $user, $emetteur='',$banque='') function addline($date, $oper, $label, $amount, $num_chq, $categorie, $user, $emetteur='',$banque='')
{ {
// Clean parameters // Clean parameters
$emetteur=trim($emetteur); $emetteur=trim($emetteur);
@@ -344,10 +344,10 @@ class Account extends CommonObject
} }
/** /**
* Create bank account into database * Create bank account into database
* *
* @param user Object user making action * @param User $user Object user making action
* @return int < 0 if KO, > 0 if OK * @return int < 0 if KO, > 0 if OK
*/ */
function create($user='') function create($user='')
{ {
@@ -455,8 +455,8 @@ class Account extends CommonObject
/** /**
* Update bank account card * Update bank account card
* *
* @param user Object user making action * @param User $user Object user making action
* @return int <0 si ko, >0 si ok * @return int <0 si ko, >0 si ok
*/ */
function update($user='') function update($user='')
{ {
@@ -520,8 +520,8 @@ class Account extends CommonObject
/** /**
* Update BBAN (RIB) account fields * Update BBAN (RIB) account fields
* *
* @param user Object user making update * @param User $user Object user making update
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update_bban($user='') function update_bban($user='')
{ {
@@ -574,9 +574,10 @@ class Account extends CommonObject
/** /**
* Load a bank account into memory from database * Load a bank account into memory from database
* *
* @param id Id of bank account to get * @param int $id Id of bank account to get
* @param ref Ref of bank account to get * @param string $ref Ref of bank account to get
* @param ref_ext External ref of bank account to get * @param string $ref_ext External ref of bank account to get
* @return int <0 if KO, >0 if OK
*/ */
function fetch($id,$ref='',$ref_ext='') function fetch($id,$ref='',$ref_ext='')
{ {
@@ -697,8 +698,8 @@ class Account extends CommonObject
/** /**
* Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee) * Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee)
* *
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
* @return string Libelle * @return string Libelle
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
{ {
@@ -706,10 +707,11 @@ class Account extends CommonObject
} }
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* @param statut Id statut *
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $statut Id statut
* @return string Libelle du statut * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle du statut
*/ */
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {
@@ -751,6 +753,7 @@ class Account extends CommonObject
/** /**
* Renvoi si un compte peut etre supprimer ou non (sans mouvements) * Renvoi si un compte peut etre supprimer ou non (sans mouvements)
*
* @return boolean vrai si peut etre supprime, faux sinon * @return boolean vrai si peut etre supprime, faux sinon
*/ */
function can_be_deleted() function can_be_deleted()
@@ -775,6 +778,8 @@ class Account extends CommonObject
/** /**
* Return error * Return error
*
* @return string Error string
*/ */
function error() function error()
{ {
@@ -856,9 +861,10 @@ class Account extends CommonObject
/** /**
* Renvoie nom clicable (avec eventuellement le picto) * Renvoie nom clicable (avec eventuellement le picto)
* @param withpicto Inclut le picto dans le lien *
* @param mode ''=Link to card, 'transactions'=Link to transactions card * @param int $withpicto Inclut le picto dans le lien
* @return string Chaine avec URL * @param string $mode ''=Link to card, 'transactions'=Link to transactions card
* @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0, $mode='') function getNomUrl($withpicto=0, $mode='')
{ {
@@ -888,6 +894,7 @@ class Account extends CommonObject
/** /**
* Return if an account has valid information * Return if an account has valid information
*
* @return int 1 if correct, <=0 if wrong * @return int 1 if correct, <=0 if wrong
*/ */
function verif() function verif()
@@ -913,7 +920,8 @@ class Account extends CommonObject
/** /**
* Return account country code * Return account country code
* @return String country code *
* @return string country code
*/ */
function getCountryCode() function getCountryCode()
{ {
@@ -948,6 +956,7 @@ class Account extends CommonObject
/** /**
* Return if a bank account is defined with detailed information (bank code, desk code, number and key) * Return if a bank account is defined with detailed information (bank code, desk code, number and key)
*
* @return int 0=Use only an account number * @return int 0=Use only an account number
* 1=Need Bank, Desk, Number and Key (France, Spain, ...) * 1=Need Bank, Desk, Number and Key (France, Spain, ...)
* 2=Neek Bank only (BSB for Australia) * 2=Neek Bank only (BSB for Australia)
@@ -989,8 +998,7 @@ class Account extends CommonObject
/** /**
* \class AccountLine * Class to manage bank transaction lines
* \brief Class to manage bank transaction lines
*/ */
class AccountLine extends CommonObject class AccountLine extends CommonObject
{ {
@@ -1032,10 +1040,11 @@ class AccountLine extends CommonObject
/** /**
* Load into memory content of a bank transaction line * Load into memory content of a bank transaction line
* @param rowid Id of bank transaction to load *
* @param ref Ref of bank transaction to load * @param int $rowid Id of bank transaction to load
* @param num External num to load (ex: num of transaction for paypal fee) * @param string $ref Ref of bank transaction to load
* @return int <0 if KO, >0 if OK * @param string $num External num to load (ex: num of transaction for paypal fee)
* @return int <0 if KO, >0 if OK
*/ */
function fetch($rowid,$ref='',$num='') function fetch($rowid,$ref='',$num='')
{ {
@@ -1104,8 +1113,8 @@ class AccountLine extends CommonObject
/** /**
* Delete transaction bank line record * Delete transaction bank line record
* *
* @param user User object that delete * @param User $user User object that delete
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user=0) function delete($user=0)
{ {
@@ -1153,8 +1162,8 @@ class AccountLine extends CommonObject
/** /**
* Delete bank line records * Delete bank line records
* *
* @param user User object that delete * @param User $user User object that delete
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete_urls($user=0) function delete_urls($user=0)
{ {
@@ -1190,9 +1199,9 @@ class AccountLine extends CommonObject
/** /**
* Update bank account record in database * Update bank account record in database
* *
* @param user Object user making update * @param User $user Object user making update
* @param notrigger 0=Disable all triggers * @param int $notrigger 0=Disable all triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user,$notrigger=0) function update($user,$notrigger=0)
{ {
@@ -1224,9 +1233,9 @@ class AccountLine extends CommonObject
/** /**
* Update conciliation field * Update conciliation field
* *
* @param user Objet user making update * @param User $user Objet user making update
* @param cat Category id * @param int $cat Category id
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update_conciliation($user,$cat) function update_conciliation($user,$cat)
{ {
@@ -1274,8 +1283,8 @@ class AccountLine extends CommonObject
/** /**
* Increase/decrease value date of a rowid * Increase/decrease value date of a rowid
* *
* @param int $rowid * @param int $rowid Id of line
* @param int sign 1 or -1 * @param int $sign 1 or -1
* @return int >0 if OK, 0 if KO * @return int >0 if OK, 0 if KO
*/ */
function datev_change($rowid,$sign=1) function datev_change($rowid,$sign=1)
@@ -1335,7 +1344,8 @@ class AccountLine extends CommonObject
/** /**
* Charge les informations d'ordre info dans l'objet * Charge les informations d'ordre info dans l'objet
* *
* @param rowid Id of object * @param int $rowid Id of object
* @return void
*/ */
function info($rowid) function info($rowid)
{ {
@@ -1380,10 +1390,10 @@ class AccountLine extends CommonObject
/** /**
* 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 int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param maxlen Longueur max libelle * @param int $maxlen Longueur max libelle
* @param option Option ('showall') * @param string $option Option ('showall')
* @return string Chaine avec URL * @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0,$maxlen=0,$option='') function getNomUrl($withpicto=0,$maxlen=0,$option='')
{ {

View File

@@ -58,9 +58,9 @@ class BankCateg // extends CommonObject
/** /**
* Create in database * Create in database
* *
* @param user User that create * @param User $user User that create
* @param notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, Id of created object if OK * @return int <0 if KO, Id of created object if OK
*/ */
function create($user, $notrigger=0) function create($user, $notrigger=0)
{ {
@@ -126,9 +126,10 @@ class BankCateg // 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)
{ {
@@ -166,10 +167,11 @@ class BankCateg // 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)
{ {
@@ -230,10 +232,11 @@ class BankCateg // 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)
{ {
@@ -287,9 +290,10 @@ class BankCateg // 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)
{ {

View File

@@ -229,7 +229,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
// Sort array // Sort array
if (! $error) if (! $error)
{ {
array_multisort ($tab_sqlobjOrder,$tab_sqlobj); array_multisort($tab_sqlobjOrder,$tab_sqlobj);
//Apply distinct filter //Apply distinct filter
foreach ($tab_sqlobj as $key=>$value) { foreach ($tab_sqlobj as $key=>$value) {

View File

@@ -108,9 +108,10 @@ class DeplacementStats extends Stats
/** /**
* \brief Renvoie le montant de facture par mois pour une annee donnee * Renvoie le montant de facture par mois pour une annee donnee
* \param year Year to scan *
* \return array Array of values * @param int $year Year to scan
* @return array Array of values
*/ */
function getAmountByMonth($year) function getAmountByMonth($year)
{ {
@@ -127,9 +128,10 @@ class DeplacementStats extends Stats
} }
/** /**
* \brief Return average amount * Return average amount
* \param year Year to scan *
* \return array Array of values * @param int $year Year to scan
* @return array Array of values
*/ */
function getAverageByMonth($year) function getAverageByMonth($year)
{ {
@@ -144,8 +146,9 @@ class DeplacementStats extends Stats
} }
/** /**
* \brief Return nb, total and average * Return nb, total and average
* \return array Array of values *
* @return array Array of values
*/ */
function getAllByYear() function getAllByYear()
{ {

View File

@@ -2,17 +2,17 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
@@ -178,7 +178,7 @@ else if ($action == 'update' && $user->rights->deplacement->creer)
{ {
$result = $object->fetch($id); $result = $object->fetch($id);
$object->date = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $object->date = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
$object->km = $_POST["km"]; $object->km = $_POST["km"];
$object->type = $_POST["type"]; $object->type = $_POST["type"];
$object->fk_user = $_POST["fk_user"]; $object->fk_user = $_POST["fk_user"];
@@ -494,9 +494,9 @@ else if ($id)
// Statut // Statut
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>'; print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
print "</table><br>"; print "</table><br>";
// Notes // Notes
$blocname = 'notes'; $blocname = 'notes';
$title = $langs->trans('Notes'); $title = $langs->trans('Notes');

View File

@@ -75,7 +75,7 @@ if (trim($search_ref) != '')
$sql.= ' AND d.rowid LIKE \'%'.$db->escape(trim($search_ref)) . '%\''; $sql.= ' AND d.rowid LIKE \'%'.$db->escape(trim($search_ref)) . '%\'';
} }
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1 ,$offset); $sql.= $db->plimit($limit + 1, $offset);
//print $sql; //print $sql;
$resql=$db->query($sql); $resql=$db->query($sql);

View File

@@ -64,7 +64,7 @@ class localtax extends CommonObject
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
// Clean parameters // Clean parameters
$this->amount=trim($this->amount); $this->amount=trim($this->amount);
$this->label=trim($this->label); $this->label=trim($this->label);
@@ -131,7 +131,7 @@ class localtax extends CommonObject
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
// Clean parameters // Clean parameters
$this->amount=trim($this->amount); $this->amount=trim($this->amount);
$this->label=trim($this->label); $this->label=trim($this->label);
@@ -250,7 +250,7 @@ class localtax extends CommonObject
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."localtax"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."localtax";
$sql.= " WHERE rowid=".$this->id; $sql.= " WHERE rowid=".$this->id;
@@ -300,6 +300,8 @@ class localtax extends CommonObject
/** /**
* Hum la fonction s'appelle 'Solde' elle doit a mon avis calcluer le solde de localtax, non ? * Hum la fonction s'appelle 'Solde' elle doit a mon avis calcluer le solde de localtax, non ?
* *
* @param int $year Year
* @return int ???
*/ */
function solde($year = 0) function solde($year = 0)
{ {
@@ -317,8 +319,9 @@ class localtax extends CommonObject
/** /**
* Total de la localtax des factures emises par la societe. * Total de la localtax des factures emises par la societe.
* *
* @param int $year Year
* @return int ???
*/ */
function localtax_sum_collectee($year = 0) function localtax_sum_collectee($year = 0)
{ {
@@ -357,8 +360,9 @@ class localtax extends CommonObject
/** /**
* localtax payed * localtax payed
* *
* @param int $year Year
* @return int ???
*/ */
function localtax_sum_payee($year = 0) function localtax_sum_payee($year = 0)
{ {
@@ -398,8 +402,9 @@ class localtax extends CommonObject
* localtax payed * localtax payed
* Total de la localtax payed * Total de la localtax payed
* *
* @param int $year Year
* @return int ???
*/ */
function localtax_sum_reglee($year = 0) function localtax_sum_reglee($year = 0)
{ {

View File

@@ -71,7 +71,7 @@ if ($socid)
} }
$sql.= " AND p.statut = 0"; $sql.= " AND p.statut = 0";
$sql.= " ORDER BY $sortfield $sortorder"; $sql.= " ORDER BY $sortfield $sortorder";
$sql.= $db->plimit($limit +1 ,$offset); $sql.= $db->plimit($limit+1, $offset);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
@@ -96,7 +96,7 @@ if ($resql)
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td>'.'<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.'</a></td>';
print '<td width="80" align="center">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n"; print '<td width="80" align="center">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
print "<td>$objp->paiement_type $objp->num_paiement</td>\n"; print "<td>$objp->paiement_type $objp->num_paiement</td>\n";
print '<td align="right">'.price($objp->amount).'</td>'; print '<td align="right">'.price($objp->amount).'</td>';

View File

@@ -72,7 +72,7 @@ class RemiseCheque extends CommonObject
$sql.= " WHERE bc.entity = ".$conf->entity; $sql.= " WHERE bc.entity = ".$conf->entity;
if ($id) $sql.= " AND bc.rowid = ".$id; if ($id) $sql.= " AND bc.rowid = ".$id;
if ($ref) $sql.= " AND bc.number = '".$this->db->escape($ref)."'"; if ($ref) $sql.= " AND bc.number = '".$this->db->escape($ref)."'";
dol_syslog("RemiseCheque::fetch sql=".$sql, LOG_DEBUG); dol_syslog("RemiseCheque::fetch sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
@@ -113,13 +113,13 @@ class RemiseCheque extends CommonObject
/** /**
* Create a receipt to send cheques * Create a receipt to send cheques
* *
* @param user User making creation * @param User $user User making creation
* @param account_id Bank account for cheque receipt * @param int $account_id Bank account for cheque receipt
* @param limit Limit number of cheque to this * @param int $limit Limit number of cheque to this
* @param toRemise array with cheques to remise * @param array $toRemise array with cheques to remise
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function create($user, $account_id, $limit=40,$toRemise) function create($user, $account_id, $limit=40, $toRemise)
{ {
global $conf; global $conf;
@@ -271,7 +271,8 @@ class RemiseCheque extends CommonObject
/** /**
* Supprime la remise en base * Supprime la remise en base
* *
* @param user utilisateur qui effectue l'operation * @param User $user Utilisateur qui effectue l'operation
* @return void
*/ */
function delete($user='') function delete($user='')
{ {
@@ -326,8 +327,8 @@ class RemiseCheque extends CommonObject
/** /**
* Validate a receipt * Validate a receipt
* *
* @param user User * @param User $user User
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function validate($user) function validate($user)
{ {
@@ -472,11 +473,11 @@ class RemiseCheque extends CommonObject
/** /**
* Build document * Build document
* *
* @param model Model name * @param string $model Model name
* @param outputlangs Object langs * @param Tranlsate $outputlangs Object langs
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function generatePdf($model='blochet', $outputlangs) function generatePdf($model, $outputlangs)
{ {
global $langs,$conf; global $langs,$conf;
@@ -555,8 +556,9 @@ class RemiseCheque extends CommonObject
} }
/** /**
* \brief Mets a jour le montant total * Mets a jour le montant total
* \return int 0 en cas de succes *
* @return int 0 en cas de succes
*/ */
function updateAmount() function updateAmount()
{ {
@@ -614,9 +616,10 @@ class RemiseCheque extends CommonObject
} }
/** /**
* \brief Insere la remise en base * Insere la remise en base
* \param account_id Compte bancaire concerne *
* \return int * @param int $account_id Compte bancaire concerne
* @return int
*/ */
function removeCheck($account_id) function removeCheck($account_id)
{ {
@@ -643,8 +646,9 @@ class RemiseCheque extends CommonObject
return 0; return 0;
} }
/** /**
* \brief Charge les proprietes ref_previous et ref_next * Charge les proprietes ref_previous et ref_next
* \return int <0 si ko, 0 si ok *
* @return int <0 if KO, 0 if OK
*/ */
function load_previous_next_id() function load_previous_next_id()
{ {
@@ -684,9 +688,10 @@ class RemiseCheque extends CommonObject
/** /**
* Set the creation date * Set the creation date
* @param user Object user *
* @param date Date creation * @param User $user Object user
* @return int <0 if KO, >0 if OK * @param timestamp $date Date creation
* @return int <0 if KO, >0 if OK
*/ */
function set_date($user, $date) function set_date($user, $date)
{ {
@@ -719,9 +724,10 @@ class RemiseCheque extends CommonObject
/** /**
* Renvoie nom clicable (avec eventuellement le picto) * Renvoie nom clicable (avec eventuellement le picto)
* @param withpicto Inclut le picto dans le lien *
* @param option Sur quoi pointe le lien * @param int $withpicto Inclut le picto dans le lien
* @return string Chaine avec URL * @param string $option Sur quoi pointe le lien
* @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0,$option='') function getNomUrl($withpicto=0,$option='')
{ {
@@ -741,9 +747,10 @@ class RemiseCheque extends CommonObject
} }
/** /**
* \brief Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee) * Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee)
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto *
* \return string Libelle * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
{ {
@@ -751,10 +758,11 @@ class RemiseCheque extends CommonObject
} }
/** /**
* Return label of a status * Return label of a status
* @param status Statut *
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $status Statut
* @return string Libelle du statut * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle du statut
*/ */
function LibStatut($status,$mode=0) function LibStatut($status,$mode=0)
{ {

View File

@@ -44,7 +44,7 @@ $accountstatic=new Account($db);
llxHeader('',$langs->trans("ChequesArea")); llxHeader('',$langs->trans("ChequesArea"));
print_fiche_titre($langs->trans("ChequesArea") ); print_fiche_titre($langs->trans("ChequesArea"));
print '<table border="0" width="100%" class="notopnoleftnoright">'; print '<table border="0" width="100%" class="notopnoleftnoright">';

View File

@@ -66,7 +66,7 @@ if ($_GET["search_montant"])
$sql.=" AND bc.amount=".price2num($_GET["search_montant"]); $sql.=" AND bc.amount=".price2num($_GET["search_montant"]);
} }
$sql.= " ORDER BY $sortfield $sortorder"; $sql.= " ORDER BY $sortfield $sortorder";
$sql.= $db->plimit($limit+1 ,$offset); $sql.= $db->plimit($limit+1, $offset);
//print "$sql"; //print "$sql";
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@@ -32,14 +32,16 @@ $langs->load("categories");
/** /**
* Replace the default llxHeader function * Replace the default llxHeader function
* @param $head *
* @param $title * @param string $head Optionnal head lines
* @param $help_url * @param string $title HTML title
* @param $target * @param string $help_url Link to online url help to show on left menu
* @param $disablejs * @param string $target Force target on menu links
* @param $disablehead * @param int $disablejs More content into html header
* @param $arrayofjs * @param int $disablehead More content into html header
* @param $arrayofcss * @param array $arrayofjs Array of complementary js files
* @param array $arrayofcss Array of complementary css files
* @return none
*/ */
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='') function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='')
{ {

View File

@@ -115,7 +115,7 @@ else
if ($_REQUEST["search_company"]) $sql .=" AND s.nom LIKE '%".$db->escape($_REQUEST["search_company"])."%'"; if ($_REQUEST["search_company"]) $sql .=" AND s.nom LIKE '%".$db->escape($_REQUEST["search_company"])."%'";
} }
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit+1 ,$offset); $sql.= $db->plimit($limit+1, $offset);
//print "$sql"; //print "$sql";
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@@ -75,7 +75,7 @@ class Tva extends CommonObject
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
// Clean parameters // Clean parameters
$this->amount=trim($this->amount); $this->amount=trim($this->amount);
$this->label=trim($this->label); $this->label=trim($this->label);
@@ -147,7 +147,7 @@ class Tva extends CommonObject
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
// Clean parameters // Clean parameters
$this->amount=trim($this->amount); $this->amount=trim($this->amount);
$this->label=trim($this->label); $this->label=trim($this->label);
@@ -273,7 +273,7 @@ class Tva extends CommonObject
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."tva"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."tva";
$sql.= " WHERE rowid=".$this->id; $sql.= " WHERE rowid=".$this->id;
@@ -460,9 +460,10 @@ class Tva extends CommonObject
/** /**
* \brief Ajoute un paiement de TVA * Ajoute un paiement de TVA
* \param user Object user that insert *
* \return int <0 if KO, rowid in tva table if OK * @param User $user Object user that insert
* @return int <0 if KO, rowid in tva table if OK
*/ */
function addPayment($user) function addPayment($user)
{ {
@@ -572,9 +573,10 @@ class Tva extends CommonObject
} }
/** /**
* \brief Mise a jour du lien entre le paiement tva et la ligne g<>n<EFBFBD>r<EFBFBD>e dans llx_bank * Mise a jour du lien entre le paiement tva et la ligne g<>n<EFBFBD>r<EFBFBD>e dans llx_bank
* \param id_bank Id compte bancaire *
* \return int <0 if KO, >0 if OK * @param int $id_bank Id compte bancaire
* @return int <0 if KO, >0 if OK
*/ */
function update_fk_bank($id_bank) function update_fk_bank($id_bank)
{ {
@@ -594,11 +596,12 @@ class Tva 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 option Sur quoi pointe le lien * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
\return string Chaine avec URL * @param string $option Sur quoi pointe le lien
*/ * @return string Chaine avec URL
*/
function getNomUrl($withpicto=0,$option='') function getNomUrl($withpicto=0,$option='')
{ {
global $langs; global $langs;

View File

@@ -51,9 +51,10 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
* to report the amounts for different VAT rates as different lines. * to report the amounts for different VAT rates as different lines.
* This function also accounts recurrent invoices. * This function also accounts recurrent invoices.
* *
* @param db Database handler * @param DoliDB $db Database handler
* @param y Year * @param int $y Year
* @param q Year quarter (1-4) * @param int $q Year quarter (1-4)
* @return void
*/ */
function tva_coll($db,$y,$q) function tva_coll($db,$y,$q)
{ {
@@ -118,9 +119,10 @@ function tva_coll($db,$y,$q)
* The function gets the VAT in split results, as the VAT declaration asks * The function gets the VAT in split results, as the VAT declaration asks
* to report the amounts for different VAT rates as different lines * to report the amounts for different VAT rates as different lines
* *
* @param DoliDB $db Database handler object * @param DoliDB $db Database handler object
* @param int $y Year * @param int $y Year
* @param int $q Year quarter (1-4) * @param int $q Year quarter (1-4)
* @return void
*/ */
function tva_paye($db, $y,$q) function tva_paye($db, $y,$q)
{ {
@@ -289,16 +291,16 @@ if ($conf->global->COMPTA_MODE == "CREANCES-DETTES")
$i++; $i++;
} }
print '<tr class="liste_total">' . print '<tr class="liste_total">';
'<td align="right">'.$langs->trans("Total").':</td>' . print '<td align="right">'.$langs->trans("Total").':</td>';
'<td nowrap align="right">'.price($subtot_coll_total).'</td>' . print '<td nowrap="nowrap" align="right">'.price($subtot_coll_total).'</td>';
'<td nowrap align="right">'.price($subtot_coll_vat).'</td>' . print '<td nowrap="nowrap" align="right">'.price($subtot_coll_vat).'</td>';
'<td></td>' . print '<td></td>';
'<td nowrap align="right">'.price($subtot_paye_total).'</td>' . print '<td nowrap="nowrap" align="right">'.price($subtot_paye_total).'</td>';
'<td nowrap align="right">'.price($subtot_paye_vat).'</td>' . print '<td nowrap="nowrap" align="right">'.price($subtot_paye_vat).'</td>';
'<td></td>' . print '<td></td>';
'<td nowrap align="right"><b>'.price($total).'</b>' . print '<td nowrap="nowrap" align="right"><b>'.price($total).'</b>';
'</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }

View File

@@ -70,8 +70,8 @@ abstract class ActionsContactCardCommon
/** /**
* Get object * Get object
* *
* @param int Object id * @param int $id Object id
* @return object Object loaded * @return object Object loaded
*/ */
function getObject($id) function getObject($id)
{ {
@@ -226,8 +226,8 @@ abstract class ActionsContactCardCommon
/** /**
* Set content of ->tpl array, to use into template * Set content of ->tpl array, to use into template
* *
* @param string $action Type of action * @param string &$action Type of action
* @return string HTML output * @return string HTML output
*/ */
function assign_values(&$action) function assign_values(&$action)
{ {

View File

@@ -52,9 +52,12 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
$this->canvas = $canvas; $this->canvas = $canvas;
$this->card = $card; $this->card = $card;
} }
/** /**
* Return the title of card * Return the title of card
*
* @param string $action Code action
* @return string Title
*/ */
private function getTitle($action) private function getTitle($action)
{ {
@@ -65,21 +68,22 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
if ($action == 'view') $out.= (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contact") : $langs->trans("ContactAddress")); if ($action == 'view') $out.= (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contact") : $langs->trans("ContactAddress"));
if ($action == 'edit') $out.= (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("EditContact") : $langs->trans("EditContactAddress")); if ($action == 'edit') $out.= (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("EditContact") : $langs->trans("EditContactAddress"));
if ($action == 'create') $out.= (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")); if ($action == 'create') $out.= (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress"));
return $out; return $out;
} }
/** /**
* Assign custom values for canvas * Assign custom values for canvas
* *
* @param string $action Type of action * @param string &$action Type of action
* @return void * @param int $id Id
* @return void
*/ */
function assign_values(&$action, $id) function assign_values(&$action, $id)
{ {
global $conf, $db, $langs, $user; global $conf, $db, $langs, $user;
global $form; global $form;
$ret = $this->getObject($id); $ret = $this->getObject($id);
parent::assign_values($action); parent::assign_values($action);

View File

@@ -324,7 +324,7 @@ else
// Show tabs // Show tabs
$head = contact_prepare_head($object); $head = contact_prepare_head($object);
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
dol_fiche_head($head, 'card', $title, 0, 'contact'); dol_fiche_head($head, 'card', $title, 0, 'contact');
} }
@@ -350,7 +350,7 @@ else
$object->country_code = $tmparray['code']; $object->country_code = $tmparray['code'];
$object->country = $tmparray['label']; $object->country = $tmparray['label'];
} }
$title = $addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); $title = $addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
print_fiche_titre($title); print_fiche_titre($title);
@@ -576,7 +576,7 @@ else
print $formcompany->select_civility(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$object->civilite_id); print $formcompany->select_civility(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$object->civilite_id);
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("PostOrFunction" ).'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td></tr>'; print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td></tr>';
// Address // Address
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3"><textarea class="flat" name="address" cols="70">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea></td>'; print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3"><textarea class="flat" name="address" cols="70">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea></td>';
@@ -762,7 +762,7 @@ else
print '</td></tr>'; print '</td></tr>';
// Role // Role
print '<tr><td>'.$langs->trans("PostOrFunction" ).'</td><td colspan="3">'.$object->poste.'</td>'; print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="3">'.$object->poste.'</td>';
// Address // Address
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3">';

View File

@@ -61,9 +61,9 @@ class Contrat extends CommonObject
var $note_public; var $note_public;
var $fk_projet; var $fk_projet;
var $extraparams=array(); var $extraparams=array();
var $lines=array(); var $lines=array();
@@ -128,12 +128,12 @@ class Contrat extends CommonObject
/** /**
* Activate a contract line * Activate a contract line
* *
* @param user Objet User qui active le contrat * @param User $user Objet User qui active le contrat
* @param line_id Id de la ligne de detail a activer * @param int $line_id Id de la ligne de detail a activer
* @param date Date d'ouverture * @param timestamp $date Date d'ouverture
* @param date_end Date fin prevue * @param timestamp $date_end Date fin prevue
* @param comment A comment typed by user * @param string $comment A comment typed by user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function active_line($user, $line_id, $date, $date_end='', $comment='') function active_line($user, $line_id, $date, $date_end='', $comment='')
{ {
@@ -178,11 +178,11 @@ class Contrat extends CommonObject
/** /**
* Close a contract line * Close a contract line
* *
* @param user Objet User qui active le contrat * @param User $user Objet User qui active le contrat
* @param line_id Id de la ligne de detail a activer * @param int $line_id Id de la ligne de detail a activer
* @param date_end Date fin * @param timestamp $date_end Date fin
* @param comment A comment typed by user * @param string $comment A comment typed by user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function close_line($user, $line_id, $date_end, $comment='') function close_line($user, $line_id, $date_end, $comment='')
{ {
@@ -276,10 +276,10 @@ class Contrat extends CommonObject
/** /**
* Validate a contract * Validate a contract
* *
* @param user Objet User * @param User $user Objet User
* @param langs Environnement langue de l'utilisateur * @param Translate $langs Environnement langue de l'utilisateur
* @param conf Environnement de configuration lors de l'operation * @param Conf $conf Environnement de configuration lors de l'operation
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function validate($user,$langs,$conf) function validate($user,$langs,$conf)
{ {
@@ -312,6 +312,7 @@ class Contrat extends CommonObject
* Load a contract from database * Load a contract from database
* *
* @param int $id Id of contract to load * @param int $id Id of contract to load
* @param string $ref Ref
* @return int <0 if KO, id of contract if OK * @return int <0 if KO, id of contract if OK
*/ */
function fetch($id,$ref='') function fetch($id,$ref='')
@@ -353,7 +354,7 @@ class Contrat extends CommonObject
$this->socid = $result["fk_soc"]; $this->socid = $result["fk_soc"];
$this->fk_soc = $result["fk_soc"]; $this->fk_soc = $result["fk_soc"];
$this->extraparams = (array) dol_json_decode($result["extraparams"], true); $this->extraparams = (array) dol_json_decode($result["extraparams"], true);
$this->db->free($resql); $this->db->free($resql);
@@ -690,10 +691,10 @@ class Contrat extends CommonObject
/** /**
* Supprime l'objet de la base * Supprime l'objet de la base
* *
* @param user Utilisateur qui supprime * @param User $user Utilisateur qui supprime
* @param langs Environnement langue de l'utilisateur * @param Translate $langs Environnement langue de l'utilisateur
* @param conf Environnement de configuration lors de l'operation * @param Conf $conf Environnement de configuration lors de l'operation
* @return int < 0 si erreur, > 0 si ok * @return int < 0 si erreur, > 0 si ok
*/ */
function delete($user,$langs='',$conf='') function delete($user,$langs='',$conf='')
{ {
@@ -810,22 +811,22 @@ class Contrat extends CommonObject
/** /**
* Ajoute une ligne de contrat en base * Ajoute une ligne de contrat en base
* *
* @param desc Description de la ligne * @param string $desc Description de la ligne
* @param pu_ht Prix unitaire HT * @param float $pu_ht Prix unitaire HT
* @param qty Quantite * @param int $qty Quantite
* @param txtva Taux tva * @param float $txtva Taux tva
* @param txlocaltax1 Local tax 1 rate * @param float $txlocaltax1 Local tax 1 rate
* @param txlocaltax2 Local tax 2 rate * @param float $txlocaltax2 Local tax 2 rate
* @param fk_product Id produit * @param int $fk_product Id produit
* @param remise_percent Pourcentage de remise de la ligne * @param float $remise_percent Pourcentage de remise de la ligne
* @param date_start Date de debut prevue * @param timestamp $date_start Date de debut prevue
* @param date_end Date de fin prevue * @param timestamp $date_end Date de fin prevue
* @param price_base_type HT ou TTC * @param float $price_base_type HT ou TTC
* @param pu_ttc Prix unitaire TTC * @param float $pu_ttc Prix unitaire TTC
* @param info_bits Bits de type de lignes * @param int $info_bits Bits de type de lignes
* @return int <0 si erreur, >0 si ok * @return int <0 si erreur, >0 si ok
*/ */
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0, $info_bits=0) function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0, $info_bits=0)
{ {
global $user, $langs, $conf; global $user, $langs, $conf;
@@ -936,21 +937,21 @@ class Contrat extends CommonObject
/** /**
* Mets a jour une ligne de contrat * Mets a jour une ligne de contrat
* *
* @param rowid Id de la ligne de facture * @param int $rowid Id de la ligne de facture
* @param desc Description de la ligne * @param string $desc Description de la ligne
* @param pu Prix unitaire * @param float $pu Prix unitaire
* @param qty Quantite * @param int $qty Quantite
* @param remise_percent Pourcentage de remise de la ligne * @param float $remise_percent Pourcentage de remise de la ligne
* @param date_start Date de debut prevue * @param timestamp $date_start Date de debut prevue
* @param date_end Date de fin prevue * @param timestamp $date_end Date de fin prevue
* @param tvatx Taux TVA * @param float $tvatx Taux TVA
* @param localtax1tx Local tax 1 rate * @param float $localtax1tx Local tax 1 rate
* @param localtax2tx Local tax 2 rate * @param float $localtax2tx Local tax 2 rate
* @param date_debut_reel Date de debut reelle * @param timestamp $date_debut_reel Date de debut reelle
* @param date_fin_reel Date de fin reelle * @param timestamp $date_fin_reel Date de fin reelle
* @return int < 0 si erreur, > 0 si ok * @return int < 0 si erreur, > 0 si ok
*/ */
function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $date_start='', $date_end='', $tvatx, $localtax1tx=0, $localtax2tx=0, $date_debut_reel='', $date_fin_reel='') function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0, $localtax2tx=0, $date_debut_reel='', $date_fin_reel='')
{ {
global $user, $conf, $langs; global $user, $conf, $langs;
@@ -1026,9 +1027,9 @@ class Contrat extends CommonObject
/** /**
* Delete a contract line * Delete a contract line
* *
* @param idline Id of line to delete * @param int $idline Id of line to delete
* @param user User that delete * @param User $user User that delete
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function deleteline($idline,$user) function deleteline($idline,$user)
{ {
@@ -1069,7 +1070,8 @@ class Contrat extends CommonObject
/** /**
* Update statut of contract according to services * Update statut of contract according to services
* *
* @return int <0 if KO, >0 if OK * @param User $user Object user
* @return int <0 if KO, >0 if OK
*/ */
function update_statut($user) function update_statut($user)
{ {
@@ -1092,8 +1094,8 @@ class Contrat extends CommonObject
/** /**
* Return label of a contract status * Return label of a contract status
* *
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services
* @return string Label * @return string Label
*/ */
function getLibStatut($mode) function getLibStatut($mode)
{ {
@@ -1103,9 +1105,9 @@ class Contrat extends CommonObject
/** /**
* Renvoi label of a given contrat status * Renvoi label of a given contrat status
* *
* @param statut Status id * @param int $statut Status id
* @param mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services * @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services
* @return string Label * @return string Label
*/ */
function LibStatut($statut,$mode) function LibStatut($statut,$mode)
{ {
@@ -1238,8 +1240,8 @@ class Contrat extends CommonObject
/** /**
* Return list of line rowid * Return list of line rowid
* *
* @param statut Status of lines to get * @param int $statut Status of lines to get
* @return array Array of line's rowid * @return array Array of line's rowid
*/ */
function array_detail($statut=-1) function array_detail($statut=-1)
{ {
@@ -1274,8 +1276,8 @@ class Contrat extends CommonObject
/** /**
* Return list of other contracts for same company than current contract * Return list of other contracts for same company than current contract
* *
* @param option 'all' or 'others' * @param string $option 'all' or 'others'
* @return array Array of contracts id * @return array Array of contracts id
*/ */
function getListOfContracts($option='all') function getListOfContracts($option='all')
{ {
@@ -1313,9 +1315,9 @@ class Contrat extends CommonObject
/** /**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* *
* @param user Objet user * @param User $user Objet user
* @param mode "inactive" pour services a activer, "expired" pour services expires * @param string $mode "inactive" pour services a activer, "expired" pour services expires
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function load_board($user,$mode) function load_board($user,$mode)
{ {
@@ -1510,8 +1512,7 @@ class Contrat extends CommonObject
/** /**
* \class ContratLigne * Classe permettant la gestion des lignes de contrats
* \brief Classe permettant la gestion des lignes de contrats
*/ */
class ContratLigne class ContratLigne
{ {
@@ -1570,10 +1571,10 @@ class ContratLigne
/** /**
* Return label of this contract line status * Return label of this contract line status
* *
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle * @return string Libelle
*/ */
function getLibStatut($mode) function getLibStatut($mode)
{ {
@@ -1581,12 +1582,12 @@ class ContratLigne
} }
/** /**
* Return label of a contract line status * Return label of a contract line status
* *
* @param statut id statut * @param int $statut Id statut
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @param expired 0=Not expired, 1=Expired, -1=Both or unknown * @param int $expired 0=Not expired, 1=Expired, -1=Both or unknown
* @return string Libelle * @return string Libelle
*/ */
function LibStatut($statut,$mode,$expired=-1) function LibStatut($statut,$mode,$expired=-1)
{ {
@@ -1645,8 +1646,9 @@ class ContratLigne
/** /**
* 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 int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @return string Chaine avec URL * @param int $maxlength Max length
* @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0,$maxlength=0) function getNomUrl($withpicto=0,$maxlength=0)
{ {
@@ -1670,9 +1672,9 @@ class ContratLigne
/** /**
* Load object in memory from database * Load object in memory from database
* *
* @param id id object * @param int $id Id object
* @param ref Ref of contract * @param string $ref Ref of contract
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $ref='') function fetch($id, $ref='')
{ {

View File

@@ -85,7 +85,7 @@ if ($sall) $sql.= " AND (s.nom like '%".$db->escape($sall)."%' OR cd.
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut,"; $sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut,";
$sql.= " s.nom, s.rowid"; $sql.= " s.nom, s.rowid";
$sql.= " ORDER BY $sortfield $sortorder"; $sql.= " ORDER BY $sortfield $sortorder";
$sql.= $db->plimit($conf->liste_limit + 1 ,$offset); $sql.= $db->plimit($conf->liste_limit + 1, $offset);
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)

View File

@@ -101,7 +101,7 @@ $filter_date2=dol_mktime(0,0,0,$_REQUEST['op2month'],$_REQUEST['op2day'],$_REQUE
if (! empty($_REQUEST['filter_op1']) && $_REQUEST['filter_op1'] != -1 && $filter_date1 != '') $sql.= " AND date_ouverture_prevue ".$_REQUEST['filter_op1']." ".$db->idate($filter_date1); if (! empty($_REQUEST['filter_op1']) && $_REQUEST['filter_op1'] != -1 && $filter_date1 != '') $sql.= " AND date_ouverture_prevue ".$_REQUEST['filter_op1']." ".$db->idate($filter_date1);
if (! empty($_REQUEST['filter_op2']) && $_REQUEST['filter_op2'] != -1 && $filter_date2 != '') $sql.= " AND date_fin_validite ".$_REQUEST['filter_op2']." ".$db->idate($filter_date2); if (! empty($_REQUEST['filter_op2']) && $_REQUEST['filter_op2'] != -1 && $filter_date2 != '') $sql.= " AND date_fin_validite ".$_REQUEST['filter_op2']." ".$db->idate($filter_date2);
$sql .= $db->order($sortfield,$sortorder); $sql .= $db->order($sortfield,$sortorder);
$sql .= $db->plimit($limit + 1 ,$offset); $sql .= $db->plimit($limit + 1, $offset);
//print $sql; //print $sql;
dol_syslog("contrat/services.php sql=".$sql); dol_syslog("contrat/services.php sql=".$sql);

View File

@@ -115,8 +115,14 @@ else
print '</body></html>'."\n"; print '</body></html>'."\n";
/**
function xyzToUnixTimestamp($mysqldate){ * Convert date to timestamp
*
* @param string $mysqldate Date YYYMMDD
* @return timestamp Timestamp
*/
function xyzToUnixTimestamp($mysqldate)
{
$year=substr($mysqldate,0,4); $year=substr($mysqldate,0,4);
$month=substr($mysqldate,4,2); $month=substr($mysqldate,4,2);
$day=substr($mysqldate,6,2); $day=substr($mysqldate,6,2);
@@ -124,6 +130,14 @@ function xyzToUnixTimestamp($mysqldate){
return $unixtimestamp; return $unixtimestamp;
} }
/**
* Show box
*
* @param string $selectedDate Date YYYMMDD
* @param int $month Month
* @param int $year Year
* @return void
*/
function displayBox($selectedDate,$month,$year) function displayBox($selectedDate,$month,$year)
{ {
global $langs,$conf; global $langs,$conf;

View File

@@ -31,7 +31,6 @@
/** /**
* Return line description translated in outputlangs and encoded into UTF8 * Return line description translated in outputlangs and encoded into UTF8
* *
* @param Object $object Object
* @param Line $line Current line number (0 = first line, 1 = second line, ...) * @param Line $line Current line number (0 = first line, 1 = second line, ...)
* @param Translate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
* @param int $hideref Hide reference * @param int $hideref Hide reference

View File

@@ -1463,8 +1463,8 @@ function isValidEmail($address)
/** /**
* Return true if phone number syntax is ok * Return true if phone number syntax is ok
* *
* @param string $address phone (Ex: "0601010101") * @param string $phone phone (Ex: "0601010101")
* @return boolean true if phone syntax is OK, false if KO or empty string * @return boolean true if phone syntax is OK, false if KO or empty string
*/ */
function isValidPhone($phone) function isValidPhone($phone)
{ {

View File

@@ -664,11 +664,14 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
/** /**
* Show linked objects for PDF generation * Show linked objects for PDF generation
* *
* @param PDF &$pdf Object PDF * @param PDF &$pdf Object PDF
* @param object $object Object * @param object $object Object
* @param Translate $outputlangs Object lang * @param Translate $outputlangs Object lang
* @param int $curx X * @param int $curx X
* @param int $cury Y * @param int $cury Y
* @param int $align Align
* @param string $default_font_size Font size
* @param HookManager $hookmanager Hook manager object
* @return void * @return void
*/ */
function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$align,$default_font_size,$hookmanager=false) function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$align,$default_font_size,$hookmanager=false)
@@ -682,7 +685,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$align,$d
$pdf->SetXY($posx,$posy); $pdf->SetXY($posx,$posy);
$pdf->SetFont('','', $default_font_size - 2); $pdf->SetFont('','', $default_font_size - 2);
$pdf->MultiCell(100, 3, $linkedobject["ref_title"].' : '.$linkedobject["ref_value"], '', $align); $pdf->MultiCell(100, 3, $linkedobject["ref_title"].' : '.$linkedobject["ref_value"], '', $align);
if (! empty($linkedobject["date_title"]) && ! empty($linkedobject["date_value"])) if (! empty($linkedobject["date_title"]) && ! empty($linkedobject["date_value"]))
{ {
$posy+=3; $posy+=3;
@@ -691,7 +694,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$align,$d
} }
} }
} }
return $pdf->getY(); return $pdf->getY();
} }
@@ -1292,13 +1295,13 @@ function pdf_getTotalQty($object,$type,$outputlangs,$hookmanager=false)
function pdf_getCurrencySymbol(&$pdf, $currency_code) function pdf_getCurrencySymbol(&$pdf, $currency_code)
{ {
global $db, $form; global $db, $form;
$currency_sign = ''; $currency_sign = '';
if (! is_object($form)) $form = new Form($db); if (! is_object($form)) $form = new Form($db);
$form->load_cache_currencies(); $form->load_cache_currencies();
if (is_array($form->cache_currencies[$currency_code]['unicode']) && ! empty($form->cache_currencies[$currency_code]['unicode'])) if (is_array($form->cache_currencies[$currency_code]['unicode']) && ! empty($form->cache_currencies[$currency_code]['unicode']))
{ {
foreach($form->cache_currencies[$currency_code]['unicode'] as $unicode) foreach($form->cache_currencies[$currency_code]['unicode'] as $unicode)
@@ -1310,13 +1313,13 @@ function pdf_getCurrencySymbol(&$pdf, $currency_code)
{ {
$currency_sign = $currency_code; $currency_sign = $currency_code;
} }
return $currency_sign; return $currency_sign;
} }
/** /**
* Return linked objects * Return linked objects
* *
* @param object $object Object * @param object $object Object
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param HookManager $hookmanager Hook manager instance * @param HookManager $hookmanager Hook manager instance
@@ -1325,7 +1328,7 @@ function pdf_getCurrencySymbol(&$pdf, $currency_code)
function pdf_getLinkedObjects($object,$outputlangs,$hookmanager=false) function pdf_getLinkedObjects($object,$outputlangs,$hookmanager=false)
{ {
$linkedobjects=array(); $linkedobjects=array();
$object->fetchObjectLinked(); $object->fetchObjectLinked();
foreach($object->linkedObjects as $objecttype => $objects) foreach($object->linkedObjects as $objecttype => $objects)
@@ -1355,7 +1358,7 @@ function pdf_getLinkedObjects($object,$outputlangs,$hookmanager=false)
} }
} }
} }
// For add external linked objects // For add external linked objects
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {

View File

@@ -139,6 +139,7 @@ function product_prepare_head($object, $user)
* Return array head with list of tabs to view object informations. * Return array head with list of tabs to view object informations.
* *
* @param Object $object Product * @param Object $object Product
* @param string $tab Tab id
* @return array head array with tabs * @return array head array with tabs
*/ */
function product_admin_prepare_head($object, $tab) function product_admin_prepare_head($object, $tab)
@@ -171,10 +172,11 @@ function product_admin_prepare_head($object, $tab)
/** /**
* Show stats for company
* *
* Enter description here ... * @param Product $product Product object
* @param unknown_type $product * @param int $socid Thirdparty id
* @param unknown_type $socid * @return void
*/ */
function show_stats_for_company($product,$socid) function show_stats_for_company($product,$socid)
{ {

View File

@@ -266,6 +266,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlen
* @param int $showproject Show project columns * @param int $showproject Show project columns
* @param int &$taskrole Array of roles of user for each tasks * @param int &$taskrole Array of roles of user for each tasks
* @param int $projectsListId List of id of project allowed to user (separated with comma) * @param int $projectsListId List of id of project allowed to user (separated with comma)
* @return void
*/ */
function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='') function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='')
{ {

View File

@@ -137,26 +137,56 @@ class SimpleOpenID
} }
} }
/**
* SetOpenIDServer
*
* @param string $a Server
* @return void
*/
function SetOpenIDServer($a) function SetOpenIDServer($a)
{ {
$this->URLs['openid_server'] = $a; $this->URLs['openid_server'] = $a;
} }
/**
* SetOpenIDServer
*
* @param string $a Server
* @return void
*/
function SetTrustRoot($a) function SetTrustRoot($a)
{ {
$this->URLs['trust_root'] = $a; $this->URLs['trust_root'] = $a;
} }
/**
* SetOpenIDServer
*
* @param string $a Server
* @return void
*/
function SetCancelURL($a) function SetCancelURL($a)
{ {
$this->URLs['cancel'] = $a; $this->URLs['cancel'] = $a;
} }
/**
* SetApprovedURL
*
* @param string $a Server
* @return void
*/
function SetApprovedURL($a) function SetApprovedURL($a)
{ {
$this->URLs['approved'] = $a; $this->URLs['approved'] = $a;
} }
/**
* SetRequiredFields
*
* @param string $a Server
* @return void
*/
function SetRequiredFields($a) function SetRequiredFields($a)
{ {
if (is_array($a)){ if (is_array($a)){
@@ -166,6 +196,12 @@ class SimpleOpenID
} }
} }
/**
* SetOptionalFields
*
* @param string $a Server
* @return void
*/
function SetOptionalFields($a) function SetOptionalFields($a)
{ {
if (is_array($a)){ if (is_array($a)){
@@ -175,6 +211,12 @@ class SimpleOpenID
} }
} }
/**
* SetIdentity
*
* @param string $a Server
* @return void
*/
function SetIdentity($a) function SetIdentity($a)
{ // Set Identity URL { // Set Identity URL
if ((stripos($a, 'http://') === false) if ((stripos($a, 'http://') === false)
@@ -197,17 +239,35 @@ class SimpleOpenID
$this->openid_url_identity = $a; $this->openid_url_identity = $a;
} }
/**
* GetIdentity
*
* @param string $a Server
* @return void
*/
function GetIdentity() function GetIdentity()
{ // Get Identity { // Get Identity
return $this->openid_url_identity; return $this->openid_url_identity;
} }
/**
* SetOpenIDServer
*
* @param string $a Server
* @return void
*/
function GetError() function GetError()
{ {
$e = $this->error; $e = $this->error;
return array('code'=>$e[0],'description'=>$e[1]); return array('code'=>$e[0],'description'=>$e[1]);
} }
/**
* ErrorStore
*
* @param string $a Server
* @return void
*/
function ErrorStore($code, $desc = null) function ErrorStore($code, $desc = null)
{ {
$errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server TAG on Identity page.'; $errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server TAG on Identity page.';
@@ -217,6 +277,12 @@ class SimpleOpenID
$this->error = array($code,$desc); $this->error = array($code,$desc);
} }
/**
* IsError
*
* @param string $a Server
* @return void
*/
function IsError() function IsError()
{ {
if (count($this->error) > 0){ if (count($this->error) > 0){
@@ -226,6 +292,12 @@ class SimpleOpenID
} }
} }
/**
* splitResponse
*
* @param string $a Server
* @return void
*/
function splitResponse($response) function splitResponse($response)
{ {
$r = array(); $r = array();
@@ -240,6 +312,12 @@ class SimpleOpenID
return $r; return $r;
} }
/**
* OpenID_Standarize
*
* @param string $a Server
* @return void
*/
function OpenID_Standarize($openid_identity = null) function OpenID_Standarize($openid_identity = null)
{ {
if ($openid_identity === null) if ($openid_identity === null)
@@ -353,6 +431,12 @@ class SimpleOpenID
return $servers[0]; return $servers[0];
} }
/**
* GetRedirectURL
*
* @param string $a Server
* @return void
*/
function GetRedirectURL() function GetRedirectURL()
{ {
$params = array(); $params = array();
@@ -372,18 +456,33 @@ class SimpleOpenID
return $this->URLs['openid_server'] . "?". $this->array2url($params); return $this->URLs['openid_server'] . "?". $this->array2url($params);
} }
/**
* Redirect
*
* @param string $a Server
* @return void
*/
function Redirect() function Redirect()
{ {
$redirect_to = $this->GetRedirectURL(); $redirect_to = $this->GetRedirectURL();
if (headers_sent()){ // Use JavaScript to redirect if content has been previously sent (not recommended, but safe) if (headers_sent())
{ // Use JavaScript to redirect if content has been previously sent (not recommended, but safe)
echo '<script language="JavaScript" type="text/javascript">window.location=\''; echo '<script language="JavaScript" type="text/javascript">window.location=\'';
echo $redirect_to; echo $redirect_to;
echo '\';</script>'; echo '\';</script>';
}else{ // Default Header Redirect }
else
{ // Default Header Redirect
header('Location: ' . $redirect_to); header('Location: ' . $redirect_to);
} }
} }
/**
* ValidateWithServer
*
* @param string $a Server
* @return void
*/
function ValidateWithServer() function ValidateWithServer()
{ {
$params = array( $params = array(
@@ -405,14 +504,18 @@ class SimpleOpenID
$params['openid.mode'] = "check_authentication"; $params['openid.mode'] = "check_authentication";
$openid_server = $this->GetOpenIDServer(); $openid_server = $this->GetOpenIDServer();
if ($openid_server == false){ if ($openid_server == false)
{
return false; return false;
} }
$response = $this->CURL_Request($openid_server,'POST',$params); $response = $this->CURL_Request($openid_server,'POST',$params);
$data = $this->splitResponse($response); $data = $this->splitResponse($response);
if ($data['is_valid'] == "true") { if ($data['is_valid'] == "true")
{
return true; return true;
}else{ }
else
{
return false; return false;
} }
} }

View File

@@ -39,7 +39,7 @@ class InterfaceLogevents
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function InterfaceLogevents($db) function InterfaceLogevents($db)
@@ -55,6 +55,7 @@ class InterfaceLogevents
/** /**
* Return name of trigger file * Return name of trigger file
*
* @return string Name of trigger file * @return string Name of trigger file
*/ */
function getName() function getName()
@@ -64,6 +65,7 @@ class InterfaceLogevents
/** /**
* Return description of trigger file * Return description of trigger file
*
* @return string Description of trigger file * @return string Description of trigger file
*/ */
function getDesc() function getDesc()
@@ -73,6 +75,7 @@ class InterfaceLogevents
/** /**
* Return version of trigger file * Return version of trigger file
*
* @return string Version of trigger file * @return string Version of trigger file
*/ */
function getVersion() function getVersion()
@@ -89,6 +92,7 @@ class InterfaceLogevents
/** /**
* Function called when a Dolibarrr business event is done. * Function called when a Dolibarrr business event is done.
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers * All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
*
* @param action Code de l'evenement * @param action Code de l'evenement
* @param object Objet concerne * @param object Objet concerne
* @param user Objet user * @param user Objet user

View File

@@ -32,7 +32,7 @@ class InterfacePaypalWorkflow
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function InterfacePaypalWorkflow($db) function InterfacePaypalWorkflow($db)
@@ -48,8 +48,9 @@ class InterfacePaypalWorkflow
/** /**
* \brief Renvoi nom du lot de triggers * Renvoi nom du lot de triggers
* \return string Nom du lot de triggers *
* @return string Nom du lot de triggers
*/ */
function getName() function getName()
{ {
@@ -57,8 +58,9 @@ class InterfacePaypalWorkflow
} }
/** /**
* \brief Renvoi descriptif du lot de triggers * Renvoi descriptif du lot de triggers
* \return string Descriptif du lot de triggers *
* @return string Descriptif du lot de triggers
*/ */
function getDesc() function getDesc()
{ {
@@ -66,8 +68,9 @@ class InterfacePaypalWorkflow
} }
/** /**
* \brief Renvoi version du lot de triggers * Renvoi version du lot de triggers
* \return string Version du lot de triggers *
* @return string Version du lot de triggers
*/ */
function getVersion() function getVersion()
{ {
@@ -88,7 +91,7 @@ class InterfacePaypalWorkflow
* @param string $action Code de l'evenement * @param string $action Code de l'evenement
* @param CommonObject $object Objet concerne * @param CommonObject $object Objet concerne
* @param User $user Objet user * @param User $user Objet user
* @param Translate $lang Objet lang * @param Translate $langs Objet lang
* @param Conf $conf Objet conf * @param Conf $conf Objet conf
* @return int <0 if fatal error, 0 si nothing done, >0 if ok * @return int <0 if fatal error, 0 si nothing done, >0 if ok
*/ */

View File

@@ -34,7 +34,7 @@ class InterfaceWorkflowManager
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function InterfaceWorkflowManager($db) function InterfaceWorkflowManager($db)
@@ -51,6 +51,7 @@ class InterfaceWorkflowManager
/** /**
* Return name of trigger file * Return name of trigger file
*
* @return string Name of trigger file * @return string Name of trigger file
*/ */
function getName() function getName()
@@ -60,6 +61,7 @@ class InterfaceWorkflowManager
/** /**
* Return description of trigger file * Return description of trigger file
*
* @return string Description of trigger file * @return string Description of trigger file
*/ */
function getDesc() function getDesc()
@@ -69,6 +71,7 @@ class InterfaceWorkflowManager
/** /**
* Return version of trigger file * Return version of trigger file
*
* @return string Version of trigger file * @return string Version of trigger file
*/ */
function getVersion() function getVersion()

View File

@@ -40,7 +40,7 @@ class InterfaceActionsAuto
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function InterfaceActionsAuto($db) function InterfaceActionsAuto($db)
@@ -56,6 +56,7 @@ class InterfaceActionsAuto
/** /**
* Return name of trigger file * Return name of trigger file
*
* @return string Name of trigger file * @return string Name of trigger file
*/ */
function getName() function getName()
@@ -65,6 +66,7 @@ class InterfaceActionsAuto
/** /**
* Return description of trigger file * Return description of trigger file
*
* @return string Description of trigger file * @return string Description of trigger file
*/ */
function getDesc() function getDesc()
@@ -74,6 +76,7 @@ class InterfaceActionsAuto
/** /**
* Return version of trigger file * Return version of trigger file
*
* @return string Version of trigger file * @return string Version of trigger file
*/ */
function getVersion() function getVersion()

View File

@@ -35,7 +35,7 @@ class InterfaceLdapsynchro
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function InterfaceLdapsynchro($db) function InterfaceLdapsynchro($db)
@@ -51,6 +51,7 @@ class InterfaceLdapsynchro
/** /**
* Return name of trigger file * Return name of trigger file
*
* @return string Name of trigger file * @return string Name of trigger file
*/ */
function getName() function getName()
@@ -60,6 +61,7 @@ class InterfaceLdapsynchro
/** /**
* Return description of trigger file * Return description of trigger file
*
* @return string Description of trigger file * @return string Description of trigger file
*/ */
function getDesc() function getDesc()
@@ -69,6 +71,7 @@ class InterfaceLdapsynchro
/** /**
* Return version of trigger file * Return version of trigger file
*
* @return string Version of trigger file * @return string Version of trigger file
*/ */
function getVersion() function getVersion()
@@ -85,6 +88,7 @@ class InterfaceLdapsynchro
/** /**
* Function called when a Dolibarrr business event is done. * Function called when a Dolibarrr business event is done.
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers * All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
*
* @param action Event code (COMPANY_CREATE, PROPAL_VALIDATE, ...) * @param action Event code (COMPANY_CREATE, PROPAL_VALIDATE, ...)
* @param object Object action is done on * @param object Object action is done on
* @param user Object user * @param user Object user
@@ -117,7 +121,7 @@ class InterfaceLdapsynchro
$result=$ldap->add($dn,$info,$user); $result=$ldap->add($dn,$info,$user);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -148,7 +152,7 @@ class InterfaceLdapsynchro
$result=$ldap->update($dn,$info,$user,$olddn); $result=$ldap->update($dn,$info,$user,$olddn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -179,7 +183,7 @@ class InterfaceLdapsynchro
$result=$ldap->update($dn,$info,$user,$olddn); $result=$ldap->update($dn,$info,$user,$olddn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -202,7 +206,7 @@ class InterfaceLdapsynchro
$result=$ldap->delete($dn,$info,$user); $result=$ldap->delete($dn,$info,$user);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -226,7 +230,7 @@ class InterfaceLdapsynchro
$result=$ldap->add($dn,$info,$user); $result=$ldap->add($dn,$info,$user);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -256,7 +260,7 @@ class InterfaceLdapsynchro
$result=$ldap->update($dn,$info,$user,$olddn); $result=$ldap->update($dn,$info,$user,$olddn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -274,7 +278,7 @@ class InterfaceLdapsynchro
$result=$ldap->delete($dn,$info,$user); $result=$ldap->delete($dn,$info,$user);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -295,7 +299,7 @@ class InterfaceLdapsynchro
$result=$ldap->add($dn,$info,$user); $result=$ldap->add($dn,$info,$user);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -326,7 +330,7 @@ class InterfaceLdapsynchro
$result=$ldap->update($dn,$info,$user,$olddn); $result=$ldap->update($dn,$info,$user,$olddn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -345,7 +349,7 @@ class InterfaceLdapsynchro
$result=$ldap->delete($dn,$info,$user); $result=$ldap->delete($dn,$info,$user);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -366,7 +370,7 @@ class InterfaceLdapsynchro
$result=$ldap->add($dn,$info,$user); $result=$ldap->add($dn,$info,$user);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -389,7 +393,7 @@ class InterfaceLdapsynchro
$result=$ldap->update($dn,$info,$user,$olddn); $result=$ldap->update($dn,$info,$user,$olddn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -417,7 +421,7 @@ class InterfaceLdapsynchro
$result=$ldap->update($dn,$info,$user,$olddn); $result=$ldap->update($dn,$info,$user,$olddn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -449,7 +453,7 @@ class InterfaceLdapsynchro
$result=$ldap->update($dn,$info,$user,$olddn); $result=$ldap->update($dn,$info,$user,$olddn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -472,7 +476,7 @@ class InterfaceLdapsynchro
$result=$ldap->update($dn,$info,$user,$olddn); $result=$ldap->update($dn,$info,$user,$olddn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -496,7 +500,7 @@ class InterfaceLdapsynchro
$result=$ldap->update($dn,$info,$user,$olddn); $result=$ldap->update($dn,$info,$user,$olddn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }
@@ -516,7 +520,7 @@ class InterfaceLdapsynchro
$result=$ldap->delete($dn,$info,$user); $result=$ldap->delete($dn,$info,$user);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP"." ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
} }
return $result; return $result;
} }

View File

@@ -35,7 +35,7 @@ class InterfaceNotification
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function InterfaceNotification($db) function InterfaceNotification($db)
@@ -51,6 +51,7 @@ class InterfaceNotification
/** /**
* Return name of trigger file * Return name of trigger file
*
* @return string Name of trigger file * @return string Name of trigger file
*/ */
function getName() function getName()
@@ -60,6 +61,7 @@ class InterfaceNotification
/** /**
* Return description of trigger file * Return description of trigger file
*
* @return string Description of trigger file * @return string Description of trigger file
*/ */
function getDesc() function getDesc()
@@ -69,6 +71,7 @@ class InterfaceNotification
/** /**
* Return version of trigger file * Return version of trigger file
*
* @return string Version of trigger file * @return string Version of trigger file
*/ */
function getVersion() function getVersion()
@@ -85,6 +88,7 @@ class InterfaceNotification
/** /**
* Function called when a Dolibarrr business event is done. * Function called when a Dolibarrr business event is done.
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers * All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
*
* @param action Event code (COMPANY_CREATE, PROPAL_VALIDATE, ...) * @param action Event code (COMPANY_CREATE, PROPAL_VALIDATE, ...)
* @param object Object action is done on * @param object Object action is done on
* @param user Object user * @param user Object user
@@ -202,6 +206,7 @@ class InterfaceNotification
/** /**
* Return list of events managed by notification module * Return list of events managed by notification module
*
* @return array Array of events managed by notification module * @return array Array of events managed by notification module
*/ */
function getListOfManagedEvents() function getListOfManagedEvents()