Commit 18b23bc3 authored by Till Brehm's avatar Till Brehm

Merge branch 'stable-3.1' into 'stable-3.1'

Fixes #4189



See merge request !448
parents d3279075 8de24d4a
......@@ -146,7 +146,7 @@ class tools_monitor {
$line['client'] = $tmp['username'];
//* get the domain
$tmp = $app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id=(SELECT parent_domain_id FROM web_database WHERE database_name=?", $line['database_name']);
$tmp = $app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id=(SELECT parent_domain_id FROM web_database WHERE database_name=?)", $line['database_name']);
$line['domain'] = $tmp['domain'];
//* remove the sys_groupid from output
......
......@@ -204,9 +204,12 @@ class page_action extends tform_actions {
$reseller = $app->db->queryOneRecord("SELECT client.client_id, client.customer_no_template, client.customer_no_counter, client.customer_no_start FROM sys_group,client WHERE client.client_id = sys_group.client_id and sys_group.groupid = ?", $client_group_id);
if($reseller['customer_no_template'] != '') {
//* Set customer no default
$customer_no = $app->functions->intval($reseller['customer_no_start']+$reseller['customer_no_counter']);
$customer_no_string = str_replace(array('[CUSTOMER_NO]','[CLIENTID]'),array($customer_no, $reseller['client_id']),$reseller['customer_no_template']);
if(isset($this->dataRecord['customer_no'])&& $this->dataRecord['customer_no']!='') $customer_no_string = $this->dataRecord['customer_no'];
else {
//* Set customer no default
$customer_no = $app->functions->intval($reseller['customer_no_start']+$reseller['customer_no_counter']);
$customer_no_string = str_replace(array('[CUSTOMER_NO]','[CLIENTID]'),array($customer_no, $reseller['client_id']),$reseller['customer_no_template']);
}
$app->tpl->setVar('customer_no',$customer_no_string);
}
}
......
......@@ -85,10 +85,10 @@ class page_action extends tform_actions {
$clients = $app->db->queryAllRecords($sql);
$client_select = '';
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
$tmp_data_record = $app->tform->getDataRecord($this->id);
if($this->id > 0) $tmp_data_record = $app->tform->getDataRecord($this->id); else $tmp_data_record = $this->dataRecord;
if(is_array($clients)) {
foreach( $clients as $client) {
$selected = ($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
$selected = ($client["groupid"] == $tmp_data_record["sys_groupid"] || $client["groupid"] == $tmp_data_record["client_group_id"])?'SELECTED':'';
$client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n";
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment