rename query parameters

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@432 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2009-03-22 21:34:08 +00:00
parent 2fb7e37d7b
commit aa8e7241d5
4 changed files with 17 additions and 17 deletions

View File

@ -17,7 +17,7 @@ require_once('../libs/operator.php');
$operator = check_login(); $operator = check_login();
$page = array('depid' => ''); $page = array('grid' => '');
$errors = array(); $errors = array();
$groupid = ''; $groupid = '';
@ -70,7 +70,7 @@ function update_group($groupid,$name,$descr,$commonname,$commondescr) {
if( isset($_POST['name'])) { if( isset($_POST['name'])) {
$groupid = verifyparam( "dep", "/^(\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');
@ -99,22 +99,22 @@ 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['depid'] = topage($groupid); $page['grid'] = topage($groupid);
} }
} else if( isset($_GET['dep']) ) { } else if( isset($_GET['gid']) ) {
$groupid = verifyparam( 'dep', "/^\d{1,9}$/"); $groupid = verifyparam( 'gid', "/^\d{1,9}$/");
$group = group_by_id($groupid); $group = group_by_id($groupid);
if( !$group ) { if( !$group ) {
$errors[] = getlocal("page.group.no_such"); $errors[] = getlocal("page.group.no_such");
$page['depid'] = topage($groupid); $page['grid'] = topage($groupid);
} else { } else {
$page['formname'] = topage($group['vclocalname']); $page['formname'] = topage($group['vclocalname']);
$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['depid'] = topage($group['groupid']); $page['grid'] = topage($group['groupid']);
} }
} }

View File

@ -21,7 +21,7 @@ if( isset($_GET['act']) && $_GET['act'] == 'del' ) {
// TODO check permissions, delete in other places // TODO check permissions, delete in other places
$groupid = verifyparam( "dep", "/^(\d{1,9})?$/"); $groupid = verifyparam( "gid", "/^(\d{1,9})?$/");
$link = connect(); $link = connect();
perform_query("delete from chatgroup where groupid = $groupid",$link); perform_query("delete from chatgroup where groupid = $groupid",$link);

View File

@ -19,10 +19,10 @@ $page['menuid'] = "groups";
function tpl_content() { global $page, $webimroot, $errors; function tpl_content() { global $page, $webimroot, $errors;
?> ?>
<?php if( $page['depid'] ) { ?> <?php if( $page['grid'] ) { ?>
<?php echo getlocal("page.group.intro") ?> <?php echo getlocal("page.group.intro") ?>
<?php } ?> <?php } ?>
<?php if( !$page['depid'] ) { ?> <?php if( !$page['grid'] ) { ?>
<?php echo getlocal("page.group.create_new") ?> <?php echo getlocal("page.group.create_new") ?>
<?php } ?> <?php } ?>
<br /> <br />
@ -32,7 +32,7 @@ require_once('inc_errors.php');
?> ?>
<form name="groupForm" method="post" action="<?php echo $webimroot ?>/operator/group.php"> <form name="groupForm" method="post" action="<?php echo $webimroot ?>/operator/group.php">
<input type="hidden" name="dep" value="<?php echo $page['depid'] ?>"/> <input type="hidden" name="gid" value="<?php echo $page['grid'] ?>"/>
<div> <div>
<div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner"> <div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner">

View File

@ -48,21 +48,21 @@ function tpl_content() { global $page, $webimroot;
<tbody> <tbody>
<?php <?php
if(count($page['groups']) > 0) { if(count($page['groups']) > 0) {
foreach( $page['groups'] as $dep ) { ?> foreach( $page['groups'] as $grp ) { ?>
<tr> <tr>
<td class="notlast"> <td class="notlast">
<a href="<?php echo $webimroot ?>/operator/group.php?dep=<?php echo $dep['groupid'] ?>" class="man"> <a href="<?php echo $webimroot ?>/operator/group.php?gid=<?php echo $grp['groupid'] ?>" class="man">
<?php echo htmlspecialchars(topage($dep['vclocalname'])) ?> <?php echo htmlspecialchars(topage($grp['vclocalname'])) ?>
</a> </a>
</td> </td>
<td class="notlast"> <td class="notlast">
<?php echo $dep['vclocaldescription'] ? htmlspecialchars(topage($dep['vclocaldescription'])) : "&lt;none&gt;" ?> <?php echo $grp['vclocaldescription'] ? htmlspecialchars(topage($grp['vclocaldescription'])) : "&lt;none&gt;" ?>
</td> </td>
<td> <td>
<?php echo htmlspecialchars(topage($dep['inumofagents'])) ?> <?php echo htmlspecialchars(topage($grp['inumofagents'])) ?>
</td> </td>
<td> <td>
<a href="<?php echo $webimroot ?>/operator/groups.php?act=del&amp;dep=<?php echo $dep['groupid'] ?>"> <a href="<?php echo $webimroot ?>/operator/groups.php?act=del&amp;gid=<?php echo $grp['groupid'] ?>">
remove remove
</a> </a>
</td> </td>