Removed direct references to $_REQUEST and $_POST
This commit is contained in:
@@ -29,8 +29,8 @@ class Controller_Admin_Payment extends Controller_Payment {
|
||||
public function action_addbulk() {
|
||||
$output = '';
|
||||
|
||||
if ($_POST AND isset($_POST['payer'])) {
|
||||
$c = Kohana::classname('Payment_Bulk_'.$_POST['payer']);
|
||||
if ($this->request->post() AND $this->request->post('payer')) {
|
||||
$c = Kohana::classname('Payment_Bulk_'.$this->request->post('payer'));
|
||||
$o = new $c();
|
||||
|
||||
$output .= (! $_FILES) ? $o->form() : $o->process();
|
||||
@@ -56,10 +56,10 @@ class Controller_Admin_Payment extends Controller_Payment {
|
||||
$invoices = array();
|
||||
|
||||
// Get our invoices paid by this payment ID
|
||||
$po = ORM::factory('Payment',isset($_REQUEST['pid']) ? $_REQUEST['pid'] : NULL);
|
||||
$po = ORM::factory('Payment',$this->request->query('pid'));
|
||||
|
||||
// Get all our other outstanding invoices
|
||||
foreach (ORM::factory('Account',$_REQUEST['key'])->invoices_due() as $io) {
|
||||
foreach (ORM::factory('Account',$this->request->query('key'))->invoices_due() as $io) {
|
||||
$pio = $po->payment_item;
|
||||
$pio->invoice_id = $io->id;
|
||||
|
||||
@@ -73,9 +73,9 @@ class Controller_Admin_Payment extends Controller_Payment {
|
||||
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('ACC %s: %s'=>array('id','name()'))));
|
||||
$result = Arr::merge($result,ORM::factory('Invoice')->list_autocomplete($_REQUEST['term'],'id','account_id',array('INV %s: %s'=>array('id','account->name()'))));
|
||||
if ($this->request->query('term'))
|
||||
$result = Arr::merge($result,ORM::factory('Account')->list_autocomplete($this->request->query('term'),'id','id',array('ACC %s: %s'=>array('id','name()'))));
|
||||
$result = Arr::merge($result,ORM::factory('Invoice')->list_autocomplete($this->request->query('term'),'id','account_id',array('INV %s: %s'=>array('id','account->name()'))));
|
||||
}
|
||||
|
||||
$this->response->headers('Content-Type','application/json');
|
||||
@@ -99,8 +99,8 @@ class Controller_Admin_Payment extends Controller_Payment {
|
||||
$po->values($this->request->post());
|
||||
|
||||
// Update our invoice payment items
|
||||
if (isset($_POST['payment_item']) AND count($_POST['payment_item']))
|
||||
foreach ($_POST['payment_item'] as $k=>$v) {
|
||||
if (is_array($this->request->post('payment_item')) AND count($this->request->post('payment_item')))
|
||||
foreach ($this->request->post('payment_item') as $k=>$v) {
|
||||
$pio = $po->payment_item;
|
||||
$pio->invoice_id = $k;
|
||||
$pio = $po->add_item($pio);
|
||||
|
Reference in New Issue
Block a user