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

(-)a/C4/RotatingCollections.pm (-31 lines)
Lines 53-60 BEGIN { Link Here
53
53
54
      GetItemsInCollection
54
      GetItemsInCollection
55
55
56
      GetCollections
57
58
      AddItemToCollection
56
      AddItemToCollection
59
      RemoveItemFromCollection
57
      RemoveItemFromCollection
60
      TransferCollection
58
      TransferCollection
Lines 161-195 sub UpdateCollection { Link Here
161
159
162
}
160
}
163
161
164
=head2 GetCollections
165
166
 $collections = GetCollections();
167
 Returns data about all collections
168
169
 Output:
170
  On Success:
171
   $results: Reference to an array of associated arrays
172
  On Failure:
173
   $errorCode: Code for reason of failure, good for translating errors in templates
174
   $errorMessage: English description of error
175
176
=cut
177
178
sub GetCollections {
179
180
    my $dbh = C4::Context->dbh;
181
182
    my $sth = $dbh->prepare("SELECT * FROM collections");
183
    $sth->execute() or return ( 1, $sth->errstr() );
184
185
    my @results;
186
    while ( my $row = $sth->fetchrow_hashref ) {
187
        push( @results, $row );
188
    }
189
190
    return \@results;
191
}
192
193
=head2 GetItemsInCollection
162
=head2 GetItemsInCollection
194
163
195
 ( $results, $success, $errorcode, $errormessage ) = GetItemsInCollection( $colId );
164
 ( $results, $success, $errorcode, $errormessage ) = GetItemsInCollection( $colId );
(-)a/rotating_collections/rotatingCollections.pl (-3 / +3 lines)
Lines 23-29 use CGI qw ( -utf8 ); Link Here
23
use C4::Output;
23
use C4::Output;
24
use C4::Auth;
24
use C4::Auth;
25
use C4::Context;
25
use C4::Context;
26
use C4::RotatingCollections;
26
27
use Koha::RotatingCollections;
27
28
28
my $query = new CGI;
29
my $query = new CGI;
29
30
Lines 40-46 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
40
41
41
my $branchcode = $query->cookie('branch');
42
my $branchcode = $query->cookie('branch');
42
43
43
my $collections = GetCollections();
44
my $collections = Koha::RotatingCollections->search;
44
45
45
$template->param(
46
$template->param(
46
    collectionsLoop => $collections,
47
    collectionsLoop => $collections,
47
- 

Return to bug 18606