summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2010-03-01 22:18:11 +0000
committerivan <ivan>2010-03-01 22:18:11 +0000
commit089001124dbd8016d5d51f9aaef50fb9f101dae5 (patch)
tree1c145e81f55738bbf9480737f0a9a7eeb1b568e4 /httemplate
parentea3c94b9862524f0d17931e77bf3955bac5ad83f (diff)
fixup editing w/manual inventory, RT#7010
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/edit/elements/svc_Common.html21
1 files changed, 13 insertions, 8 deletions
diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html
index 0ffb4319f..453d07f88 100644
--- a/httemplate/edit/elements/svc_Common.html
+++ b/httemplate/edit/elements/svc_Common.html
@@ -65,15 +65,20 @@
} elsif ( $flag eq 'A' ) {
$f->{'type'} = 'hidden';
} elsif ( $flag eq 'M' ) {
- $f->{'type'} = 'select-table';
- $f->{'table'} = 'inventory_item';
- $f->{'name_col'} = 'item';
- $f->{'value_col'} = 'item';
- $f->{'hashref'} = {
- 'classnum' => $columndef->columnvalue,
- 'svcnum' => '',
- };
$f->{'empty_label'} = 'Select inventory item';
+ $f->{'type'} = 'select-table';
+ $f->{'table'} = 'inventory_item';
+ $f->{'name_col'} = 'item';
+ $f->{'value_col'} = 'item';
+ $f->{'hashref'} = {
+ 'classnum'=>$columndef->columnvalue,
+ #'svcnum' => '',
+ };
+ $f->{'extra_sql'} = 'AND ( svcnum IS NULL ';
+ $f->{'extra_sql'} .= ' OR svcnum = '. $object->svcnum
+ if $object->svcnum;
+ $f->{'extra_sql'} .= ' ) ';
+ $f->{'disable_empty'} = $object->svcnum ? 1 : 0,
}
if ( $f->{'type'} eq 'select-svc_pbx' ) {