Qual: Ckeckstyle

This commit is contained in:
Laurent Destailleur 2012-01-10 01:31:06 +01:00
parent c92dbe7e61
commit 6a5218b9b2
5 changed files with 107 additions and 86 deletions

View File

@ -66,10 +66,7 @@ if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='ye
{ {
$error = 0; $error = 0;
$datepaye = dol_mktime(12, 0 , 0, $datepaye = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
$_POST['remonth'],
$_POST['reday'],
$_POST['reyear']);
$paiement_id = 0; $paiement_id = 0;
// Verifie si des paiements sont superieurs au montant facture // Verifie si des paiements sont superieurs au montant facture
@ -634,7 +631,7 @@ if (! GETPOST('action'))
} }
$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)

View File

@ -54,15 +54,15 @@ class BonPrelevement extends CommonObject
/** /**
* Constructor * Constructor
* *
* @param DoliDB $DB Database handler * @param DoliDB $db Database handler
* @param string $filename Filename of withdraw receipt * @param string $filename Filename of withdraw receipt
*/ */
function BonPrelevement($DB, $filename='') function BonPrelevement($db, $filename='')
{ {
global $conf,$langs; global $conf,$langs;
$error = 0; $error = 0;
$this->db = $DB; $this->db = $db;
$this->filename=$filename; $this->filename=$filename;
@ -1209,14 +1209,14 @@ class BonPrelevement extends CommonObject
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$esaeb19->agregaRecibo( $esaeb19->agregaRecibo(
$idOrdenante, $idOrdenante,
"idcliente".$i+1, "idcliente".$i+1,
$obj->client_nom, $obj->client_nom,
$obj->code_banque, $obj->code_banque,
$obj->code_guichet, $obj->code_guichet,
$obj->cle_rib, $obj->cle_rib,
$obj->number, $obj->number,
$obj->amount, $obj->amount,
"Fra.".$obj->facnumber." ".$obj->amount "Fra.".$obj->facnumber." ".$obj->amount
); );
@ -1303,16 +1303,7 @@ class BonPrelevement extends CommonObject
{ {
$row = $this->db->fetch_row($resql); $row = $this->db->fetch_row($resql);
$this->EnregDestinataire( $this->EnregDestinataire($row[0],$row[1],$row[2],$row[3],$row[4],$row[5],$row[6],$row[7]);
$row[0],
$row[1],
$row[2],
$row[3],
$row[4],
$row[5],
$row[6],
$row[7]
);
$this->total = $this->total + $row[5]; $this->total = $this->total + $row[5];

View File

@ -39,15 +39,16 @@ class LignePrelevement
/** /**
* \brief Constructeur de la classe * Constructor
* \param DB Handler acces base de donnees *
* \param user Objet user * @param DoliDb $db Database handler
* @param User $user Objet user
*/ */
function LignePrelevement($DB, $user) function LignePrelevement($db, $user)
{ {
global $conf,$langs; global $conf,$langs;
$this->db = $DB ; $this->db = $db;
$this->user = $user; $this->user = $user;
// List of language codes for status // List of language codes for status
@ -59,8 +60,10 @@ class LignePrelevement
} }
/** /**
* \brief Recupere l'objet prelevement * Recupere l'objet prelevement
* \param rowid id de la facture a recuperer *
* @param int $rowid id de la facture a recuperer
* @return void
*/ */
function fetch($rowid) function fetch($rowid)
{ {
@ -110,8 +113,9 @@ class LignePrelevement
/** /**
* Return status label of object * Return status label of object
* @param mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto *
* @return string Label * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
* @return string Label
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
{ {
@ -120,9 +124,10 @@ class LignePrelevement
/** /**
* Return status label for a status * Return status label for a status
* @param statut id statut *
* @param mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto * @param int $statut id statut
* @return string Label * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
* @return string Label
*/ */
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {

View File

@ -36,15 +36,16 @@ class RejetPrelevement
/** /**
* Class constructor * Constructor
* @param DB Database Handler access *
* @param user User * @param DoliDb $db Database handler
* @param User $user Objet user
*/ */
function RejetPrelevement($DB, $user) function RejetPrelevement($db, $user)
{ {
global $langs; global $langs;
$this->db = $DB ; $this->db = $db;
$this->user = $user; $this->user = $user;
$this->motifs = array(); $this->motifs = array();
@ -65,6 +66,17 @@ class RejetPrelevement
} }
/**
* Create
*
* @param User $user User object
* @param int $id Id
* @param string $motif Motif
* @param timestamp $date_rejet Date rejet
* @param int $bonid Bon id
* @param int $facturation Facturation
* @return void
*/
function create($user, $id, $motif, $date_rejet, $bonid, $facturation=0) function create($user, $id, $motif, $date_rejet, $bonid, $facturation=0)
{ {
global $langs,$conf; global $langs,$conf;
@ -181,8 +193,10 @@ class RejetPrelevement
} }
/** /**
* Envoi mail * Envoi mail
* @param fac Invoice object *
* @param Facture $fac Invoice object
* @return void
*/ */
function _send_email($fac) function _send_email($fac)
{ {
@ -235,9 +249,7 @@ class RejetPrelevement
$message = $langs->trans("InfoRejectMessage",$facref,$socname, $amount, $userinfo); $message = $langs->trans("InfoRejectMessage",$facref,$socname, $amount, $userinfo);
$mailfile = new CMailFile($subject,$sendto,$from,$message, $mailfile = new CMailFile($subject,$sendto,$from,$message,$arr_file,$arr_mime,$arr_name,'', '', 0, $msgishtml,$this->user->email);
$arr_file,$arr_mime,$arr_name,
'', '', 0, $msgishtml,$this->user->email);
$result=$mailfile->sendfile(); $result=$mailfile->sendfile();
if ($result) if ($result)
@ -257,6 +269,8 @@ class RejetPrelevement
/** /**
* Retrieve the list of invoices * Retrieve the list of invoices
*
* @return void
*/ */
function _get_list_factures() function _get_list_factures()
{ {
@ -300,7 +314,9 @@ class RejetPrelevement
/** /**
* Retrieve withdrawal object * Retrieve withdrawal object
* @param rowid id of invoice to retrieve *
* @param int $rowid id of invoice to retrieve
* @return void
*/ */
function fetch($rowid) function fetch($rowid)
{ {

View File

@ -182,7 +182,7 @@ class RssParser
} }
xml_set_object($xmlparser, $this); xml_set_object($xmlparser, $this);
xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element' ); xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element');
xml_set_character_data_handler($xmlparser, 'feed_cdata'); xml_set_character_data_handler($xmlparser, 'feed_cdata');
$status = xml_parse($xmlparser, $str); $status = xml_parse($xmlparser, $str);
xml_parser_free($xmlparser); xml_parser_free($xmlparser);
@ -371,9 +371,10 @@ class RssParser
/** /**
* Triggered when opened tag is found * Triggered when opened tag is found
* *
* @param $p * @param string $p
* @param $element Tag * @param string $element Tag
* @param $attrs Attributes of tags * @param array &$attrs Attributes of tags
* @return void
*/ */
function feed_start_element($p, $element, &$attrs) function feed_start_element($p, $element, &$attrs)
{ {
@ -382,7 +383,7 @@ class RssParser
// check for a namespace, and split if found // check for a namespace, and split if found
$ns = false; $ns = false;
if ( strpos( $element, ':' ) ) { if (strpos($element, ':' )) {
list($ns, $el) = explode(':', $element, 2); list($ns, $el) = explode(':', $element, 2);
} }
if ( $ns and $ns != 'rdf' ) { if ( $ns and $ns != 'rdf' ) {
@ -455,10 +456,7 @@ class RssParser
elseif ($this->_format == 'atom' and $this->incontent ) elseif ($this->_format == 'atom' and $this->incontent )
{ {
// if tags are inlined, then flatten // if tags are inlined, then flatten
$attrs_str = join(' ', $attrs_str = join(' ', array_map('map_attrs', array_keys($attrs), array_values($attrs)));
array_map('map_attrs',
array_keys($attrs),
array_values($attrs) ) );
$this->append_content("<$element $attrs_str>" ); $this->append_content("<$element $attrs_str>" );
@ -491,8 +489,9 @@ class RssParser
/** /**
* Triggered when CDATA is found * Triggered when CDATA is found
* *
* @param $p * @param string $p
* @param $text Tag * @param string $text Tag
* @return void
*/ */
function feed_cdata($p, $text) function feed_cdata($p, $text)
{ {
@ -509,8 +508,9 @@ class RssParser
/** /**
* Triggered when closed tag is found * Triggered when closed tag is found
* *
* @param $p * @param string $p
* @param $el Tag * @param string $el Tag
* @return void
*/ */
function feed_end_element($p, $el) function feed_end_element($p, $el)
{ {
@ -562,8 +562,9 @@ class RssParser
/** /**
* To concat 2 string with no warning if an operand is not defined * To concat 2 string with no warning if an operand is not defined
* *
* @param $str1 * @param string &$str1 Str1
* @param $str2 * @param string $str2 Str2
* @return string String cancatenated
*/ */
function concat(&$str1, $str2="") function concat(&$str1, $str2="")
{ {
@ -574,6 +575,10 @@ class RssParser
} }
/** /**
* Enter description here ...
*
* @param string $text Text
* @return void
*/ */
function append_content($text) function append_content($text)
{ {
@ -587,6 +592,10 @@ class RssParser
/** /**
* smart append - field and namespace aware * smart append - field and namespace aware
*
* @param string $el El
* @param string $text Text
* @return void
*/ */
function append($el, $text) function append($el, $text)
{ {
@ -596,30 +605,30 @@ class RssParser
if ( $this->current_namespace ) if ( $this->current_namespace )
{ {
if ( $this->initem ) { if ( $this->initem ) {
$this->concat( $this->current_item[ $this->current_namespace ][ $el ], $text); $this->concat($this->current_item[ $this->current_namespace ][ $el ], $text);
} }
elseif ($this->inchannel) { elseif ($this->inchannel) {
$this->concat( $this->channel[ $this->current_namespace][ $el ], $text); $this->concat($this->channel[ $this->current_namespace][ $el ], $text);
} }
elseif ($this->intextinput) { elseif ($this->intextinput) {
$this->concat( $this->textinput[ $this->current_namespace][ $el ], $text); $this->concat($this->textinput[ $this->current_namespace][ $el ], $text);
} }
elseif ($this->inimage) { elseif ($this->inimage) {
$this->concat( $this->image[ $this->current_namespace ][ $el ], $text); $this->concat($this->image[ $this->current_namespace ][ $el ], $text);
} }
} }
else { else {
if ( $this->initem ) { if ( $this->initem ) {
$this->concat( $this->current_item[ $el ], $text); $this->concat($this->current_item[ $el ], $text);
} }
elseif ($this->intextinput) { elseif ($this->intextinput) {
$this->concat( $this->textinput[ $el ], $text); $this->concat($this->textinput[ $el ], $text);
} }
elseif ($this->inimage) { elseif ($this->inimage) {
$this->concat( $this->image[ $el ], $text); $this->concat($this->image[ $el ], $text);
} }
elseif ($this->inchannel) { elseif ($this->inchannel) {
$this->concat( $this->channel[ $el ], $text); $this->concat($this->channel[ $el ], $text);
} }
} }
@ -630,6 +639,9 @@ class RssParser
/** /**
* Function to convert an XML object into an array * Function to convert an XML object into an array
*
* @param string $xml Xml
* @return void
*/ */
function xml2php($xml) function xml2php($xml)
{ {