فهرست منبع

Editor adds support for delete operation -- editor 增加支持删除操作。(resolve: #14273)
Editor nested calls increase return refresh -- editor 嵌套调用增加返回刷新(issue30: #14272)
editor allows to call the online enum from the button, and fill the return value into the item corresponding to the current section -- editor 允许从按钮调用online enum,并将返回值填入当前section对应的item(resolve: #14269)
Editor allows to call the lower-level editor with buttons -- editor允许用按钮调用下级editor(resolve: #14268)
Add the function of bringing out the values of multiple fields from enum and auto-filling them -- 增加从enum带出多个字段的值并自动填充的功能(resolve: #14252)
Editor adds multi-button support -- editor 增加多按钮支持(resolve: #14267)

Ray Zhang 4 سال پیش
والد
کامیت
51310f775a

BIN
RA TradeFiling/RA TradeFiling.xcodeproj/project.xcworkspace/xcuserdata/ruizhang.xcuserdatad/UserInterfaceState.xcuserstate


+ 300 - 12
RA TradeFiling/RA TradeFiling.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -376,7 +376,7 @@
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
             uuid = "C821A1DC-95B9-42F2-B3E0-71AE13585A1D"
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "../common/customUI/commoneditor/CommonEditorViewController.m"
@@ -888,7 +888,7 @@
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
             uuid = "99055D44-76BC-4295-8D13-9F571C529A5D"
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "../common/NetworkUtils.m"
@@ -1038,8 +1038,8 @@
             filePath = "RA TradeFiling/TFEditor/TFEditorViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "74"
-            endingLineNumber = "74"
+            startingLineNumber = "75"
+            endingLineNumber = "75"
             landmarkName = "-menuItemClick:"
             landmarkType = "7">
          </BreakpointContent>
@@ -1054,8 +1054,8 @@
             filePath = "RA TradeFiling/TFEditor/TFEditorViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "55"
-            endingLineNumber = "55"
+            startingLineNumber = "56"
+            endingLineNumber = "56"
             landmarkName = "-menuItemClick:"
             landmarkType = "7">
          </BreakpointContent>
@@ -1070,8 +1070,8 @@
             filePath = "RA TradeFiling/TFEditor/TFEditorViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "71"
-            endingLineNumber = "71"
+            startingLineNumber = "72"
+            endingLineNumber = "72"
             landmarkName = "-menuItemClick:"
             landmarkType = "7">
          </BreakpointContent>
@@ -1086,8 +1086,8 @@
             filePath = "RA TradeFiling/TFEditor/TFEditorViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "79"
-            endingLineNumber = "79"
+            startingLineNumber = "80"
+            endingLineNumber = "80"
             landmarkName = "-menuItemClick:"
             landmarkType = "7">
          </BreakpointContent>
@@ -1102,8 +1102,8 @@
             filePath = "RA TradeFiling/TFEditor/TFEditorViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "61"
-            endingLineNumber = "61"
+            startingLineNumber = "62"
+            endingLineNumber = "62"
             landmarkName = "-menuItemClick:"
             landmarkType = "7">
          </BreakpointContent>
@@ -1156,5 +1156,293 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "52E0F690-9720-4042-B27A-13AD243F7FB6"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "RA TradeFiling/TFEditor/TFEditorViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "301"
+            endingLineNumber = "301"
+            landmarkName = "-commonAction:index:data:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "04894F85-18C8-4D6D-B13C-B09E6C0453A6"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../common/customUI/commoneditor/EnumSelectOnlineViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "155"
+            endingLineNumber = "155"
+            landmarkName = "-viewWillDisappear:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "FBF31A2A-FDFF-4D01-843D-D5909802DBDC"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../common/customUI/commoneditor/EnumSelectOnlineViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "396"
+            endingLineNumber = "396"
+            landmarkName = "-tableView:didSelectRowAtIndexPath:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "3B6E0EE1-7B06-4AF1-84A8-08A445536C88"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../common/customUI/commoneditor/EnumSelectOnlineViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "495"
+            endingLineNumber = "495"
+            landmarkName = "-tableView:didSelectRowAtIndexPath:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "E7054449-3DE7-4051-84B5-8A9363CC7DEC"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../common/customUI/commoneditor/EnumSelectOnlineViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "402"
+            endingLineNumber = "402"
+            landmarkName = "-tableView:didSelectRowAtIndexPath:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "16699CA2-55A3-4C37-9C8E-BD8E45D47AB7"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../common/customUI/commoneditor/EnumSelectOnlineViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "50"
+            endingLineNumber = "50"
+            landmarkName = "-viewDidLoad"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "0538D8D3-281C-4530-8EB8-37870820F777"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "RA TradeFiling/TFEditor/TFEditorViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "379"
+            endingLineNumber = "379"
+            landmarkName = "-MActionClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "E1642E97-8218-4878-9F18-E3D522535636"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../common/customUI/commoneditor/CommonEditorViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "3850"
+            endingLineNumber = "3850"
+            landmarkName = "-tableView:cellForRowAtIndexPath:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "6798391A-8F67-45B0-9D1E-5E0098ADD782"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "RA TradeFiling/TFEditor/TFEditorViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "376"
+            endingLineNumber = "376"
+            landmarkName = "-MActionClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "367C6F96-2214-4EF9-B827-B385D41DEC04"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "RA TradeFiling/TFEditor/TFEditorViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "375"
+            endingLineNumber = "375"
+            landmarkName = "-MActionClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "3102363D-82DE-444C-8C56-A371C7DA3C86"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "RA TradeFiling/TFEditor/TFEditorViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "373"
+            endingLineNumber = "373"
+            landmarkName = "-MActionClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "4BA2897F-EE0F-40EA-9B89-5EE3CFC4C5CF"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "RA TradeFiling/TFEditor/TFEditorViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "449"
+            endingLineNumber = "449"
+            landmarkName = "-MActionClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "6DCF23A4-85A5-4D5D-90DE-80646FC13CE0"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../common/customUI/commoneditor/CommonEditorViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1946"
+            endingLineNumber = "1946"
+            landmarkName = "-handle_action_return:indexPath:action:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "6837AD3D-0F4C-4074-9736-3729D847CAEF"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "RA TradeFiling/TFEditor/TFEditorViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "85"
+            endingLineNumber = "85"
+            landmarkName = "-menuItemClick:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "F1888D3A-2F72-47DF-86FF-B8B8F22BEB68"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../common/customUI/commoneditor/CommonEditorViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "2190"
+            endingLineNumber = "2190"
+            landmarkName = "-handle_action_return:indexPath:action:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "78A3457A-DB8C-4DB1-ACC3-F51A3E5324AE"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "RA TradeFiling/TFEditor/TFEditorViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "77"
+            endingLineNumber = "77"
+            landmarkName = "-menuItemClick:"
+            landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "78A3457A-DB8C-4DB1-ACC3-F51A3E5324AE - 95cbafb71f36733d"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "__40-[TFEditorViewController menuItemClick:]_block_invoke"
+                  moduleName = "RA TradeFiling"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/ruizhang/Documents/CODE_IOS/ERPSuiteIOS/RA%20TradeFiling/RA%20TradeFiling/TFEditor/TFEditorViewController.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "77"
+                  endingLineNumber = "77"
+                  offsetFromSymbolStart = "294">
+               </Location>
+               <Location
+                  uuid = "78A3457A-DB8C-4DB1-ACC3-F51A3E5324AE - 443ec49a771fe869"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "__40-[TFEditorViewController menuItemClick:]_block_invoke_2"
+                  moduleName = "RA TradeFiling"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/ruizhang/Documents/CODE_IOS/ERPSuiteIOS/RA%20TradeFiling/RA%20TradeFiling/TFEditor/TFEditorViewController.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "78"
+                  endingLineNumber = "78"
+                  offsetFromSymbolStart = "54">
+               </Location>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 2 - 2
RA TradeFiling/RA TradeFiling/DataProvider/OfflineDataProvider.m

@@ -150,10 +150,10 @@
         sleep(0);
         
         dispatch_async(dispatch_get_main_queue(), ^{
-            result( [@{@"result":@2} mutableCopy]);
+            result( [@{@"result":@2,@"value": @"Editor SAVE",@"aname": @"SAME AS BY 0000000",} mutableCopy]);
         });
         
-
+   
         
         
     });

+ 63 - 17
RA TradeFiling/RA TradeFiling/FAKE_DATA/edit_isf.json

@@ -21,11 +21,68 @@
   "section_count": 3,
   "title": "DEMO ORDER DETAIL",
   "section_0": {
-    "count": 10,
+    "count": 13,
     "title": "GENERAL INFORMATION",
+    "item_12": {
+      "control": "multi_action",
+      "count": 2,
+      "item_0": {
+
+        "params": {
+          "name": "item_12_0"
+        },
+        "name": "editor",
+        "value": "12345678",
+        "aname": "CREATE NEW PARTY"
+      },
+      "item_1": {
+        "key_map": {
+          "bol": "customer_email",
+          "isfbondholder": "customer_cid"
+        },
+        "params": {
+          "name": "item_12_1"
+        },
+        "name": "online_enum",
+        "value": "12345678",
+        "aname": "SELECT EXIST PARTY"
+      },
+      "aname": "PARTY ACTIONS"
+    },
+    "item_11": {
+      "control": "action",
+
+      "params": {
+        "name": "item_11",
+        "action": "edit",
+        "sub_type": "party",
+        "id": "123456"
+      },
+      "name": "editor",
+      "value": "12345678",
+      "refresh": 1,
+      "aname": "ADD PARTY"
+    },
+    "item_10": {
+      "control": "action",
+      "key_map": {
+        "bol": "customer_email",
+        "isfbondholder": "customer_cid"
+      },
+      "params": {
+        "name": "item_10",
+        "action": "edit",
+        "sub_type": "party",
+        "id": "123456"
+      },
+      "name": "online_enum",
+      "value": "12345678",
+      "refresh": 0,
+      "aname": "SELECT PARTY"
+    },
     "item_0": {
       "control": "edit",
-      "autocomplete":true,
+      "autocomplete": false,
       "value": "DNCYQDFDAL214088",
       "name": "bol",
       "aname": "Bill Of Lading",
@@ -154,15 +211,15 @@
       "online": "true",
       "name": "abc",
       "cadedate": {
-        "count": 1, 
+        "count": 1,
         "val_0": {
           "check": 1,
           "value": "Ocean Bill of Lading",
           "value_id": 11
         }
       },
-      "params":{
-          "name":"abc"
+      "params": {
+        "name": "abc"
       },
       "required": "true",
       "single_select": "true",
@@ -171,7 +228,7 @@
   },
   "section_1": {
     "title": "Parties Details",
-    "count": 2,
+    "count": 1,
     "item_0": {
       "value": "CONTINENTAL MATERIALS INC.",
       "control": "editor",
@@ -182,17 +239,6 @@
         "sub_type": "party",
         "id": "123456"
       }
-    },
-    "item_1": {
-      "control": "multi_action",
-      "count": 1,
-      "item_0": {
-        "name": "new",
-        "value": "12345678",
-        "refresh": 1,
-        "aname": "ADD"
-      },
-      "aname": "ADD PARTY"
     }
   },
   "section_2": {

+ 19 - 0
RA TradeFiling/RA TradeFiling/FAKE_DATA/edit_party.json

@@ -1,4 +1,23 @@
 {
+    
+    "menu": [
+      {
+        "name": "save",
+        "title": "SAVE",
+        "url": "",
+        "params": {
+          "action": "123"
+        }
+      },
+      {
+        "name": "delete",
+        "title": "DELETE",
+        "url": "",
+        "params": {
+          "action": "234"
+        }
+      }
+    ],
     "section_0": {
         "title": "CONTAINER INFORMATION",
         "count": 7,

+ 23 - 1
RA TradeFiling/RA TradeFiling/FAKE_DATA/enum_cadedate.json

@@ -5,7 +5,29 @@
   "val_1": {
     "check": 0,
     "value": "House Bill of Lading",
-    "value_id": 10
+    "value_id": 10,
+    "business_card_2": "",
+    "business_card_0": "",
+    "customer_country": "US",
+    "customer_phone": "1234567890",
+    "business_card_1": "",
+    "customer_email": "po@test.com",
+    "customer_name": "Fake Order For Testing",
+    "customer_address3": "",
+    "customer_first_name": "",
+    "customer_address2": "Dock Doors 3-15",
+    "customer_contact_type": "CUSTOMER;",
+    "customer_contact_ext": "1405 Worldwide Blvd\r\nDock Doors 3-15\r\nHebron,KY 41048 US",
+    "customer_zipcode": "41048",
+    "customer_address1": "1405 Worldwide Blvd",
+    "customer_last_name": "",
+    "customer_city": "Hebron",
+    "customer_state": "KY",
+    "customer_sales_rep": "NPD-HOUSE ACCOUNT ",
+    "customer_cid": "FAKORD0001",
+    "customer_contact": " ",
+    "customer_fax": ""
+    
   },
   "val_0": {
     "check": 1,

+ 318 - 116
RA TradeFiling/RA TradeFiling/TFEditor/TFEditorViewController.m

@@ -8,7 +8,8 @@
 #import "TFEditorViewController.h"
 #import "config.h"
 #import "RAUtils.h"
-
+#import "EnumSelectOnlineViewController.h"
+#import "CommonEditorCellMAction.h"
 @interface TFEditorViewController ()
 
 @end
@@ -38,7 +39,7 @@
         vc.url_type = URL_REMOTE;
         vc.request_url=URL_EDIT;
         
-        
+        vc.delegate = self;
         vc.params = [[item_json valueForKey:@"params"] mutableCopy];
 //        vc.params[@"action"] = @"edit";
 //        vc.params[@"sub_type"] = self.function_name;
@@ -81,7 +82,8 @@
                             
                             
                             [RAUtils message_alert:@"Successful" title:@"Save" controller:self action_handler:^(UIAlertAction * _Nonnull action) {
-                                [self.navigationController popViewControllerAnimated:YES];;
+                                [self.navigationController popViewControllerAnimated:YES];
+                                [self prepareReturn:nil];
                             }  completion:^{
                                 
                                 
@@ -129,6 +131,7 @@
                             [alertVC addAction:action];
                             
                             [self presentViewController:alertVC animated:YES completion:nil];
+                            
                         }
                         
                     }];
@@ -147,7 +150,9 @@
                                 
                                 
                                 [RAUtils message_alert:@"Successful" title:@"Save" controller:self action_handler:^(UIAlertAction * _Nonnull action) {
-                                    [self.navigationController popToRootViewControllerAnimated:YES];;
+                                    [self.navigationController popViewControllerAnimated:YES];
+                                    [self prepareReturn:nil];
+                                    
                                 }  completion:^{
                                     
                                     
@@ -201,9 +206,72 @@
                     
                     }
                     else
-                        if([item[@"name"] isEqualToString:@"save_container"])
+                        if([item[@"name"] isEqualToString:@"delete"])
                         {
+                            NSMutableDictionary* params= item[@"params"];
+                            [upparams addEntriesFromDictionary:params];
                             
+                            [RADataProvider SaveEditor:upparams completionHandler:^(NSMutableDictionary *result) {
+                                int ret=[result[@"result"] intValue];
+                                
+                                if (ret==RESULT_TRUE)
+                                {
+                                    
+                                    
+                                    [RAUtils message_alert:@"Successful" title:@"Save" controller:self action_handler:^(UIAlertAction * _Nonnull action) {
+                                        [self.navigationController popToRootViewControllerAnimated:YES];
+                                        [self prepareReturn:nil];
+                                    }  completion:^{
+                                        
+                                        
+                                        
+                                    }];
+                        //            NSUser
+                                    
+        //                            [self.navigationController popViewControllerAnimated:true];
+                       
+                                    
+                                    
+                                }
+                                else
+                                {
+                                    
+                                    [[NSNotificationCenter defaultCenter] postNotificationName:RA_NOTIFICATION_LOGIN_FAILED object:nil];
+                                    //                int a = RESULT_NET_NOTAVAILABLE;
+                                    NSString* message = nil;
+                                    switch (ret) {
+                                        case RESULT_NET_NOTAVAILABLE:
+                                            message = NSLocalizedString(@"net_not_available", nil);
+                                            break;
+                                        case RESULT_NET_ERROR:
+                                            message = NSLocalizedString(@"net_error", nil);
+                                            break;
+                                        case RESULT_FALSE:
+                                            message = NSLocalizedString(@"auth_error", nil);
+                                            break;
+                                        case RESULT_VER_LOW:
+                                            message = NSLocalizedString(@"ver_low", nil);
+                                            break;
+                                        case RESULT_FAILED_WITH_MESSAGE:
+                                            message = result[@"err_msg"];
+                                            break;
+                                        default:
+                                            message=[NSString stringWithFormat:@"Failed to login code %d",ret];
+                                            break;
+                                    }
+                                    
+                                    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_error", nil) message:message preferredStyle:UIAlertControllerStyleAlert];
+                                    UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                                        
+                                    }];
+                                    
+                                    [alertVC addAction:action];
+                                    
+                                    [self presentViewController:alertVC animated:YES completion:nil];
+                                }
+                                
+                            }];
+                        
                         }
                 
                         else
@@ -229,180 +297,314 @@
 }
 -(void) commonAction:(NSString *)value index:(NSIndexPath*) indexPath data:(NSMutableDictionary*) item_json
 {
-//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-    if([value isEqualToString:@"new_addr"])
+    
+//    NSString* single_select = [item_json valueForKey:@"single_select"];
+    //        NSString* required =[item_json valueForKey:@"required"];
+    
+    NSString* name = [item_json valueForKey:@"name"];
+    if([name isEqualToString:@"editor"])
     {
-//        AddressEditorViewController * addressVC = [[AddressEditorViewController alloc] initWithNibName:@"CommonEditor.iPad" bundle:nil];
-//
-//        addressVC.url_type = URL_REMOTE;
+//        NSDictionary* item_json =((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row];
+        bool readonly = [[self.content_data_download valueForKey:@"readonly"]boolValue];
+        int disable = [[item_json valueForKey:@"disable"] intValue];
+        DebugLog(@"TFEditorViewController:: tableView willSelectRowAtIndexPath");
+        
+    //
+
+            if(disable==1||readonly)
+                return ;
+            
+            TFEditorViewController *vc = [[UIStoryboard storyboardWithName:@"TFEditor" bundle:nil] instantiateViewControllerWithIdentifier:@"TFEditorViewController"];
+            
+            
+            vc.url_type = URL_REMOTE;
+            vc.request_url=URL_EDIT;
+            
+            
+            vc.params = [[item_json valueForKey:@"params"] mutableCopy];
+
+            [self.navigationController pushViewController:vc animated:NO];
+            
+        
+    }
+    if([name isEqualToString:@"online_enum"])
+    {
+        NSString* title = [item_json valueForKey:@"aname"];
+
+        int max_select = [[item_json valueForKey:@"max"] intValue];
+        
+        EnumSelectOnlineViewController* enumvc =[[UIStoryboard storyboardWithName:@"CommonEditor" bundle:nil] instantiateViewControllerWithIdentifier:@"EnumSelectOnlineViewController"];
+        enumvc.delegate = self;
+        enumvc.max_select = max_select;
+        enumvc.updatePosition = indexPath;
+        enumvc.online_params = item_json[@"params"];
+        enumvc.single_select = true;
+        //        if([[required lowercaseString] isEqualToString:@"true"])
+        //        enumvc.canbeEmpty = false;
+        //        else
+        //        enumvc.canbeEmpty =true;
+    //            enumvc.cadedate = [cadedate_json mutableCopy];
+        enumvc.title = title;
+        //       enumvc.value = [value_json mutableCopy];
+    //    enumvc.single_select =[[single_select lowercaseString] isEqualToString:@"true"];
+        
+        enumvc.from = indexPath;
+        enumvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
+        
+            
+                    [self handle_action_return:value[@"val_0"] indexPath:indexPath action:ACTION_FILL_SECTION];
+        
+                };
+        
+        
+        [self.navigationController pushViewController:enumvc animated:true];
+    }
+   
+    return ;
+  
+}
+
+#pragma mark - multi_action sub action clicked
+
+- (void)MActionClicked:(UIButton *)sender {
+    
+    
+    
+    UIView * v=sender;
+
+    while (![v isKindOfClass:CommonEditorCellMAction.class]) {
+        v=v.superview;
+    }
+    
+    UITableViewCell *cell =v;//(UITableViewCell *) sender.superview.superview.superview;
+    NSIndexPath *   indexPath = [self.editorTable indexPathForCell:cell];
+    int refresh =0;
+    NSMutableDictionary* section_json=nil;
+
+    NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
+    NSString* subid=[item_json valueForKey:@"subid"];
+    NSString* refresh_trigger = [item_json valueForKey:@"name"];
+    NSDictionary* sub_action = [item_json objectForKey:[NSString stringWithFormat:@"item_%ld",(long)sender.tag]];
+    NSString* type = [sub_action valueForKey:@"type"];
+    {
+        
+        NSDictionary * item_json = sub_action;
+        NSString* name = [item_json valueForKey:@"name"];
+        if([name isEqualToString:@"new"])
+        {
+//            AddressEditorViewController * addressVC = [[AddressEditorViewController alloc] initWithNibName:@"CommonEditor.iPad" bundle:nil];
 //
-//        addressVC.request_url=URL_ADDRESS_EDOTOR;
+//            addressVC.url_type = URL_REMOTE;
 //
+//            addressVC.request_url=URL_ADDRESS_EDOTOR;
 //
-//        NSMutableDictionary * params= [[NSMutableDictionary alloc] init];
 //
 //
-//        addressVC.params = params;
 //
+//            NSMutableDictionary * params= [[NSMutableDictionary alloc] init];
+//            //            NSString * string = [checked componentsJoinedByString:@","];
+//            //            [params setValue:string forKey:@"cart2Checkbox"];
 //
-//        addressVC.delegate = self;
 //
-//        addressVC.from = indexPath;
-//        //            orderinfoVC.params = params;
+//            params[@"is_subaction"]=@"true";
+//            params[@"subaction_tag"]= [NSString stringWithFormat:@"%ld",(long)sender.tag];
+//            addressVC.params = params;
 //
-//        [self.navigationController pushViewController:addressVC animated:true];
-        
-    }else if([value isEqualToString:@"credit_card"])
-    {
-//        CreditCardEditorViewController * cardVC = [[CreditCardEditorViewController alloc] initWithNibName:@"CommonEditor.iPad" bundle:nil];
 //
+//            addressVC.delegate = self;
 //
-//        NSDictionary *data = [item_json objectForKey:@"data"];
+//            addressVC.from = indexPath;
+//            //            orderinfoVC.params = params;
 //
-//        if(data!=nil)
+//            [self.navigationController pushViewController:addressVC animated:true];
+            
+        }else if([name isEqualToString:@"online_enum"])
+        {
+            NSString* title = [item_json valueForKey:@"aname"];
+
+            int max_select = [[item_json valueForKey:@"max"] intValue];
+            
+            EnumSelectOnlineViewController* enumvc =[[UIStoryboard storyboardWithName:@"CommonEditor" bundle:nil] instantiateViewControllerWithIdentifier:@"EnumSelectOnlineViewController"];
+            enumvc.delegate = self;
+            enumvc.max_select = max_select;
+            enumvc.updatePosition = indexPath;
+            enumvc.online_params = item_json[@"params"];
+            enumvc.single_select = true;
+            //        if([[required lowercaseString] isEqualToString:@"true"])
+            //        enumvc.canbeEmpty = false;
+            //        else
+            //        enumvc.canbeEmpty =true;
+        //            enumvc.cadedate = [cadedate_json mutableCopy];
+            enumvc.title = title;
+            //       enumvc.value = [value_json mutableCopy];
+        //    enumvc.single_select =[[single_select lowercaseString] isEqualToString:@"true"];
+            
+            enumvc.from = indexPath;
+            enumvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
+            
+                NSMutableDictionary* ha_json =value[@"val_0"];
+                ha_json[@"is_subaction"]=@"true";
+                ha_json[@"subaction_tag"]= [NSString stringWithFormat:@"%ld",(long)sender.tag];
+                
+                        [self handle_action_return:value[@"val_0"] indexPath:indexPath action:ACTION_FILL_SECTION];
+            
+                    };
+            
+            
+            [self.navigationController pushViewController:enumvc animated:true];
+            
+        }
+//        else if([value isEqualToString:@"Sales_Order_Freight_Bill_To"])
 //        {
 //
-//            cardVC.content_data_download = [data mutableCopy];
-//            cardVC.url_type = URL_NONE;
 //
-//            cardVC.request_url=nil;
-//        }
-//        else
-//        {
-//            cardVC.url_type = URL_REMOTE;
+//            ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+//            cvc.showNavibar = true;
+//            cvc.contact_type = value;
+//            cvc.is_subaction = @"true";
+//            cvc.subaction_tag =[NSString stringWithFormat:@"%ld",(long)sender.tag];
 //
-//            cardVC.request_url=URL_CREDITCARD_EDOTOR;
-//        }
-//        NSMutableDictionary * params= [[NSMutableDictionary alloc] init];
 //
-//        params[@"orderCode"]=appDelegate.order_code;
-//        cardVC.params = params;
+//            cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
 //
-//        cardVC.delegate = self;
+//                [self handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
 //
-//        cardVC.from = indexPath;
+//                //
+//                //                if(self.returnValue)
+//                //                    self.returnValue(value);
+//            };
 //
 //
-//        [self.navigationController pushViewController:cardVC animated:true];
-        
-    }
-    else if([value isEqualToString:@"Sales_Order_Freight_Bill_To"])
-    {
-        
-        
-//        ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
-//        cvc.showNavibar = true;
-//        cvc.contact_type = value;
-//        __weak typeof(self) weakself = self;
-//        cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
 //
-//            [weakself handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
+//            [self.navigationController pushViewController:cvc animated:true];
 //
-//        };
+//        }
+//        else if([value isEqualToString:@"Sales_Order_Ship_From"])
+//        {
 //
 //
+//            ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+//            cvc.showNavibar = true;
+//            cvc.contact_type = value;
+//            cvc.is_subaction = @"true";
+//            cvc.subaction_tag =[NSString stringWithFormat:@"%ld",(long)sender.tag];
 //
-//        [self.navigationController pushViewController:cvc animated:true];
-        
-    }
-    else if([value isEqualToString:@"Sales_Order_Ship_From"])
-    {
-        
+//            cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
 //
-//        ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
-//        cvc.showNavibar = true;
-//        cvc.contact_type = value;
-//        __weak typeof(self) weakself = self;
-//        cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
+//                [self handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
 //
-//            [weakself handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
+//                //
+//                //                if(self.returnValue)
+//                //                    self.returnValue(value);
+//            };
 //
-//        };
 //
 //
+//            [self.navigationController pushViewController:cvc animated:true];
 //
-//        [self.navigationController pushViewController:cvc animated:true];
+//        }
+//        else if([value isEqualToString:@"Sales_Order_Customer"])
+//        {
 //
-    }
-    else if([value isEqualToString:@"Sales_Order_Customer"])
-    {
-        
 //
-//        ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+//            ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+//            cvc.is_subaction = @"true";
+//            cvc.subaction_tag =[NSString stringWithFormat:@"%ld",(long)sender.tag];
+//            cvc.showNavibar = true;
+//            cvc.contact_type = value;
+//            __weak typeof(self) weakself = self;
+//            cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
 //
-//        cvc.contact_type = value;
-//        cvc.showNavibar = true;
-//        __weak typeof(self) weakself = self;
-//        cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
+//                [weakself handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
 //
-//            [weakself handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
+//                //
+//                //                if(self.returnValue)
+//                //                    self.returnValue(value);
+//            };
 //
-//        };
 //
 //
+//            [self.navigationController pushViewController:cvc animated:true];
 //
-//        [self.navigationController pushViewController:cvc animated:true];
-        
-    }
-    else if([value isEqualToString:@"Sales_Order_Merchandise_Bill_To"])
-    {
-        
+//        }
+//        else if([value isEqualToString:@"Sales_Order_Merchandise_Bill_To"])
+//        {
 //
-//        ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
-//        cvc.showNavibar = true;
-//        cvc.contact_type = value;
-//        __weak typeof(self) weakself = self;
-//        cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
 //
-//            [weakself handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
+//            ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+//            cvc.showNavibar = true;
+//            cvc.contact_type = value;
+//            cvc.is_subaction = @"true";
+//            cvc.subaction_tag =[NSString stringWithFormat:@"%ld",(long)sender.tag];
+//            __weak typeof(self) weakself = self;
+//            cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
 //
-//        };
+//                [weakself handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
 //
+//                //
+//                //                if(self.returnValue)
+//                //                    self.returnValue(value);
+//            };
 //
 //
-//        [self.navigationController pushViewController:cvc animated:true];
 //
-    }
-    else if([value isEqualToString:@"Contact_Return_To"])
-    {
-        
+//            [self.navigationController pushViewController:cvc animated:true];
 //
-//        ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
-//        cvc.showNavibar = true;
-//        cvc.contact_type = value;
-//        __weak typeof(self) weakself = self;
-//        cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
+//        }
+//        else if([value isEqualToString:@"Contact_Return_To"])
+//        {
 //
-//            [weakself handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
 //
-//        };
+//            ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+//            cvc.is_subaction = @"true";
+//            cvc.subaction_tag =[NSString stringWithFormat:@"%ld",(long)sender.tag];
+//            cvc.showNavibar = true;
+//            cvc.contact_type = value;
+//            __weak typeof(self) weakself = self;
+//            cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
 //
+//                [weakself handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
 //
+//                //
+//                //                if(self.returnValue)
+//                //                    self.returnValue(value);
+//            };
 //
-//        [self.navigationController pushViewController:cvc animated:true];
-        
-    }
-    else if([value isEqualToString:@"Sales_Order_Ship_To"])
-    {
-        
 //
-//        ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
-//        cvc.showNavibar = true;
-//        cvc.contact_type = value;
-//        __weak typeof(self) weakself = self;
-//        cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
 //
-//            [weakself handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
+//            [self.navigationController pushViewController:cvc animated:true];
+//
+//        }
+//        else if([value isEqualToString:@"Sales_Order_Ship_To"])
+//        {
+//
+//
+//            ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+//            cvc.is_subaction = @"true";
+//            cvc.subaction_tag =[NSString stringWithFormat:@"%ld",(long)sender.tag];
+//            cvc.showNavibar = true;
+//            cvc.contact_type = value;
+//            __weak typeof(self) weakself = self;
+//            cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
 //
-//        };
+//                [weakself handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
 //
+//                //
+//                //                if(self.returnValue)
+//                //                    self.returnValue(value);
+//            };
 //
 //
-//        [self.navigationController pushViewController:cvc animated:true];
+//
+//            [self.navigationController pushViewController:cvc animated:true];
+//
+//        }
+        
         
     }
-    
 }
+
+
 /*
 #pragma mark - Navigation
 

+ 1 - 1
RA TradeFiling/RA TradeFiling/config.h

@@ -13,7 +13,7 @@
 //#define fake_data false
 #ifdef DEBUG
     #define test_server
-    #define fake_data false
+    #define fake_data true
 #else
     #define fake_data false
 # endif

+ 4 - 1
common/customUI/commoneditor/EnumSelectOnlineViewController.h

@@ -38,7 +38,10 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 @property (strong, nonatomic) IBOutlet UITableView *tableEnum;
-@property (nonatomic , copy) void (^returnValue)(NSMutableDictionary* value);
+
+@property (strong,nonatomic) NSIndexPath* from;
+@property (nonatomic , copy) void (^returnValue)(NSMutableDictionary* value,NSIndexPath* source);
+
 @property bool hide_navibar;
 @property bool reset;
 @property int filter_count;

+ 1 - 1
common/customUI/commoneditor/EnumSelectOnlineViewController.m

@@ -159,7 +159,7 @@
         [self.delegate EnumValueChanged:self.online_cadedate indexPath:self.updatePosition];
     }
     if(self.returnValue)
-        self.returnValue(self.online_cadedate);
+        self.returnValue(self.online_cadedate,self.from);
 }