added/changed the way parameters are passed to uiinfolog.get_list and soinfolog.readIdArray

This commit is contained in:
Ralf Becker 2002-05-01 17:16:27 +00:00
parent a6dca4b6ba
commit b6d1e36b3d
5 changed files with 29 additions and 31 deletions

View File

@ -227,12 +227,11 @@
return $this->so->anzSubs( $info_id ); return $this->so->anzSubs( $info_id );
} }
function readIdArray($order,$sort,$filter,$cat_id,$query,$action,$addr_id, function readIdArray($order,$sort,$filter,$cat_id,$query,$action,$action_id,
$proj_id,$info_id,$ordermethod,&$start,&$total) $ordermethod,&$start,&$total)
{ {
return $this->so->readIdArray($order,$sort,$filter,$cat_id,$query, return $this->so->readIdArray($order,$sort,$filter,$cat_id,$query,
$action,$addr_id,$proj_id,$info_id, $action,$action_id,$ordermethod,$start,$total);
$ordermethod,$start,$total);
} }

View File

@ -232,8 +232,8 @@
return $this->db->f(0); return $this->db->f(0);
} }
function readIdArray($order,$sort,$filter,$cat_id,$query,$action,$addr_id, function readIdArray($order,$sort,$filter,$cat_id,$query,$action,$action_id,
$proj_id,$info_id,$ordermethod,&$start,&$total) $ordermethod,&$start,&$total)
{ {
if ($order) if ($order)
{ {
@ -254,9 +254,9 @@
} }
switch ($action) switch ($action)
{ {
case 'addr': $filtermethod .= " AND info_addr_id=$addr_id "; case 'addr': $filtermethod .= " AND info_addr_id=$action_id ";
break; break;
case 'proj': $filtermethod .= " AND info_proj_id=$proj_id "; case 'proj': $filtermethod .= " AND info_proj_id=$action_id ";
break; break;
} }
if ($query) // we search in _from, _subject and _des for $query if ($query) // we search in _from, _subject and _des for $query
@ -264,7 +264,7 @@
$sql_query = "AND (info_from like '%$query%' OR info_subject ". $sql_query = "AND (info_from like '%$query%' OR info_subject ".
"like '%$query%' OR info_des like '%$query%') "; "like '%$query%' OR info_des like '%$query%') ";
} }
$pid = 'AND info_id_parent='.($action == 'sp' ? $info_id : 0); $pid = 'AND info_id_parent='.($action == 'sp' ? $action_id : 0);
if (!$phpgw_info['user']['preferences']['infolog']['listNoSubs'] && if (!$phpgw_info['user']['preferences']['infolog']['listNoSubs'] &&
$action != 'sp') $action != 'sp')

View File

