Skip to content
Snippets Groups Projects
Commit 9efd196f authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge pull request #666 from protich/issue/autoresp-email


Fix department's auto response email

Reviewed-By: default avatarJared Hancock <jared@osticket.com>
parents 5df35707 4d9b7710
No related branches found
No related tags found
No related merge requests found
......@@ -152,9 +152,11 @@ class Dept {
function getAutoRespEmail() {
if (!$this->autorespEmail && $this->ht['autoresp_email_id'])
if (!($this->autorespEmail = Email::lookup($this->ht['autoresp_email_id'])))
if (!$this->autorespEmail) {
if (!$this->ht['autoresp_email_id']
|| !($this->autorespEmail = Email::lookup($this->ht['autoresp_email_id'])))
$this->autorespEmail = $this->getEmail();
}
return $this->autorespEmail;
}
......
......@@ -86,7 +86,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</td>
<td>
<select name="tpl_id">
<option value="0">&mdash; System default &mdash;</option>
<option value="0">&mdash; System Default &mdash;</option>
<?php
$sql='SELECT tpl_id,name FROM '.EMAIL_TEMPLATE_GRP_TABLE.' tpl WHERE isactive=1 ORDER by name';
if(($res=db_query($sql)) && db_num_rows($res)){
......@@ -106,7 +106,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</td>
<td>
<select name="sla_id">
<option value="0">&mdash; System default &mdash;</option>
<option value="0">&mdash; System Default &mdash;</option>
<?php
if($slas=SLA::getSLAs()) {
foreach($slas as $id =>$name) {
......@@ -176,12 +176,11 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</tr>
<tr>
<td width="180">
Auto Response Email:
Auto-Response Email:
</td>
<td>
<select name="autoresp_email_id">
<option value="" disabled="disabled">Select Outgoing Email</option>
<option value="0">&mdash; Department Email (Above) &mdash;</option>
<option value="0" selected="selected">&mdash; Department Email &mdash;</option>
<?php
$sql='SELECT email_id,email,name FROM '.EMAIL_TABLE.' email ORDER by name';
if(($res=db_query($sql)) && db_num_rows($res)){
......
......@@ -69,9 +69,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</td>
<td>
<select name="priority_id">
<option value="">&mdash; Select Priority &mdash;</option>
<option value="0" selected="selected">&mdash; System Default &mdash;</option>
<?php
$sql='SELECT priority_id,priority_desc FROM '.PRIORITY_TABLE.' pri ORDER by priority_urgency DESC';
$sql='SELECT priority_id, priority_desc FROM '.PRIORITY_TABLE.' pri ORDER by priority_urgency DESC';
if(($res=db_query($sql)) && db_num_rows($res)){
while(list($id,$name)=db_fetch_row($res)){
$selected=($info['priority_id'] && $id==$info['priority_id'])?'selected="selected"':'';
......@@ -89,9 +89,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</td>
<td>
<select name="dept_id">
<option value="">&mdash; Select Department &mdash;</option>
<option value="0" selected="selected">&mdash; System Default &mdash;</option>
<?php
$sql='SELECT dept_id,dept_name FROM '.DEPT_TABLE.' dept ORDER by dept_name';
$sql='SELECT dept_id, dept_name FROM '.DEPT_TABLE.' dept ORDER by dept_name';
if(($res=db_query($sql)) && db_num_rows($res)){
while(list($id,$name)=db_fetch_row($res)){
$selected=($info['dept_id'] && $id==$info['dept_id'])?'selected="selected"':'';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment