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

(-)a/installer/onboarding.pl (-88 / +342 lines)
Lines 6-36 use diagnostics; Link Here
6
6
7
7
8
use Modern::Perl;
8
use Modern::Perl;
9
10
#External modules
9
use CGI qw ( -utf8 );
11
use CGI qw ( -utf8 );
12
use List::MoreUtils qw/uniq/;
13
use Digest::MD5 qw(md5_base64);
14
use Encode qw( encode );
15
16
#Internal modules 
10
use C4::Koha;
17
use C4::Koha;
11
use C4::Auth;
18
use C4::Auth;
12
use C4::Context;
19
use C4::Context;
13
use C4::Output;
20
use C4::Output;
21
use C4::Members;
22
use C4::Members::Attributes;
23
use C4::Members::AttributeTypes;
24
use C4::Log;
25
use C4::Letters;
26
use C4::Form::MessagingPreferences; 
27
use Koha::AuthorisedValues;
28
use Koha::Patron::Debarments;
29
use Koha::Cities;
14
use Koha::Patrons;
30
use Koha::Patrons;
15
use Koha::Items;
31
use Koha::Items;
16
use Koha::Libraries;
32
use Koha::Libraries;
17
use Koha::LibraryCategories;
33
use Koha::LibraryCategories;
18
34
use Koha::Database;
19
35
use Koha::DateUtils;
20
#use POSIX;
36
use Koha::Patron::Categories;
21
#use C4::Templates;
37
use Koha::ItemTypes;
22
#use C4::Languages qw(getAllLanguages getTranslatedLanguages);
38
use Koha::Patron::HouseboundRole;
23
#use C4::Installer;
39
use Koha::Patron::HouseboundRoles;
24
#use Koha;
40
use Koha::Token;
41
use Email::Valid;
42
use Module::Load;
43
44
#Imports for item types step 4
45
use Koha::ItemTypes;
46
use Koha::Localizations;
47
48
#Imports for circulation rule step 5
49
use Koha::IssuingRule;
50
use Koha::IssuingRules;
51
use Koha::Logger;
52
use Koha::RefundLostItemFeeRule;
53
use Koha::RefundLostItemFeeRules;
25
54
26
#Setting variables
55
#Setting variables
27
my $input    = new CGI;
56
my $input    = new CGI;
28
my $query    = new CGI;
57
my $query    = new CGI;
29
my $step     = $query->param('step');
58
my $step     = $query->param('step');
30
59
60
#Getting the appropriate template to display to the user-->
31
my ( $template, $loggedinuser, $cookie) = get_template_and_user(
61
my ( $template, $loggedinuser, $cookie) = get_template_and_user(
32
     {
62
     {
33
        template_name => "/onboarding/onboardingstep" . ( $step ? $step : 1 ) . ".tt",
63
        template_name => "/onboarding/onboardingstep" . ( $step ? $step : 0 ) . ".tt",
34
        query         => $query,
64
        query         => $query,
35
        type          => "intranet",
65
        type          => "intranet",
36
        authnotrequired => 0,
66
        authnotrequired => 0,
Lines 57-180 my $dbh = DBI->connect( Link Here
57
);
87
);
58
88
59
89
90
#Store the value of the template input name='op' in the variable $op so we can check if the user has pressed the button with the name="op" and value="finish" meaning the user has finished the onboarding tool.
91
my $op = $query->param('op');
92
$template->param('op'=>$op);
93
if ( $op && $op eq 'finish' ) { #If the value of $op equals 'finish' then redirect user to /cgi-bin/koha/mainpage.pl
94
    print $query->redirect("/cgi-bin/koha/mainpage.pl");
95
    exit;
96
}
60
97
61
      my $op = $query->param('op');
62
      $template->param('op'=>$op);
63
      warn $op;
64
      if ( $op && $op eq 'finish' ) {
65
         print $query->redirect("/cgi-bin/koha/mainpage.pl");
66
         exit;
67
      }
68
69
70
71
#Performing each step of the onboarding tool
72
if ( $step && $step == 1 ) {
73
#This is the Initial step of the onboarding tool to create a library 
74
75
76
    my $createlibrary = $query->param('createlibrary');
77
    $template->param('createlibrary'=>$createlibrary);
78
98
79
#store inputted parameters in variables
99
#Store the value of the template input name='start' in the variable $start so we can check if the user has pressed this button and starting the onboarding tool process
100
my $start = $query->param('start');
101
$template->param('start'=>$start); #Hand the start variable back to the template
102
if ( $start && $start eq 'Start setting up my Koha' ){ 
103
    my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, );
104
    $template->param(libraries   => $libraries,
105
              group_types => [
106
                {   categorytype => 'searchdomain',
107
                    categories   => [ Koha::LibraryCategories->search( { categorytype => 'searchdomain' } ) ],
108
                },
109
                {   categorytype => 'properties',
110
                         categories   => [ Koha::LibraryCategories->search( { categorytype => 'properties' } ) ],
111
                },
112
              ]
113
    );
114
115
116
#Select any library records from the database and hand them back to the template in the libraries variable. 
117
}elsif (  $start && $start eq 'Add a patron category' ){
118
119
#Select all the patron category records in the categories database table and store them in the newly declared variable $categories
120
    my $categories = Koha::Patron::Categories->search(); 
121
    $template->param(
122
        categories => $categories,
123
    ); #Hand the variable categories back to the template
124
125
}elsif ( $start && $start eq 'Add an item type' ){
126
     my $itemtypes = Koha::ItemTypes->search();
127
     warn $itemtypes;
128
     $template->param(
129
             itemtypes => $itemtypes,
130
    );
131
132
#Check if the $step variable equals 1 i.e. the user has clicked to create a library in the create library screen 1 
133
}elsif ( $step && $step == 1 ) {
134
135
    my $createlibrary = $query->param('createlibrary'); #Store the inputted library branch code and name in $createlibrary
136
    $template->param('createlibrary'=>$createlibrary); # Hand the library values back to the template in the createlibrary variable
137
138
    #store inputted parameters in variables
80
    my $branchcode       = $input->param('branchcode');
139
    my $branchcode       = $input->param('branchcode');
81
    my $categorycode     = $input->param('categorycode');
140
    my $categorycode     = $input->param('categorycode');
82
    my $op               = $input->param('op') || 'list';
141
    my $op               = $input->param('op') || 'list';
83
    my @messages;
142
    my @messages;
84
    my $library;
143
    my $library;
85
144
86
#Find branchcode if it exists
145
    #Take the text 'branchname' and store it in the @fields array
87
    if ( $op eq 'add_form' ) {
146
    my @fields = qw(
88
        if ($branchcode) {
147
        branchname
89
            $library = Koha::Libraries->find($branchcode);
148
    ); 
90
         }
91
149
92
        $template->param(
150
    $branchcode =~ s|\s||g; # Use a regular expression to check the value of the inputted branchcode 
93
            library    => $library,
94
            categories => [ Koha::LibraryCategories->search( {}, { order_by => [ 'categorytype', 'categoryname' ] } ) ],
95
            $library ? ( selected_categorycodes => [ map { $_->categorycode } $library->get_categories ] ) : (),
96
        );
97
    } elsif ( $op eq 'add_validate' ) {
98
        my @fields = qw(
99
            branchname
100
        );
101
151
102
        my $is_a_modif = $input->param('is_a_modif');
152
    #Create a new library object and store the branchcode and @fields array values in this new library object
103
153
    my $library = Koha::Library->new(
104
        my @categories;
154
        {   branchcode => $branchcode, 
105
        for my $category ( Koha::LibraryCategories->search ) {
155
            ( map { $_ => scalar $input->param($_) || undef } @fields )
106
            push @categories, $category
156
        }
107
                if $input->param( "selected_categorycode_" . $category->categorycode );
157
    );
108
         }
109
        if ($is_a_modif) {
110
            my $library = Koha::Libraries->find($branchcode);
111
            for my $field (@fields) {
112
                 $library->$field( scalar $input->param($field) );
113
            }
114
            $library->update_categories( \@categories );
115
158
116
            eval { $library->store; };
159
    eval { $library->store; }; #Use the eval{} function to store the library object
117
160
118
            if ($@) {
161
    #If there are values in the $@ then push the values type => 'alert', code => 'error_on_insert' into the @messages array el    se push the values type => 'message', code => 'success_on_insert' to that array
119
                push @messages, { type => 'alert', code => 'error_on_update' };
162
    if ($@) {
120
            } else {
163
        push @messages, { type => 'alert', code => 'error_on_insert' };
121
                push @messages, { type => 'message', code => 'success_on_update' };
164
    } else {
122
            }
165
        push @messages, { type => 'message', code => 'success_on_insert' };
123
        } else {
124
            $branchcode =~ s|\s||g;
125
            my $library = Koha::Library->new(
126
                 {   branchcode => $branchcode,
127
                    ( map { $_ => scalar $input->param($_) || undef } @fields )
128
                }
129
            );
130
            eval { $library->store; };
131
            $library->add_to_categories( \@categories );
132
            if ($@) {
133
                push @messages, { type => 'alert', code => 'error_on_insert' };
134
            } else {
135
                push @messages, { type => 'message', code => 'success_on_insert' };
136
            }
137
        }
138
            $op = 'list';
139
    }
166
    }
140
167
141
        
168
#Check if the $step vairable equals 2 i.e. the user has clicked to create a patron category in the create patron category screen 1
142
}elsif ( $step && $step == 2 ){
169
}elsif ( $step && $step == 2 ){
143
170
144
    my $createpatroncategory = $query->param('createpatroncategory');
171
    #Initialising values
145
    $template->param('createpatroncategory'=>$createpatroncategory);
172
    my $input         = new CGI;
173
    my $searchfield   = $input->param('description') // q||;
174
    my $categorycode  = $input->param('categorycode');
175
    my $op            = $input->param('op') // 'list';
176
    my @messages;
146
177
178
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
179
    {
180
        template_name   => "/onboarding/onboardingstep2.tt",
181
        query           => $input,
182
        type            => "intranet",
183
        authnotrequired => 0,
184
        flagsrequired   => { parameters => 'parameters_remaining_permissions' },
185
        debug           => 1,
186
    }
187
    );
188
    #When the user first arrives on the page
189
    if ( $op eq 'add_form' ) {
190
        my $category;
191
        if ($categorycode) {
192
            $category          = Koha::Patron::Categories->find($categorycode);
193
        }
194
195
        $template->param(
196
            category => $category,
197
        );
198
199
        if ( C4::Context->preference('EnhancedMessagingPreferences') ) {
200
            C4::Form::MessagingPreferences::set_form_values(
201
                { categorycode => $categorycode }, $template );
202
        }
203
    }
204
    #Once the user submits the page, this code validates the input and adds it
205
    #to the database as a new patron category 
206
    elsif ( $op eq 'add_validate' ) {
207
        my $categorycode = $input->param('categorycode');
208
        my $description = $input->param('description');
209
        my $overduenoticerequired = $input->param('overduenoticerequired');
210
        my $category_type = $input->param('category_type');
211
        my $default_privacy = $input->param('default_privacy');
212
        my $enrolmentperiod = $input->param('enrolmentperiod');
213
        my $enrolmentperioddate = $input->param('enrolmentperioddate') || undef;
214
215
        #Converts the string into a date format
216
        if ( $enrolmentperioddate) {
217
            $enrolmentperioddate = output_pref(
218
                    {
219
                        dt         => dt_from_string($enrolmentperioddate),
220
                        dateformat => 'iso',
221
                        dateonly   => 1,
222
                    }
223
            );
224
        }
225
        #Adds to the database
226
        my $category = Koha::Patron::Category->new({
227
                categorycode=> $categorycode,
228
                description => $description,
229
                overduenoticerequired => $overduenoticerequired,
230
                category_type=> $category_type,
231
                default_privacy => $default_privacy,
232
                enrolmentperiod => $enrolmentperiod,
233
                enrolmentperioddate => $enrolmentperioddate,
234
        });
235
        eval {
236
            $category->store;
237
        };
238
239
        #Error messages 
240
        if($@){
241
            push @messages, {type=> 'error', code => 'error_on_insert'};
242
        }else{
243
            push @messages, {type=> 'message', code => 'success_on_insert'};
244
        }
245
    }
246
#Create a patron
147
}elsif ( $step && $step == 3 ){
247
}elsif ( $step && $step == 3 ){
148
248
149
    my $createpatron = $query->param('createpatron');
249
    my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, );
150
    $template->param('createpatron'=>$createpatron);
250
    $template->param(libraries   => $libraries,
251
              group_types => [
252
                {   categorytype => 'searchdomain',
253
                    categories   => [ Koha::LibraryCategories->search( { categorytype => 'searchdomain' } ) ],
254
                },
255
                {   categorytype => 'properties',
256
                         categories   => [ Koha::LibraryCategories->search( { categorytype => 'properties' } ) ],
257
                },
258
              ]
259
    );
260
261
        my $categories;
262
        $categories= Koha::Patron::Categories->search();
263
        $template->param(
264
                categories => $categories,
265
        );
151
266
152
}elsif ( $step && $step == 4){
153
267
154
    my $createitemtype = $query->param('createitemtype');
155
    $template->param('createitemtype'=>$createitemtype);
156
268
157
}elsif ( $step && $step == 5){
269
    my $input = new CGI;
270
    my $op = $input->param('op');
271
    my @messages; 
158
272
159
    my $createcirculationrule = $query->param('createcirculationrule');
273
    my ($template, $loggedinuser, $cookie)
160
    $template->param('createcirculationrule'=>$createcirculationrule);
274
        = get_template_and_user({
275
                template_name => "/onboarding/onboardingstep3.tt",
276
                query => $input,
277
                type => "intranet",
278
                authnotrequired => 0,
279
                flagsrequired => {borrowers => 1},
280
                debug => 1,
281
        });
161
282
283
    if($op eq 'add_form'){
284
        my $member;
285
        $template->param(
286
            member => $member,
287
        );
162
288
163
}
164
289
290
    }
291
    elsif($op eq 'add_validate'){
292
        my $surname => $input->param('surname');
293
        my $firstname => $input->param('firstname');
294
        my $cardnumber => $input->param('cardnumber');
295
        my $libraries => $input->param('libraries');
296
        my $categorycode_entry => $input->param('categorycode_entry');
297
        my $userid => $input->param('userid');
298
        my $password => $input->param('password');
299
        my $password2 =>$input->param('password2');
300
301
        my $member = Koha::Patron->new({
302
                surname => $surname,
303
                firstname => $firstname,
304
                cardnumber => $cardnumber,
305
                libraries => $libraries,
306
                categorycode_entry => $categorycode_entry,
307
                userid => $userid,
308
                password => $password,
309
                password2 => $password2,
310
        });
311
        eval {
312
            $member->store;
313
        };
314
        if($@){
315
            push @messages, {type=> 'error', code => 'error_on_insert'};
316
        }else{
317
            push @messages, {type=> 'message', code => 'success_on_insert'};
318
        }
319
320
    }
165
321
322
#Create item type
323
}elsif ( $step && $step == 4){
324
    my $input = new CGI;
325
    my $itemtype_code = $input->param('itemtype');
326
    my $op = $input->param('op') // 'list';
327
    my @messages;
166
328
329
    my( $template, $borrowernumber, $cookie) = get_template_and_user(
330
            {   template_name   => "/onboarding/onboardingstep4.tt",
331
                query           => $input,
332
                type            => "intranet",
333
                authnotrequired => 0,
334
                flagsrequired   => { parameters => 'parameters_remaining_permissions'},
335
                debug           => 1,
336
            }
337
    );
338
339
    if($op eq 'add_form'){
340
        my $itemtype = Koha::ItemTypes->find($itemtype_code);
341
        template->param(itemtype=>$itemtype,);
342
    }elsif($op eq 'add_validate'){
343
        my $itemtype = Koha::ItemTypes->find($itemtype_code);
344
        my $description = $input->param('description');
345
346
        #store the input from the form - only 2 fields 
347
        my $itemtype= Koha::ItemType->new(
348
            { itemtype    => $itemtype_code,
349
              description => $description,
350
            }
351
        );
352
        eval{ $itemtype->store; };
353
        #Error messages
354
        if($@){
355
            push @messages, {type=> 'error', code => 'error_on_insert'};
356
        }else{
357
            push @messages, {type=> 'message', code => 'success_on_insert'};
358
        }
359
    }
167
360
361
}elsif ( $step && $step == 5){
362
    #Fetching all the existing categories to display in a drop down box
363
    my $categories;
364
    $categories= Koha::Patron::Categories->search();
365
    $template->param(
366
        categories => $categories,
367
    );
368
369
    my $itemtypes;
370
    $itemtypes= Koha::ItemTypes->search();
371
    $template->param(
372
        itemtypes => $itemtypes,
373
    );
374
375
    my $input = CGI->new;
376
    my($template, $loggedinuser, $cookie)  =get_template_and_user({
377
            template_name => "/onboarding/onboardingstep5.tt",
378
            query => $input,
379
            type => "intranet",
380
            authnotrequired=>0,
381
            flagsrequired=> {parameters => 'manage_circ_rules'},
382
            debug =>1,
383
    });
384
    
385
    my $type = $input->param('type');
386
    my $branch = $input->param('branch');
387
    
388
    
389
    
390
    if($op eq 'add_form'){
168
391
169
392
170
393
171
output_html_with_http_headers $input, $cookie, $template->output;
394
    }
395
    elsif($op eq 'add_validate'){
396
        my $bor = $input->param('categorycode');
397
        my $itemtype = $input->param('itemtype');
398
        my $maxissueqty = $input->param('maxissueqty');
399
        my $issuelength = $input->param('issuelength');
400
        #$issuelength = $issuelength eq q{} ? undef : $issuelength;
401
        my $lengthunit = $input->param('lengthunit');
402
        my $renewalsallowed = $input->param('renewalsallowed');
403
        my $renewalperiod = $input->param('renewalperiod');
404
        my $onshelfholds = $input->param('onshelfholds');
405
406
        my $params ={
407
            categorycode    => $bor,
408
            itemtype        => $itemtype,
409
            maxissueqty     => $maxissueqty,
410
            renewalsallowed => $renewalsallowed,
411
            renewalperiod   => $renewalperiod,
412
            lengthunit      => $lengthunit,
413
            onshelfholds    => $onshelfholds,
414
        };
415
        my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype});
