</label> </div> <div class="btn-group col-xs-12" id="group-selector" data-toggle="buttons"> <?php foreach ($groups as $id => $name):?> <label class="btn btn-primary"> <input type="radio" class="export-group" name="group" autocomplete="off" value="<?=$id?>" /> <?=$name?> </label> <?php endforeach;?> <label class="btn btn-primary"> <input type="radio" class="export-group" name="group" autocomplete="off" value="0" /> Custom </label> </div> <div class="clearfix"> </div> <div class="col-xs-12"> <input type="hidden" name="group" id="group-input" value=""/> <input type="hidden" name="csv" id="csv-input" value="" /> <button class="btn btn-success disabled" id="export-button" type="submit">Export</button> </div> <div class="clearfix"> </div> <table class="table table-striped hidden" id="columns"> <?php foreach (Columns::get_all() as $key => $name):?> <tr><td> <label class="control-label"> <input type="checkbox" data-csv="<?=Columns::get_csv($key) ? 1 : 0?>" name="columns[<?=$key?>]" /> <?=$name?> </label> </td></tr> <?php endforeach;?> </table> </form>
<table class="table table-striped" data-url="<?=URL::base()?>security/columns/"> <?php $cnt = 0; foreach (Columns::get_all() as $id => $name):?> <?php if ($cnt % 20 == 0):?> <tr> <th rowspan="2"> </th> <th colspan="2" class="text-center">Admin</th> <?php foreach($groups as $group):?> <th colspan="2" class="text-center"><?=HTML::chars($group)?></th> <?php endforeach;?> </tr> <tr> <th>Search</th> <th>Persistent</th> <?php foreach($groups as $group):?> <th class="text-center">Job view</th> <th class="text-center">Search</th> <?php endforeach;?> </tr> <?php endif;?> <tr> <th class="text-right"><?=HTML::chars($name)?></th> <td class="text-left"> <?=Form::select(NULL, array(0 => 'Don\'t show', 1 => 'Simple filtering', 2 => 'Advanced filtering'), Columns::get_static($id), array('class' => 'column-show', 'data-id' => $id))?> </td> <td class="text-center"> <?=Form::checkbox(NULL, NULL, Columns::get_persistent($id) ? true : false, array('class' => 'column-persistent', 'data-id' => $id))?> </td> <?php foreach ($groups as $group => $name): $value = Arr::path($permissions, array($group, $id)); $value2 = Arr::path($search, array($group, $id));?> <td class="text-center"> <?=Form::select(NULL, Columns::$states, $value, array('class' => 'column-permission', 'data-id' => $id, 'group-id' => $group))?> </td>
public function action_columns() { $list = array(array('id' => 0, 'name' => 'Ticket ID')); foreach (Columns::get_all() as $key => $value) { $column = array('id' => $key, 'name' => $value); $type = Columns::get_type($key); if (substr($type, 0, 4) == 'enum') { $id = substr($type, 5); $column['type'] = Enums::is_multi($id) ? 'multi' : 'enum'; $column['values'] = Enums::get_values($id); } else { $column['type'] = $type ?: 'string'; } $list[] = $column; } die(json_encode($list)); }