2 +--------------------------------------------------------------------+
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2019 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
26 {* This template is used for adding/configuring Scheduled Jobs. *}
27 <h3>{if $action eq 1}{ts}New Scheduled Job{/ts}{elseif $action eq 2}{ts}Edit Scheduled Job{/ts}{elseif $action eq 128}{ts}Execute Scheduled Job{/ts}{else}{ts}Delete Scheduled Job{/ts}{/if}</h3>
28 <div class="crm-block crm-form-block crm-job-form-block">
29 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
32 <div class="messages status no-popup">
33 <div class="icon inform-icon"></div>
34 {ts}WARNING: Deleting this Scheduled Job will cause some important site functionality to stop working.{/ts} {ts}Do you want to continue?{/ts}
36 {elseif $action eq 128}
37 <div class="messages status no-popup">
38 <div class="icon inform-icon"></div>
39 {ts}Are you sure you would like to execute this job?{/ts}
42 <table class="form-layout-compressed">
43 <tr class="crm-job-form-block-name">
44 <td class="label">{$form.name.label}</td><td>{$form.name.html}</td>
46 <tr class="crm-job-form-block-description">
47 <td class="label">{$form.description.label}</td><td>{$form.description.html}</td>
49 <tr class="crm-job-form-block-run_frequency">
50 <td class="label">{$form.run_frequency.label}</td><td>{$form.run_frequency.html}</td>
52 <tr class="crm-job-form-block-api_action">
53 <td class="label"><label>{ts}API call:{/ts}</label></td>
58 <select name="api_entity" type="text" id="api_entity" class="crm-form-select required">
59 {crmAPI entity="Entity" var="entities"}
60 {foreach from=$entities.values item=entity}
61 <option value="{$entity}"{if $entity eq $form.api_entity.value} selected="selected"{/if}>{$entity}</option>
64 {$form.api_action.html}
66 <div class="description">{ts}Put in the API method name. You need to enter pieces of full API function name as described in the documentation.{/ts}</div>
70 function assembleName( ) {
76 if( $('#api_action').val() == '' ) {
77 $('#fname').html( "<em>API name will start appearing here as you type in fields below.</em>" );
84 var apiEntity = $('#api_entity').val().replace( /([A-Z])/g, function($1) {
85 return $1.toLowerCase();
88 var apiAction = $('#api_action').val().replace(/(\_[a-z])/g, function($1) {return $1.toUpperCase().replace('_','');});
89 apiName = apiPrefix + '.' + apiEntity + '.' + apiAction;
90 $('#fname').text( apiName );
93 // bind to different events to build API name live
94 $('#api_entity').change(assembleName)
95 $('#api_action').change(assembleName).keyup(assembleName);
104 <tr class="crm-job-form-block-parameters">
105 <td class="label">{$form.parameters.label}<br />{docURL page="Managing Scheduled Jobs" resource="wiki"}</td>
106 <td>{$form.parameters.html}</td>
108 <tr class="crm-job-form-block-scheduled-run-date">
109 <td class="label">{$form.scheduled_run_date.label}</td>
110 <td>{$form.scheduled_run_date.html}<br />
111 <div dlass="description">{ts}Do not run this job before this date / time. The run frequency selected above will apply thereafter.{/ts}<br />
112 {if $action eq 1}{ts}Leave blank to run as soon as possible.{/ts}{else}{ts}Leave blank to run at next run frequency.{/ts}{/if}
116 <tr class="crm-job-form-block-is_active">
117 <td></td><td>{$form.is_active.html} {$form.is_active.label}</td>
121 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>