alqindiirsyam 2 anos atrás
pai
commit
5db5da44bf

+ 9 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/IncomingThread.swift

@@ -165,6 +165,8 @@ class IncomingThread {
             incomingCallCC(message: message)
         } else if message.getCode() == CoreMessage_TMessageCode.GET_WORKING_AREA_CONTACT_CENTER {
             saveWorkingArea(message: message)
+        } else if message.getCode() == CoreMessage_TMessageCode.ASKING_FOR_END_CALL {
+            askingForEndCall(message: message)
         } else {
             print("unprocessed code", message.getCode())
             ack(message: message)
@@ -177,6 +179,13 @@ class IncomingThread {
     /**
      *
      */
+    private func askingForEndCall(message: TMessage) -> Void {
+        if let packetId = message.mBodies[CoreMessage_TMessageKey.PACKET_ID] {
+            _ = Nexilis.responseString(packetId: packetId, message: "00")
+        }
+        ack(message: message)
+    }
+    
     private func saveWorkingArea(message: TMessage) -> Void {
         let data = message.getBody(key: CoreMessage_TMessageKey.DATA)
         if !data.isEmpty {

+ 223 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Call/QmeraAudioViewController.swift

@@ -12,6 +12,15 @@ import NotificationBannerSwift
 
 class QmeraAudioViewController: UIViewController {
     
+    let stackViewToolbar2 = UIStackView()
+    var onScreenConstraintWB = [NSLayoutConstraint]()
+    let buttonWB = UIButton()
+    let buttonChat = UIButton()
+    var wbVC : WhiteboardViewController?
+    var wbTimer = Timer()
+    var wbBlink = false
+    var wbRoomId = ""
+    
     let buttonSize: CGFloat = 70
     
     lazy var data: String = "" {
@@ -355,6 +364,45 @@ class QmeraAudioViewController: UIViewController {
         end.addTarget(self, action: #selector(didPressEnd(sender:)), for: .touchUpInside)
         speaker.addTarget(self, action: #selector(didSpeaker(sender:)), for: .touchUpInside)
         
+        if !ticketId.isEmpty {
+            self.view.addSubview(self.stackViewToolbar2)
+            self.stackViewToolbar2.translatesAutoresizingMaskIntoConstraints = false
+            NSLayoutConstraint.activate([
+                self.stackViewToolbar2.centerYAnchor.constraint(equalTo: self.view.centerYAnchor),
+                self.stackViewToolbar2.leftAnchor.constraint(equalTo: self.view.leftAnchor, constant: 10.0)
+            ])
+            self.stackViewToolbar2.axis = .vertical
+            self.stackViewToolbar2.distribution = .equalSpacing
+            self.stackViewToolbar2.alignment = .center
+            self.stackViewToolbar2.spacing = 5
+            
+            view.addSubview(buttonWB)
+            buttonWB.translatesAutoresizingMaskIntoConstraints = false
+            buttonWB.frame.size = CGSize(width: 40.0, height: 40.0)
+            NSLayoutConstraint.activate([
+                buttonWB.widthAnchor.constraint(equalToConstant: 40.0),
+                buttonWB.heightAnchor.constraint(equalToConstant: 40.0)
+            ])
+            buttonWB.backgroundColor = .lightGray
+            buttonWB.setImage(UIImage(systemName: "ipad.landscape", withConfiguration: UIImage.SymbolConfiguration(pointSize: 20, weight: .medium, scale: .default)), for: .normal)
+            buttonWB.circle()
+            buttonWB.tintColor = .black
+            buttonWB.addTarget(self, action: #selector(didTapWBButton), for: .touchUpInside)
+            
+            view.addSubview(buttonChat)
+            buttonChat.translatesAutoresizingMaskIntoConstraints = false
+            buttonChat.frame.size = CGSize(width: 40.0, height: 40.0)
+            NSLayoutConstraint.activate([
+                buttonChat.widthAnchor.constraint(equalToConstant: 40.0),
+                buttonChat.heightAnchor.constraint(equalToConstant: 40.0)
+            ])
+            buttonChat.backgroundColor = .lightGray
+            buttonChat.setImage(UIImage(systemName: "bubble.right", withConfiguration: UIImage.SymbolConfiguration(pointSize: 20, weight: .medium, scale: .default)), for: .normal)
+            buttonChat.circle()
+            buttonChat.tintColor = .black
+            buttonChat.addTarget(self, action: #selector(didTapChatButton), for: .touchUpInside)
+        }
+        
         self.view.addSubview(poweredByView)
         self.poweredByView.translatesAutoresizingMaskIntoConstraints = false
         let constraintRightPowered =  self.poweredByView.rightAnchor.constraint(equalTo: self.view.rightAnchor, constant: -10.0)
@@ -368,6 +416,8 @@ class QmeraAudioViewController: UIViewController {
         
         poweredByView.addArrangedSubview(poweredByLabel)
         poweredByView.addArrangedSubview(nexilisLogo)
+        stackViewToolbar2.addArrangedSubview(buttonWB)
+        stackViewToolbar2.addArrangedSubview(buttonChat)
         
     }
     
@@ -376,6 +426,107 @@ class QmeraAudioViewController: UIViewController {
     
     // MARK: - Action
     
+    @objc func didTapChatButton(){
+        let onGoingCC = UserDefaults.standard.string(forKey: "onGoingCC") ?? ""
+        let members = UserDefaults.standard.string(forKey: "membersCC") ?? ""
+        let officer = onGoingCC.isEmpty ? "" : onGoingCC.components(separatedBy: ",")[1]
+        let editorPersonalVC = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "editorPersonalVC") as! EditorPersonal
+        editorPersonalVC.hidesBottomBarWhenPushed = true
+        editorPersonalVC.unique_l_pin = officer
+        editorPersonalVC.fromNotification = true
+        editorPersonalVC.isContactCenter = true
+        editorPersonalVC.fPinContacCenter = members
+        editorPersonalVC.complaintId = ticketId
+        editorPersonalVC.onGoingCC = true
+        editorPersonalVC.isRequestContactCenter = false
+        editorPersonalVC.users = users
+        editorPersonalVC.fromVCAC = true
+        let navigationController = UINavigationController(rootViewController: editorPersonalVC)
+        navigationController.modalPresentationStyle = .overCurrentContext
+        navigationController.navigationBar.tintColor = .white
+        navigationController.navigationBar.barTintColor = .mainColor
+        navigationController.navigationBar.isTranslucent = false
+        navigationController.navigationBar.overrideUserInterfaceStyle = .dark
+        navigationController.navigationBar.barStyle = .black
+        let cancelButtonAttributes: [NSAttributedString.Key: Any] = [NSAttributedString.Key.foregroundColor: UIColor.white]
+        UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
+        let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
+        navigationController.navigationBar.titleTextAttributes = textAttributes
+        navigationController.view.backgroundColor = .mainColor
+        if UIApplication.shared.visibleViewController?.navigationController != nil {
+            UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
+        } else {
+            UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
+        }
+    }
+    
+    @objc func didTapWBButton(){
+        if(wbVC == nil){
+            wbVC = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "wbVC") as? WhiteboardViewController
+            if(wbRoomId.isEmpty){
+                let me = UserDefaults.standard.string(forKey: "me")!
+                let tid = CoreMessage_TMessageUtil.getTID()
+                wbRoomId = "\(me)wbvc\(tid)"
+                wbVC!.roomId = wbRoomId
+                var destinations = [String]()
+                var destString = ""
+                for d in users{
+                    destinations.append(d.pin)
+                    if destString.isEmpty{
+                        destString = d.pin
+                    } else {
+                        destString = destString + ",\(d.pin)"
+                    }
+                }
+                wbVC!.destinations = destinations
+                wbVC!.sendInit()
+                UserDefaults.standard.set("\(me),\(destString)", forKey: "wb_vc")
+            }
+            else {
+                self.wbTimer.invalidate()
+                self.buttonWB.backgroundColor = .lightGray
+                wbVC!.roomId = wbRoomId
+                wbVC!.sendJoin()
+            }
+        }
+        wbVC!.close = {
+            DispatchQueue.main.async {
+                if self.wbVC!.view.isDescendant(of: self.view){
+                    self.wbVC!.view.removeFromSuperview()
+                }
+//                self.buttonDecline.isHidden = false
+//                self.buttonSpeaker.isHidden = false
+//                self.buttonAddParticipant.isHidden = false
+//                self.buttonRotate.isHidden = false
+//                if(!self.wbRoomId.isEmpty){
+//                    DispatchQueue.main.async {
+//                        self.wbTimer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(self.runTimer), userInfo: nil, repeats: true)
+//                    }
+//                }
+            }
+        }
+//        self.buttonDecline.isHidden = true
+//        self.buttonSpeaker.isHidden = true
+//        self.buttonAddParticipant.isHidden = true
+//        self.buttonRotate.isHidden = true
+        addChild(wbVC!)
+        wbVC!.view.translatesAutoresizingMaskIntoConstraints = false
+        view.addSubview(wbVC!.view)
+        onScreenConstraintWB = [
+            wbVC!.view.topAnchor.constraint(equalTo: self.view.topAnchor),
+            wbVC!.view.bottomAnchor.constraint(equalTo: self.view.bottomAnchor),
+            wbVC!.view.rightAnchor.constraint(equalTo: self.view.rightAnchor),
+            wbVC!.view.leftAnchor.constraint(equalTo: self.view.leftAnchor),
+        ]
+           NSLayoutConstraint.activate(onScreenConstraintWB)
+             
+           // Notify the child view controller that the move is complete.
+           wbVC!.didMove(toParent: self)
+//        self.navigationController?.setNavigationBarHidden(false, animated: true)
+//        controller.modalPresentationStyle = .overCurrentContext
+//        self.navigationController?.present(controller, animated: true)
+    }
+    
     @objc func didSpeaker(sender: Any?) {
         isSpeaker = !isSpeaker
         speaker.isSelected = isSpeaker
@@ -434,10 +585,20 @@ class QmeraAudioViewController: UIViewController {
     }
     
     @objc func didEnd(sender: Any?) {
+        if self.buttonWB.isDescendant(of: self.view){
+            self.buttonWB.removeFromSuperview()
+        }
+        if self.buttonChat.isDescendant(of: self.view){
+            self.buttonChat.removeFromSuperview()
+        }
         poweredByView.isHidden = true
         let onGoingCC = UserDefaults.standard.string(forKey: "onGoingCC") ?? ""
         if !onGoingCC.isEmpty {
             if sender != nil && sender is Bool {
+                let controller = self.presentedViewController
+                if controller != nil {
+                    controller!.dismiss(animated: true)
+                }
                 self.dismiss(animated: false, completion: nil)
                 let requester = onGoingCC.components(separatedBy: ",")[0]
                 let officer = onGoingCC.isEmpty ? "" : onGoingCC.components(separatedBy: ",")[1]
@@ -523,6 +684,10 @@ class QmeraAudioViewController: UIViewController {
             }))
             self.present(alert, animated: true, completion: nil)
         } else {
+            let controller = self.presentedViewController
+            if controller != nil {
+                controller!.dismiss(animated: true)
+            }
             if isEndByMe {
 //                for i in 0..<Nexilis.shared.callManager.calls.count {
 //                    Nexilis.shared.callManager.end(call: Nexilis.shared.callManager.calls[i])
@@ -767,3 +932,61 @@ class QmeraAudioViewController: UIViewController {
     }
     
 }
+
+extension QmeraAudioViewController : WhiteboardReceiver {
+    
+    func incomingWB(roomId: String) {
+        print("incoming wb")
+        self.wbTimer.invalidate()
+        if(wbRoomId.isEmpty){
+            print("wbroom empty")
+            DispatchQueue.main.async {
+                self.wbTimer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(self.runTimer), userInfo: nil, repeats: true)
+            }
+            let me = UserDefaults.standard.string(forKey: "me")!
+            var destString = ""
+            for d in users{
+                if d.pin == roomId.components(separatedBy: "wbvc")[0] {
+                    continue
+                }
+                if destString.isEmpty{
+                    destString = d.pin
+                } else {
+                    destString = destString + ",\(d.pin)"
+                }
+            }
+            if destString.isEmpty {
+                UserDefaults.standard.set("\(roomId.components(separatedBy: "wbvc")[0]),\(me)", forKey: "wb_vc")
+            } else {
+                UserDefaults.standard.set("\(roomId.components(separatedBy: "wbvc")[0]),\(me),\(destString)", forKey: "wb_vc")
+            }
+            wbRoomId = roomId
+        }
+    }
+    
+    func cancel(roomId: String) {
+        DispatchQueue.main.async {
+            self.wbTimer.invalidate()
+            self.wbBlink = false
+            self.buttonWB.backgroundColor = .lightGray
+            self.buttonWB.setNeedsDisplay()
+        }
+        wbRoomId = ""
+    }
+    
+    @objc func runTimer(){
+        DispatchQueue.main.async {
+            self.wbBlink = !self.wbBlink
+            if(self.wbBlink){
+                print("set wb blink on")
+                self.buttonWB.backgroundColor = .green
+            }
+            else {
+                print("set wb blink off")
+                self.buttonWB.backgroundColor = .lightGray
+            }
+            self.buttonWB.setNeedsDisplay()
+        }
+    }
+    
+}

+ 67 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Call/QmeraVideoViewController.swift

@@ -52,6 +52,7 @@ class QmeraVideoViewController: UIViewController {
     let stackViewToolbar2 = UIStackView()
     var onScreenConstraintWB = [NSLayoutConstraint]()
     let buttonWB = UIButton()
+    let buttonChat = UIButton()
     var wbVC : WhiteboardViewController?
     let buttonAddParticipant = UIButton()
     let buttonSpeaker = UIButton()
@@ -491,6 +492,9 @@ class QmeraVideoViewController: UIViewController {
                 if self.buttonWB.isDescendant(of: self.view){
                     self.buttonWB.removeFromSuperview()
                 }
+                if self.buttonChat.isDescendant(of: self.view){
+                    self.buttonChat.removeFromSuperview()
+                }
                 if self.buttonDecline.isDescendant(of: self.view) {
                     self.buttonDecline.removeFromSuperview()
                 }
@@ -563,6 +567,7 @@ class QmeraVideoViewController: UIViewController {
                 self.buttonAddParticipant.isHidden = false
                 self.buttonSpeaker.isHidden = false
                 self.buttonWB.isHidden = false
+                self.buttonChat.isHidden = false
                 self.poweredByView.isHidden = false
                 let connectDate = Date()
                 self.vcTimer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { _ in
@@ -575,6 +580,40 @@ class QmeraVideoViewController: UIViewController {
         }
     }
     
+    @objc func didTapChatButton(){
+        let onGoingCC = UserDefaults.standard.string(forKey: "onGoingCC") ?? ""
+        let members = UserDefaults.standard.string(forKey: "membersCC") ?? ""
+        let officer = onGoingCC.isEmpty ? "" : onGoingCC.components(separatedBy: ",")[1]
+        let editorPersonalVC = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "editorPersonalVC") as! EditorPersonal
+        editorPersonalVC.hidesBottomBarWhenPushed = true
+        editorPersonalVC.unique_l_pin = officer
+        editorPersonalVC.fromNotification = true
+        editorPersonalVC.isContactCenter = true
+        editorPersonalVC.fPinContacCenter = members
+        editorPersonalVC.complaintId = ticketId
+        editorPersonalVC.onGoingCC = true
+        editorPersonalVC.isRequestContactCenter = false
+        editorPersonalVC.users = users
+        editorPersonalVC.fromVCAC = true
+        let navigationController = UINavigationController(rootViewController: editorPersonalVC)
+        navigationController.modalPresentationStyle = .overCurrentContext
+        navigationController.navigationBar.tintColor = .white
+        navigationController.navigationBar.barTintColor = .mainColor
+        navigationController.navigationBar.isTranslucent = false
+        navigationController.navigationBar.overrideUserInterfaceStyle = .dark
+        navigationController.navigationBar.barStyle = .black
+        let cancelButtonAttributes: [NSAttributedString.Key: Any] = [NSAttributedString.Key.foregroundColor: UIColor.white]
+        UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
+        let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
+        navigationController.navigationBar.titleTextAttributes = textAttributes
+        navigationController.view.backgroundColor = .mainColor
+        if UIApplication.shared.visibleViewController?.navigationController != nil {
+            UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
+        } else {
+            UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
+        }
+    }
+    
     @objc func didTapWBButton(){
         if(wbVC == nil){
             wbVC = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "wbVC") as? WhiteboardViewController
@@ -709,7 +748,7 @@ class QmeraVideoViewController: UIViewController {
         self.stackViewToolbar2.axis = .vertical
         self.stackViewToolbar2.distribution = .equalSpacing
         self.stackViewToolbar2.alignment = .center
-        self.stackViewToolbar2.spacing = 10
+        self.stackViewToolbar2.spacing = 5
         
         view.addSubview(buttonWB)
         buttonWB.translatesAutoresizingMaskIntoConstraints = false
@@ -725,6 +764,22 @@ class QmeraVideoViewController: UIViewController {
         buttonWB.isHidden = true
         buttonWB.addTarget(self, action: #selector(didTapWBButton), for: .touchUpInside)
         
+        if !ticketId.isEmpty {
+            view.addSubview(buttonChat)
+            buttonChat.translatesAutoresizingMaskIntoConstraints = false
+            buttonChat.frame.size = CGSize(width: 40.0, height: 40.0)
+            NSLayoutConstraint.activate([
+                buttonChat.widthAnchor.constraint(equalToConstant: 40.0),
+                buttonChat.heightAnchor.constraint(equalToConstant: 40.0)
+            ])
+            buttonChat.backgroundColor = .lightGray
+            buttonChat.setImage(UIImage(systemName: "bubble.right", withConfiguration: UIImage.SymbolConfiguration(pointSize: 20, weight: .medium, scale: .default)), for: .normal)
+            buttonChat.circle()
+            buttonChat.tintColor = .black
+            buttonChat.isHidden = true
+            buttonChat.addTarget(self, action: #selector(didTapChatButton), for: .touchUpInside)
+        }
+        
         self.view.addSubview(poweredByView)
         self.poweredByView.translatesAutoresizingMaskIntoConstraints = false
         let constraintRightPowered =  self.poweredByView.rightAnchor.constraint(equalTo: self.view.rightAnchor, constant: -10.0)
@@ -744,6 +799,7 @@ class QmeraVideoViewController: UIViewController {
         stackViewToolbar.addArrangedSubview(buttonDecline)
         stackViewToolbar.addArrangedSubview(buttonSpeaker)
         stackViewToolbar2.addArrangedSubview(buttonWB)
+        stackViewToolbar2.addArrangedSubview(buttonChat)
 //        startFaceTimer()
     }
     
@@ -1022,6 +1078,10 @@ class QmeraVideoViewController: UIViewController {
                 let officer = onGoingCC.isEmpty ? "" : onGoingCC.components(separatedBy: ",")[1]
                 if arrayMessage[0] == requester || arrayMessage[0] == officer {
                     DispatchQueue.main.async {
+                        let controller = self.presentedViewController
+                        if controller != nil {
+                            controller!.dismiss(animated: true)
+                        }
                         if !self.showNotifCCEnd{
                             let imageView = UIImageView(image: UIImage(systemName: "info.circle"))
                             imageView.tintColor = .white
@@ -1038,6 +1098,9 @@ class QmeraVideoViewController: UIViewController {
                         if self.buttonWB.isDescendant(of: self.view){
                             self.buttonWB.removeFromSuperview()
                         }
+                        if self.buttonChat.isDescendant(of: self.view){
+                            self.buttonChat.removeFromSuperview()
+                        }
                         if self.buttonDecline.isDescendant(of: self.view) {
                             self.buttonDecline.removeFromSuperview()
                         }
@@ -1074,6 +1137,9 @@ class QmeraVideoViewController: UIViewController {
                     if self.buttonWB.isDescendant(of: self.view){
                         self.buttonWB.removeFromSuperview()
                     }
+                    if self.buttonChat.isDescendant(of: self.view){
+                        self.buttonChat.removeFromSuperview()
+                    }
                     if self.buttonDecline.isDescendant(of: self.view) {
                         self.buttonDecline.removeFromSuperview()
                     }

+ 3 - 2
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -100,6 +100,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
     var isLinkCopied = false
     var touchedSubview = UIView()
     var listViewOnSection: [UIView] = []
+    var fromVCAC = false
     
     public override func viewDidDisappear(_ animated: Bool) {
         if self.isMovingFromParent {
@@ -1320,7 +1321,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
                             self.dismiss(animated: true, completion: nil)
                         })
                     }
-                } else if (dataMessage.getCode() == CoreMessage_TMessageCode.INVITE_END_CONTACT_CENTER || dataMessage.getCode() == CoreMessage_TMessageCode.END_CALL_CENTER || dataMessage.getCode() == CoreMessage_TMessageCode.INVITE_EXIT_CONTACT_CENTER) {
+                } else if (dataMessage.getCode() == CoreMessage_TMessageCode.INVITE_END_CONTACT_CENTER || dataMessage.getCode() == CoreMessage_TMessageCode.END_CALL_CENTER || dataMessage.getCode() == CoreMessage_TMessageCode.INVITE_EXIT_CONTACT_CENTER) && !fromVCAC {
                     let onGoingCC = UserDefaults.standard.string(forKey: "onGoingCC") ?? ""
                     if onGoingCC.isEmpty || !isContactCenter {
                         return
@@ -2072,7 +2073,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
     }
     
     @objc func didTapExit() {
-        if complaintId.isEmpty {
+        if complaintId.isEmpty || fromVCAC {
             for timer in self.timerCredential.values {
                 timer.invalidate()
             }

+ 5 - 5
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/BroadcastMembersTableViewController.swift

@@ -305,12 +305,12 @@ class BroadcastMembersTableViewController: UITableViewController, UISearchContro
             else if User.isInternal(userType: data.userType ?? "") {
                 content.attributedText = self.set(image: UIImage(named: "ic_internal", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName)", size: 15, y: -4, colorText: UIColor.internalColor)
             } else if User.isCallCenter(userType: data.userType ?? "") {
-                let dataCategory = CategoryCC.getDataFromServiceId(service_id: data.ex_offmp!)
-                if dataCategory != nil {
-                    content.attributedText = self.set(image: UIImage(named: "pb_call_center", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName) (\(dataCategory!.service_name))", size: 15, y: -4, colorText: UIColor.ccColor)
-                } else {
+//                let dataCategory = CategoryCC.getDataFromServiceId(service_id: data.ex_offmp!)
+//                if dataCategory != nil {
+//                    content.attributedText = self.set(image: UIImage(named: "pb_call_center", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName) (\(dataCategory!.service_name))", size: 15, y: -4, colorText: UIColor.ccColor)
+//                } else {
                     content.attributedText = self.set(image: UIImage(named: "pb_call_center", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName)", size: 15, y: -4, colorText: UIColor.ccColor)
-                }
+//                }
             } else {
                 content.text = data.fullName
             }

+ 5 - 5
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/BroadcastViewController.swift

@@ -621,12 +621,12 @@ class BroadcastViewController: UITableViewController, UITextFieldDelegate, UITex
                 else if User.isInternal(userType: data.userType ?? "") {
                     content.attributedText = self.set(image: UIImage(named: "ic_internal", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName)", size: 15, y: -4, colorText: UIColor.internalColor)
                 } else if User.isCallCenter(userType: data.userType ?? "") {
-                    let dataCategory = CategoryCC.getDataFromServiceId(service_id: data.ex_offmp!)
-                    if dataCategory != nil {
-                        content.attributedText = self.set(image: UIImage(named: "pb_call_center", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName) (\(dataCategory!.service_name))", size: 15, y: -4, colorText: UIColor.ccColor)
-                    } else {
+//                    let dataCategory = CategoryCC.getDataFromServiceId(service_id: data.ex_offmp!)
+//                    if dataCategory != nil {
+//                        content.attributedText = self.set(image: UIImage(named: "pb_call_center", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName) (\(dataCategory!.service_name))", size: 15, y: -4, colorText: UIColor.ccColor)
+//                    } else {
                         content.attributedText = self.set(image: UIImage(named: "pb_call_center", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName)", size: 15, y: -4, colorText: UIColor.ccColor)
-                    }
+//                    }
                 } else {
                     content.text = data.fullName
                 }

+ 10 - 10
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/ContactChatViewController.swift

@@ -885,12 +885,12 @@ extension ContactChatViewController {
                 else if User.isInternal(userType: data.userType ?? "") {
                     content.attributedText = self.set(image: UIImage(named: "ic_internal", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName)", size: 15, y: -4, colorText: UIColor.internalColor)
                 } else if User.isCallCenter(userType: data.userType ?? "") {
-                    let dataCategory = CategoryCC.getDataFromServiceId(service_id: data.ex_offmp!)
-                    if dataCategory != nil {
-                        content.attributedText = self.set(image: UIImage(named: "pb_call_center", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName) (\(dataCategory!.service_name))", size: 15, y: -4, colorText: UIColor.ccColor)
-                    } else {
+//                    let dataCategory = CategoryCC.getDataFromServiceId(service_id: data.ex_offmp!)
+//                    if dataCategory != nil {
+//                        content.attributedText = self.set(image: UIImage(named: "pb_call_center", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName) (\(dataCategory!.service_name))", size: 15, y: -4, colorText: UIColor.ccColor)
+//                    } else {
                         content.attributedText = self.set(image: UIImage(named: "pb_call_center", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName)", size: 15, y: -4, colorText: UIColor.ccColor)
-                    }
+//                    }
                 } else {
                     content.text = data.fullName
                 }
@@ -1183,12 +1183,12 @@ extension ContactChatViewController {
                 else if User.isInternal(userType: data.userType ?? "") {
                     content.attributedText = self.set(image: UIImage(named: "ic_internal", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName)", size: 15, y: -4, colorText: UIColor.internalColor)
                 } else if User.isCallCenter(userType: data.userType ?? "") {
-                    let dataCategory = CategoryCC.getDataFromServiceId(service_id: data.ex_offmp!)
-                    if dataCategory != nil {
-                        content.attributedText = self.set(image: UIImage(named: "pb_call_center", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName) (\(dataCategory!.service_name))", size: 15, y: -4, colorText: UIColor.ccColor)
-                    } else {
+//                    let dataCategory = CategoryCC.getDataFromServiceId(service_id: data.ex_offmp!)
+//                    if dataCategory != nil {
+//                        content.attributedText = self.set(image: UIImage(named: "pb_call_center", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName) (\(dataCategory!.service_name))", size: 15, y: -4, colorText: UIColor.ccColor)
+//                    } else {
                         content.attributedText = self.set(image: UIImage(named: "pb_call_center", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: "  \(data.fullName)", size: 15, y: -4, colorText: UIColor.ccColor)
-                    }
+//                    }
                 } else {
                     content.text = data.fullName
                 }

+ 2 - 2
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/SetInternalCSAccount.swift

@@ -66,9 +66,9 @@ public class SetInternalCSAccount: UITableViewController {
         DispatchQueue.global().async {
             Database.shared.database?.inTransaction({ (fmdb, rollback) in
                 var r: [User] = []
-                var query =  "SELECT u.f_pin, u.first_name, u.last_name, u.image_id, u.user_type FROM BUDDY u where u.f_pin <> '\(User.getMyPin()!)' and u.user_type <> '24' and u.official_account <> '1' and u.official_account <> '2' and u.official_account <> '3' and u.user_type <> '23' order by 2 collate nocase asc"
+                var query =  "SELECT u.f_pin, u.first_name, u.last_name, u.image_id, u.user_type FROM BUDDY u where u.f_pin <> '\(User.getMyPin()!)' and u.user_type <> '24' and u.official_account <> '1' and u.official_account <> '2' and u.official_account <> '3' order by 2 collate nocase asc"
                 if self.isSetCS {
-                    query =  "SELECT u.f_pin, u.first_name, u.last_name, u.image_id, u.user_type FROM BUDDY u LEFT JOIN GROUPZ_MEMBER m ON u.f_pin = m.f_pin where u.f_pin <> '\(User.getMyPin()!)' and u.official_account <> '1' and u.official_account <> '2' and u.official_account <> '3' and (u.user_type = '23' or u.user_type = '24') and group_id = (select g.group_id from GROUPZ g where g.official = 1 and g.level = 3) and m.position <> '1' order by 2 collate nocase asc"
+                    query =  "SELECT u.f_pin, u.first_name, u.last_name, u.image_id, u.user_type FROM BUDDY u LEFT JOIN GROUPZ_MEMBER m ON u.f_pin = m.f_pin where u.f_pin <> '\(User.getMyPin()!)' and u.official_account <> '1' and u.official_account <> '2' and u.official_account <> '3' and (u.user_type = '23' or u.user_type = '24') and group_id = (select g.group_id from GROUPZ g where g.official = 1) and m.position <> '1' order by 2 collate nocase asc"
                 }
                 if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: query) {
                     while cursorData.next() {