diff --git a/include/class.email.php b/include/class.email.php index 17c03532876a68f01b06e19a448cec389574b5a1..5c0a51c59c1cef1cc7ae0478f83398f2215a0920 100644 --- a/include/class.email.php +++ b/include/class.email.php @@ -341,17 +341,12 @@ class Email { if($errors) return false; - //Default to default priority and dept.. - if(!$vars['priority_id'] && $cfg) - $vars['priority_id']=$cfg->getDefaultPriorityId(); - if(!$vars['dept_id'] && $cfg) - $vars['dept_id']=$cfg->getDefaultDeptId(); - $sql='updated=NOW(),mail_errors=0, mail_lastfetch=NULL'. ',email='.db_input($vars['email']). ',name='.db_input(Format::striptags($vars['name'])). ',dept_id='.db_input($vars['dept_id']). ',priority_id='.db_input($vars['priority_id']). + ',topic_id='.db_input($vars['topic_id']). ',noautoresp='.db_input(isset($vars['noautoresp'])?1:0). ',userid='.db_input($vars['userid']). ',mail_active='.db_input($vars['mail_active']). diff --git a/include/staff/email.inc.php b/include/staff/email.inc.php index 193a5347815237a41b2ffbc613cbb0a75b05914f..bd0acace9d75211d73783415115c82f8f2ce7ea3 100644 --- a/include/staff/email.inc.php +++ b/include/staff/email.inc.php @@ -63,6 +63,26 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <span class="error">* <?php echo $errors['name']; ?> </span> </td> </tr> + <tr> + <td width="180"> + New Ticket Help Topic + </td> + <td> + <select name="topic_id"> + <option value="0" selected="selected">— Empty —</option> + <?php + $sql='SELECT topic_id, topic FROM '.TOPIC_TABLE.' T ORDER by topic'; + if(($res=db_query($sql)) && db_num_rows($res)){ + while(list($id,$name)=db_fetch_row($res)){ + $selected=($info['topic_id'] && $id==$info['topic_id'])?'selected="selected"':''; + echo sprintf('<option value="%d" %s>%s</option>',$id,$selected,$name); + } + } + ?> + </select> + <span class="error"><?php echo $errors['topic_id']; ?></span> + </td> + </tr> <tr> <td width="180"> New Ticket Priority