%#============================================================================ %# 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 => 5 ) %> <%perl> my $row_counter = 0; my $client = ePortal::App::OffPhones::stClientsByDept($deptid); $client->restore_next; CLIENT: while(1) { my $client_id = $client->id; last CLIENT if ! $client_id; my $html_position = $client->Position; my $html_title = $client->Title; my ($html_memo, $html_phone, %have_memo, %have_phone); while($client_id == $client->id) { my $memo_id = $client->memo_id; if ($memo_id and ! $have_memo{$memo_id}) { $have_memo{$memo_id} = 1; $html_memo .= '
'.plink($client->phone_memo, href=>href("add_memo.htm", objid => $client->memo_id)); } my $phone_id = $client->phone_id; if ($phone_id and !$have_phone{$phone_id}) { $have_phone{$phone_id} = 1; $html_phone .= '
' if $html_phone; my $phone_formatted = ePortal::App::OffPhones::NiceFormat( $client->nNumber, $client->Format); $html_phone .= ''.$client->phone_type.' '. ''.$phone_formatted.''; } $client->restore_next; } if ($name) { use locale; my $name_formatted = ePortal::App::OffPhones::NiceFormat( $name, length($name)>=6? '##-##-##' : '##-##' ); my $found; $found += $html_position =~ s/($name)/$1<\/span>/i; $found += $html_title =~ s/($name)/$1<\/span>/i; $found += $html_phone =~ s/($name_formatted)/$1<\/span>/i; $found += $html_memo =~ s/($name)/$1<\/span>/i; next CLIENT if ! $found; } $html_phone = " " unless $html_phone; $gdata{OffPhones_found_count} ++; if ( $session{AppOffPhones_EditMode} ) { $html_position = CGI::a({-href=> href("/app/OffPhones/client_edit.htm", objid => $client_id)}, $html_position); $html_title = CGI::a({-href=> href("/app/OffPhones/client_edit.htm", objid => $client_id)}, $html_title); } <% empty_td(width => 5) %> % if ($ePortal->username) { <% empty_td(width => 5) %> % } <% empty_td(width => 5) %> % if ( $session{AppOffPhones_EditMode} ) { <% empty_td(width => 5) %> % } <% empty_td(width => 5) %> % } # ENF OF CLIENT
<% img( src => "/images/OffPhones/memo.gif", href=> href("add_memo.htm", client_id => $client_id), title => pick_lang(rus => "Добавить личную заметку", eng => "Add personal memo")) %> <% img( src=>"/images/OffPhones/adminmemo.gif", href => href("admin_memo.htm", deptid => $deptid, client_id => $client_id), title => pick_lang( rus => "Уведомить администратора о неточностях в справочнике", eng => "Add memo for phones administrator") ) %><% $html_position %><% $html_memo %> <% $html_title %> <% $html_phone %><% icon_delete($client, objid => $client_id, objtype => 'ePortal::App::OffPhones::Client') %>
%#=== @METAGS init ========================================================= <%init> $gdata{OffPhones_found_count} = 0; %#============================================================================ <%args> $deptid $name => undef # Поиск по ФИО $phone => undef # Поиск по № телефона