/** * Deletes checked ticket categories. */ public function index_onDelete() { if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) { foreach ($checkedIds as $ticketcategoryId) { if (!($ticketcategory = TicketCategory::find($ticketcategoryId))) { continue; } $ticketcategory->delete(); } Flash::success(Lang::get('keios.support::lang.ticketcategories.delete_selected_success')); } else { Flash::error(Lang::get('keios.support::lang.ticketcategories.delete_selected_empty')); } return $this->listRefresh(); }
/** * Loads categories for ticket form */ public function onRun() { $categories = TicketCategory::lists('id', 'name'); $this->page['categories'] = $categories; }