forked from Wavyzz/dolibarr
Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -41,7 +41,7 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||||
|
|
||||||
$id = GETPOST('id', 'int'); // id of record
|
$id = GETPOST('id', 'int'); // id of record
|
||||||
$mode = GETPOST('mode', 'aZ09'); // '' or 'tmp'
|
$mode = GETPOST('mode', 'aZ09'); // '' or '_tmp'
|
||||||
$piece_num = GETPOST("piece_num", 'int'); // id of transaction (several lines share the same transaction id)
|
$piece_num = GETPOST("piece_num", 'int'); // id of transaction (several lines share the same transaction id)
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
|||||||
@@ -1130,7 +1130,7 @@ class BookKeeping extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param User $user User that modifies
|
* @param User $user User that modifies
|
||||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||||
* @param string $mode Mode
|
* @param string $mode Mode ('' or _tmp')
|
||||||
* @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 = '')
|
||||||
@@ -1257,12 +1257,12 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update movement
|
* Update accounting movement
|
||||||
*
|
*
|
||||||
* @param string $piece_num Piece num
|
* @param string $piece_num Piece num
|
||||||
* @param string $field Field
|
* @param string $field Field
|
||||||
* @param string $value Value
|
* @param string $value Value
|
||||||
* @param string $mode Mode
|
* @param string $mode Mode ('' or _tmp')
|
||||||
* @return number <0 if KO, >0 if OK
|
* @return number <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function updateByMvt($piece_num = '', $field = '', $value = '', $mode = '')
|
public function updateByMvt($piece_num = '', $field = '', $value = '', $mode = '')
|
||||||
@@ -1271,9 +1271,9 @@ class BookKeeping extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element.$mode." as ab";
|
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
||||||
$sql .= ' SET ab.'.$field.'='.(is_numeric($value) ? $value : "'".$this->db->escape($value)."'");
|
$sql .= ' SET '.$field.'='.(is_numeric($value) ? $value : "'".$this->db->escape($value)."'");
|
||||||
$sql .= ' WHERE ab.piece_num='.$piece_num;
|
$sql .= " WHERE piece_num = '".$this->db->escape($piece_num)."'";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no
|
|||||||
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
|
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
|
||||||
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
|
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
|
||||||
if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
|
if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
|
||||||
|
if (!defined("NOSESSION")) define("NOSESSION", '1');
|
||||||
|
|
||||||
|
|
||||||
// Force entity if a value is provided into HTTP header. Otherwise, will use the entity of user of token used.
|
// Force entity if a value is provided into HTTP header. Otherwise, will use the entity of user of token used.
|
||||||
@@ -72,7 +73,8 @@ if (empty($conf->global->MAIN_MODULE_API))
|
|||||||
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
||||||
print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>';
|
print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>';
|
||||||
print $langs->trans("ToActivateModule");
|
print $langs->trans("ToActivateModule");
|
||||||
exit;
|
//session_destroy();
|
||||||
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test if explorer is not disabled
|
// Test if explorer is not disabled
|
||||||
@@ -81,7 +83,8 @@ if (preg_match('/api\/index\.php\/explorer/', $url) && !empty($conf->global->API
|
|||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
||||||
print $langs->trans("WarningAPIExplorerDisabled").'.<br><br>';
|
print $langs->trans("WarningAPIExplorerDisabled").'.<br><br>';
|
||||||
exit;
|
//session_destroy();
|
||||||
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -138,7 +141,7 @@ if (!empty($conf->global->API_RESTRICT_ON_IP))
|
|||||||
dol_syslog('Remote ip is '.$ipremote.', not into list '.$conf->global->API_RESTRICT_ON_IP);
|
dol_syslog('Remote ip is '.$ipremote.', not into list '.$conf->global->API_RESTRICT_ON_IP);
|
||||||
print 'APIs are not allowed from the IP '.$ipremote;
|
print 'APIs are not allowed from the IP '.$ipremote;
|
||||||
header('HTTP/1.1 503 API not allowed from your IP '.$ipremote);
|
header('HTTP/1.1 503 API not allowed from your IP '.$ipremote);
|
||||||
//print $conf->global->API_RESTRICT_ON_IP;
|
//session_destroy();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -272,6 +275,7 @@ if (!empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' &&
|
|||||||
dol_syslog('Failed to make include_once '.$dir_part_file, LOG_WARNING);
|
dol_syslog('Failed to make include_once '.$dir_part_file, LOG_WARNING);
|
||||||
print 'API not found (failed to include API file)';
|
print 'API not found (failed to include API file)';
|
||||||
header('HTTP/1.1 501 API not found (failed to include API file)');
|
header('HTTP/1.1 501 API not found (failed to include API file)');
|
||||||
|
//session_destroy();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,9 +283,16 @@ if (!empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' &&
|
|||||||
$api->r->addAPIClass($classname);
|
$api->r->addAPIClass($classname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//var_dump($api->r->apiVersionMap);
|
//var_dump($api->r->apiVersionMap);
|
||||||
//exit;
|
//exit;
|
||||||
|
|
||||||
// Call API (we suppose we found it).
|
// Call API (we suppose we found it).
|
||||||
// The handle will use the file api/temp/routes.php to get data to run the API. If the file exists and the entry for API is not found, it will return 404.
|
// The handle will use the file api/temp/routes.php to get data to run the API. If the file exists and the entry for API is not found, it will return 404.
|
||||||
|
|
||||||
|
//Luracast\Restler\Defaults::$returnResponse = true;
|
||||||
|
//print $api->r->handle();
|
||||||
|
|
||||||
$api->r->handle();
|
$api->r->handle();
|
||||||
|
|
||||||
|
//session_destroy();
|
||||||
|
|||||||
@@ -268,10 +268,10 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle
|
|||||||
if ($offsetforchartofaccount > 0)
|
if ($offsetforchartofaccount > 0)
|
||||||
{
|
{
|
||||||
// Replace lines
|
// Replace lines
|
||||||
// 'INSERT INTO llx_accounting_account (__ENTITY__, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (1401, 'PCG99-ABREGE','CAPIT', 'XXXXXX', '1', 0, '...', 1);'
|
// 'INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1401, 'PCG99-ABREGE','CAPIT', 'XXXXXX', '1', '0', '...', 1);'
|
||||||
// with
|
// with
|
||||||
// 'INSERT INTO llx_accounting_account (__ENTITY__, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (1401 + 200100000, 'PCG99-ABREGE','CAPIT', 'XXXXXX', '1', 0, '...', 1);'
|
// 'INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1401 + 200100000, 'PCG99-ABREGE','CAPIT', 'XXXXXX', '1', '0', '...', 1);'
|
||||||
$newsql = preg_replace('/VALUES\s*\(__ENTITY__, \s*(\d+)\s*,(\s*\'[^\',]*\'\s*,\s*\'[^\',]*\'\s*,\s*\'[^\',]*\'\s*,\s*\'[^\',]*\'\s*),\s*\'?([^\',]*)\'?/ims', 'VALUES (__ENTITY__, \1 + '.$offsetforchartofaccount.', \2, \3 + '.$offsetforchartofaccount, $newsql);
|
$newsql = preg_replace('/VALUES\s*\(__ENTITY__, \s*(\d+)\s*,(\s*\'[^\',]*\'\s*,\s*\'[^\',]*\'\s*,\s*\'?[^\',]*\'?\s*),\s*\'?([^\',]*)\'?/ims', 'VALUES (__ENTITY__, \1 + '.$offsetforchartofaccount.', \2, \3 + '.$offsetforchartofaccount, $newsql);
|
||||||
$newsql = preg_replace('/([,\s])0 \+ '.$offsetforchartofaccount.'/ims', '\1 0', $newsql);
|
$newsql = preg_replace('/([,\s])0 \+ '.$offsetforchartofaccount.'/ims', '\1 0', $newsql);
|
||||||
//var_dump($newsql);
|
//var_dump($newsql);
|
||||||
$arraysql[$i] = $newsql;
|
$arraysql[$i] = $newsql;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -63,6 +63,7 @@ ShipmentClassifyClosedInDolibarr=Shipment %s classified billed
|
|||||||
ShipmentUnClassifyCloseddInDolibarr=Shipment %s classified re-open
|
ShipmentUnClassifyCloseddInDolibarr=Shipment %s classified re-open
|
||||||
ShipmentBackToDraftInDolibarr=Shipment %s go back to draft status
|
ShipmentBackToDraftInDolibarr=Shipment %s go back to draft status
|
||||||
ShipmentDeletedInDolibarr=Shipment %s deleted
|
ShipmentDeletedInDolibarr=Shipment %s deleted
|
||||||
|
ReceptionValidatedInDolibarr=Reception %s validated
|
||||||
OrderCreatedInDolibarr=Order %s created
|
OrderCreatedInDolibarr=Order %s created
|
||||||
OrderValidatedInDolibarr=Order %s validated
|
OrderValidatedInDolibarr=Order %s validated
|
||||||
OrderDeliveredInDolibarr=Order %s classified delivered
|
OrderDeliveredInDolibarr=Order %s classified delivered
|
||||||
|
|||||||
@@ -213,13 +213,6 @@ session_name($sessionname);
|
|||||||
if (!defined('NOSESSION'))
|
if (!defined('NOSESSION'))
|
||||||
{
|
{
|
||||||
session_start();
|
session_start();
|
||||||
/*if (ini_get('register_globals')) // Deprecated in 5.3 and removed in 5.4. To solve bug in using $_SESSION
|
|
||||||
{
|
|
||||||
foreach ($_SESSION as $key=>$value)
|
|
||||||
{
|
|
||||||
if (isset($GLOBALS[$key])) unset($GLOBALS[$key]);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init the 5 global objects, this include will make the 'new Xxx()' and set properties for: $conf, $db, $langs, $user, $mysoc
|
// Init the 5 global objects, this include will make the 'new Xxx()' and set properties for: $conf, $db, $langs, $user, $mysoc
|
||||||
|
|||||||
@@ -2981,12 +2981,12 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Returns an accounting code, following the accounting code module.
|
* Assigns a accounting code from the accounting code module.
|
||||||
* May be identical to the one entered or generated automatically.
|
* Computed value is stored into this->code_compta or this->code_compta_fournisseur according to $type.
|
||||||
* To date only the automatic generation is implemented
|
* May be identical to the one entered or generated automatically. Currently, only the automatic generation is implemented.
|
||||||
*
|
*
|
||||||
* @param string $type Type of thirdparty ('customer' or 'supplier')
|
* @param string $type Type of thirdparty ('customer' or 'supplier')
|
||||||
* @return string Code compta si ok, 0 si aucun, <0 si ko
|
* @return int 0 if OK, <0 if $type is not valid
|
||||||
*/
|
*/
|
||||||
public function get_codecompta($type)
|
public function get_codecompta($type)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -222,6 +222,11 @@ TITLE BUTTON
|
|||||||
border: 1px solid var(--btncolorborder);
|
border: 1px solid var(--btncolorborder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.btnTitle.btnTitleSelected {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
.btnTitle > .btnTitle-icon{
|
.btnTitle > .btnTitle-icon{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user