416
        if($issuingrule){
417
            $issuingrule->set($params)->store();
418
        }else{
419
            Koha::IssuingRule->new()->set($params)->store(); 
420
            }
172
421
422
   
423
    }
424
    
173
425
174
426
175
427
428
}
176
429
177
430
178
431
179
432
433
output_html_with_http_headers $input, $cookie, $template->output;
180
434
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep0.tt (+54 lines)
Line 0 Link Here
1
<!-- Includes for creating library-->
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'installer-doc-head-close.inc' %]
4
5
6
<head>
7
<title>Welcome &rsaquo; to  &rsaquo; Koha</title>
8
9
<!--jQuery code for create library-->
10
<script type="text/javascript" src="[% interface %]/lib/tiny_mce/tiny_mce.js"></script>
11
<script type="text/javascript">
12
     //<![CDATA[
13
             $(document).ready(function() {
14
                      $("#branchest").dataTable($.extend(true, {}, dataTablesDefaults, {
15
                             "aoColumnDefs": [
16
                                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
17
                              ],
18
                              "iDisplayLength": 10,
19
                              "sPaginationType": "four_button"
20
                       }));
21
22
                       [% UNLESS library %]
23
                             $("#Aform").on("submit", function( event ) {
24
                                      if ( $("#branchcode").val().match(/\s/) ) {
25
                                         event.preventDefault();
26
                                         alert(_("The library code entered contains whitespace characters. Please remove any whitespace characters from the library code"));
27
                                          return false;
28
                                       } else {
29
                                          return true;
30
                                       }
31
                             });
32
                        [% END %]..
33
              });
