summaryrefslogtreecommitdiff
path: root/httemplate/edit/cgp_rule-vacation.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit/cgp_rule-vacation.html')
-rw-r--r--httemplate/edit/cgp_rule-vacation.html64
1 files changed, 64 insertions, 0 deletions
diff --git a/httemplate/edit/cgp_rule-vacation.html b/httemplate/edit/cgp_rule-vacation.html
new file mode 100644
index 000000000..8c288852b
--- /dev/null
+++ b/httemplate/edit/cgp_rule-vacation.html
@@ -0,0 +1,64 @@
+<% include('/elements/header-popup.html', 'Vacation rule') %>
+
+<% include('/elements/error.html') %>
+
+<FORM NAME="VacationForm" ACTION="process/cgp_rule-vacation.html" METHOD=POST>
+
+<INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $opt{'svcnum'} %>">
+
+<% ntable("#cccccc", 2) %>
+
+<TR>
+ <TD ALIGN="right">Vacation message</TD>
+ <TD><textarea name="VacationText" rows="5" cols="50"><% $reply_with ? $reply_with->params : '' %></textarea></TD>
+</TR>
+
+<% include('/elements/tr-input-date-field.html', {
+ 'label' => 'Ends',
+ 'name' => 'vacationTill',
+ 'format' => '%d %b %Y',
+ 'value' => ( $cgi->param('error')
+ ? scalar($cgi->param('vacationTill'))
+ : ( $curr_date ? $curr_date->params : '' )
+ ),
+ })
+%>
+
+%#Clear 'Replied Addresses' List ?
+
+</TABLE>
+
+<BR>
+<INPUT TYPE="submit" VALUE="<% $cgp_rule ? 'Edit' : 'Add' %> vacation message">
+
+</FORM>
+
+</BODY>
+</HTML>
+<%init>
+
+my %opt = @_;
+
+my $svc_acct = qsearchs('svc_acct', { 'svcnum' => $opt{'svcnum'} } )
+ or die "unknown svcnum";
+
+#look for existing rule
+my $cgp_rule = qsearchs('cgp_rule', { 'svcnum' => $svc_acct->svcnum,
+ 'name' => '#Vacation'
+ }
+ );
+
+my( $curr_date, $reply_with ) = ( '', '' );
+if ( $cgp_rule ) {
+ $curr_date = qsearchs('cgp_rule_condition', {
+ 'rulenum' => $cgp_rule->rulenum,
+ 'conditionname' => 'Current Date',
+ 'op' => 'less than',
+ });
+ $reply_with = qsearchs('cgp_rule_action', {
+ 'rulenum' => $cgp_rule->rulenum,
+ 'action' => 'Reply with',
+ });
+}
+
+</%init>