{* Display the overwrite/add/add new label *}
<span id="main_{$blockName}_{$blockId}_overwrite">
{if $row.main}
- <span class="action_label">(overwrite)</span>
+ <span class="action_label">({ts}overwrite{/ts})</span>
{if $blockName eq 'email' || $blockName eq 'phone' }
{$form.location.$blockName.$blockId.operation.html}
{/if}
<br />
{else}
- <span class="action_label">(add)</span>
+ <span class="action_label">({ts}add{/ts})</span>
{/if}
</span>
</td>
{if isset($row.main) || isset($row.other)}
<span id="main_{$blockName}_{$blockId}_overwrite">
{if $row.main == $row.other}
- <span class="action_label">(match)</span><br />
+ <span class="action_label">({ts}match{/ts})</span><br />
{elseif $row.main}
- <span class="action_label">(overwrite)</span><br />
+ <span class="action_label">({ts}overwrite{/ts})</span><br />
{else}
- <span class="action_label">(add)</span>
+ <span class="action_label">({ts}add{/ts})</span>
{/if}
</span>
{/if}
// Create appropriate label / add new link after changing the block
if (typeof block == 'undefined') {
- label = '<span class="action_label">(add)</span>';
+ label = '<span class="action_label">({/literal}{ts}add{/ts}{literal})</span>';
}
else {
mainBlockId = block['id'];
// Set label
- var label = '<span class="action_label">(overwrite)</span> ';
+ var label = '<span class="action_label">({/literal}{ts}overwrite{/ts}{literal})</span> ';
if (blockname == 'email' || blockname == 'phone') {
var opLabel = 'location[' + blockname + '][' + blockId + '][operation]';
- label += '<input id="' + opLabel + '" name="' + opLabel + '" type="checkbox" value="1" class="crm-form-checkbox"> <label for="' + opLabel + '">add new</label><br />';
+ label += '<input id="' + opLabel + '" name="' + opLabel + '" type="checkbox" value="1" class="crm-form-checkbox"> <label for="' + opLabel + '">{/literal}{ts}add new{/ts}{literal}</label><br />';
}
label += '<br>';
}
$('body').on('change', "input[id*='[operation]']", function() {
var originalHtml = $(this).prevAll('span.action_label').html();
if ($(this).is(":checked")) {
- $(this).prevAll('span.action_label').html(originalHtml.replace('(overwrite)', '(add new)'));
+ $(this).prevAll('span.action_label').html(originalHtml.replace('({/literal}{ts}overwrite{/ts}{literal})', '({/literal}{ts}add new{/ts}{literal})'));
}
else {
- $(this).prevAll('span.action_label').html(originalHtml.replace('(add new)', '(overwrite)'));
+ $(this).prevAll('span.action_label').html(originalHtml.replace('({/literal}{ts}add new{/ts}{literal})', '({/literal}{ts}overwrite{/ts}{literal})'));
}
});