34
    //]]>
35
 </script>
36
 </head>
37
38
 <!--Header for the koha onboarding tool-->
39
<div>
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>
42
      <h2 align="center"> We're just going to set up a few things......</h2>
43
      <form name="startkoha" method="post" action="onboarding.pl">
44
         <input type="hidden" name="step" value="1"/>
45
         <input type="submit" name="start" value="Start setting up my Koha"/>
46
      </form>
47
</div>
48
49
50
51
52
53
54
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt (-17 / +25 lines)
Lines 1-7 Link Here
1
<!--Includes for creating library--> 
1
<!--Includes for creating library--> 
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
4
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %]
5
[% INCLUDE 'installer-doc-head-close.inc' %]
3
[% INCLUDE 'installer-doc-head-close.inc' %]
6
4
7
<head>
5
<head>
Lines 31-71 Link Here
31
                                }
29
                                }
32
                       });
30
                       });
33
                 [% END %]..
31
                 [% END %]..
34
         });
32
     });
35
    //]]>
33
//]]>
36
</script>
34
</script>
37
</head>
35
</head>
38
36
37
<!--Header for the koha onboarding tool-->
39
<div>
38
<div>
40
    <h1 align="center"> Welcome to Koha</h1>
39
    <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>
40
    <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> We're just going to set up a few things</h2>
43
</div>
41
</div>
44
 
42
 [% IF libraries.count > 0 %]
45
<!--Create a library screen 2-->
43
 <br>
46
[% IF (createlibrary) %]
44
    <h3 align="left">You do not need to create a library as you have already installed the sample library data previously</h3>
45
    <form name="skiplibrary" method="post" action="onboarding.pl">
46
        <input type="hidden" name="step" value="2"/>
47
        <div>
48
            <input type="submit" name="start" value="Add a patron category"/>
49
        </div>
50
    </form>
51
52
    <!--Create a library screen 2-->
53
[% ELSIF (createlibrary) %]
47
        <!--New Library created-->
54
        <!--New Library created-->
48
        <form name="createlibrary" method="post" action="onboarding.pl">
55
        <form name="createlibrary" method="post" action="onboarding.pl">
49
            <input type="hidden" name="step" value="2"/>
56
            <input type="hidden" name="step" value="2"/>
50
            <h1 align="left"> New Library</h1>
57
            <h1 align="left"> New Library</h1>
51
58
            <div>
