- 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:
Paolo
2019-06-18 18:25:26 +02:00
parent 5bda5eb966
commit f6e0f58b3d
23 changed files with 802 additions and 613 deletions
@@ -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>&nbsp;<?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"); ?>
@@ -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>
&nbsp;
<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>&nbsp;
<?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>
&nbsp;
<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
+3 -3
View File
@@ -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}); ?>