diff --git a/include/class.osticket.php b/include/class.osticket.php index bef678239f2d66562e2af1c3d9219e35a4a428fd..fd300184a96b985b1c1b1022817b2b11e85fc4aa 100644 --- a/include/class.osticket.php +++ b/include/class.osticket.php @@ -26,7 +26,16 @@ define('LOG_WARN',LOG_WARNING); class osTicket { var $loglevel=array(1=>'Error','Warning','Debug'); + + //Page errors. var $errors; + + //System + var $system; + + + + var $warning; var $message; @@ -187,18 +196,15 @@ class osTicket { } function setErrors($errors) { - if(!is_array($errors)) - return $this->setError($errors); - $this->errors = $errors; } function getError() { - return $this->errors['err']; + return $this->system['err']; } function setError($error) { - $this->errors['err'] = $error; + $this->system['error'] = $error; } function clearError() { @@ -206,11 +212,11 @@ class osTicket { } function getWarning() { - return $this->warning; + return $this->system['warning']; } - function setWarning($warn) { - $this->warning = $warn; + function setWarning($warning) { + $this->system['warning'] = $warning; } function clearWarning() { @@ -218,16 +224,16 @@ class osTicket { } - function getMessage() { - return $this->message; + function getNotice() { + return $this->system['notice']; } - function setMessage($msg) { - $this->message = $msg; + function setNotice($notice) { + $this->system['notice'] = $notice; } - function clearMessage() { - $this->setMessage(''); + function clearNotice() { + $this->setNotice(''); } diff --git a/include/staff/header.inc.php b/include/staff/header.inc.php index a349cb3c6ecb662f2d82f64086fc4984e295c263..8475f328606a9e70892a97daef6ebb0e96aa7352 100644 --- a/include/staff/header.inc.php +++ b/include/staff/header.inc.php @@ -31,6 +31,14 @@ </head> <body> <div id="container"> + <?php + if($ost->getError()) + echo sprintf('<div id="error_bar">%s</div>', $ost->getError()); + elseif($ost->getWarning()) + echo sprintf('<div id="warning_bar">%s</div>', $ost->getWarning()); + elseif($ost->getNotice()) + echo sprintf('<div id="notice_bar">%s</div>', $ost->getNotice()); + ?> <div id="header"> <a href="index.php" id="logo">osTicket - Customer Support System</a> <p id="info">Howdy, <strong><?php echo $thisstaff->getUserName(); ?></strong> diff --git a/scp/admin.inc.php b/scp/admin.inc.php index 8a41c54db7f690b3caec9ee7728345bba1570000..66fca5d976bb3b9c4a76eed99b71657ab28f0d64 100644 --- a/scp/admin.inc.php +++ b/scp/admin.inc.php @@ -25,6 +25,7 @@ define('OSTADMININC',TRUE); //checked by admin include files define('ADMINPAGE',TRUE); //Used by the header to swap menus. //Some security related warnings - bitch until fixed!!! :) +$sysnotice= ''; if($ost->isUpgradePending()) { $errors['err']=$sysnotice='System upgrade is pending <a href="upgrade.php">Upgrade Now</a>'; if(!in_array(basename($_SERVER['SCRIPT_NAME']), array('upgrade.php', 'logs.php'))) { @@ -57,6 +58,9 @@ if($ost->isUpgradePending()) { $sysnotice='Please consider turning off register globals if possible'; } +//System notice displayed as a warning (if any). +$ost->setWarning($sysnotice); + //Admin navigation - overwrites what was set in staff.inc.php $nav = new AdminNav($thisstaff); diff --git a/scp/css/scp.css b/scp/css/scp.css index c345799ba2ecf80fe23df6ab589ed6f74a0dadde..04bd90d604e5a6265b159e49279792db58fbe4ef 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -43,12 +43,18 @@ a { color: #555; } -#msg_notice { margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; margin-bottom: 10px; border: 1px solid #0a0; background: url('../images/icons/ok.png?1300763726') 10px 50% no-repeat #e0ffe0; } +#msg_notice { margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; margin-bottom: 10px; border: 1px solid #0a0; background: url('../images/icons/ok.png') 10px 50% no-repeat #e0ffe0; } -#msg_warning { margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; margin-bottom: 10px; border: 1px solid #f26522; background: url('../images/icons/alert.png?1307823786') 10px 50% no-repeat #ffffdd; } +#msg_warning { margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; margin-bottom: 10px; border: 1px solid #f26522; background: url('../images/icons/alert.png') 10px 50% no-repeat #ffffdd; } #msg_error { margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; margin-bottom: 10px; border: 1px solid #a00; background: url('../images/icons/error.png') 10px 50% no-repeat #fff0f0; } +#notice_bar { margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; border: 1px solid #0a0; background: url('../images/icons/ok.png') 10px 50% no-repeat #e0ffe0; } + +#warning_bar { margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; border: 1px solid #f26522; background: url('../images/icons/alert.png') 10px 50% no-repeat #ffffdd; } + +#error_bar { margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; border: 1px solid #a00; background: url('../images/icons/error.png') 10px 50% no-repeat #fff0f0; } + #container { width:960px; diff --git a/scp/staff.inc.php b/scp/staff.inc.php index 8553a8bac1fef78482532de7789723af43e6c20d..8a91e4774803886deed8abce8e62bab01ffaff87 100644 --- a/scp/staff.inc.php +++ b/scp/staff.inc.php @@ -119,10 +119,11 @@ $nav = new StaffNav($thisstaff); if($thisstaff->forcePasswdChange() && !$exempt) { # XXX: Call staffLoginPage() for AJAX and API requests _not_ to honor # the request + $sysnotice = 'Password change required to continue'; require('profile.php'); //profile.php must request this file as require_once to avoid problems. exit; } - +$ost->setWarning($sysnotice); $ost->setPageTitle('osTicket :: Staff Control Panel'); ?> diff --git a/scp/tickets.php b/scp/tickets.php index 47395d592c2da9cb505daec7d037fb1349711dfa..32c1cab50634f9e2f1da8a03a1895b8563ce40e1 100644 --- a/scp/tickets.php +++ b/scp/tickets.php @@ -470,8 +470,8 @@ if($cfg->showAnsweredTickets()) { } if($stats['assigned']) { - if(!$sysnotice && $stats['assigned']>10) - $sysnotice=$stats['assigned'].' assigned to you!'; + if(!$ost->getWarning() && $stats['assigned']>3) + $ost->setWarning($stats['assigned'].' tickets assigned to you! Do something about it!'); $nav->addSubMenu(array('desc'=>'My Tickets ('.$stats['assigned'].')', 'title'=>'Assigned Tickets',