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

(-)a/installer/onboarding.pl (-99 / +113 lines)
Lines 41-57 use Koha::Token; Link Here
41
use Email::Valid;
41
use Email::Valid;
42
use Module::Load;
42
use Module::Load;
43
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;
54
55
#Setting variables
44
#Setting variables
56
my $input    = new CGI;
45
my $input    = new CGI;
57
my $query    = new CGI;
46
my $query    = new CGI;
Lines 124-130 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
124
113
125
}elsif ( $start && $start eq 'Add an item type' ){
114
}elsif ( $start && $start eq 'Add an item type' ){
126
     my $itemtypes = Koha::ItemTypes->search();
115
     my $itemtypes = Koha::ItemTypes->search();
127
     warn $itemtypes;
128
     $template->param(
116
     $template->param(
129
             itemtypes => $itemtypes,
117
             itemtypes => $itemtypes,
130
    );
118
    );
Lines 139-156 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
139
    my $branchcode       = $input->param('branchcode');
127
    my $branchcode       = $input->param('branchcode');
140
    my $categorycode     = $input->param('categorycode');
128
    my $categorycode     = $input->param('categorycode');
141
    my $op               = $input->param('op') || 'list';
129
    my $op               = $input->param('op') || 'list';
142
    my @messages;
130
    my $message;
143
    my $library;
131
    my $library;
132
#my @messages;
144
133
145
    #Take the text 'branchname' and store it in the @fields array
134
    #Take the text 'branchname' and store it in the @fields array
146
    my @fields = qw(
135
    my @fields = qw(
147
        branchname
136
        branchname
148
    ); 
137
    ); 
149
138
139
140
#test
141
    $template->param('branchcode'=>$branchcode); 
142
150
    $branchcode =~ s|\s||g; # Use a regular expression to check the value of the inputted branchcode 
143
    $branchcode =~ s|\s||g; # Use a regular expression to check the value of the inputted branchcode 
151
144
152
    #Create a new library object and store the branchcode and @fields array values in this new library object
145
    #Create a new library object and store the branchcode and @fields array values in this new library object
153
    my $library = Koha::Library->new(
146
    $library = Koha::Library->new(
154
        {   branchcode => $branchcode, 
147
        {   branchcode => $branchcode, 
155
            ( map { $_ => scalar $input->param($_) || undef } @fields )
148
            ( map { $_ => scalar $input->param($_) || undef } @fields )
156
        }
149
        }
Lines 158-179 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
158
151
159
    eval { $library->store; }; #Use the eval{} function to store the library object
152
    eval { $library->store; }; #Use the eval{} function to store the library object
160
153
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
154
    if($library){
162
    if ($@) {
155
       $message = 'success_on_insert';
163
        push @messages, { type => 'alert', code => 'error_on_insert' };
156
   }else{
164
    } else {
157
       $message = 'error_on_insert';
165
        push @messages, { type => 'message', code => 'success_on_insert' };
158
   }
166
    }
159
160
   $template->param('message' => $message); 
161
167
162
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
163
#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
169
}elsif ( $step && $step == 2 ){
164
}elsif ( $step && $step == 2 ){
165
    my $createcat = $query->param('createcat'); #Store the inputted library branch code and name in $createlibrary
166
    $template->param('createcat'=>$createcat); # Hand the library values back to the template in the createlibrary variable
167
170
168
171
    #Initialising values
169
    #Initialising values
172
    my $input         = new CGI;
170
    my $input         = new CGI;
173
    my $searchfield   = $input->param('description') // q||;
171
    my $searchfield   = $input->param('description') // q||;
174
    my $categorycode  = $input->param('categorycode');
172
    my $categorycode  = $input->param('categorycode');
175
    my $op            = $input->param('op') // 'list';
173
    my $op            = $input->param('op') // 'list';
176
    my @messages;
174
    my $message;
175
    my $category;
177
176
178
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
177
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
179
    {
178
    {
Lines 185-209 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
185
        debug           => 1,
184
        debug           => 1,
186
    }
185
    }
187
    );
186
    );
188
    #When the user first arrives on the page
187
    
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
188
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
189
    #Once the user submits the page, this code validates the input and adds it
205
    #to the database as a new patron category 
190
    #to the database as a new patron category 
206
    elsif ( $op eq 'add_validate' ) {
191
#}  elsif ( $op eq 'add_validate' ) {
192
207
        my $categorycode = $input->param('categorycode');
193
        my $categorycode = $input->param('categorycode');
208
        my $description = $input->param('description');
194
        my $description = $input->param('description');
209
        my $overduenoticerequired = $input->param('overduenoticerequired');
195
        my $overduenoticerequired = $input->param('overduenoticerequired');
Lines 223-229 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
223
            );
209
            );
