Adding sortable fields based on custom field
  • January 1970 Edit

    First off I'm aware that the manage pages are being redeveloped, but i think i'd have to redo essentially the same thing once its redone anyway, and this would be a good practice, so...

    Our place when i showed them a test version of this liked the idea, but wanted some way of writing the projects status - Ie send bill off, wait a bit almost done, something that you can type yourself. So, a custom field sounded perfect for it.

    So, the first custom invoice field is referred to as:
    [b]invoice_cf1[/b] According to the simple invoices menu. Cool!

    Now, to add this to be displayed in the manage invoices menu is what I'm after. I tracked the page I think to be manage.tpl, in templates/invoices .

    The code I think I need to change is this

    .... beginning of thread
    {[i]$LANG.customer_cf1[/i]}
    ... end of thread

    Actual column data:

    {$invoice.customer_cf1.name}

    Result is I get a blank sortable "tab", and a blank area for the actual content.

    This is far as i think I can get with the code. The goal is to display the information for that custom field - am I writing the variable that refers the customer_cf1 wrong?

  • justinjustin August 2007

    Hey

    re actual data

    change it to
    <td class="index_table">{$invoice.invoice.custom_field1}</td>

    re getting the name of the custom field 1
    - will post that info in a minute or so

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • justinjustin August 2007

    re th

    in mange.tpl change it to
    <th class="noFilter sortable">{$customFieldLabels.invoice_cf1}</th>

    in mange.php
    $customFieldLabels = getCustomFieldLabels();
    $smarty -> assign("customFieldLabels",$customFieldLabels);


    enjoy :)

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • SuperRoachSuperRoach August 2007

    I forgot to post back in here, but done it and it works fantastic! Thank you :)

  • justinjustin August 2007

    no worries

    just happy to hear its working

    note: since we've moved to Smarty as the templating system adding stuff to the layout is not as straight forward as normal php - but the benefits of smarty out weight this inconvenience

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • SuperRoachSuperRoach August 2007

    Thats ok - I just had a brief read of their site - sounds a bit daunting but i'll look into it. Do the newer SVN builds use smarty fully yet?

  • justinjustin August 2007

    re SVN
    - yep, most (90% or so) of the view code (html, templates, etc.) is done via Smarty

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Categories