Item extra ILS-defined fields
authorThomas Berezansky <tsbere@mvlc.org>
Sat, 21 May 2011 01:11:20 +0000 (21:11 -0400)
committerThomas Berezansky <tsbere@mvlc.org>
Sat, 21 May 2011 01:11:20 +0000 (21:11 -0400)
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Sip/MsgType.pm

index 7649731..d1e3c2a 100644 (file)
@@ -1129,6 +1129,16 @@ sub handle_item_information {
         $resp .= maybe_add(FID_CALL_NUMBER,      $item->call_number);          # Extension for AMH sorting
         $resp .= maybe_add(FID_SCREEN_MSG,       $item->screen_msg);
         $resp .= maybe_add(FID_PRINT_LINE,       $item->print_line);
+
+        # Custom ILS-defined protocol extensions
+        if ($item->can('extra_fields')) {
+            my $extra_fields = $item->extra_fields();
+            foreach my $field (keys %$extra_fields) {
+                foreach my $value (@{$extra_fields->{ $field }}) {
+                    $resp .= maybe_add($field, $value);
+                }
+            }
+        }
     }
 
     $self->write_msg($resp);