Removed not used permission

This commit is contained in:
Laurent Destailleur 2021-05-02 11:21:01 +02:00
parent 7a986b3e50
commit 24a58b1956
2 changed files with 3 additions and 8 deletions

View File

@ -275,11 +275,6 @@ class modKnowledgeManagement extends DolibarrModules
$this->rights[$r][4] = 'knowledgerecord'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2)
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2)
$r++;
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
$this->rights[$r][1] = 'Reply to objects of Knowledge Management'; // Permission label
$this->rights[$r][4] = 'knowledgerecord'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2)
$this->rights[$r][5] = 'reply'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2)
$r++;
/* END MODULEBUILDER PERMISSIONS */
// Main menu entries to add

View File

@ -123,7 +123,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
$permissiontoread = $user->rights->knowledgemanagement->knowledgerecord->read;
$permissiontoreply = $user->rights->knowledgemanagement->knowledgerecord->reply;
$permissiontovalidate = $user->rights->knowledgemanagement->knowledgerecord->write;
$permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->knowledgemanagement->knowledgerecord->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
$permissionnote = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_setnotes.inc.php
@ -461,12 +461,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($object->status == $object::STATUS_VALIDATED) {
print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes', '', $permissiontoadd);
}
if ($object->status == $object::STATUS_VALIDATED && $permissiontoreply) {
if ($object->status == $object::STATUS_VALIDATED && $permissiontovalidate) {
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit', '', $permissiontoadd);
}
// Validate
if ($object->status == $object::STATUS_DRAFT) {
if ((empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) && $permissiontoreply) {
if ((empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) && $permissiontovalidate) {
print dolGetButtonAction($langs->trans('ValidateReply'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes', '', $permissiontoadd);
} else {
$langs->load("errors");