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 {
35 $clauses['created_id'] = '= ' . (int) CRM_Core_Session
::getLoggedInContactID();
40 * Get the statuses for Import Jobs.
44 public static function getStatuses(): array {
48 'name' => 'completed',
49 'label' => ts('Completed'),
54 'label' => ts('Draft'),
58 'name' => 'scheduled',
59 'label' => ts('Scheduled'),
63 'name' => 'in_progress',
64 'label' => ts('In Progress'),
70 * Get the types Import Jobs.
72 * This is largely a placeholder at this stage. It will likely wind
73 * up as an option value so extensions can add different types.
75 * However, for now it just holds the one type being worked on.
79 public static function getTypes(): array {
83 'name' => 'contact_import',
84 'label' => ts('Contact Import'),