84bae9308e06e02bcffffa506a525294d83c9965
[civicrm-core.git] / templates / CRM / Contact / Form / Task / Batch.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2016 |
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 <div class="batch-update crm-form-block crm-contact-task-batch-form-block">
27 <div class="help">
28 {ts}Update field values for each contact as needed. Click <strong>Update Contacts</strong> below to save all your changes. To set a field to the same value for ALL rows, enter that value for the first contact and then click the <strong>Copy icon</strong> (next to the column title).{/ts}
29 </div>
30 <table class="crm-copy-fields">
31 <thead class="sticky">
32 <tr class="columnheader">
33 <td>{ts}Name{/ts}</td>
34 {foreach from=$fields item=field key=fieldName}
35 {if $field.skipDisplay}
36 {continue}
37 {/if}
38 <td><img src="{$config->resourceBase}i/copy.png" alt="{ts 1=$field.title}Click to copy %1 from row one to all rows.{/ts}" fname="{$field.name}" class="action-icon" title="{ts}Click here to copy the value in row one to ALL rows.{/ts}" />{$field.title}</td>
39 {/foreach}
40 </tr>
41 </thead>
42 {foreach from=$componentIds item=cid}
43 <tr class="{cycle values="odd-row,even-row"}" entity_id="{$cid}">
44 <td>{$sortName.$cid}</td>
45 {foreach from=$fields item=field key=fieldName}
46 {if $field.skipDisplay}
47 {continue}
48 {/if}
49 {assign var=n value=$field.name}
50 {if $field.options_per_line}
51 <td class="compressed">
52 {assign var="count" value="1"}
53 {strip}
54 <table class="form-layout-compressed">
55 <tr>
56 {* sort by fails for option per line. Added a variable to iterate through the element array*}
57 {assign var="index" value="1"}
58 {foreach name=optionOuter key=optionKey item=optionItem from=$form.field.$cid.$n}
59 {if $index < 10}
60 {assign var="index" value=`$index+1`}
61 {else}
62 <td class="labels font-light">{$form.field.$cid.$n.$optionKey.html}</td>
63 {if $count == $field.options_per_line}
64 </tr>
65 <tr>
66 {assign var="count" value="1"}
67 {else}
68 {assign var="count" value=`$count+1`}
69 {/if}
70 {/if}
71 {/foreach}
72 </tr>
73 </table>
74 {/strip}
75 </td>
76 {elseif ( $n eq 'birth_date' or $n eq 'deceased_date' ) }
77 <td class="compressed">{include file="CRM/common/jcalendar.tpl" elementName=$n elementIndex=$cid batchUpdate=1}</td>
78 {elseif $n|substr:0:5 eq 'phone'}
79 <td class="compressed">
80 {assign var="phone_ext_field" value=$n|replace:'phone':'phone_ext'}
81 {$form.field.$cid.$n.html}
82 {if $form.field.$cid.$phone_ext_field.html}
83 &nbsp;{$form.field.$cid.$phone_ext_field.html}
84 {/if}
85 </td>
86 {else}
87 <td class="compressed">{$form.field.$cid.$n.html}</td>
88 {/if}
89 {/foreach}
90 {/foreach}
91 </tr>
92 </table>
93 {if $fields}{$form._qf_BatchUpdateProfile_refresh.html}{/if} &nbsp;<div class="crm-submit-buttons">{$form.buttons.html}</div>
94
95 </div>
96
97 {*include batch copy js js file*}
98 {include file="CRM/common/batchCopy.tpl"}
99