Commit 90ebd4f9 authored by Anthony Geourjon's avatar Anthony Geourjon
Browse files

Merge branch 'EDCAMPUS-14-listing-user' into 'master'

minor adjustments on code and correction of runCommand in university.factory...

See merge request !8
parents 6611c042 b8aef4cc
......@@ -36,7 +36,7 @@
<div style="margin-top: -10px">
<user user="user" size="75" label="true" label-position="'bottom'"></user>
</div>
</div>
</section>
</div>
</div>
</div>
......@@ -50,7 +50,6 @@
<div>
<h3 class="name">{{_formatUser(adminUsersCtrl.currentMember).shortName}}</h3>
<p>{{adminUsersCtrl.currentMember.email}}</p>
</div>
<p style="min-height: 20px">
......@@ -59,64 +58,61 @@
<div class="clearfix">
<button class="regular pull-right" ng-click="adminUsersCtrl.closeDetailsMembers();">{{::_labels.closeBtn}}</button>
<button class="regular pull-right" ng-click="_userClick(adminUsersCtrl.currentMember)">{{::_labels.contactUsr}}</button>
</div>
</section>
</div>
</div>
</div>
<div id="newStudentModal" class="chatPopupManager hide" >
<div class="dialog" style='width: 400px;height:190px; min-height:auto;'>
<a ng-click='adminUsersCtrl.closeModalNewStudent();' title="Close" class="close"><i class="fa fa-times" aria-hidden="true"></i></a>
<h4>{{::_labels.newStudentTitle}}</h4>
<input class="name form-control" type="text" placeholder="{{::_labels.emailStudent}}" ng-model="adminUsersCtrl.inputEmail" ng-change='adminUsersCtrl.onMailChange(adminUsersCtrl.inputEmail)' list="mailList">
<datalist id='mailList'><option ng-repeat='option in adminUsersCtrl.usersList'>{{option.email}}</option></datalist>
<input class="name form-control" type="text" placeholder="{{::_labels.firstNameStudent}}" ng-model="adminUsersCtrl.inputFirstName">
<input class="name form-control" type="text" placeholder="{{::_labels.lastNameStudent}}" ng-model="adminUsersCtrl.inputLastName">
<div class='separator'></div>
<button class="pull-right" type="submit" ng-click="adminUsersCtrl.newStudent(adminUsersCtrl.inputEmail,adminUsersCtrl.inputFirstName,adminUsersCtrl.inputLastName)">{{::_labels.confirmNewStudent}}</button>
<div class="dialog" style='width: 400px;height:190px; min-height:auto;'>
<a ng-click='adminUsersCtrl.closeModalNewStudent();' title="Close" class="close"><i class="fa fa-times" aria-hidden="true"></i></a>
<h4>{{::_labels.newStudentTitle}}</h4>
<input class="name form-control" type="text" placeholder="{{::_labels.emailStudent}}" ng-model="adminUsersCtrl.inputEmail" ng-change='adminUsersCtrl.onMailChange(adminUsersCtrl.inputEmail)' list="mailList">
<datalist id='mailList'><option ng-repeat='option in adminUsersCtrl.usersList'>{{option.email}}</option></datalist>
<input class="name form-control" type="text" placeholder="{{::_labels.firstNameStudent}}" ng-model="adminUsersCtrl.inputFirstName">
<input class="name form-control" type="text" placeholder="{{::_labels.lastNameStudent}}" ng-model="adminUsersCtrl.inputLastName">
<div class='separator'></div>
<button class="pull-right" type="submit" ng-click="adminUsersCtrl.newStudent(adminUsersCtrl.inputEmail,adminUsersCtrl.inputFirstName,adminUsersCtrl.inputLastName)">{{::_labels.confirmNewStudent}}</button>
</div>
</div>
<div id="newManagerModal" class="chatPopupManager hide" >
<div class="dialog" style='width: 400px;height:220px; min-height:auto;'>
<a ng-click='adminUsersCtrl.closeModalNewManager();' title="Close" class="close"><i class="fa fa-times" aria-hidden="true"></i></a>
<h4>{{::_labels.newManagerTitle}}</h4>
<div class="dialog" style='width: 400px;height:220px; min-height:auto;'>
<a ng-click='adminUsersCtrl.closeModalNewManager();' title="Close" class="close"><i class="fa fa-times" aria-hidden="true"></i></a>
<h4>{{::_labels.newManagerTitle}}</h4>
<input class="name form-control" type="text" placeholder="{{::_labels.emailManager}}" ng-model="adminUsersCtrl.inputEmail" ng-change='adminUsersCtrl.onMailChange(adminUsersCtrl.inputEmail)'list="mailList2">
<datalist id='mailList2'><option ng-repeat='option in adminUsersCtrl.usersList'>{{option.email}}</option></datalist>
<input class="name form-control" type="text" placeholder="{{::_labels.firstNameManager}}" ng-model="adminUsersCtrl.inputFirstName">
<input class="name form-control" type="text" placeholder="{{::_labels.lastNameManager}}" ng-model="adminUsersCtrl.inputLastName">
<input class="name form-control" type="text" placeholder="{{::_labels.positionManager}}" ng-model="adminUsersCtrl.inputPosition">
<div class='separator'></div>
<button class="pull-right" type="submit" ng-click="adminUsersCtrl.newManager(adminUsersCtrl.inputEmail,adminUsersCtrl.inputFirstName,adminUsersCtrl.inputLastName,adminUsersCtrl.inputPosition)">{{::_labels.confirmNewStudent}}</button>
<input class="name form-control" type="text" placeholder="{{::_labels.positionManager}}" ng-model="adminUsersCtrl.inputPosition">
<div class='separator'></div>
<button class="pull-right" type="submit" ng-click="adminUsersCtrl.newManager(adminUsersCtrl.inputEmail,adminUsersCtrl.inputFirstName,adminUsersCtrl.inputLastName,adminUsersCtrl.inputPosition)">{{::_labels.confirmNewStudent}}</button>
</div>
</div>
<div id="newAdminModal" class="chatPopupManager hide" >
<div class="dialog" style='width: 400px;height:190px; min-height:auto;'>
<a ng-click='adminUsersCtrl.closeModalNewAdmin();' title="Close" class="close"><i class="fa fa-times" aria-hidden="true"></i></a>
<h4>{{::_labels.newCampusAdminTitle}}</h4>
<input class="name form-control" type="text" placeholder="{{::_labels.emailStudent}}" ng-model="adminUsersCtrl.inputEmail" ng-change='adminUsersCtrl.onMailChange(adminUsersCtrl.inputEmail)' list="mailList3">
<datalist id='mailList3'><option ng-repeat='option in adminUsersCtrl.usersList'>{{option.email}}</option></datalist>
<input class="name form-control" type="text" placeholder="{{::_labels.firstNameStudent}}" ng-model="adminUsersCtrl.inputFirstName">
<input class="name form-control" type="text" placeholder="{{::_labels.lastNameStudent}}" ng-model="adminUsersCtrl.inputLastName">
<div class='separator'></div>
<button class="pull-right" type="submit" ng-click="adminUsersCtrl.newAdmin(adminUsersCtrl.inputEmail,adminUsersCtrl.inputFirstName,adminUsersCtrl.inputLastName)">{{::_labels.confirmNewStudent}}</button>
<div class="dialog" style='width: 400px;height:190px; min-height:auto;'>
<a ng-click='adminUsersCtrl.closeModalNewAdmin();' title="Close" class="close"><i class="fa fa-times" aria-hidden="true"></i></a>
<h4>{{::_labels.newCampusAdminTitle}}</h4>
<input class="name form-control" type="text" placeholder="{{::_labels.emailStudent}}" ng-model="adminUsersCtrl.inputEmail" ng-change='adminUsersCtrl.onMailChange(adminUsersCtrl.inputEmail)' list="mailList3">
<datalist id='mailList3'><option ng-repeat='option in adminUsersCtrl.usersList'>{{option.email}}</option></datalist>
<input class="name form-control" type="text" placeholder="{{::_labels.firstNameStudent}}" ng-model="adminUsersCtrl.inputFirstName">
<input class="name form-control" type="text" placeholder="{{::_labels.lastNameStudent}}" ng-model="adminUsersCtrl.inputLastName">
<div class='separator'></div>
<button class="pull-right" type="submit" ng-click="adminUsersCtrl.newAdmin(adminUsersCtrl.inputEmail,adminUsersCtrl.inputFirstName,adminUsersCtrl.inputLastName)">{{::_labels.confirmNewStudent}}</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -3,7 +3,7 @@
/* Controllers */
root.controller('AdminUsersCtrl' ,['$scope','$http', '$stateParams','$universityFactory', '$userFactory',function($scope,$http,$stateParams, $universityFactory,$userFactory) {
var adminUsersCtrl=this;
adminUsersCtrl.listAlumni=[];
......@@ -11,7 +11,7 @@ root.controller('AdminUsersCtrl' ,['$scope','$http', '$stateParams','$university
adminUsersCtrl.usersList = [];
adminUsersCtrl.listTutors = [];
adminUsersCtrl.listAdmins = [];
adminUsersCtrl.currentScreen="admin";
adminUsersCtrl.currentScreen="";
adminUsersCtrl.currentMember =null
adminUsersCtrl.currentMemberType=='actual'
......@@ -23,7 +23,6 @@ root.controller('AdminUsersCtrl' ,['$scope','$http', '$stateParams','$university
case "tutors": return adminUsersCtrl.listTutors; break;
case "alumni": return adminUsersCtrl.listAlumni; break;
default: return adminUsersCtrl.listAdmins.concat(adminUsersCtrl.listTutors.concat(adminUsersCtrl.listStudents.concat(adminUsersCtrl.listAlumni)));
}
}
......@@ -51,24 +50,23 @@ root.controller('AdminUsersCtrl' ,['$scope','$http', '$stateParams','$university
};
adminUsersCtrl.getUnivs = function(){
var session = $scope._getSession();
$universityFactory.get_userCampus(session.user,function(data){
adminUsersCtrl.ready = true;
if(data.status == "success"){
adminUsersCtrl.campuses =data.details;
for(var index in data.details){
var campus = data.details[index]
if(campus.status=="1"){
adminUsersCtrl.campus = {"id":campus.id,"settings":{},"articles":{},name:campus.name,ownerId:campus.ownerId};
adminUsersCtrl.refresh();
break;
}
}
}
});
var session = $scope._getSession();
$universityFactory.get_userCampus(session.user,function(data){
adminUsersCtrl.ready = true;
if(data.status == "success"){
adminUsersCtrl.campuses = data.details;
for(var index in data.details){
var campus = data.details[index]
if(campus.status=="1"){
adminUsersCtrl.campus = {"id":campus.id,"settings":{},"articles":{},name:campus.name,ownerId:campus.ownerId};
adminUsersCtrl.refresh();
break;
}
}
}
});
};
adminUsersCtrl.fetchAdmins =function(){
$universityFactory.get_campusUsers(adminUsersCtrl.campus.id, $scope._getSession().user,'admin',adminUsersCtrl.searchInput, function(data){
......@@ -86,7 +84,6 @@ root.controller('AdminUsersCtrl' ,['$scope','$http', '$stateParams','$university
$scope._showAlert({status:3,message:""})
}
});
};
adminUsersCtrl.fetchAlumni = function(){
......@@ -123,7 +120,6 @@ root.controller('AdminUsersCtrl' ,['$scope','$http', '$stateParams','$university
$scope._showAlert({status:3,message:""})
}
});
};
adminUsersCtrl.newManager = function(email,firstName,lastName,position){
......@@ -294,5 +290,5 @@ root.controller('AdminUsersCtrl' ,['$scope','$http', '$stateParams','$university
}
adminUsersCtrl.init();
}]);
\ No newline at end of file
......@@ -13,13 +13,13 @@ function $universityFactory($rootScope,$serverFactory,$rightFactory) {
}
/**
* [get_projectDetails get the details of a project by its ID]
* [get_userCampus get universities of the user]
* @param user:int facultative
* @success [{fullName:string,name:string,ownerId:int,status:int,thumbnailUrl:string}]
*/
returns.get_userCampus=function(user,success,failure){
if(!user) user = $rightFactory.session.userId;
return $serverFactory.runCommand("getUniversitiesByUser", {user:user},success,failure);
return $serverFactory.runCommand("get_university", {user:user},success,failure);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment