diff --git a/include/class.ticket.php b/include/class.ticket.php index 76445c867f099de96e02f73fe2e38f6aec415150..7ed012530e6649b04acfb0033b96980430aea869 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -2008,7 +2008,7 @@ class Ticket { $fields['topicId'] = array('type'=>'int', 'required'=>1, 'error'=>'Select help topic'); break; case 'staff': - $fields['deptId'] = array('type'=>'int', 'required'=>1, 'error'=>'Dept. required'); + $fields['deptId'] = array('type'=>'int', 'required'=>0, 'error'=>'Dept. required'); $fields['topicId'] = array('type'=>'int', 'required'=>1, 'error'=>'Topic required'); $fields['duedate'] = array('type'=>'date', 'required'=>0, 'error'=>'Invalid date - must be MM/DD/YY'); case 'api': diff --git a/include/staff/ticket-open.inc.php b/include/staff/ticket-open.inc.php index 5de9012a6fae044fbd8915a6728f17d0cae6e549..aa15ff449fc64ffae624dbbac57e27235facddc1 100644 --- a/include/staff/ticket-open.inc.php +++ b/include/staff/ticket-open.inc.php @@ -110,46 +110,46 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); </tr> <tr> <td width="160" class="required"> - Department: + Help Topic: </td> <td> - <select name="deptId"> - <option value="" selected >— Select Department —</option> + <select name="topicId" onchange="javascript: + $('#dynamic-form').load( + 'ajax.php/form/help-topic/' + this.value); + "> + <option value="" selected >— Select Help Topic —</option> <?php - if($depts=Dept::getDepartments()) { - foreach($depts as $id =>$name) { + if($topics=Topic::getHelpTopics()) { + foreach($topics as $id =>$name) { echo sprintf('<option value="%d" %s>%s</option>', - $id, ($info['deptId']==$id)?'selected="selected"':'',$name); + $id, ($info['topicId']==$id)?'selected="selected"':'',$name); } } ?> </select> - <font class="error"><b>*</b> <?php echo $errors['deptId']; ?></font> + <font class="error"><b>*</b> <?php echo $errors['topicId']; ?></font> </td> </tr> - <tr> - <td width="160" class="required"> - Help Topic: + <td width="160"> + Department: </td> <td> - <select name="topicId" onchange="javascript: - $('#dynamic-form').load( - 'ajax.php/form/help-topic/' + this.value); - "> - <option value="" selected >— Select Help Topic —</option> + <select name="deptId"> + <option value="" selected >— Select Department —</option> <?php - if($topics=Topic::getHelpTopics()) { - foreach($topics as $id =>$name) { + if($depts=Dept::getDepartments()) { + foreach($depts as $id =>$name) { echo sprintf('<option value="%d" %s>%s</option>', - $id, ($info['topicId']==$id)?'selected="selected"':'',$name); + $id, ($info['deptId']==$id)?'selected="selected"':'',$name); } } ?> </select> - <font class="error"><b>*</b> <?php echo $errors['topicId']; ?></font> + <font class="error"><?php echo $errors['deptId']; ?></font> </td> </tr> + <tr> <td width="160"> SLA Plan: