This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit e91b089acc6384ab7c8797abe7ed3bdfcccb2ab0 Author: Yannick Martel <martel@©odelutin.com> Date: Wed Dec 23 14:07:31 2015 +0100 fixes #7853 add users searched export on ui --- coselmar-ui/src/main/webapp/js/coselmar-controllers.js | 12 +++++++++--- coselmar-ui/src/main/webapp/js/coselmar-user-services.js | 5 +++++ coselmar-ui/src/main/webapp/views/users/searchPart.html | 2 +- coselmar-ui/src/main/webapp/views/users/users.html | 8 ++++++++ 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index d432d51..e1afab7 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -548,7 +548,7 @@ coselmarControllers.controller("UsersCtrl", ['$scope', '$route', '$routeParams', //manage keywords if given $scope.search = { searchKeywords : []}; - $scope.example = { active : "true", role : 'ALL'}; + $scope.example = { active : "true", role : ''}; var keywords = $routeParams.keywords; if (Array.isArray(keywords)) { @@ -637,8 +637,6 @@ coselmarControllers.controller("UsersCtrl", ['$scope', '$route', '$routeParams', }; $scope.searchMode = function(type) { - console.log("pouet"); - console.log(type); if (type == 'advanced') { $location.search('advancedSearch'); $scope.advanced = true; @@ -647,6 +645,14 @@ coselmarControllers.controller("UsersCtrl", ['$scope', '$route', '$routeParams', $scope.advanced = false; } }; + + $scope.getExportUsersUrl = function() { + return userService.getExportUsersUrl(); + }; + + $scope.getToken = function() { + return localStorage.getItem('coselmar-jwt'); + } }]); // Controller for new user View diff --git a/coselmar-ui/src/main/webapp/js/coselmar-user-services.js b/coselmar-ui/src/main/webapp/js/coselmar-user-services.js index 81415fb..3f1e1d9 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-user-services.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-user-services.js @@ -31,6 +31,7 @@ function User(resource, config){ this.resource = resource; var baseURL = config.BASE_URL + "/users"; + var exportURL = config.BASE_URL + "/export/users"; this.saveUser = function(user, successFunction, failFunction){ @@ -106,4 +107,8 @@ function User(resource, config){ userResource.post(params, successFunction, failFunction); }; + this.getExportUsersUrl = function() { + return exportURL; + }; + }; \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/views/users/searchPart.html b/coselmar-ui/src/main/webapp/views/users/searchPart.html index 7ab1c84..16d7afd 100644 --- a/coselmar-ui/src/main/webapp/views/users/searchPart.html +++ b/coselmar-ui/src/main/webapp/views/users/searchPart.html @@ -82,7 +82,7 @@ <label class="col-md-1 control-label">{{ 'user.metadata.role' | translate }}</label> <div class="col-md-2"> <select class="form-control" name="role" ng-model="example.role" title="role" > - <option value="ALL">{{ 'user.metadata.role.all' | translate }}</option> + <option value="">{{ 'user.metadata.role.all' | translate }}</option> <option value="ADMIN">{{ 'user.metadata.role.admin' | translate }}</option> <option value="SUPERVISOR">{{ 'user.metadata.role.supervisor' | translate }}</option> <option value="EXPERT">{{ 'user.metadata.role.expert' | translate }}</option> diff --git a/coselmar-ui/src/main/webapp/views/users/users.html b/coselmar-ui/src/main/webapp/views/users/users.html index 5364160..2642793 100644 --- a/coselmar-ui/src/main/webapp/views/users/users.html +++ b/coselmar-ui/src/main/webapp/views/users/users.html @@ -32,5 +32,13 @@ <div ng-include="src='views/users/adminUsers.html'" ng-if="context.currentUser.role == 'ADMIN'"></div> <div ng-include="src='views/users/supervisorUsers.html'" ng-if="context.currentUser.role == 'SUPERVISOR'"></div> <p ng-if="users && users.length == 0" translate="common.search.noResult" class="info"/> + <div ng-if="users && users.length > 0" > + <form action="{{getExportUsersUrl()}}" method="post" target="_blank"> + <input type="hidden" name="searchOption" value="{{example}}" /> + <input type="hidden" name="token" value="{{getToken()}}" /> + <button type="submit" class="btn btn-primary"> + <span class="fa fa-download" aria-hidden="true"></span>{{ 'common.button.csvExport' | translate }}</button> + </form> + </div> </div> \ No newline at end of file -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.