Merge pull request #243 from mkoch227/migrate-settings

Migrate settings
merge-requests/2/head
Mike Koch 9 years ago
commit 37932b249a

@ -258,7 +258,7 @@ elseif (isset($_POST['submit_as_status']))
if ($ticket['status'] != $new_status)
{
// Does this status close the ticket?
$newStatusRs = hesk_dbQuery('SELECT `IsClosed`, `ShortNameContentKey` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `ID` = '.hesk_dbEscape($new_status));
$newStatusRs = hesk_dbQuery('SELECT `IsClosed`, `Key` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `ID` = '.hesk_dbEscape($new_status));
$newStatus = hesk_dbFetchAssoc($newStatusRs);
if ($newStatus['IsClosed'])
@ -274,7 +274,7 @@ elseif (isset($_POST['submit_as_status']))
} else
{
// Ticket isn't being closed, just add the history to the sql query
$revision = sprintf($hesklang['thist9'],hesk_date(),$hesklang[$newStatus['ShortNameContentKey']],$_SESSION['name'].' ('.$_SESSION['user'].')');
$revision = sprintf($hesklang['thist9'],hesk_date(),$hesklang[$newStatus['Key']],$_SESSION['name'].' ('.$_SESSION['user'].')');
$sql_status = " , `history`=CONCAT(`history`,'".hesk_dbEscape($revision)."') ";
}
}

