Ray Zhang 12 жил өмнө
parent
commit
85bfb448cd

+ 2 - 6
Apex Mobile/AboutViewController.m

@@ -43,12 +43,8 @@
     NSString* versionNum =[infoDict objectForKey:@"CFBundleVersion"];
     versionNum = [NSString stringWithFormat:@"A%@",versionNum];
     
-    self.infoText.text = [NSString stringWithFormat:@"Version:%@\nSupport:\nusairedadt@united-us.net",versionNum];
-// 
-//    NSString *filePath = [[NSBundle mainBundle]pathForResource:@"about" ofType:@"htm"];
-//    NSString *htmlString = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
-//    [self.webview loadHTMLString:htmlString baseURL:[NSURL URLWithString:filePath]];
-//    
+    self.infoText.text = [NSString stringWithFormat:NSLocalizedString(@"about_appinfo", nil),versionNum];
+
 	// Do any additional setup after loading the view.
 }
 

+ 1 - 1
Apex Mobile/Apex Mobile/Apex Mobile-Info.plist

@@ -21,7 +21,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>140328</string>
+	<string>140514</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>UIFileSharingEnabled</key>

+ 3 - 0
Apex Mobile/Apex Mobile/ApexMobileAppDelegate.m

@@ -43,6 +43,7 @@
     
     [defaults synchronize];
     [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
+    [[UIApplication sharedApplication] cancelAllLocalNotifications ];
     //self.duid = nil;
 }
 - (void)applicationWillResignActive:(UIApplication *)application
@@ -64,6 +65,8 @@
 
 - (void)applicationDidBecomeActive:(UIApplication *)application
 {
+    [[UIApplication sharedApplication] cancelAllLocalNotifications ];
+    
     // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
 }
 

+ 1 - 0
Apex Mobile/Apex Mobile/ApexMobileFirstViewController.h

@@ -9,6 +9,7 @@
 #import <UIKit/UIKit.h>
 #import "ApexMobileNetwork.h"
 #import "AESCrypt.h"
+#import "Constant.h"
 @interface
 ApexMobileFirstViewController : UIViewController <UITextFieldDelegate>
 @property (strong, nonatomic) IBOutlet UIButton *checkSavePassword;

+ 23 - 3
Apex Mobile/Apex Mobile/ApexMobileFirstViewController.m

@@ -33,8 +33,8 @@
     NSString*user = self.editUser.text;
     if(user.length==0||password.length==0)
     {
-        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
-        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:@"Ok" , nil];
+        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_upcanotempty", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
+        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
         [alert show];
         return;
     }
@@ -78,7 +78,27 @@
             }
             else
             {
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Error!" message:[NSString stringWithFormat:@"Failed to login code %d",ret] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
+//                int a = RESULT_NET_NOTAVAILABLE;
+                NSString* message = nil;
+                switch (ret) {
+                    case RESULT_NET_NOTAVAILABLE:
+                        message = NSLocalizedString(@"net_not_available", nil);
+                        break;
+                    case RESULT_NET_ERROR:
+                        message = NSLocalizedString(@"net_error", nil);
+                        break;
+                    case RESULT_FALSE:
+                        message = NSLocalizedString(@"auth_error", nil);
+                        break;
+                    case RESULT_VER_LOW:
+                        message = NSLocalizedString(@"ver_low", nil);
+                        break;
+                        
+                    default:
+                        message=[NSString stringWithFormat:@"Failed to login code %d",ret];
+                        break;
+                }
+                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_error", nil) message:message delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
                 [alert show];
             }
  

+ 3 - 60
Apex Mobile/Apex Mobile/Base.lproj/Main_iPhone.storyboard

@@ -410,7 +410,7 @@
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                                 <inset key="insetFor6xAndEarlier" minX="0.0" minY="64" maxX="0.0" maxY="-64"/>
                             </view>
-                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" id="Yak-ci-niG">
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter criterion" minimumFontSize="17" id="Yak-ci-niG">
                                 <rect key="frame" x="20" y="137" width="280" height="30"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <inset key="insetFor6xAndEarlier" minX="0.0" minY="64" maxX="0.0" maxY="-64"/>
@@ -592,34 +592,6 @@
             </objects>
             <point key="canvasLocation" x="-403" y="335"/>
         </scene>
-        <!--Pdf View Controller-->
-        <scene sceneID="qDh-ef-h6s">
-            <objects>
-                <viewController storyboardIdentifier="PdfViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="mGH-EL-5Xm" customClass="PdfViewController" sceneMemberID="viewController">
-                    <view key="view" contentMode="scaleToFill" id="1rz-rZ-fZg">
-                        <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
-                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                        <subviews>
-                            <webView contentMode="scaleToFill" scalesPageToFit="YES" allowsInlineMediaPlayback="NO" mediaPlaybackRequiresUserAction="NO" mediaPlaybackAllowsAirPlay="NO" id="Ih7-YS-cX1">
-                                <rect key="frame" x="0.0" y="20" width="320" height="548"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
-                                <dataDetectorType key="dataDetectorTypes"/>
-                                <connections>
-                                    <outlet property="delegate" destination="mGH-EL-5Xm" id="22e-58-l0c"/>
-                                </connections>
-                            </webView>
-                        </subviews>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
-                    </view>
-                    <connections>
-                        <outlet property="webview" destination="Ih7-YS-cX1" id="A2b-hn-HOg"/>
-                    </connections>
-                </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="No4-W6-BEF" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="4" y="335"/>
-        </scene>
         <!--Apex History View Controller-->
         <scene sceneID="fpU-rp-TyY">
             <objects>
@@ -1563,8 +1535,8 @@
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                         <subviews>
                             <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" text="version:
Support:
usairedadt@united-us.net" textAlignment="center" id="vhX-3H-Dxm">
-                                <rect key="frame" x="20" y="65" width="280" height="185"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                                <rect key="frame" x="20" y="65" width="280" height="257"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES"/>
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                                 <fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
                                 <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
@@ -1597,40 +1569,11 @@
                     <toolbarItems/>
                     <navigationItem key="navigationItem" id="eFt-a5-oFc"/>
                     <simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
-                    <connections>
-                        <segue destination="mUL-1B-hqq" kind="modal" identifier="DETAIL" id="fJJ-YR-ose"/>
-                    </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="pkZ-co-EKr" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
             <point key="canvasLocation" x="306" y="-1067"/>
         </scene>
-        <!--Location Detail View Controller-->
-        <scene sceneID="U7a-re-t7T">
-            <objects>
-                <viewController storyboardIdentifier="LocationDetailViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="mUL-1B-hqq" customClass="LocationDetailViewController" sceneMemberID="viewController">
-                    <view key="view" contentMode="scaleToFill" id="shM-Pf-iem">
-                        <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
-                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                        <subviews>
-                            <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" showsHorizontalScrollIndicator="NO" editable="NO" text="content" textAlignment="center" id="WJf-Cy-VOs">
-                                <rect key="frame" x="20" y="0.0" width="280" height="568"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                <fontDescription key="fontDescription" type="system" pointSize="15"/>
-                                <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
-                                <dataDetectorType key="dataDetectorTypes" phoneNumber="YES" link="YES"/>
-                            </textView>
-                        </subviews>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
-                    </view>
-                    <connections>
-                        <outlet property="contentText" destination="WJf-Cy-VOs" id="DJH-fT-gtM"/>
-                    </connections>
-                </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="hZL-fK-eOy" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="731" y="-1067"/>
-        </scene>
     </scenes>
     <resources>
         <image name="apexlogo-2" width="258" height="64"/>

+ 6 - 6
Apex Mobile/Apex Mobile/ChangePasswordViewController.m

