Skip to content

Commit

Permalink
Made the ticket filter option available not to agents
Browse files Browse the repository at this point in the history
Issue #22
  • Loading branch information
mayeenulislam committed Mar 29, 2018
1 parent 1db0127 commit e729519
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
40 changes: 21 additions & 19 deletions includes/ns-cpt-nanosupport.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,29 +249,31 @@ function ns_admin_tickets_filter() {
</select>

<?php
if( ! ns_is_user('agent') ) :

$agents = get_users(array(
'meta_key' => 'ns_make_agent',
'meta_value' => 1
));
?>

<select name="agent">
<option value=""><?php esc_html_e('Filter by Agent', 'nanosupport'); ?></option>
<?php
$agent_filter = filter_input(INPUT_GET, 'agent', FILTER_SANITIZE_NUMBER_INT);
foreach ($agents as $agent) :
printf (
'<option value="%s"%s>%s</option>',
$agent->ID,
$agent->ID == $agent_filter ? ' selected="selected"' : '',
$agent->data->display_name
);
endforeach;
$agents = get_users(array(
'meta_key' => 'ns_make_agent',
'meta_value' => 1
));
?>
</select>

<select name="agent">
<option value=""><?php esc_html_e('Filter by Agent', 'nanosupport'); ?></option>
<?php
$agent_filter = filter_input(INPUT_GET, 'agent', FILTER_SANITIZE_NUMBER_INT);
foreach ($agents as $agent) :
printf (
'<option value="%s"%s>%s</option>',
$agent->ID,
$agent->ID == $agent_filter ? ' selected="selected"' : '',
$agent->data->display_name
);
endforeach;
?>
</select>

<?php
endif;
}
}

Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,13 @@ Or, you can use software like [POEdit](https://poedit.net/download) ('cross-plat

== Changelog ==

= 0.5.0 - 2018-MAR-30 =
= 0.5.0 - 2018-MAR-31 =
* New Feature: E-commerce &mdash; Support to products of Easy Digital Downloads (v2.5+) and WooCommerce (v2.2+)
* Additional Feature: Let the admin end users filter tickets based on Priority and/or Status and/or Agent
* 7 new icons to NanoSupport Icons
* New filter hooks: 'ns_date_time_format', 'ns_mandate_product_fields'
* Issue Fixed: Email Template background was repeating
* Issue Fixed: Date Time format was not changeable

= 0.4.1 - 2017-JUL-23 =
* Bug fixed: Ticket additional info was affecting on show/hide in smaller devices
Expand Down

0 comments on commit e729519

Please sign in to comment.