Bug 15530 - Editing a course item via a disabled course disables it even if it is...
[koha-ffzg.git] / C4 / Tags.pm
index b6b319b..619c692 100644 (file)
@@ -5,18 +5,18 @@ package C4::Tags;
 #
 # This file is part of Koha.
 #
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
 #
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use strict;
 use warnings;
@@ -581,14 +581,14 @@ sub add_tag {     # biblionumber,term,[borrowernumber,approvernumber]
 #   ($min, $max) = stratify_tags($strata, $tags);
 # $stratum: the number of divisions you want
 # $tags: the tags, as provided by get_approval_rows
-# $min: the minumum stratum value
+# $min: the minimum stratum value
 # $max: the maximum stratum value. This may be the same as $min if there
 # is only one weight. Beware of divide by zeros.
 # This will add a field to the tag called "stratum" containing the calculated
 # value.
 sub stratify_tags {
     my ( $strata, $tags ) = @_;
-
+    return (0,0) if !@$tags;
     my ( $min, $max );
     foreach (@$tags) {
         my $w = $_->{weight_total};
@@ -666,7 +666,7 @@ This could be called an "approved terms" table.  See above regarding the Externa
        approved       - Negative, 0 or positive if tag is rejected, pending or approved.
        date_approved  - date of last action
        approved_by    - staffer performing the last action
-       weight_total   - total occurance of term in any biblio by any users
+    weight_total   - total occurrence of term in any biblio by any users
 
 tags_index - This table is for performance, because by far the most common operation will 
 be fetching tags for a list of search results.  We will have a set of biblios, and we will