Browse Source

Start working on settings

merge-requests/1/head
Mike Koch 6 years ago
parent
commit
1d079a5336
  1. 66
      admin/admin_settings.php
  2. 10
      admin/calendar.php
  3. 5
      calendar.php
  4. 2
      install/mods-for-hesk/sql/installSql.php
  5. 1
      js/calendar/mods-for-hesk-calendar.js
  6. 7
      language/en/text.php

66
admin/admin_settings.php

@ -552,6 +552,14 @@ if (defined('HESK_DEMO')) {
<li class="active"><a href="#general" data-toggle="tab"><?php echo $hesklang['tab_1']; ?></a></li>
<li><a href="#helpdesk" data-toggle="tab"><?php echo $hesklang['tab_2']; ?></a></li>
<li><a href="#knowledgebase" data-toggle="tab"><?php echo $hesklang['tab_3']; ?></a></li>
<li>
<a href="#calendar" data-toggle="tab"><?php echo $hesklang['calendar_title_case']; ?>
<span class="label label-primary" data-toggle="tooltip"
title="<?php echo $hesklang['added_in_mods_for_hesk']; ?>">
<?php echo $hesklang['mods_for_hesk_acronym']; ?>
</span>
</a>
</li>
<li><a href="#customFields" data-toggle="tab"><?php echo $hesklang['tab_4']; ?></a></li>
<li><a href="#email" data-toggle="tab"><?php echo $hesklang['tab_6']; ?></a></li>
<li><a href="#ticket-list" data-toggle="tab"><?php echo $hesklang['tab_7']; ?></a></li>
@ -1970,6 +1978,64 @@ if (defined('HESK_DEMO')) {
</div>
</div>
<!-- Calendar Tab -->
<div class="tab-pane fade in" id="calendar">
<h6 class="bold"><?php echo $hesklang['calendar_settings']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<label for="enable-calendar" class="col-sm-4 col-xs-12 control-label">
<?php echo $hesklang['enable_calendar']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['custom_field_setting']; ?>"
data-content="<?php echo $hesklang['custom_field_setting_help']; ?>"></i>
</label>
<div class="col-sm-8 form-inline">
<?php
$on = $modsForHesk_settings['enable_calendar'] == 1 ? 'checked="checked"' : '';
$off = $modsForHesk_settings['enable_calendar'] ? '' : 'checked="checked"';
$only = $modsForHesk_settings['enable_calendar'] == 2 ? 'checked="checked"' : '';
echo '
<div class="radio"><label><input type="radio" name="s_enable_calendar" value="1" ' . $on . ' /> ' . $hesklang['yes_enable_calendar'] . '</label></div><br>
<div class="radio"><label><input type="radio" name="s_enable_calendar" value="2" ' . $only . ' /> ' . $hesklang['yes_enable_calendar_staff_only'] . '</label></div><br>
<div class="radio"><label><input type="radio" name="s_enable_calendar" value="0" ' . $off . ' /> ' . $hesklang['no_disable_calendar'] . '</label></div>';
?>
</div>
</div>
<div class="form-group">
<label for="first-day-of-week" class="col-sm-4 col-xs-12 control-label">
<?php echo $hesklang['first_day_of_week']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['custom_field_setting']; ?>"
data-content="<?php echo $hesklang['custom_field_setting_help']; ?>"></i>
</label>
<div class="col-sm-8 col-xs-12">
<select name="first-day-of-week" class="form-control">
<option value="0" <?php if ($modsForHesk_settings['first_day_of_week'] == '0') { echo 'selected'; } ?>>
<?php echo $hesklang['d0']; ?>
</option>
<option value="1" <?php if ($modsForHesk_settings['first_day_of_week'] == '1') { echo 'selected'; } ?>>
<?php echo $hesklang['d1']; ?>
</option>
<option value="2" <?php if ($modsForHesk_settings['first_day_of_week'] == '2') { echo 'selected'; } ?>>
<?php echo $hesklang['d2']; ?>
</option>
<option value="3" <?php if ($modsForHesk_settings['first_day_of_week'] == '3') { echo 'selected'; } ?>>
<?php echo $hesklang['d3']; ?>
</option>
<option value="4" <?php if ($modsForHesk_settings['first_day_of_week'] == '4') { echo 'selected'; } ?>>
<?php echo $hesklang['d4']; ?>
</option>
<option value="5" <?php if ($modsForHesk_settings['first_day_of_week'] == '5') { echo 'selected'; } ?>>
<?php echo $hesklang['d5']; ?>
</option>
<option value="6" <?php if ($modsForHesk_settings['first_day_of_week'] == '6') { echo 'selected'; } ?>>
<?php echo $hesklang['d6']; ?>
</option>
</select>
</div>
</div>
</div>
<!-- Custom Fields Tab -->
<div class="tab-pane fade in" id="customFields">
<h6 class="bold"><?php echo $hesklang['custom_use']; ?> <a href="Javascript:void(0)"

10
admin/calendar.php

@ -43,9 +43,6 @@ hesk_session_start();
hesk_dbConnect();
hesk_isLoggedIn();
/* Check permissions for this feature */
//hesk_checkPermission('can_service_msg');
// Define required constants
if (hesk_checkPermission('can_man_calendar', 0)) {
define('MFH_CALENDAR', 1);
@ -53,6 +50,12 @@ if (hesk_checkPermission('can_man_calendar', 0)) {
define('MFH_CALENDAR_READONLY', 1);
}
// Is the calendar enabled?
$modsForHesk_settings = mfh_getSettings();
if ($modsForHesk_settings['enable_calendar'] == '0') {
hesk_error($hesklang['calendar_disabled']);
}
// Get categories for the dropdown
$rs = hesk_dbQuery("SELECT `id`, `name`, `color` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `usage` <> 1 ORDER BY `cat_order`");
$categories = [];
@ -490,6 +493,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<p id="lang_error_updating_event"><?php echo $hesklang['error_updating_event']; ?></p>
<p id="lang_ticket_due_date_updated"><?php echo $hesklang['ticket_due_date_updated']; ?></p>
<p id="lang_error_updating_ticket_due_date"><?php echo $hesklang['error_updating_ticket_due_date']; ?></p>
<p id="setting_first_day_of_week"><?php echo $modsForHesk_settings['first_day_of_week']; ?></p>
</div>
<?php

5
calendar.php

@ -47,6 +47,11 @@ hesk_session_start();
hesk_dbConnect();
$modsForHesk_settings = mfh_getSettings();
// Is the calendar enabled?
if ($modsForHesk_settings['enable_calendar'] != '1') {
hesk_error($hesklang['calendar_disabled']);
}
$categories = [];
$orderBy = $modsForHesk_settings['category_order_column'];
$categorySql = "SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `usage` <> 1 AND `type` = '0' ORDER BY '" . $orderBy . "'";

2
install/mods-for-hesk/sql/installSql.php

@ -741,5 +741,7 @@ function execute260Scripts()
executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `color` VARCHAR(7)");
executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `usage` INT NOT NULL DEFAULT 0");
executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` ADD COLUMN `notify_overdue_unassigned` ENUM('0', '1') NOT NULL DEFAULT '0' AFTER `notify_note_unassigned`");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('enable_calendar', '1')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('first_day_of_week', '0')");
executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` SET `Value` = '2.6.0' WHERE `Key` = 'modsForHeskVersion'");
}

1
js/calendar/mods-for-hesk-calendar.js

@ -9,6 +9,7 @@ $(document).ready(function() {
eventLimit: true,
timeFormat: 'H:mm',
axisFormat: 'H:mm',
firstDay: $('#setting_first_day_of_week').text(),
events: function(start, end, timezone, callback) {
$.ajax({
url: getHelpdeskUrl() + '/internal-api/admin/calendar/?start=' + start + '&end=' + end,

7
language/en/text.php

@ -85,6 +85,13 @@ $hesklang['can_man_calendar'] = 'Can manage calendar events';
$hesklang['calendar_reminder'] = 'Upcoming Event: %%TITLE%%';
$hesklang['overdue_ticket'] = '[%%TRACKID%%] Ticket Overdue!';
$hesklang['notify_overdue_unassigned'] = 'A ticket is overdue not assigned to me';
$hesklang['calendar_settings'] = 'Calendar Settings';
$hesklang['enable_calendar'] = 'Enable calendar';
$hesklang['yes_enable_calendar'] = '<b>YES</b>, enable calendar';
$hesklang['yes_enable_calendar_staff_only'] = '<b>YES</b>, enable calendar, but only for staff';
$hesklang['no_disable_calendar'] = '<b>NO</b>, disable calendar';
$hesklang['first_day_of_week'] = 'First day of week';
$hesklang['calendar_disabled'] = 'The calendar is disabled';
// ADDED OR MODIFIED IN Mods for HESK 2.5.2
$hesklang['manage_statuses'] = 'Manage Statuses';

Loading…
Cancel
Save