[Fusionforge-commits] FusionForge branch master updated. 75560c612463d04a36d18bd9a57e2581ce526d48

Franck Villaume nerville at fusionforge.org
Mon Mar 17 11:34:27 CET 2014


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  75560c612463d04a36d18bd9a57e2581ce526d48 (commit)
       via  0ae1c5afd334314c7b104c421e016faba077de28 (commit)
       via  112220ccb3742044f2d76bb9802bc4f4f06fd789 (commit)
       via  9eeb2ce2b9b25d8c2884cb0040eaf57977e6a22b (commit)
       via  0e82dd4197d9d0cb54bffeb109bfa560cdfbc9c8 (commit)
       via  bec5d34279309b4d666375e7f3cef000b14be47a (commit)
       via  0d32317001f928a770a47599f70d472c1df7c492 (commit)
       via  7dfe9e8ccfef3b587a780c19ac66617f60b04890 (commit)
      from  e1a66768a08d2d9ded90cd411d1f87a602f78bc5 (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 75560c612463d04a36d18bd9a57e2581ce526d48
Merge: 0e82dd4 0ae1c5a
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Mon Mar 17 11:28:35 2014 +0100

    merge Branch_5_3

diff --cc .gitignore
index 3110fb4,815ec00..a905e54
--- a/.gitignore
+++ b/.gitignore
@@@ -65,4 -65,12 +65,13 @@@ htdocs/deb-repo/mkdebidx.lo
  htdocs/deb-repo/timestamp
  src/www/scm/viewvc/viewvc.org/*.tar.gz
  src/www/scm/viewvc/viewvc.org/*.zip
 +*~
+ # Debian packaging:
+ /*.dsc
+ /*.tar.gz
+ /*.diff.gz
+ /*.build
+ /*.changes
+ /*.deb
+ /*.upload
+ /.pc
diff --cc src/common/docman/views/reporting.php
index 684c3c1,275b7a5..933978b
--- a/src/common/docman/views/reporting.php
+++ b/src/common/docman/views/reporting.php
@@@ -164,15 -169,20 +164,19 @@@ if (count($data) == 0) 
  	$tabletop = array(_('Folder'), _('Document'), _('User'), _('Date'));
  	$classth = array('', '', '', '');
  	echo $HTML->listTableTop($tabletop, false, 'sortable_docman_listfile', 'sortable', $classth);
 -	for ($i=0; $i<count($data); $i++) {
 -		$date = preg_replace('/^(....)(..)(..)$/', '\1-\2-\3', $data[$i][2]);
 +	for ($i = 0; $i < count($data); $i++) {
  		$ndg = new DocumentGroup($g, $data[$i][3]);
 -		$path = $ndg->getPath(true);
 -		echo '<tr '. $HTML->boxGetAltRowStyle($i) .'>'.
 -			'<td>'.$path.'</td>'.
 -			'<td>'. $data[$i][0] .'</td>';
 +		$cells = array();
 +		$cells[][] = $ndg->getPath(true);
 +		$cells[][] = $data[$i][0];
- 		$userObject = user_get_object($data[$i][1]);
- 		$cells[][] = util_display_user($userObject->getUnixName(), $data[$i][1], $userObject->getRealName());
+ 		if ( $data[$i][1] != 100) {
+ 			$userObject = user_get_object($data[$i][1]);
 -			echo '<td>'.util_display_user($userObject->getUnixname(), $data[$i][1], $userObject->getRealname()).'</td>';
++			$cells[][] = util_display_user($userObject->getUnixName(), $data[$i][1], $userObject->getRealName());
+ 		} else {
 -			echo '<td>'._('Anonymous user').'</td>';
++			$cells[][] = _('Anonymous user');
+ 		}
 -		echo '<td class="align-center">'. $date .'</td></tr>';
 +		$cells[] = array(preg_replace('/^(....)(..)(..)$/', '\1-\2-\3', $data[$i][2]), 'class' => 'align-center');
 +		echo $HTML->multiTableRow(array(), $cells);
  	}
  	echo $HTML->listTableBottom();
  }
diff --cc src/common/include/database-pgsql.php
index 714a682,bcffdad..178b500
--- a/src/common/include/database-pgsql.php
+++ b/src/common/include/database-pgsql.php
@@@ -72,8 -72,8 +72,8 @@@ function db_connect() 
  	if (function_exists("pg_pconnect")) {
  		$gfconn = pg_pconnect(pg_connectstring(forge_get_config('database_name'), forge_get_config('database_user'), forge_get_config('database_password'), forge_get_config('database_host'), forge_get_config('database_port')));
  		if (!$gfconn) {
 -			print forge_get_config ('forge_name')." Could Not Connect to Database: ".db_error();
 +			print forge_get_config('forge_name')." Could Not Connect to Database: ".db_error();
- 			exit;
+ 			exit(1);
  		}
  	} else {
  		print("function pg_pconnect doesn't exist: no postgresql interface");

commit 0e82dd4197d9d0cb54bffeb109bfa560cdfbc9c8
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Mon Mar 17 10:54:19 2014 +0100

    docman: improve report view

diff --git a/src/common/docman/views/reporting.php b/src/common/docman/views/reporting.php
index 2e7e1e1..684c3c1 100644
--- a/src/common/docman/views/reporting.php
+++ b/src/common/docman/views/reporting.php
@@ -78,34 +78,28 @@ html_use_jqueryjqplotpluginhighlighter();
 echo $HTML->getJavascripts();
 echo $HTML->getStylesheets();
 
+
 $report = new ReportPerGroupDocmanDownloads($group_id, $start, $end);
+
 if ($report->isError()) {
-	echo '<p class="error_msg">'.$report->getErrorMessage().'</p>';
+	echo html_e('p', array('class' => 'error_msg'), $report->getErrorMessage(), false);
 } else {
-?>
-
-<form action="<?php echo util_make_url('/docman/') ?>"
-	  method="get"
-	  class="align-center">
-	<input type="hidden" name="group_id" value="<?php echo $group_id; ?>" />
-	<input type="hidden" name="view" value="reporting" />
-	<strong><?php echo _('Start Date')._(':'); ?></strong>
-	<?php echo report_months_box($report, 'start', $start); ?>
-	<strong><?php echo _('End Date')._(':'); ?></strong>
-	<?php echo report_months_box($report, 'end', $end); ?>
-	<input type="submit" name="submit" value="<?php echo _('Refresh'); ?>" />
-</form>
 
-<?php
+	echo html_ao('form', array('action' => util_make_uri('/docman/?group_id='.$group_id.'&view=reporting'), 'method' => 'post', 'class' => 'align-center'));
+	echo html_ao('div', array('id' => 'div_form_reporting'));
+	echo html_e('strong', array(), _('Start Date')._(':'), false);
+	echo report_months_box($report, 'start', $start);
+	echo html_e('strong', array(), _('End Date')._(':'), false);
+	echo html_e('input', array('type' => 'submit', 'value' => _('Refresh')));
+	echo html_ac(html_ap() -2);
 
 $data = $report->getData();
 
 if (count($data) == 0) {
-	echo '<p class="information">';
-	echo _('There have been no viewed documents for this project yet.');
-	echo '</p>';
+	echo html_e('p', array('class' => 'information'), _('There have been no viewed documents for this project yet.'), false);
 } else {
-	echo '<script type="text/javascript">//<![CDATA['."\n";
+	echo '<script type="text/javascript">';
+	echo '//<![CDATA['."\n";
 	echo 'var ticks = new Array();';
 	echo 'var values = new Array();';
 	$arr =& $report->getMonthStartArr();
@@ -164,20 +158,21 @@ if (count($data) == 0) {
 	echo 'jQuery(window).resize(function() {
 			plot1.replot( { resetAxes: true } );
 		});'."\n";
-	echo '//]]></script>';
+	echo '//]]>';
+	echo '</script>';
 	echo '<div id="chart1"></div>';
 	$tabletop = array(_('Folder'), _('Document'), _('User'), _('Date'));
 	$classth = array('', '', '', '');
 	echo $HTML->listTableTop($tabletop, false, 'sortable_docman_listfile', 'sortable', $classth);
-	for ($i=0; $i<count($data); $i++) {
-		$date = preg_replace('/^(....)(..)(..)$/', '\1-\2-\3', $data[$i][2]);
-		$ndg = new DocumentGroup($g, $data[$i][4]);
-		$path = $ndg->getPath(true);
-		echo '<tr '. $HTML->boxGetAltRowStyle($i) .'>'.
-			'<td>'.$path.'</td>'.
-			'<td>'. $data[$i][0] .'</td>'.
-			'<td><a class="tabtitle" title="'._('View user profile').'" href="/users/'.urlencode($data[$i][3]).'/">'. $data[$i][1] .'</a></td>'.
-			'<td class="align-center">'. $date .'</td></tr>';
+	for ($i = 0; $i < count($data); $i++) {
+		$ndg = new DocumentGroup($g, $data[$i][3]);
+		$cells = array();
+		$cells[][] = $ndg->getPath(true);
+		$cells[][] = $data[$i][0];
+		$userObject = user_get_object($data[$i][1]);
+		$cells[][] = util_display_user($userObject->getUnixName(), $data[$i][1], $userObject->getRealName());
+		$cells[] = array(preg_replace('/^(....)(..)(..)$/', '\1-\2-\3', $data[$i][2]), 'class' => 'align-center');
+		echo $HTML->multiTableRow(array(), $cells);
 	}
 	echo $HTML->listTableBottom();
 }
diff --git a/src/common/reporting/ReportPerGroupDocmanDownloads.class.php b/src/common/reporting/ReportPerGroupDocmanDownloads.class.php
index 94e1864..1b39789 100644
--- a/src/common/reporting/ReportPerGroupDocmanDownloads.class.php
+++ b/src/common/reporting/ReportPerGroupDocmanDownloads.class.php
@@ -70,19 +70,21 @@ class ReportPerGroupDocmanDownloads extends Report {
 			return;
 		}
 
-		$res = db_query_params ('SELECT docdata_vw.filename, docdata_vw.realname,
+		$res = db_query_params ('SELECT docdata_vw.filename, docman_dlstats_doc.user_id,
 					docman_dlstats_doc.month || lpad(docman_dlstats_doc.day::text,2,0::text),
-					docdata_vw.user_name,
 					docdata_vw.doc_group
 					FROM docman_dlstats_doc, docdata_vw
 					WHERE docdata_vw.group_id = $1
-					AND docman_dlstats_doc.month >= $2
-					AND docman_dlstats_doc.month <= $3
+					AND docdata_vw.stateid = $2
+					AND docman_dlstats_doc.month >= $3
+					AND docman_dlstats_doc.month <= $4
+					AND docdata_vw.docid = docman_dlstats_doc.docid
 					ORDER BY docman_dlstats_doc.month DESC,
 					docman_dlstats_doc.day DESC',
 					array ($group_id,
-					       $start_m,
-					       $end_m));
+						1,
+						$start_m,
+						$end_m));
 
 		$this->start_date = $start;
 		$this->end_date = $end;

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

Summary of changes:
 .gitignore                                         |    9 +++
 src/common/docman/views/reporting.php              |   59 ++++++++++----------
 src/common/include/database-pgsql.php              |    4 +-
 .../ReportPerGroupDocmanDownloads.class.php        |   10 ++--
 vm/scripts/uninstall.sh                            |    2 +
 5 files changed, 48 insertions(+), 36 deletions(-)
 create mode 100755 vm/scripts/uninstall.sh


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list