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

(-)a/about.pl (+46 lines)
Lines 460-465 $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; Link Here
460
        );
460
        );
461
    }
461
    }
462
}
462
}
463
464
# Guarantor relationships warnings
465
{
466
    my $dbh   = C4::Context->dbh;
467
    my ($bad_relationships_count) = $dbh->selectall_arrayref(q{
468
        SELECT COUNT(*)
469
        FROM (
470
            SELECT relationship FROM borrower_relationships WHERE relationship='_bad_data'
471
            UNION ALL
472
            SELECT relationship FROM borrowers WHERE relationship='_bad_data') a
473
    });
474
475
    $bad_relationships_count = $bad_relationships_count->[0]->[0];
476
477
    my @existing_relationships = $dbh->selectall_array(q{
478
        SELECT DISTINCT(relationship)
479
        FROM (
480
            SELECT relationship FROM borrower_relationships WHERE relationship IS NOT NULL
481
            UNION ALL
482
            SELECT relationship FROM borrowers WHERE relationship IS NOT NULL) a     
483
    });
484
485
    my %valid_relationships = map { $_ => 1 } split( /,|\|/, C4::Context->preference('borrowerRelationship') );
486
    $valid_relationships{ _bad_data } = 1; # we handle this case in another way
487
488
    my @wrong_relationships = grep { !$valid_relationships{ $_->[0] } } @existing_relationships;
489
490
    if ( @wrong_relationships or $bad_relationships_count ) {
491
492
        $template->param(
493
            warnRelationships => 1,
494
        );
495
496
        if ( @wrong_relationships ) {
497
            $template->param(
498
                wrong_relationships => \@wrong_relationships
499
            );
500
        }
501
        if ($bad_relationships_count) {
502
            $template->param(
503
                bad_relationships_count => $bad_relationships_count,
504
            );
505
        }
506
    }
507
}
508
463
my %versions = C4::Context::get_versions();
509
my %versions = C4::Context::get_versions();
464
510
465
$template->param(
511
$template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt (-2 / +18 lines)
Lines 184-190 Link Here
184
        </div>
184
        </div>
185
185
186
        <div id="sysinfo">
186
        <div id="sysinfo">
187
    [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs %]
187
    [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships %]
188
        [% IF (warnIsRootUser) %]
188
        [% IF (warnIsRootUser) %]
189
            <h2>Warning regarding current user</h2>
189
            <h2>Warning regarding current user</h2>
190
            <p>You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.</p>
190
            <p>You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.</p>
Lines 229-234 Link Here
229
            <br/>
229
            <br/>
230
        [% END %]
230
        [% END %]
231
231
232
        [% IF warnRelationships %]
233
            <h2>Patron relationship problems</h2>
234
            [% IF bad_relationships_count %]
235
                <p>Your database contained guarantee/guarantor pairs with no defined relationship. They have been set the value '_bad_data' in the [% "borrowers.relationship" | $HtmlTags tag="strong" %] and/or [% "borrower_relationships.relationship" | $HtmlTags tag="strong" %] columns. Fix them manually by recreating those relationships, or have your system's administrator correct the values.</p>
236
            [% END %]
237
238
            [% IF wrong_relationships %]
239
                <p>The following values have been used for guarantee/guarantor relationships, but do not exist in the 'borrowerRelationship' system preference:</p>
240
                <ul>
241
                    [% FOR rel IN wrong_relationships %]
242
                        <li>[% rel.0 | html %]</li>
243
                    [% END %]
244
                </ul>
245
                <p>If the relationship is one you want, please add it to the 'borrowerRelationship' system preference, otherwise have your system's administrator correct the values in [% "borrowers.relationship" | $HtmlTags tag="strong" %] and/or [% "borrower_relationships.relationship" | $HtmlTags tag="strong" %] in the database.</p>
246
            [% END %]
247
        [% END %]
248
232
        [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules %]
249
        [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules %]
233
            <h2>Warnings regarding the system configuration</h2>
250
            <h2>Warnings regarding the system configuration</h2>
234
            <table>
251
            <table>
235
- 

Return to bug 14570