Commit a0a6fd8f authored by pkdille's avatar pkdille

[MOD] user tasks: deploy pagination links

parent 0c988035
......@@ -29,6 +29,8 @@
{include file='find.tpl' _sort_mode='y'}
{/if}
<span class="taskcount">{$cant}&nbsp;{tr}Tasks{/tr}</span>
<div class="wiki-edithelp" id='edithelpzone' >
<table width="100%">
{if $tiki_p_tasks_receive eq 'y'}
......
......@@ -149,28 +149,7 @@
</table>
</form>
<br />
<div class="mini">
{if $prev_offset >= 0}
[<a class="prevnext" href="tiki-user_tasks.php?find={$find}&amp;offset={$prev_offset}&amp;sort_mode={$sort_mode}">{tr}Prev{/tr}</a>]&nbsp;
{/if}
{tr}Page{/tr}: {$actual_page}/{$cant_pages}
{if $next_offset >= 0}
&nbsp;[<a class="prevnext" href="tiki-user_tasks.php?find={$find}&amp;offset={$next_offset}&amp;sort_mode={$sort_mode}">{tr}Next{/tr}</a>]
{/if}
{if $prefs.direct_pagination eq 'y'}
<br />
{section loop=$cant_pages name=foo}
{assign var=selector_offset value=$smarty.section.foo.index|times:$prefs.maxRecords}
<a class="prevnext" href="tiki-user_tasks.php?find={$find}&amp;offset={$selector_offset}&amp;sort_mode={$sort_mode}">
{$smarty.section.foo.index_next}</a>&nbsp;
{/section}
{/if}<br />
{$cant} {tr}Tasks{/tr}
</div>
<br />
<br />
{pagination_links cant=$cant step=$maxRecords offset=$offset}{/pagination_links}
{* end ************ Task list ***************}
......
......@@ -724,24 +724,7 @@ if (!$show_form){
/*$use_show_shared_for_group*/ false, /*$show_shared_for_group*/ null,
$show_trash, $show_completed, $show_admin);
$cant_pages = ceil($tasklist['cant'] / $maxRecords);
if($maxRecords == -1) $cant_pages = 1;
$smarty->assign_by_ref('cant_pages', $cant_pages);
$smarty->assign('actual_page', 1 + ($offset / $maxRecords));
$smarty->assign('cant', $tasklist['cant']);
if ($tasklist["cant"] > ($offset + $maxRecords)) {
$smarty->assign('next_offset', $offset + $maxRecords);
} else {
$smarty->assign('next_offset', -1);
}
// If offset is > 0 then prev_offset
if ($offset > 0) {
$smarty->assign('prev_offset', $offset - $maxRecords);
} else {
$smarty->assign('prev_offset', -1);
}
$smarty->assign_by_ref('tasklist', $tasklist["data"]);
}
......@@ -752,8 +735,6 @@ if (!$show_form){
$receive_users = $tasklib->get_user_with_permissions('tiki_p_tasks_receive');
if(count($receive_users) < 100) $smarty->assign('receive_users', $receive_users);
include_once ('tiki-mytiki_shared.php');
......
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