From 6250b7ea002fd99e40d0170d31e7e19e69f97ccd Mon Sep 17 00:00:00 2001
From: Dominik <info@profi-webdesign.net>
Date: Thu, 23 Jan 2014 13:53:43 -0500
Subject: [PATCH] Merge remote-tracking branch 'ispc3master/master'

---
 interface/web/client/domain_edit.php |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/interface/web/client/domain_edit.php b/interface/web/client/domain_edit.php
index 13e35b8..07929f9 100644
--- a/interface/web/client/domain_edit.php
+++ b/interface/web/client/domain_edit.php
@@ -38,8 +38,8 @@
 * End Form configuration
 ******************************************/
 
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
+require_once '../../lib/config.inc.php';
+require_once '../../lib/app.inc.php';
 
 //* Check permissions for module
 $app->auth->check_module_permissions('client');
@@ -50,7 +50,16 @@
 
 //* load language file
 $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'.lng';
-include($lng_file);
+include $lng_file;
+
+if(!$app->tform->checkClientLimit('limit_domainmodule')) {
+	$app->uses('ini_parser,getconf');
+	$settings = $app->getconf->get_global_config('domains');
+	if ($settings['use_domain_module'] == 'y') {
+		$app->error($settings['new_domain_html']);
+	}
+}
+
 
 class page_action extends tform_actions {
 
@@ -69,7 +78,8 @@
 
 		if($_SESSION["s"]["user"]["typ"] == 'admin') {
 			// Getting Clients of the user
-			$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name";
+			//$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY 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 sys_group.name";
 			$clients = $app->db->queryAllRecords($sql);
 			$client_select = '';
 			if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
@@ -80,7 +90,7 @@
 					$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
 				}
 			}
-			$app->tpl->setVar("client_group_id",$client_select);
+			$app->tpl->setVar("client_group_id", $client_select);
 
 		}
 
@@ -146,9 +156,10 @@
 			$app->db->query("UPDATE domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id);
 		}
 	}
+
 }
 
 $page = new page_action;
 $page->onLoad();
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1