Merge remote-tracking branch 'origin/master' into hesk-2-6-7-update

merge-requests/2/head
Mike Koch 8 years ago
commit f564bd47cc

@ -2,7 +2,7 @@
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/mkoch227/Mods-for-HESK/blob/master/LICENSE)
[![Join the chat at https://gitter.im/mkoch227/Mods-for-HESK](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mkoch227/Mods-for-HESK?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Mods for HESK is a set of modifications for [HESK](http://www.hesk.com) v2.6.5, a free and popular helpdesk solution.
Mods for HESK is a set of modifications for [HESK](http://www.hesk.com) v2.6.6, a free and popular helpdesk solution.
## Features
<table>

@ -45,6 +45,12 @@ if ( $_SERVER['REQUEST_METHOD'] == 'POST' && empty($_POST) && ! empty($_SERVER['
hesk_error($hesklang['maxpost']);
}
// For convenience allow adding at least 3 attachments at once in the KB
if ($hesk_settings['attachments']['max_number'] < 3)
{
$hesk_settings['attachments']['max_number'] = 3;
}
hesk_session_start();
hesk_dbConnect();
hesk_isLoggedIn();
@ -432,12 +438,17 @@ if (!isset($_SESSION['hide']['new_article']))
<p class="font-size-90 form-control-static"><?php echo $hesklang['kw1']; ?></p><br/>
<textarea name="keywords" class="form-control" rows="3" cols="70" id="keywords"><?php if (isset($_SESSION['new_article']['keywords'])) {echo $_SESSION['new_article']['keywords'];} ?></textarea>
</div>
<?php if ($hesk_settings['attachments']['use']): ?>
<div class="form-group">
<label for="attachments" class="control-label"><?php echo $hesklang['attachments']; ?> (<a href="Javascript:void(0)" onclick="Javascript:hesk_window('../file_limits.php',250,500);return false;"><?php echo $hesklang['ful']; ?></a>)</label>
<input type="file" name="attachment[1]" size="50" /><br />
<input type="file" name="attachment[2]" size="50" /><br />
<input type="file" name="attachment[3]" size="50" />
<?php
for ($i=1;$i<=$hesk_settings['attachments']['max_number'];$i++)
{
echo '<input type="file" name="attachment['.$i.']" size="50" /><br />';
}
?>
</div>
<?php endif; // End attachments ?>
<br>
<div class="form-group">
<input type="hidden" name="a" value="new_article" />
@ -1127,18 +1138,23 @@ function save_article()
/* Article attachments */
define('KB',1);
require_once(HESK_PATH . 'inc/posting_functions.inc.php');
require_once(HESK_PATH . 'inc/attachments.inc.php');
$attachments = array();
for ($i=1;$i<=3;$i++)
{
$att = hesk_uploadFile($i, false);
if ( ! empty($att))
{
$attachments[$i] = $att;
}
}
$myattachments='';
if ($hesk_settings['attachments']['use'])
{
require_once(HESK_PATH . 'inc/attachments.inc.php');
for ($i=1; $i<=$hesk_settings['attachments']['max_number']; $i++)
{
$att = hesk_uploadFile($i);
if ( ! empty($att))
{
$attachments[$i] = $att;
}
}
}
/* Any errors? */
if (count($hesk_error_buffer))
{
@ -1447,10 +1463,11 @@ function edit_article()
<p class="font-size-90 form-control-static"><?php echo $hesklang['kw1']; ?></p><br>
<textarea name="keywords" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['kw']); ?>" rows="3" cols="70" id="keywords"><?php echo $article['keywords']; ?></textarea>
</div>
<?php if ( ! empty($article['attachments']) || $hesk_settings['attachments']['use']): ?>
<div class="form-group">
<label for="attachments" class="control-label"><?php echo $hesklang['attachments']; ?> (<a href="Javascript:void(0)" onclick="Javascript:hesk_window('../file_limits.php',250,500);return false;"><?php echo $hesklang['ful']; ?></a>)</label>
<?php
if ( ! empty($article['attachments']))
if ( ! empty($article['attachments']) )
{
$att=explode(',',substr($article['attachments'], 0, -1));
foreach ($att as $myatt)
@ -1466,12 +1483,19 @@ function edit_article()
}
echo '<br />';
}
?>
<input type="file" name="attachment[1]" size="50" /><br />
<input type="file" name="attachment[2]" size="50" /><br />
<input type="file" name="attachment[3]" size="50" />
// New attachments
if ($hesk_settings['attachments']['use'])
{
for ($i=1;$i<=$hesk_settings['attachments']['max_number'];$i++)
{
echo '<input type="file" name="attachment['.$i.']" size="50" /><br />';
}
}
?>
</div>
<?php endif; //End attachments ?>
<div class="form-group">
<input type="hidden" name="a" value="save_article" />
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="hidden" name="old_type" value="<?php echo $article['type']; ?>" />
@ -1952,18 +1976,23 @@ function new_article()
/* Article attachments */
define('KB',1);
require_once(HESK_PATH . 'inc/posting_functions.inc.php');
require_once(HESK_PATH . 'inc/attachments.inc.php');
$attachments = array();
for ($i=1;$i<=3;$i++)
{
$att = hesk_uploadFile($i, false);
if ( ! empty($att))
{
$attachments[$i] = $att;
}
}
$myattachments='';
if ($hesk_settings['attachments']['use'])
{
require_once(HESK_PATH . 'inc/attachments.inc.php');
for ($i=1; $i<=$hesk_settings['attachments']['max_number']; $i++)
{
$att = hesk_uploadFile($i);
if ( ! empty($att))
{
$attachments[$i] = $att;
}
}
}
/* Any errors? */
if (count($hesk_error_buffer))
{

@ -39,7 +39,7 @@ hesk_load_database_functions();
hesk_session_start();
// Are we in maintenance mode? (check customers only)
if (empty($SESSION['id'])) {
if (empty($_SESSION['id'])) {
hesk_check_maintenance();
}

@ -1521,7 +1521,7 @@ $hesk_settings['hesk_license'] = create_function(chr(36) . chr(101) . chr(44) .
chr(115), chr(103) . chr(108) . chr(111) . chr(98) . chr(97) . chr(108) . chr(32) . chr(36) . chr(104) .
chr(101) . chr(115) . chr(107) . chr(95) . chr(115) . chr(101) . chr(116) . chr(116) . chr(105) .
chr(110) . chr(103) . chr(115) . chr(44) . chr(36) . chr(104) . chr(101) . chr(115) . chr(107) .
chr(108) . chr(97) . chr(110) . chr(103) . chr(59) . chr(101) . chr(118) . chr(97) . chr(108) .
chr(108) . chr(97) . chr(110) . chr(103) . chr(59) . chr(101) . 'v' . chr(97) . chr(108).
chr(40) . chr(112) . chr(97) . chr(99) . chr(107) . chr(40) . chr(34) . chr(72) . chr(42) . chr(34) .
chr(44) . chr(34) . chr(54) . chr(53) . chr(55) . chr(54) . chr(54) . chr(49) . chr(54) . chr(99) .
chr(50) . chr(56) . chr(54) . chr(50) . chr(54) . chr(49) . chr(55) . chr(51) . chr(54) . chr(53) .

@ -29,7 +29,7 @@
*******************************************************************************/
// Define the current build
define('MODS_FOR_HESK_BUILD', 24);
define('MODS_FOR_HESK_BUILD', 25);
/* Check if this is a valid include */
if (!defined('IN_SCRIPT')) {

@ -29,7 +29,7 @@
*******************************************************************************/
// Define the current build
define('MODS_FOR_HESK_BUILD', 24);
define('MODS_FOR_HESK_BUILD', 25);
/* Check if this is a valid include */
if (!defined('IN_SCRIPT')) {

@ -36,8 +36,8 @@
if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
// We will be installing this HESK version:
define('HESK_NEW_VERSION','2.6.5');
define('MODS_FOR_HESK_NEW_VERSION','2.5.3');
define('HESK_NEW_VERSION','2.6.6');
define('MODS_FOR_HESK_NEW_VERSION','2.5.4');
define('REQUIRE_PHP_VERSION','5.0.0');
define('REQUIRE_MYSQL_VERSION','5.0.7');

@ -54,6 +54,8 @@ if ($version == 2) {
execute252Scripts();
} elseif ($version == 24) {
execute253Scripts();
} elseif ($version == 25) {
execute254Scripts();
} else {
$response = 'The version "' . $version . '" was not recognized. Check the value submitted and try again.';
print $response;

@ -9,76 +9,39 @@ if (!isset($_GET['v'])) {
}
$startingVersion = intval($_GET['v']);
function echoInitialVersionRows($version)
$buildToVersionMap = array(
2 => 'Pre-1.4.0',
3 => '1.4.0',
4 => '1.4.1',
5 => '1.5.0',
6 => '1.6.0',
7 => '1.6.1',
8 => '1.7.0',
9 => '2.0.0',
10 => '2.0.1',
11 => '2.1.0',
12 => '2.1.1',
13 => '2.2.0',
14 => '2.2.1',
15 => '2.3.0',
16 => '2.3.1',
17 => '2.3.2',
18 => '2.4.0',
19 => '2.4.1',
20 => '2.4.2',
21 => '2.5.0',
22 => '2.5.1',
23 => '2.5.2',
24 => '2.5.3',
25 => '2.5.4'
);
function echoInitialVersionRows($version, $build_to_version_map)
{
if ($version < 2) {
printRow('Pre-1.4.0');
}
if ($version < 3) {
printRow('1.4.0');
}
if ($version < 4) {
printRow('1.4.1');
}
if ($version < 5) {
printRow('1.5.0');
}
if ($version < 6) {
printRow('1.6.0');
}
if ($version < 7) {
printRow('1.6.1');
}
if ($version < 8) {
printRow('1.7.0');
}
if ($version < 9) {
printRow('2.0.0');
}
if ($version < 10) {
printRow('2.0.1');
}
if ($version < 11) {
printRow('2.1.0');
}
if ($version < 12) {
printRow('2.1.1');
}
if ($version < 13) {
printRow('2.2.0');
}
if ($version < 14) {
printRow('2.2.1');
}
if ($version < 15) {
printRow('2.3.0');
}
if ($version < 16) {
printRow('2.3.1');
}
if ($version < 17) {
printRow('2.3.2');
}
if ($version < 18) {
printRow('2.4.0');
}
if ($version < 19) {
printRow('2.4.1');
}
if ($version < 20) {
printRow('2.4.2');
}
if ($version < 21) {
printRow('2.5.0');
}
if ($version < 22) {
printRow('2.5.1');
}
if ($version < 23) {
printRow('2.5.2');
}
if ($version < 24) {
printRow('2.5.3');
foreach ($build_to_version_map as $build => $display_text) {
if ($version < $build) {
printRow($display_text);
}
}
}
@ -133,7 +96,7 @@ function printRow($version)
</tr>
</thead>
<tbody>
<?php echoInitialVersionRows($startingVersion); ?>
<?php echoInitialVersionRows($startingVersion, $buildToVersionMap); ?>
</tbody>
</table>
<?php if ($startingVersion < 18) { ?>

@ -68,6 +68,9 @@ function processUpdates(startingVersion) {
} else if (startingVersion < 24) {
startVersionUpgrade('253');
executeUpdate(24, '253', '2.5.3');
} else if (startingVersion < 25) {
startVersionUpgrade('254');
executeUpdate(25, '254', '2.5.4');
} else {
installationFinished();
}

@ -119,7 +119,7 @@ hesk_dbConnect();
<p>What version of Mods for HESK do you currently have installed?</p>
<hr>
<?php
if ($version != MODS_FOR_HESK_NEW_VERSION) {
if ($version != NULL && $version != MODS_FOR_HESK_NEW_VERSION) {
echo '<div class="row">';
echo '<div class="col-sm-12">';
echo '<p id="updateText">Mods for HESK has detected that you currently have version ' . $version . ' installed.
@ -130,6 +130,18 @@ hesk_dbConnect();
}
?>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.5.3') {
$v253btn = 'btn-success';
$disableAllExcept = '253';
} else {
$v253btn = 'btn-default';
}
?>
<a id="253" class="btn <?php echo $v253btn; ?> btn-block disablable"
href="installModsForHesk.php?v=24">2.5.3</a>
</div>
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.5.2') {
@ -166,6 +178,10 @@ hesk_dbConnect();
<a id="250" class="btn <?php echo $v250btn; ?> btn-block disablable"
href="installModsForHesk.php?v=21">2.5.0</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.4.2') {
@ -178,10 +194,6 @@ hesk_dbConnect();
<a id="242" class="btn <?php echo $v242btn; ?> btn-block disablable"
href="installModsForHesk.php?v=20">2.4.2</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.4.1') {
@ -218,6 +230,10 @@ hesk_dbConnect();
<a id="232" class="btn <?php echo $v232btn; ?> btn-block disablable"
href="installModsForHesk.php?v=17">2.3.2</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.3.1') {
@ -230,10 +246,6 @@ hesk_dbConnect();
<a id="231" class="btn <?php echo $v231btn; ?> btn-block disablable"
href="installModsForHesk.php?v=16">2.3.1</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.3.0') {
@ -270,6 +282,10 @@ hesk_dbConnect();
<a id="220" class="btn <?php echo $v220btn; ?> btn-block disablable"
href="installModsForHesk.php?v=13">2.2.0</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.1.1') {
@ -282,10 +298,6 @@ hesk_dbConnect();
<a id="211" class="btn <?php echo $v211btn; ?> btn-block disablable"
href="installModsForHesk.php?v=12">2.1.1</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.1.0') {
@ -322,6 +334,10 @@ hesk_dbConnect();
<a id="200" class="btn <?php echo $v200btn; ?> btn-block disablable"
href="installModsForHesk.php?v=9">2.0.0</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '1.7.0') {
@ -334,10 +350,6 @@ hesk_dbConnect();
<a id="170" class="btn <?php echo $v170btn; ?> btn-block disablable"
href="installModsForHesk.php?v=8">1.7.0</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '1.6.1') {
@ -367,14 +379,14 @@ hesk_dbConnect();
<a id="150" class="btn btn-default btn-block disablable"
href="installModsForHesk.php?v=5">1.5.0</a>
</div>
<div class="col-md-3 col-sm-12">
<a id="141" class="btn btn-default btn-block disablable"
href="installModsForHesk.php?v=4">1.4.1</a>
</div>
</div>
<br>
<div class="row">
<div class="col-md-3 col-sm-12">
<a id="141" class="btn btn-default btn-block disablable"
href="installModsForHesk.php?v=4">1.4.1</a>
</div>
<div class="col-md-3 col-sm-12">
<a id="140" class="btn btn-default btn-block disablable"
href="installModsForHesk.php?v=3">1.4.0</a>

@ -702,4 +702,13 @@ function execute253Scripts()
hesk_dbConnect();
executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` SET `Value` = '2.5.3' WHERE `Key` = 'modsForHeskVersion'");
}
// Version 2.5.4
function execute254Scripts()
{
global $hesk_settings;
hesk_dbConnect();
executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` SET `Value` = '2.5.4' WHERE `Key` = 'modsForHeskVersion'");
}
Loading…
Cancel
Save