Koha/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt
Kyle M Hall a503474346 Bug 8836 [QA Followup] - Prevent multiple collections from having the same title
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

This works, and so I'll sign off, but I'm not crazy about the workflow.
Having the error message display on an otherwise empty page is not user
friendly. The entry form should be redisplayed so that the user can
modify the data they submitted.

That really should be changed in a follow-up.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2014-11-06 15:12:20 -03:00

137 lines
6.2 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; Rotating collections &rsaquo;
[%- IF ( action == "new" ) %]
Add a new collection
[% ELSE %]
Edit collection [% editColTitle %]
[% END -%]
</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="rcoll_editCollections" class="tools rcoll">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<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;
[%- IF ( action == "new" ) %]
Add a new collection
[% ELSE %]
<a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% editColId %]">Collection <i>[% editColTitle %]</i></a> &rsaquo; Edit
[% END -%]
</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% IF ( previousActionCreate ) %]
[% IF ( createSuccess ) %]
<div class="dialog message">
<p>Collection <i>[% createdTitle %]</i> added successfully</p>
<p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
</div>
[% ELSE %]
<div class="dialog alert">
<p>Collection <i>[% createdTitle %]</i> failed to be added</p>
<p>
[% IF failureMessage == "NO_TITLE" %]
No title entered.
[% ELSIF failureMessage == "DUPLICATE_TITLE" %]
Title already in use.
[% ELSIF failureMessage == "NO_DESCRIPTION" %]
No description entered.
[% ELSE %]
[% failureMessage %]
[% END %]
</p>
</div>
[% END %]
[% END %]
[% IF ( previousActionDelete ) %]
[% IF ( deleteSuccess ) %]
<div class="dialog message">
<p>Collection deleted successfully</p>
<p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
</div>
[% ELSE %]
<div class="dialog alert">Collection failed to be deleted</div>
[% END %]
[% END %]
[% IF ( previousActionUpdate ) %]
[% IF ( updateSuccess ) %]
<div class="dialog message">
<p>Collection <i>[% updatedTitle %]</i> updated successfully</p>
<p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
</div>
[% ELSE %]
<div class="dialog alert">
<p>Collection <i>[% updatedTitle %]</i> failed to be updated</p>
<p>
[% IF failureMessage == "NO_ID" %]
No collection id given.
[% ELSIF failureMessage == "DUPLICATE_TITLE" %]
Title already in use.
[% ELSE %]
[% failureMessage %]
[% END %]
</p>
</div>
[% END %]
[% END %]
<div>
[% IF action == "new" || action == "edit" %]
[% IF ( previousActionEdit ) %]
<h1>Edit collection <i>[% editColTitle %]</i></h1>
[% ELSE %]
<h1>Add new collection</h1>
[% END %]
<form action="editCollections.pl" method="post" class="validated">
[% IF ( previousActionEdit ) %]
<input type="hidden" name="action" value="update" />
<input type="hidden" name="colId" value="[% editColId %]" />
[% ELSE %]
<input type="hidden" name="action" value="create" />
[% END %]
<fieldset class="rows">
<ol>
<li>
<label class="required" for="title">Title: </label>
[% IF ( editColTitle ) %]
<input type="text" name="title" value="[% editColTitle %]" required="required" />
<span class="required">Required</span>
[% ELSE %]
<input type="text" name="title" required="required" />
<span class="required">Required</span>
[% END %]
</li>
<li>
<label for="description">Description: </label>
[% IF (editColDescription ) %]
<input type="text" size="50" name="description" value="[% editColDescription %]" />
[% ELSE %]
<input type="text" size="50" name="description" />
[% END %]
</li>
</ol>
</fieldset>
<fieldset class="action">
<p><input type="submit" value="Submit" /> <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl" class="cancel">Cancel</a></p>
</fieldset>
</form>
[% END %]
</div>
</div> <!-- /.yui-b -->
</div> <!-- /#yui-main -->
<div class="yui-b">
[% INCLUDE 'tools-menu.inc' %]
</div>
</div> <!-- /#bd -->
[% INCLUDE 'intranet-bottom.inc' %]