224
        }
210
        }
225
        #Adds to the database
211
        #Adds to the database
226
        my $category = Koha::Patron::Category->new({
212
        $category = Koha::Patron::Category->new({
227
                categorycode=> $categorycode,
213
                categorycode=> $categorycode,
228
                description => $description,
214
                description => $description,
229
                overduenoticerequired => $overduenoticerequired,
215
                overduenoticerequired => $overduenoticerequired,
Lines 236-248 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
236
            $category->store;
222
            $category->store;
237
        };
223
        };
238
224
239
        #Error messages 
225
        #Error messages
240
        if($@){
226
        if($category){
241
            push @messages, {type=> 'error', code => 'error_on_insert'};
227
            $message = 'success_on_insert';
242
        }else{
228
        }else{
243
            push @messages, {type=> 'message', code => 'success_on_insert'};
229
            $message = 'error_on_insert';
244
        }
230
        }
245
    }
231
232
        $template->param('message' => $message); 
233
246
#Create a patron
234
#Create a patron
247
}elsif ( $step && $step == 3 ){
235
}elsif ( $step && $step == 3 ){
248
236
Lines 258-330 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
258
              ]
246
              ]
259
    );
247
    );
260
248
261
        my $categories;
249
    my $categories;
262
        $categories= Koha::Patron::Categories->search();
250
    $categories= Koha::Patron::Categories->search();
263
        $template->param(
251
    $template->param(
264
                categories => $categories,
252
            categories => $categories,
265
        );
253
    );
266
267
254
268
255
269
    my $input = new CGI;
256
    my $input = new CGI;
270
    my $op = $input->param('op');
257
    my $op = $input->param('op') // 'list';
258
271
    my @messages; 
259
    my @messages; 
272
260
273
    my ($template, $loggedinuser, $cookie)
261
    my ($template, $loggedinuser, $cookie)= get_template_and_user({
274
        = get_template_and_user({
275
                template_name => "/onboarding/onboardingstep3.tt",
262
                template_name => "/onboarding/onboardingstep3.tt",
276
                query => $input,
263
                query => $input,
277
                type => "intranet",
264
                type => "intranet",
278
                authnotrequired => 0,
265
                authnotrequired => 0,
279
                flagsrequired => {borrowers => 1},
266
                flagsrequired => {borrowers => 1},
280
                debug => 1,
267
                debug => 1,
281
        });
268
    });
282
269
283
    if($op eq 'add_form'){
270
    if($op eq 'add_form'){
284
        my $member;
271
        my $member;
285
        $template->param(
272
        $template->param(
286
            member => $member,
273
            member => $member,
287
        );
274
        );
288
289
290
    }
275
    }
