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

(-)a/installer/install.pl (-117 / +25 lines)
Lines 4-19 use strict; Link Here
4
use warnings;
4
use warnings;
5
use diagnostics;
5
use diagnostics;
6
6
7
# use Install;
8
use InstallAuth;
7
use InstallAuth;
8
use CGI;
9
use IPC::Cmd;
10
9
use C4::Context;
11
use C4::Context;
10
use C4::Output;
12
use C4::Output;
11
use C4::Languages qw(getAllLanguages getTranslatedLanguages);
13
use C4::Languages qw(getAllLanguages getTranslatedLanguages);
12
use C4::Installer;
14
use C4::Installer;
13
15
14
use CGI;
15
use IPC::Cmd;
16
17
my $query = new CGI;
16
my $query = new CGI;
18
my $step  = $query->param('step');
17
my $step  = $query->param('step');
19
18
Lines 57-182 if ( $step && $step == 1 ) { Link Here
57
    #Checking ALL perl Modules and services needed are installed.
56
    #Checking ALL perl Modules and services needed are installed.
58
    #Whenever there is an error, adding a report to the page
57
    #Whenever there is an error, adding a report to the page
59
    $template->param( language => 1 );
58
    $template->param( language => 1 );
60
    my $problem;
59
    $template->param( 'checkmodule' => 1 ); # we start with the assumption that there are no problems and set this to 0 if there are
61
60
62
    unless ( $] >= 5.006001 ) {    # Bug 179
61
    unless ( $] >= 5.006001 ) {    # Bug 179
63
        $template->param( "problems" => 1, "perlversion" => 1 );
62
        $template->param( problems => 1, perlversion => 1, checkmodule => 0 );
64
        $problem = 1;
65
    }
66
67
    # We could here use a special find
68
    my @missing = ();
69
    unless ( eval { require ZOOM } ) {
70
        push @missing, { name => "ZOOM" };
71
    }
72
    unless ( eval { require YAML::Syck } ) {
73
        push @missing, { name => "YAML::Syck" };
74
    }
75
    unless ( eval { require LWP::Simple } ) {
76
        push @missing, { name => "LWP::Simple" };
77
    }
78
    unless ( eval { require XML::Simple } ) {
79
        push @missing, { name => "XML::Simple" };
80
    }
81
    unless ( eval { require MARC::File::XML } ) {
82
        push @missing, { name => "MARC::File::XML" };
83
    }
84
    unless ( eval { require MARC::File::USMARC } ) {
85
        push @missing, { name => "MARC::File::USMARC" };
86
    }
87
    unless ( eval { require DBI } ) {
88
        push @missing, { name => "DBI" };
89
    }
90
    unless ( eval { require Date::Manip } ) {
91
        push @missing, { name => "Date::Manip" };
92
    }
93
    unless ( eval { require DBD::mysql } ) {
94
        push @missing, { name => "DBD::mysql" };
95
    }
96
    unless ( eval { require HTML::Template::Pro } ) {
97
        push @missing, { name => "HTML::Template::Pro" };
98
    }
99
    unless ( eval { require Date::Calc } ) {
100
        push @missing, { name => "Date::Calc" };
101
    }
102
    unless ( eval { require Digest::MD5 } ) {
103
        push @missing, { name => "Digest::MD5" };
104
    }
105
    unless ( eval { require MARC::Record } ) {
106
        push @missing, { name => "MARC::Record" };
107
    }
108
    unless ( eval { require Mail::Sendmail } ) {
109
        push @missing, { name => "Mail::Sendmail", usagemail => 1 };
110
    }
111
    unless ( eval { require List::MoreUtils } ) {
112
        push @missing, { name => "List::MoreUtils" };
113
    }
114
    unless ( eval { require XML::RSS } ) {
115
        push @missing, { name => "XML::RSS" };
116
    }
117
    unless ( eval { require CGI::Carp } ) {
118
        push @missing, { name => "CGI::Carp" };
119
    }
63
    }
120
64
65
    my $perl_modules = C4::Installer::PerlModules->new;
66
    $perl_modules->version_info;
