|
@@ -246,15 +246,15 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
guard let tableShare = self.tableShare else { return }
|
|
|
guard let metadata = self.metadata else { return }
|
|
|
|
|
|
- var permission: Int = 0
|
|
|
+ var permissions: Int = 0
|
|
|
|
|
|
if sender.isOn {
|
|
|
- permission = CCUtility.getPermissionsValue(byCanEdit: true, andCanCreate: true, andCanChange: true, andCanDelete: true, andCanShare: false, andIsFolder: metadata.directory)
|
|
|
+ permissions = CCUtility.getPermissionsValue(byCanEdit: true, andCanCreate: true, andCanChange: true, andCanDelete: true, andCanShare: false, andIsFolder: metadata.directory)
|
|
|
} else {
|
|
|
- permission = CCUtility.getPermissionsValue(byCanEdit: false, andCanCreate: false, andCanChange: false, andCanDelete: false, andCanShare: false, andIsFolder: metadata.directory)
|
|
|
+ permissions = CCUtility.getPermissionsValue(byCanEdit: false, andCanCreate: false, andCanChange: false, andCanDelete: false, andCanShare: false, andIsFolder: metadata.directory)
|
|
|
}
|
|
|
|
|
|
- networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: permission, note: nil, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
+ networking?.updateShare(idShare: tableShare.idShare, password: nil, permissions: permissions, note: nil, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
}
|
|
|
|
|
|
// Read Only (directory)
|
|
@@ -262,12 +262,12 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
|
|
|
guard let tableShare = self.tableShare else { return }
|
|
|
guard let metadata = self.metadata else { return }
|
|
|
- let permission = CCUtility.getPermissionsValue(byCanEdit: false, andCanCreate: false, andCanChange: false, andCanDelete: false, andCanShare: false, andIsFolder: metadata.directory)
|
|
|
+ let permissions = CCUtility.getPermissionsValue(byCanEdit: false, andCanCreate: false, andCanChange: false, andCanDelete: false, andCanShare: false, andIsFolder: metadata.directory)
|
|
|
|
|
|
- if sender.isOn && permission != tableShare.permissions {
|
|
|
+ if sender.isOn && permissions != tableShare.permissions {
|
|
|
switchAllowUploadAndEditing.setOn(false, animated: false)
|
|
|
switchFileDrop.setOn(false, animated: false)
|
|
|
- networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: permission, note: nil, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
+ networking?.updateShare(idShare: tableShare.idShare, password: nil, permissions: permissions, note: nil, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
} else {
|
|
|
sender.setOn(true, animated: false)
|
|
|
}
|
|
@@ -278,12 +278,12 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
|
|
|
guard let tableShare = self.tableShare else { return }
|
|
|
guard let metadata = self.metadata else { return }
|
|
|
- let permission = CCUtility.getPermissionsValue(byCanEdit: true, andCanCreate: true, andCanChange: true, andCanDelete: true, andCanShare: false, andIsFolder: metadata.directory)
|
|
|
+ let permissions = CCUtility.getPermissionsValue(byCanEdit: true, andCanCreate: true, andCanChange: true, andCanDelete: true, andCanShare: false, andIsFolder: metadata.directory)
|
|
|
|
|
|
- if sender.isOn && permission != tableShare.permissions {
|
|
|
+ if sender.isOn && permissions != tableShare.permissions {
|
|
|
switchReadOnly.setOn(false, animated: false)
|
|
|
switchFileDrop.setOn(false, animated: false)
|
|
|
- networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: permission, note: nil, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
+ networking?.updateShare(idShare: tableShare.idShare, password: nil, permissions: permissions, note: nil, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
} else {
|
|
|
sender.setOn(true, animated: false)
|
|
|
}
|
|
@@ -293,12 +293,12 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
@IBAction func switchFileDrop(sender: UISwitch) {
|
|
|
|
|
|
guard let tableShare = self.tableShare else { return }
|
|
|
- let permission = NCGlobal.shared.permissionCreateShare
|
|
|
+ let permissions = NCGlobal.shared.permissionCreateShare
|
|
|
|
|
|
- if sender.isOn && permission != tableShare.permissions {
|
|
|
+ if sender.isOn && permissions != tableShare.permissions {
|
|
|
switchReadOnly.setOn(false, animated: false)
|
|
|
switchAllowUploadAndEditing.setOn(false, animated: false)
|
|
|
- networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: permission, note: nil, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
+ networking?.updateShare(idShare: tableShare.idShare, password: nil, permissions: permissions, note: nil, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
} else {
|
|
|
sender.setOn(true, animated: false)
|
|
|
}
|
|
@@ -309,7 +309,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
|
|
|
guard let tableShare = self.tableShare else { return }
|
|
|
|
|
|
- networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: tableShare.permissions, note: nil, label: nil, expirationDate: nil, hideDownload: sender.isOn)
|
|
|
+ networking?.updateShare(idShare: tableShare.idShare, password: nil, permissions: tableShare.permissions, note: nil, label: nil, expirationDate: nil, hideDownload: sender.isOn)
|
|
|
}
|
|
|
|
|
|
// Password protect
|
|
@@ -322,7 +322,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
fieldPasswordProtect.text = ""
|
|
|
fieldPasswordProtect.becomeFirstResponder()
|
|
|
} else {
|
|
|
- networking?.updateShare(idShare: tableShare.idShare, password: "", permission: tableShare.permissions, note: nil, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
+ networking?.updateShare(idShare: tableShare.idShare, password: "", permissions: tableShare.permissions, note: nil, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -330,7 +330,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
|
|
|
guard let tableShare = self.tableShare else { return }
|
|
|
|
|
|
- networking?.updateShare(idShare: tableShare.idShare, password: fieldPasswordProtect.text, permission: tableShare.permissions, note: nil, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
+ networking?.updateShare(idShare: tableShare.idShare, password: fieldPasswordProtect.text, permissions: tableShare.permissions, note: nil, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
}
|
|
|
|
|
|
// Set expiration date
|
|
@@ -342,7 +342,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
fieldSetExpirationDate.isEnabled = true
|
|
|
fieldSetExpirationDate(sender: fieldSetExpirationDate)
|
|
|
} else {
|
|
|
- networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: tableShare.permissions, note: nil, label: nil, expirationDate: "", hideDownload: tableShare.hideDownload)
|
|
|
+ networking?.updateShare(idShare: tableShare.idShare, password: nil, permissions: tableShare.permissions, note: nil, label: nil, expirationDate: "", hideDownload: tableShare.hideDownload)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -364,7 +364,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
guard let tableShare = self.tableShare else { return }
|
|
|
if fieldNoteToRecipient.text == nil { return }
|
|
|
|
|
|
- networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: tableShare.permissions, note: fieldNoteToRecipient.text, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
+ networking?.updateShare(idShare: tableShare.idShare, password: nil, permissions: tableShare.permissions, note: fieldNoteToRecipient.text, label: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
}
|
|
|
|
|
|
// Label
|
|
@@ -373,7 +373,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
guard let tableShare = self.tableShare else { return }
|
|
|
if fieldLabel.text == nil { return }
|
|
|
|
|
|
- networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: tableShare.permissions, note: nil, label: fieldLabel.text, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
+ networking?.updateShare(idShare: tableShare.idShare, password: nil, permissions: tableShare.permissions, note: nil, label: fieldLabel.text, expirationDate: nil, hideDownload: tableShare.hideDownload)
|
|
|
}
|
|
|
|
|
|
// Delete share link
|
|
@@ -432,7 +432,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
|
|
|
dateFormatter.dateFormat = "YYYY-MM-dd HH:mm:ss"
|
|
|
let expirationDate = dateFormatter.string(from: date)
|
|
|
|
|
|
- networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: tableShare.permissions, note: nil, label: nil, expirationDate: expirationDate, hideDownload: tableShare.hideDownload)
|
|
|
+ networking?.updateShare(idShare: tableShare.idShare, password: nil, permissions: tableShare.permissions, note: nil, label: nil, expirationDate: expirationDate, hideDownload: tableShare.hideDownload)
|
|
|
}
|
|
|
}
|
|
|
|