This commit is contained in:
Frédéric FRANCE 2019-02-26 21:48:21 +01:00
parent 81f2f99db5
commit 5016bc7188
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
14 changed files with 137 additions and 139 deletions

View File

@ -56,7 +56,7 @@ class BillOfMaterialsApi extends DolibarrApi
* @url GET / * @url GET /
* *
*/ */
function __construct() public function __construct()
{ {
global $db, $conf; global $db, $conf;
$this->db = $db; $this->db = $db;
@ -74,7 +74,7 @@ class BillOfMaterialsApi extends DolibarrApi
* @url GET boms/{id} * @url GET boms/{id}
* @throws RestException * @throws RestException
*/ */
function get($id) public function get($id)
{ {
if(! DolibarrApiAccess::$user->rights->bom->read) { if(! DolibarrApiAccess::$user->rights->bom->read) {
throw new RestException(401); throw new RestException(401);
@ -109,7 +109,7 @@ class BillOfMaterialsApi extends DolibarrApi
* *
* @url GET /boms/ * @url GET /boms/
*/ */
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
{ {
global $db, $conf; global $db, $conf;
@ -196,7 +196,7 @@ class BillOfMaterialsApi extends DolibarrApi
* *
* @url POST boms/ * @url POST boms/
*/ */
function post($request_data = null) public function post($request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->bom->create) { if(! DolibarrApiAccess::$user->rights->bom->create) {
throw new RestException(401); throw new RestException(401);
@ -222,7 +222,7 @@ class BillOfMaterialsApi extends DolibarrApi
* *
* @url PUT boms/{id} * @url PUT boms/{id}
*/ */
function put($id, $request_data = null) public function put($id, $request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->bom->create) { if(! DolibarrApiAccess::$user->rights->bom->create) {
throw new RestException(401); throw new RestException(401);
@ -255,7 +255,7 @@ class BillOfMaterialsApi extends DolibarrApi
* *
* @url DELETE bom/{id} * @url DELETE bom/{id}
*/ */
function delete($id) public function delete($id)
{ {
if(! DolibarrApiAccess::$user->rights->bom->delete) { if(! DolibarrApiAccess::$user->rights->bom->delete) {
throw new RestException(401); throw new RestException(401);
@ -289,7 +289,7 @@ class BillOfMaterialsApi extends DolibarrApi
* @param object $object Object to clean * @param object $object Object to clean
* @return array Array of cleaned object properties * @return array Array of cleaned object properties
*/ */
function _cleanObjectDatas($object) private function _cleanObjectDatas($object)
{ {
$object = parent::_cleanObjectDatas($object); $object = parent::_cleanObjectDatas($object);
@ -311,7 +311,7 @@ class BillOfMaterialsApi extends DolibarrApi
* *
* @throws RestException * @throws RestException
*/ */
function _validate($data) private function _validate($data)
{ {
$bom = array(); $bom = array();
foreach (BillOfMaterialsApi::$FIELDS as $field) { foreach (BillOfMaterialsApi::$FIELDS as $field) {

View File

@ -398,7 +398,7 @@ class BillOfMaterials extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL * @return string String with URL
*/ */
function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
{ {
global $db, $conf, $langs, $hookmanager; global $db, $conf, $langs, $hookmanager;
global $dolibarr_main_authentication, $dolibarr_main_demo; global $dolibarr_main_authentication, $dolibarr_main_demo;
@ -981,7 +981,7 @@ class BillOfMaterialsLine extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL * @return string String with URL
*/ */
function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
{ {
global $db, $conf, $langs, $hookmanager; global $db, $conf, $langs, $hookmanager;
global $dolibarr_main_authentication, $dolibarr_main_demo; global $dolibarr_main_authentication, $dolibarr_main_demo;
@ -1205,4 +1205,3 @@ class BillOfMaterialsLine extends CommonObject
return $error; return $error;
} }
} }

View File

@ -122,4 +122,3 @@ function bomPrepareHead($object)
return $head; return $head;
} }

View File

@ -382,7 +382,7 @@ class modAdherent extends DolibarrModules
global $conf,$langs; global $conf,$langs;
// Permissions // Permissions
$this->removeFromChild(array(), $options); $this->remove($options);
//ODT template //ODT template
/* /*
@ -408,6 +408,6 @@ class modAdherent extends DolibarrModules
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','member',".$conf->entity.")" "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','member',".$conf->entity.")"
); );
return $this->initFromChild($sql, $options); return $this->_init($sql, $options);
} }
} }

View File

@ -230,7 +230,7 @@ class modApi extends DolibarrModules
$result = $this->_load_tables('/api/sql/'); $result = $this->_load_tables('/api/sql/');
return $this->initFromChild($sql, $options); return $this->_init($sql, $options);
} }
/** /**
@ -249,6 +249,6 @@ class modApi extends DolibarrModules
"DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = ".$this->db->encrypt('API_PRODUCTION_MODE', 1) "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = ".$this->db->encrypt('API_PRODUCTION_MODE', 1)
); );
return $this->removeFromChild($sql, $options); return $this->_remove($sql, $options);
} }
} }

View File

@ -325,10 +325,10 @@ class modAsset extends DolibarrModules
global $conf; global $conf;
// Permissions // Permissions
$this->removeFromChild(array(), $options); $this->remove($options);
$sql = array(); $sql = array();
return $this->initFromChild($sql, $options); return $this->_init($sql, $options);
} }
} }

View File

@ -62,7 +62,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal
* *
* @return string Text with description * @return string Text with description
*/ */
function info() public function info()
{ {
global $langs; global $langs;
return $langs->trans("SimpleNumRefModelDesc", $this->prefix); return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
@ -74,7 +74,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal
* *
* @return string Example * @return string Example
*/ */
function getExample() public function getExample()
{ {
return $this->prefix."0501-0001"; return $this->prefix."0501-0001";
} }
@ -86,7 +86,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal
* *
* @return boolean false si conflit, true si ok * @return boolean false si conflit, true si ok
*/ */
function canBeActivated() public function canBeActivated()
{ {
global $conf,$langs,$db; global $conf,$langs,$db;
@ -124,7 +124,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal
* @param Propal $supplier_proposal Object commercial proposal * @param Propal $supplier_proposal Object commercial proposal
* @return string Next value * @return string Next value
*/ */
function getNextValue($objsoc, $supplier_proposal) public function getNextValue($objsoc, $supplier_proposal)
{ {
global $db,$conf; global $db,$conf;
@ -165,7 +165,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal
* @param Object $objforref Object for number to search * @param Object $objforref Object for number to search
* @return string Next free value * @return string Next free value
*/ */
function getNumRef($objsoc, $objforref) public function getNumRef($objsoc, $objforref)
{ {
return $this->getNextValue($objsoc, $objforref); return $this->getNextValue($objsoc, $objforref);
} }

View File

@ -62,7 +62,7 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal
* *
* @return string Texte descripif * @return string Texte descripif
*/ */
function info() public function info()
{ {
global $conf, $langs; global $conf, $langs;
@ -102,7 +102,7 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal
* *
* @return string Example * @return string Example
*/ */
function getExample() public function getExample()
{ {
global $conf,$langs,$mysoc; global $conf,$langs,$mysoc;
@ -125,7 +125,7 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal
* @param Propal $supplier_proposal Object supplier_proposal * @param Propal $supplier_proposal Object supplier_proposal
* @return string Value if OK, 0 if KO * @return string Value if OK, 0 if KO
*/ */
function getNextValue($objsoc, $supplier_proposal) public function getNextValue($objsoc, $supplier_proposal)
{ {
global $db,$conf; global $db,$conf;

View File

@ -42,7 +42,7 @@ abstract class ModelePDFSupplierProposal extends CommonDocGenerator
public $error=''; public $error='';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
@ -50,7 +50,7 @@ abstract class ModelePDFSupplierProposal extends CommonDocGenerator
* @param integer $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
static function liste_modeles($db, $maxfilenamelength = 0) public static function liste_modeles($db, $maxfilenamelength = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@ -81,7 +81,7 @@ abstract class ModeleNumRefSupplierProposal
* *
* @return boolean true if module can be used * @return boolean true if module can be used
*/ */
function isEnabled() public function isEnabled()
{ {
return true; return true;
} }
@ -91,7 +91,7 @@ abstract class ModeleNumRefSupplierProposal
* *
* @return string Texte descripif * @return string Texte descripif
*/ */
function info() public function info()
{ {
global $langs; global $langs;
$langs->load("supplier_proposal"); $langs->load("supplier_proposal");
@ -103,7 +103,7 @@ abstract class ModeleNumRefSupplierProposal
* *
* @return string Example * @return string Example
*/ */
function getExample() public function getExample()
{ {
global $langs; global $langs;
$langs->load("supplier_proposal"); $langs->load("supplier_proposal");
@ -116,7 +116,7 @@ abstract class ModeleNumRefSupplierProposal
* *
* @return boolean false si conflit, true si ok * @return boolean false si conflit, true si ok
*/ */
function canBeActivated() public function canBeActivated()
{ {
return true; return true;
} }
@ -128,7 +128,7 @@ abstract class ModeleNumRefSupplierProposal
* @param Propal $propal Object commercial proposal * @param Propal $propal Object commercial proposal
* @return string Valeur * @return string Valeur
*/ */
function getNextValue($objsoc, $propal) public function getNextValue($objsoc, $propal)
{ {
global $langs; global $langs;
return $langs->trans("NotAvailable"); return $langs->trans("NotAvailable");
@ -139,7 +139,7 @@ abstract class ModeleNumRefSupplierProposal
* *
* @return string Valeur * @return string Valeur
*/ */
function getVersion() public function getVersion()
{ {
global $langs; global $langs;
$langs->load("admin"); $langs->load("admin");