|
@@ -430,7 +430,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"With Thumbnails" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
|
UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"With Thumbnails" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
|
|
-
|
|
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
if(appDelegate.offline_mode)
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
{
|
|
|
NSMutableDictionary* params = [@{
|
|
NSMutableDictionary* params = [@{
|
|
@@ -451,6 +451,7 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
|
|
+#endif
|
|
|
{
|
|
{
|
|
|
NSString* url=[self.content_data valueForKey:@"pdfUrl"];
|
|
NSString* url=[self.content_data valueForKey:@"pdfUrl"];
|
|
|
|
|
|
|
@@ -472,7 +473,7 @@
|
|
|
alertthreetitle=@"Print Quotation";
|
|
alertthreetitle=@"Print Quotation";
|
|
|
}
|
|
}
|
|
|
UIAlertAction *alertthree = [UIAlertAction actionWithTitle:alertthreetitle style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
|
UIAlertAction *alertthree = [UIAlertAction actionWithTitle:alertthreetitle style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
|
|
-
|
|
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
if(appDelegate.offline_mode)
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
{
|
|
|
NSMutableDictionary* params = [@{
|
|
NSMutableDictionary* params = [@{
|
|
@@ -495,6 +496,7 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
|
|
+#endif
|
|
|
{
|
|
{
|
|
|
NSString* url=[self.content_data valueForKey:@"pdfUrl"];
|
|
NSString* url=[self.content_data valueForKey:@"pdfUrl"];
|
|
|
DebugLog(@"pdf url:%@",url);
|
|
DebugLog(@"pdf url:%@",url);
|
|
@@ -628,7 +630,7 @@
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
-
|
|
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
if(appDelegate.offline_mode)
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
@@ -744,6 +746,7 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
|
|
+#endif
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
NSData *imageData = UIImagePNGRepresentation(img);
|
|
NSData *imageData = UIImagePNGRepresentation(img);
|
|
@@ -1228,7 +1231,11 @@
|
|
|
//
|
|
//
|
|
|
// [self.btnCommit setImage:[[UIImage imageNamed:@"commit"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
|
|
// [self.btnCommit setImage:[[UIImage imageNamed:@"commit"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
|
|
|
|
|
|
|
|
- if(appDelegate.offline_mode==false||offline_edit)
|
|
|
|
|
|
|
+ BOOL condition = offline_edit;
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
|
|
+ condition = condition || appDelegate.offline_mode==false;
|
|
|
|
|
+#endif
|
|
|
|
|
+ if(condition)
|
|
|
{
|
|
{
|
|
|
self.btnOpen.enabled =true;
|
|
self.btnOpen.enabled =true;
|
|
|
|
|
|
|
@@ -1248,16 +1255,26 @@
|
|
|
//
|
|
//
|
|
|
// [self.btnCommit setImage:[[UIImage imageNamed:@"commit"] imageWithRenderingMode:UIImageRenderingModeAutomatic]];
|
|
// [self.btnCommit setImage:[[UIImage imageNamed:@"commit"] imageWithRenderingMode:UIImageRenderingModeAutomatic]];
|
|
|
|
|
|
|
|
- if(appDelegate.offline_mode==false||offline_edit)
|
|
|
|
|
- {
|
|
|
|
|
- self.btnOpen.enabled =true;
|
|
|
|
|
-
|
|
|
|
|
- self.btnSign.enabled = true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ BOOL condition = offline_edit;
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
|
|
+ condition = condition || appDelegate.offline_mode==false;
|
|
|
|
|
+#endif
|
|
|
|
|
+ if (condition)
|
|
|
|
|
+ {
|
|
|
|
|
+ self.btnOpen.enabled =true;
|
|
|
|
|
+
|
|
|
|
|
+ self.btnSign.enabled = true;
|
|
|
|
|
+ }
|
|
|
// self.btnCommit.enabled =false;
|
|
// self.btnCommit.enabled =false;
|
|
|
}
|
|
}
|
|
|
|
|
+ BOOL lock_condition_1 = [lock_user isEqualToString:appDelegate.user];
|
|
|
|
|
+ BOOL lock_condition_2 = false;
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
|
|
+ lock_condition_1 = !appDelegate.offline_mode && lock_condition_1;
|
|
|
|
|
+ lock_condition_2 = appDelegate.offline_mode && [self.order_code isEqualToString:appDelegate.order_code];
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
- if(((!appDelegate.offline_mode && [lock_user isEqualToString:appDelegate.user]) || (appDelegate.offline_mode && [self.order_code isEqualToString:appDelegate.order_code]))&& (status_code==1||status_code==0))
|
|
|
|
|
|
|
+ if((lock_condition_1 || lock_condition_2)&& (status_code==1||status_code==0))
|
|
|
{
|
|
{
|
|
|
// [self.btnRelease setImage:[[UIImage imageNamed:@"order"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
|
|
// [self.btnRelease setImage:[[UIImage imageNamed:@"order"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
|
|
|
|
|
|
|
@@ -2194,13 +2211,23 @@
|
|
|
bool offline_edit =[[self.content_data valueForKey:@"offline_edit"] boolValue];
|
|
bool offline_edit =[[self.content_data valueForKey:@"offline_edit"] boolValue];
|
|
|
if(status_code==1) {
|
|
if(status_code==1) {
|
|
|
|
|
|
|
|
- if(appDelegate.offline_mode==false||offline_edit) {
|
|
|
|
|
|
|
+ BOOL condition = offline_edit;
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
|
|
+ condition = condition || appDelegate.offline_mode==false;
|
|
|
|
|
+#endif
|
|
|
|
|
+ if (condition)
|
|
|
|
|
+ {
|
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
else if(status_code==0) {
|
|
else if(status_code==0) {
|
|
|
- if(appDelegate.offline_mode==false||offline_edit) {
|
|
|
|
|
|
|
+ BOOL condition = offline_edit;
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
|
|
+ condition = condition || appDelegate.offline_mode==false;
|
|
|
|
|
+#endif
|
|
|
|
|
+ if (condition)
|
|
|
|
|
+ {
|
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2555,13 +2582,23 @@
|
|
|
bool offline_edit =[[self.content_data valueForKey:@"offline_edit"] boolValue];
|
|
bool offline_edit =[[self.content_data valueForKey:@"offline_edit"] boolValue];
|
|
|
if(status_code==1) {
|
|
if(status_code==1) {
|
|
|
|
|
|
|
|
- if(appDelegate.offline_mode==false||offline_edit) {
|
|
|
|
|
|
|
+ BOOL condition = offline_edit;
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
|
|
+ condition = condition || appDelegate.offline_mode==false;
|
|
|
|
|
+#endif
|
|
|
|
|
+ if (condition)
|
|
|
|
|
+ {
|
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
else if(status_code==0) {
|
|
else if(status_code==0) {
|
|
|
- if(appDelegate.offline_mode==false||offline_edit) {
|
|
|
|
|
|
|
+ BOOL condition = offline_edit;
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
|
|
+ condition = condition || appDelegate.offline_mode==false;
|
|
|
|
|
+#endif
|
|
|
|
|
+ if (condition)
|
|
|
|
|
+ {
|
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2916,13 +2953,23 @@
|
|
|
bool offline_edit =[[self.content_data valueForKey:@"offline_edit"] boolValue];
|
|
bool offline_edit =[[self.content_data valueForKey:@"offline_edit"] boolValue];
|
|
|
if(status_code==1) {
|
|
if(status_code==1) {
|
|
|
|
|
|
|
|
- if(appDelegate.offline_mode==false||offline_edit) {
|
|
|
|
|
|
|
+ BOOL condition = offline_edit;
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
|
|
+ condition = condition || appDelegate.offline_mode==false;
|
|
|
|
|
+#endif
|
|
|
|
|
+ if (condition)
|
|
|
|
|
+ {
|
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
else if(status_code==0) {
|
|
else if(status_code==0) {
|
|
|
- if(appDelegate.offline_mode==false||offline_edit) {
|
|
|
|
|
|
|
+ BOOL condition = offline_edit;
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
|
|
+ condition = condition || appDelegate.offline_mode==false;
|
|
|
|
|
+#endif
|
|
|
|
|
+ if (condition)
|
|
|
|
|
+ {
|
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -3279,13 +3326,23 @@
|
|
|
bool offline_edit =[[self.content_data valueForKey:@"offline_edit"] boolValue];
|
|
bool offline_edit =[[self.content_data valueForKey:@"offline_edit"] boolValue];
|
|
|
if(status_code==1) {
|
|
if(status_code==1) {
|
|
|
|
|
|
|
|
- if(appDelegate.offline_mode==false||offline_edit) {
|
|
|
|
|
|
|
+ BOOL condition = offline_edit;
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
|
|
+ condition = condition || appDelegate.offline_mode==false;
|
|
|
|
|
+#endif
|
|
|
|
|
+ if (condition)
|
|
|
|
|
+ {
|
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
else if(status_code==0) {
|
|
else if(status_code==0) {
|
|
|
- if(appDelegate.offline_mode==false||offline_edit) {
|
|
|
|
|
|
|
+ BOOL condition = offline_edit;
|
|
|
|
|
+#ifdef OFFLINE_MODE
|
|
|
|
|
+ condition = condition || appDelegate.offline_mode==false;
|
|
|
|
|
+#endif
|
|
|
|
|
+ if (condition)
|
|
|
|
|
+ {
|
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
cell.sign_img.userInteractionEnabled = YES;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|