From ce17247db6b59db2a8620d7cb4f2f1b858063577 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 8 May 2013 19:00:47 +1000 Subject: [PATCH] Enabled Search, Improved Navbar, Fixed Application Authorisation and some other minor fixes --- application/classes/Config.php | 2 +- application/classes/Controller/Search.php | 14 + .../classes/Controller/User/Search.php | 37 ++ application/classes/Kohana/Exception.php | 8 +- application/classes/Model/Account.php | 21 +- application/classes/Model/RTM.php | 4 + application/classes/ORM.php | 63 ++ application/classes/ORM/OSB.php | 1 - application/classes/URL.php | 23 +- application/media/js/custom.js | 0 .../smoothness/jquery-ui-1.8.16.custom.css | 565 ++++++++++++++++++ application/media/js/search.js | 32 + application/views/errors/404.php | 28 +- .../views/theme/baseadmin/pages/navbar.php | 4 +- .../classes/Model/Service/Plugin/Adsl.php | 21 + .../classes/Controller/Admin/Charge.php | 4 +- modules/checkout/classes/Model/Checkout.php | 3 + .../classes/Model/Service/Plugin/Domain.php | 21 + modules/email/classes/Email/Template.php | 2 +- modules/email/classes/Model/Email/Log.php | 2 +- .../Model/Email/Template/Translate.php | 2 +- .../classes/Model/Service/Plugin/Host.php | 21 + modules/invoice/classes/Model/Invoice.php | 30 +- modules/lnApp | 2 +- .../classes/Controller/Admin/Payment.php | 4 +- .../payment/views/payment/admin/add_view.php | 2 +- modules/service/classes/Model/Service.php | 28 +- 27 files changed, 877 insertions(+), 67 deletions(-) create mode 100644 application/classes/Controller/Search.php create mode 100644 application/classes/Controller/User/Search.php create mode 100644 application/media/js/custom.js create mode 100755 application/media/js/jquery.ui/css/smoothness/jquery-ui-1.8.16.custom.css create mode 100644 application/media/js/search.js diff --git a/application/classes/Config.php b/application/classes/Config.php index 07a801b4..29b6aa82 100644 --- a/application/classes/Config.php +++ b/application/classes/Config.php @@ -172,7 +172,7 @@ class Config extends Kohana_Config { public static function theme() { // If we are using user admin pages (and login), we'll choose the admin theme. - if (! empty(URL::$method_directory[strtolower(Request::current()->directory())]) OR in_array(strtolower(Request::current()->controller()),array('login'))) + if (Request::current() AND (! empty(URL::$method_directory[strtolower(Request::current()->directory())]) OR in_array(strtolower(Request::current()->controller()),array('login')))) return 'theme/'.Kohana::$config->load('config')->theme_admin; else return 'theme/'.Kohana::$config->load('config')->theme; diff --git a/application/classes/Controller/Search.php b/application/classes/Controller/Search.php new file mode 100644 index 00000000..635fb0ff --- /dev/null +++ b/application/classes/Controller/Search.php @@ -0,0 +1,14 @@ + diff --git a/application/classes/Controller/User/Search.php b/application/classes/Controller/User/Search.php new file mode 100644 index 00000000..db7a74b8 --- /dev/null +++ b/application/classes/Controller/User/Search.php @@ -0,0 +1,37 @@ +TRUE, + ); + + /** + * Used by AJAX calls to find accounts, invoices, services and payments + */ + public function action_ajaxlist() { + $result = array(); + + if (isset($_REQUEST['term']) AND trim($_REQUEST['term'])) { + $result = array_merge($result,ORM::factory('Account')->list_autocomplete($_REQUEST['term'],'url','id',array('ACC %s: %s'=>array('id','name(TRUE)')),array(),array('urlprefix'=>'a/service/list/'))); + $result = array_merge($result,ORM::factory('Invoice')->list_autocomplete($_REQUEST['term'],'url','id',array('INV %s: %s'=>array('id','account->name(TRUE)')),array(),array('urlprefix'=>'u/invoice/view/'))); + $result = array_merge($result,ORM::factory('Service')->list_autocomplete($_REQUEST['term'],'url','id',array('SVC %s: %s'=>array('id','service_name()')),array(),array('urlprefix'=>'u/service/view/'))); + + foreach (array('Service_Plugin_Adsl','Service_Plugin_Domain','Service_Plugin_Host') as $o) + $result = array_merge($result,ORM::factory($o)->list_autocomplete($_REQUEST['term'],'url','service_id',array('SVC %s: %s'=>array('service_id','service_name()')),array(),array('urlprefix'=>'u/service/view/'))); + } + + $this->auto_render = FALSE; + $this->response->headers('Content-Type','application/json'); + $this->response->body(json_encode(array_values($result))); + } +} +?> diff --git a/application/classes/Kohana/Exception.php b/application/classes/Kohana/Exception.php index 2ab18210..a9bdedf9 100644 --- a/application/classes/Kohana/Exception.php +++ b/application/classes/Kohana/Exception.php @@ -22,8 +22,12 @@ class Kohana_Exception extends Kohana_Kohana_Exception { $eo = ORM::factory('Log_Error'); $eo->message = Kohana_Exception::text($e); $eo->account_id = Auth::instance()->get_user()->id; - $eo->module = (Request::current()->directory() ? Request::current()->directory().'_' : '').Request::current()->controller(); - $eo->method = Request::current()->action(); + + if (Request::current()) { + $eo->module = (Request::current()->directory() ? Request::current()->directory().'_' : '').Request::current()->controller(); + $eo->method = Request::current()->action(); + } + $eo->save(); } catch (Exception $x) { diff --git a/application/classes/Model/Account.php b/application/classes/Model/Account.php index 08e0b9ba..6957b30f 100644 --- a/application/classes/Model/Account.php +++ b/application/classes/Model/Account.php @@ -166,13 +166,11 @@ class Model_Account extends Model_Auth_UserDefault { /** * Search for accounts matching a term */ - public function list_autocomplete($term,$index='id',array $limit=array()) { - $result = array(); + public function list_autocomplete($term,$index,$value,array $label,array $limit=array(),array $options=NULL) { $ao = Auth::instance()->get_user(); $this->clear(); $this->where_active(); - $value = 'name(TRUE)'; // Build our where clause // First Name, Last name @@ -190,7 +188,6 @@ class Model_Account extends Model_Auth_UserDefault { } elseif (preg_match('/\@/',$term)) { $this->where('email','like','%'.$term.'%'); - $value = 'email'; } else { $this->where_open() @@ -201,22 +198,10 @@ class Model_Account extends Model_Auth_UserDefault { ->where_close(); } - foreach ($limit as $w) { - list($k,$s,$v) = $w; - - $this->and_where($k,$s,$v); - } - // Restrict results to authorised accounts - $this->and_where('id','IN',$ao->RTM->customers($ao->RTM)); + array_push($limit,array('id','IN',$ao->RTM->customers($ao->RTM))); - foreach ($this->find_all() as $o) - $result[$o->$index] = array( - 'value'=>$o->$index, - 'label'=>sprintf('ACC %s: %s',$o->id,Table::resolve($o,$value)), - ); - - return $result; + return parent::list_autocomplete($term,$index,$value,$label,$limit,$options); } } ?> diff --git a/application/classes/Model/RTM.php b/application/classes/Model/RTM.php index 635ee2b1..a5e11e22 100644 --- a/application/classes/Model/RTM.php +++ b/application/classes/Model/RTM.php @@ -20,6 +20,10 @@ class Model_RTM extends ORM_OSB { ); public function customers(Model_RTM $rtmo) { + // If our RTM is NULL, then we are our only customer. + if (is_null($rtmo->id)) + return (array(Auth::Instance()->get_user())); + $result = array(); foreach ($rtmo->agents_direct() as $artmo) diff --git a/application/classes/ORM.php b/application/classes/ORM.php index 40452060..5a0a0fe8 100644 --- a/application/classes/ORM.php +++ b/application/classes/ORM.php @@ -33,6 +33,13 @@ abstract class ORM extends Kohana_ORM { $this->_formated = TRUE; } + public function clear() { + $this->_formated = FALSE; + $this->_object_formated = array(); + + return parent::clear(); + } + /** * Return a formated columns, as per the model definition */ @@ -111,6 +118,62 @@ abstract class ORM extends Kohana_ORM { return $this->_where_active()->find_all(); } + public function list_autocomplete($term,$index,$value,array $label,array $limit=array(),array $options=NULL) { + $result = array(); + + $query = empty($options['object']) ? $this : $options['object']; + + foreach ($limit as $w) { + list($k,$s,$v) = $w; + + $query->and_where($k,$s,$v); + } + + $c = 0; + foreach ((empty($options['object']) ? $query->find_all() : $query->execute()) as $o) { + // If we got here via a DB query, we need to reload our ORM object from the result. + if (! is_object($o)) { + if (empty($options['key'])) + throw new Kohana_Exception('Missing key for non object'); + + $o = $this->clear()->where($options['key'],'=',$o[$options['key']])->find(); + } + + switch ($index) { + case 'url': + if (empty($options['urlprefix'])) + throw new Kohana_Exception('Missing URL Prefix'); + + $v = $options['urlprefix'].$o->resolve($value); + + break; + + default: $v = $o->resolve($value); + } + + $k = ''; + foreach ($label as $k => $details) + foreach ($details as $lvalue) + $k = preg_replace('/%s/',$o->resolve($lvalue),$k,1); + + $result[$c++] = array( + 'value'=>$v, + 'label'=>$k, + ); + } + + return $result; + } + + /** + * This function is used so that methods can be called via variables + */ + public function resolve($key) { + eval("\$x = \$this->$key;"); + + return $x; + } + /** * Function help to find records that are active */ diff --git a/application/classes/ORM/OSB.php b/application/classes/ORM/OSB.php index 756918ed..bc28b4e4 100644 --- a/application/classes/ORM/OSB.php +++ b/application/classes/ORM/OSB.php @@ -104,7 +104,6 @@ abstract class ORM_OSB extends ORM { $this->_object[$column] = $this->_blob($this->_object[$column]); } catch(Exception $e) { -echo Debug::vars($e);die(); // @todo Log this exception echo Kohana_Exception::text($e), "\n"; echo debug_print_backtrace(); diff --git a/application/classes/URL.php b/application/classes/URL.php index 303ef1fc..a7c02294 100644 --- a/application/classes/URL.php +++ b/application/classes/URL.php @@ -14,8 +14,8 @@ class URL extends Kohana_URL { public static $method_directory = array( 'admin'=>'a', 'reseller'=>'r', - 'task'=>'task', 'user'=>'u', + 'task'=>'task', ); /** @@ -49,5 +49,26 @@ class URL extends Kohana_URL { // If we get here, we didnt have anything. return $dir; } + + public static function navbar() { + $result = array(); + + foreach (array_reverse(static::$method_directory) as $k=>$v) + switch ($k) { + case 'admin': $result[$k] = array('name'=>'Administrator','icon'=>'icon-globe'); + break; + + case 'affiliate': + case 'reseller': $result[$k] = array('name'=>'Reseller','icon'=>'icon-th-list'); + break; + + case 'user': $result[$k] = array('name'=>Auth::instance()->get_user()->name(),'icon'=>'icon-user'); + break; + + default: $result[$k] = array('name'=>$k,'icon'=>'icon-question-sign'); + } + + return $result; + } } ?> diff --git a/application/media/js/custom.js b/application/media/js/custom.js new file mode 100644 index 00000000..e69de29b diff --git a/application/media/js/jquery.ui/css/smoothness/jquery-ui-1.8.16.custom.css b/application/media/js/jquery.ui/css/smoothness/jquery-ui-1.8.16.custom.css new file mode 100755 index 00000000..fcadf559 --- /dev/null +++ b/application/media/js/jquery.ui/css/smoothness/jquery-ui-1.8.16.custom.css @@ -0,0 +1,565 @@ +/*! + * jQuery UI CSS Framework 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } +.ui-helper-clearfix:after { clear: both; } +.ui-helper-clearfix { zoom: 1; } +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and ../img */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + +/*! + * jQuery UI CSS Framework 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px + */ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(../img/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content a { color: #222222; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(../img/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header a { color: #222222; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(../img/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(../img/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(../img/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(../img/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(../img/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and ../img */ +.ui-icon { width: 16px; height: 16px; background-image: url(../img/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(../img/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(../img/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(../img/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(../img/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(../img/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(../img/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(../img/ui-icons_cd0a0a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; } +.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa url(../img/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(../img/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*! + * jQuery UI Resizable 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizable#theming + */ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; } +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*! + * jQuery UI Selectable 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +/*! + * jQuery UI Accordion 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } +/*! + * jQuery UI Autocomplete 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu 1.8.21 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} +/*! + * jQuery UI Button 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ +/*! + * jQuery UI Dialog 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/*! + * jQuery UI Slider 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider#theming + */ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/*! + * jQuery UI Tabs 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs#theming + */ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } +/*! + * jQuery UI Datepicker 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/*! + * jQuery UI Progressbar 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:2em; text-align: left; overflow: hidden; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } diff --git a/application/media/js/search.js b/application/media/js/search.js new file mode 100644 index 00000000..adc2fd41 --- /dev/null +++ b/application/media/js/search.js @@ -0,0 +1,32 @@ +$(document).ready(function() { + $("input[name=search-query]").typeahead({ + minLength: 2, + source: function (query,process) { + search (query,process); + }, + + matcher: function () { return true; }, + + updater: function (item) { + window.parent.location.href = site_url+users[item]; + }, + }); +}); + +var search = _.debounce(function( query, process ){ + $.get(site_url+"/u/search/ajaxlist", {term: query}, function (data) { + users = {}; + userLabels = []; + + _.each( data, function( item, ix, list ){ + if ( _.contains( users, item.label ) ){ + item.label = item.label + ' #' + item.value; + } + + userLabels.push( item.label ); + users[ item.label ] = item.value; + }); + + process( userLabels ); + }) +}, 300); diff --git a/application/views/errors/404.php b/application/views/errors/404.php index 3c0463d8..d840cc74 100644 --- a/application/views/errors/404.php +++ b/application/views/errors/404.php @@ -1 +1,27 @@ - +type('file') + ->data('media/css/pages/error.css'); + + echo View::factory('theme/focusbusiness/page') + ->set('meta',new Meta) + ->set('navbar','') + ->set('content',' +
+
+
+
+

Oops!

+

404 Not Found?

+
+ Sorry, an error has occured, requested page not found? +
+
+ '.HTML::anchor('/',' Back to Home',array('class'=>'btn btn-large btn-primary')).' +
+
+
+
+
+'); +?> diff --git a/application/views/theme/baseadmin/pages/navbar.php b/application/views/theme/baseadmin/pages/navbar.php index b5bcd942..6c737bac 100644 --- a/application/views/theme/baseadmin/pages/navbar.php +++ b/application/views/theme/baseadmin/pages/navbar.php @@ -1,8 +1,8 @@ -Auth::instance()->get_user()->name(),'reseller'=>'Reseller','affiliate'=>'Affiliate','admin'=>'Administrator') as $type => $ddname) : ?> + $details) : ?> diff --git a/modules/adsl/classes/Model/Service/Plugin/Adsl.php b/modules/adsl/classes/Model/Service/Plugin/Adsl.php index a8f9928e..9c13135b 100644 --- a/modules/adsl/classes/Model/Service/Plugin/Adsl.php +++ b/modules/adsl/classes/Model/Service/Plugin/Adsl.php @@ -394,5 +394,26 @@ class Model_Service_Plugin_Adsl extends Model_Service_Plugin { return View::factory('service/user/plugin/adsl/table_traffic') ->set('traffic',$this->traffic_month((! is_null($month) AND trim($month)) ? strtotime($month.'-01') : NULL,FALSE)); } + + /** + * Search for services matching a term + */ + public function list_autocomplete($term,$index,$value,array $label,array $limit=array(),array $options=NULL) { + // We only show invoice numbers. + if (! is_numeric($term)) + return array(); + + $ao = Auth::instance()->get_user(); + + $options['key'] = 'id'; + $options['object'] = DB::select($this->_table_name.'.id',$this->_table_name.'.service_number') + ->from($this->_table_name) + ->join('service') + ->on('service.id','=',$this->_table_name.'.service_id') + ->where('service.account_id','IN',$ao->RTM->customers($ao->RTM)) + ->and_where($this->_table_name.'.service_number','like','%'.$term.'%'); + + return parent::list_autocomplete($term,$index,$value,$label,$limit,$options); + } } ?> diff --git a/modules/charge/classes/Controller/Admin/Charge.php b/modules/charge/classes/Controller/Admin/Charge.php index 89e49d3b..17f6845c 100644 --- a/modules/charge/classes/Controller/Admin/Charge.php +++ b/modules/charge/classes/Controller/Admin/Charge.php @@ -79,12 +79,12 @@ class Controller_Admin_Charge extends Controller_TemplateDefault_Admin { Style::add(array( 'type'=>'file', - 'data'=>'js/jquery.ui/css/smoothness/jquery-ui-1.8.16.custom.css', + 'data'=>'media/js/jquery.ui/css/smoothness/jquery-ui-1.8.16.custom.css', )); Script::add(array( 'type'=>'file', - 'data'=>'js/jquery-ui-1.8.16.custom.min.js', + 'data'=>'media/js/jquery-ui-1.8.16.custom.min.js', )); Script::add(array('type'=>'stdin','data'=>' diff --git a/modules/checkout/classes/Model/Checkout.php b/modules/checkout/classes/Model/Checkout.php index 1d0cb435..d4ea268f 100644 --- a/modules/checkout/classes/Model/Checkout.php +++ b/modules/checkout/classes/Model/Checkout.php @@ -15,6 +15,9 @@ class Model_Checkout extends ORM_OSB { 'payment'=>array(), ); + protected $_sorting = array('name'=>'ASC'); + protected $_form = array('id'=>'id','value'=>'name'); + /** * Calcuale the fee for this checkout method * diff --git a/modules/domain/classes/Model/Service/Plugin/Domain.php b/modules/domain/classes/Model/Service/Plugin/Domain.php index 99632f87..cbf4e064 100644 --- a/modules/domain/classes/Model/Service/Plugin/Domain.php +++ b/modules/domain/classes/Model/Service/Plugin/Domain.php @@ -79,5 +79,26 @@ class Model_Service_Plugin_Domain extends Model_Service_Plugin { public function manage_dns_button() { return $this->service_plugin_host->manage_button('service_plugin_host'); } + + /** + * Search for services matching a term + */ + public function list_autocomplete($term,$index,$value,array $label,array $limit=array(),array $options=NULL) { + // We only show domain names. + if (is_numeric($term)) + return array(); + + $ao = Auth::instance()->get_user(); + + $options['key'] = 'id'; + $options['object'] = DB::select($this->_table_name.'.id',$this->_table_name.'.domain_name') + ->from($this->_table_name) + ->join('service') + ->on('service.id','=',$this->_table_name.'.service_id') + ->where('service.account_id','IN',$ao->RTM->customers($ao->RTM)) + ->and_where($this->_table_name.'.domain_name','like','%'.$term.'%'); + + return parent::list_autocomplete($term,$index,$value,$label,$limit,$options); + } } ?> diff --git a/modules/email/classes/Email/Template.php b/modules/email/classes/Email/Template.php index f6933927..6ba04026 100644 --- a/modules/email/classes/Email/Template.php +++ b/modules/email/classes/Email/Template.php @@ -114,7 +114,7 @@ class Email_Template { foreach ($this->components as $component) { if ($this->etto->loaded()) { - $s = $this->etto->resolve($this->email_data['variables'],$component); + $s = $this->etto->rresolve($this->email_data['variables'],$component); switch ($component) { case 'message_html': diff --git a/modules/email/classes/Model/Email/Log.php b/modules/email/classes/Model/Email/Log.php index 0afcc984..b07b27ad 100644 --- a/modules/email/classes/Model/Email/Log.php +++ b/modules/email/classes/Model/Email/Log.php @@ -32,7 +32,7 @@ class Model_Email_Log extends ORM_OSB { if (! $this->data OR ! ($this->email_template_translate->variables($column))) return $this->email_template_translate->display($column); else - return $this->email_template_translate->resolve($this->data,$column); + return $this->email_template_translate->rresolve($this->data,$column); } } ?> diff --git a/modules/email/classes/Model/Email/Template/Translate.php b/modules/email/classes/Model/Email/Template/Translate.php index c919353a..e49f136a 100644 --- a/modules/email/classes/Model/Email/Template/Translate.php +++ b/modules/email/classes/Model/Email/Template/Translate.php @@ -28,7 +28,7 @@ class Model_Email_Template_Translate extends ORM_OSB { return $results; } - public function resolve($data,$column) { + public function rresolve($data,$column) { $output = $this->display($column); foreach ($this->variables($column) as $k => $v) diff --git a/modules/host/classes/Model/Service/Plugin/Host.php b/modules/host/classes/Model/Service/Plugin/Host.php index 29169af2..8c6c7b0f 100644 --- a/modules/host/classes/Model/Service/Plugin/Host.php +++ b/modules/host/classes/Model/Service/Plugin/Host.php @@ -75,5 +75,26 @@ class Model_Service_Plugin_Host extends Model_Service_Plugin { return ($this->username_value() AND $this->password_value() AND $a=$this->host_server->plugin()) ? $a->manage_button($this,$t) : ''; } + + /** + * Search for services matching a term + */ + public function list_autocomplete($term,$index,$value,array $label,array $limit=array(),array $options=NULL) { + // We only show domain names. + if (is_numeric($term)) + return array(); + + $ao = Auth::instance()->get_user(); + + $options['key'] = 'id'; + $options['object'] = DB::select($this->_table_name.'.id',$this->_table_name.'.domain_name') + ->from($this->_table_name) + ->join('service') + ->on('service.id','=',$this->_table_name.'.service_id') + ->where('service.account_id','IN',$ao->RTM->customers($ao->RTM)) + ->and_where($this->_table_name.'.domain_name','like','%'.$term.'%'); + + return parent::list_autocomplete($term,$index,$value,$label,$limit,$options); + } } ?> diff --git a/modules/invoice/classes/Model/Invoice.php b/modules/invoice/classes/Model/Invoice.php index 78c010a6..a609d3b8 100644 --- a/modules/invoice/classes/Model/Invoice.php +++ b/modules/invoice/classes/Model/Invoice.php @@ -529,25 +529,25 @@ class Model_Invoice extends ORM_OSB implements Cartable { /** * Search for invoices matching a term */ - public function list_autocomplete($term,$index='id') { - $result = array(); + public function list_autocomplete($term,$index,$value,array $label,array $limit=array(),array $options=NULL) { + // We only show invoice numbers. + if (! is_numeric($term)) + return array(); - if (is_numeric($term)) { - $this->clear(); - $value = 'account->name(TRUE)'; + $ao = Auth::instance()->get_user(); - // Build our where clause - $this->where('id','like','%'.$term.'%'); + $this->clear(); + $this->where_active(); - // @todo This should limit the results so that users dont see other users services. - foreach ($this->find_all() as $o) - $result[$o->$index] = array( - 'value'=>$o->$index, - 'label'=>sprintf('INV %s: %s',$o->id,Table::resolve($o,$value)), - ); - } + // Build our where clause + $this->where_open() + ->where('id','like','%'.$term.'%') + ->where_close(); - return $result; + // Restrict results to authorised accounts + array_push($limit,array('account_id','IN',$ao->RTM->customers($ao->RTM))); + + return parent::list_autocomplete($term,$index,$value,$label,$limit,$options); } private function _list_due() { diff --git a/modules/lnApp b/modules/lnApp index 74a9c291..b65ddab2 160000 --- a/modules/lnApp +++ b/modules/lnApp @@ -1 +1 @@ -Subproject commit 74a9c291e47ed245ba16304b9e73bbcc7f8edb0e +Subproject commit b65ddab2d0499e00e2b0e4caebc2178433b25c5b diff --git a/modules/payment/classes/Controller/Admin/Payment.php b/modules/payment/classes/Controller/Admin/Payment.php index 32562bee..07793691 100644 --- a/modules/payment/classes/Controller/Admin/Payment.php +++ b/modules/payment/classes/Controller/Admin/Payment.php @@ -126,12 +126,12 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin { Style::add(array( 'type'=>'file', - 'data'=>'js/jquery.ui/css/smoothness/jquery-ui-1.8.16.custom.css', + 'data'=>'media/js/jquery.ui/css/smoothness/jquery-ui-1.8.16.custom.css', )); Script::add(array( 'type'=>'file', - 'data'=>'js/jquery-ui-1.8.16.custom.min.js', + 'data'=>'media/js/jquery-ui-1.8.16.custom.min.js', )); Script::add(array('type'=>'stdin','data'=>' diff --git a/modules/payment/views/payment/admin/add_view.php b/modules/payment/views/payment/admin/add_view.php index c5169ded..07640fa4 100644 --- a/modules/payment/views/payment/admin/add_view.php +++ b/modules/payment/views/payment/admin/add_view.php @@ -12,7 +12,7 @@ Method - checkout_plugin_id,'id','name',array('status'=>'=:1'),TRUE,array('class'=>'form_button'));?> + list_select(),$po->checkout_plugin_id,array('label'=>'Payment Method','required')); ?> Amount diff --git a/modules/service/classes/Model/Service.php b/modules/service/classes/Model/Service.php index 5d34f76f..a14396ee 100644 --- a/modules/service/classes/Model/Service.php +++ b/modules/service/classes/Model/Service.php @@ -178,31 +178,25 @@ class Model_Service extends ORM_OSB { /** * Search for services matching a term */ - public function list_autocomplete($term,$index='id',array $limit=array()) { - $result = array(); + public function list_autocomplete($term,$index,$value,array $label,array $limit=array(),array $options=NULL) { + // We only show invoice numbers. + if (! is_numeric($term)) + return array(); + + $ao = Auth::instance()->get_user(); $this->clear(); $this->where_active(); - $value = 'service_name()'; // Build our where clause $this->where_open() - ->where('id','like','%'.$term.'%') - ->where_close(); + ->where('id','like','%'.$term.'%') + ->where_close(); - foreach ($limit as $w) { - list($k,$s,$v) = $w; + // Restrict results to authorised accounts + array_push($limit,array('account_id','IN',$ao->RTM->customers($ao->RTM))); - $this->and_where($k,$s,$v); - } - - foreach ($this->find_all() as $o) - $result[$o->$index] = array( - 'value'=>$o->$index, - 'label'=>sprintf('SVC %s: %s',$o->id,Table::resolve($o,$value)), - ); - - return $result; + return parent::list_autocomplete($term,$index,$value,$label,$limit,$options); } public function list_bylistgroup($cat) {