[freeside-commits] freeside/httemplate/elements select-tower_sector.html, 1.1, 1.2 tr-selectmultiple-part_pkg.html, 1.4, 1.5
Mark Wells
mark at wavetail.420.am
Tue Jan 17 18:48:06 PST 2012
- Previous message: [freeside-commits] freeside/httemplate/browse tower.html,1.1,1.2
- Next message: [freeside-commits] freeside/FS/FS Record.pm, 1.239, 1.240 svc_Tower_Mixin.pm, 1.1, 1.2 svc_acct.pm, 1.324, 1.325 svc_broadband.pm, 1.33, 1.34
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv11201/httemplate/elements
Modified Files:
select-tower_sector.html tr-selectmultiple-part_pkg.html
Log Message:
search services by tower/sector, #15950
Index: tr-selectmultiple-part_pkg.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/tr-selectmultiple-part_pkg.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -d -r1.4 -r1.5
--- tr-selectmultiple-part_pkg.html 28 Mar 2009 22:59:35 -0000 1.4
+++ tr-selectmultiple-part_pkg.html 18 Jan 2012 02:48:03 -0000 1.5
@@ -1,6 +1,5 @@
-<TR>
- <TD ALIGN="right"><% $opt{'label'} || 'Packages' %></TD>
- <TD>
+<& tr-td-label.html, label => emt('Packages'), %opt &>
+ <TD <% $style %>>
<% include( '/elements/select-table.html',
'table' => 'part_pkg',
'name_col' => 'pkg',
@@ -15,5 +14,7 @@
<%init>
my %opt = @_;
+my $style = $opt{'cell_style'};
+$style = 'STYLE="'.$style.'"' if $style;
</%init>
Index: select-tower_sector.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/select-tower_sector.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- select-tower_sector.html 10 Dec 2011 00:36:47 -0000 1.1
+++ select-tower_sector.html 18 Jan 2012 02:48:02 -0000 1.2
@@ -1,3 +1,4 @@
+% if ( ! $opt{'multiple'} ) {
<& /elements/select-table.html,
table => 'tower_sector',
name_col => 'description',
@@ -5,3 +6,45 @@
empty_label => ' ',
@_
&>
+% }
+% else { # currently only multiple sectors, not towers
+<& /elements/select-table.html,
+ table => 'tower',
+ name_col => 'towername',
+ id => 'towernum',
+ field => 'dummy_towernum'
+ onchange => 'change_towernum(this.value);',
+ element_etc => 'STYLE="vertical-align:top"',
+&>
+<SELECT NAME="sectornum" ID="sectornum" MULTIPLE SIZE="6"></SELECT>
+<SCRIPT TYPE="text/javascript">
+var sectors_of = <% encode_json(\%sectors_of) %>;
+var select_sectornum = document.getElementById('sectornum');
+function change_towernum(towernum) {
+ select_sectornum.options.length = 0;
+ for (var sectornum in sectors_of[towernum]) {
+ var o = document.createElement('OPTION');
+ o.value = sectornum;
+ o.text = sectors_of[towernum][sectornum];
+ o.selected = true;
+ select_sectornum.add(o, null);
+ }
+ return;
+}
+change_towernum('');
+% }
+</SCRIPT>
+<BR>
+<INPUT TYPE="checkbox" VALUE="none" NAME="sectornum" CHECKED> No sector
+<%init>
+my %opt = @_;
+
+my %sectors_of;
+if ( $opt{'multiple'} ) {
+ foreach my $sector ( qsearch('tower_sector',{}) ) {
+ $sectors_of{$sector->towernum} ||= {};
+ $sectors_of{$sector->towernum}->{$sector->sectornum} = $sector->sectorname;
+ $sectors_of{''}->{$sector->sectornum} = $sector->description;
+ }
+}
+</%init>
- Previous message: [freeside-commits] freeside/httemplate/browse tower.html,1.1,1.2
- Next message: [freeside-commits] freeside/FS/FS Record.pm, 1.239, 1.240 svc_Tower_Mixin.pm, 1.1, 1.2 svc_acct.pm, 1.324, 1.325 svc_broadband.pm, 1.33, 1.34
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list