Selaa lähdekoodia

eSign 20170414

iPad所有新功能已完成,开始测试。
Ray Zhang 9 vuotta sitten
vanhempi
commit
104c77671b
24 muutettua tiedostoa jossa 1878 lisäystä ja 278 poistoa
  1. BIN
      Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate
  2. 397 157
      Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  3. 115 4
      Ants Contract/AntsContract/AntsContract/Base.lproj/Main.storyboard
  4. 12 0
      Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/project.pbxproj
  5. BIN
      Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/.DS_Store
  6. 23 0
      Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/PendingDoc.imageset/Contents.json
  7. BIN
      Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/PendingDoc.imageset/pending-.png
  8. BIN
      Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/PendingDoc.imageset/pending-@2x.png
  9. BIN
      Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/PendingDoc.imageset/pending-@3x.png
  10. 2 1
      Ants Contract/common/ACNetwork.h
  11. 53 7
      Ants Contract/common/ACNetwork.m
  12. 10 3
      Ants Contract/common/AppDelegate.h
  13. 15 4
      Ants Contract/common/AppDelegate.m
  14. 43 4
      Ants Contract/common/DocumentListViewController.m
  15. 4 4
      Ants Contract/common/DocumentPageViewController.h
  16. 181 37
      Ants Contract/common/DocumentPageViewController.m
  17. 1 1
      Ants Contract/common/PageViewController.h
  18. 3 0
      Ants Contract/common/PageViewController.m
  19. 23 0
      Ants Contract/common/PendingDocumentsTableViewCell.h
  20. 25 0
      Ants Contract/common/PendingDocumentsTableViewCell.m
  21. 24 0
      Ants Contract/common/PendingDocumentsViewController.h
  22. 752 0
      Ants Contract/common/PendingDocumentsViewController.m
  23. 2 0
      Ants Contract/common/RootViewController.h
  24. 193 56
      Ants Contract/common/RootViewController.m

BIN
Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 397 - 157
Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -10,11 +10,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513069199.384237"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "789"
-            endingLineNumber = "789"
+            startingLineNumber = "792"
+            endingLineNumber = "792"
             landmarkName = "-CheckButtonClicked:"
             landmarkName = "-CheckButtonClicked:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -26,11 +26,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513069199.384237"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "782"
-            endingLineNumber = "782"
+            startingLineNumber = "785"
+            endingLineNumber = "785"
             landmarkName = "-CheckButtonClicked:"
             landmarkName = "-CheckButtonClicked:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -42,11 +42,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513069199.384237"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1126"
-            endingLineNumber = "1126"
+            startingLineNumber = "1129"
+            endingLineNumber = "1129"
             landmarkName = "-textViewDidEndEditing:"
             landmarkName = "-textViewDidEndEditing:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -58,11 +58,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513069199.384237"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1047"
-            endingLineNumber = "1047"
+            startingLineNumber = "1050"
+            endingLineNumber = "1050"
             landmarkName = "-textViewDidBeginEditing:"
             landmarkName = "-textViewDidBeginEditing:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -74,11 +74,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513069199.384237"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1041"
-            endingLineNumber = "1041"
+            startingLineNumber = "1044"
+            endingLineNumber = "1044"
             landmarkName = "-textViewDidBeginEditing:"
             landmarkName = "-textViewDidBeginEditing:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -90,11 +90,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513069199.384237"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1053"
-            endingLineNumber = "1053"
+            startingLineNumber = "1056"
+            endingLineNumber = "1056"
             landmarkName = "-textViewDidBeginEditing:"
             landmarkName = "-textViewDidBeginEditing:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -415,7 +415,7 @@
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "337"
             startingLineNumber = "337"
             endingLineNumber = "337"
             endingLineNumber = "337"
-            landmarkName = "+SavePDF:source:window_rect:name:"
+            landmarkName = "+SavePDF:source:window_rect:name:isnew:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
       </BreakpointProxy>
       </BreakpointProxy>
@@ -522,11 +522,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "511148129.577539"
+            timestampString = "513755520.923115"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "747"
-            endingLineNumber = "747"
+            startingLineNumber = "749"
+            endingLineNumber = "749"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -538,11 +538,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "511148129.577539"
+            timestampString = "513755520.923115"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "787"
-            endingLineNumber = "787"
+            startingLineNumber = "789"
+            endingLineNumber = "789"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -554,11 +554,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "511148129.577539"
+            timestampString = "513755520.923115"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "729"
-            endingLineNumber = "729"
+            startingLineNumber = "731"
+            endingLineNumber = "731"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -570,11 +570,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "511148129.577539"
+            timestampString = "513755520.923115"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "703"
-            endingLineNumber = "703"
+            startingLineNumber = "705"
+            endingLineNumber = "705"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -586,11 +586,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "511148129.577539"
+            timestampString = "513755520.923115"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "736"
-            endingLineNumber = "736"
+            startingLineNumber = "738"
+            endingLineNumber = "738"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -602,11 +602,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "511148129.577539"
+            timestampString = "513755520.923115"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1000"
-            endingLineNumber = "1000"
+            startingLineNumber = "1005"
+            endingLineNumber = "1005"
             landmarkName = "-tableView:editActionsForRowAtIndexPath:"
             landmarkName = "-tableView:editActionsForRowAtIndexPath:"
             landmarkType = "7">
             landmarkType = "7">
             <Locations>
             <Locations>
@@ -650,11 +650,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "511148129.577539"
+            timestampString = "513755520.923115"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1056"
-            endingLineNumber = "1056"
+            startingLineNumber = "1095"
+            endingLineNumber = "1095"
             landmarkName = "-tableView:editActionsForRowAtIndexPath:"
             landmarkName = "-tableView:editActionsForRowAtIndexPath:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -937,11 +937,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511065890.736989"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "168"
-            endingLineNumber = "168"
+            startingLineNumber = "169"
+            endingLineNumber = "169"
             landmarkName = "-onAddImageClicked:"
             landmarkName = "-onAddImageClicked:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1160,11 +1160,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511065890.736989"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "155"
-            endingLineNumber = "155"
+            startingLineNumber = "156"
+            endingLineNumber = "156"
             landmarkName = "-onAddImageClicked:"
             landmarkName = "-onAddImageClicked:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1208,11 +1208,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511080517.183879"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "493"
-            endingLineNumber = "493"
+            startingLineNumber = "497"
+            endingLineNumber = "497"
             landmarkName = "-imagePickerController:didFinishPickingMediaWithInfo:"
             landmarkName = "-imagePickerController:didFinishPickingMediaWithInfo:"
             landmarkType = "7">
             landmarkType = "7">
             <Locations>
             <Locations>
@@ -1256,11 +1256,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511080517.183879"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "504"
-            endingLineNumber = "504"
+            startingLineNumber = "508"
+            endingLineNumber = "508"
             landmarkName = "-imagePickerController:didFinishPickingMediaWithInfo:"
             landmarkName = "-imagePickerController:didFinishPickingMediaWithInfo:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1272,11 +1272,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511080517.183879"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "351"
-            endingLineNumber = "351"
+            startingLineNumber = "355"
+            endingLineNumber = "355"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1288,11 +1288,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511080517.183879"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "339"
-            endingLineNumber = "339"
+            startingLineNumber = "343"
+            endingLineNumber = "343"
             landmarkName = "-tableView:numberOfRowsInSection:"
             landmarkName = "-tableView:numberOfRowsInSection:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1304,11 +1304,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511080517.183879"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "422"
-            endingLineNumber = "422"
+            startingLineNumber = "426"
+            endingLineNumber = "426"
             landmarkName = "-tableView:didSelectRowAtIndexPath:"
             landmarkName = "-tableView:didSelectRowAtIndexPath:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1320,11 +1320,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511080517.183879"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "478"
-            endingLineNumber = "478"
+            startingLineNumber = "482"
+            endingLineNumber = "482"
             landmarkName = "-imagePickerController:didFinishPickingMediaWithInfo:"
             landmarkName = "-imagePickerController:didFinishPickingMediaWithInfo:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1336,11 +1336,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511080517.183879"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "502"
-            endingLineNumber = "502"
+            startingLineNumber = "506"
+            endingLineNumber = "506"
             landmarkName = "-imagePickerController:didFinishPickingMediaWithInfo:"
             landmarkName = "-imagePickerController:didFinishPickingMediaWithInfo:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1368,11 +1368,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511080517.183879"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "476"
-            endingLineNumber = "476"
+            startingLineNumber = "480"
+            endingLineNumber = "480"
             landmarkName = "-imagePickerController:didFinishPickingMediaWithInfo:"
             landmarkName = "-imagePickerController:didFinishPickingMediaWithInfo:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1400,11 +1400,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AppDelegate.m"
             filePath = "common/AppDelegate.m"
-            timestampString = "511065890.736989"
+            timestampString = "513485945.659798"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "135"
-            endingLineNumber = "135"
+            startingLineNumber = "137"
+            endingLineNumber = "137"
             landmarkName = "-application:openURL:options:"
             landmarkName = "-application:openURL:options:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1432,11 +1432,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AppDelegate.m"
             filePath = "common/AppDelegate.m"
-            timestampString = "511065890.736989"
+            timestampString = "513485945.659798"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "109"
-            endingLineNumber = "109"
+            startingLineNumber = "111"
+            endingLineNumber = "111"
             landmarkName = "-application:openURL:options:"
             landmarkName = "-application:openURL:options:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1448,11 +1448,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511080517.183879"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "360"
-            endingLineNumber = "360"
+            startingLineNumber = "364"
+            endingLineNumber = "364"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1480,11 +1480,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AppDelegate.m"
             filePath = "common/AppDelegate.m"
-            timestampString = "510741344.532136"
+            timestampString = "513485945.659798"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "61"
-            endingLineNumber = "61"
+            startingLineNumber = "63"
+            endingLineNumber = "63"
             landmarkName = "-application:openURL:options:"
             landmarkName = "-application:openURL:options:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1512,11 +1512,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/RootViewController.m"
             filePath = "common/RootViewController.m"
-            timestampString = "510737578.065408"
+            timestampString = "513591183.835804"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "28"
-            endingLineNumber = "28"
+            startingLineNumber = "30"
+            endingLineNumber = "30"
             landmarkName = "-viewDidLoad"
             landmarkName = "-viewDidLoad"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1528,11 +1528,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/RootViewController.m"
             filePath = "common/RootViewController.m"
-            timestampString = "510738511.645257"
+            timestampString = "513591183.835804"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "46"
-            endingLineNumber = "46"
+            startingLineNumber = "48"
+            endingLineNumber = "48"
             landmarkName = "-viewDidLoad"
             landmarkName = "-viewDidLoad"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1544,11 +1544,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/RootViewController.m"
             filePath = "common/RootViewController.m"
-            timestampString = "512623627.812779"
+            timestampString = "513840530.197533"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "347"
-            endingLineNumber = "347"
+            startingLineNumber = "520"
+            endingLineNumber = "520"
             landmarkName = "-OnSigninClick:"
             landmarkName = "-OnSigninClick:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1560,11 +1560,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/RootViewController.m"
             filePath = "common/RootViewController.m"
-            timestampString = "510740876.374775"
+            timestampString = "513591183.835804"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "51"
-            endingLineNumber = "51"
+            startingLineNumber = "54"
+            endingLineNumber = "54"
             landmarkName = "-viewDidAppear:"
             landmarkName = "-viewDidAppear:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1576,11 +1576,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AppDelegate.m"
             filePath = "common/AppDelegate.m"
-            timestampString = "510819931.848373"
+            timestampString = "513485945.659798"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "56"
-            endingLineNumber = "56"
+            startingLineNumber = "58"
+            endingLineNumber = "58"
             landmarkName = "-application:openURL:options:"
             landmarkName = "-application:openURL:options:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1592,11 +1592,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "511148129.577539"
+            timestampString = "513755520.923115"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "282"
-            endingLineNumber = "282"
+            startingLineNumber = "284"
+            endingLineNumber = "284"
             landmarkName = "-refresh_btn_click:"
             landmarkName = "-refresh_btn_click:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1608,11 +1608,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511079337.795097"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "284"
-            endingLineNumber = "284"
+            startingLineNumber = "288"
+            endingLineNumber = "288"
             landmarkName = "-onUploadClicked:"
             landmarkName = "-onUploadClicked:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1672,11 +1672,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511082756.429923"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "287"
