--- /dev/null
+<?php
+
+/*
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC. All rights reserved. |
+ | |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+ */
+
+namespace Civi\Api4\Service\Spec\Provider;
+
+use Civi\Api4\Service\Spec\RequestSpec;
+use Civi\Core\Service\AutoService;
+
+/**
+ * @service
+ * @internal
+ */
+class UserJobSpecProvider extends AutoService implements Generic\SpecProviderInterface {
+
+ /**
+ * @inheritDoc
+ */
+ public function modifySpec(RequestSpec $spec): void {
+ $spec->getFieldByName('job_type')
+ ->setSuffixes(['name', 'label', 'url']);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function applies($entity, $action): bool {
+ return $entity === 'UserJob';
+ }
+
+}
/**
* @var string[]
*/
- public static $pseudoConstantSuffixes = ['name', 'abbr', 'label', 'color', 'description', 'icon', 'grouping'];
+ public static $pseudoConstantSuffixes = ['name', 'abbr', 'label', 'color', 'description', 'icon', 'grouping', 'url'];
/**
* Massage values into the format the BAO expects for a write operation
'label' => E::ts('Import Name'),
'sortable' => TRUE,
'link' => [
- 'path' => 'civicrm/import/contribution?reset=1&template_id=[id]',
+ 'path' => '[job_type:url]?reset=1&template_id=[id]',
'entity' => '',
'action' => '',
'join' => '',
'label' => E::ts('Import Name'),
'sortable' => TRUE,
'link' => [
- 'path' => 'civicrm/import/contribution?reset=1&template_id=[id]',
+ 'path' => '[job_type:url]?reset=1&template_id=[id]',
'entity' => '',
'action' => '',
'join' => '',