Merge branch 'hesk-2-7-0-update' into '3-0-0'
HESK 2.7.0 Update See merge request !28merge-requests/29/head
commit
642adb4a75
File diff suppressed because it is too large
Load Diff
@ -1,393 +0,0 @@
|
||||
<?php
|
||||
/*******************************************************************************
|
||||
* Title: Help Desk Software HESK
|
||||
* Version: 2.6.8 from 10th August 2016
|
||||
* Author: Klemen Stirn
|
||||
* Website: http://www.hesk.com
|
||||
********************************************************************************
|
||||
* COPYRIGHT AND TRADEMARK NOTICE
|
||||
* Copyright 2005-2015 Klemen Stirn. All Rights Reserved.
|
||||
* HESK is a registered trademark of Klemen Stirn.
|
||||
* The HESK may be used and modified free of charge by anyone
|
||||
* AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT.
|
||||
* By using this code you agree to indemnify Klemen Stirn from any
|
||||
* liability that might arise from it's use.
|
||||
* Selling the code for this program, in part or full, without prior
|
||||
* written consent is expressly forbidden.
|
||||
* Using this code, in part or full, to create derivate work,
|
||||
* new scripts or products is expressly forbidden. Obtain permission
|
||||
* before redistributing this software over the Internet or in
|
||||
* any other medium. In all cases copyright and header must remain intact.
|
||||
* This Copyright is in full effect in any country that has International
|
||||
* Trade Agreements with the United States of America or
|
||||
* with the European Union.
|
||||
* Removing any of the copyright notices without purchasing a license
|
||||
* is expressly forbidden. To remove HESK copyright notice you must purchase
|
||||
* a license for this script. For more information on how to obtain
|
||||
* a license please visit the page below:
|
||||
* https://www.hesk.com/buy.php
|
||||
*******************************************************************************/
|
||||
|
||||
define('IN_SCRIPT', 1);
|
||||
define('HESK_PATH', '../');
|
||||
|
||||
/* Get all the required files and functions */
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
require(HESK_PATH . 'inc/common.inc.php');
|
||||
require(HESK_PATH . 'inc/admin_functions.inc.php');
|
||||
|
||||
$id = hesk_input(hesk_GET('i'));
|
||||
$query = hesk_input(hesk_utf8_urldecode(hesk_GET('q')));
|
||||
$type = hesk_input(hesk_GET('t', 'text'));
|
||||
$maxlen = intval(hesk_GET('m', 255));
|
||||
$query = stripslashes($query);
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML; 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<title><?php echo $hesklang['opt']; ?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=<?php echo $hesklang['ENCODING']; ?>"/>
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 5px 5px;
|
||||
padding: 0;
|
||||
background: #fff;
|
||||
color: black;
|
||||
font: 68.8%/1.5 Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p {
|
||||
color: black;
|
||||
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 1.0em;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: #AF0000;
|
||||
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 1.0em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: black;
|
||||
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 1.0em;
|
||||
}
|
||||
|
||||
.wrong {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.correct {
|
||||
color: green;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h3><?php echo $hesklang['opt']; ?></h3>
|
||||
|
||||
<p><i><?php echo $hesklang['ns']; ?></i></p>
|
||||
|
||||
<?php
|
||||
|
||||
switch ($type) {
|
||||
case 'text':
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = document.getElementById(\'o2\').value;
|
||||
window.opener.document.getElementById(\'s_' . $id . '_maxlen\').value = document.getElementById(\'o1\').value;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>' . $hesklang['custom_l'] . ':<td>
|
||||
<td><input type="text" name="o1" id="o1" value="' . $maxlen . '" size="30" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>' . $hesklang['defw'] . ':<td>
|
||||
<td><input type="text" name="o2" id="o2" value="' . $query . '" size="30" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'hidden':
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = document.getElementById(\'o1\').value;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
<p>' . $hesklang['hidden_custom_field_help'] . '</p>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>' . $hesklang['value_colon'] . '<td>
|
||||
<td><input type="text" name="o1" id="o1" value="' . $query . '" size="30" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'readonly':
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = document.getElementById(\'o1\').value;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
<p>' . $hesklang['readonly_custom_field_help'] . '</p>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>' . $hesklang['value_colon'] . '<td>
|
||||
<td><input type="text" name="o1" id="o1" value="' . $query . '" size="30" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'textarea':
|
||||
if (strpos($query, '#') !== false) {
|
||||
list($rows, $cols) = explode('#', $query);
|
||||
} else {
|
||||
$rows = '';
|
||||
$cols = '';
|
||||
}
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = document.getElementById(\'o1\').value + "#" + document.getElementById(\'o2\').value;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>' . $hesklang['rows'] . ':<td>
|
||||
<td><input type="text" name="o1" id="o1" value="' . $rows . '" size="5" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>' . $hesklang['cols'] . ':<td>
|
||||
<td><input type="text" name="o2" id="o2" value="' . $cols . '" size="5" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'radio':
|
||||
$options = str_replace('#HESK#', "\n", $query);
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
text = document.getElementById(\'o1\').value;
|
||||
text = text.replace(/^\s\s*/, \'\').replace(/\s\s*$/, \'\');
|
||||
text = escape(text);
|
||||
if(text.indexOf(\'%0D%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0D\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D/g ;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(\'' . addslashes($hesklang['atl2']) . '\');
|
||||
return false;
|
||||
}
|
||||
text = unescape(text.replace(re_nlchar,\'#HESK#\'));
|
||||
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = text;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>' . $hesklang['opt2'] . '</p>
|
||||
<textarea name="o1" id="o1" rows="6" cols="40">' . $options . '</textarea>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'select':
|
||||
$query = str_replace('{HESK_SELECT}', '', $query, $show_select);
|
||||
|
||||
$options = str_replace('#HESK#', "\n", $query);
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
text = document.getElementById(\'o1\').value;
|
||||
text = text.replace(/^\s\s*/, \'\').replace(/\s\s*$/, \'\');
|
||||
text = escape(text);
|
||||
if(text.indexOf(\'%0D%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0D\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D/g ;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(\'' . addslashes($hesklang['atl2']) . '\');
|
||||
return false;
|
||||
}
|
||||
text = unescape(text.replace(re_nlchar,\'#HESK#\'));
|
||||
|
||||
if (document.getElementById(\'show_select\').checked)
|
||||
{
|
||||
text = "{HESK_SELECT}" + text;
|
||||
}
|
||||
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = text;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>' . $hesklang['opt3'] . '</p>
|
||||
<p><label><input type="checkbox" name="show_select" id="show_select" value="1" ' . ($show_select ? 'checked="checked"' : '') . ' /> ' . $hesklang['show_select'] . '</label></p>
|
||||
<textarea name="o1" id="o1" rows="6" cols="40">' . $options . '</textarea>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'checkbox':
|
||||
$options = str_replace('#HESK#', "\n", $query);
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
text = document.getElementById(\'o1\').value;
|
||||
text = text.replace(/^\s\s*/, \'\').replace(/\s\s*$/, \'\');
|
||||
text = escape(text);
|
||||
if(text.indexOf(\'%0D%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0D\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D/g ;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(\'' . addslashes($hesklang['atl2']) . '\');
|
||||
return false;
|
||||
}
|
||||
text = unescape(text.replace(re_nlchar,\'#HESK#\'));
|
||||
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = text;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>' . $hesklang['opt4'] . '</p>
|
||||
<textarea name="o1" id="o1" rows="6" cols="40">' . $options . '</textarea>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'date':
|
||||
echo '<p>' . $hesklang['date_custom_field_text'] . '</p>';
|
||||
break;
|
||||
case 'multiselect':
|
||||
$options = str_replace('#HESK#', "\n", $query);
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
text = document.getElementById(\'o1\').value;
|
||||
text = text.replace(/^\s\s*/, \'\').replace(/\s\s*$/, \'\');
|
||||
text = escape(text);
|
||||
if(text.indexOf(\'%0D%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0D\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D/g ;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(\'' . addslashes($hesklang['atl2']) . '\');
|
||||
return false;
|
||||
}
|
||||
text = unescape(text.replace(re_nlchar,\'#HESK#\'));
|
||||
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = text;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>' . $hesklang['multiple_select_custom_field_text'] . '</p>
|
||||
<textarea name="o1" id="o1" rows="6" cols="40">' . $options . '</textarea>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'email':
|
||||
$ccSelected = $query == 'cc' ? 'selected="selected"' : '';
|
||||
$bccSelected = $query == 'bcc' ? 'selected="selected"' : '';
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
var dropdown = document.getElementById(\'o1\');
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = dropdown.options[dropdown.selectedIndex].value;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
<p>' . $hesklang['email_custom_field_help'] . '</p>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>' . $hesklang['email_custom_field_label'] . ':</td>
|
||||
<td>
|
||||
<select name="o1" id="o1">
|
||||
<option value="cc" ' . $ccSelected . '>' . $hesklang['cc'] . '</option>
|
||||
<option value="bcc" ' . $bccSelected . '>' . $hesklang['bcc'] . '</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
default:
|
||||
die('Invalid type');
|
||||
}
|
||||
?>
|
||||
|
||||
<p align="center"><a href="#" onclick="Javascript:window.close()"><?php echo $hesklang['cwin']; ?></a></p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php
|
||||
exit();
|
||||
?>
|
@ -0,0 +1,249 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of HESK - PHP Help Desk Software.
|
||||
*
|
||||
* (c) Copyright Klemen Stirn. All rights reserved.
|
||||
* http://www.hesk.com
|
||||
*
|
||||
* For the full copyright and license agreement information visit
|
||||
* http://www.hesk.com/eula.php
|
||||
*
|
||||
*/
|
||||
|
||||
/* Check if this is a valid include */
|
||||
if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
|
||||
|
||||
// Get and append custom fields setup to the settings
|
||||
hesk_load_custom_fields();
|
||||
|
||||
// Save number of custom fields
|
||||
$hesk_settings['num_custom_fields'] = count($hesk_settings['custom_fields']);
|
||||
|
||||
// Load custom fields for admin functions
|
||||
if (function_exists('hesk_checkPermission'))
|
||||
{
|
||||
foreach ($hesk_settings['custom_fields'] as $k => $v)
|
||||
{
|
||||
$hesk_settings['possible_ticket_list'][$k] = $hesk_settings['custom_fields'][$k]['title'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*** FUNCTIONS ***/
|
||||
|
||||
|
||||
function hesk_load_custom_fields($category=0, $use_cache=1)
|
||||
{
|
||||
global $hesk_settings, $hesklang;
|
||||
|
||||
// Do we have a cached version available
|
||||
$cache_dir = dirname(dirname(__FILE__)).'/'.$hesk_settings['cache_dir'].'/';
|
||||
$cache_file = $cache_dir . 'cf_' . sha1($hesk_settings['language']).'.cache.php';
|
||||
|
||||
if ($use_cache && file_exists($cache_file))
|
||||
{
|
||||
require($cache_file);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Get custom fields from the database
|
||||
$hesk_settings['custom_fields'] = array();
|
||||
|
||||
// Make sure we have database connection
|
||||
hesk_load_database_functions();
|
||||
hesk_dbConnect();
|
||||
|
||||
$res = hesk_dbQuery("SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."custom_fields` WHERE `use` IN ('1', '2') ORDER BY `place` ASC, `order` ASC");
|
||||
while ($row = hesk_dbFetchAssoc($res))
|
||||
{
|
||||
$id = 'custom' . $row['id'];
|
||||
unset($row['id']);
|
||||
|
||||
// Let's set field name for current language (or the first one we find)
|
||||
$names = json_decode($row['name'], true);
|
||||
$row['name'] = (isset($names[$hesk_settings['language']])) ? $names[$hesk_settings['language']] : reset($names);
|
||||
|
||||
// Name for display in ticket list; punctuation removed and shortened
|
||||
$row['title'] = hesk_remove_punctuation($row['name']);
|
||||
$row['title'] = strlen($row['title']) > 30 ? substr($row['title'], 0, 30) . '...' : $row['title'];
|
||||
|
||||
// A version with forced punctuation
|
||||
$row['name:'] = in_array(substr($row['name'], -1), array(':', '?', '!', '.') ) ? $row['name'] : $row['name'] . ':';
|
||||
|
||||
// Decode categories
|
||||
$row['category'] = strlen($row['category']) ? json_decode($row['category'], true) : array();
|
||||
|
||||
// Decode options
|
||||
$row['value'] = json_decode($row['value'], true);
|
||||
|
||||
// Add to custom_fields array
|
||||
$hesk_settings['custom_fields'][$id] = $row;
|
||||
}
|
||||
|
||||
// Try to cache results
|
||||
if ($use_cache && (is_dir($cache_dir) || ( @mkdir($cache_dir, 0777) && is_writable($cache_dir) ) ) )
|
||||
{
|
||||
// Is there an index.htm file?
|
||||
if ( ! file_exists($cache_dir.'index.htm'))
|
||||
{
|
||||
@file_put_contents($cache_dir.'index.htm', '');
|
||||
}
|
||||
|
||||
// Write data
|
||||
@file_put_contents($cache_file, '<?php if (!defined(\'IN_SCRIPT\')) {die();} $hesk_settings[\'custom_fields\']=' . var_export($hesk_settings['custom_fields'], true) . ';' );
|
||||
}
|
||||
|
||||
return true;
|
||||
} // END hesk_load_custom_fields()
|
||||
|
||||
|
||||
function hesk_is_custom_field_in_category($custom_id, $category_id)
|
||||
{
|
||||
global $hesk_settings;
|
||||
|
||||
return (
|
||||
empty($hesk_settings['custom_fields'][$custom_id]['category']) ||
|
||||
in_array($category_id, $hesk_settings['custom_fields'][$custom_id]['category'])
|
||||
) ? true : false;
|
||||
} // END hesk_is_custom_field_in_category()
|
||||
|
||||
|
||||
function hesk_custom_field_type($type)
|
||||
{
|
||||
global $hesklang;
|
||||
|
||||
switch ($type)
|
||||
{
|
||||
case 'text':
|
||||
return $hesklang['stf'];
|
||||
case 'textarea':
|
||||
return $hesklang['stb'];
|
||||
case 'radio':
|
||||
return $hesklang['srb'];
|
||||
case 'select':
|
||||
return $hesklang['ssb'];
|
||||
case 'checkbox':
|
||||
return $hesklang['scb'];
|
||||
case 'email':
|
||||
return $hesklang['email'];
|
||||
case 'date':
|
||||
return $hesklang['date'];
|
||||
case 'hidden':
|
||||
return $hesklang['sch'];
|
||||
case 'readonly':
|
||||
return $hesklang['readonly'];
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
} // END hesk_custom_field_type()
|
||||
|
||||
|
||||
function hesk_custom_date_display_format($timestamp, $format = 'F j, Y')
|
||||
{
|
||||
global $hesklang;
|
||||
|
||||
if ($timestamp == '')
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
if ( ! is_int($timestamp))
|
||||
{
|
||||
$timestamp = $timestamp * 1;
|
||||
}
|
||||
|
||||
if ($hesklang['LANGUAGE']=='English')
|
||||
{
|
||||
return gmdate($format, $timestamp);
|
||||
}
|
||||
|
||||
// Attempt to translate date for non-English users
|
||||
|
||||
$translate_months = array(
|
||||
'January' => $hesklang['m1'],
|
||||
'February' => $hesklang['m2'],
|
||||
'March' => $hesklang['m3'],
|
||||
'April' => $hesklang['m4'],
|
||||
'May' => $hesklang['m5'],
|
||||
'June' => $hesklang['m6'],
|
||||
'July' => $hesklang['m7'],
|
||||
'August' => $hesklang['m8'],
|
||||
'September' => $hesklang['m9'],
|
||||
'October' => $hesklang['m10'],
|
||||
'November' => $hesklang['m11'],
|
||||
'December' => $hesklang['m12']
|
||||
);
|
||||
|
||||
$translate_months_short = array(
|
||||
'Jan' => $hesklang['ms01'],
|
||||
'Feb' => $hesklang['ms02'],
|
||||
'Mar' => $hesklang['ms03'],
|
||||
'Apr' => $hesklang['ms04'],
|
||||
'May' => $hesklang['ms05'],
|
||||
'Jun' => $hesklang['ms06'],
|
||||
'Jul' => $hesklang['ms07'],
|
||||
'Aug' => $hesklang['ms08'],
|
||||
'Sep' => $hesklang['ms09'],
|
||||
'Oct' => $hesklang['ms10'],
|
||||
'Nov' => $hesklang['ms11'],
|
||||
'Dec' => $hesklang['ms12']
|
||||
);
|
||||
|
||||
$translate_days = array(
|
||||
'Monday' => $hesklang['d1'],
|
||||
'Tuesday' => $hesklang['d2'],
|
||||
'Wednesday' => $hesklang['d3'],
|
||||
'Thursday' => $hesklang['d4'],
|
||||
'Friday' => $hesklang['d5'],
|
||||
'Saturday' => $hesklang['d6'],
|
||||
'Sunday' => $hesklang['d0']
|
||||
);
|
||||
|
||||
$translate_days_short = array(
|
||||
'Mon' => $hesklang['mo'],
|
||||
'Tuw' => $hesklang['tu'],
|
||||
'Wes' => $hesklang['we'],
|
||||
'Thu' => $hesklang['th'],
|
||||
'Fri' => $hesklang['fr'],
|
||||
'Sat' => $hesklang['sa'],
|
||||
'Sun' => $hesklang['su']
|
||||
);
|
||||
|
||||
$date_translate = array();
|
||||
|
||||
if (strpos($format, 'F') !== false)
|
||||
{
|
||||
$date_translate = array_merge($date_translate, $translate_months);
|
||||
}
|
||||
|
||||
if (strpos($format, 'M') !== false)
|
||||
{
|
||||
$date_translate = array_merge($date_translate, $translate_months_short);
|
||||
}
|
||||
|
||||
if (strpos($format, 'l') !== false)
|
||||
{
|
||||
$date_translate = array_merge($date_translate, $translate_days);
|
||||
}
|
||||
|
||||
if (strpos($format, 'D') !== false)
|
||||
{
|
||||
$date_translate = array_merge($date_translate, $translate_days_short);
|
||||
}
|
||||
|
||||
if (count($date_translate))
|
||||
{
|
||||
return str_replace( array_keys($date_translate), array_values($date_translate), gmdate($format, $timestamp));
|
||||
}
|
||||
|
||||
return gmdate($format, $timestamp);
|
||||
|
||||
} // END hesk_custom_date_display_format()
|
||||
|
||||
|
||||
function hesk_remove_punctuation($in)
|
||||
{
|
||||
return rtrim($in, ':?!.');
|
||||
} // END hesk_remove_punctuation()
|
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of HESK - PHP Help Desk Software.
|
||||
*
|
||||
* (c) Copyright Klemen Stirn. All rights reserved.
|
||||
* http://www.hesk.com
|
||||
*
|
||||
* For the full copyright and license agreement information visit
|
||||
* http://www.hesk.com/eula.php
|
||||
*
|
||||
*/
|
||||
|
||||
// Check if this is a valid include
|
||||
if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
|
||||
|
||||
// Auto-select first empty or error field on non-staff pages?
|
||||
if (defined('AUTOFOCUS'))
|
||||
{
|
||||
?>
|
||||
<script language="javascript">
|
||||
(function(){
|
||||
var forms = document.forms || [];
|
||||
for(var i = 0; i < forms.length; i++)
|
||||
{
|
||||
for(var j = 0; j < forms[i].length; j++)
|
||||
{
|
||||
if(
|
||||
!forms[i][j].readonly != undefined &&
|
||||
forms[i][j].type != "hidden" &&
|
||||
forms[i][j].disabled != true &&
|
||||
forms[i][j].style.display != 'none' &&
|
||||
(forms[i][j].className == 'isError' || forms[i][j].className == 'isNotice' || forms[i][j].value == '')
|
||||
)
|
||||
{
|
||||
forms[i][j].focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
// Users online
|
||||
if (defined('SHOW_ONLINE'))
|
||||
{
|
||||
hesk_printOnline();
|
||||
}
|
||||
|
||||
// The closing div here is to close the content area on each page. Annoying, but necessary.
|
||||
if (defined('ADMIN_PAGE')) {
|
||||
echo '
|
||||
</div>
|
||||
<footer class="main-footer">';
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
The code below handles HESK licensing. Removing or modifying this code without
|
||||
purchasing a HESK license is strictly prohibited.
|
||||
|
||||
To purchase a HESK license and support future HESK development please visit:
|
||||
https://www.hesk.com/buy.php
|
||||
*******************************************************************************/
|
||||
$hesk_settings['hesk_license']('HMgPSAxOw0KaWYgKGZpbGVfZXhpc3RzKEhFU0tfUEFUSCAuI
|
||||
CdoZXNrX2xpY2Vuc2UucGhwJykpDQp7DQokaCA9ICghZW1wdHkoJF9TRVJWRVJbJ0hUVFBfSE9TVCddK
|
||||
SkgPyAkX1NFUlZFUlsnSFRUUF9IT1NUJ10gOiAoKCFlbXB0eSgkX1NFUlZFUlsnU0VSVkVSX05BTUUnX
|
||||
SkpID8gJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10gOiBnZXRlbnYoJ1NFUlZFUl9OQU1FJykpOw0KJGggP
|
||||
SBzdHJfcmVwbGFjZSgnd3d3LicsJycsc3RydG9sb3dlcigkaCkpOw0KaW5jbHVkZShIRVNLX1BBVEggL
|
||||
iAnaGVza19saWNlbnNlLnBocCcpOw0KaWYgKGlzc2V0KCRoZXNrX3NldHRpbmdzWydsaWNlbnNlJ10pI
|
||||
CYmIHN0cnBvcygkaGVza19zZXR0aW5nc1snbGljZW5zZSddLHNoYTEoJGguJ2gzJkZwMiNMYUEmNTkhd
|
||||
yg4LlpjXSordVI1MTInKSkgIT09IGZhbHNlKQ0Kew0KJHMgPSAwOw0KfQ0KZWxzZQ0Kew0KZWNobyAnP
|
||||
HAgc3R5bGU9InRleHQtYWxpZ246Y2VudGVyO2NvbG9yOnJlZDsiPklOVkFMSUQgTElDRU5TRSAoTk9UI
|
||||
FJFR0lTVEVSRUQgRk9SICcuJGguJykhPC9wPic7DQp9DQp9DQppZiAoJHMpDQp7DQplY2hvICc8cCBzd
|
||||
HlsZT0idGV4dC1hbGlnbjpjZW50ZXIiPjxzcGFuIGNsYXNzPSJzbWFsbGVyIj4mbmJzcDs8YnIgLz5Qb
|
||||
3dlcmVkIGJ5IDxhIGhyZWY9Imh0dHA6Ly93d3cuaGVzay5jb20iIGNsYXNzPSJzbWFsbGVyIiB0aXRsZ
|
||||
T0iRnJlZSBQSFAgSGVscCBEZXNrIFNvZnR3YXJlIj5IZWxwIERlc2sgU29mdHdhcmU8L2E+IDxiPkhFU
|
||||
0s8L2I+LCBicm91Z2h0IHRvIHlvdSBieSA8YSBocmVmPSJodHRwczovL3d3dy5zeXNhaWQuY29tLz91d
|
||||
G1fc291cmNlPUhlc2smYW1wO3V0bV9tZWRpdW09Y3BjJmFtcDt1dG1fY2FtcGFpZ249SGVza1Byb2R1Y
|
||||
3RfVG9fSFAiPlN5c0FpZDwvYT48L3NwYW4+PC9wPic7DQp9DQplY2hvICc8L3RkPjwvdHI+PC90YWJsZ
|
||||
T48L2Rpdj4nOw0KaW5jbHVkZShIRVNLX1BBVEggLiAnZm9vdGVyLnR4dCcpOw0KZWNobyAnPC9ib2R5P
|
||||
jwvaHRtbD4nOw==',"\112");
|
||||
|
||||
if (defined('ADMIN_PAGE')) {
|
||||
echo '</footer>';
|
||||
}
|
||||
|
||||
exit();
|
Loading…
Reference in New Issue