Qual: Remove tons of codesniffer errors and warnings.

This commit is contained in:
Laurent Destailleur 2013-07-07 13:14:32 +02:00
parent cbc0570bc3
commit 2bc650bf61
17 changed files with 107 additions and 95 deletions

View File

@ -1006,7 +1006,7 @@ class Adherent extends CommonObject
* Method to load member from its name * Method to load member from its name
* *
* @param string $firstname Firstname * @param string $firstname Firstname
** @param string $lastname Lastname * @param string $lastname Lastname
* @return void * @return void
*/ */
function fetch_name($firstname,$lastname) function fetch_name($firstname,$lastname)

View File

@ -2076,7 +2076,7 @@ class ContratLigne
/** /**
* Load elements linked to contract (only intervention for the moment) * Load elements linked to contract (only intervention for the moment)
* *
* @param User $user Objet type * @param string $type Object type
* @return array $elements array of linked elements * @return array $elements array of linked elements
*/ */
function get_element_list($type) function get_element_list($type)

View File

@ -289,6 +289,9 @@ abstract class CommonInvoice extends CommonObject
} }
} }
/**
* Parent class of all other business classes for details of elements (invoices, contracts, proposals, orders, ...)
*/
abstract class CommonInvoiceLine extends CommonObject abstract class CommonInvoiceLine extends CommonObject
{ {
} }

View File

