|
@@ -146,10 +146,10 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
viewWindow = nil
|
|
viewWindow = nil
|
|
}
|
|
}
|
|
|
|
|
|
- func reloadData(idRemoteShared: Int) {
|
|
|
|
|
|
+ func reloadData(idShare: Int) {
|
|
|
|
|
|
guard let metadata = self.metadata else { return }
|
|
guard let metadata = self.metadata else { return }
|
|
- tableShare = NCManageDatabase.sharedInstance.getTableShare(account: metadata.account, idRemoteShared: idRemoteShared)
|
|
|
|
|
|
+ tableShare = NCManageDatabase.sharedInstance.getTableShare(account: metadata.account, idShare: idShare)
|
|
guard let tableShare = self.tableShare else { return }
|
|
guard let tableShare = self.tableShare else { return }
|
|
|
|
|
|
if metadata.directory {
|
|
if metadata.directory {
|
|
@@ -223,7 +223,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
calendar = nil
|
|
calendar = nil
|
|
viewWindowCalendar = nil
|
|
viewWindowCalendar = nil
|
|
|
|
|
|
- reloadData(idRemoteShared: tableShare?.idRemoteShared ?? 0)
|
|
|
|
|
|
+ reloadData(idShare: tableShare?.idShare ?? 0)
|
|
}
|
|
}
|
|
|
|
|
|
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
|
|
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
|
|
@@ -246,7 +246,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
permission = UtilsFramework.getPermissionsValue(byCanEdit: false, andCanCreate: false, andCanChange: false, andCanDelete: false, andCanShare: false, andIsFolder: metadata.directory)
|
|
permission = UtilsFramework.getPermissionsValue(byCanEdit: false, andCanCreate: false, andCanChange: false, andCanDelete: false, andCanShare: false, andIsFolder: metadata.directory)
|
|
}
|
|
}
|
|
|
|
|
|
- networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
|
|
|
|
+ //networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
}
|
|
}
|
|
|
|
|
|
// Read Only (directory)
|
|
// Read Only (directory)
|
|
@@ -259,7 +259,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
if sender.isOn && permission != tableShare.permissions {
|
|
if sender.isOn && permission != tableShare.permissions {
|
|
switchAllowUploadAndEditing.setOn(false, animated: false)
|
|
switchAllowUploadAndEditing.setOn(false, animated: false)
|
|
switchFileDrop.setOn(false, animated: false)
|
|
switchFileDrop.setOn(false, animated: false)
|
|
- networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
|
|
|
|
+// networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
} else {
|
|
} else {
|
|
sender.setOn(true, animated: false)
|
|
sender.setOn(true, animated: false)
|
|
}
|
|
}
|
|
@@ -275,7 +275,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
if sender.isOn && permission != tableShare.permissions {
|
|
if sender.isOn && permission != tableShare.permissions {
|
|
switchReadOnly.setOn(false, animated: false)
|
|
switchReadOnly.setOn(false, animated: false)
|
|
switchFileDrop.setOn(false, animated: false)
|
|
switchFileDrop.setOn(false, animated: false)
|
|
- networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
|
|
|
|
+// networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
} else {
|
|
} else {
|
|
sender.setOn(true, animated: false)
|
|
sender.setOn(true, animated: false)
|
|
}
|
|
}
|
|
@@ -290,7 +290,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
if sender.isOn && permission != tableShare.permissions {
|
|
if sender.isOn && permission != tableShare.permissions {
|
|
switchReadOnly.setOn(false, animated: false)
|
|
switchReadOnly.setOn(false, animated: false)
|
|
switchAllowUploadAndEditing.setOn(false, animated: false)
|
|
switchAllowUploadAndEditing.setOn(false, animated: false)
|
|
- networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
|
|
|
|
+// networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
} else {
|
|
} else {
|
|
sender.setOn(true, animated: false)
|
|
sender.setOn(true, animated: false)
|
|
}
|
|
}
|
|
@@ -301,7 +301,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
|
|
|
guard let tableShare = self.tableShare else { return }
|
|
guard let tableShare = self.tableShare else { return }
|
|
|
|
|
|
- networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: nil, expirationTime: nil, hideDownload: sender.isOn)
|
|
|
|
|
|
+// networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: nil, expirationTime: nil, hideDownload: sender.isOn)
|
|
}
|
|
}
|
|
|
|
|
|
// Password protect
|
|
// Password protect
|
|
@@ -314,7 +314,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
fieldPasswordProtect.text = ""
|
|
fieldPasswordProtect.text = ""
|
|
fieldPasswordProtect.becomeFirstResponder()
|
|
fieldPasswordProtect.becomeFirstResponder()
|
|
} else {
|
|
} else {
|
|
- networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: "", permission: 0, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
|
|
|
|
+// networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: "", permission: 0, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -322,7 +322,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
|
|
|
guard let tableShare = self.tableShare else { return }
|
|
guard let tableShare = self.tableShare else { return }
|
|
|
|
|
|
- networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: fieldPasswordProtect.text, permission: 0, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
|
|
|
|
+// networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: fieldPasswordProtect.text, permission: 0, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
}
|
|
}
|
|
|
|
|
|
// Set expiration date
|
|
// Set expiration date
|
|
@@ -334,7 +334,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
fieldSetExpirationDate.isEnabled = true
|
|
fieldSetExpirationDate.isEnabled = true
|
|
fieldSetExpirationDate(sender: fieldSetExpirationDate)
|
|
fieldSetExpirationDate(sender: fieldSetExpirationDate)
|
|
} else {
|
|
} else {
|
|
- networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: nil, expirationTime: "", hideDownload: tableShare.hideDownload)
|
|
|
|
|
|
+// networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: nil, expirationTime: "", hideDownload: tableShare.hideDownload)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -356,7 +356,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
guard let tableShare = self.tableShare else { return }
|
|
guard let tableShare = self.tableShare else { return }
|
|
if fieldNoteToRecipient.text == nil { return }
|
|
if fieldNoteToRecipient.text == nil { return }
|
|
|
|
|
|
- networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: fieldNoteToRecipient.text, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
|
|
|
|
+// networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: fieldNoteToRecipient.text, expirationTime: nil, hideDownload: tableShare.hideDownload)
|
|
}
|
|
}
|
|
|
|
|
|
// Delete share link
|
|
// Delete share link
|
|
@@ -364,7 +364,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
|
|
|
guard let tableShare = self.tableShare else { return }
|
|
guard let tableShare = self.tableShare else { return }
|
|
|
|
|
|
- networking?.unShare(idRemoteShared: tableShare.idRemoteShared)
|
|
|
|
|
|
+// networking?.unShare(idRemoteShared: tableShare.idRemoteShared)
|
|
}
|
|
}
|
|
|
|
|
|
// Add another link
|
|
// Add another link
|
|
@@ -376,7 +376,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
// MARK: - Delegate networking
|
|
// MARK: - Delegate networking
|
|
|
|
|
|
func readShareCompleted() {
|
|
func readShareCompleted() {
|
|
- reloadData(idRemoteShared: tableShare?.idRemoteShared ?? 0)
|
|
|
|
|
|
+ reloadData(idShare: tableShare?.idShare ?? 0)
|
|
}
|
|
}
|
|
|
|
|
|
func shareCompleted() {
|
|
func shareCompleted() {
|
|
@@ -389,8 +389,8 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
NotificationCenter.default.post(name: NSNotification.Name(rawValue: k_notificationCenter_reloadDataNCShare), object: nil, userInfo: nil)
|
|
NotificationCenter.default.post(name: NSNotification.Name(rawValue: k_notificationCenter_reloadDataNCShare), object: nil, userInfo: nil)
|
|
}
|
|
}
|
|
|
|
|
|
- func updateShareWithError(idRemoteShared: Int) {
|
|
|
|
- reloadData(idRemoteShared: idRemoteShared)
|
|
|
|
|
|
+ func updateShareWithError(idShare: Int) {
|
|
|
|
+ reloadData(idShare: idShare)
|
|
}
|
|
}
|
|
|
|
|
|
func getUserAndGroup(items: [OCShareUser]?) { }
|
|
func getUserAndGroup(items: [OCShareUser]?) { }
|
|
@@ -414,7 +414,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
|
|
|
dateFormatter.dateFormat = "YYYY-MM-dd"
|
|
dateFormatter.dateFormat = "YYYY-MM-dd"
|
|
let expirationTime = dateFormatter.string(from: date)
|
|
let expirationTime = dateFormatter.string(from: date)
|
|
- networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: nil, expirationTime: expirationTime, hideDownload: tableShare.hideDownload)
|
|
|
|
|
|
+// networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: nil, expirationTime: expirationTime, hideDownload: tableShare.hideDownload)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|