@ -517,8 +517,7 @@ if ( defined('HESK_DEMO') )
<?php echo $hesklang['mods_for_hesk']; ?><span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="modsForHeskDropdown">
<li><a href="#mods-for-hesk-general" data-toggle="tab"><?php echo $hesklang['tab_1']; ?></a></li>
<li><a href="#statuses" data-toggle="tab"><?php echo $hesklang['statuses']; ?></a></li>
<li><a href="#mfh-general" data-toggle="tab"><?php echo $hesklang['tab_1'].'/'.$hesklang['statuses']; ?></a></li>
<li><a href="#colors" data-toggle="tab"><?php echo $hesklang['uiColors']; ?></a></li>
</ul>
</li>
@ -1025,33 +1024,51 @@ if ( defined('HESK_DEMO') )
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<label for="s_attempt_limit" class="col-sm-3 control-label"><?php echo $hesklang['banlim']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>helpdesk.html#47','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<label for="s_attempt_limit" class="col-sm-4 control-label"><?php echo $hesklang['banlim']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>helpdesk.html#47','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-3">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['banlim']); ?>" name="s_attempt_limit" size="5" maxlength="30" value="<?php echo ($hesk_settings['attempt_limit'] ? ($hesk_settings['attempt_limit']-1) : 0); ?>" />
</div>
</div>
<div class="form-group">
<label for="s_attempt_banmin" class="col-sm-3 control-label"><?php echo $hesklang['banmin']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>helpdesk.html#47','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<label for="s_attempt_banmin" class="col-sm-4 control-label"><?php echo $hesklang['banmin']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>helpdesk.html#47','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-3">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['banmin']); ?>" name="s_attempt_banmin" size="5" maxlength="3" value="<?php echo $hesk_settings['attempt_banmin']; ?>" />
</div>
</div>
<div class="form-group">
<label for="s_reset_pass" class="col-sm-3 control-label"><?php echo $hesklang['passr']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>helpdesk.html#69','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9">
<label for="s_reset_pass" class="col-sm-4 control-label"><?php echo $hesklang['passr']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>helpdesk.html#69','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8">
<div class="checkbox">
<label><input type="checkbox" name="s_reset_pass" value="1" <?php if ($hesk_settings['reset_pass']) {echo 'checked="checked"';} ?>/> <?php echo $hesklang['passa']; ?></label>
</div>
</div>
</div>
<div class="form-group">
<label for="s_email_view_ticket" class="col-sm-3 control-label"><?php echo $hesklang['viewvtic']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>helpdesk.html#46','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9">
<label for="s_email_view_ticket" class="col-sm-4 control-label"><?php echo $hesklang['viewvtic']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>helpdesk.html#46','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8">
<div class="checkbox">
<label><input type="checkbox" name="s_email_view_ticket" value="1" <?php if ($hesk_settings['email_view_ticket']) {echo 'checked="checked"';} ?>/> <?php echo $hesklang['reqetv']; ?></label>
</div>
</div>
</div>
<div class="form-group">
<label for="email-verification" class="col-sm-4 col-xs-12 control-label">
<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>
<?php echo $hesklang['customer_email_verification']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['customer_email_verification']; ?>"
data-content="<?php echo $hesklang['customer_email_verification_help']; ?>"></i>
</label>
<div class="col-sm-8 col-xs-12">
<div class="checkbox">
<label>
<input id="email-verification" name="email-verification" type="checkbox" <?php if ($modsForHesk_settings['customer_email_verification_required']) {echo 'checked';} ?>> <?php echo $hesklang['require_customer_validate_email']; ?>
</label>
</div>
</div>
</div>
<br/>
<h6 style="font-weight: bold"><?php echo $hesklang['attachments']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
@ -1148,8 +1165,8 @@ if ( defined('HESK_DEMO') )
<h6 style="font-weight: bold"><?php echo $hesklang['kb_set']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<label for="s_kb_enable" class="col-sm-3 control-label"><?php echo $hesklang['s_ekb']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#22','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9 form-inline">
<label for="s_kb_enable" class="col-sm-4 control-label"><?php echo $hesklang['s_ekb']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#22','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8 form-inline">
<?php
$on = $hesk_settings['kb_enable'] == 1 ? 'checked="checked"' : '';
$off = $hesk_settings['kb_enable'] ? '' : 'checked="checked"';
@ -1161,9 +1178,49 @@ if ( defined('HESK_DEMO') )
?>
</div>
</div>
<div class="form-group">
<label for="knowledgebase-visibility-setting" class="col-sm-4 col-xs-12 control-label">
<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>
<?php echo $hesklang['new_article_default_type']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['new_article_default_type']; ?>"
data-content="<?php echo $hesklang['new_article_default_type_help']; ?>"></i>
</label>
<div class="col-sm-8 col-xs-12">
<div class="radio">
<label>
<input type="radio" name="new_kb_article_visibility" value="0" <?php echo $modsForHesk_settings['new_kb_article_visibility'] == 0 ? 'checked' : ''; ?>>
<?php echo $hesklang['kb_published']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['kb_published']; ?>"
data-content="<?php echo $hesklang['kb_published2']; ?>"></i>
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="new_kb_article_visibility" value="1" <?php echo $modsForHesk_settings['new_kb_article_visibility'] == 1 ? 'checked' : ''; ?>>
<?php echo $hesklang['kb_private']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['kb_private']; ?>"
data-content="<?php echo $hesklang['kb_private2']; ?>"></i>
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="new_kb_article_visibility" value="2" <?php echo $modsForHesk_settings['new_kb_article_visibility'] == 2 ? 'checked' : ''; ?>>
<?php echo $hesklang['kb_draft']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['kb_draft']; ?>"
data-content="<?php echo $hesklang['kb_draft3']; ?>"></i>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="s_kb_wysiwyg" class="col-sm-3 control-label"><?php echo $hesklang['swyse']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#52','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9 form-inline">
<label for="s_kb_wysiwyg" class="col-sm-4 control-label"><?php echo $hesklang['swyse']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#52','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8 form-inline">
<?php
$on = $hesk_settings['kb_wysiwyg'] ? 'checked="checked"' : '';
$off = $hesk_settings['kb_wysiwyg'] ? '' : 'checked="checked"';
@ -1174,8 +1231,8 @@ if ( defined('HESK_DEMO') )
</div>
</div>
<div class="form-group">
<label for="s_kb_recommend_answers" class="col-sm-3 control-label"><?php echo $hesklang['s_suggest']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#23','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9 form-inline">
<label for="s_kb_recommend_answers" class="col-sm-4 control-label"><?php echo $hesklang['s_suggest']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#23','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8 form-inline">
<?php
$on = $hesk_settings['kb_recommendanswers'] ? 'checked="checked"' : '';
$off = $hesk_settings['kb_recommendanswers'] ? '' : 'checked="checked"';
@ -1186,8 +1243,8 @@ if ( defined('HESK_DEMO') )
</div>
</div>
<div class="form-group">
<label for="s_kb_rating" class="col-sm-3 control-label"><?php echo $hesklang['s_kbr']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#24','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9 form-inline">
<label for="s_kb_rating" class="col-sm-4 control-label"><?php echo $hesklang['s_kbr']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#24','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8 form-inline">
<?php
$on = $hesk_settings['kb_rating'] ? 'checked="checked"' : '';
$off = $hesk_settings['kb_rating'] ? '' : 'checked="checked"';
@ -1198,8 +1255,8 @@ if ( defined('HESK_DEMO') )
</div>
</div>
<div class="form-group">
<label for="s_kb_views" class="col-sm-3 control-label"><?php echo $hesklang['sav']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#58','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9 form-inline">
<label for="s_kb_views" class="col-sm-4 control-label"><?php echo $hesklang['sav']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#58','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8 form-inline">
<?php
$on = $hesk_settings['kb_views'] ? 'checked="checked"' : '';
$off = $hesk_settings['kb_views'] ? '' : 'checked="checked"';
@ -1210,8 +1267,8 @@ if ( defined('HESK_DEMO') )
</div>
</div>
<div class="form-group">
<label for="s_kb_date" class="col-sm-3 control-label"><?php echo $hesklang['sad']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#59','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9 form-inline">
<label for="s_kb_date" class="col-sm-4 control-label"><?php echo $hesklang['sad']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#59','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8 form-inline">
<?php
$on = $hesk_settings['kb_date'] ? 'checked="checked"' : '';
$off = $hesk_settings['kb_date'] ? '' : 'checked="checked"';
@ -1222,8 +1279,8 @@ if ( defined('HESK_DEMO') )
</div>
</div>
<div class="form-group">
<label for="s_kb_search" class="col-sm-3 control-label"><?php echo $hesklang['s_kbs']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#25','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9 form-inline">
<label for="s_kb_search" class="col-sm-4 control-label"><?php echo $hesklang['s_kbs']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#25','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8 form-inline">
<?php
$off = $hesk_settings['kb_search'] ? '' : 'checked="checked"';
$small = $hesk_settings['kb_search'] == 1 ? 'checked="checked"' : '';
@ -1238,69 +1295,69 @@ if ( defined('HESK_DEMO') )
</div>
</div>
<div class="form-group">
<label for="s_kb_search_limit" class="col-sm-3 control-label"><?php echo $hesklang['s_maxsr']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#26','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<label for="s_kb_search_limit" class="col-sm-4 control-label"><?php echo $hesklang['s_maxsr']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#26','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-3">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['s_maxsr']); ?>" name="s_kb_search_limit" size="5" maxlength="3" value="<?php echo $hesk_settings['kb_search_limit']; ?>" />
</div>
</div>
<div class="form-group">
<label for="s_kb_substrart" class="col-sm-3 control-label"><?php echo $hesklang['s_ptxt']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#27','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<label for="s_kb_substrart" class="col-sm-4 control-label"><?php echo $hesklang['s_ptxt']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#27','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-3">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['s_ptxt']); ?>" name="s_kb_substrart" size="5" maxlength="5" value="<?php echo $hesk_settings['kb_substrart']; ?>" />
</div>
</div>
<div class="form-group">
<label for="s_kb_cols" class="col-sm-3 control-label"><?php echo $hesklang['s_scol']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#28','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<label for="s_kb_cols" class="col-sm-4 control-label"><?php echo $hesklang['s_scol']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#28','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-3">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['s_scol']); ?>" name="s_kb_cols" size="5" maxlength="2" value="<?php echo $hesk_settings['kb_cols']; ?>" />
</div>
</div>
<div class="form-group">
<label for="s_kb_numshow" class="col-sm-3 control-label"><?php echo $hesklang['s_psubart']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#29','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<label for="s_kb_numshow" class="col-sm-4 control-label"><?php echo $hesklang['s_psubart']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#29','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-3">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['s_psubart']); ?>" name="s_kb_numshow" size="5" maxlength="2" value="<?php echo $hesk_settings['kb_numshow']; ?>" />
</div>
</div>
<div class="form-group">
<label for="s_kb_index_popart" class="col-sm-3 control-label"><?php echo $hesklang['s_spop']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#30','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<label for="s_kb_index_popart" class="col-sm-4 control-label"><?php echo $hesklang['s_spop']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#30','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-3">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['s_spop']); ?>" name="s_kb_index_popart" size="5" maxlength="2" value="<?php echo $hesk_settings['kb_index_popart']; ?>" />
</div>
<div class="col-sm-6" style="padding-left:0px">
<div class="col-sm-5" style="padding-left:0px">
<p class="form-control-static"><?php echo $hesklang['s_onin']; ?></p>
</div>
</div>
<div class="form-group">
<div class="col-sm-3 col-sm-offset-3">
<div class="col-sm-3 col-sm-offset-4">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['s_spop']); ?>" name="s_kb_popart" size="5" maxlength="2" value="<?php echo $hesk_settings['kb_popart']; ?>" />
</div>
<div class="col-sm-6" style="padding-left:0px">
<div class="col-sm-5" style="padding-left:0px">
<p class="form-control-static"><?php echo $hesklang['s_onkb']; ?></p>
</div>
</div>
<div class="form-group">
<label for="s_kb_latest" class="col-sm-3 control-label"><?php echo $hesklang['s_slat']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#31','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<label for="s_kb_latest" class="col-sm-4 control-label"><?php echo $hesklang['s_slat']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#31','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-3">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['s_slat']); ?>" name="s_kb_index_latest" size="5" maxlength="2" value="<?php echo $hesk_settings['kb_index_latest']; ?>" />
</div>
<div class="col-sm-6" style="padding-left:0px">
<div class="col-sm-5" style="padding-left:0px">
<p class="form-control-static"><?php echo $hesklang['s_onin']; ?></p>
</div>
</div>
<div class="form-group">
<div class="col-sm-3 col-sm-offset-3">
<div class="col-sm-3 col-sm-offset-4">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['s_slat']); ?>" name="s_kb_latest" size="5" maxlength="2" value="<?php echo $hesk_settings['kb_latest']; ?>" />
</div>
<div class="col-sm-6" style="padding-left:0px">
<div class="col-sm-5" style="padding-left:0px">
<p class="form-control-static"><?php echo $hesklang['s_onkb']; ?></p>
</div>
</div>
<div class="form-group">
<label for="s_kb_related" class="col-sm-3 control-label"><?php echo $hesklang['s_relart']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#60','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<label for="s_kb_related" class="col-sm-4 control-label"><?php echo $hesklang['s_relart']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>knowledgebase.html#60','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-3">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['s_relart']); ?>" name="s_kb_related" size="5" maxlength="2" value="<?php echo $hesk_settings['kb_related']; ?>" />
</div>
<div class="col-sm-6" style="padding-left:0px">
<div class="col-sm-5" style="padding-left:0px">
<p class="form-control-static"><?php echo $hesklang['s_onin']; ?></p>
</div>
</div>
@ -1309,13 +1366,40 @@ if ( defined('HESK_DEMO') )
<!-- Custom Fields Tab -->
<div class="tab-pane fade in" id="customFields">
<h6 style="font-weight: bold"><?php echo $hesklang['custom_use']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>custom.html#41','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></h6>
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<label for="custom-field-setting" class="col-sm-4 col-xs-12 control-label">
<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>
<?php echo $hesklang['custom_field_setting']; ?>
<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">
<div class="checkbox">
<label>
<input id="custom-field-setting"
name="custom-field-setting"
type="checkbox"
onchange="changeText('fieldNameHeader',
'<?php echo $hesklang['custom_language_key']; ?>',
'<?php echo $hesklang['custom_n']; ?>',
this)"
<?php if ($modsForHesk_settings['custom_field_setting']) {echo 'checked';} ?>> <?php echo $hesklang['enable_custom_field_language']; ?>
</label>
</div>
</div>
</div>
<table class="table table-hover">
<tr>
<th><?php echo $hesklang['enable']; ?></th>
<th><?php echo $hesklang['s_type']; ?></th>
<th><?php echo $hesklang['custom_r']; ?></th>
<th>
<th id="fieldNameHeader">
<?php if ($modsForHesk_settings['custom_field_setting']) { echo $hesklang['custom_language_key']; } else { echo $hesklang['custom_n']; } ?>
</th>
<th><?php echo $hesklang['custom_place']; ?></th>
@ -1398,9 +1482,34 @@ if ( defined('HESK_DEMO') )
}
echo '
<div class="radio"><label><input type="radio" name="s_smtp" value="0" onclick="hesk_attach_disable(new Array(\'s1\',\'s2\',\'s3\',\'s4\',\'s5\',\'s6\',\'s7\',\'s8\',\'s9\'));toggleContainers([],[\'smtp_settings\',\'mailgun_settings\']);" '.$off.' /> '.$hesklang['phpmail'].'</label></div>
<div class="radio"><label><input type="radio" name="s_smtp" value="1" onclick="hesk_attach_enable(new Array(\'s1\',\'s2\',\'s3\',\'s4\',\'s5\',\'s6\',\'s7\',\'s8\',\'s9\'));toggleContainers([\'smtp_settings\'],[\'mailgun_settings\']);" '.$on.' /> '.$hesklang['smtp'].'</label></div>
<div class="radio"><label><input type="radio" name="s_smtp" value="2" onclick="toggleContainers([\'mailgun_settings\'],[\'smtp_settings\']);" '.$mailgunOn.'>'.$hesklang['mailgun'].' <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="'.$hesklang['mailgun'].'" data-content="'.$hesklang['mailgun_help'].'"></i></label></div>';
<div class="radio">
<label>
<input type="radio" name="s_smtp" value="0"
onclick="hesk_attach_disable(new Array(\'s1\',\'s2\',\'s3\',\'s4\',\'s5\',\'s6\',\'s7\',\'s8\',\'s9\'));toggleContainers([],[\'smtp_settings\',\'mailgun_settings\']);" '.$off.' />
'.$hesklang['phpmail'].'
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="s_smtp" value="1"
onclick="hesk_attach_enable(new Array(\'s1\',\'s2\',\'s3\',\'s4\',\'s5\',\'s6\',\'s7\',\'s8\',\'s9\'));toggleContainers([\'smtp_settings\'],[\'mailgun_settings\']);" '.$on.' />
'.$hesklang['smtp'].'
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="s_smtp" value="2"
onclick="toggleContainers([\'mailgun_settings\'],[\'smtp_settings\']);" '.$mailgunOn.'>
<span class="label label-primary"
data-toggle="tooltip"
title="'.$hesklang['added_in_mods_for_hesk'].'">'.$hesklang['mods_for_hesk_acronym'].'</span>
'.$hesklang['mailgun'].'
<i class="fa fa-question-circle settingsquestionmark"
data-toggle="popover" title="'.$hesklang['mailgun'].'"
data-content="'.$hesklang['mailgun_help'].'">
</i>
</label>
</div>';
?>
<input type="hidden" name="tmp_smtp_host_name" value="<?php echo $hesk_settings['smtp_host_name']; ?>" />
<input type="hidden" name="tmp_smtp_host_port" value="<?php echo $hesk_settings['smtp_host_port']; ?>" />
@ -1417,13 +1526,27 @@ if ( defined('HESK_DEMO') )
</div>
<div id="mailgun_settings" style="display:<?php echo $onload_mailgun; ?>">
<div class="form-group">
<label for="mailgun_api_key" class="col-sm-3 control-label"><?php echo $hesklang['mailgun_api_key']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="<?php echo $hesklang['mailgun_api_key']; ?>" data-content="<?php echo $hesklang['mailgun_api_key_help']; ?>"></i></label>
<label for="mailgun_api_key" class="col-sm-3 control-label">
<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>
<?php echo $hesklang['mailgun_api_key']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['mailgun_api_key']; ?>" data-content="<?php echo $hesklang['mailgun_api_key_help']; ?>">
</i>
</label>
<div class="col-sm-9">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['mailgun_api_key']); ?>" id="mailgun_api_key" name="mailgun_api_key" value="<?php echo $modsForHesk_settings['mailgun_api_key']; ?>">
</div>
</div>
<div class="form-group">
<label for="mailgun_domain" class="col-sm-3 control-label"><?php echo $hesklang['mailgun_domain']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="<?php echo $hesklang['mailgun_domain']; ?>" data-content="<?php echo $hesklang['mailgun_domain_help']; ?>"></i></label>
<label for="mailgun_domain" class="col-sm-3 control-label">
<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>
<?php echo $hesklang['mailgun_domain']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="<?php echo $hesklang['mailgun_domain']; ?>" data-content="<?php echo $hesklang['mailgun_domain_help']; ?>"></i>
</label>
<div class="col-sm-9">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['mailgun_domain']); ?>" id="mailgun_domain" name="mailgun_domain" value="<?php echo $modsForHesk_settings['mailgun_domain']; ?>">
</div>
@ -1878,6 +2001,49 @@ if ( defined('HESK_DEMO') )
</div>
</div>
</div>
<div class="form-group">
<label for="html_emails" class="col-sm-3 col-xs-12 control-label">
<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>
<?php echo $hesklang['html_emails']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['html_emails']; ?>"
data-content="<?php echo $hesklang['html_emails_help']; ?>"></i>
</label>
<div class="col-sm-9 col-xs-12">
<div class="checkbox">
<label>
<input id="html_emails" name="html_emails" type="checkbox" <?php if ($modsForHesk_settings['html_emails']) {echo 'checked';} ?>> <?php echo $hesklang['html_emails_text']; ?>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="email_attachments" class="col-sm-3 col-xs-12 control-label">
<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>
<?php echo $hesklang['email_attachments']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['email_attachments']; ?>"
data-content="<?php echo $hesklang['email_attachments_help']; ?>"></i>
</label>
<div class="col-sm-9 col-xs-12">
<div class="radio">
<label>
<input type="radio" name="email_attachments" value="0" <?php echo $modsForHesk_settings['attachments'] == 0 ? 'checked' : ''; ?>>
<?php echo $hesklang['show_attachments_as_links']; ?>
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="email_attachments" value="1" <?php echo $modsForHesk_settings['attachments'] == 1 ? 'checked' : ''; ?>>
<?php echo $hesklang['attach_directly_to_email']; ?>
</label>
</div>
</div>
</div>
</div>
<!-- Ticket List Tab -->
@ -1931,8 +2097,8 @@ if ( defined('HESK_DEMO') )
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<label for="servertime" class="col-sm-3 control-label"><?php echo $hesklang['server_time']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#18','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9">
<label for="servertime" class="col-sm-4 control-label"><?php echo $hesklang['server_time']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#18','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8">
<p class="form-control-static"><?php echo $hesklang['csrt'] .' <span id="servertime">'.$server_time.'</span>' ; ?></p>
<script language="javascript" type="text/javascript"><!--
startTime();
@ -1942,25 +2108,25 @@ if ( defined('HESK_DEMO') )
</div>
<div class="form-group">
<div class="row">
<div class="col-sm-2 col-sm-offset-3">
<div class="col-sm-2 col-sm-offset-4">
<input type="text" class="form-control" name="s_diff_hours" size="5" maxlength="3" value="<?php echo $hesk_settings['diff_hours']; ?>" />
</div>
<div class="col-sm-7" style="padding-left:0px">
<div class="col-sm-6" style="padding-left:0px">
<p class="form-control-static"><?php echo $hesklang['t_h']; ?></p>
</div>
</div>
<div class="row" style="padding-top:5px">
<div class="col-sm-2 col-sm-offset-3">
<div class="col-sm-2 col-sm-offset-4">
<input type="text" class="form-control" name="s_diff_minutes" size="5" maxlength="3" value="<?php echo $hesk_settings['diff_minutes']; ?>" />
</div>
<div class="col-sm-7" style="padding-left: 0px">
<div class="col-sm-6" style="padding-left: 0px">
<p class="form-control-static"><?php echo $hesklang['t_m']; ?></p>
</div>
</div>
</div>
<div class="form-group">
<label for="s_daylight" class="col-sm-3 control-label"><?php echo $hesklang['day']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#19','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9 form-inline">
<label for="s_daylight" class="col-sm-4 control-label"><?php echo $hesklang['day']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#19','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8 form-inline">
<?php
$on = $hesk_settings['daylight'] ? 'checked="checked"' : '';
$off = $hesk_settings['daylight'] ? '' : 'checked="checked"';
@ -1971,8 +2137,8 @@ if ( defined('HESK_DEMO') )
</div>
</div>
<div class="form-group">
<label for="s_timeformat" class="col-sm-3 control-label"><?php echo $hesklang['tfor']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#20','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9">
<label for="s_timeformat" class="col-sm-4 control-label"><?php echo $hesklang['tfor']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#20','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['tfor']); ?>" name="s_timeformat" size="40" maxlength="255" value="<?php echo $hesk_settings['timeformat']; ?>" />
</div>
</div>
@ -1981,38 +2147,38 @@ if ( defined('HESK_DEMO') )
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<label for="s_ip_whois" class="col-sm-3 control-label"><?php echo $hesklang['ip_whois']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#61','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9">
<label for="s_ip_whois" class="col-sm-4 control-label"><?php echo $hesklang['ip_whois']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#61','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8">
<input type="text" class="form-control" name="s_ip_whois" size="40" maxlength="255" value="<?php echo $hesk_settings['ip_whois']; ?>" />
</div>
</div>
<br>
<div class="form-group">
<label for="s_maintenance_mode" class="col-sm-3 control-label"><?php echo $hesklang['mms']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#62','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9">
<label for="s_maintenance_mode" class="col-sm-4 control-label"><?php echo $hesklang['mms']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#62','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8">
<div class="checkbox">
<label><input type="checkbox" name="s_maintenance_mode" value="1" <?php if ($hesk_settings['maintenance_mode']) {echo 'checked="checked"';} ?>/> <?php echo $hesklang['mmd']; ?></label>
</div>
</div>
</div>
<div class="form-group">
<label for="s_alink" class="col-sm-3 control-label"><?php echo $hesklang['al']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#21','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9">
<label for="s_alink" class="col-sm-4 control-label"><?php echo $hesklang['al']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#21','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8">
<div class="checkbox">
<label><input type="checkbox" name="s_alink" value="1" <?php if ($hesk_settings['alink']) {echo 'checked="checked"';} ?>/> <?php echo $hesklang['dap']; ?></label>
</div>
</div>
</div>
<div class="form-group">
<label for="s_submit_notice" class="col-sm-3 control-label"><?php echo $hesklang['subnot']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#48','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9">
<label for="s_submit_notice" class="col-sm-4 control-label"><?php echo $hesklang['subnot']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#48','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8">
<div class="checkbox">
<label><input type="checkbox" name="s_submit_notice" value="1" <?php if ($hesk_settings['submit_notice']) {echo 'checked="checked"';} ?>/> <?php echo $hesklang['subnot2']; ?></label>
</div>
</div>
</div>
<div class="form-group">
<label for="s_online" class="col-sm-3 control-label"><?php echo $hesklang['sonline']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#56','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<label for="s_online" class="col-sm-4 control-label"><?php echo $hesklang['sonline']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#56','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-4">
<div class="checkbox">
<label><input type="checkbox" name="s_online" value="1" <?php if ($hesk_settings['online']) {echo 'checked="checked"';} ?>/> <?php echo $hesklang['sonline2']; ?></label>
@ -2023,385 +2189,82 @@ if ( defined('HESK_DEMO') )
</div>
</div>
<div class="form-group">
<label for="s_check_updates" class="col-sm-3 control-label"><?php echo $hesklang['updates']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#59','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9">
<label for="rtl" class="col-sm-4 col-xs-12 control-label">
<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>
<?php echo $hesklang['displayRtl']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['displayRtl']; ?>"
data-content="<?php echo $hesklang['displayRtlHelp']; ?>"></i>
</label>
<div class="col-sm-8 col-xs-12">
<div class="checkbox">
<label>
<input id="rtl" name="rtl" type="checkbox" <?php if ($modsForHesk_settings['rtl']) {echo 'checked' ;} ?>> <?php echo $hesklang['display_rtl']; ?>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="show-icons" class="col-sm-4 col-xs-12 control-label">
<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>
<?php echo $hesklang['showIcons']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['showIcons']; ?>"
data-content="<?php echo $hesklang['showIconsHelp']; ?>"></i>
</label>
<div class="col-sm-8 col-xs-12">
<div class="checkbox">
<label>
<input id="show-icons" name="show-icons" type="checkbox" <?php if ($modsForHesk_settings['show_icons']) {echo 'checked';} ?>> <?php echo $hesklang['show_icons_navigation']; ?>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="use_bootstrap_theme" class="col-sm-4 col-xs-12 control-label">
<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>
<?php echo $hesklang['use_bootstrap_theme']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['use_bootstrap_theme']; ?>"
data-content="<?php echo $hesklang['use_bootstrap_theme_help']; ?>"></i>
</label>
<div class="col-sm-8 col-xs-12">
<div class="checkbox">
<label>
<input id="use_boostrap_theme" name="use_bootstrap_theme" type="checkbox" <?php if ($modsForHesk_settings['use_bootstrap_theme']) {echo 'checked';} ?>> <?php echo $hesklang['use_bootstrap_theme']; ?>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="s_check_updates" class="col-sm-4 control-label"><?php echo $hesklang['updates']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>misc.html#59','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8">
<div class="checkbox">
<label><input type="checkbox" name="s_check_updates" value="1" <?php if ($hesk_settings['check_updates']) {echo 'checked="checked"';} ?>/> <?php echo $hesklang['updates2']; ?></label>
</div>
</div>
</div>
</div>
<!-- Mods For Hesk: General Settings -->
<div class="tab-pane fade in" id="mods-for-hesk-general">
<h6 style="font-weight: bold"><?php echo $hesklang['gs']; ?></h6>
<!-- Mods for HESK: General/Statuses -->
<div class="tab-pane fade in" id="mfh-general">
<h6 style="font-weight: bold"><?php echo $hesklang['tab_1'].'/'.$hesklang['statuses']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<label for="rtl" class="col-sm-4 col-xs-12 control-label">
<?php echo $hesklang['displayRtl']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['displayRtl']; ?>"
data-content="<?php echo $hesklang['displayRtlHelp']; ?>"></i>
</label>
<div class="col-sm-8 col-xs-12">
<div class="checkbox">
<label>
<input id="rtl" name="rtl" type="checkbox" <?php if ($modsForHesk_settings['rtl']) {echo 'checked' ;} ?>> <?php echo $hesklang['display_rtl']; ?>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="show-icons" class="col-sm-4 col-xs-12 control-label">
<?php echo $hesklang['showIcons']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['showIcons']; ?>"
data-content="<?php echo $hesklang['showIconsHelp']; ?>"></i>
</label>
<div class="col-sm-8 col-xs-12">
<div class="checkbox">
<label>
<input id="show-icons" name="show-icons" type="checkbox" <?php if ($modsForHesk_settings['show_icons']) {echo 'checked';} ?>> <?php echo $hesklang['show_icons_navigation']; ?>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="email-verification" class="col-sm-4 col-xs-12 control-label"><?php echo $hesklang['customer_email_verification']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['customer_email_verification']; ?>"
data-content="<?php echo $hesklang['customer_email_verification_help']; ?>"></i>
</label>
<div class="col-sm-8 col-xs-12">
<div class="checkbox">
<label>
<input id="email-verification" name="email-verification" type="checkbox" <?php if ($modsForHesk_settings['customer_email_verification_required']) {echo 'checked';} ?>> <?php echo $hesklang['require_customer_validate_email']; ?>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="html_emails" class="col-sm-4 col-xs-12 control-label">
<?php echo $hesklang['html_emails']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['html_emails']; ?>"
data-content="<?php echo $hesklang['html_emails_help']; ?>"></i>
</label>
<div class="col-sm-8 col-xs-12">
<div class="checkbox">
<label>
<input id="html_emails" name="html_emails" type="checkbox" <?php if ($modsForHesk_settings['html_emails']) {echo 'checked';} ?>> <?php echo $hesklang['html_emails_text']; ?>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="email_attachments" class="col-sm-4 col-xs-12 control-label">
<?php echo $hesklang['email_attachments']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['email_attachments']; ?>"
data-content="<?php echo $hesklang['email_attachments_help']; ?>"></i>
</label>
<div class="col-sm-8 col-xs-12">
<div class="radio">
<label>
<input type="radio" name="email_attachments" value="0" <?php echo $modsForHesk_settings['attachments'] == 0 ? 'checked' : ''; ?>>
<?php echo $hesklang['show_attachments_as_links']; ?>
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="email_attachments" value="1" <?php echo $modsForHesk_settings['attachments'] == 1 ? 'checked' : ''; ?>>
<?php echo $hesklang['attach_directly_to_email']; ?>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="use_bootstrap_theme" class="col-sm-4 col-xs-12 control-label">
<?php echo $hesklang['use_bootstrap_theme']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['use_bootstrap_theme']; ?>"
data-content="<?php echo $hesklang['use_bootstrap_theme_help']; ?>"></i>
</label>
<div class="col-sm-8 col-xs-12">
<div class="checkbox">
<label>
<input id="use_boostrap_theme" name="use_bootstrap_theme" type="checkbox" <?php if ($modsForHesk_settings['use_bootstrap_theme']) {echo 'checked';} ?>> <?php echo $hesklang['use_bootstrap_theme']; ?>
</label>
</div>
</div>
</div>
<div class="blankSpace"></div>
<h6 style="font-weight: bold"><?php echo $hesklang['tab_4']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<label for="custom-field-setting" class="col-sm-4 col-xs-12 control-label">
<?php echo $hesklang['custom_field_setting']; ?>
<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">
<div class="checkbox">
<label>
<input id="custom-field-setting" name="custom-field-setting" type="checkbox" <?php if ($modsForHesk_settings['custom_field_setting']) {echo 'checked';} ?>> <?php echo $hesklang['enable_custom_field_language']; ?>
</label>
</div>
</div>
</div>
<div class="blankSpace"></div>
<h6 style="font-weight: bold"><?php echo $hesklang['menu_kb']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<label for="knowledgebase-visibility-setting" class="col-sm-4 col-xs-12 control-label">
<?php echo $hesklang['new_article_default_type']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['new_article_default_type']; ?>"
data-content="<?php echo $hesklang['new_article_default_type_help']; ?>"></i>
</label>
<div class="col-sm-8 col-xs-12">
<div class="radio">
<label>
<input type="radio" name="new_kb_article_visibility" value="0" <?php echo $modsForHesk_settings['new_kb_article_visibility'] == 0 ? 'checked' : ''; ?>>
<?php echo $hesklang['kb_published']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['kb_published']; ?>"
data-content="<?php echo $hesklang['kb_published2']; ?>"></i>
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="new_kb_article_visibility" value="1" <?php echo $modsForHesk_settings['new_kb_article_visibility'] == 1 ? 'checked' : ''; ?>>
<?php echo $hesklang['kb_private']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['kb_private']; ?>"
data-content="<?php echo $hesklang['kb_private2']; ?>"></i>
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="new_kb_article_visibility" value="2" <?php echo $modsForHesk_settings['new_kb_article_visibility'] == 2 ? 'checked' : ''; ?>>
<?php echo $hesklang['kb_draft']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['kb_draft']; ?>"
data-content="<?php echo $hesklang['kb_draft3']; ?>"></i>
</label>
</div>
</div>
</div>
</div>
<!-- Mods For Hesk: Statuses -->
<div class="tab-pane fade in" id="statuses">
<h6 style="font-weight: bold"><?php echo $hesklang['basicProperties']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
<?php
//-- We need to get all of the statuses and dump the information to the page.
$statusesSql = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`';
$closedStatusesSql = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsClosed` = 1';
$openStatusesSql = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsClosed` = 0';
$statusesRS = hesk_dbQuery($statusesSql);
//Print header
?>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['name']; ?></th>
<th><?php echo $hesklang['shortNameKey']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="<?php echo $hesklang['shortNameKey']; ?>" data-content="<?php echo $hesklang['shortNameKeyDescr']; ?>"></i></th>
<th><?php echo $hesklang['longNameKey']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="<?php echo $hesklang['longNameKey']; ?>" data-content="<?php echo $hesklang['longNameKeyDescr']; ?>"></i></th>
<th><?php echo $hesklang['textColor']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="<?php echo $hesklang['textColor']; ?>" data-content="<?php echo $hesklang['textColorDescr']; ?>"></i></th>
<th><?php echo $hesklang['closable_question']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover" data-placement="bottom" title="<?php echo $hesklang['closable_question']; ?>" data-content="<?php echo $hesklang['closable_description']; ?>"></i></th>
<th><?php echo $hesklang['closedQuestionMark']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" data-placement="top" title="<?php echo $hesklang['closedQuestionMark']; ?>" data-content="<?php echo $hesklang['closedQuestionMarkDescr']; ?>"></i></th>
<th><?php echo $hesklang['delete']; ?></th>
</tr>
</thead>
<tbody>
<?php
//Print each status
while ($row = $statusesRS->fetch_assoc())
{
$checkedEcho = ($row['IsClosed'] == 1) ? 'checked="checked"' : '';
$isDisabled = false;
if ($row['IsNewTicketStatus'] || $row['IsClosedByClient'] || $row['IsCustomerReplyStatus'] ||
$row['IsStaffClosedOption'] || $row['IsStaffReopenedStatus'] || $row['IsDefaultStaffReplyStatus'] ||
$row['LockedTicketStatus'] || $row['IsAutocloseOption'])
{
$isDisabled = true;
}
$yesSelected = $customersOnlySelected = $staffOnlySelected = $noSelected = '';
if ($row['Closable'] == 'yes') { $yesSelected = 'selected'; }
elseif ($row['Closable'] == 'conly') { $customersOnlySelected = 'selected'; }
elseif ($row['Closable'] == 'sonly') { $staffOnlySelected = 'selected'; }
else { $noSelected = 'selected'; }
echo '<tr id="s'.$row['ID'].'_row">';
echo '<td>'.$hesklang[$row['ShortNameContentKey']].'</td>'; //Name
echo '<td><input type="text" class="form-control" name="s'.$row['ID'].'_shortName" value="'.$row['ShortNameContentKey'].'" placeholder="'.htmlspecialchars($hesklang['shortNameKey']).'"></td>'; // Short Name Language File
echo '<td><input type="text" class="form-control" name="s'.$row['ID'].'_longName" value="'.$row['TicketViewContentKey'].'" placeholder="'.htmlspecialchars($hesklang['longNameKey']).'"></td>'; // Long Name Language File
echo '<td><input type="text" class="form-control" name="s'.$row['ID'].'_textColor" value="'.$row['TextColor'].'" placeholder="'.htmlspecialchars($hesklang['textColor']).'"></td>'; // Text Color
echo '<td>
<select class="form-control" name="s'.$row['ID'].'_closable">
<option value="yes" '.$yesSelected.'>'.$hesklang['yes_title_case'].'</option>
<option value="conly" '.$customersOnlySelected.'>'.$hesklang['customers_only'].'</option>
<option value="sonly" '.$staffOnlySelected.'>'.$hesklang['staff_only'].'</option>
<option value="no" '.$noSelected.'>'.$hesklang['no_title_case'].'</option>
</select>
</td>';
echo '<td><input type="checkbox" name="s'.$row['ID'].'_isClosed" value="1" '.$checkedEcho.'></td>'; // Resolved Status?
echo '<td>';
if ($isDisabled)
{
echo '<i class="fa fa-ban" style="color: red; font-size: 1.2em; font-weight: bold" data-toggle="popover" data-placement="left" title="'.$hesklang['whyCantIDeleteThisStatus'].'" data-content="'.$hesklang['whyCantIDeleteThisStatusReason'].'"></i>';
} else
{
echo '<input type="checkbox" onclick="toggleRow(\'s'.$row['ID'].'_row\')" name="s'.$row['ID'].'_delete" value="1">';
}
echo '</td>'; //Delete status?
echo '</tr>';
}
//Print out an additional blank space for adding a status
echo '<tr class="info">';
echo '<td><b>'.$hesklang['addNew'].'</b></td>';
echo '<td><input type="text" class="form-control" name="sN_shortName" value="" placeholder="'.htmlspecialchars($hesklang['shortNameKey']).'"></td>'; // Short Name Language File
echo '<td><input type="text" class="form-control" name="sN_longName" value="" placeholder="'.htmlspecialchars($hesklang['longNameKey']).'"></td>'; // Long Name Language File
echo '<td><input type="text" class="form-control" name="sN_textColor" value="" placeholder="'.htmlspecialchars($hesklang['textColor']).'"></td>'; // Text Color
echo '<td>
<select class="form-control" name="sN_closable">
<option value="yes">'.$hesklang['yes_title_case'].'</option>
<option value="conly">'.$hesklang['customers_only'].'</option>
<option value="sonly">'.$hesklang['staff_only'].'</option>
<option value="no">'.$hesklang['no_title_case'].'</option>
</select>
</td>';
echo '<td><input type="checkbox" name="sN_isClosed" value="1"></td>'; // Resolved Status?
echo '<td></td>'; //Empty placeholder where the delete row is.
echo '</tr>';
?>
</tbody>
</table>
</div>
<h6 style="font-weight: bold"><?php echo $hesklang['defaultStatusForAction']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<label for="newTicket" class="col-sm-8 col-xs-12 control-label"><?php echo $hesklang['isNewTicketMsg']; ?></label>
<div class="col-sm-4 col-xs-12">
<select name="newTicket" class="form-control" id="newTicket">
<?php
$statusesRS = hesk_dbQuery($openStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsNewTicketStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['ShortNameContentKey']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="closedByClient" class="col-sm-8 col-xs-12 control-label"><?php echo $hesklang['isClosedByClientMsg']; ?></label>
<div class="col-sm-4 col-xs-12">
<select name="closedByClient" class="form-control" id="closedByClient">
<?php
$statusesRS = hesk_dbQuery($closedStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsClosedByClient'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['ShortNameContentKey']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="replyFromClient" class="col-sm-8 col-xs-12 control-label"><?php echo $hesklang['isRepliedByClientMsg']; ?></label>
<div class="col-sm-4 col-xs-12">
<select name="replyFromClient" class="form-control" id="replyFromClient">
<?php
$statusesRS = hesk_dbQuery($openStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsCustomerReplyStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['ShortNameContentKey']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="staffClosedOption" class="col-sm-8 col-xs-12 control-label"><?php echo $hesklang['isStaffClosedOptionMsg']; ?></label>
<div class="col-sm-4 col-xs-12">
<select name="staffClosedOption" class="form-control" id="staffClosedOption">
<?php
$statusesRS = hesk_dbQuery($closedStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsStaffClosedOption'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['ShortNameContentKey']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="staffReopenedStatus" class="col-sm-8 col-xs-12 control-label"><?php echo $hesklang['isStaffReopenedStatusMsg']; ?></label>
<div class="col-sm-4 col-xs-12">
<select name="staffReopenedStatus" class="form-control" id="staffReopenedStatus">
<?php
$statusesRS = hesk_dbQuery($openStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsStaffReopenedStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['ShortNameContentKey']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="defaultStaffReplyStatus" class="col-sm-8 col-xs-12 control-label"><?php echo $hesklang['isDefaultStaffReplyStatusMsg']; ?></label>
<div class="col-sm-4 col-xs-12">
<select name="defaultStaffReplyStatus" class="form-control" id="defaultStaffReplyStatus">
<?php
$statusesRS = hesk_dbQuery($openStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsDefaultStaffReplyStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['ShortNameContentKey']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="lockedTicketStatus" class="col-sm-8 col-xs-12 control-label"><?php echo $hesklang['lockedTicketStatusMsg']; ?></label>
<div class="col-sm-4 col-xs-12">
<select name="lockedTicketStatus" class="form-control" id="lockedTicketStatus">
<?php
$statusesRS = hesk_dbQuery($statusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['LockedTicketStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['ShortNameContentKey']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="autocloseTicketOption" class="col-sm-8 col-xs-12 control-label"><?php echo $hesklang['autoclose_ticket_status']; ?></label>
<div class="col-sm-4 col-xs-12">
<select name="autocloseTicketOption" class="form-control" id="autocloseTicketOption">
<?php
$statusesRS = hesk_dbQuery($closedStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsAutocloseOption'] == 1) ? 'selected' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['ShortNameContentKey']].'</option>';
}
?>
</select>
<div class="row text-center">
<div class="col-sm-12">
<h2>Where did general settings and statuses go?</h2>
<p>Starting with Mods for HESK 2.3.0, general Mods for HESK settings are in their respective
tabs, indicated by
<span class="label label-primary"><?php echo $hesklang['mods_for_hesk_acronym']; ?></span>.
Please visit http://mods-for-hesk.mkochcs.com/faq.php to see where each individual setting has moved to.
<br>Statuses have been moved to the "Tools" menu. <br><br>
<i>This notice will be <b>removed</b> in 2.4.0.</i>
</p>
</div>
</div>
</div>

@ -510,106 +510,6 @@ for ($i=1;$i<=20;$i++)
}
}
//-- Update the statuses
hesk_dbConnect();
$wasStatusDeleted = false;
//-- Get all the status IDs
$statusesSql = 'SELECT * FROM `'.$hesk_settings['db_pfix'].'statuses`';
$results = hesk_dbQuery($statusesSql);
while ($row = $results->fetch_assoc())
{
//-- If the status is marked for deletion, delete it and skip everything below.
if (isset($_POST['s'.$row['ID'].'_delete']))
{
$delete = "DELETE FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($delete);
$stmt->bind_param('i', $row['ID']);
$stmt->execute();
$wasStatusDeleted = true;
} else
{
//-- Update the information in the database with what is on the page
$query = "UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `ShortNameContentKey` = ?, `TicketViewContentKey` = ?, `TextColor` = ?, `IsClosed` = ?, `Closable` = ? WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($query);
$isStatusClosed = (isset($_POST['s'.$row['ID'].'_isClosed']) ? 1 : 0);
$stmt->bind_param('sssisi', $_POST['s'.$row['ID'].'_shortName'], $_POST['s'.$row['ID'].'_longName'], $_POST['s'.$row['ID'].'_textColor'], $isStatusClosed, $_POST['s'.$row['ID'].'_closable'], $row['ID']);
$stmt->execute();
}
}
//-- If any statuses were deleted, re-index them before adding a new one
if ($wasStatusDeleted) {
//-- First drop and re-add the ID column
hesk_dbQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` DROP COLUMN `ID`");
hesk_dbQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` ADD `ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST");
//-- Since statuses should be zero-based, but are now one-based, subtract one from each ID
hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `ID` = `ID`-1");
}
//-- Insert the addition if there is anything to add
if ($_POST['sN_shortName'] != null && $_POST['sN_longName'] != null && $_POST['sN_textColor'] != null)
{
//-- The next ID is equal to the number of rows, since the IDs are zero-indexed.
$nextValue = hesk_dbQuery('SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`')->num_rows;
$isClosed = isset($_POST['sN_isClosed']) ? 1 : 0;
$insert = "INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` (`ID`, `ShortNameContentKey`, `TicketViewContentKey`, `TextColor`, `IsClosed`, `Closable`)
VALUES (".$nextValue.", '".hesk_dbEscape($_POST['sN_shortName'])."', '".hesk_dbEscape($_POST['sN_longName'])."', '".hesk_dbEscape($_POST['sN_textColor'])."', ".$isClosed.", '".hesk_dbEscape($_POST['sN_closable'])."')";
hesk_dbQuery($insert);
}
//-- Update default status for actions
$defaultQuery = "UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET ";
hesk_dbConnect()->query($defaultQuery . "`IsNewTicketStatus` = 0");
$updateQuery = $defaultQuery . "`IsNewTicketStatus` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['newTicket']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`IsClosedByClient` = 0");
$updateQuery = $defaultQuery . "`IsClosedByClient` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['closedByClient']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`IsCustomerReplyStatus` = 0");
$updateQuery = $defaultQuery . "`IsCustomerReplyStatus` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['replyFromClient']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`IsStaffClosedOption` = 0");
$updateQuery = $defaultQuery . "`IsStaffClosedOption` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['staffClosedOption']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`IsStaffReopenedStatus` = 0");
$updateQuery = $defaultQuery . "`IsStaffReopenedStatus` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['staffReopenedStatus']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`IsDefaultStaffReplyStatus` = 0");
$updateQuery = $defaultQuery . "`IsDefaultStaffReplyStatus` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['defaultStaffReplyStatus']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`LockedTicketStatus` = 0");
$updateQuery = $defaultQuery . "`LockedTicketStatus` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['lockedTicketStatus']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`IsAutocloseOption` = 0");
$updateQuery = $defaultQuery . "`IsAutocloseOption` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['autocloseTicketOption']);
$stmt->execute();
$set['hesk_version'] = $hesk_settings['hesk_version'];
// Save the modsForHesk_settings.inc.php file

