diff options
| author | jeff <jeff> | 2010-02-08 15:32:38 +0000 |
|---|---|---|
| committer | jeff <jeff> | 2010-02-08 15:32:38 +0000 |
| commit | 5485c9b2bb9450f658c8d688e79af9e4cb3cd3ab (patch) | |
| tree | 4119b166080b0b17238ace73e4c06453603dc43d /httemplate/edit | |
| parent | 7f9b83d3bdaab8581479ae98b46909130a89f2af (diff) | |
grandstream device configuration support #4220
Diffstat (limited to 'httemplate/edit')
| -rw-r--r-- | httemplate/edit/part_device.html | 30 | ||||
| -rw-r--r-- | httemplate/edit/process/part_device.html | 4 |
2 files changed, 34 insertions, 0 deletions
diff --git a/httemplate/edit/part_device.html b/httemplate/edit/part_device.html index 4f2fe93b4..aa626b379 100644 --- a/httemplate/edit/part_device.html +++ b/httemplate/edit/part_device.html @@ -6,6 +6,7 @@ 'devicename' => 'Device name', }, 'viewall_dir' => 'browse', + 'html_bottom' => $html_bottom_sub, ) %> <%init> @@ -13,4 +14,33 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); +my $extra_sql = + join( ' OR ', map { "exporttype = '$_'" } + keys %{FS::part_export::export_info('part_device')} + ); +$extra_sql = $extra_sql ? " WHERE ( $extra_sql ) " : " WHERE 0 = 1 "; + +my $html_bottom_sub = sub { + my $part_device = shift; + + '<BR>'. + '<FONT SIZE="+1">Exports</FONT><BR>'. + + '<TABLE BGCOLOR="#cccccc" WIDTH=100%>'. + '<TR><TD>'. + include( '/elements/checkboxes-table.html', + 'source_obj' => $part_device, + 'link_table' => 'export_device', + 'target_table' => 'part_export', + 'extra_sql' => $extra_sql, + 'name_callback' => sub { my $o = shift; + $o->exporttype. ' to '. $o->machine; + }, + ). + '<BR>'. + '</TD></TR></TABLE>'; + +}; + </%init> + diff --git a/httemplate/edit/process/part_device.html b/httemplate/edit/process/part_device.html index 2b7e1da49..399991fc8 100644 --- a/httemplate/edit/process/part_device.html +++ b/httemplate/edit/process/part_device.html @@ -1,6 +1,10 @@ <% include( 'elements/process.html', 'table' => 'part_device', 'viewall_dir' => 'browse', + 'process_m2m' => { + 'link_table' => 'export_device', + 'target_table' => 'part_export', + }, ) %> <%init> |
