Commit 09e6dea6 authored by Leif Andersson's avatar Leif Andersson
Browse files

B

parent f7d48966
......@@ -55,6 +55,10 @@ if (isset($params['new'])) {
$this->Redirect($id, 'add_edit', $returnid, array());
}
if (isset($params['groupChange'])) {
$this->Redirect($id,'editGroups',$returnid,array());
}
foreach ($fields as $key => $res) {
$value = '';
if (isset($params[$key])) {$value = trim($params[$key]); }
......@@ -70,6 +74,8 @@ $smarty->assign('searchButton',$place);
$place = $this->CreateInputSubmit($id, 'new', 'Ny post');
$smarty->assign('newButton',$place);
$place = $this->CreateInputSubmit($id, 'groupChange', 'Hantera grupper');
$smarty->assign('groupButton',$place);
$name = 'Grupp';
$groupNames = array(' ' => 'None');
......
......@@ -8,8 +8,23 @@ if (! $this->CheckPermission('Use ReglerAddress')) {
}
require_once 'lib/class.Group.php';
$smarty = $this->smarty;
$smarty->assign('headline','Grupphantering');
$place = $this->CreateFormStart($id, 'editGroups', $returnid);
$smarty->assign('start_form', $place);
$smarty->assign('end_form', $this->CreateFormEnd());
$groups = Group::GetGroupList();
foreach ($groups as $group) {
$group->change = 'Change';
$group->print = 'Print';
}
$smarty->assign('Groups',$groups);
echo $this->ProcessTemplate('groupEditPanel.tpl');
......
......@@ -28,7 +28,7 @@ EOS;
EOS;
private static $groupFields = array('ID', 'Gruppnamn', 'GruppInfo');
private static $buttonFields = array('change','print');
private static $instance;
......@@ -36,6 +36,7 @@ EOS;
private function __construct($param = NULL) {
foreach (self::$groupFields as $field) {$this->$field = '';}
foreach (self::$buttonFields as $field) {$this->$field = '';}
if (is_null($param)) return;
if (is_array($param)) {
foreach (self::$groupFields as $field) {
......
......@@ -12,7 +12,9 @@
<td style="vertical-align:top;">{$selectgroup}</td></tr>
<tr><td colspan="2" style="text-align: center;">{$searchButton}&nbsp;{$newButton}</td>
</tr></tbody></table>
</tr>
<tr><td colspan="2" style="text-align: center;">{$groupButton}</td></tr>
</tbody></table>
{$end_form}
{if !empty($Persons)}
......
{$start_form}
<table CELLPADDING="3" align="center" bgcolor="#f0f0ff">
<thead><tr><td bgcolor="#000080" colspan="5" style="text-align: center;
font-size: 200%; font-weight:bold; color: white;">{$headline}</td></tr>
<tr><td colspan="3"><td>&nbsp;</td></tr>
</thead>
<tbody>
{if !empty($groups)}
{foreach $groups as $group}
<tr><td>{$group->ID}</td><td>{$group->Gruppnamn}</td>
<td>{$group->GruppInfo}</td><td>{$group->change}</td>
<td>{$group->print}</td></tr>
{/foreach}
{/if}
</tbody></table>
{$hidden}
{$end_form}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment