Commit bbe84c84 authored by sylvieg's avatar sylvieg

[MOD]trackerlist: option export to have a buttom linked to the export page...

[MOD]trackerlist: option export to have a buttom linked to the export page where selected fields and filters from TRACKERFILTER or param filterfields will be preselected
parent 84f91bae
......@@ -28,7 +28,7 @@ function wikiplugin_trackerfilter_info() {
'line' => array(
'required' => false,
'name' => tra('Line'),
'description' => 'y|n',
'description' => 'y|n - displays all the filter on the same line',
),
) );
......
......@@ -321,6 +321,9 @@ function wikiplugin_trackerlist($data, $params) {
if (!isset($url))
$url = '';
$smarty->assign_by_ref('url', $url);
if (!isset($export))
$export = 'n';
$smarty->assign_by_ref('export', $export);
if (!empty($ldelim))
$smarty->left_delimiter = $ldelim;
......@@ -517,6 +520,18 @@ function wikiplugin_trackerlist($data, $params) {
$smarty->assign_by_ref('filterfield',$exactvalue);
$smarty->assign_by_ref('listfields', $listfields);
$smarty->assign_by_ref('popupfields', $popupfields);
if (!empty($export)) {
$exportUrl = "tiki-view_tracker.php?trackerId=$trackerId&displayedFields=$fields&cookietab=3";
foreach ($filterfield as $i=>$fieldId) {
$exportUrl .= "&f_$fieldId=";
if (empty($filtervalue[$i])) {
$exportUrl .= $exactvalue[$i];
} else {
$exportUrl .= $filtervalue[$i];
}
}
$smarty->assign('exportUrl', $exportUrl);
}
if (count($passfields)) {
......
......@@ -59,12 +59,12 @@
<input type="radio" name="which" id="list" value="list"/> <label for="list">{tr}Fields visible in items list{/tr}</label>
<br /><input type="radio" name="which" id="ls" value="ls"/> <label for="ls">{tr}Fields searchable or visible in items list{/tr}</label>
<br /><input type="radio" name="which" id="item" value="item"/> <label for="item">{tr}Fields visible in an item view{/tr}</label>
<br /><input type="radio" name="which" id="all" value="all" checked="checked"/> <label for="all">{tr}All fields{/tr}</label>
<br /><input type="radio" name="which" id="these" value="these"> <label for="these">{tr}These fields{/tr}</label>
<br /><input type="radio" name="which" id="all" value="all"{if empty($displayedFields)} checked="checked"{/if} /> <label for="all">{tr}All fields{/tr}</label>
<br /><input type="radio" name="which" id="these" value="these"{if !empty($displayedFields)} checked="checked"{/if}> <label for="these">{tr}These fields{/tr}</label>
<select multiple="multiple" name="listfields[]" id="listfields">
{foreach from=$fields item=ix}
{if ($ix.isHidden eq 'n' or $ix.isHidden eq 'c' or $ix.isHidden eq 'p' or $tiki_p_admin_trackers eq 'y') and $ix.type ne 'x' and $ix.type ne 'h' and ($ix.type ne 'p' or $ix.options_array[0] ne 'password') and (empty($ix.visibleBy) or in_array($default_group, $ix.visibleBy) or $tiki_p_admin_trackers eq 'y')}
<option value="{$ix.fieldId}">{$ix.name|escape}</option>
<option value="{$ix.fieldId}"{if !empty($displayedFields) and in_array($ix.fieldId, $displayedFields)} selected="selected"{/if}>{$ix.name|escape}</option>
{/if}
{/foreach}
</select>
......
......@@ -173,9 +173,15 @@ link="{tr}List Attachments{/tr}"><img src="img/icons/folderin.gif" border="0" al
{if $more eq 'y'}
<div class="more">
<span class="button2"><a href="{if $moreurl}{$moreurl}{else}tiki-view_tracker.php{/if}?trackerId={$trackerId}{if isset($tr_sort_mode)}&amp;sort_mode={$tr_sort_mode}{/if}">{tr}More...{/tr}</a></span>
{capture assign=moreUrl}
{if $moreurl}{$moreurl}{else}tiki-view_tracker.php{/if}?trackerId={$trackerId}{if isset($tr_sort_mode)}&amp;sort_mode={$tr_sort_mode}{/if}
{/capture}
{button href="$moreUrl" _text="{tr}More...{/tr}"}
</div>
{else}
{pagination_links cant=$count_item step=$max offset=$tr_offset offset_arg=tr_offset}{/pagination_links}
{/if}
{if $export eq 'y' && $tiki_p_export_tracker eq 'y'}
{button href="$exportUrl" _text="{tr}Export{/tr}"}
{/if}
{/strip}
......@@ -44,7 +44,7 @@ if ($tiki_p_view_trackers != 'y') {
$filters = array();
if (!empty($_REQUEST['listfields'])) {
if (is_string($_REQUEST['listfields'])) {
$filters['fieldId'] = split(',', $_REQUEST['listfields']);
$filters['fieldId'] = split('[,:]', $_REQUEST['listfields']);
} elseif (is_array($_REQUEST['listfields'])) {
$filters['fieldId'] = $_REQUEST['listfields'];
}
......@@ -202,3 +202,4 @@ while (($items = $trklib->list_items($_REQUEST['trackerId'], $offset, $maxRecord
if (!empty($fp)) {
fclose($fp);
}
die;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment