From a9f21fe34d07fd873b6ef29acf0645c0c656ea23 Mon Sep 17 00:00:00 2001 From: Remdex Date: Thu, 18 Sep 2014 21:10:12 +0200 Subject: [PATCH] Show reseller it's status --- .../classes/erlhcoreclassmodelinstance.php | 11 ++++++++++- .../tpl/lhinstance/billing.tpl.php | 14 ++++++++++++++ instancecustomer/translations/lt_LT/translation.ts | 12 ++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/instancecustomer/classes/erlhcoreclassmodelinstance.php b/instancecustomer/classes/erlhcoreclassmodelinstance.php index d5b017e..1c70701 100644 --- a/instancecustomer/classes/erlhcoreclassmodelinstance.php +++ b/instancecustomer/classes/erlhcoreclassmodelinstance.php @@ -86,7 +86,16 @@ public function __get($var) { $this->is_active = $this->request > 0 && $this->expires > time() && $this->suspended == 0 && $this->reseller_suspended == 0; return $this->is_active; break; - + + case 'reseller_instances_count': + $db = ezcDbInstance::get(); + $cfg = erConfigClassLhConfig::getInstance(); + $db->query('USE '.$cfg->getSetting( 'db', 'database' )); + $this->reseller_instances_count = self::getCount(array('filter' => array('reseller_id' => $this->id))); + $db->query('USE '.$cfg->getSetting( 'db', 'database_user_prefix').erLhcoreClassInstance::$instanceChat->id); + return $this->reseller_instances_count; + break; + default: ; break; diff --git a/instancecustomer/design/instancecustomertheme/tpl/lhinstance/billing.tpl.php b/instancecustomer/design/instancecustomertheme/tpl/lhinstance/billing.tpl.php index 86d8ee8..9891702 100644 --- a/instancecustomer/design/instancecustomertheme/tpl/lhinstance/billing.tpl.php +++ b/instancecustomer/design/instancecustomertheme/tpl/lhinstance/billing.tpl.php @@ -1,6 +1,20 @@

getTranslation('instance/edit','Billing');?>

+ is_reseller) : ?> + + + + + + + + + + + + + diff --git a/instancecustomer/translations/lt_LT/translation.ts b/instancecustomer/translations/lt_LT/translation.ts index 5ff7f85..c1df695 100644 --- a/instancecustomer/translations/lt_LT/translation.ts +++ b/instancecustomer/translations/lt_LT/translation.ts @@ -23,6 +23,18 @@ instance/edit + + Max request per instance + Maksimalus užklausų skaičius per klientą + + + Request left to sell + Neparduotų užklausų skaičius + + + Instances + Klientai + Billing Apmokėjimas
getTranslation('instance/edit','Instances');?>reseller_instances_count?>/reseller_max_instances?>
getTranslation('instance/edit','Request left to sell');?>reseller_request?>
getTranslation('instance/edit','Max request per instance');?>reseller_max_instance_request?>
getTranslation('instance/edit','Request left');?> request?>