Merge pull request #23509 from eileenmcnaughton/import_except
[civicrm-core.git] / CRM / Admin / Page / Job.php
index 2164d2b7cefa57fd7c6531b9b6243d2933abf7cd..a521989ae254f3648d73169fb18df3200aa84dea 100644 (file)
@@ -117,6 +117,9 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic {
     $this->_action = CRM_Utils_Request::retrieve('action', 'String',
       $this, FALSE, 0
     );
+    $this->_context = CRM_Utils_Request::retrieve('context', 'String',
+      $this, FALSE, 0
+    );
 
     if (($this->_action & CRM_Core_Action::COPY) && (!empty($this->_id))) {
       try {
@@ -155,13 +158,13 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic {
     }
 
     $sj = new CRM_Core_JobManager();
-    $rows = $temp = [];
+    $rows = [];
     foreach ($sj->jobs as $job) {
       $action = array_sum(array_keys($this->links()));
 
       // update enable/disable links.
       // CRM-9868- remove enable action for jobs that should never be run automatically via execute action or runjobs url
-      if ($job->api_action == 'process_membership_reminder_date' || $job->api_action == 'update_greeting') {
+      if ($job->api_action === 'process_membership_reminder_date' || $job->api_action === 'update_greeting') {
         $action -= CRM_Core_Action::ENABLE;
         $action -= CRM_Core_Action::DISABLE;
       }
@@ -172,8 +175,8 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic {
         $action -= CRM_Core_Action::DISABLE;
       }
 
-      $job->action = CRM_Core_Action::formLink(self::links(), $action,
-        array('id' => $job->id),
+      $job->action = CRM_Core_Action::formLink($this->links(), $action,
+        ['id' => $job->id],
         ts('more'),
         FALSE,
         'job.manage.action',