[freeside-commits] freeside/httemplate/search mailinglistmember.html, NONE, 1.1.2.1
Ivan,,,
ivan at wavetail.420.am
Mon Mar 22 20:48:03 PDT 2010
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv16892/httemplate/search
Added Files:
Tag: FREESIDE_1_9_BRANCH
mailinglistmember.html
Log Message:
adding svc_mailinglist for communigate "groups" (mailing lists), RT#7514
--- NEW FILE: mailinglistmember.html ---
<% include('elements/search.html',
'title' => $title,
'name_singular' => 'member',
'query' => $query,
'count_query' => $count_query,
'header' => [ 'Email address' ],
'fields' => [ $email_sub, ], #just this one for now
'html_init' => $html_init,
)
%>
<%init>
#XXX ACL:
#make sure the mailing list is attached to a customer service i can see/view
$cgi->param('listnum') =~ /^(\d+)$/ or die 'illegal listnum';
my $listnum = $1;
my $mailinglist = qsearchs('mailinglist', { 'listnum' => $listnum })
or die "unknown listnum $listnum";
my $title = $mailinglist->listname. ' mailing list';
my $query = {
'table' => 'mailinglistmember',
'hashref' => { 'listnum' => $listnum },
};
my $count_query = "SELECT COUNT(*) FROM mailinglistmember WHERE listnum = $listnum";
my $email_sub = sub {
my $member = shift;
my $r = $member->email; #just this one for now
my $a = qq[<A HREF="javascript:areyousure('$r', ]. $member->membernum. ')">';
$r .= " (${a}remove</A>)";
$r;
};
my $html_init = <<"END";
<SCRIPT TYPE="text/javascript">
function areyousure(email,membernum) {
if ( confirm('Are you sure you want to remove ' + email + ' from this mailing list?') )
window.location.href="${p}misc/delete-mailinglistmember.html?" + membernum;
}
</SCRIPT>
END
</%init>
More information about the freeside-commits
mailing list