Skip to content

Commit 21b6004

Browse files
committed
Show (disabled) client field on mail_domain edit
1 parent 60f8368 commit 21b6004

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

interface/web/mail/mail_domain_edit.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ function onShowEnd() {
7575
$app->uses('ini_parser,getconf');
7676
$settings = $app->getconf->get_global_config('domains');
7777

78-
if($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] != 'y') {
78+
if($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] == 'y') {
79+
$sql = "SELECT CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id = ?";
80+
$clients = $app->db->queryAllRecords($sql, $this->dataRecord['sys_groupid']);
81+
$client_select = '<option value="dummy">'.$clients[0]['contactname'].'</option>';
82+
$app->tpl->setVar("client_group_name", $client_select);
83+
}
84+
elseif($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] != 'y') {
7985
// Getting Clients of the user
8086
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY client.company_name, client.contact_name, sys_group.name";
8187

interface/web/mail/templates/mail_domain_edit.htm

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,28 @@
66
{tmpl_var name='server_id'}
77
</select></div>
88
<input type="hidden" name="server_id" value="{tmpl_var name='server_id_value'}" />
9-
<tmpl_else>
9+
<tmpl_else>
1010
<label for="server_id" class="col-sm-3 control-label">{tmpl_var name='server_id_txt'}</label>
1111
<div class="col-sm-9"><select name="server_id" id="server_id" class="form-control">
1212
{tmpl_var name='server_id'}
1313
</select></div>
1414
</tmpl_if>
1515
</div>
16-
<tmpl_unless name="domain_option">
16+
<tmpl_if name="domain_option">
17+
<div class="form-group">
18+
<label for="client_group_id" class="col-sm-3 control-label">{tmpl_var name='client_txt'}</label>
19+
<div class="col-sm-9"><select name="server_id_disabled" id="server_id_disabled" class="form-control" disabled="disabled">
20+
{tmpl_var name='client_group_name'}
21+
</select></div>
22+
</div>
23+
<tmpl_else>
1724
<div class="form-group">
1825
<label for="client_group_id" class="col-sm-3 control-label">{tmpl_var name='client_txt'}</label>
1926
<div class="col-sm-9"><select name="client_group_id" id="client_group_id" class="form-control">
2027
{tmpl_var name='client_group_id'}
2128
</select></div>
2229
</div>
23-
</tmpl_unless>
30+
</tmpl_if>
2431
<tmpl_else>
2532
<tmpl_if name="only_one_server">
2633
<input type="hidden" id="server_id" name="server_id" value="{tmpl_var name='server_id_value'}" />

0 commit comments

Comments
 (0)