1) fixed bug #905779: main links title in contact field (blur text) got lost on changeing info-type

2) implemented separate sessions for infolog called via a hook and normal call, feature-request #903578
This commit is contained in:
Ralf Becker 2004-02-28 14:58:44 +00:00
parent ffb4948e35
commit b1168f7b02

View File

@ -128,17 +128,32 @@
function save_sessiondata($values)
{
$GLOBALS['phpgw']->session->appsession('session_data','infolog',array(
$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";
$GLOBALS['phpgw']->session->appsession($for.'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']
'col_filter' => $values['col_filter'],
'session_for' => $for
));
}
function read_sessiondata()
{
$values = $GLOBALS['phpgw']->session->appsession(@$this->called_by.'session_data','infolog');
if (!@$values['session_for'] && $this->called_by)
{
$values['session_for'] = $this->called_by;
$this->save_sessiondata($values);
}
//echo "<p>$this->called_by: uiinfolog::read_sessiondata() = ".print_r($values,True)."</p>\n";
return $values;
}
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]',col_filter=".print_r($query['col_filter'],True).")</p>\n";
@ -170,7 +185,7 @@
//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'));
$values = array('nm' => $this->read_sessiondata());
if (isset($_GET['filter']))
{
$values['nm']['filter'] = $_GET['filter']; // infolog/index.php sets defaultFilter that way
@ -181,10 +196,6 @@
$values['nm']['sort'] = 'DESC';
}
}
else
{
$this->save_sessiondata($values['nm']);
}
if ($action == '')
{
$action = $values['action'] ? $values['action'] : get_var('action',array('POST','GET'));
@ -229,6 +240,10 @@
}
}
}
else
{
$this->save_sessiondata($values['nm']);
}
switch ($action)
{
case 'sp':
@ -473,7 +488,7 @@
case 'calendar':
default: // to allow other apps to participate
$content['info_link_id'] = $this->link->link('infolog',$content['link_to']['to_id'],$action,$action_id);
$content['blur_title'] = $this->link->title($action,$action_id);
// $content['blur_title'] = $this->link->title($action,$action_id);
case '':
if ($info_id)
@ -495,6 +510,10 @@
$content['info_type'] = 'note';
}
}
if ($action && $action != 'new' && $action != 'sp')
{
$content['blur_title'] = $this->link->title($action,$action_id);
}
$readonlys['delete'] = !$info_id || !$this->bo->check_access($info_id,PHPGW_ACL_DELETE);
$GLOBALS['phpgw_info']['flags']['app_header'] = lang($this->messages[$info_id ? 'edit' : ($action == 'sp' ? 'add_sub' : 'add')]);
@ -698,8 +717,10 @@
{
return False;
}
$save_app = $GLOBALS['phpgw_info']['flags']['currentapp'];
$GLOBALS['phpgw_info']['flags']['currentapp'] = 'infolog';
$this->called_by = $app; // for read/save_sessiondata, to have different sessions for the hooks
$save_app = $GLOBALS['phpgw_info']['flags']['currentapp'];
$GLOBALS['phpgw_info']['flags']['currentapp'] = 'infolog';
$GLOBALS['phpgw']->translation->add_app('infolog');