added relative tforms to tform set, some small tweaks, beginnings of potential altern...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 4 Oct 2006 22:39:45 +0000 (22:39 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 4 Oct 2006 22:39:45 +0000 (22:39 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6386 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/reports/oils_rpt.js
Open-ILS/web/reports/oils_rpt_filters.js
Open-ILS/web/reports/oils_rpt_param_editor.js
Open-ILS/web/reports/oils_rpt_param_editor.xhtml
Open-ILS/web/reports/oils_rpt_report_editor.js
Open-ILS/web/reports/oils_rpt_tforms.js
Open-ILS/web/reports/oils_rpt_widget.js

index 7c2096e..5728bcc 100644 (file)
@@ -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()));
index 3e2d187..0b211d2 100644 (file)
@@ -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() {
index db69c51..c09d3e5 100644 (file)
@@ -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});
                        }
index 45249a4..7b2ea6c 100644 (file)
                                <td name='transform'/>
                                <td name='action'/>
                                <td>
-                                       <div name='widget'/>
+                                       <div>
+                                               <span name='hint'/>
+                                               <span name='widget'/>
+                                       </div>
                                        <div name='reldate_div'  style='margin-top: 5px;' class='hide_me'>
                                                <div><b> - OR - </b></div>
                                                <input type='checkbox' name='choose_rel'/> Use a relative date instead.
index c18e8e3..d0edbe9 100644 (file)
@@ -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();
index 7f0c550..930192c 100644 (file)
@@ -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 : {
index 70a7a63..f56955e 100644 (file)
@@ -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);
+}
+
+
+
+