1 <& /edit/elements/edit.html,
2 'post_url' => $fsurl.'edit/process/msg_template.html',
3 'name_singular' => 'message interface',
4 'table' => 'msg_template',
5 'viewall_dir' => 'browse',
8 'agent_null_right' => [ 'View global templates', 'Edit global templates' ],
10 'fields' => [], # callback takes care of this
11 'new_callback' => $edit_callback,
12 'edit_callback' => $edit_callback,
13 'error_callback' => $edit_callback,
15 'no_submit' => $no_submit,
18 my $curuser = $FS::CurrentUser::CurrentUser;
21 unless $curuser->access_right([ 'View templates', 'View global templates',
22 'Edit templates', 'Edit global templates',
26 'msgnum' => 'Template', # it's still a template number
27 'agentnum' => 'Agent',
28 'msgname' => 'Interface name',
29 'prepare_url' => 'Prepare URL',
30 'send_url' => 'Send URL',
31 'username' => 'HTTP username',
32 'password' => 'HTTP password',
33 'content' => 'Additional POST content',
38 my $edit_callback = sub {
39 my ($cgi, $msg_template, $fields, $opt) = @_;
40 if ( $curuser->access_right('Edit global templates')
41 || ( $curuser->access_right('Edit templates')
43 && $msg_template->agentnum
44 && $curuser->agentnums_href->{$msg_template->agentnum}
48 { field => 'msgclass',
52 { field => 'agentnum',
53 type => 'select-agent',
55 { field => 'msgname', size=>60, required => 1 },
56 { field => 'prepare_url', size=>60, required => 1 },
57 { field => 'send_url', size=>60, required => 1 },
58 { field => 'username', size=>20 },
59 { field => 'password', size=>20 },
60 { field => 'content', type => 'textarea' },
67 { field => 'agentnum',
68 type => 'select-agent',
71 { field => 'msgname', type => 'fixed', },
72 { field => 'prepare_url', type => 'fixed', },
73 { field => 'send_url', type => 'fixed', },
74 { field => 'username', type => 'fixed', },
75 { field => 'password', type => 'fixed', },
76 { field => 'content', type => 'fixed' },