From 822d38841a1620b8b8e8c5ac4102ad64de9ae17f Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 23 Oct 2013 01:53:03 -0700 Subject: add more fields to towers and sectors, RT#16372 --- httemplate/edit/process/tower.html | 2 +- httemplate/edit/tower.html | 28 ++++++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/process/tower.html b/httemplate/edit/process/tower.html index 7353784e5..bbfc1a670 100644 --- a/httemplate/edit/process/tower.html +++ b/httemplate/edit/process/tower.html @@ -2,6 +2,6 @@ table => 'tower', viewall_dir => 'browse', process_o2m => { 'table' => 'tower_sector', - 'fields' => [qw( sectorname ip_addr )], + 'fields' => [qw( sectorname ip_addr height freq_mhz direction width range )], }, &> diff --git a/httemplate/edit/tower.html b/httemplate/edit/tower.html index 673a2713a..00c9adde1 100644 --- a/httemplate/edit/tower.html +++ b/httemplate/edit/tower.html @@ -4,24 +4,32 @@ viewall_dir => 'browse', fields => [ 'towername', { field=>'disabled', type=>'checkbox', value=>'Y', }, - { field => 'default_ip_addr', + { field=>'color', type=>'pickcolor' }, + { field => 'default_ip_addr', curr_value_callback => $default_ip_addr_callback }, + 'latitude', + 'longitude', + 'altitude', + 'height', + 'veg_height', { field => 'sectornum', type => 'tower_sector', o2m_table => 'tower_sector', m2_label => 'Sector', m2_error_callback => $m2_error_callback, }, - 'latitude', - 'longitude', ], - labels => { 'towernum' => 'Tower', - 'towername' => 'Name', - 'sectornum' => 'Sector', - 'disabled' => 'Disabled', + labels => { 'towernum' => 'Tower', + 'towername' => 'Name', + 'sectornum' => 'Sector', + 'disabled' => 'Disabled', 'default_ip_addr' => 'Tower IP address', - 'latitude' => 'Latitude', - 'longitude' => 'Longitude', + 'latitude' => 'Latitude', + 'longitude' => 'Longitude', + 'altitude' => 'Altitude', + 'height' => 'Height', + 'veg_height' => 'Vegetation height', + 'color' => 'Color', }, &> <%init> @@ -29,7 +37,7 @@ my $m2_error_callback = sub { # reconstruct the list my ($cgi, $object) = @_; - my @fields = qw(sectorname ip_addr); + my @fields = qw( sectorname ip_addr height freq_mhz direction width range ); map { my $k = $_; new FS::tower_sector { -- cgit v1.2.1 From c78ac03d2e45a2979523d8c8999ab8714a58941f Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 23 Oct 2013 15:42:46 -0700 Subject: fix disabling of package and customer categories, RT#25110 --- httemplate/edit/elements/class_Common.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/elements/class_Common.html b/httemplate/edit/elements/class_Common.html index 0a0916ebc..723227f23 100644 --- a/httemplate/edit/elements/class_Common.html +++ b/httemplate/edit/elements/class_Common.html @@ -30,7 +30,13 @@ unless ( $opt{'nocat'} ) { my $fields = [ 'classname', (scalar(@category) - ? { field=>'categorynum', type=>'select-table', 'empty_label'=>'(none)', 'table'=>$category_table, 'name_col'=>'categoryname' } + ? { field => 'categorynum', + type => 'select-table', + table => $category_table, + hashref => { 'disabled' => '' }, + name_col => 'categoryname', + empty_label => '(none)', + } : { field=>'categorynum', type=>'hidden' } ), { field=>'disabled', type=>'checkbox', value=>'Y', }, -- cgit v1.2.1 From ac67ba5d343e1e704b9e706e2aa19ecd979a5863 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 24 Oct 2013 00:39:47 -0700 Subject: discount classes, RT#24911 --- httemplate/edit/discount_class.html | 10 ++++++++++ httemplate/edit/process/discount_class.html | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 httemplate/edit/discount_class.html create mode 100644 httemplate/edit/process/discount_class.html (limited to 'httemplate/edit') diff --git a/httemplate/edit/discount_class.html b/httemplate/edit/discount_class.html new file mode 100644 index 000000000..2bf27d996 --- /dev/null +++ b/httemplate/edit/discount_class.html @@ -0,0 +1,10 @@ +<% include( 'elements/class_Common.html', + 'name_singular' => 'Discount class', + 'table' => 'discount_class', + 'nocat' => 1, + 'addl_labels' => { 'classnum' => 'Class', + 'classname' => 'Class', + 'disabled' => 'Disable', + }, + ) +%> diff --git a/httemplate/edit/process/discount_class.html b/httemplate/edit/process/discount_class.html new file mode 100644 index 000000000..e7249464b --- /dev/null +++ b/httemplate/edit/process/discount_class.html @@ -0,0 +1,11 @@ +<% include( 'elements/process.html', + 'table' => 'discount_class', + 'viewall_dir' => 'browse', + ) +%> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + + -- cgit v1.2.1 From ec4ae54938488e037977066b28c6a325272b16fc Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 24 Oct 2013 00:40:05 -0700 Subject: discount classes, RT#24911 --- httemplate/edit/discount.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'httemplate/edit') diff --git a/httemplate/edit/discount.html b/httemplate/edit/discount.html index 9bcd1e724..c2853bd47 100644 --- a/httemplate/edit/discount.html +++ b/httemplate/edit/discount.html @@ -3,6 +3,7 @@ 'table' => 'discount', 'fields' => [ 'name', + { field => 'classnum', type => 'select-discount_class' }, { field => 'disabled', type => 'checkbox', value=>'Y', }, # a weird kind of false laziness # w/elements/tr-select-discount.html @@ -27,6 +28,7 @@ 'labels' => { 'discountnum' => 'Discount #', 'name' => 'Name ', + 'classnum' => 'Class', 'disabled' => 'Disabled ', '_type' => 'Type ', 'amount' => 'Amount ', -- cgit v1.2.1 From 50c2e50db2999c61db1c1c72ae416482ef370d99 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 24 Oct 2013 20:10:28 -0700 Subject: selectable choice for arbitrary fields, RT#25623 --- httemplate/edit/elements/svc_Common.html | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'httemplate/edit') diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html index 321c68545..64484eba0 100644 --- a/httemplate/edit/elements/svc_Common.html +++ b/httemplate/edit/elements/svc_Common.html @@ -121,6 +121,11 @@ $f->{'hashref'} = { 'classnum'=>$columndef->columnvalue }; + } elsif ( $flag eq 'S' ) { #selectable choice + $f->{type} = 'select'; + $f->{options} = [ split( /\s*,\s*/, + $columndef->columnvalue) + ]; } if ( $f->{'type'} eq 'select-svc_pbx' -- cgit v1.2.1 From 96a3ff4adba5871dae5b6f0ea657cc38fbe83513 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 24 Oct 2013 20:11:50 -0700 Subject: style --- httemplate/edit/elements/svc_Common.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html index 64484eba0..413150858 100644 --- a/httemplate/edit/elements/svc_Common.html +++ b/httemplate/edit/elements/svc_Common.html @@ -101,14 +101,17 @@ my $columndef = $part_svc->part_svc_column($f->{'field'}); my $flag = $columndef->columnflag; - if ( $flag eq 'F' ) { + + if ( $flag eq 'F' ) { #fixed $f->{'type'} = length($columndef->columnvalue) ? 'fixed' : 'hidden'; $f->{'value'} = $columndef->columnvalue; - } elsif ( $flag eq 'A' ) { + + } elsif ( $flag eq 'A' ) { #auto assign from inventory $f->{'type'} = 'hidden'; - } elsif ( $flag eq 'M' ) { + + } elsif ( $flag eq 'M' ) { #manually assign from inventory $f->{'type'} = 'select-inventory_item'; $f->{'empty_label'} = 'Select inventory item'; $f->{'extra_sql'} = 'WHERE ( svcnum IS NULL ' . @@ -116,11 +119,13 @@ ')'; $f->{'classnum'} = $columndef->columnvalue; $f->{'disable_empty'} = $object->svcnum ? 1 : 0; - } elsif ( $flag eq 'H' ) { + + } elsif ( $flag eq 'H' ) { #hardware $f->{'type'} = 'select-hardware_type'; $f->{'hashref'} = { 'classnum'=>$columndef->columnvalue }; + } elsif ( $flag eq 'S' ) { #selectable choice $f->{type} = 'select'; $f->{options} = [ split( /\s*,\s*/, -- cgit v1.2.1 From 2e7ce01632012ccc0dd440a8bc37a9ec9bd55fac Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 24 Oct 2013 23:29:58 -0700 Subject: limit sales reports for employee, RT#25524 --- httemplate/edit/access_user.html | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/access_user.html b/httemplate/edit/access_user.html index b087943c2..2d39f969c 100644 --- a/httemplate/edit/access_user.html +++ b/httemplate/edit/access_user.html @@ -7,17 +7,19 @@ 'last', 'first', { field=>'user_custnum', type=>'search-cust_main', }, + { field=>'report_salesnum', type=>'select-sales', empty_label=>'all', }, { field=>'disabled', type=>'checkbox', value=>'Y' }, ], 'labels' => { - 'usernum' => 'User number', - 'username' => 'Username', - '_password' => 'Password', - '_password2' => 'Re-enter Password', - 'last' => 'Last name', - 'first' => 'First name', - 'user_custnum' => 'Customer (optional)', - 'disabled' => 'Disable employee', + 'usernum' => 'User number', + 'username' => 'Username', + '_password' => 'Password', + '_password2' => 'Re-enter Password', + 'last' => 'Last name', + 'first' => 'First name', + 'user_custnum' => 'Customer (optional)', + 'report_salesnum' => 'Limit commission report to sales person', + 'disabled' => 'Disable employee', }, 'edit_callback' => \&edit_callback, 'field_callback'=> \&field_callback, @@ -68,8 +70,8 @@ my $check_user_custnum_search = <set('_password', ''); + my ($cgi, $access_user, $fields_listref, $opt_hashref) = @_; + $access_user->_password(''); } sub field_callback { -- cgit v1.2.1