criat Posted November 7, 2013 Share Posted November 7, 2013 I'm trying to split Show tickets into two links: Show open tickets (any Ticket that's not Closed) Show closed tickets (Closed tickets only) This is the code that displays all tickets: {foreach key=num item=ticket from=$tickets} <tr> <td data-title="{$LANG.supportticketsdate}">{$ticket.date}</td> <td data-title="{$LANG.supportticketsdepartment}">{$ticket.department}</td> <td data-title="{$LANG.supportticketssubject}"><div align="left"><a href="viewticket.php?tid={$ticket.tid}&c={$ticket.c}"><img src="images/article.gif" alt="" border="0" /> {if $ticket.unread}<strong>{/if}#{$ticket.tid} - {$ticket.subject}{if $ticket.unread}</strong>{/if}</a></div></td> <td data-title="{$LANG.supportticketsstatus}">{$ticket.status}</td> <td data-title="{$LANG.supportticketsticketlastupdated}">{$ticket.lastreply}</td> <td class="last textcenter"><a href="viewticket.php?tid={$ticket.tid}&c={$ticket.c}" class="btn btn-inverse">{$LANG.supportticketsviewticket}</a></td> </tr> {foreachelse} <tr> <td colspan="7" class="textcenter">{$LANG.norecordsfound}</td> </tr> {/foreach} Any ideas? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 7, 2013 Share Posted November 7, 2013 http://forum.whmcs.com/showthread.php?81179-Open-tickets-only-how 0 Quote Link to comment Share on other sites More sharing options...
criat Posted November 7, 2013 Author Share Posted November 7, 2013 That doesn't works well with multiple language Found this though: <div class="table_title opentickets" style="margin-top:20px;"> <span class="icon"></span> <a class="btn btn-primary pull-right" href="submitticket.php">{$LANG.opennewticket}</a> <h3><strong>{$clientsstats.numactivetickets}</strong> {$LANG.supportticketsopentickets}</h3> </div> <table class="table table-striped table-framed table-centered no-more-tables"> <thead> <tr> <th><a href="supporttickets.php?orderby=date">{$LANG.supportticketsdate}</a></th> <th><a href="supporttickets.php?orderby=dept">{$LANG.supportticketsdepartment}</a></th> <th><a href="supporttickets.php?orderby=subject">{$LANG.supportticketssubject}</a></th> <th><a href="supporttickets.php?orderby=subject">{$LANG.supportticketsstatus}</a></th> <th class="headerSortdesc"><a href="supporttickets.php?orderby=lastreply">{$LANG.supportticketsticketlastupdated}</a></th> <th></th> </tr> </thead> <tbody> {foreach from=$tickets item=ticket} <tr> <td data-title="{$LANG.supportticketsdate}">{$ticket.date}</td> <td data-title="{$LANG.supportticketsdepartment}">{$ticket.department}</td> <td data-title="{$LANG.supportticketssubject}"><div align="left"><img src="images/article.gif" alt="Ticket" border="0" /> <a href="viewticket.php?tid={$ticket.tid}&c={$ticket.c}">{if $ticket.unread}<strong>{/if}#{$ticket.tid} - {$ticket.subject}{if $ticket.unread}</strong>{/if}</a></div></td> <td data-title="{$LANG.supportticketsstatus}">{$ticket.status}</td> <td data-title="{$LANG.supportticketsticketlastupdated}">{$ticket.lastreply}</td> <td class="last textcenter"><a href="viewticket.php?tid={$ticket.tid}&c={$ticket.c}" class="btn btn-inverse">{$LANG.supportticketsviewticket}</a></td> </tr> {foreachelse} <tr> <td colspan="6" class="textcenter">{$LANG.supportticketsnoneopen}</td> </tr> {/foreach} </tbody> </table> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 7, 2013 Share Posted November 7, 2013 it would with one minor tweak, but if you have found a working solution - problem solved! 0 Quote Link to comment Share on other sites More sharing options...
criat Posted November 8, 2013 Author Share Posted November 8, 2013 There's one more thing... I've created a new page to display these open tickets, here's what I did: The problem I think is that the page doesn't have the $ticket variable by default open-tickets.php <?php define("CLIENTAREA",false); require("init.php"); include("includes/functions.php"); $ca = new WHMCS_ClientArea(); $ca->setPageTitle($whmcs->get_lang('opentiketstitle')); $ca->addToBreadCrumb('index.php',$whmcs->get_lang('globalsystemname')); $ca->addToBreadCrumb('support-tickets.php',$whmcs->get_lang('opentiketstitle')); $ca->initPage(); $ca->requireLogin(); // Uncomment this line to require a login to access this page $ca->setTemplate('open-tickets'); $ca->output(); ?> open-tickets.tpl <h1>{$LANG.ticketsabertostitle}</h1> <div class="table_title opentickets" style="margin-top:20px;"> <span class="icon"></span> <a class="btn btn-primary pull-right" href="submitticket.php">{$LANG.opennewticket}</a> <h3><strong>{$clientsstats.numactivetickets}</strong> {$LANG.supportticketsopentickets}</h3> </div> <table class="table table-striped table-framed table-centered no-more-tables"> <thead> <tr> <th><a href="supporttickets.php?orderby=date">{$LANG.supportticketsdate}</a></th> <th><a href="supporttickets.php?orderby=dept">{$LANG.supportticketsdepartment}</a></th> <th><a href="supporttickets.php?orderby=subject">{$LANG.supportticketssubject}</a></th> <th><a href="supporttickets.php?orderby=subject">{$LANG.supportticketsstatus}</a></th> <th class="headerSortdesc"><a href="supporttickets.php?orderby=lastreply">{$LANG.supportticketsticketlastupdated}</a></th> <th></th> </tr> </thead> <tbody> {foreach from=$tickets item=ticket} <tr> <td data-title="{$LANG.supportticketsdate}">{$ticket.date}</td> <td data-title="{$LANG.supportticketsdepartment}">{$ticket.department}</td> <td data-title="{$LANG.supportticketssubject}"><div align="left"><img src="images/article.gif" alt="Ticket" border="0" /> <a href="viewticket.php?tid={$ticket.tid}&c={$ticket.c}">{if $ticket.unread}<strong>{/if}#{$ticket.tid} - {$ticket.subject}{if $ticket.unread}</strong>{/if}</a></div></td> <td data-title="{$LANG.supportticketsstatus}">{$ticket.status}</td> <td data-title="{$LANG.supportticketsticketlastupdated}">{$ticket.lastreply}</td> <td class="last textcenter"><a href="viewticket.php?tid={$ticket.tid}&c={$ticket.c}" class="btn btn-inverse">{$LANG.supportticketsviewticket}</a></td> </tr> {foreachelse} <tr> <td colspan="6" class="textcenter">{$LANG.supportticketsnoneopen}</td> </tr> {/foreach} </tbody> </table> Output: 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 9, 2013 Share Posted November 9, 2013 what happens if you add require("includes/ticketfunctions.php"); to open-tickets.php 0 Quote Link to comment Share on other sites More sharing options...
criat Posted November 9, 2013 Author Share Posted November 9, 2013 That didn't work, in {debug} mode I can see $ticket is not even mentioned 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted November 9, 2013 Share Posted November 9, 2013 if you are making your own pages, then you need to do the php to read the mysql to populate the variables yourself 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 9, 2013 Share Posted November 9, 2013 to be honest, it would be far easier to make the link I gave in the second post multilingual, then it is to reinvent the wheel by your method. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.