mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:19:00 +01:00
1) Possebility to filter by owner or responsible
2) new filter my: in contrast to own which filters by owner, my shows only entry where you are responsible for
This commit is contained in:
parent
3d5ec14b75
commit
69b28c6aad
@ -93,18 +93,18 @@
|
||||
* generate sql to be AND'ed into a query to ensure ACL is respected (incl. _PRIVATE)
|
||||
*
|
||||
* @param $filter: none|all - list all entrys user have rights to see<br>
|
||||
* private|own - list only his personal entrys (incl. those he is responsible for !!!)
|
||||
* private|own - list only his personal entrys (incl. those he is responsible for !!!), my = entries the user is responsible for
|
||||
* @return string the necesary sql
|
||||
*/
|
||||
function aclFilter($filter = False)
|
||||
{
|
||||
preg_match('/(own|privat|all|none|user)([0-9]*)/',$filter_was=$filter,$vars);
|
||||
preg_match('/(my|own|privat|all|none|user)([0-9]*)/',$filter_was=$filter,$vars);
|
||||
$filter = $vars[1];
|
||||
$f_user = intval($vars[2]);
|
||||
|
||||
if (isset($this->acl_filter[$filter.$user]))
|
||||
if (isset($this->acl_filter[$filter.$f_user]))
|
||||
{
|
||||
return $this->acl_filter[$filter.$user]; // used cached filter if found
|
||||
return $this->acl_filter[$filter.$f_user]; // used cached filter if found
|
||||
}
|
||||
if (is_array($this->grants))
|
||||
{
|
||||
@ -126,7 +126,11 @@
|
||||
}
|
||||
}
|
||||
$filtermethod = " (info_owner=$this->user"; // user has all rights
|
||||
|
||||
|
||||
if ($filter == 'my')
|
||||
{
|
||||
$filtermethod .= ' AND info_responsible=0';
|
||||
}
|
||||
// implicit read-rights for responsible user
|
||||
$filtermethod .= " OR (info_responsible=$this->user AND info_access='public')";
|
||||
|
||||
@ -138,7 +142,7 @@
|
||||
" OR info_status = 'offer' AND info_owner IN(" . implode(',',$public_user_list) . ')' : '').")".
|
||||
" AND (info_access='public'".($has_private_access?" OR $has_private_access":'').')';
|
||||
}
|
||||
else // none --> all entrys user has rights to see
|
||||
elseif ($filter != 'my') // none --> all entrys user has rights to see
|
||||
{
|
||||
if ($has_private_access)
|
||||
{
|
||||
@ -156,7 +160,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', 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
|
||||
return $this->acl_filter[$filter.$f_user] = $filtermethod; // cache the filter
|
||||
}
|
||||
|
||||
/**
|
||||
@ -236,25 +240,6 @@
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* copy data after a query into $data
|
||||
*
|
||||
* copy only non-numeric keys
|
||||
*
|
||||
* @param $data array to copy the data
|
||||
*/
|
||||
function db2data(&$data)
|
||||
{
|
||||
$data = array();
|
||||
foreach ($this->db->Record as $key => $val)
|
||||
{
|
||||
if (!is_numeric($key))
|
||||
{
|
||||
$data[$key] = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* read InfoLog entry $info_id
|
||||
*
|
||||
@ -265,19 +250,17 @@
|
||||
*/
|
||||
function read($info_id) // did _not_ ensure ACL
|
||||
{
|
||||
$info_id = intval($info_id);
|
||||
$info_id = (int) $info_id;
|
||||
|
||||
if ($info_id <= 0 || $info_id != $this->data['info_id'] &&
|
||||
(!$this->db->select($this->info_table,'*',array('info_id'=>$info_id),__LINE__,__FILE__) ||
|
||||
!$this->db->next_record()))
|
||||
!(($this->data = $this->db->row(true)))))
|
||||
{
|
||||
$this->init( );
|
||||
return False;
|
||||
}
|
||||
if ($info_id != $this->data['info_id']) // data yet read in
|
||||
{
|
||||
$this->db2data($this->data);
|
||||
|
||||
$this->db->select($this->extra_table,'info_extra_name,info_extra_value',array('info_id'=>$info_id),__LINE__,__FILE__);
|
||||
while ($this->db->next_record())
|
||||
{
|
||||
@ -483,13 +466,15 @@
|
||||
|
||||
if (is_array($query['col_filter']))
|
||||
{
|
||||
if (!$this->table_defs) $this->table_defs = $this->db->get_table_definitions('infolog',$this->info_table);
|
||||
foreach($query['col_filter'] as $col => $data)
|
||||
{
|
||||
$data = $this->db->db_addslashes($data);
|
||||
if (substr($col,0,5) != 'info_') $col = 'info_'.$col;
|
||||
$data = $this->db->quote($data,$this->table_defs['fd'][$col]['type']);
|
||||
if (!empty($data) && eregi('^[a-z_0-9]+$',$col))
|
||||
{
|
||||
$filtermethod .= " AND $col = '$data'";
|
||||
$filtermethod .= $col != 'info_responsible' ? " AND $col=$data" :
|
||||
" AND (info_responsible=$data OR info_responsible=0 AND info_owner=$data)";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -555,10 +540,9 @@
|
||||
}
|
||||
$this->db->limit_query($sql="SELECT $distinct $this->info_table.* $sql_query $ordermethod",$query['start'],__LINE__,__FILE__);
|
||||
//echo "<p>sql='$sql'</p>\n";
|
||||
while ($this->db->next_record())
|
||||
while (($info =& $this->db->row(true)))
|
||||
{
|
||||
$this->db2data($info);
|
||||
$ids[$info['info_id']] = $info;
|
||||
$ids[$info['info_id']] =& $info;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -66,6 +66,10 @@
|
||||
$this->filters = array(
|
||||
'none' => 'no Filter',
|
||||
'done' => 'done',
|
||||
'my' => 'my',
|
||||
'my-open-today' => 'my open',
|
||||
'my-open-overdue' => 'my overdue',
|
||||
'my-upcoming' => 'my upcoming',
|
||||
'own' => 'own',
|
||||
'own-open-today' => 'own open',
|
||||
'own-open-overdue' => 'own overdue',
|
||||
@ -88,6 +92,8 @@
|
||||
$this->html = &$this->tmpl->html;
|
||||
|
||||
$this->user = $GLOBALS['egw_info']['user']['account_id'];
|
||||
|
||||
$GLOBALS['uiinfolog'] =& $this; // make ourself availible for ExecMethod of get_rows function
|
||||
}
|
||||
|
||||
function get_info($info,&$readonlys,$action='',$action_id='')
|
||||
@ -136,7 +142,7 @@
|
||||
function save_sessiondata($values)
|
||||
{
|
||||
$for = @$values['session_for'] ? $values['session_for'] : @$this->called_by;
|
||||
//echo "<p>$for: uiinfolog::save_sessiondata(".print_r($values,True).") called_by='$this->called_by'</p>\n";
|
||||
//echo "<p>$for: uiinfolog::save_sessiondata(".print_r($values,True).") called_by='$this->called_by', for='$for'<br />".function_backtrace()."</p>\n";
|
||||
$GLOBALS['egw']->session->appsession($for.'session_data','infolog',array(
|
||||
'search' => $values['search'],
|
||||
'start' => $values['start'],
|
||||
@ -157,7 +163,7 @@
|
||||
$values['session_for'] = $this->called_by;
|
||||
$this->save_sessiondata($values);
|
||||
}
|
||||
//echo "<p>$this->called_by: uiinfolog::read_sessiondata() = ".print_r($values,True)."</p>\n";
|
||||
//echo "<p>called_by='$this->called_by': uiinfolog::read_sessiondata() = ".print_r($values,True)."</p>\n";
|
||||
return $values;
|
||||
}
|
||||
|
||||
@ -200,9 +206,10 @@
|
||||
if (!is_array($values))
|
||||
{
|
||||
$values = array('nm' => $this->read_sessiondata());
|
||||
if (isset($_GET['filter']))
|
||||
if (isset($_GET['filter']) && $_GET['filter'] != 'default' || !isset($values['nm']['filter']))
|
||||
{
|
||||
$values['nm']['filter'] = $_GET['filter']; // infolog/index.php sets defaultFilter that way
|
||||
$values['nm']['filter'] = $_GET['filter'] && $_GET['filter'] != 'default' ? $_GET['filter'] :
|
||||
$GLOBALS['egw_info']['user']['preferences']['infolog']['defaultFilter'];
|
||||
}
|
||||
if (!isset($values['nm']['order']) || !$values['nm']['order'])
|
||||
{
|
||||
@ -258,10 +265,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->save_sessiondata($values['nm']);
|
||||
}
|
||||
switch ($action)
|
||||
{
|
||||
case 'sp':
|
||||
|
@ -22,6 +22,8 @@
|
||||
$GLOBALS['portal_order'][] = $app_id;
|
||||
|
||||
$infolog =& CreateObject('infolog.uiinfolog');
|
||||
$infolog->called_by = 'home';
|
||||
|
||||
switch($showevents)
|
||||
{
|
||||
case 1:
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
$GLOBALS['egw']->redirect_link('/index.php',array(
|
||||
'menuaction' => 'infolog.uiinfolog.index',
|
||||
'filter' => $GLOBALS['egw_info']['user']['preferences']['infolog']['defaultFilter']
|
||||
// 'filter' => 'default',
|
||||
));
|
||||
$GLOBALS['egw']->common->egw_exit();
|
||||
?>
|
||||
|
File diff suppressed because one or more lines are too long
@ -141,6 +141,10 @@ longer textual description infolog de l
|
||||
low infolog de niedrig
|
||||
max length of the input [, length of the inputfield (optional)] infolog de max. Länge der Eingabe [, Länge des Eingabefeldes (optional)]
|
||||
max number of entries to display on the main screen infolog de Wieviele Einträge sollen maximal auf der Startseite angezeigt werden
|
||||
my infolog de meine
|
||||
my open infolog de meine offen
|
||||
my overdue infolog de meine überfällig
|
||||
my upcoming infolog de meine zukünftig
|
||||
name must not be empty !!! infolog de Name darf nicht leer sein !!!
|
||||
name of new type to create infolog de Name des neu anzulegenden Types
|
||||
never hide search and filters infolog de Suche und Filter niemals ausblenden
|
||||
@ -201,6 +205,8 @@ select a responsible user: a person you want to delegate this task infolog de ei
|
||||
select a typ to edit it's status-values or delete it infolog de einen Type auswählen um seine Statuswerte zu ändern oder ihn zu löschen
|
||||
select an app to search in infolog de eine Anwendung zum Durchsuchen auswählen
|
||||
select an entry to link with infolog de einen Eintrag zum Verküpfen auswählen
|
||||
select to filter by owner infolog de Besiter zum Filtern auswählen
|
||||
select to filter by responsible infolog de Verantwortlichen zum Filtern auswählen
|
||||
should infolog display your open entries - not finished tasks, phonecalls or notes - on the main screen. works only if you dont selected an application for the main screen (in your preferences). infolog de Soll InfoLog die offenen Einträge - nicht beendete Aufgaben, Anrufe oder Notizen - auf der Startsteite anzeigen. Funktioniert nur, wenn Sie keine (einzelne) Anwendung für die Startseite ausgewählt haben (in Ihren Einstellungen).
|
||||
should infolog show subtasks, -calls or -notes in the normal view or not. you can always view the subs via there parent. infolog de Soll InfoLog Untereinträge in der normalen Ansicht anzeigen oder nicht. Sie können die Untereinträge immer über deren Haupteintrag anzeigen.
|
||||
should infolog show the links to other applications and/or the file-attachments in the infolog list (normal view when u enter infolog). infolog de Soll InfoLog die Verknüpfungen zu anderen Anwendungen und/oder die Datei-Anhänge in der InfoLog Liste (normale Ansicht wenn InfoLog aufgerufen wird) anzeigen.
|
||||
|
@ -141,6 +141,10 @@ longer textual description infolog en longer textual description
|
||||
low infolog en low
|
||||
max length of the input [, length of the inputfield (optional)] infolog en max length of the input [, length of the inputfield (optional)]
|
||||
max number of entries to display on the main screen infolog en Max number of entries to display on the main screen
|
||||
my infolog en my
|
||||
my open infolog en my open
|
||||
my overdue infolog en my overdue
|
||||
my upcoming infolog en my upcoming
|
||||
name must not be empty !!! infolog en Name must not be empty !!!
|
||||
name of new type to create infolog en name of new type to create
|
||||
never hide search and filters infolog en Never hide search and filters
|
||||
@ -200,6 +204,8 @@ select a responsible user: a person you want to delegate this task infolog en se
|
||||
select a typ to edit it's status-values or delete it infolog en select a type to edit it's status-values or delete it
|
||||
select an app to search in infolog en Select an App to search in
|
||||
select an entry to link with infolog en Select an entry to link with
|
||||
select to filter by owner infolog en select to filter by owner
|
||||
select to filter by responsible infolog en select to filter by responsible
|
||||
should infolog display your open entries - not finished tasks, phonecalls or notes - on the main screen. works only if you dont selected an application for the main screen (in your preferences). infolog en Should InfoLog display your open entries - not finised tasks, phone calls or notes - on the main screen. Works only if you dont selected an application for the main screen (in your preferences).
|
||||
should infolog show subtasks, -calls or -notes in the normal view or not. you can always view the subs via there parent. infolog en Should InfoLog show Subtasks, -calls or -notes in the normal view or not. You can always view the subs via their parent.
|
||||
should infolog show the links to other applications and/or the file-attachments in the infolog list (normal view when u enter infolog). infolog en Should InfoLog show the links to other applications and/or the file-attachments in the InfoLog list (normal view when u enter InfoLog).
|
||||
|
Loading…
Reference in New Issue
Block a user