From ee4a6be6dbc22b6748d7302081f997ab1385b2c5 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 4 Oct 2006 22:39:45 +0000 Subject: [PATCH] added relative tforms to tform set, some small tweaks, beginnings of potential alternat widget handling git-svn-id: svn://svn.open-ils.org/ILS/trunk@6386 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/reports/oils_rpt.js | 2 + Open-ILS/web/reports/oils_rpt_filters.js | 5 +-- Open-ILS/web/reports/oils_rpt_param_editor.js | 9 ++-- Open-ILS/web/reports/oils_rpt_param_editor.xhtml | 5 ++- Open-ILS/web/reports/oils_rpt_report_editor.js | 3 ++ Open-ILS/web/reports/oils_rpt_tforms.js | 19 ++++++++ Open-ILS/web/reports/oils_rpt_widget.js | 57 ++++++++++++++++++++++++ 7 files changed, 93 insertions(+), 7 deletions(-) diff --git a/Open-ILS/web/reports/oils_rpt.js b/Open-ILS/web/reports/oils_rpt.js index 7c2096ee56..5728bcc9e8 100644 --- a/Open-ILS/web/reports/oils_rpt.js +++ b/Open-ILS/web/reports/oils_rpt.js @@ -5,6 +5,8 @@ function oilsInitReports() { document.captureEvents(Event.MOUSEMOVE); document.onmousemove = setMousePos; + DEBUGSLIM = true; + var cgi = new CGI(); fetchUser(cgi.param('ses')); DOM.oils_rpt_user.appendChild(text(USER.usrname())); diff --git a/Open-ILS/web/reports/oils_rpt_filters.js b/Open-ILS/web/reports/oils_rpt_filters.js index 3e2d1876cf..0b211d27b6 100644 --- a/Open-ILS/web/reports/oils_rpt_filters.js +++ b/Open-ILS/web/reports/oils_rpt_filters.js @@ -71,10 +71,9 @@ function oilsRptFilterPicker(args) { oilsRptFilterPicker.prototype.addOpt = function(key) { var filter = OILS_RPT_FILTERS[key]; var label = filter.label; - if( filter.labels && filter.labels[this.dtype] ) - label = filter.labels[this.dtype]; - var obj = this; insertSelectorVal( this.selector, -1, label, key); + if( filter.labels && filter.labels[this.dtype] ) + insertSelectorVal( this.selector, -1, filter.labels[this.dtype], key); } oilsRptFilterPicker.prototype.getSelected = function() { diff --git a/Open-ILS/web/reports/oils_rpt_param_editor.js b/Open-ILS/web/reports/oils_rpt_param_editor.js index db69c51333..c09d3e5713 100644 --- a/Open-ILS/web/reports/oils_rpt_param_editor.js +++ b/Open-ILS/web/reports/oils_rpt_param_editor.js @@ -45,10 +45,14 @@ oilsRptParamEditor.prototype.draw = function() { /* display the time-relative options if necessary */ oilsRptParamEditor.prototype.buildRelWidget = function(par, row) { + var field = oilsRptFindField( oilsIDL[oilsRptPathClass(par.path)], oilsRptPathCol(par.path)); + _debug('checking rel widget for datatype '+field.datatype); - if( field.datatype != 'timestamp' ) return; + + if(field.datatype != 'timestamp') return; + if(par.op != '=') return; var dom = $n(row,'reldate_div'); unHideMe(dom); @@ -78,7 +82,6 @@ oilsRptParamEditor.prototype.buildWidget = function(param, node) { } - switch(param.op) { case 'in': case 'not in': @@ -94,7 +97,7 @@ oilsRptParamEditor.prototype.buildWidget = function(param, node) { default: switch(dtype) { case 'timestamp': - return new oilsRptRelDatePicker({node:node}); + return new oilsRptWidget({node:node}); default: return new oilsRptWidget({node:node}); } diff --git a/Open-ILS/web/reports/oils_rpt_param_editor.xhtml b/Open-ILS/web/reports/oils_rpt_param_editor.xhtml index 45249a47e4..7b2ea6c778 100644 --- a/Open-ILS/web/reports/oils_rpt_param_editor.xhtml +++ b/Open-ILS/web/reports/oils_rpt_param_editor.xhtml @@ -68,7 +68,10 @@ -
+
+ + +
- OR -
Use a relative date instead. diff --git a/Open-ILS/web/reports/oils_rpt_report_editor.js b/Open-ILS/web/reports/oils_rpt_report_editor.js index c18e8e3928..d0edbe9d12 100644 --- a/Open-ILS/web/reports/oils_rpt_report_editor.js +++ b/Open-ILS/web/reports/oils_rpt_report_editor.js @@ -1,5 +1,6 @@ oilsRptSetSubClass('oilsRptReportEditor', 'oilsRptObject'); var oilsRptReportEditorFolderTree; + function oilsRptReportEditor(rptObject, folderWindow) { var tmpl = rptObject.templateObject; var rpt = rptObject.reportObject; @@ -121,12 +122,14 @@ oilsRptReportEditor.prototype.save = function() { //return; + var obj = this; var req = new Request(OILS_RPT_CREATE_REPORT, SESSION, report, schedule ); req.callback( function(r) { var res = r.getResultObject(); oilsRptAlertSuccess(); oilsRptCurrentFolderManager.draw(); + obj.folderWindow.draw(); } ); req.send(); diff --git a/Open-ILS/web/reports/oils_rpt_tforms.js b/Open-ILS/web/reports/oils_rpt_tforms.js index 7f0c5506e6..930192caff 100644 --- a/Open-ILS/web/reports/oils_rpt_tforms.js +++ b/Open-ILS/web/reports/oils_rpt_tforms.js @@ -123,6 +123,25 @@ var OILS_RPT_TRANSFORMS = { label : 'Age' }, + relative_year : { + datatype : OILS_RPT_DTYPE_TIMESTAMP, + label : 'Relative year' + }, + + relative_month : { + datatype : OILS_RPT_DTYPE_TIMESTAMP, + label : 'Relative month' + }, + + relative_week : { + datatype : OILS_RPT_DTYPE_TIMESTAMP, + label : 'Relative week' + }, + + relative_date : { + datatype : OILS_RPT_DTYPE_TIMESTAMP, + label : 'Relative date' + }, /* int / float transforms ----------------------------------- */ sum : { diff --git a/Open-ILS/web/reports/oils_rpt_widget.js b/Open-ILS/web/reports/oils_rpt_widget.js index 70a7a63b4e..f56955ec7a 100644 --- a/Open-ILS/web/reports/oils_rpt_widget.js +++ b/Open-ILS/web/reports/oils_rpt_widget.js @@ -269,3 +269,60 @@ oilsRptRelDatePicker.prototype.getValue = function() { + + + + + + + +/* --------------------------------------------------------------------- */ +/* --------------------------------------------------------------------- */ + +function oilsRptAtomicWidget(args) { + this.node = args.node; + this.source = args.source; + this.dest = elem('input',{type:'text',size:12}); +} +oilsRptAtomicWidget.prototype.draw = function() { + if( this.source ) + appendClear(this.node, this.source); + appendClear(this.node, this.dest); +} +oilsRptAtomicWidget.prototype.getValue = function() { + return this.dest.value; +} +/* --------------------------------------------------------------------- */ +function oilsRptListWidget(args) { + this.node = args.node; + this.source = args.source; + this.dest = elem('select', + {multiple:'multiple','class':'oils_rpt_small_info_selector'}); +} +oilsRptListWidget.prototype.draw = function() { + appendClear(this.source); + appendClear(this.dest); +} +oilsRptListWidget.prototype.getValue = function() { + return getSelectedList(this.dest); +} +/* --------------------------------------------------------------------- */ +function oilsRptBetweenWidget(args) { + this.node = args.node; + this.startSource = args.startSource; + this.endSource = args.endSource; + this.dest = elem('select', + {multiple:'multiple','class':'oils_rpt_small_info_selector'}); +} +oilsRptBetweenWidget.prototype.draw = function() { + appendClear(this.startSource); + appendClear(this.endSource); + appendClear(this.dest); +} +oilsRptBetweenWidget.prototype.getValue = function() { + return getSelectedList(this.dest); +} + + + + -- 2.11.0