Theme work with focusbusiness and baseadmin

Improvements to NAVBAR, updates to StaticList methods, other minor items
Enable product category rendering and other minor improvements
Added ADSL-large category price plan
This commit is contained in:
Deon George
2013-04-26 11:42:09 +10:00
parent f9fb355ab6
commit 29c1913f47
114 changed files with 1732 additions and 6797 deletions

View File

@@ -9,48 +9,165 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Controller_Admin_Product extends Controller_TemplateDefault_Admin {
class Controller_Admin_Product extends Controller_Product {
protected $auth_required = TRUE;
protected $secure_actions = array(
'ajaxtranslateform'=>TRUE,
'ajaxtranslatecategory'=>TRUE,
'ajaxtranslate'=>TRUE,
'category'=>TRUE,
'edit'=>TRUE,
'list'=>TRUE,
'update'=>TRUE,
'view'=>TRUE,
);
public function action_ajaxtranslateform() {
$this->auto_render = FALSE;
public function action_ajaxtranslate() {
$po = ORM::factory('Product',$this->request->param('id'));
if (! $this->request->is_ajax() OR ! $po->loaded() OR ! isset($_REQUEST['key']))
$this->response->body(_('Unable to find translate data'));
else {
if (! $po->loaded() OR ! isset($_REQUEST['key'])) {
$output = _('Unable to find translate data');
} else {
$pto = $po->product_translate->where('language_id','=',$_REQUEST['key'])->find();
$this->response->body(View::factory($this->viewpath())->set('pto',$pto));
$output = View::factory('product/admin/ajaxtranslate')
->set('o',$pto);
}
$this->response->body($output);
}
/**
* Retrieve the product category translate record
*/
public function action_ajaxtranslatecategory() {
$pco = ORM::factory('Product_Category',$this->request->param('id'));
if (! $pco->loaded() OR ! isset($_REQUEST['key'])) {
$output = _('Unable to find translate data');
} else {
$pcto = $pco->product_category_translate->where('language_id','=',$_REQUEST['key'])->find();
$output = View::factory('product/category/admin/ajaxtranslate')
->set('o',$pcto);
}
$this->response->body($output);
}
/**
* Update the product category
*/
public function action_category() {
$pco = ORM::factory('Product_Category',$this->request->param('id'));
if (! $pco->loaded())
HTTP::redirect('welcome/index');
if ($_POST)
$pco->values($_POST)->save();
Script::factory()
->type('stdin')
->data('
$(document).ready(function() {
$("select[name=language_id]").change(function() {
// If we select a blank, then dont continue
if (this.value == 0)
return false;
// Send the request and update sub category dropdown
$.ajax({
type: "GET",
data: "key="+$(this).val(),
dataType: "html",
cache: false,
url: "'.URL::link('admin','product/ajaxtranslatecategory/'.$pco->id,TRUE).'",
timeout: 2000,
error: function(x) {
alert("Failed to submit");
},
success: function(data) {
$("div[id=translate]").replaceWith(data);
}
});
});
});
');
Block::factory()
->type('form-horizontal')
->title('Update Category')
->title_icon('icon-wrench')
->body(View::factory('product/category/admin/edit')
->set('o',$pco));
}
/**
* Edit a product configuration
*/
public function action_edit() {
$po = ORM::factory('Product',$this->request->param('id'));
if (! $po->loaded())
HTTP::redirect('welcome/index');
if ($_POST)
$po->values($_POST)->save();
Script::factory()
->type('stdin')
->data('
$(document).ready(function() {
$("select[name=language_id]").change(function() {
// If we select a blank, then dont continue
if (this.value == 0)
return false;
// Send the request and update sub category dropdown
$.ajax({
type: "GET",
data: "key="+$(this).val(),
dataType: "html",
cache: false,
url: "'.URL::link('admin','product/ajaxtranslate/'.$po->id,TRUE).'",
timeout: 2000,
error: function(x) {
alert("Failed to submit");
},
success: function(data) {
$("div[id=translate]").replaceWith(data);
}
});
});
});
');
Block::factory()
->type('form-horizontal')
->title('Update Product')
->title_icon('icon-wrench')
->body(View::factory('product/admin/edit')
->set('plugin_form',$po->admin_update())
->set('o',$po));
}
/**
* Show a list of products
*/
public function action_list() {
if ($this->request->param('id'))
$prods = ORM::factory('Product_Category',$this->request->param('id'))->products();
else
$prods = ORM::factory('Product')->order_by('status DESC,prod_plugin_file')->find_all();
$products = ($x=$this->request->param('id')) ? ORM::factory('Product_Category',$x)->products() : ORM::factory('Product')->order_by('status DESC,prod_plugin_file')->find_all();
Block::add(array(
'title'=>_('Customer Products'),
'body'=>Table::display(
$prods,
Block::factory()
->title(_('Products'))
->title_icon('icon-th')
->body(Table::display(
$products,
25,
array(
'id'=>array('label'=>'ID','url'=>URL::link('admin','product/view/')),
'name()'=>array('label'=>'Details'),
'status'=>array('label'=>'Active'),
'title()'=>array('label'=>'Details'),
'status(TRUE)'=>array('label'=>'Active'),
'prod_plugin_file'=>array('label'=>'Plugin Name'),
'prod_plugin_data'=>array('label'=>'Plugin Data'),
'price_type'=>array('label'=>'Price Type'),
@@ -62,81 +179,31 @@ class Controller_Admin_Product extends Controller_TemplateDefault_Admin {
'page'=>TRUE,
'type'=>'select',
'form'=>URL::link('admin','product/view'),
)),
));
}
/**
* Edit a product configuration
*/
public function action_update() {
$po = ORM::factory('Product',$this->request->param('id'));
if (! $po->loaded())
HTTP::redirect('welcome/index');
if ($_POST) {
if (isset($_POST['product_translate']['id']) AND ($pto=ORM::factory('Product_Translate',$_POST['product_translate']['id'])) AND $pto->loaded())
if (! $pto->values($_POST['product_translate'])->save())
throw new Kohana_Exception('Failed to save updates to product_translate data for record :record',array(':record'=>$po->id()));
if (! $po->values($_POST)->save())
throw new Kohana_Exception('Failed to save updates to product data for record :record',array(':record'=>$so->id()));
}
Block::add(array(
'title'=>sprintf('%s %s:%s',_('Update Product'),$po->id,$po->name()),
'body'=>View::factory($this->viewpath())
->set('po',$po)
->set('mediapath',Route::get('default/media'))
->set('plugin_form',$po->admin_update()),
));
Script::add(array('type'=>'stdin','data'=>'
$(document).ready(function() {
$("select[name=language_id]").change(function() {
// Send the request and update sub category dropdown
$.ajax({
type: "GET",
data: "key="+$(this).val(),
dataType: "html",
cache: false,
url: "'.URL::link('admin','product/ajaxtranslateform/'.$po->id,TRUE).'",
timeout: 2000,
error: function(x) {
alert("Failed to submit");
},
success: function(data) {
$("div[id=translate]").replaceWith(data);
}
});
});
});
'));
)));
}
public function action_view() {
$po = ORM::factory('Product',$this->request->param('id'));
Block::add(array(
'title'=>sprintf('%s: %s',_('Current Services Using this Product'),$po->name()),
'body'=>Table::display(
ORM::factory('Service')->where('product_id','=',$po->id)->find_all(),
Block::factory()
->title(sprintf('%s: %s',_('Current Services Using this Product'),$po->title()))
->title_icon('icon-th-list')
->body(Table::display(
$po->services()->find_all(),
25,
array(
'id'=>array('label'=>'ID','url'=>URL::link('user','service/view/')),
'account->accnum()'=>array(),
'account->name()'=>array('label'=>'Account'),
'name()'=>array('label'=>'Details'),
'status'=>array('label'=>'Active'),
'status(TRUE)'=>array('label'=>'Active'),
'price(TRUE,TRUE)'=>array('label'=>'Price','align'=>'right'),
),
array(
'page'=>TRUE,
'type'=>'select',
'form'=>URL::link('user','service/view'),
)),
));
)));
}
}
?>

View File

@@ -12,26 +12,6 @@
class Controller_Product extends Controller_TemplateDefault {
protected $auth_required = FALSE;
/**
* Show a list of product categories
*/
public function action_categorys() {
$output = '<div id="category">';
$output .= '<ul>';
foreach (ORM::factory('Product_Category')->list_active() as $pco) {
$a = '<h3>'.$pco->display('name').'</h3>';
$a .= '<p>'.$pco->description().'</p>';
$output .= '<li>'.HTML::anchor('product/category/'.$pco->id,$a).'</li>';
}
$output .= '</ul>';
$output .= '</div>';
$this->template->content = $output;
}
/**
* Show the available topics in a category
*
@@ -43,29 +23,15 @@ class Controller_Product extends Controller_TemplateDefault {
$pco = ORM::factory('Product_Category',$this->request->param('id'));
if (! $pco->loaded())
// Only show categories that are active.
if (! $pco->loaded() OR ((! $pco->status AND ! Kohana::$config->load('debug')->show_inactive)))
HTTP::redirect('welcome/index');
if (! $pco->status AND ! Kohana::$config->load('debug')->show_inactive)
HTTP::redirect('welcome/index');
Style::factory()
->type('file')
->data('media/css/pages/welcome.css');
BreadCrumb::name($this->request->uri(),$pco->name);
BreadCrumb::url('product','product/categorys');
BreadCrumb::url('product/category','product/categorys');
foreach ($pco->products() as $po)
$output .= View::factory($this->viewpath().'/list_item')
->set('co',$pco)
->set('o',$po);
// If our output is blank, then there are no products
if (! $output)
$output = _('Sorry, no pages were found in this category, or your account is not authorized for this category.');
Block::add(array(
'title'=>sprintf('%s: %s',_('Category'),$pco->name),
'body'=>$output,
));
return $this->template->content = (string)$pco->template();
}
/**
@@ -77,28 +43,14 @@ class Controller_Product extends Controller_TemplateDefault {
$po = ORM::factory('Product',$id);
if (! $po->loaded())
HTTP::redirect('Product_Category/index');
HTTP::redirect('welcome/index');
BreadCrumb::name($this->request->uri(),$po->product_translate->find()->name);
BreadCrumb::url('product','product/categorys');
// @todo This breadcrumb may not be working anymore.
#BreadCrumb::name($this->request->uri(),$po->product_translate->find()->name);
#BreadCrumb::url('product','product/categorys');
// Work out our category id for the control line
if (! empty($_GET['cid'])) {
$co = ORM::factory('Product_Category',$_GET['cid']);
// If the product category doesnt exist, or doesnt match the product
if (! $co->loaded() OR ! in_array($co->id,$po->avail_category))
HTTP::redirect('Product_Category/index');
BreadCrumb::name('product/view',$co->name);
BreadCrumb::url('product/view','product/category/'.$co->id);
}
Block::add(array(
'title'=>$po->description_short(),
'body'=>View::factory($this->viewpath())
->set('record',$po),
));
$this->template->content = (string)View::factory('product/view')
->set('o',$po);
}
}
?>

View File

@@ -1,39 +0,0 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides product categories
*
* @package Product
* @category Controllers
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Controller_Product_Category extends Controller_TemplateDefault {
/**
* By default show a menu of available categories
*/
public function action_index() {
HTTP::redirect('product_category/list');
}
public function action_list() {
Block::add(array(
'title'=>_('Product Categories'),
'body'=>View::factory('product/category/list')
->set('results',$this->_get_categories()),
));
}
/**
* Obtain a list of our categories
* @todo Only show categories according to the users group memeberhsip
* @todo Obey sort order
* @todo Move this to the model
*/
private function _get_categories() {
return ORM::factory('Product_Category')
->list_active();
}
}
?>

View File

@@ -26,16 +26,20 @@ class Model_Product extends ORM_OSB {
protected $_display_filters = array(
'price_type'=>array(
array('StaticList_PriceType::display',array(':value')),
array('StaticList_PriceType::get',array(':value')),
),
'status'=>array(
array('StaticList_YesNo::display',array(':value')),
array('StaticList_YesNo::get',array(':value')),
),
'taxable'=>array(
array('StaticList_YesNo::display',array(':value')),
array('StaticList_YesNo::get',array(':value')),
),
);
protected $_nullifempty = array(
'price_group',
);
// Our attributes that are arrays, we'll convert/unconvert them
protected $_serialize_column = array(
'avail_category',
@@ -43,41 +47,12 @@ class Model_Product extends ORM_OSB {
);
/**
* Which categories is this product available in
* Return the translated description for a category.
*/
public function categories() {
return $this->avail_category;
}
public function description($full=FALSE) {
$x = $this->translate();
/**
* Get the product description, after translating
* @todo This needs to be improved to find the right language item.
*/
public function description_long() {
return $this->product_translate->find()->display('description_full');
}
/**
* Get the product description, after translating
* @todo This needs to be improved to find the right language item.
*/
public function description_short() {
return $this->product_translate->find()->display('description_short');
}
/**
* This will render the product feature summary information
*/
public function feature_summary() {
return (is_null($plugin = $this->plugin())) ? HTML::nbsp('') : $plugin->feature_summary();
}
/**
* Get the product name, after translating
* @todo This needs to be improved to find the right language item.
*/
public function name() {
return $this->product_translate->find()->display('name');
return $x->loaded() ? $x->display($full ? 'description_full' : 'description_short') : 'No Description';
}
/**
@@ -93,6 +68,66 @@ class Model_Product extends ORM_OSB {
return ORM::factory(Kohana::classname(sprintf('Product_Plugin_%s',$this->prod_plugin_file)),$this->prod_plugin_data);
}
public function save(Validation $validation=NULL) {
if ($this->changed())
if (parent::save($validation))
SystemMessage::factory()
->title('Record Updated')
->type('success')
->body(sprintf('Record %s Updated',$this->id));
// Save our Translated Message
if ($x = array_diff_key($_POST,$this->_object) AND ! empty($_POST['language_id']) AND ! empty($_POST['product_translate']) AND is_array($_POST['product_translate'])) {
$pto = $this->product_translate->where('language_id','=',$_POST['language_id'])->find();
// For a new entry, we need to set the product_cat_id
if (! $pto->loaded()) {
$pto->product_cat_id = $this->id;
$pto->language_id = $_POST['language_id'];
}
if ($pto->values($x['product_translate'])->save())
SystemMessage::factory()
->title('Record Updated')
->type('success')
->body(sprintf('Translation for Record %s Updated',$this->id));
}
}
/**
* List the services that are linked to this product
*/
public function services($active=FALSE) {
return $active ? $this->service->where_active() : $this->service;
}
private function translate() {
return $this->product_translate->where('language_id','=',Config::language())->find();
}
/**
* Return the translated title for a category
*/
public function title() {
$x = $this->translate();
return $x->loaded() ? $x->display('name') : 'No Title';
}
/**
* Which categories is this product available in
*/
public function categories() {
return $this->avail_category;
}
/**
* This will render the product feature summary information
*/
public function feature_summary() {
return (is_null($plugin = $this->plugin())) ? HTML::nbsp('') : $plugin->feature_summary();
}
/**
* Return the best price to the uesr based on the users group's memberships
* @todo This needs to be tested with more than one price group enabled

View File

@@ -11,27 +11,30 @@
*/
class Model_Product_Category extends ORM_OSB {
protected $_table_name = 'product_cat';
protected $_created_column = FALSE;
protected $_updated_column = FALSE;
protected $_nullifempty = array(
'status',
'template',
);
protected $_has_many = array(
'product_category_translate'=>array('foreign_key'=>'product_cat_id','far_key'=>'id'),
'subcategories'=>array('model'=>'product_category','foreign_key'=>'parent_id','far_key'=>'id'),
);
protected $_sorting = array(
'name'=>'asc',
);
/**
* Return the translated description for a category.
*/
public function description() {
// If the user is not logged in, show the site default language
// @todo This needs to change to the session language.
if (! $ao=Auth::instance()->get_user())
$ao=Company::instance()->so();
$x = $this->translate();
return ($x=$this->product_category_translate->where('language_id','=',$ao->language_id)->find()->description) ? $x : _('No Description');
return $x->loaded() ? $x->display('description') : 'No Description';
}
/**
* List all the products belonging to this cateogry
* @todo Consider if we should cache this
*/
public function products() {
$result = array();
@@ -43,13 +46,68 @@ class Model_Product_Category extends ORM_OSB {
return $result;
}
public function list_bylistgroup($cat) {
$result = array();
public function save(Validation $validation=NULL) {
if ($this->changed())
if (parent::save($validation))
SystemMessage::factory()
->title('Record Updated')
->type('success')
->body(sprintf('Record %s Updated',$this->id));
foreach ($this->where('list_group','=',$cat)->find_all() as $pco)
$result[$pco->id] = $pco;
// Save our Translated Message
if ($x = array_diff_key($_POST,$this->_object) AND ! empty($_POST['language_id']) AND ! empty($_POST['product_category_translate']) AND is_array($_POST['product_category_translate'])) {
$pcto = $this->product_category_translate->where('language_id','=',$_POST['language_id'])->find();
// For a new entry, we need to set the product_cat_id
if (! $pcto->loaded()) {
$pcto->product_cat_id = $this->id;
$pcto->language_id = $_POST['language_id'];
}
if ($pcto->values($x['product_category_translate'])->save())
SystemMessage::factory()
->title('Record Updated')
->type('success')
->body(sprintf('Translation for Record %s Updated',$this->id));
}
}
/**
* Return the template that is used to render the product category
*/
public function template() {
if (! $this->template)
throw new Kohana_Exception('Product category :category doesnt have a template',array(':category'=>$this->id));
$o = Kohana::classname('Product_Category_Template_'.$this->template);
return new $o($this);
}
public function templates() {
$template_path = 'classes/Product/Category/Template';
$result = array('');
foreach (Kohana::list_files($template_path) as $file => $path) {
$file = strtoupper(preg_replace('/.php$/','',str_replace($template_path.'/','',$file)));
$result[$file] = $file;
}
return $result;
}
/**
* Return the translated title for a category
*/
public function title() {
$x = $this->translate();
return $x->loaded() ? $x->display('name') : 'No Title';
}
private function translate() {
return $this->product_category_translate->where('language_id','=',Config::language())->find();
}
}
?>

View File

@@ -11,6 +11,8 @@
*/
class Model_Product_Category_Translate extends ORM_OSB {
protected $_table_name = 'product_cat_translate';
protected $_created_column = FALSE;
protected $_updated_column = FALSE;
protected $_belongs_to = array(
'product_category'=>array(),

View File

@@ -0,0 +1,25 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides the rendering of Product Category Templates
*
* @package Product
* @category Helper
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
abstract class Product_Category_Template {
protected $pco = NULL;
abstract protected function render();
public function __construct(Model_Product_Category $pco) {
$this->pco = $pco;
}
public function __toString() {
return (string)$this->render();
}
}
?>

View File

@@ -0,0 +1,20 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides the rendering of Product Category Template Super Category
*
* This Template renders sub categories of the same type.
*
* @package Product
* @category Helper
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Product_Category_Template_Supercat extends Product_Category_Template {
protected function render() {
return View::factory('product/category/list/supercat')
->set('o',$this->pco);
}
}
?>

View File

@@ -0,0 +1,442 @@
/*------------------------------------------------------------------
[Pricing Plans Stylesheet]
Project: Base Admin
Version: 2.0
Last change: 12/29/2012
Assigned to: Rod Howard (rh)
-------------------------------------------------------------------*/
/*-- Plan Container --*/
.plan-container {
position: relative;
float: left;
}
/*-- Plan --*/
.plan {
margin-right: 6px;
margin: 0 10px;
border-radius: 4px;
}
/*-- Plan Header --*/
.plan-header {
text-align: center;
color: #FFF;
background-color: #686868;
-webkit-border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
-moz-border-radius-topleft: 4px;
-moz-border-radius-topright: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
}
.plan-title {
padding: 10px 0;
font-size: 16px;
color: #FFF;
border-bottom: 1px solid #FFF;
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
border-radius: 4px 4px 0 0;
}
.plan-price {
padding: 20px 0 10px;
font-size: 66px;
line-height: 0.8em;
background-color: #797979;
border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.plan-price span.term {
display: block;
margin-bottom: 0;
font-size: 13px;
line-height: 0;
padding: 2em 0 1em;
}
.plan-price span.note {
position: relative;
top: -40px;
display: inline;
font-size: 17px;
line-height: 0.8em;
}
.plan-price span.cents {
position: relative;
display: inline;
font-size: 17px;
line-height: 0.8em;
}
/*-- Plan Features --*/
.plan-features {
border: 1px solid #DDD;
border-bottom: none;
}
.plan-features {
padding-bottom: 1em;
}
.plan-features ul {
padding: 0;
margin: 0;
list-style: none;
}
.plan-features li {
padding: 1em 0;
margin: 0 2em;
text-align: center;
border-bottom: 1px dotted #CCC;
}
.plan-features li:last-child {
border-bottom: none;
}
/*-- Plan Actions --*/
.plan-actions {
padding: 1.15em 0;
background: #F2F2F2;
background-color: whiteSmoke;
background-image: -moz-linear-gradient(top, #F8F8F8, #E6E6E6);
background-image: -ms-linear-gradient(top, #F8F8F8, #E6E6E6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#F8F8F8), to(#E6E6E6));
background-image: -webkit-linear-gradient(top, #F8F8F8, #E6E6E6);
background-image: -o-linear-gradient(top, #F8F8F8, #E6E6E6);
background-image: linear-gradient(top, #F8F8F8, #E6E6E6);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
border-color: #E6E6E6 #E6E6E6 #BFBFBF;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
border: 1px solid #DDD;
-webkit-border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-bottomleft: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.plan-actions .btn {
padding: 1em 0;
margin: 0 2em;
display: block;
font-size: 16px;
font-weight: 600;
}
/*-- Columns --*/
.pricing-plans.plans-1 .plan-container {
width: 100%;
}
.pricing-plans.plans-2 .plan-container {
width: 50%;
}
.pricing-plans.plans-3 .plan-container {
width: 33.33%;
}
.pricing-plans.plans-4 .plan-container {
width: 25%;
}
/*-- Best Value Highlight --*/
.plan.best-value .plan-header {
background-color: #677E30;
}
.plan.best-value .plan-price {
background-color: #81994D;
}
.plan.skyblue .plan-header {
background-color: #3D7AB8;
}
.plan.skyblue .plan-price {
background-color: #69C;
}
.plan.lavendar .plan-header {
background-color: #754F75;
}
.plan.lavendar .plan-price {
background-color: #969;
}
.plan.teal .plan-header {
background-color: #257272;
}
.plan.teal .plan-price {
background-color: #399;
}
.plan.pink .plan-header {
background-color: #FF3778;
}
.plan.pink .plan-price {
background-color: #F69;
}
.plan.black .plan-header {
background-color: #222;
}
.plan.black .plan-price {
background-color: #333;
}
.plan.yellow .plan-header {
background-color: #C69E00;
}
.plan.yellow .plan-price {
background-color: #E8B900;
}
.plan.purple .plan-header {
background-color: #4E2675;
}
.plan.purple .plan-price {
background-color: #639;
}
.plan.red .plan-header {
background-color: #A40000;
}
.plan.red .plan-price {
background-color: #C00;
}
.plan.orange .plan-header {
background-color: #D98200;
}
.plan.orange .plan-price {
background-color: #F90;
}
.plan.blue .plan-header {
background-color: #0052A4;
}
.plan.blue .plan-price {
background-color: #06C;
}
/*-- Green Plan --*/
.plan.green .plan-header {
background-color: #677E30;
}
.plan.green .plan-price {
background-color: #81994D;
}
/*------------------------------------------------------------------
[2. Min Width: 767px / Max Width: 979px]
*/
@media (min-width: 767px) and (max-width: 979px) {
.pricing-plans .plan-container {
width: 50% !important;
margin-bottom: 2em;
}
}
@media (max-width: 767px) {
.pricing-plans .plan-container {
width: 100% !important;
margin-bottom: 2em;
}
}
/* Customer Settings */
.row-divider {
margin: 1.5em 0 1.5em;
}
.tablewrapper {
background: #F8F8F8 no-repeat 0px 0;
padding: 5px 5px;
border-radius: 7px;
display: block;
vertical-align: baseline;
}
.plan.plain {
font-weight: 500;
font-size: 11px;
margin: 0 0;
}
.plan.plain td:first-of-type {
border-left: 1px solid #D8D7D7;
}
.plan.plain .plan-header th.plan-title:first-of-type {
font-weight: normal;
border-radius: 4px 0 0 0;
}
.plan.plain .plan-header td.plan-title:last-of-type {
font-weight: normal;
border-radius: 0 4px 0 0;
}
.plan.plain .plan-header .plan-title {
font-size: 110%;
border-radius: 0 0 0 0;
border-bottom: 1px solid #D8D7D7;
padding: 5px;
}
.plan.plain .plan-header th.plan-price {
font-size: 110%;
color: #FFF;
font-weight: normal;
}
.plan.plain .plan-header td.plan-price {
font-size: 40px;
}
.plan.plain .plan-header td.plan-price span.note {
top: -21px;
}
.plan.plain .plan-header td.plan-price span.cents {
font-size: 20%;
}
.plan.plain .plan-header td.plan-price span.term {
font-size: 30%;
}
.plan.plain tr {
border: 0;
}
.plan.plain .plan-features {
border-top: 1px dotted #D8D7D7;
}
.plan.plain .plan-features th {
text-align: center;
padding: 5px;
font-size: 110%;
font-weight: normal;
}
.plan.plain .plan-features td {
font-weight: bold;
text-align: center;
padding: 5px;
font-size: 110%;
}
.plan.plain .plan-features td span.note {
font-weight: normal;
font-size: 100%;
}
.plan.plain .plan-features td span.normal {
font-weight: normal;
font-size: 100%;
}

View File

@@ -0,0 +1,26 @@
<div id="translate">
<div class="span6">
<?php echo Form::input('product_translate[name]',$o->name,array(
'label'=>'Category Title',
'placeholder'=>'Descriptive Title',
'class'=>'span3',
'required',
'help-block'=>'The title is shown when uses search products by category')); ?>
</div>
<div class="span9">
<?php echo Form::textarea('product_translate[description_short]',$o->description_short,array(
'label'=>'Short Product Description',
'placeholder'=>'Short Description',
'class'=>'span6',
'required',
'help-block'=>'Complete description of this category')); ?>
</div>
<div class="span9">
<?php echo Form::textarea('product_translate[description_full]',$o->description_full,array(
'label'=>'Full Product Description',
'placeholder'=>'Full Description',
'class'=>'span6',
'required',
'help-block'=>'Complete description of this category')); ?>
</div>
</div>

View File

@@ -1,15 +0,0 @@
<?php echo Form::hidden('product_translate[id]',$pto->id); ?>
<table>
<tr>
<td style="width: 40%;">Product Name</td>
<td style="width: 60%;" style="data"><?php echo Form::input('product_translate[name]',$pto->name); ?></td>
</tr>
<tr>
<td>Product Short Description</td>
<td style="data"><?php echo Form::input('product_translate[description_short]',$pto->description_short); ?></td>
</tr>
<tr>
<td>Product Long Description</td>
<td style="data"><?php echo Form::textarea('product_translate[description_full]',$pto->description_full); ?></td>
</tr>
</table>

View File

@@ -0,0 +1,76 @@
<div class="row">
<div class="span9 offset1">
<fieldset>
<legend>Update Product</legend>
<div class="row">
<div class="tabbable span9">
<ul class="nav nav-tabs">
<?php $c=0;foreach (StaticList_RecurSchedule::table() as $k=>$v) : ?>
<li class="<?php echo $c++ ? '' : 'active'; ?>"><a href="#tab<?php echo $k; ?>" data-toggle="tab"><?php echo $v; ?></a></li>
<?php endforeach ?>
</ul>
<div class="tab-content">
<?php $c=0;foreach (StaticList_RecurSchedule::table() as $k=>$v) : ?>
<div class="tab-pane <?php echo $c++ ? '' : 'active'; ?>" id="tab<?php echo $k; ?>">
<?php echo Form::checkbox("price_group[$k][show]",1,$o->isPriceShown($k),array('label'=>'Price Active','class'=>'span2')); ?>
<?php foreach ($o->availPriceGroups() as $g) : ?>
<div class="row">
<div class="span2"><?php echo ORM::factory('Group',$g)->name; ?></div>
<?php foreach ($o->availPriceOptions() as $po) : ?>
<div class="span2">
<?php echo Form::input("price_group[$k][$g][$po]",$o->price($g,$k,$po),array('placeholder'=>$po,'nocg'=>TRUE,'class'=>'span2')); ?>
</div>
<?php endforeach ?> <!-- /availPriceOptions() -->
</div>
<?php endforeach ?> <!-- /availPriceGroups() -->
</div> <!-- /tab-pane -->
<?php endforeach ?> <!-- /StaticList_RecurSchedule -->
</div> <!-- /tab-content -->
</div> <!-- /tabbable -->
</div> <!-- /row -->
<br>
<div class="row">
<div class="span3">
<?php echo StaticList_YesNo::form('status',$o->status,FALSE,array('label'=>'Product Active','class'=>'span1')); ?>
</div>
</div>
<div class="row">
<div class="span3">
<?php echo StaticList_RecurSchedule::form('price_recurr_default',$o,$o->price_recurr_default,array('label'=>'Default Period','class'=>'span2')); ?></td>
</div>
</div> <!-- /row -->
<div class="row">
<div class="span3">
<?php echo Form::input('position',$o->position,array('label'=>'Order','class'=>'span1')); ?>
</div>
</div> <!-- /row -->
<div class="row">
<div class="span5">
<?php echo Form::select('language_id',ORM::factory('Language')->list_select(TRUE),'',array('label'=>'Language','required')); ?>
</div>
</div> <!-- /row -->
<div class="row">
<div id="translate"></div>
</div> <!-- /row -->
<?php if ($plugin_form) { echo '<br/>'.$plugin_form; } ?>
<div class="row">
<div class="offset2">
<button type="submit" class="btn btn-primary">Save changes</button>
<button type="button" class="btn">Cancel</button>
</div>
</div>
</fieldset>
</div> <!-- /span8 -->
</div> <!-- /row -->

View File

@@ -1,59 +0,0 @@
<!-- @todo NEEDS TO BE TRANSLATED -->
<?php echo Form::open(); ?>
<table width="100%">
<tr>
<td style="width: 50%; vertical-align: top;">
<table width="100%">
<tr>
<td style="width: 40%;">Product Active</td>
<td style="width: 5%;">&nbsp;</td>
<td style="width: 60%;" class="data"><?php echo StaticList_YesNo::form('status',$po->status); ?></td>
</tr>
<tr>
<td colspan="2">Price</td>
<td class="data">
<table>
<tr>
<td colspan="2">&nbsp;</td>
<?php foreach (StaticList_RecurSchedule::keys() as $k) { ?>
<td class="head"><?php echo StaticList_RecurSchedule::display($k); ?></td>
<td><?php echo Form::checkbox("price_group[$k][show]",1,$po->isPriceShown($k)); ?>
<?php } ?>
</tr>
<?php foreach ($po->availPriceGroups() as $g) { ?>
<?php foreach ($po->availPriceOptions() as $o) { ?>
<tr>
<td><?php echo ORM::factory('Group',$g)->name; ?></td>
<td><?php echo $o; ?></td>
<?php foreach (StaticList_RecurSchedule::keys() as $k) { ?>
<td colspan="2"><?php echo Form::input("price_group[$k][$g][$o]",$po->price($g,$k,$o),array('size'=>5)); ?></td>
<?php } ?>
</tr>
<?php } ?>
<?php } ?>
</table>
</td>
</tr>
<tr>
<td colspan="2">Default Period</td>
<td class="data"><?php echo StaticList_RecurSchedule::form('price_recurr_default',$po,$po->price_recurr_default); ?></td>
</tr>
<tr>
<td colspan="2">Order</td>
<td class="data"><?php echo Form::input('position',$po->position); ?></td>
</tr>
<tr>
<td>Product Descriptions</td>
<td><?php echo Form::select('language_id',ORM_OSB::form('Language',TRUE)); ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td class="data" colspan="2"><div id="translate"></div></td>
</tr>
</table>
<?php if ($plugin_form) { echo '<br/>'.$plugin_form; } ?>
</td>
</tr>
</table>
<?php echo Form::submit('submit',_('Update'),array('class'=>'form_button')); ?>
<?php echo Form::close(); ?>

View File

@@ -0,0 +1,18 @@
<div id="translate">
<div class="span6">
<?php echo Form::input('product_category_translate[name]',$o->name,array(
'label'=>'Category Title',
'placeholder'=>'Descriptive Title',
'class'=>'span3',
'required',
'help-block'=>'The title is shown when uses search products by category')); ?>
</div>
<div class="span9">
<?php echo Form::textarea('product_category_translate[description]',$o->description,array(
'label'=>'Category Description',
'placeholder'=>'Description',
'class'=>'span6',
'required',
'help-block'=>'Complete description of this category')); ?>
</div>
</div>

View File

@@ -0,0 +1,36 @@
<div class="row">
<div class="span9 offset1">
<fieldset>
<legend>Update Category</legend>
<div class="row">
<div class="span3">
<?php echo StaticList_YesNo::form('status',$o->status,FALSE,array('label'=>'Active','class'=>'span1')); ?>
</div>
</div> <!-- /row -->
<div class="row">
<div class="span5">
<?php echo Form::select('template',$o->templates(),$o->template,array('label'=>'List Template')); ?>
</div>
</div> <!-- /row -->
<div class="row">
<div class="span5">
<?php echo Form::select('language_id',ORM::factory('Language')->list_select(TRUE),'',array('label'=>'Language','required')); ?>
</div>
</div> <!-- /row -->
<div class="row">
<div id="translate"></div>
</div> <!-- /row -->
<div class="row">
<div class="offset2">
<button type="submit" class="btn btn-primary">Save changes</button>
<button type="button" class="btn">Cancel</button>
</div>
</div>
</fieldset>
</div> <!-- /span8 -->
</div> <!-- /row -->

View File

@@ -1,7 +0,0 @@
<table width="100%" border="0">
<?php foreach ($results as $value) { ?>
<tr>
<td class="menu"><a href="<?php echo URL::site('product/category/'.$value->id); ?>"><?php echo $value->name; ?></a></td>
</tr>
<?php } ?>
</table>

View File

@@ -0,0 +1,27 @@
<div id="container">
<div class="row divider service-container">
<div class="grid-3">
<h2><span class="slash">//</span> <?php echo $o->title(); ?></h2>
</div>
<?php $c=0;foreach ($o->subcategories->find_all() as $pco) : ?>
<?php if (! ($c++%3) AND $c>1) : ?>
</div> <!-- /row -->
<hr class="row-divider" />
<div class="row divider service-container">
<div class="grid-3">
&nbsp;
</div>
<?php endif ?>
<div class="grid-3">
<div class="service-item">
<h3><i class="icon-tint"></i><?php echo $pco->title(); ?></h3>
<?php $x=350;echo strlen($pco->description())<$x ? $pco->description() : substr($pco->description(),0,$x).'...'; ?>
<p><a href="<?php echo URL::site('product/category/'.$pco->id); ?>" class="">More Details »</a></p>
</div> <!-- /service -->
</div>
<?php endforeach ?>
</div> <!-- /row -->
</div> <!-- /container -->

View File

@@ -1,8 +0,0 @@
<table class="product-list-item">
<tr class="head">
<td class="heading"><a href="<?php echo URL::site(sprintf('product/view/%s?cid=%s',$o->id,$co->id));?>"><?php echo $o->name(); ?></a><?php echo $co->recur_price_display ? ' ('.Currency::display($o->price(0,$co->recur_price_display,'price_base',TRUE)).')' : ''; ?></td>
</tr>
<tr class="body">
<td><?php echo $o->description_short(); ?></td>
</tr>
</table>

View File

@@ -1,40 +0,0 @@
<?php
if (! count($results)) {
echo _('Sorry, no pages were found in this category, or your account is not authorized for this category.');
return;
}
foreach ($results as $record) {
// Load the language
$translate = $record->product_translate->where('product_id','=',$record->id)->and_where('language_id','=','fr')->find();
// If there isnt a translated page, show the default language
// @todo - default language should come from configuration
if (! $translate->loaded())
$translate = $record->product_translate->where('product_id','=',$record->id)->and_where('language_id','=',1)->find();
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr valign="top">
<td class="heading"><a href="<?php echo URL::site(sprintf('product/view/%s?cid=%s',$record->id,$cat));?>"><?php echo $translate->name; ?></a> (<?php echo $record->display('price_base'); ?>/mth)</td>
</tr>
<tr>
<td style="background-color: #FFFFFF;">
<table width="100%" border="0" cellpadding="4">
<tr>
<td class="body"><?php echo $translate->description_short; ?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br/>
<?php
}
?>

View File

@@ -1,80 +1,15 @@
<?php
// @todo Need to add in product attributes
// @todo Need to add in product plugins
echo Form::open('cart/add');
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
<tr>
<td>
<?php echo Form::hidden('product_id',$record->id); ?>
<?php echo Form::hidden('quantity',1); ?>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td style="background-color: #FFFFFF;">
<table width="100%" border="0" cellpadding="4">
<tr>
<td class="body" rowspan="4"><?php echo $record->description_long(); ?></td>
<td style="text-align: right;"><?php if ($a=$record->show_thumb()) echo $a; ?></td>
</tr>
<tr>
<?php if ($record->prod_plugin_file && method_exists($record->prod_plugin_file,'product_view')) {
$pio = new $record->prod_plugin_file;
echo '<td style="vertical-align: bottom;">'.$pio->product_view($record->prod_plugin_data).'</td>';
} ?>
</tr>
<tr>
<?php if ($record->prod_plugin_file && method_exists($record->prod_plugin_file,'contract_view')) {
$pio = new $record->prod_plugin_file;
// @todo This is a hack, need to work out the correct recur_price_schedule dynamically
echo '<td style="vertical-align: top;">'.$pio->contract_view($record->prod_plugin_data,$record->price(0,1,'price_base'),$record->price(0,1,'price_setup')).'</td>';
} ?>
</tr>
<tr>
<?php if ($record->prod_plugin_file && method_exists($record->plugin(),'feature_summary')) {
echo '<td style="vertical-align: top;">'.$record->plugin()->feature_summary().'</td>';
} ?>
</tr>
<tr>
<td class="spacer" colspan="2">&nbsp;</td>
</tr>
<tr>
<td class="body" style="width: 50%;"><b>Recurring Billing Schedule</b></td>
<td class="body" style="width: 50%;"><b>Currency</b></td>
</tr>
<tr>
<td class="body"><?php echo StaticList_RecurSchedule::form('recurr_schedule',$record,$record->price_recurr_default);?> </td>
<!-- @todo The default currency should be system configurable and displayed by default -->
<!-- @todo If CURRENCY's value is not active in the DB, then the wrong flag is shown, as StaticList_Module::form() only returns active values -->
<!-- @todo Currency is not used in the cart? -->
<?php $CURRENCY_ISO='AUD'; $CURRENCY=6; $COUNTRY=61?>
<td class="body"><?php echo StaticList_Module::form('currency','currency',$CURRENCY,'id','name',array('status'=>'=:1'),FALSE,array('class'=>'form_button'));?> <?php echo Country::icon($COUNTRY);?></td>
</tr>
<tr>
<td class="body"><b>Price Type</b></td>
<td class="body"><b>Taxable</b></td>
</tr>
<tr>
<td class="body"><?php echo StaticList_PriceType::display($record->price_type);?></td>
<td class="body"><?php echo StaticList_YesNo::display($record->taxable);?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="spacer" colspan="2">&nbsp;</td>
</tr>
<tr>
<?php if ($record->prod_plugin_file && method_exists($record->prod_plugin_file,'product_cart')) {
$pio = new $record->prod_plugin_file;
echo '<td style="vertical-align: top;">'.$pio->product_cart($record->prod_plugin_data).'</td>';
} ?>
</tr>
<tr>
<td style="text-align: center;"><?php echo Form::submit('submit','Add to Cart',array('class'=>'form_button','disabled'=>'disabled')); ?> | <?php echo Form::submit('submit','Add to Cart & Checkout',array('disabled'=>'disabled'),array('class'=>'form_button')); ?></td>
</tr>
</table>
</td>
</tr>
</table>
<?php echo Form::close(); ?>
<br/>
<div id="page-title">
<h1><?php echo $o->title(); ?></h1>
<?php echo $o->description(); ?>
</div> <!-- /page-title -->
<div id="container">
<div class="row">
<div class="span9">
<?php echo $o->description(TRUE); ?>
</div> <!-- /row -->
</div> <!-- /row -->
<!-- <div class="row-divider"></div> -->
</div> <!-- /container -->