From ce98306f315a53f2ac4b8c010341c4f84bf728a8 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 19 Oct 2006 14:29:27 +0000 Subject: suspension and cancellation reasons --- httemplate/elements/tr-select-reason.html | 94 +++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100755 httemplate/elements/tr-select-reason.html (limited to 'httemplate/elements/tr-select-reason.html') diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html new file mode 100755 index 000000000..6c66e8170 --- /dev/null +++ b/httemplate/elements/tr-select-reason.html @@ -0,0 +1,94 @@ + + + + + Reason + + + + + + + +

Reason Type

+ + + + + + + + +

New Reason

+ + + + +<%init> +my($name, $class, $init_reason, $init_type, $init_newreason) = @_; +my($extra_sql, $curuser, $access_right, $display, $disabled); + +if ($class eq 'C') { + $access_right='Add on-the-fly cancel reason'; +}elsif ($class eq 'S') { + $access_right='Add on-the-fly suspend reason'; +}else{ + print "illegal class: $class"; +} + +if ($init_reason == -1){ + $display = 'inline'; + $disabled = 'false'; +}else{ + $display = 'none'; + $disabled = 'true'; +} + +$extra_sql = "WHERE class = '$class' ORDER BY reason_type"; +$curuser = $FS::CurrentUser::CurrentUser; + + + -- cgit v1.2.1 From 9811b8ce65909a293810ddbcd8c9b5ca963fba01 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 23 Oct 2006 04:21:04 +0000 Subject: events should attach reasons --- httemplate/elements/tr-select-reason.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'httemplate/elements/tr-select-reason.html') diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html index 6c66e8170..0c05ae74e 100755 --- a/httemplate/elements/tr-select-reason.html +++ b/httemplate/elements/tr-select-reason.html @@ -4,6 +4,11 @@ { %if ($curuser->access_right($access_right)){ + if (document.getElementById('<% $name %>').selectedIndex == 0){ + <% $controlledbutton ? $controlledbutton.'.disabled = true;' : ';' %> + }else{ + <% $controlledbutton ? $controlledbutton.'.disabled = false;' : ';' %> + } if (document.getElementById('<% $name %>').selectedIndex == (document.getElementById('<% $name %>').length - 1)) { @@ -36,6 +41,7 @@ % extra_sql => $extra_sql, % addl_from => 'LEFT JOIN reason_type ON reason_type.typenum = reason.reason_type', % }); + % foreach my $reason (@reasons) { % } @@ -68,7 +74,7 @@ <%init> -my($name, $class, $init_reason, $init_type, $init_newreason) = @_; +my($name, $class, $init_reason, $init_type, $init_newreason, $controlledbutton) = @_; my($extra_sql, $curuser, $access_right, $display, $disabled); if ($class eq 'C') { -- cgit v1.2.1 From af71b2b56cd66e28c6016091284883cb1105091d Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 28 Dec 2006 20:52:00 +0000 Subject: activate submit button more readily --- httemplate/elements/tr-select-reason.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'httemplate/elements/tr-select-reason.html') diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html index 0c05ae74e..2f8f3a109 100755 --- a/httemplate/elements/tr-select-reason.html +++ b/httemplate/elements/tr-select-reason.html @@ -3,13 +3,14 @@ function sh_add<% $name %>() { -%if ($curuser->access_right($access_right)){ if (document.getElementById('<% $name %>').selectedIndex == 0){ <% $controlledbutton ? $controlledbutton.'.disabled = true;' : ';' %> }else{ <% $controlledbutton ? $controlledbutton.'.disabled = false;' : ';' %> } +%if ($curuser->access_right($access_right)){ + if (document.getElementById('<% $name %>').selectedIndex == (document.getElementById('<% $name %>').length - 1)) { document.getElementById('new<% $name %>').disabled = false; -- cgit v1.2.1