%#============================================================================ %# 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. %# %# %#---------------------------------------------------------------------------- <% empty_table( height => 10) %> % if ( $session{AppOffPhones_EditMode} ) { % }
% my ($lastitem, $item); % while($item = shift @dptRing) { % $ lastitem = $item; <% CGI::a({-href => href("index.htm", deptid => $item->[0]*1)}, $item->[1]) %> <% scalar @dptRing ? "|" : undef %> %}
<% img(src => "/images/ePortal/edit.gif") %> <% plink(pick_lang( rus => "Новый телефон в подразделении", eng => "New phone in department"), href => href("client_edit.htm", objid => 0, dept_id => $lastitem->[0])) %> <% img(src => "/images/ePortal/edit.gif") %> <% plink( pick_lang(rus => "Новое подразделение", eng => "Add subdepartment"), href => href("dept_edit.htm", objid => 0, parent_id => $lastitem->[0])) %> % if ($lastitem->[0]) { <% img(src => "/images/ePortal/setup.gif") %> <% plink(pick_lang(rus => "Изменить", eng => "Edit") . " '$lastitem->[1]'", href => href("dept_edit.htm", objid => $lastitem->[0])) %> <% img(src => "/images/ePortal/trash.gif") %> <% plink(pick_lang(rus => "Удалить", eng => "Delete")." '$lastitem->[1]'", href => href("/delete.htm", objid => $lastitem->[0], objtype => "ePortal::App::OffPhones::Department", done => href($ENV{SCRIPT_NAME}, deptid => $lastitem->[2]))) %> % }
<%init> my @dptRing = (); # array of [id, name] while ($deptid > 0) { my $D = new ePortal::App::OffPhones::Department; $D->restore($deptid); my $dptName = $D->title; if ($name) { use locale; $dptName =~ s/($name)/$1<\/span>/i; } unshift @dptRing, [$deptid, $dptName, $D->parent_id]; $deptid = $D->Parent_id; } unshift @dptRing, [undef, pick_lang(rus => "Телефоны", eng => "Phones")]; <%args> $deptid => 0 $name => undef # Поиск по имени