-            endingLineNumber = "287"
+            startingLineNumber = "291"
+            endingLineNumber = "291"
             landmarkName = "-onUploadClicked:"
             landmarkName = "-onUploadClicked:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1688,11 +1688,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "511148119.309126"
+            timestampString = "513755520.923115"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "107"
-            endingLineNumber = "107"
+            startingLineNumber = "109"
+            endingLineNumber = "109"
             landmarkName = "-onAddClick:"
             landmarkName = "-onAddClick:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1704,11 +1704,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "511148174.499188"
+            timestampString = "513755520.923115"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "105"
-            endingLineNumber = "105"
+            startingLineNumber = "107"
+            endingLineNumber = "107"
             landmarkName = "-onAddClick:"
             landmarkName = "-onAddClick:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1720,11 +1720,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AddExtDocumentViewController.m"
             filePath = "common/AddExtDocumentViewController.m"
-            timestampString = "511150615.678087"
+            timestampString = "513478436.486878"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "262"
-            endingLineNumber = "262"
+            startingLineNumber = "266"
+            endingLineNumber = "266"
             landmarkName = "-onUploadClicked:"
             landmarkName = "-onUploadClicked:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1736,11 +1736,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/ACNetwork.m"
             filePath = "common/ACNetwork.m"
-            timestampString = "511152139.979635"
+            timestampString = "513746152.284802"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "524"
-            endingLineNumber = "524"
+            startingLineNumber = "535"
+            endingLineNumber = "535"
             landmarkName = "+packfiles2zip:"
             landmarkName = "+packfiles2zip:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1784,11 +1784,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513069199.384237"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1071"
-            endingLineNumber = "1071"
+            startingLineNumber = "1074"
+            endingLineNumber = "1074"
             landmarkName = "-textViewDidEndEditing:"
             landmarkName = "-textViewDidEndEditing:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1800,11 +1800,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513069199.384237"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "336"
-            endingLineNumber = "336"
+            startingLineNumber = "339"
+            endingLineNumber = "339"
             landmarkName = "-addTextView:destView:index:"
             landmarkName = "-addTextView:destView:index:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1816,11 +1816,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513069199.384237"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "326"
-            endingLineNumber = "326"
+            startingLineNumber = "329"
+            endingLineNumber = "329"
             landmarkName = "-addTextView:destView:index:"
             landmarkName = "-addTextView:destView:index:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1832,11 +1832,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513069199.384237"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "339"
-            endingLineNumber = "339"
+            startingLineNumber = "342"
+            endingLineNumber = "342"
             landmarkName = "-addTextView:destView:index:"
             landmarkName = "-addTextView:destView:index:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1848,11 +1848,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513069199.384237"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "337"
-            endingLineNumber = "337"
+            startingLineNumber = "340"
+            endingLineNumber = "340"
             landmarkName = "-addTextView:destView:index:"
             landmarkName = "-addTextView:destView:index:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1928,11 +1928,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513069199.384237"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1388"
-            endingLineNumber = "1388"
+            startingLineNumber = "1391"
+            endingLineNumber = "1391"
             landmarkName = "-TouchImageViewOnLongPress:"
             landmarkName = "-TouchImageViewOnLongPress:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -1944,11 +1944,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513071382.654335"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1434"
-            endingLineNumber = "1434"
+            startingLineNumber = "1437"
+            endingLineNumber = "1437"
             landmarkName = "-TouchImageViewOnTouche:"
             landmarkName = "-TouchImageViewOnTouche:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -2008,11 +2008,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513071382.654335"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1408"
-            endingLineNumber = "1408"
+            startingLineNumber = "1411"
+            endingLineNumber = "1411"
             landmarkName = "@implementation PageViewController"
             landmarkName = "@implementation PageViewController"
             landmarkType = "3">
             landmarkType = "3">
          </BreakpointContent>
          </BreakpointContent>
@@ -2024,11 +2024,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513071382.654335"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1409"
-            endingLineNumber = "1409"
+            startingLineNumber = "1412"
+            endingLineNumber = "1412"
             landmarkName = "@implementation PageViewController"
             landmarkName = "@implementation PageViewController"
             landmarkType = "3">
             landmarkType = "3">
          </BreakpointContent>
          </BreakpointContent>
@@ -2040,11 +2040,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
             filePath = "common/PageViewController.m"
-            timestampString = "513071382.654335"
+            timestampString = "513671115.51967"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1415"
-            endingLineNumber = "1415"
+            startingLineNumber = "1418"
+            endingLineNumber = "1418"
             landmarkName = "-touchImageClear:"
             landmarkName = "-touchImageClear:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -2072,11 +2072,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/ACNetwork.m"
             filePath = "common/ACNetwork.m"
-            timestampString = "513160732.447474"
+            timestampString = "513746152.284802"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "670"
-            endingLineNumber = "670"
+            startingLineNumber = "681"
+            endingLineNumber = "681"
             landmarkName = "+prepareUploadFile:json:"
             landmarkName = "+prepareUploadFile:json:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -2120,11 +2120,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AppDelegate.m"
             filePath = "common/AppDelegate.m"
-            timestampString = "513238525.397772"
+            timestampString = "513485945.659798"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "252"
-            endingLineNumber = "252"
+            startingLineNumber = "256"
+            endingLineNumber = "256"
             landmarkName = "-Login:pwd:canModify:offPrefix:"
             landmarkName = "-Login:pwd:canModify:offPrefix:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -2136,14 +2136,254 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/AppDelegate.m"
             filePath = "common/AppDelegate.m"
-            timestampString = "513238528.287058"
+            timestampString = "513487859.526176"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "264"
-            endingLineNumber = "264"
+            startingLineNumber = "278"
+            endingLineNumber = "278"
             landmarkName = "-Logout"
             landmarkName = "-Logout"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
       </BreakpointProxy>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/RootViewController.m"
+            timestampString = "513840530.197533"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "384"
+            endingLineNumber = "384"
+            landmarkName = "-onModeSwitch:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/RootViewController.m"
+            timestampString = "513840530.197533"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "373"
+            endingLineNumber = "373"
+            landmarkName = "-onCustomerPerDocClick:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/RootViewController.m"
+            timestampString = "513834779.597461"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "244"
+            endingLineNumber = "244"
+            landmarkName = "-onNewCustomerClick:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/ACNetwork.m"
+            timestampString = "513746152.284802"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "787"
+            endingLineNumber = "787"
+            landmarkName = "+offline_docnumber"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/DocumentPageViewController.m"
+            timestampString = "513835306.249898"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "446"
+            endingLineNumber = "446"
+            landmarkName = "-onSaveClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/DocumentPageViewController.m"
+            timestampString = "513835306.249898"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "441"
+            endingLineNumber = "441"
+            landmarkName = "-onSaveClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/PendingDocumentsViewController.m"
+            timestampString = "513661784.229098"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "513"
+            endingLineNumber = "513"
+            landmarkName = "-tableView:numberOfRowsInSection:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/PendingDocumentsViewController.m"
+            timestampString = "513661784.229098"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "520"
+            endingLineNumber = "520"
+            landmarkName = "-tableView:cellForRowAtIndexPath:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/DocumentPageViewController.m"
+            timestampString = "513835306.249898"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "429"
+            endingLineNumber = "429"
+            landmarkName = "-onSaveClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/DocumentPageViewController.m"
+            timestampString = "513840964.55427"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "879"
+            endingLineNumber = "879"
+            landmarkName = "-extract_data:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/DocumentPageViewController.m"
+            timestampString = "513840964.55427"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "887"
+            endingLineNumber = "887"
+            landmarkName = "-extract_data:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/PendingDocumentsViewController.m"
+            timestampString = "513675405.215942"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "554"
+            endingLineNumber = "554"
+            landmarkName = "-tableView:didSelectRowAtIndexPath:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/DocumentPageViewController.m"
+            timestampString = "513673020.015014"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "108"
+            endingLineNumber = "108"
+            landmarkName = "-viewDidLoad"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/ACNetwork.m"
+            timestampString = "513746152.284802"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "795"
+            endingLineNumber = "795"
+            landmarkName = "+offline_docnumber"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/RootViewController.m"
+            timestampString = "513834836.613199"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "58"
+            endingLineNumber = "58"
+            landmarkName = "-viewDidAppear:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
    </Breakpoints>
 </Bucket>
 </Bucket>

+ 115 - 4
Ants Contract/AntsContract/AntsContract/Base.lproj/Main.storyboard

@@ -16,12 +16,12 @@
                         <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
                         <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                         <subviews>
-                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="home_bg_p" id="V7m-G1-ogb">
-                                <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" image="home_bg_p" id="V7m-G1-ogb">
+                                <rect key="frame" x="0.0" y="20" width="768" height="1024"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
                             </imageView>
                             </imageView>
                             <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="VoO-EQ-M9h">
                             <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="VoO-EQ-M9h">
-                                <rect key="frame" x="130" y="420" width="200" height="150"/>
+                                <rect key="frame" x="76" y="420" width="200" height="150"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
                                 <inset key="titleEdgeInsets" minX="-100" minY="0.0" maxX="0.0" maxY="-120"/>
                                 <inset key="titleEdgeInsets" minX="-100" minY="0.0" maxX="0.0" maxY="-120"/>
                                 <inset key="imageEdgeInsets" minX="50" minY="0.0" maxX="0.0" maxY="30"/>
                                 <inset key="imageEdgeInsets" minX="50" minY="0.0" maxX="0.0" maxY="30"/>
@@ -32,8 +32,20 @@
                                     <action selector="onNewCustomerClick:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Zii-HE-DOQ"/>
                                     <action selector="onNewCustomerClick:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Zii-HE-DOQ"/>
                                 </connections>
                                 </connections>
                             </button>
                             </button>
+                            <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="xZf-mR-3rv">
+                                <rect key="frame" x="492" y="420" width="200" height="150"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+                                <inset key="titleEdgeInsets" minX="-100" minY="0.0" maxX="0.0" maxY="-120"/>
+                                <inset key="imageEdgeInsets" minX="50" minY="0.0" maxX="0.0" maxY="30"/>
+                                <state key="normal" title="Pending Documents" image="PendingDoc">
+                                    <color key="titleColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </state>
+                                <connections>
+                                    <action selector="onPendingDocClick:" destination="BYZ-38-t0r" eventType="touchUpInside" id="v66-Tw-f3L"/>
+                                </connections>
+                            </button>
                             <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="tLn-KD-7Jb">
                             <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="tLn-KD-7Jb">
-                                <rect key="frame" x="438" y="420" width="200" height="150"/>
+                                <rect key="frame" x="284" y="420" width="200" height="150"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
                                 <inset key="titleEdgeInsets" minX="-100" minY="0.0" maxX="0.0" maxY="-120"/>
                                 <inset key="titleEdgeInsets" minX="-100" minY="0.0" maxX="0.0" maxY="-120"/>
                                 <inset key="imageEdgeInsets" minX="50" minY="0.0" maxX="0.0" maxY="30"/>
                                 <inset key="imageEdgeInsets" minX="50" minY="0.0" maxX="0.0" maxY="30"/>
@@ -73,6 +85,20 @@
                                 <nil key="textColor"/>
                                 <nil key="textColor"/>
                                 <nil key="highlightedColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             </label>
+                            <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="2BU-Jv-Tw8">
+                                <rect key="frame" x="688" y="129" width="51" height="31"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                                <connections>
+                                    <action selector="onModeSwitch:" destination="BYZ-38-t0r" eventType="valueChanged" id="ve9-zT-d8E"/>
+                                </connections>
+                            </switch>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Mode" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="CHe-xF-uwt">
+                                <rect key="frame" x="532" y="134" width="140" height="21"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
                         </subviews>
                         </subviews>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </view>
                     </view>
@@ -92,7 +118,9 @@
                         <outlet property="coverView" destination="WlE-9f-0pQ" id="WdQ-tM-RPW"/>
                         <outlet property="coverView" destination="WlE-9f-0pQ" id="WdQ-tM-RPW"/>
                         <outlet property="ibSignin" destination="A9f-vj-ZDF" id="nwF-qz-pqH"/>
                         <outlet property="ibSignin" destination="A9f-vj-ZDF" id="nwF-qz-pqH"/>
                         <outlet property="imageBG" destination="V7m-G1-ogb" id="yvL-Se-ZpI"/>
                         <outlet property="imageBG" destination="V7m-G1-ogb" id="yvL-Se-ZpI"/>
