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