diff --git a/include/staff/apikey.inc.php b/include/staff/apikey.inc.php index 827c45871755e9b934e3562dac78c84ac5461639..f88a4ae0e3e73456a927f0c0ef6b9aad368c9cf9 100644 --- a/include/staff/apikey.inc.php +++ b/include/staff/apikey.inc.php @@ -23,6 +23,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>"> <input type="hidden" name="id" value="<?php echo $info['id']; ?>"> <h2><?php echo $title; ?> + <?php if (isset($info['ipaddr'])) { ?><small> + — <?php echo $info['ipaddr']; ?></small> + <?php } ?> <i class="help-tip icon-question-sign" href="#api_key"></i> </h2> <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2"> @@ -100,7 +103,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); </tr> <tr> <th colspan="2"> - <em><strong><?php echo __('Admin Notes');?></strong>: <?php echo __('Internal notes.');?> </em> + <em><strong><?php echo __('Internal Notes');?></strong>: <?php echo __("be liberal, they're internal");?></em> </th> </tr> <tr> diff --git a/include/staff/cannedresponse.inc.php b/include/staff/cannedresponse.inc.php index 72fa3c504ee48a077d315bade484176e2c546cf2..0dabac6fd3319fd5dca169521e47da16f7693bb6 100644 --- a/include/staff/cannedresponse.inc.php +++ b/include/staff/cannedresponse.inc.php @@ -26,14 +26,16 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <input type="hidden" name="do" value="<?php echo $action; ?>"> <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>"> <input type="hidden" name="id" value="<?php echo $info['id']; ?>"> - <h2><?php echo __('Canned Response')?> - <i class="help-tip icon-question-sign" href="#canned_response"></i></h2> + <h2><?php echo $title; ?> + <?php if (isset($info['title'])) { ?><small> + — <?php echo $info['title']; ?></small> + <?php } ?><i class="help-tip icon-question-sign" href="#canned_response"></i> +</h2> <table class="form_table fixed" width="940" border="0" cellspacing="0" cellpadding="2"> <thead> <tr><td></td><td></td></tr> <!-- For fixed table layout --> <tr> <th colspan="2"> - <h4><?php echo $title; ?></h4> <em><?php echo __('Canned response settings');?></em> </th> </tr> diff --git a/include/staff/category.inc.php b/include/staff/category.inc.php index c1b4dcda8f8534268408a8a04958bbb21b1e4a6d..d60d0d2f4c901e162ae67a95ae257388c63bc50f 100644 --- a/include/staff/category.inc.php +++ b/include/staff/category.inc.php @@ -6,7 +6,7 @@ if (!defined('OSTSCPINC') || !$thisstaff $info=array(); $qs = array(); if($category && $_REQUEST['a']!='add'){ - $title=__('Update Category').': '.$category->getName(); + $title=__('Update Category'); $action='update'; $submit_text=__('Save Changes'); $info=$category->getHashtable(); @@ -41,10 +41,12 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <input type="hidden" name="do" value="<?php echo $action; ?>"> <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>"> <input type="hidden" name="id" value="<?php echo $info['id']; ?>"> - <h2><?php echo __('FAQ Category');?></h2> - <div class="faq-title" style="margin:5px 0 15px"> - <?php echo $title; ?> - </div> + <h2><?php echo $title; ?> + <?php if (isset($info['name'])) { ?><small> + — <?php echo $info['name']; ?></small> + <?php } ?> + </h2> + <div style="margin:8px 0"><strong><?php echo __('Category Type');?>:</strong> <span class="error">*</span></div> diff --git a/include/staff/dashboard.inc.php b/include/staff/dashboard.inc.php index 7e760cab28daa0545c87e1a9123fe4dd0589e404..1aba46122842c9fa4edd7d60d20c33a41a1b3b0e 100644 --- a/include/staff/dashboard.inc.php +++ b/include/staff/dashboard.inc.php @@ -2,7 +2,6 @@ <script type="text/javascript" src="js/g.raphael.js"></script> <script type="text/javascript" src="js/g.line-min.js"></script> <script type="text/javascript" src="js/g.dot-min.js"></script> -<script type="text/javascript" src="js/bootstrap-tab.js"></script> <script type="text/javascript" src="js/dashboard.inc.js"></script> <!--<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>--> @@ -12,7 +11,6 @@ <div style="min-height:25px;"> <!--<p><?php //echo __('Select the starting time and period for the system activity graph');?></p>--> <form class="form-inline" id="timeframe-form"> - <i class="help-tip icon-question-sign" href="#report_timeframe"></i> <label> <?php echo __( 'Report timeframe'); ?>: <input type="text" class="dp input-medium search-query" name="start" placeholder="<?php echo __('Last month');?>" /> @@ -40,6 +38,7 @@ <button class="green button action-button muted" type="submit"> <?php echo __( 'Refresh');?> </button> + <i class="help-tip icon-question-sign" href="#report_timeframe"></i> </form> </div> </div> @@ -60,24 +59,8 @@ <hr/> <h2><?php echo __('Statistics'); ?> <i class="help-tip icon-question-sign" href="#statistics"></i></h2> <p><?php echo __('Statistics of tickets organized by department, help topic, and agent.');?></p> -<ul class="tabs"> - <li class="active"> - <a href="#departments"><?php echo __('Departments'); ?></a> - </li> - <li> - <a href="#topics"><?php echo __('Topics'); ?></a> - </li> - <li> - <a href="#agents"><?php echo __('Agents'); ?></a> - </li> +<ul id="tabular-navigation" class="tabs"> </ul> -<!--============= DEPARTMENTS ==============--> -<div class="tab_content" id="departments">Department content goes here</div> -<!--============= TOPICS ==============--> -<div class="tab_content hidden" id="topics">Topics content goes here</div> -<!--============= AGENTS ==============--> -<div class="tab_content hidden" id="agents">Agents content goes here</div> - -<div id="table-here"></div> +<!--<div id="table-here"></div>--> <?php diff --git a/include/staff/department.inc.php b/include/staff/department.inc.php index d65c99a0d630e85014e21c23cb9368cd8c4e1a3f..7b6efb32ef9a64b1b0822fd9e34354de5bbb3b31 100644 --- a/include/staff/department.inc.php +++ b/include/staff/department.inc.php @@ -3,7 +3,7 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access $info = $qs = array(); if($dept && $_REQUEST['a']!='add') { //Editing Department. - $title=__('Update Department –'); + $title=__('Update Department'); $action='update'; $submit_text=__('Save Changes'); $info = $dept->getInfo(); @@ -32,7 +32,8 @@ $info = Format::htmlchars(($errors && $_POST) ? $_POST : $info); <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>"> <input type="hidden" name="id" value="<?php echo $info['id']; ?>"> <h2><?php echo $title; ?> - <?php if ($info) { ?> <span class="ltr"><?php echo $info['name']; ?></span> + <?php if (isset($info['name'])) { ?><small> + — <?php echo $info['name']; ?></small> <?php } ?> </h2> <ul class="clean tabs"> diff --git a/include/staff/dynamic-form.inc.php b/include/staff/dynamic-form.inc.php index 4b1bcde2ac43079c714bb9aac2766e9d03dd6c41..b3bf1f76e61fd242a81d9a233ac799d9e79cd134 100644 --- a/include/staff/dynamic-form.inc.php +++ b/include/staff/dynamic-form.inc.php @@ -2,7 +2,7 @@ $info=array(); if($form && $_REQUEST['a']!='add') { - $title = __('Update form section –'); + $title = __('Update form section'); $action = 'update'; $url = "?id=".urlencode($_REQUEST['id']); $submit_text=__('Save Changes'); @@ -38,7 +38,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <input type="hidden" name="id" value="<?php echo $info['id']; ?>"> <h2><?php echo $title; ?> - <?php if ($form) { ?> <span class="ltr"><?php echo $form->getTitle(); ?></span> + <?php if (isset($info['title'])) { ?><small> + — <?php echo $info['title']; ?></small> <?php } ?> </h2> <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2"> diff --git a/include/staff/dynamic-list.inc.php b/include/staff/dynamic-list.inc.php index 58d19a092055b7049bc37f525d72db3cd2c542bf..4e4b0b7766040afefae49cbd7b47708566c9cf28 100644 --- a/include/staff/dynamic-list.inc.php +++ b/include/staff/dynamic-list.inc.php @@ -25,8 +25,8 @@ $info=Format::htmlchars(($errors && $_POST) ? array_merge($info,$_POST) : $info) <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>"> <input type="hidden" name="id" value="<?php echo $info['id']; ?>"> <h2><?php echo $title; ?> - <?php if ($list) { ?> - – <span class="ltr"><?php echo $list ? $list->getName() : __('Custom list'); ?></span> + <?php if (isset($info['name'])) { ?><small> + — <?php echo $info['name']; ?></small> <?php } ?> </h2> <ul class="clean tabs" id="list-tabs"> diff --git a/include/staff/email.inc.php b/include/staff/email.inc.php index 904b0018158bef808615daf12a8f54b6d6a87d86..08225cb95e1175634a5e03b3527e9f2717dc417e 100644 --- a/include/staff/email.inc.php +++ b/include/staff/email.inc.php @@ -2,7 +2,7 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access Denied'); $info = $qs = array(); if($email && $_REQUEST['a']!='add'){ - $title=__('Update Email Address –'); + $title=__('Update Email Address'); $action='update'; $submit_text=__('Save Changes'); $info=$email->getInfo(); @@ -35,7 +35,8 @@ if($email && $_REQUEST['a']!='add'){ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); ?> <h2><?php echo $title; ?> - <?php if ($info) { ?> <span class="ltr"><?php echo $info['email']; ?></span> + <?php if (isset($info['email'])) { ?><small> + — <?php echo $info['email']; ?></small> <?php } ?> </h2> <form action="emails.php?<?php echo Http::build_query($qs); ?>" method="post" id="save"> diff --git a/include/staff/filter.inc.php b/include/staff/filter.inc.php index c159817afcadae31fca091bacfc9f72288c3e8cb..ad5ff0d87cff2841d70ff66468fb9f60a890dc97 100644 --- a/include/staff/filter.inc.php +++ b/include/staff/filter.inc.php @@ -6,7 +6,7 @@ $match_types=Filter::getSupportedMatchTypes(); $info = $qs = array(); if($filter && $_REQUEST['a']!='add'){ - $title=__('Update Filter –'); + $title=__('Update Filter'); $action='update'; $submit_text=__('Save Changes'); $info=array_merge($filter->getInfo(),$filter->getFlatRules()); @@ -22,263 +22,295 @@ if($filter && $_REQUEST['a']!='add'){ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); ?> <form action="filters.php?<?php echo Http::build_query($qs); ?>" method="post" id="save"> - <?php csrf_token(); ?> - <input type="hidden" name="do" value="<?php echo $action; ?>"> - <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>"> - <input type="hidden" name="id" value="<?php echo $info['id']; ?>"> - <h2><?php echo $title; ?> - <?php if ($info) { ?> <span class="ltr"><?php echo $info['name']; ?></span> - <?php } ?> -</h2> - <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2"> - <thead> - <tr> - <th colspan="2"> - <em><?php echo __('Filters are executed based on execution order. Filter can target specific ticket source.');?></em> - </th> - </tr> - </thead> - <tbody> - <tr> - <td width="180" class="required"> - <?php echo __('Filter Name');?>: - </td> - <td> - <input type="text" size="30" name="name" value="<?php echo $info['name']; ?>" - autofocus> - <span class="error">* <?php echo $errors['name']; ?></span> - </td> - </tr> - <tr> - <td width="180" class="required"> - <?php echo __('Execution Order');?>: - </td> - <td> - <input type="text" size="6" name="execorder" value="<?php echo $info['execorder']; ?>"> - <em>(1...99)</em> - <span class="error">* <?php echo $errors['execorder']; ?></span> - - <label class="inline checkbox"> - <input type="checkbox" name="stop_onmatch" value="1" <?php echo $info['stop_onmatch']?'checked="checked"':''; ?> > - <?php echo __('<strong>Stop</strong> processing further on match!');?> - </label> - <i class="help-tip icon-question-sign" href="#execution_order"></i> - </td> - </tr> - <tr> - <td width="180" class="required"> - <?php echo __('Filter Status');?>: - </td> - <td> - <input type="radio" name="isactive" value="1" <?php echo - $info['isactive']?'checked="checked"':''; ?>> <?php echo __('Active'); ?> - <input type="radio" name="isactive" value="0" <?php echo !$info['isactive']?'checked="checked"':''; ?> - > <?php echo __('Disabled'); ?> - <span class="error">* </span> - </td> - </tr> - <tr> - <td width="180" class="required"> - <?php echo __('Target Channel');?>: - </td> - <td> - <select name="target"> - <option value="">— <?php echo __('Select a Channel');?> —</option> - <?php - foreach(Filter::getTargets() as $k => $v) { - echo sprintf('<option value="%s" %s>%s</option>', - $k, (($k==$info['target'])?'selected="selected"':''), $v); - } - $sql='SELECT email_id,email,name FROM '.EMAIL_TABLE.' email ORDER by name'; - if(($res=db_query($sql)) && db_num_rows($res)) { - echo sprintf('<OPTGROUP label="%s">', __('System Emails')); - while(list($id,$email,$name)=db_fetch_row($res)) { - $selected=($info['email_id'] && $id==$info['email_id'])?'selected="selected"':''; - if($name) - $email=Format::htmlchars("$name <$email>"); - echo sprintf('<option value="%d" %s>%s</option>',$id,$selected,$email); + <?php csrf_token(); ?> + <input type="hidden" name="do" value="<?php echo $action; ?>"> + <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>"> + <input type="hidden" name="id" value="<?php echo $info['id']; ?>"> + <h2><?php echo $title; ?> + <?php if (isset($info['name'])) { ?><small> + — <?php echo $info['name']; ?></small> + <?php } ?> + </h2> + <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2"> + <thead> + <tr> + <th colspan="2"> + <em><?php echo __('Filters are executed based on execution order. Filter can target specific ticket source.');?></em> + </th> + </tr> + </thead> + <tbody> + <tr> + <td width="180" class="required"> + <?php echo __('Filter Name');?>: + </td> + <td> + <input type="text" size="30" name="name" value="<?php echo $info['name']; ?>" + autofocus> + <span class="error">* <?php echo $errors['name']; ?></span> + </td> + </tr> + <tr> + <td width="180" class="required"> + <?php echo __('Execution Order');?>: + </td> + <td> + <input type="text" size="6" name="execorder" value="<?php echo $info['execorder']; ?>"> + <em>(1...99)</em> + <span class="error">* <?php echo $errors['execorder']; ?></span> + + <label class="inline checkbox"> + <input type="checkbox" name="stop_onmatch" value="1" <?php echo $info['stop_onmatch']?'checked="checked"':''; ?> > + <?php echo __('<strong>Stop</strong> processing further on match!');?> + </label> + <i class="help-tip icon-question-sign" href="#execution_order"></i> + </td> + </tr> + <tr> + <td width="180" class="required"> + <?php echo __('Filter Status');?>: + </td> + <td> + <input type="radio" name="isactive" value="1" <?php echo + $info['isactive']?'checked="checked"':''; ?>> <?php echo __('Active'); ?> + <input type="radio" name="isactive" value="0" <?php echo !$info['isactive']?'checked="checked"':''; ?> + > <?php echo __('Disabled'); ?> + <span class="error">* </span> + </td> + </tr> + <tr> + <td width="180" class="required"> + <?php echo __('Target Channel');?>: + </td> + <td> + <select name="target"> + <option value="">— <?php echo __('Select a Channel');?> —</option> + <?php + foreach(Filter::getTargets() as $k => $v) { + echo sprintf('<option value="%s" %s>%s</option>', + $k, (($k==$info['target'])?'selected="selected"':''), $v); } - echo '</OPTGROUP>'; - } - ?> - </select> - - <span class="error">* <?php echo $errors['target']; ?></span> - <i class="help-tip icon-question-sign" href="#target_channel"></i> - </td> - </tr> - <tr> - <th colspan="2"> - <em><strong><?php echo __('Filter Rules');?></strong>: <?php - echo __('Rules are applied based on the criteria.');?> <span class="error">* <?php echo - $errors['rules']; ?></span></em> - </th> - </tr> - <tr> - <td colspan=2> - <em><?php echo __('Rules Matching Criteria');?>:</em> - - <label> - <input type="radio" name="match_all_rules" value="1" <?php echo $info['match_all_rules']?'checked="checked"':''; ?>> - <?php echo __('Match All');?> - </label> - <span style="display:inline-block;width:10px"> </span> - <label> - <input type="radio" name="match_all_rules" value="0" <?php echo !$info['match_all_rules']?'checked="checked"':''; ?>> - <?php echo __('Match Any');?> - </label> - <span class="error">*</span> - <em>(<?php echo __('case-insensitive comparison');?>)</em> - <i class="help-tip icon-question-sign" href="#rules_matching_criteria"></i> - - </td> - </tr> - <?php - $n=($filter?$filter->getNumRules():0)+2; //2 extra rules of unlimited. - for($i=1; $i<=$n; $i++){ ?> - <tr id="r<?php echo $i; ?>"> - <td colspan="2"> - <div> - <select style="max-width: 200px;" name="rule_w<?php echo $i; ?>"> - <option value="">— <?php echo __('Select One');?> —</option> - <?php - foreach ($matches as $group=>$ms) { ?> - <optgroup label="<?php echo __($group); ?>"><?php - foreach ($ms as $k=>$v) { - $sel=($info["rule_w$i"]==$k)?'selected="selected"':''; - echo sprintf('<option value="%s" %s>%s</option>', - $k,$sel,__($v)); - } ?> - </optgroup> - <?php } ?> - </select> - <select name="rule_h<?php echo $i; ?>"> - <option value="0">— <?php echo __('Select One');?> —</option> - <?php - foreach($match_types as $k=>$v){ - $sel=($info["rule_h$i"]==$k)?'selected="selected"':''; - echo sprintf('<option value="%s" %s>%s</option>', - $k,$sel,$v); + $sql='SELECT email_id,email,name FROM '.EMAIL_TABLE.' email ORDER by name'; + if(($res=db_query($sql)) && db_num_rows($res)) { + echo sprintf('<OPTGROUP label="%s">', __('System Emails')); + while(list($id,$email,$name)=db_fetch_row($res)) { + $selected=($info['email_id'] && $id==$info['email_id'])?'selected="selected"':''; + if($name) + $email=Format::htmlchars("$name <$email>"); + echo sprintf('<option value="%d" %s>%s</option>',$id,$selected,$email); + } + echo '</OPTGROUP>'; } ?> - </select> - <input class="ltr" type="text" size="60" name="rule_v<?php echo $i; ?>" value="<?php echo $info["rule_v$i"]; ?>"> - <span class="error"> <?php echo $errors["rule_$i"]; ?></span> + </select> + + <span class="error">* <?php echo $errors['target']; ?></span> + <i class="help-tip icon-question-sign" href="#target_channel"></i> + </td> + </tr> + </tbody> + </table> + <ul class="clean tabs" style="margin-top:20px;" id="filter-tabs"> + <li class="active"><a href="#filter_rules"><i class="icon-filter"></i> <?php echo __('Filter Rules'); ?></a></li> + <li><a href="#filter_actions"><i class="icon-bolt"></i> <?php echo __('Filter Actions'); ?></a></li> + <li><a href="#internal_notes"><i class="icon-file-text-alt"></i> <?php echo __('Internal Notes'); ?></a></li> + </ul> + <!-- ====================== FILTER RULES ========================== --> + <div class="tab_content" id="filter_rules"> + <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2"> + <thead> + <tr> + <th colspan="2" style="text-align:left;"> + <em><strong><?php echo __('Filter Rules');?></strong>: <?php + echo __('Rules are applied based on the criteria.');?> <span class="error">* <?php echo + $errors['rules']; ?></span></em> + </th> + </tr> + </thead> + <tbody> + <tr> + <td colspan=2> + <em><?php echo __('Rules Matching Criteria');?>:</em> + + <label> + <input type="radio" name="match_all_rules" value="1" <?php echo $info['match_all_rules']?'checked="checked"':''; ?>> + <?php echo __('Match All');?> + </label> + <span style="display:inline-block;width:10px"> </span> + <label> + <input type="radio" name="match_all_rules" value="0" <?php echo !$info['match_all_rules']?'checked="checked"':''; ?>> + <?php echo __('Match Any');?> + </label> + <span class="error">*</span> + <em>(<?php echo __('case-insensitive comparison');?>)</em> + <i class="help-tip icon-question-sign" href="#rules_matching_criteria"></i> + </td> + </tr> <?php - if($info["rule_w$i"] || $info["rule_h$i"] || $info["rule_v$i"]){ ?> - <div class="pull-right" style="padding-right:20px;"><a href="#" class="clearrule">(<?php echo __('clear');?>)</a></div> + $n=($filter?$filter->getNumRules():0)+2; //2 extra rules of unlimited. + for($i=1; $i<=$n; $i++){ ?> + <tr id="r<?php echo $i; ?>"> + <td colspan="2"> + <div> + <select style="max-width: 200px;" name="rule_w<?php echo $i; ?>"> + <option value="">— <?php echo __('Select One');?> —</option> + <?php + foreach ($matches as $group=>$ms) { ?> + <optgroup label="<?php echo __($group); ?>"><?php + foreach ($ms as $k=>$v) { + $sel=($info["rule_w$i"]==$k)?'selected="selected"':''; + echo sprintf('<option value="%s" %s>%s</option>', + $k,$sel,__($v)); + } ?> + </optgroup> + <?php } ?> + </select> + <select name="rule_h<?php echo $i; ?>"> + <option value="0">— <?php echo __('Select One');?> —</option> + <?php + foreach($match_types as $k=>$v){ + $sel=($info["rule_h$i"]==$k)?'selected="selected"':''; + echo sprintf('<option value="%s" %s>%s</option>', + $k,$sel,$v); + } + ?> + </select> + <input class="ltr" type="text" size="60" name="rule_v<?php echo $i; ?>" value="<?php echo $info["rule_v$i"]; ?>"> + <span class="error"> <?php echo $errors["rule_$i"]; ?></span> + <?php + if($info["rule_w$i"] || $info["rule_h$i"] || $info["rule_v$i"]){ ?> + <div class="pull-right" style="padding-right:20px;"><a href="#" class="clearrule">(<?php echo __('clear');?>)</a></div> + <?php + } ?> + </div> + </td> + </tr> <?php + if($i>=25) //Hardcoded limit of 25 rules...also see class.filter.php + break; } ?> - </div> - </td> - </tr> - <?php - if($i>=25) //Hardcoded limit of 25 rules...also see class.filter.php - break; - } ?> - <tr> - <th colspan="2"> - <em><strong><?php echo __('Filter Actions');?></strong>: - <div><?php - echo __('Can be overwridden by other filters depending on processing order.'); - ?><br/><?php - echo __('Actions are executed in the order declared below'); - ?></em> - </th> - </tr> - </tbody> - <tbody id="dynamic-actions" class="sortable-rows"> -<?php -$existing = array(); -if ($filter) { foreach ($filter->getActions() as $A) { - $existing[] = $A->type; -?> - <tr style="background-color:white"><td><i class="icon-bolt icon-large icon-muted"></i> - <?php echo $A->getImpl()->getName(); ?>:</td> - <td><div style="position:relative"><?php - $form = $A->getImpl()->getConfigurationForm($_POST ?: false); - // XXX: Drop this when the ORM supports proper caching - $form->isValid(); - include STAFFINC_DIR . 'templates/dynamic-form-simple.tmpl.php'; -?> - <input type="hidden" name="actions[]" value="I<?php echo $A->getId(); ?>"/> - <div class="pull-right" style="position:absolute;top:2px;right:2px;"> - <a href="#" title="<?php echo __('clear'); ?>" onclick="javascript: - if (!confirm(__('You sure?'))) - return false; - $(this).closest('td').find('input[name=\'actions[]\']') - .val(function(i,v) { return 'D' + v.substring(1); }); - $(this).closest('tr').fadeOut(400, function() { $(this).hide(); }); - return false;"><i class="icon-trash"></i></a> - </div> -</div> - </td> - </tr> -<?php } } ?> - </tbody> - <tbody> - <tr> - <td><strong><i class="icon-plus-sign"></i> - <?php echo __('Add'); ?>: - </strong></td> - <td> - <select name="new-action" id="new-action-select" - onchange="javascript: $('#new-action-btn').trigger('click');"> - <option value=""><?php echo __('— Select an Action —'); ?></option> -<?php -$current_group = ''; -foreach (FilterAction::allRegistered() as $group=>$actions) { - if ($group && $current_group != $group) { - if ($current_group) echo '</optgroup>'; - $current_group = $group; - ?><optgroup label="<?php echo Format::htmlchars($group); ?>"><?php - } - foreach ($actions as $type=>$name) { -?> - <option data-title="<?php echo $name; ?>" value="<?php echo $type; ?>" - data-multi-use="<?php echo $mu = FilterAction::lookupByType($type)->hasFlag(TriggerAction::FLAG_MULTI_USE); ?> " <?php - if (in_array($type, $existing) && !$mu) echo 'disabled="disabled"'; - ?>><?php echo $name; ?></option> -<?php } -} ?> - </select> - <button id="new-action-btn" type="button" class="inline green button" onclick="javascript: - var dropdown = $('#new-action-select'), selected = dropdown.find(':selected'); - dropdown.val(''); - $('#dynamic-actions') - .append($('<tr></tr>') - .append($('<td></td>') - .text(selected.data('title') + ':') - ).append($('<td></td>') - .append($('<em></em>').text(__('Loading ...'))) - .load('ajax.php/filter/action/' + selected.val() + '/config', function() { - if (!selected.data('multiUse')) selected.prop('disabled', true); - }) - ) - ).append( - $('<input>').attr({type:'hidden',name:'actions[]',value:'N'+selected.val()}) - );"><?php echo __('Add'); ?></button> - </td> - </tr> - <tr> - <th colspan="2"> - <em><strong><?php echo __('Internal Notes');?></strong>: <?php - echo __("be liberal, they're internal");?></em> - </th> - </tr> - <tr> - <td colspan=2> - <textarea class="richtext no-bar" name="notes" cols="21" - rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea> - </td> - </tr> - </tbody> -</table> -<p style="text-align:center;"> - <input type="submit" name="submit" value="<?php echo $submit_text; ?>"> - <input type="reset" name="reset" value="<?php echo __('Reset');?>"> - <input type="button" name="cancel" value="<?php echo __('Cancel');?>" onclick='window.location.href="filters.php"'> -</p> + </tbody> + </table> + </div> + <!-- ======================= FILTER ACTIONS ========================= --> + <div class="tab_content hidden" id="filter_actions"> + <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2"> + <thead> + <tr> + <th colspan="2"> + <em><strong><?php echo __('Filter Actions');?></strong>: + <div><?php + echo __('Can be overwridden by other filters depending on processing order.'); + ?><br/><?php + echo __('Actions are executed in the order declared below'); + ?></div></em> + </th> + </tr> + </thead> + <tbody id="dynamic-actions" class="sortable-rows"> + <?php + $existing = array(); + if ($filter) { foreach ($filter->getActions() as $A) { + $existing[] = $A->type; + ?> + <tr style="background-color:white"><td><i class="icon-bolt icon-large icon-muted"></i> + <?php echo $A->getImpl()->getName(); ?>:</td> + <td> + <div style="position:relative"><?php + $form = $A->getImpl()->getConfigurationForm($_POST ?: false); + // XXX: Drop this when the ORM supports proper caching + $form->isValid(); + include STAFFINC_DIR . 'templates/dynamic-form-simple.tmpl.php'; + ?> + <input type="hidden" name="actions[]" value="I<?php echo $A->getId(); ?>"/> + <div class="pull-right" style="position:absolute;top:2px;right:2px;"> + <a href="#" title="<?php echo __('clear'); ?>" onclick="javascript: + if (!confirm(__('You sure?'))) + return false; + $(this).closest('td').find('input[name=\'actions[]\']') + .val(function(i,v) { return 'D' + v.substring(1); }); + $(this).closest('tr').fadeOut(400, function() { $(this).hide(); }); + return false;"><i class="icon-trash"></i></a> + </div> + </div> + </td> + </tr> + <?php } } ?> + <tr> + <td> + <strong><i class="icon-plus-sign"></i> + <?php echo __('Add'); ?>: + </strong> + </td> + <td> + <select name="new-action" id="new-action-select" + onchange="javascript: $('#new-action-btn').trigger('click');"> + <option value=""><?php echo __('— Select an Action —'); ?></option> + <?php + $current_group = ''; + foreach (FilterAction::allRegistered() as $group=>$actions) { + if ($group && $current_group != $group) { + if ($current_group) echo '</optgroup>'; + $current_group = $group; + ?><optgroup label="<?php echo Format::htmlchars($group); ?>"><?php + } + foreach ($actions as $type=>$name) { + ?> + <option data-title="<?php echo $name; ?>" value="<?php echo $type; ?>" + data-multi-use="<?php echo $mu = FilterAction::lookupByType($type)->hasFlag(TriggerAction::FLAG_MULTI_USE); ?> " <?php + if (in_array($type, $existing) && !$mu) echo 'disabled="disabled"'; + ?>><?php echo $name; ?></option> + <?php } + } ?> + </select> + <button id="new-action-btn" type="button" class="inline green button" onclick="javascript: + var dropdown = $('#new-action-select'), selected = dropdown.find(':selected'); + dropdown.val(''); + $('#dynamic-actions') + .append($('<tr></tr>') + .append($('<td></td>') + .text(selected.data('title') + ':') + ).append($('<td></td>') + .append($('<em></em>').text(__('Loading ...'))) + .load('ajax.php/filter/action/' + selected.val() + '/config', function() { + if (!selected.data('multiUse')) selected.prop('disabled', true); + }) + ) + ).append( + $('<input>').attr({type:'hidden',name:'actions[]',value:'N'+selected.val()}) + );"><?php echo __('Add'); ?> + </button> + </td> + </tr> + </tbody> + </table> + </div> + <!-- ======================== INTERNAL NOTES ======================== --> + <div class="tab_content hidden" id="internal_notes"> + <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2"> + <thead> + <tr> + <th colspan="2"> + <em><strong><?php echo __('Internal Notes');?></strong>: <?php + echo __("be liberal, they're internal");?></em> + </th> + </tr> + </thead> + <tbody> + <tr> + <td colspan=2> + <textarea class="richtext no-bar" name="notes" cols="21" + rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea> + </td> + </tr> + </tbody> + </table> + </div> + <p style="text-align:center;"> + <input type="submit" name="submit" value="<?php echo $submit_text; ?>"> + <input type="reset" name="reset" value="<?php echo __('Reset');?>"> + <input type="button" name="cancel" value="<?php echo __('Cancel');?>" onclick='window.location.href="filters.php"'> + </p> </form> <script type="text/javascript"> var fixHelper = function(e, ui) { diff --git a/include/staff/helptopic.inc.php b/include/staff/helptopic.inc.php index 96e70049c4d788cecceba7610c0a2ded71a5d0e8..278caf7b91170567d8249b70fc7c5af85f18f5da 100644 --- a/include/staff/helptopic.inc.php +++ b/include/staff/helptopic.inc.php @@ -24,16 +24,15 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); ?> <h2><?php echo $title; ?> -<?php if ($topic) { ?> - - <span class="ltr"><?php echo $topic->getLocal('topic'); ?></span> + <?php if (isset($info['topic'])) { ?><small> + — <?php echo $info['topic']; ?></small> <?php } ?> <i class="help-tip icon-question-sign" href="#help_topic_information"></i></h2> -<br/> <ul class="clean tabs" id="topic-tabs"> - <li class="active"><a href="#info"><i class="icon-info-sign"></i> Help Topic Information</a></li> - <li><a href="#routing"><i class="icon-ticket"></i> New ticket options</a></li> - <li><a href="#forms"><i class="icon-paste"></i> Forms</a></li> + <li class="active"><a href="#info"><i class="icon-info-sign"></i> <?php echo __('Help Topic Information'); ?></a></li> + <li><a href="#routing"><i class="icon-ticket"></i> <?php echo __('New ticket options'); ?></a></li> + <li><a href="#forms"><i class="icon-paste"></i> <?php echo __('Forms'); ?></a></li> </ul> <form action="helptopics.php?<?php echo Http::build_query($qs); ?>" method="post" id="save"> @@ -99,7 +98,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); </table> <div style="padding:8px 3px;border-bottom: 2px dotted #ddd;"> - <strong class="big"><?php echo __('Internal Notes');?></strong><br/> + <strong><?php echo __('Internal Notes');?>:</strong> <?php echo __("be liberal, they're internal.");?> </div> diff --git a/include/staff/page.inc.php b/include/staff/page.inc.php index 250b5f3bd6cb339c4489d9bc67d8de4bc198d99e..4a77dc8be6aad8ce7fcb219565c647df7526565b 100644 --- a/include/staff/page.inc.php +++ b/include/staff/page.inc.php @@ -8,7 +8,7 @@ $pageTypes = array( ); $info = $qs = array(); if($page && $_REQUEST['a']!='add'){ - $title=__('Update Page –'); + $title=__('Update Page'); $action='update'; $submit_text=__('Save Changes'); $info=$page->getHashtable(); @@ -43,7 +43,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>"> <input type="hidden" name="id" value="<?php echo $info['id']; ?>"> <h2><?php echo $title; ?> - <?php if ($info) { ?> <span class="ltr"><?php echo $info['name']; ?></span> + <?php if (isset($info['name'])) { ?><small> + — <?php echo $info['name']; ?></small> <?php } ?> <i class="help-tip icon-question-sign" href="#site_pages"></i> </h2> diff --git a/include/staff/plugin.inc.php b/include/staff/plugin.inc.php index 65c8f5863c5895590b27ec0ed026f55238b51b66..58d4a0313d852d26a59ac040b8be6b536870f2ba 100644 --- a/include/staff/plugin.inc.php +++ b/include/staff/plugin.inc.php @@ -23,7 +23,7 @@ $info = Format::htmlchars(($errors && $_POST) ? $_POST : $info); <input type="hidden" name="do" value="<?php echo $action; ?>"> <input type="hidden" name="id" value="<?php echo $info['id']; ?>"> <h2><?php echo __('Manage Plugin'); ?> - <small><?php echo $plugin->getName(); ?></small></h2> + — <small><?php echo $plugin->getName(); ?></small></h2> <h3><?php echo __('Configuration'); ?></h3> <?php diff --git a/include/staff/role.inc.php b/include/staff/role.inc.php index 34853b68806b0d3e23c7f6d22cb63061e65fc626..9d82a8a318275582b0d1cf281c7ecd47242321a6 100644 --- a/include/staff/role.inc.php +++ b/include/staff/role.inc.php @@ -2,7 +2,7 @@ $info=array(); if ($role) { - $title = __('Update Role –'); + $title = __('Update Role'); $action = 'update'; $submit_text = __('Save Changes'); $info = $role->getInfo(); @@ -23,107 +23,104 @@ $info = Format::htmlchars(($errors && $_POST) ? array_merge($info, $_POST) : $in <input type="hidden" name="do" value="<?php echo $action; ?>"> <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>"> <input type="hidden" name="id" value="<?php echo $info['id']; ?>"> -<h2><?php echo $title; ?> - <?php if ($info) { ?> <span class="ltr"><?php echo $info['name']; ?></span> - <?php } ?> -</h2> -<ul class="clean tabs"> - <li class="active"><a href="#definition"> - <i class="icon-file"></i> <?php echo __('Definition'); ?></a></li> - <li><a href="#permissions"> - <i class="icon-lock"></i> <?php echo __('Permissions'); ?></a></li> -</ul> -<div id="definition" class="tab_content"> - <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2"> - <thead> - <tr> - <th colspan="2"> - <em><?php echo __( - 'Roles are used to define agents\' permissions' - ); ?> <i class="help-tip icon-question-sign" - href="#roles"></i></em> - </th> - </tr> - </thead> - <tbody> - <tr> - <td width="180" class="required"><?php echo __('Name'); ?>:</td> - <td> - <input size="50" type="text" name="name" value="<?php echo - $info['name']; ?>" data-translate-tag="<?php echo $trans['name']; ?>" - autofocus/> - <span class="error">* <?php echo $errors['name']; ?></span> - </td> - </tr> - </tbody> - <tbody> - <tr> - <th colspan="7"> - <em><strong><?php echo __('Internal Notes'); ?></strong> </em> - </th> - </tr> - <tr> - <td colspan="7"><textarea name="notes" class="richtext no-bar" - rows="6" cols="80"><?php - echo $info['notes']; ?></textarea> - </td> - </tr> - </tbody> - </table> -</div> -<div id="permissions" class="tab_content" style="display:none"> - <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2"> - <thead> - <tr> - <th> - <em><?php echo __('Check all permissions applicable to this role.') ?></em> - </th> - </tr> - </thead> - <tbody> + <h2><?php echo $title; ?> + <?php if (isset($info['name'])) { ?><small> + — <?php echo $info['name']; ?></small> + <?php } ?> + </h2> + <ul class="clean tabs"> + <li class="active"><a href="#definition"><i class="icon-file"></i> <?php echo __('Definition'); ?></a></li> + <li><a href="#permissions"><i class="icon-lock"></i> <?php echo __('Permissions'); ?></a></li> + </ul> + <div id="definition" class="tab_content"> + <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2"> + <thead> + <tr> + <th colspan="2"> + <em><?php echo __( + 'Roles are used to define agents\' permissions' + ); ?> <i class="help-tip icon-question-sign" + href="#roles"></i></em> + </th> + </tr> + </thead> + <tbody> + <tr> + <td width="180" class="required"><?php echo __('Name'); ?>:</td> + <td> + <input size="50" type="text" name="name" value="<?php echo + $info['name']; ?>" data-translate-tag="<?php echo $trans['name']; ?>" + autofocus/> + <span class="error">* <?php echo $errors['name']; ?></span> + </td> + </tr> + </tbody> + <tbody> + <tr> + <th colspan="7"> + <em><strong><?php echo __('Internal Notes'); ?></strong> </em> + </th> + </tr> + <tr> + <td colspan="7"><textarea name="notes" class="richtext no-bar" + rows="6" cols="80"><?php + echo $info['notes']; ?></textarea> + </td> + </tr> + </tbody> + </table> + </div> + <div id="permissions" class="hidden"> <?php - $setting = $role ? $role->getPermissionInfo() : array(); - - // Eliminate groups without any department-specific permissions - $buckets = array(); - foreach (RolePermission::allPermissions() as $g => $perms) { - foreach ($perms as $k => $v) { + $setting = $role ? $role->getPermissionInfo() : array(); + // Eliminate groups without any department-specific permissions + $buckets = array(); + foreach (RolePermission::allPermissions() as $g => $perms) { + foreach ($perms as $k => $v) { if ($v['primary']) continue; - $buckets[$g][$k] = $v; + $buckets[$g][$k] = $v; } - } - foreach ($buckets as $g => $perms) { ?> - <tr><th><?php - echo Format::htmlchars(__($g)); ?></th></tr> -<?php - foreach ($perms as $k => $v) { ?> - <tr> - <td> - <label> - <?php - echo sprintf('<input type="checkbox" name="perms[]" value="%s" %s />', - $k, - (isset($setting[$k]) && $setting[$k]) ? 'checked="checked"' : ''); - ?> - - <?php echo Format::htmlchars(__($v['title'])); ?> - — - <em><?php echo Format::htmlchars(__($v['desc'])); - ?></em> - </label> - </td> - </tr> - <?php - } } ?> - </tbody> - </table> -</div> -<p class="centered"> - <input type="submit" name="submit" value="<?php echo $submit_text; ?>"> - <input type="reset" name="reset" value="<?php echo __('Reset'); ?>"> - <input type="button" name="cancel" value="<?php echo __('Cancel'); ?>" - onclick='window.location.href="?"'> -</p> + <ul class="alt tabs"> + <?php + $first = true; + foreach ($buckets as $g => $perms) { ?> + <li <?php if ($first) { echo 'class="active"'; $first=false; } ?>> + <a href="#<?php echo Format::slugify($g); ?>"><?php echo Format::htmlchars(__($g));?></a> + </li> + <?php } ?> + </ul> + <?php + $first = true; + foreach ($buckets as $g => $perms) { ?> + <div class="tab_content <?php if (!$first) { echo 'hidden'; } else { $first = false; } + ?>" id="<?php echo Format::slugify($g); ?>"> + <table class="table"> + <?php foreach ($perms as $k => $v) { ?> + <tr> + <td> + <label> + <?php + echo sprintf('<input type="checkbox" name="perms[]" value="%s" %s />', + $k, (isset($setting[$k]) && $setting[$k]) ? 'checked="checked"' : ''); ?> + + <?php echo Format::htmlchars(__($v['title'])); ?> + — + <em><?php echo Format::htmlchars(__($v['desc'])); + ?></em> + </label> + </td> + </tr> + <?php } ?> + </table> + </div> + <?php } ?> + </div> + <p class="centered"> + <input type="submit" name="submit" value="<?php echo $submit_text; ?>"> + <input type="reset" name="reset" value="<?php echo __('Reset'); ?>"> + <input type="button" name="cancel" value="<?php echo __('Cancel'); ?>" + onclick='window.location.href="?"'> + </p> </form> diff --git a/include/staff/settings-agents.inc.php b/include/staff/settings-agents.inc.php index 5a7e83230a6a6aaef958b77f6b7780684b477c3c..e5ca64b320ce14ec1f601dd4db4e55583092d96c 100644 --- a/include/staff/settings-agents.inc.php +++ b/include/staff/settings-agents.inc.php @@ -4,182 +4,198 @@ if (!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config ?> <h2><?php echo __('Agents Settings'); ?></h2> <form action="settings.php?t=agents" method="post" id="save"> -<?php csrf_token(); ?> -<input type="hidden" name="t" value="agents" > -<ul class="tabs" id="agents-tabs"> - <li class="active"><a href="#settings"> - <i class="icon-asterisk"></i> <?php echo __('Settings'); ?></a></li> - <li><a href="#templates"> - <i class="icon-file-text"></i> <?php echo __('Templates'); ?></a></li> -</ul> -<div id="agents-tabs_container"> - <div id="settings" class="tab_content"> -<table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> - <tbody> - <tr> - <th colspan="2"> - <em><b><?php echo __('General Settings'); ?></b></em> - </th> - </tr> - <tr> - <td width="180"><?php echo __('Name Formatting'); ?>:</td> - <td> - <select name="agent_name_format"> - <?php foreach (PersonsName::allFormats() as $n=>$f) { - list($desc, $func) = $f; - $selected = ($config['agent_name_format'] == $n) ? 'selected="selected"' : ''; ?> - <option value="<?php echo $n; ?>" <?php echo $selected; - ?>><?php echo __($desc); ?></option> - <?php } ?> - </select> - <i class="help-tip icon-question-sign" href="#agent_name_format"></i> - </td> - </tr> - <tr> - <td width="180"><?php echo __('Avatar Source'); ?>:</td> - <td> - <select name="agent_avatar"> -<?php require_once INCLUDE_DIR . 'class.avatar.php'; - foreach (AvatarSource::allSources() as $id=>$class) { - $modes = $class::getModes(); - if ($modes) { - echo "<optgroup label=\"{$class::getName()}\">"; - foreach ($modes as $mid=>$mname) { - $oid = "$id.$mid"; - $selected = ($config['agent_avatar'] == $oid) ? 'selected="selected"' : ''; - echo "<option {$selected} value=\"{$oid}\">{$class::getName()} / {$mname}</option>"; - } - echo "</optgroup>"; - } - else { - $selected = ($config['agent_avatar'] == $id) ? 'selected="selected"' : ''; - echo "<option {$selected} value=\"{$id}\">{$class::getName()}</option>"; - } - } ?> - </select> - <div class="error"><?php echo Format::htmlchars($errors['agent_avatar']); ?></div> - </td> - </tr> - <tr> - <th colspan="2"> - <em><b><?php echo __('Authentication Settings'); ?></b></em> - </th> - </tr> - <tr><td><?php echo __('Password Expiration Policy'); ?>:</th> - <td> - <select name="passwd_reset_period"> - <option value="0"> — <?php echo __('No expiration'); ?> —</option> - <?php - for ($i = 1; $i <= 12; $i++) { - echo sprintf('<option value="%d" %s>%s</option>', - $i,(($config['passwd_reset_period']==$i)?'selected="selected"':''), - sprintf(_N('Monthly', 'Every %d months', $i), $i)); - } - ?> - </select> - <font class="error"><?php echo $errors['passwd_reset_period']; ?></font> - <i class="help-tip icon-question-sign" href="#password_expiration_policy"></i> - </td> - </tr> - <tr><td><?php echo __('Allow Password Resets'); ?>:</th> - <td> - <input type="checkbox" name="allow_pw_reset" <?php echo $config['allow_pw_reset']?'checked="checked"':''; ?>> - <i class="help-tip icon-question-sign" href="#allow_password_resets"></i> - </td> - </tr> - <tr><td><?php echo __('Reset Token Expiration'); ?>:</th> - <td> - <input type="text" name="pw_reset_window" size="6" value="<?php - echo $config['pw_reset_window']; ?>"> - <em><?php echo __('minutes'); ?></em> - <i class="help-tip icon-question-sign" href="#reset_token_expiration"></i> - <font class="error"><?php echo $errors['pw_reset_window']; ?></font> - </td> - </tr> - <tr><td><?php echo __('Agent Excessive Logins'); ?>:</td> - <td> - <select name="staff_max_logins"> - <?php - for ($i = 1; $i <= 10; $i++) { - echo sprintf('<option value="%d" %s>%d</option>', $i,(($config['staff_max_logins']==$i)?'selected="selected"':''), $i); - } - ?> - </select> <?php echo __( - 'failed login attempt(s) allowed before a lock-out is enforced'); ?> - <br/> - <select name="staff_login_timeout"> - <?php - for ($i = 1; $i <= 10; $i++) { - echo sprintf('<option value="%d" %s>%d</option>', $i,(($config['staff_login_timeout']==$i)?'selected="selected"':''), $i); - } - ?> - </select> <?php echo __('minutes locked out'); ?> - </td> - </tr> - <tr><td><?php echo __('Agent Session Timeout'); ?>:</td> - <td> - <input type="text" name="staff_session_timeout" size=6 value="<?php echo $config['staff_session_timeout']; ?>"> - <?php echo __('minutes'); ?> <em><?php echo __('(0 to disable)'); ?></em>. <i class="help-tip icon-question-sign" href="#staff_session_timeout"></i> - </td> - </tr> - <tr><td><?php echo __('Bind Agent Session to IP'); ?>:</td> - <td> - <input type="checkbox" name="staff_ip_binding" <?php echo $config['staff_ip_binding']?'checked="checked"':''; ?>> - <i class="help-tip icon-question-sign" href="#bind_staff_session_to_ip"></i> - </td> - </tr> - </tbody> - </table> - </div> - <div id="templates" class="tab_content hidden"> - <table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> - <tbody> -<?php -$res = db_query('select distinct(`type`), id, notes, name, updated from ' - .PAGE_TABLE - .' where isactive=1 group by `type`'); -$contents = array(); -while (list($type, $id, $notes, $name, $u) = db_fetch_row($res)) - $contents[$type] = array($id, $name, $notes, $u); + <?php csrf_token(); ?> + <input type="hidden" name="t" value="agents" > + <ul class="tabs" id="agents-tabs"> + <li class="active"><a href="#settings"> + <i class="icon-asterisk"></i> <?php echo __('Settings'); ?></a></li> + <li><a href="#templates"> + <i class="icon-file-text"></i> <?php echo __('Templates'); ?></a></li> + </ul> + <div id="agents-tabs_container"> + <div id="settings" class="tab_content"> + <table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> + <tbody> + <tr> + <th colspan="2"> + <em><b><?php echo __('General Settings'); ?></b></em> + </th> + </tr> + <tr> + <td width="180"><?php echo __('Name Formatting'); ?>:</td> + <td> + <select name="agent_name_format"> + <?php foreach (PersonsName::allFormats() as $n=>$f) { + list($desc, $func) = $f; + $selected = ($config['agent_name_format'] == $n) ? 'selected="selected"' : ''; ?> + <option value="<?php echo $n; ?>" <?php echo $selected; + ?>><?php echo __($desc); ?></option> + <?php } ?> + </select> + <i class="help-tip icon-question-sign" href="#agent_name_format"></i> + </td> + </tr> + <tr> + <td width="180"><?php echo __('Avatar Source'); ?>:</td> + <td> + <select name="agent_avatar"> +<?php require_once INCLUDE_DIR . 'class.avatar.php'; + foreach (AvatarSource::allSources() as $id=>$class) { + $modes = $class::getModes(); + if ($modes) { + echo "<optgroup label=\"{$class::getName()}\">"; + foreach ($modes as $mid=>$mname) { + $oid = "$id.$mid"; + $selected = ($config['agent_avatar'] == $oid) ? 'selected="selected"' : ''; + echo "<option {$selected} value=\"{$oid}\">{$class::getName()} / {$mname}</option>"; + } + echo "</optgroup>"; + } + else { + $selected = ($config['agent_avatar'] == $id) ? 'selected="selected"' : ''; + echo "<option {$selected} value=\"{$id}\">{$class::getName()}</option>"; + } + } ?> + </select> + <div class="error"><?php echo Format::htmlchars($errors['agent_avatar']); ?></div> + </td> + </tr> + <tr> + <th colspan="2"> + <em><b><?php echo __('Authentication Settings'); ?></b></em> + </th> + </tr> + <tr> + <td><?php echo __('Password Expiration Policy'); ?>:</td> + <td> + <select name="passwd_reset_period"> + <option value="0"> — <?php echo __('No expiration'); ?> —</option> + <?php + for ($i = 1; $i <= 12; $i++) { + echo sprintf('<option value="%d" %s>%s</option>', + $i,(($config['passwd_reset_period']==$i)?'selected="selected"':''), + sprintf(_N('Monthly', 'Every %d months', $i), $i)); + } + ?> + </select> + <font class="error"><?php echo $errors['passwd_reset_period']; ?></font> + <i class="help-tip icon-question-sign" href="#password_expiration_policy"></i> + </td> + </tr> + <tr> + <td><?php echo __('Allow Password Resets'); ?>:</td> + <td> + <input type="checkbox" name="allow_pw_reset" <?php echo $config['allow_pw_reset']?'checked="checked"':''; ?>> + <i class="help-tip icon-question-sign" href="#allow_password_resets"></i> + </td> + </tr> + <tr> + <td><?php echo __('Reset Token Expiration'); ?>:</td> + <td> + <input type="text" name="pw_reset_window" size="6" value="<?php + echo $config['pw_reset_window']; ?>"> + <em><?php echo __('minutes'); ?></em> + <i class="help-tip icon-question-sign" href="#reset_token_expiration"></i> + <font class="error"><?php echo $errors['pw_reset_window']; ?></font> + </td> + </tr> + <tr> + <td><?php echo __('Agent Excessive Logins'); ?>:</td> + <td> + <select name="staff_max_logins"> + <?php + for ($i = 1; $i <= 10; $i++) { + echo sprintf('<option value="%d" %s>%d</option>', $i,(($config['staff_max_logins']==$i)?'selected="selected"':''), $i); + } + ?> + </select> <?php echo __( + 'failed login attempt(s) allowed before a lock-out is enforced'); ?> + <br/> + <select name="staff_login_timeout"> + <?php + for ($i = 1; $i <= 10; $i++) { + echo sprintf('<option value="%d" %s>%d</option>', $i,(($config['staff_login_timeout']==$i)?'selected="selected"':''), $i); + } + ?> + </select> <?php echo __('minutes locked out'); ?> + </td> + </tr> + <tr> + <td><?php echo __('Agent Session Timeout'); ?>:</td> + <td> + <input type="text" name="staff_session_timeout" size=6 value="<?php echo $config['staff_session_timeout']; ?>"> + <?php echo __('minutes'); ?> <em><?php echo __('(0 to disable)'); ?></em>. <i class="help-tip icon-question-sign" href="#staff_session_timeout"></i> + </td> + </tr> + <tr> + <td><?php echo __('Bind Agent Session to IP'); ?>:</td> + <td> + <input type="checkbox" name="staff_ip_binding" <?php echo $config['staff_ip_binding']?'checked="checked"':''; ?>> + <i class="help-tip icon-question-sign" href="#bind_staff_session_to_ip"></i> + </td> + </tr> + </tbody> + </table> + </div> + <div id="templates" class="tab_content hidden"> + <table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> + <tbody> + <?php + $res = db_query('select distinct(`type`), id, notes, name, updated from ' + .PAGE_TABLE + .' where isactive=1 group by `type`'); + $contents = array(); + while (list($type, $id, $notes, $name, $u) = db_fetch_row($res)) + $contents[$type] = array($id, $name, $notes, $u); -$manage_content = function($title, $content) use ($contents) { - list($id, $name, $notes, $upd) = $contents[$content]; - $notes = explode('. ', $notes); - $notes = $notes[0]; - ?><tr><td colspan="2"> - <div style="padding:2px 5px"> - <a href="#ajax.php/content/<?php echo $id; ?>/manage" - onclick="javascript: - $.dialog($(this).attr('href').substr(1), 201); - return false;" class="pull-left"><i class="icon-file-text icon-2x" - style="color:#bbb;"></i> </a> - <span style="display:inline-block;width:90%;width:calc(100% - 32px);padding-left:10px;line-height:1.2em"> - <a href="#ajax.php/content/<?php echo $id; ?>/manage" - onclick="javascript: - $.dialog($(this).attr('href').substr(1), 201, null, {size:'large'}); - return false;"><?php - echo Format::htmlchars($title); ?></a><br/> - <span class="faded"><?php - echo Format::display($notes); ?> - <br><em><?php echo sprintf(__('Last Updated %s'), Format::datetime($upd)); - ?></em></span> - </div></td></tr><?php -}; ?> - <tr> - <th colspan="2"> - <em><b><?php echo __( - 'Authentication and Registration Templates & Pages'); ?></b></em> - </th> - </tr> - <?php $manage_content(__('Agent Welcome Email'), 'registration-staff'); ?> - <?php $manage_content(__('Sign-in Login Banner'), 'banner-staff'); ?> - <?php $manage_content(__('Password Reset Email'), 'pwreset-staff'); ?> -</tbody> -</table> -</div> -<p style="text-align:center"> - <input class="button" type="submit" name="submit" value="<?php echo __('Save Changes'); ?>"> - <input class="button" type="reset" name="reset" value="<?php echo __('Reset Changes'); ?>"> -</p> -</div> + $manage_content = function($title, $content) use ($contents) { + list($id, $name, $notes, $upd) = $contents[$content]; + $notes = explode('. ', $notes); + $notes = $notes[0]; + ?> + <tr> + <td colspan="2"> + <div style="padding:2px 5px"> + <a href="#ajax.php/content/<?php echo $id; ?>/manage" + onclick="javascript: + $.dialog($(this).attr('href').substr(1), 201); + return false;" class="pull-left"> + <i class="icon-file-text icon-2x" style="color:#bbb;"></i> + </a> + <span style="display:inline-block;width:90%;width:calc(100% - 32px);padding-left:10px;line-height:1.2em"> + <a href="#ajax.php/content/<?php echo $id; ?>/manage" + onclick="javascript: + $.dialog($(this).attr('href').substr(1), 201, null, {size:'large'}); + return false;"><?php + echo Format::htmlchars($title); ?> + </a> + </span> + <span class="faded"><?php + echo Format::display($notes); ?> + <br /> + <em><?php echo sprintf(__('Last Updated %s'), Format::datetime($upd)); + ?></em> + </span> + </div> + </td> + </tr> + <?php + }; ?> + <tr> + <th colspan="2"> + <em><b><?php echo __( + 'Authentication and Registration Templates & Pages'); ?></b></em> + </th> + </tr> + <?php $manage_content(__('Agent Welcome Email'), 'registration-staff'); ?> + <?php $manage_content(__('Sign-in Login Banner'), 'banner-staff'); ?> + <?php $manage_content(__('Password Reset Email'), 'pwreset-staff'); ?> + </tbody> + </table> + </div> + <p style="text-align:center"> + <input class="button" type="submit" name="submit" value="<?php echo __('Save Changes'); ?>"> + <input class="button" type="reset" name="reset" value="<?php echo __('Reset Changes'); ?>"> + </p> + </div> </form> diff --git a/include/staff/settings-pages.inc.php b/include/staff/settings-pages.inc.php index c0cb5699a5a104fb5aba38e43f98ebb4ccee5511..676c1d473352c7bc27d8c7d181f919249c0ec00b 100644 --- a/include/staff/settings-pages.inc.php +++ b/include/staff/settings-pages.inc.php @@ -184,7 +184,7 @@ $pages = Page::getPages(); margin: 0.5em; height: 5em; vertical-align: middle;"/> <?php if ($logo->getId() != $current && $logo->getId() != $currentScp) { ?> - <label> + <label class="checkbox inline"> <input type="checkbox" name="delete-logo[]" value="<?php echo $logo->getId(); ?>"/> <?php echo __('Delete'); ?> </label> diff --git a/include/staff/settings-system.inc.php b/include/staff/settings-system.inc.php index 5aebca8e841676240ddd44637f0b0e31a9895d8c..cd41c566dace888626b9b3fec6a27ff5b4a9b7e8 100644 --- a/include/staff/settings-system.inc.php +++ b/include/staff/settings-system.inc.php @@ -3,7 +3,7 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) $gmtime = Misc::gmtime(); ?> -<h2><?php echo __('System Settings and Preferences');?> - <span class="ltr">osTicket (<?php echo $cfg->getVersion(); ?>)</span></h2> +<h2><?php echo __('System Settings and Preferences');?> <small>— <span class="ltr">osTicket (<?php echo $cfg->getVersion(); ?>)</span></small></h2> <form action="settings.php?t=system" method="post" id="save"> <?php csrf_token(); ?> <input type="hidden" name="t" value="system" > diff --git a/include/staff/slaplan.inc.php b/include/staff/slaplan.inc.php index db16fce4495b2eca113aadbd68d1d76d1617875e..a3c806d5a8d842b2aa11ca722a0e33119c964a80 100644 --- a/include/staff/slaplan.inc.php +++ b/include/staff/slaplan.inc.php @@ -2,7 +2,7 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access Denied'); $info = $qs = array(); if($sla && $_REQUEST['a']!='add'){ - $title=__('Update SLA Plan –' /* SLA is abbreviation for Service Level Agreement */); + $title=__('Update SLA Plan' /* SLA is abbreviation for Service Level Agreement */); $action='update'; $submit_text=__('Save Changes'); $info=$sla->getInfo(); @@ -26,7 +26,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>"> <input type="hidden" name="id" value="<?php echo $info['id']; ?>"> <h2><?php echo $title; ?> - <?php if ($info) { ?> <span class="ltr"><?php echo $info['name']; ?></span> + <?php if (isset($info['name'])) { ?><small> + — <?php echo $info['name']; ?></small> <?php } ?> </h2> <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2"> @@ -90,8 +91,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); </tr> <tr> <th colspan="2"> - <em><strong><?php echo __('Admin Notes');?></strong>: <?php echo __('Internal notes.');?> - <i class="help-tip icon-question-sign" href="#admin_notes"></i></em> + <em><strong><?php echo __('Internal Notes');?></strong>: <?php echo __("be liberal, they're internal");?> </em> </th> </tr> diff --git a/include/staff/staff.inc.php b/include/staff/staff.inc.php index d23971929a748d94c8ee66fee399b7a05f9af082..bf6c8d730307a8cb40790b4c2701dca0fd5fd024 100644 --- a/include/staff/staff.inc.php +++ b/include/staff/staff.inc.php @@ -27,7 +27,7 @@ if ($_REQUEST['a']=='add'){ } else { //Editing Department. - $title=__('Manage Agent –'); + $title=__('Manage Agent'); $action='update'; $submit_text=__('Save Changes'); $info['id'] = $staff->getId(); @@ -42,8 +42,8 @@ else { <input type="hidden" name="id" value="<?php echo $info['id']; ?>"> <h2><?php echo $title; ?> - <?php if ($staff) { ?> <span class="ltr"> - <?php echo $staff->getName(); ?></span> + <?php if (isset($staff->staff_id)) { ?><small> + — <?php echo $staff->getName(); ?></small> <?php } ?> </h2> @@ -198,7 +198,7 @@ if (count($bks) > 1) { </table> <div style="padding:8px 3px; margin-top: 1.6em"> - <strong class="big"><?php echo __('Internal Notes');?></strong><br/> + <strong class="big"><?php echo __('Internal Notes');?>: </strong> <?php echo __("be liberal, they're internal.");?> </div> diff --git a/include/staff/syslogs.inc.php b/include/staff/syslogs.inc.php index 98aa50917c58d60a0f3bd16a60a7e7d23df0b2b4..35313408afcb41176d664ceeabbae8291d638ae0 100644 --- a/include/staff/syslogs.inc.php +++ b/include/staff/syslogs.inc.php @@ -114,7 +114,7 @@ else <div class="content"> <div class="pull-left flush-left"> <h2><?php echo __('System Logs');?> - <i class="help-tip icon-question-sign" href="#system_logs"></i> + <i class="help-tip icon-question-sign" href="#system_logs"></i> </h2> </div> <div id="actions" class="pull-right flush-right"> diff --git a/include/staff/team.inc.php b/include/staff/team.inc.php index 63f10ee17f60a5b5df38bd6ed7f968cbba81281b..3552d2cc7f925ba106ae85c3e73a7315bd6464f0 100644 --- a/include/staff/team.inc.php +++ b/include/staff/team.inc.php @@ -3,7 +3,7 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access $info = $members = $qs = array(); if ($team && $_REQUEST['a']!='add') { //Editing Team - $title=__('Update Team –'); + $title=__('Update Team'); $action='update'; $submit_text=__('Save Changes'); $trans['name'] = $team->getTranslateTag('name'); @@ -29,8 +29,9 @@ $info = $team->getInfo(); <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>"> <input type="hidden" name="id" value="<?php echo $team->getId(); ?>"> <h2><?php echo $title; ?> - <?php if ($team) { ?> <span class="ltr"><?php echo $team->name; ?></span> - <?php } ?> + <?php if (isset($team->name)) { ?><small> + — <?php echo $team->getName(); ?></small> + <?php } ?> <i class="help-tip icon-question-sign" href="#teams"></i> </h2> <br> diff --git a/include/staff/template.inc.php b/include/staff/template.inc.php index fc0d403aba690010f46b3fd1a3483b7be823a608..7dd34df896a9dfacdaab3c3bf76370e1bd72dd9e 100644 --- a/include/staff/template.inc.php +++ b/include/staff/template.inc.php @@ -3,7 +3,7 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access $info = $qs = array(); if($template && $_REQUEST['a']!='add'){ - $title=__('Update Template –'); + $title=__('Update Template'); $action='update'; $submit_text=__('Save Changes'); $info=$template->getInfo(); @@ -25,7 +25,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>"> <input type="hidden" name="tpl_id" value="<?php echo $info['tpl_id']; ?>"> <h2><?php echo $title; ?> - <?php if ($info) { ?> <span class="ltr"><?php echo $info['name']; ?></span> + <?php if (isset($info['name'])) { ?><small> + — <?php echo $info['name']; ?></small> <?php } ?> </h2> <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2"> diff --git a/include/staff/templates/task-view.tmpl.php b/include/staff/templates/task-view.tmpl.php index 36627948983edd1da739fabedbc054eb6992ee1b..fda5d66ef682fc62fd50d9621652365c594b2877 100644 --- a/include/staff/templates/task-view.tmpl.php +++ b/include/staff/templates/task-view.tmpl.php @@ -102,7 +102,7 @@ if ($task->isOverdue()) href="tasks.php?id=<?php echo $task->getId(); ?>" ><i class="icon-refresh"></i> <?php echo sprintf(__('Task #%s'), $task->getNumber()); ?></a> - <?php if ($task) { ?> – <span class="ltr"><?php echo $task->getTitle(); ?></span> + <?php if ($task) { ?> – <small><span class="ltr"><?php echo $task->getTitle(); ?></span></small> <?php } ?> </h2> <?php diff --git a/include/staff/ticket-open.inc.php b/include/staff/ticket-open.inc.php index 6dd80fa83db38e9d5ad69037618ea6ace2d92d70..3173d7e92bb2004149bfa209aefc84760cdb675a 100644 --- a/include/staff/ticket-open.inc.php +++ b/include/staff/ticket-open.inc.php @@ -305,8 +305,8 @@ if ($_POST) } ?> </select> - - <label><input type='checkbox' value='1' name="append" id="append" checked="checked"><?php echo __('Append');?></label> + + <label class="checkbox inline"><input type='checkbox' value='1' name="append" id="append" checked="checked"><?php echo __('Append');?></label> </div> <?php } diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index c59d7ffaa9864fbc9b2ccc3e408d5510b27f4b8a..4799b011a70e70875c3fb5a4b3360765ec6c5b93 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -194,7 +194,7 @@ if($ticket->isOverdue()) <h2><a href="tickets.php?id=<?php echo $ticket->getId(); ?>" title="<?php echo __('Reload'); ?>"><i class="icon-refresh"></i> <?php echo sprintf(__('Ticket #%s'), $ticket->getNumber()); ?></a> - <?php if ($ticket) { ?> – <?php echo $ticket->getSubject(); } ?> + <?php if ($ticket) { ?> – <small><?php echo $ticket->getSubject(); ?></small><?php } ?> </h2> </div> </div> diff --git a/scp/css/scp.css b/scp/css/scp.css index 2cb1f025e4228c6a878ba542001262b7b1c5d9e9..eeb6d0aa19c42d6dea8753fc551adffd3ae0b6ed 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -792,7 +792,7 @@ div.section-break h3 { h2 { margin:0 0 0.7em; padding:0; - font-size:1.2em; + font-size:1.4em; color:#0A568E; } @@ -803,7 +803,10 @@ h2 i { color:#0a0; } -h2 span { color:#000; } +h2 small { + font-size:.8em; +} +/*h2 span { color:#000; }*/ h3 { margin:10px 0 0 0; @@ -1431,7 +1434,7 @@ caption:hover > i.help-tip { h2 > i.help-tip { vertical-align: middle; - font-size: .85em; + font-size: .7em; } .form_table th h4 i.help-tip { color: white; @@ -2392,8 +2395,7 @@ tr i.help-tip.warning { .ltr { direction: ltr; unicode-bidi: embed; - font-weight:normal; - font-style:italic; + } .required { font-weight: bold; @@ -2799,6 +2801,16 @@ table.grid.form caption { border-top-left-radius: 3px; border-bottom-left-radius: 3px; } +select { + height:24px; + line-height:24px; + max-width:500px; + border:1px solid #bbb; + display:inline-block; + padding:4px; + font-size:13px; +} + a.attachment { padding-left: 1.2em; display: block; diff --git a/scp/js/dashboard.inc.js b/scp/js/dashboard.inc.js index 1472825963d4deed378dbdd9fc3e5bf40e5388a5..2110f0d69618630d41b3b799e3bafdacbc77e4b1 100644 --- a/scp/js/dashboard.inc.js +++ b/scp/js/dashboard.inc.js @@ -102,7 +102,6 @@ if (this.start) build_table.apply(this); return false; } - //$(function() { $('tabular-navigation').tab(); }); // Add tabs for the tabular display $(function() { @@ -116,8 +115,12 @@ .append($('<li>').attr(first ? {'class':'active'} : {}) .append($('<a>') .click(build_table) - .attr({'table-group':key,'href':'#'}) - .append(json[key]))); + .attr({'href':'#'+key}) + .append(json[key])) + ) + .after($('<div class="tab_content"></div>') + .addClass(first ? 'hidden' : undefined)) + first=false; } build_table.apply($('#tabular-navigation li:first-child a')[0]) @@ -127,13 +130,8 @@ var start, stop; function build_table() { - if (this.tagName == 'A') { - //current_tab = $(this).tab('show'); - } - else if (this.start) { - start = this.start.value || 'last month'; - stop = this.period.value || 'now'; - } + start = this.start ? this.start.value : 'last month'; + stop = this.period ? this.period.value : 'now'; if (!current_tab) current_tab = $('#tabular-navigation li:first-child a'); @@ -147,7 +145,7 @@ url: 'ajax.php/report/overview/table', data: {group: group, start: start, period: stop}, success: function(json) { - var q = $('<table>').attr({'class':'table table-condensed table-striped'}), + var q = $('<table>'), h = $('<tr>').appendTo($('<thead>').appendTo(q)), max = []; for (var c in json.columns) {