@@ -56,15 +56,15 @@
     NSString* user = appDelegate.user;
     if(oldpass.length==0||oldpass.length==0||confirmpass.length==0)
     {
-        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Error!" message:@"Required fields can not be empty!" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
-        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:@"Ok" , nil];
+        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_fieldscanotempty", nil)delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
+        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
         [alert show];
         return;
     }
     if(! [newpass isEqualToString:confirmpass])
     {
-        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Error!" message:@"New password not equal confirm password!" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
-        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:@"Ok" , nil];
+        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_password_notequal", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
+        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
         [alert show];
         return;
     }
@@ -88,13 +88,13 @@
                  ApexMobileAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
                 appDelegate.password = newpass;
                 
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Success!" message:@"Change success." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
+                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_success", nil) message:NSLocalizedString(@"alert_msg_change_success", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
                 [alert show];
                 [self.navigationController popViewControllerAnimated:true ];
             }
             else
             {
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Error!" message:[NSString stringWithFormat:@"Failed to change password code %d",ret] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
+                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_error", nil) message:[NSString stringWithFormat:NSLocalizedString(@"alert_msg_failed_change_password", nil),ret] delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
                 [alert show];
             }
             

+ 11 - 4
Apex Mobile/Apex Mobile/Constant.h

@@ -27,6 +27,12 @@
 #define URL_LOCATIONS @"https://ra.apexshipping.com/mobile_news.php"
 #define URL_PUSH @"https://ra.apexshipping.com/main.php"
 #define COLOR(R,G,B,A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A]
+
+
+#define RESULT_NET_NOTAVAILABLE -4
+#define RESULT_NET_ERROR -3
+#define RESULT_FALSE 0
+#define RESULT_VER_LOW -15
 extern const int MAX_ROW;
 extern const int MAX_COLUMN;
 
@@ -44,16 +50,17 @@ extern const int			AP_MESSAGE_NEW;
 extern const int			AP_MESSAGE_NONE;
 
 
-extern const int		RESULT_FALSE;
+//extern const int		RESULT_FALSE;
 extern const int		RESULT_TRUE;
-extern const int		RESULT_NET_ERROR;
-extern const int		RESULT_NET_NOTAVAILABLE;
+//
+//extern const int		RESULT_NET_ERROR;
+//extern const int		RESULT_NET_NOTAVAILABLE;
 extern const int		RESULT_ERROR;
 extern const int		RESULT_LOCALFILE_ERROR;
 extern const int		RESULT_USERAUTH_ERROR;
 extern const int		RESULT_UPDATE_USERAUTH_ERROR;
 extern const int		RESULT_SESSION_EXPIRED;
-extern const int        RESULT_VER_LOW;
+//extern const int        RESULT_VER_LOW;
 
 //extern const NSString* URL_UPDATE_AUTH;
 //extern const NSString* URL_REQUEST_COUNT;

+ 4 - 4
Apex Mobile/Apex Mobile/Constant.m

@@ -23,16 +23,16 @@ const int			AP_MESSAGE_NEW				= 5;
 const int			AP_MESSAGE_NONE					= 6;
 
 
-const int		RESULT_FALSE					= 0;
+//const int		RESULT_FALSE					= 0;
 const int		RESULT_TRUE						= -1;
-const int		RESULT_NET_ERROR				= -3;
-const int		RESULT_NET_NOTAVAILABLE			= -4;
+//const int		RESULT_NET_ERROR				= -3;
+//const int		RESULT_NET_NOTAVAILABLE			= -4;
 const int		RESULT_ERROR					= -5;
 const int		RESULT_LOCALFILE_ERROR			= -7;
 const int		RESULT_USERAUTH_ERROR			= -9;
 const int		RESULT_UPDATE_USERAUTH_ERROR	= -11;
 const int		RESULT_SESSION_EXPIRED			= -13;
