[freeside-commits] freeside/httemplate/edit/process agent.cgi, 1.6, 1.7
Ivan,,,
ivan at wavetail.420.am
Wed Nov 12 18:22:06 PST 2008
Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv2946/httemplate/edit/process
Modified Files:
agent.cgi
Log Message:
add ability to view/edit access groups of an agent
Index: agent.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/agent.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- agent.cgi 13 Jan 2008 21:35:53 -0000 1.6
+++ agent.cgi 13 Nov 2008 02:22:04 -0000 1.7
@@ -1,30 +1,16 @@
-%if ( $error ) {
-% $cgi->param('error', $error);
-<% $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string ) %>
-%} else {
-<% $cgi->redirect(popurl(3). "browse/agent.cgi") %>
-%}
+<% include( 'elements/process.html',
+ 'table' => 'agent',
+ 'viewall_dir' => 'browse',
+ 'viewall_ext' => 'cgi',
+ 'process_m2m' => { 'link_table' => 'access_groupagent',
+ 'target_table' => 'access_group',
+ },
+ 'edit_ext' => 'cgi',
+ )
+%>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-my $agentnum = $cgi->param('agentnum');
-
-my $old = qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum;
-
-my $new = new FS::agent ( {
- map {
- $_, scalar($cgi->param($_));
- } fields('agent')
-} );
-
-my $error;
-if ( $agentnum ) {
- $error=$new->replace($old);
-} else {
- $error=$new->insert;
- $agentnum=$new->getfield('agentnum');
-}
-
</%init>
More information about the freeside-commits
mailing list