SupportSuite Version: 3.10.02 STABLE
- I added a custom field, type custom. Admin CP -> Custom Fields -> Insert Field -> Custom -> Next. Entered a Field Title and Field Name.
Field Title: "Date Requested"
Field Name: "daterequested"
From the Staff CP, I copied some of their HTML that calls for the JavaScript files they use to make that nifty calendar for the 'Due' field for tickets.
Code:
<tr>
<td align="left" valign="top" class="row2" width="30%">
<span class="smalltext">Date Requested: </span>
</td>
<td>
<input type="text" name="daterequested" id="daterequested" size="12" readonly="1" value=" " class="swifttext" onclick="return showCalendar('daterequested', '%m/%d/%Y');" /> <img src="https://myhelpdeskURL.com/themes/admin_default/icon_duetime.gif" id="daterequested" style="cursor: pointer;" title="" align="absmiddle" onclick="return showCalendar('daterequested', '%m/%d/%Y');" /> <a href="javascript:void(0);"onclick="javascript:document.getElementById('daterequested').value='';"><img src="https://myhelpdeskURL.com/themes/admin_default/icon_duetimeclear.gif" align="absmiddle" border="0" /></a>
</td>
</tr>
So, then from the Admin CP -> Templates -> Manage Templates -> General -> 'customfields' I added the above code at the end of the table in that template.
In Admin CP -> Templates -> Manage Templates -> Tickets -> 'submitticket' I added this code:
Code:
<script type="text/javascript" src="https://myhelpdeskURL.com/themes/admin_default/main.js"></script>
<script type="text/javascript" src="https://myhelpdeskURL.com/locale/en-us/staffmenu.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="https://myhelpdeskURL.com/themes/admin_default/calendar-blue.css" title="winter" />
<script type="text/javascript" src="https://myhelpdeskURL.com/themes/admin_default/calendar.js"></script>
<script type="text/javascript" src="https://myhelpdeskURL.com/themes/admin_default/lang/calendar-en-us.js"></script>
<script type="text/javascript" src="https://myhelpdeskURL.com/themes/admin_default/calendar-setup.js"></script>
I did the same for the 'viewtickets' template.
I'm no programmer. I'm sure I'm not doing this right. From the client interface, my field does show up on submit. My field shows when viewing a ticket and is editable. However, I can't find any example(s) of this on the forum, or information as to the right way to do this, verses my brute force method. Does anyone have an example of the correct way to do this? Also, an example of how to pull the existing value/information from the database, when viewing the field?