diff --git a/AlfrescoApp/App Delegate/AppDelegate.m b/AlfrescoApp/App Delegate/AppDelegate.m index f93ebc256..adc789cc5 100644 --- a/AlfrescoApp/App Delegate/AppDelegate.m +++ b/AlfrescoApp/App Delegate/AppDelegate.m @@ -39,6 +39,8 @@ #import +@import MediaPlayer; + static NSString * const kMDMMissingRequiredKeysKey = @"MDMMissingKeysKey"; @interface AppDelegate() @@ -208,8 +210,11 @@ - (void)applicationWillResignActive:(UIApplication *)application [[AccountManager sharedManager] saveAccountsToKeychain]; } - --(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000 +- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window +#else +- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window +#endif { // default is to support all orientations UIInterfaceOrientationMask supportedOrientations = UIInterfaceOrientationMaskAll; @@ -233,6 +238,12 @@ -(UIInterfaceOrientationMask)application:(UIApplication *)application supportedI supportedOrientations = [presentedController supportedInterfaceOrientations]; } } + else if ([modalViewController isKindOfClass:[MPMoviePlayerViewController class]]) + { + MPMoviePlaybackState playbackState = [(MPMoviePlayerViewController *)modalViewController moviePlayer].playbackState; + + supportedOrientations = (playbackState == MPMoviePlaybackStateStopped || playbackState == MPMoviePlaybackStatePaused) ? supportedOrientations : UIInterfaceOrientationMaskAllButUpsideDown; + } else { if ([modalViewController conformsToProtocol:@protocol(ModalRotation)]) diff --git a/AlfrescoApp/Model/Managers/AppConfigurationManager.m b/AlfrescoApp/Model/Managers/AppConfigurationManager.m index df161c021..a9d33f619 100644 --- a/AlfrescoApp/Model/Managers/AppConfigurationManager.m +++ b/AlfrescoApp/Model/Managers/AppConfigurationManager.m @@ -71,7 +71,7 @@ - (id)init self.embeddedConfigService = [[AlfrescoConfigService alloc] initWithDictionary:parameters]; self.noAccountConfigService = [[AlfrescoConfigService alloc] initWithDictionary:noAccountParameters]; - if([AccountManager sharedManager].allAccounts.count > 0) + if(([AccountManager sharedManager].allAccounts.count > 0) || ([AccountManager sharedManager].selectedAccount != nil)) { self.currentConfigService = self.embeddedConfigService; } @@ -211,7 +211,6 @@ - (AlfrescoConfigService *)configurationServiceForAccount:(UserAccount *)account NSDictionary *parameters = @{kAlfrescoConfigServiceParameterFolder: accountConfigurationFolderPath, kAlfrescoConfigServiceParameterFileName: kAlfrescoEmbeddedConfigurationFileName}; returnService = [[AlfrescoConfigService alloc] initWithDictionary:parameters]; - returnService.session = self.session; } else { @@ -267,11 +266,34 @@ - (void)sessionReceived:(NSNotification *)notification { id session = notification.object; self.session = session; + + self.currentConfigService = [self configurationServiceForAccount:[AccountManager sharedManager].selectedAccount]; + self.currentConfigService.session = session; [self.currentConfigService retrieveDefaultProfileWithCompletionBlock:^(AlfrescoProfileConfig *defaultProfile, NSError *defaultProfileError) { if (defaultProfileError) { AlfrescoLogError(@"Error retrieving the default profile. Error: %@", defaultProfileError.localizedDescription); + + if (defaultProfileError.code == kAlfrescoErrorCodeRequestedNodeNotFound) // The requested node wasn't found + { + // If the node is not found on the server, delete configuration.json from user's folder. + UserAccount *account = [AccountManager sharedManager].selectedAccount; + NSString *accountSpecificFolderPath = [self accountSpecificConfigurationFolderPath:account]; + accountSpecificFolderPath = [accountSpecificFolderPath stringByAppendingPathComponent:kAlfrescoEmbeddedConfigurationFileName]; + + if ([[NSFileManager defaultManager] fileExistsAtPath:accountSpecificFolderPath]) + { + NSError *removeConfigurationError; + BOOL fileRemovedSuccessfully = [[NSFileManager defaultManager] removeItemAtPath:accountSpecificFolderPath error:&removeConfigurationError]; + + if (fileRemovedSuccessfully) + { + MainMenuLocalConfigurationBuilder *localBuilder = [[MainMenuLocalConfigurationBuilder alloc] initWithAccount:account session:session]; + [[NSNotificationCenter defaultCenter] postNotificationName:kAlfrescoConfigFileDidUpdateNotification object:localBuilder userInfo:@{kAppConfigurationUserCanEditMainMenuKey : @YES}]; + } + } + } } else { @@ -297,15 +319,23 @@ - (void)sessionReceived:(NSNotification *)notification // Attempt to download and select the default profile AlfrescoConfigService *configService = [[AlfrescoConfigService alloc] initWithSession:session]; // define a success block - void (^profileSuccessfullySelectedBlock)(AlfrescoProfileConfig *profile) = ^(AlfrescoProfileConfig *selectedProfile) { + void (^profileSuccessfullySelectedBlock)(AlfrescoProfileConfig *profile, BOOL isEmbeddedConfig) = ^(AlfrescoProfileConfig *selectedProfile, BOOL isEmbeddedConfig) { self.currentConfigService = configService; self.selectedProfile = selectedProfile; self.currentConfigAccountIdentifier = account.accountIdentifier; account.selectedProfileIdentifier = selectedProfile.identifier; account.selectedProfileName = selectedProfile.label; - MainMenuRemoteConfigurationBuilder *remoteBuilder = [[MainMenuRemoteConfigurationBuilder alloc] initWithAccount:account session:session]; - [[NSNotificationCenter defaultCenter] postNotificationName:kAlfrescoConfigFileDidUpdateNotification object:remoteBuilder userInfo:@{kAppConfigurationUserCanEditMainMenuKey : @NO}]; + MainMenuConfigurationBuilder *builder; + if(isEmbeddedConfig) + { + builder = [[MainMenuLocalConfigurationBuilder alloc] initWithAccount:account session:session]; + } + else + { + builder = [[MainMenuRemoteConfigurationBuilder alloc] initWithAccount:account session:session]; + } + [[NSNotificationCenter defaultCenter] postNotificationName:kAlfrescoConfigFileDidUpdateNotification object:builder userInfo:@{kAppConfigurationUserCanEditMainMenuKey : [NSNumber numberWithBool:isEmbeddedConfig]}]; }; NSString *selectedProfileIdentifier = account.selectedProfileIdentifier; @@ -332,20 +362,20 @@ - (void)sessionReceived:(NSNotification *)notification } else { - profileSuccessfullySelectedBlock(defaultProfile); + profileSuccessfullySelectedBlock(defaultProfile, YES); } }]; } } else { - profileSuccessfullySelectedBlock(defaultServerProfile); + profileSuccessfullySelectedBlock(defaultServerProfile, NO); } }]; } else { - profileSuccessfullySelectedBlock(identifierProfile); + profileSuccessfullySelectedBlock(identifierProfile, NO); } }]; } @@ -368,14 +398,14 @@ - (void)sessionReceived:(NSNotification *)notification } else { - profileSuccessfullySelectedBlock(defaultProfile); + profileSuccessfullySelectedBlock(defaultProfile, YES); } }]; } } else { - profileSuccessfullySelectedBlock(defaultServerProfile); + profileSuccessfullySelectedBlock(defaultServerProfile, NO); } }]; } @@ -402,6 +432,7 @@ - (void)accountRemoved:(NSNotification *)notification - (void)noMoreAccounts:(NSNotification *)notification { self.currentConfigService = self.noAccountConfigService; + [AppConfigurationManager resetInstanceAndReturnManager]; [[NSNotificationCenter defaultCenter] postNotificationName:kAlfrescoConfigFileDidUpdateNotification object:nil userInfo:nil]; } @@ -449,11 +480,13 @@ - (void)setupConfigurationFileFromBundleIfRequiredWithCompletionBlock:(void (^)( AlfrescoFileManager *fileManager = [AlfrescoFileManager sharedManager]; // File location to the configuration file - NSString *completeDestinationPath = ([AccountManager sharedManager].allAccounts.count > 0) ? [self filePathForEmbeddedConfigurationFile] : [self filePathForNoAccountsConfigurationFile]; + BOOL areThereAccounts = ([AccountManager sharedManager].allAccounts.count > 0) || ([AccountManager sharedManager].selectedAccount != nil); + + NSString *completeDestinationPath = areThereAccounts ? [self filePathForEmbeddedConfigurationFile] : [self filePathForNoAccountsConfigurationFile]; if (![fileManager fileExistsAtPath:completeDestinationPath]) { - NSString *configFileName = ([AccountManager sharedManager].allAccounts.count > 0) ? kAlfrescoEmbeddedConfigurationFileName : kAlfrescoNoAccountConfigurationFileName; + NSString *configFileName = areThereAccounts ? kAlfrescoEmbeddedConfigurationFileName : kAlfrescoNoAccountConfigurationFileName; NSString *fileLocationInBundle = [[NSBundle mainBundle] pathForResource:configFileName.stringByDeletingPathExtension ofType:configFileName.pathExtension]; NSError *copyError = nil; diff --git a/AlfrescoApp/Model/Managers/SyncHelper.m b/AlfrescoApp/Model/Managers/SyncHelper.m index 68297a496..85b90ca03 100644 --- a/AlfrescoApp/Model/Managers/SyncHelper.m +++ b/AlfrescoApp/Model/Managers/SyncHelper.m @@ -84,9 +84,7 @@ - (void)updateLocalSyncInfoWithRemoteInfo:(NSDictionary *)syncNodesInfo } } [self.syncCoreDataHelper saveContextForManagedObjectContext:managedContext]; - [managedContext performBlock:^{ - [managedContext reset]; - }]; + [managedContext reset]; } } diff --git a/AlfrescoApp/Model/Managers/SyncManager.m b/AlfrescoApp/Model/Managers/SyncManager.m index 5eabf640d..252cb875f 100644 --- a/AlfrescoApp/Model/Managers/SyncManager.m +++ b/AlfrescoApp/Model/Managers/SyncManager.m @@ -579,9 +579,7 @@ - (void)syncNodes:(NSArray *)nodes includeExistingSyncNodes:(BOOL)includeExistin { [self deleteUnWantedSyncedNodes:nodes inManagedObjectContext:privateManagedObjectContext completionBlock:^(BOOL completed) { [self.syncCoreDataHelper saveContextForManagedObjectContext:privateManagedObjectContext]; - [privateManagedObjectContext performBlock:^{ - [privateManagedObjectContext reset]; - }]; + [privateManagedObjectContext reset]; syncInfoandContent(); }]; } @@ -663,30 +661,32 @@ - (void)deleteUnWantedSyncedNodes:(NSArray *)nodes inManagedObjectContext:(NSMan AlfrescoNode *localNode = [NSKeyedUnarchiver unarchiveObjectWithData:nodeInfo.node]; // check if there is any problem with removing the node from local sync - [self checkForObstaclesInRemovingDownloadForNode:localNode inManagedObjectContext:managedContext completionBlock:^(BOOL encounteredObstacle) { - - totalChecksForObstacles--; - - if (encounteredObstacle == NO) - { - // if no problem with removing the node from local sync then delete the node from local sync nodes - [self.syncHelper deleteNodeFromSync:localNode inAccountWithId:self.selectedAccountIdentifier inManagedObjectContext:managedContext]; - } - else - { - // if any problem encountered then set isRemovedFromSyncHasLocalChanges flag to YES so its not on deleted until its changes are synced to server - nodeInfo.isRemovedFromSyncHasLocalChanges = [NSNumber numberWithBool:YES]; - nodeInfo.parentNode = nil; - } - - if (totalChecksForObstacles == 0) - { - if (completionBlock != NULL) + dispatch_async(dispatch_get_main_queue(), ^{ + [self checkForObstaclesInRemovingDownloadForNode:localNode inManagedObjectContext:managedContext completionBlock:^(BOOL encounteredObstacle) { + + totalChecksForObstacles--; + + if (encounteredObstacle == NO) { - completionBlock(YES); + // if no problem with removing the node from local sync then delete the node from local sync nodes + [self.syncHelper deleteNodeFromSync:localNode inAccountWithId:self.selectedAccountIdentifier inManagedObjectContext:managedContext]; } - } - }]; + else + { + // if any problem encountered then set isRemovedFromSyncHasLocalChanges flag to YES so its not on deleted until its changes are synced to server + nodeInfo.isRemovedFromSyncHasLocalChanges = [NSNumber numberWithBool:YES]; + nodeInfo.parentNode = nil; + } + + if (totalChecksForObstacles == 0) + { + if (completionBlock != NULL) + { + completionBlock(YES); + } + } + }]; + }); } } else @@ -1231,7 +1231,6 @@ - (void)updateSessionIfNeeded:(id)session } } - - (void)cancelSyncForDocumentWithIdentifier:(NSString *)documentIdentifier { [self cancelSyncForDocumentWithIdentifier:documentIdentifier inAccountWithId:self.selectedAccountIdentifier]; @@ -1483,6 +1482,7 @@ - (void)updateFolderSizes:(BOOL)updateFolderSizes andCheckIfAnyFileModifiedLocal } } } + [privateManagedObjectContext reset]; privateManagedObjectContext = nil; } } @@ -1501,26 +1501,24 @@ - (void)statusChanged:(NSNotification *)notification if ([propertyChanged isEqualToString:kSyncTotalSize]) { SyncNodeInfo *nodeInfo = [self.syncCoreDataHelper nodeInfoForObjectWithNodeId:nodeStatus.nodeId inAccountWithId:self.selectedAccountIdentifier inManagedObjectContext:privateManagedObjectContext]; + SyncNodeInfo *parentNodeInfo = nodeInfo.parentNode; - if(nodeInfo) + if (parentNodeInfo) { - if (parentNodeInfo) + AlfrescoNode *parentNode = [NSKeyedUnarchiver unarchiveObjectWithData:parentNodeInfo.node]; + SyncNodeStatus *parentNodeStatus = [self syncStatusForNodeWithId:[self.syncHelper syncIdentifierForNode:parentNode]]; + + NSDictionary *change = [info objectForKey:kSyncStatusChangeKey]; + parentNodeStatus.totalSize += nodeStatus.totalSize - [[change valueForKey:NSKeyValueChangeOldKey] longLongValue]; + } + else + { + // if parent folder is nil - update total size for account + SyncNodeStatus *accountSyncStatus = [self.syncHelper syncNodeStatusObjectForNodeWithId:self.selectedAccountIdentifier inSyncNodesStatus:self.syncNodesStatus]; + if (nodeStatus != accountSyncStatus) { - AlfrescoNode *parentNode = [NSKeyedUnarchiver unarchiveObjectWithData:parentNodeInfo.node]; - SyncNodeStatus *parentNodeStatus = [self syncStatusForNodeWithId:[self.syncHelper syncIdentifierForNode:parentNode]]; - NSDictionary *change = [info objectForKey:kSyncStatusChangeKey]; - parentNodeStatus.totalSize += nodeStatus.totalSize - [[change valueForKey:NSKeyValueChangeOldKey] longLongValue]; - } - else - { - // if parent folder is nil - update total size for account - SyncNodeStatus *accountSyncStatus = [self.syncHelper syncNodeStatusObjectForNodeWithId:self.selectedAccountIdentifier inSyncNodesStatus:self.syncNodesStatus]; - if (nodeStatus != accountSyncStatus) - { - NSDictionary *change = [info objectForKey:kSyncStatusChangeKey]; - accountSyncStatus.totalSize += nodeStatus.totalSize - [[change valueForKey:NSKeyValueChangeOldKey] longLongValue]; - } + accountSyncStatus.totalSize += nodeStatus.totalSize - [[change valueForKey:NSKeyValueChangeOldKey] longLongValue]; } } } @@ -1566,6 +1564,7 @@ - (void)statusChanged:(NSNotification *)notification } } + [privateManagedObjectContext reset]; privateManagedObjectContext = nil; } diff --git a/AlfrescoApp/View Controllers/Accounts View Controllers/New Account/AccountInfoDetailsViewController.m b/AlfrescoApp/View Controllers/Accounts View Controllers/New Account/AccountInfoDetailsViewController.m index de98372d6..67580cee9 100644 --- a/AlfrescoApp/View Controllers/Accounts View Controllers/New Account/AccountInfoDetailsViewController.m +++ b/AlfrescoApp/View Controllers/Accounts View Controllers/New Account/AccountInfoDetailsViewController.m @@ -105,6 +105,15 @@ - (void)viewWillAppear:(BOOL)animated - (void)constructTableCellsForAlfrescoServer { + TextFieldCell *descriptionCell = (TextFieldCell *)[[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([TextFieldCell class]) owner:self options:nil] lastObject]; + descriptionCell.selectionStyle = UITableViewCellSelectionStyleNone; + descriptionCell.titleLabel.text = NSLocalizedString(@"accountdetails.fields.description", @"Description Cell Text"); + descriptionCell.valueTextField.placeholder = NSLocalizedString(@"accountdetails.placeholder.required", @"required"); + descriptionCell.valueTextField.returnKeyType = UIReturnKeyNext; + descriptionCell.valueTextField.delegate = self; + self.descriptionTextField = descriptionCell.valueTextField; + self.descriptionTextField.text = self.formBackupAccount.accountDescription; + TextFieldCell *usernameCell = (TextFieldCell *)[[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([TextFieldCell class]) owner:self options:nil] lastObject]; usernameCell.selectionStyle = UITableViewCellSelectionStyleNone; usernameCell.titleLabel.text = NSLocalizedString(@"login.username.cell.label", @"Username Cell Text"); @@ -178,10 +187,11 @@ - (void)constructTableCellsForAlfrescoServer control.alpha = self.canEditAccounts ? 1.0f : 0.3f; } - self.tableViewData = [NSMutableArray arrayWithArray:@[ @[usernameCell, passwordCell, serverAddressCell, protocolCell], - @[portCell, serviceDocumentCell, certificateCell]]]; - self.tableGroupHeaders = @[@"",@"accountdetails.header.advanced"]; - self.tableGroupFooters = @[@"",@""]; + self.tableViewData = [NSMutableArray arrayWithArray:@[ @[descriptionCell], + @[usernameCell, passwordCell, serverAddressCell, protocolCell], + @[portCell, serviceDocumentCell, certificateCell]]]; + self.tableGroupHeaders = @[@"",@"accountdetails.header.authentication", @"accountdetails.header.advanced"]; + self.tableGroupFooters = @[@"", @"",@""]; } #pragma mark - TableView Datasource @@ -263,7 +273,11 @@ - (BOOL)textFieldShouldReturn:(UITextField *)textField { self.saveButton.enabled = [self validateAccountFieldsValuesForServer]; - if (textField == self.usernameTextField) + if (textField == self.descriptionTextField) + { + [self.usernameTextField becomeFirstResponder]; + } + else if (textField == self.usernameTextField) { [self.passwordTextField becomeFirstResponder]; } @@ -272,10 +286,6 @@ - (BOOL)textFieldShouldReturn:(UITextField *)textField [self.serverAddressTextField becomeFirstResponder]; } else if (textField == self.serverAddressTextField) - { - [self.descriptionTextField becomeFirstResponder]; - } - else if (textField == self.descriptionTextField) { [self.portTextField becomeFirstResponder]; } @@ -373,6 +383,7 @@ - (BOOL)validateAccountFieldsValuesForServer if (self.account.accountType == UserAccountTypeOnPremise) { // User input validations + NSString *descriptionString = [self.descriptionTextField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; NSString *hostname = self.serverAddressTextField.text; NSString *port = [self.portTextField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; NSString *username = [self.usernameTextField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; @@ -381,16 +392,21 @@ - (BOOL)validateAccountFieldsValuesForServer NSRange hostnameRange = [hostname rangeOfString:@"^[a-zA-Z0-9_\\-\\.]+$" options:NSRegularExpressionSearch]; + BOOL descriptionError = descriptionString.length == 0; BOOL hostnameError = ( !hostname || (hostnameRange.location == NSNotFound) ); BOOL portIsInvalid = ([port rangeOfString:@"^[0-9]*$" options:NSRegularExpressionSearch].location == NSNotFound); BOOL usernameError = username.length == 0; BOOL passwordError = password.length == 0; BOOL serviceDocError = serviceDoc.length == 0; - didChangeAndIsValid = !hostnameError && !portIsInvalid && !usernameError && !passwordError && !serviceDocError; + didChangeAndIsValid = !descriptionError && !hostnameError && !portIsInvalid && !usernameError && !passwordError && !serviceDocError; if (didChangeAndIsValid) { + if ([self.formBackupAccount.accountDescription isEqualToString:self.descriptionTextField.text] == NO) + { + hasAccountPropertiesChanged = YES; + } if (![self.formBackupAccount.username isEqualToString:self.usernameTextField.text]) { hasAccountPropertiesChanged = YES; @@ -447,10 +463,13 @@ - (void)saveButtonClicked:(id)sender if (successful) { AccountManager *accountManager = [AccountManager sharedManager]; - - [[NSNotificationCenter defaultCenter] postNotificationName:kAlfrescoSessionReceivedNotification object:session userInfo:nil]; [accountManager saveAccountsToKeychain]; - [[NSNotificationCenter defaultCenter] postNotificationName:kAlfrescoAccountUpdatedNotification object:self.account]; + + if(self.account == accountManager.selectedAccount) + { + [[NSNotificationCenter defaultCenter] postNotificationName:kAlfrescoSessionReceivedNotification object:session userInfo:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:kAlfrescoAccountUpdatedNotification object:self.account]; + } [self.navigationController popViewControllerAnimated:YES]; } }]; @@ -478,10 +497,10 @@ - (void)cancel:(id)sender if([self validateAccountFieldsValuesForServer]) { UIAlertController *confirmAlert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"action.confirmation.back.title", @"Unsaved changes") message:NSLocalizedString(@"action.confirmation.back.message", @"Save changes?") preferredStyle:UIAlertControllerStyleAlert]; - [confirmAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"document.edit.button.discard", @"Discard") style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { + [confirmAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"document.edit.button.discard", @"Discard") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { [self.navigationController popViewControllerAnimated:YES]; }]]; - [confirmAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"document.edit.button.save", @"Save") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + [confirmAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"document.edit.button.save", @"Save") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { [self saveButtonClicked:sender]; }]]; diff --git a/AlfrescoApp/View Controllers/Accounts View Controllers/New Account/AccountInfoViewController.m b/AlfrescoApp/View Controllers/Accounts View Controllers/New Account/AccountInfoViewController.m index 3be994172..7b7deb431 100644 --- a/AlfrescoApp/View Controllers/Accounts View Controllers/New Account/AccountInfoViewController.m +++ b/AlfrescoApp/View Controllers/Accounts View Controllers/New Account/AccountInfoViewController.m @@ -346,7 +346,7 @@ - (void)constructTableCellsForAlfrescoServer accountDetailsCell.selectionStyle = UITableViewCellSelectionStyleDefault; accountDetailsCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; accountDetailsCell.tag = kTagAccountDetailsCell; - accountDetailsCell.titleLabel.text = self.account.accountDescription; + accountDetailsCell.titleLabel.text = self.formBackupAccount.accountDescription; accountDetailsCell.valueLabel.text = self.formBackupAccount.username; accountDetailsCell.valueLabel.textColor = [UIColor lightGrayColor]; @@ -580,6 +580,11 @@ - (void)accountInfoChanged:(UserAccount *)newAccount { self.hasChangedAccountDetails = YES; self.formBackupAccount = [newAccount copy]; + + self.title = self.formBackupAccount.accountDescription; + [self constructTableCellsForAlfrescoServer]; + [self.tableView reloadData]; + } #pragma mark - UITextFieldDelegate Functions diff --git a/AlfrescoApp/View Controllers/Document Preview View Controller/DocumentPreviewViewController.m b/AlfrescoApp/View Controllers/Document Preview View Controller/DocumentPreviewViewController.m index 7429cc822..c59e2d296 100644 --- a/AlfrescoApp/View Controllers/Document Preview View Controller/DocumentPreviewViewController.m +++ b/AlfrescoApp/View Controllers/Document Preview View Controller/DocumentPreviewViewController.m @@ -75,7 +75,11 @@ - (void)dealloc [[NSNotificationCenter defaultCenter] removeObserver:self]; } --(UIInterfaceOrientationMask)supportedInterfaceOrientations +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000 +- (UIInterfaceOrientationMask)supportedInterfaceOrientations +#else +- (NSUInteger)supportedInterfaceOrientations +#endif { if (!IS_IPAD) { diff --git a/AlfrescoApp/View Controllers/Downloads View Controller/DownloadsViewController.m b/AlfrescoApp/View Controllers/Downloads View Controller/DownloadsViewController.m index 99dfda5b2..9c22806ac 100644 --- a/AlfrescoApp/View Controllers/Downloads View Controller/DownloadsViewController.m +++ b/AlfrescoApp/View Controllers/Downloads View Controller/DownloadsViewController.m @@ -321,10 +321,10 @@ - (void)confirmDeletingMultipleNodes UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleAlert]; - [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"multiselect.button.delete", @"Delete") style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) { + [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"multiselect.button.delete", @"Delete") style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) { [self deleteMultiSelectedNodes]; }]]; - [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { }]]; + [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { }]]; alertController.modalPresentationStyle = UIModalPresentationPopover; diff --git a/AlfrescoApp/View Controllers/FileFolder View Controller/FileFolderCollectionViewController.m b/AlfrescoApp/View Controllers/FileFolder View Controller/FileFolderCollectionViewController.m index 193dd3439..f27ec7b08 100644 --- a/AlfrescoApp/View Controllers/FileFolder View Controller/FileFolderCollectionViewController.m +++ b/AlfrescoApp/View Controllers/FileFolder View Controller/FileFolderCollectionViewController.m @@ -570,7 +570,7 @@ - (void)displayActionSheet:(id)sender event:(UIEvent *)event - (UIAlertAction *)alertActionCancel { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { if ([[LocationManager sharedManager] isTrackingLocation]) { [[LocationManager sharedManager] stopLocationUpdates]; @@ -580,7 +580,7 @@ - (UIAlertAction *)alertActionCancel - (UIAlertAction *)alertActionCreateFile { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.createfile", @"Create File") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.createfile", @"Create File") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { TextFileViewController *textFileViewController = [[TextFileViewController alloc] initWithUploadFileDestinationFolder:self.displayFolder session:self.session delegate:self]; NavigationViewController *textFileViewNavigationController = [[NavigationViewController alloc] initWithRootViewController:textFileViewController]; [UniversalDevice displayModalViewController:textFileViewNavigationController onController:[UniversalDevice revealViewController] withCompletionBlock:nil]; @@ -589,17 +589,17 @@ - (UIAlertAction *)alertActionCreateFile - (UIAlertAction *)alertActionAddFolder { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.addfolder", @"Create Folder") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.addfolder", @"Create Folder") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { // Display the create folder UIAlertController UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"browser.alertview.addfolder.title", @"Create Folder Title") message:NSLocalizedString(@"browser.alertview.addfolder.message", @"Create Folder Message") preferredStyle:UIAlertControllerStyleAlert]; - [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) { }]; + [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) { }]; [alertController addAction:[self alertActionCancel]]; - [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"browser.alertview.addfolder.create", @"Create Folder") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { - NSString *desiredFolderName = [alertController.textFields[0].text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"browser.alertview.addfolder.create", @"Create Folder") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { + NSString *desiredFolderName = [[alertController.textFields[0] text] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; if ([Utility isValidFolderName:desiredFolderName]) { @@ -633,7 +633,7 @@ - (UIAlertAction *)alertActionAddFolder - (UIAlertAction *)alertActionUpload { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload", @"Upload") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload", @"Upload") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { // Upload type UIAlertController UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; [alertController addAction:[self alertActionUploadExistingPhotos]]; @@ -650,7 +650,7 @@ - (UIAlertAction *)alertActionUpload - (UIAlertAction *)alertActionUploadExistingPhotos { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload.existingPhotos", @"Choose Photo Library") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload.existingPhotos", @"Choose Photo Library") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { self.imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; self.imagePickerController.mediaTypes = @[(NSString *)kUTTypeImage]; self.imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext; @@ -660,7 +660,7 @@ - (UIAlertAction *)alertActionUploadExistingPhotos - (UIAlertAction *)alertActionUploadExistingPhotosOrVideos { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload.existingPhotosOrVideos", @"Choose Photo or Video from Library") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload.existingPhotosOrVideos", @"Choose Photo or Video from Library") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { self.imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; self.imagePickerController.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:self.imagePickerController.sourceType]; self.imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext; @@ -670,7 +670,7 @@ - (UIAlertAction *)alertActionUploadExistingPhotosOrVideos - (UIAlertAction *)alertActionUploadDocument { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload.documents", @"Upload Document") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload.documents", @"Upload Document") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { DownloadsViewController *downloadPicker = [[DownloadsViewController alloc] init]; downloadPicker.isDownloadPickerEnabled = YES; downloadPicker.downloadPickerDelegate = self; @@ -683,7 +683,7 @@ - (UIAlertAction *)alertActionUploadDocument - (UIAlertAction *)alertActionTakePhoto { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.takephoto", @"Take Photo") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.takephoto", @"Take Photo") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { // Start location services [[LocationManager sharedManager] startLocationUpdates]; @@ -696,7 +696,7 @@ - (UIAlertAction *)alertActionTakePhoto - (UIAlertAction *)alertActionTakePhotoOrVideo { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.takephotovideo", @"Take Photo or Video") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.takephotovideo", @"Take Photo or Video") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { // Start location services [[LocationManager sharedManager] startLocationUpdates]; @@ -709,7 +709,7 @@ - (UIAlertAction *)alertActionTakePhotoOrVideo - (UIAlertAction *)alertActionRecordAudio { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.record.audio", @"Record Audio") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.record.audio", @"Record Audio") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { UploadFormViewController *audioRecorderViewController = [[UploadFormViewController alloc] initWithSession:self.session createAndUploadAudioToFolder:self.displayFolder delegate:self]; NavigationViewController *audioRecorderNavigationController = [[NavigationViewController alloc] initWithRootViewController:audioRecorderViewController]; [UniversalDevice displayModalViewController:audioRecorderNavigationController onController:self.navigationController withCompletionBlock:nil]; @@ -1217,7 +1217,7 @@ - (void)confirmDeletingMultipleNodes UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleActionSheet]; - [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"multiselect.button.delete", @"Delete") style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) { + [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"multiselect.button.delete", @"Delete") style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) { [self deleteMultiSelectedNodes]; }]]; diff --git a/AlfrescoApp/View Controllers/FileFolder View Controller/FileFolderListViewController.m b/AlfrescoApp/View Controllers/FileFolder View Controller/FileFolderListViewController.m index 7d516cd4a..bb89e534a 100644 --- a/AlfrescoApp/View Controllers/FileFolder View Controller/FileFolderListViewController.m +++ b/AlfrescoApp/View Controllers/FileFolder View Controller/FileFolderListViewController.m @@ -368,7 +368,7 @@ - (void)displayActionSheet:(id)sender event:(UIEvent *)event - (UIAlertAction *)alertActionCancel { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { if ([[LocationManager sharedManager] isTrackingLocation]) { [[LocationManager sharedManager] stopLocationUpdates]; @@ -378,7 +378,7 @@ - (UIAlertAction *)alertActionCancel - (UIAlertAction *)alertActionCreateFile { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.createfile", @"Create File") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.createfile", @"Create File") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { TextFileViewController *textFileViewController = [[TextFileViewController alloc] initWithUploadFileDestinationFolder:self.displayFolder session:self.session delegate:self]; NavigationViewController *textFileViewNavigationController = [[NavigationViewController alloc] initWithRootViewController:textFileViewController]; [UniversalDevice displayModalViewController:textFileViewNavigationController onController:[UniversalDevice revealViewController] withCompletionBlock:nil]; @@ -387,17 +387,17 @@ - (UIAlertAction *)alertActionCreateFile - (UIAlertAction *)alertActionAddFolder { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.addfolder", @"Create Folder") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.addfolder", @"Create Folder") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { // Display the create folder UIAlertController UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"browser.alertview.addfolder.title", @"Create Folder Title") message:NSLocalizedString(@"browser.alertview.addfolder.message", @"Create Folder Message") preferredStyle:UIAlertControllerStyleAlert]; - [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) { }]; + [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) { }]; [alertController addAction:[self alertActionCancel]]; - [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"browser.alertview.addfolder.create", @"Create Folder") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { - NSString *desiredFolderName = [alertController.textFields[0].text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"browser.alertview.addfolder.create", @"Create Folder") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { + NSString *desiredFolderName = [[alertController.textFields[0] text] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; if ([Utility isValidFolderName:desiredFolderName]) { @@ -425,7 +425,7 @@ - (UIAlertAction *)alertActionAddFolder - (UIAlertAction *)alertActionUpload { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload", @"Upload") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload", @"Upload") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { // Upload type UIAlertController UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; [alertController addAction:[self alertActionUploadExistingPhotos]]; @@ -442,7 +442,7 @@ - (UIAlertAction *)alertActionUpload - (UIAlertAction *)alertActionUploadExistingPhotos { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload.existingPhotos", @"Choose Photo Library") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload.existingPhotos", @"Choose Photo Library") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { self.imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; self.imagePickerController.mediaTypes = @[(NSString *)kUTTypeImage]; self.imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext; @@ -452,7 +452,7 @@ - (UIAlertAction *)alertActionUploadExistingPhotos - (UIAlertAction *)alertActionUploadExistingPhotosOrVideos { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload.existingPhotosOrVideos", @"Choose Photo or Video from Library") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload.existingPhotosOrVideos", @"Choose Photo or Video from Library") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { self.imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; self.imagePickerController.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:self.imagePickerController.sourceType]; self.imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext; @@ -462,7 +462,7 @@ - (UIAlertAction *)alertActionUploadExistingPhotosOrVideos - (UIAlertAction *)alertActionUploadDocument { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload.documents", @"Upload Document") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.upload.documents", @"Upload Document") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { DownloadsViewController *downloadPicker = [[DownloadsViewController alloc] init]; downloadPicker.isDownloadPickerEnabled = YES; downloadPicker.downloadPickerDelegate = self; @@ -475,7 +475,7 @@ - (UIAlertAction *)alertActionUploadDocument - (UIAlertAction *)alertActionTakePhoto { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.takephoto", @"Take Photo") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.takephoto", @"Take Photo") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { // start location services [[LocationManager sharedManager] startLocationUpdates]; @@ -488,7 +488,7 @@ - (UIAlertAction *)alertActionTakePhoto - (UIAlertAction *)alertActionTakePhotoOrVideo { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.takephotovideo", @"Take Photo or Video") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.takephotovideo", @"Take Photo or Video") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { // start location services [[LocationManager sharedManager] startLocationUpdates]; @@ -501,7 +501,7 @@ - (UIAlertAction *)alertActionTakePhotoOrVideo - (UIAlertAction *)alertActionRecordAudio { - return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.record.audio", @"Record Audio") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:NSLocalizedString(@"browser.actionsheet.record.audio", @"Record Audio") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { UploadFormViewController *audioRecorderViewController = [[UploadFormViewController alloc] initWithSession:self.session createAndUploadAudioToFolder:self.displayFolder delegate:self]; NavigationViewController *audioRecorderNavigationController = [[NavigationViewController alloc] initWithRootViewController:audioRecorderViewController]; [UniversalDevice displayModalViewController:audioRecorderNavigationController onController:self.navigationController withCompletionBlock:nil]; @@ -781,7 +781,7 @@ - (void)confirmDeletingMultipleNodes UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleAlert]; - [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"multiselect.button.delete", @"Delete") style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) { + [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"multiselect.button.delete", @"Delete") style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) { [self deleteMultiSelectedNodes]; }]]; [alertController addAction:[self alertActionCancel]]; diff --git a/AlfrescoApp/View Controllers/Main Menu Reorder View Controller/MainMenuReorderViewController.m b/AlfrescoApp/View Controllers/Main Menu Reorder View Controller/MainMenuReorderViewController.m index 9c1087eab..b9a48a121 100644 --- a/AlfrescoApp/View Controllers/Main Menu Reorder View Controller/MainMenuReorderViewController.m +++ b/AlfrescoApp/View Controllers/Main Menu Reorder View Controller/MainMenuReorderViewController.m @@ -107,6 +107,10 @@ - (void)viewDidDisappear:(BOOL)animated // Only need to post a notifictaion informing the app if the current account order has been modified if ([AccountManager sharedManager].selectedAccount == self.account) + { + [[NSNotificationCenter defaultCenter] postNotificationName:kAlfrescoConfigShouldUpdateMainMenuNotification object:self.mainMenuBuilder]; + } + else { [[NSNotificationCenter defaultCenter] postNotificationName:kAlfrescoConfigFileDidUpdateNotification object:self.mainMenuBuilder]; } diff --git a/AlfrescoApp/View Controllers/Main Menu View Controller/Cell/MainMenuTableViewCell.xib b/AlfrescoApp/View Controllers/Main Menu View Controller/Cell/MainMenuTableViewCell.xib index 2b02fe015..856fff99a 100644 --- a/AlfrescoApp/View Controllers/Main Menu View Controller/Cell/MainMenuTableViewCell.xib +++ b/AlfrescoApp/View Controllers/Main Menu View Controller/Cell/MainMenuTableViewCell.xib @@ -1,8 +1,7 @@ - + - - + @@ -16,7 +15,8 @@ - + + @@ -24,21 +24,24 @@ - + + @@ -52,9 +55,10 @@ + - + @@ -62,6 +66,7 @@ + diff --git a/AlfrescoApp/View Controllers/Person Profile View Controller/PersonProfileViewController.m b/AlfrescoApp/View Controllers/Person Profile View Controller/PersonProfileViewController.m index 459afa333..bec004c60 100644 --- a/AlfrescoApp/View Controllers/Person Profile View Controller/PersonProfileViewController.m +++ b/AlfrescoApp/View Controllers/Person Profile View Controller/PersonProfileViewController.m @@ -296,7 +296,7 @@ - (NSArray *)availableUserContactInformationFromPerson:(AlfrescoPerson *)person NSMutableArray *contactDetails = [NSMutableArray array]; ContactInformation *contactInformation = nil; - if (person.email.length == 0) + if (person.email.length != 0) { contactInformation = [[ContactInformation alloc] initWithTitleText:NSLocalizedString(@"person.profile.view.controller.contact.information.type.email.title", @"Email") contactInformation:person.email @@ -305,7 +305,7 @@ - (NSArray *)availableUserContactInformationFromPerson:(AlfrescoPerson *)person [contactDetails addObject:contactInformation]; } - if (person.skypeId.length == 0) + if (person.skypeId.length != 0) { contactInformation = [[ContactInformation alloc] initWithTitleText:NSLocalizedString(@"person.profile.view.controller.contact.information.type.skype.title", @"Skype") contactInformation:person.skypeId @@ -314,7 +314,7 @@ - (NSArray *)availableUserContactInformationFromPerson:(AlfrescoPerson *)person [contactDetails addObject:contactInformation]; } - if (person.telephoneNumber.length == 0) + if (person.telephoneNumber.length != 0) { contactInformation = [[ContactInformation alloc] initWithTitleText:NSLocalizedString(@"person.profile.view.controller.contact.information.type.telephone.title", @"Telephone") contactInformation:person.telephoneNumber @@ -323,7 +323,7 @@ - (NSArray *)availableUserContactInformationFromPerson:(AlfrescoPerson *)person [contactDetails addObject:contactInformation]; } - if (person.mobileNumber.length == 0) + if (person.mobileNumber.length != 0) { contactInformation = [[ContactInformation alloc] initWithTitleText:NSLocalizedString(@"person.profile.view.controller.contact.information.type.mobile.title", @"Mobile") contactInformation:person.mobileNumber @@ -344,7 +344,7 @@ - (NSArray *)availableCompanyContactInformationFromCompany:(AlfrescoCompany *)co ContactInformation *contactInformation = nil; - if (company.name.length == 0) + if (company.name.length != 0) { contactInformation = [[ContactInformation alloc] initWithTitleText:NSLocalizedString(@"person.profile.view.controller.contact.information.type.name.title", @"Name") contactInformation:company.name @@ -353,7 +353,7 @@ - (NSArray *)availableCompanyContactInformationFromCompany:(AlfrescoCompany *)co [contactDetails addObject:contactInformation]; } - if (company.fullAddress.length == 0) + if (company.fullAddress.length != 0) { contactInformation = [[ContactInformation alloc] initWithTitleText:NSLocalizedString(@"person.profile.view.controller.contact.information.type.address.title", @"Address") contactInformation:[company.fullAddress stringByReplacingOccurrencesOfString:@", " withString:@"\n"] @@ -362,7 +362,7 @@ - (NSArray *)availableCompanyContactInformationFromCompany:(AlfrescoCompany *)co [contactDetails addObject:contactInformation]; } - if (company.telephoneNumber.length == 0) + if (company.telephoneNumber.length != 0) { contactInformation = [[ContactInformation alloc] initWithTitleText:NSLocalizedString(@"person.profile.view.controller.contact.information.type.telephone.title", @"Email") contactInformation:company.telephoneNumber @@ -371,7 +371,7 @@ - (NSArray *)availableCompanyContactInformationFromCompany:(AlfrescoCompany *)co [contactDetails addObject:contactInformation]; } - if (company.faxNumber.length == 0) + if (company.faxNumber.length != 0) { contactInformation = [[ContactInformation alloc] initWithTitleText:NSLocalizedString(@"person.profile.view.controller.contact.information.type.fax.title", @"Fax") contactInformation:company.faxNumber @@ -380,7 +380,7 @@ - (NSArray *)availableCompanyContactInformationFromCompany:(AlfrescoCompany *)co [contactDetails addObject:contactInformation]; } - if (company.email.length == 0) + if (company.email.length != 0) { contactInformation = [[ContactInformation alloc] initWithTitleText:NSLocalizedString(@"person.profile.view.controller.contact.information.type.email.title", @"Email") contactInformation:company.email diff --git a/AlfrescoApp/View Controllers/Profile Selection View Controller/ProfileSelectionViewController.m b/AlfrescoApp/View Controllers/Profile Selection View Controller/ProfileSelectionViewController.m index c97c7ce69..97f655a23 100644 --- a/AlfrescoApp/View Controllers/Profile Selection View Controller/ProfileSelectionViewController.m +++ b/AlfrescoApp/View Controllers/Profile Selection View Controller/ProfileSelectionViewController.m @@ -95,6 +95,7 @@ - (void)loadData { [appConfigManager removeConfigurationFileForAccount:self.account]; self.configService = [appConfigManager configurationServiceForAccount:self.account]; + self.configService.session = nil; [self.configService retrieveDefaultProfileWithCompletionBlock:^(AlfrescoProfileConfig *config, NSError *error) { self.tableViewData = [NSArray arrayWithObject:config]; [self.tableView reloadData]; diff --git a/AlfrescoApp/View Controllers/Workflow Controllers/Task View Controller/TaskViewController.m b/AlfrescoApp/View Controllers/Workflow Controllers/Task View Controller/TaskViewController.m index dae651c1a..efa006712 100644 --- a/AlfrescoApp/View Controllers/Workflow Controllers/Task View Controller/TaskViewController.m +++ b/AlfrescoApp/View Controllers/Workflow Controllers/Task View Controller/TaskViewController.m @@ -304,7 +304,7 @@ - (void)displayTaskFilter:(id)sender event:(UIEvent *)event UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; // "My Tasks" filter - [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"tasks.title.mytasks", @"My Tasks Title") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"tasks.title.mytasks", @"My Tasks Title") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { self.displayingMyTasks = YES; [self loadDataWithListingContext:nil forceRefresh:NO completionBlock:^(AlfrescoPagingResult *pagingResult, NSError *error) { [self reloadTableViewWithPagingResult:pagingResult error:error]; @@ -312,7 +312,7 @@ - (void)displayTaskFilter:(id)sender event:(UIEvent *)event }]]; // "Tasks I Started" filter - [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"tasks.title.taskistarted", @"Tasks I Started Title") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"tasks.title.taskistarted", @"Tasks I Started Title") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { self.displayingMyTasks = NO; [self loadDataWithListingContext:nil forceRefresh:NO completionBlock:^(AlfrescoPagingResult *pagingResult, NSError *error) { [self reloadTableViewWithPagingResult:pagingResult error:error]; @@ -320,7 +320,7 @@ - (void)displayTaskFilter:(id)sender event:(UIEvent *)event }]]; // Cancel - [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {}]]; + [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {}]]; alertController.modalPresentationStyle = UIModalPresentationPopover; UIPopoverPresentationController *popoverPresenter = [alertController popoverPresentationController]; diff --git a/AlfrescoApp/Views/Action Collection View/Model/ActionViewHandler.m b/AlfrescoApp/Views/Action Collection View/Model/ActionViewHandler.m index 4ec121184..41ffc5117 100644 --- a/AlfrescoApp/Views/Action Collection View/Model/ActionViewHandler.m +++ b/AlfrescoApp/Views/Action Collection View/Model/ActionViewHandler.m @@ -535,10 +535,10 @@ - (void)pressedRenameActionItem:(ActionCollectionItem *)actionItem atPath:(NSStr __block NSString *passedPath = path; UIAlertController *renameAlert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"action.rename.alert.message", @"Rename document to, message") message:nil preferredStyle:UIAlertControllerStyleAlert]; - [renameAlert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) { }]; - [renameAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { }]]; - [renameAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"action.rename.alert.title", @"Rename") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { - NSString *newName = renameAlert.textFields[0].text; + [renameAlert addTextFieldWithConfigurationHandler:^(UITextField *textField) { }]; + [renameAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { }]]; + [renameAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"action.rename.alert.title", @"Rename") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { + NSString *newName = [renameAlert.textFields[0] text]; if (newName && newName.length > 0) { diff --git a/AlfrescoDocumentPickerFileProvider/FileProvider.m b/AlfrescoDocumentPickerFileProvider/FileProvider.m index 497f2bec2..4d48886f7 100644 --- a/AlfrescoDocumentPickerFileProvider/FileProvider.m +++ b/AlfrescoDocumentPickerFileProvider/FileProvider.m @@ -343,7 +343,7 @@ - (void)stopProvidingItemAtURL:(NSURL *)url [self.fileCoordinator coordinateWritingItemAtURL:url options:NSFileCoordinatorWritingForDeleting error:NULL byAccessor:^(NSURL *newURL) { [[NSFileManager defaultManager] removeItemAtURL:newURL error:NULL]; }]; - [self providePlaceholderAtURL:url completionHandler:^(NSError * _Nullable error) {}]; + [self providePlaceholderAtURL:url completionHandler:^(NSError *error) {}]; } @end diff --git a/AlfrescoSDK b/AlfrescoSDK index a42060367..20438843a 160000 --- a/AlfrescoSDK +++ b/AlfrescoSDK @@ -1 +1 @@ -Subproject commit a420603678b83c51b3d75425f3f38f7fa25a4b5b +Subproject commit 20438843aacd3337e8a65517a25a8796bfb41e8c