function getOptions() { $form_choices = array('0' => '--None--'); foreach (DynamicForm::objects()->filter(array('type' => 'G')) as $group) { $form_choices[$group->get('id')] = $group->get('title'); } return array('equipment_backend_enable' => new BooleanField(array('id' => 'equipment_backend_enable', 'label' => 'Enable Backend', 'configuration' => array('desc' => 'Staff backend interface'))), 'equipment_frontend_enable' => new BooleanField(array('id' => 'equipment_frontend_enable', 'label' => 'Enable Frontend', 'configuration' => array('desc' => 'Client facing interface'))), 'equipment_custom_form' => new ChoiceField(array('id' => 'equipment_custom_form', 'label' => 'Custom Form Name', 'choices' => $form_choices, 'configuration' => array('desc' => 'Custom form to use for equipment')))); }
static function objects() { $os = parent::objects(); return $os->filter(array('type' => 'T')); }
static function __load() { require_once INCLUDE_DIR . 'class.i18n.php'; $i18n = new Internationalization(); $tpl = $i18n->getTemplate('list.yaml'); foreach ($tpl->getData() as $f) { if ($f['type'] == 'ticket-status') { $list = DynamicList::create($f); $list->save(); break; } } if (!$list || !($o = DynamicForm::objects()->filter(array('type' => 'L' . $list->getId())))) { return false; } // Create default statuses if ($statuses = $i18n->getTemplate('ticket_status.yaml')->getData()) { foreach ($statuses as $status) { TicketStatus::__create($status); } } return $o[0]; }
.text(' '+$sel.text()) .data('id', $sel.val()) .prepend($('<i>').addClass('icon-reorder')) .append($('<input/>').attr({name:'forms[]', type:'hidden'}).val($sel.val())) .append($('<div></div>').addClass('button-group') .append($('<div></div>').addClass('delete') .append($('<a href=\'#\'>').append($('<i>').addClass('icon-trash'))) )) ); $sel.prop('disabled',true);"> <option selected="selected" disabled="disabled"><?php echo __('Add a form'); ?> </option> <?php foreach (DynamicForm::objects()->filter(array('type' => 'G')) as $f) { if (in_array($f->get('id'), $current_list)) { continue; } ?> <option value="<?php echo $f->get('id'); ?> "><?php echo $f->getTitle(); ?> </option><?php } ?> </select> <div id="delete-warning" style="display:none">
<thead> <tr> <th width="7"> </th> <th><?php echo __('Custom Forms'); ?> </th> <th><?php echo __('Last Updated'); ?> </th> </tr> </thead> <tbody> <?php foreach (DynamicForm::objects()->filter(array('type' => 'G'))->order_by('title')->limit($pageNav->getLimit())->offset($pageNav->getStart()) as $form) { $sel = false; if ($ids && in_array($form->get('id'), $ids)) { $sel = true; } ?> <tr> <td><?php if ($form->isDeletable()) { ?> <input type="checkbox" class="ckb" name="ids[]" value="<?php echo $form->get('id'); ?> " <?php echo $sel ? 'checked="checked"' : '';
<select name="new-form" onchange="javascript: var $sel = $(this).find('option:selected'); $('#ticket-entries').append($('<div></div>').addClass('sortable row-item') .text(' '+$sel.text()) .data('id', $sel.val()) .prepend($('<i>').addClass('icon-reorder')) .append($('<input/>').attr({name:'forms[]', type:'hidden'}).val($sel.val())) .append($('<div></div>').addClass('button-group') .append($('<div></div>').addClass('delete') .append($('<a href=\'#\'>').append($('<i>').addClass('icon-trash'))) )) ); $sel.prop('disabled',true);"> <option selected="selected" disabled="disabled"><?php echo __('Add a form'); ?></option> <?php foreach (DynamicForm::objects()->filter(array( 'type'=>'G')) as $f ) { if (in_array($f->get('id'), $current_list)) continue; ?><option value="<?php echo $f->get('id'); ?>"><?php echo $f->getTitle(); ?></option><?php } ?> </select> <div id="delete-warning" style="display:none"> <hr> <div id="msg_warning"><?php echo __( 'Clicking <strong>Save Changes</strong> will permanently delete data associated with the deleted forms' ); ?> </div> </div>
</select> <i class="help-tip icon-question-sign" href="#parent_topic"></i> <span class="error"> <?php echo $errors['pid']; ?></span> </td> </tr> <tr><th colspan="2"><em><?php echo __('New ticket options');?></em></th></tr> <tr> <td><strong><?php echo __('Custom Form'); ?></strong>:</td> <td><select name="form_id"> <option value="0" <?php if ($info['form_id'] == '0') echo 'selected="selected"'; ?>>— <?php echo __('None'); ?> —</option> <option value="<?php echo Topic::FORM_USE_PARENT; ?>" <?php if ($info['form_id'] == Topic::FORM_USE_PARENT) echo 'selected="selected"'; ?>>— <?php echo __('Use Parent Form'); ?> —</option> <?php foreach (DynamicForm::objects()->filter(array('type'=>'G')) as $group) { ?> <option value="<?php echo $group->get('id'); ?>" <?php if ($group->get('id') == $info['form_id']) echo 'selected="selected"'; ?>> <?php echo $group->get('title'); ?> </option> <?php } ?> </select> <span class="error"> <?php echo $errors['form_id']; ?></span> <i class="help-tip icon-question-sign" href="#custom_form"></i> </td> </tr> <tr> <td width="180" class="required"> <?php echo __('Department'); ?>: </td>