52
            <div>   
53
                 <p> Success: Library created!</p>
59
                 <p> Success: Library created!</p>
54
                 <p> To add another library and for more settings, <br>
60
                 <p> To add another library and for more settings, <br>
55
                go to Tools->Administration->Libraries and Groups
61
                go to Tools->Administration->Libraries and Groups
56
            </div>
62
            </div>
57
            Next up:
63
            Next up:
58
            <input type="submit" value="Add a patron category"/>
64
            <input type="submit" name="start" value="Add a patron category"/>
59
        </form>
65
        </form>
60
        
66
61
        <!--Implement if statement to determine if library was succesfully created here....-
67
        <!--Implement if statement to determine if library was succesfully created here....-
62
        <div>
68
        <div>
63
             <p> Library was not successfully created</p>
69
             <p> Library was not successfully created</p>
64
        </div>
70
        </div>
65
        -->
71
        -->
66
[% ELSE %]    
72
[% ELSE %]
67
73
<!--Create a library screen 1-->
68
       <h1 align="left"> New Library</h2>
74
        <h2>Create a Library</h2> 
69
        <form name="LibraryCreation" method="post" action="onboarding.pl">
75
        <form name="LibraryCreation" method="post" action="onboarding.pl">
70
            <fieldset class="rows">
76
            <fieldset class="rows">
71
                 <input type="hidden" name="step" value="1"/>
77
                 <input type="hidden" name="step" value="1"/>
Lines 85-93 Link Here
85
                 </ol>
91
                 </ol>
86
             </fieldset>
92
             </fieldset>
87
             <br>
93
             <br>
88
             <input type="submit" class="action" value="Next &gt;&gt;"/>
94
             <input type="submit" class="action" value="Submit"/>
89
     </form>
95
     </form>
90
[% END %]        
96
[% END %]  
97
    
98
91
99
92
100
93
101
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt (-48 / +31 lines)
Lines 4-11 Link Here
4
[% USE Price %]
4
[% USE Price %]
5
5
6
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
8
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %]
9
[% INCLUDE 'installer-doc-head-close.inc' %]
7
[% INCLUDE 'installer-doc-head-close.inc' %]
10
[% INCLUDE 'calendar.inc' %]
8
[% INCLUDE 'calendar.inc' %]
11
[% INCLUDE 'datatables.inc' %]
9
[% INCLUDE 'datatables.inc' %]
Lines 13-19 Link Here
13
11
14
<head>
12
<head>
15
<title> Add a patron category</title>
13
<title> Add a patron category</title>
16
17
<!--JQuery scripts for create patron category-->
14
<!--JQuery scripts for create patron category-->
18
<script type="text/javascript">
15
<script type="text/javascript">
19
     var MSG_CATEGORYCODE_CHARS = _("Category code can only contain the following characters: letters, numbers, - and _.");
16
     var MSG_CATEGORYCODE_CHARS = _("Category code can only contain the following characters: letters, numbers, - and _.");
Lines 21-73 Link Here
21
     var MSG_ONE_ENROLLMENTPERIOD = ("Please choose an enrollment period in months OR by date.");
18
     var MSG_ONE_ENROLLMENTPERIOD = ("Please choose an enrollment period in months OR by date.");
22
</script>
19
</script>
23
<script type="text/javascript" src="[% themelang %]/js/categories.js"></script>
20
<script type="text/javascript" src="[% themelang %]/js/categories.js"></script>
24
25
</head>
21
</head>
26
22
27
<div>
23
<div> <!-- Header that appears at the top of every screen in the koha onboarding tool-->
28
    <h1 align="center"> Welcome to Koha</h1>
24
    <h1 align="center"> Welcome to Koha</h1>
29
    <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;"  src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1>
25
    <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;"  src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1>
30
</div>
26
</div>
31
27
32
<!--Create a patron category screen 2-->
28
33
[% IF (createpatroncategory) %]
29
[% IF categories.count > 0 %] <!--This if statement checks if the categories variable handed to this template by onboarding.pl has data in it. If the categories variable does have data in it this means that the user has previously imported sample patron category data and so we do not need to show them the create patron category screen 1, instead we can display a screen with ubtton redirecting the user to step 3-->
34
                
30
<br>
31
     <h3 align="left">You do not need to create a patron category as you have already installed the sample patron categories data previously</h3>
32
     <form name="skippatroncategory" method="post" action="onboarding.pl">
33
          <input type="hidden" name="step" value="3"/>
34
          <div>
35
            <input type="submit" name="start" value="Add a patron"/>
36
          </div>
37
     </form>
38
39
<!--else if the user has not previously imported sample patron categories check if the user has pressed the button name="add_validate" in the create patron category screen 1, and if they have pressed that button then display the below screen with a button to redirect the user to step 3-->
40
[% ELSIF op == 'add_validate' %]
35
     <form name="createpatroncategory" method="post" action="onboarding.pl">
41
     <form name="createpatroncategory" method="post" action="onboarding.pl">
36
             <input type="hidden" name="step" value="3"/>
42
             <input type="hidden" name="step" value="3"/>
37
             <h1 align="left"> New patron category</h1>
43
             <h1 align="left">  New patron category</h1>
38
             <div>
44
             <div>
39
                 <p> Success: Patron category created!</p>
45
                 <p> Success: Patron category created!</p>
40
                 <p> To add another patron category and for more settings<br>
46
                 <p> To add another patron category and for more settings<br>
41
                 go to More->Administration->Patrons & Circulation->Patron Categories</p>
47
                 go to More->Administration->Patrons & Circulation->Patron Categories</p>
42
             </div>
48
             </div>
43
             Next up:<br>
49
             Next up:<br>
44
             <input type="submit" value="Add a patron">
50
             <input type="submit" name="start" value="Add a patron"><!-- When the user clicks on this button then redirect them to step 3 of the onboarding tool-->
45
     </form>
51
     </form>
46
52
47
[% ELSE %]
53
[% ELSE %] <!--Else display create patron category screen 1 where the user can input values to create their first patron category-->
48
    <h1 align="left"> New Patron Category</h2>
54
    <h1 align="left"> Create a new Patron Category</h2>
49
    
50
    <form id="category_form" method="post" action="onboarding.pl">
55
    <form id="category_form" method="post" action="onboarding.pl">
51
        <fieldset class="rows">        
56
        <fieldset class="rows">
52
            <input type="hidden" name="step" value="2"/>
57
            <input type="hidden" name="step" value="2"/>
53
            <input type="hidden" name="op" value="add_validate" />
58
            <input type="hidden" name="op" value="add_validate" />
54
            <input type="hidden" name="createpatroncategory" value="createpatroncategory"/>
55
                <ol>
59
                <ol>
56
                    <li>
60
                    <li>
57
                        <label for="categorycode" class="required">Category code: </label>
61
                        <label for="categorycode" class="required">Category code: </label>
58
                        <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" class="required" required="required" />
62
                        <input type="text" name="categorycode" value="[% category.categorycode |html %]" size="10" maxlength="10" class="required" required="required" />
59
                        <span class="required">Required</span>
63
                        <span class="required">Required</span>
60
                    </li>
64
                    </li>
61
65
62
                    <li>
66
                    <li>
63
                        <label for="description" class="required">Description: </label>
67
                        <label for="description" class="required">Description: </label>
64
                        <input type="text" name="description" id="description" size="40" maxlength="80" class="required" required="required" value="[% category.description |html %]" />
68
                        <input type="text" name="description" size="40" maxlength="80" class="required" required="required" value="[% category.description |html %]" />
