Fines partial info view added (no UI design, only info)
authordrizea <danielrizea27@gmail.com>
Thu, 5 Jul 2012 22:56:04 +0000 (01:56 +0300)
committerdrizea <danielrizea27@gmail.com>
Thu, 5 Jul 2012 22:56:04 +0000 (01:56 +0300)
27 files changed:
Open-ILS/src/Android/AndroidManifest.xml
Open-ILS/src/Android/bin/EvergreenApp.apk
Open-ILS/src/Android/bin/classes.dex
Open-ILS/src/Android/bin/classes/org/evergreen/android/R$id.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/R$layout.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/R$string.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/R$style.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/accountAccess/AccountAccess.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Info.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Simple.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$SearchArrayAdapter.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/views/AccountScreenDashboard.class
Open-ILS/src/Android/bin/resources.ap_
Open-ILS/src/Android/gen/org/evergreen/android/R.java
Open-ILS/src/Android/res/layout/fines.xml [new file with mode: 0644]
Open-ILS/src/Android/res/layout/search_result_item.xml
Open-ILS/src/Android/res/values/strings.xml
Open-ILS/src/Android/src/org/evergreen/android/accountAccess/AccountAccess.java
Open-ILS/src/Android/src/org/evergreen/android/accountAccess/CircRecord.java [deleted file]
Open-ILS/src/Android/src/org/evergreen/android/accountAccess/ItemsCheckOutListView.java [deleted file]
Open-ILS/src/Android/src/org/evergreen/android/accountAccess/checkout/CircRecord.java [new file with mode: 0644]
Open-ILS/src/Android/src/org/evergreen/android/accountAccess/checkout/ItemsCheckOutListView.java [new file with mode: 0644]
Open-ILS/src/Android/src/org/evergreen/android/accountAccess/fines/FinesActivity.java [new file with mode: 0644]
Open-ILS/src/Android/src/org/evergreen/android/accountAccess/holds/PlaceHold.java
Open-ILS/src/Android/src/org/evergreen/android/globals/GlobalConfigs.java
Open-ILS/src/Android/src/org/evergreen/android/views/AccountScreenDashboard.java

index cdda9c9..10fe06f 100644 (file)
             
         </activity>
         <!-- Checkout Activities -->
-        <activity android:name=".accountAccess.ItemsCheckOutListView"></activity>
+        <activity android:name=".accountAccess.checkout.ItemsCheckOutListView"></activity>
         
         <!-- Holds Activities -->
         <activity android:name=".accountAccess.holds.HoldsListView"></activity>
         <activity android:name=".accountAccess.holds.PlaceHold"></activity>
         <activity android:name=".accountAccess.holds.HoldDetails"></activity>
         
+        <!-- Fines Activities -->
+        <activity android:name=".accountAccess.fines.FinesActivity"></activity>
+        
         <activity android:name=".searchCatalog.RecordDetails_Info"></activity>
                <activity android:name=".searchCatalog.RecordDetails_Content"></activity>
         <activity android:name=".searchCatalog.RecordDetails_Details"></activity>
         <activity android:name=".searchCatalog.RecordDetails"></activity>
         <activity android:name=".searchCatalog.RecordDetails_Simple"></activity>
+        
+        
     </application>
     
 </manifest>
