Bug 20538: Remove the need of writing [% KOHA_VERSION %] everywhere
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / rotating_collections / editCollections.tt
1 [% USE Asset %]
2 [% SET footerjs = 1 %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Tools &rsaquo; Rotating collections &rsaquo;
5     [%- IF ( action == "new" ) %]
6         Add a new collection
7     [% ELSE %]
8         Edit collection [% editColTitle %]
9     [% END -%]
10 </title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 </head>
13 <body id="rcoll_editCollections" class="tools rcoll">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'cat-search.inc' %]
16
17 <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="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Rotating collections</a> &rsaquo;
18     [%- IF ( action == "new" ) %]
19         Add a new collection
20     [% ELSE %]
21         <a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% editColId %]">Collection <i>[% editColTitle %]</i></a> &rsaquo; Edit
22     [% END -%]
23 </div>
24
25 <div id="doc3" class="yui-t2">
26     <div id="bd">
27         <div id="yui-main">
28             <div class="yui-b">
29
30               [% IF ( previousActionCreate ) %]
31                 [% IF ( createSuccess ) %]
32                     <div class="dialog message">
33                         <p>Collection <i>[% createdTitle %]</i> added successfully</p>
34                         <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
35                     </div>
36                 [% ELSE %]
37                   <div class="dialog alert">
38                     <p>Collection <i>[% createdTitle %]</i> failed to be added</p>
39                     <p>
40                         [% IF failureMessage == "NO_TITLE" %]
41                             No title entered.
42                         [% ELSIF failureMessage == "DUPLICATE_TITLE" %]
43                             Title already in use.
44                         [% ELSIF failureMessage == "NO_DESCRIPTION" %]
45                             No description entered.
46                         [% ELSE %]
47                             [% failureMessage %]
48                         [% END %]
49                     </p>
50                   </div>
51                 [% END %]
52               [% END %]
53
54               [% IF ( previousActionDelete ) %]
55                 [% IF ( deleteSuccess ) %]
56                   <div class="dialog message">
57                     <p>Collection deleted successfully</p>
58                     <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
59                   </div>
60                 [% ELSE %]
61                   <div class="dialog alert">Collection failed to be deleted</div>
62                 [% END %]
63               [% END %]
64
65               [% IF ( previousActionUpdate ) %]
66                 [% IF ( updateSuccess ) %]
67                   <div class="dialog message">
68                       <p>Collection <i>[% updatedTitle %]</i> updated successfully</p>
69                       <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
70                   </div>
71                 [% ELSE %]
72                   <div class="dialog alert">
73                     <p>Collection <i>[% updatedTitle %]</i> failed to be updated</p>
74                     <p>
75                         [% IF failureMessage == "NO_ID" %]
76                             No collection id given.
77                         [% ELSIF failureMessage == "DUPLICATE_TITLE" %]
78                             Title already in use.
79                         [% ELSE %]
80                             [% failureMessage %]
81                         [% END %]
82                     </p>
83                 </div>
84                 [% END %]
85               [% END %]
86
87               <div>
88
89                 [% IF action == "new" || action == "edit" %]
90                     [% IF ( previousActionEdit ) %]
91                       <h1>Edit collection <i>[% editColTitle %]</i></h1>
92                     [% ELSE %]
93                       <h1>Add new collection</h1>
94                     [% END %]
95
96                     <form action="editCollections.pl" method="post" class="validated">
97                         [% IF ( previousActionEdit ) %]
98                             <input type="hidden" name="action" value="update" />
99                             <input type="hidden" name="colId" value="[% editColId %]" />
100                         [% ELSE %]
101                             <input type="hidden" name="action" value="create" />
102                         [% END %]
103
104                         <fieldset class="rows">
105                             <ol>
106                                 <li>
107                                     <label class="required" for="title">Title: </label>
108                                     [% IF ( editColTitle ) %]
109                                         <input type="text" name="title" value="[% editColTitle %]" required="required" />
110                                         <span class="required">Required</span>
111                                     [% ELSE %]
112                                         <input type="text" name="title" required="required" />
113                                         <span class="required">Required</span>
114                                     [% END %]
115                                 </li>
116                                 <li>
117                                     <label for="description">Description: </label>
118                                     [% IF (editColDescription ) %]
119                                         <input type="text" size="50" name="description" value="[% editColDescription %]" />
120                                     [% ELSE %]
121                                         <input type="text" size="50" name="description" />
122                                     [% END %]
123                                 </li>
124                             </ol>
125                         </fieldset>
126                         <fieldset class="action">
127                             <p><input type="submit" value="Submit" /> <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl" class="cancel">Cancel</a></p>
128                         </fieldset>
129                     </form>
130                 [% END %]
131               </div>
132
133             </div> <!-- /.yui-b -->
134         </div> <!-- /#yui-main -->
135         <div class="yui-b">
136             [% INCLUDE 'tools-menu.inc' %]
137         </div>
138     </div> <!-- /#bd -->
139
140 [% MACRO jsinclude BLOCK %]
141     [% Asset.js("js/tools-menu.js") %]
142     [% Asset.js("js/rotating-collections.js") %]
143 [% END %]
144
145 [% INCLUDE 'intranet-bottom.inc' %]