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
e3e7a12b
authored
Sep 18, 2017
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
working on PCB v1.3
parent
5dc50182
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/websockets/StudentTalk.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/StudentFragmentGrid.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/websockets/StudentTalk.java
View file @
e3e7a12b
...
...
@@ -41,9 +41,9 @@ public class StudentTalk implements Emitter.Listener {
String
pic
=
msg
.
getString
(
"pic"
);
String
lang
=
msg
.
getString
(
"lang"
);
String
attributes
=
msg
.
getString
(
"attributes"
);
//
JSONObject license= msg.getJSONObject("license");
Log
.
e
(
"STUDENT"
,
"change...remove license in hard when lincense is not null
"
);
JSONObject
license
=
new
JSONObject
().
put
(
"isValid"
,
true
);
JSONObject
license
=
msg
.
getJSONObject
(
"license"
);
Log
.
e
(
"STUDENT"
,
"change...remove license in hard when lincense is not null
:"
+
license
.
toString
()
);
//
JSONObject license=new JSONObject().put("isValid",true);
User
user
=
PCBcontext
.
getPcbdb
().
getCurrentUser
();
User
updatedUser
=
new
User
(
id
,
username
,
user
.
get_pwd_stu
(),
name
,
surname
,
id_active_scene
,
pic
,
gender
,
lang
,
attributes
,
user
.
get_id_sup
(),
user
.
get_email_sup
(),
user
.
get_pwd_sup
(),
user
.
get_name_sup
(),
user
.
get_surname_sup
(),
user
.
get_url_img_sup
(),
user
.
get_gender_sup
(),
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/StudentFragmentGrid.java
View file @
e3e7a12b
...
...
@@ -139,13 +139,13 @@ public class StudentFragmentGrid extends Fragment {
//What ever you want to do with the value
String
license
=
edittext
.
getText
().
toString
().
replaceAll
(
"[^a-zA-Z0-9]"
,
""
).
toUpperCase
();
RestapiWrapper
wrapper
=
PCBcontext
.
getRestapiWrapper
();
String
operation
=
"stu/license/sup/"
+
sup_id
;
final
String
operation
=
"stu/license/sup/"
+
sup_id
;
Hashtable
<
String
,
String
>
params
=
new
Hashtable
<
String
,
String
>(
1
);
params
.
put
(
"license"
,
license
);
wrapper
.
ask
(
operation
,
params
,
"post"
,
new
RestapiWrapper
.
iRestapiListener
()
{
@Override
public
void
error
(
RestapiWrapper
.
HTTPException
e
)
{
Log
.
e
(
this
.
getClass
().
getName
(),
" Server restapi error
: "
+
e
.
getLocalizedMessage
());
Log
.
e
(
this
.
getClass
().
getName
(),
" Server restapi error
. Operation: "
+
operation
+
". Message:"
+
e
.
getLocalizedMessage
());
String
err
=
e
.
getLocalizedMessage
();
if
(
err
.
indexOf
(
"nvalid license"
)
>
0
)
GUITools
.
show_alert
(
getActivity
(),
R
.
string
.
loginNoLicenseMsg
);
...
...
@@ -335,11 +335,11 @@ public class StudentFragmentGrid extends Fragment {
RestapiWrapper
wrapper
=
PCBcontext
.
getRestapiWrapper
();
wrapper
.
setToken
(
token
);
String
operation
=
"stu/"
+
stu_id
+
"/supervisors"
;
final
String
operation
=
"stu/"
+
stu_id
+
"/supervisors"
;
wrapper
.
ask
(
operation
,
new
RestapiWrapper
.
iRestapiListener
()
{
@Override
public
void
error
(
RestapiWrapper
.
HTTPException
e
)
{
Log
.
e
(
this
.
getClass
().
getName
(),
" Server restapi error
: "
+
e
.
getLocalizedMessage
());
Log
.
e
(
this
.
getClass
().
getName
(),
" Server restapi error
. Operation: "
+
operation
+
". Message:"
+
e
.
getLocalizedMessage
());
GUITools
.
show_alert
(
getActivity
(),
R
.
string
.
loginErrorTxt
,
getString
(
R
.
string
.
serverError
),
new
GUITools
.
iOKListener
()
{
@Override
public
void
ok
()
{
...
...
@@ -407,12 +407,12 @@ public class StudentFragmentGrid extends Fragment {
String
token
=
getActivity
().
getIntent
().
getExtras
().
getString
(
"token"
);
RestapiWrapper
wrapper
=
PCBcontext
.
getRestapiWrapper
();
wrapper
.
setToken
(
token
);
String
operation
=
"sup/"
+
sup_id
+
"/students"
;
final
String
operation
=
"sup/"
+
sup_id
+
"/students"
;
wrapper
.
ask
(
operation
,
new
RestapiWrapper
.
iRestapiListener
()
{
@Override
public
void
error
(
RestapiWrapper
.
HTTPException
e
)
{
Log
.
e
(
this
.
getClass
().
getName
(),
" Server restapi error
: "
+
e
.
getLocalizedMessage
());
Log
.
e
(
this
.
getClass
().
getName
(),
" Server restapi error
. Operation: "
+
operation
+
". Message:"
+
e
.
getLocalizedMessage
());
GUITools
.
show_alert
(
getActivity
(),
R
.
string
.
loginErrorTxt
,
getString
(
R
.
string
.
serverError
),
new
GUITools
.
iOKListener
()
{
@Override
public
void
ok
()
{
...
...
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