Several beta 3 updates
This commit is contained in:
parent
4910e25b0a
commit
f883aff904
@ -364,9 +364,7 @@ hesk_cleanSessionVars('as_owner');
|
||||
hesk_cleanSessionVars('as_notify');
|
||||
hesk_cleanSessionVars('as_show');
|
||||
foreach ($hesk_settings['custom_fields'] as $k => $v) {
|
||||
if ($v['use']) {
|
||||
hesk_cleanSessionVars("as_$k");
|
||||
}
|
||||
hesk_cleanSessionVars("as_$k");
|
||||
}
|
||||
|
||||
// If ticket has been assigned to the person submitting it lets show a message saying so
|
||||
|
||||
@ -155,8 +155,8 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
||||
<h6 class="bold"><?php echo $hesklang['banex']; ?></h6>
|
||||
|
||||
<div class="footerWithBorder blankSpace"></div>
|
||||
<b>john@email.com</b><br/>
|
||||
<b>@domain.com</b>
|
||||
<b>john@example.com</b><br/>
|
||||
<b>@example.com</b>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
@ -347,7 +347,10 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
||||
$cls = in_array($k,$_SESSION['iserror']) ? ' class="isError" ' : '';
|
||||
|
||||
foreach ($v['value']['radio_options'] as $option) {
|
||||
if (strlen($k_value) == 0 || $k_value == $option) {
|
||||
if (strlen($k_value) == 0) {
|
||||
$k_value = $option;
|
||||
$checked = empty($v['value']['no_default']) ? 'checked="checked"' : '';
|
||||
} elseif ($k_value == $option) {
|
||||
$k_value = $option;
|
||||
$checked = 'checked="checked"';
|
||||
} else {
|
||||
@ -460,20 +463,8 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
||||
';
|
||||
break;
|
||||
|
||||
// Hidden
|
||||
// Hidden (same as text for staff)
|
||||
case 'hidden':
|
||||
if (strlen($k_value) != 0) {
|
||||
$v['value']['hidden_default_value'] = $k_value;
|
||||
}
|
||||
echo '
|
||||
<tr>
|
||||
<td style="text-align:right" width="150">'.$v['name:'].' '.$v['req'].'</td>
|
||||
<td width="80%"><input type="text" name="'.$k.'" size="40" value="'.$v['value']['hidden_default_value'].'" '.$cls.' /> ('.$hesklang['sch'].')</td>
|
||||
</tr>
|
||||
';
|
||||
break;
|
||||
|
||||
/* Default text input */
|
||||
default:
|
||||
if (strlen($k_value) != 0) {
|
||||
$v['value']['default_value'] = $k_value;
|
||||
|
||||
@ -473,18 +473,33 @@ if (!isset($_SESSION['hide']['new_article']))
|
||||
<?php
|
||||
display_dropzone_field($hesk_settings['hesk_url'] . '/internal-api/admin/knowledgebase/upload-attachment.php');
|
||||
endif; // End attachments
|
||||
|
||||
// Redirect to the correct page
|
||||
switch ($from)
|
||||
{
|
||||
case 'draft':
|
||||
$redirect_action = 'a=list_draft';
|
||||
break;
|
||||
case 'private':
|
||||
$redirect_action = 'a=list_private';
|
||||
break;
|
||||
default:
|
||||
$redirect_action = 'a=manage_cat&catid='.$catid;
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<div class="form-group">
|
||||
<input type="hidden" name="a" value="new_article" />
|
||||
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
|
||||
<input type="hidden" name="a" value="new_article">
|
||||
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>">
|
||||
<input type="hidden" name="from" value="<?php echo $from; ?>">
|
||||
|
||||
<div class="btn-group">
|
||||
<input type="submit" value="<?php echo $hesklang['kb_save']; ?>" class="btn btn-primary" />
|
||||
<a class="btn btn-default" href="manage_knowledgebase.php?a=manage_cat&catid=<?php echo $catid; ?>"><?php echo $hesklang['cancel']; ?></a>
|
||||
<input type="submit" value="<?php echo $hesklang['kb_save']; ?>" class="btn btn-primary">
|
||||
<a class="btn btn-default" href="manage_knowledgebase.php?<?php echo $redirect_action; ?>"><?php echo $hesklang['cancel']; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -670,8 +685,8 @@ function list_draft() {
|
||||
<td><?php echo $kb_cat[$article['catid']]; ?></td>
|
||||
<td style="white-space:nowrap;">
|
||||
<a href="knowledgebase_private.php?article=<?php echo $article['id']; ?>&back=1<?php if ($article['type'] == 2) {echo '&draft=1';} ?>" target="_blank"><i class="fa fa-file-o" data-toggle="tooltip" title="<?php echo $hesklang['viewart']; ?>"></i></a>
|
||||
<a href="manage_knowledgebase.php?a=edit_article&id=<?php echo $article['id']; ?>"><i class="fa fa-pencil icon-link orange" data-toggle="tooltip" title="<?php echo $hesklang['edit']; ?>"></i></a>
|
||||
<a href="manage_knowledgebase.php?a=remove_article&id=<?php echo $article['id']; ?>&token=<?php hesk_token_echo(); ?>" onclick="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['del_art']); ?>');"><i class="fa fa-times icon-link red" data-toggle="tooltip" title="<?php echo $hesklang['delete']; ?>"></i></a></td>
|
||||
<a href="manage_knowledgebase.php?a=edit_article&id=<?php echo $article['id']; ?>&from=draft"><i class="fa fa-pencil icon-link orange" data-toggle="tooltip" title="<?php echo $hesklang['edit']; ?>"></i></a>
|
||||
<a href="manage_knowledgebase.php?a=remove_article&id=<?php echo $article['id']; ?>&token=<?php hesk_token_echo(); ?>&from=draft" onclick="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['del_art']); ?>');"><i class="fa fa-times icon-link red" data-toggle="tooltip" title="<?php echo $hesklang['delete']; ?>"></i></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
$j++;
|
||||
@ -820,8 +835,8 @@ function list_private() {
|
||||
<?php echo $rat; ?>
|
||||
<td class="text-center">
|
||||
<a href="knowledgebase_private.php?article=<?php echo $article['id']; ?>&back=1<?php if ($article['type'] == 2) {echo '&draft=1';} ?>" target="_blank"><i class="fa fa-file-o icon-link" data-toggle="tooltip" title="<?php echo $hesklang['viewart']; ?>"></i></a>
|
||||
<a href="manage_knowledgebase.php?a=edit_article&id=<?php echo $article['id']; ?>"><i class="fa fa-pencil icon-link orange" data-toggle="tooltip" title="<?php echo $hesklang['edit']; ?>"></i></a>
|
||||
<a href="manage_knowledgebase.php?a=remove_article&id=<?php echo $article['id']; ?>&token=<?php hesk_token_echo(); ?>" onclick="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['del_art']); ?>');"><i class="fa fa-times red icon-link" data-toggle="tooltip" title="<?php echo $hesklang['delete']; ?>"></i></a> </td>
|
||||
<a href="manage_knowledgebase.php?a=edit_article&id=<?php echo $article['id']; ?>&from=private"><i class="fa fa-pencil icon-link orange" data-toggle="tooltip" title="<?php echo $hesklang['edit']; ?>"></i></a>
|
||||
<a href="manage_knowledgebase.php?a=remove_article&id=<?php echo $article['id']; ?>&token=<?php hesk_token_echo(); ?>&from=private" onclick="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['del_art']); ?>');"><i class="fa fa-times red icon-link" data-toggle="tooltip" title="<?php echo $hesklang['delete']; ?>"></i></a> </td>
|
||||
</tr>
|
||||
<?php
|
||||
$j++;
|
||||
@ -1111,6 +1126,7 @@ function save_article()
|
||||
$old_catid = intval( hesk_POST('old_catid') );
|
||||
$old_type = intval( hesk_POST('old_type') );
|
||||
$old_type = ($old_type < 0 || $old_type > 2) ? 0 : $old_type;
|
||||
$from = hesk_POST('from');
|
||||
|
||||
$subject = hesk_input( hesk_POST('subject') ) or $hesk_error_buffer[] = $hesklang['kb_e_subj'];
|
||||
|
||||
@ -1209,7 +1225,7 @@ function save_article()
|
||||
$hesk_error_buffer = $tmp;
|
||||
|
||||
$hesk_error_buffer = $hesklang['rfm'].'<br /><br /><ul>'.$hesk_error_buffer.'</ul>';
|
||||
hesk_process_messages($hesk_error_buffer,'./manage_knowledgebase.php?a=edit_article&id='.$id);
|
||||
hesk_process_messages($hesk_error_buffer,'./manage_knowledgebase.php?a=edit_article&id='.$id.'&from='.$from);
|
||||
}
|
||||
|
||||
/* Add to database */
|
||||
@ -1247,7 +1263,20 @@ function save_article()
|
||||
// Update article order
|
||||
update_article_order($catid);
|
||||
|
||||
hesk_process_messages($hesklang['your_kb_mod'],'./manage_knowledgebase.php?a=manage_cat&catid='.$catid,'SUCCESS');
|
||||
// Redirect to the correct page
|
||||
switch ($from) {
|
||||
case 'draft':
|
||||
$redirect_action = 'a=list_draft';
|
||||
break;
|
||||
case 'private':
|
||||
$redirect_action = 'a=list_private';
|
||||
break;
|
||||
default:
|
||||
$redirect_action = 'a=manage_cat&catid='.$catid;
|
||||
break;
|
||||
}
|
||||
|
||||
hesk_process_messages($hesklang['your_kb_mod'],'./manage_knowledgebase.php?'.$redirect_action,'SUCCESS');
|
||||
} // END save_article()
|
||||
|
||||
|
||||
@ -1278,6 +1307,8 @@ function edit_article()
|
||||
|
||||
$catid = $article['catid'];
|
||||
|
||||
$from = hesk_GET('from');
|
||||
|
||||
if (isset($_SESSION['edit_article']))
|
||||
{
|
||||
$_SESSION['edit_article'] = hesk_stripArray($_SESSION['edit_article']);
|
||||
@ -2136,6 +2167,7 @@ function remove_article()
|
||||
|
||||
$article = hesk_dbFetchAssoc($result);
|
||||
$catid = intval($article['catid']);
|
||||
$from = hesk_GET('from');
|
||||
|
||||
$result = hesk_dbQuery("DELETE FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `id`='".intval($id)."'");
|
||||
|
||||
@ -2156,7 +2188,20 @@ function remove_article()
|
||||
hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` SET `articles_draft`=`articles_draft`-1 WHERE `id`='{$catid}'");
|
||||
}
|
||||
|
||||
hesk_process_messages($hesklang['your_kb_deleted'],'./manage_knowledgebase.php?a=manage_cat&catid='.$catid,'SUCCESS');
|
||||
// Redirect to the correct page
|
||||
switch ($from) {
|
||||
case 'draft':
|
||||
$redirect_action = 'a=list_draft';
|
||||
break;
|
||||
case 'private':
|
||||
$redirect_action = 'a=list_private';
|
||||
break;
|
||||
default:
|
||||
$redirect_action = 'a=manage_cat&catid='.$catid;
|
||||
break;
|
||||
}
|
||||
|
||||
hesk_process_messages($hesklang['your_kb_deleted'],'./manage_knowledgebase.php?'.$redirect_action,'SUCCESS');
|
||||
} // End remove_article()
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user