diff --git a/action.defaultadmin.php b/action.defaultadmin.php index fc7527d3be1275d0e54df99b71a7138e3e4460d1..1eaf183efa809cb581c163c45fce7dfd6e759f31 100644 --- a/action.defaultadmin.php +++ b/action.defaultadmin.php @@ -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'); diff --git a/action.editGroups.php b/action.editGroups.php index 6f2cb87d59e7aad82a3b7b274cc5a8dcc13db830..03dc04739d4c710e7768fa2ea5fa604fe7838943 100644 --- a/action.editGroups.php +++ b/action.editGroups.php @@ -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'); + diff --git a/lib/class.Group.php b/lib/class.Group.php index f6708e9b40692ae867f84b131a28353b918b7846..8db34fdfc9f35783f3537cfec095a58b22e7fd93 100644 --- a/lib/class.Group.php +++ b/lib/class.Group.php @@ -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) { diff --git a/templates/adminpanel.tpl b/templates/adminpanel.tpl index 9185aa910a1573d5eb776c4c06d720d6f5e897ff..e9290daa3d8c9341f737ca61cc0cb8af94da1485 100644 --- a/templates/adminpanel.tpl +++ b/templates/adminpanel.tpl @@ -12,7 +12,9 @@ <td style="vertical-align:top;">{$selectgroup}</td></tr> <tr><td colspan="2" style="text-align: center;">{$searchButton} {$newButton}</td> -</tr></tbody></table> +</tr> +<tr><td colspan="2" style="text-align: center;">{$groupButton}</td></tr> +</tbody></table> {$end_form} {if !empty($Persons)} diff --git a/templates/groupEditPanel.tpl b/templates/groupEditPanel.tpl new file mode 100644 index 0000000000000000000000000000000000000000..8ca44f35c40ea724e189d6ed2632f157af4d87f5 --- /dev/null +++ b/templates/groupEditPanel.tpl @@ -0,0 +1,17 @@ +{$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> </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}