[Bps-public-commit] rt-extension-customizecontenttype branch, master, updated. 504ef240927a3f915603fc52fb3a05831dc72b9b

Thomas Sibley trs at bestpractical.com
Tue Nov 20 13:30:10 EST 2012


The branch, master has been updated
       via  504ef240927a3f915603fc52fb3a05831dc72b9b (commit)
       via  d69ae8d6944975616dede2c01f7c16d50251bfb8 (commit)
      from  b7b519e7a26456bc503d55fbc48a5591b789983e (commit)

Summary of changes:
 inc/Module/Install/RTx.pm                | 30 +++++----------------------
 lib/RT/Extension/CustomizeContentType.pm | 35 ++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 25 deletions(-)

- Log -----------------------------------------------------------------
commit d69ae8d6944975616dede2c01f7c16d50251bfb8
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Nov 20 10:29:41 2012 -0800

    Update M::I

diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 73b9cda..ce01018 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -8,7 +8,7 @@ no warnings 'once';
 
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.29';
+our $VERSION = '0.30';
 
 use FindBin;
 use File::Glob     ();
@@ -129,18 +129,7 @@ install ::
 
     my %has_etc;
     if ( File::Glob::bsd_glob("$FindBin::Bin/etc/schema.*") ) {
-
-        # got schema, load factory module
         $has_etc{schema}++;
-        $self->load('RTxFactory');
-        $self->postamble(<< ".");
-factory ::
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name))"
-
-dropdb ::
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name drop))"
-
-.
     }
     if ( File::Glob::bsd_glob("$FindBin::Bin/etc/acl.*") ) {
         $has_etc{acl}++;
@@ -164,28 +153,19 @@ dropdb ::
         print "For first-time installation, type 'make initdb'.\n";
         my $initdb = '';
         $initdb .= <<"." if $has_etc{schema};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(schema))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(schema \$(NAME) \$(VERSION)))"
 .
         $initdb .= <<"." if $has_etc{acl};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(acl))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(acl \$(NAME) \$(VERSION)))"
 .
         $initdb .= <<"." if $has_etc{initialdata};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(insert))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(insert \$(NAME) \$(VERSION)))"
 .
         $self->postamble("initdb ::\n$initdb\n");
         $self->postamble("initialize-database ::\n$initdb\n");
     }
 }
 
-sub RTxInit {
-    unshift @INC, substr( delete( $INC{'RT.pm'} ), 0, -5 ) if $INC{'RT.pm'};
-    require RT;
-    RT::LoadConfig();
-    RT::ConnectToDatabase();
-
-    die "Cannot load RT" unless $RT::Handle and $RT::DatabaseType;
-}
-
 # stolen from RT::Handle so we work on 3.6 (cmp_versions came in with 3.8)
 { my %word = (
     a     => -4,
@@ -228,4 +208,4 @@ sub requires_rt {
 
 __END__
 
-#line 348
+#line 328

commit 504ef240927a3f915603fc52fb3a05831dc72b9b
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Nov 20 10:29:49 2012 -0800

    Include an example config for a common MS Office problem

diff --git a/lib/RT/Extension/CustomizeContentType.pm b/lib/RT/Extension/CustomizeContentType.pm
index 98bab43..5e7a1b8 100644
--- a/lib/RT/Extension/CustomizeContentType.pm
+++ b/lib/RT/Extension/CustomizeContentType.pm
@@ -69,10 +69,45 @@ add RT::Extension::CustomizeContentType to @Plugins in RT's etc/RT_SiteConfig.pm
         )
     );
 
+=head1 EXAMPLE CONFIGURATIONS
+
+=head2 Microsoft Office
+
+Older versions of IE often upload newer Microsoft Office documents with the
+generic C<application/octet-stream> MIME type instead of something more
+appropriate.  This causes RT to offer the file for download using the generic
+content type, which confuses users and doesn't launch Office for them.  You can
+fix that by L<installing this extension|/INSTALLATION> and using the
+configuration below:
+
+    Set(%ContentTypes,
+        '.docm' => 'application/vnd.ms-word.document.macroEnabled.12',
+        '.docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+        '.dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
+        '.dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
+        '.potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
+        '.potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
+        '.ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
+        '.ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
+        '.ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
+        '.pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
+        '.pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+        '.xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
+        '.xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
+        '.xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
+        '.xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+        '.xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
+        '.xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
+    );
+
+Config contributed by Nathan March.
+
 =head1 AUTHOR
 
 sunnavy, <sunnavy at bestpractical.com>
 
+Thomas Sibley <trs at bestpractical.com>
+
 
 =head1 LICENSE AND COPYRIGHT
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list