276
291
    elsif($op eq 'add_validate'){
277
    elsif($op eq 'add_validate'){
292
        my $surname => $input->param('surname');
278
293
        my $firstname => $input->param('firstname');
279
         my %newdata;
294
        my $cardnumber => $input->param('cardnumber');
280
295
        my $libraries => $input->param('libraries');
281
#Store the template form values in the newdata hash
296
        my $categorycode_entry => $input->param('categorycode_entry');
282
         $newdata{borrowernumber} = $input->param('borrowernumber');
297
        my $userid => $input->param('userid');
283
         $newdata{surname}  = $input->param('surname');
298
        my $password => $input->param('password');
284
         $newdata{firstname}  = $input->param('firstname');
299
        my $password2 =>$input->param('password2');
285
         $newdata{cardnumber} = $input->param('cardnumber');
300
286
         $newdata{branchcode} = $input->param('libraries');
301
        my $member = Koha::Patron->new({
287
         $newdata{categorycode} = $input->param('categorycode_entry');
302
                surname => $surname,
288
         $newdata{userid} = $input->param('userid');
303
                firstname => $firstname,
289
         $newdata{password} = $input->param('password');
304
                cardnumber => $cardnumber,
290
         $newdata{password2} = $input->param('password2');
305
                libraries => $libraries,
291
         $newdata{dateexpiry} = '12/10/2016';
306
                categorycode_entry => $categorycode_entry,
292
307
                userid => $userid,
293
#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
308
                password => $password,
294
        my $borrowernumber = &AddMember(%newdata);
309
                password2 => $password2,
295
        my %member2;
310
        });
296
        $member2{'borrowernumber'}=$borrowernumber;
311
        eval {
297
312
            $member->store;
298
        my $flag = $input->param('flag');
313
        };
299
314
        if($@){
300
        if ($input->param('newflags')) {
301
             my $dbh=C4::Context->dbh();
302
             my @perms = $input->multi_param('flag');
303
             my %all_module_perms = ();
304
             my %sub_perms = ();
305
             foreach my $perm (@perms) {
306
                  if ($perm !~ /:/) {
307
                       $all_module_perms{$perm} = 1;
308
                   } else {
309
                        my ($module, $sub_perm) = split /:/, $perm, 2;
310
                        push @{ $sub_perms{$module} }, $sub_perm;
311
                   }
312
             }
313
314
315
        # construct flags
316
          my $module_flags = 0;
317
          my $sth=$dbh->prepare("SELECT bit,flag FROM userflags ORDER BY bit");
318
          $sth->execute(); 
319
          while (my ($bit, $flag) = $sth->fetchrow_array) {
320
              if (exists $all_module_perms{$flag}) {
321
                   $module_flags += 2**$bit;
322
              }
323
          }
324
325
           $sth = $dbh->prepare("UPDATE borrowers SET flags=? WHERE borrowernumber=?");
326
           $sth->execute($module_flags, $borrowernumber);
327
328
329
#Error handling checking if the patron was created successfully
330
        if(!$borrowernumber){
315
            push @messages, {type=> 'error', code => 'error_on_insert'};
331
            push @messages, {type=> 'error', code => 'error_on_insert'};
316
        }else{
332
         }else{
317
            push @messages, {type=> 'message', code => 'success_on_insert'};
333
            push @messages, {type=> 'message', code => 'success_on_insert'};
318
        }
334
         }
319
320
    }
335
    }
321
322
#Create item type
323
}elsif ( $step && $step == 4){
336
}elsif ( $step && $step == 4){
337
    my $createitemtype = $input->param('createitemtype');
338
    $template->param('createitemtype'=> $createitemtype );
339
324
    my $input = new CGI;
340
    my $input = new CGI;
325
    my $itemtype_code = $input->param('itemtype');
341
    my $itemtype_code = $input->param('itemtype');
326
    my $op = $input->param('op') // 'list';
342
    my $op = $input->param('op') // 'list';
327
    my @messages;
343
    my $message;
328
344
329
    my( $template, $borrowernumber, $cookie) = get_template_and_user(
345
    my( $template, $borrowernumber, $cookie) = get_template_and_user(
330
            {   template_name   => "/onboarding/onboardingstep4.tt",
346
            {   template_name   => "/onboarding/onboardingstep4.tt",
Lines 338-344 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
338
354
339
    if($op eq 'add_form'){
355
    if($op eq 'add_form'){
340
        my $itemtype = Koha::ItemTypes->find($itemtype_code);
356
        my $itemtype = Koha::ItemTypes->find($itemtype_code);
341
        template->param(itemtype=>$itemtype,);
357
        $template->param(itemtype=> $itemtype,);
342
    }elsif($op eq 'add_validate'){
358
    }elsif($op eq 'add_validate'){
343
        my $itemtype = Koha::ItemTypes->find($itemtype_code);
359
        my $itemtype = Koha::ItemTypes->find($itemtype_code);
344
        my $description = $input->param('description');
360
        my $description = $input->param('description');
Lines 351-361 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
351
        );
367
        );
352
        eval{ $itemtype->store; };
368
        eval{ $itemtype->store; };
353
        #Error messages
369
        #Error messages
354
        if($@){
370
        if($itemtype){
355
            push @messages, {type=> 'error', code => 'error_on_insert'};
371
            $message = 'success_on_insert';
356
        }else{
372
        }else{
357
            push @messages, {type=> 'message', code => 'success_on_insert'};
373
            $message = 'error_on_insert';
358
        }
374
        }
375
376
        $template->param('message' => $message); 
359
    }
377
    }
360
378
361
}elsif ( $step && $step == 5){
379
}elsif ( $step && $step == 5){
Lines 381-392 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
381
            flagsrequired=> {parameters => 'manage_circ_rules'},
399
            flagsrequired=> {parameters => 'manage_circ_rules'},
382
            debug =>1,
400
            debug =>1,
383
    });
401
    });
