Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
05bb6abf
authored
May 25, 2017
by
Jose Antonio
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
140dd793
8c4294f9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
27 additions
and
20 deletions
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/Device.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/StudentFragmentGrid.java
android/Pictogram/tabletlibrary/src/main/res/drawable-xhdpi/yottacode_logo.jpg
android/Pictogram/tabletlibrary/src/main/res/drawable-xhdpi/yottacode_logo.png
android/Pictogram/tabletlibrary/src/main/res/layout/activity_login.xml
android/Pictogram/tabletlibrary/src/main/res/layout/activity_splash_screen.xml
android/Pictogram/tabletlibrary/src/main/res/layout/edit_picto_layout.xml
android/Pictogram/tabletlibrary/src/main/res/layout/fragment_new_student.xml
android/Pictogram/tabletlibrary/src/main/res/layout/studentfragment.xml
android/Pictogram/tabletlibrary/src/main/res/layout/supervisorfragment.xml
sails/src/api/controllers/StudentController.js
sails/src/assets/scripts/modules/login/controllers/signin.js
sails/src/assets/scripts/modules/login/views/signin.html
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/Device.java
View file @
05bb6abf
...
@@ -192,9 +192,9 @@ public class Device extends SQLiteOpenHelper {
...
@@ -192,9 +192,9 @@ public class Device extends SQLiteOpenHelper {
* @return
* @return
* @throws JSONException
* @throws JSONException
*/
*/
public
Boolean
isSupervisorOnLocal
(
int
id_sup
)
throws
JSONException
{
public
Boolean
isSupervisorOnLocal
(
int
id_sup
,
int
id_stu
)
throws
JSONException
{
SQLiteDatabase
db
=
this
.
getReadableDatabase
();
SQLiteDatabase
db
=
this
.
getReadableDatabase
();
Cursor
cursor
=
db
.
rawQuery
(
" SELECT * FROM
supervisor WHERE id = "
+
id_sup
,
null
);
Cursor
cursor
=
db
.
rawQuery
(
" SELECT * FROM
users_detail WHERE id_stu = "
+
id_stu
+
" AND id_sup ="
+
id_sup
,
null
);
if
(
cursor
.
moveToFirst
())
if
(
cursor
.
moveToFirst
())
return
true
;
return
true
;
cursor
.
close
();
cursor
.
close
();
...
@@ -213,7 +213,7 @@ public class Device extends SQLiteOpenHelper {
...
@@ -213,7 +213,7 @@ public class Device extends SQLiteOpenHelper {
Hashtable
<
String
,
String
>
users
=
new
Hashtable
<>(
3
);
Hashtable
<
String
,
String
>
users
=
new
Hashtable
<>(
3
);
Cursor
cursor
=
db
.
rawQuery
(
" SELECT email_sup, name_sup, surname_sup,id_sup FROM users_detail WHERE id_stu = "
+
id_stu
,
null
);
Cursor
cursor
=
db
.
rawQuery
(
" SELECT email_sup, name_sup, surname_sup,id_sup FROM users_detail WHERE id_stu = "
+
id_stu
,
null
);
while
(
cursor
.
moveToNext
())
while
(
cursor
.
moveToNext
())
users
.
put
(
cursor
.
getString
(
0
),
cursor
.
getString
(
1
)
+
", "
+
cursor
.
getString
(
2
)+
";"
+
cursor
.
getInt
(
3
));
users
.
put
(
cursor
.
getString
(
0
),
cursor
.
getString
(
1
)
+
", "
+
cursor
.
getString
(
2
)
+
";"
+
cursor
.
getInt
(
3
));
cursor
.
close
();
cursor
.
close
();
//db.close(); <--no es necesario cerrar la bbdd https://groups.google.com/forum/#!msg/android-developers/NwDRpHUXt0U/jIam4Q8-cqQJ
//db.close(); <--no es necesario cerrar la bbdd https://groups.google.com/forum/#!msg/android-developers/NwDRpHUXt0U/jIam4Q8-cqQJ
return
users
;
return
users
;
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/StudentFragmentGrid.java
View file @
05bb6abf
...
@@ -243,7 +243,7 @@ public class StudentFragmentGrid extends Fragment{
...
@@ -243,7 +243,7 @@ public class StudentFragmentGrid extends Fragment{
try
{
try
{
supervisor
=
supervisors
.
getJSONObject
(
i
);
supervisor
=
supervisors
.
getJSONObject
(
i
);
idSupervisoresJSON
.
add
(
supervisor
.
getString
(
"email"
));
idSupervisoresJSON
.
add
(
supervisor
.
getString
(
"email"
));
if
(!
PCBcontext
.
getDevice
().
isSupervisorOnLocal
((
int
)
supervisor
.
get
(
"id"
)))
{
//Para comprobar si ya existe en local
if
(!
PCBcontext
.
getDevice
().
isSupervisorOnLocal
((
int
)
supervisor
.
get
(
"id"
)
,
stu_id
))
{
//Para comprobar si ya existe en local
User
currentUser
=
PCBcontext
.
getPcbdb
().
getCurrentUser
();
User
currentUser
=
PCBcontext
.
getPcbdb
().
getCurrentUser
();
PCBcontext
.
getDevice
().
insertUser
(
new
User
(
stu_id
,
currentUser
.
get_nickname_stu
(),
currentUser
.
get_pwd_stu
()
PCBcontext
.
getDevice
().
insertUser
(
new
User
(
stu_id
,
currentUser
.
get_nickname_stu
(),
currentUser
.
get_pwd_stu
()
,
currentUser
.
get_name_stu
(),
currentUser
.
get_surname_stu
(),
currentUser
.
get_active_scene
(),
currentUser
.
get_url_img_stu
()
,
currentUser
.
get_name_stu
(),
currentUser
.
get_surname_stu
(),
currentUser
.
get_active_scene
(),
currentUser
.
get_url_img_stu
()
...
...
android/Pictogram/tabletlibrary/src/main/res/drawable-xhdpi/yottacode_logo.jpg
deleted
100644 → 0
View file @
140dd793
13.3 KB
android/Pictogram/tabletlibrary/src/main/res/drawable-xhdpi/yottacode_logo.png
0 → 100644
View file @
05bb6abf
22.8 KB
android/Pictogram/tabletlibrary/src/main/res/layout/activity_login.xml
View file @
05bb6abf
...
@@ -80,6 +80,7 @@
...
@@ -80,6 +80,7 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"fill_parent"
android:layout_height=
"fill_parent"
android:layout_below=
"@+id/loginTopbarLayout"
android:layout_below=
"@+id/loginTopbarLayout"
android:background=
"#eeeeee"
android:paddingTop=
"10dp"
>
android:paddingTop=
"10dp"
>
<fragment
<fragment
...
...
android/Pictogram/tabletlibrary/src/main/res/layout/activity_splash_screen.xml
View file @
05bb6abf
...
@@ -8,17 +8,17 @@
...
@@ -8,17 +8,17 @@
tools:context=
"com.yottacode.pictogram.tabletlibrary.gui.login.SplashScreenActivity"
>
tools:context=
"com.yottacode.pictogram.tabletlibrary.gui.login.SplashScreenActivity"
>
<ImageView
<ImageView
android:id=
"@+id/imageView2"
android:layout_width=
"400px"
android:layout_width=
"400px"
android:layout_height=
"120px"
android:layout_height=
"120px"
android:layout_alignParentBottom=
"true"
android:layout_alignParentEnd=
"true"
android:layout_marginBottom=
"44dp"
android:contentDescription=
"@string/app_name"
android:contentDescription=
"@string/app_name"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:src=
"@drawable/yottacode_logo"
android:scaleX=
"0.5"
android:scaleX=
"0.5"
android:scaleY=
"0.5"
android:scaleY=
"0.5"
android:id=
"@+id/imageView2"
android:src=
"@drawable/yottacode_logo"
/>
android:layout_alignParentBottom=
"true"
android:layout_alignParentEnd=
"true"
android:layout_marginBottom=
"44dp"
/>
<ImageView
<ImageView
android:layout_width=
"200px"
android:layout_width=
"200px"
...
...
android/Pictogram/tabletlibrary/src/main/res/layout/edit_picto_layout.xml
View file @
05bb6abf
This diff is collapsed.
Click to expand it.
android/Pictogram/tabletlibrary/src/main/res/layout/fragment_new_student.xml
View file @
05bb6abf
...
@@ -3,5 +3,6 @@
...
@@ -3,5 +3,6 @@
android:id=
"@+id/loginStudentGridView"
android:id=
"@+id/loginStudentGridView"
android:layout_width=
"fill_parent"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"#eeeeee"
android:numColumns=
"5"
android:numColumns=
"5"
android:stackFromBottom=
"false"
/>
android:stackFromBottom=
"false"
/>
android/Pictogram/tabletlibrary/src/main/res/layout/studentfragment.xml
View file @
05bb6abf
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<ListView
<ListView
android:id=
"@android:id/list"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:
id=
"@android:id/list
"
/>
android:
background=
"#eeeeee
"
/>
</LinearLayout>
</LinearLayout>
android/Pictogram/tabletlibrary/src/main/res/layout/supervisorfragment.xml
View file @
05bb6abf
...
@@ -6,7 +6,8 @@
...
@@ -6,7 +6,8 @@
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<ListView
<ListView
android:id=
"@android:id/list"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:
id=
"@android:id/list
"
/>
android:
background=
"#eeeeee
"
/>
</LinearLayout>
</LinearLayout>
sails/src/api/controllers/StudentController.js
View file @
05bb6abf
...
@@ -161,7 +161,7 @@ module.exports = {
...
@@ -161,7 +161,7 @@ module.exports = {
student
.
supervision
=
0
;
// requester is admin of the office
student
.
supervision
=
0
;
// requester is admin of the office
else
if
(
stu_sup
&&
!
req
.
token
.
office
)
else
if
(
stu_sup
&&
!
req
.
token
.
office
)
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
&&
student
.
office
==
req
.
token
.
office
.
id
)
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
...
...
sails/src/assets/scripts/modules/login/controllers/signin.js
View file @
05bb6abf
...
@@ -41,7 +41,7 @@ function SignInCtrl($scope,
...
@@ -41,7 +41,7 @@ function SignInCtrl($scope,
email
:
''
,
email
:
''
,
logoUrl
:
''
logoUrl
:
''
},
},
office_idx
:
-
1
id_off
:
-
1
};
};
};
};
...
@@ -92,7 +92,12 @@ function SignInCtrl($scope,
...
@@ -92,7 +92,12 @@ function SignInCtrl($scope,
return
;
return
;
}
}
if
(
$scope
.
formdata
.
role
==
'therapist_nooffice'
&&
$scope
.
formdata
.
office
.
country
==
'00'
)
{
if
((
$scope
.
formdata
.
role
==
'therapist_office'
||
$scope
.
formdata
.
role
==
'tutor_office'
)
&&
$scope
.
formdata
.
id_off
==
-
1
)
{
ngToast
.
danger
({
content
:
$translate
.
instant
(
'select_office'
)
});
return
;
}
if
(
$scope
.
formdata
.
role
==
'therapist_nooffice'
&&
$scope
.
formdata
.
office
.
country
==
'00'
)
{
ngToast
.
danger
({
content
:
$translate
.
instant
(
'country_office_requested'
)
});
ngToast
.
danger
({
content
:
$translate
.
instant
(
'country_office_requested'
)
});
return
;
return
;
}
}
...
@@ -112,10 +117,8 @@ function SignInCtrl($scope,
...
@@ -112,10 +117,8 @@ function SignInCtrl($scope,
$scope
.
showdialog
=
true
;
$scope
.
showdialog
=
true
;
if
(
$scope
.
formdata
.
office_idx
!=
-
1
)
{
if
(
$scope
.
formdata
.
id_off
==
-
1
)
$scope
.
formdata
.
id_off
=
$scope
.
offices
[
$scope
.
formdata
.
office_idx
].
id
;
delete
$scope
.
formdata
.
id_off
;
delete
$scope
.
formdata
.
office_idx
;
}
if
(
$scope
.
formdata
.
role
===
'tutor_nooffice'
)
{
if
(
$scope
.
formdata
.
role
===
'tutor_nooffice'
)
{
$scope
.
formdata
.
office
.
name
=
'no_office'
;
$scope
.
formdata
.
office
.
name
=
'no_office'
;
...
...
sails/src/assets/scripts/modules/login/views/signin.html
View file @
05bb6abf
...
@@ -223,9 +223,9 @@
...
@@ -223,9 +223,9 @@
<div
class=
"form-group"
id=
"office_selection"
>
<div
class=
"form-group"
id=
"office_selection"
>
<legend
translate
>
office_center
</legend>
<legend
translate
>
office_center
</legend>
<select
class=
"form-control"
ng-model=
"formdata.
office_idx
"
ng-required=
"formdata.role == 'therapist_office' || formdata.role == 'tutor_office'"
>
<select
class=
"form-control"
ng-model=
"formdata.
id_off
"
ng-required=
"formdata.role == 'therapist_office' || formdata.role == 'tutor_office'"
>
<option
selected
disabled
hidden
value=
"-1"
>
{{ 'select_office' | translate }}
</option>
<option
selected
disabled
hidden
value=
"-1"
>
{{ 'select_office' | translate }}
</option>
<option
ng-repeat=
"office in offices | orderBy: 'name' track by
$index"
ng-value=
"$index
"
>
{{ office.name }}
</option>
<option
ng-repeat=
"office in offices | orderBy: 'name' track by
office.id"
ng-value=
"office.id
"
>
{{ office.name }}
</option>
</select>
</select>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment