Bug 12461 - Add patron clubs feature
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / clubs / clubs-add-modify.tt
blob51f4a59723b46faa3acde530c77e16e0c00dac30
1 [% USE KohaDates %]
2 [% USE Branches %]
3 [% USE AuthorisedValues %]
4 [% SET AuthorisedValuesCategories = AuthorisedValues.GetCategories %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Tools &rsaquo; Patron clubs &rsaquo; Club</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% INCLUDE 'calendar.inc' %]
9 </head>
11 <body id="clubs_add_modify" class="clubs">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'cat-search.inc' %]
14 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="clubs.pl">Patron clubs</a> &rsaquo; Add / modify club</div>
16 <div class="yui-t7">
17     <div class="yui-main">
18         <form method="post" class="validated">
19             <input type="hidden" name="id" value="[% club.id %]" />
20             <input type="hidden" name="club_template_id" value="[% club_template.id %]" />
22             <fieldset class="rows">
24                 <legend>
25                     [% IF club %]
26                         Modify club <i>[% club.name %]</i>
27                     [% ELSE %]
28                         Create a new <i>[% club_template.name %]</i> club
29                     [% END %]
30                 </legend>
32                 <ol>
33                     <li>
34                         <label class="required" for="name">Name:</label>
35                         <input id="club-name" name="name" type="text" value="[% club.name %]" required="required"/>
36                         <span class="required">Required</span>
37                     </li>
39                     <li>
40                         <label for="description">Description:</label>
41                         <input id="club-template-name" name="description" type="text" value="[% club.description %]" />
42                     </li>
44                     <li>
45                         <label for="date_start">Start date:</label>
46                         <input name="date_start" id="from" size="10" readonly="readonly" class="datepickerfrom" value="[% club.date_start | $KohaDates %]">
47                     </li>
49                     <li>
50                         <label for="date_end">End date:</label>
51                         <input name="date_end" id="to" size="10" readonly="readonly" class="datepickerto" value="[% club.date_end | $KohaDates %]" >
52                     </li>
54                     <li>
55                         <label for="name">Library:</label>
56                         <select name="branchcode" id="club-template-branchcode">
57                             <option value="">&nbsp</option>
58                             [% PROCESS options_for_libraries libraries => Branches.all( selected => club.branch.branchcode ) %]
59                         </select>
60                     </li>
62                     [% IF club %]
63                         [% FOREACH f IN club.club_fields %]
64                             <li>
65                                 <input type="hidden" name="club_template_field_id" value="[% f.club_template_field.id %]" />
66                                 <input type="hidden" name="club_field_id" value="[% f.id %]" />
68                                 <label for="club_field">[% f.club_template_field.name %]</label>
69                                 [% IF f.club_template_field.authorised_value_category %]
70                                     <select name="club_field">
71                                         [% FOREACH a IN AuthorisedValues.Get( f.club_template_field.authorised_value_category ) %]
72                                             [% IF a.authorised_value == f.value %]
73                                                 <option value="[% a.authorised_value %]" selected="selected">[% a.lib %]</option>
74                                             [% ELSE %]
75                                                 <option value="[% a.authorised_value %]">[% a.lib %]</option>
76                                             [% END %]
77                                         [% END %]
78                                     </select>
79                                 [% ELSE %]
80                                     <input type="text" name="club_field" value="[% f.value %]" />
81                                 [% END %]
82                             </li>
83                         [% END %]
84                     [% ELSE %]
85                         [% FOREACH f IN club_template.club_template_fields %]
86                             <li>
87                                 <input type="hidden" name="club_template_field_id" value="[% f.id %]" />
89                                 <label for="club_field">[% f.name %]</label>
90                                 [% IF f.authorised_value_category %]
91                                     <select name="club_field">
92                                         [% FOREACH a IN AuthorisedValues.Get( f.authorised_value_category ) %]
93                                             <option value="[% a.authorised_value %]">[% a.lib %]</option>
94                                         [% END %]
95                                     </select>
96                                 [% ELSE %]
97                                     <input type="text" name="club_field" />
98                                 [% END %]
99                             </li>
100                         [% END %]
101                     [% END %]
103                 </ol>
105             </fieldset>
107             <fieldset class="action">
108                 <input type="submit" class="btn btn-default" value="Save" />
109                 <a href="clubs.pl" class="cancel">Cancel</a>
110             </fieldset>
111         </form>
112     </div>
113 </div>
115 [% INCLUDE 'intranet-bottom.inc' %]