diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 4ae6f7c6820..da94fa3ac02 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -268,7 +268,7 @@ class Adherent extends CommonObject // Clean parameters $this->import_key = trim($this->import_key); - + // Check parameters if (! empty($conf->global->ADHERENT_MAIL_REQUIRED) && ! isValidEMail($this->email)) { @@ -1006,18 +1006,18 @@ class Adherent extends CommonObject * Method to load member from its name * * @param string $firstname Firstname - ** @param string $lastname Lastname + * @param string $lastname Lastname * @return void */ function fetch_name($firstname,$lastname) { global $conf; - + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; $sql.= " WHERE firstname='".$this->db->escape($firstname)."'"; $sql.= " AND lastname='".$this->db->escape($lastname)."'"; $sql.= " AND entity = ".$conf->entity; - + $resql=$this->db->query($sql); if ($resql) { @@ -1032,7 +1032,7 @@ class Adherent extends CommonObject dol_print_error($this->db); } } - + /** * Load member from database * @@ -1541,7 +1541,7 @@ class Adherent extends CommonObject { global $langs; $langs->load("dict"); - + $code=(! empty($this->civilite_id)?$this->civilite_id:(! empty($this->civility_id)?$this->civility_id:'')); if (empty($code)) return ''; return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 58670f48676..4575f43592d 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2076,7 +2076,7 @@ class ContratLigne /** * 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 */ function get_element_list($type) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index e7dc17d62d1..0314bf34413 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -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 { } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0de5f388b42..cce0b9277eb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2746,7 +2746,7 @@ abstract class CommonObject * @param string $seller Object of seller third party * @param string $buyer Object of buyer third party * @param string $selected Object line selected - * @param object $extrafieldline Object of extrafield line attribute + * @param object $extrafieldsline Object of extrafield line attribute * @return void */ 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 - * @return multitype:number string NULL + * @param string $force_price True of not + * @return mixed Array with info */ function getMarginInfos($force_price=false) { global $conf; diff --git a/htdocs/core/class/dolprintipp.class.php b/htdocs/core/class/dolprintipp.class.php index 1ade18a2968..f538b1359eb 100644 --- a/htdocs/core/class/dolprintipp.class.php +++ b/htdocs/core/class/dolprintipp.class.php @@ -79,7 +79,7 @@ class dolprintIPP /** * Print selected file - * + * * @param string $file file * @param string $module module * @@ -181,6 +181,8 @@ class dolprintIPP /** * Get printer detail * + * @param string $uri URI + * @return array List of attributes */ function get_printer_detail($uri) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d0ed0b911eb..9a7d798cc4e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1372,7 +1372,7 @@ class Form $objp->remise = $objp2->remise; $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++; @@ -1386,7 +1386,7 @@ class Form } else { - $this->_construct_product_list_option($objp, $opt, $optJson, $price_level, $selected); + $this->constructProductListOption($objp, $opt, $optJson, $price_level, $selected); // Add new entry // "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 @@ -1411,16 +1411,16 @@ class Form } /** - * _construct_product_list_option + * constructProductListOption * - * @param resultset &$objp Resultset of fetch - * @param string $opt Option - * @param string $optJson Option + * @param resultset &$objp Resultset of fetch + * @param string &$opt Option + * @param string &$optJson Option * @param int $price_level Price level * @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; @@ -1475,7 +1475,7 @@ class Form $sql.= " ORDER BY date_price"; $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); if ($result2) { diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 10a23a58ac3..9e0d78118b0 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -45,20 +45,22 @@ class FormProjets /** * Show a combo list with projects qualified for a third party * - * @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id) - * @param int $selected Id project preselected - * @param string $htmlname Nom de la zone html - * @param int $maxlength Maximum length of label - * @return int Nbre of project if OK, <0 if KO + * @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id) + * @param int $selected Id project preselected + * @param string $htmlname Nom de la zone html + * @param int $maxlength Maximum length of label + * @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) - { + { global $user,$conf,$langs; - + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $out=''; - + $hideunselectables = false; if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true; @@ -146,7 +148,7 @@ class FormProjets $out.= ''; } print $out; - + $this->db->free($resql); return $num; } @@ -156,16 +158,16 @@ class FormProjets return -1; } } - + /** * Build Select List of element associable to a project * - * @param TableName Table of the element to update - * @return string The HTML select list of element + * @param string $table_element Table of the element to update + * @return string The HTML select list of element */ function select_element($table_element) { - + $projectkey="fk_projet"; switch ($table_element) { @@ -186,16 +188,16 @@ class FormProjets $sql = "SELECT rowid, ref"; break; } - + $sql.= " FROM ".MAIN_DB_PREFIX.$table_element; $sql.= " WHERE ".$projectkey." is null"; if (!empty($this->societe->id)) { $sql.= " AND fk_soc=".$this->societe->id; } $sql.= " ORDER BY ref DESC"; - + dol_syslog(get_class($this).'::select_element sql='.$sql,LOG_DEBUG); - + $resql=$this->db->query($sql); if ($resql) { @@ -213,10 +215,10 @@ class FormProjets $sellist .=''; } return $sellist ; - + $this->db->free($resql); } } - + } \ No newline at end of file diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 4c5833eb1d3..aed3fae2367 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -417,8 +417,7 @@ abstract class Stats * Renvoie le montant moyen par mois pour une annee donnee * * @param int $year Year - * @param string $sql SQL - * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is a number + * @param string $sql SQL * @return array */ function _getAverageByMonth($year, $sql) diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index b7078c263c3..61bf9ca9494 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -27,9 +27,10 @@ * * @param string $url URL to call. * @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. */ -function getURLContent($url,$postorget='GET',$param) +function getURLContent($url,$postorget='GET',$param='') { //declaring of global variables global $conf, $langs; @@ -58,7 +59,7 @@ function getURLContent($url,$postorget='GET',$param) curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT)?5:$conf->global->MAIN_USE_CONNECT_TIMEOUT); curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT)?30:$conf->global->MAIN_USE_RESPONSE_TIMEOUT); - + curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); if ($postorget == 'POST') curl_setopt($ch, CURLOPT_POST, 1); else curl_setopt($ch, CURLOPT_POST, 0); @@ -82,7 +83,7 @@ function getURLContent($url,$postorget='GET',$param) $rep['content']=$response; $rep['curl_error_no']=''; $rep['curl_error_msg']=''; - + dol_syslog("getURLContent response=".$response); if (curl_errno($ch)) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index d62b10ccea1..4b85cc109fb 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -58,7 +58,7 @@ $(document).ready(function () { - +

diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 7d78d0947da..8109f5fe157 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -45,7 +45,7 @@ $(document).ready(function () { - +

diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 8da9b42b587..bdb195d6728 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -533,8 +533,9 @@ class Fichinter extends CommonObject /** * Return clicable name (with picto eventually) * - * @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only - * @return string String with URL + * @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 */ function getNomUrl($withpicto=0,$option='') { @@ -659,8 +660,9 @@ class Fichinter extends CommonObject /** * Delete intervetnion * - * @param User $user Object user who delete - * @return int <0 if KO, >0 if OK + * @param User $user Object user who delete + * @param int $notrigger Disable trigger + * @return int <0 if KO, >0 if OK */ function delete($user, $notrigger=0) { @@ -830,8 +832,8 @@ class Fichinter extends CommonObject * Define the label of the contract * * @param User $user Object user who modify - * @param string $description description - * @return int <0 if ko, >0 if ok + * @param int $contractid Description + * @return int <0 if ko, >0 if ok */ function set_contrat($user, $contratid) { diff --git a/htdocs/product/canvas/product/tpl/card_create.tpl.php b/htdocs/product/canvas/product/tpl/card_create.tpl.php index f65f2e081f1..e340fe4e724 100755 --- a/htdocs/product/canvas/product/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_create.tpl.php @@ -33,6 +33,9 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe +stock->enabled)) { ?> + + @@ -61,8 +64,6 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe - -
trans("StockLimit"); ?>
trans("Nature"); ?> diff --git a/htdocs/product/canvas/product/tpl/card_edit.tpl.php b/htdocs/product/canvas/product/tpl/card_edit.tpl.php index b96b80a00a9..1f44b21aaff 100755 --- a/htdocs/product/canvas/product/tpl/card_edit.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_edit.tpl.php @@ -33,6 +33,9 @@ dol_htmloutput_errors($object->error,$object->errors); +stock->enabled)) { ?> + + @@ -61,8 +64,6 @@ dol_htmloutput_errors($object->error,$object->errors); - -
trans("StockLimit"); ?>
trans("Nature"); ?> diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 954bc7564c4..e6644c048c5 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -53,7 +53,7 @@ class Project extends CommonObject var $statuts_short; var $statuts; var $oldcopy; - + /** * Constructor @@ -147,7 +147,7 @@ class Project extends CommonObject dol_syslog(get_class($this)."::create error -2 " . $this->error, LOG_ERR); $error++; } - + //Update extrafield if (!$error) { if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used @@ -225,7 +225,7 @@ class Project extends CommonObject } // End call triggers } - + //Update extrafield if (!$error) { if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used @@ -478,10 +478,10 @@ class Project extends CommonObject $sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_task_extrafields"; $sql.= " WHERE fk_object IN (SELECT rowid FROM " . MAIN_DB_PREFIX . "projet_task WHERE fk_projet=" . $this->id . ")"; - + dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG); $resql = $this->db->query($sql); - + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_task"; $sql.= " WHERE fk_projet=" . $this->id; @@ -493,13 +493,13 @@ class Project extends CommonObject dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG); $resql = $this->db->query($sql); - + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_extrafields"; $sql.= " WHERE fk_object=" . $this->id; - + dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG); $resql = $this->db->query($sql); - + if ($resql) { // We remove directory @@ -1277,20 +1277,19 @@ class Project extends CommonObject } return $result; } - + /** * Clean task not linked to a parent * - * @param DoliDB $db Database handler * @return int Nb of records deleted */ function clean_orphelins() { $nb=0; - + // There is orphelins. We clean that $listofid=array(); - + // Get list of id in array listofid $sql='SELECT rowid FROM '.MAIN_DB_PREFIX.'projet_task'; $resql = $this->db->query($sql); @@ -1309,22 +1308,22 @@ class Project extends CommonObject { dol_print_error($this->db); } - + if (count($listofid)) { // Removed orphelins records print 'Some orphelins were found and restored to be parents so records are visible again: '; print join(',',$listofid); - + $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task"; $sql.= " SET fk_task_parent = 0"; $sql.= " WHERE fk_task_parent NOT IN (".join(',',$listofid).")"; - + $resql = $this->db->query($sql); if ($resql) { $nb=$this->db->affected_rows($sql); - + return $nb; } else @@ -1333,19 +1332,19 @@ class Project extends CommonObject } } } - - + + /** * Associate element to a project * - * @param TableName Table of the element to update - * @param ElementSelectId Key-rowid of the line of the element to update - * @return int 1 if OK or < 0 if KO + * @param string $TableName Table 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 */ function update_element($TableName, $ElementSelectId) { $sql="UPDATE ".MAIN_DB_PREFIX.$TableName; - + if ($TableName=="actioncomm") { $sql.= " SET fk_project=".$this->id; @@ -1356,17 +1355,17 @@ class Project extends CommonObject $sql.= " SET fk_projet=".$this->id; $sql.= " WHERE rowid=".$ElementSelectId; } - + dol_syslog(get_class($this)."::update_element sql=" . $sql, LOG_DEBUG); $resql=$this->db->query($sql); if (!$resql) { - $this->error=$this->db->lasterror(); + $this->error=$this->db->lasterror(); dol_syslog(get_class($this)."::update_element error : " . $this->error, LOG_ERR); return -1; }else { return 1; } - + } } diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index 3670ff29780..aebd54f45f6 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -139,12 +139,13 @@ class AdherentTest extends PHPUnit_Framework_TestCase return $localobject->id; } - + /** * testAdherentCreate * - * @return void - * + * @param int $fk_adherent_type Id type of member + * @return int + * * @depends testAdherentTypeCreate * The depends says test is run only if previous is ok */ diff --git a/test/phpunit/FactureTestRounding.php b/test/phpunit/FactureTestRounding.php index b90f67171d2..1c38fe17bad 100644 --- a/test/phpunit/FactureTestRounding.php +++ b/test/phpunit/FactureTestRounding.php @@ -221,8 +221,8 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase $facid=$localobject1a->create($user); $localobject1a->addline($facid, 'Line 1', 6.36, 15, 21); // This include update_price print __METHOD__." id=".$facid." total_ttc=".$localobject1a->total_ttc."\n"; - $this->assertEquals( 95.40, $localobject1a->total_ht); - $this->assertEquals( 20.03, $localobject1a->total_tva); + $this->assertEquals(95.40, $localobject1a->total_ht); + $this->assertEquals(20.03, $localobject1a->total_tva); $this->assertEquals(115.43, $localobject1a->total_ttc); // With option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 1 @@ -233,8 +233,8 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase $facid=$localobject1b->create($user); $localobject1b->addline($facid, 'Line 1', 6.36, 15, 21); // This include update_price print __METHOD__." id=".$facid." total_ttc=".$localobject1b->total_ttc."\n"; - $this->assertEquals( 95.40, $localobject1b->total_ht, 'testFactureAddLine1 total_ht'); - $this->assertEquals( 20.03, $localobject1b->total_tva, 'testFactureAddLine1 total_tva'); + $this->assertEquals(95.40, $localobject1b->total_ht, 'testFactureAddLine1 total_ht'); + $this->assertEquals(20.03, $localobject1b->total_tva, 'testFactureAddLine1 total_tva'); $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 3', 6.36, 5, 21); print __METHOD__." id=".$facid." total_ttc=".$localobject2->total_ttc."\n"; - $this->assertEquals( 95.40, $localobject2->total_ht); - $this->assertEquals( 20.04, $localobject2->total_tva); + $this->assertEquals(95.40, $localobject2->total_ht); + $this->assertEquals(20.04, $localobject2->total_tva); $this->assertEquals(115.44, $localobject2->total_ttc); // 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 3', 6.36, 5, 21); print __METHOD__." id=".$facid." total_ttc=".$localobject2->total_ttc."\n"; - $this->assertEquals( 95.40, $localobject2->total_ht); - $this->assertEquals( 20.03, $localobject2->total_tva); + $this->assertEquals(95.40, $localobject2->total_ht); + $this->assertEquals(20.03, $localobject2->total_tva); $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 5', 6.36, 3, 21); print __METHOD__." id=".$facid." total_ttc=".$localobject3->total_ttc."\n"; - $this->assertEquals( 95.40, $localobject3->total_ht); - $this->assertEquals( 20.05, $localobject3->total_tva); + $this->assertEquals(95.40, $localobject3->total_ht); + $this->assertEquals(20.05, $localobject3->total_tva); $this->assertEquals(115.45, $localobject3->total_ttc); // 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 5', 6.36, 3, 21); print __METHOD__." id=".$facid." total_ttc=".$localobject3->total_ttc."\n"; - $this->assertEquals( 95.40, $localobject3->total_ht); - $this->assertEquals( 20.03, $localobject3->total_tva); + $this->assertEquals(95.40, $localobject3->total_ht); + $this->assertEquals(20.03, $localobject3->total_tva); $this->assertEquals(115.43, $localobject3->total_ttc); }