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 PropaleLigne extends CommonObjectLine
class PropaleLigne extends CommonObjectLine
{
public $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.
* 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 = 'pmp' and pmp is calculated, use pmp as buyprice
* else set min buy price as buy price
*
* @param float $unitPrice product unit price
* @param float $discountPercent line discount percent
* @param int $fk_product product id
*
* @return float <0 if ko, buyprice if ok
* @param float $unitPrice Product unit price
* @param float $discountPercent Line discount percent
* @param int $fk_product Product id
* @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;
@ -4973,6 +4972,8 @@ abstract class CommonObject
$fields = array_merge(array('datec'=>$this->db->idate(dol_now())), $this->set_save_query());
$keys=array();
$values = array();
foreach ($fields as $k => $v) {
$keys[] = $k;
$values[] = $this->quote($v);

View File

@ -25,13 +25,13 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php';
/**
* Class to offer components to list and upload files
*/
class FormMailing extends Form
class FormMailing extends Form
{
public $errors=array();
/**
* Output a select with destinaries status
*
*
* @param string $selectedid The selected id
* @param string $htmlname Name of controm
* @param integer $show_empty Show empty option
@ -46,7 +46,7 @@ class FormMailing extends Form
$mailing = new Mailing($this->db);
$options = array();
if ($show_empty) {
$options[-2] = ''; // Note -1 is used for error
}

View File

@ -55,6 +55,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask)
{
include_once $pathoffiletoeditsrc;
if (class_exists($objectname)) $object=new $objectname($db);
else return -1;
// Backup old file
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(dol_osencode($pathoffiletoedittarget), $contentclass);
@chmod($pathoffiletoedit, octdec($newmask));
@chmod($pathoffiletoedittarget, octdec($newmask));
return 1;
}
@ -139,6 +140,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask)
{
dol_include_once(strtolower($module).'/class/'.strtolower($objectname).'.class.php');
if (class_exists($objectname)) $object=new $objectname($db);
else return -1;
}
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);
file_put_contents($pathoffiletoedittarget, $contentsql);
@chmod($pathoffiletoedit, octdec($newmask));
@chmod($pathoffiletoedittarget, octdec($newmask));
// 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);
file_put_contents($pathoffiletoedittarget, $contentsql);
@chmod($pathoffiletoedit, octdec($newmask));
@chmod($pathoffiletoedittarget, octdec($newmask));
return 1;
}

View File

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