Ejemplo n.º 1
0
    $form_actions = array('class' => 'action_bar action_bar_center action_bar_single', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save')), array('type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete'), 'onclick' => "return confirm('" . _l('Really delete this record?') . "');")));
    echo module_form::generate_form_actions($form_actions);
    ?>


    </form>

    <?php 
} else {
    print_heading(array('title' => 'Ticket Types/Departments', 'type' => 'h2', 'main' => true, 'button' => array('url' => module_ticket::link_open_type('new'), 'title' => 'Add New Type', 'type' => 'add')));
    $staff = module_ticket::get_ticket_staff_rel();
    /** START TABLE LAYOUT **/
    $table_manager = module_theme::new_table_manager();
    $columns = array();
    $columns['type'] = array('title' => _l('Type/Department'), 'callback' => function ($ticket_type) {
        echo module_ticket::link_open_type($ticket_type['ticket_type_id'], true);
    }, 'cell_class' => 'row_action');
    $columns['public'] = array('title' => _l('Public'), 'callback' => function ($ticket_type) {
        $yn = get_yes_no();
        echo _l($yn[$ticket_type['public']]);
    });
    $columns['staff'] = array('title' => _l('Staff'), 'callback' => function ($ticket_type) use($staff) {
        echo isset($staff[$ticket_type['default_user_id']]) ? $staff[$ticket_type['default_user_id']] : _l('Default');
    });
    $table_manager->set_id('ticket_type_list');
    $table_manager->set_columns($columns);
    $table_manager->set_rows($ticket_types);
    $table_manager->pagination = true;
    $table_manager->print_table();
    /** END TABLE LAYOUT **/
}