Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5a00d080f9 | ||
|
fed590c325 | ||
|
2e0eefe62f |
@ -13,6 +13,8 @@ RewriteBase /
|
||||
# Protect application and system files from being viewed
|
||||
RewriteRule ^(?:application|modules|includes/kohana)\b.* index.php/$0 [L]
|
||||
|
||||
RewriteRule ^nbn$ /product/category/21 [R,L]
|
||||
|
||||
# Allow any files or directories that exist to be displayed directly
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
|
23
application/classes/Controller/Direct.php
Normal file
23
application/classes/Controller/Direct.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class provides Direct Page Access
|
||||
*
|
||||
* @package OSB
|
||||
* @category Controllers/Direct
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Controller_Direct extends Controller_TemplateDefault {
|
||||
protected $auth_required = FALSE;
|
||||
|
||||
public function action_index() {
|
||||
return $this->action_adsl();
|
||||
}
|
||||
|
||||
public function action_adsl() {
|
||||
$this->template->content = '<iframe border="0" src="http://www.exetel.com.au/table_inc/broadband_plans.php?is_agent=t&agent_code=V005#standalone" width="900" height="1000"></iframe>';
|
||||
}
|
||||
}
|
||||
?>
|
@ -37,11 +37,13 @@ class Controller_Reseller_Welcome extends Controller_Welcome {
|
||||
->span(6)
|
||||
->body(View::factory('invoice/list')->set('o',ORM::factory('Invoice')->list_due($t)));
|
||||
|
||||
/*
|
||||
Block::factory()
|
||||
->title('Un-applied payments')
|
||||
->title_icon('fa fa-money')
|
||||
->span(6)
|
||||
->body(View::factory('payment/list')->set('o',ORM::factory('Payment')->where_authorised()->list_unapplied()));
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,7 @@ class Controller_User_Search extends Controller_Search {
|
||||
$result = Arr::merge($result,ORM::factory('Service')->list_autocomplete($this->request->query('term'),'url','id',array('SVC %s: %s'=>array('id','name()')),array(),array('urlprefix'=>URL::link('user','service/view/'))));
|
||||
$result = Arr::merge($result,ORM::factory('Invoice')->list_autocomplete($this->request->query('term'),'url','id',array('INV %s: %s'=>array('id','account->name()')),array(),array('urlprefix'=>URL::link('user','invoice/view/'))));
|
||||
|
||||
foreach (array('Service_Plugin_Adsl','Service_Plugin_Domain','Service_Plugin_Host') as $o)
|
||||
foreach (array('Service_Plugin_Adsl','Service_Plugin_Domain','Service_Plugin_Host','Service_Plugin_Voip') as $o)
|
||||
$result = Arr::merge($result,ORM::factory($o)->list_autocomplete($this->request->query('term'),'url','service_id',array('SVC %s: %s'=>array('service_id','service->name()')),array(),array('urlprefix'=>URL::link('user','service/view/'))));
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
return array(
|
||||
'appname' => 'OS Billing', // Our application name, as shown in the title bar of pages
|
||||
'appname' => 'Graytech Billing', // Our application name, as shown in the title bar of pages
|
||||
'email_from' => array('noreply@graytech.net.au'=>'Graytech Hosting'),
|
||||
'method_security' => TRUE, // Enables Method Security. Setting to false means any method can be run without authentication
|
||||
'session_change_trigger'=>array( // Updates to tables to make when our session ID is changed
|
||||
|
@ -28,10 +28,10 @@ return array
|
||||
* Ports and sockets may be appended to the hostname.
|
||||
*/
|
||||
'hostname' => 'localhost',
|
||||
'username' => 'username',
|
||||
'password' => 'password',
|
||||
'username' => 'gh-webbill',
|
||||
'password' => 'ws0593',
|
||||
'persistent' => FALSE,
|
||||
'database' => 'database',
|
||||
'database' => 'webghosb',
|
||||
),
|
||||
'table_prefix' => 'ab_',
|
||||
'charset' => 'utf8',
|
||||
@ -50,9 +50,9 @@ return array
|
||||
* string password database password
|
||||
* boolean persistent use persistent connections?
|
||||
*/
|
||||
'dsn' => 'mysql:host=localhost;dbname=database',
|
||||
'username' => 'username',
|
||||
'password' => 'password',
|
||||
'dsn' => 'mysql:host=localhost;dbname=webghosb',
|
||||
'username' => 'gh-webbill',
|
||||
'password' => 'ws0593',
|
||||
'persistent' => FALSE,
|
||||
),
|
||||
/**
|
||||
@ -67,9 +67,9 @@ return array
|
||||
'default' => array(
|
||||
'type' => 'MySQLi',
|
||||
'connection' => array(
|
||||
'hostname' => 'localhost',
|
||||
'username' => 'username',
|
||||
'password' => 'password',
|
||||
'hostname' => 'database',
|
||||
'username' => 'web',
|
||||
'password' => 'uva%Cn8B',
|
||||
'persistent' => FALSE,
|
||||
'database' => 'database',
|
||||
'ssl' => NULL,
|
||||
|
@ -12,13 +12,14 @@
|
||||
|
||||
return array
|
||||
(
|
||||
'ajax'=>FALSE, // AJAX actions can only be run by ajax calls if set to FALSE
|
||||
'checkout_notify'=>FALSE, // Test mode to test a particular checkout_notify item
|
||||
'disabled_noaccess_redirect'=>FALSE, // Disable redirect when noaccess
|
||||
'email_admin_only'=> array( // Override emails and send them to an admin instead
|
||||
#'task_invoice_list_overdue'=>array('deon@leenooks.net'=>'Deon George'),
|
||||
),
|
||||
'email_bcc_admin'=> array( // Blind copy all email to an admin, in the format 'email'=>'name',
|
||||
// 'deon@leenooks.net'=>'Deon George',
|
||||
'deon@graytech.net.au'=>'Deon George',
|
||||
),
|
||||
'invoice'=>0, // Number of invoices to generate in a pass
|
||||
'show_errors'=>FALSE, // Show errors instead of logging in the DB.
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
return array(
|
||||
'trusted_hosts' => array(
|
||||
'.*\.graytech\.net\.au',
|
||||
'graytech\.net\.au',
|
||||
),
|
||||
);
|
||||
?>
|
||||
|
BIN
application/media/site/1/theme/focusbusiness/img/footer-logo.png
Normal file
BIN
application/media/site/1/theme/focusbusiness/img/footer-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
BIN
application/media/site/1/theme/focusbusiness/img/title.png
Normal file
BIN
application/media/site/1/theme/focusbusiness/img/title.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
BIN
application/media/site/1/theme/yaml/img/logo-small.png
Normal file
BIN
application/media/site/1/theme/yaml/img/logo-small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
@ -0,0 +1,81 @@
|
||||
<!-- @todo Move this content into the DB -->
|
||||
<div id="container">
|
||||
<div class="row">
|
||||
<div id="welcome" class="col-md-12">
|
||||
<h1>Graytech Hosting is an Australian based Internet Solutions provider.</h1>
|
||||
</div>
|
||||
</div> <!-- /row -->
|
||||
|
||||
<hr class="row-divider" />
|
||||
|
||||
<div class="row divider service-container">
|
||||
<div class="col-md-3">
|
||||
<h2><span class="slash">//</span> Our Services</h2>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="service-item">
|
||||
<h3><i class="fa fa-tint"></i>Website Hosting</h3>
|
||||
<p>Graytech Hosting can host your website on our enterprise servers for the fraction of a cost of many providers.</p>
|
||||
<p>Your website will be hosted on Australian based servers, providing the best access experience for your audience.</p>
|
||||
<p><a href="http://domains.graytech.hosting/web-hosting" class="">See Our Plans »</a></p>
|
||||
</div> <!-- /service -->
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="service-item">
|
||||
<h3><i class="fa fa-map-marker"></i>Domain Names</h3>
|
||||
<p>Register your .AU, .COM, .NET (or something else) domain with Graytech Hosting.</p>
|
||||
<p>We'll take away the complications of getting you visible on the Internet with an available Internet Name that suits your requirements.</p>
|
||||
<p><a href="http://domains.graytech.hosting/domain-names" class="">Register a Domain Name »</a></p>
|
||||
</div> <!-- /service -->
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="col-md-3">
|
||||
<div class="service-item">
|
||||
<h3><i class="fa fa-cogs"></i>ADSL Internet</h3>
|
||||
<p>Need to get online?</p>
|
||||
<p>We have an ADSL plan that will enable you to access the Internet, without worrying about the complications of uploads, downloads and speed.</p>
|
||||
<p><a href="<?php echo URL::site('product/category/20'); ?>" class="">See Our Plans »</a></p>
|
||||
</div> x!-- /service --x
|
||||
</div>
|
||||
-->
|
||||
</div> <!-- /row -->
|
||||
|
||||
<hr class="row-divider" />
|
||||
|
||||
<div class="row divider about-container">
|
||||
<div class="col-md-3">
|
||||
<h2><span class="slash">//</span> Our Story</h2>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="about-item">
|
||||
<h3><i class="fa fa-bank"></i> About Us</h3>
|
||||
<p>Graytech Hosting was established in 2003 providing Virtual Private Networks over the Internet to customers with distributed offices.</p>
|
||||
<p>Today our portfolio includes many customers all over Australia, using our Hosting and Email Products.</p>
|
||||
</div> <!-- /about -->
|
||||
</div> <!-- /grid-4 -->
|
||||
|
||||
<div class="col-md-5">
|
||||
<div class="about-item">
|
||||
<h3><i class="fa fa-question"></i>Why Choose Us</h3>
|
||||
<div class="choose-item">
|
||||
<h3><i class="fa fa-star"></i> Competive Pricing</h3>
|
||||
<p>We constantly revise our supplier list providing the most competitive pricing. While we make improvements in the background, you still continue to receive the same great service and with competitive pricing.</p>
|
||||
</div> <!-- /choose-item -->
|
||||
|
||||
<div class="choose-item">
|
||||
<h3><i class="fa fa-star"></i> Support Local Bendigo Customers</h3>
|
||||
<p>We are based in Bendigo Victoria, so we support many local Bendigo Customers and Business get online.</p>
|
||||
</div> <!-- /choose-item -->
|
||||
|
||||
<div class="choose-item">
|
||||
<h3><i class="fa fa-star"></i> We partner with Graytech Computers</h3>
|
||||
<p>We partner with <a href="http://www.graytech.com.au">Graytech Computers</a> to provide you with your End-to-End Computing and Internet requirements.</p>
|
||||
</div> <!-- /choose-item -->
|
||||
</div> <!-- /choose-item -->
|
||||
</div> <!-- /grid-5 -->
|
||||
</div> <!-- /row -->
|
||||
</div> <!-- /container -->
|
@ -1,127 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?php echo Site::Appname(); ?></title>
|
||||
<link rel="shortcut icon" href="<?php echo $meta->shortcut_icon ? $meta->shortcut_icon : '/favicon.ico' ?>" type="image/vnd.microsoft.icon" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="Content-Language" content="<?php echo $meta->language; ?>" />
|
||||
|
||||
<meta name="keywords" content="<?php echo $meta->keywords; ?>" />
|
||||
<meta name="description" content="<?php echo $meta->description; ?>" />
|
||||
<meta name="copyright" content="<?php echo Config::copywrite(); ?>" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
|
||||
<?php
|
||||
if (Kohana::$environment >= Kohana::TESTING OR Request::current()->secure()) {
|
||||
echo HTML::style('media/theme/bootstrap/css/bootstrap.min.css');
|
||||
echo HTML::style('media/theme/bootstrap/css/bootstrap-responsive.min.css');
|
||||
echo HTML::style('media/vendor/font-awesome/css/font-awesome.min.css');
|
||||
} else {
|
||||
echo HTML::style(Site::Protocol('netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap.min.css'));
|
||||
echo HTML::style(Site::Protocol('netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-responsive.min.css'));
|
||||
echo HTML::style(Site::Protocol('netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css'));
|
||||
}
|
||||
|
||||
echo HTML::style(Site::Protocol('fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,800italic,400,600,800'));
|
||||
echo HTML::style('media/css/ui-lightness/jquery-ui-1.10.0.custom.min.css');
|
||||
echo HTML::style('media/theme/baseadmin/css/base-admin-2.css');
|
||||
echo HTML::style('media/theme/baseadmin/css/base-admin-2-responsive.css');
|
||||
echo HTML::style('media/theme/baseadmin/css/custom.css');
|
||||
echo Style::factory()->render_all();
|
||||
?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php if (! empty($shownavbar)) : ?>
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><i class="icon-cog"></i> </a>
|
||||
<a class="brand" href="<?php echo URL::site(); ?>"><?php echo Site::Appname(); ?><sup></sup></a>
|
||||
|
||||
<div class="nav-collapse collapse">
|
||||
<ul class="nav pull-right">
|
||||
<?php echo $navbar; ?>
|
||||
</ul>
|
||||
|
||||
<?php if (class_exists('Controller_Search')) : ?>
|
||||
<div class="navbar-search pull-right">
|
||||
<div class="navbar-search-addon">
|
||||
<i class="icon-search"></i>
|
||||
<?php echo HTML::image('media/img/spinner.gif',array('class'=>'right','name'=>'searching')); ?>
|
||||
<input type="text" name="search-query" class="search-query" placeholder="Search" data-provide="typeahead">
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div><!--/.nav-collapse -->
|
||||
|
||||
</div> <!-- /container -->
|
||||
</div> <!-- /navbar-inner -->
|
||||
</div> <!-- /nvarbar -->
|
||||
|
||||
<div class="subnavbar">
|
||||
<div class="subnavbar-inner">
|
||||
<div class="container">
|
||||
<a class="btn-subnavbar collapsed" data-toggle="collapse" data-target=".subnav-collapse">
|
||||
<i class="icon-reorder"></i>
|
||||
</a>
|
||||
|
||||
<div class="subnav-collapse collapse">
|
||||
<ul class="mainnav">
|
||||
<li class="">
|
||||
<a href="<?php echo URL::link('user','welcome',TRUE); ?>"><i class="icon-home"></i><span>Home</span></a>
|
||||
</li>
|
||||
<?php if (class_exists('Auth') AND ($ao = Auth::instance()->get_user()) AND $ao->isAdmin()) : ?>
|
||||
<li class="">
|
||||
<a href="<?php echo URL::link('admin','welcome',TRUE); ?>"><i class="icon-tasks"></i><span>Admin</span></a>
|
||||
</li>
|
||||
<?php elseif ($ao AND $ao->isReseller()) : ?>
|
||||
<li class="">
|
||||
<a href="<?php echo URL::link('reseller','welcome',TRUE); ?>"><i class="icon-tasks"></i><span>Reseller</span></a>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div> <!-- /.subnav-collapse -->
|
||||
</div> <!-- /container -->
|
||||
</div> <!-- /subnavbar-inner -->
|
||||
</div> <!-- /subnavbar -->
|
||||
<?php endif ?>
|
||||
|
||||
<div class="error_container">
|
||||
<div class="error_details">
|
||||
<div class="row">
|
||||
<div class="span10 offset2">
|
||||
<?php echo SystemMessage::factory()->render_all(); ?>
|
||||
</div>
|
||||
</div> <!-- /row -->
|
||||
</div> <!-- /error_details -->
|
||||
</div> <!-- /error_container -->
|
||||
|
||||
<div class="main">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<?php echo $content; ?>
|
||||
</div> <!-- /row -->
|
||||
</div> <!-- /container -->
|
||||
</div> <!-- /main -->
|
||||
|
||||
<?php
|
||||
if (Kohana::$environment >= Kohana::TESTING OR Request::current()->secure()) {
|
||||
echo HTML::script('media/js/jquery/jquery-1.9.1.min.js');
|
||||
echo HTML::script('media/theme/bootstrap/js/bootstrap.min.js');
|
||||
echo HTML::script('media/js/lodash/lodash-1.2.1.min.js');
|
||||
} else {
|
||||
echo HTML::script(Site::Protocol('code.jquery.com/jquery-1.9.1.min.js'));
|
||||
echo HTML::script(Site::Protocol('netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js'));
|
||||
echo HTML::script(Site::Protocol('cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.min.js'));
|
||||
}
|
||||
|
||||
echo HTML::script('media/theme/baseadmin/js/backtotop.js');
|
||||
echo HTML::script('media/js/search.js');
|
||||
echo HTML::script('media/js/custom.js');
|
||||
echo Script::factory()->render_all();
|
||||
?>
|
||||
</body>
|
||||
</html>
|
BIN
forms/OCR-DDR-Online-V3.1.pdf
Normal file
BIN
forms/OCR-DDR-Online-V3.1.pdf
Normal file
Binary file not shown.
1
forms/index.html
Normal file
1
forms/index.html
Normal file
@ -0,0 +1 @@
|
||||
The direct debit form is <a href="OCR-DDR-Online-V3.1.pdf">here</a>.
|
@ -119,16 +119,23 @@ class ADSL_Billing_Exetelvisp {
|
||||
$result[$service]['cost'] = str_replace('$','',$record[6]);
|
||||
$result[$service]['info'] = 'Other Service';
|
||||
|
||||
} elseif (preg_match('/VOIP Monthly Charges/',$record[3])) {
|
||||
list($service,$description) = explode(':',(preg_replace('/([0-9]+)\s+-\s+(.*)$/',"$1:$2",$record[3])));
|
||||
$result[$service]['cost'] = str_replace('$','',$record[6]);
|
||||
$result[$service]['info'] = 'VOIP Service';
|
||||
|
||||
} elseif (preg_match('/VISP Credit/',$record[4])) {
|
||||
list($service,$description) = explode(':',(preg_replace('/([0-9]+)\s+-\s+(.*)$/',"$1:$2",$record[4])));
|
||||
$result[$service]['credit'] = str_replace('$','',$record[6]);
|
||||
|
||||
} elseif (preg_match('/Excess usage charges/',$record[4])) {
|
||||
} elseif (preg_match('/Peak Excess Usage /',$record[4])) {
|
||||
list($service,$description) = explode(':',(preg_replace('/([0-9]+)\s+-\s+(.*)$/',"$1:$2",$record[4])));
|
||||
$result[$service]['excess'] = str_replace('$','',$record[7]);
|
||||
|
||||
} elseif (preg_match('/Residential VOIP Plan Monthly/',$record[4])) {
|
||||
list($service,$description) = explode(':',(preg_replace('/([0-9]+)\s+-\s+(.*)$/',"$1:$2",$record[4])));
|
||||
$result[$service]['cost'] = str_replace('$','',$record[7]);
|
||||
|
||||
} elseif (preg_match('/Virtual FAX Number Monthly Rental/',$record[4])) {
|
||||
list($service,$description) = explode(':',(preg_replace('/([0-9]+)\s+-\s+(.*)$/',"$1:$2",$record[4])));
|
||||
$result[$service]['cost'] = str_replace('$','',$record[7]);
|
||||
|
||||
} elseif (preg_match('/Residential VOIP Plan Excess Usage/',$record[4])) {
|
||||
list($service,$description) = explode(':',(preg_replace('/([0-9]+)\s+-\s+(.*)$/',"$1:$2",$record[4])));
|
||||
$result[$service]['excess'] = str_replace('$','',$record[7]);
|
||||
|
||||
@ -148,8 +155,12 @@ class ADSL_Billing_Exetelvisp {
|
||||
$this->data_exception = $this->data = $result;
|
||||
|
||||
// @todo This could be optimised better.
|
||||
foreach ($aso->services(TRUE) as $so)
|
||||
$this->haveService($so->plugin()->service_number,$so->plugin()->admin_plan()->supplier_plan->display('base_cost'));
|
||||
foreach ($aso->services(TRUE) as $so) {
|
||||
if ($so->plugin()->admin_plan() != 'VOIP')
|
||||
$this->haveService($so->plugin()->service_number,$so->plugin()->admin_plan()->supplier_plan->display('base_cost'));
|
||||
elseif ($so->plugin()->admin_plan() == 'VOIP')
|
||||
$this->haveService($so->plugin()->service_number,10);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ class Controller_Admin_Adsl extends Controller_Adsl {
|
||||
'list'=>TRUE,
|
||||
'stat'=>TRUE,
|
||||
'traffic'=>TRUE,
|
||||
'product'=>TRUE,
|
||||
);
|
||||
|
||||
public function action_index() {
|
||||
@ -110,6 +111,121 @@ class Controller_Admin_Adsl extends Controller_Adsl {
|
||||
);
|
||||
}
|
||||
|
||||
public function action_product() {
|
||||
$lo = ORM::factory('Language',['name'=>'English']);
|
||||
$aso = ORM::factory('Service')->where_authorised($this->ao)->list_byplugin('ADSL');
|
||||
$output = '';
|
||||
|
||||
// Process our active services
|
||||
$products = array();
|
||||
|
||||
foreach ($aso as $o) {
|
||||
// $output .= sprintf('Got Service [%s]<br>',$o->id);
|
||||
if (! array_key_exists($o->product_id,$products)) {
|
||||
$products[$o->product_id] = $o->product;
|
||||
}
|
||||
}
|
||||
// $output .= sprintf('Products [%s]<br>',join('|',array_keys($products)));
|
||||
|
||||
// Find our products without services.
|
||||
$po = ORM::factory('Product')->where('prod_plugin_file','=','ADSL')->and_where('id','NOT IN',array_keys($products))->where_active()->find_all();
|
||||
foreach ($po as $o) {
|
||||
if (! array_key_exists($o->id,$products)) {
|
||||
$products[$o->id] = $o;
|
||||
}
|
||||
}
|
||||
// $output .= sprintf('Now Products [%s]<br>',join('|',array_keys($products)));
|
||||
|
||||
// Get a list of our ADSL plans that support these products
|
||||
$supplierplans = $plans = array();
|
||||
foreach ($products as $id => $po) {
|
||||
if (! array_key_exists($po->prod_plugin_data,$plans)) {
|
||||
$plans[$po->prod_plugin_data] = ORM::factory('ADSL_Plan',$po->prod_plugin_data);
|
||||
}
|
||||
|
||||
//if ($po->id == 87) $output .= Debug::vars($po);
|
||||
//if ($po->id == 87) $output .= '<hr>';
|
||||
//if ($po->id == 87) $output .= Debug::vars($plans[$po->prod_plugin_data]);
|
||||
//if ($po->id == 87) $output .= '<hr>';
|
||||
if (! array_key_exists($plans[$po->prod_plugin_data]->adsl_supplier_plan_id,$supplierplans)) {
|
||||
$supplierplans[$plans[$po->prod_plugin_data]->adsl_supplier_plan_id] = $plans[$po->prod_plugin_data]->supplier_plan;
|
||||
//if ($po->id == 87) $output .= Debug::vars($plans[$po->prod_plugin_data]->supplier_plan);
|
||||
}
|
||||
}
|
||||
|
||||
// Get a list of our supplier ADSL plans that are active
|
||||
$aspo = ORM::factory('ADSL_Supplier_Plan')->where('id','NOT IN',array_keys($supplierplans))->where_active()->find_all();
|
||||
foreach ($aspo as $o) {
|
||||
if (! array_key_exists($o->id,$supplierplans)) {
|
||||
$supplierplans[$o->id] = $o;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$output .= '<table class="table table-striped table-condensed table-hover" border=0>';
|
||||
|
||||
$output .= sprintf('<tr><th colspan="5">%s</th><th>%s</th><th>%s</th></tr>','NAME','COST','ACTIVE');
|
||||
|
||||
// List our Supplier Plans
|
||||
foreach ($supplierplans as $spo) {
|
||||
$output .= '<tr>';
|
||||
$output .= sprintf('<td colspan="5">%s: %s</td>',$spo->id,$spo->name());
|
||||
$output .= sprintf('<td>%s</td>',$spo->display('base_cost'));
|
||||
$output .= sprintf('<td>%s</td>',$spo->display('active'));
|
||||
$output .= '</tr>';
|
||||
|
||||
// List our plans that use this supplier plans.
|
||||
foreach ($plans as $po) {
|
||||
if ($po->adsl_supplier_plan_id != $spo->id) continue;
|
||||
|
||||
$output .= '<tr>';
|
||||
$output .= '<td> </td>';
|
||||
$output .= '<td> </td>';
|
||||
$output .= sprintf('<td colspan="3">%s</td>',$po->id);
|
||||
$output .= '<td> </td>';
|
||||
$output .= '<td> </td>';
|
||||
$output .= '</tr>';
|
||||
|
||||
// List our products that use these plan
|
||||
foreach ($products as $pro) {
|
||||
if ($pro->prod_plugin_data != $po->id) continue;
|
||||
|
||||
$output .= '<tr>';
|
||||
$output .= '<td> </td>';
|
||||
$output .= '<td> </td>';
|
||||
$output .= '<td> </td>';
|
||||
$output .= sprintf('<td colspan="2"><a href="/a/product/edit/%s">%s</a>: ',$pro->id,$pro->id);
|
||||
try {
|
||||
$output .= sprintf('%s</td>',$pro->name($lo));
|
||||
} catch (Exception $e) {
|
||||
$output .= sprintf('%s</td>','Unavailable');
|
||||
}
|
||||
|
||||
$output .= sprintf('<td>%s</td>',$pro->price(0,1,'base',true));
|
||||
$output .= sprintf('<td>%s</td>',$pro->display('active'));
|
||||
$output .= '</tr>';
|
||||
|
||||
// List our services using these products
|
||||
foreach ($aso as $so) {
|
||||
if ($so->product_id != $pro->id) continue;
|
||||
$output .= '<tr>';
|
||||
$output .= '<td colspan="1"> </td>';
|
||||
$output .= '<td colspan="1"> </td>';
|
||||
$output .= '<td colspan="1"> </td>';
|
||||
$output .= '<td colspan="1"> </td>';
|
||||
$output .= sprintf('<td><a href="/u/service/view/%s">%s</a>: %s</td>',$so->id,$so->id,$so->name($lo));
|
||||
$output .= sprintf('<td>%s</td>',$so->price());
|
||||
$output .= sprintf('<td>%s</td>',$so->display('active'));
|
||||
$output .= '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$output .= '</table>';
|
||||
|
||||
$this->template->content = $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Usage statistics for the previous moth
|
||||
*/
|
||||
|
@ -71,6 +71,17 @@ class Model_ADSL_Supplier extends ORM {
|
||||
}
|
||||
}
|
||||
|
||||
// VOIP
|
||||
$pos = ORM::factory('Product')
|
||||
->where('prod_plugin_file','=','VOIP')
|
||||
->list_active();
|
||||
|
||||
foreach ($pos as $po) {
|
||||
foreach ($po->service->list_active() as $so) {
|
||||
array_push($result,$so);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
@ -275,17 +275,17 @@ class Model_Service_Plugin_Adsl extends Model_Service_Plugin {
|
||||
'table'=>'style="border: 1px solid #bebcb7; padding: 5px 5px; background: none repeat scroll 0% 0% #f8f7f5; font-size: 70%;"',
|
||||
)); break;
|
||||
|
||||
case 'OFFPEAK_ALLOWANCE': $value = isset($data['allow']['base_down_offpeak']) ? $data['allow']['base_down_offpeak'].' MB' : '-'; break;
|
||||
case 'OFFPEAK_USAGE': $value = isset($data['used']['base_down_offpeak']) ? $data['used']['base_down_offpeak'].' MB' : '-'; break;
|
||||
case 'OFFPEAK_ALLOWANCE': $value = isset($data['allow']['base_down_offpeak']) ? $data['allow']['base_down_offpeak'] : '-'; break;
|
||||
case 'OFFPEAK_USAGE': $value = isset($data['used']['base_down_offpeak']) ? $data['used']['base_down_offpeak'] : '-'; break;
|
||||
|
||||
case 'PEAK_ALLOWANCE': $value = isset($data['allow']['base_down_peak']) ? $data['allow']['base_down_peak'].' MB' : '-'; break;
|
||||
case 'PEAK_USAGE': $value = isset($data['used']['base_down_peak']) ? $data['used']['base_down_peak'].' MB' : '-'; break;
|
||||
case 'PEAK_ALLOWANCE': $value = isset($data['allow']['base_down_peak']) ? $data['allow']['base_down_peak'] : '-'; break;
|
||||
case 'PEAK_USAGE': $value = isset($data['used']['base_down_peak']) ? $data['used']['base_down_peak'] : '-'; break;
|
||||
|
||||
case 'OFFPEAK_AVERAGE': $value = isset($data['used']['base_down_offpeak']) ? round($data['used']['base_down_offpeak']/$data['day'],2).' MB' : '-'; break;
|
||||
case 'OFFPEAK_AVERAGE_REMAIN': $value = ((isset($data['used']['base_down_offpeak']) AND ($data['allow']['base_down_offpeak'] > $data['used']['base_down_offpeak']) AND $daysleft) ? round(($data['allow']['base_down_offpeak']-$data['used']['base_down_offpeak'])/$daysleft,2).' MB' : '-'); break;
|
||||
case 'OFFPEAK_AVERAGE': $value = isset($data['used']['base_down_offpeak']) ? round($data['used']['base_down_offpeak']/$data['day'],2) : '-'; break;
|
||||
case 'OFFPEAK_AVERAGE_REMAIN': $value = ((isset($data['used']['base_down_offpeak']) AND ($data['allow']['base_down_offpeak'] > $data['used']['base_down_offpeak']) AND $daysleft) ? round(($data['allow']['base_down_offpeak']-$data['used']['base_down_offpeak'])/$daysleft,2) : '-'); break;
|
||||
|
||||
case 'PEAK_AVERAGE': $value = isset($data['used']['base_down_peak']) ? round($data['used']['base_down_peak']/$data['day'],2).' MB' : '-'; break;
|
||||
case 'PEAK_AVERAGE_REMAIN': $value = ((isset($data['used']['base_down_peak']) AND ($data['allow']['base_down_peak'] > $data['used']['base_down_peak']) AND $daysleft) ? round(($data['allow']['base_down_peak']-$data['used']['base_down_peak'])/$daysleft,2).' MB' : '-'); break;
|
||||
case 'PEAK_AVERAGE': $value = isset($data['used']['base_down_peak']) ? round($data['used']['base_down_peak']/$data['day'],2) : '-'; break;
|
||||
case 'PEAK_AVERAGE_REMAIN': $value = ((isset($data['used']['base_down_peak']) AND ($data['allow']['base_down_peak'] > $data['used']['base_down_peak']) AND $daysleft) ? round(($data['allow']['base_down_peak']-$data['used']['base_down_peak'])/$daysleft,2) : '-'); break;
|
||||
|
||||
case 'SERVICE_NUMBER': $value = $this->service_number; break;
|
||||
case 'USAGE_DATE': $value = Site::Date($data['last']); break;
|
||||
|
@ -49,14 +49,14 @@ class Service_Traffic_Adsl_Exetelvisp extends Service_Traffic_Adsl {
|
||||
|
||||
$valuesarray = explode(',',$details);
|
||||
|
||||
// Extel VISP stores data in MB's*100.
|
||||
// Extel VISP stores data in MB's.
|
||||
$attrs = array();
|
||||
$attrs['service'] = $valuesarray[0];
|
||||
$attrs['date'] = $valuesarray[1];
|
||||
$attrs['up_peak'] = $valuesarray[2]/100;
|
||||
$attrs['down_peak'] = $valuesarray[3]/100;
|
||||
$attrs['up_offpeak'] = $valuesarray[4]/100;
|
||||
$attrs['down_offpeak'] = $valuesarray[5]/100;
|
||||
$attrs['up_peak'] = $valuesarray[2];
|
||||
$attrs['down_peak'] = $valuesarray[3];
|
||||
$attrs['up_offpeak'] = $valuesarray[4];
|
||||
$attrs['down_offpeak'] = $valuesarray[5];
|
||||
|
||||
array_push($result,$attrs);
|
||||
}
|
||||
|
@ -18,8 +18,8 @@
|
||||
<?php $p = $so->plugin(); $po = $p->admin_plan(); $service_number = $p->service_number; ?>
|
||||
<?php $cost = $o->charge($service_number); $excess = $o->excess($service_number); $charge = Period::multiple($so->recur_schedule)*$so->price(TRUE)/12; ?>
|
||||
|
||||
<?php if ($cost != $po->supplier_plan->display('base_cost')) : ?>
|
||||
<tr class="error">
|
||||
<?php if ($po AND is_object($po) AND $cost != $po->supplier_plan->display('base_cost')) : ?>
|
||||
<tr class="error" style="background-color: #ff8888;">
|
||||
<?php elseif ($charge-$cost-$excess < 0) : ?>
|
||||
<tr class="warning">
|
||||
<?php else : ?>
|
||||
@ -28,10 +28,10 @@
|
||||
|
||||
<td><?php echo $service_number; ?></td>
|
||||
<td><?php echo HTML::anchor(URL::link('user','service/view/'.$so->id),$so->id); ?></td>
|
||||
<td><?php echo $po->supplier_plan->name().($p->provided_adsl_plan_id ? '*' : ''); ?></td>
|
||||
<td><?php echo ($po AND is_object($po)) ? ($po->supplier_plan->name().($p->provided_adsl_plan_id ? '*' : '')) : $so->name(); ?></td>
|
||||
<td><?php echo $p->contract_date_start(TRUE); ?></td>
|
||||
<td><?php echo $p->contract_date_end(TRUE); ?></td>
|
||||
<td><?php echo $po->supplier_plan->display('base_cost'); ?></td>
|
||||
<td><?php echo ($po AND is_object($po)) ? ($po->supplier_plan->display('base_cost')) : ''; ?></td>
|
||||
<td><?php echo Currency::display($cost); ?></td>
|
||||
<td><?php echo Currency::display($excess); ?></td>
|
||||
<td><?php echo Currency::display($cost+$excess); ?>
|
||||
|
@ -13,7 +13,7 @@ abstract class Checkout_Plugin_Paypal extends Checkout_Plugin {
|
||||
protected $url_prod = 'www.paypal.com';
|
||||
protected $url_test = 'www.sandbox.paypal.com';
|
||||
private $ipn_test = '173.0.82.126';
|
||||
protected $email_prod = ''; // @todo This should be in the DB
|
||||
protected $email_prod = 'deon@graytech.net.au'; // @todo This should be in the DB
|
||||
protected $email_test = ''; // @todo This should be in the DB
|
||||
protected $test_mode = FALSE;
|
||||
|
||||
|
@ -11,6 +11,31 @@
|
||||
*/
|
||||
class Controller_Admin_Checkout extends Controller_Checkout {
|
||||
protected $secure_actions = array(
|
||||
'manual'=>FALSE,
|
||||
);
|
||||
|
||||
public function action_manual() {
|
||||
$this->auto_render = FALSE;
|
||||
|
||||
$cno = ORM::factory('Checkout_Notify',$this->request->param('id'));
|
||||
|
||||
if (! $cno->loaded())
|
||||
throw HTTP_Exception::factory(404,'Not found?');
|
||||
|
||||
// Process our Notify
|
||||
try {
|
||||
$this->response->body($cno->process());
|
||||
|
||||
} catch (Exception $e) {
|
||||
Kohana_Exception::log($e);
|
||||
|
||||
echo Debug::vars($e);
|
||||
die();
|
||||
}
|
||||
|
||||
$this->response->headers('Content-Type','text/plain');
|
||||
$this->response->headers('Content-Length',(string)$this->response->content_length());
|
||||
$this->response->headers('Last-Modified',time());
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -172,6 +172,8 @@ class Invoice {
|
||||
break;
|
||||
|
||||
case 'html':
|
||||
// @todo What happened to rounding, look at service 410. Why is cost correct and invoice generation not? Maybe fixed - need to validate.
|
||||
//echo Debug::vars(['m'=>__METHOD__,'i'=>$this->_io->dump()]);
|
||||
switch ($section) {
|
||||
case 'body':
|
||||
if (! $this->_io->active)
|
||||
|
@ -296,7 +296,8 @@ class Model_Invoice extends ORM implements Cartable {
|
||||
} else {
|
||||
$key = preg_replace("/^$prefix/",'',$key);
|
||||
|
||||
return isset($this->reminders[$key]) ? ($format ? Config::date($this->reminders[$key]) : $this->reminders[$key]) : NULL;
|
||||
// Fix for inv 5061
|
||||
return (isset($this->reminders[$key]) AND ! is_array($this->reminders[$key])) ? ($format ? Site::Date($this->reminders[$key]) : $this->reminders[$key]) : NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,7 @@ class Model_Invoice_Item extends ORM {
|
||||
7=>'Extra Product/Service Charge', // * Service Billing in advance, Must have corresponding SERVICE_ID
|
||||
8=>'Product Addition', // * Additional Product Customisation, Must have corresponding SERVICE_ID
|
||||
120=>'Credit/Debit Transfer', // * SERVICE_ID is NULL, MODULE_ID is NULL, MODULE_REF is NULL : INVOICE_ID is NOT NULL
|
||||
123=>'Shipping',
|
||||
124=>'Late Payment Fee', // * SERVICE_ID is NULL, MODULE_ID = CHECKOUT MODULE,
|
||||
125=>'Payment Fee', // * SERVICE_ID is NULL, MODULE_ID = CHECKOUT MODULE, MODULE_REF = CHECKOUT NAME
|
||||
126=>'Other', // * MODEL_ID should be a module
|
||||
@ -125,20 +126,33 @@ class Model_Invoice_Item extends ORM {
|
||||
private function isValid() {
|
||||
switch ($this->item_type) {
|
||||
case 0:
|
||||
// When a charge is charging normal service fees, this fails.
|
||||
if (is_object($this->module_id))
|
||||
$this->module_id = $this->module_id->id;
|
||||
try{
|
||||
// @todo Validate if module_id = charge and module_ref corresponds with the line item
|
||||
if (! $this->service_id OR ! $this->product_id OR ($this->module_id AND $this->module_id != 30 AND ! is_null($this>module_ref)) OR $this->product_name OR is_null($this->recurring_schedule))
|
||||
if (! $this->service_id OR ! $this->product_id OR ($this->module_id AND $this->module_id != 30 AND ! is_null($this->module_ref)) OR $this->product_name OR is_null($this->recurring_schedule))
|
||||
return FALSE;
|
||||
} catch (Exception $e) {
|
||||
echo Debug::vars($this->dump());
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
return TRUE;
|
||||
if (! $this->product_id OR $this->module_id OR $this->module_ref OR $this->product_name OR ! is_null($this->recurring_schedule))
|
||||
return FALSE;
|
||||
break;
|
||||
// These items come from the charge module, so we should have a charge module_id and ref
|
||||
case 2:
|
||||
if (! $this->service_id OR ! $this->product_id OR ($this->module_id AND $this->module_id != 30 AND ! is_null($this>module_ref)) OR $this->product_name OR ! is_null($this->recurring_schedule))
|
||||
try{
|
||||
if (! $this->service_id OR ! $this->product_id OR ($this->module_id->id AND $this->module_id->id != 32 AND ! is_null($this->module_ref)) OR $this->product_name OR ! is_null($this->recurring_schedule))
|
||||
return FALSE;
|
||||
} catch (Exception $e) {
|
||||
echo Debug::vars($this->dump());
|
||||
die();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 5:
|
||||
case 4:
|
||||
case 7:
|
||||
if (! $this->service_id OR ! $this->product_id OR ! $this->module_id OR ! $this->module_ref OR $this->product_name OR ! is_null($this->recurring_schedule))
|
||||
@ -194,6 +208,8 @@ class Model_Invoice_Item extends ORM {
|
||||
switch ($this->item_type) {
|
||||
case 0:
|
||||
return sprintf('%s: %s',StaticList_ItemType::get($this->item_type),$this->period());
|
||||
case 1:
|
||||
return StaticList_ItemType::get($this->item_type);
|
||||
case 2:
|
||||
return sprintf('%s: %s',StaticList_ItemType::get($this->item_type),$this->_module() ? $this->_module()->display('date_charge') : $this->period());
|
||||
case 3:
|
||||
@ -203,6 +219,8 @@ class Model_Invoice_Item extends ORM {
|
||||
case 5:
|
||||
case 7:
|
||||
return $this->_module()->namesub($variable);
|
||||
case 123:
|
||||
return StaticList_ItemType::get($this->item_type);
|
||||
default:
|
||||
return sprintf('Unknown [%s-%s]',$this->item_type,$this->id);
|
||||
}
|
||||
|
29
modules/invoice/classes/Task/Devel/Invoice/Fixtax.php
Normal file
29
modules/invoice/classes/Task/Devel/Invoice/Fixtax.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* Fix up the missing Tax in invoices.
|
||||
*
|
||||
* @package Invoice
|
||||
* @category Tasks
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Task_Devel_Invoice_Fixtax extends Minion_Task {
|
||||
protected function _execute(array $params) {
|
||||
$c = array();
|
||||
|
||||
foreach (ORM::factory('Invoice')->find_all() as $io)
|
||||
if ($io->due() < 0)
|
||||
foreach ($io->subitems() as $iio)
|
||||
if ($iio->tax->find_all()->count() === 0) {
|
||||
$iio->subitem_add($io->account->country,FALSE);
|
||||
$iio->save();
|
||||
|
||||
array_push($c,$iio);
|
||||
}
|
||||
|
||||
return sprintf('%s items updated (%s)',count($c),join('|',$c));
|
||||
}
|
||||
}
|
||||
?>
|
65
modules/invoice/classes/Task/Devel/Invoice/List.php
Normal file
65
modules/invoice/classes/Task/Devel/Invoice/List.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @package Invoice
|
||||
* @category Tasks
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Task_Devel_Invoice_List extends Minion_Task {
|
||||
protected function _execute(array $params) {
|
||||
$c = 0;
|
||||
|
||||
foreach (ORM::factory('Invoice')->where('id','>',4331)->and_where('id','<',5320)->order_by('id','ASC')->find_all() as $io) {
|
||||
if ($io->due() == 0)
|
||||
continue;
|
||||
|
||||
/*
|
||||
elseif ($io->due() < 0) {
|
||||
foreach ($io->subitems() as $iio) {
|
||||
switch ($iio->price_base) {
|
||||
case 40.909:
|
||||
$iio->price_base=40.92;
|
||||
break;
|
||||
|
||||
case 98.045:
|
||||
case 98.05:
|
||||
$iio->price_base=98.055;
|
||||
break;
|
||||
|
||||
case 103.045:
|
||||
$iio->price_base=103.055;
|
||||
break;
|
||||
|
||||
case 204.545:
|
||||
$iio->price_base=204.56;
|
||||
break;
|
||||
case 209.545:
|
||||
$iio->price_base=209.56;
|
||||
break;
|
||||
|
||||
default:
|
||||
print_r($iio->dump());
|
||||
|
||||
}
|
||||
|
||||
$iio->save();
|
||||
}
|
||||
|
||||
printf("%4s %6.2f\n",$io->id,$io->due());
|
||||
if ($c++>2)
|
||||
break;
|
||||
|
||||
} elseif ($io->due() < 1) {
|
||||
printf("%4s %6.2f\n",$io->id,$io->due());
|
||||
}
|
||||
*/
|
||||
printf("%4s %6.2f\n",$io->id,$io->due());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
@ -100,6 +100,7 @@ class Controller_Admin_Payment extends Controller_Payment {
|
||||
if ($this->request->post()) {
|
||||
$po->values($this->request->post());
|
||||
|
||||
$po->total_amt = (float)$po->total_amt;
|
||||
// Update our invoice payment items
|
||||
if (is_array($this->request->post('payment_item')) AND count($this->request->post('payment_item')))
|
||||
foreach ($this->request->post('payment_item') as $k=>$v) {
|
||||
|
@ -107,10 +107,11 @@ class Model_SSL_CA extends ORM {
|
||||
$result = NULL;
|
||||
|
||||
// If we are a root cert, we are valid
|
||||
if (is_null($this->parent_ssl_ca_id) AND $this->isRoot())
|
||||
if ((($this->parent_ssl_ca_id == $this->id) OR is_null($this->parent_ssl_ca_id)) AND $this->isRoot())
|
||||
return StaticList_YesNo::get(TRUE,$format);
|
||||
//echo Debug::vars([__METHOD__,'psci'=>$this->parent_ssl_ca_id,'myid'=>$this->id,'root'=>$this->isRoot()]);
|
||||
|
||||
return StaticList_YesNo::get($this->aki_keyid() == $this->parent->ski(),$format);
|
||||
return StaticList_YesNo::get(($this->aki_keyid() == $this->parent->ski() AND $this->parent_ssl_ca_id != $this->id),$format);
|
||||
}
|
||||
|
||||
// If we change the SSL certificate, we need to reload our SSL object
|
||||
|
@ -116,9 +116,11 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
|
||||
// Get the first parent CA certificate
|
||||
$po = $this->ca;
|
||||
|
||||
while ($po AND $po->loaded()) {
|
||||
//echo Debug::vars([__METHOD__,'this'=>$this,'po'=>$po,'vp'=>$po->validParent()]);die();
|
||||
$c = 0;
|
||||
while ($po AND $po->loaded() AND $c++ < 5) {
|
||||
array_push($result,$po);
|
||||
$po = ($po->validParent()) ? $po->parent : NULL;
|
||||
$po = ($po->validParent() AND $po->id != $po->parent_ssl_ca_id) ? $po->parent : NULL;
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
34
modules/voip/classes/Model/Product/Plugin/Voip.php
Normal file
34
modules/voip/classes/Model/Product/Plugin/Voip.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class supports ADSL products
|
||||
*
|
||||
* @package ADSL
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Product_Plugin_Voip extends Model_Product_Plugin {
|
||||
protected $_table_name = 'voip_plan';
|
||||
|
||||
// Our required abstract methods
|
||||
|
||||
public function cost($annual=FALSE) {
|
||||
$x = 50;
|
||||
|
||||
return $annual ? $x*12 : $x;
|
||||
}
|
||||
|
||||
// @todo Select the ADSL Plan for this product.
|
||||
public function render_edit() {
|
||||
return '';
|
||||
}
|
||||
|
||||
public function supplier() {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Local functions
|
||||
}
|
||||
?>
|
131
modules/voip/classes/Model/Service/Plugin/Voip.php
Normal file
131
modules/voip/classes/Model/Service/Plugin/Voip.php
Normal file
@ -0,0 +1,131 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class supports Services
|
||||
*
|
||||
* @package ADSL
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Service_Plugin_Voip extends Model_Service_Plugin {
|
||||
protected $_table_name = 'service__voip';
|
||||
protected $_created_column = FALSE;
|
||||
protected $_updated_column = FALSE;
|
||||
|
||||
// Relationships
|
||||
protected $_has_one = array(
|
||||
);
|
||||
|
||||
protected $_has_many = array(
|
||||
);
|
||||
|
||||
protected $_display_filters = array(
|
||||
'service_connect_date'=>array(
|
||||
array('Site::Date',array(':value')),
|
||||
),
|
||||
'service_contract_date'=>array(
|
||||
array('Site::Date',array(':value')),
|
||||
),
|
||||
);
|
||||
|
||||
protected $_save_message = TRUE;
|
||||
|
||||
/** REQUIRED ABSTRACT METHODS **/
|
||||
|
||||
public function attributes($variable=NULL) {
|
||||
return array(
|
||||
'Service Address'=>$this->service_address ? $this->display('service_address') : 'UNKNOWN',
|
||||
'Contract Until'=>$this->contract_date_end(TRUE),
|
||||
);
|
||||
}
|
||||
|
||||
public function expire() {
|
||||
// We'll leave it to the Service record to determine when this service expires
|
||||
return NULL;
|
||||
}
|
||||
|
||||
public function password() {
|
||||
return $this->service_password;
|
||||
}
|
||||
|
||||
public function username() {
|
||||
return $this->service_username;
|
||||
}
|
||||
|
||||
/** LOCAL METHODS **/
|
||||
|
||||
/**
|
||||
* Calculate our contract start and end dates
|
||||
*/
|
||||
public function contract_date_start($format=FALSE) {
|
||||
return $format ? Site::Date($this->service_contract_date) : $this->service_contract_date;
|
||||
}
|
||||
|
||||
public function contract_date_end($format=FALSE) {
|
||||
$x = strtotime(sprintf('+%s months',12),$this->service_contract_date);
|
||||
|
||||
return $format ? Site::Date($x) : $x;
|
||||
}
|
||||
|
||||
public function name($variable=NULL) {
|
||||
return $this->service_number;
|
||||
}
|
||||
|
||||
public function namesub($variable=NULL) {
|
||||
return $this->display('service_address');
|
||||
}
|
||||
|
||||
/**
|
||||
* If we override the plan that the customers gets (from what the supplier provides).
|
||||
* @todo This needs to get the plan that was invoiced, not the current plan..
|
||||
*/
|
||||
public function plan($month=NULL) {
|
||||
return is_null($month) ? $this->service->product->plugin() : $this->plandate($month);
|
||||
}
|
||||
|
||||
/**
|
||||
* For a particular month, select the PLAN that the user was on
|
||||
*/
|
||||
public function plandate($month) {
|
||||
throw new Kohana_Exception('This function hasnt been written yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the template variables, used mainly in emailing
|
||||
*
|
||||
* @param array Variables that need to be expanded
|
||||
* @param array Data that was previously calculated
|
||||
*/
|
||||
public function template_variables(array $array,array $data=array()) {
|
||||
$result = array();
|
||||
|
||||
$friendly = array(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for services matching a term
|
||||
*/
|
||||
public function list_autocomplete($term,$index,$value,array $label,array $limit=array(),array $options=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('service.active','=',1)
|
||||
->where_open()
|
||||
->and_where($this->_table_name.'.service_number','like','%'.$term.'%')
|
||||
->or_where($this->_table_name.'.service_address','like','%'.$term.'%')
|
||||
->where_close();
|
||||
|
||||
return parent::list_autocomplete($term,$index,$value,$label,$limit,$options);
|
||||
}
|
||||
|
||||
public function admin_plan() { return 'VOIP'; }
|
||||
}
|
||||
?>
|
8
modules/voip/views/product/plugin/voip/order.php
Normal file
8
modules/voip/views/product/plugin/voip/order.php
Normal file
@ -0,0 +1,8 @@
|
||||
<fieldset>
|
||||
<legend>VOIP Service Details</legend>
|
||||
|
||||
<?php
|
||||
echo View::factory('field/text')->set('data',['field'=>'plugin[service_number]','value'=>'','text'=>'Service Number','class'=>'col-md-2']);
|
||||
?>
|
||||
|
||||
</fieldset>
|
10
modules/voip/views/product/plugin/voip/view.php
Normal file
10
modules/voip/views/product/plugin/voip/view.php
Normal file
@ -0,0 +1,10 @@
|
||||
<fieldset>
|
||||
<legend>VOIP Features</legend>
|
||||
|
||||
<div class="dl-horizontal">
|
||||
|
||||
<dt>Calls</dt>
|
||||
<dd>Included</dd>
|
||||
|
||||
</div> <!-- /dl-horizontal -->
|
||||
</fieldset>
|
14
modules/voip/views/service/admin/plugin/voip/edit.php
Normal file
14
modules/voip/views/service/admin/plugin/voip/edit.php
Normal file
@ -0,0 +1,14 @@
|
||||
<fieldset>
|
||||
<legend>VOIP Service Details</legend>
|
||||
|
||||
<?php
|
||||
echo View::factory('field/text')->set('data',['field'=>'plugin[service_number]','value'=>$o->service_number,'text'=>'Service Number','class'=>'col-md-2']);
|
||||
echo View::factory('field/text')->set('data',['field'=>'plugin[service_address]','value'=>$o->service_address,'text'=>'Service Address','class'=>'col-md-6']);
|
||||
echo View::factory('field/date')->set('data',['field'=>'plugin[service_connect_date]','value'=>$o->service_connect_date,'text'=>'Service Connect Date','enddate'=>NULL]);
|
||||
echo View::factory('field/date')->set('data',['field'=>'plugin[service_contract_date]','value'=>$o->service_contract_date,'text'=>'Contract Start Date','enddate'=>'new Date()']);
|
||||
echo View::factory('field/text')->set('data',['field'=>'plugin[contract_term]','value'=>$o->contract_term,'text'=>'Override Contract Term','class'=>'col-md-1']);
|
||||
echo View::factory('field/text')->set('data',['field'=>'plugin[service_username]','value'=>$o->service_username,'text'=>'Service Username','class'=>'col-md-4']);
|
||||
echo View::factory('field/text')->set('data',['field'=>'plugin[service_password]','value'=>$o->service_password,'text'=>'Service Password','class'=>'col-md-2']);
|
||||
?>
|
||||
|
||||
</fieldset>
|
29
modules/voip/views/service/user/plugin/voip/view.php
Normal file
29
modules/voip/views/service/user/plugin/voip/view.php
Normal file
@ -0,0 +1,29 @@
|
||||
<div class="span6">
|
||||
<fieldset>
|
||||
<legend>Service Details</legend>
|
||||
|
||||
<div class="dl-horizontal">
|
||||
<dt>Service Number</dt>
|
||||
<dd><?php echo $o->display('service_number'); ?></dd>
|
||||
|
||||
<dt>Service Address</dt>
|
||||
<dd><?php echo $o->display('service_address'); ?></dd>
|
||||
|
||||
<dt>Connect Date</dt>
|
||||
<dd><?php echo $o->display('service_connect_date'); ?></dd>
|
||||
|
||||
<dt>Contract Term</dt>
|
||||
<dd><?php echo $o->display('contract_term'); ?></dd>
|
||||
|
||||
<dt>Contract End Date</dt>
|
||||
<dd><?php echo $o->contract_date_end(TRUE); ?></dd>
|
||||
|
||||
<dt>Service Username</dt>
|
||||
<dd><?php echo $o->display('service_username'); ?></dd>
|
||||
|
||||
<dt>Service Password</dt>
|
||||
<dd>Contact Us for Details</dd>
|
||||
|
||||
</div> <!-- dl-horizontal -->
|
||||
</fieldset>
|
||||
</div> <!-- /span -->
|
Reference in New Issue
Block a user