Marino Faggiana 8 жил өмнө
parent
commit
2d1ad4167f

+ 1 - 1
Picker/Info.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.17</string>
 	<key>CFBundleVersion</key>
-	<string>00009</string>
+	<string>00010</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionAttributes</key>

+ 1 - 1
PickerFileProvider/Info.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.17</string>
 	<key>CFBundleVersion</key>
-	<string>00009</string>
+	<string>00010</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionFileProviderDocumentGroup</key>

+ 1 - 1
Share Ext/Info.plist

@@ -21,7 +21,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>00009</string>
+	<string>00010</string>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>

+ 1 - 1
iOSClient/CCGlobal.h

@@ -103,7 +103,7 @@ extern NSString *const BKPasscodeKeychainServiceName;
 #define COLOR_GRAY [UIColor colorWithRed:65.0/255.0 green:64.0/255.0 blue:66.0/255.0 alpha:1.0]                         // #414042 - A 1.0
 #define COLOR_CLEAR [UIColor colorWithRed:65.0/255.0 green:64.0/255.0 blue:66.0/255.0 alpha:1.0]
 #define COLOR_BAR [UIColor colorWithRed:(248.0f/255.0f) green:(248.0f/255.0f) blue:(248.0f/255.0f) alpha:1.0]
-#define COLOR_SEPARATOR_TABLE [UIColor colorWithRed:153.0/255.0 green:153.0/255.0 blue:153.0/255.0 alpha:0.2]           // Grigio chiaro
+#define COLOR_SEPARATOR_TABLE [UIColor colorWithRed:246.0/255.0 green:246.0/255.0 blue:246.0/255.0 alpha:1]           // Grigio chiaro
 #define COLOR_NO_CONNECTION [UIColor colorWithRed:204.0/255.0 green:204.0/255.0 blue:204.0/255.0 alpha:1.0]
 #define COLOR_NAVBAR_IOS7 [UIColor colorWithRed:247.0/255.0 green:247.0/255.0 blue:247.0/255.0 alpha:1.0]
 

+ 1 - 1
iOSClient/Info.plist

@@ -69,7 +69,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>00009</string>
+	<string>00010</string>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<true/>
 	<key>ITSEncryptionExportComplianceCode</key>

+ 3 - 1
iOSClient/Main/CCMain.h

@@ -62,7 +62,7 @@
 #import "CCPatenteGuida.h"
 #import "JSAlertView.h"
 
-@interface CCMain : UITableViewController <UITableViewDataSource, UITableViewDelegate, UIActionSheetDelegate, UIGestureRecognizerDelegate, UIDocumentInteractionControllerDelegate, UIViewControllerPreviewingDelegate, CCMoveDelegate, CTAssetsPickerControllerDelegate, BKPasscodeViewControllerDelegate, UISplitViewControllerDelegate, UIPopoverControllerDelegate, CCNetworkingDelegate, CCShareOCDelegate, CCAccountWebDelegate, CCBancomatDelegate, CCCartaDiCreditoDelegate, CCCartaIdentitaDelegate, CCContoCorrenteDelegate, CCNoteDelegate, CCPassaportoDelegate, CCPatenteGuidaDelegate, CCPeekPopDelegate, UIDocumentMenuDelegate, UIDocumentPickerDelegate>
+@interface CCMain : UITableViewController <UITableViewDataSource, UITableViewDelegate, UIActionSheetDelegate, UIGestureRecognizerDelegate, UIDocumentInteractionControllerDelegate, UIViewControllerPreviewingDelegate, CCMoveDelegate, CTAssetsPickerControllerDelegate, BKPasscodeViewControllerDelegate, UISplitViewControllerDelegate, UIPopoverControllerDelegate, CCNetworkingDelegate, CCShareOCDelegate, CCAccountWebDelegate, CCBancomatDelegate, CCCartaDiCreditoDelegate, CCCartaIdentitaDelegate, CCContoCorrenteDelegate, CCNoteDelegate, CCPassaportoDelegate, CCPatenteGuidaDelegate, CCPeekPopDelegate, UIDocumentMenuDelegate, UIDocumentPickerDelegate, UISearchResultsUpdating, UISearchControllerDelegate, UISearchBarDelegate>
 
 @property (nonatomic ,strong) NSString *localServerUrl;
 
