Skip to content
Snippets Groups Projects
Commit 4d9b7710 authored by Peter Rotich's avatar Peter Rotich
Browse files

oops: Fix logic on auto response emails which resulted in auto response failing to send out.

parent 5df35707
Branches
Tags
No related merge requests found
...@@ -152,9 +152,11 @@ class Dept { ...@@ -152,9 +152,11 @@ class Dept {
function getAutoRespEmail() { function getAutoRespEmail() {
if (!$this->autorespEmail && $this->ht['autoresp_email_id']) if (!$this->autorespEmail) {
if (!($this->autorespEmail = Email::lookup($this->ht['autoresp_email_id']))) if (!$this->ht['autoresp_email_id']
|| !($this->autorespEmail = Email::lookup($this->ht['autoresp_email_id'])))
$this->autorespEmail = $this->getEmail(); $this->autorespEmail = $this->getEmail();
}
return $this->autorespEmail; return $this->autorespEmail;
} }
......
...@@ -86,7 +86,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); ...@@ -86,7 +86,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</td> </td>
<td> <td>
<select name="tpl_id"> <select name="tpl_id">
<option value="0">&mdash; System default &mdash;</option> <option value="0">&mdash; System Default &mdash;</option>
<?php <?php
$sql='SELECT tpl_id,name FROM '.EMAIL_TEMPLATE_GRP_TABLE.' tpl WHERE isactive=1 ORDER by name'; $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)){ if(($res=db_query($sql)) && db_num_rows($res)){
...@@ -106,7 +106,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); ...@@ -106,7 +106,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</td> </td>
<td> <td>
<select name="sla_id"> <select name="sla_id">
<option value="0">&mdash; System default &mdash;</option> <option value="0">&mdash; System Default &mdash;</option>
<?php <?php
if($slas=SLA::getSLAs()) { if($slas=SLA::getSLAs()) {
foreach($slas as $id =>$name) { foreach($slas as $id =>$name) {
...@@ -176,12 +176,11 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); ...@@ -176,12 +176,11 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</tr> </tr>
<tr> <tr>
<td width="180"> <td width="180">
Auto Response Email: Auto-Response Email:
</td> </td>
<td> <td>
<select name="autoresp_email_id"> <select name="autoresp_email_id">
<option value="" disabled="disabled">Select Outgoing Email</option> <option value="0" selected="selected">&mdash; Department Email &mdash;</option>
<option value="0">&mdash; Department Email (Above) &mdash;</option>
<?php <?php
$sql='SELECT email_id,email,name FROM '.EMAIL_TABLE.' email ORDER by name'; $sql='SELECT email_id,email,name FROM '.EMAIL_TABLE.' email ORDER by name';
if(($res=db_query($sql)) && db_num_rows($res)){ if(($res=db_query($sql)) && db_num_rows($res)){
......
...@@ -69,9 +69,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); ...@@ -69,9 +69,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</td> </td>
<td> <td>
<select name="priority_id"> <select name="priority_id">
<option value="">&mdash; Select Priority &mdash;</option> <option value="0" selected="selected">&mdash; System Default &mdash;</option>
<?php <?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)){ if(($res=db_query($sql)) && db_num_rows($res)){
while(list($id,$name)=db_fetch_row($res)){ while(list($id,$name)=db_fetch_row($res)){
$selected=($info['priority_id'] && $id==$info['priority_id'])?'selected="selected"':''; $selected=($info['priority_id'] && $id==$info['priority_id'])?'selected="selected"':'';
...@@ -89,9 +89,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); ...@@ -89,9 +89,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</td> </td>
<td> <td>
<select name="dept_id"> <select name="dept_id">
<option value="">&mdash; Select Department &mdash;</option> <option value="0" selected="selected">&mdash; System Default &mdash;</option>
<?php <?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)){ if(($res=db_query($sql)) && db_num_rows($res)){
while(list($id,$name)=db_fetch_row($res)){ while(list($id,$name)=db_fetch_row($res)){
$selected=($info['dept_id'] && $id==$info['dept_id'])?'selected="selected"':''; $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