fix year in headers
[civicrm-core.git] / templates / CRM / Admin / Form / Job.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2017 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
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. |
12 | |
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. |
17 | |
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 +--------------------------------------------------------------------+
25 *}
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>
30
31 {if $action eq 8}
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}
35 </div>
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}
40 </div>
41 {else}
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>
45 </tr>
46 <tr class="crm-job-form-block-description">
47 <td class="label">{$form.description.label}</td><td>{$form.description.html}</td>
48 </tr>
49 <tr class="crm-job-form-block-run_frequency">
50 <td class="label">{$form.run_frequency.label}</td><td>{$form.run_frequency.html}</td>
51 </tr>
52 <tr class="crm-job-form-block-api_action">
53 <td class="label">{ts}API call:{/ts}</td>
54 <td>
55
56 <div id="fname"><br/>
57 </div>
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>
62 {/foreach}
63 </select>
64 {$form.api_action.html}
65
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>
67 <script>
68 {literal}
69 CRM.$(function($) {
70 function assembleName( ) {
71
72 // dunno yet
73 var apiName = "";
74
75 // building prefix
76 if( $('#api_action').val() == '' ) {
77 $('#fname').html( "<em>API name will start appearing here as you type in fields below.</em>" );
78 return;
79 }
80
81 var apiPrefix = 'api'
82
83 // building entity
84 var apiEntity = $('#api_entity').val().replace( /([A-Z])/g, function($1) {
85 return $1.toLowerCase();
86 });
87 // building action
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 );
91 }
92
93 // bind to different events to build API name live
94 $('#api_entity').change(assembleName)
95 $('#api_action').change(assembleName).keyup(assembleName);
96 assembleName();
97 });
98
99 {/literal}
100 </script>
101
102 </td>
103 </tr>
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>
107 </tr>
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}
113 </div>
114 </td>
115 </tr>
116 <tr class="crm-job-form-block-is_active">
117 <td></td><td>{$form.is_active.html}&nbsp;{$form.is_active.label}</td>
118 </tr>
119 </table>
120 {/if}
121 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
122 </div>
123