/
round_robin.tpl.html
157 lines (150 loc) · 4.63 KB
/
round_robin.tpl.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
{extends "manage/manage.tpl.html"}
{block "manage_content"}
<script type="text/javascript">
<!--
var url = '{$core.rel_url}manage/round_robin.php';
function populateUserComboBox()
{
url += '?prj_id=' + Eventum.getField('project').val();
window.location.href = url;
}
function validateForm()
{
if (!Validation.hasOneSelected('users[]')) {
alert('{t escape=js}Please assign the appropriate users for this round robin entry.{/t}');
Validation.selectField('users[]');
return false;
}
return true;
}
function checkDelete()
{
if (!Validation.hasOneChecked('items[]')) {
alert('{t escape=js}Please select at least one of the round robin entries.{/t}');
return false;
}
if (!confirm('{t escape=js}This action will permanently remove the selected round robin entries.{/t}')) {
return false;
} else {
return true;
}
}
$().ready(function() {
$('#round_robin_form').submit(validateForm);
$('.select_all').click(function() { Eventum.toggleCheckAll('items[]'); });
$('select[name=project]').change(populateUserComboBox);
$('#delete_form').submit(checkDelete);
});
//-->
</script>
<form id="round_robin_form" method="post">
{if $smarty.get.cat|default:'' == 'edit'}
<input type="hidden" name="cat" value="update">
<input type="hidden" name="id" value="{$smarty.get.id|intval|default:''}">
{else}
<input type="hidden" name="cat" value="new">
{/if}
<table class="bordered">
<tr class="title">
<th colspan="2">
{t}Manage Round Robin Assignments{/t}
</th>
</tr>
<tr>
<th width="140">
<nobr>{t}Project{/t}</nobr>
</th>
<td width="80%">
{if $info.prr_prj_id|default:'' != ''}
{assign var=project value=$info.prr_prj_id|default:''}
{else}
{assign var=project value=$smarty.request.prj_id|default:''}
{/if}
<select name="project">
<option value="-1">{t}Please choose an option{/t}</option>
{html_options options=$project_list|default:'' selected=$project|default:''}
</select>
{include file="error_icon.tpl.html" field="project"}
</td>
</tr>
<tr>
<th width="140">
{t}Assignable Users{/t}
</th>
<td width="80%">
<select name="users[]" multiple size="4">
{html_options options=$user_options|default:'' selected=$info.users|default:''}
</select>
{include file="error_icon.tpl.html" field="users[]"}
</td>
</tr>
<tr>
<th width="140">
{t}Blackout Time Range{/t}
</th>
<td width="80%">
<table>
<tr>
<td>{t}Start{/t}:</td>
<td>{html_select_time minute_interval=5 time=$info.prr_blackout_start|default:'' field_array="blackout_start" prefix="" display_seconds=false all_extra="class='default'"}</td>
</tr>
<tr>
<td>{t}End{/t}:</td>
<td>{html_select_time minute_interval=5 time=$info.prr_blackout_end|default:'' field_array="blackout_end" prefix="" display_seconds=false all_extra="class='default'"}</td>
</tr>
</table>
</td>
</tr>
<tr class="buttons">
<td colspan="2">
{if $smarty.get.cat|default:'' == 'edit'}
<input type="submit" value="{t}Update Round Robin Entry{/t}">
{else}
<input type="submit" value="{t}Create Round Robin Entry{/t}">
{/if}
<input type="reset" value="{t}Reset{/t}">
</td>
</tr>
</table>
</form>
<form id="delete_form" method="post">
<input type="hidden" name="cat" value="delete">
<table class="bordered grid">
<tr class="title">
<th colspan="2">
{t}Existing Round Robin Entries{/t}
</th>
</tr>
<tr>
<th width="4" nowrap><input type="button" value="{t}All{/t}" class="select_all"></th>
<th width="30%"> {t}Project{/t}</th>
<th width="70%"> {t}Assignable Users{/t}</th>
</tr>
{section name="i" loop=$list}
<tr class="{cycle values="odd,even"}">
<td width="4" nowrap align="center"><input type="checkbox" name="items[]" value="{$list[i].prr_id}"></td>
<td width="30%">
<a href="{$core.rel_url}manage/round_robin.php?cat=edit&id={$list[i].prr_id}" title="{t}update this entry{/t}">{$list[i].prj_title|escape:"html"}</a>
</td>
<td width="70%">
{$list[i].users|escape:"html"}
</td>
</tr>
{sectionelse}
<tr>
<td colspan="3" align="center">
<i>{t}No round robin entries could be found.{/t}</i>
</td>
</tr>
{/section}
<tr class="buttons">
<td width="4" align="center">
<input type="button" value="{t}All{/t}" class="select_all">
</td>
<td colspan="2">
<input type="submit" value="{t}Delete{/t}">
</td>
</tr>
</table>
</form>
{/block}