summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2017-08-25 15:06:19 -0700
committerIvan Kohler <ivan@freeside.biz>2017-08-25 15:06:19 -0700
commitcbfeb5f6b7490f78361318ce6290bfb442dbfcbe (patch)
treee6409692bc2376649eeda94344f0a7f578a75428 /httemplate/elements
parent8ffd7de981603a189cd0ea62ca948eaf3f66ca49 (diff)
parent5b5eb87bf66f1fac003a13dc2db48e8970c5c986 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/contact.html4
-rw-r--r--httemplate/elements/notify-tickets.html2
-rw-r--r--httemplate/elements/select-cust_phone.html31
-rw-r--r--httemplate/elements/select.html2
-rw-r--r--httemplate/elements/tr-select-cust_phone.html12
5 files changed, 47 insertions, 4 deletions
diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html
index 850c2540d..faee7ead4 100644
--- a/httemplate/elements/contact.html
+++ b/httemplate/elements/contact.html
@@ -57,7 +57,7 @@
>
<OPTION VALUE="">Disabled
% if ( $value || $self_base_url ) {
- <OPTION VALUE="Y" <% $value eq 'Y' ? 'SELECTED' : '' %>>Enabled
+ <OPTION VALUE="<% $value eq 'Y' ? 'Y' : 'E' %>" <% $value eq 'Y' ? 'SELECTED' : '' %>>Enabled
% if ( $value eq 'Y' && $self_base_url ) {
<OPTION VALUE="R">Re-email
<OPTION VALUE="P"><% $pwd_change_label %>
@@ -74,7 +74,7 @@
&>
<SCRIPT TYPE="text/javascript">
document.getElementById("<%$id%>_<%$field%>").onchange = function() {
- if (this.value == "P") { changepw<%$id%>_toggle(true); }
+ if (this.value == "P" || this.value == "E") { changepw<%$id%>_toggle(true); }
return false
}
</SCRIPT>
diff --git a/httemplate/elements/notify-tickets.html b/httemplate/elements/notify-tickets.html
index 35917c34d..b2541f0e7 100644
--- a/httemplate/elements/notify-tickets.html
+++ b/httemplate/elements/notify-tickets.html
@@ -14,7 +14,7 @@
use Class::Load 'load_class';
my $enabled = $FS::TicketSystem::system eq 'RT_Internal';
-$enabled = 0 if $FS::CurrentUser::CurrentUser->option('hide_notify_tickets');
+$enabled = 0 unless $FS::CurrentUser::CurrentUser->access_right('RT activity notification');
my $UnrepliedTickets;
if ($enabled) {
my $class = 'RT::Search::UnrepliedTickets';
diff --git a/httemplate/elements/select-cust_phone.html b/httemplate/elements/select-cust_phone.html
new file mode 100644
index 000000000..94cd41322
--- /dev/null
+++ b/httemplate/elements/select-cust_phone.html
@@ -0,0 +1,31 @@
+<SELECT NAME="<% $opt{'field_name'} %>" ID="<% $opt{'field_name'} %>">
+
+ <OPTION VALUE="" selected="selected">Select a phone number
+
+% foreach $p (@$phone_types) {
+ <OPTION VALUE="<% $phones_formatted{$p} %>"><% $p |h%> (<% $cust_phones->$p |h %>)
+%}
+
+</SELECT>
+
+<%init>
+
+my %opt = @_;
+my $cust_num = $opt{'cust_num'};
+my $phone_types = $opt{'phone_types'};
+my $format = $opt{'format'};
+
+my $cust_phones = qsearchs('cust_main', { 'custnum' => $cust_num })
+ or die 'unknown custnum' . $cust_num;
+
+my %phones_formatted = map {
+ $_ => format_phone_number($cust_phones->$_, $format)
+} @$phone_types;
+
+sub format_phone_number {
+ my ($n, $f) = @_;
+ if ($f eq 'xxxxxxxxxx') { $n =~ s/-//g; }
+ return $n;
+}
+
+</%init> \ No newline at end of file
diff --git a/httemplate/elements/select.html b/httemplate/elements/select.html
index 689566e36..100df94d0 100644
--- a/httemplate/elements/select.html
+++ b/httemplate/elements/select.html
@@ -69,7 +69,7 @@
%
% }
-</SELECT>
+</SELECT> <% $opt{'post_field_label'} %>
% }
<%init>
diff --git a/httemplate/elements/tr-select-cust_phone.html b/httemplate/elements/tr-select-cust_phone.html
new file mode 100644
index 000000000..cf88392b0
--- /dev/null
+++ b/httemplate/elements/tr-select-cust_phone.html
@@ -0,0 +1,12 @@
+ <TR>
+ <TD ALIGN="right"><% $opt{'label'} || 'Customer Phones' %></TD>
+ <TD>
+ <% include( '/elements/select-cust_phone.html', %opt ) %>
+ </TD>
+ </TR>
+
+<%init>
+
+my %opt = @_;
+
+</%init>