-const int       RESULT_VER_LOW                  = -15;
+//const int       RESULT_VER_LOW                  = -15;
 
 
 //const NSString* URL_UPDATE_AUTH = @"https://ra.apexshipping.com/login.php";

+ 8 - 8
Apex Mobile/Apex Mobile/CustomizeFieldViewController.m

@@ -192,21 +192,21 @@
     titleLabel.textColor=[UIColor whiteColor];
     titleLabel.backgroundColor = [UIColor clearColor];
     if(section==0)
-        titleLabel.text=@"Display items";
+        titleLabel.text=NSLocalizedString(@"display_items", nil);
     else
-        titleLabel.text=@"Hide items";
+        titleLabel.text=NSLocalizedString(@"hide_items", nil);
     [titleLabel sizeToFit];
     [myView addSubview:titleLabel];
 
     return myView;
 }
 
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
-    if(section==0)
-        return @"Display fields";
-    else
-        return @"Hide fields";
-}
+//- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
+//    if(section==0)
+//        return @"Display fields";
+//    else
+//        return @"Hide fields";
+//}
 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
 {
     

+ 3 - 3
Apex Mobile/Apex Mobile/DetailTabBarController.m

@@ -187,7 +187,7 @@
 
 -(void)saveDetail:(UIBarButtonItem*)sender
 {
-    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Create a tag to save" message:@"You can find saved Detail at tools->Save Detail/Search" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Save",nil];
+    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_create_tag", nil) message:NSLocalizedString(@"alert_msg_savehint", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:NSLocalizedString(@"save", nil),nil];
     alert.alertViewStyle = UIAlertViewStylePlainTextInput;
     
     UITextField * txt = [[UITextField alloc] init];
@@ -202,8 +202,8 @@
 - (void)viewDidLoad
 {
     [super viewDidLoad];
-    UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithTitle:@"Save" style:UIBarButtonItemStylePlain target:self action:@selector(saveDetail:)];
-    saveButton.title = @"Save";
+    UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"save", nil) style:UIBarButtonItemStylePlain target:self action:@selector(saveDetail:)];
+//    saveButton.title = @"Save";
     
     self.navigationItem.rightBarButtonItem = saveButton;
     

+ 1 - 1
Apex Mobile/Apex Mobile/FunctionSelectViewController.m

