[Fusionforge-commits] FusionForge branch master updated. 7e7f5ddfe3c4a43c16b0b1386db5099c752a6112

Alain Peyrat aljeux at fusionforge.org
Fri Jul 12 14:54:38 CEST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  7e7f5ddfe3c4a43c16b0b1386db5099c752a6112 (commit)
       via  c040837038eb517207b9a43d09705389f5b40b6c (commit)
      from  7866aa031aa924aa02103b6430888c6ec18cc20a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7e7f5ddfe3c4a43c16b0b1386db5099c752a6112
Author: Alain Peyrat <alain.peyrat at alcatel-lucent.com>
Date:   Thu Jul 11 12:06:19 2013 +0200

    Improve detection of document type in docman for .ppt & .xls (hack)

diff --git a/src/common/docman/actions/addfile.php b/src/common/docman/actions/addfile.php
index 3ecc6f1..cb13326 100644
--- a/src/common/docman/actions/addfile.php
+++ b/src/common/docman/actions/addfile.php
@@ -124,9 +124,18 @@ switch ($type) {
 		$return_msg = _('Invalid file name.');
 			session_redirect($baseurl.'&error_msg='.urlencode($return_msg));
 		}
+
 		if (function_exists('finfo_open')) {
 			$finfo = finfo_open(FILEINFO_MIME_TYPE);
 			$uploaded_data_type = finfo_file($finfo, $uploaded_data['tmp_name']);
+			if( $uploaded_data_type === 'application/msword') {
+				$ext = pathinfo($uploaded_data['name'], PATHINFO_EXTENSION);
+				if ( $ext === 'ppt' ) {
+					$uploaded_data_type = 'application/vnd.ms-powerpoint';
+				} elseif ( $ext === 'xls' ) {
+					$uploaded_data_type = 'application/vnd.ms-excel';
+				}
+			}
 		} else {
 			$uploaded_data_type = $uploaded_data['type'];
 		}

commit c040837038eb517207b9a43d09705389f5b40b6c
Author: Alain Peyrat <alain.peyrat at alcatel-lucent.com>
Date:   Thu Jul 11 12:05:15 2013 +0200

    docman: Fix error if no Created_by date

diff --git a/src/common/docman/DocumentManager.class.php b/src/common/docman/DocumentManager.class.php
index 90896ac..e6e522f 100644
--- a/src/common/docman/DocumentManager.class.php
+++ b/src/common/docman/DocumentManager.class.php
@@ -181,10 +181,16 @@ class DocumentManager extends Error {
 					$nbDocsLabel = '<span class="tabtitle-nw" title="'._('Number of deleted documents in this folder').'" >('.$nbDocsTrashed.')</span>';
 				}
 				if ($localDg->getName() != '.trash') {
-					$user = user_get_object($localDg->getCreated_by());
-					$lititle = _('Created by')._(': ').$user->getRealName();
+					$lititle = '';
+					if ($localDg->getCreated_by()) {
+						$user = user_get_object($localDg->getCreated_by());
+						$lititle .= _('Created by')._(': ').$user->getRealName();
+					}
 					if ($localDg->getLastModifyDate()) {
-						$lititle .= _('; ')._('Last modified')._(': ').relative_date($localDg->getLastModifyDate());
+						if ($lititle) {
+							$lititle .= _('; ');
+						}
+						$lititle .= _('Last modified')._(': ').relative_date($localDg->getLastModifyDate());
 					}
 					echo '<li id="leaf-'.$subGroupIdValue.'" class="'.$liclass.'">'.util_make_link($link, $localDg->getName(), array('class'=>'tabtitle-nw', 'title'=>$lititle)).$nbDocsLabel;
 				} else {

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

Summary of changes:
 src/common/docman/DocumentManager.class.php |   12 +++++++++---
 src/common/docman/actions/addfile.php       |    9 +++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list