Skip to content

Commit

Permalink
Fixed issue #9819: Not possible to add languages to the list of avail…
Browse files Browse the repository at this point in the history
…able languages in global settings
  • Loading branch information
c-schmitz committed Aug 11, 2015
1 parent 769e37f commit 852c9e1
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 12 deletions.
4 changes: 2 additions & 2 deletions application/views/admin/globalSettings_view.php
Expand Up @@ -19,8 +19,8 @@
<li role="presentation" ><a data-toggle="tab" href='#security'><?php eT("Security"); ?></a></li>
<li role="presentation" ><a data-toggle="tab" href='#presentation'><?php eT("Presentation"); ?></a></li>
<li role="presentation" ><a data-toggle="tab" href='#language'><?php eT("Language"); ?></a></li>
<li role="presentation" ><a data-toggle="tab" href='#interfaces'><?php eT("Interfaces"); ?></a></li>
<li role="presentation" id="updatetab" ><a data-toggle="tab" href='#updates' id="update_tab"><?php eT("Update"); ?></a></li>
<li role="presentation" ><a data-toggle="tab" href='#interfaces'><?php eT("Interfaces"); ?></a></li>
<li role="presentation" id="updatetab" ><a data-toggle="tab" href='#updates' id="update_tab">ComfortUpdate</a></li>
</ul>

<?php echo CHtml::form(array("admin/globalsettings"), 'post', array('class'=>'form30','id'=>'frmglobalsettings','name'=>'frmglobalsettings'));?>
Expand Down
66 changes: 56 additions & 10 deletions scripts/admin/globalsettings.js
@@ -1,13 +1,59 @@
$(document).on('click',"[data-copy] :submit",function(){
$("form :input[value='"+$(this).val()+"']").click();
});
$(document).on('submit',"#frmglobalsettings",function(){
$('#frmglobalsettings').attr('action',$('#frmglobalsettings').attr('action')+location.hash);// Maybe validate before ?
});
// $Id: globalsettings.js 8964 2010-07-20 20:46:47Z anishseth $

$(document).ready(function(){
$("[data-copy]").each(function(){
$(this).html($("#"+$(this).data('copy')).html());
});
$('[type=password]').attr('autocomplete', 'off');
$("#emailmethod").change(Emailchange);
Emailchange();

$("#bounceaccounttype").change(Emailchanges);
Emailchanges();
$('#btnRemove').click(removeLanguages);
$('#btnAdd').click(addLanguages);
$("#frmglobalsettings").submit(UpdateRestrictedLanguages);
});


function removeLanguages(ui,evt)
{
$('#includedLanguages').copyOptions('#excludedLanguages');
$("#excludedLanguages").sortOptions();
$("#includedLanguages").removeOption(/./,true);
}

function addLanguages(ui,evt)
{
$('#excludedLanguages').copyOptions('#includedLanguages');
$("#includedLanguages").sortOptions();
$("#excludedLanguages").removeOption(/./,true);
}

function UpdateRestrictedLanguages(){
aString='';
$("#includedLanguages option").each(function(){
aString=aString+' '+$(this).val();
});
$('#restrictToLanguages').val($.trim(aString));
}

function Emailchange(ui,evt)
{
smtp_enabled=($("#emailmethod").val()=='smtp');
if (smtp_enabled==true) {smtp_enabled='';}
else {smtp_enabled='disabled';}
$("#emailsmtphost").prop('disabled',smtp_enabled);
$("#emailsmtpuser").prop('disabled',smtp_enabled);
$("#emailsmtppassword").prop('disabled',smtp_enabled);
$("#emailsmtpssl").prop('disabled',smtp_enabled);
$("#emailsmtpdebug").prop('disabled',smtp_enabled);
}

function Emailchanges(ui,evt)
{
bounce_disabled=($("#bounceaccounttype").val()=='off');
if (bounce_disabled==true) {bounce_disabled='disabled';}
else {bounce_disabled='';}
$("#bounceaccounthost").prop('disabled',bounce_disabled);
$("#bounceaccountuser").prop('disabled',bounce_disabled);
$("#bounceaccountpass").prop('disabled',bounce_disabled);
$("#bounceencryption").prop('disabled',bounce_disabled);
$("#bounceaccountmailbox").prop('disabled',bounce_disabled);
}

0 comments on commit 852c9e1

Please sign in to comment.