65
                        <span class="required">Required</span>
69
                        <span class="required">Required</span>
66
                    </li>
70
                    </li>
67
71
68
                    <li>
72
                    <li>
69
                        <label for="overduenoticerequired">Overdue notice required: </label>
73
                        <label for="overduenoticerequired">Overdue notice required: </label>
70
                        <select name="overduenoticerequired" id="overduenoticerequired">
74
                        <select name="overduenoticerequired" value="overduenoticerequired">
71
                            [% IF category.overduenoticerequired %]
75
                            [% IF category.overduenoticerequired %]
72
                                <option value="0">No</option>
76
                                <option value="0">No</option>
73
                                <option value="1" selected="selected">Yes</option>
77
                                <option value="1" selected="selected">Yes</option>
Lines 80-86 Link Here
80
84
81
                    <li>
85
                    <li>
82
                        <label for="category_type" class="required">Category type: </label>
86
                        <label for="category_type" class="required">Category type: </label>
83
                        <select name="category_type" id="category_type">
87
                        <select name="category_type" value="category_type" class='required' required='required'>
84
                            [% UNLESS category %]
88
                            [% UNLESS category %]
85
                                <option value="" selected="selected">Select a category type</option>
89
                                <option value="" selected="selected">Select a category type</option>
86
                            [% ELSE %]
90
                            [% ELSE %]
Lines 128-134 Link Here
128
132
129
                    <li>
133
                    <li>
130
                        <label for="default_privacy">Default privacy: </label>
134
                        <label for="default_privacy">Default privacy: </label>
131
                        <select id="default_privacy" name="default_privacy" required="required">
135
                        <select value="default_privacy" name="default_privacy" required="required">
132
                            [% SET default_privacy = 'default' %]
136
                            [% SET default_privacy = 'default' %]
133
137
134
                            [% IF category %]
138
                            [% IF category %]
Lines 153-198 Link Here
153
                        <p>Controls how long a patrons checkout history is kept for new patrons of this category. "Never"     anonymizes checkouts on return, and "Forever" keeps a patron's checkout history indefinitely. When set to "Default", the amount of history kept is controlled by the cronjob <i>batch_anonymise.pl</i> which should be set up by your system administrator.</p>
157
                        <p>Controls how long a patrons checkout history is kept for new patrons of this category. "Never"     anonymizes checkouts on return, and "Forever" keeps a patron's checkout history indefinitely. When set to "Default", the amount of history kept is controlled by the cronjob <i>batch_anonymise.pl</i> which should be set up by your system administrator.</p>
154
                    </li>
158
                    </li>
155
159
156
            <span class="label">Enrollment period: </span>
160
            <span class="label">Enrolment period: </span>
161
            </br>
157
                    <fieldset>
162
                    <fieldset>
158
                        <legend>Choose one</legend>
163
                    <legend>Choose one</legend>
159
                            <ol>
164
                            <ol>
160
                                <li>
165
                                <li>
161
                                    <label for="enrolmentperiod" style="width:6em;">In months: </label>
166
                                    <label for="enrolmentperiod" style="width:6em;">In months: </label>
162
                                    <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperio    d" size="3"     maxlength="1" value="[% IF category.enrolmentperiod %][% category.enrolmentperiod %][% END %]" /> months
167
                                    <input type="text" name="enrolmentperiod" size="3"     maxlength="1" value="[% IF category.enrolmentperiod %][% category.enrolmentperiod %][% END %]" /> months 
163
                                </li>
168
                                </li>
164
                                <li>
169
                                <li>
165
                                    <label for="enrolmentperioddate" style="width:6em;">Until date: </label>
170
                                    <label for="enrolmentperioddate" style="width:6em;">Until date: </label>
166
                                    <input type="text" class="enrollmentperiod" name="enrolmentperioddate" id="enrolmentp    erioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
171
                                    <input type="text" name="enrolmentperioddate"  value="[% category.enrolmentperioddate | $KohaDates %]" />
167
                                </li>
172
                                </li>
168
                            </ol>
173
                            </ol>
169
                     </fieldset>
174
                     </fieldset>
170
                     <br>
175
                    <br>
171
                    <input type="submit" class="action" value="Create Patron Category" />
176
                    <input type="submit" class="action" value="Submit" />
172
    </form>
177
    </form>
173
[% END %]
178
[% END %]
174
            
175
                    
176
        <!--Onboarding tool step 2-Create a patron category screen 1
177
         <div id="doc3" class="yui-t2">
178
            <div id="bd">
179
                <div id="yui-main">
180
                <div class="yui-b">
181
         [% FOR m IN messages %]
182
            <div class="dialog [% m.type %]">
183
                [% SWITCH m.code %]
184
                    [% CASE 'error_on_insert' %]
185
                        An error occurred when inserting this patron category. The patron category might already exist.
186
                    [% CASE 'success_on_insert' %]
187
                         Patron category inserted successfully.
188
                    [% CASE 'already_exists' %]
189
                         This patron category already exists.
190
                    [% CASE %]
191
                        [% m.code %]
192
                    [% END %]
193
            </div>
194
        [% END %]
195
</body>-->
196
179
197
180
198
181
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt (-43 / +49 lines)
Lines 1-27 Link Here
1
<!--Includes for creating patron--> 
1
<!--Includes for creating patron-->
2
[% USE Koha %]
3
[% USE KohaDates %]
4
[% USE Price %]
5
<!--[% USE Branches %]-->
2
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END     %]
8
3
9
4
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %]
5
[% INCLUDE 'installer-doc-head-close.inc' %]
10
[% INCLUDE 'installer-doc-head-close.inc' %]
11
[% INCLUDE 'calendar.inc' %]
12
[% INCLUDE 'datatables.inc' %]
13
6
14
7
<head>
15
<head>
8
<title>Create Patron</title>
16
<title>Create Patron</title>
9
17
10
<!--jQuery scripts for creating patron-->
18
<!--jQuery scripts for creating patron-->
11
19
<!--<script type="text/javascript" src="[% interface %]/[% theme %]/js/members.js"></script>
12
20
-->
13
14
</head>
21
</head>
15
22
16
<div>
23
<div>
17
    <h1 align="center"> Welcome to Koha</h1>
24
    <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>
25
    <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;"  src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1>
19
</div>
26
</div>
20
 
21
<!--Create a patron screen 2-->
27
<!--Create a patron screen 2-->
22
[% IF (createpatron) %]
28
[% IF op == 'add_validate' %]
23
        <!--New patron created-->
29
        <!--New patron created-->
24
        <form name="createpatron" method="post" action="onboarding.pl">
30
        <form name="patrondone" method="post" action="onboarding.pl">
25
            <input type="hidden" name="step" value="4"/>
31
            <input type="hidden" name="step" value="4"/>
26
            <h1 align="left"> New Patron </h1>
32
            <h1 align="left"> New Patron </h1>
27
33
Lines 31-112 Link Here
31
                More > Set Permissions in a user page to gain superlibrarian permissions.
37
                More > Set Permissions in a user page to gain superlibrarian permissions.
32
                </div>
38
                </div>
33
                 Next up:
39
                 Next up:
34
                 <input type="submit" value="Add an item type"/>
40
                 <input type="submit" name="start" value="Add an item type"/>
35
        </form>
41
        </form>
36
                 <div>
42
       <!--Implement a if statement to check if the patron was successfully created
43
                <div>
37
                    <p> Oh no! Patron was not created</p>
44
                    <p> Oh no! Patron was not created</p>
38
                </div>
45
                </div>-->
