mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 17:48:25 +01:00
Merge remote-tracking branch 'upstream/develop' into camelCaps
This commit is contained in:
20
ChangeLog
20
ChangeLog
@@ -2,6 +2,18 @@
|
|||||||
English Dolibarr ChangeLog
|
English Dolibarr ChangeLog
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 9.0.0 compared to 8.0.0 *****
|
||||||
|
|
||||||
|
For Users:
|
||||||
|
NEW: Stable module: Website
|
||||||
|
NEW: Stable module: WebDAV
|
||||||
|
NEW: Stable module: Module Builder
|
||||||
|
NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making
|
||||||
|
Android application like DoliDroid able to provide native features for multicompany module
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 8.0.0 compared to 7.0.0 *****
|
***** ChangeLog for 8.0.0 compared to 7.0.0 *****
|
||||||
|
|
||||||
For Users:
|
For Users:
|
||||||
@@ -10,11 +22,11 @@ NEW: Experimental module: WebDAV
|
|||||||
NEW: Accept anonymous events (no user assigned)
|
NEW: Accept anonymous events (no user assigned)
|
||||||
NEW: Accountancy - Add import on general ledger
|
NEW: Accountancy - Add import on general ledger
|
||||||
NEW: Accountancy - Show journal name on journal page and hide button draft export (Add an option in admin)
|
NEW: Accountancy - Show journal name on journal page and hide button draft export (Add an option in admin)
|
||||||
NEW: Can create event from record card of a company and member
|
NEW: Can create event from record card of a company and/or member
|
||||||
NEW: Add a button to create Stripe customer from the Payment mode tab
|
NEW: Add a button to create Stripe customer from the customer Payment mode tab
|
||||||
NEW: Add accounting account number on product tooltip
|
NEW: Add accounting account number on product tooltip
|
||||||
NEW: add any predefined mail content
|
NEW: Add any predefined mail content
|
||||||
NEW: Add arrows to navigate into containers in website module
|
NEW: Add arrows to navigate into containers in experimental website module
|
||||||
NEW: Add a tab to specify accountant/auditor of the company
|
NEW: Add a tab to specify accountant/auditor of the company
|
||||||
NEW: Add Date delivery and Availability on Propals List
|
NEW: Add Date delivery and Availability on Propals List
|
||||||
NEW: Add date in goods reception supplier order table
|
NEW: Add date in goods reception supplier order table
|
||||||
|
|||||||
@@ -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 -->
|
||||||
|
|
||||||
|
|||||||
@@ -295,6 +295,9 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
|
|||||||
if (preg_match('/^DescADHERENT_/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^DescADHERENT_/', $value)) $qualifiedforclean=0;
|
||||||
if (preg_match('/^SubmitTranslation/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^SubmitTranslation/', $value)) $qualifiedforclean=0;
|
||||||
if (preg_match('/^ModuleCompanyCode/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^ModuleCompanyCode/', $value)) $qualifiedforclean=0;
|
||||||
|
// admin.lang
|
||||||
|
if (preg_match('/^DAV_ALLOW_PUBLIC_DIR/i', $value)) $qualifiedforclean=0;
|
||||||
|
if (preg_match('/^DAV_ALLOW_ECM_DIR/i', $value)) $qualifiedforclean=0;
|
||||||
// boxes.lang
|
// boxes.lang
|
||||||
if (preg_match('/^BoxTitleLast/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^BoxTitleLast/', $value)) $qualifiedforclean=0;
|
||||||
if (preg_match('/^BoxTitleLatest/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^BoxTitleLatest/', $value)) $qualifiedforclean=0;
|
||||||
|
|||||||
@@ -359,7 +359,8 @@ class AccountancyCategory // extends CommonObject
|
|||||||
* @param int $id Id
|
* @param int $id Id
|
||||||
* @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 display($id) {
|
public function display($id)
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$sql = "SELECT t.rowid, t.account_number, t.label";
|
$sql = "SELECT t.rowid, t.account_number, t.label";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t";
|
||||||
@@ -394,7 +395,8 @@ class AccountancyCategory // 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 getCptBK($id) {
|
public function getCptBK($id)
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT t.numero_compte, t.label_operation, t.doc_ref";
|
$sql = "SELECT t.numero_compte, t.label_operation, t.doc_ref";
|
||||||
@@ -442,8 +444,9 @@ class AccountancyCategory // 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 getAccountsWithNoCategory($id) {
|
public function getAccountsWithNoCategory($id)
|
||||||
global $conf;
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT aa.account_number as numero_compte, aa.label as label_compte";
|
$sql = "SELECT aa.account_number as numero_compte, aa.label as label_compte";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||||
@@ -485,7 +488,8 @@ class AccountancyCategory // extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function updateAccAcc($id_cat, $cpts = array()) {
|
public function updateAccAcc($id_cat, $cpts = array())
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@@ -548,7 +552,8 @@ class AccountancyCategory // extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function deleteCptCat($cpt_id) {
|
public function deleteCptCat($cpt_id)
|
||||||
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account as aa";
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||||
|
|||||||
@@ -55,11 +55,11 @@ class AccountancyExport
|
|||||||
public static $EXPORT_TYPE_AGIRIS = 9;
|
public static $EXPORT_TYPE_AGIRIS = 9;
|
||||||
public static $EXPORT_TYPE_CONFIGURABLE = 10;
|
public static $EXPORT_TYPE_CONFIGURABLE = 10;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var string[] Error codes (or messages)
|
* @var string[] Error codes (or messages)
|
||||||
*/
|
*/
|
||||||
public $errors = array ();
|
public $errors = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -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';
|
||||||
@@ -187,7 +191,8 @@ class AccountancyExport
|
|||||||
* @param unknown $TData data
|
* @param unknown $TData data
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function export(&$TData) {
|
public function export(&$TData)
|
||||||
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
self::downloadFile();
|
self::downloadFile();
|
||||||
@@ -236,7 +241,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 ) {
|
||||||
@@ -260,7 +266,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 = ";";
|
||||||
@@ -285,7 +292,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 = ";";
|
||||||
@@ -318,7 +326,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";
|
||||||
@@ -345,7 +354,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportBob50($objectLines) {
|
public function exportBob50($objectLines)
|
||||||
|
{
|
||||||
|
|
||||||
// Bob50
|
// Bob50
|
||||||
$separator = ";";
|
$separator = ";";
|
||||||
@@ -383,7 +393,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";
|
||||||
@@ -423,7 +434,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";
|
||||||
@@ -506,7 +518,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportEbp($objectLines) {
|
public function exportEbp($objectLines)
|
||||||
|
{
|
||||||
|
|
||||||
$separator = ',';
|
$separator = ',';
|
||||||
$end_line = "\n";
|
$end_line = "\n";
|
||||||
@@ -538,7 +551,8 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportAgiris($objectLines) {
|
public function exportAgiris($objectLines)
|
||||||
|
{
|
||||||
|
|
||||||
$separator = ';';
|
$separator = ';';
|
||||||
$end_line = "\n";
|
$end_line = "\n";
|
||||||
@@ -575,7 +589,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) {
|
||||||
@@ -605,7 +620,8 @@ class AccountancyExport
|
|||||||
* @param integer $size data
|
* @param integer $size data
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,11 @@
|
|||||||
class AccountancySystem
|
class AccountancySystem
|
||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
var $error;
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
var $rowid;
|
var $rowid;
|
||||||
var $fk_pcg_version;
|
var $fk_pcg_version;
|
||||||
var $pcg_type;
|
var $pcg_type;
|
||||||
@@ -43,7 +47,8 @@ class AccountancySystem
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db handler
|
* @param DoliDB $db handler
|
||||||
*/
|
*/
|
||||||
function __construct($db) {
|
function __construct($db)
|
||||||
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +107,8 @@ class AccountancySystem
|
|||||||
* @param User $user making insert
|
* @param User $user making insert
|
||||||
* @return int if KO, Id of line if OK
|
* @return int if KO, Id of line if OK
|
||||||
*/
|
*/
|
||||||
function create($user) {
|
function create($user)
|
||||||
|
{
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_system";
|
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_system";
|
||||||
|
|||||||
@@ -46,8 +46,18 @@ class AccountingAccount extends CommonObject
|
|||||||
public $restrictiononfksoc = 1;
|
public $restrictiononfksoc = 1;
|
||||||
|
|
||||||
var $db;
|
var $db;
|
||||||
var $error;
|
|
||||||
var $errors;
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array();
|
||||||
|
|
||||||
var $id;
|
var $id;
|
||||||
var $rowid;
|
var $rowid;
|
||||||
var $datec; // Creation date
|
var $datec; // Creation date
|
||||||
@@ -69,7 +79,8 @@ class AccountingAccount extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handle
|
* @param DoliDB $db Database handle
|
||||||
*/
|
*/
|
||||||
function __construct($db) {
|
function __construct($db)
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
@@ -146,7 +157,8 @@ class AccountingAccount extends CommonObject
|
|||||||
* @param int $notrigger Disable triggers
|
* @param int $notrigger Disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function create($user, $notrigger = 0) {
|
function create($user, $notrigger = 0)
|
||||||
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
@@ -297,7 +309,8 @@ class AccountingAccount extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function checkUsage() {
|
function checkUsage()
|
||||||
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$sql = "(SELECT fk_code_ventilation FROM " . MAIN_DB_PREFIX . "facturedet";
|
$sql = "(SELECT fk_code_ventilation FROM " . MAIN_DB_PREFIX . "facturedet";
|
||||||
@@ -330,7 +343,8 @@ class AccountingAccount extends CommonObject
|
|||||||
* @param int $notrigger 0=triggers after, 1=disable triggers
|
* @param int $notrigger 0=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)
|
||||||
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$result = $this->checkUsage();
|
$result = $this->checkUsage();
|
||||||
@@ -457,7 +471,8 @@ class AccountingAccount extends CommonObject
|
|||||||
* @param int $id of record
|
* @param int $id of record
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function info($id) {
|
function info($id)
|
||||||
|
{
|
||||||
$sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms';
|
$sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms';
|
||||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a';
|
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a';
|
||||||
$sql .= ' WHERE a.rowid = ' . $id;
|
$sql .= ' WHERE a.rowid = ' . $id;
|
||||||
@@ -495,7 +510,8 @@ class AccountingAccount extends CommonObject
|
|||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function account_desactivate($id) {
|
function account_desactivate($id)
|
||||||
|
{
|
||||||
$result = $this->checkUsage();
|
$result = $this->checkUsage();
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
@@ -528,7 +544,8 @@ class AccountingAccount extends CommonObject
|
|||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function account_activate($id) {
|
function account_activate($id)
|
||||||
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ class AccountingJournal extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handle
|
* @param DoliDB $db Database handle
|
||||||
*/
|
*/
|
||||||
function __construct($db) {
|
function __construct($db)
|
||||||
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +118,8 @@ class AccountingJournal extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') {
|
function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
|
||||||
|
{
|
||||||
$sql = "SELECT rowid, code, label, nature, active";
|
$sql = "SELECT rowid, code, label, nature, active";
|
||||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
|
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
|
||||||
// Manage filter
|
// Manage filter
|
||||||
|
|||||||
@@ -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,";
|
||||||
@@ -1540,7 +1555,8 @@ class BookKeeping extends CommonObject
|
|||||||
* @return int Result
|
* @return int Result
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
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,";
|
||||||
@@ -1698,7 +1714,8 @@ class BookKeeping extends CommonObject
|
|||||||
* @return string String with HTML select
|
* @return string String with HTML select
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
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';
|
||||||
|
|||||||
@@ -41,10 +41,16 @@ abstract class ActionsAdherentCardCommon
|
|||||||
var $tpl = array();
|
var $tpl = array();
|
||||||
//! Object container
|
//! Object container
|
||||||
var $object;
|
var $object;
|
||||||
//! Error string
|
/**
|
||||||
var $error;
|
* @var string Error code (or message)
|
||||||
//! Error array
|
*/
|
||||||
var $errors=array();
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ class Members extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $sqlfilters = '') {
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
@@ -293,7 +294,8 @@ 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) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class MembersTypes 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(
|
||||||
'label'
|
'label',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,7 +86,8 @@ class MembersTypes 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();
|
||||||
@@ -271,7 +272,8 @@ 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) {
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class Subscriptions extends DolibarrApi
|
|||||||
'fk_adherent',
|
'fk_adherent',
|
||||||
'dateh',
|
'dateh',
|
||||||
'datef',
|
'datef',
|
||||||
'amount'
|
'amount',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,7 +85,8 @@ class Subscriptions extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') {
|
function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -313,7 +313,9 @@ if ($mode == 'desc')
|
|||||||
{
|
{
|
||||||
$textexternal.='<br><strong>'.$langs->trans("Origin").':</strong> '.$langs->trans("ExternalModule",$dirofmodule);
|
$textexternal.='<br><strong>'.$langs->trans("Origin").':</strong> '.$langs->trans("ExternalModule",$dirofmodule);
|
||||||
if ($objMod->editor_name != 'dolibarr') $textexternal.='<br><strong>'.$langs->trans("Publisher").':</strong> '.(empty($objMod->editor_name)?$langs->trans("Unknown"):$objMod->editor_name);
|
if ($objMod->editor_name != 'dolibarr') $textexternal.='<br><strong>'.$langs->trans("Publisher").':</strong> '.(empty($objMod->editor_name)?$langs->trans("Unknown"):$objMod->editor_name);
|
||||||
if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i',$objMod->editor_url)) $textexternal.='<br><strong>'.$langs->trans("Url").':</strong> <a href="'.$objMod->editor_url.'" target="_blank">'.$objMod->editor_url.'</a>';
|
$editor_url = $objMod->editor_url;
|
||||||
|
if (! preg_match('/^http/', $editor_url)) $editor_url = 'http://'.$editor_url;
|
||||||
|
if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i',$objMod->editor_url)) $textexternal.='<br><strong>'.$langs->trans("Url").':</strong> <a href="'.$editor_url.'" target="_blank">'.$objMod->editor_url.'</a>';
|
||||||
$text.=$textexternal;
|
$text.=$textexternal;
|
||||||
$text.='<br>';
|
$text.='<br>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,8 @@ class 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)
|
||||||
|
{
|
||||||
|
|
||||||
// Remove $db object property for object
|
// Remove $db object property for object
|
||||||
unset($object->db);
|
unset($object->db);
|
||||||
@@ -220,7 +221,8 @@ class DolibarrApi
|
|||||||
* @return bool
|
* @return bool
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
static function _checkAccessToResource($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') {
|
static function _checkAccessToResource($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')
|
||||||
|
{
|
||||||
|
|
||||||
// Features/modules to check
|
// Features/modules to check
|
||||||
$featuresarray = array($resource);
|
$featuresarray = array($resource);
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
|||||||
class Login
|
class Login
|
||||||
{
|
{
|
||||||
|
|
||||||
function __construct() {
|
function __construct()
|
||||||
|
{
|
||||||
global $db;
|
global $db;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
@@ -51,7 +52,8 @@ class Login
|
|||||||
* @url GET /
|
* @url GET /
|
||||||
* @url POST /
|
* @url POST /
|
||||||
*/
|
*/
|
||||||
public function index($login, $password, $entity='', $reset=0) {
|
public function index($login, $password, $entity='', $reset=0)
|
||||||
|
{
|
||||||
|
|
||||||
global $conf, $dolibarr_main_authentication, $dolibarr_auto_user;
|
global $conf, $dolibarr_main_authentication, $dolibarr_auto_user;
|
||||||
|
|
||||||
|
|||||||
@@ -26,19 +26,21 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
|
|||||||
*/
|
*/
|
||||||
class Status
|
class Status
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Get status (Dolibarr version)
|
* Get status (Dolibarr version)
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function index() {
|
function index()
|
||||||
global $conf;
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'success' => array(
|
'success' => array(
|
||||||
'code' => 200,
|
'code' => 200,
|
||||||
'dolibarr_version' => DOL_VERSION,
|
'dolibarr_version' => DOL_VERSION,
|
||||||
'access_locked' => (empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)?'0':$conf->global->MAIN_ONLY_LOGIN_ALLOWED)
|
'access_locked' => (empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)?'0':$conf->global->MAIN_ONLY_LOGIN_ALLOWED),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ class BlockedLogAuthority
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
public function __construct($db) {
|
public function __construct($db)
|
||||||
|
{
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
@@ -61,7 +62,8 @@ class BlockedLogAuthority
|
|||||||
*
|
*
|
||||||
* @return string blockchain
|
* @return string blockchain
|
||||||
*/
|
*/
|
||||||
public function getLocalBlockChain() {
|
public function getLocalBlockChain()
|
||||||
|
{
|
||||||
|
|
||||||
$block_static = new BlockedLog($this->db);
|
$block_static = new BlockedLog($this->db);
|
||||||
|
|
||||||
@@ -84,7 +86,8 @@ class BlockedLogAuthority
|
|||||||
*
|
*
|
||||||
* @return string hash md5 of blockchain
|
* @return string hash md5 of blockchain
|
||||||
*/
|
*/
|
||||||
public function getBlockchainHash() {
|
public function getBlockchainHash()
|
||||||
|
{
|
||||||
|
|
||||||
return md5($this->signature.$this->blockchain);
|
return md5($this->signature.$this->blockchain);
|
||||||
|
|
||||||
@@ -96,7 +99,8 @@ class BlockedLogAuthority
|
|||||||
* @param string $hash hash md5 of blockchain to test
|
* @param string $hash hash md5 of blockchain to test
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function checkBlockchain($hash) {
|
public function checkBlockchain($hash)
|
||||||
|
{
|
||||||
|
|
||||||
return ($hash === $this->getBlockchainHash() );
|
return ($hash === $this->getBlockchainHash() );
|
||||||
|
|
||||||
@@ -108,7 +112,8 @@ class BlockedLogAuthority
|
|||||||
* @param string $block new block to chain
|
* @param string $block new block to chain
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addBlock($block) {
|
public function addBlock($block)
|
||||||
|
{
|
||||||
|
|
||||||
$this->blockchain.=$block;
|
$this->blockchain.=$block;
|
||||||
|
|
||||||
@@ -120,7 +125,8 @@ class BlockedLogAuthority
|
|||||||
* @param string $block new block to chain
|
* @param string $block new block to chain
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function checkBlock($block) {
|
public function checkBlock($block)
|
||||||
|
{
|
||||||
|
|
||||||
if(strlen($block)!=64) return false;
|
if(strlen($block)!=64) return false;
|
||||||
|
|
||||||
@@ -142,7 +148,8 @@ class BlockedLogAuthority
|
|||||||
* @param string $signature Signature of object to load
|
* @param string $signature Signature of object to load
|
||||||
* @return int >0 if OK, <0 if KO, 0 if not found
|
* @return int >0 if OK, <0 if KO, 0 if not found
|
||||||
*/
|
*/
|
||||||
public function fetch($id, $signature='') {
|
public function fetch($id, $signature='')
|
||||||
|
{
|
||||||
|
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -199,7 +206,8 @@ class BlockedLogAuthority
|
|||||||
* @param User $user Object user that create
|
* @param User $user Object user that create
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function create($user) {
|
public function create($user)
|
||||||
|
{
|
||||||
|
|
||||||
global $conf,$langs,$hookmanager;
|
global $conf,$langs,$hookmanager;
|
||||||
|
|
||||||
@@ -253,7 +261,8 @@ class BlockedLogAuthority
|
|||||||
* @param User $user Object user that create
|
* @param User $user Object user that create
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function update($user) {
|
public function update($user)
|
||||||
|
{
|
||||||
|
|
||||||
global $conf,$langs,$hookmanager;
|
global $conf,$langs,$hookmanager;
|
||||||
|
|
||||||
@@ -290,7 +299,8 @@ class BlockedLogAuthority
|
|||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function syncSignatureWithAuthority() {
|
public function syncSignatureWithAuthority()
|
||||||
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
//TODO create cron task on activation
|
//TODO create cron task on activation
|
||||||
|
|||||||
@@ -608,7 +608,8 @@ class BlockedLog
|
|||||||
* @param int $id Id of object to load
|
* @param int $id Id of object to load
|
||||||
* @return int >0 if OK, <0 if KO, 0 if not found
|
* @return int >0 if OK, <0 if KO, 0 if not found
|
||||||
*/
|
*/
|
||||||
public function fetch($id) {
|
public function fetch($id)
|
||||||
|
{
|
||||||
|
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -704,7 +705,8 @@ class BlockedLog
|
|||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function setCertified() {
|
public function setCertified()
|
||||||
|
{
|
||||||
|
|
||||||
$res = $this->db->query("UPDATE ".MAIN_DB_PREFIX."blockedlog SET certified=1 WHERE rowid=".$this->id);
|
$res = $this->db->query("UPDATE ".MAIN_DB_PREFIX."blockedlog SET certified=1 WHERE rowid=".$this->id);
|
||||||
if($res===false) return false;
|
if($res===false) return false;
|
||||||
@@ -721,7 +723,8 @@ class BlockedLog
|
|||||||
* @param int $forcesignature Force signature (for example '0000000000' when we disabled the module)
|
* @param int $forcesignature Force signature (for example '0000000000' when we disabled the module)
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function create($user, $forcesignature='') {
|
public function create($user, $forcesignature='')
|
||||||
|
{
|
||||||
|
|
||||||
global $conf,$langs,$hookmanager;
|
global $conf,$langs,$hookmanager;
|
||||||
|
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ class Facturation
|
|||||||
* @return string Ref
|
* @return string Ref
|
||||||
*/
|
*/
|
||||||
public function ref($aRef=null)
|
public function ref($aRef=null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (is_null($aRef))
|
if (is_null($aRef))
|
||||||
{
|
{
|
||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
@@ -927,6 +927,15 @@ if ($action == 'create')
|
|||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
$result1=$object->fetch($id);
|
$result1=$object->fetch($id);
|
||||||
|
if ($result1 <= 0)
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
print $langs->trans("ErrorRecordNotFound");
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$result2=$object->fetch_thirdparty();
|
$result2=$object->fetch_thirdparty();
|
||||||
$result2=$object->fetch_projet();
|
$result2=$object->fetch_projet();
|
||||||
$result3=$object->fetch_contact();
|
$result3=$object->fetch_contact();
|
||||||
@@ -957,7 +966,7 @@ if ($id > 0)
|
|||||||
$object->note = GETPOST("note",'none');
|
$object->note = GETPOST("note",'none');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
|
if ($result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db,$object->error);
|
dol_print_error($db,$object->error);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@@ -621,7 +621,7 @@ class ActionComm extends CommonObject
|
|||||||
$this->contact->id = $obj->fk_contact; // deprecated
|
$this->contact->id = $obj->fk_contact; // deprecated
|
||||||
|
|
||||||
$this->fk_element = $obj->elementid;
|
$this->fk_element = $obj->elementid;
|
||||||
$this->elementid = $obj->elementid;
|
$this->elementid = $obj->elementid;
|
||||||
$this->elementtype = $obj->elementtype;
|
$this->elementtype = $obj->elementtype;
|
||||||
|
|
||||||
$this->fetchResources();
|
$this->fetchResources();
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ class AgendaEvents extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->actioncomm = new ActionComm($this->db);
|
$this->actioncomm = new ActionComm($this->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,13 +99,14 @@ class AgendaEvents extends DolibarrApi
|
|||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'%dol%') and (t.datec:<:'20160101')"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'%dol%') and (t.datec:<:'20160101')"
|
||||||
* @return array Array of Agenda Events objects
|
* @return array Array of Agenda Events objects
|
||||||
*/
|
*/
|
||||||
function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '') {
|
function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '')
|
||||||
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
$obj_ret = array();
|
$obj_ret = array();
|
||||||
|
|
||||||
if (! DolibarrApiAccess::$user->rights->agenda->myactions->read) {
|
if (! DolibarrApiAccess::$user->rights->agenda->myactions->read) {
|
||||||
throw new RestException(401, "Insuffisant rights to read events");
|
throw new RestException(401, "Insuffisant rights to read events");
|
||||||
}
|
}
|
||||||
|
|
||||||
// case of external user
|
// case of external user
|
||||||
@@ -226,7 +227,8 @@ class AgendaEvents extends DolibarrApi
|
|||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function put($id, $request_data = null) {
|
function put($id, $request_data = null)
|
||||||
|
{
|
||||||
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
|
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
|
||||||
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
|
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
|
||||||
}
|
}
|
||||||
@@ -319,7 +321,8 @@ class AgendaEvents 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);
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,11 @@
|
|||||||
*/
|
*/
|
||||||
class CActionComm
|
class CActionComm
|
||||||
{
|
{
|
||||||
var $error;
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
var $db;
|
var $db;
|
||||||
|
|
||||||
var $id;
|
var $id;
|
||||||
|
|||||||
@@ -30,8 +30,17 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
{
|
{
|
||||||
|
|
||||||
var $db; //!< To store db handler
|
var $db; //!< To store db handler
|
||||||
var $error; //!< To return error code (or message)
|
/**
|
||||||
var $errors = array(); //!< To return several error codes (or messages)
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array();
|
||||||
|
|
||||||
var $element='advtargetemailing'; //!< Id that identify managed objects
|
var $element='advtargetemailing'; //!< Id that identify managed objects
|
||||||
var $table_element='advtargetemailing'; //!< Name of table without prefix where object is stored
|
var $table_element='advtargetemailing'; //!< Name of table without prefix where object is stored
|
||||||
|
|
||||||
@@ -920,7 +929,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
|
||||||
|
|||||||
@@ -27,14 +27,18 @@
|
|||||||
class FormAdvTargetEmailing extends Form
|
class FormAdvTargetEmailing extends Form
|
||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
var $error;
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @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 +51,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 +88,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 +149,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 +191,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 +338,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 +426,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);
|
||||||
}
|
}
|
||||||
@@ -703,23 +707,24 @@ class Proposals extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean sensible object datas
|
* Clean sensible object datas
|
||||||
*
|
*
|
||||||
* @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);
|
||||||
|
|
||||||
unset($object->note);
|
unset($object->note);
|
||||||
unset($object->name);
|
unset($object->name);
|
||||||
unset($object->lastname);
|
unset($object->lastname);
|
||||||
unset($object->firstname);
|
unset($object->firstname);
|
||||||
unset($object->civility_id);
|
unset($object->civility_id);
|
||||||
unset($object->address);
|
unset($object->address);
|
||||||
|
|
||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1338,13 +1338,12 @@ class Propal extends CommonObject
|
|||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_availability as ca ON p.fk_availability = ca.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_availability as ca ON p.fk_availability = ca.rowid';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON p.fk_input_reason = dr.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON p.fk_input_reason = dr.rowid';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON p.fk_incoterms = i.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON p.fk_incoterms = i.rowid';
|
||||||
$sql.= " WHERE p.fk_statut = c.id";
|
|
||||||
|
|
||||||
if ($ref) {
|
if ($ref) {
|
||||||
$sql.= " AND p.entity IN (".getEntity('propal').")"; // Dont't use entity if you use rowid
|
$sql.= " WHERE p.entity IN (".getEntity('propal').")"; // Dont't use entity if you use rowid
|
||||||
$sql.= " AND p.ref='".$ref."'";
|
$sql.= " AND p.ref='".$this->db->escape($ref)."'";
|
||||||
}
|
}
|
||||||
else $sql.= " AND p.rowid=".$rowid;
|
else $sql.= " WHERE p.rowid=".$rowid;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
@@ -3163,7 +3162,7 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
$clause = " WHERE";
|
$clause = " WHERE";
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.ref, p.datec as datec, p.fin_validite as datefin";
|
$sql = "SELECT p.rowid, p.ref, p.datec as datec, p.fin_validite as datefin, p.total_ht";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
||||||
{
|
{
|
||||||
@@ -3207,6 +3206,8 @@ class Propal extends CommonObject
|
|||||||
while ($obj=$this->db->fetch_object($resql))
|
while ($obj=$this->db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$response->nbtodo++;
|
$response->nbtodo++;
|
||||||
|
$response->total+=$obj->total_ht;
|
||||||
|
|
||||||
if ($mode == 'opened')
|
if ($mode == 'opened')
|
||||||
{
|
{
|
||||||
$datelimit = $this->db->jdate($obj->datefin);
|
$datelimit = $this->db->jdate($obj->datefin);
|
||||||
|
|||||||
@@ -97,9 +97,10 @@ class Orders 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 order objects
|
* @return array Array of order objects
|
||||||
*
|
*
|
||||||
* @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);
|
||||||
@@ -706,21 +714,22 @@ class Orders extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an order using an existing proposal.
|
* Create an order using an existing proposal.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param int $proposalid Id of the proposal
|
* @param int $proposalid Id of the proposal
|
||||||
*
|
*
|
||||||
* @url POST /createfromproposal/{proposalid}
|
* @url POST /createfromproposal/{proposalid}
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
* @throws 400
|
* @throws 400
|
||||||
* @throws 401
|
* @throws 401
|
||||||
* @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);
|
||||||
|
|
||||||
|
|||||||
@@ -3258,7 +3258,7 @@ class Commande extends CommonOrder
|
|||||||
|
|
||||||
$clause = " WHERE";
|
$clause = " WHERE";
|
||||||
|
|
||||||
$sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.date_livraison as delivery_date, c.fk_statut";
|
$sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.date_livraison as delivery_date, c.fk_statut, c.total_ht";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
||||||
{
|
{
|
||||||
@@ -3285,6 +3285,7 @@ class Commande extends CommonOrder
|
|||||||
while ($obj=$this->db->fetch_object($resql))
|
while ($obj=$this->db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$response->nbtodo++;
|
$response->nbtodo++;
|
||||||
|
$response->total+= $obj->total_ht;
|
||||||
|
|
||||||
$generic_commande->statut = $obj->fk_statut;
|
$generic_commande->statut = $obj->fk_statut;
|
||||||
$generic_commande->date_commande = $this->db->jdate($obj->date_commande);
|
$generic_commande->date_commande = $this->db->jdate($obj->date_commande);
|
||||||
|
|||||||
@@ -1423,14 +1423,14 @@ if ($resql)
|
|||||||
|
|
||||||
if (! empty($arrayfields['b.conciliated']['checked']))
|
if (! empty($arrayfields['b.conciliated']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="nowrap" align="center">';
|
print '<td class="nowraponall" align="center">';
|
||||||
print $objp->conciliated?$langs->trans("Yes"):$langs->trans("No");
|
print $objp->conciliated?$langs->trans("Yes"):$langs->trans("No");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action edit/delete
|
// Action edit/delete
|
||||||
print '<td class="nowrap" align="center">';
|
print '<td class="nowraponall" align="center">';
|
||||||
// Transaction reconciliated or edit link
|
// Transaction reconciliated or edit link
|
||||||
if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
|
if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -948,7 +948,8 @@ class Account extends CommonObject
|
|||||||
* @param int[]|int $categories Category or categories IDs
|
* @param int[]|int $categories Category or categories IDs
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
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);
|
||||||
|
|||||||
@@ -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,8 +994,9 @@ 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,18 +1225,19 @@ 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);
|
||||||
|
|
||||||
unset($object->note);
|
unset($object->note);
|
||||||
unset($object->address);
|
unset($object->address);
|
||||||
unset($object->barcode_type);
|
unset($object->barcode_type);
|
||||||
unset($object->barcode_type_code);
|
unset($object->barcode_type_code);
|
||||||
unset($object->barcode_type_label);
|
unset($object->barcode_type_label);
|
||||||
unset($object->barcode_type_coder);
|
unset($object->barcode_type_coder);
|
||||||
|
|
||||||
return $object;
|
return $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;
|
||||||
|
|||||||
@@ -3742,7 +3742,7 @@ class Facture extends CommonInvoice
|
|||||||
|
|
||||||
$clause = " WHERE";
|
$clause = " WHERE";
|
||||||
|
|
||||||
$sql = "SELECT f.rowid, f.date_lim_reglement as datefin,f.fk_statut";
|
$sql = "SELECT f.rowid, f.date_lim_reglement as datefin,f.fk_statut, f.total";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
||||||
{
|
{
|
||||||
@@ -3775,6 +3775,7 @@ class Facture extends CommonInvoice
|
|||||||
$generic_facture->statut = $obj->fk_statut;
|
$generic_facture->statut = $obj->fk_statut;
|
||||||
|
|
||||||
$response->nbtodo++;
|
$response->nbtodo++;
|
||||||
|
$response->total += $obj->total;
|
||||||
|
|
||||||
if ($generic_facture->hasDelay()) {
|
if ($generic_facture->hasDelay()) {
|
||||||
$response->nbtodolate++;
|
$response->nbtodolate++;
|
||||||
|
|||||||
@@ -30,7 +30,12 @@ class PaymentTerm // extends CommonObject
|
|||||||
{
|
{
|
||||||
var $db; //!< To store db handler
|
var $db; //!< To store db handler
|
||||||
var $error; //!< To return error code (or message)
|
var $error; //!< To return error code (or message)
|
||||||
var $errors=array(); //!< To return several error codes (or messages)
|
|
||||||
|
/**
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array();
|
||||||
|
|
||||||
//public $element='c_payment_term'; //!< Id that identify managed objects
|
//public $element='c_payment_term'; //!< Id that identify managed objects
|
||||||
//public $table_element='c_payment_term'; //!< Name of table without prefix where object is stored
|
//public $table_element='c_payment_term'; //!< Name of table without prefix where object is stored
|
||||||
var $context =array();
|
var $context =array();
|
||||||
|
|||||||
@@ -923,6 +923,9 @@ if ($resql)
|
|||||||
$facturestatic->id=$obj->id;
|
$facturestatic->id=$obj->id;
|
||||||
$facturestatic->ref=$obj->ref;
|
$facturestatic->ref=$obj->ref;
|
||||||
$facturestatic->type=$obj->type;
|
$facturestatic->type=$obj->type;
|
||||||
|
$facturestatic->total_ht=$obj->total_ht;
|
||||||
|
$facturestatic->total_tva=$obj->total_vat;
|
||||||
|
$facturestatic->total_ttc=$obj->total_ttc;
|
||||||
$facturestatic->statut=$obj->fk_statut;
|
$facturestatic->statut=$obj->fk_statut;
|
||||||
$facturestatic->date_lim_reglement=$db->jdate($obj->datelimite);
|
$facturestatic->date_lim_reglement=$db->jdate($obj->datelimite);
|
||||||
$facturestatic->note_public=$obj->note_public;
|
$facturestatic->note_public=$obj->note_public;
|
||||||
|
|||||||
@@ -722,7 +722,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerOrderToBill',$parameters);
|
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerOrderToBill',$parameters);
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= " GROUP BY s.nom, s.rowid, s.email, s.code_client, s.code_compta, c.rowid, c.ref, c.facture, c.fk_statut, c.tva, c.total_ht, c.total_ttc";
|
$sql.= " GROUP BY s.nom, s.email, s.rowid, s.code_client, s.code_compta, c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.tva, c.total_ttc, cc.rowid, cc.code";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
|
|||||||
@@ -39,8 +39,12 @@ abstract class ActionsContactCardCommon
|
|||||||
var $object;
|
var $object;
|
||||||
//! Error string
|
//! Error string
|
||||||
var $error;
|
var $error;
|
||||||
//! Error array
|
|
||||||
var $errors=array();
|
|
||||||
|
/**
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -2358,7 +2358,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');
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ $now=dol_now();
|
|||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
$sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut,";
|
$sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut,";
|
||||||
$sql.= " s.rowid as socid, s.nom as name,";
|
$sql.= " s.rowid as socid, s.nom as name, s.email, s.client, s.fournisseur,";
|
||||||
$sql.= " cd.rowid, cd.description, cd.statut,";
|
$sql.= " cd.rowid, cd.description, cd.statut,";
|
||||||
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.entity as pentity,";
|
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.entity as pentity,";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,";
|
||||||
@@ -540,6 +540,11 @@ while ($i < min($num,$limit))
|
|||||||
$contractstatic->id=$obj->cid;
|
$contractstatic->id=$obj->cid;
|
||||||
$contractstatic->ref=$obj->ref?$obj->ref:$obj->cid;
|
$contractstatic->ref=$obj->ref?$obj->ref:$obj->cid;
|
||||||
|
|
||||||
|
$companystatic->id=$obj->socid;
|
||||||
|
$companystatic->name=$obj->name;
|
||||||
|
$companystatic->email=$obj->email;
|
||||||
|
$companystatic->client=$obj->client;
|
||||||
|
$companystatic->fournisseur=$obj->fournisseur;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
@@ -555,7 +560,7 @@ while ($i < min($num,$limit))
|
|||||||
if (! empty($arrayfields['p.description']['checked']))
|
if (! empty($arrayfields['p.description']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($obj->pid)
|
if ($obj->pid > 0)
|
||||||
{
|
{
|
||||||
$productstatic->id=$obj->pid;
|
$productstatic->id=$obj->pid;
|
||||||
$productstatic->type=$obj->ptype;
|
$productstatic->type=$obj->ptype;
|
||||||
@@ -625,9 +630,6 @@ while ($i < min($num,$limit))
|
|||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$companystatic->id=$obj->socid;
|
|
||||||
$companystatic->name=$obj->name;
|
|
||||||
$companystatic->client=1;
|
|
||||||
print $companystatic->getNomUrl(1,'customer',28);
|
print $companystatic->getNomUrl(1,'customer',28);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2014-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2014-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2014 Frederic France <frederic.france@free.fr>
|
* Copyright (C) 2014-2018 Frederic France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
// Filename to print must be provided into 'file' parameter
|
// Filename to print must be provided into 'file' parameter
|
||||||
|
|
||||||
// Print file
|
// Print file
|
||||||
if ($action == 'print_file' and $user->rights->printing->read)
|
if ($action == 'print_file' && $user->rights->printing->read)
|
||||||
{
|
{
|
||||||
$langs->load("printing");
|
$langs->load("printing");
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/printing/modules_printing.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/modules/printing/modules_printing.php';
|
||||||
|
|||||||
@@ -26,13 +26,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class AntiVir
|
* Class to scan for virus
|
||||||
* \brief Class to scan for virus
|
|
||||||
*/
|
*/
|
||||||
class AntiVir
|
class AntiVir
|
||||||
{
|
{
|
||||||
var $error;
|
var $error;
|
||||||
var $errors;
|
|
||||||
|
/**
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array();
|
||||||
|
|
||||||
var $output;
|
var $output;
|
||||||
var $db;
|
var $db;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,11 @@ class Canvas
|
|||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
var $error;
|
var $error;
|
||||||
var $errors=array();
|
|
||||||
|
/**
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array();
|
||||||
|
|
||||||
var $actiontype;
|
var $actiontype;
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,12 @@ class Ccountry // extends CommonObject
|
|||||||
{
|
{
|
||||||
var $db; //!< To store db handler
|
var $db; //!< To store db handler
|
||||||
var $error; //!< To return error code (or message)
|
var $error; //!< To return error code (or message)
|
||||||
var $errors=array(); //!< To return several error codes (or messages)
|
|
||||||
|
/**
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array();
|
||||||
|
|
||||||
//var $element='ccountry'; //!< Id that identify managed objects
|
//var $element='ccountry'; //!< Id that identify managed objects
|
||||||
//var $table_element='ccountry'; //!< Name of table without prefix where object is stored
|
//var $table_element='ccountry'; //!< Name of table without prefix where object is stored
|
||||||
|
|
||||||
|
|||||||
@@ -42,9 +42,10 @@ abstract class CommonDocGenerator
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
public function __construct($db) {
|
public function __construct($db)
|
||||||
$this->db = $db;
|
{
|
||||||
}
|
$this->db = $db;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -663,7 +664,8 @@ abstract class CommonDocGenerator
|
|||||||
* @return array Array of substitution key->code
|
* @return array Array of substitution key->code
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) {
|
function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true)
|
||||||
|
{
|
||||||
$array_other = array();
|
$array_other = array();
|
||||||
if(!empty($object)) {
|
if(!empty($object)) {
|
||||||
foreach($object as $key => $value) {
|
foreach($object as $key => $value) {
|
||||||
@@ -781,9 +783,9 @@ abstract class CommonDocGenerator
|
|||||||
*/
|
*/
|
||||||
function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
|
function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
|
||||||
{
|
{
|
||||||
if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y);
|
if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y);
|
||||||
$pdf->line($x+$l, $y, $x+$l, $y+$h);
|
$pdf->line($x+$l, $y, $x+$l, $y+$h);
|
||||||
if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h);
|
if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h);
|
||||||
$pdf->line($x, $y+$h, $x, $y);
|
$pdf->line($x, $y+$h, $x, $y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6905,7 +6905,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)."'";
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ abstract class CommonStickerGenerator
|
|||||||
* @return float value value after conversion
|
* @return float value value after conversion
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function _Convert_Metric ($value, $src, $dest)
|
function _Convert_Metric($value, $src, $dest)
|
||||||
{
|
{
|
||||||
if ($src != $dest) {
|
if ($src != $dest) {
|
||||||
$tab['in'] = 39.37008;
|
$tab['in'] = 39.37008;
|
||||||
|
|||||||
@@ -34,7 +34,12 @@ class Cstate // extends CommonObject
|
|||||||
{
|
{
|
||||||
var $db; //!< To store db handler
|
var $db; //!< To store db handler
|
||||||
var $error; //!< To return error code (or message)
|
var $error; //!< To return error code (or message)
|
||||||
var $errors=array(); //!< To return several error codes (or messages)
|
|
||||||
|
/**
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array();
|
||||||
|
|
||||||
//var $element='cstate'; //!< Id that identify managed objects
|
//var $element='cstate'; //!< Id that identify managed objects
|
||||||
//var $table_element='cstate'; //!< Name of table without prefix where object is stored
|
//var $table_element='cstate'; //!< Name of table without prefix where object is stored
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,12 @@ class Ctypent // extends CommonObject
|
|||||||
{
|
{
|
||||||
var $db; //!< To store db handler
|
var $db; //!< To store db handler
|
||||||
var $error; //!< To return error code (or message)
|
var $error; //!< To return error code (or message)
|
||||||
var $errors=array(); //!< To return several error codes (or messages)
|
|
||||||
|
/**
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array();
|
||||||
|
|
||||||
//var $element='ctypent'; //!< Id that identify managed objects
|
//var $element='ctypent'; //!< Id that identify managed objects
|
||||||
//var $table_element='ctypent'; //!< Name of table without prefix where object is stored
|
//var $table_element='ctypent'; //!< Name of table without prefix where object is stored
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,11 @@ class dolReceiptPrinter extends Escpos
|
|||||||
var $printer;
|
var $printer;
|
||||||
var $template;
|
var $template;
|
||||||
var $error;
|
var $error;
|
||||||
var $errors;
|
/**
|
||||||
|
*
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array ();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,11 @@ class HookManager
|
|||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
var $error;
|
var $error;
|
||||||
var $errors=array();
|
|
||||||
|
/**
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array();
|
||||||
|
|
||||||
// Context hookmanager was created for ('thirdpartycard', 'thirdpartydao', ...)
|
// Context hookmanager was created for ('thirdpartycard', 'thirdpartydao', ...)
|
||||||
var $contextarray=array();
|
var $contextarray=array();
|
||||||
|
|||||||
@@ -219,7 +219,8 @@ class FormAccounting extends Form
|
|||||||
* @return string HTML edit field
|
* @return string HTML edit field
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '') {
|
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '')
|
||||||
|
{
|
||||||
$options = array();
|
$options = array();
|
||||||
|
|
||||||
$sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping';
|
$sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping';
|
||||||
@@ -344,7 +345,8 @@ class FormAccounting extends Form
|
|||||||
* @return string String with HTML select
|
* @return string String with HTML select
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200') {
|
function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200')
|
||||||
|
{
|
||||||
|
|
||||||
$aux_account = array();
|
$aux_account = array();
|
||||||
|
|
||||||
|
|||||||
@@ -780,7 +780,8 @@ class FormFile
|
|||||||
$out.= '<td class="right nowraponall">';
|
$out.= '<td class="right nowraponall">';
|
||||||
if ($delallowed)
|
if ($delallowed)
|
||||||
{
|
{
|
||||||
$out.= '<a href="'.$urlsource.(strpos($urlsource,'?')?'&':'?').'action=remove_file&file='.urlencode($relativepath);
|
$tmpurlsource = preg_replace('/#[a-zA-Z0-9_]*$/', '', $urlsource);
|
||||||
|
$out.= '<a href="'.$tmpurlsource.(strpos($tmpurlsource,'?')?'&':'?').'action=remove_file&file='.urlencode($relativepath);
|
||||||
$out.= ($param?'&'.$param:'');
|
$out.= ($param?'&'.$param:'');
|
||||||
//$out.= '&modulepart='.$modulepart; // TODO obsolete ?
|
//$out.= '&modulepart='.$modulepart; // TODO obsolete ?
|
||||||
//$out.= '&urlsource='.urlencode($urlsource); // TODO obsolete ?
|
//$out.= '&urlsource='.urlencode($urlsource); // TODO obsolete ?
|
||||||
@@ -816,7 +817,7 @@ class FormFile
|
|||||||
|
|
||||||
$this->numoffiles++;
|
$this->numoffiles++;
|
||||||
}
|
}
|
||||||
// Loop on each file found
|
// Loop on each link found
|
||||||
if (is_array($link_list))
|
if (is_array($link_list))
|
||||||
{
|
{
|
||||||
$colspan=2;
|
$colspan=2;
|
||||||
@@ -1307,8 +1308,7 @@ class FormFile
|
|||||||
if (! empty($conf->dol_use_jmobile)) $useajax=0;
|
if (! empty($conf->dol_use_jmobile)) $useajax=0;
|
||||||
if (empty($conf->use_javascript_ajax)) $useajax=0;
|
if (empty($conf->use_javascript_ajax)) $useajax=0;
|
||||||
if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0;
|
if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0;
|
||||||
|
print '<a href="'.(($useinecm && $useajax)?'#':($url.'?action=delete&urlfile='.urlencode($filepath).$param)).'" class="deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>';
|
||||||
print '<a href="'.(($useinecm && $useajax)?'#':$url.'?action=delete&urlfile='.urlencode($filepath).$param).'" class="deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>';
|
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php';
|
require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to offer components to list and upload files
|
* Class to offer components to list and upload files
|
||||||
*/
|
*/
|
||||||
class FormMailing extends Form
|
class FormMailing extends Form
|
||||||
{
|
{
|
||||||
@@ -37,7 +37,8 @@ class FormMailing extends Form
|
|||||||
* @param integer $show_empty Show empty option
|
* @param integer $show_empty Show empty option
|
||||||
* @return string HTML select
|
* @return string HTML select
|
||||||
*/
|
*/
|
||||||
public function selectDestinariesStatus($selectedid='',$htmlname='dest_status', $show_empty=0) {
|
public function selectDestinariesStatus($selectedid='', $htmlname='dest_status', $show_empty=0)
|
||||||
|
{
|
||||||
|
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
@@ -54,5 +55,5 @@ class FormMailing extends Form
|
|||||||
$options = $options + $mailing->statut_dest;
|
$options = $options + $mailing->statut_dest;
|
||||||
|
|
||||||
return Form::selectarray($htmlname, $options, $selectedid, 0, 0, 0, '', 1);
|
return Form::selectarray($htmlname, $options, $selectedid, 0, 0, 0, '', 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,11 @@ class Interfaces
|
|||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
var $dir; // Directory with all core and external triggers files
|
var $dir; // Directory with all core and external triggers files
|
||||||
var $errors = array(); // Array for errors
|
/**
|
||||||
|
*
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|||||||
@@ -371,7 +371,8 @@ class Ldap
|
|||||||
*
|
*
|
||||||
* @return boolean version
|
* @return boolean version
|
||||||
*/
|
*/
|
||||||
function setVersion() {
|
function setVersion()
|
||||||
|
{
|
||||||
// LDAP_OPT_PROTOCOL_VERSION est une constante qui vaut 17
|
// LDAP_OPT_PROTOCOL_VERSION est une constante qui vaut 17
|
||||||
$ldapsetversion = ldap_set_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, $this->ldapProtocolVersion);
|
$ldapsetversion = ldap_set_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, $this->ldapProtocolVersion);
|
||||||
return $ldapsetversion;
|
return $ldapsetversion;
|
||||||
@@ -382,7 +383,8 @@ class Ldap
|
|||||||
*
|
*
|
||||||
* @return boolean referrals
|
* @return boolean referrals
|
||||||
*/
|
*/
|
||||||
function setReferrals() {
|
function setReferrals()
|
||||||
|
{
|
||||||
// LDAP_OPT_REFERRALS est une constante qui vaut ?
|
// LDAP_OPT_REFERRALS est une constante qui vaut ?
|
||||||
$ldapreferrals = ldap_set_option($this->connection, LDAP_OPT_REFERRALS, 0);
|
$ldapreferrals = ldap_set_option($this->connection, LDAP_OPT_REFERRALS, 0);
|
||||||
return $ldapreferrals;
|
return $ldapreferrals;
|
||||||
|
|||||||
@@ -33,7 +33,11 @@ class Notify
|
|||||||
var $id;
|
var $id;
|
||||||
var $db;
|
var $db;
|
||||||
var $error;
|
var $error;
|
||||||
var $errors=array();
|
|
||||||
|
/**
|
||||||
|
* @var string[] Error codes (or messages)
|
||||||
|
*/
|
||||||
|
public $errors = array();
|
||||||
|
|
||||||
var $author;
|
var $author;
|
||||||
var $ref;
|
var $ref;
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ class SimpleOpenID
|
|||||||
var $URLs = array();
|
var $URLs = array();
|
||||||
var $error = array();
|
var $error = array();
|
||||||
var $fields = array(
|
var $fields = array(
|
||||||
'required' => array(),
|
'required' => array(),
|
||||||
'optional' => array(),
|
'optional' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -133,7 +133,8 @@ class SimpleOpenID
|
|||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function SetIdentity($a)
|
function SetIdentity($a)
|
||||||
{ // Set Identity URL
|
{
|
||||||
|
// Set Identity URL
|
||||||
if ((stripos($a, 'http://') === false)
|
if ((stripos($a, 'http://') === false)
|
||||||
&& (stripos($a, 'https://') === false)) {
|
&& (stripos($a, 'https://') === false)) {
|
||||||
$a = 'http://'.$a;
|
$a = 'http://'.$a;
|
||||||
@@ -162,6 +163,7 @@ class SimpleOpenID
|
|||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function GetIdentity()
|
function GetIdentity()
|
||||||
{
|
{
|
||||||
|
// Get Identity
|
||||||
return $this->openid_url_identity;
|
return $this->openid_url_identity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,7 +268,8 @@ class SimpleOpenID
|
|||||||
* @return false|string false if KO, string of url if OK
|
* @return false|string false if KO, string of url if OK
|
||||||
*/
|
*/
|
||||||
function array2url($arr)
|
function array2url($arr)
|
||||||
{ // converts associated array to URL Query String
|
{
|
||||||
|
// converts associated array to URL Query String
|
||||||
if (!is_array($arr)){
|
if (!is_array($arr)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -320,7 +323,8 @@ class SimpleOpenID
|
|||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function CURL_Request($url, $method="GET", $params = "")
|
function CURL_Request($url, $method="GET", $params = "")
|
||||||
{ // Remember, SSL MUST BE SUPPORTED
|
{
|
||||||
|
// Remember, SSL MUST BE SUPPORTED
|
||||||
if (is_array($params)) $params = $this->array2url($params);
|
if (is_array($params)) $params = $this->array2url($params);
|
||||||
|
|
||||||
$curl = curl_init($url . ($method == "GET" && $params != "" ? "?" . $params : ""));
|
$curl = curl_init($url . ($method == "GET" && $params != "" ? "?" . $params : ""));
|
||||||
@@ -377,7 +381,7 @@ class SimpleOpenID
|
|||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function GetOpenIDServer($url='')
|
function GetOpenIDServer($url='')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||||
if (empty($url)) $url=$conf->global->MAIN_AUTHENTICATION_OPENID_URL;
|
if (empty($url)) $url=$conf->global->MAIN_AUTHENTICATION_OPENID_URL;
|
||||||
|
|||||||
@@ -1655,7 +1655,7 @@ class SMTPs
|
|||||||
* @param integer $_value Message Priority
|
* @param integer $_value Message Priority
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function setPriority ( $_value = 3 )
|
function setPriority( $_value = 3 )
|
||||||
{
|
{
|
||||||
if ( ( is_numeric($_value) ) &&
|
if ( ( is_numeric($_value) ) &&
|
||||||
( ( $_value >= 0 ) && ( $_value <= 5 ) ) )
|
( ( $_value >= 0 ) && ( $_value <= 5 ) ) )
|
||||||
@@ -1821,12 +1821,14 @@ class SMTPs
|
|||||||
* @param int $_errNum Error Code Number
|
* @param int $_errNum Error Code Number
|
||||||
* @param string $_errMsg Error Message
|
* @param string $_errMsg Error Message
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _setErr ( $_errNum, $_errMsg )
|
function _setErr( $_errNum, $_errMsg )
|
||||||
{
|
{
|
||||||
$this->_smtpsErrors[] = array( 'num' => $_errNum,
|
$this->_smtpsErrors[] = array(
|
||||||
'msg' => $_errMsg );
|
'num' => $_errNum,
|
||||||
}
|
'msg' => $_errMsg,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns errors codes and messages for Class
|
* Returns errors codes and messages for Class
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -111,12 +111,13 @@ class vCard
|
|||||||
* mise en forme de la photo
|
* mise en forme de la photo
|
||||||
* warning NON TESTE !
|
* warning NON TESTE !
|
||||||
*
|
*
|
||||||
* @param string $type Type
|
* @param string $type Type
|
||||||
* @param string $photo Photo
|
* @param string $photo Photo
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function setPhoto($type, $photo)
|
function setPhoto($type, $photo)
|
||||||
{ // $type = "GIF" | "JPEG"
|
{
|
||||||
|
// $type = "GIF" | "JPEG"
|
||||||
$this->properties["PHOTO;TYPE=$type;ENCODING=BASE64"] = base64_encode($photo);
|
$this->properties["PHOTO;TYPE=$type;ENCODING=BASE64"] = base64_encode($photo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +156,7 @@ class vCard
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function setBirthday($date)
|
function setBirthday($date)
|
||||||
{
|
{
|
||||||
// $date format is YYYY-MM-DD - RFC 2425 and RFC 2426
|
// $date format is YYYY-MM-DD - RFC 2425 and RFC 2426
|
||||||
$this->properties["BDAY"] = dol_print_date($date, 'dayrfc');
|
$this->properties["BDAY"] = dol_print_date($date, 'dayrfc');
|
||||||
}
|
}
|
||||||
@@ -200,7 +201,8 @@ class vCard
|
|||||||
* @param string $type Type
|
* @param string $type Type
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function setLabel($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL") {
|
function setLabel($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL")
|
||||||
|
{
|
||||||
$label = "";
|
$label = "";
|
||||||
if ($postoffice!="") $label.= "$postoffice\r\n";
|
if ($postoffice!="") $label.= "$postoffice\r\n";
|
||||||
if ($extended!="") $label.= "$extended\r\n";
|
if ($extended!="") $label.= "$extended\r\n";
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
/* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
|
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -66,4 +67,10 @@ class WorkboardResponse
|
|||||||
*/
|
*/
|
||||||
public $nbtodolate = 0;
|
public $nbtodolate = 0;
|
||||||
|
|
||||||
}
|
/**
|
||||||
|
* total price of items
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $total = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1157,7 +1157,8 @@ class DoliDBMssql extends DoliDB
|
|||||||
* @return string field's name escaped
|
* @return string field's name escaped
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function EscapeFieldName($fieldname) {
|
function EscapeFieldName($fieldname)
|
||||||
|
{
|
||||||
return "[".$fieldname."]";
|
return "[".$fieldname."]";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1170,7 +1171,8 @@ class DoliDBMssql extends DoliDB
|
|||||||
* @return false|object
|
* @return false|object
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function GetFieldInformation($table,$fields) {
|
function GetFieldInformation($table,$fields)
|
||||||
|
{
|
||||||
$sql="SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='".$this->escape($table)."' AND COLUMN_NAME";
|
$sql="SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='".$this->escape($table)."' AND COLUMN_NAME";
|
||||||
if (is_array($fields))
|
if (is_array($fields))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1321,7 +1321,8 @@ class DoliDBSqlite3 extends DoliDB
|
|||||||
* @return int Formatted date
|
* @return int Formatted date
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
private static function calc_daynr($year, $month, $day) {
|
private static function calc_daynr($year, $month, $day)
|
||||||
|
{
|
||||||
$y = $year;
|
$y = $year;
|
||||||
if ($y == 0 && $month == 0) return 0;
|
if ($y == 0 && $month == 0) return 0;
|
||||||
$num = (365* $y + 31 * ($month - 1) + $day);
|
$num = (365* $y + 31 * ($month - 1) + $day);
|
||||||
@@ -1342,7 +1343,8 @@ class DoliDBSqlite3 extends DoliDB
|
|||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
private static function calc_weekday($daynr, $sunday_first_day_of_week) {
|
private static function calc_weekday($daynr, $sunday_first_day_of_week)
|
||||||
|
{
|
||||||
$ret = floor(($daynr + 5 + ($sunday_first_day_of_week ? 1 : 0)) % 7);
|
$ret = floor(($daynr + 5 + ($sunday_first_day_of_week ? 1 : 0)) % 7);
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@@ -1370,7 +1372,8 @@ class DoliDBSqlite3 extends DoliDB
|
|||||||
* @return string ???
|
* @return string ???
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
private static function calc_week($year, $month, $day, $week_behaviour, &$calc_year) {
|
private static function calc_week($year, $month, $day, $week_behaviour, &$calc_year)
|
||||||
|
{
|
||||||
$daynr=self::calc_daynr($year,$month,$day);
|
$daynr=self::calc_daynr($year,$month,$day);
|
||||||
$first_daynr=self::calc_daynr($year,1,1);
|
$first_daynr=self::calc_daynr($year,1,1);
|
||||||
$monday_first= ($week_behaviour & self::WEEK_MONDAY_FIRST) ? 1 : 0;
|
$monday_first= ($week_behaviour & self::WEEK_MONDAY_FIRST) ? 1 : 0;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* CombinePaths
|
* CombinePaths
|
||||||
*
|
*
|
||||||
* @param string $sBasePath sBasePath
|
* @param string $sBasePath sBasePath
|
||||||
* @param string $sFolder sFolder
|
* @param string $sFolder sFolder
|
||||||
* @return string Combined path
|
* @return string Combined path
|
||||||
@@ -393,13 +393,13 @@ EOF;
|
|||||||
// This is the function that sends the results of the uploading process to CKE.
|
// This is the function that sends the results of the uploading process to CKE.
|
||||||
/**
|
/**
|
||||||
* SendCKEditorResults
|
* SendCKEditorResults
|
||||||
*
|
*
|
||||||
* @param string $callback callback
|
* @param string $callback callback
|
||||||
* @param string $sFileUrl sFileUrl
|
* @param string $sFileUrl sFileUrl
|
||||||
* @param string $customMsg customMsg
|
* @param string $customMsg customMsg
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function SendCKEditorResults ($callback, $sFileUrl, $customMsg = '')
|
function SendCKEditorResults($callback, $sFileUrl, $customMsg = '')
|
||||||
{
|
{
|
||||||
echo '<script type="text/javascript">';
|
echo '<script type="text/javascript">';
|
||||||
|
|
||||||
@@ -409,5 +409,3 @@ function SendCKEditorResults ($callback, $sFileUrl, $customMsg = '')
|
|||||||
|
|
||||||
echo '</script>';
|
echo '</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -108,27 +108,36 @@ function versiondolibarrarray()
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch a sql file. Function used by:
|
* Launch a sql file. Function is used by:
|
||||||
* - Migrate process (dolibarr-xyz-abc.sql)
|
* - Migrate process (dolibarr-xyz-abc.sql)
|
||||||
* - Loading sql menus (auguria)
|
* - Loading sql menus (auguria)
|
||||||
* - Running specific Sql by a module init
|
* - Running specific Sql by a module init
|
||||||
|
* - Loading sql file of website import package
|
||||||
* Install process however does not use it.
|
* Install process however does not use it.
|
||||||
* Note that Sql files must have all comments at start of line.
|
* Note that Sql files must have all comments at start of line. Also this function take ';' as the char to detect end of sql request
|
||||||
*
|
*
|
||||||
* @param string $sqlfile Full path to sql file
|
* @param string $sqlfile Full path to sql file
|
||||||
* @param int $silent 1=Do not output anything, 0=Output line for update page
|
* @param int $silent 1=Do not output anything, 0=Output line for update page
|
||||||
* @param int $entity Entity targeted for multicompany module
|
* @param int $entity Entity targeted for multicompany module
|
||||||
* @param int $usesavepoint 1=Run a savepoint before each request and a rollback to savepoint if error (this allow to have some request with errors inside global transactions).
|
* @param int $usesavepoint 1=Run a savepoint before each request and a rollback to savepoint if error (this allow to have some request with errors inside global transactions).
|
||||||
* @param string $handler Handler targeted for menu
|
* @param string $handler Handler targeted for menu (replace __HANDLER__ with this value)
|
||||||
* @param string $okerror Family of errors we accept ('default', 'none')
|
* @param string $okerror Family of errors we accept ('default', 'none')
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @param int $linelengthlimit Limit for length of each line (Use 0 if unknown, may be faster if defined)
|
||||||
|
* @param int $nocommentremoval Do no try to remove comments (in such a case, we consider that each line is a request, so use also $linelengthlimit=0)
|
||||||
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$okerror='default')
|
function run_sql($sqlfile, $silent=1, $entity='', $usesavepoint=1, $handler='', $okerror='default', $linelengthlimit=32768, $nocommentremoval=0)
|
||||||
{
|
{
|
||||||
global $db, $conf, $langs, $user;
|
global $db, $conf, $langs, $user;
|
||||||
|
|
||||||
dol_syslog("Admin.lib::run_sql run sql file ".$sqlfile." silent=".$silent." entity=".$entity." usesavepoint=".$usesavepoint." handler=".$handler." okerror=".$okerror, LOG_DEBUG);
|
dol_syslog("Admin.lib::run_sql run sql file ".$sqlfile." silent=".$silent." entity=".$entity." usesavepoint=".$usesavepoint." handler=".$handler." okerror=".$okerror, LOG_DEBUG);
|
||||||
|
|
||||||
|
if (! is_numeric($linelengthlimit))
|
||||||
|
{
|
||||||
|
dol_syslog("Admin.lib::run_sql param linelengthlimit is not a numeric", LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
$ok=0;
|
$ok=0;
|
||||||
$error=0;
|
$error=0;
|
||||||
$i=0;
|
$i=0;
|
||||||
@@ -143,7 +152,9 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
|
|||||||
{
|
{
|
||||||
while (! feof($fp))
|
while (! feof($fp))
|
||||||
{
|
{
|
||||||
$buf = fgets($fp, 32768);
|
// Warning fgets with second parameter that is null or 0 hang.
|
||||||
|
if ($linelengthlimit > 0) $buf = fgets($fp, $linelengthlimit);
|
||||||
|
else $buf = fgets($fp);
|
||||||
|
|
||||||
// Test if request must be ran only for particular database or version (if yes, we must remove the -- comment)
|
// Test if request must be ran only for particular database or version (if yes, we must remove the -- comment)
|
||||||
if (preg_match('/^--\sV(MYSQL|PGSQL)([^\s]*)/i',$buf,$reg))
|
if (preg_match('/^--\sV(MYSQL|PGSQL)([^\s]*)/i',$buf,$reg))
|
||||||
@@ -191,13 +202,13 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add line buf to buffer if not a comment
|
// Add line buf to buffer if not a comment
|
||||||
if (! preg_match('/^\s*--/',$buf))
|
if ($nocommentremoval || ! preg_match('/^\s*--/',$buf))
|
||||||
{
|
{
|
||||||
$buf=preg_replace('/([,;ERLT\)])\s*--.*$/i','\1',$buf); //remove comment from a line that not start with -- before add it to the buffer
|
if (empty($nocommentremoval)) $buf=preg_replace('/([,;ERLT\)])\s*--.*$/i','\1',$buf); //remove comment from a line that not start with -- before add it to the buffer
|
||||||
$buffer .= trim($buf);
|
$buffer .= trim($buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
// print $buf.'<br>';
|
//print $buf.'<br>';exit;
|
||||||
|
|
||||||
if (preg_match('/;/',$buffer)) // If string contains ';', it's end of a request string, we save it in arraysql.
|
if (preg_match('/;/',$buffer)) // If string contains ';', it's end of a request string, we save it in arraysql.
|
||||||
{
|
{
|
||||||
@@ -229,7 +240,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
|
|||||||
if (! isset($listofmaxrowid[$table]))
|
if (! isset($listofmaxrowid[$table]))
|
||||||
{
|
{
|
||||||
//var_dump($db);
|
//var_dump($db);
|
||||||
$sqlgetrowid='SELECT MAX(rowid) as max from '.$table;
|
$sqlgetrowid='SELECT MAX(rowid) as max from '.preg_replace('/^llx_/', MAIN_DB_PREFIX, $table);
|
||||||
$resql=$db->query($sqlgetrowid);
|
$resql=$db->query($sqlgetrowid);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@@ -246,9 +257,10 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Replace __+MAX_llx_table__ with +999
|
||||||
$from='__+MAX_'.$table.'__';
|
$from='__+MAX_'.$table.'__';
|
||||||
$to='+'.$listofmaxrowid[$table];
|
$to='+'.$listofmaxrowid[$table];
|
||||||
$newsql=str_replace($from,$to,$newsql);
|
$newsql=str_replace($from, $to, $newsql);
|
||||||
dol_syslog('Admin.lib::run_sql New Request '.($i+1).' (replacing '.$from.' to '.$to.')', LOG_DEBUG);
|
dol_syslog('Admin.lib::run_sql New Request '.($i+1).' (replacing '.$from.' to '.$to.')', LOG_DEBUG);
|
||||||
|
|
||||||
$arraysql[$i]=$newsql;
|
$arraysql[$i]=$newsql;
|
||||||
|
|||||||
@@ -161,7 +161,8 @@ function bank_admin_prepare_head($object)
|
|||||||
* @param Object $object Object related to tabs
|
* @param Object $object Object related to tabs
|
||||||
* @return array Array of tabs to shoc
|
* @return array Array of tabs to shoc
|
||||||
*/
|
*/
|
||||||
function various_payment_prepare_head($object) {
|
function various_payment_prepare_head($object)
|
||||||
|
{
|
||||||
|
|
||||||
global $db, $langs, $conf;
|
global $db, $langs, $conf;
|
||||||
|
|
||||||
@@ -358,7 +359,7 @@ function checkES($IentOfi, $InumCta)
|
|||||||
for ($i = 0; $i < 11; $i++) {
|
for ($i = 0; $i < 11; $i++) {
|
||||||
$sum += $values[$i] * (int) substr($InumCta, $i, 1);//int to cast result of substr to a number
|
$sum += $values[$i] * (int) substr($InumCta, $i, 1);//int to cast result of substr to a number
|
||||||
}
|
}
|
||||||
|
|
||||||
$key = 11 - $sum % 11;
|
$key = 11 - $sum % 11;
|
||||||
|
|
||||||
if ($key == 10)
|
if ($key == 10)
|
||||||
@@ -369,4 +370,3 @@ function checkES($IentOfi, $InumCta)
|
|||||||
$keycontrol .= $key;
|
$keycontrol .= $key;
|
||||||
return $keycontrol;
|
return $keycontrol;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ function expensereport_prepare_head($object)
|
|||||||
$head[$h][2] = 'note';
|
$head[$h][2] = 'note';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT . '/expensereport/info.php?id=' . $object->id;
|
$head[$h][0] = DOL_URL_ROOT . '/expensereport/info.php?id=' . $object->id;
|
||||||
$head[$h][1] = $langs->trans("Info");
|
$head[$h][1] = $langs->trans("Info");
|
||||||
$head[$h][2] = 'info';
|
$head[$h][2] = 'info';
|
||||||
@@ -81,11 +81,12 @@ function expensereport_prepare_head($object)
|
|||||||
/**
|
/**
|
||||||
* Returns an array with the tabs for the "Expense report payment" section
|
* Returns an array with the tabs for the "Expense report payment" section
|
||||||
* It loads tabs from modules looking for the entity payment
|
* It loads tabs from modules looking for the entity payment
|
||||||
*
|
*
|
||||||
* @param Paiement $object Current payment object
|
* @param Paiement $object Current payment object
|
||||||
* @return array Tabs for the payment section
|
* @return array Tabs for the payment section
|
||||||
*/
|
*/
|
||||||
function payment_expensereport_prepare_head(PaymentExpenseReport $object) {
|
function payment_expensereport_prepare_head(PaymentExpenseReport $object)
|
||||||
|
{
|
||||||
|
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
|
|
||||||
@@ -139,7 +140,7 @@ function expensereport_admin_prepare_head()
|
|||||||
$head[$h][2] = 'expenseik';
|
$head[$h][2] = 'expenseik';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_USE_EXPENSE_RULE))
|
if (!empty($conf->global->MAIN_USE_EXPENSE_RULE))
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php";
|
$head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php";
|
||||||
@@ -147,7 +148,7 @@ function expensereport_admin_prepare_head()
|
|||||||
$head[$h][2] = 'expenserules';
|
$head[$h][2] = 'expenserules';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show more tabs from modules
|
// Show more tabs from modules
|
||||||
// Entries must be declared in modules descriptor with line
|
// Entries must be declared in modules descriptor with line
|
||||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
@@ -168,5 +169,5 @@ function expensereport_admin_prepare_head()
|
|||||||
|
|
||||||
complete_head_from_modules($conf,$langs,null,$head,$h,'expensereport_admin','remove');
|
complete_head_from_modules($conf,$langs,null,$head,$h,'expensereport_admin','remove');
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,11 +76,11 @@ function fichinter_prepare_head($object)
|
|||||||
foreach($resources as $resource_obj)
|
foreach($resources as $resource_obj)
|
||||||
{
|
{
|
||||||
$linked_resources = $object->getElementResources('fichinter',$object->id,$resource_obj);
|
$linked_resources = $object->getElementResources('fichinter',$object->id,$resource_obj);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=fichinter&element_id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=fichinter&element_id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("Resources");
|
$head[$h][1] = $langs->trans("Resources");
|
||||||
if ($nbResource > 0) $head[$h][1].= ' <span class="badge">'.$nbResource.'</span>';
|
if ($nbResource > 0) $head[$h][1].= ' <span class="badge">'.$nbResource.'</span>';
|
||||||
@@ -163,13 +163,13 @@ function fichinter_admin_prepare_head()
|
|||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fichinter_rec_prepare_head ($object)
|
function fichinter_rec_prepare_head($object)
|
||||||
{
|
{
|
||||||
global $langs, $conf; //, $user;
|
global $langs, $conf; //, $user;
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/fichinter/card-rec.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/fichinter/card-rec.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("CardFichinter");
|
$head[$h][1] = $langs->trans("CardFichinter");
|
||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
@@ -182,4 +182,3 @@ function fichinter_rec_prepare_head ($object)
|
|||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -574,7 +574,7 @@ function dol_filemtime($pathoffile)
|
|||||||
* @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...)
|
* @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...)
|
||||||
* @param string $destfile Destination file (can't be a directory). If empty, will be same than source file.
|
* @param string $destfile Destination file (can't be a directory). If empty, will be same than source file.
|
||||||
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
|
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
|
||||||
* @param int $indexdatabase Index new file into database.
|
* @param int $indexdatabase 1=index new file into database.
|
||||||
* @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK
|
* @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK
|
||||||
* @see dol_copy dolReplaceRegExInFile
|
* @see dol_copy dolReplaceRegExInFile
|
||||||
*/
|
*/
|
||||||
@@ -611,7 +611,7 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile='', $newmask=0,
|
|||||||
dol_delete_file($tmpdestfile);
|
dol_delete_file($tmpdestfile);
|
||||||
|
|
||||||
// Create $newpathoftmpdestfile from $newpathofsrcfile
|
// Create $newpathoftmpdestfile from $newpathofsrcfile
|
||||||
$content=file_get_contents($newpathofsrcfile, 'r');
|
$content = file_get_contents($newpathofsrcfile, 'r');
|
||||||
|
|
||||||
$content = make_substitutions($content, $arrayreplacement, null);
|
$content = make_substitutions($content, $arrayreplacement, null);
|
||||||
|
|
||||||
@@ -1509,7 +1509,7 @@ function dol_init_file_process($pathtoscan='', $trackid='')
|
|||||||
*
|
*
|
||||||
* @param string $upload_dir Directory where to store uploaded file (note: used to forge $destpath = $upload_dir + filename)
|
* @param string $upload_dir Directory where to store uploaded file (note: used to forge $destpath = $upload_dir + filename)
|
||||||
* @param int $allowoverwrite 1=Allow overwrite existing file
|
* @param int $allowoverwrite 1=Allow overwrite existing file
|
||||||
* @param int $donotupdatesession 1=Do no edit _SESSION variable but update database index. 0=Update _SESSION and not database index.
|
* @param int $donotupdatesession 1=Do no edit _SESSION variable but update database index. 0=Update _SESSION and not database index. -1=Do not update SESSION neither db.
|
||||||
* @param string $varfiles _FILES var name
|
* @param string $varfiles _FILES var name
|
||||||
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__'
|
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__'
|
||||||
* @param string $link Link to add (to add a link instead of a file)
|
* @param string $link Link to add (to add a link instead of a file)
|
||||||
@@ -1591,7 +1591,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update table of files
|
// Update table of files
|
||||||
if ($donotupdatesession)
|
if ($donotupdatesession == 1)
|
||||||
{
|
{
|
||||||
$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile), $TFile['name'][$i], 'uploaded', 0);
|
$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile), $TFile['name'][$i], 'uploaded', 0);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@@ -1656,7 +1656,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
|
|||||||
* All information used are in db, conf, langs, user and _FILES.
|
* All information used are in db, conf, langs, user and _FILES.
|
||||||
*
|
*
|
||||||
* @param int $filenb File nb to delete
|
* @param int $filenb File nb to delete
|
||||||
* @param int $donotupdatesession 1=Do not edit _SESSION variable
|
* @param int $donotupdatesession -1 or 1 = Do not update _SESSION variable
|
||||||
* @param int $donotdeletefile 1=Do not delete physically file
|
* @param int $donotdeletefile 1=Do not delete physically file
|
||||||
* @param string $trackid Track id (used to prefix name of session vars to avoid conflict)
|
* @param string $trackid Track id (used to prefix name of session vars to avoid conflict)
|
||||||
* @return void
|
* @return void
|
||||||
|
|||||||
@@ -3125,8 +3125,8 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo
|
|||||||
* @param boolean|int $pictoisfullpath If true or 1, image path is a full path
|
* @param boolean|int $pictoisfullpath If true or 1, image path is a full path
|
||||||
* @param int $srconly Return only content of the src attribute of img.
|
* @param int $srconly Return only content of the src attribute of img.
|
||||||
* @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
|
* @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
|
||||||
* @param string $alt Force alt for bind peoplae
|
* @param string $alt Force alt for bind people
|
||||||
* @param string $morecss Add more class css on img tag (For example 'myclascss')
|
* @param string $morecss Add more class css on img tag (For example 'myclascss'). Work only if $moreatt is empty.
|
||||||
* @return string Return img tag
|
* @return string Return img tag
|
||||||
* @see #img_object, #img_picto_common
|
* @see #img_object, #img_picto_common
|
||||||
*/
|
*/
|
||||||
@@ -3282,7 +3282,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
//$title=$tmparray[0];
|
//$title=$tmparray[0];
|
||||||
//$alt=empty($tmparray[1])?'':$tmparray[1];
|
//$alt=empty($tmparray[1])?'':$tmparray[1];
|
||||||
$title = $titlealt;
|
$title = $titlealt;
|
||||||
return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.(($notitle || empty($title))?'':' title="'.dol_escape_htmltag($title).'"').($moreatt?' '.$moreatt:' class="inline-block"').'>'; // Alt is used for accessibility, title for popup
|
return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.(($notitle || empty($title))?'':' title="'.dol_escape_htmltag($title).'"').($moreatt?' '.$moreatt:' class="inline-block'.($morecss?' '.$morecss:'').'"').'>'; // Alt is used for accessibility, title for popup
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1167,7 +1167,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
|||||||
return $numFinal;
|
return $numFinal;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_string_between($string, $start, $end){
|
function get_string_between($string, $start, $end)
|
||||||
|
{
|
||||||
$string = " ".$string;
|
$string = " ".$string;
|
||||||
$ini = strpos($string,$start);
|
$ini = strpos($string,$start);
|
||||||
if ($ini == 0) return "";
|
if ($ini == 0) return "";
|
||||||
@@ -2197,7 +2198,8 @@ function colorStringToArray($stringcolor,$colorifnotfound=array(88,88,88))
|
|||||||
* @param array $input Array of products
|
* @param array $input Array of products
|
||||||
* @return array Array of combinations
|
* @return array Array of combinations
|
||||||
*/
|
*/
|
||||||
function cartesianArray(array $input) {
|
function cartesianArray(array $input)
|
||||||
|
{
|
||||||
// filter out empty values
|
// filter out empty values
|
||||||
$input = array_filter($input);
|
$input = array_filter($input);
|
||||||
|
|
||||||
@@ -2305,8 +2307,9 @@ function getModuleDirForApiClass($module)
|
|||||||
* @param $max int Between 0 and 255
|
* @param $max int Between 0 and 255
|
||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
function random_color_part($min=0,$max=255) {
|
function random_color_part($min=0,$max=255)
|
||||||
return str_pad( dechex( mt_rand( $min, $max) ), 2, '0', STR_PAD_LEFT);
|
{
|
||||||
|
return str_pad( dechex( mt_rand( $min, $max) ), 2, '0', STR_PAD_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2316,6 +2319,7 @@ function random_color_part($min=0,$max=255) {
|
|||||||
* @param $max int Between 0 and 255
|
* @param $max int Between 0 and 255
|
||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
function random_color($min=0, $max=255) {
|
function random_color($min=0, $max=255)
|
||||||
return random_color_part($min, $max) . random_color_part($min, $max) . random_color_part($min, $max);
|
{
|
||||||
|
return random_color_part($min, $max) . random_color_part($min, $max) . random_color_part($min, $max);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,8 @@
|
|||||||
* @param Paiement $object Current payment object
|
* @param Paiement $object Current payment object
|
||||||
* @return array Tabs for the payment section
|
* @return array Tabs for the payment section
|
||||||
*/
|
*/
|
||||||
function payment_prepare_head(Paiement $object) {
|
function payment_prepare_head(Paiement $object)
|
||||||
|
{
|
||||||
|
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
|
|
||||||
@@ -59,7 +60,8 @@ function payment_prepare_head(Paiement $object) {
|
|||||||
* @param Paiement $object Current payment object
|
* @param Paiement $object Current payment object
|
||||||
* @return array Tabs for the payment section
|
* @return array Tabs for the payment section
|
||||||
*/
|
*/
|
||||||
function payment_supplier_prepare_head(Paiement $object) {
|
function payment_supplier_prepare_head(Paiement $object)
|
||||||
|
{
|
||||||
|
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ function propal_prepare_head($object)
|
|||||||
|| (! empty($conf->livraison_bon->enabled) && $user->rights->expedition->livraison->lire))))
|
|| (! empty($conf->livraison_bon->enabled) && $user->rights->expedition->livraison->lire))))
|
||||||
{
|
{
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
|
$text = '';
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id;
|
||||||
if ($conf->expedition_bon->enabled) $text=$langs->trans("Shipment");
|
if ($conf->expedition_bon->enabled) $text=$langs->trans("Shipment");
|
||||||
if ($conf->livraison_bon->enabled) $text.='/'.$langs->trans("Receivings");
|
if ($conf->livraison_bon->enabled) $text.='/'.$langs->trans("Receivings");
|
||||||
|
|||||||
@@ -87,7 +87,8 @@ function resource_prepare_head($object)
|
|||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
function resource_admin_prepare_head() {
|
function resource_admin_prepare_head()
|
||||||
|
{
|
||||||
|
|
||||||
global $langs, $conf, $user;
|
global $langs, $conf, $user;
|
||||||
|
|
||||||
|
|||||||
@@ -20,14 +20,15 @@
|
|||||||
/**
|
/**
|
||||||
* Returns an array with the tabs for the "salaries" section
|
* Returns an array with the tabs for the "salaries" section
|
||||||
* It loads tabs from modules looking for the entity salaries
|
* It loads tabs from modules looking for the entity salaries
|
||||||
*
|
*
|
||||||
* @param Paiement $object Current salaries object
|
* @param Paiement $object Current salaries object
|
||||||
* @return array Tabs for the salaries section
|
* @return array Tabs for the salaries section
|
||||||
*/
|
*/
|
||||||
function salaries_prepare_head($object) {
|
function salaries_prepare_head($object)
|
||||||
|
{
|
||||||
|
|
||||||
global $db, $langs, $conf;
|
global $db, $langs, $conf;
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ function salaries_prepare_head($object) {
|
|||||||
$head[$h][1] = $langs->trans("Info");
|
$head[$h][1] = $langs->trans("Info");
|
||||||
$head[$h][2] = 'info';
|
$head[$h][2] = 'info';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'salaries', 'remove');
|
complete_head_from_modules($conf,$langs,$object,$head,$h,'salaries', 'remove');
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
|
|||||||
@@ -28,7 +28,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
|
|||||||
*/
|
*/
|
||||||
abstract class ModeleAction extends CommonDocGenerator
|
abstract class ModeleAction extends CommonDocGenerator
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
|
|||||||
*/
|
*/
|
||||||
abstract class ModeleBankAccountDoc extends CommonDocGenerator
|
abstract class ModeleBankAccountDoc extends CommonDocGenerator
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -33,7 +33,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/barcode.lib.php'; // This is to inc
|
|||||||
class modPhpbarcode extends ModeleBarCode
|
class modPhpbarcode extends ModeleBarCode
|
||||||
{
|
{
|
||||||
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||||
var $error='';
|
|
||||||
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -32,7 +32,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/barcode.lib.php'; // This is to inc
|
|||||||
class modTcpdfbarcode extends ModeleBarCode
|
class modTcpdfbarcode extends ModeleBarCode
|
||||||
{
|
{
|
||||||
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||||
var $error='';
|
|
||||||
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
var $is2d = false;
|
var $is2d = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -29,7 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
|
|||||||
*/
|
*/
|
||||||
abstract class ModeleBarCode
|
abstract class ModeleBarCode
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,7 +53,10 @@ abstract class ModeleBarCode
|
|||||||
*/
|
*/
|
||||||
abstract class ModeleNumRefBarCode
|
abstract class ModeleNumRefBarCode
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/** Return default description of numbering model
|
/** Return default description of numbering model
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
|
|||||||
{
|
{
|
||||||
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||||
var $prefix='CHK';
|
var $prefix='CHK';
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
var $name='Mint';
|
var $name='Mint';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requ
|
|||||||
*/
|
*/
|
||||||
abstract class ModeleNumRefChequeReceipts
|
abstract class ModeleNumRefChequeReceipts
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return if a module can be used or not
|
* Return if a module can be used or not
|
||||||
@@ -119,7 +122,10 @@ abstract class ModeleNumRefChequeReceipts
|
|||||||
*/
|
*/
|
||||||
abstract class ModeleChequeReceipts extends CommonDocGenerator
|
abstract class ModeleChequeReceipts extends CommonDocGenerator
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
|||||||
{
|
{
|
||||||
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||||
var $prefix='CO';
|
var $prefix='CO';
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
var $nom='Marbre';
|
var $nom='Marbre';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
|||||||
*/
|
*/
|
||||||
abstract class ModelePDFCommandes extends CommonDocGenerator
|
abstract class ModelePDFCommandes extends CommonDocGenerator
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
@@ -72,7 +75,10 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
|
|||||||
|
|
||||||
abstract class ModeleNumRefCommandes
|
abstract class ModeleNumRefCommandes
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return if a module can be used or not
|
* Return if a module can be used or not
|
||||||
|
|||||||
@@ -30,7 +30,10 @@ class mod_contract_serpis extends ModelNumRefContracts
|
|||||||
{
|
{
|
||||||
var $version='dolibarr';
|
var $version='dolibarr';
|
||||||
var $prefix='CT';
|
var $prefix='CT';
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
var $nom='Serpis';
|
var $nom='Serpis';
|
||||||
var $code_auto=1;
|
var $code_auto=1;
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,10 @@
|
|||||||
*/
|
*/
|
||||||
abstract class ModelePDFContract extends CommonDocGenerator
|
abstract class ModelePDFContract extends CommonDocGenerator
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,7 +71,10 @@ abstract class ModelePDFContract extends CommonDocGenerator
|
|||||||
*/
|
*/
|
||||||
class ModelNumRefContracts
|
class ModelNumRefContracts
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return if a module can be used or not
|
* Return if a module can be used or not
|
||||||
|
|||||||
@@ -34,7 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
|||||||
*/
|
*/
|
||||||
abstract class ModeleDon extends CommonDocGenerator
|
abstract class ModeleDon extends CommonDocGenerator
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
@@ -64,7 +67,10 @@ abstract class ModeleDon extends CommonDocGenerator
|
|||||||
*/
|
*/
|
||||||
abstract class ModeleNumRefDons
|
abstract class ModeleNumRefDons
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return if a module can be used or not
|
* Return if a module can be used or not
|
||||||
|
|||||||
@@ -30,7 +30,10 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
|||||||
{
|
{
|
||||||
var $version='dolibarr';
|
var $version='dolibarr';
|
||||||
var $prefix='SH';
|
var $prefix='SH';
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
var $nom='Safor';
|
var $nom='Safor';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,10 @@
|
|||||||
*/
|
*/
|
||||||
abstract class ModelePdfExpedition extends CommonDocGenerator
|
abstract class ModelePdfExpedition extends CommonDocGenerator
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,7 +70,10 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
|
|||||||
*/
|
*/
|
||||||
abstract class ModelNumRefExpedition
|
abstract class ModelNumRefExpedition
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/** Return if a model can be used or not
|
/** Return if a model can be used or not
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -30,7 +30,10 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
|
|||||||
{
|
{
|
||||||
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||||
var $prefix='ER';
|
var $prefix='ER';
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
var $nom='Jade';
|
var $nom='Jade';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
|
|||||||
*/
|
*/
|
||||||
abstract class ModeleExpenseReport extends CommonDocGenerator
|
abstract class ModeleExpenseReport extends CommonDocGenerator
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,7 +78,10 @@ function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $
|
|||||||
|
|
||||||
abstract class ModeleNumRefExpenseReport
|
abstract class ModeleNumRefExpenseReport
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return if a module can be used or not
|
* Return if a module can be used or not
|
||||||
|
|||||||
@@ -30,7 +30,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
|
|||||||
*/
|
*/
|
||||||
class ModeleExports extends CommonDocGenerator // This class can't be abstract as there is instance propreties loaded by liste_modeles
|
class ModeleExports extends CommonDocGenerator // This class can't be abstract as there is instance propreties loaded by liste_modeles
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
var $driverlabel=array();
|
var $driverlabel=array();
|
||||||
var $driverversion=array();
|
var $driverversion=array();
|
||||||
|
|||||||
@@ -35,7 +35,10 @@ class mod_facture_mars extends ModeleNumRefFactures
|
|||||||
var $prefixreplacement='FR';
|
var $prefixreplacement='FR';
|
||||||
var $prefixdeposit='AC';
|
var $prefixdeposit='AC';
|
||||||
var $prefixcreditnote='AV';
|
var $prefixcreditnote='AV';
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -33,7 +33,10 @@ class mod_facture_terre extends ModeleNumRefFactures
|
|||||||
var $prefixinvoice='FA';
|
var $prefixinvoice='FA';
|
||||||
var $prefixcreditnote='AV';
|
var $prefixcreditnote='AV';
|
||||||
var $prefixdeposit='AC';
|
var $prefixdeposit='AC';
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -37,7 +37,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requ
|
|||||||
*/
|
*/
|
||||||
abstract class ModelePDFFactures extends CommonDocGenerator
|
abstract class ModelePDFFactures extends CommonDocGenerator
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
@@ -66,7 +69,10 @@ abstract class ModelePDFFactures extends CommonDocGenerator
|
|||||||
*/
|
*/
|
||||||
abstract class ModeleNumRefFactures
|
abstract class ModeleNumRefFactures
|
||||||
{
|
{
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return if a module can be used or not
|
* Return if a module can be used or not
|
||||||
|
|||||||
@@ -32,7 +32,10 @@ class mod_pacific extends ModeleNumRefFicheinter
|
|||||||
{
|
{
|
||||||
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||||
var $prefix='FI';
|
var $prefix='FI';
|
||||||
var $error='';
|
/**
|
||||||
|
* @var string Error code (or message)
|
||||||
|
*/
|
||||||
|
public $error='';
|
||||||
var $nom = 'pacific';
|
var $nom = 'pacific';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user