add visibility
This commit is contained in:
parent
739d8f82a5
commit
089875b8a2
@ -411,7 +411,7 @@ class BookKeeping 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;
|
global $db, $conf, $langs;
|
||||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||||
@ -1308,7 +1308,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $importkey Import key
|
* @param string $importkey Import key
|
||||||
* @return int Result
|
* @return int Result
|
||||||
*/
|
*/
|
||||||
function deleteByImportkey($importkey)
|
public function deleteByImportkey($importkey)
|
||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
@ -1338,7 +1338,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $mode Mode
|
* @param string $mode Mode
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function deleteByYearAndJournal($delyear = '', $journal = '', $mode = '')
|
public function deleteByYearAndJournal($delyear = '', $journal = '', $mode = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -1378,7 +1378,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param int $piecenum Piecenum to delete
|
* @param int $piecenum Piecenum to delete
|
||||||
* @return int Result
|
* @return int Result
|
||||||
*/
|
*/
|
||||||
function deleteMvtNum($piecenum)
|
public function deleteMvtNum($piecenum)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -1565,7 +1565,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $mode Mode
|
* @param string $mode Mode
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetchAllPerMvt($piecenum, $mode = '')
|
public function fetchAllPerMvt($piecenum, $mode = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -1618,14 +1618,14 @@ class BookKeeping extends CommonObject
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Export bookkeping
|
* Export bookkeping
|
||||||
*
|
*
|
||||||
* @param string $model Model
|
* @param string $model Model
|
||||||
* @return int Result
|
* @return int Result
|
||||||
*/
|
*/
|
||||||
function export_bookkeping($model = 'ebp')
|
public function export_bookkeping($model = 'ebp')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@ -1771,7 +1771,7 @@ class BookKeeping extends CommonObject
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of accounts with label by chart of accounts
|
* Return list of accounts with label by chart of accounts
|
||||||
*
|
*
|
||||||
@ -1784,7 +1784,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param int $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
|
* @param int $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
|
||||||
* @return string String with HTML select
|
* @return string String with HTML select
|
||||||
*/
|
*/
|
||||||
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
|
public function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@ -1843,14 +1843,14 @@ class BookKeeping extends CommonObject
|
|||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Description of a root accounting account
|
* Description of a root accounting account
|
||||||
*
|
*
|
||||||
* @param string $account Accounting account
|
* @param string $account Accounting account
|
||||||
* @return string Root account
|
* @return string Root account
|
||||||
*/
|
*/
|
||||||
function get_compte_racine($account = null)
|
public function get_compte_racine($account = null)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@ -1884,14 +1884,14 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Description of accounting account
|
* Description of accounting account
|
||||||
*
|
*
|
||||||
* @param string $account Accounting account
|
* @param string $account Accounting account
|
||||||
* @return string Account desc
|
* @return string Account desc
|
||||||
*/
|
*/
|
||||||
function get_compte_desc($account = null)
|
public function get_compte_desc($account = null)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|||||||
@ -32,15 +32,15 @@ abstract class ActionsAdherentCardCommon
|
|||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
var $dirmodule;
|
public $dirmodule;
|
||||||
var $targetmodule;
|
public $targetmodule;
|
||||||
var $canvas;
|
public $canvas;
|
||||||
var $card;
|
public $card;
|
||||||
|
|
||||||
//! Template container
|
//! Template container
|
||||||
var $tpl = array();
|
public $tpl = array();
|
||||||
//! Object container
|
//! Object container
|
||||||
var $object;
|
public $object;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Error code (or message)
|
* @var string Error code (or message)
|
||||||
@ -59,7 +59,7 @@ abstract class ActionsAdherentCardCommon
|
|||||||
* @param int $id Object id
|
* @param int $id Object id
|
||||||
* @return object Object loaded
|
* @return object Object loaded
|
||||||
*/
|
*/
|
||||||
function getObject($id)
|
public function getObject($id)
|
||||||
{
|
{
|
||||||
//$ret = $this->getInstanceDao();
|
//$ret = $this->getInstanceDao();
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ abstract class ActionsAdherentCardCommon
|
|||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set content of ->tpl array, to use into template
|
* Set content of ->tpl array, to use into template
|
||||||
*
|
*
|
||||||
@ -83,7 +83,7 @@ abstract class ActionsAdherentCardCommon
|
|||||||
* @param int $id Id
|
* @param int $id Id
|
||||||
* @return string HTML output
|
* @return string HTML output
|
||||||
*/
|
*/
|
||||||
function assign_values(&$action, $id)
|
public function assign_values(&$action, $id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs, $user, $canvas;
|
global $conf, $langs, $user, $canvas;
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
|||||||
* @param string $canvas Name of canvas
|
* @param string $canvas Name of canvas
|
||||||
* @param string $card Name of tab (sub-canvas)
|
* @param string $card Name of tab (sub-canvas)
|
||||||
*/
|
*/
|
||||||
function __construct($db, $dirmodule, $targetmodule, $canvas, $card)
|
public function __construct($db, $dirmodule, $targetmodule, $canvas, $card)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->dirmodule = $dirmodule;
|
$this->dirmodule = $dirmodule;
|
||||||
@ -67,7 +67,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
|||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Assign custom values for canvas
|
* Assign custom values for canvas
|
||||||
*
|
*
|
||||||
@ -75,7 +75,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
|||||||
* @param int $id Id
|
* @param int $id Id
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function assign_values(&$action, $id)
|
public function assign_values(&$action, $id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $limit, $offset, $sortfield, $sortorder;
|
global $limit, $offset, $sortfield, $sortorder;
|
||||||
@ -122,7 +122,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Fetch datas list and save into ->list_datas
|
* Fetch datas list and save into ->list_datas
|
||||||
*
|
*
|
||||||
@ -132,7 +132,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
|||||||
* @param string $sortorder Sort order ('ASC' or 'DESC')
|
* @param string $sortorder Sort order ('ASC' or 'DESC')
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
|
public function LoadListDatas($limit, $offset, $sortfield, $sortorder)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class Members extends DolibarrApi
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
@ -57,7 +57,7 @@ class Members extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function get($id)
|
public function get($id)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->adherent->lire) {
|
if(! DolibarrApiAccess::$user->rights->adherent->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -91,7 +91,7 @@ class Members extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $sqlfilters = '')
|
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $sqlfilters = '')
|
||||||
{
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ class Members extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of member
|
* @return int ID of member
|
||||||
*/
|
*/
|
||||||
function post($request_data = null)
|
public function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->adherent->creer) {
|
if(! DolibarrApiAccess::$user->rights->adherent->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -187,7 +187,7 @@ class Members extends DolibarrApi
|
|||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = null)
|
public function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->adherent->creer) {
|
if(! DolibarrApiAccess::$user->rights->adherent->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -242,7 +242,7 @@ class Members extends DolibarrApi
|
|||||||
* @param int $id member ID
|
* @param int $id member ID
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function delete($id)
|
public function delete($id)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->adherent->supprimer) {
|
if(! DolibarrApiAccess::$user->rights->adherent->supprimer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -277,7 +277,7 @@ class Members extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function _validate($data)
|
private function _validate($data)
|
||||||
{
|
{
|
||||||
$member = array();
|
$member = array();
|
||||||
foreach (Members::$FIELDS as $field) {
|
foreach (Members::$FIELDS as $field) {
|
||||||
@ -294,7 +294,7 @@ class Members 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);
|
||||||
@ -328,7 +328,7 @@ class Members extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @url GET {id}/subscriptions
|
* @url GET {id}/subscriptions
|
||||||
*/
|
*/
|
||||||
function getSubscriptions($id)
|
public function getSubscriptions($id)
|
||||||
{
|
{
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
|
|
||||||
@ -361,7 +361,7 @@ class Members extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @url POST {id}/subscriptions
|
* @url POST {id}/subscriptions
|
||||||
*/
|
*/
|
||||||
function createSubscription($id, $start_date, $end_date, $amount, $label = '')
|
public function createSubscription($id, $start_date, $end_date, $amount, $label = '')
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) {
|
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -389,7 +389,7 @@ class Members extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @url GET {id}/categories
|
* @url GET {id}/categories
|
||||||
*/
|
*/
|
||||||
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
|
public function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
|
||||||
{
|
{
|
||||||
if (! DolibarrApiAccess::$user->rights->categorie->lire) {
|
if (! DolibarrApiAccess::$user->rights->categorie->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class MembersTypes extends DolibarrApi
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
@ -53,7 +53,7 @@ class MembersTypes extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function get($id)
|
public function get($id)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->adherent->lire) {
|
if(! DolibarrApiAccess::$user->rights->adherent->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -86,7 +86,7 @@ class MembersTypes extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
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;
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ class MembersTypes extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of member type
|
* @return int ID of member type
|
||||||
*/
|
*/
|
||||||
function post($request_data = null)
|
public function post($request_data = null)
|
||||||
{
|
{
|
||||||
if (! DolibarrApiAccess::$user->rights->adherent->configurer) {
|
if (! DolibarrApiAccess::$user->rights->adherent->configurer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -179,7 +179,7 @@ class MembersTypes extends DolibarrApi
|
|||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = null)
|
public function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if (! DolibarrApiAccess::$user->rights->adherent->configurer) {
|
if (! DolibarrApiAccess::$user->rights->adherent->configurer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -220,7 +220,7 @@ class MembersTypes extends DolibarrApi
|
|||||||
* @param int $id member type ID
|
* @param int $id member type ID
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function delete($id)
|
public function delete($id)
|
||||||
{
|
{
|
||||||
if (! DolibarrApiAccess::$user->rights->adherent->configurer) {
|
if (! DolibarrApiAccess::$user->rights->adherent->configurer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -255,7 +255,7 @@ class MembersTypes extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function _validate($data)
|
private function _validate($data)
|
||||||
{
|
{
|
||||||
$membertype = array();
|
$membertype = array();
|
||||||
foreach (MembersTypes::$FIELDS as $field) {
|
foreach (MembersTypes::$FIELDS as $field) {
|
||||||
@ -272,7 +272,7 @@ class MembersTypes 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);
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class Subscriptions extends DolibarrApi
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
@ -56,7 +56,7 @@ class Subscriptions extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function get($id)
|
public function get($id)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->lire) {
|
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -85,7 +85,7 @@ class Subscriptions extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
public function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||||
{
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ class Subscriptions extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of subscription
|
* @return int ID of subscription
|
||||||
*/
|
*/
|
||||||
function post($request_data = null)
|
public function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) {
|
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -176,7 +176,7 @@ class Subscriptions extends DolibarrApi
|
|||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = null)
|
public function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->adherent->creer) {
|
if(! DolibarrApiAccess::$user->rights->adherent->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -209,7 +209,7 @@ class Subscriptions extends DolibarrApi
|
|||||||
* @param int $id ID of subscription to delete
|
* @param int $id ID of subscription to delete
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function delete($id)
|
public function delete($id)
|
||||||
{
|
{
|
||||||
// The right to delete a subscription comes with the right to create one.
|
// The right to delete a subscription comes with the right to create one.
|
||||||
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) {
|
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) {
|
||||||
@ -241,7 +241,7 @@ class Subscriptions extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function _validate($data)
|
private function _validate($data)
|
||||||
{
|
{
|
||||||
$subscription = array();
|
$subscription = array();
|
||||||
foreach (Subscriptions::$FIELDS as $field) {
|
foreach (Subscriptions::$FIELDS as $field) {
|
||||||
|
|||||||
@ -71,7 +71,7 @@ class Subscription extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ class Subscription extends CommonObject
|
|||||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||||
* @return int <0 if KO, Id subscription created if OK
|
* @return int <0 if KO, Id subscription created if OK
|
||||||
*/
|
*/
|
||||||
function create($user, $notrigger = false)
|
public function create($user, $notrigger = false)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ class Subscription extends CommonObject
|
|||||||
* @param int $rowid Id subscription
|
* @param int $rowid Id subscription
|
||||||
* @return int <0 if KO, =0 if not found, >0 if OK
|
* @return int <0 if KO, =0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($rowid)
|
public function fetch($rowid)
|
||||||
{
|
{
|
||||||
$sql ="SELECT rowid, fk_type, fk_adherent, datec,";
|
$sql ="SELECT rowid, fk_type, fk_adherent, datec,";
|
||||||
$sql.=" tms,";
|
$sql.=" tms,";
|
||||||
@ -207,7 +207,7 @@ class Subscription extends CommonObject
|
|||||||
* @param int $notrigger 0=Disable triggers
|
* @param int $notrigger 0=Disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user, $notrigger = 0)
|
public function update($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ class Subscription extends CommonObject
|
|||||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user, $notrigger = false)
|
public function delete($user, $notrigger = false)
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@ -356,7 +356,7 @@ class Subscription 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 Chaine avec URL
|
* @return string Chaine avec URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto = 0, $notooltip = 0, $option = '', $morecss = '', $save_lastsearch_value = -1)
|
public function getNomUrl($withpicto = 0, $notooltip = 0, $option = '', $morecss = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@ -395,19 +395,19 @@ class Subscription extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode = 0)
|
public function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
* @param int $statut Id statut
|
* @param int $statut Id statut
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut)
|
public function LibStatut($statut)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@ -421,7 +421,7 @@ class Subscription extends CommonObject
|
|||||||
* @param int $id Id subscription
|
* @param int $id Id subscription
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function info($id)
|
public function info($id)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT c.rowid, c.datec,';
|
$sql = 'SELECT c.rowid, c.datec,';
|
||||||
$sql.= ' c.tms as datem';
|
$sql.= ' c.tms as datem';
|
||||||
|
|||||||
@ -87,7 +87,7 @@ class DolibarrApi
|
|||||||
);
|
);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||||
/**
|
/**
|
||||||
* Clean sensible object datas
|
* Clean sensible object datas
|
||||||
*
|
*
|
||||||
@ -96,7 +96,7 @@ class DolibarrApi
|
|||||||
*/
|
*/
|
||||||
protected function _cleanObjectDatas($object)
|
protected function _cleanObjectDatas($object)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
// Remove $db object property for object
|
// Remove $db object property for object
|
||||||
unset($object->db);
|
unset($object->db);
|
||||||
unset($object->isextrafieldmanaged);
|
unset($object->isextrafieldmanaged);
|
||||||
@ -208,6 +208,7 @@ class DolibarrApi
|
|||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||||
/**
|
/**
|
||||||
* Check user access to a resource
|
* Check user access to a resource
|
||||||
*
|
*
|
||||||
@ -224,7 +225,7 @@ class DolibarrApi
|
|||||||
*/
|
*/
|
||||||
protected static function _checkAccessToResource($resource, $resource_id = 0, $dbtablename = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid')
|
protected static function _checkAccessToResource($resource, $resource_id = 0, $dbtablename = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
// Features/modules to check
|
// Features/modules to check
|
||||||
$featuresarray = array($resource);
|
$featuresarray = array($resource);
|
||||||
if (preg_match('/&/', $resource)) {
|
if (preg_match('/&/', $resource)) {
|
||||||
@ -242,6 +243,7 @@ class DolibarrApi
|
|||||||
return checkUserAccessToObject(DolibarrApiAccess::$user, $featuresarray, $resource_id, $dbtablename, $feature2, $dbt_keyfield, $dbt_select);
|
return checkUserAccessToObject(DolibarrApiAccess::$user, $featuresarray, $resource_id, $dbtablename, $feature2, $dbt_keyfield, $dbt_select);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||||
/**
|
/**
|
||||||
* Return if a $sqlfilters parameter is valid
|
* Return if a $sqlfilters parameter is valid
|
||||||
*
|
*
|
||||||
@ -250,6 +252,7 @@ class DolibarrApi
|
|||||||
*/
|
*/
|
||||||
protected function _checkFilters($sqlfilters)
|
protected function _checkFilters($sqlfilters)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
//$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
//$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||||
//$tmp=preg_replace_all('/'.$regexstring.'/', '', $sqlfilters);
|
//$tmp=preg_replace_all('/'.$regexstring.'/', '', $sqlfilters);
|
||||||
$tmp=$sqlfilters;
|
$tmp=$sqlfilters;
|
||||||
@ -272,6 +275,7 @@ class DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||||
/**
|
/**
|
||||||
* Function to forge a SQL criteria
|
* Function to forge a SQL criteria
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user