forked from Wavyzz/dolibarr
Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0
This commit is contained in:
@@ -348,6 +348,12 @@ class Members extends DolibarrApi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$member->array_options[$index] = $this->_checkValForAPI($field, $val, $member);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$member->$field = $value;
|
$member->$field = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,6 +193,12 @@ class MembersTypes extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$membertype->array_options[$index] = $this->_checkValForAPI($field, $val, $membertype);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// Process the status separately because it must be updated using
|
// Process the status separately because it must be updated using
|
||||||
// the validate(), resiliate() and exclude() methods of the class AdherentType.
|
// the validate(), resiliate() and exclude() methods of the class AdherentType.
|
||||||
$membertype->$field = $value;
|
$membertype->$field = $value;
|
||||||
|
|||||||
@@ -186,6 +186,12 @@ class Subscriptions extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$subscription->array_options[$index] = $this->_checkValForAPI($field, $val, $subscription);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$subscription->$field = $value;
|
$subscription->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -240,6 +240,12 @@ class Boms extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->bom->array_options[$index] = $this->_checkValForAPI($field, $val, $this->bom);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->bom->$field = $value;
|
$this->bom->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -237,6 +237,12 @@ class Categories extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->category->array_options[$index] = $this->_checkValForAPI($field, $val, $this->category);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->category->$field = $value;
|
$this->category->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1960,7 +1960,12 @@ if ($id > 0) {
|
|||||||
// related contact
|
// related contact
|
||||||
print '<tr><td>'.$langs->trans("ActionOnContact").'</td><td>';
|
print '<tr><td>'.$langs->trans("ActionOnContact").'</td><td>';
|
||||||
print '<div class="maxwidth200onsmartphone">';
|
print '<div class="maxwidth200onsmartphone">';
|
||||||
print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(empty($conf->global->MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT) ? $object->socid : 0, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid');
|
if (getDolGlobalInt('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT')) {
|
||||||
|
$select_contact_default = 0; // select "all" contacts by default : avoid to use it if there is a lot of contacts
|
||||||
|
} else {
|
||||||
|
$select_contact_default = -1; // select "none" by default
|
||||||
|
}
|
||||||
|
print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(!empty($object->socid) ? $object->socid : $select_contact_default, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@@ -1260,7 +1260,9 @@ class ActionComm extends CommonObject
|
|||||||
if (!is_array($val)) { // For backward compatibility when val=id
|
if (!is_array($val)) { // For backward compatibility when val=id
|
||||||
$val = array('id' => $val);
|
$val = array('id' => $val);
|
||||||
}
|
}
|
||||||
if (!empty($already_inserted[$val['id']])) continue;
|
if (!empty($already_inserted[$val['id']])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
|
||||||
$sql .= " VALUES(".((int) $this->id).", 'socpeople', ".((int) $val['id']).", 0, 0, 0)";
|
$sql .= " VALUES(".((int) $this->id).", 'socpeople', ".((int) $val['id']).", 0, 0, 0)";
|
||||||
|
|||||||
@@ -270,6 +270,12 @@ class AgendaEvents extends DolibarrApi
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->actioncomm->array_options[$index] = $this->_checkValForAPI($field, $val, $this->actioncomm);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->actioncomm->$field = $this->_checkValForAPI($field, $value, $this->actioncomm);
|
$this->actioncomm->$field = $this->_checkValForAPI($field, $value, $this->actioncomm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -695,6 +695,12 @@ class Proposals extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->propal->array_options[$index] = $this->_checkValForAPI($field, $val, $this->propal);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->propal->$field = $value;
|
$this->propal->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -653,6 +653,12 @@ class Orders extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->commande->array_options[$index] = $this->_checkValForAPI($field, $val, $this->commande);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->commande->$field = $value;
|
$this->commande->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -332,6 +332,12 @@ class BankAccounts extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$account->array_options[$index] = $this->_checkValForAPI($field, $val, $account);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$account->$field = $this->_checkValForAPI($field, $value, $account);
|
$account->$field = $this->_checkValForAPI($field, $value, $account);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -622,6 +622,12 @@ class Invoices extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->invoice->array_options[$index] = $this->_checkValForAPI($field, $val, $this->invoice);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->invoice->$field = $value;
|
$this->invoice->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -509,6 +509,12 @@ class Contracts extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->contract->array_options[$index] = $this->_checkValForAPI($field, $val, $this->contract);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->contract->$field = $value;
|
$this->contract->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9155,10 +9155,11 @@ function dol_osencode($str)
|
|||||||
* @param string $fieldid Field to get
|
* @param string $fieldid Field to get
|
||||||
* @param int $entityfilter Filter by entity
|
* @param int $entityfilter Filter by entity
|
||||||
* @param string $filters Filters to add. WARNING: string must be escaped for SQL and not coming from user input.
|
* @param string $filters Filters to add. WARNING: string must be escaped for SQL and not coming from user input.
|
||||||
|
* @param bool $useCache If true (default), cache will be queried and updated.
|
||||||
* @return int <0 if KO, Id of code if OK
|
* @return int <0 if KO, Id of code if OK
|
||||||
* @see $langs->getLabelFromKey
|
* @see $langs->getLabelFromKey
|
||||||
*/
|
*/
|
||||||
function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0, $filters = '')
|
function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0, $filters = '', $useCache = true)
|
||||||
{
|
{
|
||||||
global $cache_codes;
|
global $cache_codes;
|
||||||
|
|
||||||
@@ -9168,8 +9169,8 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid =
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check in cache
|
// Check in cache
|
||||||
if (isset($cache_codes[$tablename][$key][$fieldid])) { // Can be defined to 0 or ''
|
if ($useCache && isset($cache_codes[$tablename][$fieldkey][$fieldid][$entityfilter][$filters][$key])) { // Can be defined to 0 or ''
|
||||||
return $cache_codes[$tablename][$key][$fieldid]; // Found in cache
|
return $cache_codes[$tablename][$fieldkey][$fieldid][$entityfilter][$filters][$key]; // Found in cache
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog('dol_getIdFromCode (value for field '.$fieldid.' from key '.$key.' not found into cache)', LOG_DEBUG);
|
dol_syslog('dol_getIdFromCode (value for field '.$fieldid.' from key '.$key.' not found into cache)', LOG_DEBUG);
|
||||||
@@ -9187,13 +9188,15 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid =
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
$valuetoget = '';
|
||||||
if ($obj) {
|
if ($obj) {
|
||||||
$cache_codes[$tablename][$key][$fieldid] = $obj->valuetoget;
|
$valuetoget = $obj->valuetoget;
|
||||||
} else {
|
|
||||||
$cache_codes[$tablename][$key][$fieldid] = '';
|
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
return $cache_codes[$tablename][$key][$fieldid];
|
if ($useCache) {
|
||||||
|
$cache_codes[$tablename][$fieldkey][$fieldid][$entityfilter][$filters][$key] = $valuetoget;
|
||||||
|
}
|
||||||
|
return $valuetoget;
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -11158,11 +11161,11 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
|||||||
* 'classOverride' => '' // to replace class attribute of the button
|
* 'classOverride' => '' // to replace class attribute of the button
|
||||||
* ],
|
* ],
|
||||||
* 'confirm' => [
|
* 'confirm' => [
|
||||||
* 'url' => 'http://', // Overide Url to go when user click on action btn, if empty default url is $url.?confirm=yes, for no js compatibility use $url for fallback confirm.
|
* 'url' => 'http://', // Override Url to go when user click on action btn, if empty default url is $url.?confirm=yes, for no js compatibility use $url for fallback confirm.
|
||||||
* 'title' => '', // Overide title of modal, if empty default title use "ConfirmBtnCommonTitle" lang key
|
* 'title' => '', // Override title of modal, if empty default title use "ConfirmBtnCommonTitle" lang key
|
||||||
* 'action-btn-label' => '', // Overide label of action button, if empty default label use "Confirm" lang key
|
* 'action-btn-label' => '', // Override label of action button, if empty default label use "Confirm" lang key
|
||||||
* 'cancel-btn-label' => '', // Overide label of cancel button, if empty default label use "CloseDialog" lang key
|
* 'cancel-btn-label' => '', // Override label of cancel button, if empty default label use "CloseDialog" lang key
|
||||||
* 'content' => '', // Overide text of content, if empty default content use "ConfirmBtnCommonContent" lang key
|
* 'content' => '', // Override text of content, if empty default content use "ConfirmBtnCommonContent" lang key
|
||||||
* 'modal' => true, // true|false to display dialog as a modal (with dark background)
|
* 'modal' => true, // true|false to display dialog as a modal (with dark background)
|
||||||
* 'isDropDrown' => false, // true|false to display dialog as a dropdown (with dark background)
|
* 'isDropDrown' => false, // true|false to display dialog as a dropdown (with dark background)
|
||||||
* ],
|
* ],
|
||||||
|
|||||||
@@ -1425,12 +1425,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
|||||||
{
|
{
|
||||||
global $db, $conf, $langs;
|
global $db, $conf, $langs;
|
||||||
|
|
||||||
$idprod = (!empty($object->lines[$i]->fk_product) ? $object->lines[$i]->fk_product : false);
|
$multilangsactive = getDolGlobalInt('MAIN_MULTILANGS');
|
||||||
$label = (!empty($object->lines[$i]->label) ? $object->lines[$i]->label : (!empty($object->lines[$i]->product_label) ? $object->lines[$i]->product_label : ''));
|
|
||||||
$desc = (!empty($object->lines[$i]->desc) ? $object->lines[$i]->desc : (!empty($object->lines[$i]->description) ? $object->lines[$i]->description : ''));
|
|
||||||
$ref_supplier = (!empty($object->lines[$i]->ref_supplier) ? $object->lines[$i]->ref_supplier : (!empty($object->lines[$i]->ref_fourn) ? $object->lines[$i]->ref_fourn : '')); // TODO Not yet saved for supplier invoices, only supplier orders
|
|
||||||
$note = (!empty($object->lines[$i]->note) ? $object->lines[$i]->note : '');
|
|
||||||
$dbatch = (!empty($object->lines[$i]->detail_batch) ? $object->lines[$i]->detail_batch : false);
|
|
||||||
|
|
||||||
if ($issupplierline) {
|
if ($issupplierline) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||||
@@ -1444,10 +1439,54 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//id
|
||||||
|
$idprod = (!empty($object->lines[$i]->fk_product) ? $object->lines[$i]->fk_product : false);
|
||||||
if ($idprod) {
|
if ($idprod) {
|
||||||
$prodser->fetch($idprod);
|
$prodser->fetch($idprod);
|
||||||
|
//load multilangs
|
||||||
|
if ($multilangsactive) {
|
||||||
|
$prodser->getMultiLangs();
|
||||||
|
$object->lines[$i]->multilangs = $prodser->multilangs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//label
|
||||||
|
if (!empty($object->lines[$i]->label)) {
|
||||||
|
$label = $object->lines[$i]->label;
|
||||||
|
} else {
|
||||||
|
if (!empty($object->lines[$i]->multilangs[$outputlangs->defaultlang]['label']) && $multilangsactive) {
|
||||||
|
$label = $object->lines[$i]->multilangs[$outputlangs->defaultlang]['label'];
|
||||||
|
} else {
|
||||||
|
if (!empty($object->lines[$i]->product_label)) {
|
||||||
|
$label = $object->lines[$i]->product_label;
|
||||||
|
} else {
|
||||||
|
$label = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//description
|
||||||
|
if (!empty($object->lines[$i]->desc)) {
|
||||||
|
$desc = $object->lines[$i]->desc;
|
||||||
|
} else {
|
||||||
|
if (!empty($object->lines[$i]->multilangs[$outputlangs->defaultlang]['description']) && $multilangsactive) {
|
||||||
|
$desc = $object->lines[$i]->multilangs[$outputlangs->defaultlang]['description'];
|
||||||
|
} else {
|
||||||
|
if (!empty($object->lines[$i]->description)) {
|
||||||
|
$desc = $object->lines[$i]->description;
|
||||||
|
} else {
|
||||||
|
$desc = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//ref supplier
|
||||||
|
$ref_supplier = (!empty($object->lines[$i]->ref_supplier) ? $object->lines[$i]->ref_supplier : (!empty($object->lines[$i]->ref_fourn) ? $object->lines[$i]->ref_fourn : '')); // TODO Not yet saved for supplier invoices, only supplier orders
|
||||||
|
//note
|
||||||
|
$note = (!empty($object->lines[$i]->note) ? $object->lines[$i]->note : '');
|
||||||
|
//dbatch
|
||||||
|
$dbatch = (!empty($object->lines[$i]->detail_batch) ? $object->lines[$i]->detail_batch : false);
|
||||||
|
|
||||||
|
if ($idprod) {
|
||||||
// If a predefined product and multilang and on other lang, we renamed label with label translated
|
// If a predefined product and multilang and on other lang, we renamed label with label translated
|
||||||
if (getDolGlobalInt('MAIN_MULTILANGS') && ($outputlangs->defaultlang != $langs->defaultlang)) {
|
if ($multilangsactive && ($outputlangs->defaultlang != $langs->defaultlang)) {
|
||||||
$translatealsoifmodified = (!empty($conf->global->MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED)); // By default if value was modified manually, we keep it (no translation because we don't have it)
|
$translatealsoifmodified = (!empty($conf->global->MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED)); // By default if value was modified manually, we keep it (no translation because we don't have it)
|
||||||
|
|
||||||
// TODO Instead of making a compare to see if param was modified, check that content contains reference translation. If yes, add the added part to the new translation
|
// TODO Instead of making a compare to see if param was modified, check that content contains reference translation. If yes, add the added part to the new translation
|
||||||
|
|||||||
@@ -231,6 +231,12 @@ class Donations extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->don->array_options[$index] = $this->_checkValForAPI($field, $val, $this->don);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->don->$field = $value;
|
$this->don->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -447,6 +447,12 @@ class Shipments extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->shipment->array_options[$index] = $this->_checkValForAPI($field, $val, $this->shipment);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->shipment->$field = $value;
|
$this->shipment->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -420,6 +420,12 @@ class ExpenseReports extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->expensereport->array_options[$index] = $this->_checkValForAPI($field, $val, $this->expensereport);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->expensereport->$field = $value;
|
$this->expensereport->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -263,6 +263,12 @@ class SupplierInvoices extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->invoice->array_options[$index] = $this->_checkValForAPI($field, $val, $this->invoice);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->invoice->$field = $value;
|
$this->invoice->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -288,6 +288,12 @@ class SupplierOrders extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->order->array_options[$index] = $this->_checkValForAPI($field, $val, $this->order);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->order->$field = $value;
|
$this->order->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -298,6 +298,12 @@ class KnowledgeManagement extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->knowledgerecord->array_options[$index] = $this->_checkValForAPI($field, $val, $this->knowledgerecord);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->knowledgerecord->$field = $this->_checkValForAPI($field, $value, $this->knowledgerecord);
|
$this->knowledgerecord->$field = $this->_checkValForAPI($field, $value, $this->knowledgerecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -257,6 +257,12 @@ class MyModuleApi extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->myobject->array_options[$index] = $this->_checkValForAPI($field, $val, $this->myobject);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->myobject->$field = $this->_checkValForAPI($field, $value, $this->myobject);
|
$this->myobject->$field = $this->_checkValForAPI($field, $value, $this->myobject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -238,6 +238,12 @@ class Mos extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->mo->array_options[$index] = $this->_checkValForAPI($field, $val, $this->mo);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->mo->$field = $value;
|
$this->mo->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -255,6 +255,12 @@ class PartnershipApi extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->partnership->array_options[$index] = $this->_checkValForAPI($field, $val, $this->partnership);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->partnership->$field = $this->_checkValForAPI($field, $value, $this->partnership);
|
$this->partnership->$field = $this->_checkValForAPI($field, $value, $this->partnership);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -361,6 +361,12 @@ class Products extends DolibarrApi
|
|||||||
if ($field == 'stock_reel') {
|
if ($field == 'stock_reel') {
|
||||||
throw new RestException(400, 'Stock reel cannot be updated here. Use the /stockmovements endpoint instead');
|
throw new RestException(400, 'Stock reel cannot be updated here. Use the /stockmovements endpoint instead');
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->product->array_options[$index] = $this->_checkValForAPI($field, $val, $this->product);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->product->$field = $value;
|
$this->product->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -206,6 +206,12 @@ class Warehouses extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->warehouse->array_options[$index] = $this->_checkValForAPI($field, $val, $this->warehouse);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->warehouse->$field = $value;
|
$this->warehouse->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -461,6 +461,12 @@ class Projects extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->project->array_options[$index] = $this->_checkValForAPI($field, $val, $this->project);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->project->$field = $value;
|
$this->project->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -461,6 +461,12 @@ class Tasks extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->task->array_options[$index] = $this->_checkValForAPI($field, $val, $this->task);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->task->$field = $value;
|
$this->task->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -448,6 +448,12 @@ class Receptions extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->reception->array_options[$index] = $this->_checkValForAPI($field, $val, $this->reception);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->reception->$field = $value;
|
$this->reception->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ class Contacts extends DolibarrApi
|
|||||||
continue;
|
continue;
|
||||||
} elseif ($field == 'array_options' && is_array($value)) {
|
} elseif ($field == 'array_options' && is_array($value)) {
|
||||||
foreach ($value as $index => $val) {
|
foreach ($value as $index => $val) {
|
||||||
$this->contact->array_options[$index] = $val;
|
$this->contact->array_options[$index] = $this->_checkValForAPI($field, $val, $this->contact);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->contact->$field = $value;
|
$this->contact->$field = $value;
|
||||||
|
|||||||
@@ -302,6 +302,12 @@ class Thirdparties extends DolibarrApi
|
|||||||
if ($field == 'id') {
|
if ($field == 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->company->array_options[$index] = $this->_checkValForAPI($field, $val, $this->company);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->company->$field = $value;
|
$this->company->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -377,6 +377,15 @@ class Tickets extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($request_data as $field => $value) {
|
foreach ($request_data as $field => $value) {
|
||||||
|
if ($field == 'id') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->ticket->array_options[$index] = $this->_checkValForAPI($field, $val, $this->ticket);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->ticket->$field = $value;
|
$this->ticket->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -406,6 +406,12 @@ class Users extends DolibarrApi
|
|||||||
throw new RestException(500, 'Error when updating status of user: '.$this->useraccount->error);
|
throw new RestException(500, 'Error when updating status of user: '.$this->useraccount->error);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if ($field == 'array_options' && is_array($value)) {
|
||||||
|
foreach ($value as $index => $val) {
|
||||||
|
$this->useraccount->array_options[$index] = $this->_checkValForAPI($field, $val, $this->useraccount);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->useraccount->$field = $value;
|
$this->useraccount->$field = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user