diff --git a/css/bts_timesheet.css b/css/bts_timesheet.css
index f617782..f9313a7 100644
--- a/css/bts_timesheet.css
+++ b/css/bts_timesheet.css
@@ -668,6 +668,11 @@ div.blueTable.emptyrecord{
box-shadow: 1px 1px 10px #f50202;
}
+.divTable.highlight.newcopy{
+ box-shadow: 1px 1px 10px orange;
+ border:5px orange solid;
+}
+
.divTableRow {
display: table-row;
@@ -759,10 +764,19 @@ div.brating{
position: absolute;
}
+div.bsave span.ticon-copy{
+ display: none;
+}
+div.bsave span.ticon-save{
+ display: inline-block;
+}
-div.bsave.saved span{
+div.bsave.saved span.ticon-save{
display: none;
}
+div.bsave.saved span.ticon-copy{
+ display: inline-block;
+}
/* short code for the table */
diff --git a/html/job.html b/html/job.html
index b080ebb..bb51ed4 100644
--- a/html/job.html
+++ b/html/job.html
@@ -23,6 +23,7 @@
+
diff --git a/js/bts_timesheet.js b/js/bts_timesheet.js
index 3377e25..2d504e2 100644
--- a/js/bts_timesheet.js
+++ b/js/bts_timesheet.js
@@ -292,6 +292,14 @@
var table = $(this).closest('div.divTable');
table.data().job.do_save_record();
});
+
+ $(document).on('click', 'span.ticon.ticon-copy', function(){
+ if (!confirm("make a copy of this job?"))
+ return;
+ var table = $(this).closest('div.divTable');
+ var job = table.data().job;
+ clone_data_create_new_job(job.get_record_from_ui());
+ });
class Job{ //save data for the record, and display it as GUI
constructor(data){
@@ -512,6 +520,18 @@
this.el.removeClass('emptyrecord');
}
+ mark_highlight_me(ms){
+ this.el.addClass('blink_me');
+ this.el.addClass('highlight');
+ this.el.addClass('newcopy');
+ var self = this;
+ setTimeout(function(){
+ self.el.removeClass('blink_me');
+ self.el.removeClass('highlight');
+ self.el.removeClass('newcopy');
+ },ms);
+ }
+
is_start_valid(){
var s = this.get_start();
return is_valid_date_str(s);
@@ -887,7 +907,7 @@
});
jobs.forEach(function(e){
- clone_data_create_new_job(e.data);
+ clone_data_create_new_job(e.get_record_from_ui());
});
});
@@ -932,7 +952,8 @@
f = new Date(f.setDate(f1));
data.finish = format_date_time(f);
}
- new Job(data);
+ var newj = new Job(data);
+ newj.mark_highlight_me(1000);//for 1 second;
}
function is_valid_date_str(val){