sort- and filter-headers for infolog's index page

This commit is contained in:
Ralf Becker 2003-12-09 00:08:31 +00:00
parent 7eef3c5208
commit 173eb70fea
6 changed files with 69 additions and 31 deletions

View File

@ -248,9 +248,9 @@
return $this->so->anzSubs( $info_id );
}
function search($order,$sort,$filter,$cat_id,$query,$action,$action_id,$ordermethod,&$start,&$total)
function search($order,$sort,$filter,$cat_id,$query,$action,$action_id,$ordermethod,&$start,&$total,$col_filter=False)
{
return $this->so->search($order,$sort,$filter,$cat_id,$query,$action,$action_id,$ordermethod,$start,$total);
return $this->so->search($order,$sort,$filter,$cat_id,$query,$action,$action_id,$ordermethod,$start,$total,$col_filter);
}
/*!

View File

@ -26,7 +26,6 @@
var $db,$db2;
var $grants;
var $data = array( );
var $filters = array( );
var $user;
/*!
@ -460,9 +459,10 @@
@param $query pattern to search, search is done in info_from, info_subject and info_des
@param $action / $action_id if only entries linked to a specified app/entry show be used
@param &$start, &$total nextmatch-parameters will be used and set if query returns less entries
@param $col_filter array with column-name - data pairs, data == '' means no filter (!)
@returns array with id's as key of the matching log-entries
*/
function search($order,$sort,$filter,$cat_id,$query,$action,$action_id,$ordermethod,&$start,&$total)
function search($order,$sort,$filter,$cat_id,$query,$action,$action_id,$ordermethod,&$start,&$total,$col_filter=False)
{
//echo "<p>soinfolog.search(order='$order',,filter='$filter',,query='$query',action='$action/$action_id')</p>\n";
$action2app = array(
@ -494,6 +494,18 @@
$filtermethod = $this->aclFilter($filter);
$filtermethod .= $this->statusFilter($filter);
$filtermethod .= $this->dateFilter($filter);
if (is_array($col_filter))
{
foreach($col_filter as $col => $data)
{
$data = $this->db->db_addslashes($data);
if (!empty($data))
{
$filtermethod .= " AND $col = '$data'";
}
}
}
//echo "<p>filtermethod='$filtermethod'</p>";
if (intval($cat_id))

View File

@ -123,18 +123,27 @@
return $info;
}
function save_sessiondata($values)
{
$GLOBALS['phpgw']->session->appsession('session_data','infolog',array(
'search' => $values['search'],
'start' => $values['start'],
'filter' => $values['filter'],
'cat_id' => $values['cat_id'],
'order' => $values['order'],
'sort' => $values['sort'],
'col_filter' => $values['col_filter']
));
}
function get_rows($query,&$rows,&$readonlys)
{
//echo "<p>uiinfolog.get_rows(start=$query[start],search='$query[search]',filter='$query[filter]',cat_id=$query[cat_id],action='$query[action]/$query[action_id]')</p>\n";
$GLOBALS['phpgw']->session->appsession('session_data','infolog',array(
'search' => $query['search'],
'start' => $query['start'],
'filter' => $query['filter'],
'cat_id' => $query['cat_id']
));
//echo "<p>uiinfolog.get_rows(start=$query[start],search='$query[search]',filter='$query[filter]',cat_id=$query[cat_id],action='$query[action]/$query[action_id]',col_filter=".print_r($query['col_filter'],True).")</p>\n";
$this->save_sessiondata($query);
$ids = $this->bo->search($query['order'],$query['sort'],$query['filter'],$query['cat_id'],
$query['search'],$query['action'],$query['action_id'],$query['ordermethod'],
$query['start'],$total);
$query['start'],$total,$query['col_filter']);
if (!is_array($ids))
{
@ -148,14 +157,14 @@
}
//echo "<p>readonlys = "; _debug_array($readonlys);
reset($rows);
return $total;
}
function index($values = 0,$action='',$action_id='',$referer=0,$extra_app_header=False,$return_html=False)
{
$referer = is_array($values) ? $values['referer'] : $referer;
//echo "<p>uiinfolog::index(action='$action/$action_id',referer='$referer/$values[referer]')</p>\n";
//echo "<p>uiinfolog::index(action='$action/$action_id',referer='$referer/$values[referer]') values=\n"; _debug_array($values);
if (!is_array($values))
{
$values = array('nm' => $GLOBALS['phpgw']->session->appsession('session_data','infolog'));
@ -163,15 +172,15 @@
{
$values['nm']['filter'] = $_GET['filter']; // infolog/index.php sets defaultFilter that way
}
if (!isset($values['nm']['order']) || !$values['nm']['order'])
{
$values['nm']['order'] = 'info_datemodified';
$values['nm']['sort'] = 'DESC';
}
}
else
{
$GLOBALS['phpgw']->session->appsession('session_data','infolog',array(
'search' => $values['nm']['search'],
'start' => $values['nm']['start'],
'filter' => $values['nm']['filter'],
'cat_id' => $values['nm']['cat_id']
));
$this->save_sessiondata($values['nm']);
}
if ($action == '')
{
@ -228,7 +237,7 @@
$values['main'][1] = $this->get_info($action_id,&$readonlys['main']);
break;
}
$readonlys['cancel'] = $action != 'sp';
$readonlys['cancel'] = $action != 'sp';
$this->tmpl->read('infolog.index');
@ -245,7 +254,15 @@
$persist['action_id'] = $values['nm']['action_id'] = $action_id;
$persist['referer'] = $referer;
return $this->tmpl->exec('infolog.uiinfolog.index',$values,'',$readonlys,$persist,'',$return_html);
$all_stati = array();
foreach($this->bo->status as $typ => $stati)
{
if ($typ != 'defaults') $all_stati += $stati;
}
return $this->tmpl->exec('infolog.uiinfolog.index',$values,array(
'info_type' => $this->bo->enums['type'],
'info_status' => $all_stati
),$readonlys,$persist,'',$return_html);
}
function delete($values=0,$referer='')
@ -269,7 +286,7 @@
$values['main']['no_actions'] = True;
$persist['info_id'] = $info_id;
$persist['referer'] = $referer;
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('InfoLog').' - '.lang('Delete');
$this->tmpl->exec('infolog.uiinfolog.delete',$values,'',$readonlys,$persist);