121
67
122
# The following modules are not mandatory, depends on how the library want to use Koha
68
    my $modules = $perl_modules->get_attr('missing_pm');
123
    unless ( eval { require PDF::API2 } ) {
69
    if (scalar(@$modules)) {
124
        if ( $#missing >= 0 ) {   # only when $#missing >= 0 so this isn't fatal
70
        my @components = ();
125
            push @missing, { name => "PDF::API2", usagebarcode => 1 };
71
        my $checkmodule = 1;
126
        }
72
        foreach (@$modules) {
127
    }
73
            my ($module, $stats) = each %$_;
128
    unless ( eval { require GD::Barcorde } ) {
74
            $checkmodule = 0 if $stats->{'required'};
129
        if ( $#missing >= 0 ) {   # only when $#missing >= 0 so this isn't fatal
75
            push(
130
            push @missing,
76
                @components,
131
              { name => "GD::Barcode", usagebarcode => 1, usagespine => 1 };
77
                {
132
        }
78
                    name    => $module,
133
    }
79
                    version => $stats->{'min_ver'},
134
    unless ( eval { require GD } ) {
80
                    require => $stats->{'required'},
135
        if ( $#missing >= 0 ) {   # only when $#missing >= 0 so this isn't fatal
81
                    usage   => $stats->{'usage'},
136
            push @missing,
82
                }
137
              { name => "GD", usagepatronimages => 1 };
83
            );
138
        }
139
    }
140
    unless ( eval { require Graphics::Magick } ) {
141
        if ( $#missing >= 0 ) {   # only when $#missing >= 0 so this isn't fatal
142
            push @missing,
143
              { name => "Graphics::Magick", usagepatroncards => 1 };
144
        }
145
    }
146
    unless ( eval { require Data::Random } ) {
147
        if ( $#missing >= 0 ) {   # only when $#missing >= 0 so this isn't fatal
148
            push @missing, { name => "Data::Random", usagebarcode => 1 };
149
        }
150
    }
151
    unless ( eval { require PDF::Reuse::Barcode } ) {
152
        if ( $#missing >= 0 ) {   # only when $#missing >= 0 so this isn't fatal
153
            push @missing, { name => "PDF::Reuse::Barcode", usagebarcode => 1 };
154
        }
155
    }
156
    unless ( eval { require PDF::Report } ) {
157
        if ( $#missing >= 0 ) {   # only when $#missing >= 0 so this isn't fatal
158
            push @missing, { name => "PDF::Report", usagebarcode => 1 };
159
        }
160
    }
161
    unless ( eval { require Algorithm::CheckDigits } ) {
162
        if ( $#missing >= 0 ) {   # only when $#missing >= 0 so this isn't fatal
163
            push @missing, { name => "Algorithm::CheckDigits", usagebarcode => 1 };
164
        }
165
    }
166
    unless ( eval { require GD::Barcode::UPCE } ) {
167
        if ( $#missing >= 0 ) {   # only when $#missing >= 0 so this isn't fatal
168
            push @missing, { name => "GD::Barcode::UPCE", usagepine => 1 };
169
        }
170
    }
171
    unless ( eval { require Net::LDAP } ) {
172
        if ( $#missing >= 0 ) {   # only when $#missing >= 0 so this isn't fatal
173
            push @missing, { name => "Net::LDAP", usageLDAP => 1 };
174
        }
84
        }
85
        @components = sort {$a->{'name'} cmp $b->{'name'}} @components;
86
        $template->param( missing_modules => \@components, checkmodule => $checkmodule );
175
    }
87
    }
176
    $template->param( missings => \@missing ) if ( scalar(@missing) > 0 );
177
    $template->param( 'checkmodule' => 1 )
178
      unless ( scalar(@missing) && $problem );
