Răsfoiți Sursa

activity mail

Marino Faggiana 8 ani în urmă
părinte
comite
fc48c00fe6

+ 21 - 2
iOSClient/Settings/CCManageHelp.m

@@ -174,16 +174,35 @@
 
 - (void)sendMail:(XLFormRowDescriptor *)sender
 {
+    [self deselectFormRow:sender];
+    
     // Email Subject
     NSString *emailTitle = NSLocalizedString(@"_information_req_", nil);
     // Email Content
-    NSString *messageBody;
+    NSString *messageBody = @"\n\n";
     // Email Recipents
     NSArray *toRecipents;
     
+    NSArray *activities = [CCCoreData getAllTableActivityWithPredicate:[NSPredicate predicateWithFormat:@"(account == %@) AND (verbose == %lu)", app.activeAccount, k_activityVerboseDefault]];
+    for (TableActivity *activity in activities) {
+        
+        NSString *date, *type, *actionFile, *note;
+        
+        date = [[NSDateFormatter localizedStringFromDate:activity.date dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterMediumStyle] stringByPaddingToLength:22 withString:@" " startingAtIndex:0];
+        
+        if ([activity.type isEqual: k_activityTypeInfo])    type = @"Info   ";
+        if ([activity.type isEqual: k_activityTypeSuccess]) type = @"Success";
+        if ([activity.type isEqual: k_activityTypeFailure]) type = @"Failure";
+        
+        actionFile = [[NSString stringWithFormat:@"%@ %@", activity.action, activity.file] stringByPaddingToLength:100 withString:@" " startingAtIndex:0];
+        
+        note = [activity.note stringByPaddingToLength:150 withString:@" " startingAtIndex:0];
+        
+        messageBody = [messageBody stringByAppendingString:[NSString stringWithFormat:@"| %@ | %@ | %@ | %@ |\n", date, type, actionFile, note]];
+    }
     
+    messageBody = [messageBody stringByAppendingString:[NSString stringWithFormat:@"\n\n\n%@ Version %@ (%@)", k_brand,[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]]];
     
-    messageBody = [NSString stringWithFormat:@"\n\n\n%@ Version %@ (%@)", k_brand,[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
     toRecipents = [NSArray arrayWithObject:k_mailMe];
     
     MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];

+ 1 - 1
iOSClient/en.lproj/Localizable.strings

@@ -187,7 +187,7 @@
 "_help_intro_"                  = "Introduction _brand_";
 "_help_debug_section_"          = "Debug";
 "_help_debug_Activity_verbose_" = "Activity verbose debug";
-"_help_debug_Activity_mail_"    = "Send activity debug at Mail";
+"_help_debug_Activity_mail_"    = "Send activity debug @Mail";
 "_help_debug_Activity_clear_"   = "Clear activity";
 
 // Manage Optimizations