Skip to content

Commit 18b23bc

Browse files
author
Till Brehm
committed
Merge branch 'stable-3.1' into 'stable-3.1'
Fixes #4189 See merge request !448
2 parents d327907 + 8de24d4 commit 18b23bc

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

interface/lib/classes/tools_monitor.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function showDatabaseSize () {
146146
$line['client'] = $tmp['username'];
147147

148148
//* get the domain
149-
$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']);
149+
$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']);
150150
$line['domain'] = $tmp['domain'];
151151

152152
//* remove the sys_groupid from output

interface/web/client/client_edit.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,12 @@ function onShowEnd() {
204204
$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);
205205

206206
if($reseller['customer_no_template'] != '') {
207-
//* Set customer no default
208-
$customer_no = $app->functions->intval($reseller['customer_no_start']+$reseller['customer_no_counter']);
209-
$customer_no_string = str_replace(array('[CUSTOMER_NO]','[CLIENTID]'),array($customer_no, $reseller['client_id']),$reseller['customer_no_template']);
207+
if(isset($this->dataRecord['customer_no'])&& $this->dataRecord['customer_no']!='') $customer_no_string = $this->dataRecord['customer_no'];
208+
else {
209+
//* Set customer no default
210+
$customer_no = $app->functions->intval($reseller['customer_no_start']+$reseller['customer_no_counter']);
211+
$customer_no_string = str_replace(array('[CUSTOMER_NO]','[CLIENTID]'),array($customer_no, $reseller['client_id']),$reseller['customer_no_template']);
212+
}
210213
$app->tpl->setVar('customer_no',$customer_no_string);
211214
}
212215
}

interface/web/client/domain_edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ function onShowEnd() {
8585
$clients = $app->db->queryAllRecords($sql);
8686
$client_select = '';
8787
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
88-
$tmp_data_record = $app->tform->getDataRecord($this->id);
88+
if($this->id > 0) $tmp_data_record = $app->tform->getDataRecord($this->id); else $tmp_data_record = $this->dataRecord;
8989
if(is_array($clients)) {
9090
foreach( $clients as $client) {
91-
$selected = ($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
91+
$selected = ($client["groupid"] == $tmp_data_record["sys_groupid"] || $client["groupid"] == $tmp_data_record["client_group_id"])?'SELECTED':'';
9292
$client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n";
9393
}
9494
}

0 commit comments

Comments
 (0)