Przeglądaj źródła

add SA in setting

alqindiirsyam 1 rok temu
rodzic
commit
7e030afd7b

+ 9 - 0
appbuilder-ios/AppBuilder/AppBuilder/FourthTabViewController.swift

@@ -183,6 +183,9 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
                 } else if isChangeProfile {
                     Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "arrow.clockwise.icloud"), title: "Backup & Restore".localized()))
                     Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "lessthan.circle"), title: "Validation Transaction Limit".localized()))
+                    if Utils.getEnableMobileBuilder() == "1" {
+                        Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "iphone"), title: "Create Your Own App".localized()))
+                    }
                     Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "rectangle.portrait.and.arrow.right"), title: "Sign-Out".localized()))
                 }
                 let image = cursorUser.string(forColumnIndex: 1)
@@ -389,6 +392,8 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
                 cell.accessoryType = .disclosureIndicator
             case "Validation Transaction Limit".localized():
                 cell.accessoryType = .disclosureIndicator
+            case "Create Your Own App".localized():
+                cell.accessoryType = .disclosureIndicator
             case "Notification Message(s) Group".localized():
                 cell.accessoryType = .disclosureIndicator
 //            case "Logout".localized():
@@ -701,6 +706,10 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
         } else if item.title == "Validation Transaction Limit".localized() {
             let controller = ValidationTransactionLimit()
             navigationController?.show(controller, sender: nil)
+        }  else if item.title == "Create Your Own App".localized() {
+            let controller = BNIBookingWebView()
+            controller.customUrl = PrefsUtil.getURLBase() + "mobile_MAB?f_pin="
+            self.present(controller, animated: true)
         }
     }
     

+ 3 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/Utils.swift

@@ -140,6 +140,9 @@ public final class Utils {
     static func setEnableMobileBuilder(value: String){
         UserDefaults.standard.set(value, forKey: "app_builder_enable_mobile_builder")
     }
+    public static func getEnableMobileBuilder() -> String {
+        UserDefaults.standard.string(forKey: "app_builder_enable_mobile_builder") ?? "0"
+    }
     
     static func setFinishInitPrefs(value: Bool){
         UserDefaults.standard.set(value, forKey: "finish_init_prefs")

+ 7 - 7
appbuilder-ios/NexilisLite/NexilisLite/Source/View/BNIView/BNIBookingWebView.swift

@@ -8,16 +8,16 @@
 import UIKit
 import WebKit
 
-class BNIBookingWebView: UIViewController, WKNavigationDelegate, UIScrollViewDelegate, UIGestureRecognizerDelegate, WKScriptMessageHandler {
+public class BNIBookingWebView: UIViewController, WKNavigationDelegate, UIScrollViewDelegate, UIGestureRecognizerDelegate, WKScriptMessageHandler {
     var webView = WKWebView()
     let closeButton = UIButton()
-    var customUrl = ""
+    public var customUrl = ""
     
-    override var preferredStatusBarStyle: UIStatusBarStyle {
+    public override var preferredStatusBarStyle: UIStatusBarStyle {
         return .default
     }
     
-    override func viewDidLoad() {
+    public override func viewDidLoad() {
         super.viewDidLoad()
         
         let configuration = WKWebViewConfiguration()
@@ -96,14 +96,14 @@ class BNIBookingWebView: UIViewController, WKNavigationDelegate, UIScrollViewDel
         webView.load(urlRequest)
     }
     
-    func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
+    public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
         return true
     }
     
-    func scrollViewDidScroll(_ scrollView: UIScrollView) {
+    public func scrollViewDidScroll(_ scrollView: UIScrollView) {
     }
     
-    func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
+    public func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
         if message.name == "sendQueueBNI" {
             guard let dict = message.body as? [String: AnyObject],
                   let param1 = dict["param1"] as? String else {

+ 15 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/SettingTableViewController.swift

@@ -135,6 +135,10 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
                     Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "arrow.up.and.person.rectangle.portrait"), title: "Sign-Up/Sign-In".localized()))
                 } else if isChangeProfile {
                     Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "arrow.clockwise.icloud"), title: "Backup & Restore".localized()))
+                    Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "lessthan.circle"), title: "Validation Transaction Limit".localized()))
+                    if Utils.getEnableMobileBuilder() == "1" {
+                        Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "iphone"), title: "Create Your Own App".localized()))
+                    }
                     Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "rectangle.portrait.and.arrow.right"), title: "Sign-Out".localized()))
                 }
                 let image = cursorUser.string(forColumnIndex: 1)
@@ -323,6 +327,10 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
 //            case "Logout".localized():
             case "Change Admin / Internal Password".localized():
                 cell.accessoryType = .disclosureIndicator
+            case "Validation Transaction Limit".localized():
+                cell.accessoryType = .disclosureIndicator
+            case "Create Your Own App".localized():
+                cell.accessoryType = .disclosureIndicator
             case "Change Language".localized():
                 cell.accessoryType = .disclosureIndicator
             case "Set Internal Account".localized():
@@ -603,6 +611,13 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
             viewConfigureFB.modalTransitionStyle = .crossDissolve
             viewConfigureFB.modalPresentationStyle = .custom
             self.present(viewConfigureFB, animated: true)
+        } else if item.title == "Validation Transaction Limit".localized() {
+            let controller = ValidationTransactionLimit()
+            navigationController?.show(controller, sender: nil)
+        }  else if item.title == "Create Your Own App".localized() {
+            let controller = BNIBookingWebView()
+            controller.customUrl = Utils.getURLBase() + "mobile_MAB?f_pin="
+            self.present(controller, animated: true)
         }
     }