diff --git a/include/class.client.php b/include/class.client.php index 2d157ede502923d5e88fcbfa90f79924346c30b7..2d1f2930c12b2cc8201fc8313b54656836625fac 100644 --- a/include/class.client.php +++ b/include/class.client.php @@ -457,7 +457,6 @@ class ClientAccount extends UserAccount { if ($errors) return false; $this->set('timezone', $vars['timezone']); - $this->set('dst', isset($vars['dst']) ? 1 : 0); // Change language $this->set('lang', $vars['lang'] ?: null); Internationalization::setCurrentLanguage(null); diff --git a/include/staff/dashboard.inc.php b/include/staff/dashboard.inc.php index 3c91e3c5fd9135cb550a2c39de52c4a0411445db..c921b2b40964040ac66147f21114e7155e8b1b31 100644 --- a/include/staff/dashboard.inc.php +++ b/include/staff/dashboard.inc.php @@ -180,4 +180,16 @@ foreach ($groups as $g=>$desc) { </form> <script> $.drawPlots(<?php echo JsonDataEncoder::encode($report->getPlotData()); ?>); + // Set Selected Period For Dashboard Stats and Export + <?php if ($report && $report->end) { ?> + $("div#basic_search select option").each(function(){ + // Remove default selection + if ($(this)[0].selected) + $(this).removeAttr('selected'); + // Set the selected period by the option's value (periods equal + // option's values) + if ($(this).val() == "<?php echo $report->end; ?>") + $(this).attr("selected","selected"); + }); + <?php } ?> </script> diff --git a/include/staff/templates/task-view.tmpl.php b/include/staff/templates/task-view.tmpl.php index 130beecf417e99def01f237d3e333f2bbb99b4df..d56b230c2e96f26cb789b4a954ea3ee41777715a 100644 --- a/include/staff/templates/task-view.tmpl.php +++ b/include/staff/templates/task-view.tmpl.php @@ -146,7 +146,7 @@ if ($task->isOverdue()) <ul> <?php - if ($task->isOpen()) { ?> + if (!$task->isOpen()) { ?> <li> <a class="no-pjax task-action" href="#tasks/<?php echo $task->getId(); ?>/reopen"><i @@ -664,7 +664,10 @@ $(function() { .slideUp(); } }) - .done(function() { }) + .done(function() { + $('#loading').hide(); + $.toggleOverlay(false); + }) .fail(function() { }); }); <?php diff --git a/include/staff/templates/tasks-actions.tmpl.php b/include/staff/templates/tasks-actions.tmpl.php index dc59eae4fc5827a7231c39dbdbb4a7fc2f9c0d2e..e323e30602aee51bd9bd7efe14a3879610a163a5 100644 --- a/include/staff/templates/tasks-actions.tmpl.php +++ b/include/staff/templates/tasks-actions.tmpl.php @@ -7,57 +7,23 @@ if ($agent->hasPerm(Task::PERM_CLOSE, false)) { if (isset($options['status'])) { $status = $options['status']; - ?> - <span - class="action-button" - data-dropdown="#action-dropdown-tasks-status"> - <i class="icon-caret-down pull-right"></i> - <a class="tasks-status-action" - href="#statuses" - data-placement="bottom" - data-toggle="tooltip" - title="<?php echo __('Change Status'); ?>"><i - class="icon-flag"></i></a> - </span> - <div id="action-dropdown-tasks-status" - class="action-dropdown anchor-right"> - <ul> - <?php - if (!$status || !strcasecmp($status, 'closed')) { ?> - <li> - <a class="no-pjax tasks-action" - href="#tasks/mass/reopen"><i - class="icon-fixed-width icon-undo"></i> <?php - echo __('Reopen');?> </a> - </li> - <?php - } - if (!$status || !strcasecmp($status, 'open')) { - ?> - <li> - <a class="no-pjax tasks-action" - href="#tasks/mass/close"><i - class="icon-fixed-width icon-ok-circle"></i> <?php - echo __('Close');?> </a> - </li> - <?php - } ?> - </ul> - </div> -<?php - } else { - $actions += array( - 'reopen' => array( - 'icon' => 'icon-undo', - 'action' => __('Reopen') - )); + if (strpos($status, 'closed') !== false) { + $actions += array( + 'reopen' => array( + 'icon' => 'icon-undo', + 'action' => __('Reopen') + )); + } - $actions += array( - 'close' => array( - 'icon' => 'icon-ok-circle', - 'action' => __('Close') - )); + + if (strpos($status, 'open') !== false) { + $actions += array( + 'close' => array( + 'icon' => 'icon-ok-circle', + 'action' => __('Close') + )); + } } } @@ -95,7 +61,7 @@ if ($agent->hasPerm(Task::PERM_DELETE, false)) { 'action' => __('Delete') )); } -if ($actions && !isset($options['status'])) { +if ($actions && isset($options['status'])) { $more = $options['morelabel'] ?: __('More'); ?> <span diff --git a/include/staff/ticket-tasks.inc.php b/include/staff/ticket-tasks.inc.php index ec19431ac78f1bd772377e31212e1d31be32bab0..8c0bc5db4ac54a322cd0d288efdef2d31a713f8f 100644 --- a/include/staff/ticket-tasks.inc.php +++ b/include/staff/ticket-tasks.inc.php @@ -40,12 +40,17 @@ $showing = $pageNav->showing().' '._N('task', 'tasks', $count); print __('Add New Task'); ?></a> <?php } + foreach ($tasks as $task) + $taskStatus .= $task->isOpen() ? 'open' : 'closed'; + if ($count) Task::getAgentActions($thisstaff, array( 'container' => '#tasks_content', 'callback_url' => sprintf('ajax.php/tickets/%d/tasks', $ticket->getId()), - 'morelabel' => __('Options'))); + 'morelabel' => __('Options'), + 'status' => $taskStatus ? $taskStatus : '') + ); ?> </div> <div class="clear"></div> diff --git a/scp/login.php b/scp/login.php index 6e1854456c5757f4fdab2b3289728b3cc24a34fc..4853f7e31f028cd84f31cca74ddc833631a4d105 100644 --- a/scp/login.php +++ b/scp/login.php @@ -64,6 +64,8 @@ if ($_POST) { $redirect($_SERVER['REQUEST_URI']); } +} +if ($_POST && isset($_POST['userid'])) { // Lookup support backends for this staff $username = trim($_POST['userid']); if ($user = StaffAuthenticationBackend::process($username, @@ -94,8 +96,11 @@ elseif ($_GET['do']) { // Consider single sign-on authentication backends elseif (!$thisstaff || !($thisstaff->getId() || $thisstaff->isValid())) { if (($user = StaffAuthenticationBackend::processSignOn($errors, false)) - && ($user instanceof StaffSession)) - Http::redirect($dest); + && ($user instanceof StaffSession)) { + Http::redirect($dest); + } else if (isset($_SESSION['_staff']['auth']['msg'])) { + $msg = $_SESSION['_staff']['auth']['msg']; + } } // Browsers shouldn't suggest saving that username/password