[Fusionforge-commits] FusionForge branch master updated. fed5e78e91c96bd197ba1694ab6df6c586e285b9

Franck Villaume nerville at fusionforge.org
Sun Nov 16 15:53:13 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  fed5e78e91c96bd197ba1694ab6df6c586e285b9 (commit)
       via  02e28f451d86774b320a008d1226ff8afd3151fd (commit)
       via  46bcc748b431a2f1cbe52895bbbb515fdb4e93a5 (commit)
      from  8c768e8d9e769e0d372e9c3ce845cfa9702e471c (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 fed5e78e91c96bd197ba1694ab6df6c586e285b9
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Nov 16 15:51:56 2014 +0100

    implement [#747] direct link to file details

diff --git a/src/CHANGES b/src/CHANGES
index 1191920..84af0fb 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -1,6 +1,7 @@
 Fusionforge-X.X:
 * [#658] Docman: Basic Webdav write mkcol, delete, put, move support (TrivialDev)
 * [#657] Docman: Add move mass actions (TrivialDev)
+* [#747] Docman: Direct link to file details (TrivialDev)
 * [#692] FRS: Reorganise code (TrivialDev)
 * [#697] FRS: Enable widget "My monitored packages" (TrivialDev)
 * [#705] FRS: Provide new role settings (TrivialDev)
diff --git a/src/common/docman/Document.class.php b/src/common/docman/Document.class.php
index 3fdb873..0c75f80 100644
--- a/src/common/docman/Document.class.php
+++ b/src/common/docman/Document.class.php
@@ -254,7 +254,7 @@ class Document extends Error {
 			}
 		}
 		$this->sendNotice(true);
-		$this->SendApprovalNotice();
+		$this->sendApprovalNotice();
 		db_commit();
 		if ($filesize) {
 			DocumentStorage::instance()->commit();
@@ -899,23 +899,23 @@ class Document extends Error {
 	}
 
 	/**
-	 * SendApprovalNotice - send email to project admin for pending documents.
+	 * sendApprovalNotice - send email to project admin for pending documents.
 	 *
 	 * @return	boolean	success.
 	 */
-	function SendApprovalNotice() {
+	function sendApprovalNotice() {
 		if ($this->getStateID() != 3)
 			return true;
 
 		$doc_name = $this->getName();
-		$desc     = util_unconvert_htmlspecialchars( $this->getDescription() );
+		$desc     = util_unconvert_htmlspecialchars($this->getDescription());
 		$group_id = $this->Group->getID();
 		$name     = $this->getCreatorRealName()." (".$this->getCreatorUserName().")";
 		$bcc      = '';
 
 		$subject="[" . forge_get_config('forge_name') ."] ".util_unconvert_htmlspecialchars($doc_name);
 		$body = "\n"._('A new document has been uploaded and waiting to be approved by you')._(': ').
-		"\n".util_make_url('/docman/?group_id='.$group_id.'&view=admin').
+		"\n".util_make_url('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$this->getDocGroupID().'&filedetailid='.$this->getID()).
 		"\n"._('by').(': ').$name."\n";
 
 		$sanitizer = new TextSanitizer();
diff --git a/src/common/docman/views/listfile.php b/src/common/docman/views/listfile.php
index fca1a7c..5d79f57 100644
--- a/src/common/docman/views/listfile.php
+++ b/src/common/docman/views/listfile.php
@@ -385,6 +385,32 @@ if ($DocGroupName) {
 	}
 	if (forge_check_perm('docman', $g->getID(), 'approve') && $foundFiles) {
 		include ($gfcommon.'docman/views/editfile.php');
+		$directViewFileRequestedID = getIntFromRequest('filedetailid', null);
+		if ($directViewFileRequestedID) {
+			$localDocumentObject = document_get_object($directViewFileRequestedID);
+			echo html_ao('script', array('type' => 'text/javascript'));
+			echo '//<![CDATA['."\n";
+			echo 'jQuery(document).ready(function() {javascript:controllerListFile.toggleEditFileView({action:\''.util_make_uri($editfileaction).'\',
+														lockIntervalDelay: 60000,
+														childGroupId: '.util_ifsetor($childgroup_id, 0).',
+														id:'.$localDocumentObject->getID().',
+														groupId:'.$localDocumentObject->Group->getID().',
+														docgroupId:'.$localDocumentObject->getDocGroupID().',
+														statusId:'.$localDocumentObject->getStateID().',
+														statusDict:'.$dm->getStatusNameList('json').',
+														docgroupDict:'.$dm->getDocGroupList($nested_groups, 'json').',
+														title:\''.addslashes($localDocumentObject->getName()).'\',
+														filename:\''.$localDocumentObject->getFilename().'\',
+														description:\''.addslashes($localDocumentObject->getDescription()).'\',
+														isURL:\''.$localDocumentObject->isURL().'\',
+														isText:\''.$localDocumentObject->isText().'\',
+														isHtml:\''.$d->isHtml().'\',
+														useCreateOnline:'.$localDocumentObject->Group->useCreateOnline().',
+														docManURL:\''.util_make_uri('/docman').'\'})';
+			echo '})';
+			echo '//]]>';
+			echo html_ac(html_ap() - 1);
+		}
 	}
 }
 

commit 02e28f451d86774b320a008d1226ff8afd3151fd
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Nov 14 13:15:49 2014 +0100

    cleanup, use proper util_make_link_u

diff --git a/src/common/include/user_profile.php b/src/common/include/user_profile.php
index d95de57..872d213 100644
--- a/src/common/include/user_profile.php
+++ b/src/common/include/user_profile.php
@@ -34,6 +34,7 @@
 * @return	string		HTML
 */
 function user_personal_information($user, $compact = false, $title = false) {
+	global $HTML;
 	$user_id = $user->getID();
 
 	$user_logo = false;
@@ -42,16 +43,14 @@ function user_personal_information($user, $compact = false, $title = false) {
 	if ($params['content']) {
 		$user_logo = $params['content'];
 	}
-
+	$html = $HTML->listTableTop();
 	if($compact) {
-		$html = '<table>';
+
 		if($title) {
 			$html .= '<tr>
 						<td colspan="2">'. $title . '</td>
 					  </tr>';
 		}
-	} else {
-		$html = '<table class="fullwidth">';
 	}
 
 	$html .= '<tr>';
@@ -100,49 +99,46 @@ function user_personal_information($user, $compact = false, $title = false) {
 				</div>
 				</td>
 			</tr>';
-	if (!$compact) {
-		if(forge_get_config('user_display_contact_info')) {
-
-			$user_mail=$user->getEmail();
-			$user_mailsha1=$user->getSha1Email();
+	if (!$compact && forge_get_config('user_display_contact_info')) {
+		$user_mail=$user->getEmail();
+		$user_mailsha1=$user->getSha1Email();
 
-			$html .= '<tr>
-				<td>'. _('Email Address') . _(': ') .'</td>
-				<td><strong>'.
+		$html .= '<tr>
+			<td>'. _('Email Address') . _(': ') .'</td>
+			<td><strong>'.
 
-			// Removed for privacy reasons
-			//print '<span property="sioc:email" content="'. $user_mail .'">';
-					'<span property="sioc:email_sha1" content="'. $user_mailsha1 .'">' .
-			util_make_link ('/sendmessage.php?touser='.$user_id, str_replace('@',' @nospam@ ',$user_mail)) .
-					'</span>
-					</strong>
-				</td>
-			</tr>';
+		// Removed for privacy reasons
+		//print '<span property="sioc:email" content="'. $user_mail .'">';
+				'<span property="sioc:email_sha1" content="'. $user_mailsha1 .'">' .
+		util_make_link ('/sendmessage.php?touser='.$user_id, str_replace('@',' @nospam@ ',$user_mail)) .
+				'</span>
+				</strong>
+			</td>
+		</tr>';
 
-			if ($user->getAddress() || $user->getAddress2()) {
-				$html .= '<tr>
-				<td><'. _('Address')._(':') .'</td>
-				<td>'. $user->getAddress() .'<br/>'. $user->getAddress2() .'</td>
-			</tr>';
-			}
+		if ($user->getAddress() || $user->getAddress2()) {
+			$html .= '<tr>
+			<td><'. _('Address')._(':') .'</td>
+			<td>'. $user->getAddress() .'<br/>'. $user->getAddress2() .'</td>
+		</tr>';
+		}
 
-			if ($user->getPhone()) {
-				$html .= '<tr>
-				<td>' . _('Phone')._(':') . '</td>
-				<td>' .
-				//print '<div property="foaf:phone" content="'.$user->getPhone().'">';
-				$user->getPhone()
-				//echo '</div>';
-				.'</td>
-			</tr>';
-			}
+		if ($user->getPhone()) {
+			$html .= '<tr>
+			<td>' . _('Phone')._(':') . '</td>
+			<td>' .
+			//print '<div property="foaf:phone" content="'.$user->getPhone().'">';
+			$user->getPhone()
+			//echo '</div>';
+			.'</td>
+		</tr>';
+		}
 
-			if ($user->getFax()) {
-				$html .= '<tr>
-				<td>'. _('Fax')._(':') .'</td>
-				<td>'. $user->getFax() .'</td>
-			</tr>';
-			}
+		if ($user->getFax()) {
+			$html .= '<tr>
+			<td>'. _('Fax')._(':') .'</td>
+			<td>'. $user->getFax() .'</td>
+		</tr>';
 		}
 	}
 	$html .= '
@@ -155,13 +151,13 @@ function user_personal_information($user, $compact = false, $title = false) {
 		$user_uri = util_make_url('/users/'. $user->getUnixName() . '/');
 		$html .= '<tr>
 					<td><small>'. _('URI:') .'</small></td>
-					<td><small><a href="'. $user_uri .'">'. $user_uri .'</a></small></td>
+					<td><small>'.util_make_link_u($user->getUnixName(), $user->getID(), util_make_url_u($user->getUnixName(), $user->getID())).'</small></td>
 				</tr>';
 	}
 	$html .= '</table>
 	</td>
-	</tr>
-	</table>';
+	</tr>';
+	$html .= $HTML->listTableBottom();
 
 	return $html;
 }

commit 46bcc748b431a2f1cbe52895bbbb515fdb4e93a5
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Nov 14 11:34:59 2014 +0100

    user_profile.php is in common & clean-up

diff --git a/src/www/include/user_home.php b/src/www/include/user_home.php
index 760c9be..fc10145 100644
--- a/src/www/include/user_home.php
+++ b/src/www/include/user_home.php
@@ -29,34 +29,28 @@
  * Assumes $user object for displayed user is present
  */
 
-require_once $gfwww.'include/user_profile.php';
+require_once $gfcommon.'include/user_profile.php';
 require_once $gfwww.'include/vote_function.php';
 
 $title = _('User Profile');
 $HTML->header(array('title'=>$title));
 
 echo $HTML->boxTop(_('Personal Information'), _('Personal Information'));
+echo html_ao('div', array('about' => '', 'typeof' => 'sioc:UserAccount'));
+echo user_personal_information($user);
 
-?>
-
-<div about="" typeof="sioc:UserAccount">
-
-	<?php
-
-	echo user_personal_information($user);
-
-	if (forge_get_config('use_ratings')) {
-		echo $HTML->boxMiddle(_('Peer Rating'), _('Peer Rating'));
-        echo '<table class="my-layout-table" id="user-profile-rating">';
-		if ($user->usesRatings()) {
-			vote_show_user_rating($user_id);
-		} else {
-            echo '<tr><td colspan="2">';
-			echo _('User chose not to participate in peer rating');
-            echo '</td></tr>';
-		}
-        echo '</table><!-- id="user-profile-rating" -->';
+if (forge_get_config('use_ratings')) {
+	echo $HTML->boxMiddle(_('Peer Rating'), _('Peer Rating'));
+	echo '<table class="my-layout-table" id="user-profile-rating">';
+	if ($user->usesRatings()) {
+		vote_show_user_rating($user_id);
+	} else {
+		echo '<tr><td colspan="2">';
+		echo _('User chose not to participate in peer rating');
+		echo '</td></tr>';
 	}
+	echo '</table><!-- id="user-profile-rating" -->';
+}
 
 if (forge_get_config('use_diary')) {
 	echo $HTML->boxMiddle(_('Diary and Notes'), _('Diary and Notes'));
@@ -146,7 +140,7 @@ if (count ($projects) < 1) {
 } // end if groups
 echo "</div>\n"; // prefixes
 
-echo "</div>\n"; // end of about=""
+echo html_ac(html_ap() -1);
 
 $me = session_get_user();
 if (forge_get_config('use_ratings')) {

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

Summary of changes:
 src/CHANGES                          |    1 +
 src/common/docman/Document.class.php |   10 ++--
 src/common/docman/views/listfile.php |   26 ++++++++++
 src/common/include/user_profile.php  |   86 ++++++++++++++++------------------
 src/www/include/user_home.php        |   36 ++++++--------
 5 files changed, 88 insertions(+), 71 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list