384
    
402
385
    my $type = $input->param('type');
403
    my $type = $input->param('type');
386
    my $branch = $input->param('branch');
404
    my $branch = $input->param('branch');
387
    
405
388
    
406
389
    
407
390
    if($op eq 'add_form'){
408
    if($op eq 'add_form'){
391
409
392
410
Lines 418-434 if ( $start && $start eq 'Start setting up my Koha' ){ Link Here
418
        }else{
436
        }else{
419
            Koha::IssuingRule->new()->set($params)->store(); 
437
            Koha::IssuingRule->new()->set($params)->store(); 
420
            }
438
            }
421
422
   
423
    }
439
    }
424
    
425
426
427
440
441
    my $createcirculationrule = $query->param('createcirculationrule');
442
    $template->param('createcirculationrule'=>$createcirculationrule);
428
}
443
}
429
444
430
445
}
431
432
446
433
output_html_with_http_headers $input, $cookie, $template->output;
447
output_html_with_http_headers $input, $cookie, $template->output;
434
448
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt (-18 / +25 lines)
Lines 52-81 Link Here
52
    <!--Create a library screen 2-->
52
    <!--Create a library screen 2-->
53
[% ELSIF (createlibrary) %]
53
[% ELSIF (createlibrary) %]
54
        <!--New Library created-->
54
        <!--New Library created-->
55
        <form name="createlibrary" method="post" action="onboarding.pl">
55
       [% IF message == "success_on_insert" %] 
56
            <input type="hidden" name="step" value="2"/>
56
            <form name="createlibrary" method="post" action="onboarding.pl">
57
            <h1 align="left"> New Library</h1>
57
                <input type="hidden" name="step" value="2"/>
58
            <div>
58
                <h1 align="left"> New Library</h1>
59
                 <p> Success: Library created!</p>
59
                <div>
60
                 <p> To add another library and for more settings, <br>
60
                    <p> Success: Library created! Your branchcode is [% branchcode %]</p>
61
                go to Tools->Administration->Libraries and Groups
61
                    <p> To add another library and for more settings, <br>
62
            </div>
62
                    go to Tools->Administration->Libraries and Groups
63
            Next up:
63
                </div>
64
            <input type="submit" name="start" value="Add a patron category"/>
64
                Next up:
65
        </form>
65
                <input type="submit" name="start" value="Add a patron category"/>
66
66
            </form>
67
        <!--Implement if statement to determine if library was succesfully created here....-
67
68
        <div>
68
        [%ELSE %]
69
             <p> Library was not successfully created</p>
69
            <!--Implement if statement to determine if library was succesfully created here....-->
70
        </div>
70
            <form name="retrylibrary" method="post" action="onboarding.pl">
71
        -->
71
                <input type="hidden" name="step" value="1"/>
72
                <h1 align="left">Failed </h1>
73
                <div>
74
                    <p> Library was not successfully created</br>
75
                    Please try again or contact your system administrator. </p>
76
                </div>
77
                <input type="submit" value="Try again"/>
78
            </form>
79
        [%END%]
72
[% ELSE %]
80
[% ELSE %]
73
<!--Create a library screen 1-->
81
<!--Create a library screen 1-->
74
        <h2>Create a Library</h2> 
