Commit 8eca6916 by Arturo Montejo Ráez

Merge remote-tracking branch 'origin/master' into develop

parents 16e8b513 da28133a
...@@ -163,8 +163,8 @@ module.exports = { ...@@ -163,8 +163,8 @@ module.exports = {
student.supervision = 1; // requester is tutor of the studend student.supervision = 1; // requester is tutor of the studend
else if (stu_sup && req.token.office) else if (stu_sup && req.token.office)
student.supervision = 2; // requester is supervisor of student student.supervision = 2; // requester is supervisor of student
else if (req.token.isStudent && req.token.id == student.id) else if (req.token.isStudent && req.token.id == student.id)
student.supervision = 3 // requester is the student himself student.supervision = 3 // requester is the student himself
if (student.supervision == -1) // should not hace access!!! if (student.supervision == -1) // should not hace access!!!
return res.forbidden("Access to this student should not be granted to you"); return res.forbidden("Access to this student should not be granted to you");
......
...@@ -337,7 +337,7 @@ module.exports = { ...@@ -337,7 +337,7 @@ module.exports = {
phone: params.phone || '', phone: params.phone || '',
lang: params.lang || 'es-es', lang: params.lang || 'es-es',
}; };
if (params.id_off) if (params.id_off && params.role == 'therapist_office')
supData.id_off = params.id_off; supData.id_off = params.id_off;
console.log(JSON.stringify(supData)); console.log(JSON.stringify(supData));
......
...@@ -30,7 +30,7 @@ module.exports = { ...@@ -30,7 +30,7 @@ module.exports = {
var params = req.allParams(); var params = req.allParams();
if (!params.id) return res.badRequest("No try defined"); if (!params.id) return res.badRequest("No try defined");
if (params.end) prams.end = new Date().toISOString(); if (params.end) params.end = new Date().toISOString();
Try.update(params.id, params) Try.update(params.id, params)
.then(function (t) { .then(function (t) {
......
...@@ -303,7 +303,7 @@ module.exports = { ...@@ -303,7 +303,7 @@ module.exports = {
if (err) if (err)
return callback(err, []); return callback(err, []);
if (!stuSups || stuSups.length == 0) if (!stuSups || stuSups.length == 0)
return callback(new Error("No supervisors found"), []); return callback(null, []);
var sups = stuSups.map((st) => {return st.supervisor}); var sups = stuSups.map((st) => {return st.supervisor});
return callback(null, sups); return callback(null, sups);
......
...@@ -238,6 +238,7 @@ ...@@ -238,6 +238,7 @@
"next_actions": "Next actions", "next_actions": "Next actions",
"next_sessions": "Next sessions", "next_sessions": "Next sessions",
"no": "No", "no": "No",
"no_categories": "Without categories",
"nobegin": "No started", "nobegin": "No started",
"no_method": "No method defined", "no_method": "No method defined",
"no_office": "No office", "no_office": "No office",
...@@ -455,6 +456,7 @@ ...@@ -455,6 +456,7 @@
"warning_no_pictos_found": "No pictograms found with specified keyword", "warning_no_pictos_found": "No pictograms found with specified keyword",
"warning_no_tablet_online":"No Pictogran Tablet online detected", "warning_no_tablet_online":"No Pictogran Tablet online detected",
"warning_two_characters":"Must type at least two characters", "warning_two_characters":"Must type at least two characters",
"with_categories": "With categories",
"woman": "Woman", "woman": "Woman",
"year_totals": "Year totals", "year_totals": "Year totals",
"yes": "Yes", "yes": "Yes",
......
...@@ -238,6 +238,7 @@ ...@@ -238,6 +238,7 @@
"next_actions": "Acciones posteriores", "next_actions": "Acciones posteriores",
"next_sessions": "Sesiones posteriores", "next_sessions": "Sesiones posteriores",
"no": "No", "no": "No",
"no_categories": "Sin categorías",
"no_method": "Método sin definir", "no_method": "Método sin definir",
"no_office": "Sin centro", "no_office": "Sin centro",
"no_instruction": "Instrucción sin definir", "no_instruction": "Instrucción sin definir",
...@@ -455,6 +456,7 @@ ...@@ -455,6 +456,7 @@
"warning_no_pictos_found": "No se encontraron pictogramas con las palabras introducidas", "warning_no_pictos_found": "No se encontraron pictogramas con las palabras introducidas",
"warning_no_tablet_online":"No se detectó ningún usuario de Pictogram Tablet online", "warning_no_tablet_online":"No se detectó ningún usuario de Pictogram Tablet online",
"warning_two_characters":"Debe introducir al menos dos caracteres", "warning_two_characters":"Debe introducir al menos dos caracteres",
"with_categories": "Con categorías",
"woman": "Mujer", "woman": "Mujer",
"year_totals": "Totales año", "year_totals": "Totales año",
"yes": "Sí", "yes": "Sí",
......
...@@ -132,7 +132,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -132,7 +132,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$http.get(config.backend + '/stu/' + $scope.studentData.id + '/activeScene') $http.get(config.backend + '/stu/' + $scope.studentData.id + '/activeScene')
.success(function (activeScene) { .success(function (activeScene) {
$scope.showFreeCategory = !activeScene.categories; $scope.showFreeCategory = !activeScene.categories;
activeScene.name = $translate.instant(activeScene.name);
$scope.viewingScene = activeScene; $scope.viewingScene = activeScene;
activeScene.pictos.forEach(placePicto); activeScene.pictos.forEach(placePicto);
$scope.loadingPictos = false; $scope.loadingPictos = false;
...@@ -156,8 +157,10 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -156,8 +157,10 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$http.get(config.backend + '/scene/' + idScene) $http.get(config.backend + '/scene/' + idScene)
.success(function (scene) { .success(function (scene) {
$scope.showFreeCategory = !scene.categories; $scope.showFreeCategory = !scene.categories;
$scope.viewingScene = scene; scene.name = $translate.instant(scene.name);
$scope.viewingScene = scene;
scene.pictos.forEach(placePicto); scene.pictos.forEach(placePicto);
$scope.loadingPictos = false; $scope.loadingPictos = false;
//setTimeout(function () { $scope.$apply(); }); //setTimeout(function () { $scope.$apply(); });
...@@ -173,7 +176,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -173,7 +176,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$scope.loadScenesList = function () { $scope.loadScenesList = function () {
$http.get(config.backend + '/stu/' + $scope.studentData.id +'/scenes') $http.get(config.backend + '/stu/' + $scope.studentData.id +'/scenes')
.success(function (scenes) { .success(function (scenes) {
scenes.map((sce) => {sce.name = $translate.instant(sce.name); return sce});
$scope.scenesList = scenes; $scope.scenesList = scenes;
//setTimeout(function () { $scope.$apply(); }); //setTimeout(function () { $scope.$apply(); });
}) })
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<ul class="nav nav-tabs tabs_student"> <ul class="nav nav-tabs tabs_student">
<!-- 0: admin, 1: tutor, 2: therapist --> <!-- 0: admin, 1: tutor, 2: therapist -->
<li role="presentation" ng-class="{'active' : nav.tab == 'collections'}" ng-if="studentData.supervision != 0"> <li role="presentation" ng-class="{'active' : nav.tab == 'collections'}" ng-if="studentData.supervision != 0">
<a href="/app/#/student/{{studentData.id}}/collections" ng-click="nav.tab = ''"><span class="glyphicon glyphicon-th" aria-hidden="true"></span> {{ 'collections' | translate }}</a> <a href="/app/#/student/{{studentData.id}}/collections" ng-click="nav.tab = ''"><span class="glyphicon glyphicon-th" aria-hidden="true"></span> {{ 'collections' | translate }}</a>
</li> </li>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<button class="btn btn-default" btn-radio="'new'" ng-model="section"> <button class="btn btn-default" btn-radio="'new'" ng-model="section">
<span class="glyphicon glyphicon-record"></span> {{ 'new_session' | translate }} <span class="glyphicon glyphicon-record"></span> {{ 'new_session' | translate }}
</button> </button>
<button class="btn btn-default" btn-radio="'previous'" ng-model="section" ng-click="load_tries()"> <button class="btn btn-default" btn-radio="'previous'" ng-model="section" ng-click="load_tries()" ng-if="wsessions.length > 0">
<span class="glyphicon glyphicon-transfer"></span> {{ 'previous_sessions' | translate }} <span class="glyphicon glyphicon-transfer"></span> {{ 'previous_sessions' | translate }}
</button> </button>
</div> </div>
......
...@@ -6,7 +6,7 @@ var ASSETS_PATH = path.join(__dirname, '..', 'assets'); ...@@ -6,7 +6,7 @@ var ASSETS_PATH = path.join(__dirname, '..', 'assets');
var UPLOAD_PATH = path.join(__dirname, '..', '..', 'upload'); var UPLOAD_PATH = path.join(__dirname, '..', '..', 'upload');
module.exports.pictogram = { module.exports.pictogram = {
version: "1.1", // actual version of the server, to be checked by the client version: "1.2", // actual version of the server, to be checked by the client
admins: [ admins: [
{ {
email: 'amontejo@ujaen.es', email: 'amontejo@ujaen.es',
......
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 sign in to comment