Add weights to premium screen
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 11 Oct 2023 21:05:17 +0000 (10:05 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 11 Oct 2023 21:07:53 +0000 (10:07 +1300)
CRM/Contribute/Page/ManagePremiums.php
templates/CRM/Contribute/Form/ManagePremiums.tpl

index f1b2b7c86ae6e4895edc6f66914d4f6a13c0cb90..0c08a37687d28e8eea7a22ddb00217da081953f8 100644 (file)
@@ -53,28 +53,33 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic {
           'url' => 'civicrm/admin/contribute/managePremiums',
           'qs' => 'action=update&id=%%id%%&reset=1',
           'title' => ts('Edit Premium'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::UPDATE),
         ],
         CRM_Core_Action::PREVIEW => [
           'name' => ts('Preview'),
           'url' => 'civicrm/admin/contribute/managePremiums',
           'qs' => 'action=preview&id=%%id%%',
           'title' => ts('Preview Premium'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::PREVIEW),
         ],
         CRM_Core_Action::DISABLE => [
           'name' => ts('Disable'),
           'ref' => 'crm-enable-disable',
           'title' => ts('Disable Premium'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::DISABLE),
         ],
         CRM_Core_Action::ENABLE => [
           'name' => ts('Enable'),
           'ref' => 'crm-enable-disable',
           'title' => ts('Enable Premium'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::ENABLE),
         ],
         CRM_Core_Action::DELETE => [
           'name' => ts('Delete'),
           'url' => 'civicrm/admin/contribute/managePremiums',
           'qs' => 'action=delete&id=%%id%%',
           'title' => ts('Delete Premium'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::DELETE),
         ],
       ];
     }
@@ -125,7 +130,7 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic {
         $action -= CRM_Core_Action::DISABLE;
       }
 
-      $premiums[$dao->id]['action'] = CRM_Core_Action::formLink(self::links(),
+      $premiums[$dao->id]['action'] = CRM_Core_Action::formLink($this->links(),
         $action,
         ['id' => $dao->id],
         ts('more'),
index 984873c11cec3c52c0aaf04f21a624190e2ae966..8d820b3edc7ff498b1417783377c0fade713e68a 100644 (file)
      <span class="description">{ts}The market value of this premium (e.g. retail price). For tax-deductible contributions, this amount will be used to set the non-deductible amount in the contribution record and receipt.{/ts}</span>
        </td>
     </tr>
-    <tr class="crm-contribution-form-block-cost">
-       <td class="label">{$form.cost.label}</td>
-       <td class="html-adjust">{$form.cost.html}<br />
-        <span class="description">{ts}You may optionally record the actual cost of this premium to your organization. This may be useful when evaluating net return for this incentive.{/ts}</span>
-       </td>
-    </tr>
+      <tr class="crm-contribution-form-block-cost">
+         <td class="label">{$form.cost.label}</td>
+         <td class="html-adjust">{$form.cost.html}<br />
+          <span class="description">{ts}You may optionally record the actual cost of this premium to your organization. This may be useful when evaluating net return for this incentive.{/ts}</span>
+         </td>
+      </tr>
      <tr class="crm-contribution-form-block-financial_type">
        <td class="label">{$form.financial_type_id.label}</td>
        <td class="html-adjust">