X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRTx%2FCalendar.pm;h=be127072c0b8067071e8776fa9f1ad5cd236381f;hp=20568e853530da2dd67a457b376b89f113c8393b;hb=58c47a18e6a3cff2fe4032c08f74c922966f3f40;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924 diff --git a/rt/lib/RTx/Calendar.pm b/rt/lib/RTx/Calendar.pm index 20568e853..be127072c 100644 --- a/rt/lib/RTx/Calendar.pm +++ b/rt/lib/RTx/Calendar.pm @@ -5,7 +5,10 @@ use base qw( Exporter ); use DateTime; use DateTime::Set; -our $VERSION = "0.07"; +our $VERSION = "0.17"; + +RT->AddStyleSheets('calendar.css') + if RT->can('AddStyleSheets'); our @EXPORT_OK = qw( FirstDay LastDay ); @@ -48,7 +51,7 @@ sub DatesClauses { my $clauses = ""; my @DateClauses = map { - "($_ >= '" . $begin . "' AND $_ <= '" . $end . "')" + "($_ >= '" . $begin . " 00:00:00' AND $_ <= '" . $end . " 23:59:59')" } @$Dates; $clauses .= " AND " . " ( " . join(" OR ", @DateClauses) . " ) " if @DateClauses; @@ -82,9 +85,9 @@ sub FindTickets { return %Tickets; } -# +# # Take a user object and return the search with Description "calendar" if it exists -# +# sub SearchDefaultCalendar { my $CurrentUser = shift; my $Description = "calendar"; @@ -104,6 +107,28 @@ sub SearchDefaultCalendar { } } +package RT::Interface::Web::Menu; + +# we should get an add_after method in 4.0.6 (hopefully), but until then +# shim this in so I don't copy the code. +unless (RT::Interface::Web::Menu->can('add_after')) { + *RT::Interface::Web::Menu::add_after = sub { + my $self = shift; + my $parent = $self->parent; + my $sort_order; + for my $contemporary ($parent->children) { + if ( $contemporary->key eq $self->key ) { + $sort_order = $contemporary->sort_order + 1; + next; + } + if ( $sort_order ) { + $contemporary->sort_order( $contemporary->sort_order + 1 ); + } + } + $parent->child( @_, sort_order => $sort_order ); + }; +} + 1; @@ -113,10 +138,6 @@ __END__ RTx::Calendar - Calendar for RT due tasks -=head1 VERSION - -This document describes version 0.07 of RTx::Calendar - =head1 DESCRIPTION This RT extension provides a calendar view for your tickets and your @@ -129,16 +150,12 @@ You can also enable ics (ICal) feeds for your default calendar and all your private searches in Prefs/Calendar.html. Authentication is magic number based so that you can give those feeds to other people. -You can find screenshots on -http://gaspard.mine.nu/dotclear/index.php?tag/rtx-calendar - =head1 INSTALLATION If you upgrade from 0.02, see next part before. -You need to install those three modules : +You need to install those two modules : - * Date::ICal * Data::ICal * DateTime::Set @@ -206,26 +223,25 @@ RTx-Calendar may work without this but it's not very clean. =head1 BUGS -=over - -=item * -compatible only with RT 3.6 for the moment. If someone need -compatibility with 3.4 I can work on this. And I will work on 3.7 -compatibility later. - -=back - +All bugs should be reported via +L +or L. + =head1 AUTHORS +Best Practical Solutions + Nicolas Chuche Enchuche@barna.beE Idea borrowed from redmine's calendar (Thanks Jean-Philippe). =head1 COPYRIGHT -Copyright 2007 by Nicolas Chuche Enchuche@barna.beE +Copyright 2007-2009 by Nicolas Chuche Enchuche@barna.beE + +Copyright 2010-2012 by Best Practical Solutions. -This program is free software; you can redistribute it and/or +This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L