@ -663,7 +663,7 @@ if($ticket['email'] != '') {
$newRecentTicket = $recentTicket;
$thisTicketStatusRS = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "statuses` WHERE `ID` = " . intval($recentTicket['status']));
$theStatusRow = hesk_dbFetchAssoc($thisTicketStatusRS);
$newRecentTicket['statusText'] = $hesklang[$theStatusRow['ShortNameContentKey']];
$newRecentTicket['statusText'] = $hesklang[$theStatusRow['Key']];
$newRecentTicket['statusColor'] = $theStatusRow['TextColor'];
array_push($recentTicketsWithStatuses, $newRecentTicket);
}
@ -876,7 +876,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<?php
$random=rand(10000,99999);
$statusSql = 'SELECT `ID`, `ShortNameContentKey`, `IsStaffClosedOption`, `IsStaffReopenedStatus` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsStaffClosedOption` = 1 OR `IsStaffReopenedStatus` = 1';
$statusSql = 'SELECT `ID`, `Key`, `IsStaffClosedOption`, `IsStaffReopenedStatus` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsStaffClosedOption` = 1 OR `IsStaffReopenedStatus` = 1';
$statusRs = hesk_dbQuery($statusSql);
$staffClosedOptionStatus = array();
$staffReopenedStatus = array();
@ -976,11 +976,11 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
echo '<div class="col-md-3 col-sm-12 ticket-cell-admin"><p class="ticketPropertyTitle">'.$hesklang['status'].'</p>';
$status_options = array();
$results = hesk_dbQuery("SELECT `ID`, `ShortNameContentKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`");
$results = hesk_dbQuery("SELECT `ID`, `Key` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`");
while ($row = $results->fetch_assoc())
{
$selected = $ticket['status'] == $row['ID'] ? 'selected' : '';
$status_options[$row['ID']] = '<option value="'.$row['ID'].'" '.$selected.'>'.$hesklang[$row['ShortNameContentKey']].'</option>';
$status_options[$row['ID']] = '<option value="'.$row['ID'].'" '.$selected.'>'.$hesklang[$row['Key']].'</option>';
}
echo '
@ -1969,7 +1969,7 @@ function hesk_printReplyForm() {
</a></li>
<li class="divider"></li>
<?php
$allStatusesRs = hesk_dbQuery('SELECT `ID`, `ShortNameContentKey`, `TextColor` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`');
$allStatusesRs = hesk_dbQuery('SELECT `ID`, `Key`, `TextColor` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`');
$statuses = array();
while ($row = hesk_dbFetchAssoc($allStatusesRs)) {
array_push($statuses, $row);
@ -1979,7 +1979,7 @@ function hesk_printReplyForm() {
echo '<li><a>
<button class="dropdown-submit" type="submit" name="submit_as_status" value="'.$status['ID'].'"">
'.$hesklang['submit_reply'].' '.$hesklang['and_change_status_to'].' <b>
<span style="color:'.$status['TextColor'].'">'.$hesklang[$status['ShortNameContentKey']].'</span></b>
<span style="color:'.$status['TextColor'].'">'.$hesklang[$status['Key']].'</span></b>
</button>
</a></li>';
}

@ -98,6 +98,14 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
</li>
';
}
if (hesk_checkPermission('can_man_ticket_statuses',0))
{
echo '
<li role="presentation">
<a title="'.$hesklang['statuses'].'" href="manage_statuses.php">'.$hesklang['statuses'].'</a>
</li>
';
}
?>
</ul>
<div class="tab-content summaryList tabPadding">

@ -101,6 +101,14 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
</li>
';
}
if (hesk_checkPermission('can_man_ticket_statuses',0))
{
echo '
<li role="presentation">
<a title="'.$hesklang['statuses'].'" href="manage_statuses.php">'.$hesklang['statuses'].'</a>
</li>
';
}
?>
</ul>
<div class="tab-content summaryList tabPadding">

