• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Adding Labels (text) to Ticket Forms - Here's How

Adding Labels (text) to Ticket Forms - Here's How 14 years 4 months ago #9312

  • hughdouglas
  • hughdouglas's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 1
I had a requirement to add text within a ticket submission form as can be done with RSFormsPro but is not currently supported in RSTickets. The following code changes show how this can be done. Note these are CORE component hacks so updates will be an issue. This was done with version 1.0.0.r13 for Joomla 1.5.x

Change the following files:
components/com_rstickets/functions.php
After:
case 'calendartime':
				$return .= '<input type="text" name="rstcf_'.$row2['CustomFieldId'].'" id="rstcf_'.$row2['CustomFieldId'].'" value="'.(isset($_POST['rstcf_'.$row2['CustomFieldId']]) ? strip_tags($_POST['rstcf_'.$row2['CustomFieldId']]) : (strip_tags($row2['CustomFieldValues']))).'" onclick="displayCalendar(this,\''.$T_SETTINGS['Date_Format_JS'].' hh:ii\',this,true)" />';
				break;
Add the code:
case 'label':
				$return .= '<div>' . $row2['CustomFieldValues'] . '</div>';
				break;

Next file: components/com_rstickets/js/script.js
Change the line:
var y=x.insertCell(2);y.innerHTML='<select name="CustomFieldType[]"><option value="textbox">Text box</option><option value="textarea">Text area</option><option value="select">Select list</option><option value="multipleselect">Multiple select list</option><option value="checkbox">Checkbox group</option><option value="radio">Radio group</option><option value="calendar">Calendar</option><option value="calendartime">Calendar and time</option></select>';y.className = 'tdGrey';
To:
	var y=x.insertCell(2);y.innerHTML='<select name="CustomFieldType[]"><option value="textbox">Text box</option><option value="textarea">Text area</option><option value="select">Select list</option><option value="multipleselect">Multiple select list</option><option value="checkbox">Checkbox group</option><option value="radio">Radio group</option><option value="calendar">Calendar</option><option value="calendartime">Calendar and time</option><option value="label">Label</select>';y.className = 'tdGrey';
 

Then file: administrator/components/com_rstickets/page/admin/add_department.php

After the line:
<option value="calendartime" '.($custom_field['CustomFieldType'] == 'calendartime' ? 'selected="selected"' : '').'>'.LBL_CALENDAR_TIME.'</option>
Add the line:
							<option value="label" '.($custom_field['CustomFieldType'] == 'label' ? 'selected="selected"' : '').'>'.LBL_LABEL.'</option>
 

You will then gain a new field type of "Label" Enter the message you want to appear in the VALUE field, this sadly cannot contain HTML coding (anyone want to improve this mod with that feature?)
You will need to add a caption which will show, but it could be just a space.

Hope you find this of use.
Hugh
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!