@@ -182,7 +182,7 @@
 }
 -(void)viewWillAppear:(BOOL)animated
 {
-    int i = [UIApplication sharedApplication].applicationIconBadgeNumber;
+    long i = [UIApplication sharedApplication].applicationIconBadgeNumber;
     if(i>0)
         self.messageButton.imageView.image = [UIImage imageNamed:@"ic_message_new"];
     else

+ 0 - 1
Apex Mobile/Apex Mobile/LocalDocumentsViewController.h

@@ -8,7 +8,6 @@
 
 #import <UIKit/UIKit.h>
 #import "Constant.h"
-#import "PdfViewController.h"
 @interface LocalDocumentsViewController : UIViewController
 <UITableViewDataSource,UITableViewDelegate,UIDocumentInteractionControllerDelegate>
 @property (strong,nonatomic) NSMutableArray * toolsinfo;

+ 2 - 1
Apex Mobile/Apex Mobile/LocationViewController.h

@@ -8,9 +8,10 @@
 
 #import <UIKit/UIKit.h>
 #import <GoogleMaps/GoogleMaps.h>
-#import "LocationDetailViewController.h"
+
 #import "Constant.h"
 #import "ApexMobileNetwork.h"
+#import <AddressBookUI/AddressBookUI.h>
 
 @interface LocationViewController : UIViewController<GMSMapViewDelegate>
 

+ 16 - 16
Apex Mobile/Apex Mobile/LocationViewController.m

@@ -192,7 +192,7 @@ didTapInfoWindowOfMarker:(GMSMarker *)marker
     NSArray* arremail = [email componentsSeparatedByString:NSLocalizedString(@"\r\n", nil)];
     for(int i=0;i<arremail.count;i++)
     {
-        ABMultiValueAddValueAndLabel(multiemail, CFStringCreateWithCString( kCFAllocatorDefault, [arremail[i] UTF8String], kCFStringEncodingUTF8), kABPersonPhoneMainLabel, NULL);
+        ABMultiValueAddValueAndLabel(multiemail, CFStringCreateWithCString( kCFAllocatorDefault, [arremail[i] UTF8String], kCFStringEncodingUTF8), kABWorkLabel, NULL);
     }
     ABRecordSetValue(personRef, kABPersonEmailProperty, multiemail, &error);
     
@@ -201,7 +201,7 @@ didTapInfoWindowOfMarker:(GMSMarker *)marker
     NSArray* arrphone = [telephone componentsSeparatedByString:NSLocalizedString(@"\r\n", nil)];
     for(int i=0;i<arrphone.count;i++)
     {
-        ABMultiValueAddValueAndLabel(multiphone, CFStringCreateWithCString( kCFAllocatorDefault, [arrphone[i] UTF8String], kCFStringEncodingUTF8), kABPersonPhoneMainLabel, NULL);
+        ABMultiValueAddValueAndLabel(multiphone, CFStringCreateWithCString( kCFAllocatorDefault, [arrphone[i] UTF8String], kCFStringEncodingUTF8), kABWorkLabel, NULL);
     }
     
     NSArray* arrfax = [fax componentsSeparatedByString:NSLocalizedString(@"\r\n", nil)];
@@ -236,7 +236,7 @@ didTapInfoWindowOfMarker:(GMSMarker *)marker
     
    
     self.aBNewPersonNav = [[UINavigationController alloc] initWithRootViewController:unknown] ;
-    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStylePlain target:self action:@selector(onCloseClick:)];
+    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"close", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onCloseClick:)];
     //    closeButton.title = @"Close";
     
     unknown.navigationItem.leftBarButtonItem = closeButton;
@@ -305,7 +305,7 @@ didTapInfoWindowOfMarker:(GMSMarker *)marker
         marker.position = CLLocationCoordinate2DMake(latitude,longitude);
         marker.title = company;
         //        NSString* snippet = [city stringByAppendingString:@"\n Click for more detail"];
-        marker.snippet = [[NSString stringWithFormat:@"%@\n%@",city,area] stringByAppendingString:@"\nClick for more detail"];
+        marker.snippet = [[NSString stringWithFormat:@"%@\n%@",city,area] stringByAppendingString:NSLocalizedString(@"ask_click", nil)];
         marker.map = mapView_;
         marker.userData = location;
         marker.icon = image;
@@ -379,18 +379,18 @@ didTapInfoWindowOfMarker:(GMSMarker *)marker
     });
 }
 
-- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
-    
-    if ([[segue identifier] isEqualToString:@"DETAIL"]) {
-        
-        
-        
-        
-        LocationDetailViewController *ViewController = segue.destinationViewController;
-        
-        ViewController.params = self.params;
-    }
-}
+//- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+//    
+//    if ([[segue identifier] isEqualToString:@"DETAIL"]) {
+//        
+//        
+//        
+//        
+//        LocationDetailViewController *ViewController = segue.destinationViewController;
+//        
+//        ViewController.params = self.params;
+//    }
+//}
 //- (UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker {
 //  //  if (marker == melbourneMarker_) {
 //    UILabel * ret = [[UILabel alloc] init];

+ 13 - 6
Apex Mobile/Apex Mobile/MessageViewController.m

@@ -85,13 +85,13 @@
                 {
                     
                     int i =self.btnrefresh.state;
-                    self.btnrefresh.titleLabel.text =@"No more";
+                    self.btnrefresh.titleLabel.text =NSLocalizedString(@"no_more", nil);
                     //                    [self.btnrefresh setTitle:@"No more" forState:UIControlStateNormal];
                 }
                 else
                 {
                     self.btnrefresh.enabled = true;
-                    self.btnrefresh.titleLabel.text =@"Load more";
+                    self.btnrefresh.titleLabel.text =NSLocalizedString(@"load_more",nil);
                     //                    [self.btnrefresh setTitle:@"Load more" forState:UIControlStateNormal];
                 }
                
