A views handler to display a 'Send newsletter' link if the newsletter has not been sent yet. The link should go to the send newsletter page.

Comments

czigor’s picture

Status: Active » Needs review
StatusFileSize
new2.82 KB

Here comes the patch.

berdir’s picture

Status: Needs review » Needs work
+++ b/includes/views/handlers/simplenews_handler_field_newsletter_send.inc
@@ -0,0 +1,26 @@
+    $this->options['alter']['make_link'] = TRUE;
+    $this->options['alter']['query'] = drupal_get_destination();
+    if ($node->simplenews->status == '0') {
+      $this->options['alter']['path'] = "node/$node->nid/simplenews";

You should use the Constant here instead of == '0'. The constant is called SIMPLENEWS_STATUS_SEND_NOT.

+++ b/includes/views/handlers/simplenews_handler_field_newsletter_send.inc
@@ -0,0 +1,26 @@
+    }
+  }
+}
\ No newline at end of file

You should add an empty line at the end of the file, diff are very unhappy if these are missing.

czigor’s picture

Thanks for the review! Here comes the corrected patch.

czigor’s picture

Status: Needs work » Needs review

nedds review

Status: Needs review » Needs work

The last submitted patch, simplenews-send_views_handler-1439688-3.patch, failed testing.

czigor’s picture

Again.

czigor’s picture

Status: Needs work » Needs review

tag

berdir’s picture

Status: Needs review » Fixed

Thanks, commited.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.