diff --git a/include/class.config.php b/include/class.config.php index cc9b497682097d0e622dbbd410b0a4f5b0fae601..c43f2e305b405b992916324ce0a3813015cf83f8 100644 --- a/include/class.config.php +++ b/include/class.config.php @@ -19,7 +19,6 @@ require_once(INCLUDE_DIR.'class.email.php'); class Config { var $id=0; - var $mysqltzoffset=0; var $config=array(); var $defaultDept; //Default Department @@ -543,35 +542,32 @@ class Config { return $this->config['upload_dir']; } - function updateSettings($vars,&$errors) { + function updateSettings($vars, &$errors) { if(!$vars || $errors) return false; switch(strtolower($vars['t'])) { - case 'general': - return $this->updateGeneralSetting($vars,$errors); - break; - case 'dates': - return $this->updateDateTimeSetting($vars,$errors); + case 'system': + return $this->updateSystemSettings($vars, $errors); break; case 'tickets': - return $this->updateTicketsSetting($vars,$errors); + return $this->updateTicketsSettings($vars, $errors); break; case 'emails': - return $this->updateEmailsSetting($vars,$errors); + return $this->updateEmailsSettings($vars, $errors); break; case 'attachments': return $this->updateAttachmentsSetting($vars,$errors); break; - case 'autoresponders': - return $this->updateAutoresponderSetting($vars,$errors); + case 'autoresp': + return $this->updateAutoresponderSettings($vars, $errors); break; case 'alerts': - return $this->updateAlertsSetting($vars,$errors); + return $this->updateAlertsSettings($vars, $errors); break; case 'kb': - return $this->updateKBSetting($vars,$errors); + return $this->updateKBSettings($vars, $errors); break; default: $errors['err']='Unknown setting option. Get technical support.'; @@ -580,7 +576,7 @@ class Config { return false; } - function updateGeneralSetting($vars, &$errors) { + function updateSystemSettings($vars, &$errors) { $f=array(); $f['helpdesk_url']=array('type'=>'string', 'required'=>1, 'error'=>'Helpdesk URl required'); @@ -589,6 +585,13 @@ class Config { $f['default_template_id']=array('type'=>'int', 'required'=>1, 'error'=>'You must select template.'); $f['staff_session_timeout']=array('type'=>'int', 'required'=>1, 'error'=>'Enter idle time in minutes'); $f['client_session_timeout']=array('type'=>'int', 'required'=>1, 'error'=>'Enter idle time in minutes'); + //Date & Time Options + $f['time_format']=array('type'=>'string', 'required'=>1, 'error'=>'Time format required'); + $f['date_format']=array('type'=>'string', 'required'=>1, 'error'=>'Date format required'); + $f['datetime_format']=array('type'=>'string', 'required'=>1, 'error'=>'Datetime format required'); + $f['daydatetime_format']=array('type'=>'string', 'required'=>1, 'error'=>'Day, Datetime format required'); + $f['default_timezone_id']=array('type'=>'int', 'required'=>1, 'error'=>'Default Timezone required'); + if(!Validator::process($f, $vars, $errors) || $errors) return false; @@ -610,26 +613,6 @@ class Config { .',client_max_logins='.db_input($vars['client_max_logins']) .',client_login_timeout='.db_input($vars['client_login_timeout']) .',client_session_timeout='.db_input($vars['client_session_timeout']) - .',clickable_urls='.db_input(isset($vars['clickable_urls'])?1:0) - .',enable_auto_cron='.db_input(isset($vars['enable_auto_cron'])?1:0) - .' WHERE id='.db_input($this->getId()); - - return (db_query($sql)); - } - - function updateDateTimeSetting($vars,&$errors) { - - $f=array(); - $f['time_format']=array('type'=>'string', 'required'=>1, 'error'=>'Time format required'); - $f['date_format']=array('type'=>'string', 'required'=>1, 'error'=>'Date format required'); - $f['datetime_format']=array('type'=>'string', 'required'=>1, 'error'=>'Datetime format required'); - $f['daydatetime_format']=array('type'=>'string', 'required'=>1, 'error'=>'Day, Datetime format required'); - $f['default_timezone_id']=array('type'=>'int', 'required'=>1, 'error'=>'Default Timezone required'); - - if(!Validator::process($f,$vars,$errors) || $errors) - return false; - - $sql='UPDATE '.CONFIG_TABLE.' SET updated=NOW() ' .',time_format='.db_input($vars['time_format']) .',date_format='.db_input($vars['date_format']) .',datetime_format='.db_input($vars['datetime_format']) @@ -641,7 +624,7 @@ class Config { return (db_query($sql)); } - function updateTicketsSetting($vars,&$errors) { + function updateTicketsSettings($vars, &$errors) { $f=array(); @@ -658,7 +641,30 @@ class Config { $errors['enable_captcha']='PNG support required for Image Captcha'; } - if(!Validator::process($f,$vars,$errors) || $errors) + if($vars['allow_attachments']) { + + if(!ini_get('file_uploads')) + $errors['err']='The \'file_uploads\' directive is disabled in php.ini'; + + if(!is_numeric($vars['max_file_size'])) + $errors['max_file_size']='Maximum file size required'; + + if(!$vars['allowed_filetypes']) + $errors['allowed_filetypes']='Allowed file extentions required'; + + if(!($maxfileuploads=ini_get('max_file_uploads'))) + $maxfileuploads=DEFAULT_MAX_FILE_UPLOADS; + + if(!$vars['max_user_file_uploads'] || $vars['max_user_file_uploads']>$maxfileuploads) + $errors['max_user_file_uploads']='Invalid selection. Must be less than '.$maxfileuploads; + + if(!$vars['max_staff_file_uploads'] || $vars['max_staff_file_uploads']>$maxfileuploads) + $errors['max_staff_file_uploads']='Invalid selection. Must be less than '.$maxfileuploads; + } + + + + if(!Validator::process($f, $vars, $errors) || $errors) return false; $sql='UPDATE '.CONFIG_TABLE.' SET updated=NOW() ' @@ -676,14 +682,24 @@ class Config { .',show_answered_tickets='.db_input(isset($vars['show_answered_tickets'])?1:0) .',show_related_tickets='.db_input(isset($vars['show_related_tickets'])?1:0) .',show_notes_inline='.db_input(isset($vars['show_notes_inline'])?1:0) + .',clickable_urls='.db_input(isset($vars['clickable_urls'])?1:0) .',hide_staff_name='.db_input(isset($vars['hide_staff_name'])?1:0) + .',allow_attachments='.db_input(isset($vars['allow_attachments'])?1:0) + .',allowed_filetypes='.db_input(strtolower(preg_replace("/\n\r|\r\n|\n|\r/", '',trim($vars['allowed_filetypes'])))) + .',max_file_size='.db_input($vars['max_file_size']) + .',max_user_file_uploads='.db_input($vars['max_user_file_uploads']) + .',max_staff_file_uploads='.db_input($vars['max_staff_file_uploads']) + .',email_attachments='.db_input(isset($vars['email_attachments'])?1:0) + .',allow_email_attachments='.db_input(isset($vars['allow_email_attachments'])?1:0) + .',allow_online_attachments='.db_input(isset($vars['allow_online_attachments'])?1:0) + .',allow_online_attachments_onlogin='.db_input(isset($vars['allow_online_attachments_onlogin'])?1:0) .' WHERE id='.db_input($this->getId()); return (db_query($sql)); } - function updateEmailsSetting($vars,&$errors) { + function updateEmailsSettings($vars, &$errors) { $f=array(); $f['default_email_id']=array('type'=>'int', 'required'=>1, 'error'=>'Default email required'); @@ -704,6 +720,7 @@ class Config { .',alert_email_id='.db_input($vars['alert_email_id']) .',default_smtp_id='.db_input($vars['default_smtp_id']) .',admin_email='.db_input($vars['admin_email']) + .',enable_auto_cron='.db_input(isset($vars['enable_auto_cron'])?1:0) .',enable_mail_polling='.db_input(isset($vars['enable_mail_polling'])?1:0) .',enable_email_piping='.db_input(isset($vars['enable_email_piping'])?1:0) .',strip_quoted_reply='.db_input(isset($vars['strip_quoted_reply'])?1:0) @@ -756,7 +773,7 @@ class Config { return (db_query($sql)); } - function updateAutoresponderSetting($vars,&$errors) { + function updateAutoresponderSettings($vars, &$errors) { if($errors) return false; @@ -771,7 +788,7 @@ class Config { } - function updateKBSetting($vars,&$errors) { + function updateKBSettings($vars, &$errors) { if($errors) return false; @@ -784,7 +801,7 @@ class Config { } - function updateAlertsSetting($vars,&$errors) { + function updateAlertsSettings($vars, &$errors) { if($vars['ticket_alert_active'] diff --git a/include/class.nav.php b/include/class.nav.php index 0d5fddcbf3a48772db052a71363bfe0fb3b64ad5..47534817eb4c26200de9c3afd1cde01400322308 100644 --- a/include/class.nav.php +++ b/include/class.nav.php @@ -43,7 +43,7 @@ class StaffNav { return (!$this->isAdminPanel()); } - function setTabActive($tab){ + function setTabActive($tab, $menu=''){ if($this->tabs[$tab]){ $this->tabs[$tab]['active']=true; @@ -51,6 +51,7 @@ class StaffNav { $this->tabs[$this->activetab]['active']=false; $this->activetab=$tab; + if($menu) $this->setActiveSubMenu($menu, $tab); return true; } @@ -58,16 +59,25 @@ class StaffNav { return false; } - function setActiveTab($tab){ - return $this->setTabActive($tab); + function setActiveTab($tab, $menu=''){ + return $this->setTabActive($tab, $menu); } function getActiveTab(){ return $this->activetab; } - function setActiveSubMenu($mid) { - $this->activeMenu = $mid; + function setActiveSubMenu($mid, $tab='') { + if(is_numeric($mid)) + $this->activeMenu = $mid; + elseif($mid && $tab && ($subNav=$this->getSubNav($tab))) { + foreach($subNav as $k => $menu) { + if(strcasecmp($mid, $menu['href'])) continue; + + $this->activeMenu = $k+1; + break; + } + } } function getActiveMenu() { @@ -162,12 +172,11 @@ class AdminNav extends StaffNav{ if(!$this->tabs){ $tabs=array(); - $tabs['dashboard']=array('desc'=>'Dashboard','href'=>'admin.php','title'=>'Admin Dashboard'); + $tabs['dashboard']=array('desc'=>'Dashboard','href'=>'logs.php','title'=>'Admin Dashboard'); $tabs['settings']=array('desc'=>'Settings','href'=>'settings.php','title'=>'System Settings'); + $tabs['manage']=array('desc'=>'Manage','href'=>'helptopics.php','title'=>'Manage Options'); $tabs['emails']=array('desc'=>'Emails','href'=>'emails.php','title'=>'Email Settings'); - $tabs['topics']=array('desc'=>'Help Topics','href'=>'helptopics.php','title'=>'Help Topics'); - $tabs['staff']=array('desc'=>'Staff','href'=>'staff.php','title'=>'Staff Members'); - $tabs['depts']=array('desc'=>'Departments','href'=>'departments.php','title'=>'Departments'); + $tabs['staff']=array('desc'=>'Staff','href'=>'staff.php','title'=>'Manage Staff'); $this->tabs=$tabs; } @@ -184,37 +193,32 @@ class AdminNav extends StaffNav{ $subnav[]=array('desc'=>'System Logs','href'=>'logs.php','iconclass'=>'logs'); break; case 'settings': - $subnav[]=array('desc'=>'Settings & Preferences','href'=>'settings.php','iconclass'=>'preferences'); + $subnav[]=array('desc'=>'System Preferences','href'=>'settings.php?t=system','iconclass'=>'preferences'); + $subnav[]=array('desc'=>'Tickets','href'=>'settings.php?t=tickets','iconclass'=>'preferences'); + $subnav[]=array('desc'=>'Emails','href'=>'settings.php?t=emails','iconclass'=>'preferences'); + $subnav[]=array('desc'=>'Knowledgebase','href'=>'settings.php?t=kb','iconclass'=>'preferences'); + $subnav[]=array('desc'=>'Autoresponder','href'=>'settings.php?t=autoresp','iconclass'=>'preferences'); + $subnav[]=array('desc'=>'Alerts & Notices','href'=>'settings.php?t=alerts','iconclass'=>'preferences'); + break; + case 'manage': + $subnav[]=array('desc'=>'Help Topics','href'=>'helptopics.php','iconclass'=>'helpTopics'); + $subnav[]=array('desc'=>'Ticket Filters','href'=>'filters.php', + 'title'=>'Ticket Filters','iconclass'=>'emailFilters'); $subnav[]=array('desc'=>'SLA Plans','href'=>'slas.php','iconclass'=>'sla'); $subnav[]=array('desc'=>'API Keys','href'=>'apikeys.php','iconclass'=>'api'); break; case 'emails': - $subnav[]=array('desc'=>'Email Addresses','href'=>'emails.php','iconclass'=>'emailSettings'); - $subnav[]=array('desc'=>'Email Filters','href'=>'filters.php', - 'title'=>'Email Filters','iconclass'=>'emailFilters'); - $subnav[]=array('desc'=>'Email Banlist','href'=>'banlist.php', + $subnav[]=array('desc'=>'Emails','href'=>'emails.php', 'title'=>'Email Addresses', 'iconclass'=>'emailSettings'); + $subnav[]=array('desc'=>'Banlist','href'=>'banlist.php', 'title'=>'Banned Emails','iconclass'=>'emailDiagnostic'); - $subnav[]=array('desc'=>'Email Templates','href'=>'templates.php','title'=>'Email Templates','iconclass'=>'emailTemplates'); - $subnav[]=array('desc'=>'Email Diagnostic','href'=>'emailtest.php','iconclass'=>'emailDiagnostic'); - break; - case 'topics': - $subnav[]=array('desc'=>'Help Topics','href'=>'helptopics.php','iconclass'=>'helpTopics'); - $subnav[]=array('desc'=>'Add New Help Topics', - 'href'=>'helptopics.php?a=add', - 'iconclass'=>'newHelpTopic', - 'droponly'=>true); + $subnav[]=array('desc'=>'Templates','href'=>'templates.php','title'=>'Email Templates','iconclass'=>'emailTemplates'); + $subnav[]=array('desc'=>'Diagnostic','href'=>'emailtest.php', 'title'=>'Email Diagnostic', 'iconclass'=>'emailDiagnostic'); break; case 'staff': $subnav[]=array('desc'=>'Staff Members','href'=>'staff.php','iconclass'=>'users'); $subnav[]=array('desc'=>'Teams','href'=>'teams.php','iconclass'=>'teams'); $subnav[]=array('desc'=>'Groups','href'=>'groups.php','iconclass'=>'groups'); - break; - case 'depts': $subnav[]=array('desc'=>'Departments','href'=>'departments.php','iconclass'=>'departments'); - $subnav[]=array('desc'=>'Add New Department', - 'href'=>'departments.php?a=add', - 'iconclass'=>'newDepartment', - 'droponly'=>true); break; } if($subnav) diff --git a/include/staff/settings-alerts.inc.php b/include/staff/settings-alerts.inc.php index 5bb5d393246ede7266440c30a7e9f5e41df8cc8e..cc91ffdf804fce3dad988a6e11139a1b259d60c8 100644 --- a/include/staff/settings-alerts.inc.php +++ b/include/staff/settings-alerts.inc.php @@ -1,102 +1,177 @@ +<h2>Alerts and Notices</h2> <form action="settings.php?t=alerts" method="post" id="save"> <?php csrf_token(); ?> <input type="hidden" name="t" value="alerts" > <table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> <thead> <tr> - <th colspan="2"> - <h4>Alerts and Notices Setting</h4> - <em>Alerts sent to staff on ticket "events". Staff assignment takes precedence over team assignment.</em> + <th> + <h4>Alerts and Notices sent to staff on ticket "events"</h4> </th> </tr> </thead> <tbody> + <tr><th><em><b>New Ticket Alert</b>: Alert sent out on new tickets</em></th></tr> <tr> - <td width="160">New Ticket Alert:</td> - <td> + <td><em><b>Status:</b></em> <input type="radio" name="ticket_alert_active" value="1" <?php echo $config['ticket_alert_active']?'checked':''; ?> />Enable <input type="radio" name="ticket_alert_active" value="0" <?php echo !$config['ticket_alert_active']?'checked':''; ?> />Disable - <em>Alert sent out on new tickets <font class="error"> <?php echo $errors['ticket_alert_active']; ?></font></em><br> - <strong>Recipients</strong>: - <input type="checkbox" name="ticket_alert_admin" <?php echo $config['ticket_alert_admin']?'checked':''; ?>> Admin Email + <font class="error"> <?php echo $errors['ticket_alert_active']; ?></font></em> + </td> + </tr> + <tr> + <td> + <input type="checkbox" name="ticket_alert_admin" <?php echo $config['ticket_alert_admin']?'checked':''; ?>> Admin Email <em>(<?php echo $cfg->getAdminEmail(); ?>)</em> + </td> + </tr> + <tr> + <td> <input type="checkbox" name="ticket_alert_dept_manager" <?php echo $config['ticket_alert_dept_manager']?'checked':''; ?>> Department Manager - <input type="checkbox" name="ticket_alert_dept_members" <?php echo $config['ticket_alert_dept_members']?'checked':''; ?>> Department Members (spammy) </td> </tr> <tr> - <td width="160">New Message Alert:</td> <td> + <input type="checkbox" name="ticket_alert_dept_members" <?php echo $config['ticket_alert_dept_members']?'checked':''; ?>> Department Members <em>(spammy)</em> + </td> + </tr> + <tr><th><em><b>New Message Alert</b>: Alert sent out when a new message, from the user, is appended to an existing ticket</em></th></tr> + <tr> + <td><em><b>Status:</b></em> <input type="radio" name="message_alert_active" value="1" <?php echo $config['message_alert_active']?'checked':''; ?> />Enable + <input type="radio" name="message_alert_active" value="0" <?php echo !$config['message_alert_active']?'checked':''; ?> />Disable - <em>Alert sent out when a new message is appended to an existing ticket <font class="error"> <?php echo $errors['message_alert_active']; ?></font></em><br> - <strong>Recipients</strong>: + </td> + </tr> + <tr> + <td> <input type="checkbox" name="message_alert_laststaff" <?php echo $config['message_alert_laststaff']?'checked':''; ?>> Last Respondent + </td> + </tr> + <tr> + <td> <input type="checkbox" name="message_alert_assigned" <?php echo $config['message_alert_assigned']?'checked':''; ?>> Assigned Staff - <input type="checkbox" name="message_alert_dept_manager" <?php echo $config['message_alert_dept_manager']?'checked':''; ?>> Department Manager (spammy) </td> </tr> <tr> - <td width="160">New Internal Note Alert:</td> <td> + <input type="checkbox" name="message_alert_dept_manager" <?php echo $config['message_alert_dept_manager']?'checked':''; ?>> Department Manager <em>(spammy)</em> + </td> + </tr> + <tr><th><em><b>New Internal Note Alert</b>: Alert sent out when a new internal note is posted.</em></th></tr> + <tr> + <td><em><b>Status:</b></em> <input type="radio" name="note_alert_active" value="1" <?php echo $config['note_alert_active']?'checked':''; ?> />Enable + <input type="radio" name="note_alert_active" value="0" <?php echo !$config['note_alert_active']?'checked':''; ?> />Disable - <em>Alert sent out when a new internal note is posted <font class="error"> <?php echo $errors['note_alert_active']; ?></font></em><br> - <strong>Recipients</strong>: + <font class="error"> <?php echo $errors['note_alert_active']; ?></font> + </td> + </tr> + <tr> + <td> <input type="checkbox" name="note_alert_laststaff" <?php echo $config['note_alert_laststaff']?'checked':''; ?>> Last Respondent + </td> + </tr> + <tr> + <td> <input type="checkbox" name="note_alert_assigned" <?php echo $config['note_alert_assigned']?'checked':''; ?>> Assigned Staff - <input type="checkbox" name="note_alert_dept_manager" <?php echo $config['note_alert_dept_manager']?'checked':''; ?>> Department Manager (spammy) </td> </tr> <tr> - <td width="160">Ticket Assignment Alert:</td> <td> + <input type="checkbox" name="note_alert_dept_manager" <?php echo $config['note_alert_dept_manager']?'checked':''; ?>> Department Manager <em>(spammy)</em> + </td> + </tr> + <tr><th><em><b>Ticket Assignment Alert</b>: Alert sent out to staff on ticket assignment.</em></th></tr> + <tr> + <td><em><b>Status: </b></em> <input name="assigned_alert_active" value="1" checked="checked" type="radio">Enable + <input name="assigned_alert_active" value="0" type="radio">Disable - <em>Alert sent out to staff on ticket assignment <font class="error"> <?php echo $errors['assigned_alert_active']; ?></font></em><br> - <strong>Recipients</strong>: + <font class="error"> <?php echo $errors['assigned_alert_active']; ?></font> + </td> + </tr> + <tr> + <td> <input type="checkbox" name="assigned_alert_staff" <?php echo $config['assigned_alert_staff']?'checked':''; ?>> Assigned Staff - <input type="checkbox"name="assigned_alert_team_lead" <?php echo $config['assigned_alert_team_lead']?'checked':''; ?>>Team Lead (Team assignment) - <input type="checkbox"name="assigned_alert_team_members" <?php echo $config['assigned_alert_team_members']?'checked':''; ?>> - Team Members (spammy) </td> </tr> <tr> - <td width="160">Ticket Transfer Alert:</td> <td> + <input type="checkbox"name="assigned_alert_team_lead" <?php echo $config['assigned_alert_team_lead']?'checked':''; ?>>Team Lead <em>(On team assignment)</em> + </td> + </tr> + <tr> + <td> + <input type="checkbox"name="assigned_alert_team_members" <?php echo $config['assigned_alert_team_members']?'checked':''; ?>> + Team Members <em>(spammy)</em> + </td> + </tr> + <tr><th><em><b>Ticket Transfer Alert</b>: Alert sent out to staff of the target department on ticket transfer.</em></th></tr> + <tr> + <td><em><b>Status:</b></em> <input type="radio" name="transfer_alert_active" value="1" <?php echo $config['transfer_alert_active']?'checked':''; ?> />Enable <input type="radio" name="transfer_alert_active" value="0" <?php echo !$config['transfer_alert_active']?'checked':''; ?> />Disable - <em>Alert sent out to staff on ticket transfer <font class="error"> -<?php echo $errors['alert_alert_active']; ?></font></em><br> - <strong>Recipients</strong>: + <font class="error"> <?php echo $errors['alert_alert_active']; ?></font> + </td> + </tr> + <tr> + <td> <input type="checkbox" name="transfer_alert_assigned" <?php echo $config['transfer_alert_assigned']?'checked':''; ?>> Assigned Staff/Team + </td> + </tr> + <tr> + <td> <input type="checkbox" name="transfer_alert_dept_manager" <?php echo $config['transfer_alert_dept_manager']?'checked':''; ?>> Department Manager - <input type="checkbox" name="transfer_alert_dept_members" <?php echo $config['transfer_alert_dept_members']?'checked':''; ?>> Department Members - (spammy) </td> </tr> <tr> - <td width="160">Overdue Ticket Alert:</td> <td> + <input type="checkbox" name="transfer_alert_dept_members" <?php echo $config['transfer_alert_dept_members']?'checked':''; ?>> + Department Members <em>(spammy)</em> + </td> + </tr> + <tr><th><em><b>Overdue Ticket Alert</b>: Alert sent out when a ticket becomes overdue - admin email gets an alert by default.</em></th></tr> + <tr> + <td><em><b>Status:</b></em> <input type="radio" name="overdue_alert_active" value="1" <?php echo $config['overdue_alert_active']?'checked':''; ?> />Enable <input type="radio" name="overdue_alert_active" value="0" <?php echo !$config['overdue_alert_active']?'checked':''; ?> />Disable - <em>Alert sent out when a ticket becomes overdue - admin email gets an alert by default. <font class="error"> <?php echo $errors['overdue_alert_active']; ?></font></em><br> - <strong>Recipients</strong>: + <font class="error"> <?php echo $errors['overdue_alert_active']; ?></font> + </td> + </tr> + <tr> + <td> <input type="checkbox" name="overdue_alert_assigned" <?php echo $config['overdue_alert_assigned']?'checked':''; ?>> Assigned Staff/Team + </td> + </tr> + <tr> + <td> <input type="checkbox" name="overdue_alert_dept_manager" <?php echo $config['overdue_alert_dept_manager']?'checked':''; ?>> Department Manager - <input type="checkbox" name="overdue_alert_dept_members" <?php echo $config['overdue_alert_dept_members']?'checked':''; ?>> Department Members (spammy) </td> </tr> <tr> - <td width="160">System Alerts:</td> - <td><em><b>Enabled</b>: Errors are sent to system admin email (<?php echo $cfg->getAdminEmail(); ?>)</em><br> + <td> + <input type="checkbox" name="overdue_alert_dept_members" <?php echo $config['overdue_alert_dept_members']?'checked':''; ?>> Department Members <em>(spammy)</em> + </td> + </tr> + <tr><th><em><b>System Alerts</b>: Enabled by default. Errors are sent to system admin email (<?php echo $cfg->getAdminEmail(); ?>)</em></th></tr> + <tr> + <td> <input type="checkbox" name="send_sys_errors" checked="checked" disabled="disabled">System Errors + </td> + </tr> + <tr> + <td> <input type="checkbox" name="send_sql_errors" <?php echo $config['send_sql_errors']?'checked':''; ?>>SQL errors + </td> + </tr> + <tr> + <td> <input type="checkbox" name="send_login_errors" <?php echo $config['send_login_errors']?'checked':''; ?>>Excessive Login attempts </td> </tr> </tbody> </table> -<p style="padding-left:200px;"> +<p style="padding-left:350px;"> <input class="button" type="submit" name="submit" value="Save Changes"> <input class="button" type="reset" name="reset" value="Reset Changes"> </p> diff --git a/include/staff/settings-attachments.inc.php b/include/staff/settings-attachments.inc.php deleted file mode 100644 index b381fa40d334f9f2c9077f91698c6ec90aa31491..0000000000000000000000000000000000000000 --- a/include/staff/settings-attachments.inc.php +++ /dev/null @@ -1,108 +0,0 @@ -<?php -if(!($maxfileuploads=ini_get('max_file_uploads'))) - $maxfileuploads=DEFAULT_MAX_FILE_UPLOADS; - -?> -<form action="settings.php?t=attachments" method="post" id="save"> -<?php csrf_token(); ?> -<input type="hidden" name="t" value="attachments" > -<table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> - <thead> - <tr> - <th colspan="2"> - <h4>Attachments Settings</h4> - <em> Before enabling attachments make sure you understand PHP file upload settings and security issues related to file upload.</em> - </th> - </tr> - </thead> - <tbody> - <tr> - <td width="180">Allow Attachments:</td> - <td> - <input type="checkbox" name="allow_attachments" <?php echo $config['allow_attachments']?'checked="checked"':''; ?>><b>Allow Attachments</b> - <em>(Global Setting)</em> - <font class="error"> <?php echo $errors['allow_attachments']; ?></font> - </td> - </tr> - <tr> - <td width="180">Emailed Attachments:</td> - <td> - <input type="checkbox" name="allow_email_attachments" <?php echo $config['allow_email_attachments']?'checked="checked"':''; ?>> Accept emailed files - <font class="error"> <?php echo $errors['allow_email_attachments']; ?></font> - </td> - </tr> - <tr> - <td width="180">Online Attachments:</td> - <td> - <input type="checkbox" name="allow_online_attachments" <?php echo $config['allow_online_attachments']?'checked="checked"':''; ?> > - Allow web upload - <input type="checkbox" name="allow_online_attachments_onlogin" <?php echo $config['allow_online_attachments_onlogin'] ?'checked="checked"':''; ?> > - Limit to authenticated users only. <em>(User must be logged in to upload files)</em> - <font class="error"> <?php echo $errors['allow_online_attachments']; ?></font> - </td> - </tr> - <tr> - <td>Max. User File Uploads:</td> - <td> - <select name="max_user_file_uploads"> - <?php - for($i = 1; $i <=$maxfileuploads; $i++) { - ?> - <option <?php echo $config['max_user_file_uploads']==$i?'selected="selected"':''; ?> value="<?php echo $i; ?>"> - <?php echo $i; ?> <?php echo ($i>1)?'files':'file'; ?></option> - <?php - } ?> - </select> - <em>(Number of files the user is allowed to upload simultaneously)</em> - <font class="error"> <?php echo $errors['max_user_file_uploads']; ?></font> - </td> - </tr> - <tr> - <td>Max. Staff File Uploads:</td> - <td> - <select name="max_staff_file_uploads"> - <?php - for($i = 1; $i <=$maxfileuploads; $i++) { - ?> - <option <?php echo $config['max_staff_file_uploads']==$i?'selected="selected"':''; ?> value="<?php echo $i; ?>"> - <?php echo $i; ?> <?php echo ($i>1)?'files':'file'; ?></option> - <?php - } ?> - </select> - <em>(Number of files the staff is allowed to upload simultaneously)</em> - <font class="error"> <?php echo $errors['max_staff_file_uploads']; ?></font> - </td> - </tr> - <tr> - <td width="180">Maximum File Size:</td> - <td> - <input type="text" name="max_file_size" value="<?php echo $config['max_file_size']; ?>"> in bytes. - <em>(Max <?php echo Format::file_size(ini_get('upload_max_filesize')); ?>)</em> - <font class="error"> <?php echo $errors['max_file_size']; ?></font> - </td> - </tr> - <tr> - <td width="180">Ticket Response Files:</td> - <td> - <input type="checkbox" name="email_attachments" <?php echo $config['email_attachments']?'checked="checked"':''; ?> >Email attachments to the user - </td> - </tr> - <tr> - <th colspan="2"> - <em><strong>Accepted File Types</strong>: Limit the type of files users are allowed to upload. - <font class="error"> <?php echo $errors['allowed_filetypes']; ?></font></em> - </th> - </tr> - <tr> - <td colspan="2"> - <em>Enter allowed file extensions separated by a comma. e.g .doc, .pdf. To accept all files enter wildcard <b><i>.*</i></b> i.e dotStar (NOT Recommended).</em><br> - <textarea name="allowed_filetypes" cols="21" rows="4" style="width: 65%;" wrap="hard" ><?php echo $config['allowed_filetypes']; ?></textarea> - </td> - </tr> - </tbody> -</table> -<p style="padding-left:210px;"> - <input class="button" type="submit" name="submit" value="Save Changes"> - <input class="button" type="reset" name="reset" value="Reset Changes"> -</p> -</form> diff --git a/include/staff/settings-autoresponders.inc.php b/include/staff/settings-autoresp.inc.php similarity index 93% rename from include/staff/settings-autoresponders.inc.php rename to include/staff/settings-autoresp.inc.php index 106e7f3f4d7063a6bcb4835cdbd07006b6f16b5c..b5815915fc346bb97fbfa318db9416bda6bfccce 100644 --- a/include/staff/settings-autoresponders.inc.php +++ b/include/staff/settings-autoresp.inc.php @@ -1,6 +1,7 @@ -<form action="settings.php?t=autoresponders" method="post" id="save"> +<h2>Autoresponder Settings</h2> +<form action="settings.php?t=autoresp" method="post" id="save"> <?php csrf_token(); ?> -<input type="hidden" name="t" value="autoresponders" > +<input type="hidden" name="t" value="autoresp" > <table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> <thead> <tr> diff --git a/include/staff/settings-dates.inc.php b/include/staff/settings-dates.inc.php deleted file mode 100644 index f8085cfc3193342bf1bd6c66df87b48d9dcf5edd..0000000000000000000000000000000000000000 --- a/include/staff/settings-dates.inc.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -$gmtime=Misc::gmtime(); -?> -<form action="settings.php?t=dates" method="post" id="save"> -<?php csrf_token(); ?> -<input type="hidden" name="t" value="dates" > -<table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> - <thead> - <tr> - <th colspan="2"> - <h4>Date and Time Options</h4> - <em>Please refer to <a href="http://php.net/date" target="_blank">PHP Manual</a> for supported parameters.</em> - </th> - </tr> - </thead> - <tbody> - <tr><td width="220" class="required">Time Format:</td> - <td> - <input type="text" name="time_format" value="<?php echo $config['time_format']; ?>"> - <font class="error">* <?php echo $errors['time_format']; ?></font> - <em><?php echo Format::date($config['time_format'],$gmtime,$config['timezone_offset'],$config['enable_daylight_saving']); ?></em></td> - </tr> - <tr><td width="220" class="required">Date Format:</td> - <td><input type="text" name="date_format" value="<?php echo $config['date_format']; ?>"> - <font class="error">* <?php echo $errors['date_format']; ?></font> - <em><?php echo Format::date($config['date_format'],$gmtime,$config['timezone_offset'],$config['enable_daylight_saving']); ?></em> - </td> - </tr> - <tr><td width="220" class="required">Date & Time Format:</td> - <td><input type="text" name="datetime_format" value="<?php echo $config['datetime_format']; ?>"> - <font class="error">* <?php echo $errors['datetime_format']; ?></font> - <em><?php echo Format::date($config['datetime_format'],$gmtime,$config['timezone_offset'],$config['enable_daylight_saving']); ?></em> - </td> - </tr> - <tr><td width="220" class="required">Day, Date & Time Format:</td> - <td><input type="text" name="daydatetime_format" value="<?php echo $config['daydatetime_format']; ?>"> - <font class="error">* <?php echo $errors['daydatetime_format']; ?></font> - <em><?php echo Format::date($config['daydatetime_format'],$gmtime,$config['timezone_offset'],$config['enable_daylight_saving']); ?></em> - </td> - </tr> - <tr><td width="220" class="required">Default Time Zone:</td> - <td> - <select name="default_timezone_id"> - <option value="">— Select Default Time Zone —</option> - <?php - $sql='SELECT id, offset,timezone FROM '.TIMEZONE_TABLE.' ORDER BY id'; - if(($res=db_query($sql)) && db_num_rows($res)){ - while(list($id,$offset, $tz)=db_fetch_row($res)){ - $sel=($config['default_timezone_id']==$id)?'selected="selected"':''; - echo sprintf('<option value="%d" %s>GMT %s - %s</option>',$id,$sel,$offset,$tz); - } - } - ?> - </select> - <font class="error">* <?php echo $errors['default_timezone_id']; ?></font> - </td> - </tr> - <tr> - <td width="220">Daylight Saving:</td> - <td> - <input type="checkbox" name="enable_daylight_saving" <?php echo $config['enable_daylight_saving'] ? 'checked="checked"': ''; ?>>Observe daylight savings - </td> - </tr> - </tbody> -</table> -<p style="padding-left:250px;"> - <input class="button" type="submit" name="submit" value="Save Changes"> - <input class="button" type="reset" name="reset" value="Reset Changes"> -</p> -</form> diff --git a/include/staff/settings-emails.inc.php b/include/staff/settings-emails.inc.php index e4ccaf3a4e69329c15d474bfd3f136f9a8fe17f9..f8674095d49cfe25102ef682e64bb9df59e1614a 100644 --- a/include/staff/settings-emails.inc.php +++ b/include/staff/settings-emails.inc.php @@ -1,110 +1,118 @@ -<form action="settings.php?t=emails" method="post" id="save"> +<?php +if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) die('Access Denied'); +?> +<h2>Email Settings and Options</h2> +<form action="settings.php?t=emails" method="post" id="save"> <?php csrf_token(); ?> -<input type="hidden" name="t" value="emails" > -<table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> - <thead> - <tr> - <th colspan="2"> - <h4>Email Settings</h4> - <em>Note that some of the global settings can be overwritten at department/email level.</em> - </th> - </tr> - </thead> - <tbody> - <tr> - <td width="180" class="required">Default System Email:</td> - <td> - <select name="default_email_id"> - <option value=0 disabled>Select One</option> +<input type="hidden" name="t" value="emails" > +<table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> + <thead> + <tr> + <th colspan="2"> + <h4>Email Settings</h4> + <em>Note that some of the global settings can be overwritten at department/email level.</em> + </th> + </tr> + </thead> + <tbody> + <tr> + <td width="180" class="required">Default System Email:</td> + <td> + <select name="default_email_id"> + <option value=0 disabled>Select One</option> <?php - $sql='SELECT email_id,email,name FROM '.EMAIL_TABLE; - if(($res=db_query($sql)) && db_num_rows($res)){ - while (list($id,$email,$name) = db_fetch_row($res)){ - $email=$name?"$name <$email>":$email; - ?> - <option value="<?php echo $id; ?>"<?php echo ($config['default_email_id']==$id)?'selected="selected"':''; ?>><?php echo $email; ?></option> + $sql='SELECT email_id,email,name FROM '.EMAIL_TABLE; + if(($res=db_query($sql)) && db_num_rows($res)){ + while (list($id,$email,$name) = db_fetch_row($res)){ + $email=$name?"$name <$email>":$email; + ?> + <option value="<?php echo $id; ?>"<?php echo ($config['default_email_id']==$id)?'selected="selected"':''; ?>><?php echo $email; ?></option> <?php - } - } ?> - </select> - <font class="error">* <?php echo $errors['default_email_id']; ?></font> - </td> - </tr> - <tr> - <td width="180" class="required">Default Alert Email:</td> - <td> - <select name="alert_email_id"> - <option value="0" selected="selected">Use Default System Email (above)</option> + } + } ?> + </select> + <font class="error">* <?php echo $errors['default_email_id']; ?></font> + </td> + </tr> + <tr> + <td width="180" class="required">Default Alert Email:</td> + <td> + <select name="alert_email_id"> + <option value="0" selected="selected">Use Default System Email (above)</option> <?php - $sql='SELECT email_id,email,name FROM '.EMAIL_TABLE.' WHERE email_id != '.db_input($config['default_email_id']); - if(($res=db_query($sql)) && db_num_rows($res)){ - while (list($id,$email,$name) = db_fetch_row($res)){ - $email=$name?"$name <$email>":$email; - ?> - <option value="<?php echo $id; ?>"<?php echo ($config['alert_email_id']==$id)?'selected="selected"':''; ?>><?php echo $email; ?></option> + $sql='SELECT email_id,email,name FROM '.EMAIL_TABLE.' WHERE email_id != '.db_input($config['default_email_id']); + if(($res=db_query($sql)) && db_num_rows($res)){ + while (list($id,$email,$name) = db_fetch_row($res)){ + $email=$name?"$name <$email>":$email; + ?> + <option value="<?php echo $id; ?>"<?php echo ($config['alert_email_id']==$id)?'selected="selected"':''; ?>><?php echo $email; ?></option> <?php - } - } ?> - </select> - <font class="error">* <?php echo $errors['alert_email_id']; ?></font> - </td> - </tr> - <tr> - <td width="180" class="required">Admin Email Address:</td> - <td> - <input type="text" size=40 name="admin_email" value="<?php echo $config['admin_email']; ?>"> - <font class="error">* <?php echo $errors['admin_email']; ?></font></td> - </tr> - <tr><th colspan=2><em><strong>Incoming Emails</strong>: For mail fetcher (POP/IMAP) to work you must set a cron job or enable auto-cron</em></th> - <tr> - <td width="180">Email Polling:</td> - <td><input type="checkbox" name="enable_mail_polling" value=1 <?php echo $config['enable_mail_polling']? 'checked="checked"': ''; ?> > Enable POP/IMAP - <em>(Global setting which can be disabled at email level)</em> - </td> - </tr> - <tr> - <td width="180">Email Piping:</td> - <td><input type="checkbox" name="enable_email_piping" value=1 <?php echo $config['enable_email_piping']? 'checked="checked"': ''; ?>> Enable email piping - <em>(You pipe we accept policy)</em> - </td> - </tr> - <tr> - <td width="180">Strip Quoted Reply:</td> - <td> - <input type="checkbox" name="strip_quoted_reply" <?php echo $config['strip_quoted_reply'] ? 'checked="checked"':''; ?>> - <em>(depends on the reply separator tag set below)</em> - <font class="error"> <?php echo $errors['strip_quoted_reply']; ?></font> - </td> - </tr> - <tr> - <td width="180">Reply Separator Tag:</td> - <td><input type="text" name="reply_separator" value="<?php echo $config['reply_separator']; ?>"> - <font class="error"> <?php echo $errors['reply_separator']; ?></font> - </td> - </tr> - <tr><th colspan=2><em><strong>Outgoing Emails</strong>: Default email only applies to outgoing emails without SMTP setting.</em></th></tr> - <tr><td width="180">Default Outgoing Email:</td> - <td> - <select name="default_smtp_id"> - <option value=0 selected="selected">None: Use PHP mail function</option> + } + } ?> + </select> + <font class="error">* <?php echo $errors['alert_email_id']; ?></font> + </td> + </tr> + <tr> + <td width="180" class="required">Admin's Email Address:</td> + <td> + <input type="text" size=40 name="admin_email" value="<?php echo $config['admin_email']; ?>"> + <font class="error">* <?php echo $errors['admin_email']; ?></font> + <em>(System administrator's email)</em> + </td> + </tr> + <tr><th colspan=2><em><strong>Incoming Emails</strong>: For mail fetcher (polling) to work you must set an external cron job or enable auto-cron</em></th> + <tr> + <td width="180">Email Polling:</td> + <td><input type="checkbox" name="enable_mail_polling" value=1 <?php echo $config['enable_mail_polling']? 'checked="checked"': ''; ?> > Enable POP/IMAP polling + + <input type="checkbox" name="enable_auto_cron" <?php echo $config['enable_auto_cron']?'checked="checked"':''; ?>> + Enable Auto-Cron <em>(Poll based on staff activity - NOT recommended)</em> + </td> + </tr> + <tr> + <td width="180">Email Piping:</td> + <td><input type="checkbox" name="enable_email_piping" value=1 <?php echo $config['enable_email_piping']? 'checked="checked"': ''; ?>> Enable email piping + <em>(You pipe we accept policy)</em> + </td> + </tr> + <tr> + <td width="180">Strip Quoted Reply:</td> + <td> + <input type="checkbox" name="strip_quoted_reply" <?php echo $config['strip_quoted_reply'] ? 'checked="checked"':''; ?>> + <em>(depends on the reply separator tag set below)</em> + <font class="error"> <?php echo $errors['strip_quoted_reply']; ?></font> + </td> + </tr> + <tr> + <td width="180">Reply Separator Tag:</td> + <td><input type="text" name="reply_separator" value="<?php echo $config['reply_separator']; ?>"> + <font class="error"> <?php echo $errors['reply_separator']; ?></font> + </td> + </tr> + <tr><th colspan=2><em><strong>Outgoing Emails</strong>: Default email only applies to outgoing emails without SMTP setting.</em></th></tr> + <tr><td width="180">Default Outgoing Email:</td> + <td> + <select name="default_smtp_id"> + <option value=0 selected="selected">None: Use PHP mail function</option> <?php - $sql='SELECT email_id,email,name,smtp_host FROM '.EMAIL_TABLE.' WHERE smtp_active=1'; - - if(($res=db_query($sql)) && db_num_rows($res)) { - while (list($id,$email,$name,$host) = db_fetch_row($res)){ - $email=$name?"$name <$email>":$email; - ?> - <option value="<?php echo $id; ?>"<?php echo ($config['default_smtp_id']==$id)?'selected="selected"':''; ?>><?php echo $email; ?></option> + $sql='SELECT email_id,email,name,smtp_host FROM '.EMAIL_TABLE.' WHERE smtp_active=1'; + + if(($res=db_query($sql)) && db_num_rows($res)) { + while (list($id,$email,$name,$host) = db_fetch_row($res)){ + $email=$name?"$name <$email>":$email; + ?> + <option value="<?php echo $id; ?>"<?php echo ($config['default_smtp_id']==$id)?'selected="selected"':''; ?>><?php echo $email; ?></option> <?php - } - } ?> - </select> <font class="error"> <?php echo $errors['default_smtp_id']; ?></font> - </td> - </tr> - </tbody> -</table> -<p style="padding-left:250px;"> - <input class="button" type="submit" name="submit" value="Save Changes"> - <input class="button" type="reset" name="reset" value="Reset Changes"> -</p> -</form> + } + } ?> + </select> <font class="error"> <?php echo $errors['default_smtp_id']; ?></font> + </td> + </tr> + </tbody> +</table> +<p style="padding-left:250px;"> + <input class="button" type="submit" name="submit" value="Save Changes"> + <input class="button" type="reset" name="reset" value="Reset Changes"> +</p> +</form> diff --git a/include/staff/settings-kb.inc.php b/include/staff/settings-kb.inc.php index 6fe8433f5ee580c5a201a42518652106af63d313..0ab2ec09449a07f8f7efa78f8602683534b7666a 100644 --- a/include/staff/settings-kb.inc.php +++ b/include/staff/settings-kb.inc.php @@ -1,3 +1,7 @@ +<?php +if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) die('Access Denied'); +?> +<h2>Knowledge Base Settings and Options</h2> <form action="settings.php?t=kb" method="post" id="save"> <?php csrf_token(); ?> <input type="hidden" name="t" value="kb" > @@ -5,25 +9,25 @@ <thead> <tr> <th colspan="2"> - <h4>Knowledgebase Settings</h4> - <em>Disabling knowledgebase disables user's knowledgebase interface.</em> + <h4>Knowledge Base Settings</h4> + <em>Disabling knowledge base disables clients'interface.</em> </th> </tr> </thead> <tbody> <tr> - <td width="180">Knowledgebase Status:</td> + <td width="180">Knowledge base status:</td> <td> <input type="checkbox" name="enable_kb" value="1" <?php echo $config['enable_kb']?'checked="checked"':''; ?>> - Enable Knowledgebase <em>(Client Interface)</em> + Enable Knowledge base <em>(Client interface)</em> <font class="error"> <?php echo $errors['enable_kb']; ?></font> </td> </tr> <tr> - <td width="180">Premade Responses:</td> + <td width="180">Canned Responses:</td> <td> <input type="checkbox" name="enable_premade" value="1" <?php echo $config['enable_premade']?'checked="checked"':''; ?> > - Enable premade/canned responses <em>(Available on ticket reply)</em> + Enable canned responses <em>(Available on ticket reply)</em> <font class="error"> <?php echo $errors['enable_premade']; ?></font> </td> </tr> diff --git a/include/staff/settings-general.inc.php b/include/staff/settings-system.inc.php similarity index 70% rename from include/staff/settings-general.inc.php rename to include/staff/settings-system.inc.php index 20bbd94866960d2e06ae4d3451825d5752c853ac..1bc9b3ee4daf79688164593ca59daab8a1bb0ebc 100644 --- a/include/staff/settings-general.inc.php +++ b/include/staff/settings-system.inc.php @@ -1,12 +1,18 @@ -<form action="settings.php?t=general" method="post" id="save"> +<?php +if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) die('Access Denied'); + +$gmtime = Misc::gmtime(); +?> +<h2>System Settings and Preferences - <span>osTicket (v<?php echo $cfg->getVersion(); ?>)</span></h2> +<form action="settings.php?t=system" method="post" id="save"> <?php csrf_token(); ?> -<input type="hidden" name="t" value="general" > +<input type="hidden" name="t" value="system" > <table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> <thead> <tr> <th colspan="2"> - <h4>General Settings</h4> - <em>Offline mode will disable client interface and only allow admins to login to Staff Control Panel</em> + <h4>System Settings & Preferences</h4> + <em><b>General Settings</b>: Offline mode will disable client interface and only allow admins to login to Staff Control Panel</em> </th> </tr> </thead> @@ -120,6 +126,12 @@ <font class="error"> <?php echo $errors['passwd_reset_period']; ?></font> </td> </tr> + <tr><td>Bind Staff Session to IP:</td> + <td> + <input type="checkbox" name="staff_ip_binding" <?php echo $config['staff_ip_binding']?'checked="checked"':''; ?>> + <em>(binds staff session to originating IP address upon login)</em> + </td> + </tr> <tr><td>Staff Excessive Logins:</td> <td> <select name="staff_max_logins"> @@ -144,12 +156,6 @@ Maximum idle time in minutes before a staff member must log in again (enter 0 to disable). </td> </tr> - <tr><td>Bind Staff Session to IP:</td> - <td> - <input type="checkbox" name="staff_ip_binding" <?php echo $config['staff_ip_binding']?'checked="checked"':''; ?>> - <em>(binds staff session to originating IP address upon login)</em> - </td> - </tr> <tr><td>Client Excessive Logins:</td> <td> <select name="client_max_logins"> @@ -176,16 +182,56 @@ Maximum idle time in minutes before a client must log in again (enter 0 to disable). </td> </tr> - <tr><td>Clickable URLs:</td> + <tr> + <th colspan="2"> + <em><b>Date and Time Options</b>: Please refer to <a href="http://php.net/date" target="_blank">PHP Manual</a> for supported parameters.</em> + </th> + </tr> + <tr><td width="220" class="required">Time Format:</td> + <td> + <input type="text" name="time_format" value="<?php echo $config['time_format']; ?>"> + <font class="error">* <?php echo $errors['time_format']; ?></font> + <em><?php echo Format::date($config['time_format'],$gmtime,$config['timezone_offset'],$config['enable_daylight_saving']); ?></em></td> + </tr> + <tr><td width="220" class="required">Date Format:</td> + <td><input type="text" name="date_format" value="<?php echo $config['date_format']; ?>"> + <font class="error">* <?php echo $errors['date_format']; ?></font> + <em><?php echo Format::date($config['date_format'],$gmtime,$config['timezone_offset'],$config['enable_daylight_saving']); ?></em> + </td> + </tr> + <tr><td width="220" class="required">Date & Time Format:</td> + <td><input type="text" name="datetime_format" value="<?php echo $config['datetime_format']; ?>"> + <font class="error">* <?php echo $errors['datetime_format']; ?></font> + <em><?php echo Format::date($config['datetime_format'],$gmtime,$config['timezone_offset'],$config['enable_daylight_saving']); ?></em> + </td> + </tr> + <tr><td width="220" class="required">Day, Date & Time Format:</td> + <td><input type="text" name="daydatetime_format" value="<?php echo $config['daydatetime_format']; ?>"> + <font class="error">* <?php echo $errors['daydatetime_format']; ?></font> + <em><?php echo Format::date($config['daydatetime_format'],$gmtime,$config['timezone_offset'],$config['enable_daylight_saving']); ?></em> + </td> + </tr> + <tr><td width="220" class="required">Default Time Zone:</td> <td> - <input type="checkbox" name="clickable_urls" <?php echo $config['clickable_urls']?'checked="checked"':''; ?>> - <em>(converts URLs in messages to clickable links)</em> + <select name="default_timezone_id"> + <option value="">— Select Default Time Zone —</option> + <?php + $sql='SELECT id, offset,timezone FROM '.TIMEZONE_TABLE.' ORDER BY id'; + if(($res=db_query($sql)) && db_num_rows($res)){ + while(list($id,$offset, $tz)=db_fetch_row($res)){ + $sel=($config['default_timezone_id']==$id)?'selected="selected"':''; + echo sprintf('<option value="%d" %s>GMT %s - %s</option>',$id,$sel,$offset,$tz); + } + } + ?> + </select> + <font class="error">* <?php echo $errors['default_timezone_id']; ?></font> </td> </tr> - <tr><td>Enable Auto Cron:</td> + <tr> + <td width="220">Daylight Saving:</td> <td> - <input type="checkbox" name="enable_auto_cron" <?php echo $config['enable_auto_cron']?'checked="checked"':''; ?>> - <em>(executes cron jobs based on staff activity - not recommended)</em> + <input type="checkbox" name="enable_daylight_saving" <?php echo $config['enable_daylight_saving'] ? 'checked="checked"': ''; ?>>Observe daylight savings </td> </tr> </tbody> @@ -195,4 +241,3 @@ <input class="button" type="reset" name="reset" value="Reset Changes"> </p> </form> - diff --git a/include/staff/settings-tickets.inc.php b/include/staff/settings-tickets.inc.php index 280abca08ea44d698e0a41b56b1d8d0a62cd1693..992e9900425c19d708f7cb35d75a59f7b18c36bf 100644 --- a/include/staff/settings-tickets.inc.php +++ b/include/staff/settings-tickets.inc.php @@ -1,3 +1,9 @@ +<?php +if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) die('Access Denied'); +if(!($maxfileuploads=ini_get('max_file_uploads'))) + $maxfileuploads=DEFAULT_MAX_FILE_UPLOADS; +?> +<h2>Ticket Settings and Options</h2> <form action="settings.php?t=tickets" method="post" id="save"> <?php csrf_token(); ?> <input type="hidden" name="t" value="tickets" > @@ -5,7 +11,7 @@ <thead> <tr> <th colspan="2"> - <h4>Ticket Settings and Options</h4> + <h4>Ticket Settings</h4> <em>Global ticket settings and options.</em> </th> </tr> @@ -55,53 +61,59 @@ </td> </tr> <tr> - <td width="180">Web Tickets Priority</td> + <td>Maximum <b>Open</b> Tickets:</td> <td> - <input type="checkbox" name="allow_priority_change" value="1" <?php echo $config['allow_priority_change'] ?'checked="checked"':''; ?>> - <em>(Allow user to overwrite/set priority)</em> + <input type="text" name="max_open_tickets" size=4 value="<?php echo $config['max_open_tickets']; ?>"> + per email/user. <em>(Helps with spam and email flood control - enter 0 for unlimited)</em> </td> </tr> <tr> - <td width="180">Emailed Tickets Priority</td> + <td>Ticket Auto-lock Time:</td> <td> - <input type="checkbox" name="use_email_priority" value="1" <?php echo $config['use_email_priority'] ?'checked="checked"':''; ?> > - <em>(Use email priority when available)</em> + <input type="text" name="autolock_minutes" size=4 value="<?php echo $config['autolock_minutes']; ?>"> + <font class="error"><?php echo $errors['autolock_minutes']; ?></font> + <em>(Minutes to lock a ticket on activity - enter 0 to disable locking)</em> + </td> + </tr> + <tr> + <td width="180">Web Tickets Priority:</td> + <td> + <input type="checkbox" name="allow_priority_change" value="1" <?php echo $config['allow_priority_change'] ?'checked="checked"':''; ?>> + <em>(Allow user to overwrite/set priority)</em> + </td> + </tr> + <tr> + <td width="180">Emailed Tickets Priority:</td> + <td> + <input type="checkbox" name="use_email_priority" value="1" <?php echo $config['use_email_priority'] ?'checked="checked"':''; ?> > + <em>(Use email priority when available)</em> </td> </tr> <tr> - <td width="180">Show Related Tickets</td> + <td width="180">Show Related Tickets:</td> <td> <input type="checkbox" name="show_related_tickets" value="1" <?php echo $config['show_related_tickets'] ?'checked="checked"':''; ?> > <em>(Show all related tickets on user login - otherwise access is restricted to one ticket view per login)</em> </td> </tr> <tr> - <td width="180">Show Notes Inline</td> + <td width="180">Show Notes Inline:</td> <td> <input type="checkbox" name="show_notes_inline" value="1" <?php echo $config['show_notes_inline'] ?'checked="checked"':''; ?> > <em>(Show internal notes inline)</em> </td> - </tr> - <tr> - <td>Human Verification:</td> - <td> - <input type="checkbox" name="enable_captcha" <?php echo $config['enable_captcha']?'checked="checked"':''; ?>> - Enable CAPTCHA on new web tickets.<em>(requires GDLib)</em> <font class="error"> <?php echo $errors['enable_captcha']; ?></font><br/> - </td> </tr> - <tr> - <td>Maximum <b>Open</b> Tickets:</td> + <tr><td>Clickable URLs:</td> <td> - <input type="text" name="max_open_tickets" size=4 value="<?php echo $config['max_open_tickets']; ?>"> - per email/user. <em>(Helps with spam and email flood control - enter 0 for unlimited)</em> + <input type="checkbox" name="clickable_urls" <?php echo $config['clickable_urls']?'checked="checked"':''; ?>> + <em>(converts URLs in ticket thread to clickable links)</em> </td> </tr> <tr> - <td>Ticket Auto-lock Time:</td> + <td>Human Verification:</td> <td> - <input type="text" name="autolock_minutes" size=4 value="<?php echo $config['autolock_minutes']; ?>"> - <font class="error"><?php echo $errors['autolock_minutes']; ?></font> - <em>(Minutes to lock a ticket on activity - enter 0 to disable locking)</em> + <input type="checkbox" name="enable_captcha" <?php echo $config['enable_captcha']?'checked="checked"':''; ?>> + Enable CAPTCHA on new web tickets.<em>(requires GDLib)</em> <font class="error"> <?php echo $errors['enable_captcha']; ?></font><br/> </td> </tr> <tr> @@ -139,6 +151,94 @@ Hide staff's name on responses. </td> </tr> + <tr> + <th colspan="2"> + <em><b>Attachments</b>: Size setting mainly apply to web tickets.</em> + </th> + </tr> + <tr> + <td width="180">Allow Attachments:</td> + <td> + <input type="checkbox" name="allow_attachments" <?php echo $config['allow_attachments']?'checked="checked"':''; ?>><b>Allow Attachments</b> + <em>(Global Setting)</em> + <font class="error"> <?php echo $errors['allow_attachments']; ?></font> + </td> + </tr> + <tr> + <td width="180">Emailed Attachments:</td> + <td> + <input type="checkbox" name="allow_email_attachments" <?php echo $config['allow_email_attachments']?'checked="checked"':''; ?>> Accept emailed files + <font class="error"> <?php echo $errors['allow_email_attachments']; ?></font> + </td> + </tr> + <tr> + <td width="180">Online Attachments:</td> + <td> + <input type="checkbox" name="allow_online_attachments" <?php echo $config['allow_online_attachments']?'checked="checked"':''; ?> > + Allow web upload + <input type="checkbox" name="allow_online_attachments_onlogin" <?php echo $config['allow_online_attachments_onlogin'] ?'checked="checked"':''; ?> > + Limit to authenticated users only. <em>(User must be logged in to upload files)</em> + <font class="error"> <?php echo $errors['allow_online_attachments']; ?></font> + </td> + </tr> + <tr> + <td>Max. User File Uploads:</td> + <td> + <select name="max_user_file_uploads"> + <?php + for($i = 1; $i <=$maxfileuploads; $i++) { + ?> + <option <?php echo $config['max_user_file_uploads']==$i?'selected="selected"':''; ?> value="<?php echo $i; ?>"> + <?php echo $i; ?> <?php echo ($i>1)?'files':'file'; ?></option> + <?php + } ?> + </select> + <em>(Number of files the user is allowed to upload simultaneously)</em> + <font class="error"> <?php echo $errors['max_user_file_uploads']; ?></font> + </td> + </tr> + <tr> + <td>Max. Staff File Uploads:</td> + <td> + <select name="max_staff_file_uploads"> + <?php + for($i = 1; $i <=$maxfileuploads; $i++) { + ?> + <option <?php echo $config['max_staff_file_uploads']==$i?'selected="selected"':''; ?> value="<?php echo $i; ?>"> + <?php echo $i; ?> <?php echo ($i>1)?'files':'file'; ?></option> + <?php + } ?> + </select> + <em>(Number of files the staff is allowed to upload simultaneously)</em> + <font class="error"> <?php echo $errors['max_staff_file_uploads']; ?></font> + </td> + </tr> + <tr> + <td width="180">Maximum File Size:</td> + <td> + <input type="text" name="max_file_size" value="<?php echo $config['max_file_size']; ?>"> in bytes. + <em>(System Max. <?php echo Format::file_size(ini_get('upload_max_filesize')); ?>)</em> + <font class="error"> <?php echo $errors['max_file_size']; ?></font> + </td> + </tr> + <tr> + <td width="180">Ticket Response Files:</td> + <td> + <input type="checkbox" name="email_attachments" <?php echo $config['email_attachments']?'checked="checked"':''; ?> >Email attachments to the user + </td> + </tr> + <tr> + <th colspan="2"> + <em><strong>Accepted File Types</strong>: Limit the type of files users are allowed to submit. + <font class="error"> <?php echo $errors['allowed_filetypes']; ?></font></em> + </th> + </tr> + <tr> + <td colspan="2"> + <em>Enter allowed file extensions separated by a comma. e.g .doc, .pdf. To accept all files enter wildcard <b><i>.*</i></b> i.e dotStar (NOT Recommended).</em><br> + <textarea name="allowed_filetypes" cols="21" rows="4" style="width: 65%;" wrap="hard" ><?php echo $config['allowed_filetypes']; ?></textarea> + </td> + </tr> </tbody> </table> <p style="padding-left:250px;"> diff --git a/scp/apikeys.php b/scp/apikeys.php index e393a31c5f2bea0647a238240ba5e9021ad3c9ab..1e17675442066356a077041f03357fa0c3913414 100644 --- a/scp/apikeys.php +++ b/scp/apikeys.php @@ -96,7 +96,7 @@ $page='apikeys.inc.php'; if($api || ($_REQUEST['a'] && !strcasecmp($_REQUEST['a'],'add'))) $page='apikey.inc.php'; -$nav->setTabActive('settings'); +$nav->setTabActive('manage'); require(STAFFINC_DIR.'header.inc.php'); require(STAFFINC_DIR.$page); include(STAFFINC_DIR.'footer.inc.php'); diff --git a/scp/departments.php b/scp/departments.php index ef1acb12d62adcaa3c6285a210e7aa9d3f57fc29..31fc4c6df5602f5959d9f4585517a8ebf04fc008 100644 --- a/scp/departments.php +++ b/scp/departments.php @@ -104,7 +104,7 @@ $page='departments.inc.php'; if($dept || ($_REQUEST['a'] && !strcasecmp($_REQUEST['a'],'add'))) $page='department.inc.php'; -$nav->setTabActive('depts'); +$nav->setTabActive('staff'); require(STAFFINC_DIR.'header.inc.php'); require(STAFFINC_DIR.$page); include(STAFFINC_DIR.'footer.inc.php'); diff --git a/scp/filters.php b/scp/filters.php index 4ce0f30765f5192617f22345c00571f26d206af2..2fe1f9fb7c06f9848f958d1e2e8b6ebe62b17390 100644 --- a/scp/filters.php +++ b/scp/filters.php @@ -100,7 +100,7 @@ $page='filters.inc.php'; if($filter || ($_REQUEST['a'] && !strcasecmp($_REQUEST['a'],'add'))) $page='filter.inc.php'; -$nav->setTabActive('emails'); +$nav->setTabActive('manage'); require(STAFFINC_DIR.'header.inc.php'); require(STAFFINC_DIR.$page); include(STAFFINC_DIR.'footer.inc.php'); diff --git a/scp/helptopics.php b/scp/helptopics.php index 5bd1ded7048f26307f2cd18d09d6b3a946f13f65..37e865b22057483bc87595023ad92ce9be1bb306 100644 --- a/scp/helptopics.php +++ b/scp/helptopics.php @@ -96,7 +96,7 @@ $page='helptopics.inc.php'; if($topic || ($_REQUEST['a'] && !strcasecmp($_REQUEST['a'],'add'))) $page='helptopic.inc.php'; -$nav->setTabActive('topics'); +$nav->setTabActive('manage'); require(STAFFINC_DIR.'header.inc.php'); require(STAFFINC_DIR.$page); include(STAFFINC_DIR.'footer.inc.php'); diff --git a/scp/settings.php b/scp/settings.php index 9058fe42ca52c4f9b428bbc52f2ed2cb61f80a8a..0a3f97a912d8fdf6d92dc42ddf035f36bc61b12f 100644 --- a/scp/settings.php +++ b/scp/settings.php @@ -15,49 +15,28 @@ **********************************************************************/ require('admin.inc.php'); $errors=array(); -$SettingOptions=array('general'=>'General Settings', - 'dates'=>'Date and Time Options', - 'tickets'=>'Ticket Settings and Options', - 'emails'=>'Email Settings', - 'attachments'=>'Attachments Settings', - 'kb'=>'Knowledgebase Settings', - 'autoresponders'=>'Autoresponder Settings', - 'alerts'=>'Alerts and Notices Settings'); - +$settingOptions=array( + 'system' => 'System Settings', + 'tickets' => 'Ticket Settings and Options', + 'emails' => 'Email Settings', + 'kb' => 'Knowledgebase Settings', + 'autoresp' => 'Autoresponder Settings', + 'alerts' => 'Alerts and Notices Settings'); //Handle a POST. -if($_POST && !$errors){ - $errors=array(); - if($cfg && $cfg->updateSettings($_POST,$errors)){ - $msg=Format::htmlchars($SettingOptions[$_POST['t']]).' Updated Successfully'; +if($_POST && !$errors) { + if($cfg && $cfg->updateSettings($_POST,$errors)) { + $msg=Format::htmlchars($settingOptions[$_POST['t']]).' Updated Successfully'; $cfg->reload(); - }elseif(!$errors['err']){ - $errors['err']='Unable to update system settings - correct any errors below and try again'; + } elseif(!$errors['err']) { + $errors['err']='Unable to update settings - correct errors below and try again'; } } -$target=($_REQUEST['t'] && $SettingOptions[$_REQUEST['t']])?$_REQUEST['t']:'general'; - -$nav->setTabActive('settings'); -require(STAFFINC_DIR.'header.inc.php'); -?> -<h2>System Preferences and Settings - <span>osTicket (v<?php echo $cfg->getVersion(); ?>)</span></h2> -<div style="padding-top:10px;padding-bottom:5px;"> - <form method="get" action="settings.php"> - Setting Option: - <select id="setting_options" name="t" style="width:300px;"> - <option value="">— Select Setting Group —</option> - <?php - foreach($SettingOptions as $k=>$v) { - $sel=($target==$k)?'selected="selected"':''; - echo sprintf('<option value="%s" %s>%s</option>',$k,$sel,$v); - } - ?> - </select> - <input type="submit" value="Go"> - </form> -</div> -<?php +$target=($_REQUEST['t'] && $settingOptions[$_REQUEST['t']])?$_REQUEST['t']:'system'; $config=($errors && $_POST)?Format::input($_POST):Format::htmlchars($cfg->getConfigInfo()); + +$nav->setTabActive('settings', ('settings.php?t='.$target)); +require_once(STAFFINC_DIR.'header.inc.php'); include_once(STAFFINC_DIR."settings-$target.inc.php"); include_once(STAFFINC_DIR.'footer.inc.php'); ?> diff --git a/scp/slas.php b/scp/slas.php index 8f3b0f75ca331381beb6a348f46c2a703853b229..8dd5b86c90b33b6cf2e88558f9ac679f63af77be 100644 --- a/scp/slas.php +++ b/scp/slas.php @@ -96,7 +96,7 @@ $page='slaplans.inc.php'; if($sla || ($_REQUEST['a'] && !strcasecmp($_REQUEST['a'],'add'))) $page='slaplan.inc.php'; -$nav->setTabActive('settings'); +$nav->setTabActive('manage'); require(STAFFINC_DIR.'header.inc.php'); require(STAFFINC_DIR.$page); include(STAFFINC_DIR.'footer.inc.php');