@@ -117,7 +117,7 @@
             else
             {
                 self.btnrefresh.enabled = true;
-                [self.btnrefresh setTitle:@"Load more" forState:UIControlStateNormal];
+                [self.btnrefresh setTitle:NSLocalizedString(@"refresh", nil) forState:UIControlStateNormal];
                 
             }
             
@@ -140,7 +140,7 @@
 - (void)loadmore
 {
     self.btnrefresh.enabled = NO;
-    self.btnrefresh.titleLabel.text =@"Loading...";
+    self.btnrefresh.titleLabel.text =NSLocalizedString(@"loading",nil);
     
     //    [self.btnrefresh setTitle:@"Loading..." forState:UIControlStateNormal];
     [self loadpage];
@@ -149,6 +149,7 @@
 - (void)viewDidLoad
 {
     [super viewDidLoad];
+    [[UIApplication sharedApplication] cancelAllLocalNotifications ];
     self.offset = 0;
     self.limit = 20;
     self.messageinfo = [[NSMutableArray alloc]init];
@@ -156,6 +157,8 @@
     self.btnrefresh = [UIButton buttonWithType:UIButtonTypeCustom];
     //    self.btnrefresh.titleLabel.text =@"Load more";
     [self.btnrefresh setTitle:@"Load more" forState:UIControlStateNormal];
+//    [self.btnrefresh.titleLabel sizeToFit];
+    self.btnrefresh.titleLabel.adjustsFontSizeToFitWidth = YES;
     self.btnrefresh.hidden = true;
     [self.btnrefresh setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
     self.btnrefresh.backgroundColor = [UIColor lightGrayColor];
@@ -201,16 +204,20 @@
     if(_id.length>0)
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             
-            
+            self.mum.hidden = false;
             int result = [ApexMobileNetwork delAllMessage:_id];;
             
             
             dispatch_async(dispatch_get_main_queue(), ^{
                 if(result==1)
                 {
+                    self.mum.hidden = true;
                     [self.messageinfo removeAllObjects ];
                 [self.tableview reloadData];
                     [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
+                    
+                    [[UIApplication sharedApplication] cancelAllLocalNotifications];
+                    self.btnrefresh.hidden = true;
                 }
                 
                 NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
@@ -285,7 +292,7 @@
     
     NSString *CellIdentifier = @"tableitemmsg";
     MessageItem *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
-    NSString* title = @"New message from Apex";
+    NSString* title =NSLocalizedString(@"new_message",nil);
     NSString* time =[self.messageinfo[indexPath.row] valueForKey:@"insert_time"];
     cell.MessageLabel.text = title;
     cell.TimeLabel.text=time;

+ 5 - 2
Apex Mobile/Apex Mobile/NewsViewController.m

@@ -67,13 +67,13 @@
                 {
                     
                     int i =self.btnrefresh.state;
-                    self.btnrefresh.titleLabel.text =@"No more";
+                    self.btnrefresh.titleLabel.text =NSLocalizedString(@"no_more",nil);
                     //                    [self.btnrefresh setTitle:@"No more" forState:UIControlStateNormal];
                 }
                 else
                 {
                     self.btnrefresh.enabled = true;
-                    self.btnrefresh.titleLabel.text =@"Load more";
+                    self.btnrefresh.titleLabel.text =NSLocalizedString(@"load_more",nil);
                     //                    [self.btnrefresh setTitle:@"Load more" forState:UIControlStateNormal];
                 }
                 [self.tableview reloadData ];
@@ -127,7 +127,10 @@
     
     self.btnrefresh = [UIButton buttonWithType:UIButtonTypeCustom];
     //    self.btnrefresh.titleLabel.text =@"Load more";
+    
     [self.btnrefresh setTitle:@"Load more" forState:UIControlStateNormal];
+    self.btnrefresh.titleLabel.adjustsFontSizeToFitWidth = YES;
+//    [self.btnrefresh.titleLabel sizeToFit];
     self.btnrefresh.hidden = true;
     [self.btnrefresh setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
     self.btnrefresh.backgroundColor = [UIColor lightGrayColor];

+ 9 - 9
Apex Mobile/Apex Mobile/ResultViewController.m

@@ -109,7 +109,7 @@
     
     //(int)Authorize : (NSString*) user password:(NSString*) password
     
-    //    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"1111" message:@"1111" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
+    //    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"1111" message:@"1111" delegate:self cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles: nil];
     //    [alert show];
 }
 - (BOOL)canPerformAction:(SEL)action withSender:(id)sender
@@ -136,7 +136,7 @@
     }
     else
     {
-        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Create a tag to save" message:@"You can find saved search at tools->Save Detail/Search" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Save",nil];
+        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_create_tag", nil) message:NSLocalizedString(@"alert_msg_savehint", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:NSLocalizedString(@"save", nil),nil];
         alert.alertViewStyle = UIAlertViewStylePlainTextInput;
         
         UITextField * txt = [[UITextField alloc] init];
@@ -266,7 +266,7 @@
     if(self.actions.count<1)
         return;
     self.detail_id = _id;
-    UIMenuItem *detail = [[UIMenuItem alloc] initWithTitle:@"Show Detail" action:@selector(showDetail:)];
+    UIMenuItem *detail = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"menuitem_showdetail", nil) action:@selector(showDetail:)];
     //    [detail setValue:_id forKey:@"_id"];
     
     UIMenuController *menu = [UIMenuController sharedMenuController];
@@ -401,10 +401,10 @@
     else if([self.function_name isEqualToString:@"Download Document"])
         title = @"Document Result";
     self.navigationItem.title = title;
-    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] init];
-    backButton.title = @"Back";
-    
-    self.navigationItem.backBarButtonItem = backButton;
+//    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] init];
+//    backButton.title = @"Back";
+//    
+//    self.navigationItem.backBarButtonItem = backButton;
     
     // self.navigationController.view.frame.size.height;
     
@@ -433,8 +433,8 @@
     pulldownMenu = [[PulldownMenu alloc] initWithView:self.view];
     [self.view addSubview:pulldownMenu];
     
-    [pulldownMenu insertButton:@"Setting"];
-    [pulldownMenu insertButton:@"Save Search"];
+    [pulldownMenu insertButton:NSLocalizedString(@"menuitem_setting", nil)];
+    [pulldownMenu insertButton:NSLocalizedString(@"menuitem_savesearch", nil)];
     
     
     pulldownMenu.delegate = self;

+ 4 - 4
Apex Mobile/Apex Mobile/RetrievePasswordViewController.m

@@ -40,8 +40,8 @@
 
     if(user.length==0||email.length==0)
     {
-        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Error!" message:@"User&Email can not be empty!" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
-        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:@"Ok" , nil];
+        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_uecanotempty", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
+        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
         [alert show];
         return;
     }
