Skip to content

Commit

Permalink
SSP-1604 - Filter both on program status and/or coach id...
Browse files Browse the repository at this point in the history
  • Loading branch information
scody committed Jul 7, 2015
1 parent 78e4109 commit bba6d64
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 45 deletions.
3 changes: 2 additions & 1 deletion src/main/webapp/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,8 @@ Ext.require([
'Ext.form.field.ComboBox',
'Ext.grid.column.Action',
'Ext.grid.feature.Grouping',
'Ext.layout.container.Column'
'Ext.layout.container.Column',
'Ext.util.Cookies'
]);

var apiUrls = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Ext.define('Ssp.controller.admin.caseload.CaseloadReassignmentSourceViewControll
},
'sourceCoachBox': {
change: 'onCoachChange'

},
'sourceProgramStatusBox': {
change: 'onProgramStatusChange'
Expand All @@ -67,23 +68,39 @@ Ext.define('Ssp.controller.admin.caseload.CaseloadReassignmentSourceViewControll
Ext.Msg.alert('SSP Error', 'There was an issue in loading assigned students for this coach.');
}
me.coachId = newValue;
me.caseloadService.getCaseloadById(me.coachId, me.programStatusId, me.store, {success: success, failure: failure, scope: me});

if (me.coachId == null && me.programStatusId == null){
Ext.Msg.alert('SSP Error', 'There was an issue in loading assigned students for this coach.');
me.getView().setLoading(false);
}
else {
me.caseloadService.getCaseloadById(me.coachId, me.programStatusId, me.store, {success: success, failure: failure, scope: me});
me.formUtils.reconfigureGridPanel( me.getView(), me.store);
},
}
},

onProgramStatusChange: function(combobox, newValue,oldValue,eOpts) {
var me=this;
me.programStatusId = newValue;
if (me.coachId!=null) {
me.getView().setLoading(true);
var success = function(){
me.getView().setLoading(false);
}
var failure = function(){
Ext.Msg.alert('SSP Error', 'There was an issue in loading assigned students for this coach.');
}

me.getView().setLoading(true);
var success = function(){
me.getView().setLoading(false);
}
var failure = function(){
Ext.Msg.alert('SSP Error', 'There was an issue in loading assigned students for this coach.');
}


if (me.coachId == null && me.programStatusId == null){
Ext.Msg.alert('SSP Error', 'There was an issue in loading assigned students for this coach.');
me.getView().setLoading(false);
}
else {
me.caseloadService.getCaseloadById(me.coachId, me.programStatusId, me.store, {success: success, failure: failure, scope: me});
me.formUtils.reconfigureGridPanel( me.getView(), me.store);
}

},
onAddAllButtonClick: function(button) {
var me=this;
Expand Down
18 changes: 13 additions & 5 deletions src/main/webapp/app/service/CaseloadService.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,26 @@ Ext.define('Ssp.service.CaseloadService', {
return this.callParent( arguments );
},



getBaseUrl: function(){
var me=this;
var baseUrl = me.apiProperties.createUrl( me.apiProperties.getItemUrl('personCaseload') );
return baseUrl;
},

getBaseUrlForIdCaseload: function(id, programStatusId){
getBaseUrlForIdCaseload: function(id, programStatusId){
var me=this;
var baseUrl = me.apiProperties.createUrl( me.apiProperties.getItemUrl('personCaseloadId') );
baseUrl = baseUrl.replace('{id}',id);
if (programStatusId!=null) {
baseUrl = baseUrl + "?programStatusId=" +programStatusId;
var baseUrl = me.apiProperties.createUrl( me.apiProperties.getItemUrl('directoryPersonSearch') );
//baseUrl = baseUrl.replace('{id}',id);
if (programStatusId!=null && id !=null) {
baseUrl = baseUrl + "?programStatus=" +programStatusId + "&coachId=" + id;
}
else if (programStatusId!=null) {
baseUrl = baseUrl + "?programStatus=" +programStatusId;
}
else if (id!=null) {
baseUrl = baseUrl + "?coachId=" + id;
}
return baseUrl;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,35 +76,38 @@ Ext.define('Ssp.view.admin.forms.caseload.CaseloadReassignmentSource', {
],

dockedItems: [
{
xtype: 'toolbar',
dock: 'top',
items: [{
xtype: 'combobox',
name: 'sourceCoachBox',
itemId: 'sourceCoachBox',
fieldLabel: 'Currently Assigned To',
emptyText: 'Select One',
store: me.allCoachesCurrentStore,
valueField: 'id',
displayField: 'fullName',
mode: 'local',
editable: false
},
{
xtype: 'combobox',
multiSelect: false,
fieldLabel: 'Program Status',
emptyText: 'Select Status',
store: me.programStatusesStore,
valueField: 'id',
displayField: 'name',
columnWidth: 0.5,
itemId: 'sourceProgramStatusBox',
name: 'sourceProgramStatusBox',
mode: 'local',
editable: false
}]
{
xtype: 'toolbar',
dock: 'top',
items: [{
xtype: 'combobox',
name: 'sourceCoachBox',
itemId: 'sourceCoachBox',
fieldLabel: 'Currently Assigned To',
emptyText: 'Select One',
store: me.allCoachesCurrentStore,
valueField: 'id',
displayField: 'fullName',
mode: 'local',
labelWidth: 120,
editable: false,
allowBlank: true
},'->',
{
xtype: 'combobox',
multiSelect: false,
fieldLabel: 'Program Status',
emptyText: 'Select Status',
store: me.programStatusesStore,
valueField: 'id',
displayField: 'name',
columnWidth: 0.5,
itemId: 'sourceProgramStatusBox',
name: 'sourceProgramStatusBox',
mode: 'local',
editable: false,
allowBlank: true
}]
},
{
xtype: 'toolbar',
Expand Down

0 comments on commit bba6d64

Please sign in to comment.