+                        <outlet property="labelMode" destination="CHe-xF-uwt" id="VCT-dC-CKA"/>
                         <outlet property="labelVer" destination="WPb-xH-q9X" id="hrQ-cR-Ac5"/>
                         <outlet property="labelVer" destination="WPb-xH-q9X" id="hrQ-cR-Ac5"/>
+                        <outlet property="switchMode" destination="2BU-Jv-Tw8" id="BJ3-uX-wiI"/>
                         <outlet property="welcomeLabel" destination="QNm-bw-hPi" id="76Y-sU-MT9"/>
                         <outlet property="welcomeLabel" destination="QNm-bw-hPi" id="76Y-sU-MT9"/>
                     </connections>
                     </connections>
                 </viewController>
                 </viewController>
@@ -1000,10 +1028,93 @@
             </objects>
             </objects>
             <point key="canvasLocation" x="3935" y="-1400"/>
             <point key="canvasLocation" x="3935" y="-1400"/>
         </scene>
         </scene>
+        <!--Pending Documents View Controller-->
+        <scene sceneID="0vO-uv-GqV">
+            <objects>
+                <viewController storyboardIdentifier="PendingDocumentsViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="6vP-98-4Js" customClass="PendingDocumentsViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="RUZ-6C-sBf">
+                        <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="Flg-41-AM4">
+                                <rect key="frame" x="0.0" y="20" width="768" height="1004"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <prototypes>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" restorationIdentifier="PendingDocumentsTableViewCell" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="PendingDocumentsTableViewCell" id="bC4-0A-Qjh" customClass="PendingDocumentsTableViewCell">
+                                        <rect key="frame" x="0.0" y="28" width="768" height="44"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="bC4-0A-Qjh" id="rna-0d-wd1">
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="GE2016121201" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="5Tt-7m-QFz">
+                                                    <rect key="frame" x="8" y="8" width="121" height="21"/>
+                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2016-12-12" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="e5C-3D-UJW">
+                                                    <rect key="frame" x="345" y="8" width="97" height="21"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="CUSTOMER NAME" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="RMA-Os-3p1">
+                                                    <rect key="frame" x="143" y="8" width="189" height="21"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="AGENT NAME" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="4SK-nY-T58">
+                                                    <rect key="frame" x="454" y="8" width="190" height="21"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Create by" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="CxZ-jk-8rp">
+                                                    <rect key="frame" x="652" y="8" width="108" height="21"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                            </subviews>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="labelAgent" destination="4SK-nY-T58" id="Gvx-ZF-Yej"/>
+                                            <outlet property="labelCreateby" destination="CxZ-jk-8rp" id="HyW-Ty-5ik"/>
+                                            <outlet property="labelCustomer" destination="RMA-Os-3p1" id="rOI-M5-Abc"/>
+                                            <outlet property="labelDocID" destination="5Tt-7m-QFz" id="zRs-3S-3Tx"/>
+                                            <outlet property="labelJobDate" destination="e5C-3D-UJW" id="X2h-Tr-ay8"/>
+                                        </connections>
+                                    </tableViewCell>
+                                </prototypes>
+                                <connections>
+                                    <outlet property="dataSource" destination="6vP-98-4Js" id="wZG-5Q-xT5"/>
+                                    <outlet property="delegate" destination="6vP-98-4Js" id="DyW-Hp-PNK"/>
+                                </connections>
+                            </tableView>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    </view>
+                    <connections>
+                        <outlet property="tableView" destination="Flg-41-AM4" id="zGy-IK-tDu"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="XPr-rH-haQ" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="2916" y="-4145"/>
+        </scene>
     </scenes>
     </scenes>
     <resources>
     <resources>
         <image name="NewDoc" width="100" height="100"/>
         <image name="NewDoc" width="100" height="100"/>
         <image name="OpenDoc" width="100" height="100"/>
         <image name="OpenDoc" width="100" height="100"/>
+        <image name="PendingDoc" width="100" height="100"/>
         <image name="checkbox" width="16" height="16"/>
         <image name="checkbox" width="16" height="16"/>
         <image name="close" width="40" height="40"/>
         <image name="close" width="40" height="40"/>
         <image name="file_icon" width="20" height="20"/>
         <image name="file_icon" width="20" height="20"/>

+ 12 - 0
Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/project.pbxproj

@@ -60,6 +60,8 @@
 		7128C3541E12548C00FF635B /* PDFScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7128C34D1E12548C00FF635B /* PDFScrollView.m */; };
 		7128C3541E12548C00FF635B /* PDFScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7128C34D1E12548C00FF635B /* PDFScrollView.m */; };
 		7128C3551E12548C00FF635B /* SignatureListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7128C34F1E12548C00FF635B /* SignatureListViewController.m */; };
 		7128C3551E12548C00FF635B /* SignatureListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7128C34F1E12548C00FF635B /* SignatureListViewController.m */; };
 		7128C3561E12548C00FF635B /* SignatureTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7128C3511E12548C00FF635B /* SignatureTableViewCell.m */; };
 		7128C3561E12548C00FF635B /* SignatureTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7128C3511E12548C00FF635B /* SignatureTableViewCell.m */; };
+		714A9AEC1E9CA92000371995 /* PendingDocumentsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 714A9AEB1E9CA92000371995 /* PendingDocumentsViewController.m */; };
+		714A9AEF1E9CADA100371995 /* PendingDocumentsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 714A9AEE1E9CADA100371995 /* PendingDocumentsTableViewCell.m */; };
 		714B37041E70F2BF00E99B90 /* ScannerControllerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 714B36FF1E70F2BF00E99B90 /* ScannerControllerView.m */; };
 		714B37041E70F2BF00E99B90 /* ScannerControllerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 714B36FF1E70F2BF00E99B90 /* ScannerControllerView.m */; };
 		714B37051E70F2BF00E99B90 /* ScannerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 714B37011E70F2BF00E99B90 /* ScannerViewController.m */; };
 		714B37051E70F2BF00E99B90 /* ScannerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 714B37011E70F2BF00E99B90 /* ScannerViewController.m */; };
 		714B37061E70F2BF00E99B90 /* SCShapeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 714B37031E70F2BF00E99B90 /* SCShapeView.m */; };
 		714B37061E70F2BF00E99B90 /* SCShapeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 714B37031E70F2BF00E99B90 /* SCShapeView.m */; };
@@ -177,6 +179,10 @@
 		7128C34F1E12548C00FF635B /* SignatureListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SignatureListViewController.m; path = ../../common/SignatureListViewController.m; sourceTree = "<group>"; };
 		7128C34F1E12548C00FF635B /* SignatureListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SignatureListViewController.m; path = ../../common/SignatureListViewController.m; sourceTree = "<group>"; };
 		7128C3501E12548C00FF635B /* SignatureTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SignatureTableViewCell.h; path = ../../common/SignatureTableViewCell.h; sourceTree = "<group>"; };
 		7128C3501E12548C00FF635B /* SignatureTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SignatureTableViewCell.h; path = ../../common/SignatureTableViewCell.h; sourceTree = "<group>"; };
 		7128C3511E12548C00FF635B /* SignatureTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SignatureTableViewCell.m; path = ../../common/SignatureTableViewCell.m; sourceTree = "<group>"; };
 		7128C3511E12548C00FF635B /* SignatureTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SignatureTableViewCell.m; path = ../../common/SignatureTableViewCell.m; sourceTree = "<group>"; };
+		714A9AEA1E9CA91F00371995 /* PendingDocumentsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PendingDocumentsViewController.h; path = ../../common/PendingDocumentsViewController.h; sourceTree = "<group>"; };
+		714A9AEB1E9CA92000371995 /* PendingDocumentsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PendingDocumentsViewController.m; path = ../../common/PendingDocumentsViewController.m; sourceTree = "<group>"; };
+		714A9AED1E9CADA100371995 /* PendingDocumentsTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PendingDocumentsTableViewCell.h; path = ../../common/PendingDocumentsTableViewCell.h; sourceTree = "<group>"; };
+		714A9AEE1E9CADA100371995 /* PendingDocumentsTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PendingDocumentsTableViewCell.m; path = ../../common/PendingDocumentsTableViewCell.m; sourceTree = "<group>"; };
 		714B36FE1E70F2BF00E99B90 /* ScannerControllerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScannerControllerView.h; path = ../../../common/ScannerControllerView.h; sourceTree = "<group>"; };
 		714B36FE1E70F2BF00E99B90 /* ScannerControllerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScannerControllerView.h; path = ../../../common/ScannerControllerView.h; sourceTree = "<group>"; };
 		714B36FF1E70F2BF00E99B90 /* ScannerControllerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ScannerControllerView.m; path = ../../../common/ScannerControllerView.m; sourceTree = "<group>"; };
 		714B36FF1E70F2BF00E99B90 /* ScannerControllerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ScannerControllerView.m; path = ../../../common/ScannerControllerView.m; sourceTree = "<group>"; };
 		714B37001E70F2BF00E99B90 /* ScannerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScannerViewController.h; path = ../../../common/ScannerViewController.h; sourceTree = "<group>"; };
 		714B37001E70F2BF00E99B90 /* ScannerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScannerViewController.h; path = ../../../common/ScannerViewController.h; sourceTree = "<group>"; };
@@ -269,6 +275,10 @@
 				7115D4291E14DE0A00EF4E4C /* DocListTableViewCell.m */,
 				7115D4291E14DE0A00EF4E4C /* DocListTableViewCell.m */,
 				7115D4251E13B70C00EF4E4C /* DocumentListViewController.h */,
 				7115D4251E13B70C00EF4E4C /* DocumentListViewController.h */,
 				7115D4261E13B70C00EF4E4C /* DocumentListViewController.m */,
 				7115D4261E13B70C00EF4E4C /* DocumentListViewController.m */,
+				714A9AED1E9CADA100371995 /* PendingDocumentsTableViewCell.h */,
+				714A9AEE1E9CADA100371995 /* PendingDocumentsTableViewCell.m */,
+				714A9AEA1E9CA91F00371995 /* PendingDocumentsViewController.h */,
+				714A9AEB1E9CA92000371995 /* PendingDocumentsViewController.m */,
 				71BBFC351E6419D4008668A7 /* ExtDocumentsViewController.h */,
 				71BBFC351E6419D4008668A7 /* ExtDocumentsViewController.h */,
 				71BBFC361E6419D4008668A7 /* ExtDocumentsViewController.m */,
 				71BBFC361E6419D4008668A7 /* ExtDocumentsViewController.m */,
 				71B152ED1E66C87F00D2E5EC /* AddExtDocumentViewController.h */,
 				71B152ED1E66C87F00D2E5EC /* AddExtDocumentViewController.h */,
@@ -540,6 +550,7 @@
 				7128C2B71E1250CA00FF635B /* RectDrawable.m in Sources */,
 				7128C2B71E1250CA00FF635B /* RectDrawable.m in Sources */,
 				71BBFC3A1E651CC4008668A7 /* DocnotesViewController.m in Sources */,
 				71BBFC3A1E651CC4008668A7 /* DocnotesViewController.m in Sources */,
 				7128C2D91E12510900FF635B /* mztools.c in Sources */,
 				7128C2D91E12510900FF635B /* mztools.c in Sources */,
+				714A9AEF1E9CADA100371995 /* PendingDocumentsTableViewCell.m in Sources */,
 				7128C2EB1E12511B00FF635B /* NSString+Base64.m in Sources */,
 				7128C2EB1E12511B00FF635B /* NSString+Base64.m in Sources */,
 				7128C2CA1E1250FC00FF635B /* NetworkUtils.m in Sources */,
 				7128C2CA1E1250FC00FF635B /* NetworkUtils.m in Sources */,
 				7128C2B31E1250CA00FF635B /* BasicDrawable.m in Sources */,
 				7128C2B31E1250CA00FF635B /* BasicDrawable.m in Sources */,
@@ -557,6 +568,7 @@
 				7128C2DC1E12510900FF635B /* ZipArchive.mm in Sources */,
 				7128C2DC1E12510900FF635B /* ZipArchive.mm in Sources */,
 				7128C3561E12548C00FF635B /* SignatureTableViewCell.m in Sources */,
 				7128C3561E12548C00FF635B /* SignatureTableViewCell.m in Sources */,
 				7128C2B51E1250CA00FF635B /* GroupDrawable.m in Sources */,
 				7128C2B51E1250CA00FF635B /* GroupDrawable.m in Sources */,