@@ -74,6 +74,8 @@
 @property (nonatomic, weak) CCDetail *detailViewController;
 @property (nonatomic, weak) CCLoginNCOC *loginVC;
 
+@property (nonatomic, strong)  UISearchController *searchController;
+
 - (void)returnCreate:(NSInteger)type;
 
 - (void)createFolderCameraUpload;

+ 48 - 31
iOSClient/Main/CCMain.m

@@ -127,12 +127,15 @@
     _queueSelector = [[NSMutableArray alloc] init];
     _isViewDidLoad = YES;
     _fatherPermission = @"";
-
+    _searchController = [[UISearchController alloc] initWithSearchResultsController:nil];
+    
     // delegate
     self.tableView.delegate = self;
     self.tableView.tableFooterView = [UIView new];
     self.tableView.separatorColor = COLOR_SEPARATOR_TABLE;
-
+    self.searchController.delegate = self;
+    self.searchController.searchBar.delegate = self;
+    
     [[CCNetworking sharedNetworking] settingDelegate:self];
     
     // Custom Cell
@@ -183,6 +186,14 @@
         
     // List Transfers
     app.controlCenter = (CCControlCenter *)self.navigationController;
+    
+    // Search
+    self.searchController.searchResultsUpdater = self;
+    self.searchController.dimsBackgroundDuringPresentation = NO;
+    self.tableView.tableHeaderView = self.searchController.searchBar;
+    self.searchController.searchBar.scopeButtonTitles = @[NSLocalizedString(@"_search_this_folder_",nil),NSLocalizedString(@"_search_all_folders_",nil)];
+    self.searchController.searchBar.barTintColor = COLOR_SEPARATOR_TABLE;
+    [self.searchController.searchBar sizeToFit];
 }
 
 // Apparirà
@@ -815,29 +826,29 @@
     }
     
     if ([tipo isEqualToString:@"cartadicredito"])
