From 3312bcd5953ab8c6af10d1013e8630446a8befa5 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Thu, 1 Oct 2009 14:29:30 +0000 Subject: [PATCH] fixed problem with edit button in timesheets --- timesheet/inc/class.timesheet_ui.inc.php | 14 ++++++++++++-- timesheet/setup/egw_de.lang | 3 +++ timesheet/setup/egw_en.lang | 3 +++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/timesheet/inc/class.timesheet_ui.inc.php b/timesheet/inc/class.timesheet_ui.inc.php index 541e369256..c4e0243ab6 100644 --- a/timesheet/inc/class.timesheet_ui.inc.php +++ b/timesheet/inc/class.timesheet_ui.inc.php @@ -99,6 +99,16 @@ class timesheet_ui extends timesheet_bo { //echo "

ts_start=$content[ts_start], start_time=$content[start_time], end_time=$content[end_time], ts_duration=$content[ts_duration], ts_quantity=$content[ts_quantity]

\n"; // we only need 2 out of 3 values from start-, end-time or duration (the date in ts_start is always required!) + if (!isset($GLOBALS['egw_info']['user']['apps']['admin']) && $content['ts_status']) + { + if ($this->status_labels_config[$content['ts_status']]['admin']) + { + $view = true; //only admin can edit with this status + $only_admin_edit = true; + $msg = lang('only Admin can edit this status'); + } + } + if ($content['start_time']) // start-time specified { $content['ts_start'] += $content['start_time']; @@ -124,7 +134,7 @@ class timesheet_ui extends timesheet_bo switch($button) { case 'edit': - if ($this->check_acl(EGW_ACL_EDIT) && $only_admin_edit) $view = false; + if ($this->check_acl(EGW_ACL_EDIT) && !$only_admin_edit) $view = false; break; case 'save': @@ -446,7 +456,7 @@ class timesheet_ui extends timesheet_bo { //$query['col_filter']['ts_id'] = egw_link::get_links('projectmanager',$query['col_filter']['pm_id'],'timesheet'); $query['col_filter']['ts_id'] = $this->get_ts_links($query['col_filter']['pm_id']); - if (empty($query['col_filter']['ts_id'])) $query['col_filter']['ts_id'] = -1; + if (empty($query['col_filter']['ts_id'])) $query['col_filter']['ts_id'] = -1; if (!$query['col_filter']['ts_id']) $query['col_filter']['ts_id'] = 0; } if ((string)$query['col_filter']['pm_id'] != '' && (string)$query['col_filter']['pm_id'] == '0') diff --git a/timesheet/setup/egw_de.lang b/timesheet/setup/egw_de.lang index a3ccc858e6..1e7d2c5495 100644 --- a/timesheet/setup/egw_de.lang +++ b/timesheet/setup/egw_de.lang @@ -55,12 +55,14 @@ links timesheet de Verknüpfungen max length of the input [, length of the inputfield (optional)] timesheet de maximale Länge der Eingabe[,Länge des Eingabefeldes (optional)] modify the status of the timesheet timesheet de Status des Stundenzettels verändern new ticket submitted by %1 at %2 timesheet de Neues Ticket erstellt von %1 am %2 +new timesheet submitted by %1 at %2 timesheet de Neuer Stundenzettel von %1 am %2 no details timesheet de Keine Details no project timesheet de Kein Projekt no status timesheet de Kein Status none: use only free project-names admin de Keine: verwende nur freie Projektnamen number of row for a multiline inputfield or line of a multi-select-box timesheet de Anzahl von Reihen für ein Mehrzeiliges Textfeld oder einer Mehrfachauswahlbox only admin timesheet de nur Admin +only admin can edit this status timesheet de nur Admins dürfen diesen Status bearbeiten or endtime timesheet de oder Endzeit order timesheet de Reihenfolge parent timesheet de Übergeordnet @@ -95,6 +97,7 @@ this year timesheet de Dieses Jahr ticket modified by %1 at %2 timesheet de Ticket geändert von %1 am %2 timesheet common de Stundenzettel timesheet csv export timesheet de Export des Stundenzettels als CSV +timesheet modified by %1 at %2 timesheet de Stundenzettel verändert von %1 am %2 timesheet openoffice export timesheet de Export des Stundenzettels als Open Office timesheet status-%1 '%2' added. timesheet de Stundenzettel Status %1 '%2' hinzugefügt. timesheet-%1 '%2' updated. timesheet de Stundenzettel Status %1 '%2' geändert diff --git a/timesheet/setup/egw_en.lang b/timesheet/setup/egw_en.lang index d76db86269..f8c69a4450 100644 --- a/timesheet/setup/egw_en.lang +++ b/timesheet/setup/egw_en.lang @@ -55,12 +55,14 @@ links timesheet en Links max length of the input [, length of the inputfield (optional)] timesheet en max length of the input [, length of the inputfield (optional)] modify the status of the timesheet timesheet en Modify the Status of the Timesheet new ticket submitted by %1 at %2 timesheet en New ticket submitted by %1 at %2 +new timesheet submitted by %1 at %2 timesheet en New timesheet submitted by %1 at %2 no details timesheet en no details no project timesheet en No project no status timesheet en No status none: use only free project-names admin en None: use only free project-names number of row for a multiline inputfield or line of a multi-select-box timesheet en number of row for a multiline inputfield or line of a multi-select-box only admin timesheet en Only Admin +only admin can edit this status timesheet en only Admin can edit this status or endtime timesheet en or Endtime order timesheet en Order parent timesheet en Parent @@ -95,6 +97,7 @@ this year timesheet en This year ticket modified by %1 at %2 timesheet en Ticket modified by %1 at %2 timesheet common en TimeSheet timesheet csv export timesheet en Timesheet CSV export +timesheet modified by %1 at %2 timesheet en Timesheet modified by %1 at %2 timesheet openoffice export timesheet en Timesheet OpenOffice export timesheet status-%1 '%2' added. timesheet en Timesheet Status-%1 '%2' added. timesheet-%1 '%2' updated. timesheet en Timesheet-%1 '%2' updated.