@ -56,13 +56,13 @@ hesk_token_check();
$trackingID = hesk_cleanID() or die($hesklang['int_error'].': '.$hesklang['no_trackID']);
/* Valid statuses */
$statusSql = "SELECT `ID`, `ShortNameContentKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`";
$statusSql = "SELECT `ID`, `Key` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`";
$status_options = array();
$results = hesk_dbQuery($statusSql);
while ($row = $results->fetch_assoc())
{
$status_options[$row['ID']] = $hesklang[$row['ShortNameContentKey']];
$status_options[$row['ID']] = $hesklang[$row['Key']];
}
/* New status */

@ -242,12 +242,12 @@ $fid = 1;
require(HESK_PATH . 'inc/assignment_search.inc.php');
// --> TICKET STATUS
$possibleStatusSql = 'SELECT `ID`, `ShortNameContentKey` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`';
$possibleStatusSql = 'SELECT `ID`, `Key` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`';
$possibleStatusRS = hesk_dbQuery($possibleStatusSql);
$possible_status = array();
while ($row = $possibleStatusRS->fetch_assoc())
{
$possible_status[$row['ID']] = $hesklang[$row['ShortNameContentKey']];
$possible_status[$row['ID']] = $hesklang[$row['Key']];
}
$status = $possible_status;
@ -505,9 +505,9 @@ if (isset($_GET['w']))
$result = hesk_dbQuery($sql);
while ($ticket=hesk_dbFetchAssoc($result))
{
$statusContentKeySql = 'SELECT `ShortNameContentKey` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `ID` = '.$ticket['status'];
$statusContentKeySql = 'SELECT `Key` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `ID` = '.$ticket['status'];
$statusContentKeyRow = hesk_dbQuery($statusContentKeySql)->fetch_assoc();
$ticket['status'] = $hesklang[$statusContentKeyRow['ShortNameContentKey']];
$ticket['status'] = $hesklang[$statusContentKeyRow['Key']];
switch ($ticket['priority'])
{
@ -779,14 +779,14 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<label for="status" class="control-label col-sm-2"><?php echo $hesklang['status']; ?>:</label>
<div class="col-sm-10">
<?php
$getStatusCheckboxSql = 'SELECT `ID`, `ShortNameContentKey`, `TextColor` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`';
$getStatusCheckboxSql = 'SELECT `ID`, `Key`, `TextColor` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`';
$getStatusCheckboxRS = hesk_dbQuery($getStatusCheckboxSql);
while ($row = $getStatusCheckboxRS->fetch_assoc())
{
?>
<div class="col-xs-4">
<div class="checkbox">
<label><input type="checkbox" name="s<?php echo $row['ID']; ?>" value="1" <?php if (isset($status[$row['ID']])) {echo 'checked="checked"';} ?> /> <span style="color: <?php echo $row['TextColor']; ?>"><?php echo $hesklang[$row['ShortNameContentKey']]; ?></span></label>
<label><input type="checkbox" name="s<?php echo $row['ID']; ?>" value="1" <?php if (isset($status[$row['ID']])) {echo 'checked="checked"';} ?> /> <span style="color: <?php echo $row['TextColor']; ?>"><?php echo $hesklang[$row['Key']]; ?></span></label>
</div>
</div>
<?php

@ -13,7 +13,7 @@ hesk_session_start();
hesk_dbConnect();
hesk_isLoggedIn();
hesk_checkPermission('can_manage_email_templates');
hesk_checkPermission('can_man_email_tpl');
define('WYSIWYG',1);
@ -91,6 +91,16 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<li role="presentation" class="active">
<a href="#"><?php echo $hesklang['email_templates']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="<?php echo $hesklang['email_templates']; ?>" data-content="<?php echo $hesklang['email_templates_intro']; ?>"></i></a>
</li>
<?php
if (hesk_checkPermission('can_man_ticket_statuses',0))
{
echo '
<li role="presentation">
<a title="'.$hesklang['statuses'].'" href="manage_statuses.php">'.$hesklang['statuses'].'</a>
</li>
';
}
?>
</ul>
<div class="tab-content summaryList tabPadding">
<?php if ($showEditPanel): ?>
@ -264,7 +274,7 @@ function save() {
$success = file_put_contents($filePath, $_POST['text']);
if ($success === false) {
hesk_process_messages($hesklang[''], 'manage_email_templates.php');
hesk_process_messages($hesklang['email_template_not_saved'], 'manage_email_templates.php');
} else {
$message = sprintf($hesklang['email_template_saved'], $_POST['template']);
hesk_process_messages($message,'manage_email_templates.php','SUCCESS');

@ -0,0 +1,407 @@
<?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');
hesk_load_database_functions();
hesk_session_start();
hesk_dbConnect();
hesk_isLoggedIn();
hesk_checkPermission('can_man_ticket_statuses');
define('WYSIWYG',1);
// Are we performing an action?
if (isset($_POST['action'])) {
if ($_POST['action'] == 'save') {
save();
}
}
/* Print header */
require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row" style="padding: 20px">
<ul class="nav nav-tabs" role="tablist">
<?php
// Show a link to banned_emails.php if user has permission
if ( hesk_checkPermission('can_ban_emails',0) )
{
echo '
<li role="presentation">
<a title="' . $hesklang['banemail'] . '" href="banned_emails.php">'.$hesklang['banemail'].'</a>
</li>
';
}
if ( hesk_checkPermission('can_ban_ips',0) )
{
echo '
<li role="presentation">
<a title="' . $hesklang['banip'] . '" href="banned_ips.php">'.$hesklang['banip'].'</a>
</li>';
}
// Show a link to status_message.php if user has permission to do so
if ( hesk_checkPermission('can_service_msg',0) )
{
echo '
<li role="presentation">
<a title="' . $hesklang['sm_title'] . '" href="service_messages.php">' . $hesklang['sm_title'] . '</a>
</li>';
}
if ( hesk_checkPermission('can_man_email_tpl',0) )
{
echo '
<li role="presentation">
<a title="'.$hesklang['email_templates'].'" href="manage_email_templates.php">'.$hesklang['email_templates'].'</a>
</li>
';
}
?>
<li role="presentation" class="active">
<a href="#"><?php echo $hesklang['statuses']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="<?php echo $hesklang['statuses']; ?>" data-content="<?php echo $hesklang['statuses_intro']; ?>"></i></a>
</li>
</ul>
<div class="tab-content summaryList tabPadding">
<div class="row">
<div class="col-md-12">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<h6 style="font-weight: bold"><?php echo $hesklang['basicProperties']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
<?php
//-- We need to get all of the statuses and dump the information to the page.
$statusesSql = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`';
$closedStatusesSql = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsClosed` = 1';
$openStatusesSql = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsClosed` = 0';
$statusesRS = hesk_dbQuery($statusesSql);
?>
<form class="form-horizontal" method="post" action="manage_statuses.php" role="form">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['name']; ?></th>
<th><?php echo $hesklang['language_key']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="<?php echo $hesklang['language_key']; ?>" data-content="<?php echo $hesklang['language_key_description']; ?>"></i></th>
<th><?php echo $hesklang['textColor']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="<?php echo $hesklang['textColor']; ?>" data-content="<?php echo $hesklang['textColorDescr']; ?>"></i></th>
<th><?php echo $hesklang['closable_question']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover" data-placement="bottom" title="<?php echo $hesklang['closable_question']; ?>" data-content="<?php echo $hesklang['closable_description']; ?>"></i></th>
<th><?php echo $hesklang['closedQuestionMark']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" data-placement="top" title="<?php echo $hesklang['closedQuestionMark']; ?>" data-content="<?php echo $hesklang['closedQuestionMarkDescr']; ?>"></i></th>
<th><?php echo $hesklang['delete']; ?></th>
</tr>
</thead>
<tbody>
<?php
//Print each status
while ($row = $statusesRS->fetch_assoc())
{
$checkedEcho = ($row['IsClosed'] == 1) ? 'checked="checked"' : '';
$isDisabled = false;
if ($row['IsNewTicketStatus'] || $row['IsClosedByClient'] || $row['IsCustomerReplyStatus'] ||
$row['IsStaffClosedOption'] || $row['IsStaffReopenedStatus'] || $row['IsDefaultStaffReplyStatus'] ||
$row['LockedTicketStatus'] || $row['IsAutocloseOption'])
{
$isDisabled = true;
}
$yesSelected = $customersOnlySelected = $staffOnlySelected = $noSelected = '';
if ($row['Closable'] == 'yes') { $yesSelected = 'selected'; }
elseif ($row['Closable'] == 'conly') { $customersOnlySelected = 'selected'; }
elseif ($row['Closable'] == 'sonly') { $staffOnlySelected = 'selected'; }
else { $noSelected = 'selected'; }
echo '<tr id="s'.$row['ID'].'_row">';
echo '<td>'.$hesklang[$row['Key']].'</td>'; //Name
echo '<td><input type="text" class="form-control" name="s'.$row['ID'].'_key" value="'.$row['Key'].'" placeholder="'.htmlspecialchars($hesklang['language_key']).'"></td>'; // Language File Key
echo '<td><input type="text" class="form-control" name="s'.$row['ID'].'_textColor" value="'.$row['TextColor'].'" placeholder="'.htmlspecialchars($hesklang['textColor']).'"></td>'; // Text Color
echo '<td>
<select class="form-control" name="s'.$row['ID'].'_closable">
<option value="yes" '.$yesSelected.'>'.$hesklang['yes_title_case'].'</option>
<option value="conly" '.$customersOnlySelected.'>'.$hesklang['customers_only'].'</option>
<option value="sonly" '.$staffOnlySelected.'>'.$hesklang['staff_only'].'</option>
<option value="no" '.$noSelected.'>'.$hesklang['no_title_case'].'</option>
</select>
</td>';
echo '<td><input type="checkbox" name="s'.$row['ID'].'_isClosed" value="1" '.$checkedEcho.'></td>'; // Resolved Status?
echo '<td>';
if ($isDisabled)
{
echo '<i class="fa fa-ban" style="color: red; font-size: 1.2em; font-weight: bold" data-toggle="popover" data-placement="left" title="'.$hesklang['whyCantIDeleteThisStatus'].'" data-content="'.$hesklang['whyCantIDeleteThisStatusReason'].'"></i>';
} else
{
echo '<input type="checkbox" onclick="toggleRow(\'s'.$row['ID'].'_row\')" name="s'.$row['ID'].'_delete" value="1">';
}
echo '</td>'; //Delete status?
echo '</tr>';
}
//Print out an additional blank space for adding a status
echo '<tr class="info">';
echo '<td><b>'.$hesklang['addNew'].'</b></td>';
echo '<td><input type="text" class="form-control" name="sN_key" value="" placeholder="'.htmlspecialchars($hesklang['language_key']).'"></td>'; // Language File Key
echo '<td><input type="text" class="form-control" name="sN_textColor" value="" placeholder="'.htmlspecialchars($hesklang['textColor']).'"></td>'; // Text Color
echo '<td>
<select class="form-control" name="sN_closable">
<option value="yes">'.$hesklang['yes_title_case'].'</option>
<option value="conly">'.$hesklang['customers_only'].'</option>
<option value="sonly">'.$hesklang['staff_only'].'</option>
<option value="no">'.$hesklang['no_title_case'].'</option>
</select>
</td>';
echo '<td><input type="checkbox" name="sN_isClosed" value="1"></td>'; // Resolved Status?
echo '<td></td>'; //Empty placeholder where the delete row is.
echo '</tr>';
?>
</tbody>
</table>
</div>
<h6 style="font-weight: bold"><?php echo $hesklang['defaultStatusForAction']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<label for="newTicket" class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isNewTicketMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="newTicket" class="form-control" id="newTicket">
<?php
$statusesRS = hesk_dbQuery($openStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsNewTicketStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['Key']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="closedByClient" class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isClosedByClientMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="closedByClient" class="form-control" id="closedByClient">
<?php
$statusesRS = hesk_dbQuery($closedStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsClosedByClient'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['Key']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="replyFromClient" class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isRepliedByClientMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="replyFromClient" class="form-control" id="replyFromClient">
<?php
$statusesRS = hesk_dbQuery($openStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsCustomerReplyStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['Key']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="staffClosedOption" class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isStaffClosedOptionMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="staffClosedOption" class="form-control" id="staffClosedOption">
<?php
$statusesRS = hesk_dbQuery($closedStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsStaffClosedOption'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['Key']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="staffReopenedStatus" class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isStaffReopenedStatusMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="staffReopenedStatus" class="form-control" id="staffReopenedStatus">
<?php
$statusesRS = hesk_dbQuery($openStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsStaffReopenedStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['Key']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="defaultStaffReplyStatus" class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isDefaultStaffReplyStatusMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="defaultStaffReplyStatus" class="form-control" id="defaultStaffReplyStatus">
<?php
$statusesRS = hesk_dbQuery($openStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsDefaultStaffReplyStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['Key']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="lockedTicketStatus" class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['lockedTicketStatusMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="lockedTicketStatus" class="form-control" id="lockedTicketStatus">
<?php
$statusesRS = hesk_dbQuery($statusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['LockedTicketStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['Key']].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="autocloseTicketOption" class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['autoclose_ticket_status']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="autocloseTicketOption" class="form-control" id="autocloseTicketOption">
<?php
$statusesRS = hesk_dbQuery($closedStatusesSql);
while ($row = $statusesRS->fetch_assoc())
{
$selectedEcho = ($row['IsAutocloseOption'] == 1) ? 'selected' : '';
echo '<option value="'.$row['ID'].'" '.$selectedEcho.'>'.$hesklang[$row['Key']].'</option>';
}
?>
</select>
</div>
</div>
<div class="col-sm-6 col-sm-offset-6">
<input type="hidden" name="action" value="save">
<input type="submit" class="btn btn-default" value="<?php echo $hesklang['save_changes']; ?>">
</div>
</form>
</div>
</div>
</div>
</div>
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();
function save() {
global $hesklang, $hesk_settings;
hesk_dbConnect();
$wasStatusDeleted = false;
//-- Get all the status IDs
$statusesSql = 'SELECT * FROM `'.$hesk_settings['db_pfix'].'statuses`';
$results = hesk_dbQuery($statusesSql);
while ($row = $results->fetch_assoc())
{
//-- If the status is marked for deletion, delete it and skip everything below.
if (isset($_POST['s'.$row['ID'].'_delete']))
{
$delete = "DELETE FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($delete);
$stmt->bind_param('i', $row['ID']);
$stmt->execute();
$wasStatusDeleted = true;
} else
{
//-- Update the information in the database with what is on the page
$query = "UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `Key` = ?, `TextColor` = ?, `IsClosed` = ?, `Closable` = ? WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($query);
$isStatusClosed = (isset($_POST['s'.$row['ID'].'_isClosed']) ? 1 : 0);
$stmt->bind_param('sssisi', $_POST['s'.$row['ID'].'_key'], $_POST['s'.$row['ID'].'_textColor'], $isStatusClosed, $_POST['s'.$row['ID'].'_closable'], $row['ID']);
$stmt->execute();
}
}
//-- If any statuses were deleted, re-index them before adding a new one
if ($wasStatusDeleted) {
//-- First drop and re-add the ID column
hesk_dbQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` DROP COLUMN `ID`");
hesk_dbQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` ADD `ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST");
//-- Since statuses should be zero-based, but are now one-based, subtract one from each ID
hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `ID` = `ID`-1");
}
//-- Insert the addition if there is anything to add
if ($_POST['sN_key'] != null && $_POST['sN_textColor'] != null)
{
//-- The next ID is equal to the number of rows, since the IDs are zero-indexed.
$nextValue = hesk_dbQuery('SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`')->num_rows;
$isClosed = isset($_POST['sN_isClosed']) ? 1 : 0;
$insert = "INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` (`ID`, `Key`, `TextColor`, `IsClosed`, `Closable`)
VALUES (".$nextValue.", '".hesk_dbEscape($_POST['sN_key'])."', '".hesk_dbEscape($_POST['sN_textColor'])."', ".$isClosed.", '".hesk_dbEscape($_POST['sN_closable'])."')";
hesk_dbQuery($insert);
}
//-- Update default status for actions
$defaultQuery = "UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET ";
hesk_dbConnect()->query($defaultQuery . "`IsNewTicketStatus` = 0");
$updateQuery = $defaultQuery . "`IsNewTicketStatus` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['newTicket']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`IsClosedByClient` = 0");
$updateQuery = $defaultQuery . "`IsClosedByClient` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['closedByClient']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`IsCustomerReplyStatus` = 0");
$updateQuery = $defaultQuery . "`IsCustomerReplyStatus` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['replyFromClient']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`IsStaffClosedOption` = 0");
$updateQuery = $defaultQuery . "`IsStaffClosedOption` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['staffClosedOption']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`IsStaffReopenedStatus` = 0");
$updateQuery = $defaultQuery . "`IsStaffReopenedStatus` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['staffReopenedStatus']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`IsDefaultStaffReplyStatus` = 0");
$updateQuery = $defaultQuery . "`IsDefaultStaffReplyStatus` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['defaultStaffReplyStatus']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`LockedTicketStatus` = 0");
$updateQuery = $defaultQuery . "`LockedTicketStatus` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['lockedTicketStatus']);
$stmt->execute();
hesk_dbConnect()->query($defaultQuery . "`IsAutocloseOption` = 0");
$updateQuery = $defaultQuery . "`IsAutocloseOption` = 1 WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($updateQuery);
$stmt->bind_param('i', $_POST['autocloseTicketOption']);
$stmt->execute();
hesk_process_messages($hesklang['statuses_saved'],'manage_statuses.php','SUCCESS');
}

