Ray Zhang 10 سال پیش
والد
کامیت
9703e91fa4

+ 1 - 1
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.h

@@ -58,7 +58,7 @@
 -(NSMutableArray*) translate_json: (NSDictionary*) injson changed:(NSDictionary*) changed_value;
 -(NSMutableDictionary*)create_cusromer_info_from_table;
 @property (strong,nonatomic) NSIndexPath* from;
--(subitem_data*) subitem_param:(NSDictionary*) itemjson addto:(NSMutableDictionary*) upparam;
+-(subitem_data*) subitem_param:(NSDictionary*) itemjson addto:(NSMutableDictionary*) upparam alert:(bool)alert;
 -(NSMutableDictionary*) check_cancommit:(bool) alert;
 
 -(NSString*) getValue:(NSString*)name;

+ 176 - 44
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -211,14 +211,15 @@
     NSMutableArray* fields=[[NSMutableArray alloc] init];
     NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
     //  [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
-    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
+    int section_count=self.content_data_control.count;//[[self.content_data_download valueForKey:@"section_count"] intValue];
     for(int i=0;i<section_count;i++)
     {
-        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
-        int item_count = [[sectionjson valueForKey:@"count"] intValue];
+        NSLog(@"debug...section:%d",i);
+        NSMutableArray * sectionjson = [self.content_data_control[i] mutableCopy];//[[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
+        int item_count = sectionjson.count;//[[sectionjson valueForKey:@"count"] intValue];
         for(int j=0;j<item_count;j++)
         {
-            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
+            NSMutableDictionary * itemjson=[sectionjson[j] mutableCopy];//[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
             NSString* key = [itemjson valueForKey:@"name"];
             if(key==nil || key.length==0)
                 continue;
@@ -236,6 +237,35 @@
                         if([[valjson valueForKey:@"check"]intValue]==1)
                         {
                             [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
+//                            NSMutableDictionary* subjson=nil;
+//                            subjson=[[valjson objectForKey:@"sub_item"] mutableCopy];
+//                            if( subjson!=nil /*&& !active*/)
+//                            {
+//                                int sub_count = [[subjson valueForKey:@"count"] intValue];
+//                                for(int l=0;l<sub_count;l++)
+//                                {
+//                                    NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
+//                                    if([modify_item valueForKey:@"value"]!=nil && ![[modify_item valueForKey:@"value"]isEqualToString:@""])
+//                                        [upparams setValue:[modify_item valueForKey:@"value"] forKey:[modify_item valueForKey:@"name"]];
+//                                    else
+//                                    {
+//                                        if([[modify_item valueForKey:@"required"] isEqualToString: @"true"] )
+//                                        {
+//                                            self.cancommit = false;
+//                                            [fields addObject:itemjson[@"aname"]];
+//                                            NSIndexPath* indexpath =[self get_indexpath1:[modify_item valueForKey:@"name"]];
+//                                            [self unhide_section:indexpath.section];
+//                                            if(fields.count==1)
+//                                            {
+//                                                self.first_miss_pos =  indexpath;
+//                                                
+//                                            }
+//                                        }
+//                                    }
+//                                }
+//                            }
+                            
+                            
                             setvalue=true;
                             break;
                         }
@@ -244,10 +274,12 @@
                     {
                         self.cancommit = false;
                         [fields addObject:itemjson[@"aname"]];
-                        
+                        NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
+                        if(alert)
+                        [self unhide_section:indexpath.section];
                         if(fields.count==1)
                         {
-                            self.first_miss_pos =  [self get_indexpath:[itemjson valueForKey:@"name"]];
+                            self.first_miss_pos =  indexpath;
                             
                         }
                             
@@ -272,9 +304,12 @@
                     {
                         self.cancommit = false;
                         [fields addObject:itemjson[@"aname"]];
+                        NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
+                        if(alert)
+                        [self unhide_section:indexpath.section];
                         if(fields.count==1)
                         {
-                            self.first_miss_pos =  [self get_indexpath:[itemjson valueForKey:@"name"]];
+                            self.first_miss_pos =  indexpath;
                             
                         }
                     }
@@ -295,9 +330,12 @@
                     {
                         self.cancommit = false;
                         [fields addObject:itemjson[@"aname"]];
+                        NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
+                        if(alert)
+                        [self unhide_section:indexpath.section];
                         if(fields.count==1)
                         {
-                            self.first_miss_pos =  [self get_indexpath:[itemjson valueForKey:@"name"]];
+                            self.first_miss_pos =  indexpath;
                             
                         }
                     }
@@ -309,9 +347,12 @@
                     {
                         self.cancommit = false;
                         [fields addObject:itemjson[@"aname"]];
+                        NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
+                        if(alert)
+                        [self unhide_section:indexpath.section];
                         if(fields.count==1)
                         {
-                            self.first_miss_pos =  [self get_indexpath:[itemjson valueForKey:@"name"]];
+                            self.first_miss_pos =  indexpath;
                             
                         }
                     }
@@ -351,9 +392,12 @@
                                 {
                                     self.cancommit = false;
                                     [fields addObject:itemjson[@"aname"]];
+                                    NSIndexPath* indexpath =[self get_indexpath1:[modify_item valueForKey:@"name"]];
+                                    if(alert)
+                                    [self unhide_section:indexpath.section];
                                     if(fields.count==1)
                                     {
-                                        self.first_miss_pos =  [self get_indexpath:[modify_item valueForKey:@"name"]];
+                                        self.first_miss_pos =  indexpath;
                                         
                                     }
                                 }
@@ -371,9 +415,12 @@
                         {
                             self.cancommit = false;
                             [fields addObject:itemjson[@"aname"]];
+                            NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
+                            if(alert)
+                            [self unhide_section:indexpath.section];
                             if(fields.count==1)
                             {
-                                self.first_miss_pos =  [self get_indexpath:[itemjson valueForKey:@"name"]];
+                                self.first_miss_pos =  indexpath;
                                 
                             }
                         }
@@ -391,15 +438,18 @@
                             [fields addObject:itemjson[@"aname"]];
                             
                             
+                            NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
+                            if(alert)
+                            [self unhide_section:indexpath.section];
                             if(fields.count==1)
                             {
-                                self.first_miss_pos =  [self get_indexpath:[itemjson valueForKey:@"name"]];
+                                self.first_miss_pos =  indexpath;
                                 
                             }
                         }
                     }
                 }
-            subitem_data * data=[self subitem_param:itemjson addto:upparams ];
+            subitem_data * data=[self subitem_param:itemjson addto:upparams alert:alert];
             upparams= data.params;
             fields=[[fields arrayByAddingObjectsFromArray:data.missingfields] mutableCopy];
         }
