Skip to content

Commit

Permalink
Merge pull request changeweb#189 from gerpollo2000/master
Browse files Browse the repository at this point in the history
Added translations for XLS massive import
  • Loading branch information
changeweb authored Aug 13, 2019
2 parents b0875d6 + f95ae02 commit 633f66c
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 49 deletions.
56 changes: 28 additions & 28 deletions app/Imports/FirstStudentSheetImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,50 +28,50 @@ public function onRow(Row $row)

$row = $row->toArray();

$this->class = (string) $row['class'];
$this->section = (string) $row['section'];
$this->class = (string) $row[__('class')];
$this->section = (string) $row[__('section')];

$user = [
'name' => $row['name'],
'email' => $row['email'],
'password' => Hash::make($row['password']),
'name' => $row[__('name')],
'email' => $row[__('email')],
'password' => Hash::make($row[__('password')]),
'active' => 1,
'role' => 'student',
'school_id' => auth()->user()->school_id,
'code' => auth()->user()->code,
'student_code' => auth()->user()->school_id.date('y').substr(number_format(time() * mt_rand(), 0, '', ''), 0, 5),
'address' => $row['address'],
'about' => $row['about'],
'address' => $row[__('address')],
'about' => $row[__('about')],
'pic_path' => '',
'phone_number' => $row['phone_number'],
'phone_number' => $row[__('phone_number')],
'verified' => 1,
'section_id' => $this->getSectionId(),
'blood_group' => $row['blood_group'],
'nationality' => $row['nationality'],
'gender' => $row['gender'],
'blood_group' => $row[__('blood_group')],
'nationality' => $row[__('nationality')],
'gender' => $row[__('gender')],
];

$tb = create(User::class, $user);

$student_info = [
'student_id' => $tb->id,
'session' => $row['session'] ?? now()->year,
'version' => $row['version'] ?? '',
'group' => $row['group'] ?? '',
'birthday' => $row['birthday']?? date('Y-m-d'),
'religion' => $row['religion'] ?? '',
'father_name' => $row['father_name'],
'father_phone_number' => $row['father_phone_number'] ?? '',
'father_national_id' => $row['father_national_id'] ?? '',
'father_occupation' => $row['father_occupation'] ?? '',
'father_designation' => $row['father_designation'] ?? '',
'father_annual_income' => $row['father_annual_income'] ?? '',
'mother_name' => $row['mother_name'],
'mother_phone_number' => $row['mother_phone_number'] ?? '',
'mother_national_id' => $row['mother_national_id'] ?? '',
'mother_occupation' => $row['mother_occupation'] ?? '',
'mother_designation' => $row['mother_designation'] ?? '',
'mother_annual_income' => $row['mother_annual_income'] ?? '',
'session' => $row[__('session')] ?? now()->year,
'version' => $row[__('version')] ?? '',
'group' => $row[__('group')] ?? '',
'birthday' => $row[__('birthday')]?? date('Y-m-d'),
'religion' => $row[__('religion')] ?? '',
'father_name' => $row[__('father_name')],
'father_phone_number' => $row[__('father_phone_number')] ?? '',
'father_national_id' => $row[__('father_national_id')] ?? '',
'father_occupation' => $row[__('father_occupation')] ?? '',
'father_designation' => $row[__('father_designation')] ?? '',
'father_annual_income' => $row[__('father_annual_income')] ?? '',
'mother_name' => $row[__('mother_name')],
'mother_phone_number' => $row[__('mother_phone_number')] ?? '',
'mother_national_id' => $row[__('mother_national_id')] ?? '',
'mother_occupation' => $row[__('mother_occupation')] ?? '',
'mother_designation' => $row[__('mother_designation')] ?? '',
'mother_annual_income' => $row[__('mother_annual_income')] ?? '',
'user_id' => auth()->user()->id,
];

