1) responsible user can change status now, even if he has no write-grant

2) removed not yet used confirm-field in the delegation-tab
3) fixed counting of subs (did not take acl into account)
This commit is contained in:
Ralf Becker 2004-02-05 13:37:29 +00:00
parent 2de0e0e79a
commit 32a2083cbb
6 changed files with 69 additions and 39 deletions

View File

@ -223,7 +223,7 @@
{
$values['info_owner'] = $this->so->user;
}
if (empty($values['info_subject']))
if (isset($values['info_subject']) && empty($values['info_subject']))
{
$values['info_subject'] = $this->subject_from_des($values['info_des']);
}

View File

@ -92,7 +92,7 @@
private|own - list only his personal entrys (incl. those he is responsible for !!!)
@returns the necesary sql
*/
function aclFilter($filter = 'none')
function aclFilter($filter = False)
{
ereg('.*(own|privat|all|none|user)([0-9]*).*',$filter_was=$filter,$vars);
$filter = $vars[1];
@ -149,7 +149,7 @@
{
$filtermethod = " ((info_owner=$f_user AND info_responsible=0 OR info_responsible=$f_user) AND $filtermethod)";
}
//echo "<p>aclFilter(filter='$filter_was',user='$user') = '$filtermethod'</p>\n";
//echo "<p>aclFilter(filter='$filter_was',user='$user') = '$filtermethod', privat_user_list=".print_r($privat_user_list,True).", public_user_list=".print_r($public_user_list,True)."</p>\n";
return $this->acl_filter[$filter.$user] = $filtermethod; // cache the filter
}
@ -444,10 +444,10 @@
{
return 0;
}
$this->db->query("select count(*) FROM phpgw_infolog WHERE info_id_parent=$info_id",__LINE__,__FILE__);
$this->db->query($sql="select count(*) FROM phpgw_infolog WHERE info_id_parent=$info_id AND ".$this->aclFilter(),__LINE__,__FILE__);
$this->db->next_record();
//echo "<p>anzSubs($info_id) = ".$this->db->f(0)." ($sql)</p>\n";
return $this->db->f(0);
}

View File

@ -79,6 +79,8 @@
$this->html = &$this->tmpl->html;
$this->tz_offset = $GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
$this->user = $GLOBALS['phpgw_info']['user']['account_id'];
}
function get_info($info,&$readonlys,$action='',$action_id='')
@ -98,6 +100,7 @@
$this->bo->link_id2from($info,$action,$action_id); // unset from for $action:$action_id
$readonlys["edit[$id]"] = !$this->bo->check_access($id,PHPGW_ACL_EDIT);
$readonlys["edit_status[$id]"] = !($this->bo->check_access($id,PHPGW_ACL_EDIT) || $info['info_responsible'] == $this->user);
$readonlys["delete[$id]"] = !$this->bo->check_access($id,PHPGW_ACL_DELETE);
$readonlys["sp[$id]"] = !$this->bo->check_access($id,PHPGW_ACL_ADD);
$readonlys["view[$id]"] = $info['info_anz_subs'] < 1;
@ -207,6 +210,7 @@
switch($do)
{
case 'edit':
case 'edit_status':
return $this->edit($do_id,$action,$action_id,'',$referer);
case 'delete':
return $this->delete($do_id,$referer);
@ -321,13 +325,28 @@
}
if ($content['save'] || $content['delete'] || $content['cancel'])
{
if ($content['save'] && (!$info_id || $this->bo->check_access($info_id,PHPGW_ACL_EDIT)))
if ($content['save'] && $info_id)
{
if (!($edit_acl = $this->bo->check_access($info_id,PHPGW_ACL_EDIT)))
{
$old = $this->bo->read($info_id);
$status_only = $old['info_responsible'] == $this->user;
}
}
if ($content['save'] && (!$info_id || $edit_acl || $status_only))
{
if (strstr($content['info_link_id'],':') !== False)
{
$info_link_id = $content['info_link_id'];
$content['info_link_id'] = 0; // as field has to be int
}
if ($status_only)
{
$content = array(
'info_id' => $content['info_id'],
'info_status' => $content['info_status']
);
}
$this->bo->write($content);
if (!$info_id && is_array($content['link_to']['to_id'])) // writing link for new entry
@ -389,7 +408,7 @@
}
$parent = $this->bo->so->data;
$content['info_id'] = $info_id = 0;
$content['info_owner'] = $GLOBALS['phpgw_info']['user']['account_id'];
$content['info_owner'] = $this->user;
$content['info_id_parent'] = $parent['info_id'];
/*
if ($parent['info_type']=='task' && $parent['info_status']=='offer')
@ -416,7 +435,18 @@
{
if ($info_id && !$this->bo->check_access($info_id,PHPGW_ACL_EDIT))
{
return $referer ? $this->tmpl->location($referer) : $this->index(0,$action,$action_id);
if ($content['info_responsible'] == $this->user)
{
$content['status_only'] = True;
foreach($content as $name => $value)
{
$readonlys[$name] = $name != 'info_status';
}
}
else
{
return $referer ? $this->tmpl->location($referer) : $this->index(0,$action,$action_id);
}
}
}
$content['links'] = $content['link_to'] = array(
@ -479,6 +509,9 @@
{
$this->tmpl->set_cell_attribute('description|links|delegation|customfields','name','description|links|delegation');
}
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('InfoLog').' - '.
($content['status_only'] ? lang('Edit Status') : lang('Edit'));
//echo "<p>uiinfolog.edit(info_id='$info_id',action='$action',action_id='$action_id') readonlys="; print_r($readonlys); echo ", content = "; _debug_array($content);
$this->tmpl->exec('infolog.uiinfolog.edit',$content,array(
'info_type' => $this->bo->enums['type'],

File diff suppressed because one or more lines are too long

View File

@ -42,6 +42,7 @@ call infolog de anrufen
cancel infolog de Abbruch
categories infolog de Kategorien
category infolog de Kategorie
change the status of an entry, eg. close it infolog de Status eines Eintrags ändern, zB. ihn als erledigt markieren
charset of file infolog de Zeichensatz der Datei
check to set startday infolog de ankreutzen um Startdatum zu setzen
click here to create the link infolog de hier klicken um die Verknüpfung zu erzeugen
@ -90,6 +91,7 @@ duration infolog de Dauer
each value is a line like <id>[=<label>] infolog de jeder Wert ist eine Zeile im Format <id>=[<angezeigter Wert>]
edit infolog de Bearbeiten
edit or create categories for ingolog infolog de Kategorien für InfoLog bearbeiten oder neu anlegen
edit status infolog de Status ändern
edit the entry infolog de Eintrag bearbeiten
edit this entry infolog de diesen Eintrag bearbeiten
empty for all infolog de leer für alle
@ -175,6 +177,7 @@ priority infolog de Priorit
private infolog de Privat
project infolog de Projekt
re: infolog de Re:
reg. expr. for local ip's<br>eg. ^192.168.1. infolog de reg. Ausdr. für lokale IP's<br>^192\.168\.1\.
reg. expr. for local ip's<br>eg. ^192\.168\.1\. infolog de reg. Ausdr. für lokale IP's<br>^192\.168\.1\.
reject infolog de Absage
remark infolog de Bemerkung
@ -233,6 +236,8 @@ urgent infolog de Dringend
use button to search for address infolog de Button zum Suchen der Adresse verwenden
use button to search for project infolog de Button zum Suchen des Projekts verwenden
valid path on clientside<br>eg. \\server\share or e:\ infolog de gültiger Pfad clientseitig<br>zB. \\Server\Share oder e:\
valid path on clientside<br>eg. \servershare or e: infolog de gültiger Pfad clientseitig<br>zB. \\Server\Share oder e:\
valid path on clientside<br>eg. servershare or e: infolog de gültiger Pfad clientseitig<br>zB. \\Server\Share oder e:\
values for selectbox infolog de Werte für die Auswahlbox
view all subs of this entry infolog de alle Untereinträge dieses Eintrag anzeigen
view other subs infolog de andere Untereinträge anzeigen

View File

@ -42,6 +42,7 @@ call infolog en call
cancel infolog en Cancel
categories infolog en Categories
category infolog en Category
change the status of an entry, eg. close it infolog en Change the status of an entry, eg. close it
charset of file infolog en Charset of file
check to set startday infolog en check to set startday
click here to create the link infolog en click here to create the Link
@ -90,6 +91,7 @@ duration infolog en Duration
each value is a line like <id>[=<label>] infolog en each value is a line like <id>[=<label>]
edit infolog en Edit
edit or create categories for ingolog infolog en Edit or create categories for IngoLog
edit status infolog en Edit Status
edit the entry infolog en Edit the entry
edit this entry infolog en Edit this entry
empty for all infolog en empty for all
@ -175,6 +177,7 @@ priority infolog en Priority
private infolog en Private
project infolog en Project
re: infolog en Re:
reg. expr. for local ip's<br>eg. ^192.168.1. infolog en
reg. expr. for local ip's<br>eg. ^192\.168\.1\. infolog en reg. expr. for local IP's<br>eg. ^192\.168\.1\.
remark infolog en Remark
remove this link (not the entry itself) infolog en Remove this link (not the entry itself)
@ -232,6 +235,8 @@ urgent infolog en urgent
use button to search for address infolog en use Button to search for Address
use button to search for project infolog en use Button to search for Project
valid path on clientside<br>eg. \\server\share or e:\ infolog en valid path on clientside<br>eg. \\Server\Share or e:\
valid path on clientside<br>eg. \servershare or e: infolog en
valid path on clientside<br>eg. servershare or e: infolog en
values for selectbox infolog en Values for selectbox
view all subs of this entry infolog en View all subs of this entry
view other subs infolog en view other Subs