@@ -412,9 +462,14 @@
         self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
         [self.editorTable reloadData];
         
-        [self.editorTable scrollToRowAtIndexPath:self.first_miss_pos atScrollPosition:UITableViewScrollPositionBottom animated:YES];
+        [self.editorTable scrollToRowAtIndexPath:self.first_miss_pos atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
         return upparams;
     }
+    else
+    {
+        self.cancommit=true;
+        //[self.editorTable reloadData];
+    }
     
     return upparams;
     
@@ -693,7 +748,7 @@
         //        self.navigationItem.title =  [self.content_data_download valueForKey:@"title"] ;
     }
 }
--(subitem_data*) subitem_param:(NSDictionary*) itemjson addto:(NSMutableDictionary*) upparam
+-(subitem_data*) subitem_param:(NSDictionary*) itemjson addto:(NSMutableDictionary*) upparam alert:(bool)alert
 {
     
     subitem_data * data = [[subitem_data alloc] init];
@@ -751,9 +806,12 @@
                                 self.cancommit = false;
                                 [fields addObject:addjson[@"aname"]];
                                 
+                                NSIndexPath* indexpath =[self get_indexpath1:[addjson valueForKey:@"name"]];
+                                if(alert)
+                                [self unhide_section:indexpath.section];
                                 if(fields.count==1)
                                 {
-                                    self.first_miss_pos =  [self get_indexpath:[addjson valueForKey:@"name"]];
+                                    self.first_miss_pos =  indexpath;
                                     
                                 }
                             }