@ -78,6 +78,7 @@ $hesk_settings['features'] = array(
'can_unban_ips', /* User can delete IP bans. Also enables "can_ban_ips" */
'can_service_msg', /* User can manage service messages shown in customer interface */
'can_man_email_tpl', /* User can manage email templates */
'can_man_ticket_statuses', /* User can manage ticket statuses */
);
/* Set default values */

@ -101,6 +101,14 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
</li>
';
}
if (hesk_checkPermission('can_man_ticket_statuses',0))
{
echo '
<li role="presentation">
<a title="'.$hesklang['statuses'].'" href="manage_statuses.php">'.$hesklang['statuses'].'</a>
</li>
';
}
?>
</ul>
<div class="tab-content summaryList tabPadding">

@ -608,9 +608,9 @@ function hesk_getEmailSubject($eml_file, $ticket='', $is_ticket=1, $strip=0)
}
/* Set status */
$statusRs = hesk_dbQuery("SELECT `ShortNameContentKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ".$ticket['status']);
$statusRs = hesk_dbQuery("SELECT `Key` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ".$ticket['status']);
$row = hesk_dbFetchAssoc($statusRs);
$ticket['status'] = $hesklang[$row['ShortNameContentKey']];
$ticket['status'] = $hesklang[$row['Key']];
/* Replace all special tags */
$msg = str_replace('%%SUBJECT%%', $ticket['subject'], $msg);
@ -778,9 +778,9 @@ function hesk_processMessage($msg, $ticket, $is_admin, $is_ticket, $just_message
$ticket['owner'] = hesk_msgToPlain( hesk_getOwnerName($ticket['owner']), 1);
/* Set status */
$statusRs = hesk_dbQuery("SELECT `ShortNameContentKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ".$ticket['status']);
$statusRs = hesk_dbQuery("SELECT `Key` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ".$ticket['status']);
$row = hesk_dbFetchAssoc($statusRs);
$ticket['status'] = $hesklang[$row['ShortNameContentKey']];
$ticket['status'] = $hesklang[$row['Key']];
/* Replace all special tags */
$msg = str_replace('%%NAME%%', $ticket['name'] ,$msg);

@ -57,6 +57,7 @@ require(HESK_PATH . 'modsForHesk_settings.inc.php');
<?php } else { ?>
<link href="<?php echo HESK_PATH; ?>css/hesk_newStyle.php?v=<?php echo $hesk_settings['hesk_version']; ?>" type="text/css" rel="stylesheet" />
<?php } ?>
<link href="<?php echo HESK_PATH; ?>css/bootstrap-iconpicker.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/octicons.css" type="text/css">
<script src="<?php echo HESK_PATH; ?>js/jquery-1.10.2.min.js"></script>
@ -64,6 +65,9 @@ require(HESK_PATH . 'modsForHesk_settings.inc.php');
<script language="Javascript" type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap.min.js"></script>
<script language="Javascript" type="text/javascript" src="<?php echo HESK_PATH; ?>js/modsForHesk-javascript.js"></script>
<script language="JavaScript" type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/iconset-fontawesome-4.3.0.js"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/iconset-octicon-2.1.2.js"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-iconpicker.js"></script>
<?php

