BiblioAddsAuthorities improvement/fix
authorPaul POULAIN <paul.poulain@biblibre.com>
Tue, 8 Apr 2008 20:14:13 +0000 (22:14 +0200)
committerJoshua Ferraro <jmf@liblime.com>
Thu, 10 Apr 2008 07:55:08 +0000 (02:55 -0500)
this commit restore a better behaviour :
- if ON : the librarian can enter manually an authority-linked marc field. and if it does not exist in the authorities file, it will be created automatically
- if OFF : the authority must exist in the authority file, and the librarian can't enter if manually in the MARC editor

This patch just deals with the OFF case (the ON was already here). With OFF the behaviour is now the same as in 2.2

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
cataloguing/addbiblio.pl

index a93f63f..cd6f1e1 100755 (executable)
@@ -342,6 +342,7 @@ sub create_input {
     # it's a thesaurus / authority field
     }
     elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) {
+     if (C4::Context->preference("BiblioAddsAuthorities")) {
         $subfield_data{marc_value} =
             "<input type=\"text\"
                     id=\"".$subfield_data{id}."\"
@@ -354,7 +355,23 @@ sub create_input {
                     \/>
                     <a href=\"#\" class=\"buttonDot\"
                         onclick=\"Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=".$tagslib->{$tag}->{$subfield}->{authtypecode}."&amp;index=$subfield_data{id}','$subfield_data{id}'); return false;\" title=\"Tag Editor\">...</a>
-               ";
+            ";
+      } else {
+        $subfield_data{marc_value} =
+            "<input type=\"text\"
+                    id=\"".$subfield_data{id}."\"
+                    name=\"".$subfield_data{id}."\"
+                    value=\"$value\"
+                    class=\"input_marceditor\"
+                    tabindex=\"1\"
+                    size=\"67\"
+                    maxlength=\"255\" 
+                    disabled=\"true\"
+                    \/>
+                    <a href=\"#\" class=\"buttonDot\"
+                        onclick=\"Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=".$tagslib->{$tag}->{$subfield}->{authtypecode}."&amp;index=$subfield_data{id}','$subfield_data{id}'); return false;\" title=\"Tag Editor\">...</a>
+            ";
+      }
     # it's a plugin field
     }
     elsif ( $tagslib->{$tag}->{$subfield}->{'value_builder'} ) {