3eee6f3091
When editing an item in a Course Reserve, the page displayed is the same that is displayed when adding an item to a Course Reserve. This patch removes the warning 'This course already has this item on reserve' when the item is being edited, as well as changes the title, breadcrumbs, and header of the div. This patch also Changes the header of the div to say 'Edit 'book_name' in 'course_name'' instead of 'Add 'book_name' to 'course_name'' when adding items to a course reserve if the item is already present. To test: 1) Create a new course in Course Reserves (you will need Course Reserves enabled in syspref) 2) Add an item by clicking the Add reserves button 3) Click the edit button on the right hand side of the item listing under the Reserves heading 4) Observe that the warning 'The course already has this item on reserve' appears, and that the title, breadcrumbs and header of the div all say Add/Reserve 5) Apply the patch 6) Repeat step 3 and observe that the title, breadcrumbs and header of the div now say Edit 7) Also verify that when adding a reserve with a barcode that does not yet exist in the course reserves that the warning 'The course already...' is not displayed and that the header of the div says Add 8) Finally verify that when adding a reserve with a barcode that DOES exist in the course reserves that the warning 'The course already...' IS displayed and the header of the div says Edit 9) Sign off! Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
122 lines
6.8 KiB
Text
122 lines
6.8 KiB
Text
[% USE Branches %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Course reserves ›[% IF is_edit %] Edit item[% ELSE %]Add items[% END %]</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
</head>
|
|
|
|
<body id="courses_add_items_step2" class="course">
|
|
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'cat-search.inc' %]
|
|
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a> ›[% IF is_edit %] Edit [% ELSE %] Reserve [% END %]<i><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | html %]">[% biblio.title | html %]</a></i> for <i><a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id | html %]">[% course.course_name | html %]</a></i></div>
|
|
|
|
<div class="main container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-8 col-md-offset-2">
|
|
|
|
[% IF course_reserve && !is_edit%]<div class="dialog message" id="already_on_reserve_this">This course already has this item on reserve.</div>[% END %]
|
|
[% IF course_item %]<div class="dialog message" id="already_on_reserve">Number of courses reserving this item: [% course_item.course_reserves.size | html %]</div>[% END %]
|
|
|
|
<form method="post" action="/cgi-bin/koha/course_reserves/add_items.pl">
|
|
<input type="hidden" name="course_id" value="[% course.course_id | html %]" />
|
|
<input type="hidden" name="return" value="[% return | html %]" />
|
|
<input type="hidden" name="action" value="add" />
|
|
|
|
<fieldset class="rows">
|
|
[% IF is_edit || course_reserve %]
|
|
<legend>Edit <i>[% biblio.title | html %]</i> in <i>[% course.course_name | html %]</i></legend>
|
|
[% ELSE %]
|
|
<legend>Add <i>[% biblio.title | html %]</i> to <i>[% course.course_name | html %]</i></legend>
|
|
[% END %]
|
|
<ol>
|
|
<li>
|
|
<span class="label">Barcode:</span>
|
|
<span id="barcode">[% item.barcode | html %]</span>
|
|
<input type="hidden" name="itemnumber" value="[% item.itemnumber | html %]" />
|
|
</li>
|
|
|
|
[% IF item_level_itypes %]
|
|
<li>
|
|
<label class="required" for="itype">Item type:</label>
|
|
<select id="itype" name="itype">
|
|
<option value="">LEAVE UNCHANGED</option>
|
|
|
|
[% FOREACH it IN itypes %]
|
|
[% IF course_item.itype.defined && ( ( course.enabled == 'yes' && it.itemtype == item.itype ) || ( course.enabled == 'no' && it.itemtype == course_item.itype ) ) %]
|
|
<option value="[% it.itemtype | html %]" selected="selected">[% it.description | html %]</option>
|
|
[% ELSE %]
|
|
<option value="[% it.itemtype | html %]">[% it.description | html %]</option>
|
|
[% END %]
|
|
[% END %]
|
|
</select>
|
|
</li>
|
|
[% END %]
|
|
|
|
<li>
|
|
<label class="required" for="ccode">Collection code:</label>
|
|
<select id="ccode" name="ccode">
|
|
<option value="">LEAVE UNCHANGED</option>
|
|
|
|
[% FOREACH c IN ccodes %]
|
|
[% IF course_item.ccode.defined && ( ( course.enabled == 'yes' && c.authorised_value == item.ccode ) || ( course.enabled == 'no' && c.authorised_value == course_item.ccode ) ) %]
|
|
<option value="[% c.authorised_value | html %]" selected="selected">[% c.lib | html %]</option>
|
|
[% ELSE %]
|
|
<option value="[% c.authorised_value | html %]">[% c.lib | html %]</option>
|
|
[% END %]
|
|
[% END %]
|
|
</select>
|
|
</li>
|
|
|
|
<li>
|
|
<label class="required" for="location">Shelving location:</label>
|
|
<select id="location" name="location">
|
|
<option value="">LEAVE UNCHANGED</option>
|
|
|
|
[% FOREACH s IN locations %]
|
|
[% IF course_item.location.defined && ( ( course.enabled == 'yes' && s.authorised_value == item.location ) || ( course.enabled == 'no' && s.authorised_value == course_item.location ) ) %]
|
|
<option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
|
|
[% ELSE %]
|
|
<option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
|
|
[% END %]
|
|
[% END %]
|
|
</select>
|
|
</li>
|
|
|
|
<li>
|
|
<label class="required" for="holdingbranch">Holding library:</label>
|
|
<select id="holdingbranch" name="holdingbranch">
|
|
<option value="">LEAVE UNCHANGED</option>
|
|
[% FOREACH b IN Branches.all() %]
|
|
[% IF course_item.holdingbranch.defined && ( ( course.enabled == 'yes' && b.value == item.holdingbranch ) || ( course.enabled == 'no' && b.value == course_item.holdingbranch ) ) %]
|
|
<option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
|
|
[% ELSE %]
|
|
<option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
|
|
[% END %]
|
|
[% END %]
|
|
</select>
|
|
</li>
|
|
|
|
<li>
|
|
<label for="staff_note">Staff note:</label>
|
|
<textarea name="staff_note" id="staff_note">[% course_reserve.staff_note | html %]</textarea>
|
|
</li>
|
|
|
|
<li>
|
|
<label for="public_note">Public note:</label>
|
|
<textarea name="public_note" id="public_note">[% course_reserve.public_note | html %]</textarea>
|
|
</li>
|
|
|
|
</ol>
|
|
</fieldset>
|
|
|
|
<fieldset class="action">
|
|
<input type="submit" id="submit" value="Save" class="submit focus" />
|
|
|
|
<a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id | uri %]" class="cancel">Cancel</a>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|