Update of /cvsroot/wtf-tracker/wtf/static
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19349/static
Modified Files:
tracking.js
Log Message:
Patch to add feature request 1618511: Populate Yesterday's Input Data
Index: tracking.js
===================================================================
RCS file: /cvsroot/wtf-tracker/wtf/static/tracking.js,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** tracking.js 20 Dec 2006 00:04:32 -0000 1.11
--- tracking.js 21 Dec 2006 16:36:04 -0000 1.12
***************
*** 15,19 ****
createTrackingItems();
window.onunload = function () {
! submitTrackingForm( document.tracking, true );
}
--- 15,19 ----
createTrackingItems();
window.onunload = function () {
! if ( ! skipSubmitTrackingForm ) submitTrackingForm( document.tracking, true );
}
***************
*** 30,33 ****
--- 30,36 ----
}
+ // boolean variable to prevent automatic tracking form submission
+ var skipSubmitTrackingForm = false;
+
// boolean variable to prevent form double submission based on the
// window.onunload hook setup inside the window.onload function;
***************
*** 601,602 ****
--- 604,631 ----
"description=" + description;
}
+
+ function copyLastData(trackingForm) {
+ if ( trackingChange && ! confirm(
+ 'Are you sure you want to copy last data?\n' +
+ 'You will loose any changes you have made.'
+ ) ) return;
+
+ trackingForm.copy_last_data.value = "on";
+ skipSubmitTrackingForm = true;
+ trackingForm.submit();
+ }
+
+ function resetTrackingForm( trackingForm, urlPath ) {
+ if (
+ ( trackingChange && confirm(
+ 'Are you sure you want to reset this data?\n' +
+ 'You will loose any changes you have made.'
+ ) ) ||
+ ( trackingForm.copy_last_data_done == "on" && ! trackingChange )
+ ) {
+ skipSubmitTrackingForm = true;
+ trackingForm.reset();
+ //window.location.reload(false);
+ window.location.href = '/wtf/view/input/tracking?display_date=' + trackingForm.display_date.value;
+ }
+ }
|