Fix: Removing chekstyle warning helps me to find real bugs

This commit is contained in:
Laurent Destailleur 2012-07-29 15:08:03 +02:00
parent 498ac04ad1
commit 8a77ffe58f
23 changed files with 129 additions and 117 deletions

View File

@ -2110,7 +2110,7 @@ class Commande extends CommonObject
* @param int $skip_update_total Skip update of total * @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, $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)
{ {
global $conf; global $conf;

View File

@ -45,7 +45,7 @@ class CommandeStats extends Stats
/** /**
* Constructor * Constructor
* *
* @param DoliDB $DB Database handler * @param DoliDB $db Database handler
* @param int $socid Id third party for filter * @param int $socid Id third party for filter
* @param string $mode Option * @param string $mode Option
* @param int $userid Id user for filter * @param int $userid Id user for filter

View File

@ -400,7 +400,13 @@ class Facture extends CommonObject
$localtax2_tx, $localtax2_tx,
$_facrec->lines[$i]->fk_product, $_facrec->lines[$i]->fk_product,
$_facrec->lines[$i]->remise_percent, $_facrec->lines[$i]->remise_percent,
'','',0,0,'','HT',0, '',
'',
0,
0,
'',
'HT',
0,
$_facrec->lines[$i]->product_type, $_facrec->lines[$i]->product_type,
$_facrec->lines[$i]->rang, $_facrec->lines[$i]->rang,
$_facrec->lines[$i]->special_code $_facrec->lines[$i]->special_code

View File

@ -143,9 +143,12 @@ class FileUpload
} }
/** /**
* getFullUrl
* *
* @return string Full url
*/ */
protected function getFullUrl() { protected function getFullUrl()
{
$https = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'; $https = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';
return return
($https ? 'https://' : 'http://'). ($https ? 'https://' : 'http://').
@ -159,9 +162,11 @@ class FileUpload
/** /**
* Set delete url * Set delete url
* *
* @param unknown_type $file * @param string $file File
* @return void
*/ */
protected function set_file_delete_url($file) { protected function set_file_delete_url($file)
{
$file->delete_url = $this->_options['script_url'] $file->delete_url = $this->_options['script_url']
.'?file='.rawurlencode($file->name).'&fk_element='.$this->_fk_element.'&element='.$this->_element; .'?file='.rawurlencode($file->name).'&fk_element='.$this->_fk_element.'&element='.$this->_element;
$file->delete_type = $this->_options['delete_type']; $file->delete_type = $this->_options['delete_type'];
@ -331,9 +336,10 @@ class FileUpload
/** /**
* Enter description here ... * Enter description here ...
* *
* @param unknown_type $name * @param string $name
* @param unknown_type $type * @param string $type
* @param unknown_type $index * @param string $index
* @return string Trimed string
*/ */
protected function trim_file_name($name, $type, $index) { protected function trim_file_name($name, $type, $index) {
// Remove path information and dots around the filename, to prevent uploading // Remove path information and dots around the filename, to prevent uploading

View File

@ -56,7 +56,6 @@ class HookManager
/** /**
* Init array this->hooks with instantiated action controlers. * Init array this->hooks with instantiated action controlers.
*
* First, a hook is declared by a module by adding a constant MAIN_MODULE_MYMODULENAME_HOOKS * First, a hook is declared by a module by adding a constant MAIN_MODULE_MYMODULENAME_HOOKS
* with value 'nameofcontext1:nameofcontext2:...' into $this->const of module descriptor file. * with value 'nameofcontext1:nameofcontext2:...' into $this->const of module descriptor file.
* This make conf->hooks_modules loaded with an entry ('modulename'=>array(nameofcontext1,nameofcontext2,...)) * This make conf->hooks_modules loaded with an entry ('modulename'=>array(nameofcontext1,nameofcontext2,...))

View File

@ -1028,7 +1028,7 @@ class Ldap
* Recupere le SID de l'utilisateur * Recupere le SID de l'utilisateur
* Required by Active Directory * Required by Active Directory
* *
* @param string $ldapuser Login de l'utilisateur * @param string $ldapUser Login de l'utilisateur
* @return string Sid * @return string Sid
*/ */
function getObjectSid($ldapUser) function getObjectSid($ldapUser)

View File

@ -490,6 +490,7 @@ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
* Before= Capture d\'écran.doc After= Capture d'écran.doc * Before= Capture d\'écran.doc After= Capture d'écran.doc
* *
* @param string $filename Filename * @param string $filename Filename
* @return string Unescaped string
*/ */
function dol_unescapefile($filename) function dol_unescapefile($filename)
{ {

View File

@ -449,7 +449,6 @@ function dol_escape_htmltag($stringtoescape,$keepb=0)
* this, use logging to files instead of syslog (see setup of module). * this, use logging to files instead of syslog (see setup of module).
* Note: If SYSLOG_FILE_NO_ERROR defined, we never output any error message when writing to log fails. * Note: If SYSLOG_FILE_NO_ERROR defined, we never output any error message when writing to log fails.
* Note: You can get log message into html sources by adding parameter &logtohtml=1 (constant MAIN_LOGTOHTML must be set) * Note: You can get log message into html sources by adding parameter &logtohtml=1 (constant MAIN_LOGTOHTML must be set)
*
* This function works only if syslog module is enabled. * This function works only if syslog module is enabled.
* This must not use any call to other function calling dol_syslog (avoid infinite loop). * This must not use any call to other function calling dol_syslog (avoid infinite loop).
* *
@ -877,7 +876,6 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
/** /**
* Return an array with locale date info. * Return an array with locale date info.
* PHP getdate is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows * PHP getdate is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows
*
* WARNING: This function always use PHP server timezone to return locale informations. * WARNING: This function always use PHP server timezone to return locale informations.
* Usage must be avoid. * Usage must be avoid.
* *

View File

@ -392,7 +392,7 @@ class pdf_oursin extends ModelePDFFactures
$invoice->fetch($obj->fk_facture_source); $invoice->fetch($obj->fk_facture_source);
$pdf->SetXY($tab3_posx, $tab3_top+$y ); $pdf->SetXY($tab3_posx, $tab3_top+$y);
$pdf->MultiCell(20, 3, dol_print_date($obj->datef,'day',false,$outputlangs,true), 0, 'L', 0); $pdf->MultiCell(20, 3, dol_print_date($obj->datef,'day',false,$outputlangs,true), 0, 'L', 0);
$pdf->SetXY($tab3_posx+21, $tab3_top+$y); $pdf->SetXY($tab3_posx+21, $tab3_top+$y);
$pdf->MultiCell(20, 3, price($obj->amount_ttc), 0, 'L', 0); $pdf->MultiCell(20, 3, price($obj->amount_ttc), 0, 'L', 0);
@ -401,7 +401,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetXY($tab3_posx+58, $tab3_top+$y); $pdf->SetXY($tab3_posx+58, $tab3_top+$y);
$pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', 0); $pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3 ); $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3);
$i++; $i++;
} }
@ -429,7 +429,7 @@ class pdf_oursin extends ModelePDFFactures
$y+=3; $y+=3;
$row = $this->db->fetch_object($resql); $row = $this->db->fetch_object($resql);
$pdf->SetXY($tab3_posx, $tab3_top+$y ); $pdf->SetXY($tab3_posx, $tab3_top+$y);
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0); $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0);
$pdf->SetXY($tab3_posx+21, $tab3_top+$y); $pdf->SetXY($tab3_posx+21, $tab3_top+$y);
$pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0); $pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0);
@ -440,7 +440,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetXY($tab3_posx+58, $tab3_top+$y); $pdf->SetXY($tab3_posx+58, $tab3_top+$y);
$pdf->MultiCell(30, 3, $row->num, 0, 'L', 0); $pdf->MultiCell(30, 3, $row->num, 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3 ); $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3);
$i++; $i++;
} }

View File

@ -155,7 +155,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
/** /**
* Function to build a document on disk using the generic odt module. * Function to build a document on disk using the generic odt module.
* *
* @param Societe $object Object source to build document * @param Societe &$object Object source to build document
* @param Translate $outputlangs Lang output object * @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file * @param string $srctemplatepath Full path of source filename for generator using a template file
* @return int 1 if OK, <=0 if KO * @return int 1 if OK, <=0 if KO

View File

@ -364,7 +364,7 @@ abstract class ModeleAccountancyCode
* Create a document for third party * Create a document for third party
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param Societe $object Object of third party to use * @param Societe &$object Object of third party to use
* @param string $message Message * @param string $message Message
* @param string $modele Force model to use ('' to not force). model can be a model name or a template file. * @param string $modele Force model to use ('' to not force). model can be a model name or a template file.
* @param Translate $outputlangs Object lang to use for translation * @param Translate $outputlangs Object lang to use for translation

View File

@ -61,6 +61,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param Societe $object Third party providing order
*/ */
function __construct($db,$object) function __construct($db,$object)
{ {

View File

@ -26,6 +26,7 @@
* *
* @param int $id Element id * @param int $id Element id
* @param string $table Table of Element * @param string $table Table of Element
* @return boolean True if exists
*/ */
function checkElementExist($id, $table) function checkElementExist($id, $table)
{ {

View File

@ -55,7 +55,7 @@ class Project extends CommonObject
/** /**
* Constructor * Constructor
* *
* @param DoliDB $DB Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) function __construct($db)
{ {

View File

@ -64,7 +64,7 @@ class Task extends CommonObject
/** /**
* Constructor * Constructor
* *
* @param DoliDB $DB Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) function __construct($db)
{ {