Commit dbfe41f7 authored by Alex Vandiver's avatar Alex Vandiver
Browse files

release 0.21

parent 45d78d1d
Revision history for RT-Extension-JSGantt
0.21
0.21 Wed Jun 16 23:32:17 EDT 2014
* Packaging updates; no code change. This includes serving the CSS
from static/ under RT 4.2
0.20 Mon Feb 10 19:25:33 CST 2014
......
......@@ -13,6 +13,7 @@ inc/Module/Install/Can.pm
inc/Module/Install/Fetch.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/ReadmeFromPod.pm
inc/Module/Install/RTx.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
......
......@@ -8,7 +8,7 @@ configure_requires:
ExtUtils::MakeMaker: 6.36
distribution_type: module
dynamic_config: 1
generated_by: 'Module::Install version 1.06'
generated_by: 'Module::Install version 1.08'
license: gplv2
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
......@@ -19,9 +19,10 @@ no_index:
- etc
- html
- inc
- static
requires:
JSON: 0
List::MoreUtils: 0
resources:
repository: git://github.com/bestpractical/rt-extension-jsgantt.git
version: 0.21
version: '0.21'
......@@ -5,6 +5,7 @@ RTx('RT-Extension-JSGantt');
author ('sunnavy <sunnavy@bestpractical.com>');
abstract_from('lib/RT/Extension/JSGantt.pm');
readme_from('lib/RT/Extension/JSGantt.pm');
license('GPLv2');
repository 'git://github.com/bestpractical/rt-extension-jsgantt.git';
......@@ -12,4 +13,6 @@ repository 'git://github.com/bestpractical/rt-extension-jsgantt.git';
requires( 'JSON' );
requires( 'List::MoreUtils' );
requires_rt('4.0.0');
&WriteAll;
RT-Extension-JSGantt version 0.21
NAME
RT::Extension::JSGantt - Gantt charts for your tickets
CAVEAT: please use version 0.18 if you are running RT 3.
DESCRIPTION
This extension uses the Starts and Due dates, along with ticket
dependencies, to produce Gantt charts.
How to install:
INSTALLATION
"perl Makefile.PL"
"make"
"make install"
May need root permissions
1. perl Makefile.PL
2. make
3. make install ( you may need root permission )
4. config items in etc/RT_SiteConfig.pm
# add RT::Extension::JSGantt to @Plugins: e.g.
Set(@Plugins,'RT::Extension::JSGantt');
# customize JSGantt as you wish:
Edit your /opt/rt4/etc/RT_SiteConfig.pm
If you are using RT 4.2 or greater, add this line:
Set(
%JSGanttOptions,
DefaultFormat => 'day', # or week or month or quarter
ShowOwner => 1,
ShowProgress => 1,
ShowDuration => 1,
Plugin('RT::Extension::JSGantt');
# define your own color scheme:
# ColorScheme => ['ff0000', 'ffff00', 'ff00ff', '00ff00', '00ffff', '0000ff'],
For RT 3.8 and 4.0, add this line:
# we color owners consistently by default, you can disable it via:
# ColorSchemeByOwner => 0,
Set(@Plugins, qw(RT::Extension::JSGantt));
# you can specify colors to use, unspecified owners will be
# assigned to some color automatically:
# ColorSchemeByOwner => { root => 'ff0000', foo => '00ff00' },
or add "RT::Extension::JSGantt" to your existing @Plugins line.
# if can't find both start and end dates, use this color
NullDatesColor => 333,
Clear your mason cache
rm -rf /opt/rt4/var/mason_data/obj
# to caculate day length
WorkingHoursPerDay => 8,
Restart your webserver
# used to set start/end if one exists but the other does not
DefaultDays => 7,
);
CONFIGURATION
Set(
%JSGanttOptions,
DefaultFormat => 'day', # or week or month or quarter
ShowOwner => 1,
ShowProgress => 1,
ShowDuration => 1,
6. restart RT
# define your own color scheme:
# ColorScheme => ['ff0000', 'ffff00', 'ff00ff', '00ff00', '00ffff', '0000ff'],
How to update jsgantt.js and jsgantt.css:
# we color owners consistently by default, you can disable it via:
# ColorSchemeByOwner => 0,
To make it work better with RT, we changed original jsgantt.js and jsgantt.css,
which can be found in jsgantt.diff.
# you can specify colors to use, unspecified owners will be
# assigned to some color automatically:
# ColorSchemeByOwner => { root => 'ff0000', foo => '00ff00' },
If you want to update jsgantt.js and jsgantt.css to a new version, please
review the diff to see what have been changed and maybe do the same change too.
# if can't find both start and end dates, use this color
NullDatesColor => 333,
# to caculate day length
WorkingHoursPerDay => 8,
# used to set start/end if one exists but the other does not
DefaultDays => 7,
);
METHODS
AllRelatedTickets
Given a ticket, return all the relative tickets, including the original
ticket.
TicketsInfo
Given tickets, resolve useful info for jsgantt.js Returns a 2 elements
array, 1st is the ids arrayref, 2nd is the info hashref.
GetTimeRange
Given a ticket, resolve it's start/end. Returns an array like (
$start_obj, $start, $end_obj, $end ) $start and $end are strings like
3/21/2011
AUTHOR
sunnavy <sunnavy@bestpractical.com>
BUGS
All bugs should be reported via email to
bug-RT-Extension-JSGantt@rt.cpan.org
<mailto:bug-RT-Extension-JSGantt@rt.cpan.org> or via the web at
rt.cpan.org
<http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-JSGantt>.
LICENSE AND COPYRIGHT
This software is Copyright (c) 2014 by Best Practical Solutions
This is free software, licensed under:
The GNU General Public License, Version 2, June 1991
......@@ -31,7 +31,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
$VERSION = '1.06';
$VERSION = '1.08';
# Storage for the pseudo-singleton
$MAIN = undef;
......
......@@ -4,7 +4,7 @@ package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
$VERSION = '1.06';
$VERSION = '1.08';
}
# Suspend handler for "redefined" warnings
......
......@@ -8,7 +8,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.06';
$VERSION = '1.08';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......
......@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.06';
$VERSION = '1.08';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......
......@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.06';
$VERSION = '1.08';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......
......@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.06';
$VERSION = '1.08';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......
......@@ -8,7 +8,7 @@ no warnings 'once';
use Module::Install::Base;
use base 'Module::Install::Base';
our $VERSION = '0.32';
our $VERSION = '0.34';
use FindBin;
use File::Glob ();
......@@ -88,6 +88,11 @@ sub RTx {
."Upgrade to RT 3.8.1 or newer.\n" if $RT::VERSION =~ /^3\.8\.0/;
$path{$_} = $RT::LocalPluginPath . "/$original_name/$_"
foreach @DIRS;
# Copy RT 4.2.0 static files into NoAuth; insufficient for
# images, but good enough for css and js.
$path{static} = "$path{html}/NoAuth/"
unless $RT::StaticPath;
} else {
foreach ( @DIRS ) {
no strict 'refs';
......@@ -136,7 +141,9 @@ install ::
$has_etc{acl}++;
}
if ( -e 'etc/initialdata' ) { $has_etc{initialdata}++; }
if ( -d 'etc/upgrade/' ) { $has_etc{upgrade}++; }
if ( grep { /\d+\.\d+\.\d+.*$/ } glob('etc/upgrade/*.*.*') ) {
$has_etc{upgrade}++;
}
$self->postamble("$postamble\n");
unless ( $subdirs{'lib'} ) {
......@@ -174,46 +181,50 @@ install ::
}
}
# stolen from RT::Handle so we work on 3.6 (cmp_versions came in with 3.8)
{ my %word = (
a => -4,
alpha => -4,
b => -3,
beta => -3,
pre => -2,
rc => -1,
head => 9999,
);
sub cmp_version($$) {
my ($a, $b) = (@_);
my @a = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
split /([^0-9]+)/, $a;
my @b = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
split /([^0-9]+)/, $b;
@a > @b
? push @b, (0) x (@a-@b)
: push @a, (0) x (@b-@a);
for ( my $i = 0; $i < @a; $i++ ) {
return $a[$i] <=> $b[$i] if $a[$i] <=> $b[$i];
}
return 0;
}}
sub requires_rt {
my ($self,$version) = @_;
# if we're exactly the same version as what we want, silently return
return if ($version eq $RT::VERSION);
my @sorted = sort cmp_version $version,$RT::VERSION;
_load_rt_handle();
my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
if ($sorted[-1] eq $version) {
# should we die?
warn "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
die "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
}
}
sub rt_too_new {
my ($self,$version,$msg) = @_;
$msg ||= "Your version %s is too new, this extension requires a release of RT older than %s\n";
_load_rt_handle();
my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
if ($sorted[0] eq $version) {
die sprintf($msg,$RT::VERSION,$version);
}
}
# RT::Handle runs FinalizeDatabaseType which calls RT->Config->Get
# On 3.8, this dies. On 4.0/4.2 ->Config transparently runs LoadConfig.
# LoadConfig requires being able to read RT_SiteConfig.pm (root) so we'd
# like to avoid pushing that on users.
# Fake up just enough Config to let FinalizeDatabaseType finish, and
# anyone later calling LoadConfig will overwrite our shenanigans.
sub _load_rt_handle {
unless ($RT::Config) {
require RT::Config;
$RT::Config = RT::Config->new;
RT->Config->Set('DatabaseType','mysql');
}
require RT::Handle;
}
1;
__END__
#line 336
#line 367
#line 1
package Module::Install::ReadmeFromPod;
use 5.006;
use strict;
use warnings;
use base qw(Module::Install::Base);
use vars qw($VERSION);
$VERSION = '0.22';
sub readme_from {
my $self = shift;
return unless $self->is_admin;
# Input file
my $in_file = shift || $self->_all_from
or die "Can't determine file to make readme_from";
# Get optional arguments
my ($clean, $format, $out_file, $options);
my $args = shift;
if ( ref $args ) {
# Arguments are in a hashref
if ( ref($args) ne 'HASH' ) {
die "Expected a hashref but got a ".ref($args)."\n";
} else {
$clean = $args->{'clean'};
$format = $args->{'format'};
$out_file = $args->{'output_file'};
$options = $args->{'options'};
}
} else {
# Arguments are in a list
$clean = $args;
$format = shift;
$out_file = shift;
$options = \@_;
}
# Default values;
$clean ||= 0;
$format ||= 'txt';
# Generate README
print "readme_from $in_file to $format\n";
if ($format =~ m/te?xt/) {
$out_file = $self->_readme_txt($in_file, $out_file, $options);
} elsif ($format =~ m/html?/) {
$out_file = $self->_readme_htm($in_file, $out_file, $options);
} elsif ($format eq 'man') {
$out_file = $self->_readme_man($in_file, $out_file, $options);
} elsif ($format eq 'pdf') {
$out_file = $self->_readme_pdf($in_file, $out_file, $options);
}
if ($clean) {
$self->clean_files($out_file);
}
return 1;
}
sub _readme_txt {
my ($self, $in_file, $out_file, $options) = @_;
$out_file ||= 'README';
require Pod::Text;
my $parser = Pod::Text->new( @$options );
open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n";
$parser->output_fh( *$out_fh );
$parser->parse_file( $in_file );
close $out_fh;
return $out_file;
}
sub _readme_htm {
my ($self, $in_file, $out_file, $options) = @_;
$out_file ||= 'README.htm';
require Pod::Html;
Pod::Html::pod2html(
"--infile=$in_file",
"--outfile=$out_file",
@$options,
);
# Remove temporary files if needed
for my $file ('pod2htmd.tmp', 'pod2htmi.tmp') {
if (-e $file) {
unlink $file or warn "Warning: Could not remove file '$file'.\n$!\n";
}
}
return $out_file;
}
sub _readme_man {
my ($self, $in_file, $out_file, $options) = @_;
$out_file ||= 'README.1';
require Pod::Man;
my $parser = Pod::Man->new( @$options );
$parser->parse_from_file($in_file, $out_file);
return $out_file;
}
sub _readme_pdf {
my ($self, $in_file, $out_file, $options) = @_;
$out_file ||= 'README.pdf';
eval { require App::pod2pdf; }
or die "Could not generate $out_file because pod2pdf could not be found\n";
my $parser = App::pod2pdf->new( @$options );
$parser->parse_from_file($in_file);
open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n";
select $out_fh;
$parser->output;
select STDOUT;
close $out_fh;
return $out_file;
}
sub _all_from {
my $self = shift;
return unless $self->admin->{extensions};
my ($metadata) = grep {
ref($_) eq 'Module::Install::Metadata';
} @{$self->admin->{extensions}};
return unless $metadata;
return $metadata->{values}{all_from} || '';
}
'Readme!';
__END__
#line 254
......@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.06';
$VERSION = '1.08';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......
......@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.06';
$VERSION = '1.08';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment