fixed problem with edit button in timesheets

This commit is contained in:
Stefan Becker 2009-10-01 14:29:30 +00:00
parent a81fb02efe
commit 3312bcd595
3 changed files with 18 additions and 2 deletions

View File

@ -99,6 +99,16 @@ class timesheet_ui extends timesheet_bo
{ {
//echo "<p>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]</p>\n"; //echo "<p>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]</p>\n";
// we only need 2 out of 3 values from start-, end-time or duration (the date in ts_start is always required!) // 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 if ($content['start_time']) // start-time specified
{ {
$content['ts_start'] += $content['start_time']; $content['ts_start'] += $content['start_time'];
@ -124,7 +134,7 @@ class timesheet_ui extends timesheet_bo
switch($button) switch($button)
{ {
case 'edit': 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; break;
case 'save': 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'] = 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']); $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 (!$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') if ((string)$query['col_filter']['pm_id'] != '' && (string)$query['col_filter']['pm_id'] == '0')

View File

@ -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)] 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 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 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 details timesheet de Keine Details
no project timesheet de Kein Projekt no project timesheet de Kein Projekt
no status timesheet de Kein Status no status timesheet de Kein Status
none: use only free project-names admin de Keine: verwende nur freie Projektnamen 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 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 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 or endtime timesheet de oder Endzeit
order timesheet de Reihenfolge order timesheet de Reihenfolge
parent timesheet de Übergeordnet 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 ticket modified by %1 at %2 timesheet de Ticket geändert von %1 am %2
timesheet common de Stundenzettel timesheet common de Stundenzettel
timesheet csv export timesheet de Export des Stundenzettels als CSV 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 openoffice export timesheet de Export des Stundenzettels als Open Office
timesheet status-%1 '%2' added. timesheet de Stundenzettel Status %1 '%2' hinzugefügt. 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 timesheet-%1 '%2' updated. timesheet de Stundenzettel Status %1 '%2' geändert

View File

@ -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)] 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 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 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 details timesheet en no details
no project timesheet en No project no project timesheet en No project
no status timesheet en No status no status timesheet en No status
none: use only free project-names admin en None: use only free project-names 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 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 timesheet en Only Admin
only admin can edit this status timesheet en only Admin can edit this status
or endtime timesheet en or Endtime or endtime timesheet en or Endtime
order timesheet en Order order timesheet en Order
parent timesheet en Parent 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 ticket modified by %1 at %2 timesheet en Ticket modified by %1 at %2
timesheet common en TimeSheet timesheet common en TimeSheet
timesheet csv export timesheet en Timesheet CSV export 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 openoffice export timesheet en Timesheet OpenOffice export
timesheet status-%1 '%2' added. timesheet en Timesheet Status-%1 '%2' added. timesheet status-%1 '%2' added. timesheet en Timesheet Status-%1 '%2' added.
timesheet-%1 '%2' updated. timesheet en Timesheet-%1 '%2' updated. timesheet-%1 '%2' updated. timesheet en Timesheet-%1 '%2' updated.