source: LATMOS-Accounts-Web/root/html/massedit/index.tt @ 624

Last change on this file since 624 was 236, checked in by nanardon, 15 years ago
  • make massedit working
  • Property svn:keywords set to Id Rev
File size: 2.7 KB
Line 
1<form action="[% c.uri_for() %]" method="post">
2<select name="otype">
3[% FOREACH otype = db.list_supported_objects() %]
4<option value="[% otype | html %]"[% ' "selected"' IF otype == c.req.param('otype') %]>[% otype | html %]</option>
5[% END %]
6</select>
7<input type="submit">
8</form>
9
10[% IF c.req.param('otype') %]
11[% INCLUDE 'includes/filter.tt'
12    formuri = c.uri_for()
13    otype = c.req.param('otype')
14%]
15
16<table border="1">
17<form action="[% c.uri_for() %]" method="POST">
18<input type="hidden" name="otype" value="[% c.req.param('otype') %]">
19<tr>
20<th>Object name</th>
21[% FOREACH atcol = c.req.param('attrcol') %]
22[% NEXT IF NOT atcol %]
23    <th>
24    <select name="attrcol">
25    <option value="">Remove</option>
26    [% FOREACH f = db.list_canonical_fields(c.req.param('otype'), 'w') %]
27    <option value="[% f | html %]" [% ' selected="1"' IF atcol == f %]>
28        [% c.model('AttrForms').attr_label(f) | html %]
29    </option>
30    [% END %]
31    </select>
32    </th>
33[% END %]
34    <th>
35    <select name="attrcol">
36    <option value="">Select to add</option>
37    [% FOREACH f = db.list_canonical_fields(c.req.param('otype'), 'w') %]
38    <option value="[% f | html %]">
39        [% c.model('AttrForms').attr_label(f) | html %]
40    </option>
41    [% END %]
42    </select>
43    <input type="submit"></td>
44</tr>
45</form>
46
47<form action="[% c.uri_for() %]" method="POST">
48<input type="hidden" name="otype" value="[% c.req.param('otype') %]">
49<input type="hidden" name="_change" value="all">
50[% FOREACH obj = objectslist %]
51<input type="hidden" name="objid" value="[% obj.id | html  %]">
52[% END %]
53[% FOREACH atcol = c.req.param('attrcol') %]
54[% NEXT IF NOT atcol %]
55[% END %]
56<tr>
57<th>Change for All</th>
58[% attrform = c.model('AttrForms', c.req.param('otype'), c.req.param('otype'), db) %]
59[% FOREACH atcol = c.req.param('attrcol') %]
60[% NEXT IF NOT atcol %]
61<td>
62    [% attrform.attr_field(atcol) %]
63</td>
64[% END %]
65<td><input type="submit"></td>
66</tr>
67</form>
68
69<form action="[% c.uri_for() %]" method="POST">
70<input type="hidden" name="otype" value="[% c.req.param('otype') %]">
71<input type="hidden" name="_change" value="perobj">
72[% FOREACH atcol = c.req.param('attrcol') %]
73[% NEXT IF NOT atcol %]
74[% END %]
75[% FOREACH obj = objectslist %]
76[% attrform = c.model('AttrForms', c.req.param('otype'), obj) %]
77<tr>
78<th>[% obj.id | html  %]
79<input type="hidden" name="objid" value="[% obj.id | html  %]">
80</th>
81[% FOREACH atcol = c.req.param('attrcol') %]
82[% NEXT IF NOT atcol %]
83<td>
84    [% attrform.attr_field(atcol) %]
85</td>
86[% END %]
87<td></td>
88</tr>
89[% END %]
90<tr>
91<th></th>
92[% FOREACH atcol = c.req.param('attrcol') %]
93[% NEXT IF NOT atcol %]
94<td>
95</td>
96[% END %]
97<td><input type="submit"></td>
98</tr>
99</form>
100</table>
101[% END %]
Note: See TracBrowser for help on using the repository browser.