Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
This commit is contained in:
commit
4001101f59
@ -381,7 +381,7 @@ foreach ($dirmodels as $reldir) {
|
|||||||
if (in_array($name, $def)) {
|
if (in_array($name, $def)) {
|
||||||
print '<td class="center">'."\n";
|
print '<td class="center">'."\n";
|
||||||
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") {
|
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">';
|
||||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2023 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -147,6 +148,9 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
if ($result <= 0) {
|
if ($result <= 0) {
|
||||||
throw new RestException(503, 'Error when fetching user :'.$fuser->error.' (conf->entity='.$conf->entity.')');
|
throw new RestException(503, 'Error when fetching user :'.$fuser->error.' (conf->entity='.$conf->entity.')');
|
||||||
}
|
}
|
||||||
|
if ($fuser->statut == 0) {
|
||||||
|
throw new RestException(503, 'Error when fetching user. This user has been locked or disabled');
|
||||||
|
}
|
||||||
|
|
||||||
$fuser->getrights();
|
$fuser->getrights();
|
||||||
|
|
||||||
|
|||||||
@ -708,6 +708,8 @@ class ActionComm extends CommonObject
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -567,6 +567,7 @@ if (empty($reshook)) {
|
|||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
// modified by hook
|
// modified by hook
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1412,6 +1412,8 @@ class Propal extends CommonObject
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -445,6 +445,7 @@ if (empty($reshook)) {
|
|||||||
// Note that $action and $object may be modified by hook
|
// Note that $action and $object may be modified by hook
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action);
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action);
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1252,6 +1252,8 @@ class Commande extends CommonOrder
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1406,6 +1408,8 @@ class Commande extends CommonOrder
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1299,6 +1299,8 @@ class Facture extends CommonInvoice
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1432,6 +1434,8 @@ class Facture extends CommonInvoice
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -341,6 +341,7 @@ if (empty($reshook)) {
|
|||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
// modified by hook
|
// modified by hook
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -2564,6 +2564,8 @@ class Contrat extends CommonObject
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $clonedObj, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $clonedObj, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -344,6 +344,7 @@ function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir)
|
|||||||
$filearray[$key]['position_name'] = ($filearrayindatabase[$key2]['position'] ? $filearrayindatabase[$key2]['position'] : '0').'_'.$filearrayindatabase[$key2]['name'];
|
$filearray[$key]['position_name'] = ($filearrayindatabase[$key2]['position'] ? $filearrayindatabase[$key2]['position'] : '0').'_'.$filearrayindatabase[$key2]['name'];
|
||||||
$filearray[$key]['position'] = $filearrayindatabase[$key2]['position'];
|
$filearray[$key]['position'] = $filearrayindatabase[$key2]['position'];
|
||||||
$filearray[$key]['cover'] = $filearrayindatabase[$key2]['cover'];
|
$filearray[$key]['cover'] = $filearrayindatabase[$key2]['cover'];
|
||||||
|
$filearray[$key]['keywords'] = $filearrayindatabase[$key2]['keywords'];
|
||||||
$filearray[$key]['acl'] = $filearrayindatabase[$key2]['acl'];
|
$filearray[$key]['acl'] = $filearrayindatabase[$key2]['acl'];
|
||||||
$filearray[$key]['rowid'] = $filearrayindatabase[$key2]['rowid'];
|
$filearray[$key]['rowid'] = $filearrayindatabase[$key2]['rowid'];
|
||||||
$filearray[$key]['label'] = $filearrayindatabase[$key2]['label'];
|
$filearray[$key]['label'] = $filearrayindatabase[$key2]['label'];
|
||||||
|
|||||||
@ -455,6 +455,8 @@ class ExpenseReport extends CommonObject
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1211,6 +1211,8 @@ class Fichinter extends CommonObject
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1654,6 +1654,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1314,6 +1314,7 @@ if (empty($reshook)) {
|
|||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
|
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1295,33 +1295,35 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error && !GETPOST('regenerateclasssql') && !GETPOST('regeneratemissing')) {
|
||||||
$addfieldentry = array(
|
$addfieldentry = array(
|
||||||
'name'=>GETPOST('propname', 'aZ09'),
|
'name'=>GETPOST('propname', 'aZ09'),
|
||||||
'label'=>GETPOST('proplabel', 'alpha'),
|
'label'=>GETPOST('proplabel', 'alpha'),
|
||||||
'type'=>GETPOST('proptype', 'alpha'),
|
'type'=>GETPOST('proptype', 'alpha'),
|
||||||
'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'restricthtml'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}'
|
'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'restricthtml'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}'
|
||||||
'visible'=>GETPOST('propvisible', 'int'),
|
'visible'=>GETPOST('propvisible', 'int'),
|
||||||
'enabled'=>GETPOST('propenabled', 'int'),
|
'enabled'=>GETPOST('propenabled', 'int'),
|
||||||
'position'=>GETPOST('propposition', 'int'),
|
'position'=>GETPOST('propposition', 'int'),
|
||||||
'notnull'=>GETPOST('propnotnull', 'int'),
|
'notnull'=>GETPOST('propnotnull', 'int'),
|
||||||
'index'=>GETPOST('propindex', 'int'),
|
'index'=>GETPOST('propindex', 'int'),
|
||||||
'searchall'=>GETPOST('propsearchall', 'int'),
|
'searchall'=>GETPOST('propsearchall', 'int'),
|
||||||
'isameasure'=>GETPOST('propisameasure', 'int'),
|
'isameasure'=>GETPOST('propisameasure', 'int'),
|
||||||
'comment'=>GETPOST('propcomment', 'alpha'),
|
'comment'=>GETPOST('propcomment', 'alpha'),
|
||||||
'help'=>GETPOST('prophelp', 'alpha'),
|
'help'=>GETPOST('prophelp', 'alpha'),
|
||||||
'css'=>GETPOST('propcss', 'aZ09'),
|
'css'=>GETPOST('propcss', 'aZ09'),
|
||||||
'cssview'=>GETPOST('propcssview', 'aZ09'),
|
'cssview'=>GETPOST('propcssview', 'aZ09'),
|
||||||
'csslist'=>GETPOST('propcsslist', 'aZ09'),
|
'csslist'=>GETPOST('propcsslist', 'aZ09'),
|
||||||
'default'=>GETPOST('propdefault', 'restricthtml'),
|
'default'=>GETPOST('propdefault', 'restricthtml'),
|
||||||
'noteditable'=>intval(GETPOST('propnoteditable', 'int')),
|
'noteditable'=>intval(GETPOST('propnoteditable', 'int')),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!empty($addfieldentry['arrayofkeyval']) && !is_array($addfieldentry['arrayofkeyval'])) {
|
if (!empty($addfieldentry['arrayofkeyval']) && !is_array($addfieldentry['arrayofkeyval'])) {
|
||||||
$addfieldentry['arrayofkeyval'] = json_decode($addfieldentry['arrayofkeyval'], true);
|
$addfieldentry['arrayofkeyval'] = json_decode($addfieldentry['arrayofkeyval'], true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$addfieldentry = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (GETPOST('regeneratemissing'))
|
/*if (GETPOST('regeneratemissing'))
|
||||||
|
|||||||
@ -407,6 +407,7 @@ if (empty($reshook)) {
|
|||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
// modified by hook
|
// modified by hook
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1160,6 +1160,8 @@ class SupplierProposal extends CommonObject
|
|||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
|
$this->errors += $hookmanager->errors;
|
||||||
|
$this->error = $hookmanager->error;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user