diff --git a/infolog/inc/class.infolog_bo.inc.php b/infolog/inc/class.infolog_bo.inc.php index f552621510..64483347f7 100644 --- a/infolog/inc/class.infolog_bo.inc.php +++ b/infolog/inc/class.infolog_bo.inc.php @@ -120,11 +120,15 @@ class infolog_bo */ var $user; /** - * History loggin: ''=no, 'history'=history & delete allowed, 'history_admin_delete', 'history_no_delete' + * History logging: ''=no, 'history'=history & delete allowed, 'history_admin_delete', 'history_no_delete' * * @var string */ var $history; + /** + * @var string "yes": archived entries can not be changed, "but_admins" noone but admins can change archived entries + */ + var $archived_readonly; /** * Instance of infolog_tracking, only instaciated if needed! * @@ -286,6 +290,18 @@ class infolog_bo } $this->history = $config_data['history']; + if (($this->archived_readonly = $config_data['archived_readonly'] ?? null)) + { + // add "archive" status to all types + foreach($this->status as $type => &$statis) + { + if ($type !== 'defaults' && !isset($statis['archive'])) + { + $statis['archive'] = 'archive'; + } + } + } + $this->limit_modified_n_month = $config_data['limit_modified_n_month'] ?? null; } // sort types by there translation @@ -332,7 +348,7 @@ class infolog_bo } /** - * check's if user has the requiered rights on entry $info_id + * check's if user has the required rights on entry $info_id * * @param int|array $info data or info_id of infolog entry to check * @param int $required_rights ACL::{READ|EDIT|ADD|DELETE}|infolog_bo::ACL_UNDELETE @@ -364,10 +380,16 @@ class infolog_bo if (!isset($access)) { - // handle delete for the various history modes if (!is_array($info) && !($info = $this->so->read(array('info_id' => $info_id)))) return false; - if ($info['info_status'] == 'deleted' && + // handle edit for archived entries + if ($info['info_status'] === 'archive' && $this->archived_readonly && $required_rights == ACL::EDIT && + ($this->archived_readonly === 'yes' || empty($GLOBALS['egw_info']['users']['apps']['admin']))) + { + $access = false; + } + // handle delete for the various history modes + elseif ($info['info_status'] === 'deleted' && ($required_rights == Acl::EDIT || // no edit rights for deleted entries $required_rights == Acl::ADD || // no add rights for deleted entries $required_rights == Acl::DELETE && ($this->history == 'history_no_delete' || // no delete at all! diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index b11b92e592..3a70f73ed4 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -2631,6 +2631,7 @@ class infolog_ui Api\Config::save_value('responsible_edit', $this->bo->responsible_edit, 'infolog'); Api\Config::save_value('implicit_rights', $this->bo->implicit_rights = $content['implicit_rights'] == 'edit' ? 'edit' : 'read', 'infolog'); Api\Config::save_value('history', $this->bo->history = $content['history'], 'infolog'); + Api\Config::save_value('archived_readonly', $this->bo->archived_readonly = $content['archived_readonly'], 'infolog'); Api\Config::save_value('index_load_cfs', implode(',', (array)$content['index_load_cfs']), 'infolog'); Api\Config::save_value('sub_prefix', $content['sub_prefix'], 'infolog'); Api\Config::save_value('allow_past_due_date', $content['allow_past_due_date'], 'infolog'); diff --git a/infolog/lang/egw_de.lang b/infolog/lang/egw_de.lang index 98b2ed7e0d..532acd2558 100644 --- a/infolog/lang/egw_de.lang +++ b/infolog/lang/egw_de.lang @@ -192,6 +192,8 @@ enter a custom phone/email, leave empty if linked entry should be used infolog d enter a textual description of the log-entry infolog de Geben Sie eine textliche Beschreibung des Eintrags ein enter the query pattern infolog de Geben Sie ein Suchmuster ein entry and all files infolog de Eintrag und alle Dateien +entry can not be changed anymore, after status is set infolog de Eintrag kann NICHT mehr geändert werden, nach dem der Status gesetzt wurde +entry can not be changed by anybody, but egroupware admins infolog de Eintrag kann NICHT mehr geändert werden von jedem, außer EGroupware Administratoren error: importing the ical infolog de Fehler beim Import der iCal error: no mail (mailbox / uid) given! infolog de Fehler: keine Mail (Mailbox / UID) angegeben! error: saving the entry infolog de Fehler: beim Speichern des Eintrags @@ -223,6 +225,7 @@ general fields: infolog de Allgemeine Felder: general settings infolog de Allgemeine Einstellungen: global categories infolog de Globale Kategorien group owner for infolog de Gruppeneigentümer für +handling of status 'archived' infolog de Behandlung des Status 'Archiviert' high infolog de Hoch history infolog de Historie history logging infolog de Protokollierung der Historie @@ -313,6 +316,7 @@ no entries found, try again ... infolog de Kein Einträge gefunden, noch einmal no filter infolog de Kein Filter no links or attachments infolog de Keine Verknüpfungen oder Anhänge no project infolog de Kein Projekt +no special handling infolog de Keine spezielle Behandlung nonactive infolog de Nicht aktiv none infolog de Keine normal infolog de Normal diff --git a/infolog/lang/egw_en.lang b/infolog/lang/egw_en.lang index b9562a827b..2a93710c8f 100644 --- a/infolog/lang/egw_en.lang +++ b/infolog/lang/egw_en.lang @@ -192,6 +192,8 @@ enter a custom phone/email, leave empty if linked entry should be used infolog e enter a textual description of the log-entry infolog en Enter text description of the InfoLog entry enter the query pattern infolog en Enter the query pattern entry and all files infolog en Entry and all files +entry can not be changed anymore, after status is set infolog en Entry can NOT be changed anymore, after status is set +entry can not be changed by anybody, but egroupware admins infolog en Entry can NOT be changed by anybody, but EGroupware admins error: importing the ical infolog en Error: importing the iCal error: no mail (mailbox / uid) given! infolog en Error: no mail (Mailbox / UID) given! error: saving the entry infolog en Error saving the entry! @@ -223,6 +225,7 @@ general fields: infolog en General fields: general settings infolog en General settings global categories infolog en Global categories group owner for infolog en Group owner for +handling of status 'archived' infolog en Handling of status 'archived' high infolog en High history infolog en History history logging infolog en History logging @@ -313,6 +316,7 @@ no entries found, try again ... infolog en No entries found, try again ... no filter infolog en No filter no links or attachments infolog en No links or attachments no project infolog en No project +no special handling infolog en No special handling nonactive infolog en Non active none infolog en None normal infolog en Normal diff --git a/infolog/templates/default/config.xet b/infolog/templates/default/config.xet index acb81141f6..7d9fae7e61 100644 --- a/infolog/templates/default/config.xet +++ b/infolog/templates/default/config.xet @@ -29,6 +29,14 @@ + + + + + + + + @@ -46,7 +54,7 @@ - + @@ -100,7 +108,7 @@