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

(-)a/C4/Members.pm (-26 lines)
Lines 71-77 BEGIN { Link Here
71
        &GetNoticeEmailAddress
71
        &GetNoticeEmailAddress
72
72
73
        &GetAge
73
        &GetAge
74
        &GetSortDetails
75
        &GetTitles
74
        &GetTitles
76
75
77
        &GetHideLostItemsPreference
76
        &GetHideLostItemsPreference
Lines 1599-1629 sub SetAge{ Link Here
1599
    return $borrower;
1598
    return $borrower;
1600
}    # sub SetAge
1599
}    # sub SetAge
1601
1600
1602
=head2 GetSortDetails (OUEST-PROVENCE)
1603
1604
  ($lib) = &GetSortDetails($category,$sortvalue);
1605
1606
Returns the authorized value  details
1607
C<&$lib>return value of authorized value details
1608
C<&$sortvalue>this is the value of authorized value 
1609
C<&$category>this is the value of authorized value category
1610
1611
=cut
1612
1613
sub GetSortDetails {
1614
    my ( $category, $sortvalue ) = @_;
1615
    my $dbh   = C4::Context->dbh;
1616
    my $query = qq|SELECT lib 
1617
        FROM authorised_values 
1618
        WHERE category=?
1619
        AND authorised_value=? |;
1620
    my $sth = $dbh->prepare($query);
1621
    $sth->execute( $category, $sortvalue );
1622
    my $lib = $sth->fetchrow;
1623
    return ($lib) if ($lib);
1624
    return ($sortvalue) unless ($lib);
1625
}
1626
1627
=head2 MoveMemberToDeleted
1601
=head2 MoveMemberToDeleted
1628
1602
1629
  $result = &MoveMemberToDeleted($borrowernumber);
1603
  $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 390-397 function validate1(date) { Link Here
390
        [% END %]
390
        [% END %]
391
    </li>
391
    </li>
392
392
393
    [% IF ( sort1 ) %]<li><span class="label">Sort field 1:</span>[% lib1 %]</li>[% END %]
393
    [% IF ( sort1 ) %]<li><span class="label">Sort field 1:</span>[% AuthorisedValues.GetByCode('Bsort1', sort1) %]</li>[% END %]
394
    [% IF ( sort2 ) %]<li><span class="label">Sort field 2:</span>[% lib2 %]</li>[% END %]
394
    [% IF ( sort2 ) %]<li><span class="label">Sort field 2:</span>[% AuthorisedValues.GetByCode('Bsort2', sort2) %]</li>[% END %]
395
    <li><span class="label">Username: </span>[% userid %]</li>
395
    <li><span class="label">Username: </span>[% userid %]</li>
396
    <li><span class="label">Password: </span>
396
    <li><span class="label">Password: </span>
397
    [% IF ( password ) %]
397
    [% 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