Skip to content

Commit c56175b

Browse files
author
Marius Cramer
committed
Merge branch 'convert_to_reseller' into 'master'
Convert to reseller Fixes FS#925 http://bugtracker.ispconfig.org/index.php?do=details&task_id=925 See merge request !117
2 parents c0914f8 + 7e509f5 commit c56175b

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

interface/web/client/client_edit.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ function onSubmit() {
9696
//* Resellers shall not be able to create another reseller
9797
if($_SESSION["s"]["user"]["typ"] == 'user') {
9898
$this->dataRecord['limit_client'] = 0;
99+
} else {
100+
if($this->dataRecord["reseller"]) {
101+
$this->dataRecord["limit_client"] = 1; // allow 1 client, template limits will be applied later, if we set -1 it would override template limits
102+
}
99103
}
100104

101105
if($this->id != 0) {
@@ -223,7 +227,7 @@ function onShowEnd() {
223227

224228
if($app->auth->is_admin()) {
225229
// Fill the client select field
226-
$sql = "SELECT client.client_id, 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 AND client.limit_client > 0 ORDER BY client.company_name, client.contact_name, sys_group.name";
230+
$sql = "SELECT client.client_id, 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 AND client.limit_client != 0 ORDER BY client.company_name, client.contact_name, sys_group.name";
227231
$clients = $app->db->queryAllRecords($sql);
228232
$client_select = "<option value='0'>- ".$app->tform->lng('none_txt')." -</option>";
229233
//$tmp_data_record = $app->tform->getDataRecord($this->id);

interface/web/client/lib/lang/en_client.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,5 @@ $wb['parent_client_id_txt'] = 'Client of reseller';
176176
$wb['none_txt'] = 'none';
177177
$wb['limit_database_quota_txt'] = 'Database quota';
178178
$wb['limit_database_quota_error_notint'] = 'The database quota limit must be a number.';
179+
$wb['reseller_txt'] = 'Reseller';
179180
?>

interface/web/client/lib/lang/es_client.lng

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,7 @@ $wb['added_by_txt'] = 'Creado por';
155155
$wb['added_date_txt'] = 'Fecha de alta';
156156
$wb['parent_client_id_txt'] = 'Cliente de revendedor';
157157
$wb['none_txt'] = 'ninguno';
158+
$wb['limit_database_quota_txt'] = 'Cuota de base de datos';
159+
$wb['limit_database_quota_error_notint'] = 'Cuota de base de datos debe ser un número.';
160+
$wb['reseller_txt'] = 'Revendedor';
158161
?>

interface/web/client/templates/client_edit_limits.htm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ <h2><tmpl_var name="list_head_txt"></h2>
4444
{tmpl_var name='parent_client_id'}
4545
</select>
4646
</div>
47+
<div class="ctrlHolder">
48+
<label for="reseller">{tmpl_var name='reseller_txt'}</label>
49+
<input type="checkbox" name="reseller" value="1" id="reseller" />
50+
</div>
4751
</tmpl_if>
4852
<div class="subsectiontoggle"><span class="showing"></span>{tmpl_var name='web_limits_txt'}<em class="showing"></em></div>
4953
<div>
@@ -331,7 +335,7 @@ <h2><tmpl_var name="list_head_txt"></h2>
331335
.find('div.pnl_formsarea')
332336
.find('fieldset')
333337
.find('input,select,button')
334-
.not('#template_master,#template_additional,#default_mailserver,#default_webserver,#default_dbserver,#default_dnsserver,#default_slave_dnsserver,#customer_no_template,#customer_no_start,#customer_no_counter,#parent_client_id')
338+
.not('#template_master,#template_additional,#default_mailserver,#default_webserver,#default_dbserver,#default_dnsserver,#default_slave_dnsserver,#customer_no_template,#customer_no_start,#customer_no_counter,#parent_client_id,#reseller')
335339
.click(function(e) {
336340
if(custom_template_selected()) return true;
337341
e.preventDefault();

0 commit comments

Comments
 (0)