Просмотр исходного кода

161010
fix: upload offline wishlist issue caused by time error.
Add: unlock function.
Add: sync will check current account & offline account.

Ray Zhang 9 лет назад
Родитель
Сommit
92038683af

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 134 - 22
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -228,11 +228,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/offline/OLDataProvider.m"
             filePath = "common/Functions/offline/OLDataProvider.m"
-            timestampString = "496807925.651955"
+            timestampString = "497764322.556114"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2078"
-            endingLineNumber = "2078"
+            startingLineNumber = "2091"
+            endingLineNumber = "2091"
             landmarkName = "+offline_createorder:"
             landmarkName = "+offline_createorder:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -253,22 +253,6 @@
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
       </BreakpointProxy>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/Functions/cart/CartViewController.m"
-            timestampString = "496659786.345942"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1347"
-            endingLineNumber = "1347"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
          <BreakpointContent
@@ -467,11 +451,11 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/offline/OLDataProvider.m"
             filePath = "common/Functions/offline/OLDataProvider.m"
-            timestampString = "496807925.651955"
+            timestampString = "497764322.556114"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1737"
-            endingLineNumber = "1737"
+            startingLineNumber = "1750"
+            endingLineNumber = "1750"
             landmarkName = "+offline_model:"
             landmarkName = "+offline_model:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -620,5 +604,133 @@
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
       </BreakpointProxy>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/offline/OLDataProvider.m"
+            timestampString = "497689866.465849"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "297"
+            endingLineNumber = "297"
+            landmarkName = "+prepareWishlist:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/data_provider/iSalesDB.m"
+            timestampString = "497696089.532886"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "775"
+            endingLineNumber = "775"
+            landmarkName = "+initializeDb"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/data_provider/iSalesDB.m"
+            timestampString = "497696089.532886"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "859"
+            endingLineNumber = "859"
+            landmarkName = "+execSql:db:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/data_provider/iSalesDB.m"
+            timestampString = "497694767.347312"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "43"
+            endingLineNumber = "43"
+            landmarkName = "offline_dirty()"
+            landmarkType = "9">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/sidemenu/LoginViewController.m"
+            timestampString = "497755310.694797"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "302"
+            endingLineNumber = "302"
+            landmarkName = "-onLoginClick:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/offline/OfflineSettingViewController.m"
+            timestampString = "497761550.534126"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "312"
+            endingLineNumber = "312"
+            landmarkName = "-OnCheckUpdate:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/offline/OfflineSettingViewController.m"
+            timestampString = "497764366.97742"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "324"
+            endingLineNumber = "324"
+            landmarkName = "-OnCheckUpdate:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/offline/OfflineUnlockViewController.m"
+            timestampString = "497764591.957008"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "31"
+            endingLineNumber = "31"
+            landmarkName = "-OnUnlockClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
    </Breakpoints>
 </Bucket>
 </Bucket>

+ 2 - 1
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -294,7 +294,7 @@
     
     
     if (ver!=nil) {
     if (ver!=nil) {
         
         
-        where=[NSString stringWithFormat:@"modify_time >'%@-%@-%@ %@:%@:%@'",[ver substringWithRange:NSMakeRange(0,4)],[ver substringWithRange:NSMakeRange(4,2)],[ver substringWithRange:NSMakeRange(6,2)],[ver substringWithRange:NSMakeRange(8,2)],[ver substringWithRange:NSMakeRange(10,2)],[ver substringWithRange:NSMakeRange(12,2)]];
+        where=@"is_dirty=1";
     }
     }
     sqlite3 *db = [iSalesDB get_db];
     sqlite3 *db = [iSalesDB get_db];
     
     
@@ -346,6 +346,7 @@
             itemjson[@"item_id"]=[NSNumber numberWithInt:item_id];
             itemjson[@"item_id"]=[NSNumber numberWithInt:item_id];
             itemjson[@"qty"]=[NSNumber numberWithInt:qty];
             itemjson[@"qty"]=[NSNumber numberWithInt:qty];
             itemjson[@"create_time"]=nscreate_time;
             itemjson[@"create_time"]=nscreate_time;
+            itemjson[@"modify_time"]=nsmodify_time;
             itemjson[@"is_delete"]=[NSNumber numberWithInt:is_delete];
             itemjson[@"is_delete"]=[NSNumber numberWithInt:is_delete];
             
             
             
             

+ 1 - 1
RedAnt ERP Mobile/common/Functions/offline/OfflineSettingViewController.h

@@ -18,7 +18,7 @@
 @property (strong, nonatomic) IBOutlet UISwitch *switch_internal_address;
 @property (strong, nonatomic) IBOutlet UISwitch *switch_internal_address;
 @property (strong, nonatomic) IBOutlet UILabel *label_sync;
 @property (strong, nonatomic) IBOutlet UILabel *label_sync;
 
 
-
+@property bool bunlock;
 @property (strong, nonatomic) IBOutlet UIButton *btn_clearcache;
 @property (strong, nonatomic) IBOutlet UIButton *btn_clearcache;
 
 
 //-(void) onLogUpdate;
 //-(void) onLogUpdate;

+ 146 - 0
RedAnt ERP Mobile/common/Functions/offline/OfflineSettingViewController.m

@@ -11,6 +11,7 @@
 #import "MainViewController.h"
 #import "MainViewController.h"
 #import "LoginViewController.h"
 #import "LoginViewController.h"
 #import "OLDataProvider.h"
 #import "OLDataProvider.h"
+#import "OfflineUnlockViewController.h"
 //#import "SyncControlPanelViewController.h"
 //#import "SyncControlPanelViewController.h"
 
 
 @interface OfflineSettingViewController ()
 @interface OfflineSettingViewController ()
@@ -18,9 +19,129 @@
 @end
 @end
 
 
 @implementation OfflineSettingViewController
 @implementation OfflineSettingViewController
+- (IBAction)onUnlockClicked:(id)sender {
+    
+    UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Unlock offline" message:@"Unlock offline to sync with another account." preferredStyle:UIAlertControllerStyleAlert];
+    //block代码块取代了delegate
+    
+    
+    
+    UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Unlock" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
+        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+
+        sqlite3* db = [iSalesDB get_db];
+        int offline_user_iscurrent=[iSalesDB get_recordcount:db table:@"offline_login" where:[NSString stringWithFormat:@"username='%@'",appDelegate.user ]];
+        
+        [iSalesDB close_db:db];
+        
+        
+        if(offline_user_iscurrent>0)
+        {
+        self.bunlock=true;
+        }
+        else
+        {
+            OfflineUnlockViewController * unlockvc =[ self.storyboard instantiateViewControllerWithIdentifier:@"OfflineUnlockViewController"];
+            unlockvc.returnValue = ^(bool blogin){
+                self.bunlock=true;
+            };
+            UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:unlockvc] ;
+            
+            
+            
+            
+            
+            //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
+            
+            navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
+            [self presentViewController:navi animated:YES completion:^{
+                
+                //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
+                
+                NSLog(@"LoginViewController present.........");
+                
+                //   self.btop = false;
+                //  <#code#>
+            }];
+
+            
+            
+        }
+        
+        
+        
+        
+//        UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Are you sure remove all models from cart?" message:nil preferredStyle:UIAlertControllerStyleAlert];
+//        //block代码块取代了delegate
+//        
+//        
+//        
+//        UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
+//            UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Remove Models From Cart"];
+//            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//                
+//                NSDictionary* cart_json = [iSalesNetwork cart_remove:ids];
+//                
+//                dispatch_async(dispatch_get_main_queue(), ^{
+//                    
+//                    [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+//                    
+//                    if([[cart_json valueForKey:@"result"] intValue]==2)
+//                    {
+//                        
+//                        [self end_edit];
+//                        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+//                        [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:true];
+//                        [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:true];
+//                    }
+//                    else
+//                    {
+//                        [RAUtils message_alert:[cart_json valueForKey:@"err_msg"] title:@"Delete Model" controller:self] ;
+//                    }
+//                    
+//                    
+//                    
+//                });
+//            });
+//            
+//            
+//        }];
+//        
+//        UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+//            NSLog(@"No");
+//        }];
+//        [alertControl addAction:actionOne];
+//        
+//        [alertControl addAction:alertthree];
+//        
+//        //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+//        
+//        
+//        [self presentViewController:alertControl animated:YES completion:nil];
+//        
+//        NSLog(@"%@",self.edit_select_arr);
+//        
+//        
+    }];
+ 
+    
+    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+        NSLog(@"No");
+    }];
+    [alertControl addAction:actionOne];
+     [alertControl addAction:alertthree];
+    
+    
+    //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+    
+    
+    [self presentViewController:alertControl animated:YES completion:nil];
+    
+}
 
 
 - (void)viewDidLoad {
 - (void)viewDidLoad {
     [super viewDidLoad];
     [super viewDidLoad];
+    self.bunlock=false;
     // Do any additional setup after loading the view.
     // Do any additional setup after loading the view.
     
     
     
     
@@ -184,10 +305,35 @@
     }
     }
     else
     else
     {
     {
+        
+        
+       // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+        
+        sqlite3* db = [iSalesDB get_db];
+        int offline_user_iscurrent=[iSalesDB get_recordcount:db table:@"offline_login" where:[NSString stringWithFormat:@"username='%@'",appDelegate.user ]];
+        
+        [iSalesDB close_db:db];
+        
+
+        
         NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
         NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
         
         
         NSString*  ver = [defaults stringForKey:@"OfflineVer"] ;
         NSString*  ver = [defaults stringForKey:@"OfflineVer"] ;
         
         
+        
+        if(offline_user_iscurrent==0)
+        {
+            if(!self.bunlock)
+            {
+            [RAUtils alert_view:@"Current login account is different from the offline account, to continue with sync, all current offline data will be erased, you must unlock offline lock first. " title:@"Sync denied."];
+            return;
+            }
+            else
+            {
+                ver=nil;
+            }
+        }
+        
         if(sender==nil)
         if(sender==nil)
         {
         {
             [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn parentvc:self];
             [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn parentvc:self];

+ 18 - 0
RedAnt ERP Mobile/common/Functions/offline/OfflineUnlockViewController.h

@@ -0,0 +1,18 @@
+//
+//  OfflineUnlockViewController.h
+//  iSales-NPD
+//
+//  Created by Ray on 10/10/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#
+
+@interface OfflineUnlockViewController : UIViewController
+@property (strong, nonatomic) IBOutlet UIBarButtonItem *bb_close;
+@property (strong, nonatomic) IBOutlet UIButton *btnUnlock;
+@property (strong, nonatomic) IBOutlet UITextField *edituser;
+@property (strong, nonatomic) IBOutlet UITextField *editpass;
+@property (nonatomic , copy) void (^returnValue)(bool bunlocked);
+@end

+ 87 - 0
RedAnt ERP Mobile/common/Functions/offline/OfflineUnlockViewController.m

@@ -0,0 +1,87 @@
+//
+//  OfflineUnlockViewController.m
+//  iSales-NPD
+//
+//  Created by Ray on 10/10/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "OfflineUnlockViewController.h"
+#import "RAUtils.h"
+#import "iSalesDB.h"
+#import "AESCrypt.h"
+
+
+@interface OfflineUnlockViewController ()
+
+@end
+
+@implementation OfflineUnlockViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+- (IBAction)OnUnlockClicked:(id)sender {
+    NSString* user = self.edituser.text;
+    NSString* password = self.editpass.text;
+    
+    
+//    NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
+    
+    
+    if(user.length==0||password.length==0)
+    {
+        //        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Error!" message:@"user or password can not be empty." delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
+        //        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
+        //
+        //
+        //        //[[UILabel appearanceWhenContainedIn:UIAlertView.class, nil] setAppearanceFont:[UIFont boldSystemFontOfSize:10]];
+        //        [alert show];
+        
+        
+        [RAUtils alert_view:@"Username or Password cannot be blank." title:@"Unlock offline"];
+        return;
+    }
+    
+    sqlite3* db = [iSalesDB get_db];
+    int offline_user_exist=[iSalesDB get_recordcount:db table:@"offline_login" where:[NSString stringWithFormat:@"lower(username)='%@' and password='%@'",user.lowercaseString ,[AESCrypt encrypt:password password:@"usai"]]];
+    
+    [iSalesDB close_db:db];
+    
+    if(offline_user_exist>0)
+        [self dismissViewControllerAnimated:YES completion:^{
+            
+                    if(self.returnValue)
+                    self.returnValue(true);
+
+        }];
+    else
+        [RAUtils alert_view:MSG_USERAUTH_ERROR title:@"Unlock offline"];
+    
+}
+- (IBAction)CloseClick:(id)sender {
+    
+    [self dismissViewControllerAnimated:true completion:nil];
+    if(self.returnValue)
+        self.returnValue(false);
+    
+    
+    
+}
+/*
+#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

+ 4 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/LoginViewController.m

@@ -292,11 +292,14 @@
                     NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
                     NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
                     
                     
                     bool offline_dirty=[defaults boolForKey:@"OFFLINE_DIRTY"];
                     bool offline_dirty=[defaults boolForKey:@"OFFLINE_DIRTY"];
+                    sqlite3* db = [iSalesDB get_db];
+                    int offline_user_exist=[iSalesDB get_recordcount:db table:@"offline_login" where:[NSString stringWithFormat:@"username='%@'",appDelegate.user ]];
                     
                     
+                    [iSalesDB close_db:db];
                     
                     
                     
                     
                     
                     
-                    if(offline_dirty&& !appDelegate.offline_mode)
+                    if(offline_dirty&& !appDelegate.offline_mode&& offline_user_exist>0)
                     {
                     {
                         
                         
                         UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Detected new offline data" message:@"Do you want to sync with server?" preferredStyle:UIAlertControllerStyleAlert];
                         UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Detected new offline data" message:@"Do you want to sync with server?" preferredStyle:UIAlertControllerStyleAlert];

+ 3 - 3
RedAnt ERP Mobile/common/data_provider/iSalesDB.m

@@ -703,7 +703,7 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
     
     
     NSString* create_offline_cart=@"CREATE TABLE IF NOT EXISTS offline_cart ( _id INTEGER PRIMARY KEY, orderitem_id integer,product_id INTEGER,item_id integer,str_price text , discount float , so_no VARCHAR(40), item_count integer,line_note text,bundle_item text,type integer,create_time TIMESTAMP default (datetime('now', 'localtime')),modify_time TIMESTAMP default (datetime('now', 'localtime')));";
     NSString* create_offline_cart=@"CREATE TABLE IF NOT EXISTS offline_cart ( _id INTEGER PRIMARY KEY, orderitem_id integer,product_id INTEGER,item_id integer,str_price text , discount float , so_no VARCHAR(40), item_count integer,line_note text,bundle_item text,type integer,create_time TIMESTAMP default (datetime('now', 'localtime')),modify_time TIMESTAMP default (datetime('now', 'localtime')));";
 //    NSString* create_offline_wish=@"CREATE TABLE IF NOT EXISTS offline_wishlist ( _id INTEGER PRIMARY KEY, product_id INTEGER,qty integer,item_id integer, create_time TIMESTAMP default (datetime('now', 'localtime')));";
 //    NSString* create_offline_wish=@"CREATE TABLE IF NOT EXISTS offline_wishlist ( _id INTEGER PRIMARY KEY, product_id INTEGER,qty integer,item_id integer, create_time TIMESTAMP default (datetime('now', 'localtime')));";
-    NSString* create_wishlist=@"CREATE TABLE IF NOT EXISTS wishlist ( _id INTEGER PRIMARY KEY, user_id INTEGER,  product_id integer ,item_id integer , qty integer,create_time TIMESTAMP default (datetime('now', 'localtime')),modify_time TIMESTAMP default (datetime('now', 'localtime')));";
+    NSString* create_wishlist=@"CREATE TABLE IF NOT EXISTS wishlist ( _id INTEGER PRIMARY KEY, user_id INTEGER,  product_id integer ,item_id integer , qty integer, is_delete integer, is_dirty integer,create_time TIMESTAMP default (datetime('now', 'localtime')),modify_time TIMESTAMP default (datetime('now', 'localtime')));";
 
 
     
     
     NSString* create_offline_contact=@"CREATE TABLE IF NOT EXISTS offline_contact (_id INTEGER, country VARCHAR(40,0), company_name VARCHAR(40,0), contact_id VARCHAR(20,0), addr_1 text, addr_2 text, addr_3 text, addr_4 text, zipcode varchar(20,0), state VARCHAR(40,0), city VARCHAR(40,0), first_name VARCHAR(40,0), last_name VARCHAR(40,0), phone VARCHAR(40,0), fax VARCHAR(40,0), email VARCHAR(40,0), notes text, price_type VARCHAR(40,0), sales_rep VARCHAR(40,0), type VARCHAR(40,0), create_time timestamp default (datetime('now', 'localtime')), editable integer, contact_name text, addr text, Sales_Order_Customer integer, Sales_Order_Freight_Bill_To integer, Sales_Order_Ship_From integer, Sales_Order_Merchandise_Bill_To integer, Contact_Return_To integer, Sales_Order_Ship_To integer,img_0 TEXT,img_1 TEXT,img_2 TEXT,related_cid VARCHAR(20,0),is_active integer,sync_data text,modify_time TIMESTAMP default (datetime('now', 'localtime')), PRIMARY KEY(_id) );";
     NSString* create_offline_contact=@"CREATE TABLE IF NOT EXISTS offline_contact (_id INTEGER, country VARCHAR(40,0), company_name VARCHAR(40,0), contact_id VARCHAR(20,0), addr_1 text, addr_2 text, addr_3 text, addr_4 text, zipcode varchar(20,0), state VARCHAR(40,0), city VARCHAR(40,0), first_name VARCHAR(40,0), last_name VARCHAR(40,0), phone VARCHAR(40,0), fax VARCHAR(40,0), email VARCHAR(40,0), notes text, price_type VARCHAR(40,0), sales_rep VARCHAR(40,0), type VARCHAR(40,0), create_time timestamp default (datetime('now', 'localtime')), editable integer, contact_name text, addr text, Sales_Order_Customer integer, Sales_Order_Freight_Bill_To integer, Sales_Order_Ship_From integer, Sales_Order_Merchandise_Bill_To integer, Contact_Return_To integer, Sales_Order_Ship_To integer,img_0 TEXT,img_1 TEXT,img_2 TEXT,related_cid VARCHAR(20,0),is_active integer,sync_data text,modify_time TIMESTAMP default (datetime('now', 'localtime')), PRIMARY KEY(_id) );";
@@ -731,7 +731,7 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
     NSString* create_cart_trigger=@"CREATE TRIGGER  if not exists offline_cart_insert after insert on offline_cart BEGIN select offline_dirty(); UPDATE offline_cart SET modify_time= datetime('now', 'localtime') WHERE _id=new._id;  END;CREATE TRIGGER  if not exists offline_cart_update after update on offline_cart BEGIN select offline_dirty(); UPDATE offline_cart SET modify_time= datetime('now', 'localtime') WHERE _id=new._id;  END;CREATE TRIGGER  if not exists offline_cart_delete after delete on offline_cart BEGIN select offline_dirty();  END;";
     NSString* create_cart_trigger=@"CREATE TRIGGER  if not exists offline_cart_insert after insert on offline_cart BEGIN select offline_dirty(); UPDATE offline_cart SET modify_time= datetime('now', 'localtime') WHERE _id=new._id;  END;CREATE TRIGGER  if not exists offline_cart_update after update on offline_cart BEGIN select offline_dirty(); UPDATE offline_cart SET modify_time= datetime('now', 'localtime') WHERE _id=new._id;  END;CREATE TRIGGER  if not exists offline_cart_delete after delete on offline_cart BEGIN select offline_dirty();  END;";
     
     
     
     
-    NSString* create_wishlist_trigger=@"CREATE TRIGGER  if not exists wishlist_insert after insert on wishlist BEGIN select offline_dirty();  UPDATE wishlist SET modify_time= datetime('now', 'localtime') WHERE _id=new._id;END;CREATE TRIGGER  if not exists wishlist_update after update on wishlist BEGIN select offline_dirty();  UPDATE wishlist SET modify_time= datetime('now', 'localtime'), is_delete = 0 WHERE _id=new._id; END;CREATE TRIGGER if not exists wishlist_delete after DELETE ON wishlist BEGIN select offline_dirty(); END;";
+    NSString* create_wishlist_trigger=@"CREATE TRIGGER  if not exists wishlist_insert after insert on wishlist BEGIN select offline_dirty();  UPDATE wishlist SET modify_time= datetime('now', 'localtime') WHERE _id=new._id;END;CREATE TRIGGER  if not exists wishlist_update after update on wishlist BEGIN select offline_dirty();  UPDATE wishlist SET modify_time= datetime('now', 'localtime'), is_ditry = 1 WHERE _id=new._id; END;CREATE TRIGGER if not exists wishlist_delete after DELETE ON wishlist BEGIN select offline_dirty(); END;";
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     
     
     //if(appDelegate.offline_mode)
     //if(appDelegate.offline_mode)
@@ -802,7 +802,7 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
     [self alterTable:@"wishlist" columns:@"qty integer;item_id integer" rename:NO db:db];
     [self alterTable:@"wishlist" columns:@"qty integer;item_id integer" rename:NO db:db];
     [self alterTable:@"wishlist" columns:@"modify_time TIMESTAMP" rename:NO db:db];
     [self alterTable:@"wishlist" columns:@"modify_time TIMESTAMP" rename:NO db:db];
     [self alterTable:@"wishlist" columns:@"is_delete integer" rename:NO db:db];
     [self alterTable:@"wishlist" columns:@"is_delete integer" rename:NO db:db];
-    
+    [self alterTable:@"wishlist" columns:@"is_dirty integer" rename:NO db:db];
     
     
     [self alterTable:@"offline_order" columns:@"modify_time TIMESTAMP" rename:NO db:db];
     [self alterTable:@"offline_order" columns:@"modify_time TIMESTAMP" rename:NO db:db];
     [self alterTable:@"offline_order" columns:@"ship_via text" rename:NO db:db];
     [self alterTable:@"offline_order" columns:@"ship_via text" rename:NO db:db];

+ 6 - 0
RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj

@@ -55,6 +55,7 @@
 		714B1F401C7BF74100539193 /* OrderDetailSignatureCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 714B1F3F1C7BF74100539193 /* OrderDetailSignatureCell.m */; };
 		714B1F401C7BF74100539193 /* OrderDetailSignatureCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 714B1F3F1C7BF74100539193 /* OrderDetailSignatureCell.m */; };
 		715001FF1D114D9100F5927F /* BundleDetailButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 715001FE1D114D9100F5927F /* BundleDetailButton.m */; };
 		715001FF1D114D9100F5927F /* BundleDetailButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 715001FE1D114D9100F5927F /* BundleDetailButton.m */; };
 		715850461CF6F0E500856B20 /* DefaultAppearance.m in Sources */ = {isa = PBXBuildFile; fileRef = 715850451CF6F0E500856B20 /* DefaultAppearance.m */; };
 		715850461CF6F0E500856B20 /* DefaultAppearance.m in Sources */ = {isa = PBXBuildFile; fileRef = 715850451CF6F0E500856B20 /* DefaultAppearance.m */; };
+		715F30BD1DAB37EB00490EED /* OfflineUnlockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 715F30BC1DAB37EB00490EED /* OfflineUnlockViewController.m */; };
 		7161FEB51D61B24900157EE1 /* creditcardpayment.html in Resources */ = {isa = PBXBuildFile; fileRef = 7161FEB21D61B24900157EE1 /* creditcardpayment.html */; };
 		7161FEB51D61B24900157EE1 /* creditcardpayment.html in Resources */ = {isa = PBXBuildFile; fileRef = 7161FEB21D61B24900157EE1 /* creditcardpayment.html */; };
 		7161FEB61D61B24900157EE1 /* normalpayment.html in Resources */ = {isa = PBXBuildFile; fileRef = 7161FEB31D61B24900157EE1 /* normalpayment.html */; };
 		7161FEB61D61B24900157EE1 /* normalpayment.html in Resources */ = {isa = PBXBuildFile; fileRef = 7161FEB31D61B24900157EE1 /* normalpayment.html */; };
 		7161FEB71D61B24900157EE1 /* orderinfo.html in Resources */ = {isa = PBXBuildFile; fileRef = 7161FEB41D61B24900157EE1 /* orderinfo.html */; };
 		7161FEB71D61B24900157EE1 /* orderinfo.html in Resources */ = {isa = PBXBuildFile; fileRef = 7161FEB41D61B24900157EE1 /* orderinfo.html */; };
@@ -290,6 +291,8 @@
 		715001FE1D114D9100F5927F /* BundleDetailButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BundleDetailButton.m; path = common/Functions/BundleDetailButton.m; sourceTree = SOURCE_ROOT; };
 		715001FE1D114D9100F5927F /* BundleDetailButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BundleDetailButton.m; path = common/Functions/BundleDetailButton.m; sourceTree = SOURCE_ROOT; };
 		715850441CF6F0E500856B20 /* DefaultAppearance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DefaultAppearance.h; path = common/Functions/DefaultAppearance.h; sourceTree = SOURCE_ROOT; };
 		715850441CF6F0E500856B20 /* DefaultAppearance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DefaultAppearance.h; path = common/Functions/DefaultAppearance.h; sourceTree = SOURCE_ROOT; };
 		715850451CF6F0E500856B20 /* DefaultAppearance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DefaultAppearance.m; path = common/Functions/DefaultAppearance.m; sourceTree = SOURCE_ROOT; };
 		715850451CF6F0E500856B20 /* DefaultAppearance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DefaultAppearance.m; path = common/Functions/DefaultAppearance.m; sourceTree = SOURCE_ROOT; };
+		715F30BB1DAB37EB00490EED /* OfflineUnlockViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OfflineUnlockViewController.h; path = common/Functions/offline/OfflineUnlockViewController.h; sourceTree = SOURCE_ROOT; };
+		715F30BC1DAB37EB00490EED /* OfflineUnlockViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OfflineUnlockViewController.m; path = common/Functions/offline/OfflineUnlockViewController.m; sourceTree = SOURCE_ROOT; };
 		7161FEB21D61B24900157EE1 /* creditcardpayment.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = creditcardpayment.html; path = common/Functions/offline/creditcardpayment.html; sourceTree = SOURCE_ROOT; };
 		7161FEB21D61B24900157EE1 /* creditcardpayment.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = creditcardpayment.html; path = common/Functions/offline/creditcardpayment.html; sourceTree = SOURCE_ROOT; };
 		7161FEB31D61B24900157EE1 /* normalpayment.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = normalpayment.html; path = common/Functions/offline/normalpayment.html; sourceTree = SOURCE_ROOT; };
 		7161FEB31D61B24900157EE1 /* normalpayment.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = normalpayment.html; path = common/Functions/offline/normalpayment.html; sourceTree = SOURCE_ROOT; };
 		7161FEB41D61B24900157EE1 /* orderinfo.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = orderinfo.html; path = common/Functions/offline/orderinfo.html; sourceTree = SOURCE_ROOT; };
 		7161FEB41D61B24900157EE1 /* orderinfo.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = orderinfo.html; path = common/Functions/offline/orderinfo.html; sourceTree = SOURCE_ROOT; };
@@ -952,6 +955,8 @@
 				716AF8E01D7AA0E0001188E0 /* SelectUploadOrderViewController.m */,
 				716AF8E01D7AA0E0001188E0 /* SelectUploadOrderViewController.m */,
 				716AF8E51D7AA398001188E0 /* SelectOrderTableViewCell.m */,
 				716AF8E51D7AA398001188E0 /* SelectOrderTableViewCell.m */,
 				716AF8E61D7AA398001188E0 /* SelectOrderTableViewCell.h */,
 				716AF8E61D7AA398001188E0 /* SelectOrderTableViewCell.h */,
