I have HESK 2.5.5 version.
I would like to modify the "new ticket" function, in particular the email "required" and the name.
I would like the "required" Name and Email addresses to be drop down lists of Staff users. This info is valid and would come from the database. I modified the code to pull the info from the DB but when user submits the ticket they are confronted with the following error:
Error: Please correct the following errors:
Please enter a valid email address
The following is the code to pull the data from the DB. Can anyone help me. Please?
Code: Select all
<td width="80%"><select name="email" <?php if (in_array('email',$_SESSION['iserror'])) {echo ' class="isError" ';} elseif (in_array('email',$_SESSION['isnotice'])) {echo ' class="isNotice" ';} ?> <?php if($hesk_settings['detect_typos']) { echo ' onblur="Javascript:hesk_suggestEmail(1)"'; } ?> />
<?php
if (!empty($_GET['catid']))
{
$_SESSION['as_email'] = intval( hesk_GET('catid') );
}
$result = hesk_dbQuery('SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'users` ORDER BY `id` ASC');
while ($row=hesk_dbFetchAssoc($result))
{
if (isset($_SESSION['as_email']) && $_SESSION['as_email'] == $row['id']) {$selected = ' selected="selected"';}
else {$selected = '';}
echo '<option value="'.$row['id'].'"'.$selected.'>'.$row['email'].'</option>';
}
?>
</select></td>
</tr>
</table>
<div id="email_suggestions"></div>
<hr />