Removed direct references to $_REQUEST and $_POST
This commit is contained in:
@@ -29,12 +29,12 @@ class Controller_Reseller_Charge extends Controller_Charge {
|
||||
public function action_ajaxlist() {
|
||||
$result = array();
|
||||
|
||||
if (isset($_REQUEST['term']) AND trim($_REQUEST['term'])) {
|
||||
$result = Arr::merge($result,ORM::factory('Account')->list_autocomplete($_REQUEST['term'],'id','id',array('%s: %s'=>array('refnum()','name()'))));
|
||||
$result = Arr::merge($result,ORM::factory('Service')->list_autocomplete($_REQUEST['term'],'account_id','id',array('%s: %s (%s)'=>array('account->refnum()','account->name()','name()'))));
|
||||
if ($this->request->query('term')) {
|
||||
$result = Arr::merge($result,ORM::factory('Account')->list_autocomplete($this->request->query('term'),'id','id',array('%s: %s'=>array('refnum()','name()'))));
|
||||
$result = Arr::merge($result,ORM::factory('Service')->list_autocomplete($this->request->query('term'),'account_id','id',array('%s: %s (%s)'=>array('account->refnum()','account->name()','name()'))));
|
||||
|
||||
foreach (array('Service_Plugin_Adsl','Service_Plugin_Domain','Service_Plugin_Host') as $o)
|
||||
$result = Arr::merge($result,ORM::factory($o)->list_autocomplete($_REQUEST['term'],'account_id','service->account_id',array('%s: %s (%s)'=>array('service->account->refnum()','service->account->name()','service->name()'))));
|
||||
$result = Arr::merge($result,ORM::factory($o)->list_autocomplete($this->request->query('term'),'account_id','service->account_id',array('%s: %s (%s)'=>array('service->account->refnum()','service->account->name()','service->name()'))));
|
||||
}
|
||||
|
||||
$this->response->headers('Content-Type','application/json');
|
||||
@@ -44,8 +44,8 @@ class Controller_Reseller_Charge extends Controller_Charge {
|
||||
public function action_ajaxlistservice() {
|
||||
$result = array();
|
||||
|
||||
if (isset($_REQUEST['key']) AND trim($_REQUEST['key']))
|
||||
$result = Arr::merge($result,ORM::factory('Service')->list_autocomplete('','id','id',array('%s: %s'=>array('refnum(TRUE)','name()')),array(array('account_id','=',$_REQUEST['key']))));
|
||||
if ($this->request->query('key'))
|
||||
$result = Arr::merge($result,ORM::factory('Service')->list_autocomplete('','id','id',array('%s: %s'=>array('refnum(TRUE)','name()')),array(array('account_id','=',$this->request->query('key')))));
|
||||
|
||||
$this->response->headers('Content-Type','application/json');
|
||||
$this->response->body(json_encode(array_values($result)));
|
||||
@@ -56,7 +56,7 @@ class Controller_Reseller_Charge extends Controller_Charge {
|
||||
|
||||
$this->meta->title = sprintf('Charge: %s (%s)',$co->name(),$co->account->name());
|
||||
|
||||
if ($_POST AND $co->values($_POST)->changed() AND (! $this->save($co)))
|
||||
if ($this->request->post() AND $co->values($this->request->post())->changed() AND (! $this->save($co)))
|
||||
$co->reload();
|
||||
|
||||
Script::factory()
|
||||
|
Reference in New Issue
Block a user