Expand Down
24 changes: 12 additions & 12 deletions app/Imports/FirstTeacherSheetImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@ class FirstTeacherSheetImport implements ToModel, WithHeadingRow, WithBatchInser
*/
public function model(array $row)
{
$this->class = (string) $row['class'];
$this->section = (string) $row['section'];
$this->department = $row['department'];
$this->class = (string) $row[__('class')];
$this->section = (string) $row[__('section')];
$this->department = $row[__('department')];

return new User([
'name' => $row['name'],
'email' => $row['email'],
'password' => Hash::make($row['password']),
'name' => $row[__('name')],
'email' => $row[__('email')],
'password' => Hash::make($row[__('password')]),
'active' => 1,
'role' => 'teacher',
'school_id' => auth()->user()->school_id,
'code' => auth()->user()->code,
'student_code' => auth()->user()->school_id.date('y').substr(number_format(time() * mt_rand(), 0, '', ''), 0, 5),
'address' => $row['address'],
'about' => $row['about'],
'address' => $row[__('address')],
'about' => $row[__('about')],
'pic_path' => '',
'phone_number' => $row['phone_number'],
'phone_number' => $row[__('phone_number')],
'verified' => 1,
'section_id' => $this->getSectionId(),// For assigning as class teacher
'blood_group' => $row['blood_group'] ?? '',
'nationality' => $row['nationality'] ?? '',
'gender' => $row['gender'],
'blood_group' => $row[__('blood_group')] ?? '',
'nationality' => $row[__('nationality')] ?? '',
'gender' => $row[__('gender')],
'department_id' => $this->getDepartmentId(),
]);
}
Expand Down
37 changes: 31 additions & 6 deletions resources/lang/es-MX.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"About Book": "Acerca del libro",
"About School": "Acerca de la Escuela",
"About": "Detalles",
"about": "detalles",
"Absent": "Ausente",
"Academic Information": "Información academica",
"Academic Part": "Para el interesado",
Expand Down Expand Up @@ -44,6 +45,7 @@
"Add Teacher": "Agregar maestro",
"Add Users": "Agregar usuarios",
"Address": "Dirección",
"address": "direccion",
"Adjust Attendance of Student": "Ajustar asistencia de alumno",
"Adjust Missed Attendance": "Ajustar ausencia",
"Adjust Missing Attendances": "Ajustar ausencias",
Expand Down Expand Up @@ -91,7 +93,9 @@
"Bank Check": "Cuenta bancaria",
"Biology": "Biologia",
"Birthday": "Fecha de nacimiento",
"birthday": "fecha_nacimiento",
"Blood Group": "Grupo sanguineo",
"blood_group": "grupo_sanguineo",
"Blood": "Sangre",
"Board": "Tablero",
"Book Author": "Autor de libro",
Expand Down Expand Up @@ -142,6 +146,7 @@
"Class Test": "Pruebas de Sección",
"Class and Section": "Grupo y Sección",
"Class": "Sección",
"class": "seccion",
"Classes & Sections": "Grupos y Secciones",
"Classes": "Secciones",
"Click Class to View All Sections": "De click en Sección para ver todos los grupos",
Expand Down Expand Up @@ -181,6 +186,7 @@
"Deleted!": "Eliminado!",
"Department Name": "Nombre del Departamento",
"Department": "Departamento",
"department": "departamento",
"Description": "Descripción",
"Details": "Detalles",
"Documentation": "Documentación",
Expand Down Expand Up @@ -214,13 +220,19 @@
"Expense": "Gasto",
"Export in Excel by Year": "Exportar a Excel por año",
"Father Name": "Nombre del Padre",
"father_name": "nombre_padre",
"Father": "Padre",
"Father's Annual Income": "Ingreso anual del Padre",
"father_annual_income": "ingreso_padre",
"Father's Designation": "Nombramiento del Padre",
"father_designation": "nombramiento_padre",
"Father's Name": "Nombre del Padre",
"Father's National ID": "CURP del Padre",
"father_national_id": "curp_padre",
"Father's Occupation": "Ocupación del Padre",
"father_occupation": "ocupacion_padre",
"Father's Phone Number": "Telefono del Padre",
"father_phone_number": "telefono_padre",
"Fee Name": "Nombre del cargo",
"Fees Form": "Formulario de cargos",
"Fees Generator": "Generador de cargos",
Expand Down Expand Up @@ -250,6 +262,7 @@
"Full Name": "Nombre completo",
"GPA": "Promedio global",
"Gender": "Genero",
"gender": "genero",
"Generate Form": "Generar formulario",
"Get Expense List": "Obtener lista de gastos",
"Get Income List": "Obtener lista de ingresos",
Expand All @@ -266,6 +279,7 @@
"Grades": "Calificaciones",
"Group (Optional)": "Grupo (opcional)",
"Group": "Grupo",
"group": "salon",
"Hi": "Hola",
"Highest Marks": "Puntaje mas alto",
"Hindi": "Hindu",
Expand Down Expand Up @@ -337,18 +351,26 @@
"Missing": "Faltante",
"Money": "Dinero",
"Mother Name": "Nombre de la madre",
"mother_name": "nombre_madre",
"Mother": "Madre",
"Mother's Annual Income": "Ingreso anual de la madre",
"mother_annual_income": "ingreso_madre",
"Mother's Designation": "Nombramiento de la madre",
"mother_designation": "nombramiento_madre",
"Mother's Name": "Nombre de la madre",
"Mother's National ID": "CURP de la madre",
"mother_national_id": "madre_curp",
"Mother's Occupation": "Ocupación de la madre",
"mother_occupation": "ocupacion_madre",
"Mother's Phone Number": "Numero de telefono de la madre",
"mother_phone_number": "telefono_madre",
"My Attendance": "Mi asistencia",
"My Courses": "Mis asignaturas",
"My Grade": "Mi Calificación",
"Name": "Nombre",
"name": "nombre",
"Nationality": "Nacionalidad",
"nationality": "nacionalidad",
"New Password": "Nueva contraseña",
"New": "Nuevo",
"News": "Noticias",
Expand Down Expand Up @@ -379,6 +401,7 @@
"Parents/Guardian": "Padres/Tutor",
"Passing Year": "Año al que pasa",
"Password": "Contraseña",
"password": "contrasena",
"Passwords do not match.": "Las contraseñas no son iguales.",
"Pay Fee For": "Concepto de pago",
"Pay": "Pagar",
Expand All @@ -393,6 +416,7 @@
"Percentage": "Porcentaje",
"Personal details": "Detalles personales",
"Phone Number": "Telefono",
"phone_number": "telefono",
"Phone": "Telefono",
"Physics": "Fisica",
"Please ask site administrator to know your login access.": "Por favor consulte al administrador para obtener sus claves de acceso",
Expand Down Expand Up @@ -437,6 +461,7 @@
"Registered By": "Registrado por",
"Registration": "Registro",
"Religion": "Religion",
"religion": "religion",
"Remarks": "Observaciones",
"Remember Me": "Recuerdame",
"Remove": "Eliminar",
Expand Down Expand Up @@ -486,7 +511,8 @@
"Semester 1 Exam 2018, Final Exam 2019, ...": "Semestre 1 Periodo 2018, Periodo Final 2019, ...",
"Send Message": "Enviar mensaje",
"Send Password Reset Link": "Enviar liga para reestablecimiento de contraseña",
"Session": "Ingreso",
"Session": "F. Ingreso",
"session": "fecha_ingreso",
"Set Active": "Marcar como Activo",
"Signature": "Firma",
"Single Invoice": "Recibo sencillo",
Expand All @@ -506,6 +532,7 @@
"Student Name": "Nombre de alumno",
"Student Profile": "Perfil del alumno",
"Student": "Alumno",
"student": "alumno",
"Student's Name": "Nombre del alumno",
"Students are added successfully!": "Los estudiantes se agregaron exitosamente",
"Student_Code": "Matricula del alumno",
Expand Down Expand Up @@ -560,6 +587,7 @@
"Uploaded": "Cargado",
"Uploading": "Cargando",
"Version": "Idioma",
"version": "idioma",
"View Admins": "Ver administradores",
"View All Assigned Courses": "Ver todos las asignaturas asignadas",
"View All Students": "Ver todos los estudiantes",
Expand Down Expand Up @@ -593,7 +621,6 @@
"You can change your password once logged-in.": "Puede cambiar el password despues de iniciar sesion",
"Your login details are as follows:": "Sus credenciales para iniciar sesión son:",
"Your presence and cooperation will help us to improve the education system of our organization.": "Su presencia y cooperacion nos ayudaran a mejorar el sistema educativo de la institución",
"address": "Dirección",
"all books": "todos los libros",
"already assigned to Exam": "ya asignada al Periodo:",
"books": "libros",
Expand All @@ -602,7 +629,7 @@
"out of": "de",
"print": "imprimir",
"row No": "fila Num.",
"section": "Grupo",
"section": "grupo",
"uploaded": "Cargado",
"Academic Settings": "Configuración Académica",
"Please refresh and try again": "Recargue la pagina con F5 e intente de nuevo",
Expand All @@ -618,7 +645,5 @@
"Service Unavailable": "Servicio no disponible",
"Could not add course.": "No se pudo agregar asignatura",
"Could not save configuration.": "No se pudo guardar la configuración",
"English, Mathematics,...": "Unico",
"nationality": "nacionalidad"

"English, Mathematics,...": "Unico"
}
6 changes: 3 additions & 3 deletions resources/views/grade/teacher-grade.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
<br>
<div class="row" style="margin-bottom: 2%;">
<div class="col-md-10">
<b>Course - </b> <small>{{$grade->course->course_name}}</small>
<b>Class - </b> <small>{{$grade->course->section->class->class_number}}</small> <b>Section - </b> <small>{{$grade->course->section->section_number}}</small>
<b>Exam - </b> <small>{{$grade->exam->exam_name}}</small>
<b>@lang('Course') - </b> <small>{{$grade->course->course_name}}</small>
<b>@lang('Class') - </b> <small>{{$grade->course->section->class->class_number}}</small> <b>@lang('Section') - </b> <small>{{$grade->course->section->section_number}}</small>
<b>@lang('Exam') - </b> <small>{{$grade->exam->exam_name}}</small>
</div>
</div>
<div class="row">
Expand Down

0 comments on commit 633f66c

Please sign in to comment.