* fix the bug: can not clean a group's priv.

* fix the bug: can not clean a group's user.
This commit is contained in:
wangchunsheng
2011-03-07 10:02:57 +00:00
parent 308ac499b4
commit af279834ce
4 changed files with 32 additions and 14 deletions
+16 -10
View File
@@ -123,25 +123,31 @@ class group extends control
* @access public
* @return void
*/
public function managePriv($groupID)
public function managePriv($type = 'byGroup', $param = 0)
{
if($type == 'byGroup') $groupID = $param;
if(!empty($_POST))
{
$this->group->updatePriv($groupID);
die(js::alert($this->lang->group->successSaved));
echo js::alert($this->lang->group->successSaved);
die(js::execute('parent.document.body.click();'));
}
$group = $this->group->getById($groupID);
$groupPrivs = $this->group->getPrivs($groupID);
if($type == 'byGroup')
{
$group = $this->group->getById($groupID);
$groupPrivs = $this->group->getPrivs($groupID);
$this->view->header->title = $this->lang->company->common . $this->lang->colon . $group->name . $this->lang->colon . $this->lang->group->managePriv;
$this->view->position[] = $group->name . $this->lang->colon . $this->lang->group->managePriv;
$this->view->header->title = $this->lang->company->common . $this->lang->colon . $group->name . $this->lang->colon . $this->lang->group->managePriv;
$this->view->position[] = $group->name . $this->lang->colon . $this->lang->group->managePriv;
$this->view->group = $group;
$this->view->groupPrivs = $groupPrivs;
$this->view->group = $group;
$this->view->groupPrivs = $groupPrivs;
/* Load lang files of every module. */
foreach($this->lang->resource as $moduleName => $action) $this->app->loadLang($moduleName);
/* Load lang files of every module. */
foreach($this->lang->resource as $moduleName => $action) $this->app->loadLang($moduleName);
}
$this->display();
}
+1 -1
View File
@@ -30,7 +30,7 @@
<td class='a-left'><?php echo $group->desc;?></td>
<td class='a-left'><?php foreach($groupUsers[$group->id] as $user) echo $user . ' ';?></td>
<td>
<?php common::printLink('group', 'managepriv', "groupID=$group->id", $lang->group->managePriv);?>
<?php common::printLink('group', 'managepriv', "type=byGroup&param=$group->id", $lang->group->managePriv);?>
<?php common::printLink('group', 'managemember', "groupID=$group->id", $lang->group->manageMember);?>
<?php common::printLink('group', 'edit', "groupID=$group->id", $lang->edit);?>
<?php common::printLink('group', 'copy', "groupID=$group->id", $lang->copy);?>
+7 -1
View File
@@ -34,7 +34,13 @@
</tr>
<tr>
<th class='rowhead'></th>
<td class='a-center'><?php echo html::submitButton() . html::linkButton($lang->goback, $this->createLink('group', 'browse'));?></td>
<td class='a-center'>
<?php
echo html::submitButton();
echo html::linkButton($lang->goback, $this->createLink('group', 'browse'));
echo html::hidden('foo'); // Just a var, to make sure $_POST is not empty.
?>
</td>
</tr>
</table>
</form>
+8 -2
View File
@@ -26,7 +26,7 @@
<?php foreach($moduleActions as $action => $actionLabel):?>
<div class='w-p20 f-left'><input type='checkbox' name='actions[<?php echo $moduleName;?>][]' value='<?php echo $action;?>' <?php if(isset($groupPrivs[$moduleName][$action])) echo "checked";?> />
<?php if(isset($lang->group->newPriv[$moduleName][$actionLabel])):?>
<font color="#FF0000"><?php echo $lang->$moduleName->$actionLabel;?></font>
<span class='red'><?php echo $lang->$moduleName->$actionLabel;?></span>
<?php else:?>
<?php echo $lang->$moduleName->$actionLabel;?>
<?php endif;?>
@@ -38,7 +38,13 @@
<?php endforeach;?>
<tr>
<th class='rowhead'><?php echo $lang->group->checkall;?><input type='checkbox' onclick='checkall(this);'></th>
<td class='a-center'><?php echo html::submitButton($lang->save, 'name="submit"') . html::linkButton($lang->goback, $this->createLink('group', 'browse'));?></td>
<td class='a-center'>
<?php
echo html::submitButton($lang->save);
echo html::linkButton($lang->goback, $this->createLink('group', 'browse'));
echo html::hidden('foo'); // Just a hidden var, to make sure $_POST is not empty.
?>
</td>
</tr>
</table>
</form>