Added aggregating groups

This commit is contained in:
Dmitriy Simushev 2012-02-24 13:52:39 +00:00
parent 4f16162665
commit 0802ce8993
16 changed files with 158 additions and 55 deletions

View File

@ -329,6 +329,13 @@ div.errinfo {
background: url(images/subitem.gif) no-repeat 10px 2px; background: url(images/subitem.gif) no-repeat 10px 2px;
} }
.forminner .level0{
}
.forminner .level1{
padding-left: 20px;
}
.fieldinrow { .fieldinrow {
min-width: 300px; min-width: 300px;
display: inline; display: inline;
@ -502,6 +509,13 @@ table.list tbody tr:hover td, table.list tbody tr:hover td a, table.statistics t
color: #1D485E; color: #1D485E;
} }
table.list td.level0{
}
table.list td.level1{
padding-left: 20px;
}
/* awaiting */ /* awaiting */
table.awaiting { table.awaiting {

View File

@ -28,6 +28,7 @@ $dbtables = array(
"vclocaldescription" => "varchar(1024) NOT NULL", "vclocaldescription" => "varchar(1024) NOT NULL",
"vccommondescription" => "varchar(1024) NOT NULL", "vccommondescription" => "varchar(1024) NOT NULL",
"iweight" => "int NOT NULL DEFAULT 0", "iweight" => "int NOT NULL DEFAULT 0",
"parent" => "int DEFAULT NULL",
), ),
"${mysqlprefix}chatthread" => array( "${mysqlprefix}chatthread" => array(
@ -146,6 +147,9 @@ $dbtables = array(
); );
$dbtables_indexes = array( $dbtables_indexes = array(
"${mysqlprefix}chatgroup" => array(
"parent" => "parent"
),
"${mysqlprefix}chatmessage" => array( "${mysqlprefix}chatmessage" => array(
"idx_agentid" => "agentid" "idx_agentid" => "agentid"
), ),
@ -164,7 +168,7 @@ $dbtables_can_update = array(
"${mysqlprefix}chatmessage" => array("agentId"), "${mysqlprefix}chatmessage" => array("agentId"),
"${mysqlprefix}chatoperator" => array("vcavatar", "vcjabbername", "iperm", "istatus", "idisabled", "vcemail", "dtmrestore", "vcrestoretoken"), "${mysqlprefix}chatoperator" => array("vcavatar", "vcjabbername", "iperm", "istatus", "idisabled", "vcemail", "dtmrestore", "vcrestoretoken"),
"${mysqlprefix}chatban" => array(), "${mysqlprefix}chatban" => array(),
"${mysqlprefix}chatgroup" => array("vcemail", "iweight"), "${mysqlprefix}chatgroup" => array("vcemail", "iweight", "parent"),
"${mysqlprefix}chatgroupoperator" => array(), "${mysqlprefix}chatgroupoperator" => array(),
"${mysqlprefix}chatresponses" => array("vctitle"), "${mysqlprefix}chatresponses" => array("vctitle"),
"${mysqlprefix}chatsitevisitor" => array(), "${mysqlprefix}chatsitevisitor" => array(),

View File

@ -171,6 +171,15 @@ if ($act == "silentcreateall") {
runsql("ALTER TABLE ${mysqlprefix}chatgroup ADD iweight int DEFAULT 0", $link); runsql("ALTER TABLE ${mysqlprefix}chatgroup ADD iweight int DEFAULT 0", $link);
} }
if (in_array("${mysqlprefix}chatgroup.parent", $absent)) {
runsql("ALTER TABLE ${mysqlprefix}chatgroup ADD parent int DEFAULT NULL AFTER groupid", $link);
}
$res = mysql_query("select null from information_schema.statistics where table_schema = '$mysqldb' and table_name = '${mysqlprefix}chatgroup' and index_name = 'parent'", $link);
if ($res && mysql_num_rows($res) == 0) {
runsql("ALTER TABLE ${mysqlprefix}chatgroup ADD INDEX (parent)", $link);
}
$res = mysql_query("select null from information_schema.statistics where table_schema = '$mysqldb' and table_name = '${mysqlprefix}chatmessage' and index_name = 'idx_agentid'", $link); $res = mysql_query("select null from information_schema.statistics where table_schema = '$mysqldb' and table_name = '${mysqlprefix}chatmessage' and index_name = 'idx_agentid'", $link);
if ($res && mysql_num_rows($res) == 0) { if ($res && mysql_num_rows($res) == 0) {
runsql("ALTER TABLE ${mysqlprefix}chatmessage ADD INDEX idx_agentid (agentid)", $link); runsql("ALTER TABLE ${mysqlprefix}chatmessage ADD INDEX idx_agentid (agentid)", $link);

View File

@ -331,34 +331,40 @@ function setup_survey($name, $email, $groupid, $info, $referrer)
$page['forminfo'] = topage($info); $page['forminfo'] = topage($info);
$page['referrer'] = urlencode(topage($referrer)); $page['referrer'] = urlencode(topage($referrer));
$selectedgroupid = $groupid;
if ($settings['enablegroups'] == '1' && $settings["surveyaskgroup"] == "1") { if ($settings['enablegroups'] == '1' && $settings["surveyaskgroup"] == "1") {
$link = connect(); $link = connect();
$allgroups = get_groups($link, false); $showgroups = ($groupid == '')?true:group_has_children($groupid, $link);
close_connection($link); if ($showgroups) {
$val = ""; $allgroups = get_groups($link, false);
$groupdescriptions = array(); close_connection($link);
foreach ($allgroups as $k) { $val = "";
$groupname = $k['vclocalname']; $groupdescriptions = array();
if ($k['inumofagents'] == 0) { foreach ($allgroups as $k) {
continue; $groupname = $k['vclocalname'];
} if ($k['inumofagents'] == 0 || ($groupid && $k['parent'] != $groupid && $k['groupid'] != $groupid )) {
if ($k['ilastseen'] !== NULL && $k['ilastseen'] < $settings['online_timeout']) { continue;
if (!$groupid) {
$groupid = $k['groupid']; // select first online group
} }
} else { if ($k['ilastseen'] !== NULL && $k['ilastseen'] < $settings['online_timeout']) {
$groupname .= " (offline)"; if (!$selectedgroupid) {
$selectedgroupid = $k['groupid']; // select first online group
}
} else {
$groupname .= " (offline)";
}
$isselected = $k['groupid'] == $selectedgroupid;
if ($isselected) {
$defaultdescription = $k['vclocaldescription'];
}
$val .= "<option value=\"" . $k['groupid'] . "\"" . ($isselected ? " selected=\"selected\"" : "") . ">$groupname</option>";
$groupdescriptions[] = $k['vclocaldescription'];
} }
$isselected = $k['groupid'] == $groupid; $page['groups'] = $val;
if ($isselected) { $page['group.descriptions'] = json_encode($groupdescriptions);
$defaultdescription = $k['vclocaldescription']; $page['default.department.description'] = empty($defaultdescription)?' ':$defaultdescription;
}
$val .= "<option value=\"" . $k['groupid'] . "\"" . ($isselected ? " selected=\"selected\"" : "") . ">$groupname</option>";
$groupdescriptions[] = $k['vclocaldescription'];
} }
$page['groups'] = $val; close_connection($link);
$page['group.descriptions'] = json_encode($groupdescriptions);
$page['default.department.description'] = empty($defaultdescription)?' ':$defaultdescription;
} }
$page['showemail'] = $settings["surveyaskmail"] == "1" ? "1" : ""; $page['showemail'] = $settings["surveyaskmail"] == "1" ? "1" : "";

View File

@ -72,7 +72,7 @@ function get_groups_list()
$link = connect(); $link = connect();
$allgroups = get_all_groups($link); $allgroups = get_all_groups($link);
close_connection($link); close_connection($link);
$result[] = array('groupid' => '', 'vclocalname' => getlocal("page.gen_button.default_group")); $result[] = array('groupid' => '', 'vclocalname' => getlocal("page.gen_button.default_group"), 'level' => 0);
foreach ($allgroups as $g) { foreach ($allgroups as $g) {
$result[] = $g; $result[] = $g;
} }

View File

@ -66,4 +66,31 @@ function get_operator_groupslist($operatorid, $link)
} }
} }
function get_available_parent_groups($skipgroup)
{
global $mysqlprefix;
$link = connect();
$query = "select ${mysqlprefix}chatgroup.groupid as groupid, parent, vclocalname from ${mysqlprefix}chatgroup order by vclocalname";
$groupslist = select_multi_assoc($query, $link);
$result = array(array('groupid' => '', 'level' => '', 'vclocalname' => getlocal("form.field.groupparent.root")));
if ($skipgroup) {
$skipgroup = (array)$skipgroup;
} else {
$skipgroup = array();
}
$result = array_merge($result, get_sorted_child_groups_($groupslist, $skipgroup, 0) );
close_connection($link);
return $result;
}
function group_has_children($groupid, $link)
{
global $mysqlprefix;
$children = select_one_row(sprintf("select COUNT(*) as count from ${mysqlprefix}chatgroup where parent = %u", $groupid),
$link);
return ($children['count'] > 0);
}
?> ?>

View File

@ -176,7 +176,8 @@ function has_online_operators($groupid = "")
$link = connect(); $link = connect();
$query = "select count(*) as total, min(unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time from ${mysqlprefix}chatoperator"; $query = "select count(*) as total, min(unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time from ${mysqlprefix}chatoperator";
if ($groupid) { if ($groupid) {
$query .= ", ${mysqlprefix}chatgroupoperator where groupid = $groupid and ${mysqlprefix}chatoperator.operatorid = " . $query .= ", ${mysqlprefix}chatgroupoperator, ${mysqlprefix}chatgroup where ${mysqlprefix}chatgroup.groupid = ${mysqlprefix}chatgroupoperator.groupid and " .
"(${mysqlprefix}chatgroup.groupid = $groupid or ${mysqlprefix}chatgroup.parent = $groupid) and ${mysqlprefix}chatoperator.operatorid = " .
"${mysqlprefix}chatgroupoperator.operatorid and istatus = 0"; "${mysqlprefix}chatgroupoperator.operatorid and istatus = 0";
} else { } else {
if ($settings['enablegroups'] == 1) { if ($settings['enablegroups'] == 1) {
@ -390,14 +391,29 @@ function prepare_menu($operator, $hasright = true)
function get_all_groups($link) function get_all_groups($link)
{ {
global $mysqlprefix; global $mysqlprefix;
$query = "select ${mysqlprefix}chatgroup.groupid as groupid, vclocalname, vclocaldescription from ${mysqlprefix}chatgroup order by vclocalname"; $query = "select ${mysqlprefix}chatgroup.groupid as groupid, parent, vclocalname, vclocaldescription from ${mysqlprefix}chatgroup order by vclocalname";
return select_multi_assoc($query, $link); return get_sorted_child_groups_(select_multi_assoc($query, $link));
}
function get_sorted_child_groups_($groupslist, $skipgroups = array(), $maxlevel = -1, $groupid = NULL, $level = 0)
{
$child_groups = array();
foreach ($groupslist as $index => $group) {
if ($group['parent'] == $groupid && !in_array($group['groupid'], $skipgroups)) {
$group['level'] = $level;
$child_groups[] = $group;
if ($maxlevel == -1 || $level < $maxlevel) {
$child_groups = array_merge($child_groups, get_sorted_child_groups_($groupslist, $skipgroups, $maxlevel, $group['groupid'], $level+1));
}
}
}
return $child_groups;
} }
function get_groups($link, $checkaway) function get_groups($link, $checkaway)
{ {
global $mysqlprefix; global $mysqlprefix;
$query = "select ${mysqlprefix}chatgroup.groupid as groupid, vclocalname, vclocaldescription, iweight" . $query = "select ${mysqlprefix}chatgroup.groupid as groupid, parent, vclocalname, vclocaldescription, iweight" .
", (SELECT count(*) from ${mysqlprefix}chatgroupoperator where ${mysqlprefix}chatgroup.groupid = " . ", (SELECT count(*) from ${mysqlprefix}chatgroupoperator where ${mysqlprefix}chatgroup.groupid = " .
"${mysqlprefix}chatgroupoperator.groupid) as inumofagents" . "${mysqlprefix}chatgroupoperator.groupid) as inumofagents" .
", (SELECT min(unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time " . ", (SELECT min(unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time " .
@ -412,7 +428,7 @@ function get_groups($link, $checkaway)
: "" : ""
) . ) .
" from ${mysqlprefix}chatgroup order by iweight, vclocalname"; " from ${mysqlprefix}chatgroup order by iweight, vclocalname";
return select_multi_assoc($query, $link); return get_sorted_child_groups_(select_multi_assoc($query, $link));
} }
function get_operator_groupids($operatorid) function get_operator_groupids($operatorid)

View File

@ -154,6 +154,9 @@ form.field.groupdesc=Description
form.field.groupemail.description=Group email for notifications. Leave empty to use the default address. form.field.groupemail.description=Group email for notifications. Leave empty to use the default address.
form.field.groupname.description=Name to identify the group. form.field.groupname.description=Name to identify the group.
form.field.groupname=Name form.field.groupname=Name
form.field.groupparent=Parent group
form.field.groupparent.description=Groups can be organized in a hierarchical structure
form.field.groupparent.root=&lt;none&gt;
form.field.groupweight=Weight form.field.groupweight=Weight
form.field.groupweight.description=Groups with lower weight display higher in groups list. Group weight is a positive integer value. form.field.groupweight.description=Groups with lower weight display higher in groups list. Group weight is a positive integer value.
form.field.login.description=Login can consist of small Latin letters and underscore. form.field.login.description=Login can consist of small Latin letters and underscore.

View File

@ -152,6 +152,9 @@ form.field.groupdesc=
form.field.groupemail.description=Адрес для извещений. Оставьте пустым, чтобы использовать глобальный адрес. form.field.groupemail.description=Адрес для извещений. Оставьте пустым, чтобы использовать глобальный адрес.
form.field.groupname.description=Может быть названием отдела в вашей компании. form.field.groupname.description=Может быть названием отдела в вашей компании.
form.field.groupname=Название группы form.field.groupname=Название группы
form.field.groupparent=Ðîäèòåëüñêàÿ ãðóïïà
form.field.groupparent.description=Ãðóïïû ìîãóò áûòü îðãàíèçîâàíû â èåðàðõè÷åñêóþ ñòðóêòóðó
form.field.groupparent.root=&lt;íåò&gt;
form.field.groupweight=Вес группы form.field.groupweight=Вес группы
form.field.groupweight.description=Группы с меньшим весом отображаются выше в списке групп. Вес - это целое положительное число. form.field.groupweight.description=Группы с меньшим весом отображаются выше в списке групп. Вес - это целое положительное число.
form.field.login.description=Логин может состоять из маленьких латинских букв и знака подчеркивания. form.field.login.description=Логин может состоять из маленьких латинских букв и знака подчеркивания.

View File

@ -39,18 +39,19 @@ function group_by_name($name)
return $group; return $group;
} }
function create_group($name, $descr, $commonname, $commondescr, $weight ,$email) function create_group($name, $descr, $commonname, $commondescr, $email, $weight, $parentgroup)
{ {
global $mysqlprefix; global $mysqlprefix;
$link = connect(); $link = connect();
$query = sprintf( $query = sprintf(
"insert into ${mysqlprefix}chatgroup (vclocalname,vclocaldescription,vccommonname,vccommondescription,iweight,vcemail) values ('%s','%s','%s','%s',%u,'%s')", "insert into ${mysqlprefix}chatgroup (parent, vclocalname,vclocaldescription,vccommonname,vccommondescription,vcemail,iweight) values (%s, '%s','%s','%s','%s','%s',%u)",
($parentgroup?(int)$parentgroup:'NULL'),
db_escape_string($name), db_escape_string($name),
db_escape_string($descr), db_escape_string($descr),
db_escape_string($commonname), db_escape_string($commonname),
db_escape_string($commondescr), db_escape_string($commondescr),
$weight, db_escape_string($email),
db_escape_string($email)); $weight);
perform_query($query, $link); perform_query($query, $link);
$id = db_insert_id($link); $id = db_insert_id($link);
@ -60,42 +61,50 @@ function create_group($name, $descr, $commonname, $commondescr, $weight ,$email)
return $newdep; return $newdep;
} }
function update_group($groupid, $name, $descr, $commonname, $commondescr, $weight, $email) function update_group($groupid, $name, $descr, $commonname, $commondescr, $email, $weight, $parentgroup)
{ {
global $mysqlprefix; global $mysqlprefix;
$link = connect(); $link = connect();
$query = sprintf( $query = sprintf(
"update ${mysqlprefix}chatgroup set vclocalname = '%s', vclocaldescription = '%s', vccommonname = '%s', vccommondescription = '%s', iweight = %u, vcemail = '%s' where groupid = %s", "update ${mysqlprefix}chatgroup set parent = %s, vclocalname = '%s', vclocaldescription = '%s', vccommonname = '%s', vccommondescription = '%s', vcemail = '%s', iweight = %u where groupid = %s",
($parentgroup?(int)$parentgroup:'NULL'),
db_escape_string($name), db_escape_string($name),
db_escape_string($descr), db_escape_string($descr),
db_escape_string($commonname), db_escape_string($commonname),
db_escape_string($commondescr), db_escape_string($commondescr),
$weight,
db_escape_string($email), db_escape_string($email),
$weight,
$groupid); $groupid);
perform_query($query, $link); perform_query($query, $link);
if ($parentgroup) {
$query = sprintf("update ${mysqlprefix}chatgroup set parent = NULL where parent = %u", $groupid);
perform_query($query, $link);
}
close_connection($link); close_connection($link);
} }
if (isset($_POST['name'])) { if (isset($_POST['name'])) {
$groupid = verifyparam("gid", "/^(\d{1,9})?$/", ""); $groupid = verifyparam("gid", "/^(\d{1,9})?$/", "");
$name = getparam('name'); $name = getparam('name');
$description = getparam('description'); $description = getparam('description');
$commonname = getparam('commonname'); $commonname = getparam('commonname');
$commondescription = getparam('commondescription'); $commondescription = getparam('commondescription');
$weight = getparam('weight');
$email = getparam('email'); $email = getparam('email');
$weight = getparam('weight');
$parentgroup = verifyparam("parentgroup", "/^(\d{1,9})?$/", "");
if (!$name) if (!$name)
$errors[] = no_field("form.field.groupname"); $errors[] = no_field("form.field.groupname");
if ($email != '' && !is_valid_email($email))
$errors[] = wrong_field("form.field.mail");
if (! preg_match("/^\d{1,9}$/", $weight)) if (! preg_match("/^\d{1,9}$/", $weight))
$errors[] = wrong_field("form.field.groupweight"); $errors[] = wrong_field("form.field.groupweight");
if ($email != '' && !is_valid_email($email)) if (! $parentgroup)
$errors[] = wrong_field("form.field.mail"); $parentgroup = NULL;
$existing_group = group_by_name($name); $existing_group = group_by_name($name);
if ((!$groupid && $existing_group) || if ((!$groupid && $existing_group) ||
@ -104,11 +113,11 @@ if (isset($_POST['name'])) {
if (count($errors) == 0) { if (count($errors) == 0) {
if (!$groupid) { if (!$groupid) {
$newdep = create_group($name, $description, $commonname, $commondescription, $weight, $email); $newdep = create_group($name, $description, $commonname, $commondescription, $email, $weight, $parentgroup);
header("Location: $webimroot/operator/groupmembers.php?gid=" . $newdep['groupid']); header("Location: $webimroot/operator/groupmembers.php?gid=" . $newdep['groupid']);
exit; exit;
} else { } else {
update_group($groupid, $name, $description, $commonname, $commondescription, $weight, $email); update_group($groupid, $name, $description, $commonname, $commondescription, $email, $weight, $parentgroup);
header("Location: $webimroot/operator/group.php?gid=$groupid&stored"); header("Location: $webimroot/operator/group.php?gid=$groupid&stored");
exit; exit;
} }
@ -117,8 +126,9 @@ if (isset($_POST['name'])) {
$page['formdescription'] = topage($description); $page['formdescription'] = topage($description);
$page['formcommonname'] = topage($commonname); $page['formcommonname'] = topage($commonname);
$page['formcommondescription'] = topage($commondescription); $page['formcommondescription'] = topage($commondescription);
$page['formweight'] = topage($weight);
$page['formemail'] = topage($email); $page['formemail'] = topage($email);
$page['formweight'] = topage($weight);
$page['formparentgroup'] = topage($parentgroup);
$page['grid'] = topage($groupid); $page['grid'] = topage($groupid);
} }
@ -134,13 +144,15 @@ if (isset($_POST['name'])) {
$page['formdescription'] = topage($group['vclocaldescription']); $page['formdescription'] = topage($group['vclocaldescription']);
$page['formcommonname'] = topage($group['vccommonname']); $page['formcommonname'] = topage($group['vccommonname']);
$page['formcommondescription'] = topage($group['vccommondescription']); $page['formcommondescription'] = topage($group['vccommondescription']);
$page['formweight'] = topage($group['iweight']);
$page['formemail'] = topage($group['vcemail']); $page['formemail'] = topage($group['vcemail']);
$page['formweight'] = topage($group['iweight']);
$page['formparentgroup'] = topage($group['parent']);
$page['grid'] = topage($group['groupid']); $page['grid'] = topage($group['groupid']);
} }
} }
$page['stored'] = isset($_GET['stored']); $page['stored'] = isset($_GET['stored']);
$page['availableParentGroups'] = get_available_parent_groups($groupid);
prepare_menu($operator); prepare_menu($operator);
setup_group_settings_tabs($groupid, 0); setup_group_settings_tabs($groupid, 0);
start_html_output(); start_html_output();

View File

@ -129,7 +129,7 @@ function print_pending_threads($groupids, $since)
: "") . : "") .
($settings['enablegroups'] == '1' ($settings['enablegroups'] == '1'
? "AND (groupid is NULL" . ($groupids ? "AND (groupid is NULL" . ($groupids
? " OR groupid IN ($groupids)" ? " OR groupid IN ($groupids) OR groupid IN (SELECT parent FROM ${mysqlprefix}chatgroup WHERE groupid IN ($groupids)) "
: "") . : "") .
") " ") "
: "") . : "") .

View File

@ -49,7 +49,7 @@ require_once('inc_errors.php');
<?php echo getlocal("canned.group") ?><br/> <?php echo getlocal("canned.group") ?><br/>
<select name="group" onchange="this.form.submit();"><?php <select name="group" onchange="this.form.submit();"><?php
foreach($page['groups'] as $k) { foreach($page['groups'] as $k) {
echo "<option value=\"".$k["groupid"]."\"".($k["groupid"] == form_value("group") ? " selected=\"selected\"" : "").">".$k["vclocalname"]."</option>"; echo "<option value=\"".$k["groupid"]."\"".($k["groupid"] == form_value("group") ? " selected=\"selected\"" : "").">".str_repeat('&nbsp', $k['level']*2).$k["vclocalname"]."</option>";
} ?></select> } ?></select>
</div> </div>

View File

@ -74,7 +74,7 @@ require_once('inc_errors.php');
<div class="fieldinrow"> <div class="fieldinrow">
<div class="flabel"><?php echo getlocal("page.gen_button.choose_group") ?></div> <div class="flabel"><?php echo getlocal("page.gen_button.choose_group") ?></div>
<div class="fvaluenodesc"> <div class="fvaluenodesc">
<select name="group" onchange="this.form.submit();"><?php foreach($page['groups'] as $k) { echo "<option value=\"".$k['groupid']."\"".($k['groupid'] == form_value("group") ? " selected=\"selected\"" : "").">".$k['vclocalname']."</option>"; } ?></select> <select name="group" onchange="this.form.submit();"><?php foreach($page['groups'] as $k) { echo "<option value=\"".$k['groupid']."\"".($k['groupid'] == form_value("group") ? " selected=\"selected\"" : "").">".str_repeat('&nbsp;', $k['level']*2).$k['vclocalname']."</option>"; } ?></select>
</div> </div>
</div> </div>
<br clear="all"/> <br clear="all"/>

View File

@ -86,6 +86,15 @@ require_once('inc_errors.php');
<br clear="all"/> <br clear="all"/>
</div> </div>
<div class="field">
<div class="flabel"><?php echo getlocal('form.field.mail') ?></div>
<div class="fvalue">
<input type="text" name="email" size="40" value="<?php echo form_value('email') ?>" class="formauth"/>
</div>
<div class="fdescr"> &mdash; <?php echo getlocal('form.field.groupemail.description') ?></div>
<br clear="all"/>
</div>
<div class="field"> <div class="field">
<div class="flabel"><?php echo getlocal('form.field.groupweight') ?></div> <div class="flabel"><?php echo getlocal('form.field.groupweight') ?></div>
<div class="fvalue"> <div class="fvalue">
@ -96,14 +105,14 @@ require_once('inc_errors.php');
</div> </div>
<div class="field"> <div class="field">
<div class="flabel"><?php echo getlocal('form.field.mail') ?></div> <div class="flabel"><?php echo getlocal('form.field.groupparent') ?></div>
<div class="fvalue"> <div class="fvalue">
<input type="text" name="email" size="40" value="<?php echo form_value('email') ?>" class="formauth"/> <select name="parentgroup" ><?php foreach($page['availableParentGroups'] as $k) { echo "<option value=\"".$k['groupid']."\"".($k['groupid'] == form_value("parentgroup") ? " selected=\"selected\"" : "").">".str_repeat('&nbsp;', $k['level']*2).$k['vclocalname']."</option>"; } ?></select>
</div> </div>
<div class="fdescr"> &mdash; <?php echo getlocal('form.field.groupemail.description') ?></div> <div class="fdescr"> &mdash; <?php echo getlocal('form.field.groupparent.description') ?></div>
<br clear="all"/> <br clear="all"/>
</div> </div>
<div class="fbutton"> <div class="fbutton">
<input type="image" name="save" value="" src='<?php echo $webimroot.getlocal("image.button.save") ?>' alt='<?php echo getlocal("button.save") ?>'/> <input type="image" name="save" value="" src='<?php echo $webimroot.getlocal("image.button.save") ?>' alt='<?php echo getlocal("button.save") ?>'/>
</div> </div>

View File

@ -73,7 +73,7 @@ require_once('inc_errors.php');
if(count($page['groups']) > 0) { if(count($page['groups']) > 0) {
foreach( $page['groups'] as $grp ) { ?> foreach( $page['groups'] as $grp ) { ?>
<tr> <tr>
<td class="notlast"> <td class="notlast level<?php echo $grp['level'] ?>">
<a href="<?php echo $webimroot ?>/operator/group.php?gid=<?php echo $grp['groupid'] ?>" id="ti<?php echo $grp['groupid'] ?>" class="man"> <a href="<?php echo $webimroot ?>/operator/group.php?gid=<?php echo $grp['groupid'] ?>" id="ti<?php echo $grp['groupid'] ?>" class="man">
<?php echo htmlspecialchars(topage($grp['vclocalname'])) ?> <?php echo htmlspecialchars(topage($grp['vclocalname'])) ?>
</a> </a>

View File

@ -48,7 +48,7 @@ require_once('inc_errors.php');
<b><?php echo $page['currentop'] ?>&lrm;</b> <b><?php echo $page['currentop'] ?>&lrm;</b>
</p> </p>
<?php foreach( $page['groups'] as $pm ) { ?> <?php foreach( $page['groups'] as $pm ) { ?>
<div class="field"> <div class="field level<?php echo $pm['level'] ?>">
<div class="flabel"><?php echo htmlspecialchars(topage($pm['vclocalname'])) ?></div> <div class="flabel"><?php echo htmlspecialchars(topage($pm['vclocalname'])) ?></div>
<div class="fvalue"> <div class="fvalue">
<input type="checkbox" name="group<?php echo $pm['groupid'] ?>" value="on"<?php echo form_value_mb('group',$pm['groupid']) ? " checked=\"checked\"" : "" ?><?php echo $page['canmodify'] ? "" : " disabled=\"disabled\"" ?>/> <input type="checkbox" name="group<?php echo $pm['groupid'] ?>" value="on"<?php echo form_value_mb('group',$pm['groupid']) ? " checked=\"checked\"" : "" ?><?php echo $page['canmodify'] ? "" : " disabled=\"disabled\"" ?>/>