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
9f394f14
authored
May 11, 2017
by
Germán Callejas Alcántara
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Arreglado el obtener el active scene de user como -1 que ocurria a veces
parent
f018b7df
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
18 deletions
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/action/Action.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/User.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/UserLogin.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/PictoUploader.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/tools/PCBcontext.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/action/Action.java
View file @
9f394f14
...
...
@@ -51,7 +51,8 @@ public abstract class Action {
Log
.
d
(
"TIMESTAMP-----------> "
,
datetime
.
format
(
currentTime
));
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
has_supervisor
())
{
jsonObject
.
put
(
param_id_sup
,
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_id_sup
());
jsonObject
.
put
(
param_id_scene
,
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_active_scene
());
//TODO: Esto coge -1
Log
.
i
(
"TAG_PRUEBAS"
,
"ACTION_ID_SCENE: "
+
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_active_scene
());
jsonObject
.
put
(
param_id_scene
,
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_active_scene
());
}
//TODO Decidir qué almacenar con DEVICE
//if (PCBcontext.getDevice().getDeviceID()!=null)
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/User.java
View file @
9f394f14
...
...
@@ -253,12 +253,13 @@ public class User {
* @return The id of the active scene of this student
*/
public
int
get_active_scene
()
{
try
{
/*
try {
return this.attributes_stu.getInt(JSON_STUDENT_ATTTRS.ID_ACTIVE_SCENE);
} catch (JSONException e) {
e.printStackTrace();
}
return
-
1
;
return -1;*/
return
this
.
id_scene_stu
;
}
public
void
set_active_scene
(
int
id
)
{
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/UserLogin.java
View file @
9f394f14
...
...
@@ -189,18 +189,19 @@ public class UserLogin {
String
st_gender
=
user
.
getString
(
TAG_GENDER
);
String
st_lang
=
user
.
getString
(
TAG_LANG
);
String
st_attributes
=
user
.
getString
(
TAG_ATTRIBUTES
);
set_student_oline
(
new
User
(
st_id_int
,
username
,
password
,
st_name
,
st_surname
,
st_id_scene
,
st_pic
,
st_gender
,
st_lang
,
st_attributes
,
User
.
NO_SUPERVISOR
,
""
,
""
,
""
,
""
,
""
,
"M"
,
"es-es"
,
""
,
""
)
User
newStu
=
new
User
(
st_id_int
,
username
,
password
,
st_name
,
st_surname
,
st_id_scene
,
st_pic
,
st_gender
,
st_lang
,
st_attributes
,
User
.
NO_SUPERVISOR
,
""
,
""
,
""
,
""
,
""
,
"M"
,
"es-es"
,
""
,
""
);
newStu
.
set_active_scene
(
st_id_scene
);
set_student_oline
(
newStu
,
result
.
getString
(
TAG_TOKEN
)
,
pictogramActivity
,
activity
);
}
catch
(
JSONException
e
)
{
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
View file @
9f394f14
...
...
@@ -96,7 +96,7 @@ public class Vocabulary implements Iterable<Picto> {
JSONObject
attrs_picto
=
args
.
getJSONObject
(
"attributes"
);
attrs_picto
.
put
(
Picto
.
JSON_ATTTRS
.
STUPICTO_ID
,
args
.
getInt
(
"id"
));
Picto
newPicto
=
new
Picto
(
picto_id
,
uri
,
attrs_picto
);
Picto
prev_picto
=
/*PCBcontext.getPcbdb().getCurrentUser().has_categories()*/
PCBcontext
.
getVocabulary
().
has_categories
()
Picto
prev_picto
=
PCBcontext
.
getVocabulary
().
has_categories
()
?
find_picto
(
newPicto
.
get_category
(),
newPicto
.
get_row
(),
newPicto
.
get_column
())
:
find_picto
(
newPicto
.
getFreeRow
(),
newPicto
.
getFreeColumn
());
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/PictoUploader.java
View file @
9f394f14
...
...
@@ -324,7 +324,6 @@ public class PictoUploader {
params
.
put
(
"id_stu"
,
Integer
.
toString
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_id_stu
()));
//params.put("id_pic", Integer.toString(this.picto.get_id()));
//params.put("id_scene" , Integer.toString(PCBcontext.getPcbdb().getCurrentUser().get_active_scene()));
params
.
put
(
"id_stuPicto"
,
Integer
.
toString
(
this
.
picto
.
get_stupicto_id
()));
Log
.
i
(
LOG_TAG
,
"Picto "
+
this
.
picto
.
get_id
()+
" stupicto id:"
+
this
.
picto
.
get_stupicto_id
()+
" Uploading "
+
params
.
toString
());
PCBcontext
.
getRestapiWrapper
().
ask
(
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/tools/PCBcontext.java
View file @
9f394f14
...
...
@@ -80,7 +80,7 @@ public final class PCBcontext {
Log
.
i
(
"TAG_PRUEBAS"
,
"ID_SCENE_VOCAB: "
+
PCBcontext
.
getVocabulary
().
getId_scene
()+
"ID_SCENE_USER: "
+
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_active_scene
());
if
(
updatedStudent
.
is_picto_size_big
()!=
getPcbdb
().
getCurrentUser
().
is_picto_size_big
()
||
PCBcontext
.
getVocabulary
().
has_categories
()
!=
vocabulary
.
has_categories
()
/*|| PCBcontext.getVocabulary().getId_scene()!= PCBcontext.getPcbdb().getCurrentUser().get_active_scene()*/
)
{
||
PCBcontext
.
getVocabulary
().
getId_scene
()!=
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_active_scene
()
)
{
PCBcontext
.
getNetService
().
restart_app
(
false
);
}
else
{
...
...
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