@@ -777,9 +835,12 @@
                             [fields addObject:addjson[@"aname"]];
                             
                             
+                            NSIndexPath* indexpath =[self get_indexpath1:[addjson valueForKey:@"name"]];
+                            if(alert)
+                            [self unhide_section:indexpath.section];
                             if(fields.count==1)
                             {
-                                self.first_miss_pos =  [self get_indexpath:[addjson valueForKey:@"name"]];
+                                self.first_miss_pos =  indexpath;
                                 
                             }
                         }
@@ -824,9 +885,12 @@
                                             [fields addObject:itemjson[@"aname"]];
                                             
                                             
+                                            NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
+                                            if(alert)
+                                            [self unhide_section:indexpath.section];
                                             if(fields.count==1)
                                             {
-                                                self.first_miss_pos =  [self get_indexpath:[itemjson valueForKey:@"name"]];
+                                                self.first_miss_pos =  indexpath;
                                                 
                                             }
                                         }
@@ -852,16 +916,19 @@
                                             self.cancommit = false;
                                             [fields addObject:itemjson[@"aname"]];
                                             
+                                            NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
+                                            if(alert)
+                                            [self unhide_section:indexpath.section];
                                             if(fields.count==1)
                                             {
-                                                self.first_miss_pos =  [self get_indexpath:[itemjson valueForKey:@"name"]];
+                                                self.first_miss_pos =  indexpath;
                                                 
                                             }
                                         }
                                     }
                                 }
                                 
-                                subitem_data * data1=[self subitem_param:itemjson addto:upparam ];
+                                subitem_data * data1=[self subitem_param:itemjson addto:upparam alert:alert];
                                 upparam= data1.params;
                                 fields=[[fields arrayByAddingObjectsFromArray:data1.missingfields] mutableCopy];
                                // upparam= [self subitem_param:itemjson addto:upparam ];
@@ -882,16 +949,19 @@
                                 self.cancommit = false;
                                 [fields addObject:addjson[@"aname"]];
                                 
+                                NSIndexPath* indexpath =[self get_indexpath1:[addjson valueForKey:@"name"]];
+                                if(alert)
+                                [self unhide_section:indexpath.section];
                                 if(fields.count==1)
                                 {
-                                    self.first_miss_pos =  [self get_indexpath:[addjson valueForKey:@"name"]];
+                                    self.first_miss_pos =  indexpath;
                                     
                                 }
                             }
                         }
                     }
                     
-                    subitem_data * data2=[self subitem_param:addjson addto:upparam ];
+                    subitem_data * data2=[self subitem_param:addjson addto:upparam alert:alert];
                     upparam= data2.params;
                     fields=[[fields arrayByAddingObjectsFromArray:data2.missingfields] mutableCopy];
                     
@@ -1919,7 +1989,16 @@
         //   return [item valueForKey:@"value"];
     
 }