@ -105,6 +105,10 @@ if ( hesk_check_kb_only(false) )
echo '<li><a href="banned_ips.php"><i class="fa fa-wrench" '.$iconDisplay.'></i>&nbsp;'.$hesklang['tools'].'</a> </li>';
} elseif (hesk_checkPermission('can_service_msg',0)) {
echo '<li><a href="service_messages.php"><i class="fa fa-wrench" '.$iconDisplay.'></i>&nbsp;'.$hesklang['tools'].'</a> </li>';
} elseif (hesk_checkPermission('can_man_email_tpl',0)) {
echo '<li><a href="manage_email_templates.php"><i class="fa fa-wrench" '.$iconDisplay.'></i>&nbsp;'.$hesklang['tools'].'</a> </li>';
} elseif (hesk_checkPermission('can_man_ticket_statuses',0)) {
echo '<li><a href="manage_statuses.php"><i class="fa fa-wrench" '.$iconDisplay.'></i>&nbsp;'.$hesklang['tools'].'</a> </li>';
}
if (hesk_checkPermission('can_manage_settings',0)) {
echo '<li><a href="admin_settings.php"><i class="fa fa-cog" '.$iconDisplay.'></i>&nbsp;'.$hesklang['settings'].'</a></li>';

@ -38,10 +38,10 @@ if ( ! isset($status) )
{
$status = array();
//-- We don't want to check statuses that are considered "closed"
$statusRS = hesk_dbQuery('SELECT `ID`, `ShortNameContentKey` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsClosed` = 0');
$statusRS = hesk_dbQuery('SELECT `ID`, `Key` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsClosed` = 0');
while ($row = $statusRS->fetch_assoc())
{
$status[$row['ID']] = $row['ShortNameContentKey'];
$status[$row['ID']] = $row['Key'];
}
}
@ -131,7 +131,7 @@ $more2 = empty($_GET['more2']) ? 0 : 1;
<tr>
<?php
$rowCounter = 1;
$statusRS = hesk_dbQuery('SELECT `ID`, `ShortNameContentKey`, `TextColor` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`');
$statusRS = hesk_dbQuery('SELECT `ID`, `Key`, `TextColor` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`');
while ($row = $statusRS->fetch_assoc())
{
if ($rowCounter > 3)
@ -149,7 +149,7 @@ $more2 = empty($_GET['more2']) ? 0 : 1;
}
echo '<label><input type="checkbox" name="s'.$row['ID'].'" value="1"';
if (isset($status[$row['ID']])) {echo 'checked="checked"';}
echo '/> <span style="font-weight: bold;color: '.$row['TextColor'].';">'.$hesklang[$row['ShortNameContentKey']].'</span></label></td>';
echo '/> <span style="font-weight: bold;color: '.$row['TextColor'].';">'.$hesklang[$row['Key']].'</span></label></td>';
$rowCounter++;
}

