pulling in more copy fields for display; added sample code
authorBill Erickson <erickson@esilibrary.com>
Mon, 14 Feb 2011 11:45:40 +0000 (06:45 -0500)
committerBill Erickson <erickson@esilibrary.com>
Mon, 14 Feb 2011 11:45:40 +0000 (06:45 -0500)
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
Open-ILS/web/templates/default/opac/parts/record/cn_details.tt2
Open-ILS/web/templates/default/opac/record.tt2

index aeb7108..ac15a59 100644 (file)
@@ -44,9 +44,15 @@ sub mk_copy_query {
 
     my $query = {
         select => {
-            acp => ['id', 'barcode', 'circ_lib'],
-            acpl => [{column => 'name', alias => 'copy_location'}],
-            ccs => [{column => 'name', alias => 'copy_status'}],
+            acp => ['id', 'barcode', 'circ_lib', 'create_date', 'age_protect', 'holdable'],
+            acpl => [
+                {column => 'name', alias => 'copy_location'},
+                {column => 'holdable', alias => 'location_holdable'}
+            ],
+            ccs => [
+                {column => 'name', alias => 'copy_status'},
+                {column => 'holdable', alias => 'status_holdable'}
+            ],
             acn => [
                 {column => 'label', alias => 'call_number_label'},
                 {column => 'id', alias => 'call_number'}
index 6d44776..2a5167e 100644 (file)
                                 <td width='33%'>[% l("Barcode") %]</td>
                                 <td>[% l("Status") %]</td>
                                 <td>[% l("Location") %]</td>
-                                <td name='age_protect_label' class='hide_me'>[% l("Age Hold Protection") %]</td>
-                                <td name='create_date_label' class='hide_me'>[% l("Create Date") %]</td>
-                                <td name='holdable_label' class='hide_me'>[% l("Holdable") %]</td>
-                                <td name='due_date_label' class='hide_me'>[% l("Due Date") %]</td>
+                                [% IF ctx.is_staff %]
+                                <td>[% l("Age Hold Protection") %]</td>
+                                <td>[% l("Create Date") %]</td>
+                                <td>[% l("Holdable") %]</td>
+                                [% END %]
+                                <td>[% l("Due Date") %]</td>
                             </tr>
                         </thead>
                         <tbody name='copies_tbody' class='copy_details_table' width='100%'>
+                            [% FOR copy_info IN ctx.copies %]
                             <tr name='copies_row'>
+                                <td>[% copy_info.barcode %]</td>
+                                <td>[% copy_info.copy_status %]</td>
+                                <td>[% copy_info.copy_location %]</td>
+                                [% IF ctx.is_staff %]
+                                <td>[% copy_info.age_protect %]</td>
+                                <td>[% date.format(ctx.parse_datetime(copy_info.create_date), DATE_FORMAT) %]</td>
+                                <td>
+                                    [%  IF copy_info.holdable == 't' AND 
+                                            copy_info.location_holdable == 't' AND
+                                            copy_info.status_holdable == 't';
+                                            l('Yes');
+                                        ELSE;
+                                            l('No');
+                                        END; 
+                                    %]
+                                </td>
+                                [% END %]
+                                <td>[% date.format(ctx.parse_datetime(copy_info.create_date), DATE_FORMAT) %]</td>
+                            </tr>
+                            [% END %]
+
+                                <!-- XXX keeping for now for reference...
                                 <td>
                                     <span name='barcode'> </span>
                                     <a class='hide_me classic_link copy_more_info'
@@ -39,6 +64,7 @@
                                     <span name='copy_due_date'> </span>
                                 </td>
                             </tr>
+                                -->
 
                             <tr name='copy_extras_row' class='hide_me'>
                                 <td colspan='10'>
index 6e4368f..04e33cb 100644 (file)
             <div class="common-full-pad"></div>        
         </div>
     </div>
-    [%# TODO: TEST CODE, DELETE ME... %]
-    [% FOR copy_info IN ctx.copies %]
-        <div>
-            [% 
-                copy_info.id _ ' ' _ copy_info.barcode _ ' ' _ ctx.find_aou(copy_info.circ_lib).name _ 
-                ' ' _ copy_info.copy_location _ ' ' _ copy_info.copy_status _ 
-                ' ' _ copy_info.call_number_label _ ' ' _ copy_info.call_number _ ' ';
-                IF copy_info.due_date; date.format(ctx.parse_datetime(copy_info.due_date),'%m/%d/%Y'); END;
-            %]
-        </div>
-    [% END %]
 [% END %]