@ -2746,7 +2746,7 @@ abstract class CommonObject
* @param string $seller Object of seller third party * @param string $seller Object of seller third party
* @param string $buyer Object of buyer third party * @param string $buyer Object of buyer third party
* @param string $selected Object line selected * @param string $selected Object line selected
* @param object $extrafieldline Object of extrafield line attribute * @param object $extrafieldsline Object of extrafield line attribute
* @return void * @return void
*/ */
function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected=0,$extrafieldsline=0) function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected=0,$extrafieldsline=0)
@ -3013,9 +3013,10 @@ abstract class CommonObject
/** /**
* get Margin info
* *
* @param string $force_price * @param string $force_price True of not
* @return multitype:number string NULL * @return mixed Array with info
*/ */
function getMarginInfos($force_price=false) { function getMarginInfos($force_price=false) {
global $conf; global $conf;

View File

@ -181,6 +181,8 @@ class dolprintIPP
/** /**
* Get printer detail * Get printer detail
* *
* @param string $uri URI
* @return array List of attributes
*/ */
function get_printer_detail($uri) function get_printer_detail($uri)
{ {

View File

@ -1372,7 +1372,7 @@ class Form
$objp->remise = $objp2->remise; $objp->remise = $objp2->remise;
$objp->price_by_qty_rowid = $objp2->rowid; $objp->price_by_qty_rowid = $objp2->rowid;
$this->_construct_product_list_option($objp, $opt, $optJson, 0, $selected); $this->constructProductListOption($objp, $opt, $optJson, 0, $selected);
$j++; $j++;
@ -1386,7 +1386,7 @@ class Form
} }
else else
{ {
$this->_construct_product_list_option($objp, $opt, $optJson, $price_level, $selected); $this->constructProductListOption($objp, $opt, $optJson, $price_level, $selected);
// Add new entry // Add new entry
// "key" value of json key array is used by jQuery automatically as selected value // "key" value of json key array is used by jQuery automatically as selected value
// "label" value of json key array is used by jQuery automatically as text for combo box // "label" value of json key array is used by jQuery automatically as text for combo box
@ -1411,16 +1411,16 @@ class Form
} }
/** /**
* _construct_product_list_option * constructProductListOption
* *
* @param resultset &$objp Resultset of fetch * @param resultset &$objp Resultset of fetch
* @param string $opt Option * @param string &$opt Option
* @param string $optJson Option * @param string &$optJson Option
* @param int $price_level Price level * @param int $price_level Price level
* @param string $selected Preselected value * @param string $selected Preselected value
* @return * @return void
*/ */
private function _construct_product_list_option(&$objp, &$opt, &$optJson, $price_level, $selected) private function constructProductListOption(&$objp, &$opt, &$optJson, $price_level, $selected)
{ {
global $langs,$conf,$user,$db; global $langs,$conf,$user,$db;
@ -1475,7 +1475,7 @@ class Form
$sql.= " ORDER BY date_price"; $sql.= " ORDER BY date_price";
$sql.= " DESC LIMIT 1"; $sql.= " DESC LIMIT 1";
dol_syslog(get_class($this)."::_construct_product_list_option search price for level '.$price_level.' sql=".$sql); dol_syslog(get_class($this)."::constructProductListOption search price for level '.$price_level.' sql=".$sql);
$result2 = $this->db->query($sql); $result2 = $this->db->query($sql);
if ($result2) if ($result2)
{ {

View File

@ -49,7 +49,9 @@ class FormProjets
* @param int $selected Id project preselected * @param int $selected Id project preselected
* @param string $htmlname Nom de la zone html * @param string $htmlname Nom de la zone html
* @param int $maxlength Maximum length of label * @param int $maxlength Maximum length of label
* @return int Nbre of project if OK, <0 if KO * @param int $option_only Option only
* @param int $show_empty Add an empty line
* @return int Nber of project if OK, <0 if KO
*/ */
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1) function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1)
{ {
@ -160,7 +162,7 @@ class FormProjets
/** /**
* Build Select List of element associable to a project * Build Select List of element associable to a project
* *
* @param TableName Table of the element to update * @param string $table_element Table of the element to update
* @return string The HTML select list of element * @return string The HTML select list of element
*/ */
function select_element($table_element) function select_element($table_element)

View File

@ -418,7 +418,6 @@ abstract class Stats
* *
* @param int $year Year * @param int $year Year
* @param string $sql SQL * @param string $sql SQL
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is a number
* @return array * @return array
*/ */
function _getAverageByMonth($year, $sql) function _getAverageByMonth($year, $sql)

View File

@ -27,9 +27,10 @@
* *
* @param string $url URL to call. * @param string $url URL to call.
* @param string $postorget 'post' = POST, 'get='GET' * @param string $postorget 'post' = POST, 'get='GET'
* @param string $param Paraemeters of URL (x=value1&y=value2)
* @return array returns an associtive array containing the response from the server. * @return array returns an associtive array containing the response from the server.
*/ */
function getURLContent($url,$postorget='GET',$param) function getURLContent($url,$postorget='GET',$param='')
{ {
//declaring of global variables //declaring of global variables
global $conf, $langs; global $conf, $langs;

View File

@ -58,7 +58,7 @@ $(document).ready(function () {
<input type="hidden" name="dol_no_mouse_hover" id="dol_no_mouse_hover" value="<?php echo $dol_no_mouse_hover; ?>" /> <input type="hidden" name="dol_no_mouse_hover" id="dol_no_mouse_hover" value="<?php echo $dol_no_mouse_hover; ?>" />
<input type="hidden" name="dol_use_jmobile" id="dol_use_jmobile" value="<?php echo $dol_use_jmobile; ?>" /> <input type="hidden" name="dol_use_jmobile" id="dol_use_jmobile" value="<?php echo $dol_use_jmobile; ?>" />
<table class="login_table_title" summary="<?php echo dol_escape_htmltag($title); ?>" cellpadding="0" cellspacing="0" border="0" align="center"> <table class="login_table_title" summary="<?php echo dol_escape_htmltag($title); ?>" align="center">
<tr class="vmenu"><td align="center"><?php echo $title; ?></td></tr> <tr class="vmenu"><td align="center"><?php echo $title; ?></td></tr>
</table> </table>
<br> <br>

View File

@ -45,7 +45,7 @@ $(document).ready(function () {
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="action" value="buildnewpassword"> <input type="hidden" name="action" value="buildnewpassword">
<table class="login_table_title" summary="<?php echo dol_escape_htmltag($title); ?>" cellpadding="0" cellspacing="0" border="0" align="center"> <table class="login_table_title" summary="<?php echo dol_escape_htmltag($title); ?>" align="center">
<tr class="vmenu"><td align="center"><?php echo $title; ?></td></tr> <tr class="vmenu"><td align="center"><?php echo $title; ?></td></tr>
</table> </table>
<br> <br>

View File

@ -534,6 +534,7 @@ class Fichinter extends CommonObject
* Return clicable name (with picto eventually) * Return clicable name (with picto eventually)
* *
* @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only * @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
* @param string $option Options
* @return string String with URL * @return string String with URL
*/ */
function getNomUrl($withpicto=0,$option='') function getNomUrl($withpicto=0,$option='')
@ -660,6 +661,7 @@ class Fichinter extends CommonObject
* Delete intervetnion * Delete intervetnion
* *
* @param User $user Object user who delete * @param User $user Object user who delete
* @param int $notrigger Disable trigger
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger=0) function delete($user, $notrigger=0)
@ -830,7 +832,7 @@ class Fichinter extends CommonObject
* Define the label of the contract * Define the label of the contract
* *
* @param User $user Object user who modify * @param User $user Object user who modify
* @param string $description description * @param int $contractid Description
* @return int <0 if ko, >0 if ok * @return int <0 if ko, >0 if ok
*/ */
function set_contrat($user, $contratid) function set_contrat($user, $contratid)

View File

@ -33,6 +33,9 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe
<input type="hidden" name="action" value="add"> <input type="hidden" name="action" value="add">
<input type="hidden" name="type" value="0"> <input type="hidden" name="type" value="0">
<input type="hidden" name="canvas" value="<?php echo $canvas; ?>"> <input type="hidden" name="canvas" value="<?php echo $canvas; ?>">
<?php if (empty($conf->stock->enabled)) { ?>
<input name="seuil_stock_alerte" type="hidden" value="0">
<?php } ?>
<table class="border allwidth"> <table class="border allwidth">
@ -61,8 +64,6 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe
<tr><td><?php echo $langs->trans("StockLimit"); ?></td><td> <tr><td><?php echo $langs->trans("StockLimit"); ?></td><td>
<input name="seuil_stock_alerte" size="4" value="<?php echo $object->seuil_stock_alerte; ?>"> <input name="seuil_stock_alerte" size="4" value="<?php echo $object->seuil_stock_alerte; ?>">
</td></tr> </td></tr>
<?php } else { ?>
<input name="seuil_stock_alerte" type="hidden" value="0">
<?php } ?> <?php } ?>
<tr><td><?php echo $langs->trans("Nature"); ?></td><td> <tr><td><?php echo $langs->trans("Nature"); ?></td><td>

View File

@ -33,6 +33,9 @@ dol_htmloutput_errors($object->error,$object->errors);
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" name="id" value="<?php echo $object->id; ?>"> <input type="hidden" name="id" value="<?php echo $object->id; ?>">
<input type="hidden" name="canvas" value="<?php echo $object->canvas; ?>"> <input type="hidden" name="canvas" value="<?php echo $object->canvas; ?>">
<?php if (empty($conf->stock->enabled)) { ?>
<input name="seuil_stock_alerte" type="hidden" value="0">
<?php } ?>
<table class="border allwidth"> <table class="border allwidth">
@ -61,8 +64,6 @@ dol_htmloutput_errors($object->error,$object->errors);
<tr><td><?php echo $langs->trans("StockLimit"); ?></td><td> <tr><td><?php echo $langs->trans("StockLimit"); ?></td><td>
<input name="seuil_stock_alerte" size="4" value="<?php echo $object->seuil_stock_alerte; ?>"> <input name="seuil_stock_alerte" size="4" value="<?php echo $object->seuil_stock_alerte; ?>">
</td></tr> </td></tr>
<?php } else { ?>
<input name="seuil_stock_alerte" type="hidden" value="0">
<?php } ?> <?php } ?>
<tr><td><?php echo $langs->trans("Nature"); ?></td><td> <tr><td><?php echo $langs->trans("Nature"); ?></td><td>

View File

@ -1281,7 +1281,6 @@ class Project extends CommonObject
/** /**
* Clean task not linked to a parent * Clean task not linked to a parent
* *
* @param DoliDB $db Database handler
* @return int Nb of records deleted * @return int Nb of records deleted
*/ */
function clean_orphelins() function clean_orphelins()
@ -1338,8 +1337,8 @@ class Project extends CommonObject
/** /**
* Associate element to a project * Associate element to a project
* *
* @param TableName Table of the element to update * @param string $TableName Table of the element to update
* @param ElementSelectId Key-rowid of the line of the element to update * @param int $ElementSelectId Key-rowid of the line of the element to update
* @return int 1 if OK or < 0 if KO * @return int 1 if OK or < 0 if KO
*/ */
function update_element($TableName, $ElementSelectId) function update_element($TableName, $ElementSelectId)

View File

@ -143,7 +143,8 @@ class AdherentTest extends PHPUnit_Framework_TestCase
/** /**
* testAdherentCreate * testAdherentCreate
* *
* @return void * @param int $fk_adherent_type Id type of member
* @return int
* *
* @depends testAdherentTypeCreate * @depends testAdherentTypeCreate
* The depends says test is run only if previous is ok * The depends says test is run only if previous is ok

View File

@ -221,8 +221,8 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase
$facid=$localobject1a->create($user); $facid=$localobject1a->create($user);
$localobject1a->addline($facid, 'Line 1', 6.36, 15, 21); // This include update_price $localobject1a->addline($facid, 'Line 1', 6.36, 15, 21); // This include update_price
print __METHOD__." id=".$facid." total_ttc=".$localobject1a->total_ttc."\n"; print __METHOD__." id=".$facid." total_ttc=".$localobject1a->total_ttc."\n";
$this->assertEquals( 95.40, $localobject1a->total_ht); $this->assertEquals(95.40, $localobject1a->total_ht);
$this->assertEquals( 20.03, $localobject1a->total_tva); $this->assertEquals(20.03, $localobject1a->total_tva);
$this->assertEquals(115.43, $localobject1a->total_ttc); $this->assertEquals(115.43, $localobject1a->total_ttc);
// With option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 1 // With option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 1
@ -233,8 +233,8 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase
$facid=$localobject1b->create($user); $facid=$localobject1b->create($user);
$localobject1b->addline($facid, 'Line 1', 6.36, 15, 21); // This include update_price $localobject1b->addline($facid, 'Line 1', 6.36, 15, 21); // This include update_price
print __METHOD__." id=".$facid." total_ttc=".$localobject1b->total_ttc."\n"; print __METHOD__." id=".$facid." total_ttc=".$localobject1b->total_ttc."\n";
$this->assertEquals( 95.40, $localobject1b->total_ht, 'testFactureAddLine1 total_ht'); $this->assertEquals(95.40, $localobject1b->total_ht, 'testFactureAddLine1 total_ht');
$this->assertEquals( 20.03, $localobject1b->total_tva, 'testFactureAddLine1 total_tva'); $this->assertEquals(20.03, $localobject1b->total_tva, 'testFactureAddLine1 total_tva');
$this->assertEquals(115.43, $localobject1b->total_ttc, 'testFactureAddLine1 total_ttc'); $this->assertEquals(115.43, $localobject1b->total_ttc, 'testFactureAddLine1 total_ttc');
} }
@ -264,8 +264,8 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase
$localobject2->addline($facid, 'Line 2', 6.36, 5, 21); $localobject2->addline($facid, 'Line 2', 6.36, 5, 21);
$localobject2->addline($facid, 'Line 3', 6.36, 5, 21); $localobject2->addline($facid, 'Line 3', 6.36, 5, 21);
print __METHOD__." id=".$facid." total_ttc=".$localobject2->total_ttc."\n"; print __METHOD__." id=".$facid." total_ttc=".$localobject2->total_ttc."\n";
$this->assertEquals( 95.40, $localobject2->total_ht); $this->assertEquals(95.40, $localobject2->total_ht);
$this->assertEquals( 20.04, $localobject2->total_tva); $this->assertEquals(20.04, $localobject2->total_tva);
$this->assertEquals(115.44, $localobject2->total_ttc); $this->assertEquals(115.44, $localobject2->total_ttc);
// With option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 1 // With option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 1
@ -278,8 +278,8 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase
$localobject2->addline($facid, 'Line 2', 6.36, 5, 21); $localobject2->addline($facid, 'Line 2', 6.36, 5, 21);
$localobject2->addline($facid, 'Line 3', 6.36, 5, 21); $localobject2->addline($facid, 'Line 3', 6.36, 5, 21);
print __METHOD__." id=".$facid." total_ttc=".$localobject2->total_ttc."\n"; print __METHOD__." id=".$facid." total_ttc=".$localobject2->total_ttc."\n";
$this->assertEquals( 95.40, $localobject2->total_ht); $this->assertEquals(95.40, $localobject2->total_ht);
$this->assertEquals( 20.03, $localobject2->total_tva); $this->assertEquals(20.03, $localobject2->total_tva);
$this->assertEquals(115.43, $localobject2->total_ttc); $this->assertEquals(115.43, $localobject2->total_ttc);
} }
@ -311,8 +311,8 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase
$localobject3->addline($facid, 'Line 4', 6.36, 3, 21); $localobject3->addline($facid, 'Line 4', 6.36, 3, 21);
$localobject3->addline($facid, 'Line 5', 6.36, 3, 21); $localobject3->addline($facid, 'Line 5', 6.36, 3, 21);
print __METHOD__." id=".$facid." total_ttc=".$localobject3->total_ttc."\n"; print __METHOD__." id=".$facid." total_ttc=".$localobject3->total_ttc."\n";
$this->assertEquals( 95.40, $localobject3->total_ht); $this->assertEquals(95.40, $localobject3->total_ht);
$this->assertEquals( 20.05, $localobject3->total_tva); $this->assertEquals(20.05, $localobject3->total_tva);
$this->assertEquals(115.45, $localobject3->total_ttc); $this->assertEquals(115.45, $localobject3->total_ttc);
// With option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 1 // With option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 1
@ -327,8 +327,8 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase
$localobject3->addline($facid, 'Line 4', 6.36, 3, 21); $localobject3->addline($facid, 'Line 4', 6.36, 3, 21);
$localobject3->addline($facid, 'Line 5', 6.36, 3, 21); $localobject3->addline($facid, 'Line 5', 6.36, 3, 21);
print __METHOD__." id=".$facid." total_ttc=".$localobject3->total_ttc."\n"; print __METHOD__." id=".$facid." total_ttc=".$localobject3->total_ttc."\n";
$this->assertEquals( 95.40, $localobject3->total_ht); $this->assertEquals(95.40, $localobject3->total_ht);
$this->assertEquals( 20.03, $localobject3->total_tva); $this->assertEquals(20.03, $localobject3->total_tva);
$this->assertEquals(115.43, $localobject3->total_ttc); $this->assertEquals(115.43, $localobject3->total_ttc);
} }