@ -386,8 +386,8 @@ if ($total > 0)
// Print ticket status
if ( hesk_show_column('status') )
{
$statusName = hesk_dbFetchAssoc(hesk_dbQuery("SELECT `ShortNameContentKey`, `TextColor` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE ID = ".$ticket['status']));
$ticket['status']='<span style="color: '.$statusName['TextColor'].'">'.$hesklang[$statusName['ShortNameContentKey']].'</span>';
$statusName = hesk_dbFetchAssoc(hesk_dbQuery("SELECT `Key`, `TextColor` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE ID = ".$ticket['status']));
$ticket['status']='<span style="color: '.$statusName['TextColor'].'">'.$hesklang[$statusName['Key']].'</span>';
echo '<td class="'.$color.'">'.$ticket['status'].'&nbsp;</td>';
}

@ -1089,11 +1089,20 @@ function print_start()
?>
<div class="form-group">
<label for="emailAddress"><?php echo $hesklang['email']; ?>:</label>
<?php
$my_email = '';
$do_remember = '';
if (isset($_COOKIE['hesk_myemail']))
{
$my_email = $_COOKIE['hesk_myemail'];
$do_remember = 'checked';
}
?>
<input type="text" class="form-control" name="e" id="emailAddress" size="35" value="<?php echo $my_email; ?>" placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"/>
</div>
<div class="checkbox">
<label for="r">
<input type="checkbox" name="r" value="Y" /> <?php echo $hesklang['rem_email']; ?>
<input type="checkbox" name="r" value="Y" <?php echo $do_remember; ?>> <?php echo $hesklang['rem_email']; ?>
</label>
</div>
<?php
@ -1194,11 +1203,11 @@ function forgot_tid()
}
/* Prepare ticket statuses */
$myStatusSQL = hesk_dbQuery("SELECT `ID`, `TicketViewContentKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`");
$myStatusSQL = hesk_dbQuery("SELECT `ID`, `Key` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`");
$my_status = array();
while ($myStatusRow = hesk_dbFetchAssoc($myStatusSQL))
{
$my_status[$myStatusRow['ID']] = $hesklang[$myStatusRow['TicketViewContentKey']];
$my_status[$myStatusRow['ID']] = $hesklang[$myStatusRow['Key']];
}
// Get tickets from the database

