Koha/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt
Jonathan Druart 45a35f1ecc Bug 17855: Simplify the onboarding tool
This patch should not modify a lot the behaviours of the onboarding
tool.
Its goal is mainly to remove duplicated as well as useless (because
copy/pasted from existing script files) code.

It assumes that the onboarding tool will be done on an empty database
and will skip steps that are not needed. For instance if a library
already exists, the first step will be skipped.

One of the main problem was the lack of feedback messages sent to the
user when something wrong/ok happened.

Explanation on main changes:
1. Use checkauth first, then get_template_and_user
=> As we do not know the template to use, it's better to use checkauth
first to know if the user is logged in, then retrieve the template we
need, depending on the success or the failure of the action
2. Create a @messages variables
Pushing messages to this variable and handling the messages via an
include files (onboarding_messages.inc) simplify error handling. Note
that we could remove this include file if we merge all the
onboardingstepX.tt files altogether
3. Simplify creation of the admnistrator user
This patch removes some unecessary checks done on the user's info
(passwd to short, mandatory fields

Todo (minor): Add style to feedback messages

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-04-28 08:36:20 -04:00

114 lines
5.6 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Create Circulation rule</title>
[% INCLUDE 'installer-doc-head-close.inc' %]
<div>
<h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1>
</div>
[% INCLUDE 'onboarding_messages.inc' %]
[% IF all_done %]
<h1>Congratulations you have finished and ready to use Koha</h1>
<a href="/cgi-bin/koha/mainpage.pl">Start using Koha</a>
[% ELSE %]
<h1 align="left"> Create a new circulation rule </h1>
<form name="createcirculationrule" method="post" action="onboarding.pl">
<fieldset class="rows">
<input type="hidden" name="step" value="5"/>
<input type="hidden" name="op" value="add_validate_circ_rule" />
<ol>
<li>
<label for="branch" class="required"> Library branch</label>
<select name="branch" id="branchname" required="required">
<option value""> Choose</option>
<option value="*" selected="selected">All</option>
[% FOREACH library IN libraries %]
<option id="branch" value="[% library.branchcode %]"> [% library.branchname %]</option>
[% END %]
</select>
<span class="required">Required</span>
</li>
<li>
<label for="categorycode" class="required">Patron category: </label>
<select name="categorycode" id="categorycodeselection" required="required" onchange = "update_categorycode(this);">
<option value=""> Choose</option>
<option value="*" selected="selected">All</option>
[% FOREACH category IN categories %]
<option id="categorycode" value = "[% category.categorycode %]"> [%category.description %]</option>
[%END%]
</select>
<span class="required">Required</span>
</li>
<li>
<label for="itemtype"> Item type: </label>
<select id="itemtype" name="itemtype" required="required">
<option value""> Choose </option>
<option value="*" selected="selected">All</option>
[% FOREACH item IN itemtypes %]
<option name="itemtype" value = "[% item.itemtype %]"> [% item.itemtype %]
[%END%]
</select>
<span class="required"> Required</span>
</li>
<li>
<label for="maxissueqty" class="required">Current checkouts allowed: </label>
<input type="number" min="0" name="maxissueqty" title="Please only enter numbers" id="maxissueqty" size="10" value="50" class="required" required="required" />
<span class="required">Required</span>
</li>
<li>
<label for="issuelength" class="required">Loan period: </label>
<input type="number" min="0" name="issuelength" title="Please only enter numbers" id="issuelength" size="10" value="14" class="required" required="required" />
<span class="required">Required</span>
</li>
<li>
<label for="lengthunit">Units: </label>
<select name="lengthunit" id="lengthunit" required="required">
<option value=""> Choose </option>
[% SET units = 'days' %]
[% IF category %]
[% SET default_privacy = category.default_privacy %]
[% END %]
[% SWITCH units %]
[% CASE 'days' %]
<option value="days" selected="selected">Days</option>
<option value="hours">Hours</option>
[% CASE 'hours' %]
<option value="days">Days</option>
<option value="hours" selected="selected">Hours</option>
[% END %]
</select>
</li>
<li>
<label for="renewalsallowed" class="required">Renewals allowed: </label>
<input type="number" min="0" name="renewalsallowed" title="Please only enter numbers" id="renewalsallowed" size="10" max="10" value="10" class="required" required="required" />
<span class="required">Required</span>
</li>
<li>
<label for="renewalperiod" class="required">Renewals period: </label>
<input type="number" min="0" name="renewalperiod" title="Please only enter numbers" id="renewalperiod" size="10" value="14" class="required" required="required" />
<span class="required">Required</span>
</li>
<li>
<label for="onshelfholds">On shelf holds allowed: </label>
<select name="onshelfholds" id="onshelfholds" required="required">
<option value="">Choose</option>
<option value="1" selected="selected">Yes</option>
<option value="0">If any unavailable</option>
<option value="2">If all unavailable</option>
</select>
</li>
</ol>
<p> To create circulation rule, go to <br>
More -> Administration -> Circulation and Fine Rules
</p>
</fieldset><br>
<input type="submit" class="action" value="Submit"/>
</form>
[% END %]