Fixed: FS#1016 - Client list dropdown misses reasonable sorting
| | |
| | | // If user is admin, we will allow him to select to whom this record belongs |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') { |
| | | // Getting Domains of the user |
| | | $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0"; |
| | | $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER by name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = ''; |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>"; |
| | |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']; |
| | | $sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = '<option value="'.$client['client_id'].'">'.$client['contact_name'].'</option>'; |
| | | if(is_array($clients)) { |
| | |
| | | $app->tpl->setVar("server_id",$server_id_option); |
| | | |
| | | // load the list of clients |
| | | $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0"; |
| | | $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = ''; |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>"; |
| | |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') { |
| | | // Getting Clients of the user |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') { |
| | | $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0"; |
| | | $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name"; |
| | | } else { |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $sql = "SELECT client.client_id, limit_web_domain, default_webserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"; |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, contact_name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, contact_name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id order by contact_name"); |
| | | |
| | | // Set the webserver to the default server of the client |
| | | $tmp = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = $client[default_webserver]"); |
| | |
| | | unset($tmp); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']; |
| | | $sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = '<option value="'.$client['client_id'].'">'.$client['contact_name'].'</option>'; |
| | | if(is_array($clients)) { |
| | |
| | | unset($ips); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0"; |
| | | $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = "<option value='0'></option>"; |
| | | if(is_array($clients)) { |
| | |
| | | unset($tmp); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']; |
| | | $sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = '<option value="'.$client['client_id'].'">'.$client['contact_name'].'</option>'; |
| | | if(is_array($clients)) { |
| | |
| | | unset($ips); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0"; |
| | | $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = "<option value='0'></option>"; |
| | | if(is_array($clients)) { |