|
@@ -211,14 +211,15 @@
|
|
|
NSMutableArray* fields=[[NSMutableArray alloc] init];
|
|
NSMutableArray* fields=[[NSMutableArray alloc] init];
|
|
|
NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
|
|
NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
|
|
|
// [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
|
|
// [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++)
|
|
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++)
|
|
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"];
|
|
NSString* key = [itemjson valueForKey:@"name"];
|
|
|
if(key==nil || key.length==0)
|
|
if(key==nil || key.length==0)
|
|
|
continue;
|
|
continue;
|
|
@@ -236,6 +237,35 @@
|
|
|
if([[valjson valueForKey:@"check"]intValue]==1)
|
|
if([[valjson valueForKey:@"check"]intValue]==1)
|
|
|
{
|
|
{
|
|
|
[upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
|
|
[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;
|
|
setvalue=true;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -244,10 +274,12 @@
|
|
|
{
|
|
{
|
|
|
self.cancommit = false;
|
|
self.cancommit = false;
|
|
|
[fields addObject:itemjson[@"aname"]];
|
|
[fields addObject:itemjson[@"aname"]];
|
|
|
-
|
|
|
|
|
|
|
+ NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
|
|
|
|
|
+ if(alert)
|
|
|
|
|
+ [self unhide_section:indexpath.section];
|
|
|
if(fields.count==1)
|
|
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;
|
|
self.cancommit = false;
|
|
|
[fields addObject:itemjson[@"aname"]];
|
|
[fields addObject:itemjson[@"aname"]];
|
|
|
|
|
+ NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
|
|
|
|
|
+ if(alert)
|
|
|
|
|
+ [self unhide_section:indexpath.section];
|
|
|
if(fields.count==1)
|
|
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;
|
|
self.cancommit = false;
|
|
|
[fields addObject:itemjson[@"aname"]];
|
|
[fields addObject:itemjson[@"aname"]];
|
|
|
|
|
+ NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
|
|
|
|
|
+ if(alert)
|
|
|
|
|
+ [self unhide_section:indexpath.section];
|
|
|
if(fields.count==1)
|
|
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;
|
|
self.cancommit = false;
|
|
|
[fields addObject:itemjson[@"aname"]];
|
|
[fields addObject:itemjson[@"aname"]];
|
|
|
|
|
+ NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
|
|
|
|
|
+ if(alert)
|
|
|
|
|
+ [self unhide_section:indexpath.section];
|
|
|
if(fields.count==1)
|
|
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;
|
|
self.cancommit = false;
|
|
|
[fields addObject:itemjson[@"aname"]];
|
|
[fields addObject:itemjson[@"aname"]];
|
|
|
|
|
+ NSIndexPath* indexpath =[self get_indexpath1:[modify_item valueForKey:@"name"]];
|
|
|
|
|
+ if(alert)
|
|
|
|
|
+ [self unhide_section:indexpath.section];
|
|
|
if(fields.count==1)
|
|
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;
|
|
self.cancommit = false;
|
|
|
[fields addObject:itemjson[@"aname"]];
|
|
[fields addObject:itemjson[@"aname"]];
|
|
|
|
|
+ NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
|
|
|
|
|
+ if(alert)
|
|
|
|
|
+ [self unhide_section:indexpath.section];
|
|
|
if(fields.count==1)
|
|
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"]];
|
|
[fields addObject:itemjson[@"aname"]];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
|
|
|
|
|
+ if(alert)
|
|
|
|
|
+ [self unhide_section:indexpath.section];
|
|
|
if(fields.count==1)
|
|
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;
|
|
upparams= data.params;
|
|
|
fields=[[fields arrayByAddingObjectsFromArray:data.missingfields] mutableCopy];
|
|
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.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
|
|
|
[self.editorTable reloadData];
|
|
[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;
|
|
return upparams;
|
|
|
}
|
|
}
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ self.cancommit=true;
|
|
|
|
|
+ //[self.editorTable reloadData];
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return upparams;
|
|
return upparams;
|
|
|
|
|
|
|
@@ -693,7 +748,7 @@
|
|
|
// self.navigationItem.title = [self.content_data_download valueForKey:@"title"] ;
|
|
// 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];
|
|
subitem_data * data = [[subitem_data alloc] init];
|
|
@@ -751,9 +806,12 @@
|
|
|
self.cancommit = false;
|
|
self.cancommit = false;
|
|
|
[fields addObject:addjson[@"aname"]];
|
|
[fields addObject:addjson[@"aname"]];
|
|
|
|
|
|
|
|
|
|
+ NSIndexPath* indexpath =[self get_indexpath1:[addjson valueForKey:@"name"]];
|
|
|
|
|
+ if(alert)
|
|
|
|
|
+ [self unhide_section:indexpath.section];
|
|
|
if(fields.count==1)
|
|
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"]];
|
|
[fields addObject:addjson[@"aname"]];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ NSIndexPath* indexpath =[self get_indexpath1:[addjson valueForKey:@"name"]];
|
|
|
|
|
+ if(alert)
|
|
|
|
|
+ [self unhide_section:indexpath.section];
|
|
|
if(fields.count==1)
|
|
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"]];
|
|
[fields addObject:itemjson[@"aname"]];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
|
|
|
|
|
+ if(alert)
|
|
|
|
|
+ [self unhide_section:indexpath.section];
|
|
|
if(fields.count==1)
|
|
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;
|
|
self.cancommit = false;
|
|
|
[fields addObject:itemjson[@"aname"]];
|
|
[fields addObject:itemjson[@"aname"]];
|
|
|
|
|
|
|
|
|
|
+ NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
|
|
|
|
|
+ if(alert)
|
|
|
|
|
+ [self unhide_section:indexpath.section];
|
|
|
if(fields.count==1)
|
|
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;
|
|
upparam= data1.params;
|
|
|
fields=[[fields arrayByAddingObjectsFromArray:data1.missingfields] mutableCopy];
|
|
fields=[[fields arrayByAddingObjectsFromArray:data1.missingfields] mutableCopy];
|
|
|
// upparam= [self subitem_param:itemjson addto:upparam ];
|
|
// upparam= [self subitem_param:itemjson addto:upparam ];
|
|
@@ -882,16 +949,19 @@
|
|
|
self.cancommit = false;
|
|
self.cancommit = false;
|
|
|
[fields addObject:addjson[@"aname"]];
|
|
[fields addObject:addjson[@"aname"]];
|
|
|
|
|
|
|
|
|
|
+ NSIndexPath* indexpath =[self get_indexpath1:[addjson valueForKey:@"name"]];
|
|
|
|
|
+ if(alert)
|
|
|
|
|
+ [self unhide_section:indexpath.section];
|
|
|
if(fields.count==1)
|
|
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;
|
|
upparam= data2.params;
|
|
|
fields=[[fields arrayByAddingObjectsFromArray:data2.missingfields] mutableCopy];
|
|
fields=[[fields arrayByAddingObjectsFromArray:data2.missingfields] mutableCopy];
|
|
|
|
|
|
|
@@ -1919,7 +1989,16 @@
|
|
|
// return [item valueForKey:@"value"];
|
|
// 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)
|
|
if(self.first_miss_pos!=nil)
|
|
|
return self.first_miss_pos;
|
|
return self.first_miss_pos;
|
|
@@ -2838,7 +2917,21 @@
|
|
|
else
|
|
else
|
|
|
cell.textview.textAlignment =kCTLeftTextAlignment;
|
|
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];
|
|
int disable = [[item_json valueForKey:@"disable"] intValue];
|
|
|
if(disable==1||readonly)
|
|
if(disable==1||readonly)
|
|
@@ -3136,6 +3229,23 @@
|
|
|
else
|
|
else
|
|
|
cell.textfield.textAlignment =NSTextAlignmentLeft;
|
|
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];
|
|
int disable = [[item_json valueForKey:@"disable"] intValue];
|
|
|
if(disable==1||readonly)
|
|
if(disable==1||readonly)
|
|
|
{
|
|
{
|
|
@@ -5649,34 +5759,56 @@
|
|
|
{
|
|
{
|
|
|
NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
|
|
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];
|
|
// 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]];
|
|
[cadedatejson setObject:val_json forKey:[NSString stringWithFormat:@"val_%d",i]];
|
|
|
|
|
|