Skip to content
This repository has been archived by the owner on Aug 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #159 from SlateFoundation/develop
Browse files Browse the repository at this point in the history
Release: slate-admin v2.3.3
  • Loading branch information
themightychris authored Dec 7, 2017
2 parents fb5b7cb + 58b7589 commit fb3eb41
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
22 changes: 18 additions & 4 deletions sencha-workspace/SlateAdmin/app/controller/progress/terms/Print.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand All @@ -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
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand All @@ -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
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion sencha-workspace/packages/jarvus-lazydata

0 comments on commit fb3eb41

Please sign in to comment.