skshost Posted April 8, 2007 Share Posted April 8, 2007 I didn't like that extra step of selecting the department before you write up a ticket, so I just linked directly to: submitticket.php?step=2 from the homepage. I removed the hidden form input(deptid) and replaced where it showed the department with this: <select name="deptid"> {foreach item=department from=$departments} <option value ="{$department.id}">{$department.name}</option> {/foreach} </select> Of course I had to pass it all to smarty first: {php} $i=0; $client_query = "SELECT * FROM tblticketdepartments WHERE hidden != 'on' ORDER BY id"; $result = mysql_query($client_query); while($row = mysql_fetch_array($result)) { $tktdepart_array[$i]['id'] = $row['id']; $tktdepart_array[$i]['name'] = $row['name']; $i++; } //Pass the values to smarty $this->assign('departments',$tktdepart_array); {/php} I just thought some here mite make some use of it. 0 Quote Link to comment Share on other sites More sharing options...
skshost Posted April 30, 2007 Author Share Posted April 30, 2007 Updated to not show hidden departments. 0 Quote Link to comment Share on other sites More sharing options...
Nathan123 Posted May 31, 2007 Share Posted May 31, 2007 Updated to not show hidden departments. This works great, Thanks SksHost. 0 Quote Link to comment Share on other sites More sharing options...
AVeal Posted June 8, 2007 Share Posted June 8, 2007 Where do you put the smarty code upon the page? 0 Quote Link to comment Share on other sites More sharing options...
skshost Posted June 12, 2007 Author Share Posted June 12, 2007 On supportticketsubmit-steptwo.tpl 0 Quote Link to comment Share on other sites More sharing options...
generic Posted June 12, 2007 Share Posted June 12, 2007 nice work, just wish it would show them in the same order as whmcs allows you to set them to, i tried a few changes, but cant get that to work. 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted June 13, 2007 Share Posted June 13, 2007 all you have to do is change the ORDER BY part in the mysql statement. I dont know off the top of my head what name of that field is though that does the ordering. 0 Quote Link to comment Share on other sites More sharing options...
mstorman Posted June 18, 2007 Share Posted June 18, 2007 Very nice... I think this should become part of the default installation. Matthew. 0 Quote Link to comment Share on other sites More sharing options...
generic Posted June 18, 2007 Share Posted June 18, 2007 i tried using this, but it didnt work {foreach key=num item=department from=$departments} 0 Quote Link to comment Share on other sites More sharing options...
SpookedOut Posted June 20, 2007 Share Posted June 20, 2007 Got your .tpl file? This is quite confusing for people who don't know how to do it! Just my 2.34523424542 cents 0 Quote Link to comment Share on other sites More sharing options...
BionHostStan Posted July 3, 2007 Share Posted July 3, 2007 can I get a demo please? 0 Quote Link to comment Share on other sites More sharing options...
SpookedOut Posted July 3, 2007 Share Posted July 3, 2007 There is no demo currently. I do however, have a working example please PM me if you would like to see it 0 Quote Link to comment Share on other sites More sharing options...
Daniel Posted July 19, 2007 Share Posted July 19, 2007 Have I got this right? It doesnt seem to show the drop down for me.. {if $errormessage} <font color=#cc0000>{$LANG.clientareaerrors}</font></p> <ul> {$errormessage} [/list] {/if} <form method="post" action="{$SERVER.PHP_SELF}?step=3" enctype="multipart/form-data"> <table> <tr><td width=120>{$LANG.supportticketsclientname}</td><td>{if $loggedin}{$clientname}{else}<input type="text" name="name" size=30 value="{$name}">{/if}</td></tr> <tr><td>{$LANG.supportticketsclientemail}</td><td>{if $loggedin}{$email}{else}<input type="text" name="email" size=50 value="{$email}">{/if}</td></tr> {php} $i=0; $client_query = "SELECT * FROM tblticketdepartments WHERE hidden != 'on' ORDER BY id"; $result = mysql_query($client_query); while($row = mysql_fetch_array($result)) { $tktdepart_array[$i]['id'] = $row['id']; $tktdepart_array[$i]['name'] = $row['name']; $i++; } //Pass the values to smarty $this->assign('departments',$tktdepart_array); {/php} <tr><td>{$LANG.supportticketsticketsubject}</td><td><input type="text" name="subject" size=60 value="{$subject}"></td></tr> <tr><td>{$LANG.supportticketsticketurgency}</td><td><select name="urgency"><option value="Low">{$LANG.supportticketsticketurgencylow}<option value="Medium" selected>{$LANG.supportticketsticketurgencymedium}<option value="High">{$LANG.supportticketsticketurgencyhigh}</select></td></tr> </table> <textarea name="message" rows=12 style="width:100%">{$message}</textarea> {if $customfields}<table>{/if} {foreach key=num item=customfield from=$customfields} <tr><td width=120>{$customfield.name}</td><td>{$customfield.input} {$customfield.required}</td></tr> {/foreach} {if $customfields}</table> {/if} {$LANG.supportticketsticketattachment}: <input type="file" name="attachment" style="width:80%"> ({$LANG.supportticketsallowedextensions}: {$allowedfiletypes}) <P ALIGN="center"><input type="submit" value="{$LANG.supportticketsticketsubmit}"></P> </form> 0 Quote Link to comment Share on other sites More sharing options...
angelcosta Posted November 28, 2007 Share Posted November 28, 2007 I just realized that if you use this as is, you wont be able to see the custom fields for each department. Is there a fix? 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.