| 162 |
naveen |
1 |
<!DOCTYPE html PUBLIC
|
|
|
2 |
"-//W3C//DTD XHTML 1.1 Transitional//EN"
|
|
|
3 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
4 |
|
|
|
5 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
|
6 |
<head>
|
|
|
7 |
<title>List of Entities</title>
|
| 242 |
naveen |
8 |
<script type="text/javascript" src="jquery/jquery-1.4.2.js"></script>
|
|
|
9 |
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.core.js"></script>
|
|
|
10 |
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.widget.js"></script>
|
|
|
11 |
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.position.js"></script>
|
|
|
12 |
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.autocomplete.js"></script>
|
|
|
13 |
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.dialog.js"></script>
|
|
|
14 |
<script type="text/javascript" src="jquery/validation/jquery.validate.js"></script>
|
|
|
15 |
|
|
|
16 |
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.mouse.js"></script>
|
|
|
17 |
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.draggable.js"></script>
|
|
|
18 |
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.resizable.js"></script>
|
|
|
19 |
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.effects.core.js"></script>
|
|
|
20 |
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.effects.blind.js"></script>
|
|
|
21 |
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.effects.drop.js"></script>
|
| 516 |
rajveer |
22 |
<script type="text/javascript" src="jquery/jquery.chained.js"></script>
|
| 579 |
rajveer |
23 |
<script type="text/javascript" src="jquery/jquery.tablesorter.js"></script>
|
| 242 |
naveen |
24 |
<script>
|
|
|
25 |
// increase the default animation speed to exaggerate the effect
|
|
|
26 |
jQuery.fx.speeds._default = 1000;
|
|
|
27 |
$(function() {
|
| 579 |
rajveer |
28 |
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
$('.category').click(function() {
|
|
|
32 |
var categoryid = $(this).attr('id') + "-table";
|
|
|
33 |
alert("Toggle style for category" + categoryid);
|
|
|
34 |
$('.category-table').hide();
|
|
|
35 |
$('#'+categoryid).show();
|
|
|
36 |
return false;
|
|
|
37 |
});
|
|
|
38 |
|
|
|
39 |
$('.delete').click(function() {
|
|
|
40 |
var entityid = $(this).attr('id');
|
| 725 |
chandransh |
41 |
$('#dialog').dialog({
|
| 579 |
rajveer |
42 |
autoOpen: false,
|
|
|
43 |
width: 470,
|
|
|
44 |
height: 100,
|
|
|
45 |
modal: true,
|
|
|
46 |
title: 'Are you sure ? It will be permanently deleted. Continue ?',
|
|
|
47 |
buttons: {
|
|
|
48 |
"OK":function() { window.location.href = "/content/entity/" + entityid + "?_method=delete" },
|
|
|
49 |
"Cancel": function() { $(this).dialog("close"); }
|
|
|
50 |
}
|
|
|
51 |
});
|
|
|
52 |
|
|
|
53 |
$('#dialog').dialog('open');
|
|
|
54 |
|
|
|
55 |
return false;
|
|
|
56 |
});
|
| 1051 |
rajveer |
57 |
|
|
|
58 |
$('.complete').click(function() {
|
|
|
59 |
var entityid = $(this).attr('id');
|
|
|
60 |
$('#dialog').dialog({
|
|
|
61 |
autoOpen: false,
|
|
|
62 |
width: 470,
|
|
|
63 |
height: 100,
|
|
|
64 |
modal: true,
|
|
|
65 |
title: 'The item will be completed, you will not be able to make further changes. Continue?',
|
|
|
66 |
buttons: {
|
|
|
67 |
"OK":function() { window.location.href = "/content/item-update/" + entityid + "?_method=put&action=complete" },
|
|
|
68 |
"Cancel": function() { $(this).dialog("close"); }
|
|
|
69 |
}
|
|
|
70 |
});
|
|
|
71 |
|
|
|
72 |
$('#dialog').dialog('open');
|
|
|
73 |
|
|
|
74 |
return false;
|
|
|
75 |
});
|
|
|
76 |
|
| 579 |
rajveer |
77 |
|
| 725 |
chandransh |
78 |
$('.ready').click(function() {
|
|
|
79 |
var entityid = $(this).attr('id');
|
|
|
80 |
$('#dialog').dialog({
|
|
|
81 |
autoOpen: false,
|
|
|
82 |
width: 470,
|
|
|
83 |
height: 100,
|
|
|
84 |
modal: true,
|
|
|
85 |
title: 'The item will become available for consumers to place orders for. Continue?',
|
|
|
86 |
buttons: {
|
| 1152 |
rajveer |
87 |
"OK":function() { window.location.href = "/content/item-update/" + entityid + "?_method=put&action=ready" },
|
| 725 |
chandransh |
88 |
"Cancel": function() { $(this).dialog("close"); }
|
|
|
89 |
}
|
|
|
90 |
});
|
|
|
91 |
|
|
|
92 |
$('#dialog').dialog('open');
|
|
|
93 |
|
|
|
94 |
return false;
|
|
|
95 |
});
|
| 1051 |
rajveer |
96 |
|
|
|
97 |
|
|
|
98 |
$('.assign').click(function() {
|
|
|
99 |
var entityid = $(this).attr('id');
|
|
|
100 |
|
|
|
101 |
$('#dialog-form').dialog({
|
|
|
102 |
autoOpen: false,
|
|
|
103 |
width: 470,
|
|
|
104 |
height: 400,
|
|
|
105 |
modal: true,
|
|
|
106 |
title: 'The item will be assigned. Are you sure ?',
|
|
|
107 |
buttons: {
|
|
|
108 |
"OK":function() {
|
|
|
109 |
var username = $('#username').val();
|
|
|
110 |
window.location.href = "/content/item-update/" + entityid + "?_method=put&action=assign&username=" + username;
|
|
|
111 |
},
|
|
|
112 |
"Cancel": function() { $(this).dialog("close"); }
|
|
|
113 |
}
|
|
|
114 |
});
|
|
|
115 |
|
|
|
116 |
$('#dialog-form').dialog('open');
|
|
|
117 |
|
|
|
118 |
return false;
|
|
|
119 |
});
|
|
|
120 |
|
|
|
121 |
|
| 242 |
naveen |
122 |
});
|
| 516 |
rajveer |
123 |
|
| 579 |
rajveer |
124 |
$(document).ready(function()
|
|
|
125 |
{
|
|
|
126 |
$("#myTable").tablesorter();
|
|
|
127 |
}
|
|
|
128 |
);
|
|
|
129 |
|
| 516 |
rajveer |
130 |
</script>
|
|
|
131 |
|
| 579 |
rajveer |
132 |
|
| 198 |
naveen |
133 |
<link type="text/css" href="jquery/jqueryui/themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" />
|
| 162 |
naveen |
134 |
<style type="text/css">
|
| 212 |
naveen |
135 |
|
|
|
136 |
* { font-family: Verdana; font-size: 96%; }
|
|
|
137 |
label { width: 10em; float: left; }
|
|
|
138 |
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
|
|
|
139 |
p { clear: both; }
|
|
|
140 |
.submit { margin-left: 12em; }
|
|
|
141 |
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
|
|
|
142 |
|
| 162 |
naveen |
143 |
table {
|
|
|
144 |
border-width: 1px 1px 1px 1px;
|
|
|
145 |
border-spacing: 2px;
|
|
|
146 |
border-style: outset outset outset outset;
|
|
|
147 |
border-color: gray gray gray gray;
|
|
|
148 |
border-collapse: separate;
|
|
|
149 |
background-color: white;
|
|
|
150 |
}
|
|
|
151 |
th {
|
|
|
152 |
border-width: 1px 1px 1px 1px;
|
|
|
153 |
padding: 1px 1px 1px 1px;
|
|
|
154 |
border-style: inset inset inset inset;
|
|
|
155 |
border-color: gray gray gray gray;
|
|
|
156 |
background-color: white;
|
|
|
157 |
-moz-border-radius: 0px 0px 0px 0px;
|
|
|
158 |
}
|
|
|
159 |
td {
|
|
|
160 |
border-width: 1px 1px 1px 1px;
|
|
|
161 |
padding: 1px 1px 1px 1px;
|
|
|
162 |
border-style: inset inset inset inset;
|
|
|
163 |
border-color: gray gray gray gray;
|
|
|
164 |
background-color: white;
|
|
|
165 |
-moz-border-radius: 0px 0px 0px 0px;
|
|
|
166 |
}
|
| 242 |
naveen |
167 |
div.dialog {
|
|
|
168 |
padding:12px;
|
|
|
169 |
font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif";
|
|
|
170 |
}
|
| 162 |
naveen |
171 |
</style>
|
| 242 |
naveen |
172 |
|
| 162 |
naveen |
173 |
</head>
|
|
|
174 |
<body>
|
| 208 |
naveen |
175 |
<div>
|
| 1051 |
rajveer |
176 |
<span align="right"> Welcome $action.getUsername() <a href="$request.contextPath/logout">logout</a></span>
|
|
|
177 |
</div>
|
|
|
178 |
<div>
|
| 2276 |
rajveer |
179 |
|
|
|
180 |
<p/>
|
|
|
181 |
<span align="right"> <a href="$request.contextPath/helpdoc">Go to helpdoc</a></span>
|
|
|
182 |
<p/>
|
| 162 |
naveen |
183 |
<h1>Entities</h1>
|
| 242 |
naveen |
184 |
|
| 1051 |
rajveer |
185 |
<div style="color:green;">
|
| 242 |
naveen |
186 |
#sactionmessage()
|
| 1051 |
rajveer |
187 |
</div>
|
|
|
188 |
<div style="color:red;">
|
|
|
189 |
#sactionerror()
|
|
|
190 |
</div>
|
| 2095 |
rajveer |
191 |
|
|
|
192 |
#set($inconsistententities = $action.getInconsistentEntities())
|
| 2097 |
rajveer |
193 |
|
|
|
194 |
#if($inconsistententities && !$inconsistententities.isEmpty())
|
|
|
195 |
<div style="color:red;">
|
| 2095 |
rajveer |
196 |
Following entities are not yet complete.
|
|
|
197 |
<ul>
|
|
|
198 |
#foreach($inconsistententity in $inconsistententities)
|
|
|
199 |
<li>$inconsistententity</li>
|
|
|
200 |
#end
|
|
|
201 |
</ul>
|
|
|
202 |
Please complete them before 2.45 PM. Otherwise these entities will be removed from www.saholic.com.
|
|
|
203 |
</div>
|
|
|
204 |
#end
|
| 1152 |
rajveer |
205 |
<!--
|
| 1051 |
rajveer |
206 |
<a href="$request.contextPath/entity/new">Create New</a>
|
| 1152 |
rajveer |
207 |
-->
|
| 162 |
naveen |
208 |
<p></p>
|
| 1152 |
rajveer |
209 |
#set ( $entitiesState = $action.getEntitiesState() )
|
| 1051 |
rajveer |
210 |
#set ( $users = $action.getAllUserNames() )
|
| 250 |
naveen |
211 |
|
|
|
212 |
<div>
|
| 1152 |
rajveer |
213 |
#drawAllEntities($entitiesState)
|
| 250 |
naveen |
214 |
</div>
|
| 1051 |
rajveer |
215 |
</div>
|
| 250 |
naveen |
216 |
|
| 1051 |
rajveer |
217 |
<div id="dialog" title="">
|
|
|
218 |
</div>
|
| 579 |
rajveer |
219 |
|
| 1051 |
rajveer |
220 |
<div style="display:none;">
|
|
|
221 |
<div id="dialog-form" title="Select an user to assign">
|
|
|
222 |
<p class="validateTips">All form fields are required.</p>
|
|
|
223 |
<form>
|
|
|
224 |
<fieldset>
|
|
|
225 |
<label for="user">Username</label>
|
|
|
226 |
<select id="username" name="username">
|
|
|
227 |
#foreach($user in $users)
|
|
|
228 |
<option value="$user" class="text ui-widget-content ui-corner-all">$user</option>
|
| 579 |
rajveer |
229 |
#end
|
| 1051 |
rajveer |
230 |
</select>
|
| 579 |
rajveer |
231 |
|
| 1051 |
rajveer |
232 |
</fieldset>
|
|
|
233 |
</form>
|
|
|
234 |
</div>
|
| 250 |
naveen |
235 |
</div>
|
|
|
236 |
|
|
|
237 |
</body>
|
|
|
238 |
</html>
|
|
|
239 |
|
| 1152 |
rajveer |
240 |
#macro (drawAllEntities $entitiesState)
|
| 579 |
rajveer |
241 |
<table id="myTable">
|
|
|
242 |
<thead>
|
|
|
243 |
<tr style="border: 1px">
|
|
|
244 |
<th>#</th>
|
|
|
245 |
<th>Entity ID</th>
|
|
|
246 |
<th>Category</th>
|
|
|
247 |
<th>Brand</th>
|
| 2605 |
rajveer |
248 |
<th>Model Name</th>
|
| 579 |
rajveer |
249 |
<th>Model Number</th>
|
| 1051 |
rajveer |
250 |
<th>Current Status</th>
|
|
|
251 |
<th>Created By</th>
|
|
|
252 |
<th>Assigned To</th>
|
|
|
253 |
<th>Completed By</th>
|
|
|
254 |
<th colspan="5">Actions</th>
|
| 579 |
rajveer |
255 |
</tr>
|
|
|
256 |
</thead>
|
|
|
257 |
<tbody>
|
| 1152 |
rajveer |
258 |
|
|
|
259 |
|
|
|
260 |
#foreach ( $entityid in $entitiesState.keySet() )
|
|
|
261 |
#set($entityState = $entitiesState.get($entityid))
|
| 579 |
rajveer |
262 |
<tr style="border: 1px">
|
|
|
263 |
<td>$velocityCount</td>
|
|
|
264 |
<td><a href="/content/entity/$entityid/edit">$entityid</a></td>
|
| 1152 |
rajveer |
265 |
<td>$action.getCategoryName($entityState.getCategoryID())</td>
|
|
|
266 |
<td>$entityState.getBrand()</td>
|
| 2605 |
rajveer |
267 |
<td>$entityState.getModelName()</td>
|
| 1152 |
rajveer |
268 |
<td>$entityState.getModelNumber()</td>
|
| 1051 |
rajveer |
269 |
|
|
|
270 |
<td>$entityState.getStatus()</td>
|
|
|
271 |
<td>$entityState.getCreatedBy()</td>
|
|
|
272 |
<td>#if($entityState.getAssignedTo())$entityState.getAssignedTo()#end</td>
|
|
|
273 |
<td>#if($entityState.getCompletedBy())$entityState.getCompletedBy()#end</td>
|
|
|
274 |
|
| 579 |
rajveer |
275 |
<td><a href="/content/entity/$entityid" target="_blank">View</a></td>
|
|
|
276 |
<!-- <td><a href="" id="$entityid" class="opener">Media</a></td> -->
|
|
|
277 |
<td><a href="" id="$entityid" class="delete">Delete</a></td>
|
| 1051 |
rajveer |
278 |
<td><a href="" id="$entityid" class="ready">Approve</a></td>
|
|
|
279 |
|
|
|
280 |
<td><a href="" id="$entityid" class="complete">Complete</a></td>
|
|
|
281 |
<td><a href="" id="$entityid" class="assign">Assign</a></td>
|
| 579 |
rajveer |
282 |
</tr>
|
|
|
283 |
#end
|
|
|
284 |
</tbody>
|
|
|
285 |
</table>
|
|
|
286 |
|
|
|
287 |
#end
|