179
180
}
88
}
181
elsif ( $step && $step == 2 ) {
89
elsif ( $step && $step == 2 ) {
182
#
90
#
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tmpl (-26 / +14 lines)
Lines 31-62 listed, please inform your systems administrator.</p> Link Here
31
<!--/TMPL_UNLESS-->
31
<!--/TMPL_UNLESS-->
32
<!--TMPL_IF Name="language"-->
32
<!--TMPL_IF Name="language"-->
33
  <!--TMPL_UNLESS Name="checkmodule"-->
33
  <!--TMPL_UNLESS Name="checkmodule"-->
34
  <!--TMPL_IF Name="missing"-->
34
  <!--TMPL_IF Name="missing_modules"-->
35
  <p>Some perl modules are missing.<br />
35
  <p>Some perl modules are missing. Modules in red <b>must</b> be installed before you may continue.<br />
36
  <ul>
36
  <ul>
37
  <!--TMPL_LOOP Name="missing"-->
37
  <!--TMPL_LOOP Name="missing_modules"-->
38
    <!--TMPL_IF Name="require"-->
39
    <li style="color:#FF0000;font-weight:bold;"><!--TMPL_VAR Name="name"-->
40
    <!-- TMPL_ELSE -->
38
    <li><!--TMPL_VAR Name="name"-->
41
    <li><!--TMPL_VAR Name="name"-->
39
    <!--TMPL_IF Name="usagemail"-->
40
      <br /> This module is used whenever Koha has to send email.
41
    <!--TMPL_ELSIF Name="usagebarcode"-->
42
      <br /> This module is needed if you intend to print barcodes.
43
    <!--TMPL_ELSIF Name="usagespine"-->
44
      <br /> This module is needed if you intend to print spine labels.
45
    <!--TMPL_ELSIF Name="usageLDAP"-->
46
      <br /> This module is needed if you intend to use LDAP for authentication.
47
    <!--TMPL_ELSIF Name="usagepatronimages"-->
48
      <br /> This module is needed if you intend to use patron images.
49
    <!--TMPL_ELSIF Name="usagepatroncards"-->
50
      <br /> This module is needed if you intend to use the patron card creator.
51
    <!--/TMPL_IF-->
42
    <!--/TMPL_IF-->
43
      <br /> Version: <!--TMPL_VAR Name="version"-->
44
      <br /> Usage: <!--TMPL_VAR Name="usage"-->
52
    </li>
45
    </li>
53
  <!--/TMPL_LOOP-->
46
  <!--/TMPL_LOOP-->
54
  Please consider installing these modules before continuing.
55
  <pre>
56
  <!--TMPL_LOOP Name="missing"-->
57
    perl -MCPAN -e "install <!--TMPL_VAR Name="name"-->";
58
  <!--/TMPL_LOOP-->
59
  </pre>
60
  <!--/TMPL_IF-->
47
  <!--/TMPL_IF-->
61
  <!--TMPL_IF Name="problems"-->
48
  <!--TMPL_IF Name="problems"-->
62
  <p>I encountered some problems.</p>
49
  <p>I encountered some problems.</p>
Lines 68-80 listed, please inform your systems administrator.</p> Link Here
68
   </ul>
55
   </ul>
69
  <!--/TMPL_IF-->
56
  <!--/TMPL_IF-->
70
  <!--/TMPL_UNLESS-->
57
  <!--/TMPL_UNLESS-->
71
  <!--TMPL_IF Name="checkmodule"-->
72
<form name="checkmodules" action="install.pl">
58
<form name="checkmodules" action="install.pl">
73
<p> All dependencies installed.
59
<!--TMPL_IF Name="checkmodule"-->
74
</p>
75
<input type="hidden" name="step" value="2" />
60
<input type="hidden" name="step" value="2" />
61
<p> All dependencies installed.</p>
76
<p>Please click next to continue <input value="Next &gt;&gt;" type="submit" /></p>
62
<p>Please click next to continue <input value="Next &gt;&gt;" type="submit" /></p>
63
<!-- TMPL_ELSE -->
64
<input type="hidden" name="step" value="1" />
65
<p>Click to recheck dependencies <input value="Recheck" type="submit" /></p>
66
<!--/TMPL_IF-->
77
</form>
67
</form>
78
  <!--/TMPL_IF-->
79
<!--/TMPL_IF-->
68
<!--/TMPL_IF-->
80
<!-- TMPL_INCLUDE name="intranet-bottom.inc" -->
69
<!-- TMPL_INCLUDE name="intranet-bottom.inc" -->
81
- 

Return to bug 4444