3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * This class contains user jobs functionality.
21 class CRM_Core_BAO_UserJob
extends CRM_Core_DAO_UserJob
{
24 * Restrict access to the relevant user.
26 * Note that it is likely we might want to permit other users such as
27 * sysadmins to access other people's user_jobs in future but it has been
28 * kept tightly restricted for initial simplicity (ie do we want to
29 * use an existing permission? a new permission ? do they require
30 * 'view all contacts' etc.
34 public function addSelectWhereClause(): array {
36 if (!\CRM_Core_Permission
::check('administer queues')) {
37 $clauses['created_id'] = '= ' . (int) CRM_Core_Session
::getLoggedInContactID();
39 CRM_Utils_Hook
::selectWhereClause($this, $clauses);
44 * Get the statuses for Import Jobs.
48 public static function getStatuses(): array {
52 'name' => 'completed',
53 'label' => ts('Completed'),
58 'label' => ts('Draft'),
62 'name' => 'scheduled',
63 'label' => ts('Scheduled'),
67 'name' => 'in_progress',
68 'label' => ts('In Progress'),
74 * Get the types Import Jobs.
76 * This is largely a placeholder at this stage. It will likely wind
77 * up as an option value so extensions can add different types.
79 * However, for now it just holds the one type being worked on.
83 public static function getTypes(): array {
87 'name' => 'contact_import',
88 'label' => ts('Contact Import'),