39
[% ELSE %]    
46
[% ELSE %]    
40
<!--Create a patron screen 1-->
47
<!--Create a patron screen 1-->
41
       <h1 align="left"> New Patron </h2>
48
       <h1 align="left"> Create a new Patron </h2>
42
        <form name="PatronCreation" method="post" action="onboarding.pl">
49
        <form name="createpatron" method="post" action="onboarding.pl">
43
            <fieldset class="rows">
50
            <fieldset class="rows">
44
                 <input type="hidden" name="step" value="3"/>
51
                 <input type="hidden" name="step" value="3"/>
45
                 <input type="hidden" name="op" value="add_validate" />
52
                 <input type="hidden" name="op" value="add_validate" />
46
                 <input type="hidden" name="createpatron" value="createpatron"/>
47
                    <ol>
53
                    <ol>
48
                    <h3>Patron Identity</h3> 
54
                    <h3>Patron Identity</h3> 
49
                        <li>
55
                        <li>
50
                            <label for="surname" class="required">Surname: </label>
56
                            <label for="surname" class="required">Surname: </label>
51
                            <input type="text" name="surname" id="surname" size="10" maxlength="10" value="[% library.branchcode |html %]" class="required" required="required" />
57
                            <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="0"  value="[% surname %]" class="required" required="required" />
52
                            <span class="required">Required</span>
58
                            <span class="required">Required</span>
53
                        </li>
59
                        </li>
54
                        <li>
60
                        <li>
55
                            <label for="firstname" class="required">First Name: </label>
61
                            <label for="firstname" class="required">First Name: </label>
56
                            <input type="text" name="firstname" id="firstname" size="80" value="[% library.branchname |html %]" class="    required" required="required" style="width:200px;">
62
                            <input style= "text-transform:uppercase;" type="text" name="firstname" id="firstname" size="20" value="[% firstname |html %]" class="required" required="required">
57
                            <span class="required">Required</span>
63
                            <span class="required">Required</span>
58
                        </li>
64
                        </li>
59
                    </ol>
65
                    </ol>
66
                    
67
                    <legend id="library_management_lgd">Library Management</legend>
60
                    <ol>
68
                    <ol>
61
                    <h3>Library Management</h3>
62
                        <li>
69
                        <li>
63
                            <label for="cardnum" class="required">Card Number: </label>
70
                            <label for="cardnumber" class="required">Card Number: </label>
64
                            <input type="text" name="cardnum" id="cardnum" size="10" maxlength="20" value="/" class="required" required="required">
71
                            <input type="text" id="cardnumber" name="cardnumber" size="10" maxlength="20" value="[% cardnumber | html %]" class="required">
65
                            <span class="required">Required</span>
72
                            <span class="required">Required</span>
66
                        </li>
73
                        </li>
67
                        <li>
74
                        <li>
68
                         <div class="dropdown">
75
                       <!--require a foreach loop to get all the values for the library that the user has either imported (in web installer) or created in the first step of this onboarding tool-->
69
                           <button onclick="myFunction()" class="dropbtn">Library: </button>
76
                            <label for="libraries" class="required"> Library: </label>
70
                             <div id="myDropdown" class="dropdown-content">
77
                            <select name="branchcode" size="1" id="libraries">
71
                                <a href="#">Centreville</a>
78
72
                                <a href="#">Centre City</a>
79
                             [% FOREACH library IN libraries %]
73
                                <a href="#">Centre of the Earth</a>
80
                                  <option value="[% library.branchcode %]"> [% library.branchname %]
74
                              </div>
81
                             [% END %]
75
                            </div>
82
                                    
83
                                </select>
84
                            <span class="required"> Required</span>
76
                        </li>
85
                        </li>
77
                        <li>
86
                        <li>
78
                         <div class="dropdown">
87
                            <label for="categorycode_entry" class="required"> Patron Category</label>
79
                           <button onclick="myFunction()" class="dropbtn">Category: </button>
88
                            <select id="categorycode_entry" name="categorycode" onchange="update_category_code(this);">
80
                             <div id="myDropdown" class="dropdown-content">
89
                           [% FOREACH category IN categories %]
81
                                <a href="#">Adult</a>
90
                                <option value = "[% category.description %]"> [%category.description %] 
82
                                <a href="#">Infant</a>
91
                            [% END %]
83
                                <a href="#">Pet Horse</a>
92
                            </select>
84
                              </div>
93
                            <span class="required">Required</span>
85
                            </div>
86
                        </li> 
94
                        </li> 
87
                    </ol>
95
                    </ol>
88
                     <ol>
96
                     <ol>
89
                    <h3>OPAC/Staff Login</h3> 
97
                    <h3>OPAC/Staff Login</h3> 
90
                        <li>
98
                        <li>
91
                            <label for="username" class="required">Username: </label>
99
                            <label for="userid" class="required">Username: </label>
92
                            <input type="text" name="username" id="username" size="10" maxlength="10" value="[% library.branchcode |html %]" class="required" required="required" />
100
                            <input type="text" name="userid" id ="userid" size="20" value="[% userid %]" class="required" required="required" />
93
                            <span class="required">Required</span>
101
                            <span class="required">Required</span>
94
                        </li>
102
                        </li>
95
                        <li>
103
                        <li>
96
                            <label for="password" class="required">Password: </label>
104
                            <label for="password" class="required">Password: </label>
97
                            <input type="password" name="password" id="password" size="80" value="[% library.branchname |html %]" class="    required" required="required" style="width:200px;">
105
                            <input type="password" name="password" id="password" size="20" value="[% password %]" class="required" required="required">
98
                            <span class="required">Required</span>
106
                            <span class="required">Required</span>
99
                        </li>
107
                        </li>
100
                        <li>
108
                        <li>
101
                            <label for="password" class="required">Confirm password: </label>
109
                            <label for="password2" class="required">Confirm password: </label>
102
                            <input type="password" name="password" id="password" size="80" value="[% library.branchname |html %]" class="    required" required="required" style="width:200px;">
110
                            <input type="password" id="password2" name="password2" size="20" value="" class="required" required="required">
103
                            <span class="required">Required</span>
111
                            <span class="required">Required</span>
104
                        </li>
112
                        </li>
105
                    </ol>
113
                    </ol>
106
             </fieldset>
114
             </fieldset><br>
107
            <fieldset>
108
                <input type="submit" class="action" value="Submit"/>
115
                <input type="submit" class="action" value="Submit"/>
109
            </fieldset>
110
     </form>
116
     </form>
111
[% END %]        
117
[% END %]        
112
118
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt (-16 / +21 lines)
Lines 17-29 Link Here
17
    <h1 align="center"> Welcome to Koha</h1>
17
    <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>
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>
19
</div>
19
</div>
20
 
20
21
[% IF itemtypes.count > 0 %]
22
    <br>
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>
24
     <form name="skipitemtype" method="post" action="onboarding.pl">
25
          <input type="hidden" name="step" value="5"/>
26
          <div>
27
            <input type="submit" name="start" value="Add a circulation rule"/>
28
          </div>
29
      </form>
30
      
31
21
<!--Create a item type screen 2-->
32
<!--Create a item type screen 2-->
22
[% IF (createitemtype) %]
33
[% ELSIF op == "add_validate" %]
23
        <!--New item type created-->
34
        <!--New item type created-->
24
        <form name="createitemtype" method="post" action="onboarding.pl">
35
        <form name="createitemtype" method="post" action="onboarding.pl">
25
            <input type="hidden" name="step" value="5"/>
36
            <input type="hidden" name="step" value="5"/>
