CRM-13296 fix e-notice, change cancel button text on mailing labels to Done, refactor...
authorDave Greenberg <dave@civicrm.org>
Fri, 30 Aug 2013 21:55:43 +0000 (14:55 -0700)
committerDave Greenberg <dave@civicrm.org>
Fri, 30 Aug 2013 21:55:43 +0000 (14:55 -0700)
----------------------------------------
* CRM-13296: Add tasks to membership search - print labels & print pdf letter
  http://issues.civicrm.org/jira/browse/CRM-13296

CRM/Contact/Form/Task/Label.php
CRM/Contact/Form/Task/PDFLetterCommon.php
CRM/Member/Form/Task/Label.php

index ea844bfc34972aa28a49e2099e312922e66fee71..73e8c3852e29e4c3eebbcb1c1fe600e5b03005f2 100644 (file)
@@ -78,7 +78,17 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
     $this->add('checkbox', 'merge_same_address', ts('Merge labels for contacts with the same address'), NULL);
     $this->add('checkbox', 'merge_same_household', ts('Merge labels for contacts belonging to the same household'), NULL);
 
-    $this->addDefaultButtons(ts('Make Mailing Labels'));
+    $this->addButtons(array(
+      array(
+        'type' => 'submit',
+        'name' => ts('Make Mailing Labels'),
+        'isDefault' => TRUE,
+      ),
+      array(
+        'type' => 'cancel',
+        'name' => ts('Done'),
+      ),
+    ));
   }
 
   /**
index 1e9f3735a29059a04e2ec9159db66e3b7bf55031..078aa20c2119d5bae4499e8a84a7fbc64efa510f 100644 (file)
@@ -386,7 +386,7 @@ class CRM_Contact_Form_Task_PDFLetterCommon {
     );
     $activityParams = array(
       'subject' => $formValues['subject'],
-      'campaign_id' => $formValues['campaign_id'],
+      'campaign_id' => CRM_Utils_Array::value('campaign_id', $formValues),
       'source_contact_id' => $userID,
       'activity_type_id' => $activityTypeID,
       'activity_date_time' => date('YmdHis'),
index 6097a29f87ba0ab86215e341dcc1d70e6de9a971..119efdf52674bfc3f4096a3d74c28b1b67dbff3d 100644 (file)
@@ -59,28 +59,8 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task {
    * @return void
    */
   function buildQuickForm() {
-    CRM_Utils_System::setTitle(ts('Make Mailing Labels'));
-
-    //add select for label
-    $label = CRM_Core_BAO_LabelFormat::getList(TRUE);
-
-    $this->add('select', 'label_name', ts('Select Label'), array('' => ts('- select label -')) + $label, TRUE);
-
-
-    // add select for Location Type
-    $this->addElement('select', 'location_type_id', ts('Select Location'),
-      array(
-        '' => ts('Primary')) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'), TRUE
-    );
+    CRM_Contact_Form_Task_Label::buildQuickForm($this);
     $this->addElement('checkbox', 'per_membership', ts('Print one label per Membership (rather than per contact)'));
-
-    // checkbox for SKIP contacts with Do Not Mail privacy option
-    $this->addElement('checkbox', 'do_not_mail', ts('Do not print labels for contacts with "Do Not Mail" privacy option checked'));
-
-    $this->add('checkbox', 'merge_same_address', ts('Merge labels for contacts with the same address'), NULL);
-    $this->add('checkbox', 'merge_same_household', ts('Merge labels for contacts belonging to the same household'), NULL);
-
-    $this->addDefaultButtons(ts('Make Mailing Labels'));
   }
 
   /**