@@ -67,14 +67,14 @@
                 
                 [self dismissViewControllerAnimated:true completion:^{
                     
-                    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Retrieve successfully!!" message:@"Email has been sent." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
+                    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_retrieve_success", nil) message:NSLocalizedString(@"alert_msg_email_sent", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
                     [alert show];
                     ;
                 }];
             }
             else
             {
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Error!" message:[NSString stringWithFormat:@"Failed to retrieve password code %d",ret] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
+                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert_title_error", nil) message:[NSString stringWithFormat:NSLocalizedString(@"alert_msg_failed_retrieve_password", nil),ret] delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
                 [alert show];
             }
             

+ 11 - 11
Apex Mobile/Apex Mobile/SearchViewController.m

@@ -45,9 +45,9 @@
     self.navigationItem.title = title;
     
     
-    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] init];
-    backButton.title = @"Back";
-    self.navigationItem.backBarButtonItem = backButton;
+//    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] init];
+//    backButton.title = @"Back";
+//    self.navigationItem.backBarButtonItem = backButton;
     
     self.dirty = true;
     
@@ -72,12 +72,12 @@
     //    if(![[field valueForKey:@"type"] isEqualToString:@"bool"])
     //        return YES;
     
-    NSString *title = UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) ? @"Select value" : @"Select value";
+    NSString *title = NSLocalizedString(@"select_val", nil);//UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) ? @"Select value" : @"Select value";
     UIActionSheet *selBool = [[UIActionSheet alloc] initWithTitle:title
                                                          delegate:self
-                                                cancelButtonTitle:@"No"
-                                           destructiveButtonTitle:@"Clear"
-                                                otherButtonTitles:@"Yes",
+                                                cancelButtonTitle:NSLocalizedString(@"no", nil)
+                                           destructiveButtonTitle:NSLocalizedString(@"clear", nil)
+                                                otherButtonTitles:NSLocalizedString(@"yes", nil),
                               nil];
     selBool.tag = 1;
     //dateDialog.actionSheetStyle = self.navigationController.navigationBar.barStyle;