@ -444,6 +444,10 @@ function execute230Scripts() {
hesk_dbConnect();
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."service_messages` ADD COLUMN `icon` VARCHAR(150)");
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` ADD COLUMN `Key` TEXT");
executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `Key` = `ShortNameContentKey`");
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` DROP COLUMN `ShortNameContentKey`");
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` DROP COLUMN `TicketViewContentKey`");
executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.3.0' WHERE `Key` = 'modsForHeskVersion'");
}
// END Version 2.3.0

@ -92,4 +92,12 @@ function disableIfEmpty(sourceId, destinationId) {
}
}
function changeText(id, checkedValue, uncheckedValue, object) {
if (object.checked) {
$('#'+id).text(checkedValue);
} else {
$('#'+id).text(uncheckedValue);
}
}
jQuery(document).ready(loadJquery);

@ -27,6 +27,14 @@ $hesklang['sm_icon_type'] = 'Icon Type';
$hesklang['sm_no_icon'] = 'No Icon';
$hesklang['sm_search_icon'] = 'Search Icon';
$hesklang['sm_iconpicker_footer_label'] = '{0} - {1} of {2}'; // {0}: lower bound of page, {1}: upper bound of page, {2}: total number of icons
$hesklang['mods_for_hesk_acronym'] = 'MFH'; // THIS SHOULD NOT BE TRANSLATED
$hesklang['added_in_mods_for_hesk'] = 'Added in Mods for HESK';
$hesklang['statuses_intro'] = 'Here you can add, remove, and modify ticket statuses, as well as changing the default status for particular actions.';
$hesklang['statuses_saved'] = 'Ticket statuses have been updated!';
$hesklang['email_template_not_saved'] = 'The email template <b>%s</b> was NOT saved due to an error. Enable debug mode to see if an error message appears, and ensure that your file has CHMOD 0666'; // %s: Template file name
$hesklang['language_key'] = 'Language Key';
$hesklang['language_key_description'] = 'This is the language file \'key\' that contains the text you want to display';
$hesklang['can_man_ticket_statuses'] = 'Can manage ticket statuses';
// ADDED OR MODIFIED IN Mods for HESK 2.2.1
$hesklang['popart_no_colon']='Top Knowledgebase Articles'; // same as $hesklang['popart'] but without a colon (:)
@ -224,10 +232,6 @@ $hesklang['changeLanguage'] = 'Change language to';
// ADDED OR MODIFIED IN Mods For HESK 1.2
$hesklang['statuses'] = 'Statuses';
$hesklang['basicProperties'] = 'Basic Properties';
$hesklang['shortNameKey'] = 'Short Name Key';
$hesklang['shortNameKeyDescr'] = "This is the language file 'key' that contains the text you want to display on all pages that have statuses, except for the ticket view pages (ticket.php, admin_ticket.php, and print.php)";
$hesklang['longNameKey'] = 'Long Name Key';
$hesklang['longNameKeyDescr'] = "This is the language file 'key' that contains the text you want to display on ticket.php, print.php, and admin_ticket.php";
$hesklang['textColor'] = 'Text Color';
$hesklang['textColorDescr'] = 'This is the hex color code for the status that will be used on the ticket search page and export search page';
$hesklang['closedQuestionMark'] = 'Closed?';

@ -60,7 +60,7 @@ if ( empty($_SESSION['id']) )
}
/* Get ticket info */
$res = hesk_dbQuery("SELECT `t1`.* , `ticketStatus`.`IsClosed` AS `isClosed`, `ticketStatus`.`TicketViewContentKey` AS `statusKey`, `t2`.name AS `repliername`
$res = hesk_dbQuery("SELECT `t1`.* , `ticketStatus`.`IsClosed` AS `isClosed`, `ticketStatus`.`Key` AS `statusKey`, `t2`.name AS `repliername`
FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` AS `t1` LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."users` AS `t2` ON `t1`.`replierid` = `t2`.`id`
INNER JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` AS `ticketStatus` ON `t1`.`status` = `ticketStatus`.`ID`
WHERE `trackid`='".hesk_dbEscape($trackingID)."' LIMIT 1");

@ -106,7 +106,7 @@ hesk_dbConnect();
hesk_limitBfAttempts();
/* Get ticket info */
$res = hesk_dbQuery( "SELECT `t1`.* , `t2`.name AS `repliername`, `ticketStatus`.`IsClosed` AS `isClosed`, `ticketStatus`.`TicketViewContentKey` AS `statusKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` AS `t1` INNER JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` AS `ticketStatus` ON `t1`.`status` = `ticketStatus`.`ID` LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."users` AS `t2` ON `t1`.`replierid` = `t2`.`id` WHERE `trackid`='".hesk_dbEscape($trackingID)."' LIMIT 1");
$res = hesk_dbQuery( "SELECT `t1`.* , `t2`.name AS `repliername`, `ticketStatus`.`IsClosed` AS `isClosed`, `ticketStatus`.`Key` AS `statusKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` AS `t1` INNER JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` AS `ticketStatus` ON `t1`.`status` = `ticketStatus`.`ID` LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."users` AS `t2` ON `t1`.`replierid` = `t2`.`id` WHERE `trackid`='".hesk_dbEscape($trackingID)."' LIMIT 1");
/* Ticket found? */
if (hesk_dbNumRows($res) != 1)
@ -299,7 +299,7 @@ require_once(HESK_PATH . 'inc/header.inc.php');
$repliesColumnWidth = 3;
}
echo '<div class="col-md-3 col-sm-12 ticket-cell"><p class="ticketPropertyTitle">'.$hesklang['status'].'</p>';
$ticketStatusKey = $status['ShortNameContentKey'];
$ticketStatusKey = $status['Key'];
echo '<p class="ticketPropertyText">'.$hesklang[$ticketStatusKey].'</p>';
echo '</div>';
echo '<div class="col-md-3 col-sm-12 ticket-cell"><p class="ticketPropertyTitle">'.$hesklang['last_replier'].'</p>

Loading…
Cancel
Save