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

Prohibit disabling and deleting canned responses

when they are in use by email filters
parent 617f386d
No related branches found
No related tags found
No related merge requests found
......@@ -2,10 +2,12 @@
if(!defined('OSTSCPINC') || !$thisstaff) die('Access Denied');
$qstr='';
$sql='SELECT canned.*, count(attach.file_id) as files, dept.dept_name as department '.
$sql='SELECT canned.*, count(attach.file_id) as files, dept.dept_name as department, '.
' (filter.id is not null) as in_use '.
' FROM '.CANNED_TABLE.' canned '.
' LEFT JOIN '.DEPT_TABLE.' dept ON (dept.dept_id=canned.dept_id) '.
' LEFT JOIN '.CANNED_ATTACHMENT_TABLE.' attach ON (attach.canned_id=canned.canned_id) ';
' LEFT JOIN '.CANNED_ATTACHMENT_TABLE.' attach ON (attach.canned_id=canned.canned_id) '.
' LEFT JOIN '.EMAIL_FILTER_TABLE.' filter ON (canned.canned_id = filter.canned_response_id) ';
$sql.=' WHERE 1';
$sortOptions=array('title'=>'canned.title','status'=>'canned.isenabled','dept'=>'department','updated'=>'canned.updated');
......@@ -81,9 +83,12 @@ else
?>
<tr id="<?php echo $row['canned_id']; ?>">
<td width=7px>
<?php if (!$row['in_use']) { ?>
<input type="checkbox" name="ids[]" value="<?php echo $row['canned_id']; ?>"
<?php echo $sel?'checked="checked"':''; ?> <?php echo $default?'disabled="disabled"':''; ?>
onClick="highLight(this.value,this.checked);"> </td>
onClick="highLight(this.value,this.checked);"/>
<?php } ?>
</td>
<td>
<a href="canned.php?id=<?php echo $row['canned_id']; ?>"><?php echo Format::truncate($row['title'],200); echo "&nbsp;$files"; ?></a>&nbsp;
</td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment