#208 Add TinyMCE to client side and fix edit post for admin
This commit is contained in:
parent
7048ab621b
commit
5068c5ba2d
@ -1815,7 +1815,7 @@ function print_form()
|
||||
|
||||
|
||||
function hesk_printTicketReplies() {
|
||||
global $hesklang, $hesk_settings, $result, $reply, $isManager;
|
||||
global $hesklang, $hesk_settings, $result, $reply, $isManager, $modsForHesk_settings;
|
||||
|
||||
$i = $hesk_settings['new_top'] ? 0 : 1;
|
||||
|
||||
|
@ -34,9 +34,11 @@
|
||||
|
||||
define('IN_SCRIPT',1);
|
||||
define('HESK_PATH','../');
|
||||
define('WYSIWYG',1);
|
||||
|
||||
/* Get all the required files and functions */
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
require(HESK_PATH . 'modsForHesk_settings.inc.php');
|
||||
require(HESK_PATH . 'inc/common.inc.php');
|
||||
require(HESK_PATH . 'inc/admin_functions.inc.php');
|
||||
hesk_load_database_functions();
|
||||
@ -453,7 +455,10 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
||||
<div class="form-group">
|
||||
<label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<textarea class="form-control" name="message" rows="12" placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" cols="60"><?php echo $ticket['message']; ?></textarea>
|
||||
<?php
|
||||
$message = $modsForHesk_settings['rich_text_for_tickets'] ? hesk_html_entity_decode($ticket['message']) : $ticket['message'];
|
||||
?>
|
||||
<textarea class="form-control htmlEditor" name="message" rows="12" placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" cols="60"><?php echo $message; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@ -478,6 +483,28 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($modsForHesk_settings['rich_text_for_tickets']): ?>
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
tinyMCE.init({
|
||||
mode : "textareas",
|
||||
editor_selector : "htmlEditor",
|
||||
elements : "content",
|
||||
theme : "advanced",
|
||||
convert_urls : false,
|
||||
|
||||
theme_advanced_buttons1 : "cut,copy,paste,|,undo,redo,|,formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
|
||||
theme_advanced_buttons2 : "sub,sup,|,charmap,|,bullist,numlist,|,outdent,indent,insertdate,inserttime,preview,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,link,unlink,anchor,image,cleanup,code",
|
||||
theme_advanced_buttons3 : "",
|
||||
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_resizing : true
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
require_once(HESK_PATH . 'inc/footer.inc.php');
|
||||
|
@ -198,7 +198,7 @@
|
||||
|
||||
}
|
||||
|
||||
.message > ul {
|
||||
.message > * {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
@ -201,7 +201,7 @@
|
||||
|
||||
}
|
||||
|
||||
.ticketMessageBottom > ul {
|
||||
.message > * {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ require(HESK_PATH . 'modsForHesk_settings.inc.php');
|
||||
if (defined('WYSIWYG') && $hesk_settings['kb_wysiwyg'])
|
||||
{
|
||||
?>
|
||||
<script type="text/javascript" src="<?php echo HESK_PATH; ?>inc/tiny_mce/3.5.10/tiny_mce.js"></script>
|
||||
<script type="text/javascript" src="<?php echo HESK_PATH; ?>inc/tiny_mce/3.5.11/tiny_mce.js"></script>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
25
index.php
25
index.php
@ -34,6 +34,7 @@
|
||||
|
||||
define('IN_SCRIPT',1);
|
||||
define('HESK_PATH','./');
|
||||
define('WYSIWYG',1);
|
||||
|
||||
// Get all the required files and functions
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
@ -574,7 +575,29 @@ if (!$show['show']) {
|
||||
<div class="form-group">
|
||||
|
||||
<div class="col-sm-12">
|
||||
<textarea placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" name="message" id="message" class="form-control" rows="12" cols="60" <?php if (in_array('message',$_SESSION['iserror'])) {echo ' class="isError" ';} ?> ><?php if (isset($_SESSION['c_message'])) {echo stripslashes(hesk_input($_SESSION['c_message']));} ?></textarea>
|
||||
<textarea placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" name="message" id="message" class="form-control htmlEditor" rows="12" cols="60" <?php if (in_array('message',$_SESSION['iserror'])) {echo ' class="isError" ';} ?> ><?php if (isset($_SESSION['c_message'])) {echo stripslashes(hesk_input($_SESSION['c_message']));} ?></textarea>
|
||||
<?php if ($modsForHesk_settings['rich_text_for_tickets']): ?>
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
tinyMCE.init({
|
||||
mode : "textareas",
|
||||
editor_selector : "htmlEditor",
|
||||
elements : "content",
|
||||
theme : "advanced",
|
||||
convert_urls : false,
|
||||
|
||||
theme_advanced_buttons1 : "cut,copy,paste,|,undo,redo,|,formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
|
||||
theme_advanced_buttons2 : "sub,sup,|,charmap,|,bullist,numlist,|,outdent,indent,insertdate,inserttime,preview,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,link,unlink,anchor,image,cleanup,code",
|
||||
theme_advanced_buttons3 : "",
|
||||
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_resizing : true
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
23
print.php
23
print.php
@ -98,12 +98,20 @@ $replies = hesk_dbNumRows($res);
|
||||
<title><?php echo $hesk_settings['hesk_title']; ?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $hesklang['ENCODING']; ?>">
|
||||
<style type="text/css">
|
||||
body, table, td, p
|
||||
body, table, td
|
||||
{
|
||||
color : black;
|
||||
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size : <?php echo $hesk_settings['print_font_size']; ?>px;
|
||||
}
|
||||
p
|
||||
{
|
||||
color: black;
|
||||
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: <?php echo $hesk_settings['print_font_size']; ?>px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
table
|
||||
{
|
||||
border-collapse:collapse;
|
||||
@ -234,12 +242,21 @@ foreach ($hesk_settings['custom_fields'] as $k=>$v)
|
||||
echo '</table><br>';
|
||||
|
||||
// Print initial ticket message
|
||||
echo '<p>' . hesk_unhortenUrl($ticket['message']) . '</p>';
|
||||
$newMessage = hesk_unhortenUrl($ticket['message']);
|
||||
if ($modsForHesk_settings['rich_text_for_tickets'])
|
||||
{
|
||||
$newMessage = hesk_html_entity_decode($newMessage);
|
||||
}
|
||||
echo '<p>' . $newMessage . '</p>';
|
||||
|
||||
// Print replies
|
||||
while ($reply = hesk_dbFetchAssoc($res))
|
||||
{
|
||||
$reply['dt'] = hesk_date($reply['dt'], true);
|
||||
$theReply = hesk_unhortenUrl($reply['message']);
|
||||
if ($modsForHesk_settings['rich_text_for_tickets']) {
|
||||
$theReply = hesk_html_entity_decode($theReply);
|
||||
}
|
||||
|
||||
echo '
|
||||
<hr />
|
||||
@ -251,7 +268,7 @@ while ($reply = hesk_dbFetchAssoc($res))
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>' . hesk_unhortenUrl($reply['message']) . '</p>
|
||||
<div class="message">' . $theReply . '</div>
|
||||
';
|
||||
}
|
||||
|
||||
|
37
ticket.php
37
ticket.php
@ -35,6 +35,7 @@
|
||||
define('IN_SCRIPT',1);
|
||||
define('HESK_PATH','./');
|
||||
define('HESK_NO_ROBOTS',1);
|
||||
define('WYSIWYG',1);
|
||||
|
||||
/* Get all the required files and functions */
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
@ -380,7 +381,7 @@ if (!$show['show']) {
|
||||
<div class="ticketMessageBottom">
|
||||
<!-- Message -->
|
||||
<p><b><?php echo $hesklang['message']; ?>:</b></p>
|
||||
<p class="message"><?php echo hesk_html_entity_decode($ticket['message']); ?><br /> </p>
|
||||
<div class="message"><?php echo hesk_html_entity_decode($ticket['message']); ?></div>
|
||||
</div>
|
||||
<div class="ticketMessageTop">
|
||||
<!-- Custom Fields after Message -->
|
||||
@ -579,7 +580,7 @@ exit();
|
||||
|
||||
function hesk_printCustomerReplyForm($reopen=0)
|
||||
{
|
||||
global $hesklang, $hesk_settings, $trackingID, $my_email;
|
||||
global $hesklang, $hesk_settings, $trackingID, $my_email, $modsForHesk_settings;
|
||||
|
||||
// Already printed?
|
||||
if (defined('REPLY_FORM'))
|
||||
@ -597,7 +598,29 @@ function hesk_printCustomerReplyForm($reopen=0)
|
||||
<div class="form-group">
|
||||
<label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?>: <span class="important">*</span></label>
|
||||
<div class="col-sm-9">
|
||||
<textarea name="message" class="form-control" rows="12" cols="60"><?php if (isset($_SESSION['ticket_message'])) {echo stripslashes(hesk_input($_SESSION['ticket_message']));} ?></textarea>
|
||||
<textarea name="message" class="form-control htmlEditor" rows="12" cols="60"><?php if (isset($_SESSION['ticket_message'])) {echo stripslashes(hesk_input($_SESSION['ticket_message']));} ?></textarea>
|
||||
<?php if ($modsForHesk_settings['rich_text_for_tickets']): ?>
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
tinyMCE.init({
|
||||
mode : "textareas",
|
||||
editor_selector : "htmlEditor",
|
||||
elements : "content",
|
||||
theme : "advanced",
|
||||
convert_urls : false,
|
||||
|
||||
theme_advanced_buttons1 : "cut,copy,paste,|,undo,redo,|,formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
|
||||
theme_advanced_buttons2 : "sub,sup,|,charmap,|,bullist,numlist,|,outdent,indent,insertdate,inserttime,preview,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,link,unlink,anchor,image,cleanup,code",
|
||||
theme_advanced_buttons3 : "",
|
||||
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_resizing : true
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
@ -632,7 +655,11 @@ function hesk_printCustomerReplyForm($reopen=0)
|
||||
echo '<input type="hidden" name="reopen" value="1" />';
|
||||
}
|
||||
?>
|
||||
<input type="submit" value="<?php echo $hesklang['submit_reply']; ?>" class="btn btn-default" />
|
||||
<div class="form-group">
|
||||
<div class="col-sm-9 col-sm-offset-3">
|
||||
<input type="submit" value="<?php echo $hesklang['submit_reply']; ?>" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
@ -697,7 +724,7 @@ function hesk_printCustomerTicketReplies()
|
||||
<div class="ticketMessageBottom">
|
||||
<!-- Message -->
|
||||
<p><b><?php echo $hesklang['message']; ?>:</b></p>
|
||||
<p class="message"><?php echo hesk_html_entity_decode($reply['message']); ?></p>
|
||||
<div class="message"><?php echo hesk_html_entity_decode($reply['message']); ?></div>
|
||||
</div>
|
||||
<div class="ticketMessageTop">
|
||||
<?php hesk_listAttachments($reply['attachments'],$i);?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user