Ejemplo n.º 1
0
</p><?php 
}
?>
	<hr>

	<label for="wpas-assignee"><strong><?php 
_e('Support Staff', 'awesome-support');
?>
</strong></label>
	<p>
		<?php 
$staff_atts = array('cap' => 'edit_ticket', 'name' => 'wpas_assignee', 'id' => 'wpas-assignee', 'disabled' => !current_user_can('assign_ticket') ? true : false, 'select2' => true);
if (isset($post)) {
    $staff_atts['selected'] = get_post_meta($post->ID, '_wpas_assignee', true);
}
echo wpas_users_dropdown($staff_atts);
?>
	</p>
	<?php 
if (WPAS_FIELDS_DESC) {
    ?>
<p class="description"><?php 
    printf(__('The above agent is currently responsible for this ticket.', 'awesome-support'), '#');
    ?>
</p><?php 
}
?>
	
	<!-- <hr>

	<label for="wpas-ccs"><strong><?php 
Ejemplo n.º 2
0
/**
 * Display a dropdown of the support users.
 *
 * Wrapper function for wpas_users_dropdown where
 * the cap_exclude is set to exclude all users with
 * the capability to edit a ticket.
 *
 * @since  3.1.3
 * @param  array  $args Arguments
 * @return string       HTML dropdown
 */
function wpas_support_users_dropdown($args = array())
{
    $args['cap_exclude'] = 'edit_ticket';
    $args['cap'] = 'create_ticket';
    echo wpas_users_dropdown($args);
}
function wpdt_assinge_filter()
{
    global $typenow;
    if ('ticket' != $typenow) {
        return;
    }
    $staff_atts = array('cap' => 'edit_ticket', 'name' => 'assignee', 'id' => 'wpas-assignee', 'disabled' => !current_user_can('assign_ticket') ? true : false, 'select2' => true);
    if (isset($post)) {
        $staff_atts['selected'] = get_post_meta($post->ID, '_wpas_assignee', true);
    }
    if (isset($_GET['assignee']) && !empty($_GET['assignee'])) {
        $staff_atts['selected'] = $_GET['assignee'];
    }
    echo wpas_users_dropdown($staff_atts);
}