[freeside-commits] freeside/httemplate/browse cgp_rule.html, 1.1.2.5, 1.1.2.6
Ivan,,,
ivan at wavetail.420.am
Sun Jun 6 19:39:58 PDT 2010
Update of /home/cvs/cvsroot/freeside/httemplate/browse
In directory wavetail.420.am:/tmp/cvs-serv2863/httemplate/browse
Modified Files:
Tag: FREESIDE_1_9_BRANCH
cgp_rule.html
Log Message:
domain rules based on templates (rules from other domains), RT#7514
Index: cgp_rule.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/cgp_rule.html,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -w -d -r1.1.2.5 -r1.1.2.6
--- cgp_rule.html 7 Jun 2010 00:09:30 -0000 1.1.2.5
+++ cgp_rule.html 7 Jun 2010 02:39:54 -0000 1.1.2.6
@@ -26,25 +26,45 @@
#agent virt so you can't do cross-agent communigate rules
my $cust_svc = qsearchs('cust_svc', { 'svcnum' => $svcnum })
or die 'unknown svcnum';
+my $part_svc = $cust_svc->part_svc;
my $count_query = "SELECT COUNT(*) FROM cgp_rule WHERE svcnum = $svcnum";
my($svc_label, $svc_value, $svcdb) = $cust_svc->label;
-
my $view = FS::UI::Web::svc_url( 'm' => $m,
'action' => 'view',
- 'part_svc' => $cust_svc->part_svc,
+ 'part_svc' => $part_svc,
'svc' => $cust_svc,
);
my $html_init =
qq(<A HREF="$view">View this $svc_label</A><BR><BR>).
- qq!<A HREF="${p}edit/cgp_rule.html?svcnum=$svcnum">Add new rule</A><BR><BR>!.
+ qq!<A HREF="${p}edit/cgp_rule.html?svcnum=$svcnum">Add new rule</A><BR>!;
+
+if ( $part_svc->svcdb eq 'svc_domain' ) {
+
+ #areyousure for adding these?
+
+ foreach my $line ( FS::Conf->new->config('cgp_rule-domain_templates') ) {
+ $line =~ /^\s*(\d+)\s+(.+)\s*$/ or next;
+ my($t_svcnum, $t_name) = ( $1, $2 );
+ $html_init .=
+ qq!<A HREF="${p}misc/clone-cgp_rule.html?clone=$t_svcnum;svcnum=$svcnum">!
+ ."Add $t_name rule</A><BR>";
+ }
+
+}
+
+$html_init .=
+ '<BR>'.
qq!
<SCRIPT>
- function areyousure(href) {
- if (confirm("Are you sure you want to delete this rule?") == true)
+ function areyousure_delete(href) {
+ areyousure(href,"Are you sure you want to delete this rule?");
+ }
+ function areyousure(href,message) {
+ if (confirm(message) == true)
window.location.href = href;
}
</SCRIPT>
@@ -87,7 +107,7 @@
my $edit_sub = [ $p.'edit/cgp_rule.html?', 'rulenum' ];
my $del_sub = sub {
my $rulenum = shift->rulenum;
- [ "javascript:areyousure('${p}misc/delete-cgp_rule.html?$rulenum')", '' ];
+ [ "javascript:areyousure_delete('${p}misc/delete-cgp_rule.html?$rulenum')", '' ];
};
</%init>
More information about the freeside-commits
mailing list