Ensure site_id is included in ORM::add(), fixed payment revendering, start product category work

This commit is contained in:
Deon George
2016-08-25 13:14:08 +10:00
parent c1cc6b6f69
commit b74fdc930f
7 changed files with 82 additions and 82 deletions

View File

@@ -95,7 +95,7 @@ class Controller_Admin_Payment extends Controller_Payment {
private function add_edit($id=NULL,$output='') {
$po = ORM::factory('Payment',$id);
$this->meta->title = 'Payment: '.$po->refnum(TRUE);
$this->meta->title = $po->loaded() ? 'Payment: '.$po->refnum(TRUE) : 'A|Payment Add';
if ($this->request->post()) {
$po->values($this->request->post());
@@ -113,61 +113,6 @@ class Controller_Admin_Payment extends Controller_Payment {
$this->save($po);
}
Script::factory()
->type('file')
->data('media/theme/bootstrap/js/bootstrap.datepicker.js');
Style::factory()
->type('file')
->data('media/theme/bootstrap/css/bootstrap.datepicker.css');
Script::factory()
->type('stdin')
->data('
$(document).ready(function() {
$("#date_payment_label").datepicker({
autoclose : true,
todayHighlight: true,
endDate : new Date(),
format : "dd-mm-yyyy",
todayBtn : true,
}).on("hide",function(ev) {
$("input[name=date_payment]").val(ev.date.valueOf()/1000);
});
$("input[name=account_id_label]").typeahead({
minLength: 2,
source: function (query,process) {
search("'.URL::link('admin','payment/ajaxlist').'",query,process);
},
matcher: function () { return true; },
updater: function (item) {
$("input[name=account_id]").val(users[item]);
// Send the request and update sub category dropdown
$.ajax({
type: "GET",
data: "key="+users[item],
dataType: "html",
cache: false,
url: "'.URL::link('admin','payment/ajaxitemlist',TRUE).'",
timeout: 2000,
error: function(x) {
alert("Failed to submit");
},
success: function(data) {
$("div[id=items]").empty().append(data);
}
});
return item;
},
});
});
');
if ($po->loaded())
Script::factory()
->type('stdin')