Goto ticket by double lick

This commit is contained in:
Gerrit Linnemann 2016-12-27 14:32:39 +01:00
parent d11c45633a
commit 6418b770dd
4 changed files with 12 additions and 0 deletions

View File

@ -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>

View File

@ -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 {

View File

@ -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)