Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

do not show empty categories in new/edit ticket categories list #54

Closed
thekordy opened this issue Oct 6, 2015 · 1 comment
Closed

Comments

@thekordy
Copy link
Owner

thekordy commented Oct 6, 2015

We should also filter our empty categories from the categories list drop down in

  1. edit form
  2. new ticket
  3. make sure before update and store, you are not saving an empty category specially before firing trying to select agent
@thekordy
Copy link
Owner Author

thekordy commented Oct 6, 2015

Not necisserly any more, as an empty category will have only one option "Auto Select" which will assign tickets of empty categories to the admin

// If no agent is selected, select admin
        $selected_agent_id = config('ticketit.admin_ids')[0];

        foreach ($agents as $agent) {
            if ($count == 0) {
                $lowest_tickets = $agent->agentTickets->count();
                $selected_agent_id = $agent->id;
            }
            else {
                $tickets_count = $agent->agentTickets->count();
                if ($tickets_count < $lowest_tickets) {
                    $lowest_tickets = $tickets_count;
                    $selected_agent_id = $agent->id;
                }
            }
            $count++;
        }
        return $selected_agent_id;

@thekordy thekordy closed this as completed Oct 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant