Checked Out view:
authorkenstir <kenstir@gmail.com>
Tue, 17 Dec 2013 03:21:26 +0000 (22:21 -0500)
committerkenstir <kenstir@gmail.com>
Tue, 17 Dec 2013 03:21:26 +0000 (22:21 -0500)
* checked out / overdue headers cleaner
* fixed up one-sided rounded corner
* only show "Renew" button if there are renewals left
* show brief toast when renewal successful

Fixed NPE due to lack of IDL for class 'bmp'

Open-ILS/src/Android/core/res/layout/activity_splash.xml
Open-ILS/src/Android/core/res/layout/checkout_list.xml
Open-ILS/src/Android/core/res/layout/simple_actionbar.xml
Open-ILS/src/Android/core/res/values/strings.xml
Open-ILS/src/Android/core/src/org/evergreen/android/accountAccess/AccountAccess.java
Open-ILS/src/Android/core/src/org/evergreen/android/accountAccess/checkout/ItemsCheckOutListView.java
Open-ILS/src/Android/cwmars_app/assets/fm_IDL.xml
Open-ILS/src/Android/cwmars_app/fetch_idl.sh
Open-ILS/src/Android/demo_app/fetch_idl.sh

index 1cb6263..4df99cb 100644 (file)
@@ -32,7 +32,9 @@
             android:layout_centerHorizontal="true"
             android:layout_marginTop="60dp"
             android:text="@string/retry_label"
-            android:visibility="gone"
+            android:paddingLeft="25sp"
+            android:paddingRight="25sp"
+            android:visibility="visible"
             />
 
         <ProgressBar
index 9c12210..1a8fd9a 100644 (file)
@@ -7,46 +7,52 @@
      >
 
        <include android:id="@+id/header_actionbar" layout="@layout/simple_actionbar"/>
-    
-    <LinearLayout android:layout_width="fill_parent"
-         android:layout_height="wrap_content"
-         android:layout_marginTop="2dip"
-         android:orientation="horizontal"
-         >
-         <TextView 
-             android:layout_width="wrap_content"
-             android:layout_height="wrap_content"
-             android:text="@string/checkout_item_txt"
-             />
-         <TextView 
-             android:id="@+id/checkout_items_number"
-             android:layout_width="wrap_content"
-             android:layout_height="wrap_content"
-             android:textStyle="bold"
-             android:textSize="16sp"
-             />
-         <TextView 
-             android:layout_width="wrap_content"
-             android:layout_height="wrap_content"
-             android:text="@string/checkout_overdue_items"
-             />
-         <TextView 
-             android:id="@+id/checkout_items_overdue"
-             android:layout_width="wrap_content"
-             android:layout_height="wrap_content"
-             android:textColor="@color/red"
-             android:textStyle="bold"
-             android:textSize="16sp"
-             />
-         
-    </LinearLayout>
-     
-       <ListView 
+
+    <TableLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            android:paddingLeft="5dip"
+            android:paddingRight="5dip"
+            android:stretchColumns="2">
+        <TableRow
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                >
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/checkout_item_txt"
+                />
+            <TextView
+                 android:id="@+id/checkout_items_number"
+                 android:layout_width="32sp"
+                 android:layout_height="wrap_content"
+                 android:textStyle="bold"
+                 android:textSize="16sp"
+                 />
+            <TextView
+                 android:layout_width="16dip"
+                 />
+            <TextView
+                 android:layout_width="wrap_content"
+                 android:layout_height="wrap_content"
+                 android:text="@string/checkout_overdue_items"
+                 />
+            <TextView
+                 android:id="@+id/checkout_items_overdue"
+                 android:layout_width="32sp"
+                 android:layout_height="wrap_content"
+                 android:textStyle="bold"
+                 android:textSize="16sp"
+                 />
+        </TableRow>
+    </TableLayout>
+
+    <ListView
          android:id="@+id/checkout_items_list"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
-         android:divider="@drawable/list_view_separator"
-      android:dividerHeight="1dp" 
          >
            
        </ListView>
index 8f27a7a..9e0880e 100644 (file)
@@ -10,7 +10,7 @@
         android:id="@+id/header"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