+				714A9AEC1E9CA92000371995 /* PendingDocumentsViewController.m in Sources */,
 				7128C28E1E12501B00FF635B /* TouchImageView.m in Sources */,
 				7128C28E1E12501B00FF635B /* TouchImageView.m in Sources */,
 				7128C2B41E1250CA00FF635B /* GridDrawable.m in Sources */,
 				7128C2B41E1250CA00FF635B /* GridDrawable.m in Sources */,
 				7115D4561E1606F700EF4E4C /* GEContractFilterViewController.m in Sources */,
 				7115D4561E1606F700EF4E4C /* GEContractFilterViewController.m in Sources */,

BIN
Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/.DS_Store


+ 23 - 0
Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/PendingDoc.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "pending-.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "pending-@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "pending-@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/PendingDoc.imageset/pending-.png


BIN
Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/PendingDoc.imageset/pending-@2x.png


BIN
Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/PendingDoc.imageset/pending-@3x.png


+ 2 - 1
Ants Contract/common/ACNetwork.h

@@ -25,7 +25,8 @@
 +(NSDictionary *) updateNotes:(NSString*) doc_number notes:(NSString*)notes;
 +(NSDictionary *) updateNotes:(NSString*) doc_number notes:(NSString*)notes;
 +(NSDictionary*)upload_file:(NSString*)file params:(NSMutableDictionary*) params;
 +(NSDictionary*)upload_file:(NSString*)file params:(NSMutableDictionary*) params;
 
 
-
++(NSString *) getjsonPath:(NSString*) serial;
++(NSString *) getPDFPath:(NSString*) file;
 +(NSString *) offline_docnumber;
 +(NSString *) offline_docnumber;
 
 
 + (int)heartBeat;
 + (int)heartBeat;

+ 53 - 7
Ants Contract/common/ACNetwork.m

@@ -342,8 +342,16 @@
             
             
         }
         }
         
         
-        NSString* offPrefix = jsobj[@"offPrefix"];
+        NSString* offPrefix = jsobj[@"randcode"];
         bool canModify = [jsobj[@"can_modify"] boolValue];
         bool canModify = [jsobj[@"can_modify"] boolValue];
+        
+        NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
+        if(offPrefix!=nil)
+        {
+            [defaults setValue:offPrefix forKey:user];
+            [defaults synchronize];
+            
+        }
 //        NSDictionary* objheader = [jsobj objectForKey:@"header"];
 //        NSDictionary* objheader = [jsobj objectForKey:@"header"];
 //        
 //        
 //        NSString* required_ver=[jsobj objectForKey:@"min_ver"] ;
 //        NSString* required_ver=[jsobj objectForKey:@"min_ver"] ;
@@ -740,19 +748,57 @@
     return jsobj;
     return jsobj;
 
 
 }
 }
+
++(NSString *) getjsonPath:(NSString*) serial
+{
+    
+    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
+    NSString *cachefolder = [paths objectAtIndex:0];
+    
+    NSString *upfolder = [cachefolder stringByAppendingPathComponent:@"upload_data"];
+    upfolder = [upfolder stringByAppendingPathComponent:serial];
+    
+    NSString * jsonpath= [upfolder stringByAppendingPathComponent:@"json.json"];
+    return jsonpath;
+}
++(NSString *) getPDFPath:(NSString*) file
+{
+    
+    NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);//坐标
+    
+    NSString *saveDirectory=[paths objectAtIndex:0];
+
+    NSString *saveFileName=file ;
+    
+    NSString *newFilePath=[saveDirectory stringByAppendingPathComponent:saveFileName];
+    
+    
+    NSLog(@"%@",newFilePath);
+    return newFilePath;
+}
 +(NSString *) offline_docnumber
 +(NSString *) offline_docnumber
 {
 {
-    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    return @"prefix123";
+    
+  
+        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if( appDelegate.user==nil)
+        return nil;
+
+    
     
     
+    NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
     
     
-            NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
-    long docint=[defaults integerForKey:appDelegate.offPrefix];
+    NSString* prefix = [defaults stringForKey:appDelegate.user];
+    if(prefix==nil)
+        return nil;
+    long docint=[defaults integerForKey:prefix];
     docint++;
     docint++;
-            [defaults removeObjectForKey:appDelegate.offPrefix];
-           [defaults setInteger:docint forKey:appDelegate.offPrefix];
+            [defaults removeObjectForKey:prefix];
+           [defaults setInteger:docint forKey:prefix];
             [defaults synchronize];
             [defaults synchronize];
     
     
-    return [NSString stringWithFormat:@"%@%6ld",appDelegate.offPrefix,docint ];
+    return [NSString stringWithFormat:@"%@%6ld",prefix,docint ];
 }
 }
 
 
 + (int)heartBeat {
 + (int)heartBeat {

+ 10 - 3
Ants Contract/common/AppDelegate.h

@@ -8,14 +8,20 @@
 
 
 #import <UIKit/UIKit.h>
 #import <UIKit/UIKit.h>
 
 
+
+typedef NS_ENUM(NSInteger, AppAccessMode) {
+    AppAccessModeOffline = 0,
+    AppAccessModeOnline = 1
+};
+
 @interface AppDelegate : UIResponder <UIApplicationDelegate>
 @interface AppDelegate : UIResponder <UIApplicationDelegate>
 
 
 @property (strong, nonatomic) UIWindow *window;
 @property (strong, nonatomic) UIWindow *window;
 
 
 @property bool bEnable_Cache;
 @property bool bEnable_Cache;
 @property bool bLogin;
 @property bool bLogin;
-@property bool bCanModify;
-@property (strong,nonatomic) NSString* offPrefix;
+//@property bool bCanModify;
+//@property (strong,nonatomic) NSString* offPrefix;
 
 
 @property (strong,nonatomic) NSString* user;
 @property (strong,nonatomic) NSString* user;
 @property (strong,nonatomic) NSString * password;
 @property (strong,nonatomic) NSString * password;
@@ -24,6 +30,7 @@
 -(void) Login:(NSString* )user pwd:(NSString*) pwd canModify:(bool) canModify offPrefix:(NSString*) offPrefix;
 -(void) Login:(NSString* )user pwd:(NSString*) pwd canModify:(bool) canModify offPrefix:(NSString*) offPrefix;
 @property (strong,nonatomic) NSString* printerURL;
 @property (strong,nonatomic) NSString* printerURL;
 @property (strong,nonatomic) NSMutableDictionary* shareFile;
 @property (strong,nonatomic) NSMutableDictionary* shareFile;
-
+@property (assign) AppAccessMode accessMode;
+-(void) SwitchToOffline:(NSString* )user;
 @end
 @end
 
 

+ 15 - 4
Ants Contract/common/AppDelegate.m

@@ -29,6 +29,8 @@
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
     // Override point for customization after application launch.
     // Override point for customization after application launch.
     
     
+    self.accessMode = AppAccessModeOnline;
+    
     self.bEnable_Cache = true;
     self.bEnable_Cache = true;
     
     
     
     
@@ -258,8 +260,8 @@
 }
 }
 -(void) Login:(NSString* )user pwd:(NSString*) pwd canModify:(bool) canModify offPrefix:(NSString*) offPrefix
 -(void) Login:(NSString* )user pwd:(NSString*) pwd canModify:(bool) canModify offPrefix:(NSString*) offPrefix
 {
 {
-    self.bCanModify = canModify;
-    self.offPrefix = offPrefix;
+ //   self.bCanModify = canModify;
+//    self.offPrefix = offPrefix;
     self.user = user;
     self.user = user;
     self.password = pwd;
     self.password = pwd;
     self.bLogin = true;
     self.bLogin = true;
@@ -271,6 +273,15 @@
         [weakself heartBeatRightNow:YES];
         [weakself heartBeatRightNow:YES];
     });
     });
 }
 }
+-(void) SwitchToOffline:(NSString* )user
+{
+    self.accessMode = AppAccessModeOffline;
+ //   self.bCanModify = false;
+    //self.offPrefix = offPrefix;
+    self.user = user;
+    self.password = user;
+    self.bLogin = true;
+}
 -(void) Logout
 -(void) Logout
 {
 {
 //    MainViewController * main_vc= (MainViewController*)self.main_vc;
 //    MainViewController * main_vc= (MainViewController*)self.main_vc;
@@ -280,8 +291,8 @@
 //    [main_vc hideMenu];
 //    [main_vc hideMenu];
 //    [main_vc switchToHome];
 //    [main_vc switchToHome];
     self.user = nil;
     self.user = nil;
-    self.bCanModify = false;
-    self.offPrefix = nil;
+ //   self.bCanModify = false;
+//    self.offPrefix = nil;
     self.password=nil;
     self.password=nil;
     self.bLogin = false;
     self.bLogin = false;
     
     

+ 43 - 4
Ants Contract/common/DocumentListViewController.m

@@ -17,6 +17,8 @@
 #import "DocnotesViewController.h"
 #import "DocnotesViewController.h"
 
 
 #import "AddExtDocumentViewController.h"
 #import "AddExtDocumentViewController.h"
+#import "DocumentPageViewController.h"
+
 
 
 @interface DocumentListViewController ()
 @interface DocumentListViewController ()
 
 
@@ -995,6 +997,9 @@
     NSString* notes = item_json[@"notes"];
     NSString* notes = item_json[@"notes"];
     NSString* doc_number = item_json[@"doc_number"];
     NSString* doc_number = item_json[@"doc_number"];
     
     
+    NSString* pdfurl =item_json[@"pdf_path1"];
+    NSString* jsonurl =item_json[@"json_path1"];
+    
     NSMutableArray* arr_doc = [item_json[@"documents"] mutableCopy];
     NSMutableArray* arr_doc = [item_json[@"documents"] mutableCopy];
     
     
     UITableViewRowAction *docAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Documents"handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
     UITableViewRowAction *docAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Documents"handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
@@ -1048,10 +1053,44 @@
     
     
     
     
     UITableViewRowAction *modifyAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"   Modify        " handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
     UITableViewRowAction *modifyAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"   Modify        " handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
-        
+         __weak typeof(self) weakSelf = self;
         DebugLog(@"modify click");
         DebugLog(@"modify click");
         
         
-
+        UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Downloading contract"];
+        NSData* jsondata= [NSData dataWithContentsOfURL:[NSURL URLWithString:jsonurl]];
+        NSData* pdfdata= [NSData dataWithContentsOfURL:[NSURL URLWithString:pdfurl]];
+        [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+        if(jsondata==nil||pdfdata==nil)
+        {
+            
+            [RAUtils message_alert:@"Please try again."  title:@"Can not download contract" controller:self];
+            return;
+        }
+        
+        NSString* tempDir = NSTemporaryDirectory();
+        
+        NSString* jsonpath=[tempDir stringByAppendingPathComponent:@"json.json"];
+        NSString* pdfpath=[tempDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.pdf",item_json[@"doc_number"]]];
+        [jsondata writeToFile:jsonpath atomically:true];
+        [pdfdata writeToFile:pdfpath atomically:true];
+        
+        
+        DocumentPageViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DocumentPageViewController" ];
+        
+        //                dvc.templateName = @"debug.json";
+        dvc.templatePath = jsonpath;
+        dvc.pdfPath = pdfpath;
+        
+        dvc.docment_id =  item_json[@"doc_number"];
+        dvc.OnSave=^(NSString* file, NSString* subject)
+        {
+            
+            [weakSelf previewPDF:file title:item_json[@"doc_number"] subject:subject];
+        };
+        
+        [self.navigationController pushViewController:dvc animated:true];
+        
+        
 //        [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];
 //        [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];
 //        DocnotesViewController * notesVC =[ self.storyboard instantiateViewControllerWithIdentifier:@"DocnotesViewController"];
 //        DocnotesViewController * notesVC =[ self.storyboard instantiateViewControllerWithIdentifier:@"DocnotesViewController"];
 //
 //
@@ -1115,8 +1154,8 @@
     noteAction.backgroundColor = UIColorFromRGB(0x336699);
     noteAction.backgroundColor = UIColorFromRGB(0x336699);
     
     
     
     
-    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-    if(appDelegate.bCanModify)
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if(jsonurl.length>0)
         return @[modifyAction,docAction,noteAction];
         return @[modifyAction,docAction,noteAction];
     else
     else
         return @[docAction,noteAction];
         return @[docAction,noteAction];

+ 4 - 4
Ants Contract/common/DocumentPageViewController.h

@@ -23,10 +23,10 @@ typedef NS_ENUM(NSInteger, PDFEditAction) {
 @property size_t total_page;
 @property size_t total_page;
 @property CGPDFDocumentRef document;
 @property CGPDFDocumentRef document;
 @property (strong, nonatomic) NSMutableDictionary* signatureData;
 @property (strong, nonatomic) NSMutableDictionary* signatureData;
-
-
-@property (strong, nonatomic) NSString* pdfName;
-@property (strong, nonatomic) NSString* templateName;
+@property (assign, nonatomic) bool  hide_control;
+@property (assign, nonatomic) bool  no_save;
+@property (strong, nonatomic) NSString* pdfPath;//pdfName;
+@property (strong, nonatomic) NSString* templatePath;//templateName;
 
 
 @property (strong, nonatomic) NSString* docment_id;
 @property (strong, nonatomic) NSString* docment_id;
 @property long current_page;
 @property long current_page;

+ 181 - 37
Ants Contract/common/DocumentPageViewController.m

@@ -103,9 +103,9 @@
     self.signatureData= [[NSMutableDictionary alloc] init];
     self.signatureData= [[NSMutableDictionary alloc] init];
     
     
     
     
-    self.document = [PDFUtils OpenPDF:self.pdfName];
+    self.document = [PDFUtils OpenPDF:self.pdfPath];
     self.total_page = CGPDFDocumentGetNumberOfPages (self.document);
     self.total_page = CGPDFDocumentGetNumberOfPages (self.document);
-    self.controlTemplate = [self templateInit:[PDFUtils loadControl:self.templateName]];
+    self.controlTemplate = [self templateInit:[PDFUtils loadControl:self.templatePath]];
     
     
     
     
 //    self.title = [NSString stringWithFormat:@"%@ [%d/%ld]", self.docment_id,1, self.total_page ];
 //    self.title = [NSString stringWithFormat:@"%@ [%d/%ld]", self.docment_id,1, self.total_page ];
@@ -149,6 +149,12 @@
 
 
 - (IBAction)OnCancelClicked:(id)sender {
 - (IBAction)OnCancelClicked:(id)sender {
     
     
+    
+    if(self.no_save|| self.hide_control)
+    {
+        [self.navigationController popToRootViewControllerAnimated:false];
+        return;
+    }
     UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Are you sure cancel customer? All your entered information will lost." message:nil preferredStyle:UIAlertControllerStyleAlert];
     UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Are you sure cancel customer? All your entered information will lost." message:nil preferredStyle:UIAlertControllerStyleAlert];
     
     
     UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
     UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
@@ -373,25 +379,77 @@
 - (IBAction)onSaveClicked:(id)sender {
 - (IBAction)onSaveClicked:(id)sender {
     
     
     [self EndEditing];
     [self EndEditing];
+    if(self.no_save)
+    {
+     [RAUtils message_alert:@"Can not save pending document under offline mode." title:@"Save document" controller:self] ;
+        return;
+    }
     
     
     if([self verifyData]==false)
     if([self verifyData]==false)
         return;
         return;
     
     
     NSString* pdffile = nil;
     NSString* pdffile = nil;
     NSString* zipfile = nil;
     NSString* zipfile = nil;
-    
+    NSString* jsonfile = nil;
    // for(int l=0;l<1;l++)
    // for(int l=0;l<1;l++)
     {
     {
+        
+        if(self.hide_control)
+        {
+            pdffile = self.pdfPath;
+        }
+        else
+        {
         pdffile = [PDFUtils SavePDF:self.controlTemplate source:self.document window_rect:CGRectMake(0, 0, 768, 960) name:self.docment_id isnew:self.action==PDFEditActionNew];
         pdffile = [PDFUtils SavePDF:self.controlTemplate source:self.document window_rect:CGRectMake(0, 0, 768, 960) name:self.docment_id isnew:self.action==PDFEditActionNew];
-    
-    
+        }
+        
      zipfile=[ACNetwork prepareUploadFile:pdffile json:self.controlTemplate];
      zipfile=[ACNetwork prepareUploadFile:pdffile json:self.controlTemplate];
+        
+        //jsonfile = [ACNetwork getjsonPath:zip];
+        
     }
     }
     
     
-    
-    
-        __weak typeof(self) weakSelf = self;
+    __weak typeof(self) weakSelf = self;
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if(appDelegate.accessMode == AppAccessModeOffline)
+    {
+        
+        NSMutableDictionary * json = [[NSMutableDictionary alloc]init];
+        
+        json[@"json"]=@"json.json";
+        json[@"pdf"]=pdffile.lastPathComponent;
+        json[@"zip"]=zipfile.lastPathComponent;
+        json[@"serial"]=[json[@"zip"] stringByDeletingPathExtension];
+        
+        
+        
+        json[@"create_by"]=appDelegate.user;
+        
+
+        json[@"agent_name"]=[self extract_data:@"agent_name"];
+        json[@"doc_number"]=[self extract_data:@"doc_number"];
+        json[@"job_date"]=[self extract_data:@"job_date"];
+        json[@"customer_name"]=[self extract_data:@"customer_name"];
+        json[@"signed_date"]=[self extract_data:@"signed_date"];
+        
         
         
+        
+        NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
+        NSMutableArray * arr_pending = [[defaults arrayForKey:@"pending_doc"] mutableCopy];
+        if(arr_pending==nil)
+            arr_pending = [[NSMutableArray alloc]init];
+        [arr_pending addObject:json];
+        [defaults setObject:arr_pending forKey:@"pending_doc"];
+        [defaults synchronize];
+        
+        
+        [weakSelf.navigationController popToRootViewControllerAnimated:false];
+        if(weakSelf.OnSave)
+            weakSelf.OnSave(pdffile,@"");
+        
+    }
+    else
+    {
         UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Saving"];
         UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Saving"];
         
         
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
@@ -406,39 +464,108 @@
                 
                 
                 
                 
                 [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
                 [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-//                if([[logout_json valueForKey:@"result"] intValue]==2)
-//                {
-//                    self.welcomeLabel.text=@"Not sign in";
-//                    //                        [sender setTitle:@"Sign in" forState:UIControlStateNormal];
-//                    [bbitem setTitle:@"Sign in"];
-//                    
-//                    self.buttonHIC.enabled = false;
-//                    self.buttonSRL.enabled = false;
-//                    self.coverView.hidden = false;
-//                }
-//                else
-//                {
-//                    [RAUtils message_alert:[logout_json valueForKey:@"err_msg"] title:@"Sign out" controller:self] ;
-//                }
-                
-                                    if([[json valueForKey:@"result"] intValue]==2)
-                                    {
-                
-                                        
-                                        [weakSelf.navigationController popToRootViewControllerAnimated:false];
-                                        if(weakSelf.OnSave)
-                                            weakSelf.OnSave(pdffile,json[@"subject"]);
-                
+                //                if([[logout_json valueForKey:@"result"] intValue]==2)
+                //                {
+                //                    self.welcomeLabel.text=@"Not sign in";
+                //                    //                        [sender setTitle:@"Sign in" forState:UIControlStateNormal];
+                //                    [bbitem setTitle:@"Sign in"];
+                //
+                //                    self.buttonHIC.enabled = false;
+                //                    self.buttonSRL.enabled = false;
+                //                    self.coverView.hidden = false;
+                //                }
+                //                else
+                //                {
+                //                    [RAUtils message_alert:[logout_json valueForKey:@"err_msg"] title:@"Sign out" controller:self] ;
+                //                }
                 
                 
-                                    }
-                                    else
-                                    {
-                                        [RAUtils message_alert:[json valueForKey:@"err_msg"] title:@"Save document" controller:self] ;
-                                    }
+                if([[json valueForKey:@"result"] intValue]==2)
+                {
+                    
+                    
+                    [weakSelf.navigationController popToRootViewControllerAnimated:false];
+                    if(weakSelf.OnSave)
+                        weakSelf.OnSave(pdffile,json[@"subject"]);
+                    
+                    
+                }
+                else
+                {
+//                    [RAUtils message_alert:[json valueForKey:@"err_msg"] title:@"Save document" controller:self] ;
+                    
+                    
+                    
+                    UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Create Customer" message:@"Can not create new customer on server, do you want to create an offline document?" preferredStyle:UIAlertControllerStyleAlert];
+                    
+                    
+                    UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
+                        __block NSString* offline_docnumber =[ACNetwork offline_docnumber];
+                        if(offline_docnumber==nil)
+                        {
+                            [RAUtils message_alert:@"Offline document number prefix not found, Please check your user name and make sure you had signed in at least once."  title:@"Create Customer" controller:self] ;
+                            return;
+                        }
+                        [appDelegate SwitchToOffline:appDelegate.user];
+                        
+                        
+                        NSMutableDictionary * json = [[NSMutableDictionary alloc]init];
+                        
+                        json[@"json"]=@"json.json";
+                        json[@"pdf"]=pdffile.lastPathComponent;
+                        json[@"zip"]=zipfile.lastPathComponent;
+                        json[@"serial"]=[json[@"zip"] stringByDeletingPathExtension];
+                        
+                        
+                        
+                        json[@"create_by"]=appDelegate.user;
+                        
+                        
+                        json[@"agent_name"]=[self extract_data:@"agent_name"];
+                        json[@"doc_number"]=[self extract_data:@"doc_number"];
+                        json[@"job_date"]=[self extract_data:@"job_date"];
+                        json[@"customer_name"]=[self extract_data:@"customer_name"];
+                        json[@"signed_date"]=[self extract_data:@"signed_date"];
+                        
+                        
+                        
+                        NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
+                        NSMutableArray * arr_pending = [[defaults arrayForKey:@"pending_doc"] mutableCopy];
+                        if(arr_pending==nil)
+                            arr_pending = [[NSMutableArray alloc]init];
+                        [arr_pending addObject:json];
+                        [defaults setObject:arr_pending forKey:@"pending_doc"];
+                        [defaults synchronize];
+                        
+                        
+                        [weakSelf.navigationController popToRootViewControllerAnimated:false];
+                        if(weakSelf.OnSave)
+                            weakSelf.OnSave(pdffile,@"");
+                        
+                        
+                    }];
+                    
+                    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+                        DebugLog(@"Cancel");
+                    }];
+                    [alertControl addAction:actionOne];
+                    
+                    [alertControl addAction:alertthree];
+                    
+                    //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+                    
+                    
+                    [self presentViewController:alertControl animated:YES completion:nil];
+                    
+                }
                 
                 
                 
                 
             });
             });
         });
         });
+    }
+    
+    
+        
+  
         
         
         
         
         
         
@@ -686,7 +813,7 @@
     
     
     PageViewController.pageRef =  CGPDFDocumentGetPage (self.document , index+1);
     PageViewController.pageRef =  CGPDFDocumentGetPage (self.document , index+1);
     PageViewController.pageIndex = index;
     PageViewController.pageIndex = index;
-    
+    PageViewController.hide_control = self.hide_control;
     
     
             __weak typeof(self) weakSelf = self;
             __weak typeof(self) weakSelf = self;
     PageViewController.blk_Fill = ^(NSString* file,NSString* subtype,bool fillFullDoc)
     PageViewController.blk_Fill = ^(NSString* file,NSString* subtype,bool fillFullDoc)
@@ -747,6 +874,23 @@
 {
 {
     return viewController.pageIndex;//[self.pagePDF indexOfObject:viewController.pdfview];
     return viewController.pageIndex;//[self.pagePDF indexOfObject:viewController.pdfview];
 }
 }
+- (NSString*) extract_data:(NSString*)field_name
+{
+    for(int p=0;p<[self.controlTemplate[@"count"] intValue];p++)
+    {
+        NSDictionary* page=self.controlTemplate[[NSString stringWithFormat:@"page_%d",p]];
+        for(int c=0;c<[page[@"count"] intValue];c++)
+        {
+            NSDictionary* control=page[[NSString stringWithFormat:@"control_%d",c]];
+            if([control[@"field"] isEqualToString:field_name])
+            {
+                return control[@"value"]==nil?@"":control[@"value"];
+            }
+        }
+    }
+    return @"";
+}
+
 
 
 #pragma mark verify data
 #pragma mark verify data
 - (UIView *)createDemoView:(NSString*) msg
 - (UIView *)createDemoView:(NSString*) msg

