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

(-)a/koha-tmpl/intranet-tmpl/prog/css/installer.css (+229 lines)
Line 0 Link Here
1
body {
2
    background-color: #EEE;
3
    text-align: left;
4
    font-family: arial, verdana, helvetica, sans-serif;
5
}
6
7
h1 {
8
    font-size: 161.6%;
9
    font-weight: bold;
10
}
11
12
h2 {
13
    background-color: #eee;
14
    border-radius: 4px;
15
    font-size: 146.5%;
16
    font-weight: bold;
17
    text-shadow: 1px 1px 0px #FFF;
18
    padding: .5em;
19
}
20
21
h3 {
22
    color: #003366;
23
    font-size: 131%;
24
    font-weight: bold;
25
}
26
27
hr {
28
    margin-top: .5em;
29
    margin-bottom: .5em;
30
}
31
32
.installer-main {
33
    background-color: #FFF;
34
    border-radius: 5px;
35
    margin-top: 3%;
36
    margin-bottom: 3%;
37
    padding: 1em;
38
    -webkit-box-shadow: 0px 2px 2px 0px rgba(50, 50, 50, 0.5);
39
    -moz-box-shadow:    0px 2px 2px 0px rgba(50, 50, 50, 0.5);
40
    box-shadow:         0px 2px 2px 0px rgba(50, 50, 50, 0.5);
41
}
42
43
ul, ol { padding: 5px 5px 5px 20px; }
44
45
#logo {
46
    background: url(../img/koha-logo.gif) no-repeat top center;
47
    margin-top: 0;
48
    margin-bottom: .5em;
49
}
50
51
#logo a {
52
    display: block;
53
    text-indent: -1000px;
54
    height: 74px;
55
    border-bottom: none;
56
}
57
58
.bg-danger {
59
    padding: .2em .4em;
60
}
61
62
.step a, .step input { font-size: 2em; }
63
64
td input { font-size: 1.5em; }
65
66
.step, th { text-align: right; }
67
68
#bloc25, .bloc25 {
69
        float:left;
70
        border:1px solid #000000;
71
        margin:0px;
72
        padding:0px;
73
74
}
75
76
#footer {
77
        text-align: center;
78
        border-top: 1px solid #ccc;
79
        padding-top: 1em;
80
        font-style: italic;
