Merge branch 'master' of git.evergreen-ils.org:Evergreen into template-toolkit-opac
authorMike Rylander <mrylander@gmail.com>
Tue, 2 Aug 2011 18:39:31 +0000 (14:39 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 2 Aug 2011 18:39:31 +0000 (14:39 -0400)
1  2 
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
Open-ILS/xul/staff_client/server/patron/holds.js

@@@ -3227,7 -3227,10 +3227,10 @@@ __PACKAGE__->register_method
  );
  
  sub clear_shelf_process {
-       my($self, $client, $auth, $org_id) = @_;
+       my($self, $client, $auth, $org_id, $match_copy) = @_;
+     my $current_copy = { '!=' => undef };
+     $current_copy = { '=' => $match_copy } if $match_copy;
  
        my $e = new_editor(authtoken=>$auth, xact => 1);
        $e->checkauth or return $e->die_event;
              fulfillment_time  => undef,
              shelf_time        => {'!=' => undef},
              capture_time      => {'!=' => undef},
-             current_copy      => {'!=' => undef},
+             current_copy      => $current_copy,
          },
          { idlist => 1 }
      );
              my $copy = $hold->current_copy;
              my ($alt_hold) = __PACKAGE__->find_nearest_permitted_hold($e, $copy, $e->requestor, 1);
  
-             if($alt_hold) {
+             if($alt_hold and !$match_copy) {
  
                  push(@{$cache_data{hold}}, $hold->id); # copy is needed for a hold
  
@@@ -3370,15 -3373,15 +3373,15 @@@ __PACKAGE__->register_method
                  'available at the library where the user is placing the hold (or, alternatively, '.
                  'at the pickup library) to encourage bypassing the hold placement and just '      .
                  'checking out the item.' ,
 -        params => {
 +        params => [
              { desc => 'Authentication Token', type => 'string' },
              { desc => 'Method Arguments.  Options include: hold_type, hold_target, org_unit.  ' 
                      . 'hold_type is the hold type code (T, V, C, M, ...).  '
                      . 'hold_target is the identifier of the hold target object.  ' 
                      . 'org_unit is org unit ID.', 
                type => 'object' 
 -            },
 -        },
 +            }
 +        ],
          return => { 
              desc => q/Result hash like { "copy" : copy_id, "location" : location_name }, empty hash on misses, event on error./,
              type => 'object' 
@@@ -75,7 -75,6 +75,6 @@@ patron.holds.prototype = 
                          // 'acp_circ_modifier' : { 'hidden' : false }
                      })
                  ),
-                 'map_row_to_columns' : circ.util.std_map_row_to_columns(),
                  'retrieve_row' : function(params) {
                      var row = params.row;
                      try {
                                      var opac_url;
                                      switch(htype) {
                                          case 'M' :
-                                             opac_url = xulG.url_prefix( urls.opac_rresult ) + '?m=' + htarget;
+                                             opac_url = xulG.url_prefix( urls.opac_rresult_metarecord ) + htarget;
                                          break;
                                          case 'T' :
                                          case 'P' :
-                                             opac_url = xulG.url_prefix( urls.opac_rdetail ) + '?r=' + htarget;
+                                             opac_url = xulG.url_prefix( urls.opac_rdetail ) + htarget;
                                          break;
                                          case 'I' :
                                              opac_url = xulG.url_prefix( urls.opac_rdetail )
-                                             + '?r=' + obj.hold_subscription_map[ obj.retrieve_ids[i].id ].record_entry();
+                                             + obj.hold_subscription_map[ obj.retrieve_ids[i].id ].record_entry();
                                          break;
                                          case 'V' :
                                              var my_acn = obj.network.simple_request( 'FM_ACN_RETRIEVE.authoritative', [ htarget ]);
-                                             opac_url = xulG.url_prefix( urls.opac_rdetail) + '?r=' + my_acn.record();
+                                             opac_url = xulG.url_prefix( urls.opac_rdetail) + my_acn.record();
                                          break;
                                          case 'C' :
                                          case 'R' :
                                                  my_acn = obj.network.simple_request( 'FM_ACN_RETRIEVE.authoritative',
                                                      [ my_acp.call_number() ]);
                                              }
-                                             opac_url = xulG.url_prefix( urls.opac_rdetail) + '?r=' + my_acn.record();
+                                             opac_url = xulG.url_prefix( urls.opac_rdetail) + my_acn.record();
                                          break;
                                          default:
                                              obj.error.standard_unexpected_error_alert($("patronStrings").getFormattedString('staff.patron.holds.show_catalog.unknown_htype', [htype]), obj.retrieve_ids[i]);
                          ['command'],
                          function(ev) {
                              try {
 +                                var use_url = urls.browser;
 +                                use_url += use_url.match(/\?/) ? "&" : "?";
 +                                use_url += "patron_barcode=" + obj.patron_barcode;
                                  var content_params = {
                                      'show_nav_buttons' : false,
                                      'show_print_button' : true,
                                          'patron_barcode' : obj.patron_barcode
                                      },
                                      'url_prefix' : xulG.url_prefix,
 -                                    'url' : xulG.url_prefix( urls.browser )
 +                                    'url' : xulG.url_prefix(use_url)
                                  };
                                  xulG.display_window.g.patron.right_deck.set_iframe( urls.XUL_REMOTE_BROWSER + '?patron_hold=1', {}, content_params);
                              } catch(E) {