--(NSIndexPath*) get_indexpath:(NSString*)name
+-(void) unhide_section:(int)isection
+{
+    
+    
+     NSMutableDictionary* section=  [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",isection]] mutableCopy];
+    [section setValue:@"false" forKey:@"hide"];
+    [self.content_data_download setObject:section forKey:[NSString stringWithFormat:@"section_%d",isection]];
+    
+}
+-(NSIndexPath*) get_indexpath1:(NSString*)name
 {
     if(self.first_miss_pos!=nil)
         return self.first_miss_pos;
@@ -2838,7 +2917,21 @@
         else
             cell.textview.textAlignment =kCTLeftTextAlignment;
         
-        
+        int capital =[[item_json valueForKey:@"capital"] intValue];
+        switch (capital) {
+            case 1:
+                cell.textview.autocapitalizationType=UITextAutocapitalizationTypeWords;
+                break;
+            case 2:
+                cell.textview.autocapitalizationType=UITextAutocapitalizationTypeSentences;
+                break;
+            case 3:
+                cell.textview.autocapitalizationType=UITextAutocapitalizationTypeAllCharacters;
+                break;
+            default:
+                cell.textview.autocapitalizationType=UITextAutocapitalizationTypeNone;
+                break;
+        }
         
         int disable = [[item_json valueForKey:@"disable"] intValue];
         if(disable==1||readonly)
@@ -3136,6 +3229,23 @@
                 else
                     cell.textfield.textAlignment =NSTextAlignmentLeft;
                 
+                int capital =[[item_json valueForKey:@"capital"] intValue];
+                switch (capital) {
+                    case 1:
+                        cell.textfield.autocapitalizationType=UITextAutocapitalizationTypeWords;
+                        break;
+                    case 2:
+                        cell.textfield.autocapitalizationType=UITextAutocapitalizationTypeSentences;
+                        break;
+                    case 3:
+                        cell.textfield.autocapitalizationType=UITextAutocapitalizationTypeAllCharacters;
+                        break;
+                    default:
+                        cell.textfield.autocapitalizationType=UITextAutocapitalizationTypeNone;
+                        break;
+                }
+
+                
                 int disable = [[item_json valueForKey:@"disable"] intValue];
                 if(disable==1||readonly)
                 {
@@ -5649,34 +5759,56 @@
                 {
                     NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
                     
+//                    NSString* subid=[modify_item valueForKey:@"subid"];
+//                    
+//                    
+//                    NSMutableDictionary * olditem=[[section_json objectForKey:[NSString stringWithFormat:@"item_%d",item ]] mutableCopy];
+                    
+                    NSString* control_type = [modify_item valueForKey:@"control"];
+                    if([control_type isEqualToString:@"switch"])
+                        modify_item=   [self fill_switch_subitem:modify_item subid:nil source:source mapping:mapping ];
+                    else if([control_type isEqualToString:@"enum"])
+                    {
+                        modify_item=   [self fill_enum_subitem:modify_item subid:nil source:source mapping:mapping ];
+                        
+                    }
+                    else
+                    {
+                        NSString* mapto = [modify_item valueForKey:@"name"];
+                        if(mapto.length==0)
+                            continue;
+                        NSString* valuefrom= [mapping valueForKey:[modify_item valueForKey:@"name"]];
+                        if(valuefrom==nil)
+                            continue;
+                        NSString* valuestr= [source valueForKey:valuefrom];
+                        
+                        if(true)
+                        {
+                            if(valuestr.length>0)
+                                [modify_item setValue:valuestr forKey:@"value"];
+                            else
+                                [modify_item setValue:@"" forKey:@"value"];
+                            //[modify_item setValue:valuestr forKey:@"value"];
+                            
+                           // [modify_item setValue:@"true" forKey:@"dirty"];
+                           
+                        }
+                    }
                     
+                    [modify_item setValue:@"true" forKey:@"dirty"];
+                     [subjson setObject:modify_item  forKey:[NSString stringWithFormat:@"item_%d",l ]];
+                //    [section_json setObject:olditem  forKey:[NSString stringWithFormat:@"item_%d",item ]];
+
                     
                     
                     //                NSMutableDictionary* modify_item= [[section_json objectForKey:[NSString stringWithFormat:@"item_%d",ic ]] mutableCopy];
                     
-                    NSString* mapto = [modify_item valueForKey:@"name"];
-                    if(mapto.length==0)
-                        continue;
-                    NSString* valuefrom= [mapping valueForKey:[modify_item valueForKey:@"name"]];
-                    if(valuefrom==nil)
-                        continue;
-                    NSString* valuestr= [source valueForKey:valuefrom];
-                    
-                    if(true)
-                    {
-                        if(valuestr.length>0)
-                            [modify_item setValue:valuestr forKey:@"value"];
-                        else
-                            [modify_item setValue:@"" forKey:@"value"];
-                        //[modify_item setValue:valuestr forKey:@"value"];
-                        
-                        [modify_item setValue:@"true" forKey:@"dirty"];
-                        [subjson setObject:modify_item  forKey:[NSString stringWithFormat:@"item_%d",l ]];
-                    }
+    
                 }
+                [val_json setObject:subjson forKey:@"sub_item"];
             }
             
-            [val_json setObject:subjson forKey:@"sub_item"];
+            
         }
         [cadedatejson setObject:val_json forKey:[NSString stringWithFormat:@"val_%d",i]];
         

+ 1 - 1
RedAnt ERP Mobile/common/customUI/ImageScrollerView.h

@@ -28,7 +28,7 @@ typedef NS_ENUM(NSInteger, MRImgLocation) {
 - (id)initWithFrame:(CGRect)frame;
 
 - (id)initWithFrame:(CGRect)frame withSourceData:(NSMutableArray *)imgSource withIndex:(NSInteger)index;
-
+- (id)initWithFrame:(CGRect)frame withSourceURL:(NSMutableArray *)imgURL withIndex:(NSInteger)index;
 // 谦让双击放大手势
 - (void)requireDoubleGestureRecognizer:(UITapGestureRecognizer *)tep;
 @end

+ 84 - 1
RedAnt ERP Mobile/common/customUI/ImageScrollerView.m

@@ -7,6 +7,7 @@
 //
 
 #import "ImageScrollerView.h"
+#import "iSalesDB.h"
 #pragma mark -定义宏常量
 #define kImgViewCount 3
 
@@ -49,7 +50,89 @@
     }
     return self;
 }