26
            <input type="hidden" name="step" value="1"/>
27
            <h1 align="left"> New Item type </h1>
37
            <h1 align="left"> New Item type </h1>
28
38
29
            <div>   
39
            <div>   
Lines 32-69 Link Here
32
                 go to More->Administration->Item types 
42
                 go to More->Administration->Item types 
33
            </div>
43
            </div>
34
                 Next up:
44
                 Next up:
35
                 <input type="submit" value="Add an circulation rule"/>
45
                 <input type="submit" value="Add a circulation rule"/>
36
                 <br>
37
                 Or:
38
                 <input type="submit" value="Return to Home"/>
39
        </form>
46
        </form>
47
          <!--Implement a if statement to check if the item type was successfully created or not
40
            <div>
48
            <div>
41
                  <p> Oh no! Patron was not created</p>
49
                  <p> Oh no! Patron was not created</p>
42
            </div>
50
            </div>-->
43
[% ELSE %]    
51
[% ELSE %]    
44
<!--Create a item type screen 1-->
52
<!--Create a item type screen 1-->
45
       <h1 align="left"> New Item type </h2>
53
       <h1 align="left"> Create a new Item type </h2>
46
        <form name="ItemTypeCreation" method="post" action="onboarding.pl">
54
        <form name="createitemtype" method="post" action="onboarding.pl">
47
            <fieldset class="rows">
55
            <fieldset class="rows">
48
                 <input type="hidden" name="step" value="4"/>
56
                 <input type="hidden" name="step" value="4"/>
49
                 <input type="hidden" name="op" value="add_validate" />
57
                 <input type="hidden" name="op" value="add_validate" />
50
                 <input type="hidden" name="createitemtype" value="createitemtype"/>
51
                    <ol>
58
                    <ol>
52
                        <li>
59
                        <li>
53
                            <label for="itemtype" class="required">Item type: </label>
60
                            <label for="itemtype" class="required">Item type: </label>
54
                            <input type="text" name="surname" id="surname" size="10" maxlength="10" value="" class="required" required="required" />
61
                            <input type="text" name="itemtype" id="itemtype" size="10" maxlength="10"  class="required" required="required" />
55
                            <span class="required">Required</span>
62
                            <span class="required">Required</span>
56
                        </li>
63
                        </li>
57
                        <li>
64
                        <li>
58
                            <label for="description" class="required">Description: </label>
65
                            <label for="description" class="required">Description: </label>
59
                            <input type="text" name="firstname" id="firstname" size="80" value="" class="required" required="required" style="width:200px;">
66
                            <input type="text" name="description" id="description" size="80" value="[% itemtype.description |html %]" class="required" required="required">
60
                            <span class="required">Required</span>
67
                            <span class="required">Required</span>
61
                        </li>
68
                        </li>
62
                    </ol>
69
                    </ol>
63
            </fieldset>
70
            </fieldset><br>
64
            <fieldset>
65
                <input type="submit" class="action" value="Submit"/>
71
                <input type="submit" class="action" value="Submit"/>
66
            </fieldset>
67
     </form>
72
     </form>
68
[% END %]        
73
[% END %]        
69
74
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt (-137 / +31 lines)
Lines 25-36 Link Here
25
[% END %]
25
[% END %]
26
26
27
<!--Create a circulation rule screen 2-->
27
<!--Create a circulation rule screen 2-->
28
[% IF (createcirculationrule) %]
28
[% IF op == "add_validate" %]
29
        <!--New circulation rule created-->
29
        <!--New circulation rule created-->
30
        <form name="finish" method="post" action="onboarding.pl">
30
        <form name="finish" method="post" action="onboarding.pl">
31
              <input type="hidden" name="op" value="finish" />
31
              <input type="hidden" name="op" value="finish" />
32
32
33
            <h1 align="left"> New Item type </h1>
33
            <h1 align="left"> New Circulation rule </h1>
34
34
35
            <div>   
35
            <div>   
36
                 <p> Success: New circulation rule created!</p>
36
                 <p> Success: New circulation rule created!</p>
Lines 38-182 Link Here
38
                 More->Administration->Circulation and Fine Rules 
38
                 More->Administration->Circulation and Fine Rules 
39
            </div>
39
            </div>
40
                 Next up:
40
                 Next up:
41
                 <input type="submit" name="op" value="finish"/>
41
                 <input type="submit" name="op" value="Finish"/>
42
        </form>
42
        </form>
43
            <div>
43
           <!-- <div>
44
                  <p> Oh no! Circulation Rule was not created</p>
44
                  <p> Oh no! Circulation Rule was not created</p>
45
            </div>
45
            </div> -->
46
46
47
47
48
[% ELSE %]    
48
[% ELSE %]    
49
<!--Create a circulation rule screen 1-->
49
<!--Create a circulation rule screen 1-->
50
       <h1 align="left"> New Circulation rule </h2>
50
       <h1 align="left"> Create a new Circulation rule </h2>
51
        <form name="CirculationRuleCreation" method="post" action="onboarding.pl">
51
  
52
       <form name="createcirculationrule" method="post" action="onboarding.pl">
52
            <fieldset class="rows">
53
            <fieldset class="rows">
53
                 <input type="hidden" name="step" value="5"/>
54
                 <input type="hidden" name="step" value="5"/>
54
                 <input type="hidden" name="op" value="add_validate" />
55
                 <input type="hidden" name="op" value="add_validate" />
55
                 <input type="hidden" name="createcirculationrule" value="createcirculationrule"/>
56
                    <ol>
56
                    <ol>
57
                        <li>
57
                    <li>
58
                             <label for="patron_category" class="required">Patron Category: </label>
58
                             <label for="categorycode" class="required">Patron Category: </label>
59
                             <select name="patron_category" id="patron_category">
59
                             <select name="categorycode" id="categorycode" required="required" onchange = "update_categorycode(this);">
60
                                 [% UNLESS category %]
60
                                                   
61
                                     <option value="" selected="selected">Select a patron category type</option>
61
                             [% FOREACH category IN categories %]
62
                                 [% ELSE %]
62
                                <option name="categorycode" value = "[% category.description %]"> [%category.description %]
63
                                     <option value="">Select a patron category type</option>
63
                            [%END%]
64
                                 [% END %]
64
                             </select>
65
66
                                 [% IF category and category.category_type == 'A' %]
67
                                    <option value="A" selected="selected">Adult</option>
68
                                 [% ELSE %]
69
                                    <option value="A">Adult</option>
70
                                 [% END %]
71
72
                                 [% IF category and category.category_type == 'C' %]
73
                                    <option value="C" selected="selected">Child</option>
74
                                 [% ELSE %]
75
                                    <option value="C">Child</option>
76
                                 [% END %]
77
78
                                 [% IF category and category.category_type == 'S' %]
79
                                    <option value="S" selected="selected">Staff</option>
80
                                 [% ELSE %]
81
                                    <option value="S">Staff</option>
82
                                 [% END %]
83
84
                                 [% IF category and category.category_type == 'I' %]
85
                                    <option value="I" selected="selected">Organization</option>
86
                                 [% ELSE %]
87
                                    <option value="I">Organization</option>
88
                                 [% END %]
89
90
                                 [% IF category and category.category_type == 'P' %]
91
                                    <option value="P" selected="selected">Professional</option>
92
                                 [% ELSE %]
93
                                    <option value="P">Professional</option>
94
                                 [% END %]
95
96
                                 [% IF category and category.category_type == 'X' %]
97
                                    <option value="X" selected="selected">Statistical</option>