-        android:background="@drawable/one_header_rounded_corner"
+        android:background="@drawable/header_rounded_corners"
         android:orientation="horizontal"
         android:paddingTop="3dip"
         android:paddingBottom="2dip"
index 13b1ee4..5df7398 100644 (file)
@@ -58,7 +58,8 @@
     <string name="title_holds">Holds</string>
     <string name="title_fines">Fines</string>
     <string name="title_book_bags">Bookbags</string>
-    <string name="renew_button">renew</string>
+    <string name="renew_button">Renew</string>
+    <string name="item_renewed">Item renewed</string>
     <string name="record_of">Record %1$d of %2$d</string>
 
     <!-- Search Details View -->
@@ -90,8 +91,9 @@
     <string name="hold_items">Items on hold: </string>
 
     <!-- Checkout items -->
-    <string name="checkout_item_txt">Total items out: </string>
-    <string name="checkout_overdue_items">/ Overdue items: </string>
+    <string name="checkout_item_txt">Total items checked out:</string>
+    <string name="checkout_overdue_items">Overdue:</string>
+    <string name="due">due</string>
 
     <!-- Fines Activity -->
     <string name="total_owned">Total Owned </string>
         <item quantity="other">%d items</item>
     </plurals>
 
-    <string name="title_activity_junk">JunkActivity</string>
     <string name="action_settings">Settings</string>
-    <string name="hello_world">Hello world!</string>
     <string name="retry_label">Retry</string>
 
 </resources>
index b6e6298..a67a69e 100644 (file)
@@ -408,8 +408,7 @@ public class AccountAccess {
             }
         }
 
