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

(-)a/C4/Members.pm (-26 lines)
Lines 70-76 BEGIN { Link Here
70
        &GetNoticeEmailAddress
70
        &GetNoticeEmailAddress
71
71
72
        &GetAge
72
        &GetAge
73
        &GetSortDetails
74
        &GetTitles
73
        &GetTitles
75
74
76
        &GetHideLostItemsPreference
75
        &GetHideLostItemsPreference
Lines 1496-1526 sub SetAge{ Link Here
1496
    return $borrower;
1495
    return $borrower;
1497
}    # sub SetAge
1496
}    # sub SetAge
1498
1497
1499
=head2 GetSortDetails (OUEST-PROVENCE)
1500
1501
  ($lib) = &GetSortDetails($category,$sortvalue);
1502
1503
Returns the authorized value  details
1504
C<&$lib>return value of authorized value details
1505
C<&$sortvalue>this is the value of authorized value 
1506
C<&$category>this is the value of authorized value category
1507
1508
=cut
1509
1510
sub GetSortDetails {
1511
    my ( $category, $sortvalue ) = @_;
1512
    my $dbh   = C4::Context->dbh;
1513
    my $query = qq|SELECT lib 
1514
        FROM authorised_values 
1515
        WHERE category=?
1516
        AND authorised_value=? |;
1517
    my $sth = $dbh->prepare($query);
1518
    $sth->execute( $category, $sortvalue );
1519
    my $lib = $sth->fetchrow;
1520
    return ($lib) if ($lib);
1521
    return ($sortvalue) unless ($lib);
1522
}
1523
1524
=head2 MoveMemberToDeleted
1498
=head2 MoveMemberToDeleted
1525
1499
1526
  $result = &MoveMemberToDeleted($borrowernumber);
1500
  $result = &MoveMemberToDeleted($borrowernumber);
(-)a/admin/aqbudgets.pl (-1 / +1 lines)
Lines 30-36 use C4::Branch; # GetBranches Link Here
30
use C4::Auth;
30
use C4::Auth;
31
use C4::Acquisition;
31
use C4::Acquisition;
32
use C4::Budgets;
32
use C4::Budgets;
33
use C4::Members;  # calls GetSortDetails()
33
use C4::Members;
34
use C4::Context;
34
use C4::Context;
35
use C4::Output;
35
use C4::Output;
36
use C4::Koha;
36
use C4::Koha;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-2 / +2 lines)
Lines 391-398 function validate1(date) { Link Here
391
        [% END %]
391
        [% END %]
392
    </li>
392
    </li>
393
393
394
    [% IF ( sort1 ) %]<li><span class="label">Sort field 1:</span>[% lib1 %]</li>[% END %]
394
    [% IF ( sort1 ) %]<li><span class="label">Sort field 1:</span>[% AuthorisedValues.GetByCode('Bsort1', sort1) %]</li>[% END %]
395
    [% IF ( sort2 ) %]<li><span class="label">Sort field 2:</span>[% lib2 %]</li>[% END %]
395
    [% IF ( sort2 ) %]<li><span class="label">Sort field 2:</span>[% AuthorisedValues.GetByCode('Bsort2', sort2) %]</li>[% END %]
396
    <li><span class="label">Username: </span>[% userid %]</li>
396
    <li><span class="label">Username: </span>[% userid %]</li>
397
    <li><span class="label">Password: </span>
397
    <li><span class="label">Password: </span>
398
    [% IF ( password ) %]
398
    [% IF ( password ) %]
(-)a/members/moremember.pl (-4 lines)
Lines 209-218 my $library = Koha::Libraries->find( $data->{branchcode})->unblessed; Link Here
209
@{$data}{keys %$library} = values %$library; # merge in all branch columns
209
@{$data}{keys %$library} = values %$library; # merge in all branch columns
210
210
211
my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
211
my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
212
my $lib1 = &GetSortDetails( "Bsort1", $data->{'sort1'} );
213
my $lib2 = &GetSortDetails( "Bsort2", $data->{'sort2'} );
214
$template->param( lib1 => $lib1 ) if ($lib1);
215
$template->param( lib2 => $lib2 ) if ($lib2);
216
212
217
# If printing a page, send the account informations to the template
213
# If printing a page, send the account informations to the template
218
if ($print eq "page") {
214
if ($print eq "page") {
(-)a/t/db_dependent/Koha.t (-12 / +2 lines)
Lines 21-27 $dbh->{AutoCommit} = 0; Link Here
21
$dbh->{RaiseError} = 1;
21
$dbh->{RaiseError} = 1;
22
22
23
subtest 'Authorized Values Tests' => sub {
23
subtest 'Authorized Values Tests' => sub {
24
    plan tests => 7;
24
    plan tests => 4;
25
25
26
    my $data = {
26
    my $data = {
27
        category            => 'CATEGORY',
27
        category            => 'CATEGORY',
Lines 46-63 subtest 'Authorized Values Tests' => sub { Link Here
46
46
47
# Tests
47
# Tests
48
    SKIP: {
48
    SKIP: {
49
        skip "INSERT failed", 4 unless $insert_success;
49
        skip "INSERT failed", 1 unless $insert_success;
50
50
51
        is ( GetAuthorisedValueByCode($data->{category}, $data->{authorised_value}), $data->{lib}, "GetAuthorisedValueByCode" );
51
        is ( GetAuthorisedValueByCode($data->{category}, $data->{authorised_value}), $data->{lib}, "GetAuthorisedValueByCode" );
52
53
        my $sortdet=C4::Members::GetSortDetails("lost", "3");
54
        is ($sortdet, "Lost and Paid For", "lost and paid works");
55
56
        my $sortdet2=C4::Members::GetSortDetails("loc", "child");
57
        is ($sortdet2, "Children's Area", "Child area works");
58
59
        my $sortdet3=C4::Members::GetSortDetails("withdrawn", "1");
60
        is ($sortdet3, "Withdrawn", "Withdrawn works");
61
    }
52
    }
62
53
63
# Clean up
54
# Clean up
64
- 

Return to bug 16908