Fix phpcs

This commit is contained in:
Laurent Destailleur 2017-07-13 23:46:01 +02:00
parent 652d715fdc
commit 312b153005
5 changed files with 19 additions and 17 deletions

View File

@ -3502,7 +3502,7 @@ class Propal extends CommonObject
/** /**
* Class to manage commercial proposal lines * Class to manage commercial proposal lines
*/ */
class PropaleLigne extends CommonObjectLine class PropaleLigne extends CommonObjectLine
{ {
public $element='propaldet'; public $element='propaldet';
public $table_element='propaldet'; public $table_element='propaldet';

View File

@ -4655,18 +4655,17 @@ abstract class CommonObject
/** /**
* Get buy price to use for margin calculation. This function is called when buy price is unknown. * Get buy price to use for margin calculation. This function is called when buy price is unknown.
* set buy price = sell price if ForceBuyingPriceIfNull configured, * Set buy price = sell price if ForceBuyingPriceIfNull configured,
* else if calculation MARGIN_TYPE = 'costprice' and costprice is defined, use costprice as buyprice * else if calculation MARGIN_TYPE = 'costprice' and costprice is defined, use costprice as buyprice
* else if calculation MARGIN_TYPE = 'pmp' and pmp is calculated, use pmp as buyprice * else if calculation MARGIN_TYPE = 'pmp' and pmp is calculated, use pmp as buyprice
* else set min buy price as buy price * else set min buy price as buy price
* *
* @param float $unitPrice product unit price * @param float $unitPrice Product unit price
* @param float $discountPercent line discount percent * @param float $discountPercent Line discount percent
* @param int $fk_product product id * @param int $fk_product Product id
* * @return float <0 if KO, buyprice if OK
* @return float <0 if ko, buyprice if ok
*/ */
public function defineBuyPrice($unitPrice = 0, $discountPercent = 0, $fk_product = 0) public function defineBuyPrice($unitPrice = 0.0, $discountPercent = 0.0, $fk_product = 0)
{ {
global $conf; global $conf;
@ -4973,6 +4972,8 @@ abstract class CommonObject
$fields = array_merge(array('datec'=>$this->db->idate(dol_now())), $this->set_save_query()); $fields = array_merge(array('datec'=>$this->db->idate(dol_now())), $this->set_save_query());
$keys=array();
$values = array();
foreach ($fields as $k => $v) { foreach ($fields as $k => $v) {
$keys[] = $k; $keys[] = $k;
$values[] = $this->quote($v); $values[] = $this->quote($v);

View File

@ -25,7 +25,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php';
/** /**
* Class to offer components to list and upload files * Class to offer components to list and upload files
*/ */
class FormMailing extends Form class FormMailing extends Form
{ {
public $errors=array(); public $errors=array();

View File

@ -55,6 +55,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask)
{ {
include_once $pathoffiletoeditsrc; include_once $pathoffiletoeditsrc;
if (class_exists($objectname)) $object=new $objectname($db); if (class_exists($objectname)) $object=new $objectname($db);
else return -1;
// Backup old file // Backup old file
dol_copy($pathoffiletoeditsrc, $pathoffiletoeditsrc.'.back', $newmask, 1); dol_copy($pathoffiletoeditsrc, $pathoffiletoeditsrc.'.back', $newmask, 1);
@ -109,7 +110,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask)
//file_put_contents($pathoffiletoedittmp, $contentclass); //file_put_contents($pathoffiletoedittmp, $contentclass);
file_put_contents(dol_osencode($pathoffiletoedittarget), $contentclass); file_put_contents(dol_osencode($pathoffiletoedittarget), $contentclass);
@chmod($pathoffiletoedit, octdec($newmask)); @chmod($pathoffiletoedittarget, octdec($newmask));
return 1; return 1;
} }
@ -139,6 +140,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask)
{ {
dol_include_once(strtolower($module).'/class/'.strtolower($objectname).'.class.php'); dol_include_once(strtolower($module).'/class/'.strtolower($objectname).'.class.php');
if (class_exists($objectname)) $object=new $objectname($db); if (class_exists($objectname)) $object=new $objectname($db);
else return -1;
} }
catch(Exception $e) catch(Exception $e)
{ {
@ -171,7 +173,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask)
$contentsql = preg_replace('/-- BEGIN MODULEBUILDER FIELDS.*END MODULEBUILDER FIELDS/ims', $texttoinsert, $contentsql); $contentsql = preg_replace('/-- BEGIN MODULEBUILDER FIELDS.*END MODULEBUILDER FIELDS/ims', $texttoinsert, $contentsql);
file_put_contents($pathoffiletoedittarget, $contentsql); file_put_contents($pathoffiletoedittarget, $contentsql);
@chmod($pathoffiletoedit, octdec($newmask)); @chmod($pathoffiletoedittarget, octdec($newmask));
// Edit .key.sql file // Edit .key.sql file
@ -199,7 +201,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask)
$contentsql = preg_replace('/-- BEGIN MODULEBUILDER INDEXES.*END MODULEBUILDER INDEXES/ims', $texttoinsert, $contentsql); $contentsql = preg_replace('/-- BEGIN MODULEBUILDER INDEXES.*END MODULEBUILDER INDEXES/ims', $texttoinsert, $contentsql);
file_put_contents($pathoffiletoedittarget, $contentsql); file_put_contents($pathoffiletoedittarget, $contentsql);
@chmod($pathoffiletoedit, octdec($newmask)); @chmod($pathoffiletoedittarget, octdec($newmask));
return 1; return 1;
} }

View File

@ -2563,10 +2563,9 @@ class SupplierProposal extends CommonObject
/** /**
* \class SupplierProposalLine * Class to manage supplier_proposal lines
* \brief Class to manage supplier_proposal lines
*/ */
class SupplierProposalLine extends CommonObjectLine class SupplierProposalLine extends CommonObjectLine
{ {
var $db; var $db;
var $error; var $error;