82
        <h2>Create a Library</h2> 
75
        <form name="LibraryCreation" method="post" action="onboarding.pl">
83
        <form name="LibraryCreation" method="post" action="onboarding.pl">
76
            <fieldset class="rows">
84
            <fieldset class="rows">
77
                 <input type="hidden" name="step" value="1"/>
85
                 <input type="hidden" name="step" value="1"/>
78
                 <input type="hidden" name="op" value="add_validate" />
79
                 <input type="hidden" name="createlibrary" value="createlibrary"/>
86
                 <input type="hidden" name="createlibrary" value="createlibrary"/>
80
                 <ol>
87
                 <ol>
81
                     <li>
88
                     <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt (-10 / +20 lines)
Lines 18-23 Link Here
18
     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.");
19
</script>
19
</script>
20
<script type="text/javascript" src="[% themelang %]/js/categories.js"></script>
20
<script type="text/javascript" src="[% themelang %]/js/categories.js"></script>
21
<style type="text/css">#enrolmentmessage.hint { display : none; }</style>
22
21
</head>
23
</head>
22
24
23
<div> <!-- Header that appears at the top of every screen in the koha onboarding tool-->
25
<div> <!-- Header that appears at the top of every screen in the koha onboarding tool-->
Lines 37-54 Link Here
37
     </form>
39
     </form>
38
40
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-->
41
<!--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' %]
42
[% ELSIF op == "add_validate" %]
41
     <form name="createpatroncategory" method="post" action="onboarding.pl">
43
    [% IF message != "error_on_insert" %]
42
             <input type="hidden" name="step" value="3"/>
44
     <form name="createcat" method="post" action="onboarding.pl">
45
          Message is [%message%] 
46
            <input type="hidden" name="step" value="3"/>
43
             <h1 align="left">  New patron category</h1>
47
             <h1 align="left">  New patron category</h1>
44
             <div>
48
             <div>
45
                 <p> Success: Patron category created!</p>
49
                 <p> Success: Patron category created! Your patron category code is [% category.categorycode %] </p>
46
                 <p> To add another patron category and for more settings<br>
50
                 <p> To add another patron category and for more settings<br>
47
                 go to More->Administration->Patrons & Circulation->Patron Categories</p>
51
                 go to More->Administration->Patrons & Circulation->Patron Categories</p>
48
             </div>
52
             </div>
49
             Next up:<br>
53
             Next up:<br>
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-->
54
             <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-->
51
     </form>
55
     </form>
56
     [% ELSE %]
57
        <form name="retrypatcat" method="post" action="onboarding.pl">
58
        Message is [% message %]    
59
        <input type="hidden" name="step" value="2"/>
60
            <h1 align="left">Failed</h1>
61
            <div>Patron Category was not successfully created.</br>
62
            Please try again or contact your system administrator.</p>
63
            </div>
64
            <input type="submit" value="Try again"/>
65
        </form>
66
    [% END %] 
67
        
52
68
53
[% ELSE %] <!--Else display create patron category screen 1 where the user can input values to create their first patron category-->
69
[% ELSE %] <!--Else display create patron category screen 1 where the user can input values to create their first patron category-->
54
    <h1 align="left"> Create a new Patron Category</h2>
70
    <h1 align="left"> Create a new Patron Category</h2>
Lines 85-96 Link Here
85
                    <li>
101
                    <li>
86
                        <label for="category_type" class="required">Category type: </label>
102
                        <label for="category_type" class="required">Category type: </label>
87
                        <select name="category_type" value="category_type" class='required' required='required'>
103
                        <select name="category_type" value="category_type" class='required' required='required'>
88
                            [% UNLESS category %]
89
                                <option value="" selected="selected">Select a category type</option>
90
                            [% ELSE %]
91
                                <option value="">Select a category type</option>
92
                            [% END %]
93
94
                            [% IF category and category.category_type == 'A' %]
104
                            [% IF category and category.category_type == 'A' %]
95
                                <option value="A" selected="selected">Adult</ option>
105
                                <option value="A" selected="selected">Adult</ option>
96
                            [% ELSE %]
106
                            [% ELSE %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt (-11 / +21 lines)
Lines 30-36 Link Here
30
        <form name="patrondone" method="post" action="onboarding.pl">
30
        <form name="patrondone" method="post" action="onboarding.pl">
31
            <input type="hidden" name="step" value="4"/>
31
            <input type="hidden" name="step" value="4"/>
32
            <h1 align="left"> New Patron </h1>
32
            <h1 align="left"> New Patron </h1>
33
34
            <div>   
33
            <div>   
35
                 <p> Success: New patron created!</p>
34
                 <p> Success: New patron created!</p>
36
                 <p> To create another patron, go to Patrons > New Patron. <br>
35
                 <p> To create another patron, go to Patrons > New Patron. <br>
Lines 54-60 Link Here
54
                    <h3>Patron Identity</h3> 
53
                    <h3>Patron Identity</h3> 
55
                        <li>
54
                        <li>
56
                            <label for="surname" class="required">Surname: </label>
55
                            <label for="surname" class="required">Surname: </label>
57
                            <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="0"  value="[% surname %]" class="required" required="required" />
56
57
                            <input type="text" id="surname" name="surname"  value="[% surname %]" class="required" required="required" />
58
                            <span class="required">Required</span>
58
                            <span class="required">Required</span>
59
                        </li>
59
                        </li>
60
                        <li>
60
                        <li>
Lines 74-83 Link Here
74
                        <li>
74
                        <li>
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-->
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-->
76
                            <label for="libraries" class="required"> Library: </label>
76
                            <label for="libraries" class="required"> Library: </label>
77
                            <select name="branchcode" size="1" id="libraries">
77
                            <select name="libraries" size="1" id="libraries">
78
78
79
                             [% FOREACH library IN libraries %]
79
                             [% FOREACH library IN libraries %]
80
                                  <option value="[% library.branchcode %]"> [% library.branchname %]
80
                                  <option name="libraries" value="[% library.branchcode %]"> [% library.branchname %]
81
                             [% END %]
81
                             [% END %]
82
                                    
82
                                    
83
                                </select>
83
                                </select>
Lines 85-99 Link Here
85
                        </li>
85
                        </li>
86
                        <li>
86
                        <li>
87
                            <label for="categorycode_entry" class="required"> Patron Category</label>
87
                            <label for="categorycode_entry" class="required"> Patron Category</label>
88
                            <select id="categorycode_entry" name="categorycode" onchange="update_category_code(this);">
88
                            <select id="categorycode_entry" name="categorycode_entry" onchange="update_category_code(this);">
89
                           [% FOREACH category IN categories %]
89
                           [% FOREACH category IN categories %] 
90
                                <option value = "[% category.description %]"> [%category.description %] 
90
                                <option name="categorycode_entry" value = "[% category.categorycode %]"> [%category.categorycode %]</option>
91
                            [% END %]
91
                           [% END %]
92
                            </select>
92
                            </select>
93
                            <span class="required">Required</span>
93
                            <span class="required">Required</span>
94
                        </li> 
94
                        </li> 
95
                    </ol>
95
                    </ol>
96
                     <ol>
96
                    
97
                    <ol>
98
                    
99
                            <h3> Patron permissions</h3>
100
                            <input type="hidden" name="newflags" value="1"/>
101
                            <li>
102
                                <input type="hidden" class="flag parent" id="flag-0" name="flag" value="superlibrarian"/>
103
                                <label name="permissioncode" for="flag-0"> superlibrarian</label>
104
                            </li>                    
105
                    </ol>
106
                    <ol>
97
                    <h3>OPAC/Staff Login</h3> 
107
                    <h3>OPAC/Staff Login</h3> 
98
                        <li>
108
                        <li>
99
                            <label for="userid" class="required">Username: </label>
109
                            <label for="userid" class="required">Username: </label>
Lines 101-108 Link Here
101
                            <span class="required">Required</span>
111
                            <span class="required">Required</span>
102
                        </li>
112
                        </li>
103
                        <li>
113
                        <li>
104
                            <label for="password" class="required">Password: </label>
114
                            <label for="passwordlabel" class="required">Password: </label>
105
                            <input type="password" name="password" id="password" size="20" value="[% password %]" class="required" required="required">
115
                            <input type="password" name="password" id="password" size="20" value="[% member.password |html %]" class="required" required="required">
106
                            <span class="required">Required</span>
116
                            <span class="required">Required</span>
107
                        </li>
117
                        </li>
108
                        <li>
118
                        <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt (-19 / +28 lines)
Lines 20-26 Link Here
20
20
21
[% IF itemtypes.count > 0 %]
21
[% IF itemtypes.count > 0 %]
22
    <br>
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>
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>
24
     <form name="skipitemtype" method="post" action="onboarding.pl">
26
     <form name="skipitemtype" method="post" action="onboarding.pl">
25
          <input type="hidden" name="step" value="5"/>
27
          <input type="hidden" name="step" value="5"/>
26
          <div>
28
          <div>
Lines 32-57 Link Here
32
<!--Create a item type screen 2-->
34
<!--Create a item type screen 2-->
33
[% ELSIF op == "add_validate" %]
35
[% ELSIF op == "add_validate" %]
34
        <!--New item type created-->
36
        <!--New item type created-->
35
        <form name="createitemtype" method="post" action="onboarding.pl">
37
        [% IF message != "error_on_insert" %]
36
            <input type="hidden" name="step" value="5"/>
38
            <form name="createitemtype" method="post" action="onboarding.pl">
37
            <h1 align="left"> New Item type </h1>
39
                <input type="hidden" name="step" value="5"/>
38
40
                <h1 align="left"> New Item type </h1>
39
            <div>   
41
40
                 <p> Success: New item type created!</p>
42
                <div>   
41
                 <p> To create another item type later and for more setttings <br>
43
                    <p> Success: New item type created!</p>
42
                 go to More->Administration->Item types 
44
                    <p> To create another item type later and for more setttings <br>
43
            </div>
45
                    go to More->Administration->Item types 
44
                 Next up:
46
                </div>
45
                 <input type="submit" value="Add a circulation rule"/>
47
                     Next up:
46
        </form>
48
                    <input type="submit" value="Add a circulation rule"/>
49
            </form>
50
        [% ELSE %]
51
            <form name="retryitem" method="post" action="onboarding.pl">
52
                <input type="hidden" name="step" value="4"/>
53
                <h1 align="left">Failed </h1>
54
                <div>
55
                    <p>Item type was not successfully created. </br>
56
                    Please try again or contact your system administrator. </p>
57
                    </div>
58
            </form> 
47
          <!--Implement a if statement to check if the item type was successfully created or not
59
          <!--Implement a if statement to check if the item type was successfully created or not
48
            <div>
60
-->     [% END %]
49
                  <p> Oh no! Patron was not created</p>
50
            </div>-->
51
[% ELSE %]    
61
[% ELSE %]    
52
<!--Create a item type screen 1-->
62
<!--Create a item type screen 1-->
53
       <h1 align="left"> Create a new Item type </h2>
63
       <h1 align="left"> Create a new Item type </h2>
54
        <form name="createitemtype" method="post" action="onboarding.pl">
64
        <form name="createitemform" method="post" action="onboarding.pl">
55
            <fieldset class="rows">
65
            <fieldset class="rows">
56
                 <input type="hidden" name="step" value="4"/>
66
                 <input type="hidden" name="step" value="4"/>
57
                 <input type="hidden" name="op" value="add_validate" />
67
                 <input type="hidden" name="op" value="add_validate" />
Lines 63-69 Link Here
63
                        </li>
73
                        </li>
64
                        <li>
74
                        <li>
65
                            <label for="description" class="required">Description: </label>
75
                            <label for="description" class="required">Description: </label>
66
                            <input type="text" name="description" id="description" size="80" value="[% itemtype.description |html %]" class="required" required="required">
76
                            <input type="text" name="description" id="description" size="42" value="[% itemtype.description |html %]" class="required" required="required">
67
                            <span class="required">Required</span>
77
                            <span class="required">Required</span>
68
                        </li>
78
                        </li>
69
                    </ol>
79
                    </ol>
70
- 

Return to bug 17855