Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-08-25-10-57-01
[civicrm-core.git] / templates / CRM / Event / Import / Form / MapTable.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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 {* Event Import Wizard - Data Mapping table used by MapFields.tpl and Preview.tpl *}
27 <div class="crm-block crm-form-block crm-event-import-maptable-form-block">
28 <div id="map-field">
29 {strip}
30 <table>
31 {if $loadedMapping}
32 <tr class="columnheader-dark"><th colspan="4">{ts 1=$savedName}Saved Field Mapping: %1{/ts}</td></tr>
33 {/if}
34 <tr class="columnheader">
35 {section name=rows loop=$rowDisplayCount}
36 {if $skipColumnHeader }
37 { if $smarty.section.rows.iteration == 1 }
38 <th>{ts}Column Headers{/ts}</th>
39 {else}
40 <th>{ts 1=$smarty.section.rows.iteration}Import Data (row %1){/ts}</th>
41 {/if}
42 {else}
43 <th>{ts 1=$smarty.section.rows.iteration}Import Data (row %1){/ts}</th>
44 {/if}
45 {/section}
46
47 <th>{ts}Matching CiviCRM Field{/ts}</th>
48 </tr>
49
50 {*Loop on columns parsed from the import data rows*}
51 {section name=cols loop=$columnCount}
52 {assign var="i" value=$smarty.section.cols.index}
53 <tr style="border-bottom: 1px solid #92B6EC;">
54
55 {section name=rows loop=$rowDisplayCount}
56 {assign var="j" value=$smarty.section.rows.index}
57 <td class="{if $skipColumnHeader AND $smarty.section.rows.iteration == 1}even-row labels{else}odd-row{/if}">{$dataValues[$j][$i]}</td>
58 {/section}
59
60 {* Display mapper <select> field for 'Map Fields', and mapper value for 'Preview' *}
61 <td class="form-item even-row{if $wizard.currentStepName == 'Preview'} labels{/if}">
62 {if $wizard.currentStepName == 'Preview'}
63 {$mapper[$i]}
64 {else}
65 {$form.mapper[$i].html}
66 {/if}
67 </td>
68
69 </tr>
70 {/section}
71
72 </table>
73 {/strip}
74
75 {if $wizard.currentStepName != 'Preview'}
76 <div>
77
78 {if $loadedMapping}
79 <span>{$form.updateMapping.html} &nbsp;&nbsp; {$form.updateMapping.label}</span>
80 {/if}
81 <span>{$form.saveMapping.html} &nbsp;&nbsp; {$form.saveMapping.label}</span>
82 <div id="saveDetails" class="form-item">
83 <table class="form-layout">
84 <tr class="crm-event_map_table-form-block-saveMappingName">
85 <td class="label">{$form.saveMappingName.label}</td><td>{$form.saveMappingName.html}</td>
86 </tr>
87 <tr class="crm-event_map_table-form-block-saveMappingDesc">
88 <td class="label">{$form.saveMappingDesc.label}</td><td>{$form.saveMappingDesc.html}</td>
89 </tr>
90 </table>
91 </div>
92 <script type="text/javascript">
93 {if $mappingDetailsError }
94 cj('#saveDetails').show();
95 {else}
96 cj('#saveDetails').hide();
97 {/if}
98
99 {literal}
100 function showSaveDetails(chkbox) {
101 if (chkbox.checked) {
102 document.getElementById("saveDetails").style.display = "block";
103 document.getElementById("saveMappingName").disabled = false;
104 document.getElementById("saveMappingDesc").disabled = false;
105 } else {
106 document.getElementById("saveDetails").style.display = "none";
107 document.getElementById("saveMappingName").disabled = true;
108 document.getElementById("saveMappingDesc").disabled = true;
109 }
110 }
111 {/literal}
112 {include file="CRM/common/highLightImport.tpl"}
113 </script>
114 </div>
115 {/if}
116 </div>
117 </div>