|
@@ -86,8 +86,18 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
if ViewController.middleButton.isHidden {
|
|
|
ViewController.isExpandButton = false
|
|
|
if let viewController = viewController as? ViewController {
|
|
|
- viewController.tabBar.isHidden = false
|
|
|
- ViewController.middleButton.isHidden = false
|
|
|
+ if viewController.tabBar.isHidden {
|
|
|
+ viewController.tabBar.isHidden = false
|
|
|
+ ViewController.middleButton.isHidden = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if PrefsUtil.getCpaasMode() != PrefsUtil.CPAAS_MODE_DOCKED {
|
|
|
+ DispatchQueue.main.async {
|
|
|
+ if let viewController = viewController as? ViewController {
|
|
|
+ if viewController.tabBar.isHidden {
|
|
|
+ viewController.tabBar.isHidden = false
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -137,18 +147,17 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
Item(icon: UIImage(systemName: "person.fill"), title: "Personal Information".localized()),
|
|
|
Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
|
|
|
Item(icon: UIImage(systemName: "person.crop.rectangle"), title: "Change Admin / Internal Password".localized()),
|
|
|
-// Item(icon: UIImage(systemName: "laptopcomputer.and.iphone"), title: "Login to Nexilis Web".localized()),
|
|
|
+ Item(icon: UIImage(systemName: "laptopcomputer.and.iphone"), title: "Login to Web".localized()),
|
|
|
]
|
|
|
} else if cursorUser.string(forColumnIndex: 0) == "23" || cursorUser.string(forColumnIndex: 0) == "24" {
|
|
|
Item.menus["Personal"] = [
|
|
|
Item(icon: UIImage(systemName: "person.fill"), title: "Personal Information".localized()),
|
|
|
Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
|
|
|
-// Item(icon: UIImage(systemName: "laptopcomputer.and.iphone"), title: "Login to Nexilis Web".localized()),
|
|
|
+ Item(icon: UIImage(systemName: "laptopcomputer.and.iphone"), title: "Login to Web".localized()),
|
|
|
]
|
|
|
} else {
|
|
|
Item.menus["Personal"] = [
|
|
|
Item(icon: UIImage(systemName: "person.fill"), title: "Personal Information".localized()),
|
|
|
-// Item(icon: UIImage(systemName: "laptopcomputer.and.iphone"), title: "Login to Nexilis Web".localized()),
|
|
|
Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
|
|
|
Item(icon: UIImage(systemName: "person.crop.rectangle"), title: "Access Admin / Internal Features".localized()),
|
|
|
]
|
|
@@ -197,7 +206,6 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
} else {
|
|
|
Item.menus["Personal"] = [
|
|
|
Item(icon: UIImage(systemName: "person.fill"), title: "Personal Information".localized()),
|
|
|
-// Item(icon: UIImage(systemName: "laptopcomputer.and.iphone"), title: "Login to Nexilis Web".localized()),
|
|
|
Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
|
|
|
Item(icon: UIImage(systemName: "person.crop.rectangle"), title: "Access Admin / Internal Features".localized()),
|
|
|
Item(icon: UIImage(systemName: "arrow.up.and.person.rectangle.portrait"), title: "Login".localized())
|
|
@@ -233,8 +241,8 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
})
|
|
|
|
|
|
Item.menus["Call"] = [
|
|
|
- Item(icon: UIImage(systemName: "message"), title: "Incoming Message(s)".localized()),
|
|
|
- Item(icon: UIImage(systemName: "phone"), title: "Incoming Call(s)".localized()),
|
|
|
+// Item(icon: UIImage(systemName: "message"), title: "Incoming Message(s)".localized()),
|
|
|
+// Item(icon: UIImage(systemName: "phone"), title: "Incoming Call(s)".localized()),
|
|
|
Item(icon: UIImage(systemName: "iphone.homebutton.radiowaves.left.and.right"), title: "Vibrate Mode".localized()),
|
|
|
Item(icon: UIImage(systemName: "photo.on.rectangle.angled"), title: "Save to Gallery".localized()),
|
|
|
Item(icon: UIImage(systemName: "arrow.down.square"), title: "Auto Download".localized()),
|
|
@@ -256,7 +264,7 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
var bgChoosen = ""
|
|
|
let arrayBg = listBg.split(separator: ",")
|
|
|
bgChoosen = String(arrayBg[Int.random(in: 0..<arrayBg.count)])
|
|
|
- ViewController.getDataImageFromUrl(from: URL(string: PrefsUtil.getURLBase()! + "/dashboardv2/uploads/background/" + bgChoosen)!) { data, response, error in
|
|
|
+ ViewController.getDataImageFromUrl(from: URL(string: PrefsUtil.getURLBase() + "/dashboardv2/uploads/background/" + bgChoosen)!) { data, response, error in
|
|
|
guard let data = data, error == nil else { return }
|
|
|
// always update the UI from the main thread
|
|
|
DispatchQueue.main.async() { [self] in
|
|
@@ -318,7 +326,7 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
cell.accessoryType = .disclosureIndicator
|
|
|
case "Access Admin / Internal Features".localized():
|
|
|
cell.accessoryType = .disclosureIndicator
|
|
|
- case "Login to Nexilis Web".localized():
|
|
|
+ case "Login to Web".localized():
|
|
|
cell.accessoryType = .disclosureIndicator
|
|
|
case "Login".localized():
|
|
|
cell.accessoryType = .disclosureIndicator
|
|
@@ -331,7 +339,8 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
let accessoryButton = UIButton(type: .custom)
|
|
|
accessoryButton.setTitle(UIApplication.appVersion, for: .normal)
|
|
|
accessoryButton.setTitleColor(.black, for: .normal)
|
|
|
- accessoryButton.frame = CGRect(x: 0, y: 0, width: 40, height: 40)
|
|
|
+ accessoryButton.contentHorizontalAlignment = .right;
|
|
|
+ accessoryButton.frame = CGRect(x: 0, y: 0, width: 100, height: 40)
|
|
|
accessoryButton.contentMode = .scaleAspectFit
|
|
|
cell.accessoryView = accessoryButton as UIView
|
|
|
case "Vibrate Mode".localized():
|
|
@@ -460,8 +469,9 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
UserDefaults.standard.setValue(id, forKey: "me")
|
|
|
Utils.setProfile(value: false)
|
|
|
UserDefaults.standard.synchronize()
|
|
|
- // pos registration
|
|
|
- _ = Nexilis.write(message: CoreMessage_TMessageBank.getPostRegistration(p_pin: id))
|
|
|
+ if Utils.getForceAnonymous() {
|
|
|
+ _ = Nexilis.write(message: CoreMessage_TMessageBank.getPostRegistration(p_pin: id))
|
|
|
+ }
|
|
|
DispatchQueue.main.async {
|
|
|
Nexilis.hideLoader()
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "checkmark.circle.fill"))
|
|
@@ -474,6 +484,17 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
self.makeMenu()
|
|
|
self.tableView.reloadData()
|
|
|
}
|
|
|
+ if !Utils.getForceAnonymous() {
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
|
|
|
+ var viewController = UIApplication.shared.windows.first!.rootViewController
|
|
|
+ if !(viewController is ViewController) {
|
|
|
+ viewController = self.parent
|
|
|
+ }
|
|
|
+ if let viewController = viewController as? ViewController {
|
|
|
+ viewController.viewWillAppear(false)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
Nexilis.hideLoader()
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
@@ -493,6 +514,50 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
|
}
|
|
|
}))
|
|
|
self.present(alert, animated: true, completion: nil)
|
|
|
+ } else if item.title == "Login to Web".localized() {
|
|
|
+ var permissionCheck = -1
|
|
|
+ if AVCaptureDevice.authorizationStatus(for: .video) == .authorized {
|
|
|
+ permissionCheck = 1
|
|
|
+ } else if AVCaptureDevice.authorizationStatus(for: .video) == .denied {
|
|
|
+ permissionCheck = 0
|
|
|
+ } else {
|
|
|
+ AVCaptureDevice.requestAccess(for: .video, completionHandler: { (granted: Bool) -> Void in
|
|
|
+ if granted == true {
|
|
|
+ permissionCheck = 1
|
|
|
+ } else {
|
|
|
+ permissionCheck = 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ while permissionCheck == -1 {
|
|
|
+ sleep(1)
|
|
|
+ }
|
|
|
+
|
|
|
+ if permissionCheck == 0 {
|
|
|
+ let alert = UIAlertController(title: "Attention!".localized(), message: "Please allow camera permission in your settings".localized(), preferredStyle: .alert)
|
|
|
+ alert.addAction(UIAlertAction(title: "OK".localized(), style: UIAlertAction.Style.default, handler: { _ in
|
|
|
+ if let url = URL(string: UIApplication.openSettingsURLString), UIApplication.shared.canOpenURL(url) {
|
|
|
+ UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
+ UIApplication.shared.visibleViewController?.navigationController?.present(alert, animated: true, completion: nil)
|
|
|
+ } else {
|
|
|
+ UIApplication.shared.visibleViewController?.present(alert, animated: true, completion: nil)
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let controller = ScannerViewController()
|
|
|
+ let navigationController = UINavigationController(rootViewController: controller)
|
|
|
+ navigationController.navigationBar.tintColor = .white
|
|
|
+ navigationController.navigationBar.barTintColor = .mainColor
|
|
|
+ navigationController.navigationBar.isTranslucent = false
|
|
|
+ let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
+ navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
+ navigationController.view.backgroundColor = .mainColor
|
|
|
+ navigationController.modalPresentationStyle = .custom
|
|
|
+ self.present(navigationController, animated: true)
|
|
|
}
|
|
|
}
|
|
|
|