Files
FHC-Core/application/controllers/system/FASMessages.php
T
Paolo f6e0f58b3d - Renamed view system/messages/messageSent.php to system/messages/htmlSuccess.php
- Added new view system/messages/htmlError.php
- Renamed view system/messages/messageWrite.php to system/messages/htmlWriteTemplate.php
- Added new widget views: widgets/Dropdown_widget.php and widgets/MultipleDropdown_widget.php
- Added new CSS public/css/Widgets.css
- Controller system/FASMessages:
	- Renamed method write to writeTemplate and method writeReply to writeReplyTemplate
	- Removed all the private methods and moved all the logic to model CL/Messages_model
	- Methods writeTemplate and writeReplyTemplate do not need anymore the sender id as parameter
- Controller system/Messages:
	- Renamed method write to writeTemplate
	- Renamed method send to sendImplicitTemplate
	- Renamed method sendJson to sendExplicitTemplateJson
	- Moved all the logic to model CL/Messages_model
- Adapted php and JS code to use these new methods names and interfaces
- Removed public method getIsAdmin from MessageLib
- Method _sendMessage of MessageLib now returns the saved message ids
- Added new package olifolkerd/tabulator to composer
- Added new parameter widgets to view templates/FHC-Header.php
- Added new HTML widget widgets/Dropdown_widget and widgets/MultipleDropdown_widget
- Added constants REPLY_SUBJECT_PREFIX and REPLY_BODY_PREFIX to model CL/Messages_model
- Added new public methods prepareHtmlWriteTemplatePersons, prepareHtmlWriteTemplatePrestudents, sendImplicitTemplate, sendExplicitTemplate, getVorlage, parseMessageText and getMessageFromIds to model CL/Messages_model
- Added new private methods _getAuthUser, _lowerReplaceSpaceArrayKeys, _addOeToPrestudents, _personLog and _prepareHtmlWriteTemplate to model CL/Messages_model
2019-06-18 18:25:26 +02:00

61 lines
1.4 KiB
PHP

<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
class FASMessages extends Auth_Controller
{
/**
*
*/
public function __construct()
{
parent::__construct(
array(
'writeTemplate' => 'basis/message:rw',
'writeReplyTemplate' => 'basis/message:rw'
)
);
// Loads model CLMessagesModel which contains the GUI logic
$this->load->model('CL/Messages_model', 'CLMessagesModel');
// Phrases used in loaded views
$this->loadPhrases(
array(
'global',
'ui'
)
);
}
/**
* Writes a new message to a prestudent using templates
*/
public function writeTemplate()
{
$prestudents = $this->input->post('prestudent_id'); // recipients prestudend_id(s)
// Loads the view to write a new message with a template
$this->load->view(
'system/messages/htmlWriteTemplate',
$this->CLMessagesModel->prepareHtmlWriteTemplatePrestudents($prestudents)
);
}
/**
* Writes a reply to a message identified by parameters $message_id and $recipient_id
* The recipient is a prestudent
* Uses templates
*/
public function writeReplyTemplate($message_id, $recipient_id)
{
$prestudents = $this->input->post('prestudent_id'); // recipients prestudend_id(s)
// Loads the view to write a new message with a template
$this->load->view(
'system/messages/htmlWriteTemplate',
$this->CLMessagesModel->prepareHtmlWriteTemplatePrestudents($prestudents, $message_id, $recipient_id)
);
}
}