Merge pull request #322 from mkoch227/2-4-1-fixes

2.4.1 Changes
merge-requests/2/head v2.4.1
Mike Koch 9 years ago
commit 88c8506cf3

@ -864,11 +864,13 @@ if ( defined('HESK_DEMO') )
</label>
<div class="col-sm-6 form-inline">
<?php
$on = $modsForHesk_settings['rich_text_for_tickets'] ? 'checked' : '';
$off = $modsForHesk_settings['rich_text_for_tickets'] ? '' : 'checked';
$both = $modsForHesk_settings['rich_text_for_tickets'] && $modsForHesk_settings['rich_text_for_tickets_for_customers'] ? 'checked' : '';
$staff = $modsForHesk_settings['rich_text_for_tickets'] && !$modsForHesk_settings['rich_text_for_tickets_for_customers'] ? 'checked' : '';
$no = $modsForHesk_settings['rich_text_for_tickets'] && $modsForHesk_settings['rich_text_for_tickets_for_customers'] ? '' : 'checked';
echo '
<div class="radio"><label><input type="radio" name="rich_text_for_tickets" value="0" '.$off.'> '.$hesklang['off'].'</label></div>&nbsp;&nbsp;&nbsp;
<div class="radio"><label><input type="radio" name="rich_text_for_tickets" value="1" '.$on.'> '.$hesklang['on'].'</label></div>
<div class="radio"><label><input type="radio" name="rich_text_for_tickets" value="0" '.$no.'> '.$hesklang['off'].'</label></div>&nbsp;&nbsp;&nbsp;
<div class="radio"><label><input type="radio" name="rich_text_for_tickets" value="1" '.$staff.'> '.$hesklang['staff_only'].'</label></div>&nbsp;&nbsp;&nbsp;
<div class="radio"><label><input type="radio" name="rich_text_for_tickets" value="2" '.$both.'> '.$hesklang['on'].'</label></div>
';
?>
</div>

