forked from FITER1/community-app-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* FBR-75 Refactor the creation of a center and added the ability to edit an existing center (#9) Co-authored-by: Leonardo Hildt <[email protected]> * FBR-102 Como líder de Agencia, quiero crear uno o mas grupos (#10) Co-authored-by: Leonardo Hildt <[email protected]> * FBR-102 - Fix edition of Portfolio (#11) Co-authored-by: Leonardo Hildt <[email protected]> * FBR-101 - Necesito trasladar grupos a otro centro (#12) Co-authored-by: Leonardo Hildt <[email protected]> * FBR-101 Fix parameter validation (#13) Co-authored-by: Leonardo Hildt <[email protected]> * FBR-151 Feedback Sprint 4 (#15) Co-authored-by: Leonardo Hildt <[email protected]> * FBR-137 Como gerente quiero mover una agencia a otra región (#16) Co-authored-by: Leonardo Hildt <[email protected]> * FBR-108 Planificación para facilitadores (#17) Co-authored-by: Leonardo Hildt <[email protected]> * FBR-142 Asignación de responsables por estructura Fiter (#18) Co-authored-by: Leonardo Hildt <[email protected]> * Mostrar usuario responsable (facilitador) en gestión de cartera (#19) Co-authored-by: Leonardo Hildt <[email protected]> * Fix for FBR-175 - Error when editing a portfolio (#20) Co-authored-by: Leonardo Hildt <[email protected]> --------- Co-authored-by: Leonardo Hildt <[email protected]>
- Loading branch information
1 parent
e929e39
commit c00fcbf
Showing
16 changed files
with
404 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
app/scripts/controllers/organization/PortfoliosPlanningController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
(function (module) { | ||
mifosX.controllers = _.extend(module, { | ||
PortfoliosPlanningController: function (scope, resourceFactory, location) { | ||
|
||
scope.routeTo = function (id) { | ||
location.path('/viewportfolioplanning/' + id); | ||
}; | ||
|
||
scope.deepCopy = function (obj) { | ||
if (Object.prototype.toString.call(obj) === '[object Array]') { | ||
var out = [], i = 0, len = obj.length; | ||
for (; i < len; i++) { | ||
out[i] = arguments.callee(obj[i]); | ||
} | ||
return out; | ||
} | ||
if (typeof obj === 'object') { | ||
var out = {}, i; | ||
for (i in obj) { | ||
out[i] = arguments.callee(obj[i]); | ||
} | ||
return out; | ||
} | ||
return obj; | ||
} | ||
|
||
scope.PortfoliosPerPage =15; | ||
resourceFactory.portfolioResource.getAllPortfoliosForCurrentUser(function (data) { | ||
scope.portfolios = scope.deepCopy(data); | ||
|
||
function sortByParentId(a, b) { | ||
return a.parentId - b.parentId; | ||
} | ||
|
||
data.sort(sortByParentId); | ||
|
||
}); | ||
} | ||
}); | ||
mifosX.ng.application.controller('PortfoliosPlanningController', ['$scope', 'ResourceFactory', '$location', mifosX.controllers.PortfoliosPlanningController]).run(function ($log) { | ||
$log.info("PortfoliosPlanningController initialized"); | ||
}); | ||
}(mifosX.controllers || {})); |
65 changes: 65 additions & 0 deletions
65
app/scripts/controllers/organization/TransferAgencyController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
(function (module) { | ||
mifosX.controllers = _.extend(module, { | ||
TransferAgencyController: function (scope, resourceFactory, route, location, routeParams, $uibModal, dateFilter) { | ||
scope.regionsAvailability = []; | ||
scope.agencyData = {}; | ||
scope.tf = "HH:mm"; | ||
let agencyId = routeParams.id; | ||
let currentParentId = 0; | ||
|
||
resourceFactory.agencyResource.get({agencyId: routeParams.id}, function (data) { | ||
scope.agency = data; | ||
if(data.parentId) { | ||
currentParentId = data.parentId; | ||
} | ||
|
||
let requestParams = {orderBy: 'description', sortOrder: 'ASC'}; | ||
resourceFactory.officeChildrenByUserResource.get(requestParams, function (data) { | ||
// list of offices related to regions available to transfer the agency | ||
for (var i = 0; i < data.length; i++) { | ||
let id = data[i].id; | ||
let name = data[i].name; | ||
if (currentParentId != id) { | ||
scope.regionsAvailability.push({parentId: id, parentName: name}) | ||
} | ||
} | ||
}); | ||
}); | ||
|
||
scope.transferAgency = function (parentId) { | ||
scope.agencyData.newRegionId = parentId; | ||
|
||
$uibModal.open({ | ||
templateUrl: 'transferAgency.html', | ||
controller: TransferAgency | ||
}); | ||
} | ||
|
||
var TransferAgency = function ($scope, $uibModalInstance) { | ||
$scope.transfer = function () { | ||
|
||
resourceFactory.transferAgencyResource.transfer({'agencyId':agencyId}, scope.agencyData, function (data) { | ||
$uibModalInstance.close('transfer'); | ||
location.path('/agencies/'); | ||
}); | ||
}; | ||
$scope.cancel = function () { | ||
$uibModalInstance.dismiss('cancel'); | ||
}; | ||
}; | ||
|
||
scope.submit = function () { | ||
this.formData.locale = scope.optlang.code; | ||
this.formData.dateFormat = scope.df; | ||
this.formData.newPortfolioCenterId = scope.newPortfolioCenterId; | ||
|
||
resourceFactory.transferCenterGroupResource.transfer({'portfolioCenterId':portfolioCenterId, 'centerGroupId': centerGroupId}, this.formData, function (data) { | ||
location.path('/viewcentergroups/' + portfolioId + "/" + portfolioCenterId); | ||
}); | ||
}; | ||
} | ||
}); | ||
mifosX.ng.application.controller('TransferAgencyController', ['$scope', 'ResourceFactory', '$route', '$location', '$routeParams', '$uibModal', 'dateFilter', mifosX.controllers.TransferAgencyController]).run(function ($log) { | ||
$log.info("TransferAgencyController initialized"); | ||
}); | ||
}(mifosX.controllers || {})); |
29 changes: 29 additions & 0 deletions
29
app/scripts/controllers/organization/ViewPortfolioPlanningController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(function (module) { | ||
mifosX.controllers = _.extend(module, { | ||
ViewPortfolioPlanningController: function (scope, routeParams, route, location, resourceFactory) { | ||
scope.centers=[]; | ||
|
||
resourceFactory.portfolioPlanningResource.get({portfolioId: routeParams.id}, function (data) { | ||
scope.portfolio = data; | ||
|
||
// centers associated with this portfolio | ||
if (data.detailedPlanningData) { | ||
scope.detailedPlanningData = data.detailedPlanningData; | ||
scope.convertTimeArrayToObject('meetingStartTime'); | ||
scope.convertTimeArrayToObject('meetingEndTime'); | ||
} | ||
}); | ||
|
||
scope.convertTimeArrayToObject = function(timeFieldName){ | ||
var date = new Date(); | ||
for(var i in scope.detailedPlanningData){ | ||
scope.detailedPlanningData[i][timeFieldName] = new Date(date.getFullYear(), date.getMonth(), date.getDay(), scope.detailedPlanningData[i][timeFieldName][0], scope.detailedPlanningData[i][timeFieldName][1], 0); | ||
} | ||
}; | ||
} | ||
|
||
}); | ||
mifosX.ng.application.controller('ViewPortfolioPlanningController', ['$scope', '$routeParams', '$route', '$location', 'ResourceFactory', mifosX.controllers.ViewPortfolioPlanningController]).run(function ($log) { | ||
$log.info("ViewPortfolioPlanningController initialized"); | ||
}); | ||
}(mifosX.controllers || {})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.