81
}
82
83
.update_error {
84
        color: red;
85
        font-weight: bold;
86
}
87
88
.checkbox {
89
    margin-bottom: 1em;
90
}
91
92
fieldset.rows {
93
    border-width: 0;
94
    float: left;
95
    font-size: 90%;
96
    clear: left;
97
    margin: .9em 0 0 0;
98
    padding: 0;
99
    width: 100%;
100
}
101
102
fieldset.rows legend {
103
    border: 0;
104
    margin-left: 1em;
105
    font-weight: bold;
106
    font-size: 110%;
107
    margin-bottom: 0;
108
}
109
110
fieldset.rows label,
111
fieldset.rows span.label {
112
    float: left;
113
    font-weight: bold;
114
    width: 9em;
115
    margin-right: 1em;
116
    text-align: right;
117
}
118
119
fieldset.rows span.label {
120
    display: inline;
121
    padding: .2em .6em .3em;
122
    font-size: inherit;
123
    font-weight: bold;
124
    line-height: 1;
125
    color: inherit;
126
    text-align: right;
127
    white-space: normal;
128
    vertical-align: baseline;
129
    border-radius: 0;
130
}
131
132
fieldset.rows fieldset {
133
    background-color: transparent;
134
    border-width: 1px;
135
    margin: 1em;
136
    padding: .3em;
137
}
138
139
fieldset.rows ol {
140
    padding: 1em 1em 0 1em;
141
    list-style-type: none;
142
}
143
144
fieldset.rows li {
145
    float: left;
146
    clear: left;
147
    padding-bottom: 1em;
148
    list-style-type: none;
149
    width: 100%;
150
}
151
152
fieldset.rows .hint {
153
    margin-left: 10.5em;
154
    margin-right: 4em;
155
    margin-top: .5em;
156
    font-size: 96%;
157
    color: #666;
158
}
159
160
fieldset.rows label.error {
161
    color: #cc0000;
162
    float: none;
163
    margin-left: 1em;
164
    width: auto;
165
}
166
167
fieldset.rows ol {
168
    padding: 0 1em 0 1em;
169
}
170
171
172
label.required,
173
span.required {
174
    color : #C00;
175
}
176
177
span.required {
178
    font-style : italic;
179
    margin-left : .5em;
180
}
181
182
.breadcrumbs {
183
    background-color: #e6f0f2;
184
    margin: 1em 0;
185
    padding: .4em 2em;
186
}
187
188
/* Override core jQueryUI widgets */
189
.ui-widget-content { border: 1px solid #B9D8D9; background: #ffffff none; color: #222222; }
190
.ui-widget-header { border: 1px solid #B9D8D9; background: #E6F0F2 none; color: #222222; font-weight: bold; }
191
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #B9D8D9; background: #F4F8F9 none; font-weight: normal; color: #555555; }
192
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #B9D8D9; background: #E6F0F2 none; font-weight: normal; color: #212121; }
193
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff none; font-weight: normal; color: #212121; }
194
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight  {border: 1px solid #FED22F; background: #FFF4C6; color: #363636; }
195
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec; color: #cd0a0a; }
196
197
.ui-widget,
198
.ui-widget input,
199
.ui-widget select,
200
.ui-widget textarea,
201
.ui-widget button {
202
    font-family : inherit;
203
    font-size : inherit;
204
}
205
206
/* jQuery UI Datepicker */
207
.ui-datepicker table {
208
    width: 100%;
209
    font-size: .9em;
210
    border : 0;
211
    border-collapse: collapse;
212
    margin:0 0 .4em;
213
}
214
215
.ui-datepicker th {
216
    background : transparent none;
217
    padding: .7em .3em;
218
    text-align: center;
219
    font-weight: bold;
220
    border: 0;
221
}
222
223
.ui-datepicker-trigger {
224
    vertical-align: middle;
225
    margin : 0 3px;
226
}
227
.ui-datepicker {
228
    box-shadow: 1px 1px 3px 0 #666;
229
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc (-78 / +1 lines)
Lines 2-93 Link Here
2
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
2
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
3
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.css" />
3
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.css" />
4
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/bootstrap/bootstrap.min.css" />
4
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/bootstrap/bootstrap.min.css" />
5
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/font-awesome/css/font-awesome.min.css" />
5
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/installer.css" />
6
<link rel="stylesheet" type="text/css" media="print" href="[% interface %]/[% theme %]/css/print.css" />
7
<style type="text/css" media="screen">
8
9
[% IF ( login ) %]
10
    @import url([% interface %]/[% theme %]/css/login.css);
11
[% END %]
12
13
html { background: #eee; }
14
15
body {
16
        background: #fff;
17
        color: #000;
18
        font-family: Georgia, "Times New Roman", Times, serif;
19
        margin-left: 20%;
20
        margin-right: 20%;
21
        padding: .2em 2em;
22
}
23
24
h1 {
25
        color: #006;
26
        font-size: 2em;
27
        font-weight: normal;
28
        vertical-align:middle;
29
}
30
31
h2 { font-size: 1.75em; }
32
33
h3 {
34
        color: #006;
35
        font-size: 1.5em;
36
        font-weight: lighter;
37
}
38
39
p, li, dt {
40
        line-height: 140%;
41
        padding-bottom: 2px;
42
}
43
44
ul, ol { padding: 5px 5px 5px 20px; }
45
46
#logo { margin-bottom: 2em; }
47
48
.step a, .step input { font-size: 2em; }
49
50
td input { font-size: 1.5em; }
51
52
.step, th { text-align: right; }
53
54
#bloc25, .bloc25 {
55
        float:left;
56
        border:1px solid #000000;
57
        margin:0px;
58
        padding:0px;
59
60
}
61
62
#footer {
63
        text-align: center;
64
        border-top: 1px solid #ccc;
65
        padding-top: 1em;
66
        font-style: italic;
67
}
68
69
.update_error {
70
        color: red;
71
        font-weight: bold;
72
}
73
74
</style>
75
6
76
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-2.2.3.min.js"></script>
7
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-2.2.3.min.js"></script>
77
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min.js"></script>
8
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min.js"></script>
78
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.js"></script>
9
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.js"></script>
79
<script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script>
80
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
81
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.highlight-3.js"></script>
82
<script type="text/javascript" src="[% interface %]/lib/bootstrap/bootstrap.min.js"></script>
10
<script type="text/javascript" src="[% interface %]/lib/bootstrap/bootstrap.min.js"></script>
83
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.validate.min.js"></script>
11
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.validate.min.js"></script>
84
<!-- koha core js -->
85
<script type="text/javascript" src="[% interface %]/[% theme %]/js/staff-global.js"></script>
86
87
<script type="text/javascript">
12
<script type="text/javascript">
88
    //<![CDATA[
13
    //<![CDATA[
89
        function _(s) { return s } // dummy function for gettext
14
        function _(s) { return s } // dummy function for gettext
90
    //]]>
15
    //]]>
91
</script>
16
</script>
92
</head>
93
<body id="installer" class="installer">
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/installer-strings.inc (+7 lines)
Line 0 Link Here
1
<script type="text/javascript">
2
    var MSG_LETTERS_ONLY=(_("Please only enter letters."));
3
    var MSG_PASSWORD_MISMATCH=(_("The entered passwords do not match"));
4
    var MSG_ONE_ENROLLMENTPERIOD =(_("Please choose an enrollment period in months OR by date."));
5
    var MSG_ONLY_ONE_ENROLLMENTPERIOD=(_("Please only choose one enrollment period."));
6
    var MSG_LETTERS_NUMBERS_ONLY=(_("Please only enter letters or numbers."));
7
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/auth.tt (-41 / +52 lines)
Lines 1-52 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; 
3
<title>Koha &rsaquo;
4
    [% IF ( nopermission ) %]Access denied[% END %]
4
    [% IF ( nopermission ) %]Access denied[% END %]
5
    [% IF ( timed_out ) %]Session timed out[% END %]
5
    [% IF ( timed_out ) %]Session timed out[% END %]
6
    [% IF ( different_ip ) %]IP address change[% END %]
6
    [% IF ( different_ip ) %]IP address change[% END %]
7
    [% IF ( invalid_username_or_password ) %]Invalid username or password[% END %]
7
    [% IF ( invalid_username_or_password ) %]Invalid username or password[% END %]
8
    [% IF ( loginprompt ) %]Log in to Koha[% END %]
8
    [% IF ( loginprompt ) %]Log in to the Koha web installer[% END %]
9
</title>
9
</title>
10
10
11
[% INCLUDE 'installer-doc-head-close.inc' %]
11
[% INCLUDE 'installer-doc-head-close.inc' %]
12
<div id="login">
13
<h1><a>Koha [%- Koha.Version.release -%] installer</a></h1>
14
[% IF ( nopermission ) %]
15
<div id="login_error"><strong>Error: </strong>Unauthorized user <a href="/cgi-bin/koha/mainpage.pl?logout.x=1">click to log out</a></div>
16
[% END %]
17
18
[% IF ( timed_out ) %]
19
<div id="login_error"><strong>Error: </strong>Session timed out, please log in again</div>
20
[% END %]
21
22
[% IF ( different_ip ) %]
23
<div id="login_error"><strong>Error: </strong>IP address has changed, please log in again </div>
24
[% END %]
25
26
[% IF ( invalid_username_or_password ) %]
27
<div id="login_error"><strong>Error: </strong>Invalid username or password</div>
28
[% END %]
29
30
[% IF ( loginprompt ) %]
31
<!-- login prompt time-->
32
<form action="/cgi-bin/koha/installer/install.pl" method="post" name="mainform" id="mainform">
33
[% FOREACH INPUT IN INPUTS %]
34
    <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]" />
35
[% END %]
36
<h3>Welcome to the Koha web installer</h3>
37
<p>Before we begin, please verify you have the correct credentials to continue. Please log in
38
with the username and password given to you by your systems administrator and located in your
39
<code>koha-conf.xml</code> configuration file.</p>
40
<p>Please enter your username and password:</p>
41
<p><label>Username:<br />
42
<input type="text" name="userid" id="userid" class="input" value="[% userid %]" size="20" tabindex="1" /></label>
43
</p>
44
<p><label>Password:<br />
45
<input type="password" name="password" id="password" class="input" value="" size="20" tabindex="2" /></label>
46
</p>
47
<p class="submit"><input id="submit" type="submit" value="Login" tabindex="4" /></p>
48
</form>
49
50
[% END %]
51
12
13
<div class="container-fluid">
14
    <div class="row">
15
        <div id="installer-login" class="installer-main col-sm-6 col-sm-offset-3 col-md-6 col-md-offset-3">
16
17
            <h1 id="logo"><a href="#">Koha</a></h1>
18
19
            [% IF ( nopermission ) %]
20
                <div id="login_error"><strong>Error: </strong>Unauthorized user <a href="/cgi-bin/koha/mainpage.pl?logout.x=1">click to log out</a></div>
21
            [% END %]
22
23
            [% IF ( timed_out ) %]
24
            <div id="login_error"><strong>Error: </strong>Session timed out, please log in again</div>
25
            [% END %]
26
27
            [% IF ( different_ip ) %]
28
            <div id="login_error"><strong>Error: </strong>IP address has changed, please log in again </div>
29
            [% END %]
30
31
            [% IF ( invalid_username_or_password ) %]
32
            <div id="login_error"><strong>Error: </strong>Invalid username or password</div>
33
            [% END %]
34
35
            [% IF ( loginprompt ) %]
36
                <h2>Welcome to the Koha [%- Koha.Version.release -%] web installer</h2>
37
38
                <p>Before we begin, please verify you have the correct credentials to continue. Please log in with the username and password given to you by your systems administrator and located in your <code>koha-conf.xml</code> configuration file.</p>
39
40
                <form action="[% url %]" method="post" role="form" id="mainform">
41
                    [% FOREACH INPUT IN INPUTS %]
42
                        <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]" />
43
                    [% END %]
44
45
                    <fieldset>
46
                        <legend>Please enter your username and password</legend>
47
48
                        <div class="form-group">
49
                            <label>Username:</label>
50
                            <input type="text" class="form-control" name="userid" id="userid" value="[% userid %]" size="20" tabindex="1" />
51
                        </div>
52
                        <div class="form-group">
53
                            <label>Password:</label>
54
                            <input type="password" class="form-control" name="password" id="password" value="" size="20" tabindex="2" />
55
                        </div>
56
                        <input id="submit" type="submit" class="btn btn-primary" value="Log in" tabindex="3" /></p>
57
                    </fieldset>
58
                </form>
59
            [% END %]
60
        </div>
61
    </div>
62
</div>
52
[% INCLUDE 'intranet-bottom.inc' %]
63
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt (-76 / +92 lines)
Lines 1-82 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Web installer &rsaquo; Step 1</title>
2
<title>Koha &rsaquo; Web installer &rsaquo;
3
[% INCLUDE 'installer-doc-head-close.inc' %]
3
    [% UNLESS ( language ) %] Choose your language [% END %]
4
<div>
4
    [% IF ( language ) %]
5
<h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif" /> Web installer &rsaquo; Step 1</h1>
5
        [% UNLESS ( checkmodule ) %]
6
[% UNLESS ( language ) %]
6
            [% IF ( missing_modules ) %]
7
<p>You are about to install Koha.</p>
7
                Perl modules missing
8
9
<p>Please pick your language from the following list. If your language is not
10
listed, please inform your systems administrator.</p>
11
<form name="language" method="post">
12
<select name="language">
13
[% IF ( installer_languages_loop ) %]
14
        [% FOREACH installer_languages_loo IN installer_languages_loop %]
15
            [% IF ( installer_languages_loo.plural ) %]
16
            <optgroup label="[% installer_languages_loo.language %]">
17
            [% FOREACH sublanguages_loo IN installer_languages_loo.sublanguages_loop %]
18
                <option value="[% sublanguages_loo.rfc4646_subtag %]">[% IF ( sublanguages_loo.native_description ) %][% sublanguages_loo.native_description %][% ELSE %][% sublanguages_loo.rfc4646_subtag %][% END %]</option>
19
            [% END %]
8
            [% END %]
20
            </optgroup>
9
            [% IF ( problems ) %]
21
            [% ELSE %]
10
                Perl version obsolete
22
		<option value="[% installer_languages_loo.rfc4646_subtag %]">[% IF ( installer_languages_loo.native_description ) %][% installer_languages_loo.native_description %][% ELSE %][% installer_languages_loo.rfc4646_subtag %][% END %]</option>
23
            [% END %]
11
            [% END %]
24
        [% END %]
12
        [% END %]
25
[% END %]
13
        Check Perl dependencies
26
</select>
27
</p>
28
29
<p> Click 'Next' to continue <input value="Next &gt;&gt;" type="submit" /></p>
30
</form>
31
[% END %]
32
[% IF ( language ) %]
33
  [% IF ( checkmodule ) %]
34
  <p>All required Perl modules appear to be installed.<br />
35
  [% ELSE %]
36
  [% IF ( missing_modules ) %]
37
  <p><b>Warning: </b>Some Perl modules are missing.<br />Modules in red must be installed before you may continue.<br />
38
  <ul>
39
  [% FOREACH missing_module IN missing_modules %]
40
    [% IF ( missing_module.require ) %]
41
    <li style="color:#FF0000;font-weight:bold;">[% missing_module.name %]
42
    [% ELSE %]
43
    <li>[% missing_module.name %]
44
    [% END %]
14
    [% END %]
45
      <br /> Version: [% missing_module.version %]
15
</title>
46
      <br /> Usage: [% missing_module.usage %]
16
[% INCLUDE 'installer-doc-head-close.inc' %]
47
    </li>
17
48
  [% END %]
18
<div class="container-fluid">
49
  [% END %]
19
    <div class="row">
50
  [% IF ( problems ) %]
20
        <div id="installer-step1" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2">
51
  <p>I encountered some problems.</p>
21
52
   <ul>
22
            <h1 id="logo"><a href="#">Koha</a></h1>
53
    [% IF ( perlversion ) %]
23
54
    <li>Your Perl version seems to be obsolete.
24
            [% UNLESS ( language ) %]
55
      Please upgrade to a newer version of Perl (at least Version 5.10).</li>
25
                <h2>Web installer &rsaquo; Choose your language</h2>
56
    [% END %]
26
                <p>You are about to install Koha.</p>
57
   </ul>
27
58
  [% END %]
28
                <p>Please pick your language from the following list. If your language is not listed, please inform your system administrator.</p>
59
  [% END %]
29
60
<form name="checkmodules" action="install.pl">
30
                <form name="language" role="form" method="post" action="install.pl">
61
[% IF ( checkmodule ) %]
31
                    <div class="form-group">
62
[% IF (op == 'noop') %]
32
                        <label for="language">Select a language: </label>
63
<input type="hidden" name="step" value="2" />
33
                        <select id="language" name="language">
64
[% ELSE %]
34
                            [% IF ( installer_languages_loop ) %]
65
<input type="hidden" name="step" value="3" />
35
                                [% FOREACH installer_languages_loo IN installer_languages_loop %]
66
<input type="hidden" name="op" value="[% op %]" />
36
                                    [% IF ( installer_languages_loo.plural ) %]
67
<input type="hidden" name="checkmodule" value="[% checkmodule %]"/>
37
                                        <optgroup label="[% installer_languages_loo.language %]">
68
[% END %]
38
                                            [% FOREACH sublanguages_loo IN installer_languages_loo.sublanguages_loop %]
69
<p> All dependencies installed.</p>
39
                                                <option value="[% sublanguages_loo.rfc4646_subtag %]">[% IF ( sublanguages_loo.native_description ) %][% sublanguages_loo.native_description %][% ELSE %][% sublanguages_loo.rfc4646_subtag %][% END %]</option>
70
<p>Please click 'Next' to continue <input value="Next &gt;&gt;" type="submit" /></p>
40
                                            [% END %]
71
[% ELSE %]
41
                                        </optgroup>
72
[% IF (op == 'noop') %]
42
                                    [% ELSE %]
73
<input type="hidden" name="step" value="1" />
43
                                        <option value="[% installer_languages_loo.rfc4646_subtag %]">[% IF ( installer_languages_loo.native_description ) %][% installer_languages_loo.native_description %][% ELSE %][% installer_languages_loo.rfc4646_subtag %][% END %]</option>
74
[% ELSE %]
44
                                    [% END %]
75
<input type="hidden" name="step" value="1" />
45
                                [% END %]
76
<input type="hidden" name="op" value="[% op %]" />
46
                            [% END %]
77
[% END %]
47
                        </select>
78
<p>Click to recheck dependencies <input value="Recheck" type="submit" /></p>
48
                    </div>
79
[% END %]
49
80
</form>
50
                    <p><input value="Continue to the next step" class="btn btn-primary" type="submit" /></p>
81
[% END %]
51
                </form>
52
            [% END %]
53
54
            [% IF ( language ) %]
55
                [% UNLESS ( checkmodule ) %]
56
                    [% IF ( missing_modules ) %]
57
                        <h2>Web installer &rsaquo; Perl modules missing</h2>
58
                        <p>Some Perl modules are missing. <span class="label label-danger">Required</span> modules <b>must</b> be installed before you may continue.<br />
59
                        <ul>
60
                            [% FOREACH missing_module IN missing_modules %]
61
                                <li><strong>[% missing_module.name %]</strong> [% IF ( missing_module.require ) %]<span class="label label-danger">Required</span>[% END %]
62
                                    <br /> Version: [% missing_module.version %]
63
                                    <br /> Usage: [% missing_module.usage %]
64
                                </li>
65
                            [% END %]
66
                        </ul>
67
                    [% END %]
68
69
                    [% IF ( problems ) %]
70
                        <h2>Web installer &rsaquo; Perl version too old</h2>
71
                        <p>I encountered some problems.</p>
72
                        <ul>
73
                            [% IF ( perlversion ) %]
74
                                <li>Your Perl version is out of date. Please upgrade to a newer version of Perl (at least version 5.10).</li>
75
                            [% END %]
76
                        </ul>
77
                    [% END %]
78
79
                    <form name="checkmodules" role="form" action="install.pl">
80
                        <input type="hidden" name="step" value="1" />
81
                        <p> <input value="Recheck dependencies" class="btn btn-primary" type="submit" /></p>
82
                    </form>
83
84
                [% ELSE # IF checkmodule %]
85
                    <h2>Web installer &rsaquo; Check Perl dependencies</h2>
86
                    <p>All required Perl modules appear to be installed.</p>
87
                    <p> All dependencies installed.</p>
88
89
                    <form name="checkmodules" role="form" action="install.pl">
90
                        <input type="hidden" name="step" value="2" />
91
                        <p> <input value="Continue to the next step" class="btn btn-primary" type="submit" /> </p>
92
                    </form>
93
                [% END # IF checkmodule%]
94
            [% END # IF language %]
95
        </div>
96
    </div>
97
82
[% INCLUDE 'intranet-bottom.inc' %]
98
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt (-61 / +68 lines)
Lines 1-63 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]<title>Koha &rsaquo; Web installer &rsaquo; Step 2</title>
1
[% INCLUDE 'doc-head-open.inc' %]<title>Koha &rsaquo; Web installer &rsaquo; Database settings</title>
2
[% INCLUDE 'installer-doc-head-close.inc' %]
2
[% INCLUDE 'installer-doc-head-close.inc' %]
3
<div>
3
4
<h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif" /> Web installer &rsaquo; Step 2</h1>
4
<div class="container-fluid">
5
<h2 align="center">Database settings:</h2>
5
    <div class="row">
6
<ul>
6
        <div id="installer-step2" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2">
7
<li><em>database type : </em>[% dbms %]</li>
7
8
<li><em>database name : </em>[% dbname %]</li>
8
            <h1 id="logo"><a href="#">Koha</a></h1>
9
<li><em>database host : </em>[% hostname %]</li>
9
            <h2>Web installer &rsaquo; Database settings</h2>
10
<li><em>database port : </em>[% port %] (probably OK if blank)</li>
10
            <h3>Database settings:</h3>
11
<li><em>database user : </em>[% user %]</li>
11
            <ul>
12
</ul>
12
                <li><em>Database type : </em> <code>[% dbms %]</code></li>
13
<div>
13
                <li><em>Database name : </em> <code>[% dbname %]</code></li>
14
[% IF ( dbconnection ) %]
14
                <li><em>Database host : </em> <code>[% hostname %]</code></li>
15
<form name="checkdbparameters" type="post" action="install.pl">
15
                <li><em>Database port : </em> <code>[% port %]</code> (probably okay if blank)</li>
16
  [% IF ( checkdatabaseaccess ) %]
16
                <li><em>Database user : </em> <code>[% user %]</code></li>
17
  <p>Connection established.</p>
17
            </ul>
18
     [% IF ( checkdatabasecreated ) %]
18
19
  <p>Database <code>[% dbname %]</code> exists.</p>
19
            [% IF ( dbconnection ) %]
20
        [% IF ( checkgrantaccess ) %]
20
                <form name="checkdbparameters" role="form" type="post" action="install.pl">
21
  <p>User <code>[% user %]</code> has all required privileges on database <code>[% dbname %]</code>.</p>
21
                    [% IF ( checkdatabaseaccess ) %]
22
        [% ELSE %]
22
                        <div class="alert alert-success" role="alert"><p>Connection established.</p></div>
23
  <p class="error">user <code>[% user %]</code> doesn't have enough privilege on database <code>[% dbname %]</code></p>
23
                        [% IF ( checkdatabasecreated ) %]
24
  <p class="tip">Ask for or make a change in the user's privileges. Need help? See
24
                            <ul>
25
    [% IF dbms == 'mysql' %]<a href="https://dev.mysql.com/doc/refman/5.5/en/grant.html">
25
                                <li>Database <code>[% dbname %]</code> exists.</li>
26
    [% ELSE %]<a href="http://www.postgresql.org/docs/8.2/interactive/sql-createrole.html">
26
                            [% IF ( checkgrantaccess ) %]
27
    [% END %]this page</a>.
27
                                <li>User <code>[% user %]</code> has all required privileges on database <code>[% dbname %]</code>.</li>
28
  </p>
28
                                </ul>
29
  <p class="tip">
29
                            [% ELSE %]
30
    User <code>[% user %]</code> must have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on <code>[% dbname %]</code>
30
                                </ul>
31
  </p>
31
                                <p class="error">user <code>[% user %]</code> doesn't have enough privilege on database <code>[% dbname %]</code> </p>
32
        [% END %]
32
                                <p class="tip"> Ask for or make a change in the user's privileges. Need help? See [% IF ( mysql ) %]
33
      [% ELSE %]
33
                                        <a href="http://dev.mysql.com/doc/refman/4.1/en/grant.html">
34
  <p class="error">No database named <code>[% dbname %]</code> detected.</p>
34
                                    [% ELSE %]
35
  <p class="tip">Please create the database before continuing.</p>
35
                                        <a href="http://www.postgresql.org/docs/8.2/interactive/sql-createrole.html">
36
      [% END %]
36
                                    [% END %]
37
   [% ELSE %]
37
                                    this page</a>. User <code>[% user %]</code> must have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on <code>[% dbname %]</code>
38
    <div class="error">[% error %] : [% message %]
38
                                </p>
39
                            [% END %]
40
                        [% ELSE %]
41
                            <div class="alert alert-danger" role="alert"><p>No database named <code>[% dbname %]</code> detected.</p></div>
42
                            <p>Please create the database before continuing.</p>
43
                        [% END %]
44
                    [% ELSE %]
45
                        <div class="alert alert-warning" role="alert">[% error %] : [% message %]</div>
46
                        <div class="tip">
47
                            <ul>
48
                                <li>Check that your database is running.</li>
49
                                <li>Check your database settings in <code>koha-conf.xml</code>. </li>
50
                                <li>Check the hostname setting in <code>koha-conf.xml</code>.
51
                                Some database servers require <code>127.0.0.1</code> rather than <code>localhost</code>.</li>
52
                            </ul>
53
                        </div>
54
                        <p>Please correct these errors and <a href="/cgi-bin/koha/installer/install.pl">start the installer</a> again.
55
                    [% END %]
56
                    [% UNLESS ( error ) %]
57
                        <input type="hidden" name="step" value="3" />
58
                        <p> <input value="Continue to the next step" class="btn btn-primary" type="submit" /> </p>
59
                    [% END %]
60
                </form>
61
            [% ELSE %]
62
                <form name="checkinformation" role="form" type="post" action="install.pl">
63
                    <input type="hidden" name="step" value="2" />
64
                    <input type="hidden" name="checkdb" value="1" />
65
                    <p> <input value="Continue to the next step" class="btn btn-primary" type="submit" /> </p>
66
                </form>
67
            [% END %]
68
        </div>
39
    </div>
69
    </div>
40
    <div class="tip">
70
[% INCLUDE 'intranet-bottom.inc' %]
41
      <ul>
42
      <li>Check that your database is running.</li>
43
      <li>Check your database settings in <code>koha-conf.xml</code>. </li>
44
      <li>Check the hostname setting in <code>koha-conf.xml</code>. 
45
      Some database servers require <code>127.0.0.1</code> rather than <code>localhost</code>.</li>
46
    </div>
47
    <p>Please correct these errors and <a href="/cgi-bin/koha/installer/install.pl">start the installer</a> again.
48
  [% END %]
49
  [% IF ( error ) %][% ELSE %]
50
<input type="hidden" name="step" value="3" />
51
<p> Click 'Next' to continue <input value="Next &gt;&gt;" type="submit" /></p>
52
[% END %]
53
</form>
54
[% ELSE %]
55
<form name="checkinformation" type="post" action="install.pl">
56
<input type="hidden" name="step" value="2" />
57
<input type="hidden" name="checkdb" value="1" />
58
<p> Please click 'Next' to continue if this information is correct <input value="Next &gt;&gt;" type="submit" /></p>
59
</form>
60
[% END %]
61
</div>
62
</body>
63
</html>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt (-281 / +220 lines)
Lines 1-311 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]<title>Koha &rsaquo; Web installer &rsaquo; Step 3</title>
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/installer/onboarding.pl">[% END %]
2
<title>Koha &rsaquo; Web installer &rsaquo;
3
    [% IF ( proposeimport ) %]
4
        Set up database
5
    [% END %]
6
    [% IF ( importdatastructure ) %]
7
        [% IF ( error ) %]
8
            Error creating database tables
9
        [% ELSE %]
10
            Database tables created
11
        [% END %]
12
    [% END %]
13
    [% IF ( default ) %]
14
        [% IF ( upgrading ) %]
15
            Update database
16
        [% ELSE %]
17
            Install basic configuration settings
18
        [% END %]
19
    [% END %]
20
    [% IF ( choosemarc ) %]
21
        Select your MARC flavor
22
    [% END %]
23
    [% IF ( selectframeworks ) %]
24
        Selecting default settings
25
    [% END %]
26
</title>
27
[% IF ( finish ) %]<meta http-equiv="refresh" content="5; url=/cgi-bin/koha/installer/onboarding.pl">[% END %]
3
[% INCLUDE 'installer-doc-head-close.inc' %]
28
[% INCLUDE 'installer-doc-head-close.inc' %]
4
<div>
5
<h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif" /> Koha web  installer &rsaquo; Step 3</h1>
6
7
[% IF ( selectframeworks ) %]
8
    <script type="text/javascript">
9
//<![CDATA[
10
11
var surl = unescape(window.location.pathname);
12
29
13
function doLoad()
30
<div class="container-fluid">
14
{
31
    <div class="row">
15
    // the timeout value should be the same as in the "refresh" meta-tag
32
        <div id="installer-step3" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2">
16
    setTimeout( "refresh()", 2*1000 );
17
}
18
33
19
function refresh(value)
34
            <h1 id="logo"><a href="#">Koha</a></h1>
20
{
21
    //  The argument to the location.reload function determines
22
    //  if the browser should retrieve the document from the
23
    //  web-server.  In our example all we need to do is cause
24
    //  the JavaScript block in the document body to be
25
    //  re-evaluated.  If we needed to pull the document from
26
    //  the web-server again (such as where the document contents
27
    //  change dynamically) we would pass the argument as 'true'.
28
    //
29
    surl=surl+'?step=3&op=selectframeworks&fwklanguage='+value;
30
35
31
    window.location.replace( surl );
36
            [% IF ( finish ) %]
32
}
37
                <h2>Web installer &rsaquo; Installation complete</h2>
33
38
                <h3>Congratulations, installation complete</h3>
34
function selectAllFrameworks()
39
                <p>
35
{
40
                    If this page does not redirect in 5 seconds, <a href="/cgi-bin/koha/installer/onboarding.pl">Start onboarding process</a>.
36
    //  A handy short link that selects all available checkboxes
41
                </p>
37
    //  on the page.
42
            [% END %]
38
    //
39
    var checkboxes = document.getElementsByTagName("input");
40
    for (var i = 0; i < checkboxes.length; i++)
41
    {
42
        if (checkboxes[i].type == 'checkbox')
43
        {
44
            checkboxes[i].checked = true;
45
        }
46
    }
47
48
    //  Prevent event propergation.
49
    return false;
50
}
51
52
function Hide(link)
53
{
54
    //  Toggle the display of a given element on the page.
55
    //
56
    subfield = document.getElementById('bloc'+link);
57
    var initstyle = subfield.style.display;
58
    if (initstyle == 'block') subfield.style.display = 'none' ;
59
    if (initstyle == 'none') subfield.style.display = 'block' ;
60
}
61
43
62
//]]>
63
</script>
64
[% END %]
65
44
45
            [% IF ( choosemarc ) %]
46
                <h2>Choose your setup</h2>
47
                <p>Basic setup selects recommended settings by default.</p>
48
                <form name="frameworkselection" method="post" action="install.pl">
49
                    <input type="hidden" name="step" value="3" />
50
                    <input type="hidden" name="op" value="selectframeworks"/>
51
52
                    <p>
53
                        <label><input type="radio" name="setup" value="Basic" checked="checked" /> Basic</label>
54
                    </p>
55
                    <p>
56
                        <label><input type="radio" name="setup" value="Advanced"/> Advanced</label>
57
                    </p>
58
59
                    <h2>Select your MARC flavor</h2>
60
                    <p>MARC stands for Machine Readable Cataloging, containing information about a bibliographic record. MARC21 is used globally, whereas UNIMARC tends to be used in Europe. </p>
61
62
                    [% FOREACH flavourloo IN flavourloop %]
63
                        [% IF ( flavourloo.label == "Unimarc") %]
64
                             <p>
65
                                 <label><input type="radio" name="marcflavour" value="[% flavourloo.code %]" /> [% flavourloo.label %]</label>
66
                             </p>
67
                        [% ELSE %]
68
                             <p>
69
                                 <label><input type="radio" name="marcflavour" value="[% flavourloo.code %]" checked="checked" /> [% flavourloo.label %]</label>
70
                             </p>
71
                        [% END %]
72
                    [% END %]
73
                    <p><input value="Continue to the next step" class="btn btn-primary" type="submit" /> </p>
74
                </form>
75
            [% END # / IF choosemarc %]
66
76
67
[% IF ( finish ) %]
77
            [% IF ( selectframeworks ) %]
68
    <h1>Congratulations, installation complete</h1>
78
                <h2>Web installer &rsaquo; [% setup %] setup &rsaquo; Selecting default settings</h2>
69
    <p>If this page does not redirect in 10 seconds, click <a href="/cgi-bin/koha/installer/onboarding.pl">Start onboarding process</a>.</p>
70
[% END %]
71
79
80
                [% IF setup == "Advanced" %]
81
                    <p id="selectall"><a href="#">Select all sample data</a></p>
82
                [% END %]
72
83
73
[% IF ( choosemarc ) %]
84
                <form name="frameworkselection" method="post" action="install.pl">
74
    <h2 align="center">Choose your setup</h2>
85
                    <input type="hidden" name="step" value="3" />
75
    <p>Basic setup selects recommended settings by default.</p>
86
                    <input type="hidden" name="op" value="addframeworks" />
76
    <form name="frameworkselection" method="post" action="install.pl">
87
                    [% IF ( frameworksloop ) %]
77
    <input type="hidden" name="step" value="3" />
88
                        <h3>MARC frameworks: [% marcflavour %]</h3>
78
    <input type="hidden" name="op" value="selectframeworks"/>
89
                        [% IF ( en_marc_frameworks ) %]
90
                            <h4><span class="error">No MARC frameworks are available for your language.
91
                                Defaulting to the frameworks supplied for English (en)<span></h4>
92
                        [% END %]
93
                        [% FOREACH frameworksloo IN frameworksloop %]
94
                            <h4>[% frameworksloo.label %]</h4>
95
                            [% FOREACH framework IN frameworksloo.frameworks %]
96
                                <div class="checkbox">
97
                                    <label>
98
                                        [% IF (frameworksloo.label == "Default") && (setup=="Basic") %]
99
                                            <input type="hidden" name="framework" value="[% framework.fwkfile %]" id ="[%framework.fwkname%]" />
100
                                        [% ELSE %]
101
                                            <input type="checkbox" name="framework" value="[% framework.fwkfile %]" id ="[%framework.fwkname%]" />
102
                                        [% END %]
103
                                        [% framework.fwkdescription %]
104
                                        <em>([% framework.fwkname %])</em>
105
                                    </label>
106
                                </div>
107
                                <hr />
108
                            [% END # / FOREACH framework %]
109
                       [% END # / FOREACH frameworksloo %]
110
                    [% END # / IF frameworkdsloop %]
111
112
                    <h2>Other data</h2>
113
114
                    [% IF ( en_sample_data ) %]
115
                        <h4><span class="error">No sample data and settings are available for your language.
116
                                Defaulting to the samples supplied for English (en)<span></h4>
117
                    [% END %]
79
118
80
    <div>
119
                    [% FOREACH levelloo IN levelloop %]
81
        <input type="radio" name="setup" value="Basic" checked="checked">Basic<br/>
120
                        <h4>[% levelloo.label %]</h4>
82
        <input type="radio" name="setup" value="Advanced"/>Advanced<br/>
83
    </div>
84
121
85
    <h2 align="center">Select your MARC flavor</h2>
122
                        [% IF (setup == "Basic" && levelloo.label == "Optional") %]
86
    <p>MARC stands for Machine Readable Cataloging, containing information about a bibliographic record. MARC21 is more commonly used globally, whereas UNIMARC tends to be used in Europe. </p>
123
                            <p id="selectall"><a href="#">Select all sample data</a></p>
124
                        [% END %]
87
125
88
    [% FOREACH flavourloo IN flavourloop %]
126
                        [% FOREACH framework IN levelloo.frameworks %]
89
    <div>
127
                            <div class="checkbox">
90
            [% IF ( flavourloo.label == "Unimarc") %]
128
                                <label for="[% framework.fwkname %]">
91
                 <input type="radio" name="marcflavour" value="[% flavourloo.code %]" /> [% flavourloo.label %]<br/>
129
                                    [% IF (levelloo.label == "Default" ) && (setup=="Basic")%]
92
            [% ELSE %]
130
                                         <input type="hidden" name="framework" value="[% framework.fwkfile %]" id="[%framework.fwkname %]" />
93
                 <input type="radio" name="marcflavour" value="[% flavourloo.code %]" checked="checked" /> [% flavourloo.label %] <br/>
131
                                    [% ELSE %]
94
            [% END %]
132
                                         <input type="checkbox" name="framework" value="[%framework.fwkfile %]" id="[%framework.fwkname%]"/>
95
    </div>
133
                                    [% END %]
96
    [% END %]
134
                                    [% framework.fwkdescription %]
135
                                    <em>([% framework.fwkname %])</em>
136
                                </label>
137
                            </div> <!-- /div.checkbox -->
138
                        [% END # / FOREACH framework %]
139
                    [% END # / FOREACH levelloo %]
97
140
98
        <p>Click 'Next' to continue <input value="Next &gt;&gt;" type="submit" /></p>
141
                    <p>When you've made your selections, please click 'Import' below to begin the process. It may take a while to complete,
142
                    please be patient.</p>
99
143
100
    </form>
144
                    <p><input type="submit" value="Import" class="btn btn-primary" /></p>
145
                </form>
146
            [% END # / IF selectframeworks %]
101
147
102
[% END %]
148
            [% IF ( addframeworks ) %]
149
                <h2>Web installer &rsaquo; Default data loaded</h2>
103
150
104
[% IF ( selectframeworks ) %]
151
                [% FOREACH lis IN list %]
105
        <h2 align= "center"> [% setup %] setup</h2>
152
                    <h3>[% lis.level FILTER ucfirst %] data added</h3>
106
        <h2 align="center">Selecting Default Settings</h2>
107
153
108
        [% IF setup == "Advanced" %]
154
                    <ul>
109
            <script type="text/javascript">
155
                        [% FOREACH fwklis IN lis.fwklist %]
110
                var linklabel = _("Select all options");
111
                document.write('<p><a href="#" onclick="return selectAllFrameworks();"><button>'+linklabel+'</button></a></p>');
112
            </script>
113
        [% END %]
114
        <form name="frameworkselection" method="post" action="install.pl">
115
            <input type="hidden" name="step" value="3" />
116
            <input type="hidden" name="op" value="addframeworks" />
117
    [% IF ( frameworksloop ) %]
118
        <h2>MARC frameworks: [% marcflavour %]</h2>
119
        [% IF ( en_marc_frameworks ) %]
120
            <h4><span class="error">No MARC frameworks are available for your language.
121
                    Defaulting to the frameworks supplied for English (en)<span></h4>
122
        [% END %]
123
        [% FOREACH frameworksloo IN frameworksloop %]
124
           <div>
125
           <h3>[% frameworksloo.label %]</h3>
126
           [% FOREACH framework IN frameworksloo.frameworks %]
127
                <table style="border:1px;vertical-align:top;">
128
                <tr>
129
                    <td style = "border:1px; vertical-align:top;">
130
                        [% IF (frameworksloo.label == "Default") && (setup=="Basic") %]
131
                            <input type="hidden" name="framework" value="[% framework.fwkfile %]" id ="[%framework.fwkname%]" />
132
                        [% ELSE %]
133
                            <input type="checkbox" name="framework" value="[% framework.fwkfile %]" id ="[%framework.fwkname%]" />
134
                        [% END %]
135
                    </td>
136
                    <td>
137
                    [% IF (frameworksloo.label == "Default") && (setup=="Basic") %]
138
                        <ul>
139
                            <li>
156
                            <li>
140
                                <label for="[% framework.fwkname %]">
157
                                [% fwklis.fwkname %]
141
                                    [% framework.fwkdescription %]
158
                                [% IF ( fwklis.error ) %]<p class="bg-danger">[% fwklis.error %]</p>[% END %]
142
                                    <em>([% framework.fwkname %])</em>
143
                                </label>
144
                            </li>
159
                            </li>
145
                        </ul>
160
                        [% END %]
146
                    </td>
161
                    </ul>
147
                    [% ELSE %]
148
                    <td>
149
                        <label for= "[% framework.fwkname %]">
150
                            [% framework.fwkdescription %]
151
                            <em>([% framework.fwkname %])</em>
152
                        </label>
153
                    </td>
154
                    [% END %]
155
                </tr>
156
                </table>
157
           [% END %]
158
           </div>
159
        [% END %]
160
    <h2>Other data</h2>
161
    [% END %]
162
    [% IF ( en_sample_data ) %]
163
        <h4><span class="error">No sample data and settings are available for your language.
164
                Defaulting to the samples supplied for English (en)<span></h4>
165
    [% END %]
166
    [% FOREACH levelloo IN levelloop %]
167
        <div>
168
        <h3>[% levelloo.label %]</h3>
169
170
        [% IF (setup == "Basic" && levelloo.label == "Optional") %]
171
            <script type="text/javascript">
172
                var linklabel = _("Select all options");
173
                document.write('<p><a href="#" onclick="return selectAllFrameworks();"><button>'+linklabel+'</button></a></p>');
174
            </script>
175
        [% END %]
176
177
        [% FOREACH framework IN levelloo.frameworks %]
178
            <table style="border:1px;vertical-align:top;">
179
            <tr>
180
                <td style="vertical-align:top;">
181
                [% IF (levelloo.label == "Default" ) && (setup=="Basic")%]
182
                     <input type="hidden" name="framework" value="[% framework.fwkfile %]" id="[%framework.fwkname %]" />
183
                [% ELSE %]
184
                     <input type="checkbox" name="framework" value="[%framework.fwkfile %]" id="[%framework.fwkname%]"/>
185
                [% END %]
162
                [% END %]
186
                </td>
163
187
                <td>
164
                <h3>All done!</h3>
188
                [% IF (levelloo.label == "Default") && (setup=="Basic")%]
165
                <p>Installation complete.</p>
189
                <ul>
166
                <form action="/cgi-bin/koha/installer/install.pl" method="post" name="finish">
190
                    <li>
167
                    <input type="hidden" name="step" value="3" />
191
                        <label for="[% framework.fwkname %]">
168
                    <input type="hidden" name="op" value="finish" />
192
                            [% framework.fwkdescription %]
169
                    <p> <input value="Set up some of Koha's basic requirements" class="btn btn-primary" type="submit" /> </p>
193
                            <em>([% framework.fwkname %])</em>
170
                </form>
194
                        </label>
171
195
                    </li>
172
            [% END # / IF addframeworks %]
196
                </ul>
173
197
                </td>
174
            [% IF ( importdatastructure ) %]
175
                [% IF ( error ) %]
176
                    <p>The following error occurred while importing the database structure:</p>
177
                                <div class="alert alert-warning"><p>[% error %] </p></div>
178
                    <p>Please contact your system administrator</p>
198
                [% ELSE %]
179
                [% ELSE %]
199
                <td>
180
                    <h2>Web installer &rsaquo; Success</h2>
200
                    <label for= "[% framework.fwkname %]">
181
                    <div class="alert alert-success"><p>Database tables created</p></div>
201
                        [% framework.fwkdescription %]
182
                    <form action="install.pl" method="post">
202
                        <em>([% framework.fwkname %])</em>
183
                        <input type="hidden" name="step" value="3" />
203
                    </label>
184
                        <p> <input value="Continue to the next step" class="btn btn-primary" type="submit" /> </p>
204
                </td>
185
                    </form>
205
                [% END %]
186
                [% END %]
206
            </tr>
187
            [% END %]
207
            </table>
208
        [% END %]
209
        </div>
210
    [% END %]
211
    <p>When you've made your selections, please click 'Import' below to begin the process. It may take a while to complete,
212
    please be patient.</p>
213
    <p><input type="submit" value="Import &gt;&gt;" />
214
    </p>
215
    </form>
216
[% END %]
217
218
219
[% IF ( addframeworks ) %]
220
    [% FOREACH lis IN list %]
221
    <h3>[% lis.level %] data added</h3>
222
    <ul>
223
    [% FOREACH fwklis IN lis.fwklist %]
224
        <li>[% fwklis.fwkname %][% IF ( fwklis.error ) %]<br /><span class="error">[% fwklis.error %]</span>[% END %] </li>
225
    [% END %]
226
    </ul>
227
    [% END %]
228
    <h3>All done!</h3>
229
    <p>Installation complete.<br />
230
        <p>Click on 'Set up Koha with the onboarding tool' to complete and load the Koha onboarding tool.
231
        <form name="finish">
232
        <input type="hidden" name="step" value="3" />
233
        <input type="hidden" name="op" value="finish" />
234
        <input type="submit" value="Set up Koha with the onboarding tool"/>
235
        </form>
236
        </p>
237
    </p>
238
[% END %]
239
240
188
241
[% IF ( importdatastructure ) %]
189
            [% IF ( proposeimport ) %]
242
    [% IF ( error ) %]
190
                <h2>Web installer &rsaquo; Set up database</h2>
243
        <p>The following error occurred while importing the database structure:</p>
191
                <p>Now we're ready to create the database tables and fill them with some default data.</p>
244
        <p class="error">[% error %] </p>
192
                <form action="install.pl" method="post">
245
        <p>Please contact your system administrator</p>
193
                    <input type="hidden" name="step" value="3" />
246
    [% ELSE %]
194
                    <input type="hidden" name="op" value="importdatastructure" />
247
        <h2 align="center">Success</h2>
195
                    <p><input value="Continue to the next step" class="btn btn-primary" type="submit" /></p>
248
        <ul>
196
                </form>
249
        <li>Database tables created</li>
197
            [% END %]
250
        </ul>
251
        <form action="install.pl">
252
        <input type="hidden" name="step" value="3" />
253
            <p> Click 'Next' to continue <input value="Next &gt;&gt;" type="submit" /></p>
254
        </form>
255
    [% END %]
256
[% END %]
257
198
199
            [% IF ( default ) %]
200
                [% IF ( upgrading ) %]
201
                    <h2>Web installer &rsaquo; Update database</h2>
202
                    <p>We are upgrading from Koha [% dbversion %] to [% kohaversion %]</p>
203
                    <p><a href="install.pl?step=3&amp;op=updatestructure" class="btn btn-primary">Update your database</a></p>
204
                [% ELSE %]
205
                    <h2>Web installer &rsaquo; Install basic configuration settings</h2>
206
                    <p>We are ready to do some basic configuration.</p>
207
                    <p> <a href="install.pl?step=3&amp;op=choosemarc" class="btn btn-primary">Continue to the next step</a> </p>
208
                [% END %]
209
            [% END %]
258
210
259
[% IF ( proposeimport ) %]
211
            [% IF ( updatestructure ) %]
260
    <p>Now we're ready to create the database tables and fill them with some default data.</p>
212
                <h2>Updating database structure</h2>
261
    <form action="install.pl">
213
                [% IF ( has_update_succeeds ) %]
262
    <input type="hidden" name="step" value="3" />
214
                    <p>Update report :</p>
263
    <input type="hidden" name="op" value="importdatastructure" />
215
                    <ul>
264
    <p> Click 'Next' to continue <input value="Next &gt;&gt;" type="submit" /></p>
216
                        [% FOREACH update_repor IN update_report %]
265
    </form>
217
                            <li>[% update_repor.line |html %]</li>
266
[% END %]
218
                        [% END %]
219
                    </ul>
220
                [% END %]
267
221
268
[% IF ( default ) %]
222
                [% IF ( has_update_errors ) %]
269
    [% IF ( upgrading ) %]
223
                    <p>Update errors :</p>
270
        <p>
224
                        <ul>
271
            We are upgrading from Koha [% dbversion %] to [% kohaversion %], you must update your database.
225
                            [% FOREACH update_error IN update_errors %]
272
        <br>
226
                                <li class="update_error">[% update_error.line |html %]</li>
273
        <a href="install.pl?step=3&amp;op=updatestructure" class="button"><button>Update Database</button></a>
227
                            [% END %]
274
        </p>
228
                        </ul>
275
    [% ELSE %]
229
                [% END %]
276
        <p>We are ready to do some basic configuration. Please install some basic configuration settings to continue the installation:
277
        <br>
278
        <br>
279
            <a href="install.pl?step=3&amp;op=choosemarc" class="button"><button>Install Basic Configuration Settings</button></a>
280
230
281
    [% END %]
231
                [% UNLESS ( has_update_errors ) %]
282
[% END %]
232
                    <p>Everything went okay. Update done.</p>
233
                [% END %]
234
                <p><a href="install.pl?step=3&amp;op=finished" class="btn btn-primary">Continue to log in to Koha</a></p>
235
           [% END # / IF updatestructure %]
236
    </div>
237
</div>
283
238
284
[% IF ( updatestructure ) %]
239
[% IF ( selectframeworks ) %]
285
  <div><h2 align="center">Updating database structure</h2>
240
    <script type="text/javascript">
286
  [% IF ( has_update_succeeds ) %]
241
        $(document).ready(function(){
287
  <p>Update report :</p>
242
            $("#selectall").on("click",function(e){
288
    <ul>
243
                e.preventDefault();
289
      [% FOREACH update_repor IN update_report %]
244
                $("input:checkbox").prop("checked", true);
290
          <li>[% update_repor.line |html %]</li>
245
            });
291
      [% END %]
246
        });
292
    </ul>
247
    </script>
293
  [% END %]
294
  [% IF ( has_update_errors ) %]
295
  <p>Update errors :</p>
296
    <ul>
297
      [% FOREACH update_error IN update_errors %]
298
          <li class="update_error">[% update_error.line |html %]</li>
299
      [% END %]
300
    </ul>
301
  [% END %]
302
 [% UNLESS ( has_update_errors ) %]
303
    <p>Everything went OK, update done.</p>
304
  [% END %]
305
<a href="install.pl?step=3&amp;op=choosemarc" class="button"><button>Back to Installation</button></a>
306
  </div>
307
[% END %]
248
[% END %]
308
249
309
</div>
250
[% INCLUDE 'intranet-bottom.inc' %]
310
</body>
311
</html>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt (-69 / +59 lines)
Lines 1-81 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
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
4
[% INCLUDE 'installer-doc-head-close.inc' %]
5
[% INCLUDE 'datatables.inc' %]
6
7
[% IF (libraries && libraries.count > 1) %]
3
[% IF (libraries && libraries.count > 1) %]
8
    <meta http-equiv="refresh" content="0; url=/cgi-bin/koha/installer/onboarding.pl?step=2">
4
    <meta http-equiv="refresh" content="0; url=/cgi-bin/koha/installer/onboarding.pl?step=2">
5
[% END %]
6
<title>Koha &rsaquo; Web installer &rsaquo; Create a library</title>
7
[% INCLUDE 'installer-doc-head-close.inc' %]
8
</head>
9
9
10
[% ELSIF (op == "add_validate_library") %]
10
<body id="installer" class="installer">
11
    <head>
11
    <div class="container-fluid">
12
        <title>Welcome &rsaquo; to  &rsaquo; Koha</title>
12
        <div class="row">
13
    </head>
13
            <div id="installer-step3" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2">
14
14
15
    <!--Header for the koha onboarding tool-->
15
            <h1 id="logo"><a href="#">Koha</a></h1>
16
    <div>
16
17
        <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1>
17
            [% IF (op == "add_validate_library") %]
18
    </div>
19
18
20
<!--New Library created-->
19
                <!--New Library created-->
21
       [% IF message == "success_on_insert" %]
22
            <form name="createlibrary" method="post" action="onboarding.pl" >
23
                <input type="hidden" name="step" value="2"/>
24
                <h1 align="left"> New library</h1>
25
                <div>
26
                    <p> Success: library created!
27
                    </p>
28
                    <p> To add another library and for more settings, <br>
29
                    go to:<br>
30
                    More -> Administration -> Libraries and groups<br>
31
                    </p>
32
                </div>
33
                Next up:
34
                <input type="submit" name="start" value="Minimal patron category setup"/>
35
            </form>
36
20
37
        [%ELSE %]
21
                [% IF message == "success_on_insert" %]
38
            <form name="retrylibrary" method="post" action="onboarding.pl">
22
                    <h2>Web installer &rsaquo; Library created</h2>
39
                <input type="hidden" name="step" value="1"/>
40
                <h1 align="left">Failed </h1>
41
                <div>
42
                    <p> Library was not successfully created</br>
43
                    Please try again or contact your system administrator. </p>
44
                </div>
45
                <input type="submit" value="Try again"/>
46
            </form>
47
        [%END%]
48
23
49
[% ELSE %]
24
                    <form name="createlibrary" method="post" action="onboarding.pl" >
50
    <head>
25
                        <input type="hidden" name="step" value="2" />
51
        <title>Welcome &rsaquo; to  &rsaquo; Koha</title>
26
                        <div class="alert alert-success">Success: Library created!</div>
52
    </head>
27
                        <p> To add another library and for more settings, go to: </p>
28
                        <div class="breadcrumbs"> Administration <b>&rsaquo;</b> Libraries and groups </div>
29
                        <input type="submit" name="start" class="btn btn-primary" value="Continue to the next step"/>
30
                    </form>
31
                 [% ELSE %]
32
                    <h2>Web installer &rsaquo; Library creation failed</h2>
53
33
54
    <!--Header for the koha onboarding tool-->
34
                    <form name="retrylibrary" method="post" action="onboarding.pl">
55
    <div>
35
                        <input type="hidden" name="step" value="1"/>
56
        <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1>
36
                        <div class="alert alert-danger">Library was not successfully created</div>
37
                        <p>Please try again or contact your system administrator.</p>
38
                        <input type="submit" class="btn btn-primary" value="Try again"/>
39
                    </form>
40
                 [% END %]
41
42
            [% ELSE %]
43
44
                <!--Create a library screen 1-->
45
                 <h2>Web installer &rsaquo; Create a library</h2>
46
47
                <form name="LibraryCreation" method="post" action="onboarding.pl">
48
                    <fieldset class="rows" >
49
                         <input type="hidden" name="step" value="1"/>
50
                         <input type="hidden" name="op" value="add_validate_library"/>
51
                         <ol>
52
                             <li>
53
                                <label for="branchcode" class="required">Library code: </label>
54
                                <input type="text"  pattern="^[A-Za-z]{0,10}$" title="Please enter 3 capital letters" name="branchcode" id="branchcode" size="3" maxlength="10" class="required" required="required" />
55
                                <span class="required">Required</span>
56
                            </li>
57
                            <li>
58
                                <label for="branchname" class="required">Name: </label>
59
                                <input type="text" name="branchname" id="branchname" size="42" class="required" required="required">
60
                                <span class="required">Required</span>
61
                            </li>
62
                         </ol>
63
                        <input type="submit" class="btn btn-primary" value="Submit" />
64
                    </fieldset>
65
                </form>
66
67
            [% END # / IF add_validate_library %]
57
    </div>
68
    </div>
69
</div>
58
70
59
<!--Create a library screen 1-->
71
[% INCLUDE 'intranet-bottom.inc' %]
60
        <form name="LibraryCreation" method="post" action="onboarding.pl">
61
            <fieldset class="rows" >
62
                 <h2>Create a library</h2>
63
                 <input type="hidden" name="step" value="1"/>
64
                 <input type="hidden" name="op" value="add_validate_library"/>
65
                 <ol>
66
                     <li>
67
                        <label for="branchcode" class="required">Library code: </label>
68
                        <input type="text"  pattern="[0-9A-Za-z]{1,10}" title="Please enter up to 10 letters and/or numbers" name="branchcode" id="branchcode" size="10" maxlength="10" value="[% library.branchcode |html %]" class="required" required="required" />
69
                        <span class="required">Required</span>
70
                    </li>
71
                    <li>
72
                        <label for="branchname" class="required">Name: </label>
73
                        <input type="text" name="branchname" id="branchname" title="Please enter the name of your institution" size="42" value="[% library.branchname |html %]" class="    required" required="required" style="width:200px;">
74
                        <span class="required">Required</span>
75
                    </li>
76
                 </ol>
77
             <br>
78
             <input type="submit" class="action" value="Submit"/>
79
            </fieldset>
80
     </form>
81
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt (-380 / +123 lines)
Lines 3-396 Link Here
3
[% USE KohaDates %]
3
[% USE KohaDates %]
4
[% USE Price %]
4
[% USE Price %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
<title> Add a patron category</title>
6
<title>Koha &rsaquo; Web installer &rsaquo; Add a patron category</title>
7
[% IF (categories && categories.count > 1 )
8
    # This if statement checks if the categories variable handed to this template
9
    # by onboarding.pl has data in it. If the categories variable does have data
10
    # in it this means that the user has previously imported sample patron category
11
    # data and so we do not need to show them the create patron category screen 1,
12
    #instead we can display a screen with ubtton redirecting the user to step 3 %]
13
     <meta http-equiv="refresh" content="0; url=/cgi-bin/koha/installer/onboarding.pl?step=3">
14
[% END %]
7
[% INCLUDE 'installer-doc-head-close.inc' %]
15
[% INCLUDE 'installer-doc-head-close.inc' %]
8
[% INCLUDE 'calendar.inc' %]
16
[% INCLUDE 'calendar.inc' %]
9
17
[% INCLUDE 'validator-strings.inc' %]
10
<script type="text/javascript">
18
[% INCLUDE 'installer-strings.inc' %]
11
//<![CDATA[
19
<script type="text/javascript" src="[% interface %]/[% theme %]/js/onboarding.js"></script>
12
13
var debug    = "";
14
var dformat  = "us";
15
var sentmsg = 0;
16
if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");}
17
var MSG_PLEASE_ENTER_A_VALID_DATE = (_("Please enter a valid date (should match %s)."));
18
19
function is_valid_date(date) {
20
        // An empty string is considered as a valid date for convenient reasons.
21
        if ( date === '' ) return 1;
22
        var dateformat = dateformat_str = 'us';
23
        if ( dateformat == 'us' ) {
24
           if ( date.search(/^\d{2}\/\d{2}\/\d{4}($|\s)/) == -1 ) return 0;
25
                  dateformat = 'mm/dd/yy';
26
           } else if ( dateformat == 'metric' ) {
27
                  if ( date.search(/^\d{2}\/\d{2}\/\d{4}($|\s)/) == -1 ) return 0;
28
                  dateformat = 'dd/mm/yy';
29
           } else if (dateformat == 'iso' ) {
30
                  if ( date.search(/^\d{4}-\d{2}-\d{2}($|\s)/) == -1 ) return 0;
31
                  dateformat = 'yy-mm-dd';
32
           } else if ( dateformat == 'dmydot' ) {
33
                  if ( date.search(/^\d{2}\.\d{2}\.\d{4}($|\s)/) == -1 ) return 0;
34
                  dateformat = 'dd.mm.yy';
35
           }
36
           try {
37
               $.datepicker.parseDate(dateformat, date);
38
           } catch (e) {
39
               return 0;
40
           };
41
               return 1;
42
}function get_dateformat_str(dateformat) {
43
           var dateformat_str;
44
           if ( dateformat == 'us' ) {
45
                dateformat_str = 'mm/dd/yyyy';
46
           } else if ( dateformat == 'metric' ) {
47
                dateformat_str = 'dd/mm/yyyy';
48
           } else if (dateformat == 'iso' ) {
49
                dateformat_str = 'yyyy-mm-dd';
50
           } else if ( dateformat == 'dmydot' ) {
51
                dateformat_str = 'dd.mm.yyyy';
52
           }
53
           return dateformat_str;
54
}
55
56
function validate_date (dateText, inst) {
57
           if ( !is_valid_date(dateText) ) {
58
               var dateformat_str = get_dateformat_str( 'us' );
59
               alert(MSG_PLEASE_ENTER_A_VALID_DATE.format(dateformat_str));
60
               $('#'+inst.id).val('');
61
           }
62
}
63
function Date_from_syspref(dstring) {
64
            var dateX = dstring.split(/[-/.]/);
65
            if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));}
66
            if (dformat === "iso") {
67
                return new Date(dateX[0], (dateX[1] - 1), dateX[2]);  // YYYY-MM-DD to (YYYY,m(0-11),d)
68
            } else if (dformat === "us") {
69
                return new Date(dateX[2], (dateX[0] - 1), dateX[1]);  // MM/DD/YYYY to (YYYY,m(0-11),d)
70
            } else if (dformat === "metric") {
71
                return new Date(dateX[2], (dateX[1] - 1), dateX[0]);  // DD/MM/YYYY to (YYYY,m(0-11),d)
72
            } else if (dformat === "dmydot") {
73
                return new Date(dateX[2], (dateX[1] - 1), dateX[0]);  // DD.MM.YYYY to (YYYY,m(0-11),d)
74
            } else {
75
                if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);}
76
                return 0;
77
            }
78
}
79
80
function DateTime_from_syspref(date_time) {
81
           var parts = date_time.split(" ");
82
           var date = parts[0];
83
           var time = parts[1];
84
           parts = time.split(":");
85
           var hour = parts[0];
86
           var minute = parts[1];
87
           if ( hour < 0 || hour > 23 ) {
88
                   return 0;
89
           }
90
           if ( minute < 0 || minute > 59 ) {
91
                   return 0;
92
           }
93
           var datetime = Date_from_syspref( date );
94
           if ( isNaN( datetime.getTime() ) ) {
95
                   return 0;
96
           }
97
           datetime.setHours( hour );
98
           datetime.setMinutes( minute );
99
           return datetime;
100
}
101
102
/* Instead of including multiple localization files as you would normally see with
103
      jQueryUI we expose the localization strings in the default configuration */
104
jQuery(function($){
105
          $.datepicker.regional[''] = {
106
              closeText: _("Done"),
107
              prevText: _("Prev"),
108
              nextText: _("Next"),
109
              currentText: _("Today"),
110
              monthNames: [_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),
111
                           _("July"),_("August"),_("September"),_("October"),_("November"),_("December")],
112
              monthNamesShort: [_("Jan"), _("Feb"), _("Mar"), _("Apr"), _("May"), _("Jun"),
113
                                _("Jul"), _("Aug"), _("Sep"), _("Oct"), _("Nov"), _("Dec")],
114
              dayNames: [_("Sunday"), _("Monday"), _("Tuesday"), _("Wednesday"), _("Thursday"), _("Friday"), _("Saturday")],
115
              dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")],
116
              dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")],
117
              weekHeader: _("Wk"),
118
              dateFormat: "mm/dd/yy",
119
              firstDay: 0,
120
              isRTL: false,
121
              showMonthAfterYear: false,
122
              yearSuffix: ''};
123
              $.datepicker.setDefaults($.datepicker.regional['']);
124
                                                                                                                                               });
125
126
$(document).ready(function(){
127
        $.datepicker.setDefaults({
128
             showOn: "both",
129
             changeMonth: true,
130
             changeYear: true,
131
             buttonImage: '/[% interface %]/prog/img/famfamfam/silk/calendar.png',
132
             buttonImageOnly: true,
133
             showButtonPanel: true,
134
             showOtherMonths: true,
135
             selectOtherMonths: true
136
        });
137
        $( ".datepicker" ).datepicker({
138
             onClose: function(dateText, inst) {
139
             validate_date(dateText, inst);
140
             },
141
        }).on("change", function(e, value) {
142
        if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
143
        });
144
       // http://jqueryui.com/demos/datepicker/#date-range
145
            var dates = $( ".datepickerfrom, .datepickerto" ).datepicker({
146
            changeMonth: true,
147
            numberOfMonths: 1,
148
            onSelect: function( selectedDate ) {
149
            var option = this.id == "from" ? "minDate" : "maxDate",
150
            instance = $( this ).data( "datepicker" );
151
            date = $.datepicker.parseDate(
152
                   instance.settings.dateFormat ||
153
                   $.datepicker._defaults.dateFormat,
154
                   selectedDate, instance.settings );
155
                   dates.not( this ).datepicker( "option", option, date );
156
            },
157
            onClose: function(dateText, inst) {
158
                 validate_date(dateText, inst);
159
            },
160
            }).on("change", function(e, value) {
161
            if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
162
            });
163
});
164
//]]>
165
</script>
166
167
168
<script type="text/javascript">
169
    var MSG_CATEGORYCODE_CHARS=(_("Please only enter letters into this field."));
170
    var MSG_ONE_ENROLLMENTPERIOD =(_("Please choose an enrollment period in months OR by date."));
171
    var MSG_ONLY_ONE_ENROLLMENTPERIOD=(_("Please only choose one enrolment period."));
172
</script>
173
174
<script type="text/javascript">
175
jQuery.validator.addMethod( "category_code_check", function(value,element){
176
     var patt = /[0-9A-Za-z]{1,10}$/g;
177
     if (patt.test(element.value)) {
178
              return true;
179
     } else {
180
              return false;
181
     }
182
   }, MSG_CATEGORYCODE_CHARS
183
);
184
185
jQuery.validator.addMethod( "enrollment_period", function(){
186
      enrolmentperiod = $("#enrolmentperiod").val();
187
      enrolmentperioddate = $("#enrolmentperioddate").val();
188
      if (( $("#enrolmentperiod").val() == "" && $("#enrolmentperioddate").val() == "") || ($("#enrolmentperiod").val() !== "" && $("#enrolmentperioddate").val() !== "")) {
189
             return false;
190
      } else {
191
             return true;
192
      }
193
    }, MSG_ONLY_ONE_ENROLLMENTPERIOD
194
);
195
196
$(document).ready(function() {
197
      $("#enrolmentperioddate").datepicker({
198
            minDate: 1
199
      }); // Require that "until date" be in the future
200
      if ($("#branches option:selected").length < 1) {
201
          $("#branches option:first").attr("selected", "selected");
202
      }
203
      $("#categorycode").on("blur",function(){
204
           toUC(this);
205
      });
206
      $("#category_form").validate({
207
                rules: {
208
                     categorycode: {
209
                            required: true,
210
                            category_code_check: true
211
                     },
212
                     description: {
213
                            required:true,
214
                     },
215
                     enrolmentperiod: {
216
                           required: function(element){
217
                                 return $("#enrolmentperioddate").val() === "";
218
                           },
219
                           digits: true,
220
                           enrollment_period: true,
221
                    },
222
                     enrolmentperioddate: {
223
                            required: function(element){
224
                               return $("#enrolmentperiod").val() === "";
225
                            },
226
                            enrollment_period: true,
227
                    },
228
                     dateofbirthrequired: {
229
                             digits: true
230
                     },
231
                     upperagelimit: {
232
                             digits: true
233
                     },
234
                     enrolmentfee: {
235
                             number: true
236
                     },
237
                     reservefee: {
238
                             number: true
239
                     },
240
                     category_type: {
241
                             required: true
242
                    }
243
                },
244
                messages: {
245
                      categorycode: {
246
                            required:  MSG_CATEGORYCODE_CHARS
247
                      },
248
                      enrolmentperiod: {
249
                             required: MSG_ONE_ENROLLMENTPERIOD
250
                      },
251
                      enrolmentperioddate: {
252
                             required: MSG_ONE_ENROLLMENTPERIOD
253
                      }
254
                }
255
       });
256
});
257
258
</script>
259
</head>
20
</head>
260
21
261
[% IF (categories && categories.count > 1 ) %] <!--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-->
22
<body id="installer" class="installer">
262
23
263
24
    <div class="container-fluid">
264
     <meta http-equiv="refresh" content="0; url=/cgi-bin/koha/installer/onboarding.pl?step=3">
25
        <div class="row">
265
26
            <div id="installer-step3" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2">
266
[% ELSIF (op == "add_validate_category") %]
27
267
<!--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-->
28
            <h1 id="logo"><a href="#">Koha</a></h1>
268
29
269
    <div> <!-- Header that appears at the top of every screen in the koha onboarding tool-->
30
            [% IF (op == "add_validate_category")
270
        <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1>
31
                # if the user has not previously imported sample patron categories
271
    </div>
32
                # check if the user has pressed the button name="add_validate" in
272
33
                # the create patron category screen 1, and if they have pressed that
273
    [% IF message != "error_on_insert" %]
34
                # button then display the below screen with a button to redirect the
274
     <form name="createcat" method="post" action="onboarding.pl">
35
                # user to step 3 %]
275
            <input type="hidden" name="step" value="3"/>
36
276
             <h1 align="left">  New patron category</h1>
37
                [% IF message != "error_on_insert" %]
277
             <div>
38
278
                 <p> Success: patron category created! </p>
39
                    <h2>Web installer &rsaquo; Patron category created</h2>
279
                 <p> To add another patron category and for more settings<br>
40
280
                 go to:<br>
41
                    <form name="createcat" method="post" action="onboarding.pl">
281
                 More -> Administration -> Patron categories<br>
42
                        <input type="hidden" name="step" value="3"/>
282
             </div>
43
                        <div class="alert alert-success">Success: Patron category created! </div>
283
             Next up:<br>
44
                        <p> To add another patron category and for more settings go to:</p>
284
             <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
                        <div class="breadcrumbs"> Administration <b>&rsaquo;</b> Patron categories</div>
285
     </form>
46
                        <input type="submit" class="btn btn-primary" name="start" value="Continue to the next step" />
286
     [% ELSE %]
47
                     </form>
287
        <form name="retrypatcat" method="post" action="onboarding.pl">
48
                 [% ELSE %]
288
        Message is [% message %]
49
289
        <input type="hidden" name="step" value="2"/>
50
                    <h2>Web installer &rsaquo; Patron category creation failed</h2>
290
            <h1 align="left">Failed</h1>
51
291
            <div>Patron category was not successfully created.</br>
52
                    <form name="retrypatcat" method="post" action="onboarding.pl">
292
            Please try again or contact your system administrator.</p>
53
                        <input type="hidden" name="step" value="2"/>
293
            </div>
54
                        <div class="alert alert-danger">
294
            <input type="submit" value="Try again"/>
55
                            Patron category was not successfully created.
295
        </form>
56
                            Message is [% message %]
296
    [% END %]
57
                        </div>
297
58
                        <p>Please try again or contact your system administrator.</p>
298
59
                        <input type="submit" class="btn btn-primary" value="Try again" />
299
[% ELSE %] <!--Else display create patron category screen 1 where the user can input values to create their first patron category-->
60
                    </form>
300
    <div> <!-- Header that appears at the top of every screen in the koha onboarding tool-->
61
                [% END %]
301
        <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1>
62
302
    </div>
63
303
64
            [% ELSE
304
    <h1 align="left"> Create a new patron category</h1>
65
                # Else display create patron category screen 1 where the user
305
    <p> The patron category you create in this form is going to be the one which the new administrator patron account will have.</p>
66
                # can input values to create their first patron category %]
306
       <form id="category_form" method="post" action="onboarding.pl">
67
307
       <fieldset class="rows">
68
            <h2>Web installer &rsaquo; Create a patron category</h2>
308
            <input type="hidden" name="step" value="2"/>
69
309
            <input type="hidden" name="op" value="add_validate_category" />
70
            <p> The patron category you create will be used by the <span class="bg-info">administrator account</span>.</p>
310
                <ol>
71
311
                    <li>
72
            <form id="category_form" method="post" action="onboarding.pl">
312
                        <label for="categorycode" class="required">Category code: </label>
73
                <fieldset class="rows">
313
                        <input type="text" pattern="[0-9A-Za-z]{1,10}" title="Please enter up to 10 letters and/or numbers" id="categorycode" name="categorycode" value="[% category.categorycode |html %]" size="10" maxlength="10" class="required" required="required" />
74
                    <input type="hidden" name="step" value="2"/>
314
                        <span class="required">Required</span>
75
                    <input type="hidden" name="op" value="add_validate_category" />
315
                    </li>
76
                    <ol>
316
77
                        <li>
317
                    <li>
78
                            <label for="categorycode" class="required">Category code: </label>
318
                        <label for="description" class="required">Description: </label>
79
                            <input type="text" id="categorycode" name="categorycode" size="10" maxlength="10" class="required" required="required" />
319
                        <input type="text" name="description" title="Please enter a description of the category" size="40" maxlength="80" class="required" required="required" value="[% category.description |html%]" />
80
                            <span class="required">Required</span>
320
                        <span class="required">Required</span>
81
                        </li>
321
                    </li>
82
322
83
                        <li>
323
                    <li>
84
                            <label for="description" class="required">Description: </label>
324
                        <label for="overduenoticerequired">Overdue notice required: </label>
85
                            <input type="text" id="description" name="description" size="40" class="required" required="required" />
325
                        <select name="overduenoticerequired" value="overduenoticerequired">
86
                            <span class="required">Required</span>
326
                            [% IF category.overduenoticerequired %]
87
                        </li>
327
                                <option value="0">No</option>
88
328
                                <option value="1" selected="selected">Yes</option>
89
                        <li>
329
                            [% ELSE %]
90
                            <label for="overduenoticerequired">Overdue notice required: </label>
91
                            <select name="overduenoticerequired" id="overduenoticerequired">
330
                                <option value="0" selected="selected">No</option>
92
                                <option value="0" selected="selected">No</option>
331
                                <option value="1">Yes</option>
93
                                <option value="1">Yes</option>
332
                            [% END %]
94
                            </select>
333
                        </select>
95
                        </li>
334
                    </li>
96
335
97
                        <li>
336
                    <li>
98
                            <span class="label">Category type: </span>
337
                        <label for="category_type" class="required">Category type: </label>
99
                            <input type="hidden" name="category_type" value="S" />
338
                        <select name="category_type" value="category_type" class='required' required='required'>
100
                            Staff
339
                            [% IF category and category.category_type == 'S' %]
101
                        </li>
340
                                <option value="S" selected="selected">Staff</option>
102
341
                            [% ELSE %]
103
                        <li>
342
                                <option value="S">Staff</option>
104
                            <label for="default_privacy">Default privacy: </label>
343
                            [% END %]
105
                            <select id="default_privacy" name="default_privacy" required="required">
344
                        </select>
345
                        <span class="required">Required</span>
346
                    </li>
347
348
                    <li>
349
                        <label for="default_privacy">Default privacy: </label>
350
                        <select value="default_privacy" name="default_privacy" required="required">
351
                            [% SET default_privacy = 'default' %]
352
353
                            [% IF category %]
354
                               [% SET default_privacy = category.default_privacy %]
355
                            [% END %]
356
357
                            [% SWITCH default_privacy %]
358
                            [% CASE 'forever' %]
359
                                <option value="default">Default</option>
360
                                <option value="never">Never</option>
361
                                <option value="forever" selected="selected">Forever</option>
362
                            [% CASE 'never' %]
363
                                <option value="default">Default</option>
364
                                <option value="never" selected="selected">Never</option>
365
                                <option value="forever">Forever</option>
366
                            [% CASE %]
367
                                <option value="default" selected="selected">Default</option>
106
                                <option value="default" selected="selected">Default</option>
368
                                <option value="never">Never</option>
107
                                <option value="never">Never</option>
369
                                <option value="forever">Forever</option>
108
                                <option value="forever">Forever</option>
370
                            [% END %]
109
                            </select>
371
                        </select>
110
                            <div class="hint">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 <code>batch_anonymise.pl</code> which should be set up by your system administrator.</div>
372
                        <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>
111
                        </li>
373
                    </li>
112
                        <li>
374
            </ol>
113
                            <span class="label">Enrolment period: </span>
375
            <span class="label">Enrolment period: </span>
114
                            <fieldset class="rows">
376
            </br>
115
                                <ol>
377
                    <fieldset>
116
                                    <li>
378
                    <legend>Choose one</legend>
117
                                        <span class="label"> </span><strong>Choose one</strong>
379
                            <ol>
118
                                    </li>
380
                                <li>
119
                                    <li>
381
                                    <label for="enrolmentperiod" style="width:6em;">In months: </label>
120
                                        <label for="enrolmentperiod">In months: </label>
382
                                    <input type="number" class="enrolmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF category.enrolmentperiod %][% category.enrolmentperiod %][% END %]" /> months
121
                                        <input type="number" name="enrolmentperiod" id="enrolmentperiod" size="3" /> months
383
                                </li>
122
                                    </li>
384
                                <li>
123
                                    <li>
385
                                    <label for="enrolmentperioddate" style="width:6em;">Until date: </label>
124
                                        <label for="enrolmentperioddate">Until date: </label>
386
                                    <input type="text" class="enrolmentperioddate datepicker" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
125
                                        <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" />
387
                                </li>
126
                                        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
388
                            </ol>
127
                                    </li>
389
                     </fieldset>
128
                                </ol>
390
                    <br>
129
                             </fieldset>
391
                    <input type="submit" class="action" value="Submit" />
130
                        </li>
392
    </fieldset>
131
                    </ol>
393
    </form>
132
                    <input type="submit" class="btn btn-primary" value="Submit" />
394
[% END %]
133
                </fieldset>
134
            </form>
135
        [% END %]
136
    </div>
137
</div>
395
138
396
[% INCLUDE 'intranet-bottom.inc' %]
139
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt (-198 / +148 lines)
Lines 1-206 Link Here
1
<!--Includes for creating patron-->
1
<!--Includes for creating patron-->
2
[% USE Koha %]
3
[% USE KohaDates %]
4
[% USE Price %]
5
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
6
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END%]
3
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END%]
4
<title>Koha &rsaquo; Web installer &rsaquo; Create Koha administrator patron</title>
7
[% INCLUDE 'installer-doc-head-close.inc' %]
5
[% INCLUDE 'installer-doc-head-close.inc' %]
8
[% INCLUDE 'calendar.inc' %]
6
[% INCLUDE 'validator-strings.inc' %]
9
[% INCLUDE 'datatables.inc' %]
7
[% INCLUDE 'installer-strings.inc' %]
10
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/onboarding.js"></script>
11
<head>
12
<title>Create Koha administrator patron</title>
13
14
<!--jQuery scripts for creating patron-->
15
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
16
17
<script type="text/javascript">
18
     var MSG_PASSWORD_MISMATCH=(_("The entered passwords do not match, please rewrite them"));
19
</script>
20
21
22
23
<script type="text/javascript">
24
jQuery.validator.addMethod( "password_match", function(value,element){
25
        var MSG_PASSWORD_MISMATCH = (_("The passwords entered do not match"));
26
        var password = document.getElementById('password').value
27
        var confirmpassword = document.getElementById('password2').value
28
29
        if ( password != confirmpassword ){
30
               return false;
31
          }
32
          else{
33
               return true
34
          }
35
    },  MSG_PASSWORD_MISMATCH
36
);
37
38
$(document).ready(function(){
39
40
    $("#Submit").click(function(){
41
        $("#createpatron").validate({
42
         rules: {
43
            surname: {
44
                required: true,
45
            },
46
            firstname: {
47
                required: true,
48
            },
49
            cardnumber: {
50
                required: true,
51
            },
52
           password: {
53
                 password_match:true
54
            }
55
         },
56
         messages: {
57
            password: {
58
                 required: MSG_PASSWORD_MISMATCH
59
            },
60
         }
61
62
     });
63
});
64
});
65
</script>
66
</head>
9
</head>
67
10
68
<div>
11
<body id="installer" class="installer">
69
    <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1>
12
70
</div>
13
    <div class="container-fluid">
14
        <div class="row">
15
            <div id="installer-step3" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2">
16
17
            <h1 id="logo"><a href="#">Koha</a></h1>
18
19
            [%  IF (nok) %]
20
21
                <h2>Web installer &rsaquo; Administrator patron creation failed</h2>
22
23
                <form id="errors" method="post" action="onboarding.pl">
24
                    <input type="hidden" name="step" value="3"/>
25
                    <div class="alert alert-danger">
26
                        <ul>
27
                        [% IF errorloginexists %]
28
                            <li id="ERROR_login_exist">Username/password already exists.</li>
29
                        [% END %]
30
                        [% IF errorcardnumberexists %]
31
                            <li id="ERROR_cardnumber">Cardnumber already in use.</li>
32
                        [% END %]
33
                        [% IF errorcardnumberlength %]
34
                            <li id="ERROR_cardnumber">Cardnumber length is incorrect</li>
35
                        [% END %]
36
                        [% IF errorshortpassword %]
37
                            <li id="ERROR_short_password">Password length is incorrect, must be at least [% minPasswordLength %] characters long.</li>
38
                        [% END %]
39
                        [% IF errorpasswordmismatch %]
40
                            <li id="ERROR_password_mismatch">Passwords do not match.</li>
41
                        [% END %]
42
                        </ul>
43
                    </div>
44
                    <input type="submit" class="btn btn-primary" name="step" value="Try again"/>
45
                </form>
46
47
            [% ELSIF op == 'add_validate' # New patron created  %]
48
49
                <h2>Web installer &rsaquo; Koha administrator patron created</h2>
50
51
                <form id="patrondone" method="post" action="onboarding.pl">
52
                    <input type="hidden" name="step" value="4"/>
53
                    <div class="alert alert-success">Success: Administrator patron created! </div>
54
                    <p> To create another patron, go to: </p>
55
                    <div class="breadcrumbs">Patrons &rsaquo; New patron</div>
56
                    <input type="submit" class="btn btn-primary" name="start" value="Continue to the next step" />
57
                </form>
58
59
            [% ELSE %]
60
61
                <h2>Web installer &rsaquo; Create Koha administrator patron</h2>
62
63
                <p>
64
                Now we will create a patron with superlibrarian permissions. Login with this to access Koha as a staff member with all permissions.
65
                </p>
66
67
                <form id="createpatron" method="post" action="onboarding.pl">
68
                    <fieldset class="rows">
69
                        <input type="hidden" name="step" value="3"/>
70
                        <input type="hidden" name="op" value="add_validate" />
71
                            <h3>Administrator identity</h3>
72
                            <ol>
73
                                <li>
74
                                    <label for="surname" class="required">Surname: </label>
75
                                    <input type="text" id="surname" name="surname" class="required" required="required" />
76
                                    <span class="required">Required</span>
77
                                </li>
78
                                <li>
79
                                    <label for="firstname" class="required">First name: </label>
80
                                    <input  type="text" name="firstname" id="firstname" size="20" class="required" required="required">
81
                                    <span class="required">Required</span>
82
                                </li>
83
                            </ol>
84
85
                            <ol>
86
                                <li>
87
                                    <label for="cardnumber" class="required">Card number: </label>
88
                                    [% IF patrons && patrons > 1 %]
89
                                        <input type="text" id="cardnumber" class="noEnterSubmit valid required" name="cardnumber" required="required">
90
                                    [% ELSE %]
91
                                        <input type="text" id="cardnumber" name="cardnumber" class="required" required="required">
92
                                    [% END %]
93
                                    <span class="required">Required</span>
94
                                </li>
95
                                <li>
96
97
                                <!--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-->
98
                                    <label for="libraries" class="required"> Library: </label>
99
                                    <select name="libraries" size="1" id="libraries">
100
101
                                     [% FOREACH library IN libraries %]
102
                                          <option name="libraries" value="[% library.branchcode %]"> [% library.branchname %]
103
                                     [% END %]
104
105
                                        </select>
106
                                    <span class="required"> Required</span>
107
                                </li>
108
                                <li>
109
                                    <label for="categorycode_entry" class="required"> Patron category</label>
110
                                    <select id="categorycode_entry" name="categorycode_entry" onchange="update_category_code(this);">
111
                                    [% FOREACH category IN categories %]
112
                                        <option name="categorycode_entry" value = "[% category.categorycode %]">[%category.description %]</option>
113
                                    [% END %]
114
                                    </select>
115
                                    <span class="required">Required</span><br><br>
116
                                    <b>Note:</b> If you installed sample patron categories please select the "Staff" option in the patron categories dropdown box.
117
                                </li>
118
                            </ol>
119
120
                            <h3>Administrator account permissions</h3>
121
                            <ol>
122
                                <li>
123
                                    <input type="hidden" name="newflags" value="1"/>
124
                                    <input type="hidden" class="flag parent" id="flag-0" name="flag" value="superlibrarian"/>
125
                                    <code>superlibrarian</code>
126
                                </li>
127
                            </ol>
128
129
                            <h3>Administrator login</h3>
130
                            <ol>
131
                                <li>
132
                                    <input type="hidden" name="BorrowerMandatoryField" value = [% BorrowerMandatoryField %] />
133
                                    <label for="userid" class="required">Username: </label>
134
                                    <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" class="required" required="required" />
135
                                    <span class="required">Required</span>
136
                                </li>
137
                                <li>
138
                                    <label for="password" class="required">Password: </label>
139
                                    <input type="password" name="password" id="password" size="20" class="required" required="required">
140
                                    <span class="required">Required</span>
141
                                </li>
142
                                <li>
143
                                    <label for="password2" class="required">Confirm password: </label>
144
                                    <input type="password" id="password2" name="password2" size="20" class="required" required="required">
145
                                    <span class="required">Required</span>
146
                                </li>
147
                            </ol>
148
                    </fieldset>
149
                    <input type="submit" class="btn btn-primary" value="Submit" />
150
                </form>
71
151
72
73
[%  IF (nok) %]
74
        <form name="errors" method="post" action="onboarding.pl">
75
            <input type="hidden" name="step" value="3"/>
76
            <h1 align="left">There was an error</h1>
77
            <p>Try again </p>
78
            <div>
79
            <ul>
80
            [% IF errorloginexists %]
81
                <li id="ERROR_login_exist">Username/password already exists.</li>
82
            [% END %]
83
            [% IF errorcardnumberexists %]
84
                <li id="ERROR_cardnumber">Cardnumber already in use.</li>
85
            [% END %]
86
            [% IF errorcardnumberlength %]
87
                <li id="ERROR_cardnumber">Cardnumber length is incorrect</li>
88
            [% END %]
152
            [% END %]
89
            [% IF errorshortpassword %]
153
        </div>
90
                <li id="ERROR_short_password">Password length is incorrect, must be at least [% minPasswordLength %] characters long.</li>
154
    </div>
91
            [% END %]
155
92
            [% IF errorpasswordmismatch %]
156
[% INCLUDE 'intranet-bottom.inc' %]
93
                <li id="ERROR_password_mismatch">Passwords do not match.</li>
94
            [% END %]
95
            </ul>
96
97
            </div>
98
            <input type="submit" name="step" value="Try again"/>
99
        </form>
100
101
102
<!--Create a patron screen 2-->
103
[% ELSIF op == 'add_validate' %]
104
          <!--New patron created-->
105
        <form name="patrondone" method="post" action="onboarding.pl">
106
            <input type="hidden" name="step" value="4"/>
107
            <h1 align="left"> Koha administrator patron </h1>
108
            <div>
109
                 <p> Success: administrator patron created!</p>
110
                 <p> To create another patron, go to Patrons -> New Patron. <br>
111
                More -> Set Permissions in a user page to gain superlibrarian permissions.
112
            </div>
113
            Next up:
114
            <input type="submit" name="start" value="Minimal item type setup"/>
115
        </form>
116
[% ELSE %]
117
<!--Create a patron screen 1-->
118
       <h1 align="left"> Create koha administrator patron</h1>
119
        <p>
120
        Now we will create a patron with superlibrarian permissions. Login with this to access Koha as a staff member will all permissions.
121
        </p>
122
        <form name="createpatron" id="createpatron" method="post" action="onboarding.pl">
123
            <fieldset class="rows">
124
                 <input type="hidden" name="step" value="3"/>
125
                 <input type="hidden" name="op" value="add_validate" />
126
                    <legend id="library_management_lgd">Library management</legend>
127
                    <ol>
128
                    <h3>Patron identity</h3>
129
                        <li>
130
                            <label for="surname" class="required">Surname: </label>
131
                            <input type="text" id="surname" name="surname" title="Please only enter letters in the surname field" value="[% surname |html %]" class="required" required="required" />
132
                            <span class="required">Required</span>
133
                        </li>
134
                        <li>
135
                            <label for="firstname" class="required">First name: </label>
136
                            <input  type="text" name="firstname" title="Please only enter letters in the first name field" id="firstname" size="20" value="[% firstname |html %]" class="required" required="required">
137
                            <span class="required">Required</span>
138
                        </li>
139
                    </ol>
140
141
                    <ol>
142
                        <li>
143
                            <label for="cardnumber" class="required">Card number: </label>
144
                            [% IF patrons && patrons > 1 %]
145
                                <input type="text" id="cardnumber" title="Please enter a cardnumber" class="noEnterSubmit valid" name="cardnumber" value="[% newcardnumber | html %]" class="required" required="required">
146
                            [% ELSE %]
147
                                <input type="text" id="cardnumber" title="Please enter a cardnumber" name="cardnumber" value="[% cardnumber | html %]" class="required" required="required">
148
                            [% END %]
149
                            <span class="required">Required</span>
150
                        </li>
151
                        <li>
152
153
                        <!--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-->
154
                            <label for="libraries" class="required"> Library: </label>
155
                            <select name="libraries" size="1" id="libraries">
156
157
                             [% FOREACH library IN libraries %]
158
                                  <option name="libraries" value="[% library.branchcode %]"> [% library.branchname %]
159
                             [% END %]
160
161
                                </select>
162
                            <span class="required"> Required</span>
163
                        </li>
164
                        <li>
165
                            <label for="categorycode_entry" class="required"> Patron category</label>
166
                            <select id="categorycode_entry" name="categorycode_entry" onchange="update_category_code(this);">
167
                            [% FOREACH category IN categories %]
168
                                <option name="categorycode_entry" value = "[% category.categorycode %]">[%category.description %]</option>
169
                            [% END %]
170
                            </select>
171
                            <span class="required">Required</span><br><br>
172
                            <b>Note:</b> If you installed sample patron categories please select the "Staff" option in the patron categories dropdown box.
173
                        </li>
174
                    </ol>
175
176
                    <ol>
177
                            <h3> Koha administrator patron permissions</h3>
178
                            <input type="hidden" name="newflags" value="1"/>
179
                            <li>
180
                                <input type="hidden" class="flag parent" id="flag-0" name="flag" value="superlibrarian"/>
181
                                <label name="permissioncode" for="flag-0"> superlibrarian</label>
182
                            </li>
183
                    </ol>
184
                    <ol>
185
                    <h3>OPAC/Staff Login</h3>
186
                        <li>
187
                            <input type="hidden" name="BorrowerMandatoryField" value = [% BorrowerMandatoryField %] />
188
                            <label for="userid" class="required">Username: </label>
189
                            <input type="text" name="userid" id ="userid" size="20" title="Please only enter a username of letters and numbers" value="[% userid |html %]" class="required" required="required" />
190
                            <span class="required">Required</span>
191
                        </li>
192
                        <li>
193
                            <label for="passwordlabel" class="required">Password: </label>
194
                            <input type="password" name="password" id="password" size="20" value="[% member.password |html %]" class="required" required="required">
195
                            <span class="required">Required</span>
196
                        </li>
197
                        <li>
198
                            <label for="password2" class="required">Confirm password: </label>
199
                            <input type="password" id="password2" name="password2" size="20" value="" class="required" required="required">
200
                            <span class="required">Required</span>
201
                        </li>
202
                    </ol>
203
             </fieldset><br>
204
                <input type="submit" id="Submit" class="action" value="Submit"/>
205
     </form>
206
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt (-59 / +74 lines)
Lines 1-67 Link Here
1
<!-- includes for creating item type-->
1
<!-- includes for creating item type-->
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END%]
3
[% IF ( finish ) %]
4
    <meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl" />
5
[% ELSIF ( op != "add_validate" && itemtypes && itemtypes.count > 1 ) %]
6
     <meta http-equiv="refresh" content="0; url=/cgi-bin/koha/installer/onboarding.pl?step=5" />
7
[% END %]
8
<title>Koha &rsaquo; Web installer &rsaquo; Create a new item type </title>
4
[% INCLUDE 'installer-doc-head-close.inc' %]
9
[% INCLUDE 'installer-doc-head-close.inc' %]
5
<head>
10
[% INCLUDE 'validator-strings.inc' %]
6
    <title>Create item type</title>
11
[% INCLUDE 'installer-strings.inc' %]
12
<script type="text/javascript" src="[% interface %]/[% theme %]/js/onboarding.js"></script>
7
</head>
13
</head>
8
<div>
9
    <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1>
10
</div>
11
14
12
[% IF (itemtypes && itemtypes.count >1) %]
15
<body id="installer" class="installer">
13
16
14
     <meta http-equiv="refresh" content="0; url=/cgi-bin/koha/installer/onboarding.pl?step=5">
17
    <div class="container-fluid">
18
        <div class="row">
19
            <div id="installer-step3" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2">
15
20
16
[% ELSIF op == "add_validate" %]
21
            <h1 id="logo"><a href="#">Koha</a></h1>
17
        [% IF message != "error_on_insert" %]
18
            <form name="createitemtype" method="post" action="onboarding.pl">
19
                <input type="hidden" name="step" value="5"/>
20
                <h1 align="left"> New Item type </h1>
21
                <div>
22
                    <p> Success: New item type created!</p>
23
                    <p> To create another item type later and for more settings <br>
24
                    go to: <br>
25
                    More -> Administration -> Item types <br>
26
                </div>
27
                Next up:
28
                <input type="submit" value="Add a circulation rule"/>
29
            </form>
30
        [% ELSE %]
31
        <form name="retryitem" method="post" action="onboarding.pl">
32
            <input type="hidden" name="step" value="4"/>
33
            <h1 align="left">Failed </h1>
34
            <div>
35
                <p>Item type was not successfully created. </br>
36
                Please try again or contact your system administrator.
37
                </p>
38
            </div>
39
        </form>
40
        <!--Implement a if statement to check if the item type was successfully created or not -->
41
        [% END %]
42
[% ELSE %]
43
    <!--Create a item type screen 1-->
44
        <h1 align="center"> Create a new Item type </h1>
45
        <p> Item types are used to group related items. Examples of item types are books, cds, and DVDs. <br><br> When adding to your institutions catalogue you will create an item of a particular item type. <br><br> Importantly item types are what you apply     circulation rules to. Circulation rules govern how your institution will lend its items, for example a circulation rule applied to the DVD item type may enforce a payment of $1.00 for borrowing any DVD.</p>
46
        <form name="createitemform" method="post" action="onboarding.pl">
47
            <fieldset class="rows">
48
                <input type="hidden" name="step" value="4"/>
49
                <input type="hidden" name="op" value="add_validate" />
50
                <ol>
51
                    <li>
52
                        <label for="itemtype" class="required">Item type code: </label>
53
                        <input type="text" name="itemtype" pattern="[0-9A-Za-z]{1,10}" title="Please enter up to 10 letters and/or numbers" id="itemtype" size="10" maxlength="10"  class="required" required="required" value="[% itemtype.itemtype |html %]" />
54
                        <span class="required">Required</span>
55
                    </li>
56
22
57
                    <li>
23
            [% IF op == "add_validate" %]
58
                        <label for="description" class="required">Description: </label>
24
                [% IF message != "error_on_insert" %]
59
                        <input type="text" name="description" id="description" title="Please only enter letters and/or numbers into this item type description" size="42" value="[% itemtype.description |html %]" class="required" required="required">
25
60
                        <span class="required">Required</span>
26
                    <h2>Web installer &rsaquo; Item type created</h2>
61
                    </li>
27
62
                </ol>
28
                    <form id="createitemtype" method="post" action="onboarding.pl">
63
            <br>
29
                        <input type="hidden" name="step" value="5"/>
64
            <input type="submit" class="action" value="Submit"/>
30
                        <div class="alert alert-success"> Success: New item type created!</div>
65
        </fieldset>
31
                        <p> To create another item type later and for more settings go to: </p>
66
        </form>
32
                        <div class="breadcrumbs"> Administration &rsaquo; Item types </div>
67
[% END %]
33
                        <input type="submit" class="btn btn-primary" value="Continue to the next step"/>
34
                    </form>
35
                [% ELSE %]
36
37
                    <h2>Web installer &rsaquo; Item type creation failed</h2>
38
39
                    <form id="retryitem" method="post" action="onboarding.pl">
40
                        <input type="hidden" name="step" value="4"/>
41
                        <h1 align="left">Failed </h1>
42
                        <div class="alert alert-danger">
43
                            <p>Item type was not successfully created. </br>
44
                            Please try again or contact your system administrator.
45
                            </p>
46
                        </div>
47
                    </form>
48
                <!--Implement a if statement to check if the item type was successfully created or not -->
49
                [% END %]
50
            [% ELSE %]
51
                <!--Create a item type screen 1-->
52
                    <h2>Web installer &rsaquo; Create a new item type </h2>
53
54
                    <p> Item types are used to group related items. Examples of item types might be books, CDs, or DVDs.</p>
55
                    <p> When adding to your institution's catalog you will create an item of a particular item type.</p>
56
                    <p> Importantly item types are what you apply circulation rules to. Circulation rules govern how your institution will lend its items: Checkout length, renewal policy, hold policy, etc. For example a circulation rule applied to the DVD item type may enforce a payment of $1.00 for checking out any DVD.</p>
57
58
                    <form id="createitemform" method="post" action="onboarding.pl">
59
                        <fieldset class="rows">
60
                            <input type="hidden" name="step" value="4"/>
61
                            <input type="hidden" name="op" value="add_validate" />
62
                            <ol>
63
                                <li>
64
                                    <label for="itemtype" class="required">Item type code: </label>
65
                                    <input type="text" name="itemtype"  id="itemtype" size="10" maxlength="10" class="required" required="required" />
66
                                    <span class="required">Required</span>
67
                                </li>
68
69
                                <li>
70
                                    <label for="description" class="required">Description: </label>
71
                                    <input type="text" name="description" id="description" size="42" class="required" required="required">
72
                                    <span class="required">Required</span>
73
                                </li>
74
                            </ol>
75
                            <input type="submit" class="btn btn-primary" value="Submit"/>
76
                        </fieldset>
77
                    </form>
78
            [% END %]
79
        </div>
80
    </div>
81
82
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt (-115 / +119 lines)
Lines 1-127 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Create Circulation rule</title>
2
<title>Koha &rsaquo; Web installer &rsaquo; Create circulation rule</title>
3
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %]
3
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %]
4
[% INCLUDE 'installer-doc-head-close.inc' %]
4
[% INCLUDE 'installer-doc-head-close.inc' %]
5
[% INCLUDE 'validator-strings.inc' %]
6
[% INCLUDE 'installer-strings.inc' %]
7
<script type="text/javascript" src="[% interface %]/[% theme %]/js/onboarding.js"></script>
8
</head>
5
9
6
<div>
10
<body id="installer" class="installer">
7
    <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1>
8
</div>
9
11
10
[% IF (finish) %]
12
    <div class="container-fluid">
11
<h1>Congratulations you have finished and ready to use Koha</h1>
13
        <div class="row">
12
<a href="/cgi-bin/koha/mainpage.pl">Start using Koha</a>
14
            <div id="installer-step3" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2">
13
15
14
[% END %]
16
            <h1 id="logo"><a href="#">Koha</a></h1>
15
17
16
<!--Create a circulation rule screen 2-->
18
            [% IF (finish) %]
17
[% IF op == "add_validate" %]
18
        <!--New circulation rule created-->
19
        <form name="finish" method="post" action="onboarding.pl">
20
            <input type="hidden" name="op" value="finish" />
21
            <h1 align="left"> New circulation rule </h1>
22
            <div>
23
                 <p> Success: circulation rule created!</p>
24
                 <p> To create circulation rule, go to <br>
25
                 More -> Administration -> Circulation and Fine Rules
26
            </div>
27
                 Next up:
28
                 <input type="submit" name="op" value="Finish"/>
29
        </form>
30
[% ELSE %]
31
<!--Create a circulation rule screen 1-->
32
       <h1 align="left"> Create a new circulation rule </h1>
33
       <form name="createcirculationrule" method="post" action="onboarding.pl">
34
            <fieldset class="rows">
35
                 <input type="hidden" name="step" value="5"/>
36
                 <input type="hidden" name="op" value="add_validate" />
37
                    <ol>
38
                    <li>
39
                        <label for="branch" class="required"> Library branch</label>
40
                        <select name="branch" id="branchname" required="required">
41
                        <option value""> Choose</option>
42
                        <option value="*" selected="selected">All</option>
43
                        [% FOREACH library IN libraries %]
44
                            <option id="branch" value="[% library.branchcode %]"> [% library.branchname %]</option>
45
                        [% END %]
46
                        </select>
47
                        <span class="required">Required</span>
48
                    </li>
49
                    <li>
50
                        <label for="categorycode" class="required">Patron category: </label>
51
                        <select name="categorycode" id="categorycodeselection" required="required" onchange = "update_categorycode(this);">
52
                            <option value=""> Choose</option>
53
                            <option value="*" selected="selected">All</option>
54
                            [% FOREACH category IN categories %]
55
                                <option id="categorycode" value = "[% category.categorycode %]"> [%category.description %]</option>
56
                            [%END%]
57
                        </select>
58
                        <span class="required">Required</span>
59
                    </li>
60
19
61
                    <li>
20
                <h2>Web installer &rsaquo; Complete</h2>
62
                        <label for="itemtype"> Item type: </label>
21
                <h3>Congratulations you have finished and ready to use Koha</h3>
63
                        <select id="itemtype" name="itemtype" required="required">
22
                <a class="btn btn-success" href="/cgi-bin/koha/mainpage.pl">Start using Koha</a>
64
                        <option value""> Choose </option>
65
                        <option value="*" selected="selected">All</option>
66
                            [% FOREACH item IN itemtypes %]
67
                                <option name="itemtype" value = "[% item.itemtype %]"> [% item.itemtype %]
68
                            [%END%]
69
                        </select>
70
                        <span class="required"> Required</span>
71
                    </li>
72
                    <li>
73
                        <label for="maxissueqty" class="required">Current checkouts allowed: </label>
74
                        <input type="number" min="0" name="maxissueqty" title="Please only enter numbers" id="maxissueqty" size="10" max="10" value="" class="required" required="required" />
75
                        <span class="required">Required</span>
76
                    </li>
77
23
78
                    <li>
24
            [% END %]
79
                        <label for="issuelength" class="required">Loan period: </label>
80
                        <input type="number" min="0" name="issuelength" title="Please only enter numbers" id="issuelength" size="10" max="10" value="" class="required" required="required" />
81
                        <span class="required">Required</span>
82
                   </li>
83
                   <li>
84
                        <label for="lengthunit">Units: </label>
85
                        <select name="lengthunit" id="lengthunit" required="required">
86
                        <option value=""> Choose </option>
87
                        [% SET units = 'days' %]
88
                        [% IF category %]
89
                            [% SET default_privacy = category.default_privacy %]
90
                        [% END %]
91
25
92
                        [% SWITCH units %]
26
            <!--Create a circulation rule screen 2-->
93
                             [% CASE 'days' %]
94
                                   <option value="days" selected="selected">Days</option>
95
                                   <option value="hours">Hours</option>
96
                             [% CASE 'hours' %]
97
                                   <option value="days">Days</option>
98
                                   <option value="hours" selected="selected">Hours</option>
99
                        [% END %]
100
                        </select>
101
                     </li>
102
                     <li>
103
                        <label for="renewalsallowed" class="required">Renewals allowed: </label>
104
                        <input type="number" min="0" name="renewalsallowed" title="Please only enter numbers" id="renewalsallowed" size="10" max="10" value="" class="required" required="required" />
105
                        <span class="required">Required</span>
106
                     </li>
107
27
108
                     <li>
28
            [% IF op == "add_validate" %]
109
                        <label for="renewalperiod" class="required">Renewals period: </label>
29
                    <!--New circulation rule created-->
110
                        <input type="number" min="0" name="renewalperiod" title="Please only enter numbers" id="renewalperiod" size="10" max="10" value="" class="required" required="required" />
30
                    <h2>Web installer &rsaquo; New circulation rule created</h2>
111
                        <span class="required">Required</span>
31
                    <form id="finish" method="post" action="onboarding.pl">
112
                     </li>
32
                        <input type="hidden" name="op" value="finish" />
33
                        <div class="alert alert-success">
34
                            Success: circulation rule created!
35
                        </div>
36
                        <p> To create more circulation rules, go to: </p>
37
                        <div class="breadcrumbs">Administration &rsaquo; Circulation and fine rules</div>
38
                         <input type="submit" class="btn btn-primary" value="Finish" />
39
                    </form>
40
            [% ELSE %]
113
41
114
                     <li>
42
            <!--Create a circulation rule screen 1-->
115
                        <label for="onshelfholds">On shelf holds allowed: </label>
43
                    <h2>Web installer &rsaquo; Create a new circulation rule </h2>
116
                        <select name="onshelfholds" id="onshelfholds" required="required">
44
                    <form id="createcirculationrule" method="post" action="onboarding.pl">
117
                              <option value="">Choose</option>
45
                        <fieldset class="rows">
118
                              <option value="1" selected="selected">Yes</option>
46
                            <input type="hidden" name="step" value="5"/>
119
                              <option value="0">If any unavailable</option>
47
                            <input type="hidden" name="op" value="add_validate" />
120
                              <option value="2">If all unavailable</option>
48
                                <ol>
121
                        </select>
49
                                    <li>
122
                     </li>
50
                                        <label for="branchname" class="required"> Library branch</label>
123
                  </ol>
51
                                        <select name="branch" id="branchname" required="required">
124
            </fieldset><br>
52
                                            <option value=""> Choose</option>
125
                <input type="submit" class="action" value="Submit"/>
53
                                            <option value="*" selected="selected">All</option>
126
     </form>
54
                                            [% FOREACH library IN libraries %]
127
[% END %]
55
                                                <option id="branch" value="[% library.branchcode %]"> [% library.branchname %]</option>
56
                                            [% END %]
57
                                        </select>
58
                                        <span class="required">Required</span>
59
                                    </li>
60
                                    <li>
61
                                        <label for="categorycodeselection" class="required">Patron category: </label>
62
                                        <select name="categorycode" id="categorycodeselection" required="required">
63
                                            <option value=""> Choose</option>
64
                                            <option value="*" selected="selected">All</option>
65
                                            [% FOREACH category IN categories %]
66
                                                <option id="categorycode" value = "[% category.categorycode %]"> [%category.description %]</option>
67
                                            [%END%]
68
                                        </select>
69
                                        <span class="required">Required</span>
70
                                    </li>
71
72
                                    <li>
73
                                        <label for="itemtype"> Item type: </label>
74
                                        <select id="itemtype" name="itemtype" required="required">
75
                                        <option value=""> Choose </option>
76
                                        <option value="*" selected="selected">All</option>
77
                                            [% FOREACH item IN itemtypes %]
78
                                                <option value = "[% item.itemtype %]"> [% item.itemtype %]</option>
79
                                            [%END%]
80
                                        </select>
81
                                        <span class="required"> Required</span>
82
                                    </li>
83
                                    <li>
84
                                        <label for="maxissueqty" class="required">Current checkouts allowed: </label>
85
                                        <input type="number" min="0" name="maxissueqty" title="Please only enter numbers" id="maxissueqty" size="10" class="required" required="required" />
86
                                        <span class="required">Required</span>
87
                                    </li>
88
89
                                    <li>
90
                                        <label for="issuelength" class="required">Loan period: </label>
91
                                        <input type="number" min="0" name="issuelength" title="Please only enter numbers" id="issuelength" size="10" class="required" required="required" />
92
                                        <span class="required">Required</span>
93
                                   </li>
94
                                   <li>
95
                                        <label for="lengthunit">Units: </label>
96
                                        <select name="lengthunit" id="lengthunit" required="required">
97
                                            <option value=""> Choose </option>
98
                                            <option value="days" selected="selected">Days</option>
99
                                            <option value="hours">Hours</option>
100
                                        </select>
101
                                     </li>
102
                                     <li>
103
                                        <label for="renewalsallowed" class="required">Renewals allowed: </label>
104
                                        <input type="number" min="0" name="renewalsallowed" title="Please only enter numbers" id="renewalsallowed" size="10" class="required" required="required" />
105
                                        <span class="required">Required</span>
106
                                     </li>
107
108
                                     <li>
109
                                        <label for="renewalperiod" class="required">Renewals period: </label>
110
                                        <input type="number" min="0" name="renewalperiod" title="Please only enter numbers" id="renewalperiod" size="10" class="required" required="required" />
111
                                        <span class="required">Required</span>
112
                                     </li>
113
114
                                     <li>
115
                                        <label for="onshelfholds">On shelf holds allowed: </label>
116
                                        <select name="onshelfholds" id="onshelfholds" required="required">
117
                                            <option value="">Choose</option>
118
                                            <option value="1" selected="selected">Yes</option>
119
                                            <option value="0">If any unavailable</option>
120
                                            <option value="2">If all unavailable</option>
121
                                        </select>
122
                                     </li>
123
                              </ol>
124
                        </fieldset>
125
                        <input type="submit" class="btn btn-primary" value="Submit" />
126
                 </form>
127
            [% END %]
128
        </div>
129
    </div>
130
131
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/onboarding.js (-1 / +150 lines)
Line 0 Link Here
0
- 
1
function _(s) { return s; } // dummy function for gettext
2
3
jQuery.validator.addMethod( "category_code_check", function(value,element){
4
    var patt = /^[A-Za-z]{0,10}$/g;
5
    if (patt.test(element.value)) {
6
        return true;
7
    } else {
8
        return false;
9
    }
10
    }, MSG_LETTERS_ONLY
11
);
12
13
jQuery.validator.addMethod( "letters_only", function(value,element){
14
        var patt =/^[A-Za-z ]{0,30}$/g;
15
        if (patt.test(element.value)){
16
            return true;
17
        } else {
18
            return false;
19
        }
20
    }, MSG_LETTERS_ONLY
21
);
22
23
jQuery.validator.addMethod( "enrollment_period", function(){
24
      enrolmentperiod = $("#enrolmentperiod").val();
25
      enrolmentperioddate = $("#enrolmentperioddate").val();
26
      if (( $("#enrolmentperiod").val() === "" && $("#enrolmentperioddate").val() === "") || ($("#enrolmentperiod").val() !== "" && $("#enrolmentperioddate").val() !== "")) {
27
             return false;
28
      } else {
29
             return true;
30
      }
31
    }, MSG_ONLY_ONE_ENROLLMENTPERIOD
32
);
33
34
jQuery.validator.addMethod( "password_match", function(value,element){
35
        var MSG_PASSWORD_MISMATCH = ( MSG_PASSWORD_MISMATCH );
36
        var password = document.getElementById('password').value;
37
        var confirmpassword = document.getElementById('password2').value;
38
39
        if ( password != confirmpassword ){
40
               return false;
41
          }
42
          else{
43
               return true;
44
          }
45
    },  MSG_PASSWORD_MISMATCH
46
);
47
48
jQuery.validator.addMethod( "cardnumber_check", function(value,element){
49
          var patt =/[A-Za-z1-9 ]+$/g;
50
          if (patt.test(element.value)){
51
              return true;
52
          } else {
53
              return false;
54
          }
55
     }, MSG_LETTERS_NUMBERS_ONLY
56
);
57
58
function toUC(f) {
59
    var x=f.value.toUpperCase();
60
    f.value=x;
61
    return true;
62
}
63
64
$(document).ready(function() {
65
    if ($("#branches option:selected").length < 1) {
66
        $("#branches option:first").attr("selected", "selected");
67
    }
68
    $("#categorycode").on("blur",function(){
69
         toUC(this);
70
    });
71
72
    $("#enrolmentperioddate").datepicker({
73
        minDate: 1
74
    }); // Require that "until date" be in the future
75
76
    $("#category_form").validate({
77
        rules: {
78
            categorycode: {
79
                    required: true,
80
                    category_code_check: true
81
            },
82
            description: {
83
                    required:true
84
            },
85
            enrolmentperiod: {
86
                   required: function(element){
87
                         return $("#enrolmentperioddate").val() === "";
88
                   },
89
                   digits: true,
90
                   enrollment_period: true,
91
            },
92
            enrolmentperioddate: {
93
                    required: function(element){
94
                        return $("#enrolmentperiod").val() === "";
95
                    },
96
                    enrollment_period: true,
97
                    // is_valid_date ($(#"enrolementperioddate").val());
98
            },
99
            dateofbirthrequired: {
100
                    digits: true
101
            },
102
            upperagelimit: {
103
                    digits: true
104
            },
105
            enrolmentfee: {
106
                    number: true
107
            },
108
            reservefee: {
109
                    number: true
110
            },
111
            category_type: {
112
                    required: true
113
            }
114
        },
115
        messages: {
116
            enrolmentperiod: {
117
                    required: MSG_ONE_ENROLLMENTPERIOD
118
            },
119
            enrolmentperioddate: {
120
                    required: MSG_ONE_ENROLLMENTPERIOD
121
            }
122
        }
123
    });
124
125
    $("#createpatron").validate({
126
        rules: {
127
            surname: {
128
                required: true
129
            },
130
            firstname: {
131
                required: true
132
            },
133
            cardnumber: {
134
                required: true
135
            },
136
            password: {
137
                password_match: true
138
            }
139
        },
140
        messages: {
141
            password: {
142
                required: MSG_PASSWORD_MISMATCH
143
            },
144
        }
145
146
    });
147
148
    $("#createitemform").validate();
149
    $("#createcirculationrule").validate();
150
});

Return to bug 17942