added latest circ to flesh copy call and displaying due_date in copy-details for...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 21 Aug 2006 16:00:25 +0000 (16:00 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 21 Aug 2006 16:00:25 +0000 (16:00 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5627 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
Open-ILS/web/opac/skin/default/js/copy_details.js
Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_cn_details.xml

index 81a6402..823f224 100644 (file)
                        <field name="status" oils_obj:array_position="30" oils_persist:virtual="false" />
                        <field name="notes" oils_obj:array_position="31" oils_persist:virtual="true" />
                        <field name="stat_cat_entry_copy_maps" oils_obj:array_position="32" oils_persist:virtual="true" />
+                       <field name="circulations" oils_obj:array_position="33" oils_persist:virtual="true" />
                </fields>
                <links>
                        <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
index 09cc0b0..842ffa1 100644 (file)
@@ -280,18 +280,21 @@ sub fleshed_copy_retrieve2 {
        # For backwards compatibility
        $copy->stat_cat_entries($copy->stat_cat_entry_copy_maps);
 
-       return $copy;
-
-#      return $copy unless $copy->stat_cat_entries;
-#
-#      for my $map (@{$copy->stat_cat_entries}) {
-#              $map->stat_cat(
-#                      $e->retrieve_asset_stat_cat($map->stat_cat));
-#              $map->stat_cat_entry(
-#                      $e->retrieve_asset_stat_cat_entry($map->stat_cat_entry));
-#      }
-#      return $copy;
+       if( $copy->status->id == OILS_COPY_STATUS_CHECKED_OUT ) {
+               $copy->circulations(
+                       $e->search_action_circulation( 
+                               [       
+                                       { target_copy => $copy->id },
+                                       {
+                                               order_by => 'xact_start',
+                                               limit => 1
+                                       }
+                               ]
+                       )
+               );
+       }
 
+       return $copy;
 }
 
 
index 617addf..aa3792e 100644 (file)
@@ -25,6 +25,7 @@ var i = cpdCheckExisting(contextRow);
                unHideMe($n(templateRow, 'age_protect_label'));
                unHideMe($n(templateRow, 'create_date_label'));
                unHideMe($n(templateRow, 'holdable_label'));
+               unHideMe($n(templateRow, 'due_date_label'));
        }
 
        unHideMe(templateRow);
@@ -175,6 +176,7 @@ function cpdDrawCopies(r) {
                unHideMe($n(copyrow, 'age_protect_value'));
                unHideMe($n(copyrow, 'create_date_value'));
                unHideMe($n(copyrow, 'copy_holdable_td'));
+               unHideMe($n(copyrow, 'copy_due_date_td'));
        }
 
        for( var i = 0; i < copies.length; i++ ) {
@@ -198,7 +200,6 @@ function cpdDrawCopy(r) {
        $n(row, 'status').appendChild(text(copy.status().name()));
 
        if(isXUL()) {
-
                /* show the hold link */
                var l = $n(row, 'copy_hold_link');
                unHideMe(l);
@@ -230,6 +231,14 @@ function cpdDrawCopy(r) {
                        $n(row, 'copy_is_holdable').appendChild(text(no));      
                }
 
+               var circ;
+               if( copy.circulations() ) {
+                       circ = copy.circulations()[0];
+                       if( circ ) {
+                               $n(row, 'copy_due_date').appendChild(text(circ.due_date().replace(/[T ].*/,'')));
+                       }
+               }
+
        }
 
        r.args.copy = copy;
index 619f5ca..1a10718 100644 (file)
@@ -16,6 +16,7 @@
                                                                <td name='age_protect_label' class='hide_me'>Age Hold Protection</td>
                                                                <td name='create_date_label' class='hide_me'>Create Date</td>
                                                                <td name='holdable_label' class='hide_me'>Holdable</td>
+                                                               <td name='due_date_label' class='hide_me'>Due Date</td>
                                                        </tr>
                                                </thead>
                                                <tbody name='copies_tbody' class='copy_details_table' width='100%'>
                                                                        <span name='copy_is_holdable'> </span>
                                                                </td>
 
+                                                               <td name='copy_due_date_td' class='hide_me'>
+                                                                       <span name='copy_due_date'> </span>
+                                                               </td>
+
                                                        </tr>
 
                                                        <tr name='copy_extras_row' class='hide_me'>