@ -516,7 +516,17 @@ $set['mfh_attachments'] = empty($_POST['email_attachments']) ? 0 : 1;
$set['show_number_merged'] = empty($_POST['show_number_merged']) ? 0 : 1;
$set['request_location'] = empty($_POST['request_location']) ? 0 : 1;
$set['category_order_column'] = empty($_POST['category_order_column']) ? 'cat_order' : 'name';
$set['rich_text_for_tickets'] = empty($_POST['rich_text_for_tickets']) ? 0 : 1;
$rich_text_setting = hesk_POST('rich_text_for_tickets', 0);
if ($rich_text_setting == 0) {
$set['rich_text_for_tickets'] = 0;
$set['rich_text_for_tickets_for_customers'] = 0;
} elseif ($rich_text_setting == 1) {
$set['rich_text_for_tickets'] = 1;
$set['rich_text_for_tickets_for_customers'] = 0;
} else {
$set['rich_text_for_tickets'] = 1;
$set['rich_text_for_tickets_for_customers'] = 1;
}
$set['statuses_order_column'] = empty($_POST['statuses_order_column']) ? 'sort' : 'name';
$set['kb_attach_dir'] = hesk_POST('kb_attach_dir', 'attachments');
@ -596,7 +606,10 @@ $modsForHesk_settings[\'rich_text_for_tickets\'] = '.$set['rich_text_for_tickets
$modsForHesk_settings[\'statuses_order_column\'] = \''.$set['statuses_order_column'].'\';
//-- Directory to store knowledgebase articles in.
$modsForHesk_settings[\'kb_attach_dir\'] = \''.$set['kb_attach_dir'].'\';';
$modsForHesk_settings[\'kb_attach_dir\'] = \''.$set['kb_attach_dir'].'\';
//-- Setting for using rich-text editor for customers. 0 = Disable, 1 = Enable
$modsForHesk_settings[\'rich_text_for_tickets_for_customers\'] = '.$set['rich_text_for_tickets_for_customers'].';';
// Write the file
if ( ! file_put_contents(HESK_PATH . 'modsForHesk_settings.inc.php', $modsForHesk_file_content) )

@ -45,6 +45,10 @@ function mfh_listAttachments($attachments='', $reply=0, $is_staff)
echo '<span data-toggle="tooltip" title="'.$hesklang['click_to_preview'].'">
<img src="'.$path.'" alt="'.$hesklang['image'].'" data-toggle="modal" data-target="#modal-attachment-'.$att_id.'">
</span>';
$download_path = '';
if ($is_staff) {
$download_path = '../';
}
echo '<div class="modal fade" id="modal-attachment-'.$att_id.'" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
@ -57,7 +61,7 @@ function mfh_listAttachments($attachments='', $reply=0, $is_staff)
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">'.$hesklang['close_modal'].'</button>
<a href="../download_attachment.php?att_id='.$att_id.'&amp;track='.$trackingID.'" class="btn btn-success">'.$hesklang['dnl'].'</a>
<a href="'.$download_path.'download_attachment.php?att_id='.$att_id.'&amp;track='.$trackingID.'" class="btn btn-success">'.$hesklang['dnl'].'</a>
</div>
</div>
</div>
@ -78,11 +82,14 @@ function mfh_listAttachments($attachments='', $reply=0, $is_staff)
echo '<td>
<div class="btn-group">';
/* Can edit and delete tickets? */
if ($is_staff && $can_edit && $can_delete)
{
echo '<a class="btn btn-danger" href="admin_ticket.php?delatt='.$att_id.'&amp;reply='.$reply.'&amp;track='.$trackingID.'&amp;Refresh='.mt_rand(10000,99999).'&amp;token='.hesk_token_echo(0).'" onclick="return hesk_confirmExecute(\''.hesk_makeJsString($hesklang['pda']).'\');" data-toggle="tooltip" data-placement="top" data-original-title="'.$hesklang['delete'].'"><i class="fa fa-times"></i></a> ';
$download_path = '';
if ($is_staff) {
$download_path = '../';
if ($can_edit && $can_delete) {
echo '<a class="btn btn-danger" href="admin_ticket.php?delatt='.$att_id.'&amp;reply='.$reply.'&amp;track='.$trackingID.'&amp;Refresh='.mt_rand(10000,99999).'&amp;token='.hesk_token_echo(0).'" onclick="return hesk_confirmExecute(\''.hesk_makeJsString($hesklang['pda']).'\');" data-toggle="tooltip" data-placement="top" data-original-title="'.$hesklang['delete'].'"><i class="fa fa-times"></i></a> ';
}
}
echo '<a class="btn btn-success" href="../download_attachment.php?att_id='.$att_id.'&amp;track='.$trackingID.'"
echo '<a class="btn btn-success" href="'.$download_path.'download_attachment.php?att_id='.$att_id.'&amp;track='.$trackingID.'"
data-toggle="tooltip" data-placement="top" data-original-title="'.$hesklang['dnl'].'">
<i class="fa fa-arrow-down"></i>
</a>';

@ -576,7 +576,7 @@ if (!$show['show']) {
<div class="col-sm-12">
<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']): ?>
<?php if ($modsForHesk_settings['rich_text_for_tickets_for_customers']): ?>
<script type="text/javascript">
/* <![CDATA[ */
tinyMCE.init({

@ -37,7 +37,7 @@ if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
// We will be installing this HESK version:
define('HESK_NEW_VERSION','2.6.4');
define('MODS_FOR_HESK_NEW_VERSION','2.4.0');
define('MODS_FOR_HESK_NEW_VERSION','2.4.1');
define('REQUIRE_PHP_VERSION','5.0.0');
define('REQUIRE_MYSQL_VERSION','5.0.7');

@ -48,6 +48,9 @@ if ($version == 1) {
} elseif ($version == 240) {
execute240Scripts();
execute240FileUpdate();
} elseif ($version == 241) {
execute240Scripts();
execute240FileUpdate();
} else {
$response = 'The version "'.$version.'" was not recognized. Check the value submitted and try again.';
print $response;

@ -50,6 +50,9 @@ function processUpdates(startingVersion) {
} else if (startingVersion < 240) {
startVersionUpgrade('240');
executeUpdate(240, '240', '2.4.0');
} else if (startingVersion < 241) {
startVersionUpgrade('241');
executeUpdate(241, '241', '2.4.1');
} else {
installationFinished();
}

@ -137,6 +137,17 @@ hesk_dbConnect();
}
?>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.4.0') {
$v240btn = 'btn-success';
$disableAllExcept = '240';
} else {
$v240btn = 'btn-default';
}
?>
<a id="240" class="btn <?php echo $v240btn; ?> btn-block disablable" href="installModsForHesk.php?v=240">v2.4.0</a>
</div>
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.3.2') {
@ -170,6 +181,9 @@ hesk_dbConnect();
?>
<a id="230" class="btn <?php echo $v230btn; ?> btn-block disablable" href="installModsForHesk.php?v=230">v2.3.0</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.2.1') {
@ -181,9 +195,6 @@ hesk_dbConnect();
?>
<a id="221" class="btn <?php echo $v221btn; ?> btn-block disablable" href="installModsForHesk.php?v=221">v2.2.1</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.2.0') {
@ -217,6 +228,9 @@ hesk_dbConnect();
?>
<a id="210" class="btn <?php echo $v210btn; ?> btn-block disablable" href="installModsForHesk.php?v=210">v2.1.0</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.0.1') {
@ -228,9 +242,6 @@ hesk_dbConnect();
?>
<a id="201" class="btn <?php echo $v201btn; ?> btn-block disablable" href="installModsForHesk.php?v=201">v2.0.1</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.0.0') {
@ -264,6 +275,9 @@ hesk_dbConnect();
?>
<a id="161" class="btn <?php echo $v161btn; ?> btn-block disablable" href="installModsForHesk.php?v=161">v1.6.1</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
@ -276,9 +290,6 @@ hesk_dbConnect();
?>
<a id="160" class="btn <?php echo $v160btn; ?> btn-block disablable" href="installModsForHesk.php?v=160">v1.6.0</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<a id="150" class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=150">v1.5.0</a>
</div>
@ -288,12 +299,12 @@ hesk_dbConnect();
<div class="col-md-3 col-sm-12">
<a id="140" class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=140">v1.4.0</a>
</div>
<div class="col-md-3 col-sm-12">
<a id="130" class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=130">v1.3.0</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<a id="130" class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=130">v1.3.0</a>
</div>
<div class="col-md-3 col-sm-12">
<a id="124" class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=124">v1.2.4</a>
</div>

@ -650,5 +650,30 @@ $modsForHesk_settings[\'rich_text_for_tickets\'] = 0;';
$modsForHesk_settings[\'kb_attach_dir\'] = \''.$hesk_settings['attach_dir'].'\';';
}
return file_put_contents(HESK_PATH.'modsForHesk_settings.inc.php', $file);
}
// END Version 2.4.0
// BEGIN Version 2.4.1
function execute241Scripts() {
global $hesk_settings;
hesk_dbConnect();
executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.4.1' WHERE `Key` = 'modsForHeskVersion'");
}
function execute241FileUpdate() {
$file = file_get_contents(HESK_PATH . 'modsForHesk_settings.inc.php');
if (strpos($file, '$modsForHesk_settings[\'rich_text_for_tickets_for_customers\']') === false)
{
$file .= '
//-- Setting for using rich-text editor for customers. 0 = Disable, 1 = Enable
$modsForHesk_settings[\'rich_text_for_tickets_for_customers\'] = 0;';
}
return file_put_contents(HESK_PATH.'modsForHesk_settings.inc.php', $file);
}

@ -58,4 +58,7 @@ $modsForHesk_settings['rich_text_for_tickets'] = 0;
$modsForHesk_settings['statuses_order_column'] = 'sort';
//-- Directory to store knowledgebase articles in.
$modsForHesk_settings['kb_attach_dir'] = 'attachments';
$modsForHesk_settings['kb_attach_dir'] = 'attachments';
//-- Setting for using rich-text editor for customers. 0 = Disable, 1 = Enable
$modsForHesk_settings['rich_text_for_tickets_for_customers'] = 0;

@ -205,7 +205,7 @@ $ticket['status'] = $ticket['status'] == $defaultNewTicketStatus['ID'] ? $defaul
$res = hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` SET `lastchange`=NOW(), `status`='{$ticket['status']}', `replies`=`replies`+1, `lastreplier`='0' WHERE `id`='{$ticket['id']}' LIMIT 1");
// Insert reply into database
$html = $modsForHesk_settings['rich_text_for_tickets'];
$html = $modsForHesk_settings['rich_text_for_tickets_for_customers'];
hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."replies` (`replyto`,`name`,`message`,`dt`,`attachments`, `html`) VALUES ({$ticket['id']},'".hesk_dbEscape($ticket['name'])."','".hesk_dbEscape($message)."',NOW(),'".hesk_dbEscape($myattachments)."','".$html."')");

@ -448,7 +448,7 @@ $tmpvar['latitude'] = hesk_POST('latitude');
$tmpvar['longitude'] = hesk_POST('longitude');
// Set html
$tmpvar['html'] = $modsForHesk_settings['rich_text_for_tickets'];
$tmpvar['html'] = $modsForHesk_settings['rich_text_for_tickets_for_customers'];
// Should the helpdesk validate emails?
$createTicket = true;

@ -606,7 +606,7 @@ function hesk_printCustomerReplyForm($reopen=0)
<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 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']): ?>
<?php if ($modsForHesk_settings['rich_text_for_tickets_for_customers']): ?>
<script type="text/javascript">
/* <![CDATA[ */
tinyMCE.init({

Loading…
Cancel
Save