-
+- (id)initWithFrame:(CGRect)frame withSourceURL:(NSMutableArray *)imgURL withIndex:(NSInteger)index
+{
+    self = [super initWithFrame:frame];
+    if (self) {
+        
+        NSMutableArray* data = [[NSMutableArray alloc]init];
+        for(int i=0;i<imgURL.count;i++)
+        {
+            NSString* img_url = imgURL[i];
+            NSString* file_name=[img_url lastPathComponent];
+            NSData* img_data=[iSalesDB load_cached_img:file_name];
+            if(img_data!=nil)
+            {
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    UIImage * img =[UIImage imageWithData:img_data];
+                    [data addObject:img];
+                    
+                    
+                    //                if(i==count-1)
+                    //                {
+                    //
+                    //                }
+                    //                        if(i==0)
+                    //                        cell.imageView.image = img;
+                });
+            }
+            else
+            {
+                NSData*  downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    
+                    
+                    
+                    if(downloadimg_data!=nil)
+                    {
+                        [iSalesDB cache_img:downloadimg_data :file_name ];
+                        
+                        UIImage * img =[UIImage imageWithData:downloadimg_data];
+                        [data addObject:img];
+                        
+                        //                    if(i==count-1)
+                        //                    {
+                        //                        UIImage* qrimg=[QRCodeGenerator qrImageForString:[section_json valueForKey:@"model_name"] imageSize:350];
+                        //                        if(qrimg!=nil)
+                        //                            [cell AddPhoto:qrimg];
+                        //                    }
+                        //                            if(i==0)
+                        //                                cell.imageView.image = img;
+                    }
+                    else
+                    {
+                        
+                        
+                        UIImage * img =[UIImage imageNamed:@"notfound_l"];
+                        [data addObject:img];
+                        
+                        //                    if(i==count-1)
+                        //                    {
+                        //                        UIImage* qrimg=[QRCodeGenerator qrImageForString:[section_json valueForKey:@"model_name"] imageSize:350];
+                        //                        if(qrimg!=nil)
+                        //                            [cell AddPhoto:qrimg];
+                        //                    }
+                        //                            if(i==0)
+                        //                                cell.imageView.image = img;
+                    }
+                    
+                });
+            }
+        }
+        
+        // 初始化控件属性
+        [self initScrollView];
+        
+        // 设置数据源
+        [self setImgSource:data];
+        
+        // 设置图片下标
+        [self setCurIndex:index];
+        
+        
+    }
+    return self;
+}
 #pragma mark -初始化控件
 - (void)initScrollView{
     

+ 2 - 0
RedAnt ERP Mobile/common/customUI/ImageScrollerViewController.h

@@ -13,6 +13,8 @@
 @property (nonatomic , strong) NSMutableArray * data;
 
 @property (nonatomic , strong) UIButton * btn_close;
+@property bool use_url;
 - (id)initWithSourceData:(NSMutableArray *)data withIndex:(NSInteger)index;
+- (id)initWithSourceURL:(NSMutableArray *)urls withIndex:(NSInteger)index;
 @property (nonatomic , strong) ImageScrollerView *imgShowView;
 @end

+ 38 - 4
RedAnt ERP Mobile/common/customUI/ImageScrollerViewController.m

@@ -53,7 +53,7 @@
     self = [super init];
     
     if (self) {
-        
+        self.use_url =false;
         self=[self init];
         
         _data = data;
@@ -65,6 +65,31 @@
     
 }
 
+- (id)initWithSourceURL:(NSMutableArray *)urls withIndex:(NSInteger)index{
+    
+    
+    self = [super init];
+    if (self) {
+        
+        self=[self init];
+//    NSMutableArray* data = [[NSMutableArray alloc]init];
+
+//    UIImage* qrimg=[QRCodeGenerator qrImageForString:[section_json valueForKey:@"model_name"] imageSize:350];
+//    if(qrimg!=nil)
+//        [cell AddPhoto:qrimg];
+    
+    
+ self.use_url =true;
+        
+        _data = urls;
+        _index = index;
+    }
+    
+    
+    return self;
+    
+}
+
 - (BOOL)prefersStatusBarHidden
 {
     return YES; //返回NO表示要显示,返回YES将hiden
@@ -99,12 +124,21 @@
     // Dispose of any resources that can be recreated.
 }
 - (void)creatImgShow{
-    
-    ImageScrollerView *imgShowView = [[ImageScrollerView alloc]
+    ImageScrollerView *imgShowView=nil;
+    if(self.use_url)
+    {
+        imgShowView= [[ImageScrollerView alloc]
+                      initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y+42, self.view.frame.size.width, self.view.frame.size.height-84) //self.view.frame
+                      withSourceURL:_data
+                      withIndex:_index];
+    }
+    else
+    {
+     imgShowView= [[ImageScrollerView alloc]
                                   initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y+42, self.view.frame.size.width, self.view.frame.size.height-84) //self.view.frame
                                   withSourceData:_data
                                   withIndex:_index];
-    
+    }
     // 解决谦让
    // [imgShowView requireDoubleGestureRecognizer:[[self.view gestureRecognizers] lastObject]];
     

+ 1 - 1
RedAnt ERP Mobile/common/customUI/NIDropDown.m

@@ -187,7 +187,7 @@
     NSDictionary* item = [self.selector objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]];
     
     cell.imageView.image=[UIImage imageNamed:@"loading_s"];
-    cell.textLabel.text=[NSString stringWithFormat:@"%@:%@",selectorname,[item valueForKey:@"title"]];
+    cell.textLabel.text=[NSString stringWithFormat:@"%@: %@",selectorname,[item valueForKey:@"title"]];
     NSString* img_url = [item valueForKey:@"pic_url"];
     NSString* file_name=[img_url lastPathComponent];
     NSData* img_data=[iSalesDB load_cached_img:file_name];

+ 3 - 2
RedAnt ERP Mobile/common/photoStack/PhotoStackView.m

@@ -333,7 +333,7 @@ static CGFloat const PhotoRotationOffsetDefault = 4.0f;
     NSInteger numberOfPhotos = [self.dataSource numberOfPhotosInPhotoStackView:self];
     NSInteger topPhotoIndex  = [self indexOfTopPhoto]; // Keeping track of current photo's top index so that it remains on top if new photos are added
     
-    if(numberOfPhotos > 0) {
+    if(numberOfPhotos >= 0) {
 
         NSMutableArray *photoViewsMutable   = [[NSMutableArray alloc] initWithCapacity:numberOfPhotos];
         UIImage *borderImage                = [self.borderImage resizableImageWithCapInsets:UIEdgeInsetsMake(self.borderWidth, self.borderWidth, self.borderWidth, self.borderWidth)];
@@ -385,7 +385,8 @@ static CGFloat const PhotoRotationOffsetDefault = 4.0f;
         }
 
         // Photo views are added to subview in the photoView setter
-        self.photoViews = photoViewsMutable; photoViewsMutable = nil;
+        self.photoViews = photoViewsMutable;
+        //photoViewsMutable = nil;
         [self goToPhotoAtIndex:topPhotoIndex];
         
     }