Jump to content

Set default $itemlimit for invoice page to 'all'


elijahpaul

Recommended Posts

I'm currently working on a custom template using dataTables for the invoice page.

 

Which means I require all invoice items to be loaded by default.

 

As a workaround I've set the invoice page nav link to 'clientarea.php?action=invoices&itemlimit=all'

 

But I'm wondering if there is another way to set $itemlimit to 'all' by default ?

Link to comment
Share on other sites

  • 3 months later...

I'm also looking for this option.

 

I've rebased my custom theme to use the 'six' theme template core files, including tablelist.tpl, yet unless I manually add &itemlimit=all to my URLs, any clients that have previously logged in and viewed the page seem to have the itemlimit set to 10.

 

If I change my template to six the issue disappears, yet I can't see anywhere in the six template where it specifies that the itemlimit should always be 'all'.

 

As a workaround, I added this to the tablelist.tpl file between script tags:

 

{if isset($itemlimit) && $itemlimit neq "all"}

jQuery.get( window.location.href, { itemlimit: "all" } );

{/if}

 

But it's not what I'd consider an elegant fix.

Link to comment
Share on other sites

in tablelist.tpl, if you change...

 

        "pageLength": 10,
       "order": [
           [ {if isset($startOrderCol) && $startOrderCol}{$startOrderCol}{else}0{/if}, "asc" ]
       ],
       "lengthMenu": [
           [10, 25, 50, -1],
           [10, 25, 50, "{$LANG.tableviewall}"]

to...

 

        "pageLength": -1,
       "order": [
           [ {if isset($startOrderCol) && $startOrderCol}{$startOrderCol}{else}0{/if}, "asc" ]
       ],
       "lengthMenu": [
           [-1],
           ["{$LANG.tableviewall}"]

that should show all invoices and not just the first 10 - obviously, this setting will be applied to all tables.

 

there does appear to be an issue with domains having a blank dropdown - page works ok, just the initial value of the dropdown is empty - it's probably caused by additional code in the include call.

 

the other way to do this, if you want to only apply it to invoices, might be to use a hook to modify the navbar and sidebar links and add &itemlimit=all to the URL.... but hopefully the template edit will meet your needs.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated