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

1.修改NPD,增加OFFLINE MODE宏定义,分离工程中的离线判断。

Pen Li 8 лет назад
Родитель
Сommit
42e18069a8

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


+ 4 - 1
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -159,8 +159,9 @@
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
 
     [appDelegate.urgencyDic setValue:appDelegate.user forKey:@"user"];
+#ifdef OFFLINE_MODE
     [appDelegate.urgencyDic setValue:[NSNumber numberWithBool:appDelegate.offline_mode] forKey:@"offline_mode"];
-    
+#endif
     [[JKTimerManager sharedTimerManager] scheduledDispatchTimerWithName:self.urgency_timer_name timeInterval:1 queue:nil repeats:YES action:^{
         
         NSMutableDictionary *urgencyDic = [NSMutableDictionary dictionary];
@@ -4897,6 +4898,7 @@
             
             if(signimg!=nil)
             {
+#ifdef OFFLINE_MODE
                 if(appDelegate.offline_mode)
                 {
                     
@@ -4952,6 +4954,7 @@
                     }
                 }
             else
+#endif
             {
                 NSData *imageData = UIImagePNGRepresentation(img);
                 

+ 18 - 5
RedAnt ERP Mobile/common/Functions/cart/CartViewController.m

@@ -543,12 +543,12 @@
         frame3.origin.x = x;
         self.printButton.frame = frame3;
     }
-    
+#ifdef OFFLINE_MODE
     // 离线隐藏Email
     self.emailButton.hidden = appDelegate.offline_mode;
     // 离线隐藏Print
     self.printButton.hidden = appDelegate.offline_mode;
-        
+#endif
 //    [self reload_data]; // 视图没及时刷新
     
     //    UIApplication * app = [UIApplication sharedApplication];
@@ -2350,20 +2350,29 @@
         int is_rate = [item_json[@"is_rate"] intValue];
 
         NSMutableArray* arr=[@[] mutableCopy];
+
 #ifdef BUILD_NPD
+#ifdef OFFLINE_MODE
         if (!appDelegate.offline_mode && outOfStock) {
             [arr addObject:notifyMeAction];
         }
 #endif
+#endif
+        
 #ifdef BUILD_HOMER
+#ifdef OFFLINE_MODE
         if (!appDelegate.offline_mode && outOfStock) {
             [arr addObject:notifyMeAction];
         }
 #endif
+#endif
+        
 #ifdef BUILD_GATIT
+#ifdef OFFLINE_MODE
         if (!appDelegate.offline_mode && outOfStock) {
             [arr addObject:notifyMeAction];
         }
+#endif
 #endif
         
         if(product_id.length>0)
@@ -2673,12 +2682,16 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
                     
                     
                 }
-                
-                if(appDelegate.offline_mode) {
+#ifdef OFFLINE_MODE
+                if(appDelegate.offline_mode)
+                {
                     
                     [self ReloadData];
                     
-                } else {
+                }
+                else
+#endif
+                {
                     
                     [self.content_arr insertObject:newitem atIndex:0];
                     

+ 2 - 0
RedAnt ERP Mobile/common/Functions/category/CategoryViewController.m

@@ -1885,9 +1885,11 @@
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                 
                 NSData*  downloadimg_data = nil;
+#ifdef OFFLINE_MODE
                 if (!appDelegate.offline_mode) {
                     downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
                 }
+#endif
                 
                 dispatch_async(dispatch_get_main_queue(), ^{
                     

+ 6 - 1
RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m

@@ -1554,10 +1554,15 @@
     
 //#ifdef BUILD_NPD
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    if (!appDelegate.bLogin  || buyQty < 1) {
+        return;
+    }
     
-    if (!appDelegate.bLogin || appDelegate.offline_mode || buyQty < 1) {
+#ifdef OFFLINE_MODE
+    if (appDelegate.offline_mode) {
         return;
     }
+#endif
     
     
     if (appDelegate.user_type == USER_ROLE_CUSTOMER) { // customer

+ 2 - 1
RedAnt ERP Mobile/common/Functions/modelDetail/DetailTopicCell.m

@@ -110,10 +110,11 @@
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                 
                 NSData*  downloadimg_data = nil;
+#ifdef OFFLINE_MODE
                 if (!appDelegate.offline_mode) {
                     downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
                 }
-                
+#endif
                 dispatch_async(dispatch_get_main_queue(), ^{
                     
                     

+ 12 - 0
RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m

@@ -1165,9 +1165,11 @@ self.isrefreshing=false;
                 }
                 
                 // offline
+#ifdef OFFLINE_MODE
                 if (appDelegate.offline_mode) {
                     cell.btnNotifyMe.hidden = YES;
                 }
+#endif
                 
             }
 #endif
@@ -1304,9 +1306,11 @@ self.isrefreshing=false;
                 }
                 
                 // offline
+#ifdef OFFLINE_MODE
                 if (appDelegate.offline_mode) {
                     cell.btnNotifyMe.hidden = YES;
                 }
+#endif
                 
             }
 #endif
@@ -1444,9 +1448,11 @@ self.isrefreshing=false;
                 }
                 
                 // offline
+#ifdef OFFLINE_MODE
                 if (appDelegate.offline_mode) {
                     cell.btnNotifyMe.hidden = YES;
                 }
+#endif
                 
             }
 #endif
@@ -1625,9 +1631,11 @@ self.isrefreshing=false;
                     else
                     {
                         NSData*  downloadimg_data = nil;
+#ifdef OFFLINE_MODE
                         if (!appDelegate.offline_mode) {
                             downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
                         }
+#endif
                         dispatch_async(dispatch_get_main_queue(), ^{
                             
                             
@@ -1735,9 +1743,11 @@ self.isrefreshing=false;
                     else
                     {
                         NSData*  downloadimg_data = nil;
+#ifdef OFFLINE_MODE
                         if (!appDelegate.offline_mode) {
                             downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
                         }
+#endif
                         dispatch_async(dispatch_get_main_queue(), ^{
                             
                             
@@ -1996,9 +2006,11 @@ self.isrefreshing=false;
                     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                         
                         NSData*  downloadimg_data = nil;
+#ifdef OFFLINE_MODE
                         if (!appDelegate.offline_mode) {
                             downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
                         }
+#endif
                         dispatch_async(dispatch_get_main_queue(), ^{
                             
                             

+ 6 - 3
RedAnt ERP Mobile/common/Functions/offline/OfflineSettingViewController.m

@@ -457,8 +457,9 @@
                         [defaults setBool:self.switch_offline.isOn forKey:@"EnableOfflineMode"];
                         
                         [defaults synchronize];
+#ifdef OFFLINE_MODE
                         appDelegate.offline_mode =self.switch_offline.isOn;
-                        
+#endif
                         [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
                         [((MainViewController*)appDelegate.main_vc) reloadDocuments:true immediately:false];
                         [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
@@ -490,8 +491,9 @@
             [defaults setBool:self.switch_offline.isOn forKey:@"EnableOfflineMode"];
             
             [defaults synchronize];
+#ifdef OFFLINE_MODE
             appDelegate.offline_mode =self.switch_offline.isOn;
-            
+#endif
             [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
             [((MainViewController*)appDelegate.main_vc) reloadDocuments:true immediately:false];
             [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
@@ -533,8 +535,9 @@
                             [defaults setBool:self.switch_offline.isOn forKey:@"EnableOfflineMode"];
                             
                             [defaults synchronize];
+#ifdef OFFLINE_MODE
                             appDelegate.offline_mode =self.switch_offline.isOn;
-                            
+#endif
                             [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
                             [((MainViewController*)appDelegate.main_vc) reloadDocuments:true immediately:false];
                             [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];

+ 18 - 0
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m

@@ -202,11 +202,13 @@
     
     
     NSString* msg;
+#ifdef OFFLINE_MODE
     if(appDelegate.offline_mode)
     {
         msg=@"Are you sure to mark offline order as ready for submit?";
     }
     else
+#endif
     {
         msg=@"Submit order now?";
         
@@ -927,12 +929,14 @@
                                                                     
                                                                     NSString* title=nil;
                                                                     NSString* msg=nil;
+#ifdef OFFLINE_MODE
                                                                     if(appDelegate.offline_mode)
                                                                     {
                                                                         title=TITLE_OFFLINE_SUBMIT;
                                                                         msg=MSG_OFFLINE_SUBMIT;
                                                                     }
                                                                     else
+#endif
                                                                     {
                                                                         title=@"Order submitted sucessfully";
                                                                         msg=[NSString stringWithFormat:@"Confirmation#: %@",[editor_json valueForKey:@"so#"]];
@@ -1047,12 +1051,14 @@
                                                                 
                                                                 NSString* title=nil;
                                                                 NSString* msg=nil;
+#ifdef OFFLINE_MODE
                                                                 if(appDelegate.offline_mode)
                                                                 {
                                                                     title=TITLE_OFFLINE_SUBMIT;
                                                                     msg=MSG_OFFLINE_SUBMIT;
                                                                 }
                                                                 else
+#endif
                                                                 {
                                                                     title=@"Order submitted sucessfully";
                                                                     msg=[NSString stringWithFormat:@"Confirmation#: %@",[editor_json valueForKey:@"so#"]];
@@ -1148,12 +1154,14 @@
                                         
                                         NSString* title=nil;
                                         NSString* msg=nil;
+#ifdef OFFLINE_MODE
                                         if(appDelegate.offline_mode)
                                         {
                                             title=TITLE_OFFLINE_SUBMIT;
                                             msg=MSG_OFFLINE_SUBMIT;
                                         }
                                         else
+#endif
                                         {
                                             title=@"Order submitted sucessfully";
                                             msg=[NSString stringWithFormat:@"Confirmation#: %@",[editor_json valueForKey:@"so#"]];
@@ -1288,12 +1296,14 @@
                                     
                                     NSString* title=nil;
                                     NSString* msg=nil;
+#ifdef OFFLINE_MODE
                                     if(appDelegate.offline_mode)
                                     {
                                         title=TITLE_OFFLINE_SUBMIT;
                                         msg=MSG_OFFLINE_SUBMIT;
                                     }
                                     else
+#endif
                                     {
                                         title=@"Order submitted sucessfully";
                                         msg=[NSString stringWithFormat:@"Confirmation#: %@",[editor_json valueForKey:@"so#"]];
@@ -1971,12 +1981,14 @@
                                                                 
                                                                 NSString* title=nil;
                                                                 NSString* msg=nil;
+#ifdef OFFLINE_MODE
                                                                 if(appDelegate.offline_mode)
                                                                 {
                                                                     title=TITLE_OFFLINE_SUBMIT;
                                                                     msg=MSG_OFFLINE_SUBMIT;
                                                                 }
                                                                 else
+#endif
                                                                 {
                                                                     title=@"Order submitted sucessfully";
                                                                     msg=[NSString stringWithFormat:@"Confirmation#: %@",[editor_json valueForKey:@"so#"]];
@@ -2091,12 +2103,14 @@
                                                             
                                                             NSString* title=nil;
                                                             NSString* msg=nil;
+#ifdef OFFLINE_MODE
                                                             if(appDelegate.offline_mode)
                                                             {
                                                                 title=TITLE_OFFLINE_SUBMIT;
                                                                 msg=MSG_OFFLINE_SUBMIT;
                                                             }
                                                             else
+#endif
                                                             {
                                                                 title=@"Order submitted sucessfully";
                                                                 msg=[NSString stringWithFormat:@"Confirmation#: %@",[editor_json valueForKey:@"so#"]];
@@ -2192,12 +2206,14 @@
                                     
                                     NSString* title=nil;
                                     NSString* msg=nil;
+#ifdef OFFLINE_MODE
                                     if(appDelegate.offline_mode)
                                     {
                                         title=TITLE_OFFLINE_SUBMIT;
                                         msg=MSG_OFFLINE_SUBMIT;
                                     }
                                     else
+#endif
                                     {
                                         title=@"Order submitted sucessfully";
                                         msg=[NSString stringWithFormat:@"Confirmation#: %@",[editor_json valueForKey:@"so#"]];
@@ -2325,12 +2341,14 @@
                                 
                                 NSString* title=nil;
                                 NSString* msg=nil;
+#ifdef OFFLINE_MODE
                                 if(appDelegate.offline_mode)
                                 {
                                     title=TITLE_OFFLINE_SUBMIT;
                                     msg=MSG_OFFLINE_SUBMIT;
                                 }
                                 else
+#endif
                                 {
                                     title=@"Order submitted sucessfully";
                                     msg=[NSString stringWithFormat:@"Confirmation#: %@",[editor_json valueForKey:@"so#"]];

+ 76 - 19
RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.m

@@ -430,7 +430,7 @@
     
     
     UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"With Thumbnails" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
-        
+#ifdef OFFLINE_MODE
         if(appDelegate.offline_mode)
         {
             NSMutableDictionary* params = [@{
@@ -451,6 +451,7 @@
             }
         }
         else
+#endif
         {
         NSString* url=[self.content_data valueForKey:@"pdfUrl"];
         
@@ -472,7 +473,7 @@
             alertthreetitle=@"Print Quotation";
         }
     UIAlertAction *alertthree = [UIAlertAction actionWithTitle:alertthreetitle style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
-        
+#ifdef OFFLINE_MODE
         if(appDelegate.offline_mode)
         {
             NSMutableDictionary* params = [@{
@@ -495,6 +496,7 @@
             }
         }
         else
+#endif
         {
             NSString* url=[self.content_data valueForKey:@"pdfUrl"];
             DebugLog(@"pdf url:%@",url);
@@ -628,7 +630,7 @@
 {
     
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-    
+#ifdef OFFLINE_MODE
     if(appDelegate.offline_mode)
     {
         
@@ -744,6 +746,7 @@
         }
     }
     else
+#endif
     {
 
         NSData *imageData = UIImagePNGRepresentation(img);
@@ -1228,7 +1231,11 @@
                     //
                     //                        [self.btnCommit setImage:[[UIImage imageNamed:@"commit"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
                     
-                    if(appDelegate.offline_mode==false||offline_edit)
+                    BOOL condition = offline_edit;
+#ifdef OFFLINE_MODE
+                    condition = condition || appDelegate.offline_mode==false;
+#endif
+                    if(condition)
                     {
                     self.btnOpen.enabled =true;
                     
@@ -1248,16 +1255,26 @@
                         //
                         //                    [self.btnCommit setImage:[[UIImage imageNamed:@"commit"] imageWithRenderingMode:UIImageRenderingModeAutomatic]];
                         
-                                            if(appDelegate.offline_mode==false||offline_edit)
-                                            {
-                        self.btnOpen.enabled =true;
-                        
-                        self.btnSign.enabled = true;
-                                            }
+                        BOOL condition = offline_edit;
+#ifdef OFFLINE_MODE
+                        condition = condition || appDelegate.offline_mode==false;
+#endif
+                        if (condition)
+                        {
+                            self.btnOpen.enabled =true;
+                            
+                            self.btnSign.enabled = true;
+                        }
                         //                    self.btnCommit.enabled =false;
                     }
+                BOOL lock_condition_1 = [lock_user isEqualToString:appDelegate.user];
+                BOOL lock_condition_2 = false;
+#ifdef OFFLINE_MODE
+                lock_condition_1 = !appDelegate.offline_mode && lock_condition_1;
+                lock_condition_2 = appDelegate.offline_mode && [self.order_code isEqualToString:appDelegate.order_code];
+#endif
                 
-                if(((!appDelegate.offline_mode && [lock_user isEqualToString:appDelegate.user]) || (appDelegate.offline_mode && [self.order_code isEqualToString:appDelegate.order_code]))&& (status_code==1||status_code==0))
+                if((lock_condition_1 || lock_condition_2)&& (status_code==1||status_code==0))
                 {
                     //                [self.btnRelease setImage:[[UIImage imageNamed:@"order"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
                     
@@ -2194,13 +2211,23 @@
         bool offline_edit =[[self.content_data valueForKey:@"offline_edit"] boolValue];
         if(status_code==1) {
             
-            if(appDelegate.offline_mode==false||offline_edit) {
+            BOOL condition = offline_edit;
+#ifdef OFFLINE_MODE
+            condition = condition || appDelegate.offline_mode==false;
+#endif
+            if (condition)
+            {
                 cell.sign_img.userInteractionEnabled = YES;
             }
             
         }
         else if(status_code==0) {
-            if(appDelegate.offline_mode==false||offline_edit) {
+            BOOL condition = offline_edit;
+#ifdef OFFLINE_MODE
+            condition = condition || appDelegate.offline_mode==false;
+#endif
+            if (condition)
+            {
                 cell.sign_img.userInteractionEnabled = YES;
             }
         }
@@ -2555,13 +2582,23 @@
         bool offline_edit =[[self.content_data valueForKey:@"offline_edit"] boolValue];
         if(status_code==1) {
             
-            if(appDelegate.offline_mode==false||offline_edit) {
+            BOOL condition = offline_edit;
+#ifdef OFFLINE_MODE
+            condition = condition || appDelegate.offline_mode==false;
+#endif
+            if (condition)
+            {
                 cell.sign_img.userInteractionEnabled = YES;
             }
             
         }
         else if(status_code==0) {
-            if(appDelegate.offline_mode==false||offline_edit) {
+            BOOL condition = offline_edit;
+#ifdef OFFLINE_MODE
+            condition = condition || appDelegate.offline_mode==false;
+#endif
+            if (condition)
+            {
                 cell.sign_img.userInteractionEnabled = YES;
             }
         }
@@ -2916,13 +2953,23 @@
         bool offline_edit =[[self.content_data valueForKey:@"offline_edit"] boolValue];
         if(status_code==1) {
             
-            if(appDelegate.offline_mode==false||offline_edit) {
+            BOOL condition = offline_edit;
+#ifdef OFFLINE_MODE
+            condition = condition || appDelegate.offline_mode==false;
+#endif
+            if (condition)
+            {
                 cell.sign_img.userInteractionEnabled = YES;
             }
             
         }
         else if(status_code==0) {
-            if(appDelegate.offline_mode==false||offline_edit) {
+            BOOL condition = offline_edit;
+#ifdef OFFLINE_MODE
+            condition = condition || appDelegate.offline_mode==false;
+#endif
+            if (condition)
+            {
                 cell.sign_img.userInteractionEnabled = YES;
             }
         }
@@ -3279,13 +3326,23 @@
                 bool offline_edit =[[self.content_data valueForKey:@"offline_edit"] boolValue];
                 if(status_code==1) {
 
-                    if(appDelegate.offline_mode==false||offline_edit) {
+                    BOOL condition = offline_edit;
+#ifdef OFFLINE_MODE
+                    condition = condition || appDelegate.offline_mode==false;
+#endif
+                    if (condition)
+                    {
                         cell.sign_img.userInteractionEnabled = YES;
                     }
 
                 }
                 else if(status_code==0) {
-                        if(appDelegate.offline_mode==false||offline_edit) {
+                    BOOL condition = offline_edit;
+#ifdef OFFLINE_MODE
+                    condition = condition || appDelegate.offline_mode==false;
+#endif
+                    if (condition)
+                        {
                             cell.sign_img.userInteractionEnabled = YES;
                         }
                 }

+ 5 - 1
RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m

@@ -1745,7 +1745,11 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
         return UITableViewCellEditingStyleNone;
     else
     {
-        if(appDelegate.offline_mode==false||offline_edit)
+        BOOL condition = offline_edit;
+#ifdef OFFLINE_MODE
+        condition = condition || appDelegate.offline_mode==false;
+#endif
+        if (condition)
             return UITableViewCellEditingStyleDelete;
         else
             return UITableViewCellEditingStyleNone;

+ 7 - 3
RedAnt ERP Mobile/common/Functions/portfolio/TearSheetParamViewController.m

@@ -365,10 +365,14 @@
                     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                         
                         
-                        
-                        if (appDelegate.offline_mode) {
+#ifdef OFFLINE_MODE
+                        if (appDelegate.offline_mode)
+                        {
                             [upparams setValue:url forKey:@"pdfPath"];
-                        } else {
+                        }
+                        else
+#endif
+                        {
                             [upparams setValue:path forKey:@"pdfPath"];
                         }
                         [upparams setValue:name forKey:@"pdfName"];

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

@@ -149,7 +149,9 @@
                     
                     [defaults synchronize];
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+#ifdef OFFLINE_MODE
                     appDelegate.offline_mode = self.checkOfflineMode.selected;
+#endif
                 }
 
             }
@@ -168,7 +170,9 @@
             
             [defaults synchronize];
             AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+#ifdef OFFLINE_MODE
             appDelegate.offline_mode = self.checkOfflineMode.selected;
+#endif
         }
         
         
@@ -313,8 +317,12 @@
                     [iSalesDB close_db:db];
                     
                     
+                    BOOL condition = offline_dirty && offline_user_exist>0;
                     
-                    if(offline_dirty&& !appDelegate.offline_mode&& offline_user_exist>0)
+#ifdef OFFLINE_MODE
+                    condition = condition && !appDelegate.offline_mode;
+#endif
+                    if(condition)
                     {
                         
                         UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Detected new offline data" message:@"Do you want to sync with server?" preferredStyle:UIAlertControllerStyleAlert];

+ 2 - 0
RedAnt ERP Mobile/common/Functions/watchlist/WatchListViewController.m

@@ -567,10 +567,12 @@
     [[self navigationController] setNavigationBarHidden:YES animated:NO];
     
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+#ifdef OFFLINE_MODE
     // 离线隐藏Email
     self.emailBtn.enabled = !appDelegate.offline_mode;
     // 离线隐藏Print
     self.printBtn.enabled = !appDelegate.offline_mode;
+#endif
 }
 
 -(void) operation_reload_data

+ 2 - 0
RedAnt ERP Mobile/common/customUI/ImageUploadViewController.m

@@ -216,6 +216,7 @@
     
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     
+#ifdef OFFLINE_MODE
     if(appDelegate.offline_mode)
     {
         
@@ -248,6 +249,7 @@
         }
     }
     else
+#endif
     {
         
         //    UIAlertView * waitalert = [[UIAlertView alloc] initWithTitle:@"wait" message:@"uploading" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil, nil];

+ 2 - 0
RedAnt ERP Mobile/iSales-NPD/PhotoList/Controller/ContentPreviewController.m

@@ -371,9 +371,11 @@
     else
     {
         NSData*  downloadimg_data = nil;
+#ifdef OFFLINE_MODE
         if (!appDelegate.offline_mode) {
             downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
         }
+#endif
         dispatch_async(dispatch_get_main_queue(), ^{
             
             

+ 1 - 1
RedAnt ERP Mobile/iSales-NPD/config.h

@@ -24,7 +24,7 @@
 #import "Singleton.h"
 
 
-
+#define OFFLINE_MODE
 #define PDF_DEBUG false
 
 //#define ENCRYPT_OFF