%#============================================================================ %# ePortal - WEB Based daily organizer %# Author - S.Rusakov %# %# Copyright (c) 2000-2003 Sergey Rusakov. All rights reserved. %# This program is free software; you can redistribute it %# and/or modify it under the same terms as Perl itself. %# %# %#---------------------------------------------------------------------------- %# List of subdepartments 3 columns wide %# %#---------------------------------------------------------------------------- <% empty_table( height => 5 ) %> %for (my $counter=0; $counter < $rows; $counter++) { <% empty_td( width => 5 ) %> % for (my $column=0; $column < 3; $column++) { % my $data = $subDepts[$rows*$column + $counter]; % $D->data($data); <% CGI::td({}, $data ? CGI::a({ -href => href("index.htm", deptid => $D->id)}, $D->Title ) : " ") %> <% empty_td( width => 5 ) %> % } %}
%#=== @metags init ========================================================= <%init> my (@subDepts, $rows); my $D = new ePortal::App::OffPhones::Department; $D->restore_where(parent_id => $deptid, order_by => 'title'); while($D->restore_next) { push @subDepts, $D->data; } $gdata{OffPhones_found_count} = scalar @subDepts; return if ! @subDepts; { use integer; $rows = 1+ scalar(@subDepts) / 3; no integer; } <%args> $deptid => 0