Goto ticket by double lick
This commit is contained in:
parent
d11c45633a
commit
6418b770dd
Binary file not shown.
@ -911,6 +911,9 @@
|
||||
</prototypeCellViews>
|
||||
</tableColumn>
|
||||
</tableColumns>
|
||||
<connections>
|
||||
<action trigger="doubleAction" selector="otrsListDoubleClickAction:" target="XfG-lQ-9wD" id="4pR-ED-fer"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
</subviews>
|
||||
</clipView>
|
||||
|
||||
@ -12,6 +12,7 @@ struct Constants {
|
||||
|
||||
struct SERVICE {
|
||||
static let URL = "http://saeweb01.sae.intra/web/ws/v1/user/permission/"
|
||||
static let URL_TICKET = "http://saeotrs01.sae.intra/otrs/index.pl?Action=AgentTicketZoom;TicketID="
|
||||
}
|
||||
|
||||
struct USER_SETTINGS {
|
||||
|
||||
@ -81,6 +81,14 @@ class ViewController: NSViewController {
|
||||
|
||||
// MARK: Actions
|
||||
|
||||
@IBAction func otrsListDoubleClickAction(_ sender: NSTableView) {
|
||||
let ticketID = OTRS.sharedInstance.ticketDictionary[sender.clickedRow].id
|
||||
|
||||
if let url = URL(string: "\(Constants.SERVICE.URL_TICKET)\(ticketID)"), NSWorkspace.shared().open(url) {
|
||||
print("🖥 Going to open ticket #\(ticketID)")
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func saveSettingsAction(_ sender: NSButton) {
|
||||
UserDefaults.standard.setValue(txtUsername.stringValue, forKey: Constants.USER_SETTINGS.CREDENTIALS.USER)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user