-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathgroupmembersettings.page.php
97 lines (83 loc) · 4.47 KB
/
groupmembersettings.page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
/*
Copyright (c) 2007-2009 BeVolunteer
This file is part of BW Rox.
BW Rox is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
BW Rox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/> or
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/**
* @author Fake51
*/
/**
* This page handles member settings for a group
*
* @package Apps
* @subpackage Groups
*/
class GroupMemberSettingsPage extends GroupsSubPage
{
protected function column_col3()
{
echo '<div class="row"><div class="col-12">';
$formkit = $this->layoutkit->formkit;
$callbacktag = $formkit->setPostCallback('GroupsController', 'changeMemberSettings');
$words = $this->getWords();
$resultmsg = $problemmsg = '';
$redirected = $formkit->mem_from_redirect;
if (is_object($redirected))
{
$resultmsg = (($redirected->result) ? "<p class=\"alert-success p-2\">{$words->get('GroupMemberSettingsUpdated')}</p>" : "<p class=\"alert-warning p-2\">{$words->get('GroupMemberSettingsNotUpdated')}</p>");
$problemmsg = (($redirected->problems) ? "<p class=\"alert-danger p-2\">{$words->get('GroupMemberSettingsProblems')}</p>" : '');
}
$membershipinfo = $this->member->getGroupMembership($this->group);
?>
<?= $resultmsg; ?>
<?= $problemmsg; ?>
<form action="" method="post">
<?= $callbacktag; ?>
<h2><?= $words->get('GroupsMemberSettings') ;?><?= htmlspecialchars($this->group->Name, ENT_QUOTES) ?></h2>
<input type='hidden' name='member_id' value='<?= $this->member->id ;?>' />
<input type='hidden' name='group_id' value='<?= $membershipinfo->IdGroup ;?>' />
<div class="row">
<div class="col-12 col-md-6">
<div class="o-form-group"><label for="comment"><?= $words->get('GroupsMemberComments') ;?></label><br>
<textarea class="o-input" id="comment" name="membershipinfo_comment" cols="30" rows="3"><?= (($membershipinfo->Comment != '' ) ? htmlspecialchars($words->mTrad($membershipinfo->Comment)) : '' ); ?></textarea>
</div>
</div> <!-- row -->
<div class="col-12 col-md-6">
<label><?= $words->get('GroupsMemberAcceptMail') ;?>: </label><br>
<div class="btn-group w-100" data-toggle="buttons">
<label class="btn btn-outline-primary <?= (($membershipinfo->IacceptMassMailFromThisGroup == 'yes') ? 'active' : '' ); ?>" for="yes_option">
<input id='yes_option' class="noradio" autocomplete="off" type="radio" value="yes" name="membershipinfo_acceptgroupmail" <?= (($membershipinfo->IacceptMassMailFromThisGroup == 'yes') ? 'checked="checked" ' : '' ); ?>><?= $words->get('yes'); ?>
</label>
<label for="no_option" class="btn btn-outline-primary <?= (($membershipinfo->IacceptMassMailFromThisGroup == 'no') ? 'active' : '' ); ?>">
<input id='no_option' class="noradio" autocomplete="off" type="radio" value="no" name="membershipinfo_acceptgroupmail" <?= (($membershipinfo->IacceptMassMailFromThisGroup == 'no' || !$membershipinfo->IacceptMassMailFromThisGroup) ? 'checked="checked" ' : '' ); ?>><?= $words->get('no'); ?>
</label>
</div>
</div>
<?php if ($membershipinfo->IdMember < 0) { ?>
<p><?= $words->get('GroupMemberSettingsDisabledInfo') ?></p>
<?php } ?>
<div class="col-12">
<input type="submit" class="btn btn-primary pull-right" value="<?= $words->getBuffered('GroupsUpdateMemberSettings') ;?>"><?=$words->flushBuffer();?>
</div>
</div>
</form>
</div>
</div>
<?php
}
protected function getSubmenuActiveItem() {
return 'membersettings';
}
}