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

(-)a/installer/onboarding.pl (-5 / +25 lines)
Lines 143-150 elsif ( $start && $start eq 'Minimal item type setup' ) { Link Here
143
    $template->param( itemtypes => $itemtypes, );
143
    $template->param( itemtypes => $itemtypes, );
144
}
144
}
145
elsif ( $step && $step == 1 ) {
145
elsif ( $step && $step == 1 ) {
146
    my $createlibrary = $input->param('createlibrary'); #Store the inputted library branch code and name in $createlibrary variable
146
    my $createlibrary = $input->param('createlibrary')
147
    $template->param( 'createlibrary' => $createlibrary ); # Hand the library values back to the template in the createlibrary variable
147
      ; #Store the inputted library branch code and name in $createlibrary variable
148
    $template->param( 'createlibrary' => $createlibrary )
149
      ; # Hand the library values back to the template in the createlibrary variable
148
150
149
    #store inputted parameters in variables
151
    #store inputted parameters in variables
150
    my $branchcode = $input->param('branchcode');
152
    my $branchcode = $input->param('branchcode');
Lines 160-166 elsif ( $step && $step == 1 ) { Link Here
160
    );
162
    );
161
163
162
    $template->param( 'branchcode' => $branchcode );
164
    $template->param( 'branchcode' => $branchcode );
163
    $branchcode =~ s|\s||g; # Use a regular expression to check the value of the inputted branchcode
165
    $branchcode =~ s|\s||g
166
      ; # Use a regular expression to check the value of the inputted branchcode
164
167
165
#Create a new library object and store the branchcode and @fields array values in this new library object
168
#Create a new library object and store the branchcode and @fields array values in this new library object
166
    my $library = Koha::Library->new(
169
    my $library = Koha::Library->new(
Lines 182-188 elsif ( $step && $step == 1 ) { Link Here
182
#Check if the $step variable equals 2 i.e. the user has clicked to create a patron category in the create patron category screen 1
185
#Check if the $step variable equals 2 i.e. the user has clicked to create a patron category in the create patron category screen 1
183
}
186
}
184
elsif ( $step && $step == 2 ) {
187
elsif ( $step && $step == 2 ) {
185
    my $createcat = $input->param('createcat');    #Store the inputted category code and name in $createcat
188
    my $createcat = $input->param('createcat')
189
      ;    #Store the inputted category code and name in $createcat
186
    $template->param( 'createcat' => $createcat );
190
    $template->param( 'createcat' => $createcat );
187
191
188
    #Initialising values
192
    #Initialising values
Lines 306-311 elsif ( $step && $step == 3 ) { Link Here
306
    my $borrowernumber = $input->param('borrowernumber');
310
    my $borrowernumber = $input->param('borrowernumber');
307
    my $userid         = $input->param('userid');
311
    my $userid         = $input->param('userid');
308
312
313
    # function to designate mandatory fields (visually with css)
314
    my $check_BorrowerMandatoryField =
315
      C4::Context->preference("BorrowerMandatoryField");
316
    my @field_check = split( /\|/, $check_BorrowerMandatoryField );
317
    foreach (@field_check) {
318
        $template->param( "mandatory$_" => 1 );
319
        $template->param(
320
            BorrowerMandatoryField =>
321
              C4::Context->preference("BorrowerMandatoryField")
322
            ,    #field to test with javascript
323
        );
324
    }
325
309
 #If the entered cardnumber causes an error hand this error to the @errors array
326
 #If the entered cardnumber causes an error hand this error to the @errors array
310
    if ( my $error_code = checkcardnumber( $cardnumber, $borrowernumber ) ) {
327
    if ( my $error_code = checkcardnumber( $cardnumber, $borrowernumber ) ) {
311
        push @errors,
328
        push @errors,
Lines 649-654 elsif ( $step && $step == 5 ) { Link Here
649
            );
666
            );
650
            $sth_search->execute($branch);
667
            $sth_search->execute($branch);
651
            my $res = $sth_search->fetchrow_hashref();
668
            my $res = $sth_search->fetchrow_hashref();
669
652
            if ( $res->{total} ) {
670
            if ( $res->{total} ) {
653
                $sth_update->execute( $onshelfholds, $branch );
671
                $sth_update->execute( $onshelfholds, $branch );
654
            }
672
            }
Lines 665-671 elsif ( $step && $step == 5 ) { Link Here
665
        if ($issuingrule) {
683
        if ($issuingrule) {
666
            $issuingrule->set($params)->store();
684
            $issuingrule->set($params)->store();
667
            push @messages,
685
            push @messages,
668
              { type => 'error', code => 'error_on_insert'
686
              {
687
                type => 'error',
688
                code => 'error_on_insert'
669
              }; #Stops crash of the onboarding tool if someone makes a circulation rule with the same item type, library and patron categroy as an exisiting circulation rule.
689
              }; #Stops crash of the onboarding tool if someone makes a circulation rule with the same item type, library and patron categroy as an exisiting circulation rule.
670
690
671
        }
691
        }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt (-37 / +32 lines)
Lines 13-65 Link Here
13
13
14
<!--jQuery scripts for creating patron-->
14
<!--jQuery scripts for creating patron-->
15
<script type-"text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
15
<script type-"text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
16
<script type="text/javascipt">
16
17
        var MSG_DUPLICATE_PATRON = _("Warning: Duplicate patron");
17
<script type="text/javascript">
18
        var MSG_PASSWORD_MISMATCH = _("The passwords entered do not match");
18
 var MSG_CATEGORYCODE_CHARS=(_("Please only enter letters into this field."));
19
        var MSG_PASSWORD_CONTAINS_TRAILING_SPACES = _("Password contains leading and/or trailing spaces.");
19
 var MSG_PASSWORD_MISMATCH=(_("The entered passwords do not match, please rewrite them"));
20
function check_password(password){
20
 </script>
21
    if(password.match(/^\s/) || password.match(/\s$/)){
21
22
        return false;
22
<script type="text/javascript">
23
    }return true;
23
jQuery.validator.addMethod( "password_match", function(value,element){
24
}
24
        var MSG_PASSWORD_MISMATCH = (_("The passwords entered do not match"));
25
        var password = document.getElementById('password').value
26
        var confirmpassword = document.getElementById('password2').value
27
28
        if ( password != confirmpassword ){
29
               return false;
30
          }
31
          else{
32
               return true
33
          }
34
    },  MSG_PASSWORD_MISMATCH
35
);
36
37
25
38
26
$(document).ready(function(){
39
$(document).ready(function(){
27
     $("#createpatron").validate({
40
41
    $("#Submit").click(function(){
42
        $("#createpatron").validate({
28
         rules: {
43
         rules: {
29
            borrowernumber: {
30
                 required: true,
31
                 digits: true
32
             },
33
            surname:{
34
                required: true,
35
                letters: true
36
            },
37
            firstname:{
38
                required:true,
39
                letters:true
40
            },
41
            userid: {
42
                required: true;
43
                letters_numbers: true
44
            },
45
            password: {
44
            password: {
46
                 letters_numbers: true
45
                 password_match:true
47
            },
46
            }
48
         },
47
         },
49
         messages: {
48
         messages: {
50
             password: {
49
             password: {
51
                 required: MSG_PASSWORD_MISMATCH
50
                 required: MSG_PASSWORD_MISMATCH
52
             },
51
             },
53
             userid: {
54
                 required: MSG_DUPLICATE_PATRON
55
             }
56
         }
52
         }
57
53
58
     });
54
     });
59
55
});
60
})
56
});
61
</script>
57
</script>
62
<script type="text/javascript" src="[% interface %]/[% theme %]/js/members.js"></script>
63
</head>
58
</head>
64
59
65
<div>
60
<div>
Lines 118-124 $(document).ready(function(){ Link Here
118
        <p>
113
        <p>
119
        Now we will create a patron with superlibrarian permissions. Login with this to access Koha as a staff member will all permissions.
114
        Now we will create a patron with superlibrarian permissions. Login with this to access Koha as a staff member will all permissions.
120
        </p>
115
        </p>
121
        <form name="createpatron" method="post" action="onboarding.pl">
116
        <form name="createpatron" id="createpatron" method="post" action="onboarding.pl">
122
            <fieldset class="rows">
117
            <fieldset class="rows">
123
                 <input type="hidden" name="step" value="3"/>
118
                 <input type="hidden" name="step" value="3"/>
124
                 <input type="hidden" name="op" value="add_validate" />
119
                 <input type="hidden" name="op" value="add_validate" />
Lines 179-184 $(document).ready(function(){ Link Here
179
                    <ol>
174
                    <ol>
180
                    <h3>OPAC/Staff Login</h3>
175
                    <h3>OPAC/Staff Login</h3>
181
                        <li>
176
                        <li>
177
                            <input type="hidden" name="BorrowerMandatoryField" value = [% BorrowerMandatoryField %] />
182
                            <label for="userid" class="required">Username: </label>
178
                            <label for="userid" class="required">Username: </label>
183
                            <input type="text" name="userid" id ="userid" pattern="[A-Za-z1-9 ]+" title="Please only enter letters or numbers into this username field" size="20" value="[% userid %]" class="required" required="required" />
179
                            <input type="text" name="userid" id ="userid" pattern="[A-Za-z1-9 ]+" title="Please only enter letters or numbers into this username field" size="20" value="[% userid %]" class="required" required="required" />
184
                            <span class="required">Required</span>
180
                            <span class="required">Required</span>
Lines 195-200 $(document).ready(function(){ Link Here
195
                        </li>
191
                        </li>
196
                    </ol>
192
                    </ol>
197
             </fieldset><br>
193
             </fieldset><br>
198
                <input type="submit" class="action" value="Submit"/>
194
                <input type="submit" id="Submit" class="action" value="Submit"/>
199
     </form>
195
     </form>
200
[% END %]
196
[% END %]
201
- 

Return to bug 17855