From c6bf50d0524388fd6edd7bbed3c819f3a42e94a1 Mon Sep 17 00:00:00 2001 From: Andrew Elwell Date: Sat, 5 Jun 2010 13:16:51 +0200 Subject: [PATCH] The start of some POD cleanups in C4/*.pm If these are acceptable I'll continue - target is to get rid of all warnings and errors with podcheck and make sure that any man and html formatted pod docs look 'OK' Signed-off-by: Galen Charlton --- C4/Acquisition.pm | 292 ++++++++++-------------------------------- C4/AuthoritiesMarc.pm | 126 +++++------------- C4/Koha.pm | 170 +++++++++++------------- 3 files changed, 180 insertions(+), 408 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index c0ac40ecfc..fc99f7dc9a 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -128,16 +128,11 @@ orders, basket and parcels. =head3 GetBasket -=over 4 - -$aqbasket = &GetBasket($basketnumber); + $aqbasket = &GetBasket($basketnumber); get all basket informations in aqbasket for a given basket -return : -informations for a given basket returned as a hashref. - -=back +B informations for a given basket returned as a hashref. =cut @@ -162,15 +157,12 @@ sub GetBasket { =head3 NewBasket -=over 4 - -$basket = &NewBasket( $booksellerid, $authorizedby, $basketname, $basketnote, $basketbooksellernote, $basketcontractnumber ); - -=back + $basket = &NewBasket( $booksellerid, $authorizedby, $basketname, + $basketnote, $basketbooksellernote, $basketcontractnumber ); Create a new basket in aqbasket table -=over 2 +=over =item C<$booksellerid> is a foreign key in the aqbasket table @@ -204,14 +196,10 @@ sub NewBasket { =head3 CloseBasket -=over 4 - -&CloseBasket($basketno); + &CloseBasket($basketno); close a basket (becomes unmodifiable,except for recieves) -=back - =cut sub CloseBasket { @@ -230,15 +218,12 @@ sub CloseBasket { =head3 GetBasketAsCSV -=over 4 - -&GetBasketAsCSV($basketno); + &GetBasketAsCSV($basketno); Export a basket as CSV -=back - =cut + sub GetBasketAsCSV { my ($basketno) = @_; my $basket = GetBasket($basketno); @@ -290,14 +275,10 @@ sub GetBasketAsCSV { =head3 CloseBasketgroup -=over 4 - -&CloseBasketgroup($basketgroupno); + &CloseBasketgroup($basketgroupno); close a basketgroup -=back - =cut sub CloseBasketgroup { @@ -315,14 +296,10 @@ sub CloseBasketgroup { =head3 ReOpenBaskergroup($basketgroupno) -=over 4 - -&ReOpenBaskergroup($basketgroupno); + &ReOpenBaskergroup($basketgroupno); reopen a basketgroup -=back - =cut sub ReOpenBasketgroup { @@ -341,21 +318,18 @@ sub ReOpenBasketgroup { =head3 DelBasket -=over 4 - -&DelBasket($basketno); + &DelBasket($basketno); Deletes the basket that has basketno field $basketno in the aqbasket table. -=over 2 +=over =item C<$basketno> is the primary key of the basket in the aqbasket table. =back -=back - =cut + sub DelBasket { my ( $basketno ) = @_; my $query = "DELETE FROM aqbasket WHERE basketno=?"; @@ -369,21 +343,18 @@ sub DelBasket { =head3 ModBasket -=over 4 - -&ModBasket($basketinfo); + &ModBasket($basketinfo); Modifies a basket, using a hashref $basketinfo for the relevant information, only $basketinfo->{'basketno'} is required. -=over 2 +=over =item C<$basketno> is the primary key of the basket in the aqbasket table. =back -=back - =cut + sub ModBasket { my $basketinfo = shift; my $query = "UPDATE aqbasket SET "; @@ -412,13 +383,11 @@ sub ModBasket { =head3 ModBasketHeader -=over 4 - -&ModBasketHeader($basketno, $basketname, $note, $booksellernote, $contractnumber); + &ModBasketHeader($basketno, $basketname, $note, $booksellernote, $contractnumber); Modifies a basket's header. -=over 2 +=over =item C<$basketno> is the "basketno" field in the "aqbasket" table; @@ -432,9 +401,8 @@ Modifies a basket's header. =back -=back - =cut + sub ModBasketHeader { my ($basketno, $basketname, $note, $booksellernote, $contractnumber) = @_; my $query = "UPDATE aqbasket SET basketname=?, note=?, booksellernote=? WHERE basketno=?"; @@ -454,24 +422,20 @@ sub ModBasketHeader { =head3 GetBasketsByBookseller -=over 4 - -@results = &GetBasketsByBookseller($booksellerid, $extra); + @results = &GetBasketsByBookseller($booksellerid, $extra); Returns a list of hashes of all the baskets that belong to bookseller 'booksellerid'. -=over 2 +=over =item C<$booksellerid> is the 'id' field of the bookseller in the aqbooksellers table =item C<$extra> is the extra sql parameters, can be -- $extra->{groupby}: group baskets by column + $extra->{groupby}: group baskets by column ex. $extra->{groupby} = aqbasket.basketgroupid -- $extra->{orderby}: order baskets by column -- $extra->{limit}: limit number of results (can be helpful for pagination) - -=back + $extra->{orderby}: order baskets by column + $extra->{limit}: limit number of results (can be helpful for pagination) =back @@ -503,18 +467,10 @@ sub GetBasketsByBookseller { =head3 GetBasketsByBasketgroup -=over 4 - -$baskets = &GetBasketsByBasketgroup($basketgroupid); - -=over 2 + $baskets = &GetBasketsByBasketgroup($basketgroupid); Returns a reference to all baskets that belong to basketgroup $basketgroupid. -=back - -=back - =cut sub GetBasketsByBasketgroup { @@ -533,11 +489,7 @@ sub GetBasketsByBasketgroup { =head3 NewBasketgroup -=over 4 - -$basketgroupid = NewBasketgroup(\%hashref); - -=over 2 + $basketgroupid = NewBasketgroup(\%hashref); Adds a basketgroup to the aqbasketgroups table, and add the initial baskets to it. @@ -553,10 +505,6 @@ $hashref->{'deliverycomment'} is the 'deliverycomment' field of the basketgroup $hashref->{'closed'} is the 'closed' field of the aqbasketgroups table, it is false if 0, true otherwise. -=back - -=back - =cut sub NewBasketgroup { @@ -594,11 +542,7 @@ sub NewBasketgroup { =head3 ModBasketgroup -=over 4 - -ModBasketgroup(\%hashref); - -=over 2 + ModBasketgroup(\%hashref); Modifies a basketgroup in the aqbasketgroups table, and add the baskets to it. @@ -616,10 +560,6 @@ $hashref->{'deliverycomment'} is the 'deliverycomment' field of the basketgroup $hashref->{'closed'} is the 'closed' field of the aqbasketgroups table, it is false if 0, true otherwise. -=back - -=back - =cut sub ModBasketgroup { @@ -658,15 +598,11 @@ sub ModBasketgroup { =head3 DelBasketgroup -=over 4 - -DelBasketgroup($basketgroupid); - -=back + DelBasketgroup($basketgroupid); Deletes a basketgroup in the aqbasketgroups table, and removes the reference to it from the baskets, -=over 2 +=over =item C<$basketgroupid> is the 'id' field of the basket in the aqbasketgroup table @@ -689,26 +625,12 @@ sub DelBasketgroup { =head2 FUNCTIONS ABOUT ORDERS -=over 2 - -=cut - -=back - =head3 GetBasketgroup -=over 4 - -$basketgroup = &GetBasketgroup($basketgroupid); - -=over 2 + $basketgroup = &GetBasketgroup($basketgroupid); Returns a reference to the hash containing all infermation about the basketgroup. -=back - -=back - =cut sub GetBasketgroup { @@ -727,18 +649,10 @@ sub GetBasketgroup { =head3 GetBasketgroups -=over 4 - -$basketgroups = &GetBasketgroups($booksellerid); - -=over 2 + $basketgroups = &GetBasketgroups($booksellerid); Returns a reference to the array of all the basketgroups of bookseller $booksellerid. -=back - -=back - =cut sub GetBasketgroups { @@ -763,9 +677,7 @@ sub GetBasketgroups { =head3 GetPendingOrders -=over 4 - -$orders = &GetPendingOrders($booksellerid, $grouped, $owner); + $orders = &GetPendingOrders($booksellerid, $grouped, $owner); Finds pending orders from the bookseller with the given ID. Ignores completed and cancelled orders. @@ -779,7 +691,7 @@ reference-to-hash with the following fields: C<$grouped> is a boolean that, if set to 1 will group all order lines of the same basket in a single result line -=over 2 +=over =item C @@ -787,12 +699,10 @@ in a single result line =item C -These give the value of the corresponding field in the aqorders table -of the Koha database. - =back -=back +These give the value of the corresponding field in the aqorders table +of the Koha database. Results are ordered from most to least recent. @@ -847,9 +757,7 @@ sub GetPendingOrders { =head3 GetOrders -=over 4 - -@orders = &GetOrders($basketnumber, $orderby); + @orders = &GetOrders($basketnumber, $orderby); Looks up the pending (non-cancelled) orders with the given basket number. If C<$booksellerID> is non-empty, only orders from that seller @@ -860,8 +768,6 @@ C<&basket> returns a two-element array. C<@orders> is an array of references-to-hash, whose keys are the fields from the aqorders, biblio, and biblioitems tables in the Koha database. -=back - =cut sub GetOrders { @@ -893,23 +799,20 @@ sub GetOrders { =head3 GetOrderNumber -=over 4 - -$ordernumber = &GetOrderNumber($biblioitemnumber, $biblionumber); - -=back + $ordernumber = &GetOrderNumber($biblioitemnumber, $biblionumber); Looks up the ordernumber with the given biblionumber and biblioitemnumber. Returns the number of this order. -=over 4 +=over =item C<$ordernumber> is the order number. =back =cut + sub GetOrderNumber { my ( $biblionumber,$biblioitemnumber ) = @_; my $dbh = C4::Context->dbh; @@ -929,17 +832,13 @@ sub GetOrderNumber { =head3 GetOrder -=over 4 - -$order = &GetOrder($ordernumber); + $order = &GetOrder($ordernumber); Looks up an order by order number. Returns a reference-to-hash describing the order. The keys of C<$order> are fields from the biblio, biblioitems, aqorders tables of the Koha database. -=back - =cut sub GetOrder { @@ -964,19 +863,16 @@ sub GetOrder { =head3 NewOrder -=over 4 - -&NewOrder(\%hashref); + &NewOrder(\%hashref); Adds a new order to the database. Any argument that isn't described below is the new value of the field with the same name in the aqorders table of the Koha database. -=over 4 +=over =item $hashref->{'basketno'} is the basketno foreign key in aqorders, it is mandatory - =item $hashref->{'ordernumber'} is a "minimum order number." =item $hashref->{'budgetdate'} is effectively ignored. @@ -993,8 +889,6 @@ The following keys are used: "biblionumber", "title", "basketno", "quantity", "n =back -=back - =cut sub NewOrder { @@ -1029,12 +923,7 @@ sub NewOrder { =head3 NewOrderItem -=over 4 - -&NewOrderItem(); - - -=back + &NewOrderItem(); =cut @@ -1055,19 +944,12 @@ sub NewOrderItem { =head3 ModOrder -=over 4 - -&ModOrder(\%hashref); - -=over 2 + &ModOrder(\%hashref); Modifies an existing order. Updates the order with order number -$hashref->{'ordernumber'} and biblionumber $hashref->{'biblionumber'}. All other keys of the hash -update the fields with the same name in the aqorders table of the Koha database. - -=back - -=back +$hashref->{'ordernumber'} and biblionumber $hashref->{'biblionumber'}. All +other keys of the hash update the fields with the same name in the aqorders +table of the Koha database. =cut @@ -1106,18 +988,15 @@ sub ModOrder { =head3 ModOrderItem -=over 4 - -&ModOrderItem(\%hashref); - -=over 2 + &ModOrderItem(\%hashref); Modifies the itemnumber in the aqorders_items table. The input hash needs three entities: -- itemnumber: the old itemnumber -- ordernumber: the order this item is attached to -- newitemnumber: the new itemnumber we want to attach the line to -=back +=over + +=item - itemnumber: the old itemnumber +=item - ordernumber: the order this item is attached to +=item - newitemnumber: the new itemnumber we want to attach the line to =back @@ -1145,15 +1024,11 @@ sub ModOrderItem { =head3 ModOrderBibliotemNumber -=over 4 - -&ModOrderBiblioitemNumber($biblioitemnumber,$ordernumber, $biblionumber); + &ModOrderBiblioitemNumber($biblioitemnumber,$ordernumber, $biblionumber); Modifies the biblioitemnumber for an existing order. Updates the order with order number C<$ordernum> and biblionumber C<$biblionumber>. -=back - =cut #FIXME: is this used at all? @@ -1173,9 +1048,7 @@ sub ModOrderBiblioitemNumber { =head3 ModReceiveOrder -=over 4 - -&ModReceiveOrder($biblionumber, $ordernumber, $quantityreceived, $user, + &ModReceiveOrder($biblionumber, $ordernumber, $quantityreceived, $user, $unitprice, $booksellerinvoicenumber, $biblioitemnumber, $freight, $bookfund, $rrp); @@ -1189,8 +1062,6 @@ portion must have a booksellerinvoicenumber. Updates the order with bibilionumber C<$biblionumber> and ordernumber C<$ordernumber>. -=back - =cut @@ -1331,16 +1202,12 @@ sub SearchOrder { =head3 DelOrder -=over 4 - -&DelOrder($biblionumber, $ordernumber); + &DelOrder($biblionumber, $ordernumber); Cancel the order with the given order and biblio numbers. It does not delete any entries in the aqorders table, it merely marks them as cancelled. -=back - =cut sub DelOrder { @@ -1364,9 +1231,7 @@ sub DelOrder { =head3 GetParcel -=over 4 - -@results = &GetParcel($booksellerid, $code, $date); + @results = &GetParcel($booksellerid, $code, $date); Looks up all of the received items from the supplier with the given bookseller ID at the given date, for the given code (bookseller Invoice number). Ignores cancelled and completed orders. @@ -1376,8 +1241,6 @@ the aqorders, biblio, and biblioitems tables of the Koha database. C<@results> is sorted alphabetically by book title. -=back - =cut sub GetParcel { @@ -1437,16 +1300,13 @@ sub GetParcel { =head3 GetParcels -=over 4 + $results = &GetParcels($bookseller, $order, $code, $datefrom, $dateto); -$results = &GetParcels($bookseller, $order, $code, $datefrom, $dateto); get a lists of parcels. -=back - * Input arg : -=over 4 +=over =item $bookseller is the bookseller this function has to get parcels. @@ -1460,9 +1320,13 @@ is the booksellerinvoicenumber. =item $datefrom & $dateto to know on what date this function has to filter its search. +=back + * return: a pointer on a hash list containing parcel informations as such : +=over + =item Creation date =item Last operation @@ -1523,17 +1387,13 @@ sub GetParcels { =head3 GetLateOrders -=over 4 - -@results = &GetLateOrders; + @results = &GetLateOrders; Searches for bookseller with late orders. return: the table of supplier with late issues. This table is full of hashref. -=back - =cut sub GetLateOrders { @@ -1625,9 +1485,7 @@ sub GetLateOrders { =head3 GetHistory -=over 4 - -(\@order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( $title, $author, $name, $from_placed_on, $to_placed_on ); + (\@order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( $title, $author, $name, $from_placed_on, $to_placed_on ); Retreives some acquisition history information @@ -1653,8 +1511,6 @@ returns: $total_price is the cost of each in $order_loop times the quantity $total_qtyreceived is the sum of all of the quantityreceived entries in $order_loop -=back - =cut sub GetHistory { @@ -1751,7 +1607,7 @@ sub GetHistory { =head2 GetRecentAcqui -$results = GetRecentAcqui($days); + $results = GetRecentAcqui($days); C<$results> is a ref to a table which containts hashref @@ -1774,17 +1630,13 @@ sub GetRecentAcqui { =head3 GetContracts -=over 4 - -$contractlist = &GetContracts($booksellerid, $activeonly); - -=back + $contractlist = &GetContracts($booksellerid, $activeonly); Looks up the contracts that belong to a bookseller Returns a list of contracts -=over 2 +=over =item C<$booksellerid> is the "id" field in the "aqbooksellers" table. @@ -1793,6 +1645,7 @@ Returns a list of contracts =back =cut + sub GetContracts { my ( $booksellerid, $activeonly ) = @_; my $dbh = C4::Context->dbh; @@ -1823,17 +1676,14 @@ sub GetContracts { =head3 GetContract -=over 4 - -$contract = &GetContract($contractID); + $contract = &GetContract($contractID); Looks up the contract that has PRIMKEY (contractnumber) value $contractID Returns a contract -=back - =cut + sub GetContract { my ( $contractno ) = @_; my $dbh = C4::Context->dbh; diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 5de02c4d43..f276987ec4 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -64,18 +64,20 @@ BEGIN { ); } + +=head1 NAME + +C4::AuthoritiesMarc + =head2 GetAuthMARCFromKohaField -=over 4 + ( $tag, $subfield ) = &GetAuthMARCFromKohaField ($kohafield,$authtypecode); -( $tag, $subfield ) = &GetAuthMARCFromKohaField ($kohafield,$authtypecode); returns tag and subfield linked to kohafield Comment : Suppose Kohafield is only linked to ONE subfield -=back - =cut sub GetAuthMARCFromKohaField { @@ -94,13 +96,11 @@ sub GetAuthMARCFromKohaField { =head2 SearchAuthorities -=over 4 + (\@finalresult, $nbresults)= &SearchAuthorities($tags, $and_or, + $excluding, $operator, $value, $offset,$length,$authtypecode,$sortby) -(\@finalresult, $nbresults)= &SearchAuthorities($tags, $and_or, $excluding, $operator, $value, $offset,$length,$authtypecode,$sortby) returns ref to array result and count of results returned -=back - =cut sub SearchAuthorities { @@ -344,13 +344,10 @@ sub SearchAuthorities { =head2 CountUsage -=over 4 + $count= &CountUsage($authid) -$count= &CountUsage($authid) counts Usage of Authid in bibliorecords. -=back - =cut sub CountUsage { @@ -371,13 +368,10 @@ sub CountUsage { =head2 CountUsageChildren -=over 4 + $count= &CountUsageChildren($authid) -$count= &CountUsageChildren($authid) counts Usage of narrower terms of Authid in bibliorecords. -=back - =cut sub CountUsageChildren { @@ -386,13 +380,10 @@ sub CountUsageChildren { =head2 GetAuthTypeCode -=over 4 + $authtypecode= &GetAuthTypeCode($authid) -$authtypecode= &GetAuthTypeCode($authid) returns authtypecode of an authid -=back - =cut sub GetAuthTypeCode { @@ -407,11 +398,7 @@ sub GetAuthTypeCode { =head2 GuessAuthTypeCode -=over 4 - -my $authtypecode = GuessAuthTypeCode($record); - -=back + my $authtypecode = GuessAuthTypeCode($record); Get the record and tries to guess the adequate authtypecode from its content. @@ -486,11 +473,7 @@ my $heading_fields = { =head2 GuessAuthId -=over 4 - -my $authtid = GuessAuthId($record); - -=back + my $authtid = GuessAuthId($record); Get the record and tries to guess the adequate authtypecode from its content. @@ -508,14 +491,16 @@ sub GuessAuthId { =head2 GetTagsLabels -=over 4 + $tagslabel= &GetTagsLabels($forlibrarian,$authtypecode) -$tagslabel= &GetTagsLabels($forlibrarian,$authtypecode) returns a ref to hashref of authorities tag and subfield structure. tagslabel usage : -$tagslabel->{$tag}->{$subfield}->{'attribute'} + + $tagslabel->{$tag}->{$subfield}->{'attribute'} + where attribute takes values in : + lib tab mandatory @@ -529,8 +514,6 @@ where attribute takes values in : isurl link -=back - =cut sub GetTagsLabels { @@ -605,14 +588,10 @@ ORDER BY tagfield,tagsubfield" =head2 AddAuthority -=over 4 - -$authid= &AddAuthority($record, $authid,$authtypecode) -returns authid of the newly created authority + $authid= &AddAuthority($record, $authid,$authtypecode) Either Create Or Modify existing authority. - -=back +returns authid of the newly created authority =cut @@ -722,16 +701,12 @@ sub AddAuthority { =head2 DelAuthority -=over 4 + $authid= &DelAuthority($authid) -$authid= &DelAuthority($authid) Deletes $authid -=back - =cut - sub DelAuthority { my ($authid) = @_; my $dbh=C4::Context->dbh; @@ -771,13 +746,10 @@ sub ModAuthority { =head2 GetAuthorityXML -=over 4 + $marcxml= &GetAuthorityXML( $authid) -$marcxml= &GetAuthorityXML( $authid) returns xml form of record $authid -=back - =cut sub GetAuthorityXML { @@ -804,13 +776,10 @@ sub GetAuthorityXML { =head2 GetAuthority -=over 4 + $record= &GetAuthority( $authid) -$record= &GetAuthority( $authid) Returns MARC::Record of the authority passed in parameter. -=back - =cut sub GetAuthority { @@ -832,11 +801,7 @@ sub GetAuthority { =head2 GetAuthType -=over 4 - -$result = &GetAuthType($authtypecode) - -=back + $result = &GetAuthType($authtypecode) If the authority type specified by C<$authtypecode> exists, returns a hashref of the type's fields. If the type @@ -909,15 +874,12 @@ sub AUTHhtml2marc { =head2 FindDuplicateAuthority -=over 4 + $record= &FindDuplicateAuthority( $record, $authtypecode) -$record= &FindDuplicateAuthority( $record, $authtypecode) return $authid,Summary if duplicate is found. Comments : an improvement would be to return All the records that match. -=back - =cut sub FindDuplicateAuthority { @@ -951,17 +913,14 @@ sub FindDuplicateAuthority { =head2 BuildSummary -=over 4 + $text= &BuildSummary( $record, $authid, $authtypecode) -$text= &BuildSummary( $record, $authid, $authtypecode) return HTML encoded Summary Comment : authtypecode can be infered from both record and authid. Moreover, authid can also be inferred from $record. Would it be interesting to delete those things. -=back - =cut sub BuildSummary{ @@ -1133,17 +1092,14 @@ sub BuildSummary{ =head2 BuildUnimarcHierarchies -=over 4 + $text= &BuildUnimarcHierarchies( $authid, $force) -$text= &BuildUnimarcHierarchies( $authid, $force) return text containing trees for hierarchies for them to be stored in auth_header Example of text: 122,1314,2452;1324,2342,3,2452 -=back - =cut sub BuildUnimarcHierarchies{ @@ -1192,9 +1148,8 @@ sub BuildUnimarcHierarchies{ =head2 BuildUnimarcHierarchy -=over 4 + $ref= &BuildUnimarcHierarchy( $record, $class,$authid) -$ref= &BuildUnimarcHierarchy( $record, $class,$authid) return a hashref in order to display hierarchy for record and final Authid $authid "loopparents" @@ -1208,8 +1163,6 @@ return a hashref in order to display hierarchy for record and final Authid $auth "ifchildren" Those two latest ones should disappear soon. -=back - =cut sub BuildUnimarcHierarchy{ @@ -1244,13 +1197,10 @@ sub BuildUnimarcHierarchy{ =head2 GetHeaderAuthority -=over 4 + $ref= &GetHeaderAuthority( $authid) -$ref= &GetHeaderAuthority( $authid) return a hashref in order auth_header table data -=back - =cut sub GetHeaderAuthority{ @@ -1265,13 +1215,10 @@ sub GetHeaderAuthority{ =head2 AddAuthorityTrees -=over 4 + $ref= &AddAuthorityTrees( $authid, $trees) -$ref= &AddAuthorityTrees( $authid, $trees) return success or failure -=back - =cut sub AddAuthorityTrees{ @@ -1285,16 +1232,11 @@ sub AddAuthorityTrees{ =head2 merge -=over 4 - -$ref= &merge(mergefrom,$MARCfrom,$mergeto,$MARCto) - + $ref= &merge(mergefrom,$MARCfrom,$mergeto,$MARCto) Could add some feature : Migrating from a typecode to an other for instance. Then we should add some new parameter : bibliotargettag, authtargettag -=back - =cut sub merge { @@ -1465,11 +1407,7 @@ sub merge { =head2 get_auth_type_location -=over 4 - -my ($tag, $subfield) = get_auth_type_location($auth_type_code); - -=back + my ($tag, $subfield) = get_auth_type_location($auth_type_code); Get the tag and subfield used to store the heading type for indexing purposes. The C<$auth_type> parameter is diff --git a/C4/Koha.pm b/C4/Koha.pm index 11c7850deb..cb93034d5c 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -71,16 +71,15 @@ memoize('GetAuthorisedValues'); =head1 NAME - C4::Koha - Perl Module containing convenience functions for Koha scripts +C4::Koha - Perl Module containing convenience functions for Koha scripts =head1 SYNOPSIS - use C4::Koha; - +use C4::Koha; =head1 DESCRIPTION - Koha.pm provides many functions for Koha scripts. +Koha.pm provides many functions for Koha scripts. =head1 FUNCTIONS @@ -90,8 +89,8 @@ memoize('GetAuthorisedValues'); $slash_date = &slashifyDate($dash_date); - Takes a string of the form "DD-MM-YYYY" (or anything separated by - dashes), converts it to the form "YYYY/MM/DD", and returns the result. +Takes a string of the form "DD-MM-YYYY" (or anything separated by +dashes), converts it to the form "YYYY/MM/DD", and returns the result. =cut @@ -106,7 +105,7 @@ sub slashifyDate { =head2 DisplayISBN - my $string = DisplayISBN( $isbn ); + my $string = DisplayISBN( $isbn ); =cut @@ -220,7 +219,6 @@ sub subfield_is_koha_internal_p ($) { Returns a string with the name of the itemtype. - =cut sub GetSupportName{ @@ -396,21 +394,21 @@ build a HTML select with the following code : =head3 in PERL SCRIPT -my $authtypes = getauthtypes; -my @authtypesloop; -foreach my $thisauthtype (keys %$authtypes) { - my $selected = 1 if $thisauthtype eq $authtype; - my %row =(value => $thisauthtype, + my $authtypes = getauthtypes; + my @authtypesloop; + foreach my $thisauthtype (keys %$authtypes) { + my $selected = 1 if $thisauthtype eq $authtype; + my %row =(value => $thisauthtype, selected => $selected, authtypetext => $authtypes->{$thisauthtype}->{'authtypetext'}, ); - push @authtypesloop, \%row; -} -$template->param(itemtypeloop => \@itemtypesloop); + push @authtypesloop, \%row; + } + $template->param(itemtypeloop => \@itemtypesloop); =head3 in TEMPLATE -
+ "> -
+ =cut @@ -458,21 +456,21 @@ build a HTML select with the following code : =head3 in PERL SCRIPT -my $frameworks = frameworks(); -my @frameworkloop; -foreach my $thisframework (keys %$frameworks) { + my $frameworks = frameworks(); + my @frameworkloop; + foreach my $thisframework (keys %$frameworks) { my $selected = 1 if $thisframework eq $frameworkcode; my %row =(value => $thisframework, selected => $selected, description => $frameworks->{$thisframework}->{'frameworktext'}, ); push @frameworksloop, \%row; -} -$template->param(frameworkloop => \@frameworksloop); + } + $template->param(frameworkloop => \@frameworksloop); =head3 in TEMPLATE -
+ "> -
- + =cut @@ -539,18 +536,12 @@ sub getitemtypeinfo { =head2 getitemtypeimagedir -=over - -=item 4 - my $directory = getitemtypeimagedir( 'opac' ); pass in 'opac' or 'intranet'. Defaults to 'opac'. returns the full path to the appropriate directory containing images. -=back - =cut sub getitemtypeimagedir { @@ -585,17 +576,16 @@ sub getitemtypeimagelocation($$) { =head3 _getImagesFromDirectory - Find all of the image files in a directory in the filesystem +Find all of the image files in a directory in the filesystem - parameters: - a directory name +parameters: a directory name - returns: a list of images in that directory. +returns: a list of images in that directory. - Notes: this does not traverse into subdirectories. See - _getSubdirectoryNames for help with that. - Images are assumed to be files with .gif or .png file extensions. - The image names returned do not have the directory name on them. +Notes: this does not traverse into subdirectories. See +_getSubdirectoryNames for help with that. +Images are assumed to be files with .gif or .png file extensions. +The image names returned do not have the directory name on them. =cut @@ -616,17 +606,15 @@ sub _getImagesFromDirectory { =head3 _getSubdirectoryNames - Find all of the directories in a directory in the filesystem +Find all of the directories in a directory in the filesystem - parameters: - a directory name +parameters: a directory name - returns: a list of subdirectories in that directory. +returns: a list of subdirectories in that directory. - Notes: this does not traverse into subdirectories. Only the first - level of subdirectories are returned. - The directory names returned don't have the parent directory name - on them. +Notes: this does not traverse into subdirectories. Only the first +level of subdirectories are returned. +The directory names returned don't have the parent directory name on them. =cut @@ -647,18 +635,20 @@ sub _getSubdirectoryNames { =head3 getImageSets - returns: a listref of hashrefs. Each hash represents another collection of images. - { imagesetname => 'npl', # the name of the image set (npl is the original one) - images => listref of image hashrefs - } - - each image is represented by a hashref like this: - { KohaImage => 'npl/image.gif', - StaffImageUrl => '/intranet-tmpl/prog/img/itemtypeimg/npl/image.gif', - OpacImageURL => '/opac-tmpl/prog/itemtypeimg/npl/image.gif' - checked => 0 or 1: was this the image passed to this method? - Note: I'd like to remove this somehow. - } +returns: a listref of hashrefs. Each hash represents another collection of images. + + { imagesetname => 'npl', # the name of the image set (npl is the original one) + images => listref of image hashrefs + } + +each image is represented by a hashref like this: + + { KohaImage => 'npl/image.gif', + StaffImageUrl => '/intranet-tmpl/prog/img/itemtypeimg/npl/image.gif', + OpacImageURL => '/opac-tmpl/prog/itemtypeimg/npl/image.gif' + checked => 0 or 1: was this the image passed to this method? + Note: I'd like to remove this somehow. + } =cut @@ -722,7 +712,7 @@ sub GetPrinters { =head2 GetPrinter -$printer = GetPrinter( $query, $printers ); + $printer = GetPrinter( $query, $printers ); =cut @@ -978,15 +968,9 @@ SELECT lib, =head2 displayServers -=over 4 - -my $servers = displayServers(); - -my $servers = displayServers( $position ); - -my $servers = displayServers( $position, $type ); - -=back + my $servers = displayServers(); + my $servers = displayServers( $position ); + my $servers = displayServers( $position, $type ); displayServers returns a listref of hashrefs, each containing information about available z3950 servers. Each hashref has a format @@ -1004,7 +988,6 @@ like: 'zed' => 1, }, - =cut sub displayServers { @@ -1052,7 +1035,7 @@ sub displayServers { =head2 GetAuthValCode -$authvalcode = GetAuthValCode($kohafield,$frameworkcode); + $authvalcode = GetAuthValCode($kohafield,$frameworkcode); =cut @@ -1068,7 +1051,7 @@ sub GetAuthValCode { =head2 GetAuthValCodeFromField -$authvalcode = GetAuthValCodeFromField($field,$subfield,$frameworkcode); + $authvalcode = GetAuthValCodeFromField($field,$subfield,$frameworkcode); C<$subfield> can be undefined @@ -1092,7 +1075,7 @@ sub GetAuthValCodeFromField { =head2 GetAuthorisedValues -$authvalues = GetAuthorisedValues([$category], [$selected]); + $authvalues = GetAuthorisedValues([$category], [$selected]); This function returns all authorised values from the'authorised_value' table in a reference to array of hashrefs. @@ -1126,7 +1109,7 @@ sub GetAuthorisedValues { =head2 GetAuthorisedValueCategories -$auth_categories = GetAuthorisedValueCategories(); + $auth_categories = GetAuthorisedValueCategories(); Return an arrayref of all of the available authorised value categories. @@ -1145,12 +1128,14 @@ sub GetAuthorisedValueCategories { } =head2 GetKohaAuthorisedValues - - Takes $kohafield, $fwcode as parameters. - If $opac parameter is set to a true value, displays OPAC descriptions rather than normal ones when they exist. - Returns hashref of Code => description - Returns undef - if no authorised value category is defined for the kohafield. + +Takes $kohafield, $fwcode as parameters. + +If $opac parameter is set to a true value, displays OPAC descriptions rather than normal ones when they exist. + +Returns hashref of Code => description + +Returns undef if no authorised value category is defined for the kohafield. =cut @@ -1173,13 +1158,15 @@ sub GetKohaAuthorisedValues { } =head2 GetKohaAuthorisedValuesFromField - - Takes $field, $subfield $fwcode as parameters. - If $opac parameter is set to a true value, displays OPAC descriptions rather than normal ones when they exist. - $subfield can be undefined - Returns hashref of Code => description - Returns undef - if no authorised value category is defined for the given field and subfield + +Takes $field, $subfield, $fwcode as parameters. + +If $opac parameter is set to a true value, displays OPAC descriptions rather than normal ones when they exist. +$subfield can be undefined + +Returns hashref of Code => description + +Returns undef if no authorised value category is defined for the given field and subfield =cut @@ -1203,12 +1190,9 @@ sub GetKohaAuthorisedValuesFromField { =head2 display_marc_indicators -=over 4 - -# field is a MARC::Field object -my $display_form = C4::Koha::display_marc_indicators($field); + my $display_form = C4::Koha::display_marc_indicators($field); -=back +C<$field> is a MARC::Field object Generate a display form of the indicators of a variable MARC field, replacing any blanks with '#'. -- 2.39.2