"Fossies" - the Fresh Open Source Software Archive

Member "email-reminder-0.8.1/EmailReminder/MonthlyStore.pm" (11 Sep 2020, 1525 Bytes) of package /linux/privat/email-reminder-0.8.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "MonthlyStore.pm" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 0.7.8_vs_0.8.0.

    1 # This file is part of Email-Reminder.
    2 #
    3 # Email-Reminder is free software; you can redistribute it and/or
    4 # modify it under the terms of the GNU General Public License as
    5 # published by the Free Software Foundation; either version 3 of the
    6 # License, or (at your option) any later version.
    7 #
    8 # Email-Reminder is distributed in the hope that it will be useful,
    9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   11 # General Public License for more details.
   12 #
   13 # You should have received a copy of the GNU General Public License
   14 # along with Email-Reminder; if not, write to the Free Software
   15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
   16 # 02110-1301, USA.
   17 
   18 package EmailReminder::MonthlyStore;
   19 
   20 use strict;
   21 use warnings;
   22 
   23 use EmailReminder::EventStore;
   24 use EmailReminder::MonthlyEvent;
   25 
   26 use base qw(EmailReminder::EventStore);
   27 
   28 # Column indices
   29 my $NAME_INDEX = 1;
   30 my $DAY_INDEX = 2;
   31 
   32 sub init
   33 {
   34     my ($self) = @_;
   35 
   36     $self->{TYPE} = EmailReminder::MonthlyEvent->get_type();
   37     $self->{NB_COLUMNS} = EmailReminder::MonthlyEvent->get_nb_fields();
   38 
   39     $self->EmailReminder::EventStore::init();
   40     return 1;
   41 }
   42 
   43 sub get_event_column
   44 {
   45     my ($self, $event, $col) = @_;
   46     
   47     if ($col == $NAME_INDEX) {
   48         return $event->get_name();
   49     }
   50     elsif ($col == $DAY_INDEX) {
   51         return $event->get_day();
   52     }
   53     else {
   54         return $self->EmailReminder::EventStore::get_event_column($event, $col);
   55     }
   56 }
   57 
   58 1;