@ -304,16 +304,20 @@
return $url['path'] . $qstr; return $url['path'] . $qstr;
} }
function get_list($for_include=0) function get_list($for_include=0,$action='',$action_id=0)
{ {
global $cat_filter,$cat_id,$sort,$order,$query,$start,$filter; global $cat_filter,$cat_id,$sort,$order,$query,$start,$filter;
global $action,$addr_id,$proj_id,$info_id;
if (!$for_include) if (!$for_include)
{ {
$GLOBALS['phpgw']->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar(); echo parse_navbar();
} }
if ($action == '')
{
$action = get_var('action',array('GET','POST'));
$action_id = get_var('action_id',array('GET','POST'));
}
$t = $this->template; $html = $this->html; $t = $this->template; $html = $this->html;
$t->set_file(array( 'info_list_t' => 'list.tpl' )); $t->set_file(array( 'info_list_t' => 'list.tpl' ));
@ -338,20 +342,20 @@
switch ($action) switch ($action)
{ {
case 'sp': // Sub-List case 'sp': // Sub-List
$action_vars = array('action'=>'sp','info_id'=>$info_id); $action_vars = array('action'=>'sp','info_id'=>$action_id);
$t->set_var(lang_info_action,lang('InfoLog - Subprojects from')); $t->set_var(lang_info_action,lang('InfoLog - Subprojects from'));
break; break;
case 'proj': case 'proj':
$action_vars += array( 'id_project' => $proj_id, $action_vars += array( 'id_project' => $action_id,
'proj_id' => $proj_id); 'proj_id' => $action_id);
$proj = $this->bo->readProj($proj_id); $proj = $this->bo->readProj($action_id);
$t->set_var(lang_info_action,lang('InfoLog').' - '. $t->set_var(lang_info_action,lang('InfoLog').' - '.
$proj['title']); $proj['title']);
break; break;
case 'addr': case 'addr':
$action_vars += array( 'id_addr' => $addr_id, $action_vars += array( 'id_addr' => $action_id,
'addr_id' => $addr_id ); 'addr_id' => $action_id );
$addr = $this->bo->readAddr($addr_id); $addr = $this->bo->readAddr($action_id);
$t->set_var(lang_info_action,lang('InfoLog').' - '. $t->set_var(lang_info_action,lang('InfoLog').' - '.
$this->bo->addr2name($addr)); $this->bo->addr2name($addr));
break; break;
@ -394,8 +398,7 @@
// -------------- end header declaration ----------------- // -------------- end header declaration -----------------
$ids = $this->bo->readIdArray($order,$sort,$filter,$cat_id,$query, $ids = $this->bo->readIdArray($order,$sort,$filter,$cat_id,$query,
$action,$addr_id,$proj_id,$info_id, $action,$action_id,$ordermethod,$start,$total);
$ordermethod,$start,$total);
$maxmatchs = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']; $maxmatchs = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
if ($total > $maxmatchs) if ($total > $maxmatchs)
@ -420,14 +423,14 @@
{ {
case 'sp': // details of parent case 'sp': // details of parent
$t->set_var( $this->infoHeaders( )); $t->set_var( $this->infoHeaders( ));
$t->set_var( $this->formatInfo( $info_id )); $t->set_var( $this->formatInfo( $action_id ));
$t->parse('projdetailshandle','projdetails',True); $t->parse('projdetailshandle','projdetails',True);
break; break;
case 'addr': case 'addr':
$nm_extra = "&addr_id=$addr_id"; $nm_extra = "&action_id=$action_id";
break; break;
case 'proj': case 'proj':
$nm_extra = "&proj_id=$proj_id"; $nm_extra = "&action_id=$action_id";
break; break;
} }
@ -503,7 +506,7 @@
{ {
$t->set_var('viewsub', $html->a_href( $t->set_var('viewsub', $html->a_href(
$this->icon('action','view'),'/index.php', $this->icon('action','view'),'/index.php',
$this->menuaction()+array( 'info_id' => $id, $this->menuaction()+array( 'action_id' => $id,
'filter' => $filter, 'action' => 'sp'))); 'filter' => $filter, 'action' => 'sp')));
} }
else // else display ADD SUB-Icon else // else display ADD SUB-Icon
@ -522,7 +525,7 @@
$t->set_var('viewparent',$html->a_href( $t->set_var('viewparent',$html->a_href(
$this->icon('action','parent'),'/index.php', $this->icon('action','parent'),'/index.php',
$this->menuaction()+ $this->menuaction()+
array('info_id' => $parent, array('action_id' => $parent,
'filter' => $filter,'action' => 'sp'))); 'filter' => $filter,'action' => 'sp')));
} }

View File

@ -18,8 +18,7 @@
/* echo "<p>hook_addressbook_view(ab_id=$ab_id)</p>"; */ /* echo "<p>hook_addressbook_view(ab_id=$ab_id)</p>"; */
$GLOBALS['addr_id'] = $GLOBALS['ab_id']; $GLOBALS['action'] = 'addr';
$infolog = CreateObject('infolog.uiinfolog'); $infolog = CreateObject('infolog.uiinfolog');
$infolog->get_list(True); $infolog->get_list(True,'addr',$GLOBALS['ab_id']);
$GLOBALS['phpgw_info']['flags']['currentapp'] = $save_app; $GLOBALS['phpgw_info']['flags']['currentapp'] = $save_app;

View File

@ -17,12 +17,9 @@
$phpgw->translation->add_app('infolog'); $phpgw->translation->add_app('infolog');
global $id;
//echo "<p>hook_projects_view(id=$id)</p>"; //echo "<p>hook_projects_view(id=$id)</p>";
global $proj_id,$action;
$proj_id = $id; $action='proj';
$infolog = CreateObject('infolog.uiinfolog'); $infolog = CreateObject('infolog.uiinfolog');
$infolog->get_list(True); $infolog->get_list(True,'proj',$GLOBALS['id']);
$phpgw_info['flags']['currentapp'] = $save_app; $phpgw_info['flags']['currentapp'] = $save_app;