Bug 34188: Require Library Branch Selection when Logging in
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / clubs / clubs-add-modify.tt
1 [% USE raw %]
2 [% USE HtmlTags %]
3 [% USE KohaDates %]
4 [% USE Branches %]
5 [% USE AuthorisedValues %]
6 [% PROCESS 'i18n.inc' %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>[% FILTER collapse %]
10     [% IF club %]
11         [% tx("Modify club {club_name}", { club_name = club.name }) | html %]
12     [% ELSE %]
13         [% tx("Create a new {club_template} club", { club_template = club_template.name }) | html %]
14     [% END %] &rsaquo;
15     [% t("Patron clubs") | html %] &rsaquo;
16     [% t("Tools") | html %] &rsaquo;
17     [% t("Koha") | html %]
18 [% END %]</title>
19 [% INCLUDE 'doc-head-close.inc' %]
20 </head>
21
22 <body id="clubs_add_modify" class="clubs">
23 [% WRAPPER 'header.inc' %]
24     [% INCLUDE 'cat-search.inc' %]
25 [% END %]
26
27 [% WRAPPER 'sub-header.inc' %]
28     [% WRAPPER breadcrumbs %]
29         [% WRAPPER breadcrumb_item %]
30             <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
31         [% END %]
32         [% WRAPPER breadcrumb_item %]
33             <a href="clubs.pl">Patron clubs</a>
34         [% END %]
35         [% WRAPPER breadcrumb_item bc_active= 1 %]
36             [% IF club %]
37                 <span>Modify club [% club.name | html | $HtmlTags tag="em" %]</span>
38             [% ELSE %]
39                 <span>Create a new [% club_template.name | html | $HtmlTags tag="em" %] club</span>
40             [% END %]
41         [% END %]
42     [% END #/ WRAPPER breadcrumbs %]
43 [% END #/ WRAPPER sub-header.inc %]
44
45 <div class="main container-fluid">
46     <div class="row">
47         <div class="col-md-8 col-md-offset-2">
48
49             <form method="post" class="validated">
50                 <input type="hidden" name="id" value="[% club.id | html %]" />
51                 <input type="hidden" name="club_template_id" value="[% club_template.id | html %]" />
52
53                 <fieldset class="rows">
54
55                     <legend>
56                         <h1>
57                             [% IF club %]
58                                 <span>Modify club [% club.name | html | $HtmlTags tag="em" %]</span>
59                             [% ELSE %]
60                                 <span>Create a new [% club_template.name | html | $HtmlTags tag="em" %] club</span>
61                             [% END %]
62                         </h1>
63                     </legend>
64
65                     <ol>
66                         <li>
67                             <label class="required" for="club-name">Name:</label>
68                             <input id="club-name" name="name" type="text" value="[% club.name | html %]" required="required"/>
69                             <span class="required">Required</span>
70                         </li>
71
72                         <li>
73                             <label for="club-template-name">Description:</label>
74                             <input id="club-template-name" name="description" type="text" value="[% club.description | html %]" size="40" />
75                         </li>
76
77                         <li>
78                             <label for="from">Start date:</label>
79                             <input name="date_start" id="from" size="10" class="flatpickr" data-date_to="to" value="[% club.date_start | html %]">
80                         </li>
81
82                         <li>
83                             <label for="to">End date:</label>
84                             <input name="date_end" id="to" size="10" class="flatpickr" value="[% club.date_end | html %]" >
85                         </li>
86
87                         <li>
88                             <label for="club-template-branchcode">Library:</label>
89                             <select name="branchcode" id="club-template-branchcode">
90                                 <option value=""></option>
91                                 [% PROCESS options_for_libraries libraries => Branches.all( selected => club.branch.branchcode ) %]
92                             </select>
93                         </li>
94
95                         [% IF club %]
96                             [% FOREACH f IN club.club_fields %]
97                                 <li>
98                                     <input type="hidden" name="club_template_field_id" value="[% f.club_template_field.id | html %]" />
99                                     <input type="hidden" name="club_field_id" value="[% f.id | html %]" />
100
101                                     <label for="club_field_[% f.club_template_field_id | html %]">[% f.club_template_field.name | html %]</label>
102                                     [% IF f.club_template_field.authorised_value_category %]
103                                         <select name="club_field" id="club_field_[% f.club_template_field_id | html %]">
104                                             [% FOREACH a IN AuthorisedValues.Get( f.club_template_field.authorised_value_category ) %]
105                                                 [% IF a.authorised_value == f.value %]
106                                                     <option value="[% a.authorised_value | html %]" selected="selected">[% a.lib | html %]</option>
107                                                 [% ELSE %]
108                                                     <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
109                                                 [% END %]
110                                             [% END %]
111                                         </select>
112                                     [% ELSE %]
113                                         <input type="text" name="club_field" id="club_field_[% f.club_template_field_id | html %]" value="[% f.value | html %]" size="40" />
114                                     [% END %]
115                                 </li>
116                             [% END %]
117                         [% ELSE %]
118                             [% FOREACH f IN club_template.club_template_fields %]
119                                 <li>
120                                     <input type="hidden" name="club_template_field_id" value="[% f.id | html %]" />
121
122                                     <label for="club_template_field_[% f.id | html %]">[% f.name | html %]</label>
123                                     [% IF f.authorised_value_category %]
124                                         <select name="club_field" id="club_template_field_[% f.id | html %]">
125                                             [% FOREACH a IN AuthorisedValues.Get( f.authorised_value_category ) %]
126                                                 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
127                                             [% END %]
128                                         </select>
129                                     [% ELSE %]
130                                         <input type="text" name="club_field" id="club_template_field_[% f.id | html %]" size="40" />
131                                     [% END %]
132                                 </li>
133                             [% END %]
134                         [% END %]
135
136                     </ol>
137
138                 </fieldset>
139
140                 <fieldset class="action">
141                     <input type="submit" class="btn btn-primary" value="Save" />
142                     <a href="clubs.pl" class="cancel">Cancel</a>
143                 </fieldset>
144             </form>
145         </div>
146     </div>
147
148 [% MACRO jsinclude BLOCK %]
149     [% INCLUDE 'calendar.inc' %]
150 [% END %]
151
152 [% INCLUDE 'intranet-bottom.inc' %]