summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/access_user.html22
-rw-r--r--httemplate/edit/discount.html2
-rw-r--r--httemplate/edit/discount_class.html10
-rw-r--r--httemplate/edit/elements/class_Common.html8
-rw-r--r--httemplate/edit/elements/svc_Common.html18
-rw-r--r--httemplate/edit/process/discount_class.html11
-rw-r--r--httemplate/edit/process/tower.html2
-rw-r--r--httemplate/edit/tower.html28
8 files changed, 75 insertions, 26 deletions
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 = <<END;
END
sub edit_callback {
- my ($c, $o, $f, $opt) = @_;
- $o->set('_password', '');
+ my ($cgi, $access_user, $fields_listref, $opt_hashref) = @_;
+ $access_user->_password('');
}
sub field_callback {
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&nbsp;',
+ 'classnum' => 'Class',
'disabled' => 'Disabled&nbsp;',
'_type' => 'Type&nbsp;',
'amount' => 'Amount&nbsp;',
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/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', },
diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html
index 321c68545..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,18 @@
')';
$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*/,
+ $columndef->columnvalue)
+ ];
}
if ( $f->{'type'} eq 'select-svc_pbx'
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');
+
+</%init>
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 {