-        // TODO are we using this too? In the opac they are not used
-        /*
+        /* Other fields returned by the request; apparently not used in OPAC
         resp_map.get("claims_returned");
         resp_map.get("long_overdue")
         resp_map.get("lost");
@@ -421,6 +420,7 @@ public class AccountAccess {
                 return lhs.getDueDate().compareTo(rhs.getDueDate());
             }
         });
+
         return circRecords;
     }
 
index 8d6ce2f..47f76a2 100644 (file)
@@ -23,6 +23,7 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
+import android.opengl.Visibility;
 import org.evergreen.android.R;
 import org.evergreen.android.accountAccess.AccountAccess;
 import org.evergreen.android.accountAccess.MaxRenewalsException;
@@ -249,24 +250,23 @@ public class ItemsCheckOutListView extends Activity {
             }
 
             // Get reference to TextView - title
-            recordTitle = (TextView) row
-                    .findViewById(R.id.checkout_record_title);
+            recordTitle = (TextView) row.findViewById(R.id.checkout_record_title);
 
             // Get reference to TextView - author
-            recordAuthor = (TextView) row
-                    .findViewById(R.id.checkout_record_author);
+            recordAuthor = (TextView) row.findViewById(R.id.checkout_record_author);
 
             // Get reference to TextView - record Publisher date+publisher
-            recordDueDate = (TextView) row
-                    .findViewById(R.id.checkout_due_date);
+            recordDueDate = (TextView) row.findViewById(R.id.checkout_due_date);
 
             renewButton = (TextView) row.findViewById(R.id.renew_button);
-
-            renewButton.setText("renew : " + record.getRenewals());
-
+            final boolean renewable = record.getRenewals() > 0;
+            renewButton.setVisibility(renewable ? View.VISIBLE : View.GONE);
+            renewButton.setEnabled(renewable);
             renewButton.setOnClickListener(new OnClickListener() {
                 @Override
                 public void onClick(View v) {
+                    if (!renewable)
+                        return;
                     Thread renew = new Thread(new Runnable() {
 
                         @Override
@@ -321,6 +321,12 @@ public class ItemsCheckOutListView extends Activity {
                                     Log.d(TAG, "Exception in reauth", eauth);
                                 }
                             }
+                            runOnUiThread(new Runnable() {
+                                @Override
+                                public void run() {
+                                    Toast.makeText(context, getString(R.string.item_renewed), Toast.LENGTH_SHORT).show();
+                                }
+                            });
 
                             if (refresh) {
                                 try {
@@ -356,7 +362,7 @@ public class ItemsCheckOutListView extends Activity {
             // set text
             recordTitle.setText(record.getTitle());
             recordAuthor.setText(record.getAuthor());
-            recordDueDate.setText(record.getDueDate());
+            recordDueDate.setText(getString(R.string.due) + ": " + record.getDueDate());
             Log.d(TAG, "title:  " + record.getTitle());
             Log.d(TAG, "author: " + record.getAuthor());
             Log.d(TAG, "due:    " + record.getDueDate());
index 5f8585e..6f6f5f2 100644 (file)
                 </retrieve>
             </actions>
         </permacrud>
+       </class><class id='bmp' controller='open-ils.cstore open-ils.pcrud' oils_obj:fieldmapper='biblio::monograph_part' oils_persist:tablename='biblio.monograph_part' reporter:label='Monograph Parts' oils_persist:field_safe='true'>
+               <fields oils_persist:primary='id' oils_persist:sequence='biblio.monograph_part_id_seq'>
+                       <field name='id' reporter:datatype='id'></field>
+                       <field name='record' reporter:datatype='link'></field>
+                       <field name='label' reporter:datatype='text'></field>
+                       <field name='label_sortkey' reporter:datatype='text'></field>
+               </fields>
+               <links>
+                       <link field='record' reltype='has_a' key='id' map='' class='bre'></link>
+               </links>
+        <permacrud xmlns='http://open-ils.org/spec/opensrf/IDL/permacrud/v1'>
+            <actions>
+                <create permission='CREATE_MONOGRAPH_PART' global_required='true'></create>
+                <retrieve></retrieve>
+                <update permission='UPDATE_MONOGRAPH_PART' global_required='true'></update>
+                <delete permission='DELETE_MONOGRAPH_PART' global_required='true'></delete>
+            </actions>
+        </permacrud>
        </class><class id='au' controller='open-ils.cstore open-ils.pcrud' oils_obj:fieldmapper='actor::user' oils_persist:tablename='actor.usr' reporter:core='true' reporter:label='ILS User'>
                <fields oils_persist:primary='id' oils_persist:sequence='actor.usr_id_seq'>
                        <field reporter:label='All Addresses' name='addresses' oils_persist:virtual='true' reporter:datatype='link'></field>
index 2f7cd68..ad7a5d4 100644 (file)
@@ -1,2 +1,3 @@
 #!/bin/sh
-curl -o assets/fm_IDL.xml 'http://bark.cwmars.org/reports/fm_IDL.xml?class=acn&class=acp&class=ahr&class=ahtc&class=au&class=cbreb&class=cbrebi&class=cbrebin&class=cbrebn&class=ccs&class=circ&class=ex&class=mbt&class=mbts&class=mous&class=mus&class=mvr&class=perm_ex'
+root=http://bark.cwmars.org
+curl -o assets/fm_IDL.xml "$root/reports/fm_IDL.xml?class=acn&class=acp&class=ahr&class=ahtc&class=au&class=bmp&class=cbreb&class=cbrebi&class=cbrebin&class=cbrebn&class=ccs&class=circ&class=ex&class=mbt&class=mbts&class=mous&class=mus&class=mvr&class=perm_ex"
index 7f50727..a671ee0 100644 (file)
@@ -1,2 +1,3 @@
 #!/bin/sh
-curl -o assets/fm_IDL.xml 'http://demo.evergreencatalog.com/reports/fm_IDL.xml?class=acn&class=acp&class=ahr&class=ahtc&class=au&class=cbreb&class=cbrebi&class=cbrebin&class=cbrebn&class=ccs&class=circ&class=ex&class=mbt&class=mbts&class=mous&class=mus&class=mvr&class=perm_ex'
+root=http://demo.evergreencatalog.com
+curl -o assets/fm_IDL.xml "$root/reports/fm_IDL.xml?class=acn&class=acp&class=ahr&class=ahtc&class=au&class=bmp&class=cbreb&class=cbrebi&class=cbrebin&class=cbrebn&class=ccs&class=circ&class=ex&class=mbt&class=mbts&class=mous&class=mus&class=mvr&class=perm_ex"