diff options
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/contact.html | 55 | ||||
-rw-r--r-- | httemplate/elements/freeside.css | 10 | ||||
-rw-r--r-- | httemplate/elements/input-date-field.html | 6 | ||||
-rw-r--r-- | httemplate/elements/menu.html | 13 | ||||
-rw-r--r-- | httemplate/elements/popup_link.html | 2 | ||||
-rw-r--r-- | httemplate/elements/search-cust_main.html | 5 | ||||
-rw-r--r-- | httemplate/elements/select-month_year.html | 2 | ||||
-rw-r--r-- | httemplate/elements/select-state.html | 2 | ||||
-rw-r--r-- | httemplate/elements/select-terms.html | 2 | ||||
-rw-r--r-- | httemplate/elements/standardize_locations.html | 18 | ||||
-rw-r--r-- | httemplate/elements/standardize_locations.js | 278 | ||||
-rw-r--r-- | httemplate/elements/tr-pkg_svc.html | 2 | ||||
-rw-r--r-- | httemplate/elements/tr-select-cust_tag.html | 3 |
13 files changed, 20 insertions, 378 deletions
diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html index eea3694e3..a7a33b1f0 100644 --- a/httemplate/elements/contact.html +++ b/httemplate/elements/contact.html @@ -5,38 +5,12 @@ <TABLE> <TR> % foreach my $field ( @fields ) { -% -% my $value = ''; -% if ( $field =~ /^phonetypenum(\d+)$/ ) { -% my $contact_phone = qsearchs('contact_phone', { -% 'contactnum' => $curr_value, -% 'phonetypenum' => $1, -% }); -% if ( $contact_phone ) { -% $value = $contact_phone->phonenum; -% $value .= 'x'.$contact_phone->extension -% if $contact_phone->extension; -% $value = '+'. $contact_phone->countrycode. " $value" -% if $contact_phone->countrycode -% && $contact_phone->countrycode ne '1'; -% } -% } elsif ( $field eq 'emailaddress' ) { -% #XXX multiple not yet supported -% my $contact_email = qsearchs('contact_email', { -% 'contactnum' => $curr_value, -% }); -% $value = $contact_email->emailaddress if $contact_email; -% } else { -% $value = $contact->get($field); -% } - <TD> - <INPUT TYPE = "text" - NAME = "<%$name%>_<%$field%>" - ID = "<%$id%>_<%$field%>" - SIZE = "<% $size{$field} || 15 %>" + <INPUT TYPE = "text" + NAME = "<%$name%>_<%$field%>" + ID = "<%$id%>_<%$field%>" VALUE = "<% scalar($cgi->param($name."_$field")) - || $value |h %>" + || $contact->get($field) |h %>" <% $onchange %> ><BR> <FONT SIZE="-1"><% $label{$field} %></FONT> @@ -71,25 +45,12 @@ if ( $curr_value ) { $contact = new FS::contact {}; } -my %size = ( 'title' => 12 ); - tie my %label, 'Tie::IxHash', - 'first' => 'First name', - 'last' => 'Last name', - 'title' => 'Title/Position', - 'emailaddress' => 'Email', + 'first' => 'First name', + 'last' => 'Last name', + 'title' => 'Title/Position', + 'comment' => 'Comment', ; - -my $first = 0; -foreach my $phone_type ( qsearch({table=>'phone_type', order_by=>'weight'}) ) { - next if $phone_type->typename eq 'Home'; - my $f = 'phonetypenum'.$phone_type->phonetypenum; - $label{$f} = $phone_type->typename. ' phone'; - $size{$f} = $first++ ? 11 : 15; -} - -$label{'comment'} = 'Comment'; - my @fields = keys %label; </%init> diff --git a/httemplate/elements/freeside.css b/httemplate/elements/freeside.css index 6cb15030b..18b14e395 100644 --- a/httemplate/elements/freeside.css +++ b/httemplate/elements/freeside.css @@ -40,16 +40,6 @@ textarea:focus, input[type="text"]:focus, input[type="password"]:focus { border-radius: 2px; } -.fsdisabled { - background-color: #dddddd; - color: #666666; - border: 1px solid #999999; - padding: 1px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; -} - input[type="reset"], input[type="submit"], input[type="button"] { background-color: #dddddd; border: 1px solid #666666; diff --git a/httemplate/elements/input-date-field.html b/httemplate/elements/input-date-field.html index 2a9bc1d53..0ea4be70a 100644 --- a/httemplate/elements/input-date-field.html +++ b/httemplate/elements/input-date-field.html @@ -1,9 +1,8 @@ -% if(!$noinit) { + <LINK REL="stylesheet" TYPE="text/css" HREF="<%$fsurl%>elements/calendar-win2k-2.css" TITLE="win2k-2"> <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar_stripped.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-en.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-setup.js"></SCRIPT> -% } <INPUT TYPE="text" NAME="<% $name %>" ID="<% $name %>_text" VALUE="<% $value %>"> <IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $name %>_button" STYLE="cursor: pointer" TITLE="Select date"> @@ -19,14 +18,13 @@ <%init> -my($name, $value, $format, $usedatetime, $noinit); +my($name, $value, $format, $usedatetime); if ( ref($_[0]) ) { my $opt = shift; $name = $opt->{'name'}; $value = $opt->{'value'}; $format = $opt->{'format'}; $usedatetime = $opt->{'usedatetime'}; - $noinit = $opt->{'noinit'}; } else { ($name, $value, $format, $usedatetime) = @_; } diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 1909d909d..b852a402e 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -190,11 +190,6 @@ foreach my $svcdb ( FS::part_svc->svc_tables() ) { [ $fsurl."search/report_$svcdb.html", '' ]; } - if ( $svcdb eq 'svc_phone' ) { - $report_svc{"Avaialble phone numbers (DIDs)"} = - [ $fsurl."search/phone_avail.html", '' ]; - } - $report_services{$name} = [ \%report_svc, $longname ]; } @@ -369,13 +364,11 @@ $tools_menu{'Process payment batches'} = [ $fsurl.'search/pay_batch.cgi?magic=_d if ( $conf->exists('batch-enable') || $conf->config('batch-enable_payby') ) && $curuser->access_right('Process batches'); $tools_menu{'Process invoice batches'} = [ $fsurl.'search/bill_batch.cgi' ] - if $conf->exists('invoice_print_pdf'); + if ( $conf->exists('invoice_print_pdf') ); $tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ] if $curuser->access_right('Job queue'); $tools_menu{'Ticketing'} = [ \%tools_ticketing, 'Ticketing tools' ] if $conf->config('ticket_system'); -$tools_menu{'Business card scan'} = [ $fsurl.'edit/prospect_main-upload.html' ] - if $curuser->access_right('New prospect'); $tools_menu{'Time Queue'} = [ $fsurl.'search/report_timeworked.html', 'View pending support time' ] if $curuser->access_right('Time queue'); $tools_menu{'Attachments'} = [ $fsurl.'browse/cust_attachment.html', 'View customer attachments' ] @@ -544,8 +537,8 @@ my $wiki = 'http://www.freeside.biz/mediawiki/index.php'; my $doc_link = $conf->config('support-key') ? "$wiki/Supported:Documentation" : $curuser->access_right('Configuration') - ? "$wiki/Freeside:2.1:Documentation" - : "$wiki/Freeside:2.1:Documentation:User"; + ? "$wiki/Freeside:1.9:Documentation" + : "$wiki/Freeside:1.9:Documentation:User"; eval "use RT;" if $conf->config('ticket_system') eq 'RT_Internal'; diff --git a/httemplate/elements/popup_link.html b/httemplate/elements/popup_link.html index fbb6ce3b8..49b624c84 100644 --- a/httemplate/elements/popup_link.html +++ b/httemplate/elements/popup_link.html @@ -11,7 +11,7 @@ Example: 'label' => 'click me', # text of <A> tag #strongly recommended - 'actionlabel' => 'You clicked', # popup title + 'actionlabel => 'You clicked', # popup title #opt 'width' => 540, diff --git a/httemplate/elements/search-cust_main.html b/httemplate/elements/search-cust_main.html index e8c645eca..317922d3c 100644 --- a/httemplate/elements/search-cust_main.html +++ b/httemplate/elements/search-cust_main.html @@ -11,7 +11,7 @@ Example: ); </%doc> -<INPUT TYPE="hidden" NAME="<% $field %>" ID="<% $field %>" VALUE="<% $value %>"> +<INPUT TYPE="hidden" NAME="<% $field %>" VALUE="<% $value %>"> <!-- some false laziness w/ misc/batch-cust_pay.html, though not as bad as i'd thought at first... --> @@ -60,9 +60,6 @@ Example: function smart_<% $field %>_search(what) { - if ( <% $field %>_search_active ) - return; - var customer = what.value; if ( customer == 'searching...' || customer == '' diff --git a/httemplate/elements/select-month_year.html b/httemplate/elements/select-month_year.html index cbf90b6d7..34476bc94 100644 --- a/httemplate/elements/select-month_year.html +++ b/httemplate/elements/select-month_year.html @@ -12,7 +12,7 @@ % if ( $opt{'show_month_abbr'} ) { % @mon = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); % } else { -% @mon = ( ( map "0$_", 1 .. 9 ), 10 .. 12 ), +% @mon = ( 1 .. 12 ); % } % % my $date = $opt{'selected_date'} || ''; diff --git a/httemplate/elements/select-state.html b/httemplate/elements/select-state.html index 2d60fde0f..9b358e24d 100644 --- a/httemplate/elements/select-state.html +++ b/httemplate/elements/select-state.html @@ -32,7 +32,7 @@ Example: % foreach my $state ( keys %states ) { - <OPTION VALUE="<% $state |h %>"<% $state eq $opt{'state'} ? ' SELECTED' : '' %>><% $states{$state} || '(n/a)' |h %> + <OPTION VALUE="<% $state |h %>"<% $state eq $opt{'state'} ? ' SELECTED' : '' %>><% $states{$state} || '(n/a)' %> % } diff --git a/httemplate/elements/select-terms.html b/httemplate/elements/select-terms.html index 1ca586e60..52f9fb542 100644 --- a/httemplate/elements/select-terms.html +++ b/httemplate/elements/select-terms.html @@ -33,7 +33,7 @@ my $empty_label = my $empty_value = $opt{'empty_value'} || ''; my @terms = ( 'Payable upon receipt', - ( map "Net $_", 0, 10, 15, 20, 30, 45, 60, 90 ), + ( map "Net $_", 0, 10, 15, 20, 30, 45, 60 ), ); my @pre_options = $opt{pre_options} ? @{ $opt{pre_options} } : (); diff --git a/httemplate/elements/standardize_locations.html b/httemplate/elements/standardize_locations.html deleted file mode 100644 index 9f8b71c62..000000000 --- a/httemplate/elements/standardize_locations.html +++ /dev/null @@ -1,18 +0,0 @@ -<% include('/elements/init_overlib.html') %> - -<% include( '/elements/xmlhttp.html', - 'url' => $p.'misc/xmlhttp-cust_main-address_standardize.html', - 'subs' => [ 'address_standardize' ], - #'method' => 'POST', #could get too long? - ) -%> - -<SCRIPT TYPE="text/javascript"> - <% include('/elements/standardize_locations.js', %options) %> -</SCRIPT> - -<%init> - -my (%options) = @_; - -</%init> diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js deleted file mode 100644 index e6a4aa607..000000000 --- a/httemplate/elements/standardize_locations.js +++ /dev/null @@ -1,278 +0,0 @@ -function standardize_locations() { - - var cf = document.<% $formname %>; - - var state_el = cf.elements['<% $main_prefix %>state']; - var ship_state_el = cf.elements['<% $ship_prefix %>state']; - - var address_info = new Array( -% if ( $onlyship ) { - 'onlyship', 1, -% } else { -% if ( $withfirm ) { - 'company', cf.elements['<% $main_prefix %>company'].value, -% } - 'address1', cf.elements['<% $main_prefix %>address1'].value, - 'address2', cf.elements['<% $main_prefix %>address2'].value, - 'city', cf.elements['<% $main_prefix %>city'].value, - 'state', state_el.options[ state_el.selectedIndex ].value, - 'zip', cf.elements['<% $main_prefix %>zip'].value, -% } -% if ( $withfirm ) { - 'ship_company', cf.elements['<% $ship_prefix %>company'].value, -% } - 'ship_address1', cf.elements['<% $ship_prefix %>address1'].value, - 'ship_address2', cf.elements['<% $ship_prefix %>address2'].value, - 'ship_city', cf.elements['<% $ship_prefix %>city'].value, - 'ship_state', ship_state_el.options[ ship_state_el.selectedIndex ].value, - 'ship_zip', cf.elements['<% $ship_prefix %>zip'].value - ); - - address_standardize( address_info, update_address ); - -} - -var standardize_address; - -function update_address(arg) { - - var argsHash = eval('(' + arg + ')'); - - var changed = argsHash['address_standardized']; - var ship_changed = argsHash['ship_address_standardized']; - var error = argsHash['error']; - var ship_error = argsHash['ship_error']; - - - //yay closures - standardize_address = function () { - - var cf = document.<% $formname %>; - var state_el = cf.elements['<% $main_prefix %>state']; - var ship_state_el = cf.elements['<% $ship_prefix %>state']; - -% if ( !$onlyship ) { - if ( changed ) { -% if ( $withfirm ) { - cf.elements['<% $main_prefix %>company'].value = argsHash['new_company']; -% } - cf.elements['<% $main_prefix %>address1'].value = argsHash['new_address1']; - cf.elements['<% $main_prefix %>address2'].value = argsHash['new_address2']; - cf.elements['<% $main_prefix %>city'].value = argsHash['new_city']; - setselect(cf.elements['<% $main_prefix %>state'], argsHash['new_state']); - cf.elements['<% $main_prefix %>zip'].value = argsHash['new_zip']; - } -% } - - if ( ship_changed ) { -% if ( $withfirm ) { - cf.elements['<% $ship_prefix %>company'].value = argsHash['new_ship_company']; -% } - cf.elements['<% $ship_prefix %>address1'].value = argsHash['new_ship_address1']; - cf.elements['<% $ship_prefix %>address2'].value = argsHash['new_ship_address2']; - cf.elements['<% $ship_prefix %>city'].value = argsHash['new_ship_city']; - setselect(cf.elements['<% $ship_prefix %>state'], argsHash['new_ship_state']); - cf.elements['<% $ship_prefix %>zip'].value = argsHash['new_ship_zip']; - } - - post_standardization(); - - } - - - - if ( changed || ship_changed ) { - -% if ( $conf->exists('cust_main-auto_standardize_address') ) { - - standardize_address(); - -% } else { - - // popup a confirmation popup - - var confirm_change = - '<CENTER><BR><B>Confirm address standardization</B><BR><BR>' + - '<TABLE>'; - - if ( changed ) { - - confirm_change = confirm_change + - '<TR><TH>Entered billing address</TH>' + - '<TH>Standardized billing address</TH></TR>'; - // + '<TR><TD> </TD><TD> </TD></TR>'; - - if ( argsHash['company'] || argsHash['new_company'] ) { - confirm_change = confirm_change + - '<TR><TD>' + argsHash['company'] + - '</TD><TD>' + argsHash['new_company'] + '</TD></TR>'; - } - - confirm_change = confirm_change + - '<TR><TD>' + argsHash['address1'] + - '</TD><TD>' + argsHash['new_address1'] + '</TD></TR>' + - '<TR><TD>' + argsHash['address2'] + - '</TD><TD>' + argsHash['new_address2'] + '</TD></TR>' + - '<TR><TD>' + argsHash['city'] + ', ' + argsHash['state'] + ' ' + argsHash['zip'] + - '</TD><TD>' + argsHash['new_city'] + ', ' + argsHash['new_state'] + ' ' + argsHash['new_zip'] + '</TD></TR>' + - '<TR><TD> </TD><TD> </TD></TR>'; - - } - - if ( ship_changed ) { - - confirm_change = confirm_change + - '<TR><TH>Entered service address</TH>' + - '<TH>Standardized service address</TH></TR>'; - // + '<TR><TD> </TD><TD> </TD></TR>'; - - if ( argsHash['ship_company'] || argsHash['new_ship_company'] ) { - confirm_change = confirm_change + - '<TR><TD>' + argsHash['ship_company'] + - '</TD><TD>' + argsHash['new_ship_company'] + '</TD></TR>'; - } - - confirm_change = confirm_change + - '<TR><TD>' + argsHash['ship_address1'] + - '</TD><TD>' + argsHash['new_ship_address1'] + '</TD></TR>' + - '<TR><TD>' + argsHash['ship_address2'] + - '</TD><TD>' + argsHash['new_ship_address2'] + '</TD></TR>' + - '<TR><TD>' + argsHash['ship_city'] + ', ' + argsHash['ship_state'] + ' ' + argsHash['ship_zip'] + - '</TD><TD>' + argsHash['new_ship_city'] + ', ' + argsHash['new_ship_state'] + ' ' + argsHash['new_ship_zip'] + '</TD></TR>' + - '<TR><TD> </TD><TD> </TD></TR>'; - - } - - var addresses = 'address'; - var height = 268; - if ( changed && ship_changed ) { - addresses = 'addresses'; - height = 396; // #what - } - - confirm_change = confirm_change + - '<TR><TD>' + - '<BUTTON TYPE="button" onClick="post_standardization();"><IMG SRC="<%$p%>images/error.png" ALT=""> Use entered ' + addresses + '</BUTTON>' + - '</TD><TD>' + - '<BUTTON TYPE="button" onClick="standardize_address();"><IMG SRC="<%$p%>images/tick.png" ALT=""> Use standardized ' + addresses + '</BUTTON>' + - '</TD></TR>' + - '<TR><TD COLSPAN=2 ALIGN="center">' + - '<BUTTON TYPE="button" onClick="document.<% $formname %>.submitButton.disabled=false; parent.cClick();"><IMG SRC="<%$p%>images/cross.png" ALT=""> Cancel submission</BUTTON></TD></TR>' + - - '</TABLE></CENTER>'; - - overlib( confirm_change, CAPTION, 'Confirm address standardization', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, height, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 ); - -% } - - } else { - - post_standardization(); - - } - - -} - -function post_standardization() { - - var cf = document.<% $formname %>; - -% if ( $conf->exists('enable_taxproducts') ) { - - if ( new String(cf.elements['<% $taxpre %>zip'].value).length < 10 ) - { - - var country_el = cf.elements['<% $taxpre %>country']; - var country = country_el.options[ country_el.selectedIndex ].value; - var geocode = cf.elements['geocode'].value; - - if ( country == 'CA' || country == 'US' ) { - - var state_el = cf.elements['<% $taxpre %>state']; - var state = state_el.options[ state_el.selectedIndex ].value; - - var url = "<% $p %>/misc/choose_tax_location.html" + - "?data_vendor=cch-zip" + - ";city=" + cf.elements['<% $taxpre %>city'].value + - ";state=" + state + - ";zip=" + cf.elements['<% $taxpre %>zip'].value + - ";country=" + country + - ";geocode=" + geocode + - ";formname=" + '<% $formname %>' + - ";"; - - // popup a chooser - OLgetAJAX( url, update_geocode, 300 ); - - } else { - - cf.elements['geocode'].value = 'DEFAULT'; - <% $post_geocode %>; - - } - - } else { - - cf.elements['geocode'].value = ''; - <% $post_geocode %>; - - } - -% } else { - - <% $post_geocode %>; - -% } - -} - -function update_geocode() { - - //yay closures - set_geocode = function (what) { - - var cf = document.<% $formname %>; - - //alert(what.options[what.selectedIndex].value); - var argsHash = eval('(' + what.options[what.selectedIndex].value + ')'); - cf.elements['<% $taxpre %>city'].value = argsHash['city']; - setselect(cf.elements['<% $taxpre %>state'], argsHash['state']); - cf.elements['<% $taxpre %>zip'].value = argsHash['zip']; - cf.elements['geocode'].value = argsHash['geocode']; - <% $post_geocode %>; - - } - - // popup a chooser - - overlib( OLresponseAJAX, CAPTION, 'Select tax location', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 ); - -} - -function setselect(el, value) { - - for ( var s = 0; s < el.options.length; s++ ) { - if ( el.options[s].value == value ) { - el.selectedIndex = s; - } - } - -} -<%init> - -my %opt = @_; -my $conf = new FS::Conf; - -my $withfirm = 1; - -my $formname = $opt{form} || 'CustomerForm'; -my $onlyship = $opt{onlyship} || ''; -my $main_prefix = $opt{main_prefix} || ''; -my $ship_prefix = $opt{ship_prefix} || ($onlyship ? '' : 'ship_'); -my $taxpre = $main_prefix; -$taxpre = $ship_prefix if ( $conf->exists('tax-ship_address') || $onlyship ); -my $post_geocode = $opt{callback} || 'post_geocode();'; -$withfirm = 0 if $opt{no_company}; - -</%init> diff --git a/httemplate/elements/tr-pkg_svc.html b/httemplate/elements/tr-pkg_svc.html index e68ed4add..e66bdf7d7 100644 --- a/httemplate/elements/tr-pkg_svc.html +++ b/httemplate/elements/tr-pkg_svc.html @@ -84,7 +84,7 @@ my @part_svc = qsearch('part_svc', {}, '', $where); #my $q_part_pkg = $clone_part_pkg || $part_pkg; #my %pkg_svc = map { $_->svcpart => $_ } $q_part_pkg->pkg_svc; -my %pkg_svc = map { $_->svcpart => $_ } $part_pkg->pkg_svc('disable_linked'=>1); +my %pkg_svc = map { $_->svcpart => $_ } $part_pkg->pkg_svc; my @fixups = (); my $count = 0; diff --git a/httemplate/elements/tr-select-cust_tag.html b/httemplate/elements/tr-select-cust_tag.html index b2b6d967e..d88f3a894 100644 --- a/httemplate/elements/tr-select-cust_tag.html +++ b/httemplate/elements/tr-select-cust_tag.html @@ -1,4 +1,4 @@ -% if ( ($curuser->access_right('Edit customer tags') && @part_tag) || $is_report ) { +% if ( $curuser->access_right('Edit customer tags') && @part_tag ) { <TR> <TD ALIGN="right"><% $opt{'label'} || 'Tags' %></TD> @@ -25,7 +25,6 @@ my $curuser = $FS::CurrentUser::CurrentUser; my %opt = @_; my $cgi = $opt{'cgi'}; -my $is_report = $opt{'is_report'}; my @curr_tagnum = (); if ( $cgi->param('error') ) { |