|
@@ -22,6 +22,7 @@
|
|
|
|
|
|
|
|
#import "ContentPreviewController.h"
|
|
#import "ContentPreviewController.h"
|
|
|
#import "DetailViewController.h"
|
|
#import "DetailViewController.h"
|
|
|
|
|
+#import "RAPDFViewController.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
@implementation DetailHeaderCell
|
|
@implementation DetailHeaderCell
|
|
@@ -94,8 +95,69 @@
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- (IBAction)create_HangTag:(id)sender {
|
|
- (IBAction)create_HangTag:(id)sender {
|
|
|
- UIViewController *vc= [RAUtils getViewController:self];
|
|
|
|
|
- [RAUtils message_alert:@"" title:@"hang tag" controller:vc];
|
|
|
|
|
|
|
+
|
|
|
|
|
+ DetailViewController *vc= (DetailViewController *)[RAUtils getViewController:self];
|
|
|
|
|
+
|
|
|
|
|
+ NSString *catelog_name = [NSString stringWithFormat:@"%@ Hang Tag",vc.groupName];
|
|
|
|
|
+
|
|
|
|
|
+ UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Processing"];
|
|
|
|
|
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
+
|
|
|
|
|
+ NSDictionary* editor_json = [RANetwork request_hangTag:vc.groupName];
|
|
|
|
|
+
|
|
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
+ [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if([[editor_json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
+
|
|
|
|
|
+ NSString* url = [editor_json valueForKey:@"pdf_path"];
|
|
|
|
|
+ bool isLocalFile = [[editor_json valueForKey:@"isLocalFile"] boolValue];
|
|
|
|
|
+ RAPDFViewController *ViewController = [vc.storyboard instantiateViewControllerWithIdentifier:@"RAPDFViewController"];
|
|
|
|
|
+ ViewController.url = url;
|
|
|
|
|
+ ViewController.canSave = true;
|
|
|
|
|
+ ViewController.isLocalfile=isLocalFile;
|
|
|
|
|
+
|
|
|
|
|
+ ViewController.filename = [NSString stringWithFormat:@"%@.pdf",[TextUtils legalFilename:catelog_name]];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSString* company= [appDelegate.customerInfo valueForKey:@"customer_name"];
|
|
|
|
|
+
|
|
|
|
|
+ if(company==nil)
|
|
|
|
|
+ company=@"";
|
|
|
|
|
+
|
|
|
|
|
+ NSString* customer_email= [appDelegate.customerInfo valueForKey:@"customer_email"];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableArray* send_to = [[NSMutableArray alloc]init];
|
|
|
|
|
+ if(customer_email.length>0)
|
|
|
|
|
+ {
|
|
|
|
|
+ send_to=[[customer_email componentsSeparatedByString:NSLocalizedString(@";", nil)] mutableCopy];
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewController.mail_to = send_to;
|
|
|
|
|
+
|
|
|
|
|
+ NSString* subject;
|
|
|
|
|
+
|
|
|
|
|
+ subject =catelog_name;
|
|
|
|
|
+
|
|
|
|
|
+ ViewController.mail_subject = subject;
|
|
|
|
|
+
|
|
|
|
|
+ ViewController.hidenavi = false;
|
|
|
|
|
+ [vc.navigationController pushViewController:ViewController animated:YES];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:@"Create Hang Tag" controller:vc];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
- (IBAction)add_toPortfolio:(id)sender {
|
|
- (IBAction)add_toPortfolio:(id)sender {
|
|
|
|
|
|