- Renamed parameter jquery into jquery19 in file application/views/templates/header.php

- Fixed includes in prestudentMultiAssign.php and messageWrite.php
- Fixed new lines in prestudentMultiAssign.php and messageWrite.php
This commit is contained in:
Paolo
2017-08-25 14:13:46 +02:00
parent fbb4a492b5
commit 2beba613e6
3 changed files with 613 additions and 613 deletions
@@ -1,323 +1,323 @@
<?php $this->load->view("templates/header", array("title" => "Users manager", "jquery" => true, "tablesort" => true, "jquery_checkboxes" => true, "jquery_custom" => true)); ?>
<body>
<form id="usersFiltersForm" action="" method="post">
<table>
<tr>
<td>
<?php
echo $this->widgetlib->widget(
'Studiengang_widget',
array(DropdownWidget::SELECTED_ELEMENT => $studiengang),
array('name' => 'studiengang', 'id' => 'studiengangFilter')
);
?>
</td>
<td>
<?php
echo $this->widgetlib->widget(
'Studiensemester_widget',
array(DropdownWidget::SELECTED_ELEMENT => $studiensemester),
array('name' => 'studiensemester', 'id' => 'studiensemesterFilter')
);
?>
</td>
<td>
<?php
echo $this->widgetlib->widget(
'Reihungstest_widget',
array(
DropdownWidget::SELECTED_ELEMENT => $reihungstest,
'studiengang' => $studiengang,
'studiensemester' => $studiensemester
),
array('name' => 'reihungstest', 'id' => 'reihungstestFilter')
);
?>
</td>
<td>
<?php
echo $this->widgetlib->widget(
'Aufnahmegruppe_widget',
array(DropdownWidget::SELECTED_ELEMENT => $aufnahmegruppe),
array('name' => 'aufnahmegruppe', 'id' => 'aufnahmegruppeFilter')
);
?>
</td>
<td>
<?php
echo $this->widgetlib->widget(
'Stufe_widget',
array(DropdownWidget::SELECTED_ELEMENT => $stufe),
array('name' => 'stufe', 'id' => 'stufeFilter')
);
?>
</td>
</tr>
</table>
</form>
<br>
<form id="linkUsersForm" action="" method="post">
<?php
if ($users != null)
{
?>
<table>
<tr>
<td colspan="2">
<strong>Assign to:</strong>
</td>
</tr>
<tr>
<td height="3px" colspan="2"></td>
</tr>
<tr>
<td>
<?php
echo $this->widgetlib->widget(
'Stufe_widget',
array('stufe' => $stufe),
array('name' => 'stufe', 'id' => 'stufeAssign')
);
?>
</td>
<td>&nbsp;</td>
<td>
<input type="button" id="linkToStufe" value="Assign this stufe">
</td>
</tr>
<tr>
<td>
<?php
echo $this->widgetlib->widget(
'Aufnahmegruppe_widget',
array('aufnahmegruppe' => $aufnahmegruppe),
array('name' => 'aufnahmegruppe', 'id' => 'aufnahmegruppeAssign')
);
?>
<td>&nbsp;</td>
<td>
<input type="button" id="linkToGruppe" value="Assign to this group">
</td>
</tr>
</table>
<?php
}
?>
<br>
<br>
<div>
<?php
if ($users != null)
{
?>
<table id="t0" class="tablesorter">
<thead>
<tr>
<th>&nbsp;</th>
<th class="clm_prestudent_id header">Prestudent ID</th>
<th class="clm_person_id header">Person ID</th>
<th class="header headerSortDown">Vorname</th>
<th>Nachname</th>
<th>Geschlecht</th>
<th>Studiengang</th>
<th>OrgForm</th>
<th>Studienplan</th>
<th>Geburtsdatum</th>
<th>Email</th>
<th>Stufe</th>
<th>Gruppe</th>
<th>Punkte</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $i < count($users); $i++)
{
$user = $users[$i];
?>
<tr>
<td>
<input type="checkbox" name="prestudent_id[]" value="<?php echo $user->prestudent_id ?>">
</td>
<td>
<?php echo $user->prestudent_id; ?>
</td>
<td>
<?php echo $user->person_id; ?>
</td>
<td>
<?php echo $user->vorname; ?>
</td>
<td>
<?php echo $user->nachname; ?>
</td>
<td>
<?php echo $user->geschlecht; ?>
</td>
<td>
<?php echo $user->kurzbzlang; ?>
</td>
<td>
<?php echo $user->orgform_kurzbz; ?>
</td>
<td>
<?php echo $user->studienplan; ?>
</td>
<td>
<?php echo $user->gebdatum; ?>
</td>
<td>
<?php echo $user->email; ?>
</td>
<td>
<?php echo $user->rt_stufe; ?>
</td>
<td>
<?php echo $user->aufnahmegruppe_kurzbz; ?>
</td>
<td>
<?php echo $user->punkte; ?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
else
{
echo 'No users found.';
}
?>
</div>
</form>
<?php
$hrefLinkToStufe = str_replace("/system/aufnahme/PrestudentMultiAssign", "/system/aufnahme/PrestudentMultiAssign/linkToStufe", $_SERVER["REQUEST_URI"]);
$hrefLinkToAufnahmegruppe = str_replace("/system/aufnahme/PrestudentMultiAssign", "/system/aufnahme/PrestudentMultiAssign/linkToAufnahmegruppe", $_SERVER["REQUEST_URI"]);
?>
<script>
$(document).ready(function() {
if ($("#linkToStufe"))
{
$("#linkToStufe").click(function() {
$.ajax({
type: "POST",
dataType: "json",
url: "<?php echo $hrefLinkToStufe; ?>",
data: $("#linkUsersForm").serialize(),
success: function(data, textStatus, jqXHR) {
alert(data.msg);
$("#usersFiltersForm").submit();
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
}
});
});
}
if ($("#linkToGruppe"))
{
$("#linkToGruppe").click(function() {
$.ajax({
type: "POST",
dataType: "json",
url: "<?php echo $hrefLinkToAufnahmegruppe; ?>",
data: $("#linkUsersForm").serialize(),
success: function(data, textStatus, jqXHR) {
alert(data.msg);
$("#usersFiltersForm").submit();
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
}
});
});
}
if ($('#studiengangFilter'))
{
$('#studiengangFilter').change(function() {
$('#usersFiltersForm').submit();
});
}
if ($('#studiensemesterFilter'))
{
$('#studiensemesterFilter').change(function() {
$('#usersFiltersForm').submit();
});
}
if ($('#aufnahmegruppeFilter'))
{
$('#aufnahmegruppeFilter').change(function() {
$('#usersFiltersForm').submit();
});
}
if ($('#stufeFilter'))
{
$('#stufeFilter').change(function() {
$('#usersFiltersForm').submit();
});
}
if ($('#reihungstestFilter'))
{
$('#reihungstestFilter').change(function() {
$('#usersFiltersForm').submit();
});
}
$(".tablesorter").each(function(i, v) {
$("#"+v.id).tablesorter(
{
widgets: ["zebra"],
sortList: [[3,0],[4,0]],
headers: {0: { sorter: false}}
});
$("#toggle_"+v.id).on('click', function(e) {
$("#"+v.id).checkboxes('toggle');
e.preventDefault();
if ($("input.chkbox:checked").size() > 0)
$("#mailSendButton").html('Mail an markierte Personen senden');
else
$("#mailSendButton").html('Mail an alle senden');
});
$("#uncheck_"+v.id).on('click', function(e) {
$("#"+v.id).checkboxes('uncheck');
e.preventDefault();
if ($("input.chkbox:checked").size() > 0)
$("#mailSendButton").html('Mail an markierte Personen senden');
else
$("#mailSendButton").html('Mail an alle senden');
});
$("#"+v.id).checkboxes('range', true);
});
$('.chkbox').change(function()
{
if ($("input.chkbox:checked").size() > 0)
$("#mailSendButton").html('Mail an markierte Personen senden');
else
$("#mailSendButton").html('Mail an alle senden');
});
});
</script>
</body>
<?php $this->load->view("templates/footer"); ?>
<?php $this->load->view("templates/header", array("title" => "Users manager", "jquery19" => true, "tablesort" => true, "jquery_checkboxes" => true, "jquery_custom" => true)); ?>
<body>
<form id="usersFiltersForm" action="" method="post">
<table>
<tr>
<td>
<?php
echo $this->widgetlib->widget(
'Studiengang_widget',
array(DropdownWidget::SELECTED_ELEMENT => $studiengang),
array('name' => 'studiengang', 'id' => 'studiengangFilter')
);
?>
</td>
<td>
<?php
echo $this->widgetlib->widget(
'Studiensemester_widget',
array(DropdownWidget::SELECTED_ELEMENT => $studiensemester),
array('name' => 'studiensemester', 'id' => 'studiensemesterFilter')
);
?>
</td>
<td>
<?php
echo $this->widgetlib->widget(
'Reihungstest_widget',
array(
DropdownWidget::SELECTED_ELEMENT => $reihungstest,
'studiengang' => $studiengang,
'studiensemester' => $studiensemester
),
array('name' => 'reihungstest', 'id' => 'reihungstestFilter')
);
?>
</td>
<td>
<?php
echo $this->widgetlib->widget(
'Aufnahmegruppe_widget',
array(DropdownWidget::SELECTED_ELEMENT => $aufnahmegruppe),
array('name' => 'aufnahmegruppe', 'id' => 'aufnahmegruppeFilter')
);
?>
</td>
<td>
<?php
echo $this->widgetlib->widget(
'Stufe_widget',
array(DropdownWidget::SELECTED_ELEMENT => $stufe),
array('name' => 'stufe', 'id' => 'stufeFilter')
);
?>
</td>
</tr>
</table>
</form>
<br>
<form id="linkUsersForm" action="" method="post">
<?php
if ($users != null)
{
?>
<table>
<tr>
<td colspan="2">
<strong>Assign to:</strong>
</td>
</tr>
<tr>
<td height="3px" colspan="2"></td>
</tr>
<tr>
<td>
<?php
echo $this->widgetlib->widget(
'Stufe_widget',
array('stufe' => $stufe),
array('name' => 'stufe', 'id' => 'stufeAssign')
);
?>
</td>
<td>&nbsp;</td>
<td>
<input type="button" id="linkToStufe" value="Assign this stufe">
</td>
</tr>
<tr>
<td>
<?php
echo $this->widgetlib->widget(
'Aufnahmegruppe_widget',
array('aufnahmegruppe' => $aufnahmegruppe),
array('name' => 'aufnahmegruppe', 'id' => 'aufnahmegruppeAssign')
);
?>
<td>&nbsp;</td>
<td>
<input type="button" id="linkToGruppe" value="Assign to this group">
</td>
</tr>
</table>
<?php
}
?>
<br>
<br>
<div>
<?php
if ($users != null)
{
?>
<table id="t0" class="tablesorter">
<thead>
<tr>
<th>&nbsp;</th>
<th class="clm_prestudent_id header">Prestudent ID</th>
<th class="clm_person_id header">Person ID</th>
<th class="header headerSortDown">Vorname</th>
<th>Nachname</th>
<th>Geschlecht</th>
<th>Studiengang</th>
<th>OrgForm</th>
<th>Studienplan</th>
<th>Geburtsdatum</th>
<th>Email</th>
<th>Stufe</th>
<th>Gruppe</th>
<th>Punkte</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $i < count($users); $i++)
{
$user = $users[$i];
?>
<tr>
<td>
<input type="checkbox" name="prestudent_id[]" value="<?php echo $user->prestudent_id ?>">
</td>
<td>
<?php echo $user->prestudent_id; ?>
</td>
<td>
<?php echo $user->person_id; ?>
</td>
<td>
<?php echo $user->vorname; ?>
</td>
<td>
<?php echo $user->nachname; ?>
</td>
<td>
<?php echo $user->geschlecht; ?>
</td>
<td>
<?php echo $user->kurzbzlang; ?>
</td>
<td>
<?php echo $user->orgform_kurzbz; ?>
</td>
<td>
<?php echo $user->studienplan; ?>
</td>
<td>
<?php echo $user->gebdatum; ?>
</td>
<td>
<?php echo $user->email; ?>
</td>
<td>
<?php echo $user->rt_stufe; ?>
</td>
<td>
<?php echo $user->aufnahmegruppe_kurzbz; ?>
</td>
<td>
<?php echo $user->punkte; ?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
else
{
echo 'No users found.';
}
?>
</div>
</form>
<?php
$hrefLinkToStufe = str_replace("/system/aufnahme/PrestudentMultiAssign", "/system/aufnahme/PrestudentMultiAssign/linkToStufe", $_SERVER["REQUEST_URI"]);
$hrefLinkToAufnahmegruppe = str_replace("/system/aufnahme/PrestudentMultiAssign", "/system/aufnahme/PrestudentMultiAssign/linkToAufnahmegruppe", $_SERVER["REQUEST_URI"]);
?>
<script>
$(document).ready(function() {
if ($("#linkToStufe"))
{
$("#linkToStufe").click(function() {
$.ajax({
type: "POST",
dataType: "json",
url: "<?php echo $hrefLinkToStufe; ?>",
data: $("#linkUsersForm").serialize(),
success: function(data, textStatus, jqXHR) {
alert(data.msg);
$("#usersFiltersForm").submit();
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
}
});
});
}
if ($("#linkToGruppe"))
{
$("#linkToGruppe").click(function() {
$.ajax({
type: "POST",
dataType: "json",
url: "<?php echo $hrefLinkToAufnahmegruppe; ?>",
data: $("#linkUsersForm").serialize(),
success: function(data, textStatus, jqXHR) {
alert(data.msg);
$("#usersFiltersForm").submit();
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
}
});
});
}
if ($('#studiengangFilter'))
{
$('#studiengangFilter').change(function() {
$('#usersFiltersForm').submit();
});
}
if ($('#studiensemesterFilter'))
{
$('#studiensemesterFilter').change(function() {
$('#usersFiltersForm').submit();
});
}
if ($('#aufnahmegruppeFilter'))
{
$('#aufnahmegruppeFilter').change(function() {
$('#usersFiltersForm').submit();
});
}
if ($('#stufeFilter'))
{
$('#stufeFilter').change(function() {
$('#usersFiltersForm').submit();
});
}
if ($('#reihungstestFilter'))
{
$('#reihungstestFilter').change(function() {
$('#usersFiltersForm').submit();
});
}
$(".tablesorter").each(function(i, v) {
$("#"+v.id).tablesorter(
{
widgets: ["zebra"],
sortList: [[3,0],[4,0]],
headers: {0: { sorter: false}}
});
$("#toggle_"+v.id).on('click', function(e) {
$("#"+v.id).checkboxes('toggle');
e.preventDefault();
if ($("input.chkbox:checked").size() > 0)
$("#mailSendButton").html('Mail an markierte Personen senden');
else
$("#mailSendButton").html('Mail an alle senden');
});
$("#uncheck_"+v.id).on('click', function(e) {
$("#"+v.id).checkboxes('uncheck');
e.preventDefault();
if ($("input.chkbox:checked").size() > 0)
$("#mailSendButton").html('Mail an markierte Personen senden');
else
$("#mailSendButton").html('Mail an alle senden');
});
$("#"+v.id).checkboxes('range', true);
});
$('.chkbox').change(function()
{
if ($("input.chkbox:checked").size() > 0)
$("#mailSendButton").html('Mail an markierte Personen senden');
else
$("#mailSendButton").html('Mail an alle senden');
});
});
</script>
</body>
<?php $this->load->view("templates/footer"); ?>
+286 -286
View File
@@ -1,286 +1,286 @@
<?php $this->load->view("templates/header", array("title" => "MessageReply", "jquery" => true, "tinymce" => true)); ?>
<body>
<?php
$href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER["REQUEST_URI"]);
?>
<form id="sendForm" method="post" action="<?php echo $href; ?>">
<table>
<tr>
<td>
<strong>To:</strong>
</td>
<td>
<?php
for ($i = 0; $i < count($receivers); $i++)
{
$receiver = $receivers[$i];
// Every 10 recipients a new line
if ($i > 1 && $i % 10 == 0)
{
echo '<br>';
}
echo $receiver->Vorname . " " . $receiver->Nachname . "; ";
}
?>
</td>
</tr>
<tr>
<td height="3px"></td>
</tr>
<tr>
<td>
<strong>Subject:</strong>&nbsp;
</td>
<td>
<?php
$subject = '';
if (isset($message))
{
$subject = 'Re: '.$message->subject;
}
?>
<input id="subject" type="text" value="<?php echo $subject; ?>" name="subject" size="70">
</td>
</tr>
</table>
<table width="100%">
<tr>
<td width="80%">
<strong>Message:</strong><br>
<?php
$body = '';
if (isset($message))
{
$body = $message->body;
}
?>
<textarea id="bodyTextArea" name="body"><?php echo $body; ?></textarea>
</td>
<td width="3%">&nbsp;</td>
<td width="17%">
<?php
if (isset($variables))
{
?>
<div>
<strong>Variables:</strong><br>
<select id="variables" size="14" style="min-width:200px;">
<?php
foreach($variables as $key => $val)
{
?>
<option value="<?php echo $key; ?>"><?php echo $val; ?></option>
<?php
}
?>
</select>
</div>
<?php
}
?>
</td>
</tr>
</table>
<table>
<tr>
<td>
<?php
echo $this->widgetlib->widget(
'Vorlage_widget',
array('oe_kurzbz' => $oe_kurzbz, 'isAdmin' => $isAdmin),
array('name' => 'vorlage', 'id' => 'vorlageDnD')
);
?>
</td>
<td>
&nbsp;
</td>
<td>
<button id="sendButton" type="button">Send</button>
</td>
</tr>
</table>
<br>
<?php
if (isset($receivers) && count($receivers) > 0)
{
?>
<div>
Preview:
</div>
<div style="border: 1px; border-style: solid;">
<table width="100%" style="margin: 3px;">
<tr>
<td>
<strong>Recipient:</strong>
<select id="recipients">
<option value="-1">Select...</option>
<?php
foreach($receivers as $receiver)
{
?>
<option value="<?php echo $receiver->prestudent_id; ?>"><?php echo $receiver->Nachname . " " . $receiver->Vorname; ?></option>
<?php
}
?>
</select>
&nbsp;
<strong><a href="#" id="refresh">Refresh</a></strong>
</td>
</tr>
<tr>
<td>
&nbsp;
</td>
</tr>
<tr>
<td width="100%">
<textarea id="tinymcePreview"></textarea>
</td>
</tr>
</table>
</div>
<?php
}
?>
<?php
for($i = 0; $i < count($receivers); $i++)
{
$receiver = $receivers[$i];
echo '<input type="hidden" name="prestudents[]" value="' . $receiver->prestudent_id . '">' . "\n";
}
?>
<?php
if (isset($message))
{
?>
<input type="hidden" name="relationmessage_id" value="<?php echo $message->message_id; ?>">
<?php
}
?>
</form>
<script>
tinymce.init({
selector: "#bodyTextArea"
});
tinymce.init({
menubar: false,
toolbar: false,
readonly: 1,
selector: "#tinymcePreview",
statusbar: true
});
$(document).ready(function() {
if ($("#variables"))
{
$("#variables").dblclick(function() {
if ($("#bodyTextArea"))
{
tinyMCE.get("bodyTextArea").setContent(tinyMCE.get("bodyTextArea").getContent() + $(this).children(":selected").val());
}
});
}
if ($("#recipients"))
{
$("#recipients").change(tinymcePreviewSetContent);
}
if ($("#refresh"))
{
$("#refresh").click(tinymcePreviewSetContent);
}
if ($("#sendButton") && $("#sendForm"))
{
$("#sendButton").click(function() {
if ($("#subject") && $("#subject").val() != '' && tinyMCE.get("bodyTextArea").getContent() != '')
{
$("#sendForm").submit();
}
else
{
alert("Subject and text are required fields!");
}
});
}
if ($("#vorlageDnD"))
{
$("#vorlageDnD").change(function() {
if (this.value != '')
{
<?php
$url = str_replace("/system/Messages/write", "/system/Messages/getVorlage", $_SERVER["REQUEST_URI"]);
?>
$.ajax({
dataType: "json",
url: "<?php echo $url; ?>",
data: {"vorlage_kurzbz": this.value},
success: function(data, textStatus, jqXHR) {
tinyMCE.get("bodyTextArea").setContent(data.retval[0].text);
$("#subject").val(data.retval[0].subject);
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + " - " + errorThrown);
}
});
}
});
}
});
function tinymcePreviewSetContent()
{
if ($("#tinymcePreview"))
{
if ($("#recipients").children(":selected").val() > -1)
{
parseMessageText($("#recipients").children(":selected").val(), tinyMCE.get("bodyTextArea").getContent());
}
else
{
tinyMCE.get("tinymcePreview").setContent("");
}
}
}
function parseMessageText(prestudent_id, text)
{
<?php
$url = str_replace("/system/Messages/write", "/system/Messages/parseMessageText", $_SERVER["REQUEST_URI"]);
$url = substr($url, 0, strrpos($url, '/'));
?>
$.ajax({
dataType: "json",
url: "<?php echo $url; ?>",
data: {"prestudent_id": prestudent_id, "text" : text},
success: function(data, textStatus, jqXHR) {
tinyMCE.get("tinymcePreview").setContent(data);
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
}
});
}
</script>
</body>
<?php $this->load->view("templates/footer"); ?>
<?php $this->load->view("templates/header", array("title" => "MessageReply", "jquery19" => true, "tinymce" => true)); ?>
<body>
<?php
$href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER["REQUEST_URI"]);
?>
<form id="sendForm" method="post" action="<?php echo $href; ?>">
<table>
<tr>
<td>
<strong>To:</strong>
</td>
<td>
<?php
for ($i = 0; $i < count($receivers); $i++)
{
$receiver = $receivers[$i];
// Every 10 recipients a new line
if ($i > 1 && $i % 10 == 0)
{
echo '<br>';
}
echo $receiver->Vorname . " " . $receiver->Nachname . "; ";
}
?>
</td>
</tr>
<tr>
<td height="3px"></td>
</tr>
<tr>
<td>
<strong>Subject:</strong>&nbsp;
</td>
<td>
<?php
$subject = '';
if (isset($message))
{
$subject = 'Re: '.$message->subject;
}
?>
<input id="subject" type="text" value="<?php echo $subject; ?>" name="subject" size="70">
</td>
</tr>
</table>
<table width="100%">
<tr>
<td width="80%">
<strong>Message:</strong><br>
<?php
$body = '';
if (isset($message))
{
$body = $message->body;
}
?>
<textarea id="bodyTextArea" name="body"><?php echo $body; ?></textarea>
</td>
<td width="3%">&nbsp;</td>
<td width="17%">
<?php
if (isset($variables))
{
?>
<div>
<strong>Variables:</strong><br>
<select id="variables" size="14" style="min-width:200px;">
<?php
foreach($variables as $key => $val)
{
?>
<option value="<?php echo $key; ?>"><?php echo $val; ?></option>
<?php
}
?>
</select>
</div>
<?php
}
?>
</td>
</tr>
</table>
<table>
<tr>
<td>
<?php
echo $this->widgetlib->widget(
'Vorlage_widget',
array('oe_kurzbz' => $oe_kurzbz, 'isAdmin' => $isAdmin),
array('name' => 'vorlage', 'id' => 'vorlageDnD')
);
?>
</td>
<td>
&nbsp;
</td>
<td>
<button id="sendButton" type="button">Send</button>
</td>
</tr>
</table>
<br>
<?php
if (isset($receivers) && count($receivers) > 0)
{
?>
<div>
Preview:
</div>
<div style="border: 1px; border-style: solid;">
<table width="100%" style="margin: 3px;">
<tr>
<td>
<strong>Recipient:</strong>
<select id="recipients">
<option value="-1">Select...</option>
<?php
foreach($receivers as $receiver)
{
?>
<option value="<?php echo $receiver->prestudent_id; ?>"><?php echo $receiver->Nachname . " " . $receiver->Vorname; ?></option>
<?php
}
?>
</select>
&nbsp;
<strong><a href="#" id="refresh">Refresh</a></strong>
</td>
</tr>
<tr>
<td>
&nbsp;
</td>
</tr>
<tr>
<td width="100%">
<textarea id="tinymcePreview"></textarea>
</td>
</tr>
</table>
</div>
<?php
}
?>
<?php
for($i = 0; $i < count($receivers); $i++)
{
$receiver = $receivers[$i];
echo '<input type="hidden" name="prestudents[]" value="' . $receiver->prestudent_id . '">' . "\n";
}
?>
<?php
if (isset($message))
{
?>
<input type="hidden" name="relationmessage_id" value="<?php echo $message->message_id; ?>">
<?php
}
?>
</form>
<script>
tinymce.init({
selector: "#bodyTextArea"
});
tinymce.init({
menubar: false,
toolbar: false,
readonly: 1,
selector: "#tinymcePreview",
statusbar: true
});
$(document).ready(function() {
if ($("#variables"))
{
$("#variables").dblclick(function() {
if ($("#bodyTextArea"))
{
tinyMCE.get("bodyTextArea").setContent(tinyMCE.get("bodyTextArea").getContent() + $(this).children(":selected").val());
}
});
}
if ($("#recipients"))
{
$("#recipients").change(tinymcePreviewSetContent);
}
if ($("#refresh"))
{
$("#refresh").click(tinymcePreviewSetContent);
}
if ($("#sendButton") && $("#sendForm"))
{
$("#sendButton").click(function() {
if ($("#subject") && $("#subject").val() != '' && tinyMCE.get("bodyTextArea").getContent() != '')
{
$("#sendForm").submit();
}
else
{
alert("Subject and text are required fields!");
}
});
}
if ($("#vorlageDnD"))
{
$("#vorlageDnD").change(function() {
if (this.value != '')
{
<?php
$url = str_replace("/system/Messages/write", "/system/Messages/getVorlage", $_SERVER["REQUEST_URI"]);
?>
$.ajax({
dataType: "json",
url: "<?php echo $url; ?>",
data: {"vorlage_kurzbz": this.value},
success: function(data, textStatus, jqXHR) {
tinyMCE.get("bodyTextArea").setContent(data.retval[0].text);
$("#subject").val(data.retval[0].subject);
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + " - " + errorThrown);
}
});
}
});
}
});
function tinymcePreviewSetContent()
{
if ($("#tinymcePreview"))
{
if ($("#recipients").children(":selected").val() > -1)
{
parseMessageText($("#recipients").children(":selected").val(), tinyMCE.get("bodyTextArea").getContent());
}
else
{
tinyMCE.get("tinymcePreview").setContent("");
}
}
}
function parseMessageText(prestudent_id, text)
{
<?php
$url = str_replace("/system/Messages/write", "/system/Messages/parseMessageText", $_SERVER["REQUEST_URI"]);
$url = substr($url, 0, strrpos($url, '/'));
?>
$.ajax({
dataType: "json",
url: "<?php echo $url; ?>",
data: {"prestudent_id": prestudent_id, "text" : text},
success: function(data, textStatus, jqXHR) {
tinyMCE.get("tinymcePreview").setContent(data);
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
}
});
}
</script>
</body>
<?php $this->load->view("templates/footer"); ?>
+4 -4
View File
@@ -2,7 +2,7 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
isset($title) ? $title = 'VileSci - '.$title : $title = 'VileSci';
!isset($jquery) ? $jquery = false : $jquery = $jquery;
!isset($jquery19) ? $jquery19 = false : $jquery19 = $jquery19;
!isset($jqueryComposer) ? $jqueryComposer = false : $jqueryComposer = $jqueryComposer;
!isset($jqueryui) ? $jqueryui = false : $jqueryui = $jqueryui;
!isset($jquery_checkboxes) ? $jquery_checkboxes = false : $jquery_checkboxes = $jquery_checkboxes;
@@ -19,7 +19,7 @@ isset($title) ? $title = 'VileSci - '.$title : $title = 'VileSci';
!isset($datepicker) ? $datepicker = false : $datepicker = $datepicker;
if ($tablesort || $jquery_checkboxes || $jquery_custom)
$jquery = true;
$jquery19 = true;
if($datepicker)
$jqueryui = true;
@@ -27,7 +27,7 @@ if($datepicker)
if($jqueryui)
$jqueryComposer = true;
if($jquery && $jqueryComposer)
if($jquery19 && $jqueryComposer)
show_error("Two JQuery versions used: composer and include folder version");
?>
@@ -42,7 +42,7 @@ if($jquery && $jqueryComposer)
<link rel="stylesheet" type="text/css" href="<?php echo base_url('skin/tablesort.css'); ?>" />
<?php endif ?>
<?php if($jquery) : ?>
<?php if($jquery19) : ?>
<script type="text/javascript" src="<?php echo base_url('include/js/jquery1.9.min.js'); ?>"></script>
<?php endif ?>