Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 16.0
This commit is contained in:
commit
be6cc3c3ef
@ -305,7 +305,8 @@ class Categories extends DolibarrApi
|
|||||||
Categorie::TYPE_CUSTOMER,
|
Categorie::TYPE_CUSTOMER,
|
||||||
Categorie::TYPE_SUPPLIER,
|
Categorie::TYPE_SUPPLIER,
|
||||||
Categorie::TYPE_MEMBER,
|
Categorie::TYPE_MEMBER,
|
||||||
Categorie::TYPE_PROJECT
|
Categorie::TYPE_PROJECT,
|
||||||
|
Categorie::TYPE_KNOWLEDGEMANAGEMENT
|
||||||
])) {
|
])) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -322,6 +323,8 @@ class Categories extends DolibarrApi
|
|||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
} elseif ($type == Categorie::TYPE_PROJECT && !DolibarrApiAccess::$user->rights->projet->lire) {
|
} elseif ($type == Categorie::TYPE_PROJECT && !DolibarrApiAccess::$user->rights->projet->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
|
} elseif ($type == Categorie::TYPE_KNOWLEDGEMANAGEMENT && !DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read) {
|
||||||
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
$categories = $this->category->getListForItem($id, $type, $sortfield, $sortorder, $limit, $page);
|
$categories = $this->category->getListForItem($id, $type, $sortfield, $sortorder, $limit, $page);
|
||||||
|
|||||||
@ -75,7 +75,7 @@ if ($_socid > 0) {
|
|||||||
// We load data of thirdparty
|
// We load data of thirdparty
|
||||||
$objsoc = new Societe($db);
|
$objsoc = new Societe($db);
|
||||||
$objsoc->id = $_socid;
|
$objsoc->id = $_socid;
|
||||||
$objsoc->fetch($_socid, $to);
|
$objsoc->fetch($_socid);
|
||||||
|
|
||||||
|
|
||||||
$head = societe_prepare_head($objsoc);
|
$head = societe_prepare_head($objsoc);
|
||||||
@ -141,7 +141,6 @@ if ($_socid > 0) {
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
$tag = !$tag;
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Date").'</td>';
|
print '<td>'.$langs->trans("Date").'</td>';
|
||||||
print '<td>'.$langs->trans("PriceLevel").'</td>';
|
print '<td>'.$langs->trans("PriceLevel").'</td>';
|
||||||
|
|||||||
@ -112,17 +112,17 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('propalcard', 'globalcard'));
|
$hookmanager->initHooks(array('propalcard', 'globalcard'));
|
||||||
|
|
||||||
$usercanread = $user->rights->propal->lire;
|
$usercanread = $user->hasRight("propal", "lire");
|
||||||
$usercancreate = $user->rights->propal->creer;
|
$usercancreate = $user->hasRight("propal", "creer");
|
||||||
$usercandelete = $user->rights->propal->supprimer;
|
$usercandelete = $user->hasRight("propal", "supprimer");
|
||||||
|
|
||||||
$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->close)));
|
$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->close)));
|
||||||
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->validate)));
|
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->validate)));
|
||||||
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->send)));
|
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->send)));
|
||||||
|
|
||||||
$usercancreateorder = $user->rights->commande->creer;
|
$usercancreateorder = $user->hasRight("commande", "creer");
|
||||||
$usercancreateinvoice = $user->rights->facture->creer;
|
$usercancreateinvoice = $user->hasRight("facture", "creer");
|
||||||
$usercancreatecontract = $user->rights->contrat->creer;
|
$usercancreatecontract = $user->hasRight("contrat", "creer");
|
||||||
$usercancreateintervention = $user->hasRight('ficheinter', 'creer');
|
$usercancreateintervention = $user->hasRight('ficheinter', 'creer');
|
||||||
$usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'));
|
$usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'));
|
||||||
|
|
||||||
|
|||||||
@ -108,16 +108,16 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
$usercanread = $user->rights->commande->lire;
|
$usercanread = $user->hasRight("commande", "lire");
|
||||||
$usercancreate = $user->rights->commande->creer;
|
$usercancreate = $user->hasRight("commande", "creer");
|
||||||
$usercandelete = $user->rights->commande->supprimer;
|
$usercandelete = $user->hasRight("commande", "supprimer");
|
||||||
// Advanced permissions
|
// Advanced permissions
|
||||||
$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->close)));
|
$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->close)));
|
||||||
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->validate)));
|
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->validate)));
|
||||||
$usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->annuler)));
|
$usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->annuler)));
|
||||||
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send);
|
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send);
|
||||||
|
|
||||||
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
$usercancreatepurchaseorder = ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer"));
|
||||||
|
|
||||||
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
|
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
|
||||||
|
|||||||
@ -128,11 +128,11 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('invoicecard', 'globalcard'));
|
$hookmanager->initHooks(array('invoicecard', 'globalcard'));
|
||||||
|
|
||||||
$usercanread = $user->rights->facture->lire;
|
$usercanread = $user->hasRight("facture", "lire");
|
||||||
$usercancreate = $user->rights->facture->creer;
|
$usercancreate = $user->hasRight("facture", "creer");
|
||||||
$usercanissuepayment = $user->rights->facture->paiement;
|
$usercanissuepayment = $user->hasRight("facture", "paiement");
|
||||||
$usercandelete = $user->rights->facture->supprimer;
|
$usercandelete = $user->hasRight("facture", "supprimer");
|
||||||
$usercancreatecontract = $user->rights->contrat->creer;
|
$usercancreatecontract = $user->hasRight("contrat", "creer");
|
||||||
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->validate)));
|
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->validate)));
|
||||||
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->send)));
|
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->send)));
|
||||||
$usercanreopen = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->reopen)));
|
$usercanreopen = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->reopen)));
|
||||||
|
|||||||
@ -6010,7 +6010,7 @@ abstract class CommonObject
|
|||||||
// Test fetch_array ! is_int($key) because fetch_array result is a mix table with Key as alpha and Key as int (depend db engine)
|
// Test fetch_array ! is_int($key) because fetch_array result is a mix table with Key as alpha and Key as int (depend db engine)
|
||||||
if ($key != 'rowid' && $key != 'tms' && $key != 'fk_member' && !is_int($key)) {
|
if ($key != 'rowid' && $key != 'tms' && $key != 'fk_member' && !is_int($key)) {
|
||||||
// we can add this attribute to object
|
// we can add this attribute to object
|
||||||
if (!empty($extrafields) && in_array($extrafields->attributes[$this->table_element]['type'][$key], array('date', 'datetime'))) {
|
if (!empty($extrafields->attributes[$this->table_element]) && in_array($extrafields->attributes[$this->table_element]['type'][$key], array('date', 'datetime'))) {
|
||||||
//var_dump($extrafields->attributes[$this->table_element]['type'][$key]);
|
//var_dump($extrafields->attributes[$this->table_element]['type'][$key]);
|
||||||
$this->array_options["options_".$key] = $this->db->jdate($value);
|
$this->array_options["options_".$key] = $this->db->jdate($value);
|
||||||
} else {
|
} else {
|
||||||
@ -6023,7 +6023,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
// If field is a computed field, value must become result of compute
|
// If field is a computed field, value must become result of compute
|
||||||
foreach ($tab as $key => $value) {
|
foreach ($tab as $key => $value) {
|
||||||
if (!empty($extrafields) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
|
if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
|
||||||
//var_dump($conf->disable_compute);
|
//var_dump($conf->disable_compute);
|
||||||
if (empty($conf->disable_compute)) {
|
if (empty($conf->disable_compute)) {
|
||||||
$this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '');
|
$this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user