98
                                 [% ELSE %]
99
                                    <option value="X">Statistical</option>
100
                                 [% END %]
101
                            </select>
102
                        <span class="required">Required</span>
65
                        <span class="required">Required</span>
103
                    </li>
66
                    </li>
104
67
105
                    <li>
68
                    <li>
106
                        <label for="item_type"> Item type: </label>
69
                        <label for="itemtype"> Item type: </label>
107
                        <select id="item_type" name="item_type" required="required">
70
                        <select id="itemtype" name="itemtype" required="required">
108
                              [% UNLESS item_type %]
71
                            [% FOREACH item IN itemtypes %]
109
                                 <option value="" selected="selected">Select a item type</option>
72
                                <option name="itemtype" value = "[% item.itemtype %]"> [% item.itemtype %]
110
                              [% ELSE %]
73
                            [%END%]
111
                                 <option value="">Select a category type</option>
112
                              [% END %]
113
114
                              [% IF item_type and item.item_type == 'Books' %]
115
                                <option value="Books" selected="selected">Books</option>
116
                              [% ELSE %]
117
                                <option value="Books">Books</option>
118
                              [% END %]
119
120
                              [% IF item_type and item.item_type == 'Computer Files' %]
121
                                <option value="Computer Files" selected="selected">Computer Files</option>
122
                              [% ELSE %]
123
                                <option value="Computer Files">Computer Files</option>
124
                              [% END %]
125
126
                              [% IF item_type and item.item_type == 'Continuing Resources' %]
127
                                <option value="Continuing Resources" selected="selected">Continuing Resources</option>
128
                              [% ELSE %]
129
                                <option value="Continuing Resources">Continuing Resources</option>
130
                              [% END %]
131
132
                              [% IF item_type and item.item_type == 'Maps' %]
133
                                <option value="Maps" selected="selected">Maps</option>
134
                              [% ELSE %]
135
                                <option value="Maps">Maps</option>
136
                              [% END %]
137
138
                              [% IF item_type and item.item_type == 'Mixed Materials' %]
139
                                <option value="Mixed Materials" selected="selected">Mixed Materials</option>
140
                              [% ELSE %]
141
                                <option value="Mixed Materials">Mixed Materials</option>
142
                              [% END %]
143
144
                              [% IF item_type and item.item_type == 'Music' %]
145
                                <option value="Music" selected="selected">Music</option>
146
                              [% ELSE %]
147
                                <option value="Music">Music</option>
148
                              [% END %]
149
150
                              [% IF item_type and item.item_type == 'Reference' %]
151
                                <option value="Reference" selected="selected">Reference</option>
152
                              [% ELSE %]
153
                                <option value="Reference">Reference</option>
154
                              [% END %]
155
156
                              [% IF item_type and item.item_type == 'Visual Materials' %]
157
                                <option value="Visual Materials" selected="selected">Visual Materials</option>
158
                              [% ELSE %]
159
                                <option value="Visual Materials">Visual Materials</option>
160
                              [% END %]
161
                            </select>
74
                            </select>
162
                            <span class="required"> Required</span>
75
                            <span class="required"> Required</span>
163
                        </li>
76
                        </li>
164
77
165
                        <li>
78
                        <li>
166
                            <label for="currentcheckoutsallowed" class="required">Current checkouts allowed: </label>
79
                            <label for="maxissueqty" class="required">Current checkouts allowed: </label>
167
                            <input type="text" name="currentcheckoutsallowed" id="currentcheckoutsallowed" size="10" maxlength="10" value="" class="required" required="required" />
80
                            <input type="text" name="maxissueqty" id="maxissueqty" size="10" maxlength="10" value="" class="required" required="required" />
168
                            <span class="required">Required</span>
81
                            <span class="required">Required</span>
169
                        </li>
82
                        </li>
170
                        
83
                        
171
                        <li>
84
                        <li>
172
                             <label for="loanperiod" class="required">Loan Period: </label>
85
                             <label for="issuelength" class="required">Loan Period: </label>
173
                             <input type="text" name="loanperiod" id="loanperiod" size="10" maxlength="10" value="" class="required" required="required" />
86
                             <input type="text" name="issuelength" id="issuelength" size="10" maxlength="10" value="" class="required" required="required" />
174
                              <span class="required">Required</span>
87
                              <span class="required">Required</span>
175
                        </li>
88
                        </li>
176
89
177
                        <li>
90
                        <li>
178
                            <label for="units">Units: </label>
91
                            <label for="lengthunit">Units: </label>
179
                            <select name="units" id="units">
92
                            <select name="lengthunit" id="lengthunit" required="required">
180
                                   [% SET units = 'days' %]
93
                                   [% SET units = 'days' %]
181
94
182
                                   [% 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-->
95
                                   [% 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-->
Lines 208-241 Link Here
208
121
209
                         <li>
122
                         <li>
210
                            <label for="onshelfholds">On shelf holds allowed: </label>
123
                            <label for="onshelfholds">On shelf holds allowed: </label>
211
                            <select name="onshelfholds" id="onshelfholds">
124
                            <select name="onshelfholds" id="onshelfholds" required="required">
212
                                   [% SET onshelfholdsallowed = 'yes' %]
213
214
                                   [% IF category %]
215
                                   [% SET onshelfholdsallowed = category.onshelfholdsallowed %]
216
                                   [% END %]
217
218
                                   [% SWITCH onshelfholdsallowed %]
219
                                   [% CASE 'yes' %]
220
                                     <option value="yes" selected="selected">Yes</option>
125
                                     <option value="yes" selected="selected">Yes</option>
221
                                     <option value="anyunavailable">If any unavailable</option>
126
                                     <option value="anyunavailable">If any unavailable</option>
222
                                     <option value="allunavailable">If all unavailable</option>
127
                                    <option value="allunavailable">If all unavailable</option>
223
                                   [% CASE 'anyunavailable' %]
224
                                     <option value="yes">Yes</option>
225
                                     <option value="anyunavailable" selected="selected">If any unavailable</option>
226
                                     <option value="allunavailable">If all unavailable</option>
227
                                   [% CASE 'allunavailable' %]
228
                                     <option value="yes">Yes</option>
229
                                     <option value="anyunavailable">If any unavailable</option>
230
                                     <option value="allunavailable" selected="selected">If all unavailable</option>
231
                                   [% END %]
232
                            </select>
128
                            </select>
233
                        </li>
129
                        </li>
234
                    </ol>
130
                    </ol>
235
            </fieldset>
131
            </fieldset><br>
236
            <fieldset>
132
                <input type="submit" class="action" value="Submit"/> 
237
                <input type="submit" class="action" value="Submit"/>
238
            </fieldset>
239
     </form>
133
     </form>
240
[% END %]        
134
[% END %]        
241
135
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt (-2 / +1 lines)
Lines 13-19 Link Here
13
    <div id="bd">
13
    <div id="bd">
14
        <div id="yui-main" class="sysprefs">
14
        <div id="yui-main" class="sysprefs">
15
            <div class="yui-g"><h1>Tutorial Summary Page</h1></div>
15
            <div class="yui-g"><h1>Tutorial Summary Page</h1></div>
16
            <fieldset>
16
            <fieldset style="font-size:120%">
17
            <h2>Library</h2>
17
            <h2>Library</h2>
18
            <p> To add another library and for more settings, go to </br>
18
            <p> To add another library and for more settings, go to </br>
19
            More > Administration > Libraries and Groups </p>
19
            More > Administration > Libraries and Groups </p>
20
- 

Return to bug 17855