/
products.tpl.html
167 lines (160 loc) · 5.63 KB
/
products.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
158
159
160
161
162
163
164
165
166
167
{extends "manage/manage.tpl.html"}
{block "manage_content"}
<script type="text/javascript">
function validateForm()
{
if (Validation.isFieldWhitespace('title')) {
Validation.selectField('title');
alert('{t escape=js}Please enter the name of this product.{/t}');
return false;
}
if (Validation.isFieldWhitespace('rank')) {
Validation.selectField('rank');
alert('{t escape=js}Please enter the rank of this product.{/t}');
return false;
}
return true;
}
function checkDelete()
{
if (!Validation.hasOneChecked('items[]')) {
alert('{t escape=js}Please select at least one of the products.{/t}');
return false;
}
if (!confirm('{t escape=js}WARNING: This action will remove the selected products permanently.{/t}\n{t escape=js}Please click OK to confirm.{/t}')) {
return false;
} else {
return true;
}
}
$().ready(function() {
$('.select_all').click(function() { Eventum.toggleCheckAll('items[]'); });
$('#delete_product').submit(checkDelete);
$('#product_form').submit(validateForm);
});
</script>
<form id="product_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 Products{/t}
</th>
</tr>
<tr>
<th width="120">
{t}Title{/t} *
</th>
<td>
<input type="text" name="title" size="40" value="{$info.pro_title|default:''|escape:'html'}">
{include file="error_icon.tpl.html" field="title"}
</td>
</tr>
<tr>
<th width="120">
{t}Version How To{/t}
</th>
<td>
<input type="text" name="version_howto" size="100" value="{$info.pro_version_howto|default:''|escape}">
{include file="error_icon.tpl.html" field="version_howto"}
</td>
</tr>
<tr>
<th width="120">
{t}Email Address{/t}
</th>
<td>
<input type="text" name="email" size="100" value="{$info.pro_email|default:''|escape}">
{include file="error_icon.tpl.html" field="email"}
<br />{t}This address will be notified when issues are created with this product.{/t}
</td>
</tr>
<tr>
<th width="120">
<nobr>{t}Rank{/t} *</nobr>
</th>
<td>
<input type="text" name="rank" size="3" value="{$info.pro_rank|default:''}" />
{include file="error_icon.tpl.html" field="rank"}
</td>
</tr>
<tr>
<th width="120">
{t}Removed{/t}
</th>
<td width="80%">
<input type="checkbox" name="removed" value="1" {if $info.pro_removed|default:'' == 1}checked{/if} />
</td>
</tr>
<tr class="buttons">
<th colspan="2">
{if $smarty.get.cat|default:'' == 'edit'}
<input type="submit" value="{t}Update Product{/t}">
{else}
<input type="submit" value="{t}Create Product{/t}">
{/if}
<input type="reset" value="{t}Reset{/t}">
</th>
</tr>
</table>
</form>
<form id="delete_product" method="post">
<table class="bordered grid">
<tr class="title">
<th colspan="5">
{t}Existing Products{/t}
</th>
</tr>
<tr>
<th nowrap><input type="button" value="{t}All{/t}" class="select_all"></th>
<th> {t}Title{/t}</th>
<th> {t}Version How To{/t}</th>
<th> {t}Email{/t}</th>
<th> {t}Rank{/t}</th>
<th> {t}Removed{/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].pro_id}" {if $smarty.section.i.total == 0}disabled{/if}>
</td>
<td width="20%">
<a class="link" href="{$core.rel_url}manage/products.php?cat=edit&id={$list[i].pro_id}" title="{t}update this entry{/t}">{$list[i].pro_title|escape}</a>
</td>
<td width="20%">
{$list[i].pro_version_howto|escape}
</td>
<td width="40%">
{$list[i].pro_email|escape}
</td>
<td width="10%">
{$list[i].pro_rank}
</td>
<td width="10%">
{if $list[i].pro_removed == 1}Yes{/if}
</td>
</tr>
{sectionelse}
<tr class="no_results">
<td colspan="5">
{t}No products could be found.{/t}
</td>
</tr>
{/section}
<tr class="buttons">
<td width="4">
<input type="button" value="{t}All{/t}" class="select_all">
<input type="hidden" name="cat" value="delete">
</td>
<td colspan="5">
<input type="submit" value="{t}Delete{/t}">
</td>
</tr>
</table>
</form>
{/block}