From fbbbf7985c5c08e27c678bede0eebca8414c8d66 Mon Sep 17 00:00:00 2001 From: Daniel Barreto Date: Mon, 9 Feb 2015 19:04:51 -0500 Subject: [PATCH] Fix user pictures, boss accept mail response - refs BT#9092 --- plugin/advancedsubscription/ajax/advsub.ajax.php | 11 ++++++++++- .../src/AdvancedSubscriptionPlugin.class.php | 2 +- plugin/advancedsubscription/src/admin_view.php | 4 ++-- .../views/advsub_request_approve_confirmed.tpl | 7 ++++--- .../views/advsub_request_superior.tpl | 2 +- .../views/advsub_request_superior_reminder.tpl | 2 +- .../views/advsub_request_superior_reminder_max.tpl | 2 +- 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/plugin/advancedsubscription/ajax/advsub.ajax.php b/plugin/advancedsubscription/ajax/advsub.ajax.php index da82a3969b..e5343ab0ae 100644 --- a/plugin/advancedsubscription/ajax/advsub.ajax.php +++ b/plugin/advancedsubscription/ajax/advsub.ajax.php @@ -79,6 +79,8 @@ if (!empty($a) && !empty($u)) { $var = $extraSession->get_values_by_handler_and_field_variable($s, 'recommended_number_of_participants'); $sessionArray['recommended_number_of_participants'] = $var['field_valiue']; $studentArray = api_get_user_info($u); + $studentArray['picture'] = UserManager::get_user_picture_path_by_id($studentArray['user_id'], 'web', false, true); + $studentArray['picture'] = UserManager::get_picture_user($studentArray['user_id'], $studentArray['picture']['file'], 22, USER_IMAGE_SIZE_MEDIUM); $superiorId = UserManager::getStudentBoss($u); if (!empty($superiorId)) { $superiorArray = api_get_user_info($superiorId); @@ -187,7 +189,14 @@ if (!empty($a) && !empty($u)) { $var = $extraSession->get_values_by_handler_and_field_variable($s, 'recommended_number_of_participants'); $sessionArray['recommended_number_of_participants'] = $var['field_valiue']; $studentArray = api_get_user_info($u); - $superiorArray = api_get_user_info(UserManager::getStudentBoss($u)); + $studentArray['picture'] = UserManager::get_user_picture_path_by_id($studentArray['user_id'], 'web', false, true); + $studentArray['picture'] = UserManager::get_picture_user($studentArray['user_id'], $studentArray['picture']['file'], 22, USER_IMAGE_SIZE_MEDIUM); + $superiorId = UserManager::getStudentBoss($u); + if (!empty($superiorId)) { + $superiorArray = api_get_user_info($superiorId); + } else { + $superiorArray = null; + } $adminsArray = UserManager::get_all_administrators(); foreach ($adminsArray as &$admin) { $admin['complete_name'] = $admin['lastname'] . ', ' . $admin['firstname']; diff --git a/plugin/advancedsubscription/src/AdvancedSubscriptionPlugin.class.php b/plugin/advancedsubscription/src/AdvancedSubscriptionPlugin.class.php index b36f7dc4e0..ce5e2cea2e 100644 --- a/plugin/advancedsubscription/src/AdvancedSubscriptionPlugin.class.php +++ b/plugin/advancedsubscription/src/AdvancedSubscriptionPlugin.class.php @@ -407,7 +407,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface $data['u'], $data['superior']['user_id'], $this->get_lang('MailStudentRequest'), - $tpl->fetch('/advancedsubscription/views/advsub_request_approved_info_admin.tpl'), + $tpl->fetch('/advancedsubscription/views/advsub_request_approve_confirmed.tpl'), $data['s'] ); // Mail to admin diff --git a/plugin/advancedsubscription/src/admin_view.php b/plugin/advancedsubscription/src/admin_view.php index 8c7caaadab..2d22075640 100644 --- a/plugin/advancedsubscription/src/admin_view.php +++ b/plugin/advancedsubscription/src/admin_view.php @@ -85,8 +85,8 @@ if (!empty($s)) { $data['e'] = ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED; $student['dataDisapprove'] = $plugin->encrypt($data); $student['complete_name'] = $student['lastname'] . ', ' . $student['firstname']; - $student['picture'] = UserManager::get_user_picture_path_by_id($user[0], 'web', false, true); - $student['picture'] = UserManager::get_picture_user($user[0], $student['picture']['file'], 22, USER_IMAGE_SIZE_MEDIUM); + $student['picture'] = UserManager::get_user_picture_path_by_id($student['user_id'], 'web', false, true); + $student['picture'] = UserManager::get_picture_user($student['user_id'], $student['picture']['file'], 22, USER_IMAGE_SIZE_MEDIUM); } $tpl->assign('session', $studentList['session']); $tpl->assign('students', $studentList['students']); diff --git a/plugin/advancedsubscription/views/advsub_request_approve_confirmed.tpl b/plugin/advancedsubscription/views/advsub_request_approve_confirmed.tpl index 11404d2067..db9323e154 100644 --- a/plugin/advancedsubscription/views/advsub_request_approve_confirmed.tpl +++ b/plugin/advancedsubscription/views/advsub_request_approve_confirmed.tpl @@ -59,9 +59,10 @@  

Estimado:

-

{{ student.complete_name }}

-

Lamentamos informarle que, en esta oportunidad, su inscripción al curso {{ session.name }} NO ha sido aprobada. Esperamos mantenga todo su ánimo y participe en otro curso o, en otra oportunidad, a este mismo curso.

-

Gracias.

+

{{ superior.complete_name }}

+

Hemos recibido y registrado su decisión de aprobar el curso {{ session.name }} para su colaborador {{ student.complete_name }}

+

Ahora la inscripción al curso está pendiente de la disponibilidad de cupos. Le mantendremos informado sobre el resultado de esta etapa

+

Gracias por su colaboración.

{{ signature }}

  diff --git a/plugin/advancedsubscription/views/advsub_request_superior.tpl b/plugin/advancedsubscription/views/advsub_request_superior.tpl index 8cb058c4cf..aeb0d11f6c 100644 --- a/plugin/advancedsubscription/views/advsub_request_superior.tpl +++ b/plugin/advancedsubscription/views/advsub_request_superior.tpl @@ -64,7 +64,7 @@

Le invitamos a aprobar o desarprobar esta inscripción, dando clic en el botón correspondiente a continuación.

- + diff --git a/plugin/advancedsubscription/views/advsub_request_superior_reminder.tpl b/plugin/advancedsubscription/views/advsub_request_superior_reminder.tpl index bc6b7898ce..43a4c803ff 100644 --- a/plugin/advancedsubscription/views/advsub_request_superior_reminder.tpl +++ b/plugin/advancedsubscription/views/advsub_request_superior_reminder.tpl @@ -65,7 +65,7 @@

{{ student.complete_name }}

{% for student in students %} - + diff --git a/plugin/advancedsubscription/views/advsub_request_superior_reminder_max.tpl b/plugin/advancedsubscription/views/advsub_request_superior_reminder_max.tpl index e474d8b52c..d9a2c38a4c 100644 --- a/plugin/advancedsubscription/views/advsub_request_superior_reminder_max.tpl +++ b/plugin/advancedsubscription/views/advsub_request_superior_reminder_max.tpl @@ -65,7 +65,7 @@

{{ student.complete_name }}

{% for student in students %} - +

{{ student.complete_name }}