\ No newline at end of file
index 2fc6711..a1ea8cc 100644 (file)
Binary files a/Open-ILS/src/Android/bin/EvergreenApp.apk and b/Open-ILS/src/Android/bin/EvergreenApp.apk differ
index 3f44d14..7f57258 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes.dex and b/Open-ILS/src/Android/bin/classes.dex differ
index 1df1557..63bf8f2 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$id.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$id.class differ
index 026ddf8..d2968ba 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$layout.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$layout.class differ
index 2e85469..5af3b3a 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$string.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$string.class differ
index 05641cd..fd2bb4d 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$style.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$style.class differ
index de535e0..74119eb 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/accountAccess/AccountAccess.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/accountAccess/AccountAccess.class differ
index 04d288f..0a04014 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Info.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Info.class differ
index eb7a51e..735df09 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Simple.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Simple.class differ
index 795fe1d..ba15ccc 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$SearchArrayAdapter.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$SearchArrayAdapter.class differ
index 9a0a685..32c35ab 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView.class differ
index 3d1666a..de37477 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/views/AccountScreenDashboard.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/views/AccountScreenDashboard.class differ
index f5588e2..7501804 100644 (file)
Binary files a/Open-ILS/src/Android/bin/resources.ap_ and b/Open-ILS/src/Android/bin/resources.ap_ differ
index 2458fb7..f1ad2a6 100644 (file)
@@ -52,78 +52,84 @@ public final class R {
         public static final int account_btn_check_out=0x7f090007;
         public static final int account_btn_fines=0x7f090009;
         public static final int account_btn_holds=0x7f090008;
-        public static final int action_bar=0x7f090010;
-        public static final int back_button=0x7f090011;
-        public static final int cancel_hold=0x7f090021;
-        public static final int cancel_hold_button=0x7f090012;
+        public static final int action_bar=0x7f090014;
+        public static final int back_button=0x7f090015;
+        public static final int cancel_hold=0x7f090025;
+        public static final int cancel_hold_button=0x7f090016;
         public static final int checkout_due_date=0x7f090005;
         public static final int checkout_items_list=0x7f090001;
         public static final int checkout_record_author=0x7f090003;
         public static final int checkout_record_title=0x7f090002;
         public static final int checkout_renewals_remaining=0x7f090004;
-        public static final int chose_organisation=0x7f090036;
-        public static final int header=0x7f09000e;
-        public static final int header_title=0x7f09000f;
-        public static final int hold_author=0x7f090016;
-        public static final int hold_contact_telephone=0x7f090018;
-        public static final int hold_enable_email_notification=0x7f09001a;
-        public static final int hold_enable_phone_notification=0x7f090019;
-        public static final int hold_expiration_date=0x7f09001c;
-        public static final int hold_physical_description=0x7f090017;
-        public static final int hold_pickup_location=0x7f09001b;
-        public static final int hold_recipient=0x7f090014;
-        public static final int hold_status=0x7f090020;
-        public static final int hold_suspend_hold=0x7f09001d;
-        public static final int hold_thaw_date=0x7f090023;
-        public static final int hold_title=0x7f090015;
-        public static final int holds_item_list=0x7f09001f;
-        public static final int holds_number=0x7f09001e;
+        public static final int chose_organisation=0x7f09003a;
+        public static final int fined_balance_owed=0x7f090010;
+        public static final int fines_overdue_materials_list=0x7f090011;
+        public static final int fines_total_owned=0x7f09000e;
+        public static final int fines_total_paid=0x7f09000f;
+        public static final int header=0x7f090012;
+        public static final int header_title=0x7f090013;
+        public static final int hold_author=0x7f09001a;
+        public static final int hold_contact_telephone=0x7f09001c;
+        public static final int hold_enable_email_notification=0x7f09001e;
+        public static final int hold_enable_phone_notification=0x7f09001d;
+        public static final int hold_expiration_date=0x7f090020;
+        public static final int hold_physical_description=0x7f09001b;
+        public static final int hold_pickup_location=0x7f09001f;
+        public static final int hold_recipient=0x7f090018;
+        public static final int hold_status=0x7f090024;
+        public static final int hold_suspend_hold=0x7f090021;
+        public static final int hold_thaw_date=0x7f090027;
+        public static final int hold_title=0x7f090019;
+        public static final int holds_item_list=0x7f090023;
+        public static final int holds_number=0x7f090022;
         public static final int main_btn_account=0x7f09000c;
         public static final int main_btn_app_settings=0x7f09000d;
         public static final int main_btn_search=0x7f09000b;
-        public static final int place_hold=0x7f090022;
-        public static final int record_details_info_author=0x7f090025;
-        public static final int record_details_info_publisher=0x7f090026;
-        public static final int record_details_info_title=0x7f090024;
-        public static final int record_details_simple_author=0x7f090028;
-        public static final int record_details_simple_isbn=0x7f09002d;
-        public static final int record_details_simple_publisher=0x7f090029;
-        public static final int record_details_simple_series=0x7f09002b;
-        public static final int record_details_simple_subject=0x7f09002a;
-        public static final int record_details_simple_synopsis=0x7f09002c;
-        public static final int record_details_simple_title=0x7f090027;
+        public static final int place_hold=0x7f090026;
+        public static final int record_details_info_author=0x7f090029;
+        public static final int record_details_info_publisher=0x7f09002a;
+        public static final int record_details_info_title=0x7f090028;
+        public static final int record_details_simple_author=0x7f09002c;
+        public static final int record_details_simple_isbn=0x7f090031;
+        public static final int record_details_simple_publisher=0x7f09002d;
+        public static final int record_details_simple_series=0x7f09002f;
+        public static final int record_details_simple_subject=0x7f09002e;
+        public static final int record_details_simple_synopsis=0x7f090030;
+        public static final int record_details_simple_title=0x7f09002b;
         public static final int renew_button=0x7f090006;
-        public static final int searchButton=0x7f090034;
-        public static final int searchText=0x7f090033;
-        public static final int search_more_items_button=0x7f09002e;
-        public static final int search_record_author=0x7f090031;
-        public static final int search_record_img=0x7f09002f;
-        public static final int search_record_publishing=0x7f090032;
-        public static final int search_record_title=0x7f090030;
+        public static final int searchButton=0x7f090038;
+        public static final int searchText=0x7f090037;
+        public static final int search_more_items_button=0x7f090032;
+        public static final int search_record_author=0x7f090035;
+        public static final int search_record_img=0x7f090033;
+        public static final int search_record_publishing=0x7f090036;
+        public static final int search_record_title=0x7f090034;
         public static final int search_result_number=0x7f090000;
-        public static final int search_results_list=0x7f090035;
-        public static final int update_hold_button=0x7f090013;
+        public static final int search_results_list=0x7f090039;
+        public static final int update_hold_button=0x7f090017;
     }
     public static final class layout {
         public static final int checkout_list=0x7f030000;
         public static final int checkout_list_item=0x7f030001;
         public static final int dashbord_account=0x7f030002;
         public static final int dashbord_main=0x7f030003;
-        public static final int hold_details=0x7f030004;
-        public static final int holds_list=0x7f030005;
-        public static final int holds_list_item=0x7f030006;
-        public static final int main=0x7f030007;
-        public static final int place_hold=0x7f030008;
-        public static final int record_details_info=0x7f030009;
-        public static final int record_details_simple=0x7f03000a;
-        public static final int search_result_footer_view=0x7f03000b;
-        public static final int search_result_item=0x7f03000c;
-        public static final int search_result_list=0x7f03000d;
+        public static final int fines=0x7f030004;
+        public static final int hold_details=0x7f030005;
+        public static final int holds_list=0x7f030006;
+        public static final int holds_list_item=0x7f030007;
+        public static final int main=0x7f030008;
+        public static final int place_hold=0x7f030009;
+        public static final int record_details_info=0x7f03000a;
+        public static final int record_details_simple=0x7f03000b;
+        public static final int search_result_footer_view=0x7f03000c;
+        public static final int search_result_item=0x7f03000d;
+        public static final int search_result_list=0x7f03000e;
     }
     public static final class string {
         public static final int app_name=0x7f070001;
         public static final int author=0x7f07000d;
         public static final int back=0x7f070019;
+        public static final int balance_owed=0x7f07001f;
         public static final int cancel=0x7f070017;
         public static final int cancel_hold=0x7f070018;
         public static final int cancel_hold_dialog_message=0x7f07001b;
@@ -151,6 +157,10 @@ public final class R {
         public static final int title_holds=0x7f070006;
         public static final int title_my_account=0x7f070003;
         public static final int title_search=0x7f070002;
+        /**  Fines Activity 
+         */
+        public static final int total_owned=0x7f07001d;
+        public static final int total_paid=0x7f07001e;
         public static final int update_hold=0x7f07001a;
     }
     public static final class style {
diff --git a/Open-ILS/src/Android/res/layout/fines.xml b/Open-ILS/src/Android/res/layout/fines.xml
new file mode 100644 (file)
index 0000000..6be2116
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:orientation="vertical" >
+
+         <TableLayout 
+             android:layout_width="fill_parent"
+             android:layout_height="wrap_content"
+             >
+            <TableRow 
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                >
+                
+                <TextView 
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:text="@string/total_owned"
+                    />
+                <TextView 
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:text="@string/total_paid"
+                    />
+                
+                <TextView 
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:text="@string/balance_owed"
+                    />
+                
+            </TableRow>
+             <TableRow 
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                >
+                <TextView 
+                    android:id="@+id/fines_total_owned"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    />
+                <TextView 
+                    android:id="@+id/fines_total_paid"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    />
+                <TextView 
+                    android:id="@+id/fined_balance_owed"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    />
+            </TableRow>
+
+         </TableLayout>
+
+        
+
+       <ListView 
+         android:id="@+id/fines_overdue_materials_list"
+         android:layout_width="fill_parent"
+         android:layout_height="wrap_content"  
+       ></ListView>
+
+</LinearLayout>
\ No newline at end of file
index aba6b72..045d540 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
+    android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:gravity="left|center"
        android:paddingBottom="3px"
index 13f524d..47f36d9 100644 (file)
     <string name="update_hold">Update Hold</string>
     <string name="cancel_hold_dialog_message">Are you sure you want to cancel this hold?</string>
     <string name="thaw_date">Automatically activate hold one</string>
+    
+    
+    <!-- Fines Activity -->
+    <string name="total_owned">Total Owned </string>
+    <string name="total_paid">Total Paid</string>
+    <string name="balance_owed">Balance Owed</string>
+    
 </resources>
\ No newline at end of file
index 15e05fa..cbd6ec3 100644 (file)
@@ -8,6 +8,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.evergreen.android.accountAccess.checkout.CircRecord;
 import org.evergreen.android.accountAccess.holds.HoldRecord;
 import org.evergreen.android.globals.Utils;
 import org.evergreen.android.searchCatalog.RecordInfo;
@@ -824,16 +825,17 @@ public class AccountAccess {
        ahr.put("usr", userID);
        ahr.put("requestor", userID);
        
+       //TODO
        //do not set hold type, the systems knows the hold type
-       //ahr.put("hold_type", "T");
+       ahr.put("hold_type", null);
        ahr.put("pickup_lib", pickup_lib); //pick-up lib
-       ahr.put("phone_notify", phone);
-       ahr.put("email_notify", email_notify);
-       ahr.put("expire_time",expire_time);
+       //ahr.put("phone_notify", phone);
+       //ahr.put("email_notify", email_notify);
+       //ahr.put("expire_time",expire_time);
        //frozen set, what this means ? 
        ahr.put("frozen", suspendHold);
        //only if it is frozen
-       ahr.put("thaw_date",thaw_date);
+       //ahr.put("thaw_date",thaw_date);
        
        //extra parameters (not mandatory for hold creation)
 
@@ -894,11 +896,21 @@ public class AccountAccess {
        
        //----------------------------Fines Summary------------------------------------//
        
-       public OSRFObject getFinesSummary(){
+       public float[] getFinesSummary(){
                
+               //mous object
                OSRFObject finesSummary = (OSRFObject) Utils.doRequest(conn,SERVICE_ACTOR, METHOD_FETCH_FINES_SUMMARY, new Object[]{authToken,userID});
                
-               return finesSummary;
+               float fines[] = new float[3];
+               try{
+                       fines[0] = Float.parseFloat(finesSummary.getString("total_owed"));
+                       fines[1] = Float.parseFloat(finesSummary.getString("total_paid"));
+                       fines[2] = Float.parseFloat(finesSummary.getString("balance_owed"));
+               }catch(Exception e){
+                       System.err.println("Exception in parsing fines " + e.getMessage());
+               }
+               
+               return fines;
        }
        
        private Object getTransactions(){
@@ -908,6 +920,8 @@ public class AccountAccess {
                return transactions;
        }
        
+       //---------------------------------------Book bags-----------------------------------//
+       
        public Object getBookbags(){
                
                Object response = Utils.doRequest(conn,SERVICE_ACTOR, METHOD_FLESH_CONTAINERS, new Object[]{authToken,userID,"biblio","bookbag"});
diff --git a/Open-ILS/src/Android/src/org/evergreen/android/accountAccess/CircRecord.java b/Open-ILS/src/Android/src/org/evergreen/android/accountAccess/CircRecord.java
deleted file mode 100644 (file)
index e606cb6..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-package org.evergreen.android.accountAccess;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.evergreen.android.globals.GlobalConfigs;
-import org.opensrf.util.OSRFObject;
-
-/**
- * This is a wrapper class that get the information out for a circ object 
- * @author daniel
- *
- */
-public class CircRecord {
-
-       public static final int MVR_OBJ_TYPE = 1;
-       public static final int ACP_OBJ_TYPE = 2;
-       public static final int UNDEF_OBJ_TYPE = 0;
-       
-       public OSRFObject mvr = null;
-       
-       public OSRFObject acp = null;
-       
-       public OSRFObject circ = null;
-       
-       public int circ_info_type = UNDEF_OBJ_TYPE;
-       
-       public int circ_type;
-       
-       public static final int OUT = 0;
-       public static final int CLAIMS_RETURNED = 1;
-       public static final int LONG_OVERDUE = 2;
-       public static final int OVERDUE = 3;
-       public static final int LOST = 4;
-       
-       public int circ_id = -1;
-       
-       private Date circ_due_date = null;
-       
-       public CircRecord(OSRFObject circ, OSRFObject mvr, OSRFObject acp, int circ_type, int circ_id) {
-               
-               this.circ = circ;
-               
-               //one of the acp or mvr will be null this will determine the circ OSRFObject type
-               this.acp = acp;
-               this.mvr = mvr;
-               
-               if(this.acp != null)
-                       this.circ_info_type  = ACP_OBJ_TYPE;
-               
-               if(this.mvr != null)
-                       this.circ_info_type = MVR_OBJ_TYPE;
-               
-               this.circ_type = circ_type;
-               this.circ_id = circ_id;
-               //parse due date
-               parseDate(circ);
-       }
-       
-       public CircRecord(OSRFObject circ,int circ_type, int circ_id){
-               this.circ = circ;
-               this.circ_type = circ_type;
-               this.circ_id = circ_id;
-               //parse due date
-               parseDate(circ);
-       }
-       
-       public String getAuthor(){
-               
-               String author = null;
-               
-               if(this.circ_info_type == MVR_OBJ_TYPE)
-                       author = mvr.getString("author");
-               if(this.circ_info_type == ACP_OBJ_TYPE)
-                       author = acp.getString("dummy_author");
-                       
-               return author;
-       }
-       
-       
-       public String getDueDate(){
-               
-               return circ_due_date.toLocaleString();
-       }
-       
-       public String getTitle(){
-               
-               String title = null;
-               
-               if(this.circ_info_type == MVR_OBJ_TYPE)
-                       title = mvr.getString("title");
-               if(this.circ_info_type == ACP_OBJ_TYPE)
-                       title = acp.getString("dummy_title");
-               
-               return title;
-       }
-       
-       public Integer getRenewals(){
-
-               if(circ != null)
-                       return circ.getInt("renewal_remaining");
-                       
-               return null;
-       }
-       
-       public Integer getTargetCopy(){
-               if(circ != null)
-                       return circ.getInt("target_copy");
-               
-               return null;
-       }
-       
-       private void parseDate(OSRFObject circ){
-               
-               this.circ_due_date = GlobalConfigs.parseDate(circ.getString("due_date"));
-               System.out.println(this.circ_due_date);
-
-       }
-       
-}
diff --git a/Open-ILS/src/Android/src/org/evergreen/android/accountAccess/ItemsCheckOutListView.java b/Open-ILS/src/Android/src/org/evergreen/android/accountAccess/ItemsCheckOutListView.java
deleted file mode 100644 (file)
index b6fa40b..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-package org.evergreen.android.accountAccess;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.evergreen.android.R;
-
-import android.app.Activity;
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.ListView;
-import android.widget.TextView;
-import android.widget.Toast;
-
-public class ItemsCheckOutListView extends Activity{
-
-       private String TAG = "ItemsCheckOutListView";
-       
-       private AccountAccess accountAccess = null;
-       
-       private ListView lv;
-       
-       private CheckOutArrayAdapter listAdapter = null;
-
-       private ArrayList<CircRecord> circRecords = null;
-
-       private Context context;
-       
-       private ProgressDialog progressDialog;
-       
-       @Override
-       public void onCreate(Bundle savedInstanceState) {
-               // TODO Auto-generated method stub
-               super.onCreate(savedInstanceState);
-               
-               setContentView(R.layout.checkout_list);
-               
-               context = this;
-               accountAccess = AccountAccess.getAccountAccess();
-               lv = (ListView) findViewById(R.id.checkout_items_list);
-               circRecords = new ArrayList<CircRecord>();
-               listAdapter = new CheckOutArrayAdapter(context, R.layout.checkout_list_item, circRecords);
-               lv.setAdapter(listAdapter);
-               
-               Thread getCirc = new Thread(new Runnable() {
-                       
-                       @Override
-                       public void run() {
-                               
-                               circRecords = accountAccess.getItemsCheckedOut();                       
-       
-                               runOnUiThread(new Runnable() {
-                                       
-                                       @Override
-                                       public void run() {
-                                               for(int i=0;i<circRecords.size();i++)
-                                                       listAdapter.add(circRecords.get(i));
-                                               
-                                               
-                                               progressDialog.dismiss();       
-                                               
-                                               if(circRecords.size() == 0)
-                                                       Toast.makeText(context, "No circ records", Toast.LENGTH_LONG);
-                                               
-                                               listAdapter.notifyDataSetChanged();
-                                       }
-                               });
-                       }
-               });
-               
-               
-               if(accountAccess.isAuthenticated()){
-                       progressDialog = new ProgressDialog(context);
-                       progressDialog.setMessage("Please wait while retrieving circ data");
-                       progressDialog.show();
-                       getCirc.start();
-                       
-               }
-               else
-                       Toast.makeText(context, "You must be authenticated to retrieve circ records", Toast.LENGTH_LONG);
-
-
-       }
-       
-         class CheckOutArrayAdapter extends ArrayAdapter<CircRecord> {
-               private static final String tag = "CheckoutArrayAdapter";
-               
-               private TextView recordTitle;
-               private TextView recordAuthor;
-               private TextView recordDueDate;
-               private TextView recordRenewals;
-               private TextView renewButton;
-               
-               private List<CircRecord> records = new ArrayList<CircRecord>();
-
-               public CheckOutArrayAdapter(Context context, int textViewResourceId,
-                               List<CircRecord> objects) {
-                       super(context, textViewResourceId, objects);
-                       this.records = objects;
-               }
-
-               public int getCount() {
-                       return this.records.size();
-               }
-
-               public CircRecord getItem(int index) {
-                       return this.records.get(index);
-               }
-
-               public View getView(int position, View convertView, ViewGroup parent) {
-                       View row = convertView;
-                       
-                       // Get item
-                       final CircRecord record = getItem(position);
-                       
-                       
-                       if(record == null)
-                       {
-                                       Log.d(tag, "Starting XML view more infaltion ... ");
-                               LayoutInflater inflater = (LayoutInflater) this.getContext()
-                                               .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-                               row = inflater.inflate(R.layout.search_result_footer_view, parent, false);
-                               Log.d(tag, "Successfully completed XML view more Inflation!");
-
-                               
-                               }
-                       else{
-                       
-                               //if it is the right type of view
-                                       if (row == null ) {
-               
-                                                       Log.d(tag, "Starting XML Row Inflation ... ");
-                                                       LayoutInflater inflater = (LayoutInflater) this.getContext()
-                                                                       .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-                                                       row = inflater.inflate(R.layout.checkout_list_item, parent, false);
-                                                       Log.d(tag, "Successfully completed XML Row Inflation!");
-               
-                                       }
-
-                               // Get reference to TextView - title
-                               recordTitle = (TextView) row.findViewById(R.id.checkout_record_title);
-                               
-                               // Get reference to TextView - 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);
-                   
-                               //Get remaining renewals
-                               recordRenewals = (TextView) row.findViewById(R.id.checkout_renewals_remaining);
-                               
-                               renewButton = (TextView) row.findViewById(R.id.renew_button);
-                               
-                               renewButton.setText("renew : " + record.getRenewals());
-                               
-                               renewButton.setOnClickListener(new OnClickListener() {
-                                               
-                                               @Override
-                                               public void onClick(View v) {
-                                                               
-                                                               Thread renew = new Thread(new Runnable() {
-                                                                       
-                                                                       @Override
-                                                                       public void run() {
-                                                                               boolean refresh = true;
-                                                                               AccountAccess ac = AccountAccess.getAccountAccess();
-                                                                               
-                                                                               runOnUiThread(new Runnable() {  
-                                                                                       @Override
-                                                                                       public void run() {
-                                                                                               progressDialog = new ProgressDialog(context);
-                                                                                               progressDialog.setMessage("Renew item please wait.");
-                                                                                               progressDialog.show();
-                                                                                       }
-                                                                               });
-                                                                               
-                                                                               try{
-                                                                                       ac.renewCirc(record.getTargetCopy());
-                                                                               }catch(MaxRenewalsException e){
-                                                                                       runOnUiThread(new Runnable() {
-                                                                                               
-                                                                                               @Override
-                                                                                               public void run() {
-                                                                                                       progressDialog.dismiss();
-                                                                                                       Toast.makeText(context, "Max renewals reached", Toast.LENGTH_SHORT).show();
-                                                                                               }
-                                                                                       });
-                                                                                       
-                                                                                       refresh = false;
-                                                                               }
-                                                                               if(refresh){
-                                                                                       circRecords = accountAccess.getItemsCheckedOut();
-                                                                                       listAdapter.clear();
-                                                                                       for(int i=0;i<circRecords.size();i++){
-                                                                                               listAdapter.add(circRecords.get(i));
-                                                                                       }
-                                                                                       runOnUiThread(new Runnable() {
-                                                                                               
-                                                                                               @Override
-                                                                                               public void run() {
-                                                                                                       progressDialog.dismiss();
-                                                                                                       listAdapter.notifyDataSetChanged();
-                                                                                               }
-                                                                                       });
-                                                                               }
-                                                                       }
-                                                               });
-                                                               
-                                                               renew.start();
-                                               }
-                                       });
-                               //set text
-                               System.out.println("Row" + record.getTitle() + " " + record.getAuthor() + " " + record.getDueDate() + " " + record.getRenewals());
-                               recordTitle.setText(record.getTitle());
-                               recordAuthor.setText(record.getAuthor());
-                               recordDueDate.setText(record.getDueDate());
-                               recordRenewals.setText(record.getRenewals()+"");
-                       }
-                       
-                       return row;
-               }
-           }
-}
diff --git a/Open-ILS/src/Android/src/org/evergreen/android/accountAccess/checkout/CircRecord.java b/Open-ILS/src/Android/src/org/evergreen/android/accountAccess/checkout/CircRecord.java
new file mode 100644 (file)
index 0000000..6293396
--- /dev/null
@@ -0,0 +1,121 @@
+package org.evergreen.android.accountAccess.checkout;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.evergreen.android.globals.GlobalConfigs;
+import org.opensrf.util.OSRFObject;
+
+/**
+ * This is a wrapper class that get the information out for a circ object 
+ * @author daniel
+ *
+ */
+public class CircRecord {
+
+       public static final int MVR_OBJ_TYPE = 1;
+       public static final int ACP_OBJ_TYPE = 2;
+       public static final int UNDEF_OBJ_TYPE = 0;
+       
+       public OSRFObject mvr = null;
+       
+       public OSRFObject acp = null;
+       
+       public OSRFObject circ = null;
+       
+       public int circ_info_type = UNDEF_OBJ_TYPE;
+       
+       public int circ_type;
+       
+       public static final int OUT = 0;
+       public static final int CLAIMS_RETURNED = 1;
+       public static final int LONG_OVERDUE = 2;
+       public static final int OVERDUE = 3;
+       public static final int LOST = 4;
+       
+       public int circ_id = -1;
+       
+       private Date circ_due_date = null;
+       
+       public CircRecord(OSRFObject circ, OSRFObject mvr, OSRFObject acp, int circ_type, int circ_id) {
+               
+               this.circ = circ;
+               
+               //one of the acp or mvr will be null this will determine the circ OSRFObject type
+               this.acp = acp;
+               this.mvr = mvr;
+               
+               if(this.acp != null)
+                       this.circ_info_type  = ACP_OBJ_TYPE;
+               
+               if(this.mvr != null)
+                       this.circ_info_type = MVR_OBJ_TYPE;
+               
+               this.circ_type = circ_type;
+               this.circ_id = circ_id;
+               //parse due date
+               parseDate(circ);
+       }
+       
+       public CircRecord(OSRFObject circ,int circ_type, int circ_id){
+               this.circ = circ;
+               this.circ_type = circ_type;
+               this.circ_id = circ_id;
+               //parse due date
+               parseDate(circ);
+       }
+       
+       public String getAuthor(){
+               
+               String author = null;
+               
+               if(this.circ_info_type == MVR_OBJ_TYPE)
+                       author = mvr.getString("author");
+               if(this.circ_info_type == ACP_OBJ_TYPE)
+                       author = acp.getString("dummy_author");
+                       
+               return author;
+       }
+       
+       
+       public String getDueDate(){
+               
+               return circ_due_date.toLocaleString();
+       }
+       
+       public String getTitle(){
+               
+               String title = null;
+               
+               if(this.circ_info_type == MVR_OBJ_TYPE)
+                       title = mvr.getString("title");
+               if(this.circ_info_type == ACP_OBJ_TYPE)
+                       title = acp.getString("dummy_title");
+               
+               return title;
+       }
+       
+       public Integer getRenewals(){
+
+               if(circ != null)
+                       return circ.getInt("renewal_remaining");
+                       
+               return null;
+       }
+       
+       public Integer getTargetCopy(){
+               if(circ != null)
+                       return circ.getInt("target_copy");
+               
+               return null;
+       }
+       
+       private void parseDate(OSRFObject circ){
+               
+               this.circ_due_date = GlobalConfigs.parseDate(circ.getString("due_date"));
+               System.out.println(this.circ_due_date);
+
+       }
+       
+}
diff --git a/Open-ILS/src/Android/src/org/evergreen/android/accountAccess/checkout/ItemsCheckOutListView.java b/Open-ILS/src/Android/src/org/evergreen/android/accountAccess/checkout/ItemsCheckOutListView.java
new file mode 100644 (file)
index 0000000..390fdb2
--- /dev/null
@@ -0,0 +1,232 @@
+package org.evergreen.android.accountAccess.checkout;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.evergreen.android.R;
+import org.evergreen.android.accountAccess.AccountAccess;
+import org.evergreen.android.accountAccess.MaxRenewalsException;
+
+import android.app.Activity;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+public class ItemsCheckOutListView extends Activity{
+
+       private String TAG = "ItemsCheckOutListView";
+       
+       private AccountAccess accountAccess = null;
+       
+       private ListView lv;
+       
+       private CheckOutArrayAdapter listAdapter = null;
+
+       private ArrayList<CircRecord> circRecords = null;
+
+       private Context context;
+       
+       private ProgressDialog progressDialog;
+       
+       @Override
+       public void onCreate(Bundle savedInstanceState) {
+               // TODO Auto-generated method stub
+               super.onCreate(savedInstanceState);
+               
+               setContentView(R.layout.checkout_list);
+               
+               context = this;
+               accountAccess = AccountAccess.getAccountAccess();
+               lv = (ListView) findViewById(R.id.checkout_items_list);
+               circRecords = new ArrayList<CircRecord>();
+               listAdapter = new CheckOutArrayAdapter(context, R.layout.checkout_list_item, circRecords);
+               lv.setAdapter(listAdapter);
+               
+               Thread getCirc = new Thread(new Runnable() {
+                       
+                       @Override
+                       public void run() {
+                               
+                               circRecords = accountAccess.getItemsCheckedOut();                       
+       
+                               runOnUiThread(new Runnable() {
+                                       
+                                       @Override
+                                       public void run() {
+                                               for(int i=0;i<circRecords.size();i++)
+                                                       listAdapter.add(circRecords.get(i));
+                                               
+                                               
+                                               progressDialog.dismiss();       
+                                               
+                                               if(circRecords.size() == 0)
+                                                       Toast.makeText(context, "No circ records", Toast.LENGTH_LONG);
+                                               
+                                               listAdapter.notifyDataSetChanged();
+                                       }
+                               });
+                       }
+               });
+               
+               
+               if(accountAccess.isAuthenticated()){
+                       progressDialog = new ProgressDialog(context);
+                       progressDialog.setMessage("Please wait while retrieving circ data");
+                       progressDialog.show();
+                       getCirc.start();
+                       
+               }
+               else
+                       Toast.makeText(context, "You must be authenticated to retrieve circ records", Toast.LENGTH_LONG);
+
+
+       }
+       
+         class CheckOutArrayAdapter extends ArrayAdapter<CircRecord> {
+               private static final String tag = "CheckoutArrayAdapter";
+               
+               private TextView recordTitle;
+               private TextView recordAuthor;
+               private TextView recordDueDate;
+               private TextView recordRenewals;
+               private TextView renewButton;
+               
+               private List<CircRecord> records = new ArrayList<CircRecord>();
+
+               public CheckOutArrayAdapter(Context context, int textViewResourceId,
+                               List<CircRecord> objects) {
+                       super(context, textViewResourceId, objects);
+                       this.records = objects;
+               }
+
+               public int getCount() {
+                       return this.records.size();
+               }
+
+               public CircRecord getItem(int index) {
+                       return this.records.get(index);
+               }
+
+               public View getView(int position, View convertView, ViewGroup parent) {
+                       View row = convertView;
+                       
+                       // Get item
+                       final CircRecord record = getItem(position);
+                       
+                       
+                       if(record == null)
+                       {
+                                       Log.d(tag, "Starting XML view more infaltion ... ");
+                               LayoutInflater inflater = (LayoutInflater) this.getContext()
+                                               .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+                               row = inflater.inflate(R.layout.search_result_footer_view, parent, false);
+                               Log.d(tag, "Successfully completed XML view more Inflation!");
+
+                               
+                               }
+                       else{
+                       
+                               //if it is the right type of view
+                                       if (row == null ) {
+               
+                                                       Log.d(tag, "Starting XML Row Inflation ... ");
+                                                       LayoutInflater inflater = (LayoutInflater) this.getContext()
+                                                                       .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+                                                       row = inflater.inflate(R.layout.checkout_list_item, parent, false);
+                                                       Log.d(tag, "Successfully completed XML Row Inflation!");
+               
+                                       }
+
+                               // Get reference to TextView - title
+                               recordTitle = (TextView) row.findViewById(R.id.checkout_record_title);
+                               
+                               // Get reference to TextView - 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);
+                   
+                               //Get remaining renewals
+                               recordRenewals = (TextView) row.findViewById(R.id.checkout_renewals_remaining);
+                               
+                               renewButton = (TextView) row.findViewById(R.id.renew_button);
+                               
+                               renewButton.setText("renew : " + record.getRenewals());
+                               
+                               renewButton.setOnClickListener(new OnClickListener() {
+                                               
+                                               @Override
+                                               public void onClick(View v) {
+                                                               
+                                                               Thread renew = new Thread(new Runnable() {
+                                                                       
+                                                                       @Override
+                                                                       public void run() {
+                                                                               boolean refresh = true;
+                                                                               AccountAccess ac = AccountAccess.getAccountAccess();
+                                                                               
+                                                                               runOnUiThread(new Runnable() {  
+                                                                                       @Override
+                                                                                       public void run() {
+                                                                                               progressDialog = new ProgressDialog(context);
+                                                                                               progressDialog.setMessage("Renew item please wait.");
+                                                                                               progressDialog.show();
+                                                                                       }
+                                                                               });
+                                                                               
+                                                                               try{
+                                                                                       ac.renewCirc(record.getTargetCopy());
+                                                                               }catch(MaxRenewalsException e){
+                                                                                       runOnUiThread(new Runnable() {
+                                                                                               
+                                                                                               @Override
+                                                                                               public void run() {
+                                                                                                       progressDialog.dismiss();
+                                                                                                       Toast.makeText(context, "Max renewals reached", Toast.LENGTH_SHORT).show();
+                                                                                               }
+                                                                                       });
+                                                                                       
+                                                                                       refresh = false;
+                                                                               }
+                                                                               if(refresh){
+                                                                                       circRecords = accountAccess.getItemsCheckedOut();
+                                                                                       listAdapter.clear();
+                                                                                       for(int i=0;i<circRecords.size();i++){
+                                                                                               listAdapter.add(circRecords.get(i));
+                                                                                       }
+                                                                                       runOnUiThread(new Runnable() {
+                                                                                               
+                                                                                               @Override
+                                                                                               public void run() {
+                                                                                                       progressDialog.dismiss();
+                                                                                                       listAdapter.notifyDataSetChanged();
+                                                                                               }
+                                                                                       });
+                                                                               }
+                                                                       }
+                                                               });
+                                                               
+                                                               renew.start();
+                                               }
+                                       });
+                               //set text
+                               System.out.println("Row" + record.getTitle() + " " + record.getAuthor() + " " + record.getDueDate() + " " + record.getRenewals());
+                               recordTitle.setText(record.getTitle());
+                               recordAuthor.setText(record.getAuthor());
+                               recordDueDate.setText(record.getDueDate());
+                               recordRenewals.setText(record.getRenewals()+"");
+                       }
+                       
+                       return row;
+               }
+           }
+}
diff --git a/Open-ILS/src/Android/src/org/evergreen/android/accountAccess/fines/FinesActivity.java b/Open-ILS/src/Android/src/org/evergreen/android/accountAccess/fines/FinesActivity.java
new file mode 100644 (file)
index 0000000..94148b6
--- /dev/null
@@ -0,0 +1,69 @@
+package org.evergreen.android.accountAccess.fines;
+
+import org.evergreen.android.R;
+import org.evergreen.android.accountAccess.AccountAccess;
+
+import android.app.Activity;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.os.Bundle;
+import android.widget.ListView;
+import android.widget.TextView;
+
+public class FinesActivity extends Activity{
+
+       
+       private TextView total_owned;
+       
+       private TextView total_paid;
+       
+       private TextView balance_owed;
+       
+       private ListView overdue_materials;
+       
+       private Runnable getFinesInfo;
+       
+       private AccountAccess ac;
+       
+       private ProgressDialog progressDialog;
+       
+       private Context context;
+       @Override
+       protected void onCreate(Bundle savedInstanceState) {
+               super.onCreate(savedInstanceState);
+               
+               setContentView(R.layout.fines);
+               
+               total_owned = (TextView) findViewById(R.id.fines_total_owned);
+               total_paid = (TextView) findViewById(R.id.fines_total_paid);
+               balance_owed = (TextView) findViewById(R.id.fined_balance_owed);
+               context = this;
+               
+               ac = AccountAccess.getAccountAccess();
+               
+               
+               progressDialog = ProgressDialog.show(this, null, "Retrieving fines");
+               
+               getFinesInfo = new Runnable() {
+                       @Override
+                       public void run() {
+                               
+                               final float[] fines = ac.getFinesSummary();
+                               
+                               runOnUiThread(new Runnable() {          
+                                       @Override
+                                       public void run() {     
+                                               
+                                               total_owned.setText(fines[0]+"");
+                                               total_paid.setText(fines[1]+"");
+                                               balance_owed.setText(fines[2]+"");
+                                               progressDialog.dismiss();
+                                       }
+                               });
+                       }
+               };
+               
+               Thread getFinesTh = new Thread(getFinesInfo);
+               getFinesTh.start();
+       }
+}
index 11eb9c9..86d9333 100644 (file)
@@ -1,5 +1,6 @@
 package org.evergreen.android.accountAccess.holds;
 
+import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
 
@@ -67,12 +68,15 @@ public class PlaceHold extends Activity{
        
        private Date thaw_date = null;
        
+       private GlobalConfigs globalConfigs = null;
+       
+       private int selectedOrgPos = 0;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                
                setContentView(R.layout.place_hold);
-               
+               globalConfigs = GlobalConfigs.getGlobalConfigs(this);
                RecordInfo record = (RecordInfo) getIntent().getSerializableExtra("recordInfo");
                
                accountAccess = AccountAccess.getAccountAccess();
@@ -115,11 +119,10 @@ public class PlaceHold extends Activity{
                        @Override
                        public void onClick(View v) {
                                
-                               
-                               
                                accountAccess.getHoldPreCreateInfo(record_id, 4);
                                accountAccess.isHoldPossible(4, record_id);
                                
+                               
                                String expire_date_s = null;
                                String thaw_date_s = null;
                                if(expire_date != null)
@@ -127,11 +130,14 @@ public class PlaceHold extends Activity{
                                if(thaw_date != null)
                                        thaw_date_s = GlobalConfigs.getStringDate(thaw_date);
                                
-                               accountAccess.createHold(record_id,4,email_notification.isChecked(),phone_notification.isChecked(),phone_number.getText().toString(),suspendHold.isChecked(),expire_date_s,thaw_date_s);
+                               System.out.println("date expire: " + expire_date_s + " " + expire_date);
+                               int selectedOrgID = -1;
+                               if(globalConfigs.organisations.size() > selectedOrgPos)
+                                       selectedOrgID = globalConfigs.organisations.get(selectedOrgPos).id;
+                               accountAccess.createHold(record_id,selectedOrgID,email_notification.isChecked(),phone_notification.isChecked(),phone_number.getText().toString(),suspendHold.isChecked(),expire_date_s,thaw_date_s);
                        }
                });
                
-               
                phone_notification.setOnCheckedChangeListener(new OnCheckedChangeListener() {
                        
                        @Override
@@ -168,8 +174,8 @@ public class PlaceHold extends Activity{
                                                             int monthOfYear, int dayOfMonth)
                         {
                                 
-
-                                   Date chosenDate = new Date(year, monthOfYear,dayOfMonth);                 
+                                               
+                                   Date chosenDate = new Date(year-1900, monthOfYear,dayOfMonth);                 
                                    expire_date = chosenDate;
                                    CharSequence strDate = DateFormat.format("MMMM dd, yyyy", chosenDate);
                                    expiration_date.setText(strDate);
@@ -190,11 +196,11 @@ public class PlaceHold extends Activity{
                                                             int monthOfYear, int dayOfMonth)
                         {
                                 
-                                               
-                                   Date chosenDate = new Date(year, monthOfYear,dayOfMonth);                 
+                                
+                                   Date chosenDate = new Date(year-1900, monthOfYear,dayOfMonth);                 
                                    thaw_date = chosenDate;
                                    CharSequence strDate = DateFormat.format("MMMM dd, yyyy", chosenDate);
-                                   expiration_date.setText(strDate);
+                                   thaw_date_edittext.setText(strDate);
                                    //set current date          
                        }}, cal.get(Calendar.YEAR),cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH));
        
@@ -206,20 +212,30 @@ public class PlaceHold extends Activity{
                        }
                });
                
-               
+               ArrayList<String> list = new ArrayList<String>();
+        for(int i=0;i<globalConfigs.organisations.size();i++){
+               list.add(globalConfigs.organisations.get(i).padding + globalConfigs.organisations.get(i).name);
+               
+               if(globalConfigs.organisations.get(i).level -1 == 0)
+                       selectedOrgPos = i;
+        }
                ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,list);
         orgSelector.setAdapter(adapter);
-       
-        orgSelector.setSelection();
         
-        orgSelectorn.setOnItemSelectedListener(new OnItemSelectedListener() {
+        orgSelector.setSelection(selectedOrgPos);
+        
+        orgSelector.setOnItemSelectedListener(new OnItemSelectedListener() {
                        @Override
                        public void onItemSelected(AdapterView<?> arg0, View arg1,
                                        int ID, long arg3) {
-                               //select the specific organization
-                               search.selectOrganisation(globalConfigs.organisations.get(ID));
+                       
+                               selectedOrgPos = ID;
                                
                        }
+                       
+                       public void onNothingSelected(android.widget.AdapterView<?> arg0) {
+                               }
+        });
        }
        
        public void disableView(View view){
index 8fe5210..a681d89 100644 (file)
@@ -33,7 +33,7 @@ public class GlobalConfigs {
        
        //to parse date from requests
        public static final String datePattern = "yyyy-MM-dd'T'hh:mm:ssZ";
-       
+
        /** The locale. */
        public String locale = "en-US";  
        
index 86dc83a..fae20d0 100644 (file)
@@ -2,7 +2,8 @@
 package org.evergreen.android.views;
 
 import org.evergreen.android.R;
-import org.evergreen.android.accountAccess.ItemsCheckOutListView;
+import org.evergreen.android.accountAccess.checkout.ItemsCheckOutListView;
+import org.evergreen.android.accountAccess.fines.FinesActivity;
 import org.evergreen.android.accountAccess.holds.HoldsListView;
 
 import android.app.Activity;
@@ -118,7 +119,7 @@ public class AccountScreenDashboard extends Activity {
                   startActivity (new Intent(getApplicationContext(), HoldsListView.class));
                   break;
              case R.id.account_btn_fines :
-                  //startActivity (new Intent(getApplicationContext(), F5Activity.class));
+                  startActivity (new Intent(getApplicationContext(), FinesActivity.class));
                   break;
              case R.id.account_btn_book_bags :
                   //startActivity (new Intent(getApplicationContext(), F6Activity.class));