Stambro

/include/staff/settings-emails.inc.php

Jan 24th, 2023
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.99 KB | None | 0 0
  1. <?php
  2. if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) die('Access Denied');
  3. ?>
  4. <h2><?php echo __('Email Settings and Options');?></h2>
  5. <form action="emailsettings.php" method="post" class="save">
  6. <?php csrf_token(); ?>
  7. <input type="hidden" name="t" value="emails" >
  8. <table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2">
  9. <thead>
  10. <tr>
  11. <th colspan="2">
  12. <em><?php echo __('Note that some of the global settings can be overridden at department/email level.');?></em>
  13. </th>
  14. </tr>
  15. </thead>
  16. <tbody>
  17. <tr>
  18. <td width="180" class="required"><?php echo __('Default Template Set'); ?>:</td>
  19. <td>
  20. <select name="default_template_id">
  21. <option value="">&mdash; <?php echo __('Select Default Email Template Set'); ?> &mdash;</option>
  22. <?php
  23. $sql='SELECT tpl_id, name FROM '.EMAIL_TEMPLATE_GRP_TABLE
  24. .' WHERE isactive =1 ORDER BY name';
  25. if(($res=db_query($sql)) && db_num_rows($res)){
  26. while (list($id, $name) = db_fetch_row($res)){
  27. $selected = ($config['default_template_id']==$id)?'selected="selected"':''; ?>
  28. <option value="<?php echo $id; ?>"<?php echo $selected; ?>><?php echo $name; ?></option>
  29. <?php
  30. }
  31. } ?>
  32. </select>&nbsp;<font class="error">*&nbsp;<?php echo $errors['default_template_id']; ?></font>
  33. <i class="help-tip icon-question-sign" href="#default_email_templates"></i>
  34. </td>
  35. </tr>
  36. <tr>
  37. <td width="180" class="required"><?php echo __('Default System Email');?>:</td>
  38. <td>
  39. <select name="default_email_id">
  40. <option value=0 disabled><?php echo __('Select One');?></option>
  41. <?php
  42. $sql='SELECT email_id,email,name FROM '.EMAIL_TABLE;
  43. if(($res=db_query($sql)) && db_num_rows($res)){
  44. while (list($id,$email,$name) = db_fetch_row($res)){
  45. $email=$name?"$name &lt;$email&gt;":$email;
  46. ?>
  47. <option value="<?php echo $id; ?>"<?php echo ($config['default_email_id']==$id)?'selected="selected"':''; ?>><?php echo $email; ?></option>
  48. <?php
  49. }
  50. } ?>
  51. </select>
  52. &nbsp;<font class="error">*&nbsp;<?php echo $errors['default_email_id']; ?></font>
  53. <i class="help-tip icon-question-sign" href="#default_system_email"></i>
  54. </td>
  55. </tr>
  56. <tr>
  57. <td width="180" class="required"><?php echo __('Default Alert Email');?>:</td>
  58. <td>
  59. <select name="alert_email_id">
  60. <option value="0" selected="selected"><?php echo __('Use Default System Email (above)');?></option>
  61. <?php
  62. $sql='SELECT email_id,email,name FROM '.EMAIL_TABLE.' WHERE email_id != '.db_input($config['default_email_id']);
  63. if(($res=db_query($sql)) && db_num_rows($res)){
  64. while (list($id,$email,$name) = db_fetch_row($res)){
  65. $email=$name?"$name &lt;$email&gt;":$email;
  66. ?>
  67. <option value="<?php echo $id; ?>"<?php echo ($config['alert_email_id']==$id)?'selected="selected"':''; ?>><?php echo $email; ?></option>
  68. <?php
  69. }
  70. } ?>
  71. </select>
  72. &nbsp;<font class="error">*&nbsp;<?php echo $errors['alert_email_id']; ?></font>
  73. <i class="help-tip icon-question-sign" href="#default_alert_email"></i>
  74. </td>
  75. </tr>
  76. <tr>
  77. <td width="180" class="required"><?php echo __("Admin's Email Address");?>:</td>
  78. <td>
  79. <input type="text" size=40 name="admin_email" value="<?php echo $config['admin_email']; ?>">
  80. &nbsp;<font class="error">*&nbsp;<?php echo $errors['admin_email']; ?></font>
  81. <i class="help-tip icon-question-sign" href="#admins_email_address"></i>
  82. </td>
  83. </tr>
  84. <tr>
  85. <td width="180" class="required"><?php echo __("Verify Email Addresses");?>:</td>
  86. <td>
  87. <input type="checkbox" name="verify_email_addrs" <?php
  88. if ($config['verify_email_addrs']) echo 'checked="checked"'; ?>>
  89. <?php echo __('Verify email address domain'); ?>
  90. <i class="help-tip icon-question-sign" href="#verify_email_addrs"></i>
  91. </td>
  92. </tr>
  93. <tr><th colspan=2><em><strong><?php echo __('Incoming Emails'); ?>:</strong>&nbsp;
  94. </em></th>
  95. <tr>
  96. <td width="180"><?php echo __('Email Fetching'); ?>:</td>
  97. <td><input type="checkbox" name="enable_mail_polling" value=1 <?php echo $config['enable_mail_polling']? 'checked="checked"': ''; ?>>
  98. <?php echo __('Enable'); ?>
  99. <i class="help-tip icon-question-sign" href="#email_fetching"></i>
  100. &nbsp;
  101. <input type="checkbox" name="enable_auto_cron" <?php echo $config['enable_auto_cron']?'checked="checked"':''; ?>>
  102. <?php echo __('Fetch on auto-cron'); ?>&nbsp;
  103. <i class="help-tip icon-question-sign" href="#enable_autocron_fetch"></i>
  104. </td>
  105. </tr>
  106. <tr>
  107. <td width="180"><?php echo __('Strip Quoted Reply');?>:</td>
  108. <td>
  109. <input type="checkbox" name="strip_quoted_reply" <?php echo $config['strip_quoted_reply'] ? 'checked="checked"':''; ?>>
  110. <?php echo __('Enable'); ?>
  111. <i class="help-tip icon-question-sign" href="#strip_quoted_reply"></i>
  112. &nbsp;<font class="error">&nbsp;<?php echo $errors['strip_quoted_reply']; ?></font>
  113. </td>
  114. </tr>
  115. <tr>
  116. <td width="180"><?php echo __('Reply Separator Tag');?>:</td>
  117. <td><input type="text" name="reply_separator" value="<?php echo $config['reply_separator']; ?>">
  118. &nbsp;<font class="error">&nbsp;<?php echo $errors['reply_separator']; ?></font>&nbsp;<i class="help-tip icon-question-sign" href="#reply_separator_tag"></i>
  119. </td>
  120. </tr>
  121. <tr>
  122. <td width="180"><?php echo __('Emailed Tickets Priority'); ?>:</td>
  123. <td>
  124. <input type="checkbox" name="use_email_priority" value="1" <?php echo $config['use_email_priority'] ?'checked="checked"':''; ?>>
  125. &nbsp;<?php echo __('Enable'); ?>&nbsp;
  126. <i class="help-tip icon-question-sign" href="#emailed_tickets_priority"></i>
  127. </td>
  128. </tr>
  129. <tr>
  130. <td width="180"><?php echo __('Accept All Emails'); ?>:</td>
  131. <td><input type="checkbox" name="accept_unregistered_email" <?php
  132. echo $config['accept_unregistered_email'] ? 'checked="checked"' : ''; ?>/>
  133. <?php echo __('Accept email from unknown Users'); ?>
  134. <i class="help-tip icon-question-sign" href="#accept_all_emails"></i>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td width="180"><?php echo __('Accept Email Collaborators'); ?>:</td>
  139. <td><input type="checkbox" name="add_email_collabs" <?php
  140. echo $config['add_email_collabs'] ? 'checked="checked"' : ''; ?>/>
  141. <?php echo __('Automatically add collaborators from email fields'); ?>&nbsp;
  142. <i class="help-tip icon-question-sign" href="#accept_email_collaborators"></i>
  143. </tr>
  144. <tr><th colspan=2><em><strong><?php echo __('Outgoing Email');?></strong>: <?php echo __('Default email only applies to outgoing emails without SMTP setting.');?></em></th></tr>
  145. <tr><td width="180"><?php echo __('Default MTA'); ?>:</td>
  146. <td>
  147. <select name="default_smtp_id">
  148. <option value=0 selected="selected"><?php echo __('None: Use PHP mail function');?></option>
  149. <?php
  150. $accounts = SmtpAccount::objects()->filter(['active' => 1]);
  151. foreach ($accounts as $account) {
  152. $id = $account->getId();
  153. $email = sprintf('%s &lt;%s&gt;',
  154. $account->email->getName(),
  155. $account->email->getEmail());
  156. ?>
  157. <option value="<?php echo $id; ?>"<?php
  158. echo ($config['default_smtp_id'] == $id) ? 'selected="selected"' : ''; ?>><?php
  159. echo $email; ?></option>
  160. <?php
  161. }
  162. ?>
  163. </select>&nbsp;<font class="error">&nbsp;<?php echo $errors['default_smtp_id']; ?></font>
  164. <i class="help-tip icon-question-sign" href="#default_mta"></i>
  165. </td>
  166. </tr>
  167. <tr>
  168. <td width="180"><?php echo __('Attachments');?>:</td>
  169. <td>
  170. <input type="checkbox" name="email_attachments" <?php echo $config['email_attachments']?'checked="checked"':''; ?>>
  171. <?php echo __('Email attachments to the user'); ?>
  172. <i class="help-tip icon-question-sign" href="#ticket_response_files"></i>
  173. </td>
  174. </tr>
  175. </tbody>
  176. </table>
  177. <p style="text-align:center;">
  178. <input class="button" type="submit" name="submit" value="<?php echo __('Save Changes');?>">
  179. <input class="button" type="reset" name="reset" value="<?php echo __('Reset Changes');?>">
  180. </p>
  181. </form>
  182.  
Advertisement
Add Comment
Please, Sign In to add comment