File diff suppressed because one or more lines are too long

View File

@ -63,9 +63,10 @@ custom contact-address, leave empty to use information from most recent link inf
custom contact-information, leave emtpy to use information from most recent link infolog de benutzerdefinierte Kontaktinformationen, leer lassen um die Daten der Verknüpfung zu verwenden
custom fields infolog de Benutzerdefinierte Felder
custom fields, typ and status common de Benutzerdefinierte Felder, Typen und Status
custom regarding infolog de benutzerdefinierter Bezug
custom regarding infolog de Benutzerdefinierter Bezug
custom status for typ infolog de Benutzerdefinierter Status für Typ
datecreated infolog de erstellt am
customfields infolog de Benutzerdefinierte Felder
datecreated infolog de Erstellt am
dates, status, access infolog de Daten, Status, Zugriff
days infolog de Tage
default filter for infolog infolog de Standard-Filter für InfoLog
@ -159,8 +160,6 @@ own infolog de eigene
own open infolog de eigene offen
own overdue infolog de eigene überfällig
own upcoming infolog de eigene zukünftig
owner infolog de Erstellt von
owner responsible infolog de Ersteller Verantwortlich
path on (web-)serverside<br>eg. /var/samba/share infolog de Pfad auf (Web-)Server<br>zB. /var/samba/Share
path to user and group files has to be outside of the webservers document-root!!! infolog de Pfad zu Benutzer- und Gruppen-Dateien MUSS AUSSERHALB des Wurzelverzeichnisses des Webservers (document-root) liegen!!!
pattern for search in addressbook infolog de Muster für Suche im Adressbuch
@ -176,7 +175,7 @@ reg. expr. for local ip's<br>eg. ^192\.168\.1\. infolog de reg. Ausdr. f
reject infolog de Absage
remark infolog de Bemerkung
remove this link (not the entry itself) infolog de Diese Verknüpfung lösen (nicht den Eintrag selbst)
responsible infolog de Auftrag an
responsible infolog de Verantwortlich
responsible user, priority, ... infolog de Verantwortlicher, Prioritäten, ...
save infolog de Speichern
saves the changes made and leaves infolog de speichert die Änderungen und beendet

View File

@ -66,6 +66,7 @@ custom fields infolog en Custom Fields
custom fields, typ and status common en Custom fields, type and status
custom regarding infolog en Custom regarding
custom status for typ infolog en Custom status for type
customfields infolog en Customfields
datecreated infolog en date created
dates, status, access infolog en Dates, Status, Access
days infolog en days
@ -161,8 +162,6 @@ own infolog en own
own open infolog en own open
own overdue infolog en own overdue
own upcoming infolog en own upcoming
owner infolog en Owner
owner responsible infolog en Owner Responsible
path on (web-)serverside<br>eg. /var/samba/share infolog en path on (web-)serverside<br>eg. /var/samba/Share
path to user and group files has to be outside of the webservers document-root!!! infolog en Path to user and group files HAS TO BE OUTSIDE of the webservers document-root!!!
pattern for search in addressbook infolog en pattern for search in Addressbook