+ 1 - 1
Ants Contract/common/PageViewController.h

@@ -30,5 +30,5 @@
 @property int keyboard_h;
 @property int keyboard_h;
 -(void)EndEditing;
 -(void)EndEditing;
 @property (assign, nonatomic) long  tiv_index;
 @property (assign, nonatomic) long  tiv_index;
-
+@property (assign, nonatomic) bool  hide_control;
 @end
 @end

+ 3 - 0
Ants Contract/common/PageViewController.m

@@ -157,6 +157,9 @@
 }
 }
 -(void) initControl
 -(void) initControl
 {
 {
+    
+    if(self.hide_control)
+        return;
 //    return;
 //    return;
     int count = [self.controlTemplate[@"count"] intValue];
     int count = [self.controlTemplate[@"count"] intValue];
     for(int i=0;i<count;i++)
     for(int i=0;i<count;i++)

+ 23 - 0
Ants Contract/common/PendingDocumentsTableViewCell.h

@@ -0,0 +1,23 @@
+//
+//  PendingDocumentsTableViewCell.h
+//  Granite Expo eSign
+//
+//  Created by Ray on 11/04/2017.
+//  Copyright © 2017 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface PendingDocumentsTableViewCell : UITableViewCell
+@property (strong, nonatomic) IBOutlet UILabel *labelDocID;
+@property (strong, nonatomic) IBOutlet UILabel *labelCustomer;
+
+@property (strong, nonatomic) IBOutlet UILabel *labelJobDate;
+
+
+@property (strong, nonatomic) IBOutlet UILabel *labelAgent;
+
+@property (strong, nonatomic) IBOutlet UILabel *labelSignDate;
+
+@property (strong, nonatomic) IBOutlet UILabel *labelCreateby;
+@end

+ 25 - 0
Ants Contract/common/PendingDocumentsTableViewCell.m

@@ -0,0 +1,25 @@
+//
+//  PendingDocumentsTableViewCell.m
+//  Granite Expo eSign
+//
+//  Created by Ray on 11/04/2017.
+//  Copyright © 2017 United Software Applications, Inc. All rights reserved.
+//
+
+#import "PendingDocumentsTableViewCell.h"
+
+
+@implementation PendingDocumentsTableViewCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+@end

+ 24 - 0
Ants Contract/common/PendingDocumentsViewController.h

@@ -0,0 +1,24 @@
+//
+//  PendingDocumentsViewController.h
+//  Granite Expo eSign
+//
+//  Created by Ray on 11/04/2017.
+//  Copyright © 2017 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface PendingDocumentsViewController : UIViewController
+@property (strong,nonatomic) NSMutableArray* table_data;
+@property (strong, nonatomic) IBOutlet UITableView *tableView;
+
+@property long offset;
+@property int limit;
+@property (strong,nonatomic) NSString* load_more_hint;
+//@property
+
+
+@property bool reset_result;
+
+@property (strong,nonatomic) NSMutableDictionary* filterparams;
+@end

+ 752 - 0
Ants Contract/common/PendingDocumentsViewController.m

@@ -0,0 +1,752 @@
+//
+//  PendingDocumentsViewController.m
+//  Granite Expo eSign
+//
+//  Created by Ray on 11/04/2017.
+//  Copyright © 2017 United Software Applications, Inc. All rights reserved.
+//
+
+#import "PendingDocumentsViewController.h"
+#import "ACNetwork.h"
+#import "PendingDocumentsTableViewCell.h"
+#import "RAUtils.h"
+#import "GEContractFilterViewController.h"
+#import "PDFViewController.h"
+#import "AppDelegate.h"
+#import "ExtDocumentsViewController.h"
+#import "DocnotesViewController.h"
+#import "DocumentPageViewController.h"
+#import "AddExtDocumentViewController.h"
+@interface PendingDocumentsViewController ()
+
+@end
+
+@implementation PendingDocumentsViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    
+    self.offset = 0;
+    self.limit = 20;
+    
+    self.table_data = [[NSMutableArray alloc] init];
+    
+    self.filterparams = [[NSMutableDictionary alloc]init];
+    
+
+    
+    
+
+    
+    
+    UIRefreshControl *ref = [[UIRefreshControl alloc]init];
+    ref.tag = 201 ;
+    ref.attributedTitle = [[NSAttributedString alloc]initWithString:@"Pull to refresh"];
+    ref.tintColor = [UIColor colorWithRed:0.10 green:0.68 blue:0.94 alpha:0.7];
+    //    ref.hidden = true;
+    [ref addTarget:self action:@selector(manually_refresh) forControlEvents:UIControlEventValueChanged];
+    [self.tableView addSubview:ref];
+    
+    //    NSMutableArray * arr = [[NSMutableArray alloc] init];
+    //    for(int i=0;i<100;i++)
+    //    {
+    //        [arr addObject:[NSNumber numberWithInt:i]];
+    //    }
+    //    NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
+    //    dict[@"arr"] = arr;
+    //    DebugLog([RAUtils dict2string:dict]);
+    
+    
+    
+    
+    
+    
+    
+    [self loadpage];
+    // Do any additional setup after loading the view.
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+- (IBAction)onAddClick:(id)sender {
+    
+    
+    __weak typeof(self) weakself = self;
+    {
+        
+        
+        
+        AddExtDocumentViewController * addVC;
+        
+        
+        
+        addVC = [ [UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"AddExtDocumentViewController"];
+        addVC.is_present = true;
+        addVC.doc_number = nil;
+        addVC.uploadSuccess = ^(NSMutableArray* arr_upload){
+            if(arr_upload.count>0)
+                [weakself loadpage];
+            
+            
+        };
+        //addVC.arr_documents = [NSMutableArray arrayWithObjects:appDelegate.shareFile, nil];
+        //appDelegate.shareFile=nil;
+        
+        //        notesVC.docNotes = notes;
+        
+        UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:addVC] ;
+        
+        
+        
+        
+        
+        
+        navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
+        [self presentViewController:navi animated:YES completion:^{
+            
+            //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
+            
+            DebugLog(@"filter present.........");
+            
+            //   self.btop = false;
+            //  <#code#>
+        }];
+        
+        
+    }
+}
+- (IBAction)onFilterClick:(id)sender {
+    
+    
+    GEContractFilterViewController * filterVC =[ self.storyboard instantiateViewControllerWithIdentifier:@"GEContractFilterViewController"];
+    filterVC.filterparams = self.filterparams;
+    
+    filterVC.OnSearch = ^(NSMutableDictionary* params)
+    {
+        //    [self reload_container_getdata:true];
+        self.reset_result=true;
+        //    self.norefresh=true;
+        [self loadpage];
+    };
+    
+    UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:filterVC] ;
+    
+    
+    
+    
+    
+    
+    navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
+    [self presentViewController:navi animated:YES completion:^{
+        
+        //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
+        
+        DebugLog(@"filter present.........");
+        
+        //   self.btop = false;
+        //  <#code#>
+    }];
+}
+
+-(void) previewPDF:(NSString*)url title:(NSString*)title subject:(NSString*)subject
+{
+    NSString* name=@"";//[self.content_data[indexPath.row] valueForKey:@"tear_name"];
+    //    NSString* url= file;//[self.content_data[indexPath.row] valueForKey:@"pdf_path"];
+    
+    
+    
+    bool isLocalFile= false;//[self.content_data[indexPath.row] valueForKey:@"isLocalFile"];
+    
+    PDFViewController *ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PDFViewController"];
+    ViewController.url = url;
+    ViewController.canSave = false;
+    ViewController.isLocalfile=isLocalFile;
+    ViewController.defaultStyle = true;
+    ViewController.save_name = title;
+    //   NSString* subject;
+    //                    if (company.length==0) {
+    
+    //    NSString* cur_time =[RAUtils current_date];
+    //   subject =name;//[NSString stringWithFormat:@"NPD Product List %@",cur_time];
+    
+    //    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    //    NSString* customer_email=    [appDelegate.customerInfo valueForKey:@"customer_email"];
+    
+    
+    NSMutableArray* send_to = [[NSMutableArray alloc]init];
+    //    if(customer_email.length>0)
+    //    {
+    //        send_to=[[customer_email componentsSeparatedByString:NSLocalizedString(@";", nil)] mutableCopy];
+    //        //                            customer_email compo
+    //        //                            [send_to addObject:customer_email];
+    //    }
+    ViewController.mail_to = send_to;
+    
+    //                    }
+    //                    else
+    //                    {
+    //                        subject = [NSString stringWithFormat:@"Tear sheet for %@",company ];
+    //                    }
+    //    ViewController.attachment_name = [NSString stringWithFormat:@"NPD_Product_List %@.pdf",cur_time];
+    ViewController.mail_subject = subject;
+    
+    ViewController.hidenavi = false;
+    [self.navigationController pushViewController:ViewController animated:YES];
+}
+
+#pragma mark - OperationQueue request page data
+-(void) loadpage
+{
+
+    NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
+            self.table_data = [[defaults arrayForKey:@"pending_doc"] mutableCopy];
+
+    
+}
+- (void)loadmore
+{
+    //    self.btnrefresh.enabled = NO;
+    //    self.btnrefresh.titleLabel.text =NSLocalizedString(@"loading",nil);
+    
+    //    [self.btnrefresh setTitle:@"Loading..." forState:UIControlStateNormal];
+    [self loadpage];
+}
+-(void)manually_refresh
+{
+    UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:201];
+    //    if(self.isrefreshing)
+    //    {
+    //        [reF endRefreshing];
+    //        return;
+    //    }
+    reF.attributedTitle = [[NSAttributedString alloc]initWithString:@"Refreshing"];
+    if ([self respondsToSelector:@selector(ReloadData)])
+        [self performSelector:@selector(ReloadData) withObject:nil afterDelay:1];
+    
+}
+-(void)ReloadData
+{
+    
+    
+    //    [self.content_data removeAllObjects];
+    //    [self.table_order reloadData];
+    
+    
+    // self.table_order.hidden = true;
+    UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:201];
+    
+    [reF endRefreshing];
+    
+    reF.attributedTitle = [[NSAttributedString alloc]initWithString:@"Pull to refresh"];
+    
+    //    self.keywords=self.searchbar.text;
+    //    //    self.offset = 0;
+    self.reset_result=true;
+    //    [self.content_data removeAllObjects];
+    //    [self.table_order reloadData];
+    
+    
+    [self loadpage];
+    
+    //   [self loadpage];
+    
+}
+-(void)refresh_btn_click:(UILongPressGestureRecognizer*)gestureRecognizer
+{
+    //    [self reload_container_getdata:true];
+    self.reset_result=true;
+    //    self.norefresh=true;
+    [self loadpage];
+}
+
+
+/*
+ #pragma mark - Navigation
+ 
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+ // Get the new view controller using [segue destinationViewController].
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+
+#pragma mark - Table view data source
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
+{
+
+        return 44;
+    
+    
+}
+
+//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
+//{
+//    return 0;
+//}
+//- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
+//{
+//    return 0;
+//}
+//- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
+//{
+//        UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
+//    return myView;
+//
+//}
+
+- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
+{
+    
+    NSString* value =nil;//[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
+    
+    if(value==nil)
+        value=@"";
+    unsigned long color = strtoul([value UTF8String],0,16);
+    
+    UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
+    myView.backgroundColor =  UIColorFromRGB(0xf7f7f7);
+    myView.layer.shadowPath =[UIBezierPath bezierPathWithRect:myView.bounds].CGPath;
+    myView.layer.shadowColor = [UIColor blackColor].CGColor;
+    myView.layer.shadowOffset = CGSizeMake(0, 0);
+    myView.layer.shadowOpacity = 0.5;
+    myView.layer.shadowRadius = 2.0;
+    
+    
+    UILabel *statuslabel = [[UILabel alloc] initWithFrame:CGRectMake(8, 2, 130, 22)];
+    statuslabel.textColor=UIColorFromRGB(color);
+    statuslabel.backgroundColor = [UIColor clearColor];
+    statuslabel.text=NSLocalizedString(@"Document #", nil);
+    [statuslabel sizeToFit];
+    [myView addSubview:statuslabel];
+    
+
+    
+    UILabel *userlabel = [[UILabel alloc] initWithFrame:CGRectMake(143, 2, 135, 22)];
+    userlabel.textColor=UIColorFromRGB(color);
+    userlabel.backgroundColor = [UIColor clearColor];
+    userlabel.text=NSLocalizedString(@"Customer", nil);
+    [userlabel sizeToFit];
+    [myView addSubview:userlabel];
+    
+    //    UILabel *creatorlabel = [[UILabel alloc] initWithFrame:CGRectMake(155, 21, 135, 22)];
+    //    creatorlabel.textColor=UIColorFromRGB(color);
+    //    creatorlabel.backgroundColor = [UIColor clearColor];
+    //    creatorlabel.text=NSLocalizedString(@"Create by", nil);
+    //    [creatorlabel sizeToFit];
+    //    [myView addSubview:creatorlabel];
+    
+    UILabel *contactlabel = [[UILabel alloc] initWithFrame:CGRectMake(345, 2, 150, 22)];
+    
+    contactlabel.textColor=UIColorFromRGB(color);
+    contactlabel.backgroundColor = [UIColor clearColor];
+    contactlabel.text=NSLocalizedString(@"Job Date", nil);
+    [contactlabel sizeToFit];
+    [myView addSubview:contactlabel];
+    
+    //
+    //    UILabel *modellabel = [[UILabel alloc] initWithFrame:CGRectMake(424, 11, 52, 22)];
+    //    modellabel.textColor=[UIColor whiteColor];
+    //    modellabel.backgroundColor = [UIColor clearColor];
+    //    modellabel.text=NSLocalizedString(@"Model", nil);
+    //    [modellabel sizeToFit];
+    //    [myView addSubview:modellabel];
+    
+    //    UILabel *modellabel = [[UILabel alloc] initWithFrame:CGRectMake(self.table_order.frame.size.width-276, 2, 100, 22)];
+    //    modellabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
+    //    modellabel.textColor=[UIColor whiteColor];
+    //    modellabel.backgroundColor = [UIColor clearColor];
+    //    modellabel.text=NSLocalizedString(@"Items/QTY", nil);
+    //    [modellabel sizeToFit];
+    //    [myView addSubview:modellabel];
+    
+    UILabel *pricelabel = [[UILabel alloc] initWithFrame:CGRectMake(/*492*/self.tableView.frame.size.width-313, 2, 100, 22)];
+    pricelabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
+    pricelabel.textColor=UIColorFromRGB(color);
+    pricelabel.backgroundColor = [UIColor clearColor];
+    pricelabel.text=NSLocalizedString(@"Agent Name", nil);
+    [pricelabel sizeToFit];
+    [myView addSubview:pricelabel];
+    
+    UILabel *timelabel = [[UILabel alloc] initWithFrame:CGRectMake(self.tableView.frame.size.width-111/*605*/,2, 148, 22)];
+    timelabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
+    timelabel.textColor=UIColorFromRGB(color);
+    timelabel.backgroundColor = [UIColor clearColor];
+    //    if(self.time_zone==nil)
+    timelabel.text=@"Create by";
+    //    else
+    //        timelabel.text=[NSString stringWithFormat:@"Create time (%@)",self.time_zone];
+    [timelabel sizeToFit];
+    [myView addSubview:timelabel];
+    
+    myView.autoresizesSubviews=true;
+    // [myView setAutoresizingMask:UIViewAutoresizingFlexibleWidth  | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin];
+    
+    
+    
+    
+    //    modellabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+    //    pricelabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+    //    timelabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+    myView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+    //
+    return myView;
+}
+
+
+//- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
+//{
+//
+//
+//    NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
+//
+//    if(value==nil)
+//        value=@"";
+//    unsigned long color = strtoul([value UTF8String],0,16);
+//
+//
+//    DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
+//    //  myView.backgroundColor = UIColorFromRGB(0x996633);;
+//
+//
+//    myView.layer.shadowPath =[UIBezierPath bezierPathWithRect:myView.bounds].CGPath;
+//    //    myView.layer.masksToBounds = false;
+//    //添加四个边阴影
+//
+//    myView.layer.shadowColor = [UIColor blackColor].CGColor;
+//    myView.layer.shadowOffset = CGSizeMake(0, 0);
+//    myView.layer.shadowOpacity = 0.5;
+//    myView.layer.shadowRadius = 2.0;
+//
+//
+//    NSString*labeltitle = nil;
+//    switch (section) {
+//        case 0:
+//            labeltitle= @"Order Info";
+//            break;
+//        case 1:
+//        {
+//            labeltitle= @"More Info";
+//
+//            NSString* btntitle=nil ;
+//            if(self.showMore)
+//            {
+//                btntitle=@"Hide";
+//                //        [section setValue:@"false" forKey:@"hide"];
+//                //        [sender setTitle:@"Show" forState:UIControlStateNormal];
+//            }
+//            else{
+//                btntitle=@"Show";
+//            }
+//
+//
+//            UIButton * btn =[[UIButton alloc] initWithFrame:CGRectMake(tableView.bounds.size.width-50-15, 0, 50, 33)];
+//            btn.tag=section;
+//            [btn addTarget:self action:@selector(HideSction:) forControlEvents:UIControlEventTouchUpInside];
+//            [btn setTitle:btntitle forState:UIControlStateNormal];
+//            [myView addSubview:btn];
+//
+//        }
+//            break;
+//        case 2:{
+//            labeltitle= @"Models";
+//
+//            NSString* btntitle=nil ;
+//            if(self.showModels)
+//            {
+//                btntitle=@"Hide";
+//            }
+//            else{
+//                btntitle=@"Show";
+//            }
+//
+//
+//            UIButton * btn =[[UIButton alloc] initWithFrame:CGRectMake(tableView.bounds.size.width-50-15, 0, 50, 33)];
+//            btn.tag=section;
+//
+//            [btn addTarget:self action:@selector(HideSction:) forControlEvents:UIControlEventTouchUpInside];
+//
+//            [btn setTitle:btntitle forState:UIControlStateNormal];
+//            [myView addSubview:btn];
+//
+//        }
+//            break;
+//        case 3:
+//            labeltitle= @"Price Info";
+//        default:
+//            break;
+//    }
+//
+//
+//
+//    UILabel *titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 5.5, 200, 20)];
+//    titlelabel.textColor=UIColorFromRGB(color);;
+//    titlelabel.backgroundColor = [UIColor clearColor];
+//    titlelabel.text=NSLocalizedString(labeltitle, nil);
+//    [titlelabel sizeToFit];
+//    [myView addSubview:titlelabel];
+//
+//    //
+//    return myView;
+//}
+
+//- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
+//
+//    return [NSString stringWithFormat:@"Signature%ld",(long)section+1];
+//
+//}
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+    return 1;
+}
+- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
+{
+    return 22;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+    
+
+    return self.table_data.count;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    
+    
+        NSString *CellIdentifier = @"PendingDocumentsTableViewCell";
+        PendingDocumentsTableViewCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+        NSDictionary * item_json = self.table_data[indexPath.row];
+        
+        cell.labelAgent.text = item_json[@"agent_name"];
+        
+        
+        //    if(sss.length==0)
+        //        sss=@"";
+        cell.labelDocID.text = item_json[@"doc_number"];//
+
+        cell.labelJobDate.text =item_json[@"job_date"];
+        cell.labelCustomer.text =item_json[@"customer_name"];
+        cell.labelSignDate.text =item_json[@"signed_date"];
+        cell.labelCreateby.text =item_json[@"create_by"];
+        
+        
+        return cell;
+
+    
+    
+ 
+}
+#pragma mark tableview delegate
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    
+    NSDictionary * item_json = self.table_data[indexPath.row];
+
+    
+    DocumentPageViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DocumentPageViewController" ];
+    
+    //                dvc.templateName = @"debug.json";
+    
+    dvc.templatePath = [ACNetwork getjsonPath:item_json[@"serial"]];
+    dvc.pdfPath = [ACNetwork getPDFPath:item_json[@"pdf"]] ;
+    
+    dvc.hide_control =true;
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    dvc.no_save = appDelegate.accessMode==AppAccessModeOffline;
+    
+    
+    
+    
+    
+    dvc.docment_id =  item_json[@"doc_number"];
+    dvc.OnSave=^(NSString* file, NSString* subject)
+    {
+        
+        [self.table_data removeObjectAtIndex:indexPath.row];
+        
+        NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
+        [defaults setObject:self.table_data forKey:@"pending_doc"];
+        [defaults synchronize];
+        
+        [self.tableView reloadData];
+        
+    };
+    
+    [self.navigationController pushViewController:dvc animated:true];
+    
+    
+    
+}
+
+- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
+
+{
+    
+//    __weak typeof (self) weekself=self;
+//    __weak NSIndexPath* weekindex = indexPath;
+//    NSDictionary * item_json = self.table_data[indexPath.row];
+//    
+//    NSString* notes = item_json[@"notes"];
+//    NSString* doc_number = item_json[@"doc_number"];
+//    
+//    NSMutableArray* arr_doc = [item_json[@"documents"] mutableCopy];
+//    
+//    UITableViewRowAction *docAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Documents"handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
+//        
+//        DebugLog(@"Documents click");
+//        
+//        [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];
+//        
+//        
+//        ExtDocumentsViewController * docVC =[ self.storyboard instantiateViewControllerWithIdentifier:@"ExtDocumentsViewController"];
+//        
+//        docVC.docNumber = doc_number;
+//        docVC.arr_documents =arr_doc;
+//        
+//        docVC.closeExtDoc=^(bool refresh){
+//            
+//            if(refresh)
+//            {
+//                
+//                self.reset_result=true;
+//                //    self.norefresh=true;
+//                [self loadpage];
+//            }
+//            //            [weekself.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:weekindex, nil] withRowAnimation:UITableViewRowAnimationAutomatic];
+//            
+//        };
+//        //        notesVC.docNotes = notes;
+//        
+//        UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:docVC] ;
+//        
+//        
+//        
+//        
+//        
+//        
+//        navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
+//        [self presentViewController:navi animated:YES completion:^{
+//            
+//            //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
+//            
+//            DebugLog(@"filter present.........");
+//            
+//            //   self.btop = false;
+//            //  <#code#>
+//        }];
+//        
+//    }];
+//    
+//    
+//    docAction.backgroundColor = UIColorFromRGB(0xff9933);
+//    
+//    
+//    UITableViewRowAction *modifyAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"   Modify        " handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
+//        
+//        DebugLog(@"modify click");
+//        
+//        
+//        //        [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];
+//        //        DocnotesViewController * notesVC =[ self.storyboard instantiateViewControllerWithIdentifier:@"DocnotesViewController"];
+//        //
+//        //        notesVC.docNumber = doc_number;
+//        //        notesVC.docNotes = notes;
+//        //
+//        //        UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:notesVC] ;
+//        //
+//        //
+//        //
+//        //
+//        //
+//        //
+//        //        navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
+//        //        [self presentViewController:navi animated:YES completion:^{
+//        //
+//        //            //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
+//        //
+//        //            DebugLog(@"filter present.........");
+//        //
+//        //            //   self.btop = false;
+//        //            //  <#code#>
+//        //        }];
+//        
+//    }];
+//    
+//    modifyAction.backgroundColor = UIColorFromRGB(0x9BBF5A);
+//    
+    
+    UITableViewRowAction *delAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
+        
+        
+        UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Delete pending document" message:@"Are you sure?" preferredStyle:UIAlertControllerStyleAlert];
+
+        UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+            [self.table_data removeObjectAtIndex:indexPath.row];
+            
+            NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
+            [defaults setObject:self.table_data forKey:@"pending_doc"];
+            [defaults synchronize];
+            
+            [self.tableView reloadData];
+
+        }];
+               UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+            
+        }];
+        [alertControl addAction:actionOne];
+
+        [alertControl addAction:alertthree];
+        
+        //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+        
+        
+        [self presentViewController:alertControl animated:YES completion:nil];
+        
+            
+
+    }];
+    
+    delAction.backgroundColor = UIColorFromRGB(0x336699);
+    
+    
+
+        return @[delAction];
+
+    
+    
+}
+
+- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
+    
+     return YES;
+}
+
+- (void)tableView:(UITableView *)tableView
+commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:(NSIndexPath *)indexPath {
+    
+    
+    
+}
+
+- (UITableViewCellEditingStyle)tableView:(UITableView *)tv editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
+    
+    return UITableViewCellEditingStyleDelete;
+    
+  
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+@end

+ 2 - 0
Ants Contract/common/RootViewController.h

@@ -22,6 +22,8 @@
 
 
 @property (weak, nonatomic) IBOutlet UIImageView *imageBG;
 @property (weak, nonatomic) IBOutlet UIImageView *imageBG;
 @property (weak, nonatomic) IBOutlet UIImageView *coverBG;
 @property (weak, nonatomic) IBOutlet UIImageView *coverBG;
+@property (weak, nonatomic) IBOutlet UILabel *labelMode;
+@property (weak, nonatomic) IBOutlet UISwitch *switchMode;
 
 
 - (void)dealWithUILogout;
 - (void)dealWithUILogout;
 
 

+ 193 - 56
Ants Contract/common/RootViewController.m

@@ -14,6 +14,8 @@
 #import "RAUtils.h"
 #import "RAUtils.h"
 #import "PDFViewController.h"
 #import "PDFViewController.h"
 #import "DocumentListViewController.h"
 #import "DocumentListViewController.h"
+#import "PendingDocumentsViewController.h"
+
 #import "ACNetwork.h"
 #import "ACNetwork.h"
 #import "PDFUtils.h"
 #import "PDFUtils.h"
 #import "AddExtDocumentViewController.h"
 #import "AddExtDocumentViewController.h"
