icons to add entry, especialy for hook_addressbook_view, which is no longer showing the Add-Button at the end

This commit is contained in:
Ralf Becker 2001-07-13 22:23:33 +00:00
parent 5c431fd271
commit 76ba59071a
3 changed files with 50 additions and 54 deletions

View File

@ -209,10 +209,10 @@
return $referer;
}
function get_list( ) {
function get_list($for_include=0) {
global $phpgw,$phpgw_info;
global $cat_filter,$cat_id,$sort,$order,$query,$start,$filter;
global $action,$addr_id,$proj_id,$info_id,$for_include;
global $action,$addr_id,$proj_id,$info_id;
if (!$for_include) {
$phpgw->common->phpgw_header();
@ -231,30 +231,23 @@
'sort' => $sort,'order' => $order,'query' => $query,
'start' => $start,'filter' => $filter,'cat_id' => $cat_id
);
$common_hidden_vars = $html->input_hidden($hidden_vars);
global $PHP_SELF,$QUERY_STRING; // set referer for form
$referer = $PHP_SELF.($QUERY_STRING ? '?'.$QUERY_STRING : '');
$common_hidden_vars .= $html->input_hidden('referer',$referer);
if ($action)
$common_hidden_vars .= $html->input_hidden('action',$action);
$action_vars = array( 'action' => 'new' );
switch ($action) {
case 'sp': // Sub-List
$common_hidden_vars .= $html->input_hidden('info_id',$info_id);
$t->set_var(lang_info_action,lang('Info Log - Subprojects from'));
$action_vars = array('action'=>'sp','info_id'=>$info_id);
$t->set_var(lang_info_action,lang('Info Log - Subprojects from'));
break;
case 'proj':
$common_hidden_vars .=$html->input_hidden(array(
'id_project' => $proj_id, 'proj_id' => $proj_id));
$action_vars += array('id_project' => $proj_id,'proj_id' => $proj_id);
$proj = $this->bo->readProj($proj_id);
$t->set_var(lang_info_action,lang('Info Log').' - '.
$proj['title']);
$t->set_var(lang_info_action,lang('Info Log').' - '. $proj['title']);
break;
case 'addr':
$common_hidden_vars .= $html->input_hidden(array(
'id_addr' => $addr_id, 'addr_id' => $addr_id ));
$action_vars += array( 'id_addr' => $addr_id, 'addr_id' => $addr_id );
$addr = $this->bo->readAddr($addr_id);
$t->set_var(lang_info_action,lang('Info Log').' - '.
$this->bo->addr2name($addr));
@ -264,15 +257,27 @@
break;
}
$t->set_var($this->setStyleSheet( ));
global $REQUEST_URI;
$t->set_var(actionurl,$html->link('/index.php',
$this->menuaction('edit')+array( 'action' => 'new')));
if (!$for_include)
$t->set_var('add_button',$html->form_1button('add_button','Add',
$hidden_vars+$action_vars+array('referer'=>$referer),
'/index.php',$this->menuaction('edit')));
$t->set_var('cat_form',$html->link('/index.php',$this->menuaction()));
$t->set_var('lang_category',lang('Category'));
$t->set_var('lang_all',lang('All'));
$t->set_var('lang_select',lang('Select'));
$t->set_var('categories',$this->categories->formated_list('select','all',$cat_id,'True'));
$t->set_var(common_hidden_vars,$common_hidden_vars);
$t->set_var('categories',$this->categories->formated_list('select',
'all',$cat_id,'True'));
$icons = array( 'task' => lang('add Task'),
'phone' => lang('add Phonecall'),
'note' => lang('add Note') );
$add_icons = lang('Add').':';
while (list($type,$lang) = each($icons)) {
$add_icons .= $html->a_href($this->icon('type',$type),'/index.php',
$this->menuaction('edit')+$action_vars+array('type'=>$type));
}
$t->set_var('add_icons',$add_icons);
// ===========================================
// list header variable template-declarations
@ -355,9 +360,9 @@
// nextmatch variable template-declarations
// ===========================================
if (!$for_include) {
$next_matchs = $this->nextmatchs->show_tpl('/index.php',$start,
$total,"menuaction=infolog.uiinfolog.get_list&order=$order&filter=$filter&sort=$sort&query=$query&action=$action$nm_extra&info_id=$info_id&cat_id=$cat_id",
'95%',$phpgw_info['theme']['th_bg']);
$next_matchs = $this->nextmatchs->show_tpl('/index.php',$start,$total,
"&menuaction=infolog.uiinfolog.get_list&action=$action$nm_extra&".
"info_id=$info_id&cat_id=$cat_id",'95%',$phpgw_info['theme']['th_bg']);
$t->set_var('next_matchs',$next_matchs);
if ($total > $maxmatchs)
$t->set_var('next_matchs_end',$next_matchs);
@ -440,20 +445,13 @@
// =========================================================
if ($action && !$for_include) {
$t->set_var('lang_back2projects', '<br>'.
$html->a_href(lang('Back to Projectlist'),'/index.php',
$this->menuaction()+array('filter' => $filter)));
$t->set_var('back2projects',
$html->form_1button('back','Back to Projectlist','',
'/index.php',$this->menuaction()+array('filter'=>$filter)));
}
// ============================================
// template declaration for Add Form
// ============================================
$t->set_var(lang_add,lang('Add'));
$t->pfp('out','info_list_t',true);
// -------------- end Add form declaration ------------------------
if (!$for_include)
$phpgw->common->phpgw_footer();
}

View File

@ -20,9 +20,9 @@
global $ab_id;
//echo "<p>hook_addressbook_view(ab_id=$ab_id)</p>";
global $addr_id,$action,$for_include;
$addr_id = $ab_id; $action='addr'; $for_include = True;
global $addr_id,$action;
$addr_id = $ab_id; $action='addr';
$infolog = CreateObject('infolog.uiinfolog');
$infolog->get_list();
$infolog->get_list(True);
$phpgw_info['flags']['currentapp'] = $save_app;

View File

@ -1,5 +1,9 @@
{info_css}
<span class=action>{lang_info_action}</span><br>
<table width=98%><tr><td>
<span class=action>{lang_info_action}</span>
</td><td align=right>
<span class=action>{add_icons}</span>
</td></tr></table>
<hr noshade width="98%" align="center" size="1">
<center>
<!-- BEGIN projdetails -->
@ -25,7 +29,8 @@
<!-- END projdetails -->
<!-- BEGIN cat_selection -->
<TABLE><tr valign="middle"><td>
<table><tr valign="middle">
<td>
<form method="POST" name="cat" action="{cat_form}">
{lang_category}
<select name="cat_filter" onChange="this.form.submit();">
@ -36,7 +41,8 @@
</form>
</td><td>
{total_matchs}
</td></tr></table>
</td>
</tr></table>
<!-- END cat_selection -->
{next_matchs}
@ -69,21 +75,13 @@
<!-- END info_list -->
</table>
{next_matchs_end}
<form method="POST" action="{actionurl}">
{common_hidden_vars}
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4%" align="right">
<input type="submit" name="Add" value="{lang_add}">
</td>
<td width="72%">&nbsp;</td>
<td width="24%">&nbsp;</td>
</tr>
<tr>
<td colspan="3">{lang_back2projects}<!-- {lang_matrixviewhref} --></td>
</tr>
</table>
</form>
</center>
<table><tr><td>
{add_button}
</td><td>
{back2projects}
</td></tr></table>