alert sound when timer exceeds the given hours
diff --git a/erpnext/projects/doctype/timesheet/timesheet.css b/erpnext/projects/doctype/timesheet/timesheet.css
index 9cce5f4..a88e663 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.css
+++ b/erpnext/projects/doctype/timesheet/timesheet.css
@@ -1,5 +1,5 @@
@import 'https://fonts.googleapis.com/css?family=Open+Sans:300,600,800';
-/*html,
+/* html,
body {
background-color: #000;
color: #fff;
@@ -13,7 +13,7 @@
-o-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
-}*/
+} */
.stopwatch {
height: 50%;
diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js
index ed8bbb6..390ed4f 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.js
+++ b/erpnext/projects/doctype/timesheet/timesheet.js
@@ -50,7 +50,7 @@
}
}
- if (frm.doc.total_hours) {
+ if (frm.doc.total_hours && frm.doc.docstatus < 2) {
frm.add_custom_button(__('Start Timer'), function() {
frm.trigger("timer")
}).addClass("btn-primary");
@@ -78,7 +78,6 @@
"options": frm.doc.time_logs.map(d => d.hours)}
]
});
-
dialog.wrapper.append(frappe.render_template("timesheet"));
frm.trigger("control_timer");
dialog.show();
@@ -93,6 +92,10 @@
var paused_time = 0;
$(".playpause").click(function(e) {
+ if (!cur_dialog.get_value('activity')) {
+ frappe.msgprint(__("Please select Activity"));
+ return false;
+ }
if (clicked) {
e.preventDefault();
return false;
@@ -120,6 +123,7 @@
});
$(".stop").click(function() {
+ console.log(currentIncrement);
reset();
});
@@ -146,6 +150,7 @@
if(cur_dialog && cur_dialog.get_value('hours') == hours) {
isPaused = true;
initialised = false;
+ frappe.utils.play_sound("alert");
frappe.msgprint(__("Timer exceeded the given hours"));
}
$(".hours").text(hours < 10 ? ("0" + hours.toString()) : hours.toString());