diff --git a/ChangeLog b/ChangeLog index 5d25e7130..31d1e573b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,7 @@ + Now ships with an add-on script, update-holidays.pl, which contacts http://holidata.net, and brings the installed holiday files up to date. + Extension system now controlled by the 'extensions' configuration variable. + + HTML export in the form of an external scripts export-html.pl. # Tracked Features, sorted by ID. + Added feature #523 & #659, adding 'status' as a reportable field (thanks to diff --git a/NEWS b/NEWS index 91bd36a26..784a5c0ed 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ New Features in taskwarrior 2.0.0 filter's results. - Status attribute can now be used in report. - Project names may now contain spaces. + - New export-html.pl script. Please refer to the ChangeLog file for full details. There are too many to list here. diff --git a/scripts/add-ons/export-csv.pl b/scripts/add-ons/export-csv.pl index 0083b41de..f8c6e0929 100755 --- a/scripts/add-ons/export-csv.pl +++ b/scripts/add-ons/export-csv.pl @@ -28,10 +28,23 @@ use strict; use warnings; -use JSON; + +# Give a nice error if the (non-standard) JSON module is not installed. +eval "use JSON"; +if ($@) +{ + print "Error: You need to install the JSON Perl module.\n"; + exit 1; +} + # Use the taskwarrior 1.9.4+ _query command to issue a query and return JSON my $command = '/usr/local/bin/task _query ' . join (' ', @ARGV); +if ($command =~ /No matches/) +{ + print stderr $command; + exit 1; +} # Generate output. print "'uuid','status','tags','entry','start','due','recur','end','project',", diff --git a/scripts/add-ons/export-html.pl b/scripts/add-ons/export-html.pl new file mode 100755 index 000000000..29faf68fe --- /dev/null +++ b/scripts/add-ons/export-html.pl @@ -0,0 +1,92 @@ +#! /usr/bin/perl +################################################################################ +## taskwarrior - a command line task list manager. +## +## Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez. +## All rights reserved. +## +## This program is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free Software +## Foundation; either version 2 of the License, or (at your option) any later +## version. +## +## This program is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +## details. +## +## You should have received a copy of the GNU General Public License along with +## this program; if not, write to the +## +## Free Software Foundation, Inc., +## 51 Franklin Street, Fifth Floor, +## Boston, MA +## 02110-1301 +## USA +## +################################################################################ + +use strict; +use warnings; + +# Give a nice error if the (non-standard) JSON module is not installed. +eval "use JSON"; +if ($@) +{ + print "Error: You need to install the JSON Perl module.\n"; + exit 1; +} + + +# Use the taskwarrior 1.9.4+ _query command to issue a query and return JSON +my $command = '/usr/local/bin/task _query ' . join (' ', @ARGV); +if ($command =~ /No matches/) +{ + print stderr $command; + exit 1; +} + +# Generate output. +print "\n", + "
\n", + "| ID | \n", + "Pri | \n", + "Description | \n", + "Project | \n", + "Due | \n", + "
| ", ($data->{'id'} || ''), " | \n", + "", ($data->{'priority'} || ''), " | \n", + "", ($data->{'description'} || ''), " | \n", + "", ($data->{'project'} || ''), " | \n", + "", ($data->{'due'} || ''), " | \n", + "
| ", $count, " matching tasks | \n", + "