Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Leif Andersson
ReglerAddress
Commits
a34f89ef
Commit
a34f89ef
authored
Sep 21, 2015
by
Leif Andersson
Browse files
Ändrade namn på class Group till Groups. Städade upp.
parent
c49d00b9
Changes
6
Hide whitespace changes
Inline
Side-by-side
action.add_edit_Group.php
View file @
a34f89ef
...
...
@@ -12,12 +12,14 @@ foreach ($paramKeys as $key) {
$this
->
Redirect
(
$id
,
'printGroup'
,
$returnid
,
array
(
'ID'
=>
$ID
));
return
;
}
if
(
isset
(
$params
[
'back'
]))
{
$this
->
Redirect
(
$id
,
'defaultadmin'
,
$returnid
,
array
());
}
if
(
!
$this
->
CheckPermission
(
'Use ReglerAddress'
))
{
return
$this
->
DisplayErrorPage
(
$id
,
$params
,
$returnid
,
'ReglerAddress access denied.'
);
}
require_once
'lib/class.Group.php'
;
//
require_once 'lib/class.Group.php';
if
(
isset
(
$params
[
'cancelUpdate'
]))
{
$paramsB
=
array
();
...
...
@@ -26,8 +28,8 @@ if (isset($params['cancelUpdate'])) {
}
if
(
isset
(
$params
[
'submit'
]))
{
$record
=
new
Group
(
$params
);
echo
'<pre>'
;
print_r
(
$record
);
echo
'</pre>'
;
$record
=
new
Group
s
(
$params
);
//
echo '<pre>'; print_r($record); echo '</pre>';
$record
->
updateRecord
();
$paramsB
[
'module_message'
]
=
'Gruppen ändrad'
;
$this
->
Redirect
(
$id
,
'editGroups'
,
$returnid
,
$paramsB
);
...
...
@@ -48,16 +50,16 @@ foreach ($paramKeys as $key) {
break
;
}
if
(
isset
(
$params
[
'new'
])){
$group
=
new
Group
();
$group
=
new
Group
s
();
$ID
=
''
;
}
else
{
$group
=
new
Group
(
$ID
);
$group
=
new
Group
s
(
$ID
);
}
$place
=
$this
->
CreateFormStart
(
$id
,
'add_edit_Group'
,
$returnid
);
$smarty
->
assign
(
'start_form'
,
$place
);
$smarty
->
assign
(
'end_form'
,
$this
->
CreateFormEnd
());
$fields
=
Group
::
$groupFields
;
$fields
=
Group
s
::
$groupFields
;
$smarty
->
assign
(
'title_ID'
,
'ID'
);
$smarty
->
assign
(
'value_ID'
,
$ID
);
...
...
action.changeGroups.php
View file @
a34f89ef
...
...
@@ -6,7 +6,7 @@ if (! $this->CheckPermission('Use ReglerAddress')) {
return
$this
->
DisplayErrorPage
(
$id
,
$params
,
$returnid
,
'ReglerAddress access denied.'
);
}
require_once
'lib/class.Group.php'
;
//
require_once 'lib/class.Group.php';
if
(
isset
(
$params
[
'back'
]))
{
$paramsB
=
array
();
...
...
@@ -29,18 +29,18 @@ $smarty->assign('headline',$headline);
if
(
isset
(
$params
[
'setMember'
]))
{
$GroupID
=
$params
[
'nonmembers'
];
Group
::
setMember
(
$ID
,
$GroupID
);
Group
::
setMailLists
();
Group
s
::
setMember
(
$ID
,
$GroupID
);
Group
s
::
setMailLists
();
}
if
(
isset
(
$params
[
'unsetMember'
]))
{
$GroupID
=
$params
[
'members'
];
Group
::
UnsetMember
(
$ID
,
$GroupID
);
Group
::
setMailLists
();
Group
s
::
UnsetMember
(
$ID
,
$GroupID
);
Group
s
::
setMailLists
();
}
$members
=
Group
::
getMembers
(
$ID
);
$nonmembers
=
Group
::
getNonMembers
(
$ID
);
$members
=
Group
s
::
getMembers
(
$ID
);
$nonmembers
=
Group
s
::
getNonMembers
(
$ID
);
// echo '<pre>'; print_r($nonmembers); echo '</pre>';
...
...
action.defaultadmin.php
View file @
a34f89ef
...
...
@@ -10,7 +10,7 @@
* line which check to make sure that method was called from the module
* API, and that everything's safe to continue:
*/
require_once
'lib/class.Group.php'
;
//
require_once 'lib/class.Group.php';
if
(
!
isset
(
$gCms
))
exit
;
//echo '<pre>'; print_r($params); echo '</pre>';
...
...
@@ -30,10 +30,9 @@ $canChangeRecord = $this->CheckPermission('Use ReglerAddress');
* wrapped in the DisplayAdminPanel() method in the module body.
*/
$groups
=
Group
::
getGroupList
();
$groups
=
Group
s
::
getGroupList
();
//echo '<pre>'; print_r($groups); echo '</pre>'; exit;
//file_put_contents("/tmp/defaultadmin.txt",print_r($params,TRUE));
$addrDB
=
AddressDB
::
getDB
();
$smarty
=
$this
->
smarty
;
// echo '<pre>'; print_r($params); echo '</pre>';
...
...
action.editGroups.php
View file @
a34f89ef
<?php
if
(
!
isset
(
$gCms
))
exit
;
//echo '<pre>'; print_r($params); echo '</pre>';
require_once
'lib/class.Group.php'
;
//
require_once 'lib/class.Group.php';
$canChangeRecord
=
$this
->
CheckPermission
(
'Use ReglerAddress'
);
/* if (! $this->CheckPermission('Use ReglerAddress')) { */
...
...
@@ -16,7 +16,7 @@ $place = $this->CreateFormStart($id, 'add_edit_Group', $returnid);
$smarty
->
assign
(
'start_form'
,
$place
);
$smarty
->
assign
(
'end_form'
,
$this
->
CreateFormEnd
());
$groups
=
Group
::
GetGroupList
();
$groups
=
Group
s
::
GetGroupList
();
foreach
(
$groups
as
$group
)
{
if
(
$canChangeRecord
)
{
$group
->
change
=
$this
->
CreateInputSubmit
(
$id
,
'change_'
.
$group
->
ID
,
...
...
@@ -26,6 +26,9 @@ foreach ($groups as $group) {
}
$group
->
print
=
$this
->
CreateInputSubmit
(
$id
,
'print_'
.
$group
->
ID
,
'Skriv ut'
);
}
$place
=
$this
->
CreateInputSubmit
(
$id
,
'back'
,
'Tillbaka'
);
$smarty
->
assign
(
'backButton'
,
$place
);
if
(
$canChangeRecord
)
{
$place
=
$this
->
CreateInputSubmit
(
$id
,
'new'
,
'Lägg till grupp'
);
}
else
{
...
...
lib/class.Group.php
→
lib/class.Group
s
.php
View file @
a34f89ef
<?php
class
Group
{
class
Group
s
{
private
static
$queryList
=
<<<EOS
select ID, Gruppnamn, GruppInfo from Grupper order by Gruppnamn
...
...
@@ -33,7 +33,8 @@ EOS;
EOS;
public
static
$groupFields
=
array
(
'ID'
,
'Gruppnamn'
,
'GruppInfo'
);
//public static $groupFields = array('ID', 'Gruppnamn', 'GruppInfo');
public
static
$groupFields
;
private
static
$buttonFields
=
array
(
'change'
,
'print'
);
private
static
$instance
;
...
...
@@ -41,6 +42,10 @@ EOS;
private
static
$list
=
array
();
public
function
__construct
(
$param
=
NULL
)
{
global
$gCms
;
if
(
!
isset
(
$gCms
))
exit
;
if
(
!
isset
(
self
::
$groupFields
))
{
self
::
$groupFields
=
AddressDB
::
getFields
(
'Grupper'
);
}
foreach
(
self
::
$groupFields
as
$field
)
{
$this
->
$field
=
''
;}
foreach
(
self
::
$buttonFields
as
$field
)
{
$this
->
$field
=
''
;}
if
(
is_null
(
$param
))
return
;
...
...
@@ -100,7 +105,7 @@ EOS;
}
public
static
function
getGroupList
()
{
if
(
count
(
self
::
$list
)
>
0
)
return
$list
;
if
(
count
(
self
::
$list
)
>
0
)
return
self
::
$list
;
global
$gCms
;
if
(
!
isset
(
$gCms
))
exit
;
$c
=
__CLASS__
;
$db
=
AddressDB
::
getDB
();
...
...
templates/groupEditPanel.tpl
View file @
a34f89ef
...
...
@@ -12,7 +12,8 @@
<td>
{
$group
->
print
}
</td></tr>
{/
foreach
}
{/
if
}
<tr><td
colspan=
"5"
style=
"text-align: center;"
>
{
$newButton
}
</td></tr>
<tr><td
colspan=
"5"
style=
"text-align: center;"
>
{
$newButton
}
{
$backButton
}
</td></tr>
</tbody></table>
{
if
isset
(
$hidden
)
}{
$hidden
}{/
if
}
{
$end_form
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment