koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha koha-tmpl/intranet-tmpl/default/en/catalog... [rel_2_2]


From: Henri-Damien LAURENT
Subject: [Koha-cvs] koha koha-tmpl/intranet-tmpl/default/en/catalog... [rel_2_2]
Date: Tue, 31 Oct 2006 14:33:32 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Henri-Damien LAURENT <hdl>      06/10/31 14:33:32

Modified files:
        koha-tmpl/intranet-tmpl/default/en/catalogue: detail.tmpl 
                                                      ISBDdetail.tmpl 
                                                      MARCdetail.tmpl 
        .              : detail.pl ISBDdetail.pl MARCdetail.pl 

Log message:
        preventing librarian other than superlibrarian from deleting itemized 
biblios.
        count_items added in ISBDdetail and MARCdetail relies on information 
contained in marcrecord.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/default/en/catalogue/detail.tmpl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.17.2.12&r2=1.17.2.13
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/default/en/catalogue/ISBDdetail.tmpl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.4.2.1&r2=1.4.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.30.2.13&r2=1.30.2.14
http://cvs.savannah.gnu.org/viewcvs/koha/detail.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.24.2.9&r2=1.24.2.10
http://cvs.savannah.gnu.org/viewcvs/koha/ISBDdetail.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.4.2.6&r2=1.4.2.7
http://cvs.savannah.gnu.org/viewcvs/koha/MARCdetail.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.25.2.23&r2=1.25.2.24

Patches:
Index: koha-tmpl/intranet-tmpl/default/en/catalogue/detail.tmpl
===================================================================
RCS file: 
/sources/koha/koha/koha-tmpl/intranet-tmpl/default/en/catalogue/Attic/detail.tmpl,v
retrieving revision 1.17.2.12
retrieving revision 1.17.2.13
diff -u -b -r1.17.2.12 -r1.17.2.13
--- koha-tmpl/intranet-tmpl/default/en/catalogue/detail.tmpl    13 Sep 2006 
16:34:28 -0000      1.17.2.12
+++ koha-tmpl/intranet-tmpl/default/en/catalogue/detail.tmpl    31 Oct 2006 
14:33:31 -0000      1.17.2.13
@@ -14,9 +14,10 @@
                        Edit item
                </a>
        
-               <a href="javascript:confirm_deletion()" class="button 
catalogue">
+               <!--TMPL_IF Name="candelete" --><a 
href="javascript:confirm_deletion()" class="button catalogue">
                        delete
                </a>
+               <!--/TMPL_IF -->
                <a href="MARCdetail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" 
-->" class="button catalogue">
                        Complete
                </a>

Index: koha-tmpl/intranet-tmpl/default/en/catalogue/ISBDdetail.tmpl
===================================================================
RCS file: 
/sources/koha/koha/koha-tmpl/intranet-tmpl/default/en/catalogue/Attic/ISBDdetail.tmpl,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -u -b -r1.4.2.1 -r1.4.2.2
--- koha-tmpl/intranet-tmpl/default/en/catalogue/ISBDdetail.tmpl        25 Mar 
2005 16:52:57 -0000      1.4.2.1
+++ koha-tmpl/intranet-tmpl/default/en/catalogue/ISBDdetail.tmpl        31 Oct 
2006 14:33:32 -0000      1.4.2.2
@@ -13,9 +13,10 @@
                        Edit item
                </a>
        
-               <a href="javascript:confirm_deletion()" class="button 
catalogue">
+               <!--TMPL_IF Name="candelete" --><a 
href="javascript:confirm_deletion()" class="button catalogue">
                        delete
                </a>
+               <!--/TMPL_IF -->
                <a href="MARCdetail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" 
-->" class="button catalogue">
                        Complete
                </a>

Index: koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl
===================================================================
RCS file: 
/sources/koha/koha/koha-tmpl/intranet-tmpl/default/en/catalogue/Attic/MARCdetail.tmpl,v
retrieving revision 1.30.2.13
retrieving revision 1.30.2.14
diff -u -b -r1.30.2.13 -r1.30.2.14
--- koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl        10 Aug 
2006 14:19:13 -0000      1.30.2.13
+++ koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl        31 Oct 
2006 14:33:32 -0000      1.30.2.14
@@ -17,9 +17,10 @@
                        Edit item
                </a>
        
-               <a href="javascript:confirm_deletion()" class="button 
catalogue">
+               <!--TMPL_IF Name="candelete" --><a 
href="javascript:confirm_deletion()" class="button catalogue">
                        delete
                </a>
+               <!--/TMPL_IF -->
                <a href="detail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" -->" 
class="button catalogue">
                        Complete
                </a>

Index: detail.pl
===================================================================
RCS file: /sources/koha/koha/Attic/detail.pl,v
retrieving revision 1.24.2.9
retrieving revision 1.24.2.10
diff -u -b -r1.24.2.9 -r1.24.2.10
--- detail.pl   13 Apr 2006 18:32:32 -0000      1.24.2.9
+++ detail.pl   31 Oct 2006 14:33:32 -0000      1.24.2.10
@@ -36,6 +36,7 @@
 my $subscriptionsnumber = getsubscriptionfrombiblionumber($biblionumber);
 
 $dat->{'count'address@hidden;
+$template->param("candelete"=>1) if 
($dat->{'count'}==0||C4::Context->userenv->{flags} eq "1");
 
 $dat->{'additional'}=$addauthor->[0]->{'author'};
 for (my $i = 1; $i < $authorcount; $i++) {

Index: ISBDdetail.pl
===================================================================
RCS file: /sources/koha/koha/Attic/ISBDdetail.pl,v
retrieving revision 1.4.2.6
retrieving revision 1.4.2.7
diff -u -b -r1.4.2.6 -r1.4.2.7
--- ISBDdetail.pl       14 Jun 2006 15:37:19 -0000      1.4.2.6
+++ ISBDdetail.pl       31 Oct 2006 14:33:32 -0000      1.4.2.7
@@ -70,6 +70,8 @@
                             debug => 1,
                             });
 
+my $val=count_items($record);
+$template->param("candelete"=>1) if ($val==0||C4::Context->userenv->{flags} eq 
"1");
 my $ISBD = C4::Context->preference('ISBD');
 # my @blocs = split /\@/,$ISBD;
 # my @fields = $record->fields();
@@ -160,3 +162,10 @@
        return $value; # if nothing is found return the original value
    }
 }
+sub count_items ($$$$$) {
+  my ($record) = @_;
+  my ($tag,$subfield)=MARCfind_marc_from_kohafield(C4::Context->dbh, 
"items.itemnumber");
+  my @list_item_fields=$record->field($tag);
+  my $value=scalar(@list_item_fields);
+  return $value; # if nothing is found return the original value
+}

Index: MARCdetail.pl
===================================================================
RCS file: /sources/koha/koha/Attic/MARCdetail.pl,v
retrieving revision 1.25.2.23
retrieving revision 1.25.2.24
diff -u -b -r1.25.2.23 -r1.25.2.24
--- MARCdetail.pl       14 Jun 2006 15:37:19 -0000      1.25.2.23
+++ MARCdetail.pl       31 Oct 2006 14:33:32 -0000      1.25.2.24
@@ -86,6 +86,9 @@
                             debug => 1,
                             });
 
+my $val=count_items($record);
+$template->param("candelete"=>1) if ($val==0||C4::Context->userenv->{flags} eq 
"1");
+
 #Getting the list of all frameworks
 my $queryfwk =$dbh->prepare("select frameworktext, frameworkcode from 
biblio_framework");
 $queryfwk->execute;
@@ -277,7 +280,8 @@
 
    #---- branch
     if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
-       return getbranchname($value);
+#        return getbranchname($value);
+        return $value;
     }
 
    #---- itemtypes
@@ -297,3 +301,10 @@
        return $value; # if nothing is found return the original value
    }
 }
+sub count_items ($$$$$) {
+  my ($record) = @_;
+  my ($tag,$subfield)=MARCfind_marc_from_kohafield(C4::Context->dbh, 
"items.itemnumber");
+  my @list_item_fields=$record->field($tag);
+  my $value=scalar(@list_item_fields);
+  return $value; # if nothing is found return the original value
+}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]