[freeside-devel] Possible Changes to svc_www.cgi and svc_www.pm

ivan ivan at 420.am
Sat Jun 22 23:29:45 PDT 2002


How about something to "unprovision" any sort of service?  Something like
the `delete-svc_www.cgi' below except generalized for any sort of service.
"Unprovision" links could go on the main view customer screen, the package
view screen and the individual service view screens.  Probably should have
a JavaScript "Are you sure?" like the cancel links do now.

On Sun, Jun 23, 2002 at 01:03:36AM -0400, Stephen Bechard wrote:
> Here is the updated diff of the view/svc_www.cgi with the edit and delete
> links.
> You will also need the new file /misc/delete-svc_www.cgi as well. (see
> below)
> 
> *** /tarballs/freeside-1.4.0pre14/httemplate/view/svc_www.cgi       Tue Feb
> 19 20:03:10 2002
> --- view/svc_www.cgi Sun Jun 23 01:04:35 2002
> ***************
> *** 38,46 ****
>             "${p}misc/cancel-unaudited.cgi?$svcnum" )
>     ),
>     "Main menu" => $p,
> ! )).
> !       "Service #$svcnum".
>         qq!<BR>Website name: <B><A HREF="http://$www">$www</A></B>!.
>         '<BR>'. joblisting({'svcnum'=>$svcnum}, 1).
>         '</BODY></HTML>'
>   ;
> --- 38,61 ----
>             "${p}misc/cancel-unaudited.cgi?$svcnum" )
>     ),
>     "Main menu" => $p,
> ! ));
> !
> ! print <<END;
> ! <SCRIPT>
> ! function svc_www_areyousure(href) {
> !     if (confirm("Are you sure you want to delete this website?")
> !  == true)
> !         window.location.href = href;
> ! }
> ! </SCRIPT>
> ! END
> !
> ! print "Service #$svcnum".
>         qq!<BR>Website name: <B><A HREF="http://$www">$www</A></B>!.
> +       '&nbsp;(&nbsp;<A HREF="'. popurl(2). 'edit/svc_www.cgi?'. $svcnum.
> +           '">Edit</A>&nbsp;)'.
> +       '&nbsp;(&nbsp;<A HREF="javascript:svc_www_areyousure(\''. popurl(2).
> +           'misc/delete-svc_www.cgi?'.  $svcnum. '\')">delete</A>&nbsp;)'.
>         '<BR>'. joblisting({'svcnum'=>$svcnum}, 1).
>         '</BODY></HTML>'
>   ;
> 
> Here is the misc/delete-svc_www.cgi I crafted up based on the other
> misc/delete-* files. Everything works great from the database standpoint,
> but I have the same problem as the edit/svc_www.cgi, nothing gets put back
> into the queue for processing on the remote server. Maybe its in the .pm?
> 
> Well any way here it is and it needs to be put in the misc/ directory.
> 
> -- start of file: delete-svc_www.cgi -----------------------------------
> <%
> 
> #untaint svcnum
> my($query) = $cgi->keywords;
> $query =~ /^(\d+)$/ || die "Illegal svcnum";
> my $svcnum = $1;
> 
> my $svc_www = qsearchs('svc_www',{'svcnum'=>$svcnum});
> my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
> 
> my $error = $svc_www->delete;
> eidiot($error) if $error;
> 
> print $cgi->redirect($p. "view/cust_pkg.cgi?". $cust_svc->pkgnum);
> 
> %>
> -- end of file: delete-svc_www.cgi -----------------------------------
> 
> Enjoy,
> Steve
> 

-- 
_ivan



More information about the freeside-devel mailing list