%#============================================================================ %# 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. %# %# %#---------------------------------------------------------------------------- <%perl> # Prepare Calendar object my $CAL = new ePortal::HTML::Calendar; my @date = $CAL->date; # get date from calendar # Lookup for days my $days = new ePortal::ThePersistent::Support( DBISource => 'Organizer', SQL => "SELECT distinct an_day FROM Anniversary", Where => "org_id=? AND an_month=?", Bind => [$session{_org_id}, $date[1]], OrderBy => "an_day"); $days->restore_all; while($days->restore_next) { $CAL->url($days->an_day, 'self'); }
<& SELF:show_dates, date => \@date &> <% $CAL->draw %> % if ($session{_organizer}->xacl_check_update) { % }
%#=== @metags categ_caption ==================================================== <%method categ_caption> % my $categ = $ARGS{categ}; <% empty_td(width => 10) %> <% $categ->Title %> %#=== @METAGS item ==================================================== <%method item> % my $ann = $ARGS{ann}; % my $Y = 1900 + (localtime(time))[5]; <% empty_td(width => 10) %> %# %# <% $ann->an_day %> %#   <% $ann->Title %> % if ($ann->an_year > 0) { (<% $Y - $ann->an_year %> <% pick_lang(rus => "годовщина", eng => "anniversary")%>) % } % if ($ann->xacl_check_update) { <% icon_edit($ann, url => 'ann_edit.htm') %> <% icon_delete($ann) %> % } %#=== @METAGS attr ========================================================= <%attr> Title => {rus => "События и годовщины", eng => "Anniversary"} %#=== @METAGS month_name ==================================================== <%method month_name><%perl> my $mon = $ARGS{month}; my @MonthNames = ( {rus => "Январь", eng => "January"}, {rus => "Февраль", eng => "February"}, {rus => "Март", eng => "March"}, {rus => "Апрель", eng => "April"}, {rus => "Май", eng => "May"}, {rus => "Июнь", eng => "June"}, {rus => "Июль", eng => "Jule"}, {rus => "Август", eng => "August"}, {rus => "Сентябрь", eng => "September"}, {rus => "Октябрь", eng => "October"}, {rus => "Ноябрь", eng => "November"}, {rus => "Декабрь", eng => "December"} ); return pick_lang($MonthNames[$mon-1]); %#=== @METAGS show_dates ==================================================== <%method show_dates> % my @date = @{ $ARGS{date} }; <% empty_td(width => 10) %> <%perl> my $ann = new ePortal::App::Organizer::Anniversary; $ann->restore_where(org_id => $session{_org_id}, an_day => $date[2], an_month => $date[1], order_by=>"category_id, Title"); my $last_shown_categ = new ePortal::App::Organizer::Category; while ($ann->restore_next) { if ( $last_shown_categ->id != $ann->category_id ) { $last_shown_categ->restore($ann->category_id); $m->comp("SELF:categ_caption", categ => $last_shown_categ); } $m->comp("SELF:item", ann => $ann); }
<& /item_caption.mc, title => sprintf("%02d.%02d.%04d", reverse @date) &>