View | Details | Raw Unified | Return to bug 17855
Collapse All | Expand All

(-)a/installer/onboarding.pl (-24 / +88 lines)
Lines 6-11 use diagnostics; Link Here
6
6
7
7
8
use Modern::Perl;
8
use Modern::Perl;
9
 use C4::InstallAuth;
9
10
10
#External modules
11
#External modules
11
use CGI qw ( -utf8 );
12
use CGI qw ( -utf8 );
Lines 53-59 my $query = new CGI; Link Here
53
my $step     = $query->param('step');
54
my $step     = $query->param('step');
54
55
55
#Getting the appropriate template to display to the user-->
56
#Getting the appropriate template to display to the user-->
56
my ( $template, $loggedinuser, $cookie) = get_template_and_user(
57
my ( $template, $loggedinuser, $cookie) = C4::InstallAuth::get_template_and_user(
57
     {
58
     {
58
        template_name => "/onboarding/onboardingstep" . ( $step ? $step : 0 ) . ".tt",
59
        template_name => "/onboarding/onboardingstep" . ( $step ? $step : 0 ) . ".tt",
59
        query         => $query,
60
        query         => $query,
Lines 180-186 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
180
    my $message;
181
    my $message;
181
    my $category;
182
    my $category;
182
183
183
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
184
    my ( $template, $loggedinuser, $cookie ) =  C4::InstallAuth::get_template_and_user(
184
    {
185
    {
185
        template_name   => "/onboarding/onboardingstep2.tt",
186
        template_name   => "/onboarding/onboardingstep2.tt",
186
        query           => $input,
187
        query           => $input,
Lines 193-199 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
193
194
194
    #Once the user submits the page, this code validates the input and adds it
195
    #Once the user submits the page, this code validates the input and adds it
195
    #to the database as a new patron category 
196
    #to the database as a new patron category 
196
197
    my $categorycode = $input->param('categorycode');
197
    my $categorycode = $input->param('categorycode');
198
    my $description = $input->param('description');
198
    my $description = $input->param('description');
199
    my $overduenoticerequired = $input->param('overduenoticerequired');
199
    my $overduenoticerequired = $input->param('overduenoticerequired');
Lines 238-244 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
238
238
239
#Create a patron
239
#Create a patron
240
}elsif ( $step && $step == 3 ){
240
}elsif ( $step && $step == 3 ){
241
242
    my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, );
241
    my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, );
243
    $template->param(libraries   => $libraries,
242
    $template->param(libraries   => $libraries,
244
              group_types => [
243
              group_types => [
Lines 257-271 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
257
            categories => $categories,
256
            categories => $categories,
258
    );
257
    );
259
258
260
261
    my $input = new CGI;
259
    my $input = new CGI;
262
    my $op = $input->param('op') // 'list';
260
    my $op = $input->param('op') // 'list';
263
261
264
    my @messages;
262
    my @messages;
265
    my @errors;
263
    my @errors;
266
    my $nok = $input->param('nok');
267
264
268
    my ($template, $loggedinuser, $cookie)= get_template_and_user({
265
    my ($template, $loggedinuser, $cookie)= C4::InstallAuth::get_template_and_user({
269
                template_name => "/onboarding/onboardingstep3.tt",
266
                template_name => "/onboarding/onboardingstep3.tt",
270
                query => $input,
267
                query => $input,
271
                type => "intranet",
268
                type => "intranet",
Lines 290-314 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
290
         $newdata{dateexpiry} = '12/10/2016';
287
         $newdata{dateexpiry} = '12/10/2016';
291
         $newdata{privacy} = "default";
288
         $newdata{privacy} = "default";
292
289
293
         $newdata{'cardnumber'} = undef if $newdata{'cardnumber'} =~ /^\s*$/;
290
        if(my $error_code = checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){
294
         if(my $error_code = checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){
295
            push @errors, $error_code == 1
291
            push @errors, $error_code == 1
296
                ? 'ERROR_cardnumber_already_exists'
292
                ? 'ERROR_cardnumber_already_exists'
297
                :$error_code == 2
293
                :$error_code == 2 
298
                    ? 'ERROR_cardnumber_length'
294
                    ? 'ERROR_cardnumber_length'
299
                    :()
295
                    :()
300
         }
296
        }
301
297
302
298
303
#Hand the newdata hash to the AddMember subroutine in the C4::Members module and it creates a patron and hands back a borrowernumber which is being stored
299
#Hand the newdata hash to the AddMember subroutine in the C4::Members module and it creates a patron and hands back a borrowernumber which is being stored
304
        my $borrowernumber = &AddMember(%newdata);
300
        my $borrowernumber = &AddMember(%newdata);
305
306
#Create a hash named member2 and fillit with the borrowernumber of the borrower that has just been created 
301
#Create a hash named member2 and fillit with the borrowernumber of the borrower that has just been created 
307
        my %member2;
302
        my %member2;
308
        $member2{'borrowernumber'}=$borrowernumber;
303
        $member2{'borrowernumber'}=$borrowernumber;
309
304
310
        my $flag = $input->param('flag');
305
        my $flag = $input->param('flag');
311
312
        if ($input->param('newflags')) {
306
        if ($input->param('newflags')) {
313
             my $dbh=C4::Context->dbh();
307
             my $dbh=C4::Context->dbh();
314
             my @perms = $input->multi_param('flag');
308
             my @perms = $input->multi_param('flag');
Lines 354-360 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
354
    my $op = $input->param('op') // 'list';
348
    my $op = $input->param('op') // 'list';
355
    my $message;
349
    my $message;
356
350
357
    my( $template, $borrowernumber, $cookie) = get_template_and_user(
351
    my( $template, $borrowernumber, $cookie) = C4::InstallAuth::get_template_and_user(
358
            {   template_name   => "/onboarding/onboardingstep4.tt",
352
            {   template_name   => "/onboarding/onboardingstep4.tt",
359
                query           => $input,
353
                query           => $input,
360
                type            => "intranet",
354
                type            => "intranet",
Lines 372-385 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
372
        my $description = $input->param('description');
366
        my $description = $input->param('description');
373
367
374
        #store the input from the form - only 2 fields 
368
        #store the input from the form - only 2 fields 
375
        $itemtype= Koha::ItemType->new(
369
        my $thisitemtype= Koha::ItemType->new(
376
            { itemtype    => $itemtype_code,
370
            { itemtype    => $itemtype_code,
377
              description => $description,
371
              description => $description,
378
            }
372
            }
379
        );
373
        );
380
        eval{ $itemtype->store; };
374
        eval{ $thisitemtype->store; };
381
        #Error messages
375
        #Error messages
382
        if($itemtype){
376
        if($thisitemtype){
383
            $message = 'success_on_insert';
377
            $message = 'success_on_insert';
384
        }else{
378
        }else{
385
            $message = 'error_on_insert';
379
            $message = 'error_on_insert';
Lines 387-397 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
387
381
388
        $template->param('message' => $message); 
382
        $template->param('message' => $message); 
389
    }
383
    }
390
391
392
393
394
}elsif ( $step && $step == 5){
384
}elsif ( $step && $step == 5){
385
395
    #Fetching all the existing categories to display in a drop down box
386
    #Fetching all the existing categories to display in a drop down box
396
    my $categories;
387
    my $categories;
397
    $categories= Koha::Patron::Categories->search();
388
    $categories= Koha::Patron::Categories->search();
Lines 420-427 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
420
    my $input = CGI->new;
411
    my $input = CGI->new;
421
    my $dbh = C4::Context->dbh;
412
    my $dbh = C4::Context->dbh;
422
413
423
    my ($template, $loggedinuser, $cookie)
414
    my ($template, $loggedinuser, $cookie) = C4::InstallAuth::get_template_and_user({template_name => "/onboarding/onboardingstep5.tt",
424
        = get_template_and_user({template_name => "/onboarding/onboardingstep5.tt",
425
                     query => $input,
415
                     query => $input,
426
                     type => "intranet",
416
                     type => "intranet",
427
                     authnotrequired => 0,
417
                     authnotrequired => 0,
Lines 442-448 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
442
    my $op = $input->param('op') || q{};
432
    my $op = $input->param('op') || q{};
443
433
444
    if($op eq 'add_validate'){
434
    if($op eq 'add_validate'){
445
446
        my $type = $input->param('type');
435
        my $type = $input->param('type');
447
        my $br = $branch;
436
        my $br = $branch;
448
        my $bor = $input->param('categorycode');
437
        my $bor = $input->param('categorycode');
Lines 468-473 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
468
            lengthunit      => $lengthunit,
457
            lengthunit      => $lengthunit,
469
            onshelfholds    => $onshelfholds,
458
            onshelfholds    => $onshelfholds,
470
        };
459
        };
460
        my @messages;
461
462
#New code from smart-rules.tt starts here. Needs to be added to library
463
#Allows for the 'All' option to work when selecting all libraries for a circulation rule to apply to. 
464
 if ($branch eq "*") {
465
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
466
                                        FROM default_circ_rules");
467
        my $sth_insert = $dbh->prepare("INSERT INTO default_circ_rules
468
                                        (maxissueqty, onshelfholds)
469
                                        VALUES (?, ?)");
470
        my $sth_update = $dbh->prepare("UPDATE default_circ_rules
471
                                        SET maxissueqty = ?, onshelfholds = ?");
472
473
        $sth_search->execute();
474
        my $res = $sth_search->fetchrow_hashref();
475
        if ($res->{total}) {
476
            $sth_update->execute($maxissueqty, $onshelfholds);
477
        } else {
478
            $sth_insert->execute($maxissueqty, $onshelfholds);
479
        }
480
    }
481
482
483
#Allows for the 'All' option to work when selecting all patron categories for a circulation rule to apply to. 
484
        if ($bor eq "*") {
485
            my $sth_search = $dbh->prepare("SELECT count(*) AS total
486
                                            FROM default_circ_rules");
487
            my $sth_insert = $dbh->prepare(q|
488
                INSERT INTO default_circ_rules
489
                    (maxissueqty)
490
                    VALUES (?)
491
            |);
492
            my $sth_update = $dbh->prepare(q|
493
                UPDATE default_circ_rules
494
                SET maxissueqty = ?
495
            |);
496
497
            $sth_search->execute();
498
            my $res = $sth_search->fetchrow_hashref();
499
            if ($res->{total}) {
500
                $sth_update->execute($maxissueqty);
501
            } else {
502
                $sth_insert->execute($maxissueqty);
503
            }
504
        }
505
#Allows for the 'All' option to work when selecting all itemtypes for a circulation rule to apply to
506
        if ($itemtype eq "*") {
507
            my $sth_search = $dbh->prepare("SELECT count(*) AS total
508
                                        FROM default_branch_circ_rules
509
                                        WHERE branchcode = ?");
510
            my $sth_insert = $dbh->prepare("INSERT INTO default_branch_circ_rules
511
                                        (branchcode, onshelfholds)
512
                                        VALUES (?, ?)");
513
            my $sth_update = $dbh->prepare("UPDATE default_branch_circ_rules
514
                                        SET onshelfholds = ?
515
                                        WHERE branchcode = ?");
516
            $sth_search->execute($branch);
517
            my $res = $sth_search->fetchrow_hashref();
518
            if ($res->{total}) {
519
                $sth_update->execute($onshelfholds, $branch);
520
            } else {
521
            $sth_insert->execute($branch, $onshelfholds);
522
            }
523
        }   
524
#End new code
525
526
       my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br });
527
       if($issuingrule){
528
           $issuingrule->set($params)->store();
529
           push @messages, {type=> 'error', code => 'error_on_insert'};#Stops crash of the onboarding tool if someone makes a circulation rule with the same item type, library and patron categroy as an exisiting circulation rule. 
530
531
       }else{
532
           Koha::IssuingRule->new()->set($params)->store(); 
533
       }
534
    }
471
535
472
        my @messages;
536
        my @messages;
473
537
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep0.tt (-1 / +1 lines)
Lines 39-45 Link Here
39
<div>
39
<div>
40
      <h1 align="center"> Welcome to Koha</h1>
40
      <h1 align="center"> Welcome to Koha</h1>
41
      <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;"  src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1>
41
      <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;"  src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1>
42
      <h2 align="center"> We're just going to set up a few things......</h2>
42
      <h2 align="center"> You haven't installed some sample data, so we're just going to set up a few more things...</h2>
43
      <form name="startkoha" method="post" action="onboarding.pl">
43
      <form name="startkoha" method="post" action="onboarding.pl">
44
         <input type="hidden" name="step" value="1"/>
44
         <input type="hidden" name="step" value="1"/>
45
         <input type="submit" name="start" value="Start setting up my Koha"/>
45
         <input type="submit" name="start" value="Start setting up my Koha"/>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt (-1 / +1 lines)
Lines 92-98 Link Here
92
                    </li>
92
                    </li>
93
                    <li>
93
                    <li>
94
                        <label for="branchname" class="required">Name: </label>
94
                        <label for="branchname" class="required">Name: </label>
95
                        <input type="text" style="text-transform:capitalize;" name="branchname" id="branchname" size="80" value="[% library.branchname |html %]" class="    required" required="required" style="width:200px;">
95
                        <input type="text" style="text-transform:capitalize;" name="branchname" id="branchname" size="42" value="[% library.branchname |html %]" class="    required" required="required" style="width:200px;">
96
                        <span class="required">Required</span>
96
                        <span class="required">Required</span>
97
                    </li>
97
                    </li>
98
                 </ol>
98
                 </ol>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt (-3 / +7 lines)
Lines 49-55 Link Here
49
            <fieldset class="rows">
49
            <fieldset class="rows">
50
                 <input type="hidden" name="step" value="3"/>
50
                 <input type="hidden" name="step" value="3"/>
51
                 <input type="hidden" name="op" value="add_validate" />
51
                 <input type="hidden" name="op" value="add_validate" />
52
                    <ol>
52
                     <legend id="library_management_lgd">Library Management</legend>
53
                     <p>
54
                        Now we will create a patron with superlibrarian permissions. Login with this to access Koha as a staff member will all permissions. 
55
                     </p>
56
                     <ol>
53
                    <h3>Patron Identity</h3> 
57
                    <h3>Patron Identity</h3> 
54
                        <li>
58
                        <li>
55
                            <label for="surname" class="required">Surname: </label>
59
                            <label for="surname" class="required">Surname: </label>
Lines 64-74 Link Here
64
                        </li>
68
                        </li>
65
                    </ol>
69
                    </ol>
66
                    
70
                    
67
                    <legend id="library_management_lgd">Library Management</legend>
71
    
68
                    <ol>
72
                    <ol>
69
                        <li>
73
                        <li>
70
                            <label for="cardnumber" class="required">Card Number: </label>
74
                            <label for="cardnumber" class="required">Card Number: </label>
71
                            <input type="number" min="1" id="cardnumber" name="cardnumber" maxlength="[%maxlength_cardnumber%]" minlength="[%minlength_cardnumber%]" value="[% cardnumber | html %]" class="required" required="required">
75
                            <input type="number" min="1" id="cardnumber" class="noEnterSubmit valid" name="cardnumber" maxlength="[%maxlength_cardnumber%]" minlength="[%minlength_cardnumber%]" value="[% cardnumber | html %]" class="required" required="required">
72
                            <span class="required">Required</span>
76
                            <span class="required">Required</span>
73
                        </li>
77
                        </li>
74
                        <li>
78
                        <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt (-2 lines)
Lines 20-27 Link Here
20
20
21
[% IF itemtypes.count > 0 %]
21
[% IF itemtypes.count > 0 %]
22
    <br>
22
    <br>
23
    h no! Patron was not created</p>
24
25
        <h3 align="left">You do not need to create a item type as you have already installed the sample item type data previously</h3>
23
        <h3 align="left">You do not need to create a item type as you have already installed the sample item type data previously</h3>
26
     <form name="skipitemtype" method="post" action="onboarding.pl">
24
     <form name="skipitemtype" method="post" action="onboarding.pl">
27
          <input type="hidden" name="step" value="5"/>
25
          <input type="hidden" name="step" value="5"/>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt (-82 / +61 lines)
Lines 1-18 Link Here
1
<!--Includes for creating circulation rule--> 
2
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
3
2
<title>Create Circulation rule</title>
4
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %]
3
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %]
5
[% INCLUDE 'installer-doc-head-close.inc' %]
4
[% INCLUDE 'installer-doc-head-close.inc' %]
6
5
7
<head>
8
<title>Create Circulation rule</title>
9
10
<!--jQuery scripts for creating circulation rule-->
11
12
13
14
</head>
6
</head>
15
16
<div>
7
<div>
17
    <h1 align="center"> Welcome to Koha</h1>
8
    <h1 align="center"> Welcome to Koha</h1>
18
    <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;"  src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1>
9
    <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;"  src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1>
Lines 28-37 Link Here
28
[% IF op == "add_validate" %]
19
[% IF op == "add_validate" %]
29
        <!--New circulation rule created-->
20
        <!--New circulation rule created-->
30
        <form name="finish" method="post" action="onboarding.pl">
21
        <form name="finish" method="post" action="onboarding.pl">
31
              <input type="hidden" name="op" value="finish" />
22
            <input type="hidden" name="op" value="finish" />
32
33
            <h1 align="left"> New Circulation rule </h1>
23
            <h1 align="left"> New Circulation rule </h1>
34
35
            <div>   
24
            <div>   
36
                 <p> Success: New circulation rule created!</p>
25
                 <p> Success: New circulation rule created!</p>
37
                 <p> To create circulation rule, go to <br>
26
                 <p> To create circulation rule, go to <br>
Lines 40-54 Link Here
40
                 Next up:
29
                 Next up:
41
                 <input type="submit" name="op" value="Finish"/>
30
                 <input type="submit" name="op" value="Finish"/>
42
        </form>
31
        </form>
43
           <!-- <div>
32
[% ELSE %]
44
                  <p> Oh no! Circulation Rule was not created</p>
45
            </div> -->
46
47
48
[% ELSE %]    
49
<!--Create a circulation rule screen 1-->
33
<!--Create a circulation rule screen 1-->
50
       <h1 align="left"> Create a new Circulation rule </h1>
34
       <h1 align="left"> Create a new Circulation rule </h1>
51
  
52
       <form name="createcirculationrule" method="post" action="onboarding.pl">
35
       <form name="createcirculationrule" method="post" action="onboarding.pl">
53
            <fieldset class="rows">
36
            <fieldset class="rows">
54
                 <input type="hidden" name="step" value="5"/>
37
                 <input type="hidden" name="step" value="5"/>
Lines 57-63 Link Here
57
                    <li>
40
                    <li>
58
                        <label for="branch" class="required"> Library branch</label>
41
                        <label for="branch" class="required"> Library branch</label>
59
                        <select name="branch" id="branch" required="required">
42
                        <select name="branch" id="branch" required="required">
60
43
                        <option value="*">All</option> 
61
                        [% FOREACH library IN libraries %]
44
                        [% FOREACH library IN libraries %]
62
                            <option name="branch" value="[% library.branchcode %]"> [% library.branchname %]</option>
45
                            <option name="branch" value="[% library.branchcode %]"> [% library.branchname %]</option>
63
                        [% END %]
46
                        [% END %]
Lines 65-73 Link Here
65
                        <span class="required">Required</span>
48
                        <span class="required">Required</span>
66
                    </li>
49
                    </li>
67
                    <li>
50
                    <li>
68
                             <label for="categorycode" class="required">Patron Category: </label>
51
                        <label for="categorycode" class="required">Patron Category: </label>
69
                             <select name="categorycode" id="categorycode" required="required" onchange = "update_categorycode(this);">
52
                        <select name="categorycode" id="categorycode" required="required" onchange = "update_categorycode(this);">
70
                               <!-- <option name="categorycode" value="All">All-->
53
                               <option value="*">All</option> 
71
                             [% FOREACH category IN categories %]
54
                             [% FOREACH category IN categories %]
72
                                <option name="categorycode" value = "[% category.categorycode %]"> [%category.description %]</option> 
55
                                <option name="categorycode" value = "[% category.categorycode %]"> [%category.description %]</option> 
73
                            [%END%]
56
                            [%END%]
Lines 78-147 Link Here
78
                    <li>
61
                    <li>
79
                        <label for="itemtype"> Item type: </label>
62
                        <label for="itemtype"> Item type: </label>
80
                        <select id="itemtype" name="itemtype" required="required">
63
                        <select id="itemtype" name="itemtype" required="required">
64
                            <option value="*">All</option> 
81
                            [% FOREACH item IN itemtypes %]
65
                            [% FOREACH item IN itemtypes %]
82
                                <option name="itemtype" value = "[% item.itemtype %]"> [% item.itemtype %]
66
                                <option name="itemtype" value = "[% item.itemtype %]"> [% item.itemtype %]
83
                            [%END%]
67
                            [%END%]
68
                        </select>
69
                        <span class="required"> Required</span>
70
                    </li>
71
                    <li>
72
                        <label for="maxissueqty" class="required">Current checkouts allowed: </label>
73
                        <input type="number" min="0" name="maxissueqty" id="maxissueqty" size="10" maxlength="10" value="" class="required" required="required" />
74
                        <span class="required">Required</span>
75
                    </li>
76
77
                    <li>
78
                        <label for="issuelength" class="required">Loan Period: </label>
79
                        <input type="number" min="0" name="issuelength" id="issuelength" size="10" maxlength="10" value="" class="required" required="required" />
80
                        <span class="required">Required</span>
81
                   </li>
82
                   <li>
83
                        <label for="lengthunit">Units: </label>
84
                        <select name="lengthunit" id="lengthunit" required="required">
85
                        [% SET units = 'days' %]
86
                        [% IF category %] <!--Check  if category is the correct value name in the context of units of days that a loan period is for in the item borrowing script-->
87
                            [% SET default_privacy = category.default_privacy %]
88
                        [% END %]
89
90
                        [% SWITCH units %]
91
                             [% CASE 'days' %]
92
                                   <option value="days" selected="selected">Days</option>
93
                                   <option value="hours">Hours</option>
94
                             [% CASE 'hours' %]
95
                                   <option value="days">Days</option>
96
                                   <option value="hours" selected="selected">Hours</option>
97
                             [% END %]
84
                            </select>
98
                            </select>
85
                            <span class="required"> Required</span>
99
                     </li>
86
                        </li>
100
                     <li>
87
101
                        <label for="renewalsallowed" class="required">Renewals Allowed: </label>
88
                        <li>
102
                        <input type="number"min="0" name="renewalsallowed" id="renewalsallowed" size="10" maxlength="10" value="" class="required" required="required" />
89
                            <label for="maxissueqty" class="required">Current checkouts allowed: </label>
103
                        <span class="required">Required</span>
90
                            <input type="number" min="0" name="maxissueqty" id="maxissueqty" size="10" maxlength="10" value="" class="required" required="required" />
104
                     </li>
91
                            <span class="required">Required</span>
105
92
                        </li>
106
                     <li>
93
                        
107
                        <label for="renewalperiod" class="required">Renewals Period: </label>
94
                        <li>
108
                        <input type="number" min="0"name="renewalperiod" id="renewalperiod" size="10" maxlength="10" value="" class="required" required="required" />
95
                             <label for="issuelength" class="required">Loan Period: </label>
109
                        <span class="required">Required</span>
96
                             <input type="number" min="0" name="issuelength" id="issuelength" size="10" maxlength="10" value="" class="required" required="required" />
110
                     </li>
97
                              <span class="required">Required</span>
111
98
                        </li>
112
                     <li>
99
113
                        <label for="onshelfholds">On shelf holds allowed: </label>
100
                        <li>
114
                        <select name="onshelfholds" id="onshelfholds" required="required">
101
                            <label for="lengthunit">Units: </label>
115
                              <option value="yes" selected="selected">Yes</option>
102
                            <select name="lengthunit" id="lengthunit" required="required">
116
                              <option value="anyunavailable">If any unavailable</option>
103
                                   [% SET units = 'days' %]
117
                              <option value="allunavailable">If all unavailable</option>
104
118
                        </select>
105
                                   [% IF category %] <!--Check  if category is the correct value name in the context of units of days that a loan period is for in the item borrowing script-->
119
                     </li>
106
                                   [% SET default_privacy = category.default_privacy %]
120
                  </ol>
107
                                   [% END %]
108
109
                                   [% SWITCH units %]
110
                                   [% CASE 'days' %]
111
                                     <option value="days" selected="selected">Days</option>
112
                                     <option value="hours">Hours</option>
113
                                   [% CASE 'hours' %]
114
                                     <option value="days">Days</option>
115
                                     <option value="hours" selected="selected">Hours</option>
116
                                   [% END %]
117
                            </select>
118
                        </li>
119
120
                        <li>
121
                             <label for="renewalsallowed" class="required">Renewals Allowed: </label>
122
                             <input type="number"min="0" name="renewalsallowed" id="renewalsallowed" size="10" maxlength="10" value="" class="required" required="required" />
123
                              <span class="required">Required</span>
124
                        </li>
125
126
                         <li>
127
                             <label for="renewalperiod" class="required">Renewals Period: </label>
128
                             <input type="number" min="0"name="renewalperiod" id="renewalperiod" size="10" maxlength="10" value="" class="required" required="required" />
129
                              <span class="required">Required</span>
130
                        </li>
131
132
                         <li>
133
                            <label for="onshelfholds">On shelf holds allowed: </label>
134
                            <select name="onshelfholds" id="onshelfholds" required="required">
135
                                     <option value="yes" selected="selected">Yes</option>
136
                                     <option value="anyunavailable">If any unavailable</option>
137
                                    <option value="allunavailable">If all unavailable</option>
138
                            </select>
139
                        </li>
140
                    </ol>
141
            </fieldset><br>
121
            </fieldset><br>
142
                <input type="submit" class="action" value="Submit"/> 
122
                <input type="submit" class="action" value="Submit"/> 
143
     </form>
123
     </form>
144
[% END %]        
124
[% END %]
145
125
146
126
147
127
148
- 

Return to bug 17855