#170 Add settings option for default KB article type

merge-requests/2/head
Mike Koch 9 years ago
parent 3e9d1b52c9
commit ef3fd06cab

@ -2127,6 +2127,46 @@ if ( defined('HESK_DEMO') )
</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">

@ -614,6 +614,7 @@ $set['custom-field-setting'] = empty($_POST['custom-field-setting']) ? 0 : 1;
$set['customer-email-verification-required'] = empty($_POST['email-verification']) ? 0 : 1;
$set['html_emails'] = empty($_POST['html_emails']) ? 0 : 1;
$set['use_bootstrap_theme'] = empty($_POST['use_bootstrap_theme']) ? 0 : 1;
$set['new_kb_article_visibility'] = hesk_checkMinMax( intval( hesk_POST('new_kb_article_visibility') ) , 0, 2, 2);
if ($set['customer-email-verification-required'])
{
@ -667,7 +668,10 @@ $modsForHesk_settings[\'mailgun_api_key\'] = \''.$set['mailgun_api_key'].'\';
$modsForHesk_settings[\'mailgun_domain\'] = \''.$set['mailgun_domain'].'\';
//-- Set this to 1 to enable bootstrap-theme.css
$modsForHesk_settings[\'use_bootstrap_theme\'] = '.$set['use_bootstrap_theme'].';';
$modsForHesk_settings[\'use_bootstrap_theme\'] = '.$set['use_bootstrap_theme'].';
//-- Default value for new Knowledgebase article: 0 = Published, 1 = Private, 2 = Draft
$modsForHesk_settings[\'new_kb_article_visibility\'] = '.$set['new_kb_article_visibility'].';';
// Write the file
if ( ! file_put_contents(HESK_PATH . 'modsForHesk_settings.inc.php', $modsForHesk_file_content) )

@ -21,6 +21,12 @@ $hesklang['_COLLATE']='utf8_unicode_ci';
// This is the email break line that will be used in email piping
$hesklang['EMAIL_HR']='------ Reply above this line ------';
// ADDED OR MODIFIED IN Mods for HESK 2.2.0
$hesklang['new_article_default_type'] = 'Default Type for New Articles';
$hesklang['new_article_default_type_help'] = 'Choose the default type for new knowledgebase articles.';
$hesklang['kb_draft3'] = 'The article is saved but not yet published. It can only be read by staff who has permission to
manage knowledgebase articles.'; // This is exactly the same as kb_draft2 with all HTML removed
// ADDED OR MODIFIED IN Mods for HESK 2.1.0
$hesklang['e_mfh_settings'] = 'You will not be able to save your settings unless this file is writable by the script (CHMOD to 666)!';
$hesklang['mfh_up_to_date'] = 'Mods for HESK is up to date';

@ -34,4 +34,7 @@ $modsForHesk_settings['mailgun_api_key'] = '';
$modsForHesk_settings['mailgun_domain'] = '';
//-- Set this to 1 to enable bootstrap-theme.css
$modsForHesk_settings['use_bootstrap_theme'] = 1;
$modsForHesk_settings['use_bootstrap_theme'] = 1;
//-- Default value for new Knowledgebase article: 0 = Published, 1 = Private, 2 = Draft
$modsForHesk_settings['new_kb_article_visibility'] = 0;
Loading…
Cancel
Save