diff --git a/sencha-workspace/SlateAdmin/app/controller/progress/interims/Print.js b/sencha-workspace/SlateAdmin/app/controller/progress/interims/Print.js index 5110ebd..b635c5d 100644 --- a/sencha-workspace/SlateAdmin/app/controller/progress/interims/Print.js +++ b/sencha-workspace/SlateAdmin/app/controller/progress/interims/Print.js @@ -182,16 +182,30 @@ Ext.define('SlateAdmin.controller.progress.interims.Print', { // controller methods - buildFilters: function() { - var filters = this.getOptionsForm().getValues(); - - filters.status = 'published'; + buildReportParams: function() { + var formValues = this.getOptionsForm().getValues(), + params = {}, + paramKey, paramValue; + + for (paramKey in formValues) { + if ( + formValues.hasOwnProperty(paramKey) + && (paramValue = formValues[paramKey]) + && (paramKey != 'status' || paramValue != 'any') + ) { + if (paramKey == 'group') { + paramKey = 'students'; + paramValue = 'group>'+paramValue; + } + params[paramKey] = paramValue; + } + } - return filters; + return params; }, buildHtmlUrl: function() { - return Slate.API.buildUrl('/progress/section-interim-reports?'+Ext.Object.toQueryString(this.buildFilters())); + return Slate.API.buildUrl('/progress/section-interim-reports?'+Ext.Object.toQueryString(this.buildReportParams())); }, loadPrintout: function(callback) { diff --git a/sencha-workspace/SlateAdmin/app/controller/progress/terms/Print.js b/sencha-workspace/SlateAdmin/app/controller/progress/terms/Print.js index 6e62846..c1cf5d1 100644 --- a/sencha-workspace/SlateAdmin/app/controller/progress/terms/Print.js +++ b/sencha-workspace/SlateAdmin/app/controller/progress/terms/Print.js @@ -183,11 +183,25 @@ Ext.define('SlateAdmin.controller.progress.terms.Print', { // controller methods buildReportParams: function() { - var filters = this.getOptionsForm().getValues(); - - filters.status = 'published'; + var formValues = this.getOptionsForm().getValues(), + params = {}, + paramKey, paramValue; + + for (paramKey in formValues) { + if ( + formValues.hasOwnProperty(paramKey) + && (paramValue = formValues[paramKey]) + && (paramKey != 'status' || paramValue != 'any') + ) { + if (paramKey == 'group') { + paramKey = 'students'; + paramValue = 'group>'+paramValue; + } + params[paramKey] = paramValue; + } + } - return filters; + return params; }, buildHtmlUrl: function() { diff --git a/sencha-workspace/SlateAdmin/app/view/progress/interims/print/Container.js b/sencha-workspace/SlateAdmin/app/view/progress/interims/print/Container.js index 822bc78..e3dfadb 100644 --- a/sencha-workspace/SlateAdmin/app/view/progress/interims/print/Container.js +++ b/sencha-workspace/SlateAdmin/app/view/progress/interims/print/Container.js @@ -36,7 +36,11 @@ Ext.define('SlateAdmin.view.progress.interims.print.Container', { labelWidth: 60, forceSelection: true, allowBlank: true, - valueField: 'ID' + typeAhead: false, + queryMode: 'local', + emptyText: 'Any', + matchFieldWidth: false, + anyMatch: true }, items: [ { @@ -46,43 +50,47 @@ Ext.define('SlateAdmin.view.progress.interims.print.Container', { store: 'Terms', displayField: 'Title', - valueField: 'Handle', - - queryMode: 'local', - forceSelection: false + valueField: 'Handle' }, { name: 'advisor', fieldLabel: 'Advisor', - emptyText: 'Any', store: 'Advisors', displayField: 'SortName', - valueField: 'Username', - - queryMode: 'local', - typeAhead: true, - forceSelection: false + valueField: 'Username' }, { name: 'author', fieldLabel: 'Author', - emptyText: 'Any', store: 'progress.interims.Authors', displayField: 'SortName', - valueField: 'Username', - - queryMode: 'local', - typeAhead: true, - forceSelection: false + valueField: 'Username' }, { xtype: 'slate-personfield', name: 'student', fieldLabel: 'Student', - emptyText: 'All', - appendQuery: 'class:student' + appendQuery: 'class:student', + queryMode: 'remote' + }, + { + name: 'group', + fieldLabel: 'Group', + + store: 'people.Groups', + displayField: 'namesPath', + valueField: 'Handle' + }, + { + name: 'status', + fieldLabel: 'Status', + + store: ['published', 'draft', 'any'], + value: 'published', + + editable: false } ] } diff --git a/sencha-workspace/SlateAdmin/app/view/progress/terms/print/Container.js b/sencha-workspace/SlateAdmin/app/view/progress/terms/print/Container.js index a40d91f..d10ab74 100644 --- a/sencha-workspace/SlateAdmin/app/view/progress/terms/print/Container.js +++ b/sencha-workspace/SlateAdmin/app/view/progress/terms/print/Container.js @@ -39,7 +39,11 @@ Ext.define('SlateAdmin.view.progress.terms.print.Container', { labelWidth: 60, forceSelection: true, allowBlank: true, - valueField: 'ID' + typeAhead: false, + queryMode: 'local', + emptyText: 'Any', + matchFieldWidth: false, + anyMatch: true }, items: [ { @@ -49,43 +53,47 @@ Ext.define('SlateAdmin.view.progress.terms.print.Container', { store: 'Terms', displayField: 'Title', - valueField: 'Handle', - - queryMode: 'local', - forceSelection: false + valueField: 'Handle' }, { name: 'advisor', fieldLabel: 'Advisor', - emptyText: 'Any', store: 'Advisors', displayField: 'SortName', - valueField: 'Username', - - queryMode: 'local', - typeAhead: true, - forceSelection: false + valueField: 'Username' }, { name: 'author', fieldLabel: 'Author', - emptyText: 'Any', store: 'progress.terms.Authors', displayField: 'SortName', - valueField: 'Username', - - queryMode: 'local', - typeAhead: true, - forceSelection: false + valueField: 'Username' }, { xtype: 'slate-personfield', name: 'student', fieldLabel: 'Student', - emptyText: 'All', - appendQuery: 'class:student' + appendQuery: 'class:student', + queryMode: 'remote' + }, + { + name: 'group', + fieldLabel: 'Group', + + store: 'people.Groups', + displayField: 'namesPath', + valueField: 'Handle' + }, + { + name: 'status', + fieldLabel: 'Status', + + store: ['published', 'draft', 'any'], + value: 'published', + + editable: false } ] }, diff --git a/sencha-workspace/packages/jarvus-lazydata b/sencha-workspace/packages/jarvus-lazydata index a473245..c8b1b31 160000 --- a/sencha-workspace/packages/jarvus-lazydata +++ b/sencha-workspace/packages/jarvus-lazydata @@ -1 +1 @@ -Subproject commit a4732456d35bc9468370118f4053e44ffd4b5886 +Subproject commit c8b1b31286cbde7c63ce81798f16d10ca61ff6e8