From e038fa4f34f6fce66d0b5f4728f90dcfc5e2148c Mon Sep 17 00:00:00 2001 From: Paolo Date: Tue, 31 Mar 2020 21:28:16 +0200 Subject: [PATCH 1/3] - system/messages/MessageClient->read now loads view system/messages/ajaxRead with $this->CLMessagesModel->prepareAjaxRead() as parameter - view system/messages/ajaxRead.php can hide the button to write new messages - Added new public method prepareAjaxRead to model CL/Messages_model --- .../system/messages/MessageClient.php | 2 +- application/models/CL/Messages_model.php | 17 +++++++++++++++++ application/views/system/messages/ajaxRead.php | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/application/controllers/system/messages/MessageClient.php b/application/controllers/system/messages/MessageClient.php index a0cc5c518..5adb49296 100644 --- a/application/controllers/system/messages/MessageClient.php +++ b/application/controllers/system/messages/MessageClient.php @@ -34,7 +34,7 @@ class MessageClient extends FHC_Controller public function read() { // Loads the view to read messages - $this->load->view('system/messages/ajaxRead'); + $this->load->view('system/messages/ajaxRead', $this->CLMessagesModel->prepareAjaxRead()); } /** diff --git a/application/models/CL/Messages_model.php b/application/models/CL/Messages_model.php index cbb42543f..dc4f4382c 100644 --- a/application/models/CL/Messages_model.php +++ b/application/models/CL/Messages_model.php @@ -91,6 +91,23 @@ class Messages_model extends CI_Model } } + /** + * Prepares data for the view system/messages/ajaxRead + */ + public function prepareAjaxRead() + { + $psResult = $this->PrestudentModel->loadWhere(array('person_id' => getAuthPersonId())); + + if (isError($psResult)) show_error('An error occurred while loading this page, please contact the site administrator'); + + if (hasData($psResult)) + { + return array('writeButton' => ''); + } + + return array('writeButton' => ''); + } + /** * Prepares data for the view system/messages/ajaxWrite */ diff --git a/application/views/system/messages/ajaxRead.php b/application/views/system/messages/ajaxRead.php index 1ed1b7f40..f7d60a68d 100644 --- a/application/views/system/messages/ajaxRead.php +++ b/application/views/system/messages/ajaxRead.php @@ -44,7 +44,7 @@ - + From 299f16dd8ca24141f335dde5bccc395b3c5022a8 Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 1 Apr 2020 18:27:10 +0200 Subject: [PATCH 2/3] - View system/messages/ajaxWrite added new button backButton - Added new function backToInOut to public/js/messaging/write.js - Assigned function backToInOut to backButton click event - Added new phrase backToReadWeiteMeassage to system/phrasesupdate.php --- .../views/system/messages/ajaxWrite.php | 6 ++++++ public/js/messaging/write.js | 12 +++++++++++ system/phrasesupdate.php | 21 +++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/application/views/system/messages/ajaxWrite.php b/application/views/system/messages/ajaxWrite.php index fe9b9e897..57d4c250e 100644 --- a/application/views/system/messages/ajaxWrite.php +++ b/application/views/system/messages/ajaxWrite.php @@ -85,6 +85,12 @@
+ + diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 22ce468b1..ca8f5df85 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -3618,8 +3618,8 @@ When on hold, the date is only a reminder.', 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Es existierte bereits ein Bewerberstatus und eine Reihungstestteilnahme. - Deshalb wurde bei der Freigabe der Bewerberstatus automatisch hinzugefügt und der Bewerber als Reihungstestabsolvent markiert. + 'text' => 'Es existierte bereits ein Bewerberstatus und eine Reihungstestteilnahme. + Deshalb wurde bei der Freigabe der Bewerberstatus automatisch hinzugefügt und der Bewerber als Reihungstestabsolvent markiert. Die Reihungstestpunkte müssen aber noch manuell eingetragen werden!', 'description' => '', 'insertvon' => 'system' @@ -4457,12 +4457,12 @@ When on hold, the date is only a reminder.', array( 'app' => 'core', 'category' => 'ui', - 'phrase' => 'backToReadWeiteMeassage', + 'phrase' => 'backToReadWriteMessage', 'insertvon' => 'system', 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Zurück zum Inbox/Outbox', + 'text' => 'Zurück zur Inbox/Outbox', 'description' => '', 'insertvon' => 'system' ),