Skip to content
Snippets Groups Projects
Commit 21b60042 authored by Helmo's avatar Helmo
Browse files

Show (disabled) client field on mail_domain edit

parent 60f83685
No related branches found
No related tags found
1 merge request!1061Show (disabled) client field on mail_domain edit for admin
...@@ -75,7 +75,13 @@ class page_action extends tform_actions { ...@@ -75,7 +75,13 @@ class page_action extends tform_actions {
$app->uses('ini_parser,getconf'); $app->uses('ini_parser,getconf');
$settings = $app->getconf->get_global_config('domains'); $settings = $app->getconf->get_global_config('domains');
if($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] != 'y') { if($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] == 'y') {
$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 = ?";
$clients = $app->db->queryAllRecords($sql, $this->dataRecord['sys_groupid']);
$client_select = '<option value="dummy">'.$clients[0]['contactname'].'</option>';
$app->tpl->setVar("client_group_name", $client_select);
}
elseif($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] != 'y') {
// Getting Clients of the user // Getting Clients of the user
$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"; $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";
......
...@@ -6,21 +6,28 @@ ...@@ -6,21 +6,28 @@
{tmpl_var name='server_id'} {tmpl_var name='server_id'}
</select></div> </select></div>
<input type="hidden" name="server_id" value="{tmpl_var name='server_id_value'}" /> <input type="hidden" name="server_id" value="{tmpl_var name='server_id_value'}" />
<tmpl_else> <tmpl_else>
<label for="server_id" class="col-sm-3 control-label">{tmpl_var name='server_id_txt'}</label> <label for="server_id" class="col-sm-3 control-label">{tmpl_var name='server_id_txt'}</label>
<div class="col-sm-9"><select name="server_id" id="server_id" class="form-control"> <div class="col-sm-9"><select name="server_id" id="server_id" class="form-control">
{tmpl_var name='server_id'} {tmpl_var name='server_id'}
</select></div> </select></div>
</tmpl_if> </tmpl_if>
</div> </div>
<tmpl_unless name="domain_option"> <tmpl_if name="domain_option">
<div class="form-group">
<label for="client_group_id" class="col-sm-3 control-label">{tmpl_var name='client_txt'}</label>
<div class="col-sm-9"><select name="server_id_disabled" id="server_id_disabled" class="form-control" disabled="disabled">
{tmpl_var name='client_group_name'}
</select></div>
</div>
<tmpl_else>
<div class="form-group"> <div class="form-group">
<label for="client_group_id" class="col-sm-3 control-label">{tmpl_var name='client_txt'}</label> <label for="client_group_id" class="col-sm-3 control-label">{tmpl_var name='client_txt'}</label>
<div class="col-sm-9"><select name="client_group_id" id="client_group_id" class="form-control"> <div class="col-sm-9"><select name="client_group_id" id="client_group_id" class="form-control">
{tmpl_var name='client_group_id'} {tmpl_var name='client_group_id'}
</select></div> </select></div>
</div> </div>
</tmpl_unless> </tmpl_if>
<tmpl_else> <tmpl_else>
<tmpl_if name="only_one_server"> <tmpl_if name="only_one_server">
<input type="hidden" id="server_id" name="server_id" value="{tmpl_var name='server_id_value'}" /> <input type="hidden" id="server_id" name="server_id" value="{tmpl_var name='server_id_value'}" />
......
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