[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch master updated. 40f1fb2cea5a54da20497f1c89bee21a753de127

Evergreen Git git at git.evergreen-ils.org
Tue Aug 12 10:56:07 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  40f1fb2cea5a54da20497f1c89bee21a753de127 (commit)
       via  5eb13d5e7db75ed010a33ffce6342643f3c32c4a (commit)
      from  f54db601a5a89ac99e7d64e27e34c5863e60a167 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 40f1fb2cea5a54da20497f1c89bee21a753de127
Author: Bill Erickson <berick at esilibrary.com>
Date:   Mon Aug 11 11:04:43 2014 -0400

    LP#1329503 text input repairs
    
    * Correctly propagate values for text widget "in list" values when editing
      reports
    * After entering a value for "in list" text widgets, clear the text
      input so the user can enter subsequent values w/o manually clearing.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/web/reports/oils_rpt_widget.js b/Open-ILS/web/reports/oils_rpt_widget.js
index 2937e9e..f711089 100644
--- a/Open-ILS/web/reports/oils_rpt_widget.js
+++ b/Open-ILS/web/reports/oils_rpt_widget.js
@@ -23,6 +23,10 @@ oilsRptSetWidget.prototype.draw = function() {
 	var obj = this;
 	this.addButton.onclick = function() {
 		obj.addDisplayItems(obj.inputWidget.getDisplayValue());
+        if (obj.inputWidget instanceof oilsRptTextWidget) {
+            // clear the value
+            obj.inputWidget.dest.value = '';
+        }
 	}
 
 	this.delButton.onclick = function(){obj.removeSelected()};
@@ -31,9 +35,21 @@ oilsRptSetWidget.prototype.draw = function() {
 
     var this_ = this;
     var post_draw = function() {
-        // propagate the values from the input widget into the our display.
-        if (this_.inputWidget.seedValue)
-            this_.addButton.onclick();
+        if (this_.seedValue && this_.seedValue.length) {
+            if (this_.inputWidget instanceof oilsRptTextWidget) {
+                // add each seed value to the input widget, then 
+                // propagate the value into our multiselect.
+                // when done, clear the value from the text widget.
+                dojo.forEach(this_.seedValue, function(val) {
+                    this_.inputWidget.dest.value = val;
+                    this_.addButton.onclick();
+                });
+                this_.inputWidget.dest.value = '';
+
+            } else {
+                this_.addButton.onclick();
+            }
+        }
     }
 
 	this.inputWidget.draw(null, post_draw);

commit 5eb13d5e7db75ed010a33ffce6342643f3c32c4a
Author: Bill Erickson <berick at esilibrary.com>
Date:   Fri Aug 8 13:57:09 2014 -0400

    LP#1329503 report edit scheduling repairs
    
    * ensure default values for scheduling and recurrence are applied with each
      edited report, including today's date in the scheduler.
    * If the most recent report run run_time is in the past, deafult to "run
      now"
    * fix bug with propagating months recurrence
    * If recurrence interval is in days and divisible by 7, present as weeks
    * make date regexes easier on the eyes
    * fix bug with rendering sets of org units
    * fixed bug with modifying report to be "run now" from scheduled.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/web/reports/oils_rpt_report_editor.js b/Open-ILS/web/reports/oils_rpt_report_editor.js
index 5db7a33..ae69b46 100644
--- a/Open-ILS/web/reports/oils_rpt_report_editor.js
+++ b/Open-ILS/web/reports/oils_rpt_report_editor.js
@@ -84,7 +84,19 @@ oils_rpt_editor_pivot_data
         hideMe(DOM.oils_rpt_editor_pivot_label_row);
         hideMe(DOM.oils_rpt_editor_pivot_data_row);
     }
- 
+
+
+    // schedule defaults.
+    DOM.oils_rpt_param_editor_sched_start_date.value = mkYearMonDay();
+    setSelector(DOM.oils_rpt_param_editor_sched_start_hour, '12:00');
+    DOM.oils_rpt_report_editor_run_now.checked = true;
+    DOM.oils_rpt_report_editor_schedule.checked = false;
+    DOM.oils_rpt_param_editor_sched_start_date.disabled = true;
+    DOM.oils_rpt_param_editor_sched_start_hour.disabled = true;
+
+    // recur defaults
+    setSelector(DOM.oils_rpt_recur_interval_type, 'days');
+    setSelector(DOM.oils_rpt_recur_count, '1');
 
 	if( rpt ) {
         // populate the report edit form w/ report data
@@ -101,9 +113,26 @@ oils_rpt_editor_pivot_data
         }
 
         if (rpt.recurrence()) {
+            console.log('editing report with recurrence: ' + rpt.recurrence());
             var parts = rpt.recurrence().split(/ /);
-            setSelector(DOM.oils_rpt_recur_count, parts[0]);
-            setSelector(DOM.oils_rpt_recur_interval_type, parts[1]);
+            var type = parts[1];
+            var count = Number(parts[0]);
+
+            if (type.match(/^mon/)) {
+                // PG stores 'months' as 'mon(s)'
+                type = 'months'; 
+            } else if (type.match(/^day/)) {
+                // PG stores weeks as days.  Assuming a person would typically
+                // use weeks to represent sets of 7 days, translate back to
+                // weeks when we can.
+                if (count % 7 == 0) {
+                    type = 'weeks';
+                    count = count / 7;
+                }
+            }
+
+            setSelector(DOM.oils_rpt_recur_count, count);
+            setSelector(DOM.oils_rpt_recur_interval_type, type);
         }
 
         if (rpt.data()) { 
@@ -125,26 +154,26 @@ oils_rpt_editor_pivot_data
             DOM.oils_rpt_param_editor_sched_email.value = run.email();
 
             if (run.run_time()) {
-                DOM.oils_rpt_report_editor_run_now.checked = false;
-                DOM.oils_rpt_report_editor_schedule.checked = true;
-                DOM.oils_rpt_param_editor_sched_start_date.disabled = false;
-                DOM.oils_rpt_param_editor_sched_start_hour.disabled = false;
-
-                if (new Date(Date.parse(run.run_time())) < new Date()) {
-                    // editing a report with a past-tense run time
-                    // clear the value so the user will have to edit
-                    DOM.oils_rpt_param_editor_sched_start_date.value = mkYearMonDay();
-                } else {
+                console.log('view/edit report with last run_time: ' + run.run_time());
+                if (new Date(Date.parse(run.run_time())) >= new Date() || this.readonly) {
+                    // Next run of the edited report is scheduled for some time in the future.
+                    // Propagate the value into the data selector and de-select run-now.
+                    // Ditto read-only mode, so the user can see info on the most recent run.
+
                     DOM.oils_rpt_param_editor_sched_start_date.value = 
-                        run.run_time().match(/(\d\d\d\d-\d\d-\d\d)/)[1]
+                        run.run_time().match(/(\d{4}-\d{2}-\d{2})/)[1]
+
                     setSelector(
                         DOM.oils_rpt_param_editor_sched_start_hour,
-                        run.run_time().match(/T(\d\d:\d\d)/)[1]
+                        run.run_time().match(/T(\d{2})/)[1] + ':00'
                     );
+
+                    DOM.oils_rpt_report_editor_run_now.checked = false;
+                    DOM.oils_rpt_report_editor_schedule.checked = true;
+                    DOM.oils_rpt_param_editor_sched_start_date.disabled = false;
+                    DOM.oils_rpt_param_editor_sched_start_hour.disabled = false;
                 }
-            } else {
-                DOM.oils_rpt_param_editor_sched_start_date.value = mkYearMonDay();
-            }
+            } 
         }
 	}
 
@@ -335,7 +364,6 @@ oilsRptReportEditor.prototype.save = function(options) {
 
 	var time;
 	if( DOM.oils_rpt_report_editor_run_now.checked ) {
-		DOM.oils_rpt_report_editor_run_now.checked = false;
 		time = 'now';
 
 	} else {
diff --git a/Open-ILS/web/reports/oils_rpt_widget.js b/Open-ILS/web/reports/oils_rpt_widget.js
index 2d617ef..2937e9e 100644
--- a/Open-ILS/web/reports/oils_rpt_widget.js
+++ b/Open-ILS/web/reports/oils_rpt_widget.js
@@ -36,7 +36,7 @@ oilsRptSetWidget.prototype.draw = function() {
             this_.addButton.onclick();
     }
 
-	this.inputWidget.draw(post_draw);
+	this.inputWidget.draw(null, post_draw);
 	this.node.appendChild(elem('br'))
 	this.node.appendChild(this.addButton);
 	this.node.appendChild(this.delButton);
@@ -589,7 +589,8 @@ function oilsRptRemoteWidget(args) {
     this.source.disabled = Boolean(args.readonly);
 }
 
-oilsRptRemoteWidget.prototype.draw = function(callback) {
+// selected is unused
+oilsRptRemoteWidget.prototype.draw = function(selected, callback) {
 	var orgcol;
 	iterate(oilsIDL[this.class].fields,
 		function(i) {

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/reports/oils_rpt_report_editor.js |   66 +++++++++++++++++-------
 Open-ILS/web/reports/oils_rpt_widget.js        |   27 ++++++++--
 2 files changed, 69 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list