<td width="120">
                    <label><?php 
echo __('Ticket Status');
?>
:</label>
                </td>
                <td>
                    <div class="faded"></div>
                    <select name="note_status_id">
                        <?php 
$statusId = $info['note_status_id'] ?: $ticket->getStatusId();
$states = array('open');
if ($thisstaff->canCloseTickets()) {
    $states = array_merge($states, array('closed'));
}
foreach (TicketStatusList::getStatuses(array('states' => $states)) as $s) {
    if (!$s->isEnabled()) {
        continue;
    }
    $selected = $statusId == $s->getId();
    echo sprintf('<option value="%d" %s>%s%s</option>', $s->getId(), $selected ? 'selected="selected"' : '', __($s->getName()), $selected ? ' (' . __('current') . ')' : '');
}
?>
                    </select>
                    &nbsp;<span class='error'>*&nbsp;<?php 
echo $errors['note_status_id'];
?>
</span>
                </td>
            </tr>
        </table>
<div class="dialog" style="display:none;" id="advanced-search">
    <h3><?php echo __('Advanced Ticket Search');?></h3>
    <a class="close" href=""><i class="icon-remove-circle"></i></a>
    <hr/>
    <form action="tickets.php" method="post" id="search" name="search">
        <input type="hidden" name="a" value="search">
        <fieldset class="query">
            <input type="input" id="query" name="query" size="20" placeholder="<?php echo __('Keywords') . ' &mdash; ' . __('Optional'); ?>">
        </fieldset>
        <fieldset class="span6">
            <label for="statusId"><?php echo __('Statuses');?>:</label>
            <select id="statusId" name="statusId">
                 <option value="">&mdash; <?php echo __('Any Status');?> &mdash;</option>
                <?php
                foreach (TicketStatusList::getStatuses(
                            array('states' => array('open', 'closed'))) as $s) {
                    echo sprintf('<option data-state="%s" value="%d">%s</option>',
                            $s->getState(), $s->getId(), __($s->getName()));
                }
                ?>
            </select>
        </fieldset>
        <fieldset class="span6">
            <label for="deptId"><?php echo __('Departments');?>:</label>
            <select id="deptId" name="deptId">
                <option value="">&mdash; <?php echo __('All Departments');?> &mdash;</option>
                <?php
                if(($mydepts = $thisstaff->getDepts()) && ($depts=Dept::getDepartments())) {
                    foreach($depts as $id =>$name) {
                        if(!in_array($id, $mydepts)) continue;
                        echo sprintf('<option value="%d">%s</option>', $id, $name);
                <i class="help-tip icon-question-sign" href="#sequence_id"></i>
            </td>
        </tr>
        <tr>
            <td width="180" class="required">
                <?php 
echo __('Default Status');
?>
:
            </td>
            <td>
                <span>
                <select name="default_ticket_status_id">
                <?php 
$criteria = array('states' => array('open'));
foreach (TicketStatusList::getStatuses($criteria) as $status) {
    $name = $status->getName();
    if (!($isenabled = $status->isEnabled())) {
        $name .= ' ' . __('(disabled)');
    }
    echo sprintf('<option value="%d" %s %s>%s</option>', $status->getId(), $config['default_ticket_status_id'] == $status->getId() && $isenabled ? 'selected="selected"' : '', $isenabled ? '' : 'disabled="disabled"', $name);
}
?>
                </select>
                &nbsp;
                <span class="error">*&nbsp;<?php 
echo $errors['default_ticket_status_id'];
?>
</span>
                <i class="help-tip icon-question-sign" href="#default_ticket_status"></i>
                </span>
Exemple #4
0
 function getExtraConfigOptions($source = null)
 {
     $status_choices = array(0 => __('System Default'));
     if ($statuses = TicketStatusList::getStatuses(array('enabled' => true, 'states' => array('open')))) {
         foreach ($statuses as $s) {
             $status_choices[$s->getId()] = $s->getName();
         }
     }
     return array('allowreopen' => new BooleanField(array('label' => __('Allow Reopen'), 'default' => isset($source['allowreopen']) ? $source['allowreopen'] : true, 'id' => 'allowreopen', 'name' => 'allowreopen', 'configuration' => array('desc' => __('Allow tickets on this status to be reopened by end users')), 'visibility' => new VisibilityConstraint(new Q(array('state__eq' => 'closed')), VisibilityConstraint::HIDDEN))), 'reopenstatus' => new ChoiceField(array('label' => __('Reopen Status'), 'required' => false, 'default' => isset($source['reopenstatus']) ? $source['reopenstatus'] : 0, 'id' => 'reopenstatus', 'name' => 'reopenstatus', 'choices' => $status_choices, 'configuration' => array('widget' => 'dropdown', 'multiselect' => false), 'visibility' => new VisibilityConstraint(new Q(array('allowreopen__eq' => true)), VisibilityConstraint::HIDDEN))));
 }
Exemple #5
0
        <tr>
            <td width="180">
                <?php 
echo __('Status');
?>
:
            </td>
            <td>
                <span>
                <select name="status_id">
                    <option value="">&mdash; <?php 
echo __('Default');
?>
 &mdash;</option>
                    <?php 
foreach (TicketStatusList::getStatuses() as $status) {
    $name = $status->getName();
    if (!($isenabled = $status->isEnabled())) {
        $name .= ' ' . __('(disabled)');
    }
    echo sprintf('<option value="%d" %s %s>%s</option>', $status->getId(), $info['status_id'] == $status->getId() ? 'selected="selected"' : '', $isenabled ? '' : 'disabled="disabled"', $name);
}
?>
                </select>
                &nbsp;
                <span class="error"><?php 
echo $errors['status_id'];
?>
</span>
                <i class="help-tip icon-question-sign" href="#status"></i>
                </span>
">
        <table width="100%">
            <?php 
if ($info['extra']) {
    ?>
            <tbody>
                <tr><td colspan="2"><strong><?php 
    echo $info['extra'];
    ?>
</strong></td> </tr>
            </tbody>
            <?php 
}
$verb = '';
if ($state) {
    $statuses = TicketStatusList::getStatuses(array('states' => array($state)))->all();
    $verb = TicketStateField::getVerb($state);
}
if ($statuses) {
    ?>
            <tbody>
                <tr>
                    <td colspan=2>
                        <span>
                        <?php 
    if (count($statuses) > 1) {
        ?>
                            <strong><?php 
        echo __('Status');
        ?>
:&nbsp;</strong>