Skip to content

Commit

Permalink
enhancement: introduced persistent filter support (LMS+ #620) - more …
Browse files Browse the repository at this point in the history
…validation
  • Loading branch information
chilek committed Sep 6, 2018
1 parent 08b0b75 commit 3784998
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
3 changes: 3 additions & 0 deletions img/lms-ui-persistent-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ $(function() {
$('.lms-ui-filter-apply-button').click(function () {
var form = $(this).closest('form.lms-ui-persistent-filter');
var name = $(this).siblings('.lms-ui-filter-selection').val();
if (!name.length || name == -1) {
return false;
}
form.find('[name="name"]').val(name);
form.attr('action', form.attr('action').replace('&api=1', ''));
form.submit();
Expand Down
3 changes: 2 additions & 1 deletion lib/SmartyPlugins/function.persistent_filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ function smarty_function_persistent_filter($params, $template) {
<option value="-1">' . trans("<!filter>- new -") . '</option>
' . $filters . '
</select>
<input type="text" size="20" class="lms-ui-filter-name" pattern="^.{5,}$">
<input type="text" size="20" class="lms-ui-filter-name" pattern=".{5,}" required title="'
. trans("Enter filter name (at least 5 characters)") . '">
<button class="lms-ui-button lms-ui-filter-delete-button" >
' . trans("<!filter>Delete") . '
</button>
Expand Down
1 change: 1 addition & 0 deletions lib/locale/pl/strings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4050,5 +4050,6 @@
$_LANG['<!filter>Delete'] = 'Usuń';
$_LANG['<!filter>- none -'] = '- żaden - ';
$_LANG['<!filter>- new -'] = '- nowy -';
$_LANG['Enter filter name (at least 5 characters)'] = 'Podaj nazwę filtru (co najmniej 5 znaków)';

?>
2 changes: 0 additions & 2 deletions modules/eventlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
* $Id$
*/

$filter = $SESSION->getFilter();

if (isset($filter['edate']) && !empty($filter['edate']))
list ($filter['year'], $filter['month'], $filter['day']) = explode('/', $filter['edate']);

Expand Down
2 changes: 0 additions & 2 deletions modules/rtqueueview.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

$LMS->CleanupTicketLastView();

$filter = $SESSION->getFilter();

// queue id's
if (isset($_GET['id']) && $_GET['id'] != 'all') {
if (is_array($_GET['id']))
Expand Down

0 comments on commit 3784998

Please sign in to comment.