@@ -51,6 +53,19 @@
 -(void) viewDidAppear:(BOOL)animated
 -(void) viewDidAppear:(BOOL)animated
 {
 {
         AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
         AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if(appDelegate.accessMode == AppAccessModeOnline)
+    {
+        self.labelMode.text = @"Mode: Online";
+        [self.switchMode setOn:true];
+        self.navigationItem.rightBarButtonItem = self.ibSignin;
+    }
+    else
+    {
+        self.labelMode.text = @"Mode: Offline";
+        [self.switchMode setOn:false];
+        self.navigationItem.rightBarButtonItem = nil;
+    }
+
     if(!appDelegate.bLogin)
     if(!appDelegate.bLogin)
         [self presentLogin:self.ibSignin];
         [self presentLogin:self.ibSignin];
 
 
@@ -230,54 +245,60 @@
 //}
 //}
 
 
 - (IBAction)onNewCustomerClick:(id)sender {
 - (IBAction)onNewCustomerClick:(id)sender {
-//    [self leak_debug];
-//    return;
+    //    [self leak_debug];
+    //    return;
     
     
     __weak typeof(self) weakSelf = self;
     __weak typeof(self) weakSelf = self;
-    
-    
-    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Create customer"];
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if(appDelegate.accessMode == AppAccessModeOffline)
+    {
+        __block NSString* offline_docnumber =[ACNetwork offline_docnumber];
+        
+        if(offline_docnumber==nil)
+        {
+            [RAUtils message_alert:@"Offline document number prefix not found, Please check your user name and make sure you had signed in at least once."  title:@"Create Customer" controller:self] ;
+            return;
+        }
+        DocumentPageViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DocumentPageViewController" ];
+        
+        //                dvc.templateName = @"debug.json";
+        dvc.templatePath = [[NSBundle mainBundle] pathForResource:@"GEIC - Home Improvement Contract 2017 Update.json" ofType:nil];
+        dvc.pdfPath = [[NSBundle mainBundle] pathForResource:@"GEIC - Home Improvement Contract 2017 Update.pdf" ofType:nil];
+
+        dvc.docment_id =  offline_docnumber;
+        dvc.OnSave=^(NSString* file, NSString* subject)
+        {
+            
+            [weakSelf previewPDF:file title:offline_docnumber subject:subject];
+        };
+        
+        [self.navigationController pushViewController:dvc animated:true];
+        
+        
+    }
+    else
+    {
         
         
         
         
-        NSMutableDictionary* json=[[ACNetwork  new_document] mutableCopy];
         
         
-        dispatch_async(dispatch_get_main_queue(), ^{
-            [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+        UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Create customer"];
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             
             
             
             
-            if([json[@"result"] intValue]==RESULT_TRUE)
-                
-            {
-                DocumentPageViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DocumentPageViewController" ];
-                
-//                dvc.templateName = @"debug.json";
-                dvc.templateName = @"GEIC - Home Improvement Contract 2017 Update.json";
-                dvc.pdfName = @"GEIC - Home Improvement Contract 2017 Update.pdf";
-                dvc.docment_id = json[@"doc_number"];
-                dvc.OnSave=^(NSString* file, NSString* subject)
-                {
-                    
-                    [weakSelf previewPDF:file title:json[@"doc_number"] subject:subject];
-                };
-                
-                [self.navigationController pushViewController:dvc animated:true];
-            }
-            else
-            {
-//                [RAUtils message_alert:[json valueForKey:@"err_msg"]  title:@"Create Customer" controller:self] ;
+            NSMutableDictionary* json=[[ACNetwork  new_document] mutableCopy];
+            
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
                 
                 
-                UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Create Customer" message:@"Can not create new customer on server, do you want to create an offline document?" preferredStyle:UIAlertControllerStyleAlert];
-
                 
                 
-                UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
+                if([json[@"result"] intValue]==RESULT_TRUE)
                     
                     
+                {
                     DocumentPageViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DocumentPageViewController" ];
                     DocumentPageViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DocumentPageViewController" ];
                     
                     
                     //                dvc.templateName = @"debug.json";
                     //                dvc.templateName = @"debug.json";
-                    dvc.templateName = @"GEIC - Home Improvement Contract 2017 Update.json";
-                    dvc.pdfName = @"GEIC - Home Improvement Contract 2017 Update.pdf";
-                    dvc.docment_id = [ACNetwork offline_docnumber];
+                    dvc.templatePath = [[NSBundle mainBundle] pathForResource:@"GEIC - Home Improvement Contract 2017 Update.json" ofType:nil];
+                    dvc.pdfPath = [[NSBundle mainBundle] pathForResource:@"GEIC - Home Improvement Contract 2017 Update.pdf" ofType:nil];                    dvc.docment_id = json[@"doc_number"];
                     dvc.OnSave=^(NSString* file, NSString* subject)
                     dvc.OnSave=^(NSString* file, NSString* subject)
                     {
                     {
                         
                         
@@ -285,43 +306,159 @@
                     };
                     };
                     
                     
                     [self.navigationController pushViewController:dvc animated:true];
                     [self.navigationController pushViewController:dvc animated:true];
+                }
+                else
+                {
+                    //                [RAUtils message_alert:[json valueForKey:@"err_msg"]  title:@"Create Customer" controller:self] ;
                     
                     
+                    UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Create Customer" message:@"Can not create new customer on server, do you want to create an offline document?" preferredStyle:UIAlertControllerStyleAlert];
                     
                     
-                }];
-                
-                UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
-                    DebugLog(@"Cancel");
-                }];
-                [alertControl addAction:actionOne];
-                
-                [alertControl addAction:alertthree];
-                
-                //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
-                
-                
-                [self presentViewController:alertControl animated:YES completion:nil];
+                    
+                    UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
+                        __block NSString* offline_docnumber =[ACNetwork offline_docnumber];
+                        if(offline_docnumber==nil)
+                        {
+                            [RAUtils message_alert:@"Offline document number prefix not found, Please check your user name and make sure you had signed in at least once."  title:@"Create Customer" controller:self] ;
+                            return;
+                        }
+                        [appDelegate SwitchToOffline:appDelegate.user];
+                        DocumentPageViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DocumentPageViewController" ];
+                        
+                        //                dvc.templateName = @"debug.json";
+                        dvc.templatePath = [[NSBundle mainBundle] pathForResource:@"GEIC - Home Improvement Contract 2017 Update.json" ofType:nil];
+                        dvc.pdfPath = [[NSBundle mainBundle] pathForResource:@"GEIC - Home Improvement Contract 2017 Update.pdf" ofType:nil];
+
+                        dvc.docment_id =  offline_docnumber;
+                        dvc.OnSave=^(NSString* file, NSString* subject)
+                        {
+                            
+                            [weakSelf previewPDF:file title:offline_docnumber subject:subject];
+                        };
+                        
+                        [self.navigationController pushViewController:dvc animated:true];
+                        
+                        
+                    }];
+                    
+                    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+                        DebugLog(@"Cancel");
+                    }];
+                    [alertControl addAction:actionOne];
+                    
+                    [alertControl addAction:alertthree];
+                    
+                    //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+                    
+                    
+                    [self presentViewController:alertControl animated:YES completion:nil];
+                    
+                    
+                }
                 
                 
                 
                 
-            }
-            
-            
+            });
         });
         });
-    });
-    
-    
-    
+        
+        
+        
+    }
     
     
     
     
-
     
     
     
     
 }
 }
 - (IBAction)onCustomerPerDocClick:(id)sender {
 - (IBAction)onCustomerPerDocClick:(id)sender {
     
     
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if(appDelegate.accessMode == AppAccessModeOffline)
+    {
+        [RAUtils message_alert:@"You can only access this function onder online mode." title:@"Offline mode." controller:self];
+        return;
+    }
+    
     DocumentListViewController* docVC =[self.storyboard instantiateViewControllerWithIdentifier:@"DocumentListViewController" ];
     DocumentListViewController* docVC =[self.storyboard instantiateViewControllerWithIdentifier:@"DocumentListViewController" ];
     
     
     [self.navigationController pushViewController:docVC animated:true];
     [self.navigationController pushViewController:docVC animated:true];
 }
 }
+- (IBAction)onPendingDocClick:(id)sender {
+    PendingDocumentsViewController* docVC =[self.storyboard instantiateViewControllerWithIdentifier:@"PendingDocumentsViewController" ];
+    
+    [self.navigationController pushViewController:docVC animated:true];
+}
+- (IBAction)onModeSwitch:(id)sender {
+    UISwitch* sw = sender;
+    
+    NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
+    NSString * user = [AESCrypt decrypt:[defaults stringForKey:@"user"] password:@"usai"];
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if(sw.isOn)
+    {
+        self.navigationItem.rightBarButtonItem = self.ibSignin;
+        self.labelMode.text = @"Mode: Online";
+        [appDelegate Logout];
+        [self presentLogin:self.ibSignin];
+        
+   //
+      //  [self.switchMode setOn:true];
+    }
+    else
+    {
+        
+        
+        UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Enter user name for offline mode." message:nil preferredStyle:UIAlertControllerStyleAlert];
+        
+        
+        [alertControl addTextFieldWithConfigurationHandler:^(UITextField *textField) {
+            textField.text = user;
+            textField.keyboardType=UIKeyboardTypeDefault;
+            textField.delegate = nil;
+            
+            
+        }];
+        
+        UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+            
+            
+                    UITextField *name = alertControl.textFields.firstObject;
+                    if(name.text.length==0)
+                    {
+                        self.navigationItem.rightBarButtonItem = self.ibSignin;
+                        [sw setOn: true];
+                        [RAUtils message_alert:@"User name is required." title:@"Can not switch to offline mode." controller:self];
+                    }
+                    else
+                    {
+                        self.navigationItem.rightBarButtonItem = nil;
+                        self.labelMode.text = @"Mode: Offline";
+                        [appDelegate SwitchToOffline:name.text];
+                        self.welcomeLabel.text=[NSString stringWithFormat:@"Welcome %@",appDelegate.user];
+
+                        self.coverView.hidden = true;
+                    }
+            
+            
+        }];
+        // [alertControl addAction:actionOne];
+        
+        [alertControl addAction:alertthree];
+        
+        
+        UIAlertAction *alertcancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+            [sw setOn: true];
+        }];
+        [alertControl addAction:alertcancel];
+        //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+        
+        
+        
+        
+        [self presentViewController:alertControl animated:YES completion:nil];
+        
+      //  [self.switchMode setOn:false];
+    }
+}
 
 
 - (void)didReceiveMemoryWarning {
 - (void)didReceiveMemoryWarning {
     [super didReceiveMemoryWarning];
     [super didReceiveMemoryWarning];