patrick 6 лет назад
Родитель
Сommit
088ee49941
2 измененных файлов: 37 добавлений и 2 удалений
  1. +36
    -2
      js/bts_timesheet.js
  2. +1
    -0
      ts.php

+ 36
- 2
js/bts_timesheet.js Просмотреть файл

@@ -262,7 +262,9 @@
this.el.find("div.brating span").click(function(){
var r = $(this).attr('data-rating');
self.data.rating = r;
self.mark_dirty();
self.set_rating(r);
})
this.el.find("div.brating").mouseenter(function(){
@@ -399,6 +401,7 @@
record.staff = this.get_staff();
record.client = this.get_client();
record.ack = this.get_ack();
record.rating = this.get_rating();
return record;
}
@@ -409,10 +412,35 @@
action: "save_job", // action
record: this.get_record_from_ui(),
}, function(response, status, xhr){
console.log("response for save %o", response);
self.load_data(response.newdata);
if (response.status=='success'){
self.load_data(response.newdata);
self.mark_saved();
}else{
alert( 'error saving data, please check your network');
}
});
}
mark_dirty() //need save
{
var d = this.el.find('.bsave');
d.removeClass('saved');
d.addClass('blink_me');
setTimeout(function(){
d.removeClass('blink_me');
},1000);
}
mark_saved()
{
var d = this.el.find('.bsave');

d.addClass('blink_me');
setTimeout(function(){
d.removeClass('blink_me');
d.addClass('saved');
},1000);
}
}//end of class Job
//global GUI summary
@@ -684,6 +712,12 @@
}

$(document).on('change', '.divTableRow select, .divTableRow input', function() {
var job = $(this).closest('.divTable').data().job;
job.mark_dirty();
});
reset_title_to_today();
/*________________________________________________________________________*/
});

+ 1
- 0
ts.php Просмотреть файл

@@ -328,6 +328,7 @@ class AcareOffice{
'staff' => $r['staff'],
'client' => $r['client'],
'ack' => $r['ack']=='true'?1:0,
'rating'=>$r['rating'],
);
//this is an update

Загрузка…
Отмена
Сохранить