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

Merge pull request #1114 from greezybacon/issue/dept-sys-defaults


email: Setting default for priority and department

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 93578336 522fa76d
No related branches found
No related tags found
No related merge requests found
...@@ -292,10 +292,6 @@ class Email { ...@@ -292,10 +292,6 @@ class Email {
$errors['mail_fetchfreq']='Fetch interval required'; $errors['mail_fetchfreq']='Fetch interval required';
if(!$vars['mail_fetchmax'] || !is_numeric($vars['mail_fetchmax'])) if(!$vars['mail_fetchmax'] || !is_numeric($vars['mail_fetchmax']))
$errors['mail_fetchmax']='Maximum emails required'; $errors['mail_fetchmax']='Maximum emails required';
if(!$vars['dept_id'] || !is_numeric($vars['dept_id']))
$errors['dept_id']='You must select a Dept.';
if(!$vars['priority_id'])
$errors['priority_id']='You must select a priority';
if(!isset($vars['postfetch'])) if(!isset($vars['postfetch']))
$errors['postfetch']='Indicate what to do with fetched emails'; $errors['postfetch']='Indicate what to do with fetched emails';
......
...@@ -41,6 +41,10 @@ if($res && ($num=db_num_rows($res))) ...@@ -41,6 +41,10 @@ if($res && ($num=db_num_rows($res)))
else else
$showing='No emails found!'; $showing='No emails found!';
$def_dept_id = $cfg->getDefaultDeptId();
$def_dept_name = $cfg->getDefaultDept()->getName();
$def_priority = $cfg->getDefaultPriority()->getDesc();
?> ?>
<div style="width:700px;padding-top:5px; float:left;"> <div style="width:700px;padding-top:5px; float:left;">
<h2>Email Addresses</h2> <h2>Email Addresses</h2>
...@@ -81,12 +85,13 @@ else ...@@ -81,12 +85,13 @@ else
?> ?>
<tr id="<?php echo $row['email_id']; ?>"> <tr id="<?php echo $row['email_id']; ?>">
<td width=7px> <td width=7px>
<input type="checkbox" class="ckb" name="ids[]" value="<?php echo $row['email_id']; ?>" <input type="checkbox" class="ckb" name="ids[]" value="<?php echo $row['email_id']; ?>"
<?php echo $sel?'checked="checked"':''; ?> <?php echo $default?'disabled="disabled"':''; ?>> <?php echo $sel?'checked="checked"':''; ?> <?php echo $default?'disabled="disabled"':''; ?>>
</td> </td>
<td><a href="emails.php?id=<?php echo $row['email_id']; ?>"><?php echo Format::htmlchars($email); ?></a>&nbsp;</td> <td><a href="emails.php?id=<?php echo $row['email_id']; ?>"><?php echo Format::htmlchars($email); ?></a>&nbsp;</td>
<td><?php echo $row['priority']; ?></td> <td><?php echo $row['priority'] ?: $def_priority; ?></td>
<td><a href="departments.php?id=<?php echo $row['dept_id']; ?>"><?php echo $row['department']; ?></a></td> <td><a href="departments.php?id=<?php $row['dept_id'] ?: $def_dept_id; ?>"><?php
echo $row['department'] ?: $def_dept_name; ?></a></td>
<td>&nbsp;<?php echo Format::db_date($row['created']); ?></td> <td>&nbsp;<?php echo Format::db_date($row['created']); ?></td>
<td>&nbsp;<?php echo Format::db_datetime($row['updated']); ?></td> <td>&nbsp;<?php echo Format::db_datetime($row['updated']); ?></td>
</tr> </tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment