Support ILS-defined extension fields
authorThomas Berezansky <tsbere@mvlc.org>
Fri, 29 Apr 2011 20:45:55 +0000 (16:45 -0400)
committerThomas Berezansky <tsbere@mvlc.org>
Sat, 21 May 2011 01:08:33 +0000 (21:08 -0400)
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Sip/MsgType.pm

index e5bd74c..7649731 100644 (file)
@@ -982,6 +982,16 @@ sub handle_patron_info {
 
         $resp .= maybe_add(FID_SCREEN_MSG, $patron->screen_msg);
         $resp .= maybe_add(FID_PRINT_LINE, $patron->print_line);
+
+        # Custom ILS-defined protocol extensions
+        if ($patron->can('extra_fields')) {
+            my $extra_fields = $patron->extra_fields();
+            foreach my $field (keys %$extra_fields) {
+                foreach my $value (@{$extra_fields->{ $field }}) {
+                    $resp .= maybe_add($field, $value);
+                }
+            }
+        }
     } else {
         # Invalid patron ID
         # He has no privileges, no items associated with him,