@@ -291,7 +291,7 @@
     
 }
 - (IBAction)ClearBtnOnClick:(UIButton *)sender {
-    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Attention!" message:@"Are you sure to clear criterion?" delegate:self cancelButtonTitle:@"No" otherButtonTitles:@"Yes", nil];
+    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"attention", nil) message:NSLocalizedString(@"alert_title_confirm_clear", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"no", nil) otherButtonTitles:NSLocalizedString(@"yes", nil), nil];
     [alert show];
     
 }
@@ -477,9 +477,9 @@
     NSString *title = UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) ? @"\n\n\n\n\n\n\n\n\n" : @"\n\n\n\n\n\n\n\n\n\n\n\n";
     UIActionSheet *dateDialog = [[UIActionSheet alloc] initWithTitle:title
                                                             delegate:self
-                                                   cancelButtonTitle:@"Cancel"
-                                              destructiveButtonTitle:@"Clear"
-                                                   otherButtonTitles:@"Set",
+                                                   cancelButtonTitle:NSLocalizedString(@"cancel",nil)
+                                              destructiveButtonTitle:NSLocalizedString(@"clear",nil)
+                                                   otherButtonTitles:NSLocalizedString(@"set",nil),
                                  nil];
     dateDialog.tag = 0;
     //dateDialog.actionSheetStyle = self.navigationController.navigationBar.barStyle;

+ 2 - 17
Apex Mobile/SimpleGrid.m

@@ -348,16 +348,7 @@
 
         [griddelegate LongPress:gestureRecognizer.view _id:[self.pageData get_id:row-1]];//first row is header;
         
-        
-//        [delegate gestureRecognizer.view _id:[self.pageData get_id:row]];
-        
-        
-       // [delegate touchLabel:self touchesWtihTag:self.tag];
-        
-//        [self drawRect : gestureRecognizer.view.frame ];
-//        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"消息" message:@"确定删除该模式吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"删除", nil];
-//        [alert show];
-        
+
         
     }
 }
@@ -374,13 +365,7 @@
         label.textColor = [UIColor purpleColor];
         [griddelegate Tap:label url:url];//first row is header;
     }
-    //- (void) Tap:(UIView*)view url:(NSString*) url
-    
-//    if ([gestureRecognizer state] == UIGestureRecognizerStateBegan) {
-//          DebugLog(@"LabelTap");
-////        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"消息" message:@"确定删除该模式吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"删除", nil];
-////        [alert show];
-//    }
+
 }
 
 /*