Now enforce SOGoMailCustomFromEnabled

pull/91/head
Ludovic Marcotte 2015-03-27 19:03:58 -04:00 committed by Francis Lachapelle
parent bb1977fa93
commit 10a017503e
3 changed files with 19 additions and 8 deletions

View File

@ -53,18 +53,18 @@
ng-model="account.password"/>
</md-input-container>
<script type="text/javascript">
var mailCustomFromEnabled = <var:string value="mailCustomFromEnabled" const:escapeHTML="NO"/>;
</script>
<md-input-container>
<label><var:string label:value="Full Name:"/></label>
<input type="text" required="required" ng-model="account.identities[0].fullName"/>
<input type="text" required="required"
ng-readonly="customFromIsReadonly()"
ng-model="account.identities[0].fullName"/>
</md-input-container>
<md-input-container>
<label><var:string label:value="Email:"/></label>
<input type="email" required="required" ng-model="account.identities[0].email"/>
<input type="email" required="required"
ng-readonly="customFromIsReadonly()"
ng-model="account.identities[0].email"/>
</md-input-container>
<md-input-container>

View File

@ -14,6 +14,10 @@
<main class="view md-layout-fill" ui-view="preferences" layout="row"
ng-controller="navController"><!-- preferences --> </main>
<script type="text/javascript">
var mailCustomFromEnabled = <var:string value="mailCustomFromEnabled" const:escapeHTML="NO"/>;
</script>
<script type="text/ng-template" id="preferences.html">
<md-sidenav id="left-sidenav" class="md-sidenav-left md-whiteframe-z1" md-component-id="left" md-is-locked-open="$mdMedia('gt-md')" layout="column">

View File

@ -114,7 +114,8 @@
templateUrl: 'editAccount?account=' + index,
targetEvent: null,
locals: { account: account,
accountId: index}
accountId: index,
mailCustomFromEnabled: window.mailCustomFromEnabled}
}).then(function() {
$scope.preferences.defaults.AuxiliaryMailAccounts[index] = account;
});
@ -245,9 +246,15 @@
};
}
function AccountDialogCtrl($scope, $mdDialog, account, accountId) {
function AccountDialogCtrl($scope, $mdDialog, account, accountId, mailCustomFromEnabled) {
$scope.account = account;
$scope.accountId = accountId;
$scope.customFromIsReadonly = function() {
if (accountId > 0)
return false;
return !mailCustomFromEnabled;
};
$scope.cancel = function() {
$mdDialog.cancel();
};