Commit 05bb6abf by Jose Antonio

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

parents 140dd793 8c4294f9
......@@ -192,9 +192,9 @@ public class Device extends SQLiteOpenHelper {
* @return
* @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();
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())
return true;
cursor.close();
......@@ -213,7 +213,7 @@ public class Device extends SQLiteOpenHelper {
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);
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();
//db.close(); <--no es necesario cerrar la bbdd https://groups.google.com/forum/#!msg/android-developers/NwDRpHUXt0U/jIam4Q8-cqQJ
return users;
......
......@@ -243,7 +243,7 @@ public class StudentFragmentGrid extends Fragment{
try {
supervisor = supervisors.getJSONObject(i);
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();
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()
......
......@@ -80,6 +80,7 @@
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/loginTopbarLayout"
android:background="#eeeeee"
android:paddingTop="10dp">
<fragment
......
......@@ -8,17 +8,17 @@
tools:context="com.yottacode.pictogram.tabletlibrary.gui.login.SplashScreenActivity" >
<ImageView
android:id="@+id/imageView2"
android:layout_width="400px"
android:layout_height="120px"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_marginBottom="44dp"
android:contentDescription="@string/app_name"
android:orientation="vertical"
android:src="@drawable/yottacode_logo"
android:scaleX="0.5"
android:scaleY="0.5"
android:id="@+id/imageView2"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_marginBottom="44dp" />
android:src="@drawable/yottacode_logo" />
<ImageView
android:layout_width="200px"
......
......@@ -109,7 +109,10 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginTop="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/textView_Supevisor"
android:layout_width="match_parent"
......@@ -124,182 +127,182 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/BlancoApp"
android:background="@color/VerdeApp"
android:text="___________" />
android:text="___________"
android:textColor="@color/BlancoApp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginBottom="20dp"
android:layout_marginTop="10dp"
android:background="@color/VerdeApp"
/>
</LinearLayout>
<TextView
android:id="@+id/textLegend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/legendText"
android:textColor="@color/gray"
android:textSize="20sp" />
<EditText
android:id="@+id/edtLegend"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/textLegend"
android:layout_gravity="center"
android:layout_marginBottom="15dp"
android:background="@drawable/editpicto_edittext_style"
android:ems="10"
android:gravity="center"
android:imeOptions="actionDone"
android:maxLines="1"
android:textColor="@color/black"
android:textColorLink="?android:attr/colorAccent"
android:textCursorDrawable="@null"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:background="@color/VerdeApp"
android:paddingBottom="4dp"
android:layout_height="match_parent"
android:layout_marginBottom="20dp"
android:layout_marginTop="10dp"
/>
<TextView
android:id="@+id/textView_Audio"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="Audio:"
android:textColor="@color/gray"
android:textSize="20sp" />
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp">
<TextView
android:id="@+id/textLegend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/legendText"
android:textColor="@color/gray"
android:textSize="20sp" />
<LinearLayout
android:id="@+id/layout_record"
<EditText
android:id="@+id/edtLegend"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/textLegend"
android:layout_gravity="center"
android:background="@drawable/editpicto_edittext_style"
android:ems="10"
android:gravity="center"
android:orientation="horizontal"
android:paddingTop="5dp"
android:visibility="visible"
android:weightSum="1">
android:imeOptions="actionDone"
android:maxLines="1"
android:textColor="@color/black"
android:textColorLink="?android:attr/colorAccent"
android:textCursorDrawable="@null"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:orientation="vertical">
<pl.droidsonroids.gif.GifTextView
android:id="@+id/recordImage"
android:layout_width="14dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_weight="0.36"
android:background="@color/white" />
<TextView
android:id="@+id/textView_Audio"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="Audio:"
android:textColor="@color/gray"
android:textSize="20sp" />
<TextView
android:id="@+id/tiempoActual"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:paddingLeft="5dp"
android:paddingRight="16dp"
android:text="00:00 | 00:10"
android:textColor="@color/VerdeApp" />
<com.yottacode.pictogram.tabletlibrary.gui.communicator.BotonCircular
android:id="@+id/botonGrabar"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_alignParentBottom="false"
android:layout_centerHorizontal="false"
android:background="#00ffffff"
android:clickable="true"
android:src="@drawable/micro" />
</LinearLayout>
<LinearLayout
android:id="@+id/layoutPreview"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@color/BlancoApp"
android:orientation="vertical"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="5dp"
android:visibility="invisible">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.02"
android:text="Preview"
android:textAlignment="center"
android:textColor="@android:color/black" />
android:layout_marginTop="5dp">
<LinearLayout
android:id="@+id/LinearLayout"
android:id="@+id/layout_record"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingTop="5dp"
android:visibility="visible"
android:weightSum="1">
<pl.droidsonroids.gif.GifTextView
android:id="@+id/recordImage"
android:layout_width="14dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_weight="0.36"
android:background="@color/white" />
<TextView
android:id="@+id/tiempoActual"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:paddingLeft="5dp"
android:paddingRight="16dp"
android:text="00:00 | 00:10"
android:textColor="@color/VerdeApp" />
<com.yottacode.pictogram.tabletlibrary.gui.communicator.BotonCircular
android:id="@+id/reproducir"
android:layout_width="48dp"
android:layout_height="48dp"
android:id="@+id/botonGrabar"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_alignParentBottom="false"
android:layout_centerHorizontal="false"
android:background="#00ffffff"
android:src="@android:drawable/ic_media_play" />
android:clickable="true"
android:src="@drawable/micro" />
<LinearLayout
android:layout_width="wrap_content"
</LinearLayout>
<LinearLayout
android:id="@+id/layoutPreview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@color/BlancoApp"
android:orientation="vertical"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="5dp"
android:visibility="invisible">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.00"
android:orientation="vertical">
<SeekBar
android:id="@+id/barraReproducir"
style="@style/Widget.AppCompat.SeekBar"
android:layout_width="125dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tiempoTotal"
android:layout_width="match_parent"
android:layout_weight="0.02"
android:text="Preview"
android:textAlignment="center"
android:textColor="@android:color/black" />
<LinearLayout
android:id="@+id/LinearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="horizontal">
<com.yottacode.pictogram.tabletlibrary.gui.communicator.BotonCircular
android:id="@+id/reproducir"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentBottom="false"
android:layout_centerHorizontal="false"
android:background="#00ffffff"
android:src="@android:drawable/ic_media_play" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="top|center"
android:text="00:00 | 00:00"
android:textColor="@color/VerdeApp" />
android:layout_weight="0.00"
android:orientation="vertical">
<SeekBar
android:id="@+id/barraReproducir"
style="@style/Widget.AppCompat.SeekBar"
android:layout_width="125dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tiempoTotal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top|center"
android:text="00:00 | 00:00"
android:textColor="@color/VerdeApp" />
</LinearLayout>
<com.yottacode.pictogram.tabletlibrary.gui.communicator.BotonCircular
android:id="@+id/botonBorrar"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentBottom="false"
android:layout_centerHorizontal="false"
android:background="#00ffffff"
android:src="@android:drawable/ic_menu_delete" />
</LinearLayout>
<com.yottacode.pictogram.tabletlibrary.gui.communicator.BotonCircular
android:id="@+id/botonBorrar"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentBottom="false"
android:layout_centerHorizontal="false"
android:background="#00ffffff"
android:src="@android:drawable/ic_menu_delete" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
</FrameLayout>
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
......
......@@ -3,5 +3,6 @@
android:id="@+id/loginStudentGridView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#eeeeee"
android:numColumns="5"
android:stackFromBottom="false" />
......@@ -4,7 +4,8 @@
android:layout_height="match_parent">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@android:id/list" />
android:background="#eeeeee" />
</LinearLayout>
......@@ -6,7 +6,8 @@
android:layout_height="match_parent">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@android:id/list" />
android:background="#eeeeee" />
</LinearLayout>
......@@ -161,7 +161,7 @@ module.exports = {
student.supervision = 0; // requester is admin of the office
else if (stu_sup && !req.token.office)
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
else if (req.token.isStudent && req.token.id == student.id)
student.supervision = 3 // requester is the student himself
......
......@@ -41,7 +41,7 @@ function SignInCtrl($scope,
email: '',
logoUrl: ''
},
office_idx: -1
id_off: -1
};
};
......@@ -92,7 +92,12 @@ function SignInCtrl($scope,
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') });
return;
}
......@@ -112,10 +117,8 @@ function SignInCtrl($scope,
$scope.showdialog = true;
if ($scope.formdata.office_idx != -1) {
$scope.formdata.id_off = $scope.offices[$scope.formdata.office_idx].id;
delete $scope.formdata.office_idx;
}
if ($scope.formdata.id_off == -1)
delete $scope.formdata.id_off;
if ($scope.formdata.role === 'tutor_nooffice') {
$scope.formdata.office.name = 'no_office';
......
......@@ -223,9 +223,9 @@
<div class="form-group" id="office_selection">
<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 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>
</div>
......
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