+				715F30BB1DAB37EB00490EED /* OfflineUnlockViewController.h */,
+				715F30BC1DAB37EB00490EED /* OfflineUnlockViewController.m */,
 			);
 			);
 			name = offline;
 			name = offline;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -1453,6 +1458,7 @@
 				7141DD5F1C5747CE00F7DF59 /* AESCrypt.m in Sources */,
 				7141DD5F1C5747CE00F7DF59 /* AESCrypt.m in Sources */,
 				7162A5991C58733400AB630E /* OrderDetailHtmlCell.m in Sources */,
 				7162A5991C58733400AB630E /* OrderDetailHtmlCell.m in Sources */,
 				7162A5091C586FC100AB630E /* CycleScrollView.m in Sources */,
 				7162A5091C586FC100AB630E /* CycleScrollView.m in Sources */,
+				715F30BD1DAB37EB00490EED /* OfflineUnlockViewController.m in Sources */,
 				7162A5161C58704600AB630E /* BundleModelCell.m in Sources */,
 				7162A5161C58704600AB630E /* BundleModelCell.m in Sources */,
 				7141DD621C5747CE00F7DF59 /* NSData+CommonCrypto.m in Sources */,
 				7141DD621C5747CE00F7DF59 /* NSData+CommonCrypto.m in Sources */,
 				71DF74891C57608F00F2789C /* RadioButton.m in Sources */,
 				71DF74891C57608F00F2789C /* RadioButton.m in Sources */,

Разница между файлами не показана из-за своего большого размера
+ 227 - 227
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard


+ 197 - 51
RedAnt ERP Mobile/iSales-NPD/Base.lproj/OLM.storyboard

@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" colorMatched="YES">
     <dependencies>
     <dependencies>
         <deployment identifier="iOS"/>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     </dependencies>
     <scenes>
     <scenes>
         <!--Offline Setting-->
         <!--Offline Setting-->
@@ -14,80 +15,87 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                         <subviews>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enable offline mode" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="iMj-3v-3eE">
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enable offline mode" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="iMj-3v-3eE">
-                                <rect key="frame" x="20" y="25" width="181" height="21"/>
+                                <frame key="frameInset" minX="20" minY="25" width="181" height="21"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Use internal address" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Baf-ru-Ueq">
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Use internal address" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Baf-ru-Ueq">
-                                <rect key="frame" x="20" y="76" width="173" height="21"/>
+                                <frame key="frameInset" minX="20" minY="76" width="173" height="21"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             </label>
                             <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="9fI-uo-0D5">
                             <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="9fI-uo-0D5">
-                                <rect key="frame" x="217" y="20" width="51" height="31"/>
+                                <frame key="frameInset" minX="217" minY="20" width="51" height="31"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <connections>
                                 <connections>
                                     <action selector="onChangeOfflineSwitch:" destination="FG7-WW-Z5X" eventType="valueChanged" id="F0c-jb-lQb"/>
                                     <action selector="onChangeOfflineSwitch:" destination="FG7-WW-Z5X" eventType="valueChanged" id="F0c-jb-lQb"/>
                                 </connections>
                                 </connections>
                             </switch>
                             </switch>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Last sync" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="o7T-n9-rhA">
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Last sync" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="o7T-n9-rhA">
-                                <rect key="frame" x="20" y="119" width="91" height="21"/>
+                                <frame key="frameInset" minX="20" minY="119" width="91" height="21"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="mAv-YK-pnD">
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="mAv-YK-pnD">
-                                <rect key="frame" x="217" y="119" width="179" height="21"/>
+                                <frame key="frameInset" minX="217" minY="119" width="179" height="21"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Cache size" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="4VN-I0-qDk">
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Cache size" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="4VN-I0-qDk">
-                                <rect key="frame" x="20" y="168" width="91" height="21"/>
+                                <frame key="frameInset" minX="20" minY="168" width="91" height="21"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Version" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="kcI-2q-g1r">
-                                <rect key="frame" x="20" y="217" width="91" height="21"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Version" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="kcI-2q-g1r">
+                                <frame key="frameInset" minX="20" minY="217" width="91" height="21"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             </label>
-                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="Kdt-hI-Mna">
-                                <rect key="frame" x="663" y="212" width="85" height="30"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Unlock offline" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="MNF-V6-2fB">
+                                <frame key="frameInset" minX="20" minY="266" width="106" height="21"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="Kdt-hI-Mna">
+                                <frame key="frameInset" minY="212" width="85" height="30" maxX="20"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                 <state key="normal" title="Submit local"/>
                                 <state key="normal" title="Submit local"/>
                             </button>
                             </button>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3.22GB" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="J6c-cK-Ihd">
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3.22GB" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="J6c-cK-Ihd">
-                                <rect key="frame" x="217" y="168" width="111" height="21"/>
+                                <frame key="frameInset" minX="217" minY="168" width="111" height="21"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="20160228231919" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Avj-sE-gE6">
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="20160228231919" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Avj-sE-gE6">
-                                <rect key="frame" x="217" y="217" width="147" height="21"/>
+                                <frame key="frameInset" minX="217" minY="217" width="147" height="21"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             </label>
-                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="Vzg-50-bc2">
-                                <rect key="frame" x="666" y="164" width="82" height="30"/>
+                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="Vzg-50-bc2">
+                                <frame key="frameInset" minY="164" width="82" height="30" maxX="20"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                 <state key="normal" title="Clear cache"/>
                                 <state key="normal" title="Clear cache"/>
                             </button>
                             </button>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="jns-5C-X4w">
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="jns-5C-X4w">
-                                <rect key="frame" x="616" y="115" width="132" height="30"/>
+                                <frame key="frameInset" minY="115" width="132" height="30" maxX="20"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                 <state key="normal" title="Sync"/>
                                 <state key="normal" title="Sync"/>
                                 <connections>
                                 <connections>
@@ -95,13 +103,20 @@
                                 </connections>
                                 </connections>
                             </button>
                             </button>
                             <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" id="lgu-mf-cTC">
                             <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" id="lgu-mf-cTC">
-                                <rect key="frame" x="217" y="71" width="51" height="31"/>
+                                <frame key="frameInset" minX="217" minY="71" width="51" height="31"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                             </switch>
                             </switch>
+                            <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="cIN-uF-BHa">
+                                <frame key="frameInset" minY="262" width="82" height="30" maxX="20"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                                <state key="normal" title="Unlock"/>
+                                <connections>
+                                    <action selector="onUnlockClicked:" destination="FG7-WW-Z5X" eventType="touchUpInside" id="kED-gf-S3K"/>
+                                </connections>
+                            </button>
                         </subviews>
                         </subviews>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </view>
                     </view>
-                    <simulatedScreenMetrics key="simulatedDestinationMetrics"/>
                     <connections>
                     <connections>
                         <outlet property="btn_checkupdate" destination="jns-5C-X4w" id="TPE-6V-eWn"/>
                         <outlet property="btn_checkupdate" destination="jns-5C-X4w" id="TPE-6V-eWn"/>
                         <outlet property="btn_clearcache" destination="Vzg-50-bc2" id="FQa-mv-uRb"/>
                         <outlet property="btn_clearcache" destination="Vzg-50-bc2" id="FQa-mv-uRb"/>
@@ -124,7 +139,7 @@
                     <view key="view" contentMode="scaleToFill" id="pae-Dr-xbo">
                     <view key="view" contentMode="scaleToFill" id="pae-Dr-xbo">
                         <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"/>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </view>
                     </view>
                 </viewController>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="ryb-NY-iqX" userLabel="First Responder" sceneMemberID="firstResponder"/>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="ryb-NY-iqX" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -140,36 +155,36 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                         <subviews>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Progress" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="k2H-8o-P97">
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Progress" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="k2H-8o-P97">
-                                <rect key="frame" x="20" y="64" width="68" height="21"/>
+                                <frame key="frameInset" minX="20" minY="64" width="68" height="21"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             </label>
                             <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" id="qll-0O-PAI">
                             <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" id="qll-0O-PAI">
-                                <rect key="frame" x="20" y="93" width="728" height="2"/>
+                                <frame key="frameInset" minX="20" minY="93" height="2" maxX="20"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                             </progressView>
                             </progressView>
                             <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" id="jJD-lt-Uuj">
                             <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" id="jJD-lt-Uuj">
-                                <rect key="frame" x="20" y="132" width="728" height="2"/>
+                                <frame key="frameInset" minX="20" minY="132" height="2" maxX="20"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                             </progressView>
                             </progressView>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Overall progress" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="6P9-Se-W27">
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Overall progress" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="6P9-Se-W27">
-                                <rect key="frame" x="20" y="103" width="126" height="21"/>
+                                <frame key="frameInset" minX="20" minY="103" width="126" height="21"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="sEa-AW-QiJ">
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="sEa-AW-QiJ">
-                                <rect key="frame" x="219" y="20" width="330" height="24"/>
+                                <frame key="frameInset" minX="219" minY="20" height="24" maxX="219"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="20"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="20"/>
-                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             </label>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="0lX-Gd-bGG">
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="0lX-Gd-bGG">
-                                <rect key="frame" x="639" y="974" width="109" height="30"/>
+                                <frame key="frameInset" width="109" height="30" maxX="20" maxY="20"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
                                 <state key="normal" title="Send log"/>
                                 <state key="normal" title="Send log"/>
                                 <connections>
                                 <connections>
@@ -177,14 +192,14 @@
                                 </connections>
                                 </connections>
                             </button>
                             </button>
                             <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" id="e3H-tp-xCS">
                             <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" id="e3H-tp-xCS">
-                                <rect key="frame" x="20" y="151" width="728" height="815"/>
+                                <frame key="frameInset" minX="20" minY="151" maxX="20" maxY="58"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                 <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
                                 <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
                             </textView>
                             </textView>
                         </subviews>
                         </subviews>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </view>
                     </view>
                     <connections>
                     <connections>
                         <outlet property="progress_current" destination="qll-0O-PAI" id="vAK-WH-4Z0"/>
                         <outlet property="progress_current" destination="qll-0O-PAI" id="vAK-WH-4Z0"/>
@@ -205,26 +220,26 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                         <subviews>
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="68" sectionHeaderHeight="28" sectionFooterHeight="28" id="lRS-dn-XTu">
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="68" sectionHeaderHeight="28" sectionFooterHeight="28" id="lRS-dn-XTu">
-                                <rect key="frame" x="0.0" y="0.0" width="768" height="934"/>
+                                <frame key="frameInset" maxY="90"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <prototypes>
                                 <prototypes>
                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" restorationIdentifier="SelectOrderTableViewCell" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="SelectOrderTableViewCell" rowHeight="86" id="XXr-fU-67o" customClass="SelectOrderTableViewCell">
                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" restorationIdentifier="SelectOrderTableViewCell" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="SelectOrderTableViewCell" rowHeight="86" id="XXr-fU-67o" customClass="SelectOrderTableViewCell">
                                         <rect key="frame" x="0.0" y="28" width="768" height="86"/>
                                         <rect key="frame" x="0.0" y="28" width="768" height="86"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="XXr-fU-67o" id="Ohn-hG-mj9">
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="XXr-fU-67o" id="Ohn-hG-mj9">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="85"/>
+                                            <frame key="frameInset" width="768" height="86"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="AIn-eK-sCn">
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="AIn-eK-sCn">
-                                                    <rect key="frame" x="48" y="15" width="712" height="21"/>
+                                                    <frame key="frameInset" minX="48" minY="15" width="712" height="21"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                     <nil key="highlightedColor"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 </label>
                                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="hrK-DY-RbO">
                                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="hrK-DY-RbO">
-                                                    <rect key="frame" x="10" y="32" width="21" height="21"/>
+                                                    <frame key="frameInset" minX="10" minY="32" width="21" height="21"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                     <state key="normal" image="check_0_24"/>
                                                     <state key="normal" image="check_0_24"/>
                                                     <state key="selected" image="check_1_24"/>
                                                     <state key="selected" image="check_1_24"/>
@@ -233,10 +248,10 @@
                                                     </connections>
                                                     </connections>
                                                 </button>
                                                 </button>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="v9S-8N-eqS">
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="v9S-8N-eqS">
-                                                    <rect key="frame" x="48" y="50" width="712" height="21"/>
+                                                    <frame key="frameInset" minX="48" width="98.89%" height="21" maxY="15"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                     <nil key="highlightedColor"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 </label>
                                             </subviews>
                                             </subviews>
@@ -254,7 +269,7 @@
                                 </connections>
                                 </connections>
                             </tableView>
                             </tableView>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="NKA-5N-u0m">
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="NKA-5N-u0m">
-                                <rect key="frame" x="612" y="974" width="156" height="30"/>
+                                <frame key="frameInset" width="156" height="30" maxY="20"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
                                 <state key="normal" image="btn_ok"/>
                                 <state key="normal" image="btn_ok"/>
                                 <connections>
                                 <connections>
@@ -262,7 +277,7 @@
                                 </connections>
                                 </connections>
                             </button>
                             </button>
                         </subviews>
                         </subviews>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </view>
                     </view>
                     <connections>
                     <connections>
                         <outlet property="syncDataTableView" destination="lRS-dn-XTu" id="dKZ-Ur-9t3"/>
                         <outlet property="syncDataTableView" destination="lRS-dn-XTu" id="dKZ-Ur-9t3"/>
@@ -273,10 +288,141 @@
             </objects>
             </objects>
             <point key="canvasLocation" x="2976" y="669"/>
             <point key="canvasLocation" x="2976" y="669"/>
         </scene>
         </scene>
+        <!--Sign_in-->
+        <scene sceneID="Iag-oy-jaN">
+            <objects>
+                <viewController storyboardIdentifier="OfflineUnlockViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="38J-Bm-huX" userLabel="Sign_in" customClass="OfflineUnlockViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="gyO-SO-Q7G">
+                        <rect key="frame" x="0.0" y="0.0" width="480" height="320"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                        <subviews>
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="User" minimumFontSize="17" id="OGq-ht-S8t">
+                                <frame key="frameInset" minX="60" minY="103" height="30" maxX="60"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+                                <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <textInputTraits key="textInputTraits" autocorrectionType="no"/>
+                                <connections>
+                                    <outlet property="delegate" destination="38J-Bm-huX" id="WID-8R-2yL"/>
+                                </connections>
+                            </textField>
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Password" minimumFontSize="17" id="l8b-7U-g6s">
+                                <frame key="frameInset" minX="60" minY="142" height="30" maxX="60"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+                                <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <textInputTraits key="textInputTraits" secureTextEntry="YES"/>
+                            </textField>
+                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="rMJ-4V-e3C">
+                                <frame key="frameInset" minX="60" minY="196" width="154" height="22"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <inset key="contentEdgeInsets" minX="4" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                <inset key="imageEdgeInsets" minX="-4" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                <state key="normal" title="Save password" image="checkbox">
+                                    <color key="titleColor" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    <color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </state>
+                            </button>
+                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="6lu-Dw-7uZ">
+                                <frame key="frameInset" minX="295" minY="196" width="125" height="22"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <inset key="contentEdgeInsets" minX="4" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                <inset key="imageEdgeInsets" minX="-4" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                <state key="normal" title="Offline mode" image="checkbox">
+                                    <color key="titleColor" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    <color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </state>
+                            </button>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Unlock offline" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="DWa-JA-ah5">
+                                <frame key="frameInset" minX="60" minY="67" width="124" height="26"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="20"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="snZ-xL-t2m">
+                                <frame key="frameInset" minY="65" width="172" height="30" maxX="60"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                                <state key="normal" title="Retrieve password">
+                                    <color key="titleColor" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    <color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </state>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="06f-pS-V71">
+                                <frame key="frameInset" minY="267" width="102" height="36" maxX="20"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="20"/>
+                                <state key="normal" title="Unlock">
+                                    <color key="titleColor" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
+                                    <color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </state>
+                                <userDefinedRuntimeAttributes>
+                                    <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
+                                        <integer key="value" value="19"/>
+                                    </userDefinedRuntimeAttribute>
+                                </userDefinedRuntimeAttributes>
+                                <connections>
+                                    <action selector="OnUnlockClicked:" destination="38J-Bm-huX" eventType="touchUpInside" id="Gwz-83-oAU"/>
+                                </connections>
+                            </button>
+                            <tableView hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="wA2-4c-W2N">
+                                <frame key="frameInset" minX="60" minY="133" width="360" height="129"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <prototypes>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="LoginListCell" textLabel="hql-hH-AXh" style="IBUITableViewCellStyleDefault" id="0HM-qr-ZyP">
+                                        <rect key="frame" x="0.0" y="28" width="360" height="44"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0HM-qr-ZyP" id="qg6-aD-3QW">
+                                            <frame key="frameInset" width="360" height="43"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="hql-hH-AXh">
+                                                    <frame key="frameInset" minX="15" width="330" height="43"/>
+                                                    <autoresizingMask key="autoresizingMask"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                            </subviews>
+                                        </tableViewCellContentView>
+                                    </tableViewCell>
+                                </prototypes>
+                            </tableView>
+                        </subviews>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </view>
+                    <navigationItem key="navigationItem" title="NPD" id="ANt-1h-Ffe">
+                        <barButtonItem key="rightBarButtonItem" image="close" style="plain" id="i0p-qZ-6mR">
+                            <connections>
+                                <action selector="CloseClick:" destination="38J-Bm-huX" id="RRH-EO-4ga"/>
+                            </connections>
+                        </barButtonItem>
+                    </navigationItem>
+                    <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+                    <size key="freeformSize" width="480" height="320"/>
+                    <connections>
+                        <outlet property="bb_close" destination="i0p-qZ-6mR" id="1aY-P0-jJU"/>
+                        <outlet property="btnUnlock" destination="06f-pS-V71" id="EDL-cf-g74"/>
+                        <outlet property="editpass" destination="l8b-7U-g6s" id="fHZ-C7-wni"/>
+                        <outlet property="edituser" destination="OGq-ht-S8t" id="tbr-F1-NcB"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="Rci-FC-qps" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="743" y="1761"/>
+        </scene>
     </scenes>
     </scenes>
     <resources>
     <resources>
         <image name="btn_ok" width="102" height="30"/>
         <image name="btn_ok" width="102" height="30"/>
         <image name="check_0_24" width="24" height="24"/>
         <image name="check_0_24" width="24" height="24"/>
         <image name="check_1_24" width="24" height="24"/>
         <image name="check_1_24" width="24" height="24"/>
+        <image name="checkbox" width="16" height="16"/>
+        <image name="close" width="32" height="32"/>
     </resources>
     </resources>
+    <simulatedMetricsContainer key="defaultSimulatedMetrics">
+        <simulatedStatusBarMetrics key="statusBar"/>
+        <simulatedOrientationMetrics key="orientation"/>
+        <simulatedScreenMetrics key="destination"/>
+    </simulatedMetricsContainer>
 </document>
 </document>

+ 1 - 1
RedAnt ERP Mobile/iSales-NPD/iSales-NPD-Info.plist

@@ -21,7 +21,7 @@
 	<key>CFBundleSignature</key>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<string>????</string>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>
-	<string>161009</string>
+	<string>161010</string>
 	<key>LSRequiresIPhoneOS</key>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<true/>
 	<key>NSAppTransportSecurity</key>
 	<key>NSAppTransportSecurity</key>

Некоторые файлы не были показаны из-за большого количества измененных файлов