Changed behavior of barcode.pl plugin to generate barcode onClick of the ... button
authorChris Nighswonger <cnighswonger@foundations.edu>
Sun, 10 Feb 2008 07:41:40 +0000 (01:41 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Mon, 11 Feb 2008 12:02:40 +0000 (06:02 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
cataloguing/value_builder/barcode.pl

index 185c23e..662b7c4 100755 (executable)
@@ -78,6 +78,7 @@ sub plugin_javascript {
        my $nextnum;
        my $query;
        my $autoBarcodeType = C4::Context->preference("autoBarcode");
+        warn "Barcode type = $autoBarcodeType";
        unless ($autoBarcodeType eq 'OFF' or !$autoBarcodeType) {
 
        if ($autoBarcodeType eq 'annual') {
@@ -105,11 +106,23 @@ sub plugin_javascript {
 <script type=\"text/javascript\">
 //<![CDATA[
 
-function Blur$function_name(index) {
+//function Blur$function_name(index) {
 //need this?
-}
+//}
+
+// Commenting this out so that the user can enter their own text w/the script prefilling the field on-focus -fbcit
+//function Focus$function_name(subfield_managed) {
+//             for (i=0 ; i<document.f.field_value.length ; i++) {
+//                     if (document.f.tag[i].value == '$tag' && document.f.subfield[i].value == '$subfield') {
+//                             if (document.f.field_value[i].value == '') {
+//                                     document.f.field_value[i].value = '$nextnum';
+//                             }
+//                     }
+//             }
+//return 0;
+//}
 
-function Focus$function_name(subfield_managed) {
+function Clic$function_name(subfield_managed) {
                for (i=0 ; i<document.f.field_value.length ; i++) {
                        if (document.f.tag[i].value == '$tag' && document.f.subfield[i].value == '$subfield') {
                                if (document.f.field_value[i].value == '') {
@@ -119,9 +132,6 @@ function Focus$function_name(subfield_managed) {
                }
 return 0;
 }
-
-function Clic$function_name(subfield_managed) {
-}
 //]]>
 </script>
 ";