Skip to content
Snippets Groups Projects
Commit cfc84755 authored by Till Brehm's avatar Till Brehm
Browse files

Fixed #4055 can't add/delete Addon Template

parent 785bf953
No related branches found
No related tags found
No related merge requests found
...@@ -149,7 +149,7 @@ class page_action extends tform_actions { ...@@ -149,7 +149,7 @@ class page_action extends tform_actions {
if (trim($item['client_template_id']) != ''){ if (trim($item['client_template_id']) != ''){
if ($text != '') $text .= ''; if ($text != '') $text .= '';
$text .= '<li rel="' . $item['assigned_template_id'] . '">' . $tpl[$item['client_template_id']]; $text .= '<li rel="' . $item['assigned_template_id'] . '">' . $tpl[$item['client_template_id']];
$text .= '<a href="#" class="button icons16 icoDelete"></a>'; $text .= '&nbsp;<a href="#" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></a>';
$tmp = new stdClass(); $tmp = new stdClass();
$tmp->id = $item['assigned_template_id']; $tmp->id = $item['assigned_template_id'];
$tmp->data = ''; $tmp->data = '';
...@@ -173,7 +173,7 @@ class page_action extends tform_actions { ...@@ -173,7 +173,7 @@ class page_action extends tform_actions {
foreach($tplAdd as $item){ foreach($tplAdd as $item){
if (trim($item) != ''){ if (trim($item) != ''){
if ($text != '') $text .= ''; if ($text != '') $text .= '';
$text .= '<li>' . $tpl[$item]. '<a href="#" class="button icons16 icoDelete"></a></li>'; $text .= '<li>' . $tpl[$item]. '&nbsp;<a href="#" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></a></li>';
} }
} }
} }
......
...@@ -143,7 +143,7 @@ class page_action extends tform_actions { ...@@ -143,7 +143,7 @@ class page_action extends tform_actions {
if (trim($item['client_template_id']) != ''){ if (trim($item['client_template_id']) != ''){
if ($text != '') $text .= ''; if ($text != '') $text .= '';
$text .= '<li rel="' . $item['assigned_template_id'] . '">' . $tpl[$item['client_template_id']]; $text .= '<li rel="' . $item['assigned_template_id'] . '">' . $tpl[$item['client_template_id']];
$text .= '<a href="#" class="button icons16 icoDelete"></a>'; $text .= '&nbsp;<a href="#" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></a>';
$tmp = new stdClass(); $tmp = new stdClass();
$tmp->id = $item['assigned_template_id']; $tmp->id = $item['assigned_template_id'];
$tmp->data = ''; $tmp->data = '';
...@@ -167,7 +167,7 @@ class page_action extends tform_actions { ...@@ -167,7 +167,7 @@ class page_action extends tform_actions {
foreach($tplAdd as $item){ foreach($tplAdd as $item){
if (trim($item) != ''){ if (trim($item) != ''){
if ($text != '') $text .= ''; if ($text != '') $text .= '';
$text .= '<li>' . $tpl[$item]. '<a href="#" class="button icons16 icoDelete"></a></li>'; $text .= '<li>' . $tpl[$item]. '&nbsp;<a href="#" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></a></li>';
} }
} }
} }
......
...@@ -502,12 +502,12 @@ var ISPConfig = { ...@@ -502,12 +502,12 @@ var ISPConfig = {
if(addTplId > 0) { if(addTplId > 0) {
var newVal = tpl_add.split('/'); var newVal = tpl_add.split('/');
ISPConfig.new_tpl_add_id += 1; ISPConfig.new_tpl_add_id += 1;
var delbtn = $('<a href="#"></a>').attr('class', 'button icons16 icoDelete').click(function(e) { var delbtn = $('&nbsp;<a href="#"><span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></span></a>').attr('class', 'btn btn-danger btn-xs').click(function(e) {
e.preventDefault(); e.preventDefault();
ISPConfig.delAdditionalTemplate($(this).parent().attr('rel')); ISPConfig.delAdditionalTemplate($(this).parent().attr('rel'));
}); });
newVal[newVal.length] = 'n' + ISPConfig.new_tpl_add_id + ':' + addTplId; newVal[newVal.length] = 'n' + ISPConfig.new_tpl_add_id + ':' + addTplId;
$('<li>' + addTplText + '</li>').attr('rel', 'n' + new_tpl_add_id).append(delbtn).appendTo('#template_additional_list ul'); $('<li>' + addTplText + '</li>').attr('rel', 'n' + ISPConfig.new_tpl_add_id).append(delbtn).appendTo('#template_additional_list ul');
$('#template_additional').val(newVal.join('/')); $('#template_additional').val(newVal.join('/'));
alert('additional template ' + addTplText + ' added to customer'); alert('additional template ' + addTplText + ' added to customer');
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment