1<?php
2global $cfg;
3
4$assignees = array();
5if (($staff = $ticket->getStaff()))
6    $assignees[] = $staff;
7if (($team = $ticket->getTeam()))
8    $assignees[] = $team;
9
10$form = ReleaseForm::instantiate($_POST);
11?>
12<h3 class="drag-handle"><?php echo $info[':title'] ?:  __('Release Confirmation'); ?></h3>
13<b><a class="close" href="#"><i class="icon-remove-circle"></i></a></b>
14<div class="clear"></div>
15<hr/>
16<?php
17if ($info['error']) {
18    echo sprintf('<p id="msg_error">%s</p>', $info['error']);
19} elseif ($info['warn']) {
20    echo sprintf('<p id="msg_warning">%s</p>', $info['warn']);
21} elseif ($info['msg']) {
22    echo sprintf('<p id="msg_notice">%s</p>', $info['msg']);
23} elseif ($info['notice']) {
24   echo sprintf('<p id="msg_info"><i class="icon-info-sign"></i> %s</p>',
25           $info['notice']);
26}
27?>
28<form class="mass-action" method="post"
29    action="#tickets/<?php echo $ticket->getId(); ?>/release"
30    name="release">
31    <input type='hidden' name='do' value='release'>
32    <table width="100%">
33        <tbody>
34        <?php if ($staff && $team) { ?>
35            <tr><td>
36                <p>
37                <?php echo __('Please check assignee(s) to release assignment.'); ?>
38                </p>
39            </td></tr>
40        <?php } ?>
41        <?php if(count($assignees) > 1) { ?>
42            <?php foreach($assignees as $assignee) { ?>
43                <tr><td>
44                    <label class="inline checkbox">
45                        <?php echo sprintf(
46                            ($isStaff = $assignee instanceof Staff)
47                                ? '<input type="checkbox" name="sid[]" id="s%d" value="%d">'
48                                : '<input type="checkbox" name="tid[]" id="t%d" value="%d">',
49                            $assignee->getId(),
50                            $assignee->getId()); ?>
51                    </label>
52                    <?php echo '<i class="icon-'.(($isStaff) ? 'user' : 'group').'"></i>'; ?>
53                    <?php echo $assignee->getName(); ?>
54                </td></tr>
55            <?php } ?>
56        <?php } else { ?>
57            <tr><td>
58                <input type="hidden" name="<?php echo (($staff)?'s':'t').'id[]'; ?>" value="()">
59                <p>
60                <?php echo __('Please confirm to continue.'); ?>
61                </p>
62                <p>
63                <?php echo sprintf(
64                            __('Are you sure you want to <b>unassign</b> ticket from <b>%s</b>?'),
65                            ($staff) ?: $team); ?>
66                </p>
67            </td></tr>
68        <?php } ?>
69            <tr><td>
70                <p>
71                <?php print $form->getField('comments')->render(); ?>
72                </p>
73            </td></tr>
74        </tbody>
75    </table>
76    <hr>
77    <p class="full-width">
78        <span class="buttons pull-left">
79            <input type="reset" value="<?php echo __('Reset'); ?>">
80            <input type="button" name="cancel" class="close"
81                value="<?php echo __('Cancel'); ?>">
82        </span>
83        <span class="buttons pull-right">
84            <input type="submit" value="<?php
85            echo __('Release'); ?>">
86        </span>
87    </p>
88</form>
89<div class="clear"></div>
90