Bug 16381: Fix capitalization on tags review page
[koha-ffzg.git] / misc / sip_cli_emulator.pl
index 687f354..f1799ee 100755 (executable)
@@ -40,6 +40,8 @@ my $location_code;
 my $patron_identifier;
 my $patron_password;
 
+my $summary;
+
 my $item_identifier;
 
 my $fee_acknowledged = 0;
@@ -55,13 +57,15 @@ GetOptions(
     "sp|sip_pass=s"                => \$login_password,    # sip password
     "l|location|location_code=s"   => \$location_code,     # sip location code
 
-    "patron=s"   => \$patron_identifier,    # patron cardnumber or login
-    "password=s" => \$patron_password,      # patron's password
+    "patron=s"   => \$patron_identifier,                   # patron cardnumber or login
+    "password=s" => \$patron_password,                     # patron's password
 
     "i|item=s" => \$item_identifier,
 
     "fa|fee-acknowledged" => \$fee_acknowledged,
 
+    "s|summary=s" => \$summary,
+
     "t|terminator=s" => \$terminator,
 
     "m|message=s" => \@messages,
@@ -84,8 +88,6 @@ $terminator = ( $terminator eq 'CR' ) ? $CR : $CRLF;
 # Set perl to expect the same record terminator it is sending
 $/ = $terminator;
 
-my ( $sec, $min, $hour, $day, $month, $year ) = localtime(time);
-$year += 1900;
 my $transaction_date = C4::SIP::Sip::timestamp();
 
 my $terminal_password = $login_password;
@@ -128,8 +130,9 @@ my $handlers = {
             patron_identifier => $patron_identifier,
             terminal_password => $terminal_password,
             patron_password   => $patron_password,
+            summary           => $summary,
         },
-        optional => [ 'patron_password', ],
+        optional => [ 'patron_password', 'summary' ],
     },
     item_information => {
         name       => 'Item Information',
@@ -314,8 +317,9 @@ sub build_patron_information_command_message {
     my $patron_identifier = $params->{patron_identifier};
     my $terminal_password = $params->{terminal_password};
     my $patron_password   = $params->{patron_password};
+    my $summary           = $params->{summary};
 
-    my $summary = "          ";
+    $summary //= "          ";
 
     return
         PATRON_INFO
@@ -486,6 +490,9 @@ Options:
   --patron         ILS patron cardnumber or username
   --password       ILS patron password
 
+  -s --summary     Optionally define the patron information request summary field.
+                   Please refer to the SIP2 protocol specification for details
+
   --item           ILS item identifier ( item barcode )
 
   -t --terminator  SIP2 message terminator, either CR, or CRLF