mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 17:14:44 +01:00
This now adds the cats on the same line with search/filter for show_tpl and adds a new function call cats_search_filter().
This commit is contained in:
parent
7c14b13aa4
commit
366349179c
@ -46,7 +46,9 @@
|
||||
$this->template->set_block('_nextmatchs','icon');
|
||||
$this->template->set_block('_nextmatchs','link');
|
||||
$this->template->set_block('_nextmatchs','search');
|
||||
$this->template->set_block('_nextmatchs','cats');
|
||||
$this->template->set_block('_nextmatchs','search_filter');
|
||||
$this->template->set_block('_nextmatchs','cats_search_filter');
|
||||
|
||||
if(isset($phpgw_info['user']['preferences']['common']['maxmatchs']) &&
|
||||
intval($phpgw_info['user']['preferences']['common']['maxmatchs']) > 0)
|
||||
@ -192,17 +194,23 @@
|
||||
@param $filter_obj ?
|
||||
@param $showsearch ?
|
||||
*/
|
||||
function show_tpl($sn,$localstart,$total,$extra, $twidth, $bgtheme,$search_obj=0,$filter_obj=1,$showsearch=1,$yours=0)
|
||||
function show_tpl($sn,$localstart,$total,$extra, $twidth, $bgtheme,$search_obj=0,$filter_obj=1,$showsearch=1,$yours=0,$cat_id=0,$cat_field='fcat_id')
|
||||
{
|
||||
global $filter, $qfield, $start, $order, $sort, $query, $phpgw, $phpgw_info;
|
||||
$start = $localstart;
|
||||
|
||||
$extravars = Array();
|
||||
$cats = CreateObject('phpgwapi.categories');
|
||||
|
||||
$extravars = Array();
|
||||
$extravars = $this->split_extras($extravars,$extra);
|
||||
|
||||
$var = array(
|
||||
'form_action' => ($this->action?$this->page($extra):$phpgw->link($sn, $extra)),
|
||||
'lang_category'=> lang('Category'),
|
||||
'lang_all' => lang('All'),
|
||||
'lang_select' => lang('Select'),
|
||||
'cat_field' => $cat_field,
|
||||
'categories' => $cats->formated_list('select','all',$cat_id,'True'),
|
||||
'filter_value' => $filter,
|
||||
'qfield' => $qfield,
|
||||
'start_value' => $start,
|
||||
@ -217,7 +225,8 @@
|
||||
'right' => $this->right($sn,$start,$total,$extra)
|
||||
);
|
||||
$this->template->set_var($var);
|
||||
$this->template->parse('search_filter_data','search_filter');
|
||||
$this->template->parse('cats','cats');
|
||||
$this->template->parse('cats_search_filter_data','cats_search_filter');
|
||||
return $this->template->fp('out','nextmatchs');
|
||||
}
|
||||
|
||||
@ -391,6 +400,39 @@
|
||||
return $this->template->fp('out','search_filter');
|
||||
}
|
||||
|
||||
/*!
|
||||
@function cats_search_filter
|
||||
@abstract ?
|
||||
@param $search_obj default 0
|
||||
*/
|
||||
function cats_search_filter($search_obj=0,$filter_obj=1,$yours=0,$cat_id=0,$cat_field='fcat_id',$link='',$extra='')
|
||||
{
|
||||
global $filter, $qfield, $start, $order, $sort, $query, $phpgw, $phpgw_info;
|
||||
$start = $localstart;
|
||||
|
||||
$cats = CreateObject('phpgwapi.categories');
|
||||
|
||||
$var = array(
|
||||
'form_action' => ($this->action?$this->page($extra):$phpgw->link($sn, $extra)),
|
||||
'lang_category'=> lang('Category'),
|
||||
'lang_all' => lang('All'),
|
||||
'lang_select' => lang('Select'),
|
||||
'cat_field' => $cat_field,
|
||||
'categories' => $cats->formated_list('select','all',$cat_id,'True'),
|
||||
'filter_value' => $filter,
|
||||
'qfield' => $qfield,
|
||||
'start_value' => $start,
|
||||
'order_value' => $order,
|
||||
'sort_value' => $sort,
|
||||
'query_value' => urlencode(stripslashes($query)),
|
||||
'th_bg' => $phpgw_info['theme']['th_bg'],
|
||||
'search' => $this->search($search_obj),
|
||||
'filter' => ($filter_obj?$this->filter($filter_obj,$yours):''),
|
||||
);
|
||||
$this->template->set_var($var);
|
||||
return $this->template->fp('out','cats_search_filter');
|
||||
}
|
||||
|
||||
/*!
|
||||
@function search
|
||||
@abstract ?
|
||||
|
@ -5,7 +5,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" colspan="5">
|
||||
{search_filter_data}
|
||||
{cats_search_filter_data}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -65,6 +65,16 @@
|
||||
</td>
|
||||
<!-- END search -->
|
||||
|
||||
<!-- BEGIN cats -->
|
||||
<td>
|
||||
{lang_category} <select name="{cat_field}" onChange="this.form.submit();">
|
||||
<option value="0">{lang_all}</option>
|
||||
{categories}
|
||||
</select>
|
||||
<noscript><input type="submit" name="cats" value="{lang_select}"></noscript>
|
||||
</td>
|
||||
<!-- END cats -->
|
||||
|
||||
<!-- BEGIN search_filter -->
|
||||
<form method="POST" action="{form_action}" name="filter">
|
||||
<input type="hidden" name="filter" value="{filter_value}">
|
||||
@ -80,3 +90,18 @@
|
||||
</form>
|
||||
<!-- END search_filter -->
|
||||
|
||||
<!-- BEGIN cats_search_filter -->
|
||||
<form method="POST" action="{form_action}" name="filter">
|
||||
<input type="hidden" name="filter" value="{filter_value}">
|
||||
<input type="hidden" name="qfield" value="{qfield_value}">
|
||||
<input type="hidden" name="start" value="{start_value}">
|
||||
<input type="hidden" name="order" value="{order_value}">
|
||||
<input type="hidden" name="sort" value="{sort_value}">
|
||||
<input type="hidden" name="query" value="{query_value}">
|
||||
<table border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0">
|
||||
<tr>{cats}<td> </td>{search}<td> </td>{filter}
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<!-- END cats_search_filter -->
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" colspan="5">
|
||||
{search_filter_data}
|
||||
{cats_search_filter_data}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -65,6 +65,16 @@
|
||||
</td>
|
||||
<!-- END search -->
|
||||
|
||||
<!-- BEGIN cats -->
|
||||
<td>
|
||||
{lang_category} <select name="{cat_field}" onChange="this.form.submit();">
|
||||
<option value="0">{lang_all}</option>
|
||||
{categories}
|
||||
</select>
|
||||
<noscript><input type="submit" name="cats" value="{lang_select}"></noscript>
|
||||
</td>
|
||||
<!-- END cats -->
|
||||
|
||||
<!-- BEGIN search_filter -->
|
||||
<form method="POST" action="{form_action}" name="filter">
|
||||
<input type="hidden" name="filter" value="{filter_value}">
|
||||
@ -80,3 +90,18 @@
|
||||
</form>
|
||||
<!-- END search_filter -->
|
||||
|
||||
<!-- BEGIN cats_search_filter -->
|
||||
<form method="POST" action="{form_action}" name="filter">
|
||||
<input type="hidden" name="filter" value="{filter_value}">
|
||||
<input type="hidden" name="qfield" value="{qfield_value}">
|
||||
<input type="hidden" name="start" value="{start_value}">
|
||||
<input type="hidden" name="order" value="{order_value}">
|
||||
<input type="hidden" name="sort" value="{sort_value}">
|
||||
<input type="hidden" name="query" value="{query_value}">
|
||||
<table border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0">
|
||||
<tr>{cats}<td> </td>{search}<td> </td>{filter}
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<!-- END cats_search_filter -->
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" colspan="5">
|
||||
{search_filter_data}
|
||||
{cats_search_filter_data}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -65,6 +65,16 @@
|
||||
</td>
|
||||
<!-- END search -->
|
||||
|
||||
<!-- BEGIN cats -->
|
||||
<td>
|
||||
{lang_category} <select name="{cat_field}" onChange="this.form.submit();">
|
||||
<option value="0">{lang_all}</option>
|
||||
{categories}
|
||||
</select>
|
||||
<noscript><input type="submit" name="cats" value="{lang_select}"></noscript>
|
||||
</td>
|
||||
<!-- END cats -->
|
||||
|
||||
<!-- BEGIN search_filter -->
|
||||
<form method="POST" action="{form_action}" name="filter">
|
||||
<input type="hidden" name="filter" value="{filter_value}">
|
||||
@ -80,3 +90,18 @@
|
||||
</form>
|
||||
<!-- END search_filter -->
|
||||
|
||||
<!-- BEGIN cats_search_filter -->
|
||||
<form method="POST" action="{form_action}" name="filter">
|
||||
<input type="hidden" name="filter" value="{filter_value}">
|
||||
<input type="hidden" name="qfield" value="{qfield_value}">
|
||||
<input type="hidden" name="start" value="{start_value}">
|
||||
<input type="hidden" name="order" value="{order_value}">
|
||||
<input type="hidden" name="sort" value="{sort_value}">
|
||||
<input type="hidden" name="query" value="{query_value}">
|
||||
<table border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0">
|
||||
<tr>{cats}<td> </td>{search}<td> </td>{filter}
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<!-- END cats_search_filter -->
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" colspan="5">
|
||||
{search_filter_data}
|
||||
{cats_search_filter_data}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -65,6 +65,16 @@
|
||||
</td>
|
||||
<!-- END search -->
|
||||
|
||||
<!-- BEGIN cats -->
|
||||
<td>
|
||||
{lang_category} <select name="{cat_field}" onChange="this.form.submit();">
|
||||
<option value="0">{lang_all}</option>
|
||||
{categories}
|
||||
</select>
|
||||
<noscript><input type="submit" name="cats" value="{lang_select}"></noscript>
|
||||
</td>
|
||||
<!-- END cats -->
|
||||
|
||||
<!-- BEGIN search_filter -->
|
||||
<form method="POST" action="{form_action}" name="filter">
|
||||
<input type="hidden" name="filter" value="{filter_value}">
|
||||
@ -80,3 +90,18 @@
|
||||
</form>
|
||||
<!-- END search_filter -->
|
||||
|
||||
<!-- BEGIN cats_search_filter -->
|
||||
<form method="POST" action="{form_action}" name="filter">
|
||||
<input type="hidden" name="filter" value="{filter_value}">
|
||||
<input type="hidden" name="qfield" value="{qfield_value}">
|
||||
<input type="hidden" name="start" value="{start_value}">
|
||||
<input type="hidden" name="order" value="{order_value}">
|
||||
<input type="hidden" name="sort" value="{sort_value}">
|
||||
<input type="hidden" name="query" value="{query_value}">
|
||||
<table border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0">
|
||||
<tr>{cats}<td> </td>{search}<td> </td>{filter}
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<!-- END cats_search_filter -->
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user