-        viewController = [[CCCartaDiCredito alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal];
+        viewController = [[CCCartaDiCredito alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([tipo isEqualToString:@"bancomat"])
-        viewController = [[CCBancomat alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal];
+        viewController = [[CCBancomat alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([tipo isEqualToString:@"contocorrente"])
-        viewController = [[CCContoCorrente alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal];
+        viewController = [[CCContoCorrente alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([tipo isEqualToString:@"accountweb"])
-        viewController = [[CCAccountWeb alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal];
+        viewController = [[CCAccountWeb alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([tipo isEqualToString:@"patenteguida"])
-        viewController = [[CCPatenteGuida alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal];
+        viewController = [[CCPatenteGuida alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([tipo isEqualToString:@"cartaidentita"])
-        viewController = [[CCCartaIdentita alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal];
+        viewController = [[CCCartaIdentita alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([tipo isEqualToString:@"passaporto"])
-        viewController = [[CCPassaporto alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal];
+        viewController = [[CCPassaporto alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([tipo isEqualToString:@"note"]) {
         
-        viewController = [[CCNote alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal];
+        viewController = [[CCNote alloc] initWithDelegate:self fileName:fileName uuid:uuid rev:rev fileID:fileID modelReadOnly:modelReadOnly isLocal:isLocal serverUrl:_localServerUrl];
         
         UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
         
@@ -2067,7 +2078,7 @@
             metadataNet.action = actionMoveFileOrFolder;
             metadataNet.directory = metadata.directory;
             metadataNet.fileID = metadata.fileID;
-            metadataNet.directoryID = _localDirectoryID;
+            metadataNet.directoryID = metadata.directoryID;
             metadataNet.directoryIDTo = [CCCoreData getDirectoryIDFromServerUrl:serverUrlTo activeAccount:app.activeAccount];
             metadataNet.fileName = metadata.fileName;
             metadataNet.fileNamePrint = metadataNet.fileNamePrint;
@@ -2090,7 +2101,7 @@
             metadataNet.action = actionMoveFileOrFolder;
             metadataNet.directory = metadata.directory;
             metadataNet.fileID = metadata.fileID;
-            metadataNet.directoryID = _localDirectoryID;
+            metadataNet.directoryID = metadata.directoryID;
             metadataNet.directoryIDTo = [CCCoreData getDirectoryIDFromServerUrl:serverUrlTo activeAccount:app.activeAccount];
             metadataNet.fileNamePrint = metadata.fileNamePrint;
             metadataNet.rev = metadata.rev;
@@ -3934,6 +3945,28 @@
     }
 }
 
+#pragma mark -
+#pragma --------------------------------------------------------------------------------------------
+#pragma mark ===== Search =====
+#pragma --------------------------------------------------------------------------------------------
+
+-(void) updateSearchResultsForSearchController:(UISearchController *)searchController
+{
+    _sectionDataSource = [CCSectionDataSource new];
+        
+    [self tableViewReload];
+}
+
+- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
+{
+    [self.searchController setActive:NO];
+    
+    // forse reload
+    _dateReadDataSource = nil;
+    [self getDataSourceWithReloadTableView];
+}
+
+#pragma mark -
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Swipe Tablet -> menu =====
 #pragma --------------------------------------------------------------------------------------------
@@ -4566,12 +4599,7 @@
     
     if ((totSections < section) || (section > totSections)) {
       
-        NSString *message = [NSString stringWithFormat:@"DEBUG [0] : error section, totSections = %lu - section = %lu", (long)totSections, (long)section];
-        NSLog(@"[LOG] %@", message);
-#if DEBUG
-        UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_error_", nil) message:message delegate:nil cancelButtonTitle:nil otherButtonTitles:NSLocalizedString(@"_ok_", nil), nil];
-        [alertView show];
-#endif
+        NSLog(@"[LOG] %@", [NSString stringWithFormat:@"DEBUG [0] : error section, totSections = %lu - section = %lu", (long)totSections, (long)section]);
         return nil;
     }
     
@@ -4585,23 +4613,13 @@
         
         if ((totRows < row) || (row > totRows)) {
             
-            NSString *message = [NSString stringWithFormat:@"DEBUG [1] : error row, totRows = %lu - row = %lu [%@] [%@] [%@]", (long)totRows, (long)row, valueSection, _localDirectoryID, _localServerUrl];
-            NSLog(@"[LOG] %@", message);
-#if DEBUG
-            UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_error_", nil) message:message delegate:nil cancelButtonTitle:nil otherButtonTitles:NSLocalizedString(@"_ok_", nil), nil];
-            [alertView show];
-#endif
+            NSLog(@"[LOG] %@", [NSString stringWithFormat:@"DEBUG [1] : error row, totRows = %lu - row = %lu", (long)totRows, (long)row]);
             return nil;
         }
 
     } else {
         
         NSLog(@"[LOG] DEBUG [2] : fileIDs is NIL");
-#if DEBUG
-        UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_error_", nil) message:@"DEBUG [2] : fileIDs is NIL" delegate:nil cancelButtonTitle:nil otherButtonTitles:NSLocalizedString(@"_ok_", nil), nil];
-        [alertView show];
-#endif
-
         return nil;
     }
     
@@ -4678,7 +4696,6 @@
 {
     return [[_sectionDataSource.sectionArrayRow objectForKey:[_sectionDataSource.sections objectAtIndex:section]] count];
 }
-
 - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
 {
     NSArray *sections = [_sectionDataSource.sectionArrayRow allKeys];
@@ -4687,7 +4704,7 @@
     if ([sectionTitle isKindOfClass:[NSString class]] && [sectionTitle rangeOfString:@"download"].location != NSNotFound) return 18.f;
     if ([sectionTitle isKindOfClass:[NSString class]] && [sectionTitle rangeOfString:@"upload"].location != NSNotFound) return 18.f;
     
-    if ([_directoryGroupBy isEqualToString:@"none"] && [sections count] <= 1) return 0.f;
+    if ([_directoryGroupBy isEqualToString:@"none"] && [sections count] <= 1) return 0.0f;
     
     return 20.f;
 }

+ 24 - 6
iOSClient/Main/Main.storyboard

@@ -96,7 +96,7 @@
         <scene sceneID="kWr-RF-gdq">
             <objects>
                 <collectionViewController extendedLayoutIncludesOpaqueBars="YES" id="1Ca-6H-d29" customClass="CCPhotosCameraUpload" sceneMemberID="viewController">
-                    <collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" id="zkC-IW-U7O">
+                    <collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" misplaced="YES" dataMode="prototypes" id="zkC-IW-U7O">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -252,7 +252,7 @@
                 <navigationController automaticallyAdjustsScrollViewInsets="NO" id="eZl-ut-xpC" sceneMemberID="viewController">
                     <extendedEdge key="edgesForExtendedLayout"/>
                     <toolbarItems/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="rJe-3o-bpZ">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" id="rJe-3o-bpZ">
                         <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
@@ -409,6 +409,14 @@
                         <rect key="frame" x="0.0" y="64" width="375" height="603"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <searchBar key="tableFooterView" contentMode="redraw" id="tgI-f2-wma">
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
+                            <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+                            <textInputTraits key="textInputTraits"/>
+                            <connections>
+                                <outlet property="delegate" destination="YJg-Xa-VYf" id="esC-rG-QWk"/>
+                            </connections>
+                        </searchBar>
                         <sections/>
                         <connections>
                             <outlet property="dataSource" destination="YJg-Xa-VYf" id="sz8-sd-5O4"/>
@@ -418,10 +426,20 @@
                     <extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
                     <navigationItem key="navigationItem" id="TXe-bF-Uwk"/>
                     <connections>
+                        <outlet property="searchDisplayController" destination="xcf-VI-FqA" id="nZk-CY-UUL"/>
                         <segue destination="mtc-lf-PRo" kind="showDetail" identifier="segueDetail" id="YTW-Kz-l02"/>
                     </connections>
                 </tableViewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="q78-1k-pga" userLabel="First Responder" sceneMemberID="firstResponder"/>
+                <searchDisplayController id="xcf-VI-FqA">
+                    <connections>
+                        <outlet property="delegate" destination="YJg-Xa-VYf" id="J25-Dg-BOy"/>
+                        <outlet property="searchBar" destination="tgI-f2-wma" id="7yR-AV-erZ"/>
+                        <outlet property="searchContentsController" destination="YJg-Xa-VYf" id="f4n-7F-MTp"/>
+                        <outlet property="searchResultsDataSource" destination="YJg-Xa-VYf" id="Omt-3Z-A1J"/>
+                        <outlet property="searchResultsDelegate" destination="YJg-Xa-VYf" id="r6f-t7-MvO"/>
+                    </connections>
+                </searchDisplayController>
             </objects>
             <point key="canvasLocation" x="5214" y="1218"/>
         </scene>
@@ -430,7 +448,7 @@
             <objects>
                 <navigationController storyboardIdentifier="CCDetailNC" extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="mtc-lf-PRo" sceneMemberID="viewController">
                     <toolbarItems/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="vxw-dW-rgx">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" id="vxw-dW-rgx">
                         <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
@@ -449,7 +467,7 @@
                 <navigationController storyboardIdentifier="CCMainNC" extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="bSZ-tE-FEj" customClass="CCControlCenter" sceneMemberID="viewController">
                     <tabBarItem key="tabBarItem" title="File" image="tabBarCryptoCloud" id="Zxv-aS-HGF"/>
                     <toolbarItems/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="cj6-rT-wnB">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" id="cj6-rT-wnB">
                         <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
@@ -539,7 +557,7 @@
                 <navigationController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="Npr-vu-PSD" sceneMemberID="viewController">
                     <tabBarItem key="tabBarItem" title="Photos" image="tabBarPhotos" id="5cw-bP-7It"/>
                     <toolbarItems/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="ixg-Pw-TNO">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" id="ixg-Pw-TNO">
                         <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
@@ -641,6 +659,6 @@
         <image name="tabBarSettings" width="25" height="25"/>
     </resources>
     <inferredMetricsTieBreakers>
-        <segue reference="45n-bF-9RO"/>
+        <segue reference="YTW-Kz-l02"/>
     </inferredMetricsTieBreakers>
 </document>

+ 8 - 8
iOSClient/Offline/CCOfflinePageContent.m

@@ -586,29 +586,29 @@
         isLocal = YES;
     
     if ([metadata.model isEqualToString:@"cartadicredito"])
-        viewController = [[CCCartaDiCredito alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal];
+        viewController = [[CCCartaDiCredito alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([metadata.model isEqualToString:@"bancomat"])
-        viewController = [[CCBancomat alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal];
+        viewController = [[CCBancomat alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([metadata.model isEqualToString:@"contocorrente"])
-        viewController = [[CCContoCorrente alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal];
+        viewController = [[CCContoCorrente alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([metadata.model isEqualToString:@"accountweb"])
-        viewController = [[CCAccountWeb alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal];
+        viewController = [[CCAccountWeb alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([metadata.model isEqualToString:@"patenteguida"])
-        viewController = [[CCPatenteGuida alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal];
+        viewController = [[CCPatenteGuida alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([metadata.model isEqualToString:@"cartaidentita"])
-        viewController = [[CCCartaIdentita alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal];
+        viewController = [[CCCartaIdentita alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([metadata.model isEqualToString:@"passaporto"])
-        viewController = [[CCPassaporto alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal];
+        viewController = [[CCPassaporto alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal serverUrl:_localServerUrl];
     
     if ([metadata.model isEqualToString:@"note"]) {
         
-        viewController = [[CCNote alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal];
+        viewController = [[CCNote alloc] initWithDelegate:self fileName:metadata.fileName uuid:metadata.uuid rev:metadata.rev fileID:metadata.fileID modelReadOnly:true isLocal:isLocal serverUrl:_localServerUrl];
         
         UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
         

+ 2 - 1
iOSClient/Templates/CCAccountWeb.h

@@ -33,12 +33,13 @@
 
 @property(nonatomic, weak) id <CCAccountWebDelegate> delegate;
 
-- (id)initWithDelegate:(id <CCAccountWebDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal;
+- (id)initWithDelegate:(id <CCAccountWebDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl;
 
 @property (nonatomic, strong) NSString *fileName;
 @property (nonatomic, strong) NSString *uuid;
 @property (nonatomic, strong) NSString *rev;
 @property (nonatomic, strong) NSString *fileID;
+@property (nonatomic, strong) NSString *serverUrl;
 @property BOOL isLocal;
 
 @end

+ 3 - 2
iOSClient/Templates/CCAccountWeb.m

@@ -36,7 +36,7 @@
 
 @implementation CCAccountWeb
 
-- (id)initWithDelegate:(id <CCAccountWebDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal
+- (id)initWithDelegate:(id <CCAccountWebDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl
 {
     self = [super init];
     
@@ -48,6 +48,7 @@
         self.rev = rev;
         self.fileID = fileID;
         self.uuid = uuid;
+        self.serverUrl = serverUrl;
         
         CCCrypto *crypto = [[CCCrypto alloc] init];
         
@@ -183,7 +184,7 @@
         CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
         
         metadataNet.action = actionUploadTemplate;
-        metadataNet.serverUrl = app.serverUrl;
+        metadataNet.serverUrl = self.serverUrl;
         metadataNet.fileName = [CCUtility trasformedFileNamePlistInCrypto:fileNameModel];
         metadataNet.fileNamePrint = titolo.value;
         metadataNet.pathFolder = NSTemporaryDirectory();

+ 2 - 1
iOSClient/Templates/CCBancomat.h

@@ -33,12 +33,13 @@
 
 @property(nonatomic, weak) id <CCBancomatDelegate> delegate;
 
-- (id)initWithDelegate:(id <CCBancomatDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal;
+- (id)initWithDelegate:(id <CCBancomatDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl;
 
 @property (nonatomic, strong) NSString *fileName;
 @property (nonatomic, strong) NSString *uuid;
 @property (nonatomic, strong) NSString *rev;
 @property (nonatomic, strong) NSString *fileID;
+@property (nonatomic, strong) NSString *serverUrl;
 @property BOOL isLocal;
 
 @end

+ 3 - 2
iOSClient/Templates/CCBancomat.m

@@ -35,7 +35,7 @@
 
 @implementation CCBancomat
 
-- (id)initWithDelegate:(id <CCBancomatDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal
+- (id)initWithDelegate:(id <CCBancomatDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl
 {
     self = [super init];
     
@@ -47,6 +47,7 @@
         self.rev = rev;
         self.fileID = fileID;
         self.uuid = uuid;
+        self.serverUrl = serverUrl;
         
         CCCrypto *crypto = [[CCCrypto alloc] init];
         
@@ -191,7 +192,7 @@
         CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
         
         metadataNet.action = actionUploadTemplate;
-        metadataNet.serverUrl = app.serverUrl;
+        metadataNet.serverUrl = self.serverUrl;
         metadataNet.fileName = [CCUtility trasformedFileNamePlistInCrypto:fileNameModel];
         metadataNet.fileNamePrint = titolo.value;
         metadataNet.pathFolder = NSTemporaryDirectory();

+ 2 - 1
iOSClient/Templates/CCCartaDiCredito.h

@@ -33,12 +33,13 @@
 
 @property(nonatomic, weak) id <CCCartaDiCreditoDelegate> delegate;
 
-- (id)initWithDelegate:(id <CCCartaDiCreditoDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal;
+- (id)initWithDelegate:(id <CCCartaDiCreditoDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl;
 
 @property (nonatomic, strong) NSString *fileName;
 @property (nonatomic, strong) NSString *uuid;
 @property (nonatomic, strong) NSString *rev;
 @property (nonatomic, strong) NSString *fileID;
+@property (nonatomic, strong) NSString *serverUrl;
 @property BOOL isLocal;
 
 @end

+ 3 - 2
iOSClient/Templates/CCCartaDiCredito.m

@@ -35,7 +35,7 @@
 
 @implementation CCCartaDiCredito
 
-- (id)initWithDelegate:(id <CCCartaDiCreditoDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal
+- (id)initWithDelegate:(id <CCCartaDiCreditoDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl
 {
     self = [super init];
     
@@ -47,6 +47,7 @@
         self.rev = rev;
         self.fileID = fileID;
         self.uuid = uuid;
+        self.serverUrl = serverUrl;
         
         CCCrypto *crypto = [[CCCrypto alloc] init];
         
@@ -211,7 +212,7 @@
         CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
         
         metadataNet.action = actionUploadTemplate;
-        metadataNet.serverUrl = app.serverUrl;
+        metadataNet.serverUrl = self.serverUrl;
         metadataNet.fileName = [CCUtility trasformedFileNamePlistInCrypto:fileNameModel];
         metadataNet.fileNamePrint = titolo.value;
         metadataNet.pathFolder = NSTemporaryDirectory();

+ 2 - 1
iOSClient/Templates/CCCartaIdentita.h

@@ -33,12 +33,13 @@
 
 @property(nonatomic, weak) id <CCCartaIdentitaDelegate> delegate;
 
-- (id)initWithDelegate:(id <CCCartaIdentitaDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal;
+- (id)initWithDelegate:(id <CCCartaIdentitaDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl;
 
 @property (nonatomic, strong) NSString *fileName;
 @property (nonatomic, strong) NSString *uuid;
 @property (nonatomic, strong) NSString *rev;
 @property (nonatomic, strong) NSString *fileID;
+@property (nonatomic, strong) NSString *serverUrl;
 @property BOOL isLocal;
 
 @end

+ 3 - 2
iOSClient/Templates/CCCartaIdentita.m

@@ -36,7 +36,7 @@
 
 @implementation CCCartaIdentita
 
-- (id)initWithDelegate:(id <CCCartaIdentitaDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal
+- (id)initWithDelegate:(id <CCCartaIdentitaDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl
 {
     self = [super init];
     
@@ -48,6 +48,7 @@
         self.rev = rev;
         self.fileID = fileID;
         self.uuid = uuid;
+        self.serverUrl = serverUrl;
         
         CCCrypto *crypto = [[CCCrypto alloc] init];
         
@@ -210,7 +211,7 @@
         CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
         
         metadataNet.action = actionUploadTemplate;
-        metadataNet.serverUrl = app.serverUrl;
+        metadataNet.serverUrl = self.serverUrl;
         metadataNet.fileName = [CCUtility trasformedFileNamePlistInCrypto:fileNameModel];
         metadataNet.fileNamePrint = titolo.value;
         metadataNet.pathFolder = NSTemporaryDirectory();

+ 2 - 1
iOSClient/Templates/CCContoCorrente.h

@@ -33,12 +33,13 @@
 
 @property(nonatomic, weak) id <CCContoCorrenteDelegate> delegate;
 
-- (id)initWithDelegate:(id <CCContoCorrenteDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal;
+- (id)initWithDelegate:(id <CCContoCorrenteDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl;
 
 @property (nonatomic, strong) NSString *fileName;
 @property (nonatomic, strong) NSString *uuid;
 @property (nonatomic, strong) NSString *rev;
 @property (nonatomic, strong) NSString *fileID;
+@property (nonatomic, strong) NSString *serverUrl;
 @property BOOL isLocal;
 
 @end

+ 3 - 2
iOSClient/Templates/CCContoCorrente.m

@@ -36,7 +36,7 @@
 
 @implementation CCContoCorrente
 
-- (id)initWithDelegate:(id <CCContoCorrenteDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal
+- (id)initWithDelegate:(id <CCContoCorrenteDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl
 {
     self = [super init];
     
@@ -48,6 +48,7 @@
         self.rev = rev;
         self.fileID = fileID;
         self.uuid = uuid;
+        self.serverUrl = serverUrl;
         
         CCCrypto *crypto = [[CCCrypto alloc] init];
         
@@ -211,7 +212,7 @@
         CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
         
         metadataNet.action = actionUploadTemplate;
-        metadataNet.serverUrl = app.serverUrl;
+        metadataNet.serverUrl = self.serverUrl;
         metadataNet.fileName = [CCUtility trasformedFileNamePlistInCrypto:fileNameModel];
         metadataNet.fileNamePrint = titolo.value;
         metadataNet.pathFolder = NSTemporaryDirectory();

+ 2 - 1
iOSClient/Templates/CCNote.h

@@ -33,13 +33,14 @@
 
 @property(nonatomic, weak) id <CCNoteDelegate> delegate;
 
-- (id)initWithDelegate:(id <CCNoteDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal;
+- (id)initWithDelegate:(id <CCNoteDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl;
 
 @property (nonatomic, strong) NSString *fileName;
 @property (nonatomic, strong) NSString *uuid;
 @property (nonatomic, strong) NSString *rev;
 @property (nonatomic, strong) NSString *fileID;
 @property (nonatomic, strong) NSString *titolo;
+@property (nonatomic, strong) NSString *serverUrl;
 @property BOOL isLocal;
 
 @end

+ 3 - 2
iOSClient/Templates/CCNote.m

@@ -36,7 +36,7 @@
 
 @implementation CCNote
 
-- (id)initWithDelegate:(id <CCNoteDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal
+- (id)initWithDelegate:(id <CCNoteDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl
 {
     self = [super init];
     
@@ -48,6 +48,7 @@
         self.rev = rev;
         self.fileID = fileID;
         self.uuid = uuid;
+        self.serverUrl = serverUrl;
         
         CCCrypto *crypto = [[CCCrypto alloc] init];
         
@@ -147,7 +148,7 @@
             CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
             
             metadataNet.action = actionUploadTemplate;
-            metadataNet.serverUrl = app.serverUrl;
+            metadataNet.serverUrl = self.serverUrl;
             metadataNet.fileName = [CCUtility trasformedFileNamePlistInCrypto:fileNameModel];
             metadataNet.fileNamePrint = _titolo;
             metadataNet.pathFolder = NSTemporaryDirectory();

+ 2 - 1
iOSClient/Templates/CCPassaporto.h

@@ -33,12 +33,13 @@
 
 @property(nonatomic, weak) id <CCPassaportoDelegate> delegate;
 
-- (id)initWithDelegate:(id <CCPassaportoDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal;
+- (id)initWithDelegate:(id <CCPassaportoDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl;
 
 @property (nonatomic, strong) NSString *fileName;
 @property (nonatomic, strong) NSString *uuid;
 @property (nonatomic, strong) NSString *rev;
 @property (nonatomic, strong) NSString *fileID;
+@property (nonatomic, strong) NSString *serverUrl;
 @property BOOL isLocal;
 
 @end

+ 3 - 2
iOSClient/Templates/CCPassaporto.m

@@ -36,7 +36,7 @@
 
 @implementation CCPassaporto
 
-- (id)initWithDelegate:(id <CCPassaportoDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal
+- (id)initWithDelegate:(id <CCPassaportoDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl
 {
     self = [super init];
     
@@ -48,6 +48,7 @@
         self.rev = rev;
         self.fileID = fileID;
         self.uuid = uuid;
+        self.serverUrl = serverUrl;
         
         CCCrypto *crypto = [[CCCrypto alloc] init];
         
@@ -210,7 +211,7 @@
         CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
         
         metadataNet.action = actionUploadTemplate;
-        metadataNet.serverUrl = app.serverUrl;
+        metadataNet.serverUrl = self.serverUrl;
         metadataNet.fileName = [CCUtility trasformedFileNamePlistInCrypto:fileNameModel];
         metadataNet.fileNamePrint = titolo.value;
         metadataNet.pathFolder = NSTemporaryDirectory();

+ 2 - 1
iOSClient/Templates/CCPatenteGuida.h

@@ -33,12 +33,13 @@
 
 @property(nonatomic, weak) id <CCPatenteGuidaDelegate> delegate;
 
-- (id)initWithDelegate:(id <CCPatenteGuidaDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal;
+- (id)initWithDelegate:(id <CCPatenteGuidaDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl;
 
 @property (nonatomic, strong) NSString *fileName;
 @property (nonatomic, strong) NSString *uuid;
 @property (nonatomic, strong) NSString *rev;
 @property (nonatomic, strong) NSString *fileID;
+@property (nonatomic, strong) NSString *serverUrl;
 @property BOOL isLocal;
 
 @end

+ 3 - 2
iOSClient/Templates/CCPatenteGuida.m

@@ -38,7 +38,7 @@
 
 @implementation CCPatenteGuida
 
-- (id)initWithDelegate:(id <CCPatenteGuidaDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal
+- (id)initWithDelegate:(id <CCPatenteGuidaDelegate>)delegate fileName:(NSString *)fileName uuid:(NSString *)uuid rev:(NSString *)rev fileID:(NSString *)fileID modelReadOnly:(BOOL)modelReadOnly isLocal:(BOOL)isLocal serverUrl:(NSString *)serverUrl
 {
     self = [super init];
     
@@ -50,6 +50,7 @@
         self.rev = rev;
         self.fileID = fileID;
         self.uuid = uuid;
+        self.serverUrl = serverUrl;
         
         CCCrypto *crypto = [[CCCrypto alloc] init];
         
@@ -203,7 +204,7 @@
         CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
         
         metadataNet.action = actionUploadTemplate;
-        metadataNet.serverUrl = app.serverUrl;
+        metadataNet.serverUrl = self.serverUrl;
         metadataNet.fileName = [CCUtility trasformedFileNamePlistInCrypto:fileNameModel];
         metadataNet.fileNamePrint = titolo.value;
         metadataNet.pathFolder = NSTemporaryDirectory();

+ 3 - 0
iOSClient/en.lproj/Localizable.strings

@@ -396,6 +396,9 @@
 "_paste_files_encrypted_"       = "Paste encrypted files";
 "_paste_cryptated_"             = "Paste encrypted file";
 
+"_search_this_folder_"          = "This folder";
+"_search_all_folders_"          = "All folders";
+
 // Security
 
 "_reload_folder_"               = "Please reload folder";