function declaration
This commit is contained in:
parent
7c6f41e04f
commit
7bb781eea8
@ -12,6 +12,7 @@
|
|||||||
<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
|
<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
|
||||||
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
||||||
<exclude-pattern type="relative">*.min.css</exclude-pattern>
|
<exclude-pattern type="relative">*.min.css</exclude-pattern>
|
||||||
|
<exclude-pattern type="relative">*.js</exclude-pattern>
|
||||||
|
|
||||||
<!-- List of all tests -->
|
<!-- List of all tests -->
|
||||||
|
|
||||||
@ -157,7 +158,7 @@
|
|||||||
<!-- Disabled as this does not support tab -->
|
<!-- Disabled as this does not support tab -->
|
||||||
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
|
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
|
||||||
|
|
||||||
|
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
|
||||||
|
|
||||||
<!-- Rules from PEAR Standard -->
|
<!-- Rules from PEAR Standard -->
|
||||||
|
|
||||||
|
|||||||
@ -78,7 +78,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @param DoliDb $db Database handler
|
* @param DoliDb $db Database handler
|
||||||
*/
|
*/
|
||||||
public function __construct(DoliDB &$db) {
|
public function __construct(DoliDB &$db)
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$this->db = &$db;
|
$this->db = &$db;
|
||||||
@ -91,7 +92,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return array of type
|
* @return array of type
|
||||||
*/
|
*/
|
||||||
public static function getType() {
|
public static function getType()
|
||||||
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
return array (
|
return array (
|
||||||
@ -113,7 +115,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return array of type
|
* @return array of type
|
||||||
*/
|
*/
|
||||||
public static function getTypeConfig() {
|
public static function getTypeConfig()
|
||||||
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
return array (
|
return array (
|
||||||
@ -175,7 +178,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function downloadFile() {
|
public static function downloadFile()
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$filename = 'general_ledger';
|
$filename = 'general_ledger';
|
||||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||||
@ -186,7 +190,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @param unknown $TData data
|
* @param unknown $TData data
|
||||||
*/
|
*/
|
||||||
public function export(&$TData) {
|
public function export(&$TData)
|
||||||
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
self::downloadFile();
|
self::downloadFile();
|
||||||
@ -235,7 +240,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportNormal($objectLines) {
|
public function exportNormal($objectLines)
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
foreach ( $objectLines as $line ) {
|
foreach ( $objectLines as $line ) {
|
||||||
@ -259,7 +265,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportCegid($objectLines) {
|
public function exportCegid($objectLines)
|
||||||
|
{
|
||||||
foreach ( $objectLines as $line ) {
|
foreach ( $objectLines as $line ) {
|
||||||
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
||||||
$separator = ";";
|
$separator = ";";
|
||||||
@ -284,7 +291,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportCogilog($objectLines) {
|
public function exportCogilog($objectLines)
|
||||||
|
{
|
||||||
foreach ( $objectLines as $line ) {
|
foreach ( $objectLines as $line ) {
|
||||||
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
||||||
$separator = ";";
|
$separator = ";";
|
||||||
@ -317,7 +325,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportCoala($objectLines) {
|
public function exportCoala($objectLines)
|
||||||
|
{
|
||||||
// Coala export
|
// Coala export
|
||||||
$separator = ";";
|
$separator = ";";
|
||||||
$end_line = "\n";
|
$end_line = "\n";
|
||||||
@ -344,7 +353,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportBob50($objectLines) {
|
public function exportBob50($objectLines)
|
||||||
|
{
|
||||||
|
|
||||||
// Bob50
|
// Bob50
|
||||||
$separator = ";";
|
$separator = ";";
|
||||||
@ -382,7 +392,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportCiel(&$TData) {
|
public function exportCiel(&$TData)
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$end_line ="\r\n";
|
$end_line ="\r\n";
|
||||||
@ -422,7 +433,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportQuadratus(&$TData) {
|
public function exportQuadratus(&$TData)
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$end_line ="\r\n";
|
$end_line ="\r\n";
|
||||||
@ -505,7 +517,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportEbp($objectLines) {
|
public function exportEbp($objectLines)
|
||||||
|
{
|
||||||
|
|
||||||
$separator = ',';
|
$separator = ',';
|
||||||
$end_line = "\n";
|
$end_line = "\n";
|
||||||
@ -537,7 +550,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportAgiris($objectLines) {
|
public function exportAgiris($objectLines)
|
||||||
|
{
|
||||||
|
|
||||||
$separator = ';';
|
$separator = ';';
|
||||||
$end_line = "\n";
|
$end_line = "\n";
|
||||||
@ -574,7 +588,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportConfigurable($objectLines) {
|
public function exportConfigurable($objectLines)
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
foreach ($objectLines as $line) {
|
foreach ($objectLines as $line) {
|
||||||
@ -603,7 +618,8 @@ class AccountancyExport
|
|||||||
* @param unknown $str data
|
* @param unknown $str data
|
||||||
* @param integer $size data
|
* @param integer $size data
|
||||||
*/
|
*/
|
||||||
public static function trunc($str, $size) {
|
public static function trunc($str, $size)
|
||||||
|
{
|
||||||
return dol_trunc($str, $size, 'right', 'UTF-8', 1);
|
return dol_trunc($str, $size, 'right', 'UTF-8', 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,7 +88,8 @@ class BookKeeping extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param DoliDb $db Database handler
|
* @param DoliDb $db Database handler
|
||||||
*/
|
*/
|
||||||
public function __construct(DoliDB $db) {
|
public function __construct(DoliDB $db)
|
||||||
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +100,8 @@ class BookKeeping 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 of created object if OK
|
* @return int <0 if KO, Id of created object if OK
|
||||||
*/
|
*/
|
||||||
public function create(User $user, $notrigger = false) {
|
public function create(User $user, $notrigger = false)
|
||||||
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
@ -420,7 +422,8 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $mode Mode
|
* @param string $mode Mode
|
||||||
* @return int <0 if KO, Id of created object if OK
|
* @return int <0 if KO, Id of created object if OK
|
||||||
*/
|
*/
|
||||||
public function createStd(User $user, $notrigger = false, $mode='') {
|
public function createStd(User $user, $notrigger = false, $mode='')
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
@ -590,7 +593,8 @@ class BookKeeping extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function fetch($id, $ref = null, $mode='') {
|
public function fetch($id, $ref = null, $mode='')
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
@ -687,7 +691,8 @@ class BookKeeping extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
public function fetchAllByAccount($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') {
|
public function fetchAllByAccount($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
@ -811,7 +816,8 @@ class BookKeeping extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') {
|
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
@ -1016,7 +1022,8 @@ 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
|
||||||
*/
|
*/
|
||||||
public function update(User $user, $notrigger = false, $mode='') {
|
public function update(User $user, $notrigger = false, $mode='')
|
||||||
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
@ -1185,7 +1192,8 @@ 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
|
||||||
*/
|
*/
|
||||||
public function delete(User $user, $notrigger = false, $mode='') {
|
public function delete(User $user, $notrigger = false, $mode='')
|
||||||
|
{
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -1234,7 +1242,8 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $importkey Import key
|
* @param string $importkey Import key
|
||||||
* @return int Result
|
* @return int Result
|
||||||
*/
|
*/
|
||||||
function deleteByImportkey($importkey) {
|
function deleteByImportkey($importkey)
|
||||||
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// first check if line not yet in bookkeeping
|
// first check if line not yet in bookkeeping
|
||||||
@ -1263,7 +1272,8 @@ 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='') {
|
function deleteByYearAndJournal($delyear='', $journal='', $mode='')
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if (empty($delyear) && empty($journal))
|
if (empty($delyear) && empty($journal))
|
||||||
@ -1302,7 +1312,8 @@ 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) {
|
function deleteMvtNum($piecenum)
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -1336,7 +1347,8 @@ class BookKeeping extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int New id of clone
|
* @return int New id of clone
|
||||||
*/
|
*/
|
||||||
public function createFromClone($fromid) {
|
public function createFromClone($fromid)
|
||||||
|
{
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
@ -1381,7 +1393,8 @@ class BookKeeping extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function initAsSpecimen() {
|
public function initAsSpecimen()
|
||||||
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
@ -1417,7 +1430,8 @@ 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
|
||||||
*/
|
*/
|
||||||
public function fetchPerMvt($piecenum, $mode='') {
|
public function fetchPerMvt($piecenum, $mode='')
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT piece_num,doc_date,code_journal,journal_label,doc_ref,doc_type,date_creation";
|
$sql = "SELECT piece_num,doc_date,code_journal,journal_label,doc_ref,doc_type,date_creation";
|
||||||
@ -1481,7 +1495,8 @@ 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='') {
|
function fetchAllPerMvt($piecenum, $mode='')
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT rowid, doc_date, doc_type,";
|
$sql = "SELECT rowid, doc_date, doc_type,";
|
||||||
@ -1539,7 +1554,8 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $model Model
|
* @param string $model Model
|
||||||
* @return int Result
|
* @return int Result
|
||||||
*/
|
*/
|
||||||
function export_bookkeping($model = 'ebp') {
|
function export_bookkeping($model = 'ebp')
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT rowid, doc_date, doc_type,";
|
$sql = "SELECT rowid, doc_date, doc_type,";
|
||||||
@ -1696,7 +1712,8 @@ 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 = '') {
|
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
|||||||
@ -69,7 +69,8 @@ class PrestaShopWebservice
|
|||||||
* @param string $key Authentification key
|
* @param string $key Authentification key
|
||||||
* @param mixed $debug Debug mode Activated (true) or deactivated (false)
|
* @param mixed $debug Debug mode Activated (true) or deactivated (false)
|
||||||
*/
|
*/
|
||||||
function __construct($url, $key, $debug = true) {
|
function __construct($url, $key, $debug = true)
|
||||||
|
{
|
||||||
if (!extension_loaded('curl'))
|
if (!extension_loaded('curl'))
|
||||||
throw new PrestaShopWebserviceException('Please activate the PHP extension \'curl\' to allow use of PrestaShop webservice library');
|
throw new PrestaShopWebserviceException('Please activate the PHP extension \'curl\' to allow use of PrestaShop webservice library');
|
||||||
$this->url = $url;
|
$this->url = $url;
|
||||||
|
|||||||
@ -652,7 +652,7 @@ class Facturation
|
|||||||
{
|
{
|
||||||
return $this->prix_total_ttc;
|
return $this->prix_total_ttc;
|
||||||
}
|
}
|
||||||
else if ( $aTotalTtc == 'RESET' )
|
elseif ( $aTotalTtc == 'RESET' )
|
||||||
{
|
{
|
||||||
$this->prix_total_ttc = null;
|
$this->prix_total_ttc = null;
|
||||||
}
|
}
|
||||||
@ -663,4 +663,3 @@ class Facturation
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,8 @@ class Categories extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $sqlfilters = '') {
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@ -266,7 +267,8 @@ class Categories extends DolibarrApi
|
|||||||
* @param Categorie $object Object to clean
|
* @param Categorie $object Object to clean
|
||||||
* @return array Array of cleaned object properties
|
* @return array Array of cleaned object properties
|
||||||
*/
|
*/
|
||||||
function _cleanObjectDatas($object) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
|||||||
@ -916,7 +916,8 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
* For exemple jean;joe;jim%%;!jimo;!jima%> will target all jean, joe, start with jim but not jimo and not everythnig taht start by jima
|
* For exemple jean;joe;jim%%;!jimo;!jima%> will target all jean, joe, start with jim but not jimo and not everythnig taht start by jima
|
||||||
* @return string Sql to use for the where condition
|
* @return string Sql to use for the where condition
|
||||||
*/
|
*/
|
||||||
public function transformToSQL($column_to_test,$criteria) {
|
public function transformToSQL($column_to_test,$criteria)
|
||||||
|
{
|
||||||
$return_sql_criteria = '(';
|
$return_sql_criteria = '(';
|
||||||
|
|
||||||
//This is a multiple value test
|
//This is a multiple value test
|
||||||
|
|||||||
@ -34,7 +34,8 @@ class FormAdvTargetEmailing extends Form
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db handler
|
* @param DoliDB $db handler
|
||||||
*/
|
*/
|
||||||
function __construct($db) {
|
function __construct($db)
|
||||||
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
@ -47,7 +48,8 @@ class FormAdvTargetEmailing extends Form
|
|||||||
* @param string $htmlname select field
|
* @param string $htmlname select field
|
||||||
* @return string select field
|
* @return string select field
|
||||||
*/
|
*/
|
||||||
function multiselectProspectionStatus($selected_array = array(), $htmlname = 'cust_prospect_status') {
|
function multiselectProspectionStatus($selected_array = array(), $htmlname = 'cust_prospect_status')
|
||||||
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$options_array = array();
|
$options_array = array();
|
||||||
|
|
||||||
@ -83,7 +85,8 @@ class FormAdvTargetEmailing extends Form
|
|||||||
* @param array $selected_array or Code or Label of preselected country
|
* @param array $selected_array or Code or Label of preselected country
|
||||||
* @return string HTML string with select
|
* @return string HTML string with select
|
||||||
*/
|
*/
|
||||||
function multiselectCountry($htmlname = 'country_id', $selected_array=array()) {
|
function multiselectCountry($htmlname = 'country_id', $selected_array=array())
|
||||||
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("dict");
|
$langs->load("dict");
|
||||||
@ -143,7 +146,8 @@ class FormAdvTargetEmailing extends Form
|
|||||||
* @param User $user User action
|
* @param User $user User action
|
||||||
* @return string combo list code
|
* @return string combo list code
|
||||||
*/
|
*/
|
||||||
function multiselectselectSalesRepresentatives($htmlname, $selected_array, $user) {
|
function multiselectselectSalesRepresentatives($htmlname, $selected_array, $user)
|
||||||
|
{
|
||||||
|
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -184,7 +188,8 @@ class FormAdvTargetEmailing extends Form
|
|||||||
* @param array $selected_array selected array
|
* @param array $selected_array selected array
|
||||||
* @return string combo list code
|
* @return string combo list code
|
||||||
*/
|
*/
|
||||||
function multiselectselectLanguage($htmlname='', $selected_array=array()) {
|
function multiselectselectLanguage($htmlname='', $selected_array=array())
|
||||||
|
{
|
||||||
|
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@ -330,7 +335,8 @@ class FormAdvTargetEmailing extends Form
|
|||||||
* @param int $showempty show empty
|
* @param int $showempty show empty
|
||||||
* @return string HTML combo
|
* @return string HTML combo
|
||||||
*/
|
*/
|
||||||
function advMultiselectarray($htmlname, $options_array = array(), $selected_array = array(), $showempty = 0) {
|
function advMultiselectarray($htmlname, $options_array = array(), $selected_array = array(), $showempty = 0)
|
||||||
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$form=new Form($this->db);
|
$form=new Form($this->db);
|
||||||
@ -417,7 +423,8 @@ class FormAdvTargetEmailing extends Form
|
|||||||
* @param string $type_element Type element. Example: 'mailing'
|
* @param string $type_element Type element. Example: 'mailing'
|
||||||
* @return string HTML combo
|
* @return string HTML combo
|
||||||
*/
|
*/
|
||||||
public function selectAdvtargetemailingTemplate($htmlname='template_id', $selected=0, $showempty=0, $type_element='mailing') {
|
public function selectAdvtargetemailingTemplate($htmlname='template_id', $selected=0, $showempty=0, $type_element='mailing')
|
||||||
|
{
|
||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|||||||
@ -97,7 +97,8 @@ class Proposals extends DolibarrApi
|
|||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')"
|
||||||
* @return array Array of order objects
|
* @return array Array of order objects
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') {
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@ -215,7 +216,8 @@ class Proposals extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function getLines($id) {
|
function getLines($id)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->propal->lire) {
|
if(! DolibarrApiAccess::$user->rights->propal->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -381,7 +383,8 @@ class Proposals extends DolibarrApi
|
|||||||
* @throws 401
|
* @throws 401
|
||||||
* @throws 404
|
* @throws 404
|
||||||
*/
|
*/
|
||||||
function deleteLine($id, $lineid) {
|
function deleteLine($id, $lineid)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -415,7 +418,8 @@ class Proposals extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = null) {
|
function put($id, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -709,7 +713,8 @@ class Proposals 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) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,8 @@ class Orders extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') {
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@ -218,7 +219,8 @@ class Orders extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function getLines($id) {
|
function getLines($id)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->commande->lire) {
|
if(! DolibarrApiAccess::$user->rights->commande->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -249,7 +251,8 @@ class Orders extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function postLine($id, $request_data = null) {
|
function postLine($id, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -311,7 +314,8 @@ class Orders extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
function putLine($id, $lineid, $request_data = null) {
|
function putLine($id, $lineid, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -371,7 +375,8 @@ class Orders extends DolibarrApi
|
|||||||
* @throws 401
|
* @throws 401
|
||||||
* @throws 404
|
* @throws 404
|
||||||
*/
|
*/
|
||||||
function deleteLine($id, $lineid) {
|
function deleteLine($id, $lineid)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -403,7 +408,8 @@ class Orders extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = null) {
|
function put($id, $request_data = null)
|
||||||
|
{
|
||||||
if (! DolibarrApiAccess::$user->rights->commande->creer) {
|
if (! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -544,7 +550,8 @@ class Orders extends DolibarrApi
|
|||||||
* @throws 404
|
* @throws 404
|
||||||
* @throws 405
|
* @throws 405
|
||||||
*/
|
*/
|
||||||
function reopen($id) {
|
function reopen($id)
|
||||||
|
{
|
||||||
|
|
||||||
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -581,7 +588,8 @@ class Orders extends DolibarrApi
|
|||||||
* @throws 404
|
* @throws 404
|
||||||
* @throws 405
|
* @throws 405
|
||||||
*/
|
*/
|
||||||
function setinvoiced($id) {
|
function setinvoiced($id)
|
||||||
|
{
|
||||||
|
|
||||||
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -720,7 +728,8 @@ class Orders extends DolibarrApi
|
|||||||
* @throws 404
|
* @throws 404
|
||||||
* @throws 405
|
* @throws 405
|
||||||
*/
|
*/
|
||||||
function createOrderFromProposal($proposalid) {
|
function createOrderFromProposal($proposalid)
|
||||||
|
{
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
|
||||||
|
|
||||||
@ -756,7 +765,8 @@ class Orders 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) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class Invoices extends DolibarrApi
|
|||||||
* @var array $FIELDS Mandatory fields, checked when create and update object
|
* @var array $FIELDS Mandatory fields, checked when create and update object
|
||||||
*/
|
*/
|
||||||
static $FIELDS = array(
|
static $FIELDS = array(
|
||||||
'socid'
|
'socid',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -104,7 +104,8 @@ class Invoices extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '') {
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@ -245,7 +246,8 @@ class Invoices extends DolibarrApi
|
|||||||
* @throws 404
|
* @throws 404
|
||||||
* @throws 405
|
* @throws 405
|
||||||
*/
|
*/
|
||||||
function createInvoiceFromOrder($orderid) {
|
function createInvoiceFromOrder($orderid)
|
||||||
|
{
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
|
||||||
|
|
||||||
@ -282,7 +284,8 @@ class Invoices extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function getLines($id) {
|
function getLines($id)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->facture->lire) {
|
if(! DolibarrApiAccess::$user->rights->facture->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -319,7 +322,8 @@ class Invoices extends DolibarrApi
|
|||||||
* @throws 401
|
* @throws 401
|
||||||
* @throws 404
|
* @throws 404
|
||||||
*/
|
*/
|
||||||
function putLine($id, $lineid, $request_data = null) {
|
function putLine($id, $lineid, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -383,7 +387,8 @@ class Invoices extends DolibarrApi
|
|||||||
* @throws 404
|
* @throws 404
|
||||||
* @throws 405
|
* @throws 405
|
||||||
*/
|
*/
|
||||||
function deleteLine($id, $lineid) {
|
function deleteLine($id, $lineid)
|
||||||
|
{
|
||||||
|
|
||||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -511,7 +516,8 @@ class Invoices extends DolibarrApi
|
|||||||
* @throws 404
|
* @throws 404
|
||||||
* @throws 400
|
* @throws 400
|
||||||
*/
|
*/
|
||||||
function postLine($id, $request_data = null) {
|
function postLine($id, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -849,7 +855,8 @@ class Invoices extends DolibarrApi
|
|||||||
* @throws 404
|
* @throws 404
|
||||||
* @throws 405
|
* @throws 405
|
||||||
*/
|
*/
|
||||||
function useDiscount($id, $discountid) {
|
function useDiscount($id, $discountid)
|
||||||
|
{
|
||||||
|
|
||||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -894,7 +901,8 @@ class Invoices extends DolibarrApi
|
|||||||
* @throws 404
|
* @throws 404
|
||||||
* @throws 405
|
* @throws 405
|
||||||
*/
|
*/
|
||||||
function useCreditNote($id, $discountid) {
|
function useCreditNote($id, $discountid)
|
||||||
|
{
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
|
||||||
|
|
||||||
@ -938,7 +946,8 @@ class Invoices extends DolibarrApi
|
|||||||
* @throws 404
|
* @throws 404
|
||||||
* @throws 405
|
* @throws 405
|
||||||
*/
|
*/
|
||||||
function getPayments($id) {
|
function getPayments($id)
|
||||||
|
{
|
||||||
|
|
||||||
if(! DolibarrApiAccess::$user->rights->facture->lire) {
|
if(! DolibarrApiAccess::$user->rights->facture->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -985,7 +994,8 @@ class Invoices extends DolibarrApi
|
|||||||
* @throws 401
|
* @throws 401
|
||||||
* @throws 404
|
* @throws 404
|
||||||
*/
|
*/
|
||||||
function addPayment($id, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement='', $comment='', $chqemetteur='', $chqbank='') {
|
function addPayment($id, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement='', $comment='', $chqemetteur='', $chqbank='')
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
|
||||||
@ -1215,7 +1225,8 @@ class Invoices 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) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
@ -1241,8 +1252,9 @@ class Invoices extends DolibarrApi
|
|||||||
{
|
{
|
||||||
$invoice = array();
|
$invoice = array();
|
||||||
foreach (Invoices::$FIELDS as $field) {
|
foreach (Invoices::$FIELDS as $field) {
|
||||||
if (!isset($data[$field]))
|
if (!isset($data[$field])) {
|
||||||
throw new RestException(400, "$field field missing");
|
throw new RestException(400, "$field field missing");
|
||||||
|
}
|
||||||
$invoice[$field] = $data[$field];
|
$invoice[$field] = $data[$field];
|
||||||
}
|
}
|
||||||
return $invoice;
|
return $invoice;
|
||||||
|
|||||||
@ -100,7 +100,8 @@ class Contracts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') {
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@ -216,7 +217,8 @@ class Contracts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function getLines($id) {
|
function getLines($id)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->contrat->lire) {
|
if(! DolibarrApiAccess::$user->rights->contrat->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -247,7 +249,8 @@ class Contracts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function postLine($id, $request_data = null) {
|
function postLine($id, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -300,7 +303,8 @@ class Contracts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
function putLine($id, $lineid, $request_data = null) {
|
function putLine($id, $lineid, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -359,7 +363,8 @@ class Contracts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
function activateLine($id, $lineid, $datestart, $dateend = null, $comment = null) {
|
function activateLine($id, $lineid, $datestart, $dateend = null, $comment = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -396,7 +401,8 @@ class Contracts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
function unactivateLine($id, $lineid, $datestart, $comment = null) {
|
function unactivateLine($id, $lineid, $datestart, $comment = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -436,7 +442,8 @@ class Contracts extends DolibarrApi
|
|||||||
* @throws 401
|
* @throws 401
|
||||||
* @throws 404
|
* @throws 404
|
||||||
*/
|
*/
|
||||||
function deleteLine($id, $lineid) {
|
function deleteLine($id, $lineid)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -470,7 +477,8 @@ class Contracts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = null) {
|
function put($id, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -632,7 +640,8 @@ class Contracts 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) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
|||||||
@ -2350,7 +2350,8 @@ class Contrat extends CommonObject
|
|||||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||||
* @return int New id of clone
|
* @return int New id of clone
|
||||||
*/
|
*/
|
||||||
function createFromClone($socid = 0, $notrigger=0) {
|
function createFromClone($socid = 0, $notrigger=0)
|
||||||
|
{
|
||||||
global $db, $user, $langs, $conf, $hookmanager;
|
global $db, $user, $langs, $conf, $hookmanager;
|
||||||
|
|
||||||
dol_include_once('/projet/class/project.class.php');
|
dol_include_once('/projet/class/project.class.php');
|
||||||
|
|||||||
@ -6873,7 +6873,8 @@ abstract class CommonObject
|
|||||||
* @param array $fieldsentry Properties of field
|
* @param array $fieldsentry Properties of field
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function quote($value, $fieldsentry) {
|
protected function quote($value, $fieldsentry)
|
||||||
|
{
|
||||||
if (is_null($value)) return 'NULL';
|
if (is_null($value)) return 'NULL';
|
||||||
else if (preg_match('/^(int|double|real)/i', $fieldsentry['type'])) return $this->db->escape("$value");
|
else if (preg_match('/^(int|double|real)/i', $fieldsentry['type'])) return $this->db->escape("$value");
|
||||||
else return "'".$this->db->escape($value)."'";
|
else return "'".$this->db->escape($value)."'";
|
||||||
|
|||||||
@ -677,7 +677,8 @@ class Utils
|
|||||||
*
|
*
|
||||||
* @return int 0 if OK, < 0 if KO
|
* @return int 0 if OK, < 0 if KO
|
||||||
*/
|
*/
|
||||||
function compressSyslogs() {
|
function compressSyslogs()
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if(empty($conf->loghandlers['mod_syslog_file'])) { // File Syslog disabled
|
if(empty($conf->loghandlers['mod_syslog_file'])) { // File Syslog disabled
|
||||||
|
|||||||
@ -29,7 +29,8 @@
|
|||||||
* @param Opensurveysondage $object Current viewing poll
|
* @param Opensurveysondage $object Current viewing poll
|
||||||
* @return array Tabs for the opensurvey section
|
* @return array Tabs for the opensurvey section
|
||||||
*/
|
*/
|
||||||
function opensurvey_prepare_head(Opensurveysondage $object) {
|
function opensurvey_prepare_head(Opensurveysondage $object)
|
||||||
|
{
|
||||||
|
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
|
|
||||||
|
|||||||
@ -145,7 +145,7 @@ for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
|
|||||||
$price_options[$i] = $langs->trans('SellingPrice').' '.$i;
|
$price_options[$i] = $langs->trans('SellingPrice').' '.$i;
|
||||||
}
|
}
|
||||||
|
|
||||||
$genPriceOptions = function($level) use ($price_options) {
|
$genPriceOptions = function ($level) use ($price_options) {
|
||||||
|
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
||||||
|
|||||||
@ -102,7 +102,8 @@ class Products extends DolibarrApi
|
|||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)"
|
||||||
* @return array Array of product objects
|
* @return array Array of product objects
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode=0, $category=0, $sqlfilters = '') {
|
function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode=0, $category=0, $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@ -467,7 +468,8 @@ class Products 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) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
|||||||
@ -167,7 +167,8 @@ class FormProduct
|
|||||||
* @param String $final_label full label with all parents, separated by ' >> ' (completed on each call)
|
* @param String $final_label full label with all parents, separated by ' >> ' (completed on each call)
|
||||||
* @return String full label with all parents, separated by ' >> '
|
* @return String full label with all parents, separated by ' >> '
|
||||||
*/
|
*/
|
||||||
private function get_parent_path($tab, $final_label='') {
|
private function get_parent_path($tab, $final_label='')
|
||||||
|
{
|
||||||
|
|
||||||
if(empty($final_label)) $final_label = $tab['label'];
|
if(empty($final_label)) $final_label = $tab['label'];
|
||||||
|
|
||||||
|
|||||||
@ -4505,7 +4505,8 @@ class Product extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param int[]|int $categories Category or categories IDs
|
* @param int[]|int $categories Category or categories IDs
|
||||||
*/
|
*/
|
||||||
public function setCategories($categories) {
|
public function setCategories($categories)
|
||||||
|
{
|
||||||
// Handle single category
|
// Handle single category
|
||||||
if (! is_array($categories)) {
|
if (! is_array($categories)) {
|
||||||
$categories = array($categories);
|
$categories = array($categories);
|
||||||
|
|||||||
@ -54,7 +54,8 @@ class Productcustomerprice extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param DoliDb $db handler
|
* @param DoliDb $db handler
|
||||||
*/
|
*/
|
||||||
function __construct($db) {
|
function __construct($db)
|
||||||
|
{
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
return 1;
|
return 1;
|
||||||
@ -68,7 +69,8 @@ class Productcustomerprice extends CommonObject
|
|||||||
* @param int $forceupdateaffiliate update price on each soc child
|
* @param int $forceupdateaffiliate update price on each soc child
|
||||||
* @return int <0 if KO, Id of created object if OK
|
* @return int <0 if KO, Id of created object if OK
|
||||||
*/
|
*/
|
||||||
function create($user, $notrigger = 0, $forceupdateaffiliate = 0) {
|
function create($user, $notrigger = 0, $forceupdateaffiliate = 0)
|
||||||
|
{
|
||||||
|
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -522,7 +524,8 @@ class Productcustomerprice extends CommonObject
|
|||||||
* @param int $forceupdateaffiliate update price on each soc child
|
* @param int $forceupdateaffiliate update price on each soc child
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user = 0, $notrigger = 0, $forceupdateaffiliate = 0) {
|
function update($user = 0, $notrigger = 0, $forceupdateaffiliate = 0)
|
||||||
|
{
|
||||||
|
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -719,7 +722,8 @@ class Productcustomerprice extends CommonObject
|
|||||||
* @param int $forceupdateaffiliate update price on each soc child
|
* @param int $forceupdateaffiliate update price on each soc child
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function setPriceOnAffiliateThirdparty($user, $forceupdateaffiliate) {
|
function setPriceOnAffiliateThirdparty($user, $forceupdateaffiliate)
|
||||||
|
{
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@ -811,7 +815,8 @@ class Productcustomerprice extends CommonObject
|
|||||||
* @param int $notrigger triggers after, 1=disable triggers
|
* @param int $notrigger triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user, $notrigger = 0) {
|
function delete($user, $notrigger = 0)
|
||||||
|
{
|
||||||
|
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -864,7 +869,8 @@ class Productcustomerprice extends CommonObject
|
|||||||
* @param int $fromid of object to clone
|
* @param int $fromid of object to clone
|
||||||
* @return int id of clone
|
* @return int id of clone
|
||||||
*/
|
*/
|
||||||
function createFromClone($fromid) {
|
function createFromClone($fromid)
|
||||||
|
{
|
||||||
|
|
||||||
global $user, $langs;
|
global $user, $langs;
|
||||||
|
|
||||||
@ -914,7 +920,8 @@ class Productcustomerprice extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function initAsSpecimen() {
|
function initAsSpecimen()
|
||||||
|
{
|
||||||
|
|
||||||
$this->id = 0;
|
$this->id = 0;
|
||||||
|
|
||||||
|
|||||||
@ -647,7 +647,8 @@ class PropalmergepdfproductLine
|
|||||||
var $tms='';
|
var $tms='';
|
||||||
var $import_key;
|
var $import_key;
|
||||||
|
|
||||||
function __construct() {
|
function __construct()
|
||||||
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,7 +93,8 @@ class StockMovements extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') {
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@ -153,7 +154,7 @@ class StockMovements extends DolibarrApi
|
|||||||
return $obj_ret;
|
return $obj_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @param int $product_id Id product id {@min 1}
|
* @param int $product_id Id product id {@min 1}
|
||||||
* @param int $warehouse_id Id warehouse {@min 1}
|
* @param int $warehouse_id Id warehouse {@min 1}
|
||||||
* @param float $qty Qty to add (Use negative value for a stock decrease) {@min 0} {@message qty must be higher than 0}
|
* @param float $qty Qty to add (Use negative value for a stock decrease) {@min 0} {@message qty must be higher than 0}
|
||||||
@ -279,7 +280,8 @@ class StockMovements extends DolibarrApi
|
|||||||
* @param MouvementStock $object Object to clean
|
* @param MouvementStock $object Object to clean
|
||||||
* @return array Array of cleaned object properties
|
* @return array Array of cleaned object properties
|
||||||
*/
|
*/
|
||||||
function _cleanObjectDatas($object) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
|||||||
@ -92,7 +92,8 @@ class Warehouses extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') {
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@ -248,7 +249,8 @@ class Warehouses extends DolibarrApi
|
|||||||
* @param Entrepot $object Object to clean
|
* @param Entrepot $object Object to clean
|
||||||
* @return array Array of cleaned object properties
|
* @return array Array of cleaned object properties
|
||||||
*/
|
*/
|
||||||
function _cleanObjectDatas($object) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
|||||||
@ -690,7 +690,8 @@ class Entrepot extends CommonObject
|
|||||||
* @param array() $TChildWarehouses array which will contain all children (param by reference)
|
* @param array() $TChildWarehouses array which will contain all children (param by reference)
|
||||||
* @return array() $TChildWarehouses array which will contain all children
|
* @return array() $TChildWarehouses array which will contain all children
|
||||||
*/
|
*/
|
||||||
function get_children_warehouses($id, &$TChildWarehouses) {
|
function get_children_warehouses($id, &$TChildWarehouses)
|
||||||
|
{
|
||||||
|
|
||||||
$sql = 'SELECT rowid
|
$sql = 'SELECT rowid
|
||||||
FROM '.MAIN_DB_PREFIX.'entrepot
|
FROM '.MAIN_DB_PREFIX.'entrepot
|
||||||
|
|||||||
@ -98,7 +98,8 @@ class Projects extends DolibarrApi
|
|||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||||
* @return array Array of project objects
|
* @return array Array of project objects
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') {
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@ -214,7 +215,8 @@ class Projects extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @url GET {id}/tasks
|
* @url GET {id}/tasks
|
||||||
*/
|
*/
|
||||||
function getLines($id, $includetimespent=0) {
|
function getLines($id, $includetimespent=0)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->lire) {
|
if(! DolibarrApiAccess::$user->rights->projet->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -256,7 +258,8 @@ class Projects extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function getRoles($id, $userid=0) {
|
function getRoles($id, $userid=0)
|
||||||
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->lire) {
|
if(! DolibarrApiAccess::$user->rights->projet->lire) {
|
||||||
@ -300,7 +303,8 @@ class Projects extends DolibarrApi
|
|||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function postLine($id, $request_data = null) {
|
function postLine($id, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -362,7 +366,8 @@ class Projects extends DolibarrApi
|
|||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function putLine($id, $lineid, $request_data = null) {
|
function putLine($id, $lineid, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -418,7 +423,8 @@ class Projects extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = null) {
|
function put($id, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -535,7 +541,8 @@ class Projects 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) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
|||||||
@ -106,7 +106,8 @@ class Tasks extends DolibarrApi
|
|||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||||
* @return array Array of project objects
|
* @return array Array of project objects
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') {
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@ -221,7 +222,8 @@ class Tasks extends DolibarrApi
|
|||||||
* @url GET {id}/tasks
|
* @url GET {id}/tasks
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function getLines($id, $includetimespent=0) {
|
function getLines($id, $includetimespent=0)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->lire) {
|
if(! DolibarrApiAccess::$user->rights->projet->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -263,7 +265,8 @@ class Tasks extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function getRoles($id, $userid=0) {
|
function getRoles($id, $userid=0)
|
||||||
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->lire) {
|
if(! DolibarrApiAccess::$user->rights->projet->lire) {
|
||||||
@ -305,7 +308,8 @@ class Tasks extends DolibarrApi
|
|||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function postLine($id, $request_data = null) {
|
function postLine($id, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -367,7 +371,8 @@ class Tasks extends DolibarrApi
|
|||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function putLine($id, $lineid, $request_data = null) {
|
function putLine($id, $lineid, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -422,7 +427,8 @@ class Tasks extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = null) {
|
function put($id, $request_data = null)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -550,7 +556,8 @@ class Tasks 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) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
|||||||
@ -36,13 +36,17 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxHeader() { }
|
function llxHeader()
|
||||||
|
{
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Footer empty
|
* Footer empty
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxFooter() { }
|
function llxFooter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|||||||
@ -35,13 +35,17 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxHeader() { }
|
function llxHeader()
|
||||||
|
{
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Footer empty
|
* Footer empty
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxFooter() { }
|
function llxFooter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|||||||
@ -34,13 +34,17 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxHeader() { }
|
function llxHeader()
|
||||||
|
{
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Footer empty
|
* Footer empty
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxFooter() { }
|
function llxFooter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
require '../../master.inc.php';
|
require '../../master.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
@ -204,4 +208,3 @@ print '<!-- Page content '.$original_file.' rendered with DOLIBARR SERVER : Html
|
|||||||
include_once $original_file_osencoded; // Note: The pageXXX.tpl.php showed here contains a formatage with dolWebsiteOutput() at end of page.
|
include_once $original_file_osencoded; // Note: The pageXXX.tpl.php showed here contains a formatage with dolWebsiteOutput() at end of page.
|
||||||
|
|
||||||
if (is_object($db)) $db->close();
|
if (is_object($db)) $db->close();
|
||||||
|
|
||||||
|
|||||||
@ -33,13 +33,17 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxHeader() { }
|
function llxHeader()
|
||||||
|
{
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Footer empty
|
* Footer empty
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxFooter() { }
|
function llxFooter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
require '../../master.inc.php';
|
require '../../master.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
@ -145,4 +149,3 @@ require_once $original_file_osencoded;
|
|||||||
|
|
||||||
|
|
||||||
if (is_object($db)) $db->close();
|
if (is_object($db)) $db->close();
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class Contacts extends DolibarrApi
|
|||||||
* @var array $FIELDS Mandatory fields, checked when create and update object
|
* @var array $FIELDS Mandatory fields, checked when create and update object
|
||||||
*/
|
*/
|
||||||
static $FIELDS = array(
|
static $FIELDS = array(
|
||||||
'lastname'
|
'lastname',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -102,7 +102,8 @@ class Contacts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') {
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@ -195,7 +196,8 @@ class Contacts extends DolibarrApi
|
|||||||
* @param array $request_data Request datas
|
* @param array $request_data Request datas
|
||||||
* @return int ID of contact
|
* @return int ID of contact
|
||||||
*/
|
*/
|
||||||
function post($request_data = null) {
|
function post($request_data = null)
|
||||||
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->societe->contact->creer)
|
if (!DolibarrApiAccess::$user->rights->societe->contact->creer)
|
||||||
{
|
{
|
||||||
throw new RestException(401, 'No permission to create/update contacts');
|
throw new RestException(401, 'No permission to create/update contacts');
|
||||||
@ -220,7 +222,8 @@ class Contacts extends DolibarrApi
|
|||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = null) {
|
function put($id, $request_data = null)
|
||||||
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->societe->contact->creer)
|
if (!DolibarrApiAccess::$user->rights->societe->contact->creer)
|
||||||
{
|
{
|
||||||
throw new RestException(401, 'No permission to create/update contacts');
|
throw new RestException(401, 'No permission to create/update contacts');
|
||||||
@ -255,7 +258,8 @@ class Contacts extends DolibarrApi
|
|||||||
* @param int $id Contact ID
|
* @param int $id Contact ID
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
function delete($id) {
|
function delete($id)
|
||||||
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->societe->contact->supprimer)
|
if (!DolibarrApiAccess::$user->rights->societe->contact->supprimer)
|
||||||
{
|
{
|
||||||
throw new RestException(401, 'No permission to delete contacts');
|
throw new RestException(401, 'No permission to delete contacts');
|
||||||
@ -283,7 +287,8 @@ class Contacts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @url POST {id}/createUser
|
* @url POST {id}/createUser
|
||||||
*/
|
*/
|
||||||
function createUser($id, $request_data = null) {
|
function createUser($id, $request_data = null)
|
||||||
|
{
|
||||||
//if (!DolibarrApiAccess::$user->rights->user->user->creer) {
|
//if (!DolibarrApiAccess::$user->rights->user->user->creer) {
|
||||||
//throw new RestException(401);
|
//throw new RestException(401);
|
||||||
//}
|
//}
|
||||||
@ -365,7 +370,8 @@ class Contacts 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) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
@ -389,7 +395,8 @@ class Contacts extends DolibarrApi
|
|||||||
* @return array
|
* @return array
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function _validate($data) {
|
function _validate($data)
|
||||||
|
{
|
||||||
$contact = array();
|
$contact = array();
|
||||||
foreach (Contacts::$FIELDS as $field)
|
foreach (Contacts::$FIELDS as $field)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -94,7 +94,8 @@ class Supplierproposals extends DolibarrApi
|
|||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')"
|
||||||
* @return array Array of order objects
|
* @return array Array of order objects
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') {
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@ -196,7 +197,8 @@ class Supplierproposals 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) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
|||||||
@ -1775,7 +1775,8 @@ class SupplierProposal extends CommonObject
|
|||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function updatePriceFournisseur($idProductFournPrice, $product, $user) {
|
function updatePriceFournisseur($idProductFournPrice, $product, $user)
|
||||||
|
{
|
||||||
$price=price2num($product->subprice*$product->qty,'MU');
|
$price=price2num($product->subprice*$product->qty,'MU');
|
||||||
$unitPrice = price2num($product->subprice,'MU');
|
$unitPrice = price2num($product->subprice,'MU');
|
||||||
|
|
||||||
@ -1796,7 +1797,8 @@ class SupplierProposal extends CommonObject
|
|||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function createPriceFournisseur($product, $user) {
|
function createPriceFournisseur($product, $user)
|
||||||
|
{
|
||||||
$price=price2num($product->subprice*$product->qty,'MU');
|
$price=price2num($product->subprice*$product->qty,'MU');
|
||||||
$qty=price2num($product->qty);
|
$qty=price2num($product->qty);
|
||||||
$unitPrice = price2num($product->subprice,'MU');
|
$unitPrice = price2num($product->subprice,'MU');
|
||||||
@ -3180,4 +3182,3 @@ class SupplierProposalLine extends CommonObjectLine
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class Users extends DolibarrApi
|
|||||||
* @var array $FIELDS Mandatory fields, checked when create and update object
|
* @var array $FIELDS Mandatory fields, checked when create and update object
|
||||||
*/
|
*/
|
||||||
static $FIELDS = array(
|
static $FIELDS = array(
|
||||||
'login'
|
'login',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -43,7 +43,8 @@ class Users extends DolibarrApi
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
function __construct() {
|
function __construct()
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->useraccount = new User($this->db);
|
$this->useraccount = new User($this->db);
|
||||||
@ -63,7 +64,8 @@ class Users extends DolibarrApi
|
|||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||||
* @return array Array of User objects
|
* @return array Array of User objects
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '') {
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@ -136,7 +138,8 @@ class Users extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function get($id) {
|
function get($id)
|
||||||
|
{
|
||||||
//if (!DolibarrApiAccess::$user->rights->user->user->lire) {
|
//if (!DolibarrApiAccess::$user->rights->user->user->lire) {
|
||||||
//throw new RestException(401);
|
//throw new RestException(401);
|
||||||
//}
|
//}
|
||||||
@ -162,7 +165,8 @@ class Users extends DolibarrApi
|
|||||||
* @param array $request_data New user data
|
* @param array $request_data New user data
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function post($request_data = null) {
|
function post($request_data = null)
|
||||||
|
{
|
||||||
// check user authorization
|
// check user authorization
|
||||||
//if(! DolibarrApiAccess::$user->rights->user->creer) {
|
//if(! DolibarrApiAccess::$user->rights->user->creer) {
|
||||||
// throw new RestException(401, "User creation not allowed");
|
// throw new RestException(401, "User creation not allowed");
|
||||||
@ -194,7 +198,8 @@ class Users extends DolibarrApi
|
|||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = null) {
|
function put($id, $request_data = null)
|
||||||
|
{
|
||||||
//if (!DolibarrApiAccess::$user->rights->user->user->creer) {
|
//if (!DolibarrApiAccess::$user->rights->user->user->creer) {
|
||||||
//throw new RestException(401);
|
//throw new RestException(401);
|
||||||
//}
|
//}
|
||||||
@ -236,7 +241,8 @@ class Users extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @url GET {id}/setGroup/{group}
|
* @url GET {id}/setGroup/{group}
|
||||||
*/
|
*/
|
||||||
function setGroup($id, $group, $entity = 1) {
|
function setGroup($id, $group, $entity = 1)
|
||||||
|
{
|
||||||
|
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -280,7 +286,8 @@ class Users extends DolibarrApi
|
|||||||
* @param int $id Account ID
|
* @param int $id Account ID
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function delete($id) {
|
function delete($id)
|
||||||
|
{
|
||||||
//if (!DolibarrApiAccess::$user->rights->user->user->supprimer) {
|
//if (!DolibarrApiAccess::$user->rights->user->user->supprimer) {
|
||||||
//throw new RestException(401);
|
//throw new RestException(401);
|
||||||
//}
|
//}
|
||||||
@ -363,7 +370,8 @@ class Users extends DolibarrApi
|
|||||||
* @return array
|
* @return array
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function _validate($data) {
|
function _validate($data)
|
||||||
|
{
|
||||||
$account = array();
|
$account = array();
|
||||||
foreach (Users::$FIELDS as $field)
|
foreach (Users::$FIELDS as $field)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -66,13 +66,17 @@ if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias'))
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxHeader() { }
|
function llxHeader()
|
||||||
|
{
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Footer empty
|
* Footer empty
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxFooter() { }
|
function llxFooter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
require 'main.inc.php'; // Load $user and permissions
|
require 'main.inc.php'; // Load $user and permissions
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|||||||
@ -173,7 +173,8 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals(1, $object['statut']);
|
$this->assertEquals(1, $object['statut']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRestCreateUser() {
|
public function testRestCreateUser()
|
||||||
|
{
|
||||||
|
|
||||||
// attemp to create without mandatory fields :
|
// attemp to create without mandatory fields :
|
||||||
$url = $this->api_url.'/users?api_key='.$this->api_key;
|
$url = $this->api_url.'/users?api_key='.$this->api_key;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user