mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 01:12:17 +00:00
- 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
This commit is contained in:
@@ -11,17 +11,15 @@ class FASMessages extends Auth_Controller
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'write' => 'basis/message:rw',
|
||||
'writeReply' => 'basis/message:rw'
|
||||
'writeTemplate' => 'basis/message:rw',
|
||||
'writeReplyTemplate' => 'basis/message:rw'
|
||||
)
|
||||
);
|
||||
|
||||
// Loads the message library
|
||||
$this->load->library('MessageLib');
|
||||
|
||||
// Loads the widget library
|
||||
$this->load->library('WidgetLib');
|
||||
// Loads model CLMessagesModel which contains the GUI logic
|
||||
$this->load->model('CL/Messages_model', 'CLMessagesModel');
|
||||
|
||||
// Phrases used in loaded views
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
@@ -30,162 +28,33 @@ class FASMessages extends Auth_Controller
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Write a new message
|
||||
* Writes a new message to a prestudent using templates
|
||||
*/
|
||||
public function write($sender_id)
|
||||
public function writeTemplate()
|
||||
{
|
||||
$prestudent_id = $this->input->post('prestudent_id'); // recipients prestudend_id(s)
|
||||
$prestudents = $this->input->post('prestudent_id'); // recipients prestudend_id(s)
|
||||
|
||||
if (!is_numeric($sender_id))
|
||||
{
|
||||
show_error('The current logged user person_id is not defined');
|
||||
}
|
||||
|
||||
$msgVarsData = $this->_getMsgVarsData($prestudent_id);
|
||||
|
||||
// Retrieves message vars for a person from view view vw_msg_vars_person
|
||||
$variablesArray = $this->_getMessageVarsPerson();
|
||||
|
||||
// Organisation units used to get the templates
|
||||
$oe_kurzbz = $this->_getOeKurzbz($sender_id);
|
||||
|
||||
// Admin or commoner?
|
||||
$isAdmin = $this->_getIsAdmin($sender_id);
|
||||
|
||||
$data = array(
|
||||
'recipients' => getData($msgVarsData),
|
||||
'variables' => $variablesArray,
|
||||
'oe_kurzbz' => $oe_kurzbz, // used to get the templates
|
||||
'isAdmin' => $isAdmin
|
||||
);
|
||||
|
||||
$this->load->view('system/messages/messageWrite', $data);
|
||||
// Loads the view to write a new message with a template
|
||||
$this->load->view(
|
||||
'system/messages/htmlWriteTemplate',
|
||||
$this->CLMessagesModel->prepareHtmlWriteTemplatePrestudents($prestudents)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a reply
|
||||
* Writes a reply to a message identified by parameters $message_id and $recipient_id
|
||||
* The recipient is a prestudent
|
||||
* Uses templates
|
||||
*/
|
||||
public function writeReply($sender_id, $msg_id, $receiver_id)
|
||||
public function writeReplyTemplate($message_id, $recipient_id)
|
||||
{
|
||||
$prestudent_id = $this->input->post('prestudent_id'); // recipients prestudend_id(s)
|
||||
$prestudents = $this->input->post('prestudent_id'); // recipients prestudend_id(s)
|
||||
|
||||
if (!is_numeric($sender_id))
|
||||
{
|
||||
show_error('The current logged user person_id is not defined');
|
||||
}
|
||||
|
||||
if (!is_numeric($msg_id))
|
||||
{
|
||||
show_error('The msg_id must be a number');
|
||||
}
|
||||
|
||||
if (!is_numeric($receiver_id))
|
||||
{
|
||||
show_error('The receiver_id must be a number');
|
||||
}
|
||||
|
||||
$msg = $this->_getMessage($msg_id, $receiver_id);
|
||||
|
||||
$msgVarsData = $this->_getMsgVarsData($prestudent_id);
|
||||
|
||||
// Retrieves message vars for a person from view view vw_msg_vars_person
|
||||
$variablesArray = $this->_getMessageVarsPerson();
|
||||
|
||||
// Organisation units used to get the templates
|
||||
$oe_kurzbz = $this->_getOeKurzbz($sender_id);
|
||||
|
||||
// Admin or commoner?
|
||||
$isAdmin = $this->_getIsAdmin($sender_id);
|
||||
|
||||
$data = array(
|
||||
'recipients' => getData($msgVarsData),
|
||||
'message' => $msg,
|
||||
'variables' => $variablesArray,
|
||||
'oe_kurzbz' => $oe_kurzbz, // used to get the templates
|
||||
'isAdmin' => $isAdmin
|
||||
);
|
||||
|
||||
$this->load->view('system/messages/messageWrite', $data);
|
||||
// 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)
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _getMessage($msg_id, $receiver_id)
|
||||
{
|
||||
$msg = $this->messagelib->getMessage($msg_id, $receiver_id);
|
||||
if (isError($msg))
|
||||
{
|
||||
show_error(getData($msg));
|
||||
}
|
||||
elseif (!hasData($msg))
|
||||
{
|
||||
show_error('The selected message does not exist');
|
||||
}
|
||||
else
|
||||
{
|
||||
$msg = getData($msg)[0];
|
||||
}
|
||||
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves message vars from view vw_msg_vars
|
||||
*/
|
||||
private function _getMsgVarsData($prestudent_id)
|
||||
{
|
||||
$this->load->model('system/Message_model', 'MessageModel');
|
||||
$msgVarsData = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudent_id);
|
||||
|
||||
if (isError($msgVarsData))
|
||||
{
|
||||
show_error(getData($msgVarsData));
|
||||
}
|
||||
|
||||
return $msgVarsData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper method to call messagelib->getMessageVarsPerson
|
||||
*/
|
||||
private function _getMessageVarsPerson()
|
||||
{
|
||||
$variables = $this->messagelib->getMessageVarsPerson();
|
||||
|
||||
if (isError($variables)) show_error(getData($variables));
|
||||
|
||||
return getData($variables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper method to call messagelib->getOeKurzbz
|
||||
*/
|
||||
private function _getOeKurzbz($sender_id)
|
||||
{
|
||||
$oe_kurzbz = $this->messagelib->getOeKurzbz($sender_id);
|
||||
|
||||
if (isError($oe_kurzbz)) show_error(getData($oe_kurzbz));
|
||||
|
||||
return getData($oe_kurzbz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper method to call messagelib->getIsAdmin
|
||||
*/
|
||||
private function _getIsAdmin($sender_id)
|
||||
{
|
||||
$isAdmin = $this->messagelib->getIsAdmin($sender_id);
|
||||
|
||||
if (isError($isAdmin)) show_error(getData($isAdmin));
|
||||
|
||||
return getData($isAdmin);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,28 +4,23 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Messages extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* MessageLib is loaded by CLMessagesModel
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'write' => array('basis/message:rw', 'infocenter:rw'),
|
||||
'send' => array('basis/message:rw', 'infocenter:rw'),
|
||||
'sendJson' => array('basis/message:rw', 'infocenter:rw'),
|
||||
'writeTemplate' => array('basis/message:rw', 'infocenter:rw'),
|
||||
'sendImplicitTemplate' => array('basis/message:rw', 'infocenter:rw'),
|
||||
'sendExplicitTemplateJson' => array('basis/message:rw', 'infocenter:rw'),
|
||||
'getVorlage' => array('basis/message:r', 'infocenter:r'),
|
||||
'parseMessageText' => array('basis/message:r', 'infocenter:r'),
|
||||
'getMessageFromIds' => array('basis/message:r', 'infocenter:r')
|
||||
)
|
||||
);
|
||||
|
||||
// Loads the widget library
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
$this->load->model('system/Message_model', 'MessageModel');
|
||||
// Loads model CLMessagesModel which contains the GUI logic
|
||||
$this->load->model('CL/Messages_model', 'CLMessagesModel');
|
||||
|
||||
// Phrases used in loaded views
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
@@ -38,65 +33,45 @@ class Messages extends Auth_Controller
|
||||
// Public methods - HTML output
|
||||
|
||||
/**
|
||||
* Initialize all the parameters used by view system/messages/messageWrite
|
||||
* to build a GUI used to write a messate to user/s
|
||||
* Initialize all the parameters used by view system/messages/htmlWriteTemplate
|
||||
* to build a GUI used to write a messate to user/s using a template
|
||||
*/
|
||||
public function write()
|
||||
public function writeTemplate()
|
||||
{
|
||||
$persons = $this->input->post('person_id');
|
||||
|
||||
$authUser = $this->CLMessagesModel->getAuthUser();
|
||||
if (isError($authUser)) show_error(getData($authUser));
|
||||
|
||||
$sender_id = getData($authUser)[0]->person_id;
|
||||
|
||||
// Retrieves person information
|
||||
$msgVarsData = $this->MessageModel->getMsgVarsDataByPersonId($persons);
|
||||
if (isError($msgVarsData)) show_error(getData($msgVarsData));
|
||||
|
||||
// Retrieves message vars from view vw_msg_vars_person
|
||||
$variables = $this->messagelib->getMessageVarsPerson();
|
||||
if (isError($variables)) show_error(getData($variables));
|
||||
|
||||
// Organisation units used to get the templates
|
||||
$oe_kurzbz = $this->messagelib->getOeKurzbz($sender_id);
|
||||
if (isError($oe_kurzbz)) show_error(getData($oe_kurzbz));
|
||||
|
||||
// Admin or commoner?
|
||||
$isAdmin = $this->messagelib->getIsAdmin($sender_id);
|
||||
if (isError($isAdmin)) show_error(getData($isAdmin));
|
||||
|
||||
// Loads the view to write a new message with a template
|
||||
$this->load->view(
|
||||
'system/messages/messageWrite',
|
||||
array (
|
||||
'recipients' => getData($msgVarsData), // recipients data
|
||||
'variables' => getData($variables), // message vars
|
||||
'oe_kurzbz' => getData($oe_kurzbz), // used to get the templates
|
||||
'isAdmin' => getData($isAdmin) // is admin?
|
||||
)
|
||||
'system/messages/htmlWriteTemplate',
|
||||
$this->CLMessagesModel->prepareHtmlWriteTemplatePersons($persons)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a new message or reply to user/s
|
||||
* If a relationmessage_id this message is a reply to another one
|
||||
* Body is a template and will be parsed using information present in persons parameter
|
||||
*/
|
||||
public function send()
|
||||
public function sendImplicitTemplate()
|
||||
{
|
||||
$subject = $this->input->post('subject');
|
||||
$body = $this->input->post('body');
|
||||
$persons = $this->input->post('persons');
|
||||
$relationmessage_id = $this->input->post('relationmessage_id');
|
||||
|
||||
// Retrieves message vars data for the fiven user/s
|
||||
$msgVarsData = $this->MessageModel->getMsgVarsDataByPersonId($persons);
|
||||
|
||||
// Send the message
|
||||
$send = $this->CLMessagesModel->send($msgVarsData, $relationmessage_id);
|
||||
|
||||
$this->load->view('system/messages/messageSent', array('success' => isSuccess($send)));
|
||||
$sendImplicitTemplate = $this->CLMessagesModel->sendImplicitTemplate($persons, $subject, $body, $relationmessage_id);
|
||||
if (isSuccess($sendImplicitTemplate))
|
||||
{
|
||||
$this->load->view('system/messages/htmlSuccess');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->view('system/messages/htmlError');
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods - JSON output - called by this controller and FASMessages (view system/messages/messageWrite)
|
||||
// Public methods - JSON output - called by this controller and FASMessages (view system/messages/htmlWriteTemplate)
|
||||
|
||||
/**
|
||||
* Returns an object that represent a template store in database
|
||||
@@ -106,24 +81,8 @@ class Messages extends Auth_Controller
|
||||
public function getVorlage()
|
||||
{
|
||||
$vorlage_kurzbz = $this->input->get('vorlage_kurzbz');
|
||||
$result = error('The given vorlage_kurzbz is not valid');
|
||||
|
||||
if (!isEmptyString($vorlage_kurzbz))
|
||||
{
|
||||
$this->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel');
|
||||
$this->VorlagestudiengangModel->addOrder('version','DESC');
|
||||
|
||||
$result = $this->VorlagestudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz));
|
||||
}
|
||||
|
||||
if (isError($result) || !hasData($result))
|
||||
{
|
||||
$this->outputJsonError(getData($result));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
$this->outputJson($this->CLMessagesModel->getVorlage($vorlage_kurzbz));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,26 +93,8 @@ class Messages extends Auth_Controller
|
||||
{
|
||||
$person_id = $this->input->get('person_id');
|
||||
$text = $this->input->get('text');
|
||||
$msgVarsData = error('The given person_id is not a valid number');
|
||||
|
||||
if (is_numeric($person_id))
|
||||
{
|
||||
$msgVarsData = $this->MessageModel->getMsgVarsDataByPersonId($person_id);
|
||||
}
|
||||
|
||||
if (isError($msgVarsData) || !hasData($msgVarsData))
|
||||
{
|
||||
$this->outputJsonError(getData($msgVarsData));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonSuccess(
|
||||
parseText(
|
||||
$text,
|
||||
$this->CLMessagesModel->replaceKeys((array)getData($msgVarsData)[0])
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->outputJson($this->CLMessagesModel->parseMessageText($person_id, $text));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
@@ -164,19 +105,10 @@ class Messages extends Auth_Controller
|
||||
*/
|
||||
public function getMessageFromIds()
|
||||
{
|
||||
$msg_id = $this->input->get('msg_id');
|
||||
$message_id = $this->input->get('msg_id');
|
||||
$receiver_id = $this->input->get('receiver_id');
|
||||
|
||||
$msg = $this->messagelib->getMessage($msg_id, $receiver_id);
|
||||
|
||||
if (isError($msg) || !hasData($msg))
|
||||
{
|
||||
$this->outputJson(array());
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJson(array(getData($msg)[0]));
|
||||
}
|
||||
$this->outputJson($this->CLMessagesModel->getMessageFromIds($message_id, $receiver_id));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,27 +116,16 @@ class Messages extends Auth_Controller
|
||||
* - The recipients are prestudents
|
||||
* - An email template with message var may be provided
|
||||
* - A global organisation unit may be provided, otherwise is used the prestudent one
|
||||
* - A template is explicitly specified
|
||||
*/
|
||||
public function sendJson()
|
||||
public function sendExplicitTemplateJson()
|
||||
{
|
||||
$prestudents = $this->input->post('prestudents');
|
||||
$vorlage_kurzbz = $this->input->post('vorlage_kurzbz');
|
||||
$oe_kurzbz = $this->input->post('oe_kurzbz');
|
||||
$vorlage_kurzbz = $this->input->post('vorlage_kurzbz');
|
||||
$msgVars = $this->input->post('msgvars');
|
||||
|
||||
$msgVarsData = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudents);
|
||||
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$prestudentsData = $this->PrestudentModel->getOrganisationunits($prestudents);
|
||||
|
||||
// Adds the organisation unit to each prestudent
|
||||
if (isEmptyString($oe_kurzbz) && hasData($msgVarsData) && hasData($prestudentsData))
|
||||
{
|
||||
$this->CLMessagesModel->addOeToPrestudents($msgVarsData, $prestudentsData);
|
||||
}
|
||||
|
||||
$send = $this->CLMessagesModel->send($msgVarsData, null, $oe_kurzbz, $vorlage_kurzbz, $msgVars);
|
||||
|
||||
$this->outputJson(getData($send));
|
||||
$sendExplicitTemplate = $this->CLMessagesModel->sendExplicitTemplate($prestudents, $oe_kurzbz, $vorlage_kurzbz, $msgVars);
|
||||
$this->outputJson(getData($sendExplicitTemplate));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@ class MessageLib
|
||||
|
||||
// Loads extra models
|
||||
$this->_ci->load->model('person/Person_model', 'PersonModel');
|
||||
$this->_ci->load->model('system/Benutzerrolle_model', 'BenutzerrolleModel');
|
||||
$this->_ci->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
$this->_ci->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
}
|
||||
@@ -208,14 +207,6 @@ class MessageLib
|
||||
return $benutzer; // otherwise returns the error
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin or commoner?
|
||||
*/
|
||||
public function getIsAdmin($sender_id)
|
||||
{
|
||||
return $this->_ci->BenutzerrolleModel->isAdminByPersonId($sender_id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods used by REST API
|
||||
|
||||
@@ -629,6 +620,7 @@ class MessageLib
|
||||
|
||||
/**
|
||||
* Sends new message core method, may be wrapped by other methods.
|
||||
* If success then returns an array of successfully saved message ids
|
||||
*/
|
||||
private function _sendMessage(
|
||||
$receivers, $receiversOU, $subject, $body, $sender_id, $senderOU, $relationmessage_id, $priority, $multiPartMime
|
||||
@@ -658,11 +650,7 @@ class MessageLib
|
||||
);
|
||||
if (isSuccess($saveMessageResult)) // If successfully saved
|
||||
{
|
||||
// If the system is configured to send messages immediately
|
||||
if ($this->_ci->config->item(self::CFG_SEND_IMMEDIATELY) === true)
|
||||
{
|
||||
$savedMessages[] = getData($saveMessageResult); // store the message id of the saved message
|
||||
}
|
||||
$savedMessages[] = getData($saveMessageResult); // store the message id of the saved message
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -683,7 +671,7 @@ class MessageLib
|
||||
}
|
||||
}
|
||||
|
||||
return success('Message sent successfully');
|
||||
return success($savedMessages);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Messages GUI logic
|
||||
* This model extends CI_Model because here is just implemented logic
|
||||
* It does not represent a resource (ex. like models that extend DB_Model)
|
||||
*/
|
||||
class Messages_model extends CI_Model
|
||||
{
|
||||
const REPLY_SUBJECT_PREFIX = 'Re: ';
|
||||
const REPLY_BODY_PREFIX = '<br><br>-------------------------------------------------------------------------------';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -14,102 +18,143 @@ class Messages_model extends CI_Model
|
||||
parent::__construct();
|
||||
|
||||
// Loads the message library
|
||||
$this->load->library('MessageLib');
|
||||
|
||||
$this->load->library('MessageLib'); // MessageModel loaded here!
|
||||
// Loads the person log library
|
||||
$this->load->library('PersonLogLib');
|
||||
// Loads the widget library
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
// Loads model MessageToken_model
|
||||
$this->load->model('system/MessageToken_model', 'MessageTokenModel');
|
||||
|
||||
// Loads model Benutzerrolle_model
|
||||
$this->load->model('system/Benutzerrolle_model', 'BenutzerrolleModel');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Prepares data for the view system/messages/htmlWriteTemplate using person ids as main parameter
|
||||
* Wrap method to _prepareHtmlWriteTemplate
|
||||
*/
|
||||
public function prepareHtmlWriteTemplatePersons($persons, $message_id = null, $recipient_id = null)
|
||||
{
|
||||
// Retrieves persons information
|
||||
$msgVarsData = $this->MessageModel->getMsgVarsDataByPersonId($persons);
|
||||
|
||||
return $this->_prepareHtmlWriteTemplate($msgVarsData, $message_id, $recipient_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes message sending
|
||||
* @param $sender_id
|
||||
* @return array wether execution was successfull - error or success
|
||||
* Prepares data for the view system/messages/htmlWriteTemplate using prestudent ids as main parameter
|
||||
* Wrap method to _prepareHtmlWriteTemplate
|
||||
*/
|
||||
public function send($msgVarsData, $relationmessage_id = null, $oe_kurzbz = null, $vorlage_kurzbz = null, $msgVars = null)
|
||||
public function prepareHtmlWriteTemplatePrestudents($prestudents, $message_id = null, $recipient_id = null)
|
||||
{
|
||||
$subject = $this->input->post('subject');
|
||||
$body = $this->input->post('body');
|
||||
// Retrieves prestudents information
|
||||
$msgVarsData = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudents);
|
||||
|
||||
$authUser = $this->getAuthUser();
|
||||
return $this->_prepareHtmlWriteTemplate($msgVarsData, $message_id, $recipient_id);
|
||||
}
|
||||
|
||||
if (isError($authUser)) return $authUser;
|
||||
/**
|
||||
* Sends a new message or a reply to a message (if $relationmessage_id is given)
|
||||
* using the template stored in the subject and body
|
||||
*/
|
||||
public function sendImplicitTemplate($persons, $subject, $body, $relationmessage_id = null)
|
||||
{
|
||||
// Retrieves the sender id
|
||||
$authUser = $this->_getAuthUser();
|
||||
if (isError($authUser)) show_error(getData($authUser));
|
||||
if (!hasData($authUser)) show_error('The current logged user person_id is not defined');
|
||||
|
||||
$sender_id = getData($authUser)[0]->person_id;
|
||||
|
||||
// Retrieves message vars data for the given user/s
|
||||
$msgVarsData = $this->MessageModel->getMsgVarsDataByPersonId($persons);
|
||||
if (isError($msgVarsData)) show_error(getData($msgVarsData));
|
||||
if (!hasData($msgVarsData)) show_error('No recipients were given');
|
||||
|
||||
// Send message(s)
|
||||
if (hasData($msgVarsData))
|
||||
foreach (getData($msgVarsData) as $receiver)
|
||||
{
|
||||
for ($i = 0; $i < count(getData($msgVarsData)); $i++)
|
||||
{
|
||||
$parsedText = '';
|
||||
$msgVarsDataArray = $this->replaceKeys((array)getData($msgVarsData)[$i]); // replaces array keys
|
||||
$msgVarsDataArray = $this->_lowerReplaceSpaceArrayKeys((array)$receiver); // replaces array keys
|
||||
|
||||
// Send without vorlage
|
||||
if (isEmptyString($vorlage_kurzbz))
|
||||
{
|
||||
$parsedText = parseText($body, $msgVarsDataArray);
|
||||
$parsedSubject = parseText($subject, $msgVarsDataArray);
|
||||
$parsedBody = parseText($body, $msgVarsDataArray);
|
||||
|
||||
$msg = $this->messagelib->sendMessageUser(
|
||||
$msgVarsDataArray['person_id'], // receiverPersonId
|
||||
$subject, // subject
|
||||
$parsedText, // body
|
||||
$sender_id, // sender_id
|
||||
$oe_kurzbz, // senderOU
|
||||
$relationmessage_id, // relationmessage_id
|
||||
MSG_PRIORITY_NORMAL // priority
|
||||
);
|
||||
}
|
||||
// Send with vorlage
|
||||
else
|
||||
{
|
||||
if (is_array($msgVars))
|
||||
{
|
||||
// Additional message variables
|
||||
foreach ($msgVars as $key => $msgvar)
|
||||
{
|
||||
$msgVarsDataArray[$key] = $msgvar;
|
||||
}
|
||||
}
|
||||
$message = $this->messagelib->sendMessageUser(
|
||||
$msgVarsDataArray['person_id'], // receiverPersonId
|
||||
$parsedSubject, // subject
|
||||
$parsedBody, // body
|
||||
$sender_id, // sender_id
|
||||
null, // senderOU
|
||||
$relationmessage_id, // relationmessage_id
|
||||
MSG_PRIORITY_NORMAL // priority
|
||||
);
|
||||
|
||||
$msg = $this->messagelib->sendMessageUserTemplate(
|
||||
$msgVarsDataArray['person_id'], // receiversPersonId
|
||||
$vorlage_kurzbz, // vorlage
|
||||
$msgVarsDataArray, // parseData
|
||||
null, // orgform
|
||||
$sender_id, // sender_id
|
||||
$oe_kurzbz // senderOU
|
||||
);
|
||||
}
|
||||
if (isError($message)) return $message;
|
||||
if (!hasData($message)) return error('No messages were saved in database');
|
||||
|
||||
if (isError($msg)) return $msg;
|
||||
|
||||
// Write log entry
|
||||
$personLog = $this->personloglib->log(
|
||||
$msgVarsDataArray['person_id'],
|
||||
'Action',
|
||||
array(
|
||||
'name' => 'Message sent',
|
||||
'message' => 'Message sent from person '.$sender_id.' to '.$msgVarsDataArray['person_id'].', messageid '.getData($msg),
|
||||
'success' => 'true'
|
||||
),
|
||||
'kommunikation',
|
||||
'core',
|
||||
null,
|
||||
getAuthUID()
|
||||
);
|
||||
|
||||
if (isError($personLog)) return $personLog;
|
||||
}
|
||||
|
||||
return success('Messages sent successfully');
|
||||
// Write log entry
|
||||
$personLog = $this->_personLog($sender_id, $msgVarsDataArray['person_id'], getData($message)[0]);
|
||||
if (isError($personLog)) return $personLog;
|
||||
}
|
||||
else
|
||||
|
||||
return success('Messages sent successfully');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a new message using the given template and information present in parameter prestudents
|
||||
* Extra variables can be added using parameter $msgVars
|
||||
*/
|
||||
public function sendExplicitTemplate($prestudents, $oe_kurzbz, $vorlage_kurzbz, $msgVars)
|
||||
{
|
||||
// Retrieves the sender id
|
||||
$authUser = $this->_getAuthUser();
|
||||
if (isError($authUser)) show_error(getData($authUser));
|
||||
if (!hasData($authUser)) show_error('The current logged user person_id is not defined');
|
||||
|
||||
$sender_id = getData($authUser)[0]->person_id;
|
||||
|
||||
// Retrieves message vars data for the given user/s
|
||||
$msgVarsData = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudents);
|
||||
if (isError($msgVarsData)) show_error(getData($msgVarsData));
|
||||
if (!hasData($msgVarsData)) show_error('No recipients were given');
|
||||
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$prestudentsData = $this->PrestudentModel->getOrganisationunits($prestudents);
|
||||
|
||||
// Adds the organisation unit to each prestudent
|
||||
if (isEmptyString($oe_kurzbz) && hasData($msgVarsData) && hasData($prestudentsData))
|
||||
{
|
||||
return $msgVarsData;
|
||||
$this->CLMessagesModel->_addOeToPrestudents($msgVarsData, $prestudentsData);
|
||||
}
|
||||
|
||||
foreach (getData($msgVarsData) as $receiver)
|
||||
{
|
||||
$msgVarsDataArray = $this->_lowerReplaceSpaceArrayKeys((array)$receiver); // replaces array keys
|
||||
|
||||
// Additional message variables
|
||||
if (is_array($msgVars)) $msgVarsDataArray = array_merge($msgVarsDataArray, $msgVars);
|
||||
|
||||
$message = $this->messagelib->sendMessageUserTemplate(
|
||||
$msgVarsDataArray['person_id'], // receiversPersonId
|
||||
$vorlage_kurzbz, // vorlage
|
||||
$msgVarsDataArray, // parseData
|
||||
null, // orgform
|
||||
$sender_id, // sender_id
|
||||
$oe_kurzbz // senderOU
|
||||
);
|
||||
|
||||
if (isError($message)) return $message;
|
||||
|
||||
// Write log entry
|
||||
$personLog = $this->_personLog($sender_id, $msgVarsDataArray['person_id'], getData($message)[0]);
|
||||
if (isError($personLog)) return $personLog;
|
||||
}
|
||||
|
||||
return success('Messages sent successfully');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,29 +216,98 @@ class Messages_model extends CI_Model
|
||||
return success('Reply sent');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getAuthUser()
|
||||
{
|
||||
$sender_id = null;
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods called by controller system/Messages
|
||||
|
||||
/**
|
||||
* Returns an object that represent a template store in database
|
||||
* If no templates are found with the given parameter or the given parameter is an empty string,
|
||||
* then an error is returned
|
||||
*/
|
||||
public function getVorlage($vorlage_kurzbz)
|
||||
{
|
||||
$getVorlage = error('The given vorlage_kurzbz is not valid');
|
||||
|
||||
if (!isEmptyString($vorlage_kurzbz))
|
||||
{
|
||||
$this->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel');
|
||||
$this->VorlagestudiengangModel->addOrder('version','DESC');
|
||||
|
||||
$getVorlage = $this->VorlagestudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz));
|
||||
}
|
||||
|
||||
return $getVorlage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the given given text using data from the given user
|
||||
* Use the CI parser which performs simple text substitution for pseudo-variable
|
||||
*/
|
||||
public function parseMessageText($person_id, $text)
|
||||
{
|
||||
$parseMessageText = error('The given person_id is not a valid number');
|
||||
|
||||
if (is_numeric($person_id))
|
||||
{
|
||||
$parseMessageText = $this->MessageModel->getMsgVarsDataByPersonId($person_id);
|
||||
}
|
||||
|
||||
if (hasData($parseMessageText))
|
||||
{
|
||||
$parseMessageText = success(
|
||||
parseText(
|
||||
$text,
|
||||
$this->_lowerReplaceSpaceArrayKeys((array)getData($parseMessageText)[0])
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $parseMessageText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs message data for a message (identified my msg id and receiver id) in JSON format
|
||||
*/
|
||||
public function getMessageFromIds($message_id, $receiver_id)
|
||||
{
|
||||
$getMessageFromIds = error('The given message id or receiver id are not valid');
|
||||
|
||||
if (is_numeric($message_id) && is_numeric($receiver_id))
|
||||
{
|
||||
$getMessageFromIds = $this->messagelib->getMessage($message_id, $receiver_id);
|
||||
}
|
||||
|
||||
if (isError($getMessageFromIds) || !hasData($getMessageFromIds))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
else
|
||||
{
|
||||
return array(getData($getMessageFromIds)[0]);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Returns the current authenticated person object
|
||||
*/
|
||||
private function _getAuthUser()
|
||||
{
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$authUser = $this->PersonModel->getByUid(getAuthUID());
|
||||
|
||||
if (!hasData($authUser)) $authUser = error('The current logged user person_id is not defined');
|
||||
|
||||
return $authUser;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Replaces data array keys to a lowercase string with underscores instead of spaces
|
||||
*/
|
||||
public function replaceKeys($data)
|
||||
private function _lowerReplaceSpaceArrayKeys($data)
|
||||
{
|
||||
$tmpData = array();
|
||||
|
||||
// Replaces data array keys to a lowercase without spaces string
|
||||
foreach ($data as $key => $val)
|
||||
{
|
||||
$tmpData[str_replace(' ', '_', strtolower($key))] = $val;
|
||||
@@ -203,9 +317,9 @@ class Messages_model extends CI_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Add organisation unit to an array of prestudents (objects)
|
||||
*/
|
||||
public function addOeToPrestudents(&$msgVarsData, $prestudentsData)
|
||||
private function _addOeToPrestudents(&$msgVarsData, $prestudentsData)
|
||||
{
|
||||
for ($i = 0; $i < count(getData($msgVarsData)); $i++)
|
||||
{
|
||||
@@ -219,4 +333,127 @@ class Messages_model extends CI_Model
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a person log after a message is sent
|
||||
*/
|
||||
private function _personLog($sender_id, $receiver_id, $message_id)
|
||||
{
|
||||
$_personLog = $this->personloglib->log(
|
||||
$receiver_id,
|
||||
'Action',
|
||||
array(
|
||||
'name' => 'Message sent',
|
||||
'message' => 'Message sent from person '.$sender_id.' to '.$receiver_id.', message id: '.$message_id,
|
||||
'success' => 'true'
|
||||
),
|
||||
'kommunikation',
|
||||
'core',
|
||||
null,
|
||||
getAuthUID()
|
||||
);
|
||||
|
||||
return $_personLog;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares data for the view system/messages/htmlWriteTemplate using the given parameters
|
||||
*/
|
||||
private function _prepareHtmlWriteTemplate($info, $message_id, $recipient_id)
|
||||
{
|
||||
// Checks that info parameter is valid
|
||||
if (isError($info)) show_error(getData($info));
|
||||
if (!hasData($info)) show_error('No recipients were given');
|
||||
|
||||
// If the message id and recipient id are given, then both they must be valid numbers
|
||||
if ((is_numeric($message_id) && !is_numeric($recipient_id))
|
||||
|| (!is_numeric($message_id) && is_numeric($recipient_id)))
|
||||
{
|
||||
show_error('If given, message id and recipient id both must be valid numbers');
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Retrieves the recipients information and builds:
|
||||
// - recipientsArray: an array that contains objects with id (person_id) and description (Vorname + Nachname) of recipient
|
||||
// - recipientsList: a string that contains all the recipients descriptions (Vorname + Nachname) separated by ;
|
||||
// - persons: a string that contains HTML input hidden with alla the receivers id (person_id)
|
||||
$recipientsArray = array();
|
||||
$recipientsList = '';
|
||||
$persons = '';
|
||||
foreach (getData($info) as $receiver)
|
||||
{
|
||||
$recipient = new stdClass();
|
||||
$recipient->id = $receiver->person_id;
|
||||
$recipient->description = $receiver->Vorname.' '.$receiver->Nachname;
|
||||
|
||||
$recipientsArray[] = $recipient;
|
||||
$recipientsList .= $receiver->Vorname.' '.$receiver->Nachname.'; ';
|
||||
$persons .= '<input type="hidden" name="persons[]" value="'.$receiver->person_id.'">'."\n";
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Retrieves the message to reply to, if it is specified by parameters $message_id and $recipient_id
|
||||
$replySubject = ''; // message reply subject
|
||||
$replyBody = ''; // message reply body
|
||||
$relationmessage = ''; // input hidden that contains the message id to be replied to
|
||||
// If both are given and they are valid
|
||||
if (is_numeric($message_id) && is_numeric($recipient_id))
|
||||
{
|
||||
// Retrieves a received message from tbl_msg_recipient
|
||||
$messageResult = $this->messagelib->getMessage($message_id, $recipient_id);
|
||||
if (isError($messageResult)) show_error(getData($messageResult));
|
||||
if (!hasData($messageResult)) show_error('The selected message does not exist');
|
||||
|
||||
$message = getData($messageResult)[0];
|
||||
|
||||
$replySubject = self::REPLY_SUBJECT_PREFIX.$message->subject;
|
||||
$replyBody = self::REPLY_BODY_PREFIX.$message->body;
|
||||
$relationmessage = '<input type="hidden" name="relationmessage_id" value="'.$message_id.'">';
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Retrieves message vars from database view vw_msg_vars_person
|
||||
$variablesResult = $this->messagelib->getMessageVarsPerson();
|
||||
if (isError($variablesResult)) show_error(getData($variablesResult));
|
||||
|
||||
// Then builds an array that contains objects with id (person_id) and description (Vorname + Nachname) of recipient
|
||||
$variables = array();
|
||||
foreach (getData($variablesResult) as $id => $description)
|
||||
{
|
||||
$tmpVar = new stdClass();
|
||||
$tmpVar->id = $id;
|
||||
$tmpVar->description = $description;
|
||||
|
||||
$variables[] = $tmpVar;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Retrieves the sender id
|
||||
$authUser = $this->_getAuthUser();
|
||||
if (isError($authUser)) show_error(getData($authUser));
|
||||
if (!hasData($authUser)) show_error('The current logged user person_id is not defined');
|
||||
|
||||
$sender_id = getData($authUser)[0]->person_id;
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Organisation units and a boolean (true if the sender is administrator) are used to get the templates
|
||||
$organisationUnits = $this->messagelib->getOeKurzbz($sender_id);
|
||||
if (isError($organisationUnits)) show_error(getData($organisationUnits));
|
||||
$senderIsAdmin = $this->BenutzerrolleModel->isAdminByPersonId($sender_id);
|
||||
if (isError($senderIsAdmin)) show_error(getData($senderIsAdmin));
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Returns data as an array
|
||||
return array (
|
||||
'recipientsList' => $recipientsList,
|
||||
'subject' => $replySubject,
|
||||
'body' => $replyBody,
|
||||
'variables' => $variables,
|
||||
'organisationUnits' => getData($organisationUnits),
|
||||
'senderIsAdmin' => getData($senderIsAdmin),
|
||||
'recipientsArray' => $recipientsArray,
|
||||
'persons' => $persons,
|
||||
'relationmessage_id' => $relationmessage
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<form id="sendmsgform" method="post" action="<?php echo site_url('/system/Messages/write'); ?>" target="_blank">
|
||||
<form id="sendmsgform" method="post" action="<?php echo site_url('/system/Messages/writeTemplate'); ?>" target="_blank">
|
||||
<input type="hidden" name="person_id" value="<?php echo $stammdaten->person_id ?>">
|
||||
<a id="sendmsglink" href="javascript:void(0);">
|
||||
<i class="fa fa-envelope"></i> <?php echo $this->p->t('ui','nachrichtSenden'); ?>
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Message sent failure',
|
||||
'jquery' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/messageSent.css')
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-6">
|
||||
<h3 class="page-header text-right"></h3>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
<h3 class="page-header"></h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 text-right">
|
||||
An error occurred while sending your message, please try later.
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
Beim Senden Ihrer Nachricht ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-6 text-right" style="border-right: 1px">
|
||||
You can safely close this window.
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
Sie können dieses Fenster schließen.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
<p class="signatureblock">
|
||||
Fachhochschule Technikum Wien | University of Applied Sciences Technikum Wien
|
||||
<br>Hoechstaedtplatz 6, 1200 Wien, AUSTRIA
|
||||
<br><a class="signatureblocklink" href="https://www.technikum-wien.at">www.technikum-wien.at</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view("templates/FHC-Footer"); ?>
|
||||
+1
-11
@@ -2,7 +2,7 @@
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'MessageSent',
|
||||
'title' => 'Message sent successfully',
|
||||
'jquery' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
@@ -17,11 +17,6 @@
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
|
||||
<?php
|
||||
if ($success)
|
||||
{
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-6">
|
||||
@@ -79,11 +74,6 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Write a message',
|
||||
'jquery' => true,
|
||||
'jqueryui' => true,
|
||||
'bootstrap' => true,
|
||||
'ajaxlib' => true,
|
||||
'fontawesome' => true,
|
||||
'tinymce' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'widgets' => true,
|
||||
'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/messageWrite.css'),
|
||||
'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/messageWrite.js')
|
||||
)
|
||||
);
|
||||
?>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">
|
||||
|
||||
<?php echo ucfirst($this->p->t('ui', 'nachrichtSenden')); ?>
|
||||
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<form id="sendForm" method="post" action="<?php echo site_url('/system/Messages/sendImplicitTemplate'); ?>">
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1 msgfieldcol-left">
|
||||
<label>
|
||||
|
||||
<?php echo ucfirst($this->p->t('global', 'empfaenger')).':'; ?>
|
||||
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-lg-11 msgfieldcol-right">
|
||||
<?php echo $recipientsList; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1 msgfield msgfieldcol-left">
|
||||
<label>
|
||||
|
||||
<?php echo ucfirst($this->p->t('global', 'betreff')).':'; ?>
|
||||
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-7">
|
||||
<input id="subject" class="form-control" type="text" value="<?php echo $subject; ?>" name="subject">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-lg-10">
|
||||
<label>
|
||||
|
||||
<?php echo ucfirst($this->p->t('global', 'nachricht')).':'; ?>
|
||||
|
||||
</label>
|
||||
<textarea id="bodyTextArea" name="body">
|
||||
|
||||
<?php echo $body; ?>
|
||||
|
||||
</textarea>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<div class="form-group">
|
||||
<label>
|
||||
|
||||
<?php echo ucfirst($this->p->t('ui', 'felder')).':'; ?>
|
||||
|
||||
</label>
|
||||
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'MultipleDropdown_widget',
|
||||
array('elements' => success($variables)),
|
||||
array(
|
||||
'name' => 'variables[]',
|
||||
'id' => 'variables',
|
||||
'size' => 14,
|
||||
'multiple' => true
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-xs-3">
|
||||
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Vorlage_widget',
|
||||
array('oe_kurzbz' => $organisationUnits, 'isAdmin' => $senderIsAdmin),
|
||||
array('name' => 'vorlage', 'id' => 'vorlageDnD')
|
||||
);
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="col-lg-7 col-xs-9 text-right">
|
||||
<button id="sendButton" class="btn btn-default" type="button">
|
||||
|
||||
<?php echo $this->p->t('ui', 'senden'); ?>
|
||||
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label>
|
||||
|
||||
<?php echo ucfirst($this->p->t('global', 'vorschau')).':'; ?>
|
||||
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<div class="form-grop form-inline">
|
||||
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Dropdown_widget',
|
||||
array('elements' => success($recipientsArray), 'emptyElement' => 'Select...'),
|
||||
array(
|
||||
'title' => ucfirst($this->p->t('global', 'empfaenger')).': ',
|
||||
'name' => 'recipients[]',
|
||||
'id' => 'recipients'
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1 valign-middle">
|
||||
<strong><a href="#" id="refresh">Refresh</a></strong>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<textarea id="tinymcePreview"></textarea>
|
||||
</div>
|
||||
|
||||
<?php echo $persons; ?>
|
||||
<?php echo $relationmessage_id; ?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view("templates/FHC-Footer"); ?>
|
||||
@@ -1,183 +0,0 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Write a message',
|
||||
'jquery' => true,
|
||||
'jqueryui' => true,
|
||||
'bootstrap' => true,
|
||||
'ajaxlib' => true,
|
||||
'fontawesome' => true,
|
||||
'tinymce' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/messageWrite.css'),
|
||||
'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/messageWrite.js')
|
||||
)
|
||||
);
|
||||
?>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header"><?php echo ucfirst($this->p->t('ui', 'nachrichtSenden')); ?></h3>
|
||||
</div>
|
||||
</div>
|
||||
<form id="sendForm" method="post" action="<?php echo site_url('/system/Messages/send'); ?>">
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1 msgfieldcol-left">
|
||||
<label><?php echo ucfirst($this->p->t('global', 'empfaenger')).':'; ?></label>
|
||||
</div>
|
||||
<div class="col-lg-11 msgfieldcol-right">
|
||||
<?php
|
||||
for ($i = 0; $i < count($recipients); $i++)
|
||||
{
|
||||
$receiver = $recipients[$i];
|
||||
// Every 10 recipients a new line
|
||||
if ($i > 1 && $i % 10 == 0)
|
||||
{
|
||||
echo '<br>';
|
||||
}
|
||||
echo $receiver->Vorname." ".$receiver->Nachname."; ";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1 msgfield msgfieldcol-left">
|
||||
<label><?php echo ucfirst($this->p->t('global', 'betreff')).':'; ?></label>
|
||||
</div>
|
||||
<?php
|
||||
$subject = '';
|
||||
if (isset($message))
|
||||
{
|
||||
$subject = 'Re: '.$message->subject;
|
||||
}
|
||||
?>
|
||||
<div class="col-lg-7">
|
||||
<input id="subject" class="form-control" type="text" value="<?php echo $subject; ?>" name="subject">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-lg-10">
|
||||
<label><?php echo ucfirst($this->p->t('global', 'nachricht')).':'; ?></label>
|
||||
<?php
|
||||
$body = '';
|
||||
if (isset($message))
|
||||
{
|
||||
$body = $message->body;
|
||||
}
|
||||
?>
|
||||
<textarea id="bodyTextArea" name="body"><?php echo $body; ?></textarea>
|
||||
</div>
|
||||
<?php
|
||||
if (isset($variables))
|
||||
{
|
||||
?>
|
||||
<div class="col-lg-2">
|
||||
<div class="form-group">
|
||||
<label><?php echo ucfirst($this->p->t('ui', 'felder')).':'; ?></label>
|
||||
<select id="variables" class="form-control" size="14" multiple="multiple">
|
||||
<?php
|
||||
foreach ($variables as $key => $val)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $key; ?>"><?php echo $val; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-xs-3">
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Vorlage_widget',
|
||||
array('oe_kurzbz' => $oe_kurzbz, 'isAdmin' => $isAdmin),
|
||||
array('name' => 'vorlage', 'id' => 'vorlageDnD')
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-lg-7 col-xs-9 text-right">
|
||||
<button id="sendButton" class="btn btn-default" type="button"><?php echo $this->p->t('ui', 'senden'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (isset($recipients) && count($recipients) > 0)
|
||||
{
|
||||
?>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label><?php echo ucfirst($this->p->t('global', 'vorschau')).':'; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="col-lg-5">
|
||||
<div class="form-grop form-inline">
|
||||
<label><?php echo ucfirst($this->p->t('global', 'empfaenger')).': '; ?></label>
|
||||
<select id="recipients">
|
||||
<?php
|
||||
if (count($recipients) > 1) echo '<option value="-1">Select...</option>';
|
||||
|
||||
foreach ($recipients as $receiver)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $receiver->person_id; ?>">
|
||||
<?php echo $receiver->Vorname." ".$receiver->Nachname; ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<strong><a href="#" id="refresh">Refresh</a></strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<textarea id="tinymcePreview"></textarea>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
foreach ($recipients as $receiver)
|
||||
{
|
||||
echo '<input type="hidden" name="persons[]" value="'.$receiver->person_id.'">'."\n";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($message))
|
||||
{
|
||||
?>
|
||||
<input type="hidden" name="relationmessage_id" value="<?php echo $message->message_id; ?>">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view("templates/FHC-Footer"); ?>
|
||||
@@ -30,6 +30,7 @@
|
||||
$sbadmintemplate = isset($sbadmintemplate) ? $sbadmintemplate : false;
|
||||
$tablesorter = isset($tablesorter) ? $tablesorter : false;
|
||||
$tinymce = isset($tinymce) ? $tinymce : false;
|
||||
$widgets = isset($widgets) ? $widgets : false;
|
||||
?>
|
||||
|
||||
<!-- Header start -->
|
||||
@@ -94,6 +95,9 @@
|
||||
// NavigationWidget CSS
|
||||
if ($navigationwidget === true) generateCSSsInclude('public/css/NavigationWidget.css');
|
||||
|
||||
// HTML Widget CSS
|
||||
if ($widgets === true) generateCSSsInclude('public/css/Widgets.css');
|
||||
|
||||
// Eventually required CSS
|
||||
generateCSSsInclude($customCSSs); // Eventually required CSS
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@
|
||||
<?php
|
||||
$elements = ${DropdownWidget::WIDGET_DATA_ELEMENTS_ARRAY_NAME};
|
||||
$selectedElements = ${DropdownWidget::SELECTED_ELEMENT};
|
||||
|
||||
|
||||
foreach($elements as $element)
|
||||
{
|
||||
$selected = '';
|
||||
|
||||
|
||||
if (is_array($selectedElements))
|
||||
{
|
||||
foreach($selectedElements as $selectedElement)
|
||||
@@ -71,4 +71,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php HTMLWidget::printEndBlock(${HTMLWidget::HTML_ARG_NAME}); ?>
|
||||
<?php HTMLWidget::printEndBlock(${HTMLWidget::HTML_ARG_NAME}); ?>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
class Dropdown_widget extends DropdownWidget
|
||||
{
|
||||
public function display($widgetData)
|
||||
{
|
||||
$elements = $widgetData['elements'];
|
||||
$emptyElement = $widgetData['emptyElement'];
|
||||
|
||||
$this->setElementsArray(
|
||||
$elements,
|
||||
true,
|
||||
$emptyElement,
|
||||
'No data present'
|
||||
);
|
||||
|
||||
$this->loadDropDownView($widgetData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
class MultipleDropdown_widget extends DropdownWidget
|
||||
{
|
||||
public function display($widgetData)
|
||||
{
|
||||
$elements = $widgetData['elements'];
|
||||
|
||||
$this->setElementsArray(
|
||||
$elements,
|
||||
false,
|
||||
'',
|
||||
'No data present'
|
||||
);
|
||||
|
||||
$this->setMultiple();
|
||||
|
||||
$this->loadDropDownView($widgetData);
|
||||
}
|
||||
}
|
||||
@@ -17,32 +17,32 @@ class DropdownWidget extends HTMLWidget
|
||||
const SELECTED_ELEMENT = 'selectedElement';
|
||||
// Default HTML value
|
||||
const HTML_DEFAULT_VALUE = 'null';
|
||||
|
||||
|
||||
const SIZE = 'size'; // size of the dropdown
|
||||
const MULTIPLE = 'multiple'; // multiple attribute
|
||||
|
||||
|
||||
// Alias of $this->_args[HTMLWidget::HTML_ARG_NAME] for a better code readability
|
||||
protected $htmlParameters;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function __construct($name, $args = array(), $htmlArgs = array())
|
||||
{
|
||||
parent::__construct($name, $args, $htmlArgs);
|
||||
|
||||
|
||||
// If the selectd element is not set then set it to HTML_DEFAULT_VALUE
|
||||
if (!isset($this->_args[DropdownWidget::SELECTED_ELEMENT]))
|
||||
{
|
||||
$this->_args[DropdownWidget::SELECTED_ELEMENT] = DropdownWidget::HTML_DEFAULT_VALUE;
|
||||
}
|
||||
|
||||
|
||||
$this->htmlParameters =& $this->_args[HTMLWidget::HTML_ARG_NAME]; // Reference for a better code readability
|
||||
|
||||
|
||||
// By default is not a multiple dropdown
|
||||
unset($this->htmlParameters[DropdownWidget::MULTIPLE]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set this dropdown as multiple:
|
||||
* - Setting the multiple attribute
|
||||
@@ -53,23 +53,23 @@ class DropdownWidget extends HTMLWidget
|
||||
$this->htmlParameters[DropdownWidget::MULTIPLE] = DropdownWidget::MULTIPLE;
|
||||
$this->htmlParameters[HTMLWidget::HTML_NAME] .= '[]';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if this object is a multiple dropdown
|
||||
*/
|
||||
public function isMultipleDropdown()
|
||||
{
|
||||
$isMultipleDropdown = false;
|
||||
|
||||
|
||||
if (isset($this->htmlParameters[DropdownWidget::MULTIPLE])
|
||||
&& $this->htmlParameters[DropdownWidget::MULTIPLE] == DropdownWidget::MULTIPLE)
|
||||
{
|
||||
$isMultipleDropdown = true;
|
||||
}
|
||||
|
||||
|
||||
return $isMultipleDropdown;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add the correct select to the model used to load a list of elemets for this dropdown
|
||||
* @param model $model the model used to load elements
|
||||
@@ -88,7 +88,7 @@ class DropdownWidget extends HTMLWidget
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the array used to populate the dropdown
|
||||
* @param array $elements list used to populate this dropdown
|
||||
@@ -102,7 +102,7 @@ class DropdownWidget extends HTMLWidget
|
||||
)
|
||||
{
|
||||
$tmpElements = array();
|
||||
|
||||
|
||||
if (isError($elements))
|
||||
{
|
||||
if (is_object($elements) && isset($elements->retval))
|
||||
@@ -133,11 +133,11 @@ class DropdownWidget extends HTMLWidget
|
||||
{
|
||||
$tmpElements = $elements->retval;
|
||||
}
|
||||
|
||||
|
||||
$this->_args[DropdownWidget::WIDGET_DATA_ELEMENTS_ARRAY_NAME] = $tmpElements;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds an element to the beginning of the array
|
||||
*/
|
||||
@@ -146,17 +146,17 @@ class DropdownWidget extends HTMLWidget
|
||||
$element = new stdClass();
|
||||
$element->{DropdownWidget::ID_FIELD} = $id;
|
||||
$element->{DropdownWidget::DESCRIPTION_FIELD} = $stdDescription;
|
||||
|
||||
|
||||
if (!hasData($elements))
|
||||
{
|
||||
$element->{DropdownWidget::DESCRIPTION_FIELD} = $noDataDescription;
|
||||
}
|
||||
|
||||
|
||||
array_unshift($elements->retval, $element);
|
||||
|
||||
|
||||
return $elements->retval;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads the dropdown view with all the elements to be displayed
|
||||
*/
|
||||
@@ -164,4 +164,4 @@ class DropdownWidget extends HTMLWidget
|
||||
{
|
||||
$this->view('widgets/dropdown', $this->_args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +173,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"package": {
|
||||
"name": "olifolkerd/tabulator",
|
||||
"version": "4.2.7",
|
||||
"dist": {
|
||||
"url": "https://github.com/olifolkerd/tabulator/archive/4.2.7.zip",
|
||||
"type": "zip"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"package": {
|
||||
@@ -260,6 +271,8 @@
|
||||
"netcarver/textile": "^3.5",
|
||||
"nicolaskruchten/pivottable": "^2.15.0",
|
||||
|
||||
"olifolkerd/tabulator": "4.2.7",
|
||||
|
||||
"phpseclib/phpseclib": "^2.0",
|
||||
|
||||
"rmariuzzo/jquery-checkboxes": "1.0.7",
|
||||
|
||||
Generated
+30
-19
@@ -4,8 +4,8 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "ddbbad487c655512e6983408339cb85f",
|
||||
"content-hash": "b5902c71fe21cd14397101dba5a3080c",
|
||||
"hash": "df6059a4bee974ecf5447aad8a8b1e15",
|
||||
"content-hash": "2111c73853dbc47938c3f31dbc349883",
|
||||
"packages": [
|
||||
{
|
||||
"name": "BlackrockDigital/startbootstrap-sb-admin-2",
|
||||
@@ -1198,16 +1198,16 @@
|
||||
},
|
||||
{
|
||||
"name": "netcarver/textile",
|
||||
"version": "v3.7.1",
|
||||
"version": "v3.7.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/textile/php-textile.git",
|
||||
"reference": "377933125dd30d708804c545bf33da87a3c1b0f4"
|
||||
"reference": "c24d68d9f4d099f9c2434e71024f2a6140dc1594"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/textile/php-textile/zipball/377933125dd30d708804c545bf33da87a3c1b0f4",
|
||||
"reference": "377933125dd30d708804c545bf33da87a3c1b0f4",
|
||||
"url": "https://api.github.com/repos/textile/php-textile/zipball/c24d68d9f4d099f9c2434e71024f2a6140dc1594",
|
||||
"reference": "c24d68d9f4d099f9c2434e71024f2a6140dc1594",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1247,7 +1247,7 @@
|
||||
"plaintext",
|
||||
"textile"
|
||||
],
|
||||
"time": "2019-01-26 17:03:58"
|
||||
"time": "2019-06-08 17:57:17"
|
||||
},
|
||||
{
|
||||
"name": "nicolaskruchten/pivottable",
|
||||
@@ -1260,18 +1260,29 @@
|
||||
},
|
||||
"type": "library"
|
||||
},
|
||||
{
|
||||
"name": "olifolkerd/tabulator",
|
||||
"version": "4.2.7",
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://github.com/olifolkerd/tabulator/archive/4.2.7.zip",
|
||||
"reference": null,
|
||||
"shasum": null
|
||||
},
|
||||
"type": "library"
|
||||
},
|
||||
{
|
||||
"name": "phpseclib/phpseclib",
|
||||
"version": "2.0.15",
|
||||
"version": "2.0.18",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpseclib/phpseclib.git",
|
||||
"reference": "11cf67cf78dc4acb18dc9149a57be4aee5036ce0"
|
||||
"reference": "60519001db8d791215a822efd366d24cafee9e63"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/11cf67cf78dc4acb18dc9149a57be4aee5036ce0",
|
||||
"reference": "11cf67cf78dc4acb18dc9149a57be4aee5036ce0",
|
||||
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/60519001db8d791215a822efd366d24cafee9e63",
|
||||
"reference": "60519001db8d791215a822efd366d24cafee9e63",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1350,7 +1361,7 @@
|
||||
"x.509",
|
||||
"x509"
|
||||
],
|
||||
"time": "2019-03-10 16:53:45"
|
||||
"time": "2019-06-13 06:15:54"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
@@ -2180,16 +2191,16 @@
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "v1.41.0",
|
||||
"version": "v1.42.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "575cd5028362da591facde1ef5d7b94553c375c9"
|
||||
"reference": "671347603760a88b1e7288aaa9378f33687d7edf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/575cd5028362da591facde1ef5d7b94553c375c9",
|
||||
"reference": "575cd5028362da591facde1ef5d7b94553c375c9",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/671347603760a88b1e7288aaa9378f33687d7edf",
|
||||
"reference": "671347603760a88b1e7288aaa9378f33687d7edf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2199,12 +2210,12 @@
|
||||
"require-dev": {
|
||||
"psr/container": "^1.0",
|
||||
"symfony/debug": "^2.7",
|
||||
"symfony/phpunit-bridge": "^3.4.19|^4.1.8"
|
||||
"symfony/phpunit-bridge": "^3.4.19|^4.1.8|^5.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.41-dev"
|
||||
"dev-master": "1.42-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -2242,7 +2253,7 @@
|
||||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"time": "2019-05-14 11:59:08"
|
||||
"time": "2019-06-04 11:31:08"
|
||||
},
|
||||
{
|
||||
"name": "zetacomponents/base",
|
||||
|
||||
@@ -1250,7 +1250,7 @@ function MessageNew()
|
||||
{
|
||||
var prestudentIdArray = getMultipleTreeCellText(tree, 'student-treecol-prestudent_id');
|
||||
|
||||
var action = '<?php echo APP_ROOT ?>index.ci.php/system/FASMessages/write/' + <?php echo $benutzer->person_id; ?>;
|
||||
var action = '<?php echo APP_ROOT ?>index.ci.php/system/FASMessages/writeTemplate/' + <?php echo $benutzer->person_id; ?>;
|
||||
|
||||
openWindowPostArray(action, 'prestudent_id', prestudentIdArray);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ function MessagesNewMessage()
|
||||
{
|
||||
var prestudentIdArray = getMultipleTreeCellText(tree, 'student-treecol-prestudent_id');
|
||||
|
||||
var action = '<?php echo APP_ROOT ?>index.ci.php/system/FASMessages/write/' + MessageSenderPersonID;
|
||||
var action = '<?php echo APP_ROOT ?>index.ci.php/system/FASMessages/writeTemplate';
|
||||
|
||||
openWindowPostArray(action, 'prestudent_id', prestudentIdArray);
|
||||
}
|
||||
@@ -128,7 +128,7 @@ function MessagesSendAnswer()
|
||||
var RecipientID = getTreeCellText(messagesTree, 'messages-tree-recipient_id', messagesTree.currentIndex);
|
||||
var prestudentIdArray = new Array(getTreeCellText(studentsTree, 'student-treecol-prestudent_id', studentsTree.currentIndex));
|
||||
|
||||
var action = '<?php echo APP_ROOT ?>index.ci.php/system/FASMessages/writeReply/' + MessageSenderPersonID + '/' + MessageId + '/' + RecipientID;
|
||||
var action = '<?php echo APP_ROOT ?>index.ci.php/system/FASMessages/writeReplyTemplate/' + MessageId + '/' + RecipientID;
|
||||
|
||||
openWindowPostArray(action, 'prestudent_id', prestudentIdArray);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
.div-table {
|
||||
display: table;
|
||||
}
|
||||
|
||||
.div-row {
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
.div-cell {
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.div-cell-label {
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
label[required-field=true]::after {
|
||||
content: "*";
|
||||
}
|
||||
|
||||
.div-cell-data {
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.halign-right {
|
||||
text-align: right;
|
||||
margin-left: auto;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.valign-middle {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.valign-top {
|
||||
vertical-align: top;
|
||||
padding-top: 1px;
|
||||
}
|
||||
|
||||
.width-150px {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.width-30px {
|
||||
width: 30px;
|
||||
}
|
||||
@@ -21,4 +21,9 @@ input[type=text] {
|
||||
|
||||
#sendButton {
|
||||
width: 120px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Overwrites the Widget.css class */
|
||||
div .width-150px {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
@@ -629,7 +629,7 @@ var InfocenterDetails = {
|
||||
sendFreigabeMessage: function(prestudentid, vorlage_kurzbz, msgvars)
|
||||
{
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
'system/Messages/sendJson',
|
||||
'system/Messages/sendExplicitTemplateJson',
|
||||
{
|
||||
"prestudents": prestudentid,
|
||||
"vorlage_kurzbz": vorlage_kurzbz,
|
||||
|
||||
@@ -26,7 +26,7 @@ var InfocenterPersonDataset = {
|
||||
appendTableActionsHtml: function()
|
||||
{
|
||||
var currurl = window.location.href;
|
||||
var url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/system/Messages/write";
|
||||
var url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/system/Messages/writeTemplate";
|
||||
|
||||
var formHtml = '<form id="sendMsgsForm" method="post" action="'+ url +'" target="_blank"></form>';
|
||||
$("#datasetActionsTop").before(formHtml);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* JS used by view system/messages/messageWrite
|
||||
* JS used by view system/messages/htmlWriteTemplate
|
||||
*/
|
||||
|
||||
function tinymcePreviewSetContent()
|
||||
|
||||
Reference in New Issue
Block a user