|
@@ -147,18 +147,17 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
Item(icon: UIImage(systemName: "person.fill"), title: "Personal Information".localized()),
|
|
Item(icon: UIImage(systemName: "person.fill"), title: "Personal Information".localized()),
|
|
Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".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: "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" {
|
|
} else if cursorUser.string(forColumnIndex: 0) == "23" || cursorUser.string(forColumnIndex: 0) == "24" {
|
|
Item.menus["Personal"] = [
|
|
Item.menus["Personal"] = [
|
|
Item(icon: UIImage(systemName: "person.fill"), title: "Personal Information".localized()),
|
|
Item(icon: UIImage(systemName: "person.fill"), title: "Personal Information".localized()),
|
|
Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".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 {
|
|
} else {
|
|
Item.menus["Personal"] = [
|
|
Item.menus["Personal"] = [
|
|
Item(icon: UIImage(systemName: "person.fill"), title: "Personal Information".localized()),
|
|
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: "textformat.abc"), title: "Change Language".localized()),
|
|
Item(icon: UIImage(systemName: "person.crop.rectangle"), title: "Access Admin / Internal Features".localized()),
|
|
Item(icon: UIImage(systemName: "person.crop.rectangle"), title: "Access Admin / Internal Features".localized()),
|
|
]
|
|
]
|
|
@@ -207,7 +206,6 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
} else {
|
|
} else {
|
|
Item.menus["Personal"] = [
|
|
Item.menus["Personal"] = [
|
|
Item(icon: UIImage(systemName: "person.fill"), title: "Personal Information".localized()),
|
|
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: "textformat.abc"), title: "Change Language".localized()),
|
|
Item(icon: UIImage(systemName: "person.crop.rectangle"), title: "Access Admin / Internal Features".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())
|
|
Item(icon: UIImage(systemName: "arrow.up.and.person.rectangle.portrait"), title: "Login".localized())
|
|
@@ -328,7 +326,7 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
cell.accessoryType = .disclosureIndicator
|
|
cell.accessoryType = .disclosureIndicator
|
|
case "Access Admin / Internal Features".localized():
|
|
case "Access Admin / Internal Features".localized():
|
|
cell.accessoryType = .disclosureIndicator
|
|
cell.accessoryType = .disclosureIndicator
|
|
- case "Login to Nexilis Web".localized():
|
|
|
|
|
|
+ case "Login to Web".localized():
|
|
cell.accessoryType = .disclosureIndicator
|
|
cell.accessoryType = .disclosureIndicator
|
|
case "Login".localized():
|
|
case "Login".localized():
|
|
cell.accessoryType = .disclosureIndicator
|
|
cell.accessoryType = .disclosureIndicator
|
|
@@ -516,6 +514,50 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
|
|
}
|
|
}
|
|
}))
|
|
}))
|
|
self.present(alert, animated: true, completion: nil)
|
|
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)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|