diff --git a/include/staff/helptopic.inc.php b/include/staff/helptopic.inc.php index 922dd799773c086e9acb7c1a9d2ef7feb8d76c6f..f93e76b5e72823fc179d3d524cc3a6eb7f488242 100644 --- a/include/staff/helptopic.inc.php +++ b/include/staff/helptopic.inc.php @@ -71,7 +71,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); </td> <td> <select name="pid"> - <option value="">— Select Parent Topic —</option><?php + <option value="">— Top-Level Topic —</option><?php $topics = Topic::getHelpTopics(); while (list($id,$topic) = each($topics)) { if ($id == $info['topic_id']) diff --git a/include/staff/helptopics.inc.php b/include/staff/helptopics.inc.php index 0095b97f0caf579e8314622c73672056f9071f09..21764b1d9999faa7101851f4a435cf71f946d406 100644 --- a/include/staff/helptopics.inc.php +++ b/include/staff/helptopics.inc.php @@ -41,7 +41,7 @@ $topics = array_slice($topics, $pageNav->getStart(), $pageNav->getLimit()+2); <div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> <b><a href="helptopics.php?a=add" class="Icon newHelpTopic">Add New Help Topic</a></b></div> <div class="clear"></div> -<form id="save" action="helptopics.php" method="POST" name="topics"> +<form action="helptopics.php" method="POST" name="topics"> <?php csrf_token(); ?> <input type="hidden" name="do" value="mass_process" > <input type="hidden" id="action" name="a" value="sort" > @@ -49,7 +49,11 @@ $topics = array_slice($topics, $pageNav->getStart(), $pageNav->getLimit()+2); <caption><span style="display:inline-block;vertical-align:middle"><?php echo $showing; ?></span> <div class="pull-right">Sorting Mode: - <select name="help_topic_sort_mode"> + <select name="help_topic_sort_mode" onchange="javascript: + var $form = $(this).closest('form'); + $form.find('input[name=a]').val('sort'); + $form.submit(); +"> <?php foreach (OsticketConfig::allTopicSortModes() as $i=>$m) echo sprintf('<option value="%s"%s>%s</option>', $i, $i == $cfg->getTopicSortMode() ? ' selected="selected"' : '', $m); ?> @@ -132,10 +136,12 @@ if($res && $num): //Show options.. echo '<div> Page:'.$pageNav->getPageLinks().' </div>'; ?> <p class="centered" id="actions"> - <input type="submit" name="submit" value="Save"> - <input class="button" type="submit" name="enable" value="Enable" > - <input class="button" type="submit" name="disable" value="Disable"> - <input class="button" type="submit" name="delete" value="Delete"> +<?php if ($cfg->getTopicSortMode() != 'a') { ?> + <input class="button no-confirm" type="submit" name="sort" value="Save"/> +<?php } ?> + <button class="button" type="submit" name="enable" value="Enable" >Enable</button> + <button class="button" type="submit" name="disable" value="Disable">Disable</button> + <button class="button" type="submit" name="delete" value="Delete">Delete</button> </p> <?php endif; diff --git a/scp/css/scp.css b/scp/css/scp.css index 1b2797cadd08f110ed702b9b875a78002181a4c5..db677e17bd4b9cb8fbf15aaef5c0b4dd0d1d2ff7 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -530,7 +530,7 @@ a.print { color:#000; } -.button { padding:1px 5px; margin-right:10px; color:#777; font-weight:bold;} +#actions button, .button { padding:2px 5px 3px; margin-right:10px; color:#777; font-weight:bold;} .btn_sm { padding:2px 5px; diff --git a/scp/js/scp.js b/scp/js/scp.js index dfc3142fc6906372050ee0a60a0c19fd4e32ab81..24efdcab291c6a2711ebe2cdce89c7d3e6bd0350 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -75,7 +75,7 @@ var scp_prep = function() { return false; }); - $('#actions input:submit.button').bind('click', function(e) { + $('#actions :submit.button:not(.no-confirm)').bind('click', function(e) { var formObj = $(this).closest('form'); e.preventDefault(); @@ -136,7 +136,7 @@ var scp_prep = function() { var fObj = el.closest('form'); if(!fObj.data('changed')){ fObj.data('changed', true); - $('input[type=submit][name="submit"]', fObj).css('color', 'red'); + $('input[type=submit]', fObj).css('color', 'red'); $(window).bind('beforeunload', function(e) { return 'Are you sure you want to leave? Any changes or info you\'ve entered will be discarded!'; });