[Fusionforge-commits] FusionForge branch master updated. 5e393a91c4f8040efaf2a833dc00674251419806

Franck Villaume nerville at fusionforge.org
Wed Mar 26 16:12:45 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  5e393a91c4f8040efaf2a833dc00674251419806 (commit)
       via  d673a340b191d8e8851700343a9e8ef8e09ab98d (commit)
       via  4020a7fbdd7702e666e316318b2105e3f53359b0 (commit)
       via  c386c236190ceb8de307b0387da80ad40bc11d79 (commit)
       via  c00c01cf25be8430986d109a096fb6f33b3164e6 (commit)
       via  177eca1537abc5f6f7253400563fb7a64b4565ac (commit)
       via  f281b00e1460637528086353bd70b998fa243e13 (commit)
       via  d734af8fa88e22623eba730b7cc360835aea6af2 (commit)
       via  5e26bc1f9e129e0b22748dab4c1adb0118d18d76 (commit)
       via  7056294e943759a0cebc7b80890642ab7dea34fb (commit)
       via  7d020680c7cbfa0e6a0a3a2e86ecb6000b6a3992 (commit)
       via  66ef369c72beaf16a93999ef7786e57482e74696 (commit)
       via  ca66cad3246e74f8663ed0a49add98119dd57c55 (commit)
      from  3d7e789dac791375cbb7f22b806ddba1609dc7ff (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 5e393a91c4f8040efaf2a833dc00674251419806
Merge: d673a34 c386c23
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Mar 26 16:12:03 2014 +0100

    merge Branch_5_3

diff --cc src/common/docman/views/listfile.php
index f21d1e9,62699ff..48068ee
--- a/src/common/docman/views/listfile.php
+++ b/src/common/docman/views/listfile.php
@@@ -236,25 -245,41 +236,25 @@@ if (isset($nested_docs[$dirid]) && is_a
  				break;
  			}
  			default: {
 -				$docurl = util_make_uri('/docman/view.php/'.$d->Group->getID().'/'.$d->getID().'/'.urlencode($d->getFileName()));
 -				$docurltitle = _('View this document');
 +				$cells[][] =  util_make_link('/docman/view.php/'.$d->Group->getID().'/'.$d->getID().'/'.urlencode($d->getFileName()), html_image($d->getFileTypeImage(), '22', '22', array('alt' => $d->getFileType())), array('class' => 'tabtitle-nw', 'title' => _('View this document')));
  			}
  		}
 -		echo '<td><a href="'.$docurl.'" class="tabtitle-nw" title="'.$docurltitle.'" >';
 -		echo html_image($d->getFileTypeImage(), '22', '22', array('alt'=>$d->getFileType()));
 -		echo '</a></td>'."\n";
 -		echo '<td style="word-wrap: break-word; max-width: 250px;" >';
 +		$nextcell = '';
  		if (($d->getUpdated() && $time_new > (time() - $d->getUpdated())) || $time_new > (time() - $d->getCreated())) {
 -			$html_image_attr = array();
 -			$html_image_attr['alt'] = _('new');
 -			$html_image_attr['class'] = 'tabtitle-ne';
 -			$html_image_attr['title'] = _('Created or updated since less than 7 days');
 -			echo html_image('docman/new.png', '14', '14', $html_image_attr);
 +			$nextcell = html_image('docman/new.png', '14', '14', array('alt' => _('new'), 'class' => 'tabtitle-ne', 'title' => _('Created or updated since less than 7 days'))).' ';
  		}
 -		echo ' '.$d->getFileName();
 -		echo '</td>';
 -		echo '<td style="word-wrap: break-word; max-width: 250px;" >'.$d->getName().'</td>';
 -		echo '<td style="word-wrap: break-word; max-width: 250px;" >'.$d->getDescription().'</td>';
 -		echo '<td>'.make_user_link($d->getCreatorUserName(), $d->getCreatorRealName()).'</td>';
 -		if ( $d->getUpdated() ) {
 -			echo '<td sorttable_customkey="'.$d->getUpdated().'" >';
 -			echo date(_('Y-m-d H:i'), $d->getUpdated());
 +		$cells[] = array($nextcell.$d->getFileName(), 'style' => 'word-wrap: break-word; max-width: 250px;');
 +		$cells[] = array($d->getName(), 'style' => 'word-wrap: break-word; max-width: 250px;');
 +		$cells[] = array($d->getDescription(), 'style' => 'word-wrap: break-word; max-width: 250px;');
 +		$cells[][] =  make_user_link($d->getCreatorUserName(), $d->getCreatorRealName());
 +		if ($d->getUpdated()) {
- 			$cells[][] = date(_('Y-m-d H:i'), $d->getUpdated());
++			$cells[] = array(date(_('Y-m-d H:i'), $d->getUpdated()), 'sorttable_customkey' => $d->getUpdated());
  		} else {
- 			$cells[][] = date(_('Y-m-d H:i'), $d->getCreated());
 -			echo '<td sorttable_customkey="'.$d->getCreated().'" >';
 -			echo date(_('Y-m-d H:i'), $d->getCreated());
++			$cells[] = array(date(_('Y-m-d H:i'), $d->getCreated()), 'sorttable_customkey' => $d->getCreated());
  		}
 -		echo '</td>';
 -		echo '<td>';
 +		$nextcell = '';
  		if ($d->getReserved()) {
 -			$html_image_attr = array();
 -			$html_image_attr['alt'] = _('Reserved Document');
 -			$html_image_attr['class'] = 'tabtitle';
 -			$html_image_attr['title'] = _('Reserved Document');
 -			echo html_image('docman/document-reserved.png', '22', '22', $html_image_attr);
 +			$nextcell = html_image('docman/document-reserved.png', '22', '22', array('alt' => _('Reserved Document'), 'class' => 'tabtitle', 'title' => _('Reserved Document')));
  			$reserved_by = $d->getReservedBy();
  			if ($reserved_by) {
  				$user = user_get_object($reserved_by);
diff --cc src/common/docman/views/listtrashfile.php
index 722d0dd,cd9e6b1..11271ef
--- a/src/common/docman/views/listtrashfile.php
+++ b/src/common/docman/views/listtrashfile.php
@@@ -146,26 -156,40 +146,26 @@@ if (isset($nested_docs[$dirid]) && is_a
  				break;
  			}
  			default: {
 -				$docurl = util_make_uri('/docman/view.php/'.$group_id.'/'.$d->getID().'/'.urlencode($d->getFileName()));
 -				$docurltitle = _('View this document');
 +				$cells[][] = util_make_link('/docman/view.php/'.$group_id.'/'.$d->getID().'/'.urlencode($d->getFileName()), html_image($d->getFileTypeImage(), '22', '22', array('alt' => $d->getFileType())), array('title' => _('View this document'), 'class' => 'tabtitle-nw'));
  			}
  		}
 -		echo '<td><a href="'.$docurl.'" class="tabtitle-nw" title="'.$docurltitle.'" >';
 -		echo html_image($d->getFileTypeImage(), '22', '22', array('alt'=>$d->getFileType()));;
 -		echo '</a></td>';
 -		echo '<td style="word-wrap: break-word; max-width: 250px;" >';
 +		$nextcell ='';
  		if (($d->getUpdated() && $time_new > (time() - $d->getUpdated())) || $time_new > (time() - $d->getCreated())) {
 -			$html_image_attr = array();
 -			$html_image_attr['alt'] = _('new');
 -			$html_image_attr['class'] = 'docman-newdocument';
 -			$html_image_attr['title'] = _('Updated since less than 7 days');
 -			echo html_image('docman/new.png', '14', '14', $html_image_attr);
 +			$nextcell =  html_image('docman/new.png', '14', '14', array('alt' => _('new'), 'class' => 'docman-newdocument', 'title' => _('Updated since less than 7 days'))).' ';
  		}
 -		echo ' '.$d->getFileName();
 -		echo '</td>';
 -		echo '<td style="word-wrap: break-word; max-width: 250px;" >'.$d->getName().'</td>';
 -		echo '<td style="word-wrap: break-word; max-width: 250px;" >'.$d->getDescription().'</td>';
 -		echo '<td>'.make_user_link($d->getCreatorUserName(), $d->getCreatorRealName()).'</td>';
 -		if ( $d->getUpdated() ) {
 -			echo '<td sorttable_customkey="'.$d->getUpdated().'" >';
 -			echo date(_('Y-m-d H:i'), $d->getUpdated());
 +		$cells[] = array($nextcell.$d->getFileName(), 'style' => 'word-wrap: break-word; max-width: 250px;');
 +		$cells[] = array($d->getName(), 'style' => 'word-wrap: break-word; max-width: 250px;');
 +		$cells[] = array($d->getDescription(), 'style' => 'word-wrap: break-word; max-width: 250px;');
 +		$cells[][] =  make_user_link($d->getCreatorUserName(), $d->getCreatorRealName());
 +		if ($d->getUpdated()) {
- 			$cells[][] = date(_('Y-m-d H:i'), $d->getUpdated());
++			$cells[] = array(date(_('Y-m-d H:i'), $d->getUpdated()), 'sorttable_customkey' => $d->getUpdated());
  		} else {
- 			$cells[][] = date(_('Y-m-d H:i'), $d->getCreated());
 -			echo '<td sorttable_customkey="'.$d->getCreated().'" >';
 -			echo date(_('Y-m-d H:i'), $d->getCreated());
++			$cells[] = array(date(_('Y-m-d H:i'), $d->getCreated()), 'sorttable_customkey' => $d->getCreated());
  		}
 -		echo '</td>';
 -		echo '<td>';
 -		echo $d->getStateName().'</td>';
 -		echo '<td>';
 +		$cells[][] = $d->getStateName();
  		switch ($d->getFileType()) {
  			case "URL": {
 -				echo "--";
 +				$cells[][] = "--";
  				break;
  			}
  			default: {
diff --cc src/common/docman/views/pendingfiles.php
index c4a942e,a1f884d..a56a17c
--- a/src/common/docman/views/pendingfiles.php
+++ b/src/common/docman/views/pendingfiles.php
@@@ -73,26 -76,40 +73,26 @@@ jQuery(document).ready(function() 
  					break;
  				}
  				default: {
 -					$docurl = util_make_uri('/docman/view.php/'.$g->getID().'/'.$d->getID().'/'.urlencode($d->getFileName()));
 -					$docurltitle = _('View this document');
 +					$cells[][] = util_make_link('/docman/view.php/'.$g->getID().'/'.$d->getID().'/'.urlencode($d->getFileName()), html_image($d->getFileTypeImage(), '22', '22', array('alt'=>$d->getFileType())), array('class' => 'tabtitle-nw', 'title' => _('View this document')));
  				}
  			}
 -			echo '<td><a href="'.$docurl.'" class="tabtitle-nw" title="'.$docurltitle.'" >';
 -			echo html_image($d->getFileTypeImage(), '22', '22', array('alt'=>$d->getFileType()));;
 -			echo '</a></td>';
 -			echo '<td>';
 +			$nextcell = '';
  			if (($d->getUpdated() && $time_new > (time() - $d->getUpdated())) || $time_new > (time() - $d->getCreated())) {
 -				$html_image_attr = array();
 -				$html_image_attr['alt'] = _('new');
 -				$html_image_attr['class'] = 'docman-newdocument';
 -				$html_image_attr['title'] = _('Created or updated since less than 7 days');
 -				echo html_image('docman/new.png', '14', '14', $html_image_attr);
 +				$nextcell.= html_image('docman/new.png', '14', '14', array('alt' => _('new'), 'class' => 'docman-newdocument', 'title' => _('Created or updated since less than 7 days'))).' ';
  			}
 -			echo ' '.$d->getFileName();
 -			echo '</td>';
 -			echo '<td>'.$d->getName().'</td>';
 -			echo '<td>'.$d->getDescription().'</td>';
 -			echo '<td>'.make_user_link($d->getCreatorUserName(), $d->getCreatorRealName()).'</td>';
 +			$cells[] = array($nextcell.$d->getFileName(), 'style' => 'word-wrap: break-word; max-width: 250px;');
 +			$cells[] = array($d->getName(), 'style' => 'word-wrap: break-word; max-width: 250px;');
 +			$cells[] = array($d->getDescription(), 'style' => 'word-wrap: break-word; max-width: 250px;');
 +			$cells[][] = make_user_link($d->getCreatorUserName(), $d->getCreatorRealName());
  			if ( $d->getUpdated() ) {
- 				$cells[][] = date(_('Y-m-d H:i'), $d->getUpdated());
 -				echo '<td sorttable_customkey="'.$d->getUpdated().'" >';
 -				echo date(_('Y-m-d H:i'), $d->getUpdated());
++				$cells[] = array(date(_('Y-m-d H:i'), $d->getUpdated()), 'sorttable_customkey' => $d->getUpdated());
  			} else {
- 				$cells[][] = date(_('Y-m-d H:i'), $d->getCreated());
 -				echo '<td sorttable_customkey="'.$d->getCreated().'" >';
 -				echo date(_('Y-m-d H:i'), $d->getCreated());
++				$cells[] = array(date(_('Y-m-d H:i'), $d->getCreated()), 'sorttable_customkey' => $d->getCreated());
  			}
 -			echo '</td>';
 -			echo '<td>';
 -			echo $d->getStateName().'</td>';
 -			echo '<td>';
 +			$cells[][] =$d->getStateName();
  			switch ($d->getFileType()) {
  				case "URL": {
 -					echo "--";
 +					$cells[][] = "--";
  					break;
  				}
  				default: {

commit d673a340b191d8e8851700343a9e8ef8e09ab98d
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Mar 26 10:00:47 2014 +0100

    more util_make_link, util_make_url

diff --git a/src/common/include/tag_cloud.php b/src/common/include/tag_cloud.php
index 8c157ae..69f286f 100644
--- a/src/common/include/tag_cloud.php
+++ b/src/common/include/tag_cloud.php
@@ -1,5 +1,5 @@
 <?php
-/*
+/**
  * Copyright (C) 2008-2009 Alcatel-Lucent
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -18,7 +18,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-/*
+/**
  * Standard Alcatel-Lucent disclaimer for contributing to open source
  *
  * "The Tag Cloud ("Contribution") has not been tested and/or
@@ -70,7 +70,7 @@ $SELECTED_STYLE = 'style="text-decoration:overline underline;"';
  *
  * @param	array	$params	selected tag, max tag displayed, number of sizes available,
  * 							class prefix for css class, style for selected tag
- * @return string
+ * @return	string
  */
 function tag_cloud($params = array()) {
 	global $NB_SIZE;
@@ -169,8 +169,8 @@ function tag_cloud($params = array()) {
  * 						Each tag is a link to display a list of projects
  * 						where the tag is defined.
  *
- * @param		int		Group ID
- * @return string
+ * @param	int	Group ID
+ * @return	string
  */
 function list_project_tag($group_id) {
 	$req = 'SELECT name FROM project_tags WHERE group_id = $1';
@@ -180,9 +180,8 @@ function list_project_tag($group_id) {
 	$idx = 1;
 	if ($nb_tag) {
 		while ($row = db_fetch_array($res)) {
-			$return .= '<a href="/softwaremap/tag_cloud.php?tag='
-					. urlencode($row['name'])
-					. '">' . htmlspecialchars($row['name']) . '</a>' . (($idx < $nb_tag) ? ', ' : '');
+			$return .= util_make_link('/softwaremap/tag_cloud.php?tag='.urlencode($row['name']), htmlspecialchars($row['name']))
+				. (($idx < $nb_tag) ? ', ' : '');
 			$idx++;
 		}
 	}
diff --git a/src/common/widget/Widget.class.php b/src/common/widget/Widget.class.php
index ce21fec..e9a4067 100644
--- a/src/common/widget/Widget.class.php
+++ b/src/common/widget/Widget.class.php
@@ -96,7 +96,7 @@ require_once 'common/widget/Widget_MyMonitoredDocuments.class.php';
 	}
 	function getPreferencesForm($layout_id, $owner_id, $owner_type) {
 		$prefs  = '';
-		$prefs .= '<form method="post" action="/widgets/widget.php?owner='. $owner_type.$owner_id .'&action=update&name['. $this->id .']='. $this->getInstanceId() .'&content_id='. $this->getInstanceId() .'&layout_id='. $layout_id .'">';
+		$prefs .= '<form method="post" action="'.util_make_uri('/widgets/widget.php?owner='. $owner_type.$owner_id .'&action=update&name['. $this->id .']='. $this->getInstanceId() .'&content_id='. $this->getInstanceId() .'&layout_id='. $layout_id).'">';
 		$prefs .= '<fieldset><legend>'. _("Preferences") .'</legend>';
 		$prefs .= $this->getPreferences();
 		$prefs .= '<br />';
diff --git a/src/common/widget/WidgetLayoutManager.class.php b/src/common/widget/WidgetLayoutManager.class.php
index cfd5530..18094b7 100644
--- a/src/common/widget/WidgetLayoutManager.class.php
+++ b/src/common/widget/WidgetLayoutManager.class.php
@@ -527,7 +527,7 @@ class WidgetLayoutManager {
 			if (count($categs)) {
 				// display the categories selector in left panel
 				foreach($categs as $c => $ws) {
-					$widget_rows[$c] = html_e('a', array('class' => 'widget-categ-switcher', 'id' => 'widget-categ-switcher-'.$c, 'href' => '#widget-categ-'.$c, 'onClick' => 'jQuery(\'.widget-categ-class-void\').hide();jQuery(\'.widget-categ-switcher\').removeClass(\'selected\');jQuery(\'#widget-categ-'. $c .'\').show();jQuery(\'#widget-categ-switcher-'. $c .'\').addClass(\'selected\')'), html_e('span', array(), str_replace('_',' ', $hp->purify($c, CODENDI_PURIFIER_CONVERT_HTML))), false);
+					$widget_rows[$c] = util_make_link('#widget-categ-'.$c, html_e('span', array(), str_replace('_',' ', $hp->purify($c, CODENDI_PURIFIER_CONVERT_HTML))), array('class' => 'widget-categ-switcher', 'id' => 'widget-categ-switcher-'.$c, 'onClick' => 'jQuery(\'.widget-categ-class-void\').hide();jQuery(\'.widget-categ-switcher\').removeClass(\'selected\');jQuery(\'#widget-categ-'. $c .'\').show();jQuery(\'#widget-categ-switcher-'. $c .'\').addClass(\'selected\')'), true);
 				}
 				uksort($widget_rows, 'strnatcasecmp');
 				echo html_ao('ul', array('id' => 'widget-categories'));
diff --git a/src/common/widget/Widget_MyBookmarks.class.php b/src/common/widget/Widget_MyBookmarks.class.php
index 116d5ba..1917577 100644
--- a/src/common/widget/Widget_MyBookmarks.class.php
+++ b/src/common/widget/Widget_MyBookmarks.class.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
+ * Copyright 2014, Franck Villaume - TrivialDev
  *
  * This file is a part of Fusionforge.
  *
@@ -49,15 +50,17 @@ class Widget_MyBookmarks extends Widget {
 			$html_my_bookmarks .= '<table class="fullwidth">';
 			for ($i=0; $i<$rows; $i++) {
 				$html_my_bookmarks .= '<tr '. $HTML->boxGetAltRowStyle($i) .'><td>';
-				$html_my_bookmarks .= '<a href="'. db_result($result,$i,'bookmark_url') .'">'. db_result($result,$i,'bookmark_title') .'</a> ';
-				$html_my_bookmarks .= '<small><a href="/my/bookmark_edit.php?bookmark_id='. db_result($result,$i,'bookmark_id') .'">['._("Edit").']</a></small></td>';
-				$html_my_bookmarks .= '<td style="text-align:right"><a href="/my/bookmark_delete.php?bookmark_id='. db_result($result,$i,'bookmark_id');
-				$html_my_bookmarks .= '" onClick="return confirm(\''._("Delete this bookmark?").'\')">';
-				$html_my_bookmarks .= '<img src="'.$HTML->imgroot.'ic/trash.png" height="16" width="16" alt="Delete" /></a></td></tr>';
+				$html_my_bookmarks .= util_make_link(db_result($result,$i,'bookmark_url'), db_result($result,$i,'bookmark_title'), array(), true);
+				$html_my_bookmarks .= '<small>'.util_make_link('/my/bookmark_edit.php?bookmark_id='.db_result($result,$i,'bookmark_id'), '['._('Edit').']').'</small></td>';
+				$html_my_bookmarks .= '<td style="text-align:right">';
+				$html_my_bookmarks .= util_make_link('/my/bookmark_delete.php?bookmark_id='.db_result($result,$i,'bookmark_id'),
+								'<img src="'.$HTML->imgroot.'ic/trash.png" height="16" width="16" alt="'._('Delete').'" />',
+								array('onClick' => 'return confirm("'._("Delete this bookmark?").'")'));
+				$html_my_bookmarks .= '</td></tr>';
 			}
 			$html_my_bookmarks .= '</table>';
 		}
-		$html_my_bookmarks .= '<div style="text-align:center; font-size:0.8em;"><a href="/my/bookmark_add.php">['. _("Add a bookmark") .']</a></div>';
+		$html_my_bookmarks .= '<div style="text-align:center; font-size:0.8em;">'.util_make_link('/my/bookmark_add.php', '['._('Add a bookmark').']').'</div>';
 		return $html_my_bookmarks;
 	}
 
diff --git a/src/common/widget/Widget_MyMonitoredDocuments.class.php b/src/common/widget/Widget_MyMonitoredDocuments.class.php
index 134e4e2..4d60b1e 100644
--- a/src/common/widget/Widget_MyMonitoredDocuments.class.php
+++ b/src/common/widget/Widget_MyMonitoredDocuments.class.php
@@ -87,7 +87,7 @@ class Widget_MyMonitoredDocuments extends Widget {
 							util_make_link('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$doc_group, stripslashes(db_result($result2,$i,'filename'))).'</td>'.
 							'<td class="align-center">'.
 							util_make_link('/docman/?group_id='.$group_id.'&action=monitorfile&option=remove&view=listfile&dirid='.$doc_group.'&fileid='.$docid,
-							'<img src="'.$HTML->imgroot.'ic/trash.png" height="16" width="16" "alt="'._("Stop Monitoring").'" />').'</td></tr>';
+							'<img src="'.$HTML->imgroot.'ic/trash.png" height="16" width="16" "alt="'._("Stop Monitoring").'" />', array('onClick' => 'return confirm("'._("Stop monitoring this document?").'")')).'</td></tr>';
 					}
 				}
 
diff --git a/src/common/widget/Widget_MyMonitoredForums.class.php b/src/common/widget/Widget_MyMonitoredForums.class.php
index f9483fb..5bcfd90 100644
--- a/src/common/widget/Widget_MyMonitoredForums.class.php
+++ b/src/common/widget/Widget_MyMonitoredForums.class.php
@@ -111,7 +111,7 @@ class Widget_MyMonitoredForums extends Widget {
 				list($hide_now,$count_diff,$hide_url) = my_hide_url('forum',$group_id,$hide_item_id,$rows2,$hide_forum);
 
 				$html_hdr = '<tr class="boxitem"><td colspan="2">'.
-				$hide_url.'<a href="/forum/?group_id='.$group_id.'">'.$group_name.'</a>    ';
+				$hide_url.util_make_link('/forum/?group_id='.$group_id, $group_name).'    ';
 
 				$html = '';
 				$count_new = max(0, $count_diff);
@@ -120,12 +120,13 @@ class Widget_MyMonitoredForums extends Widget {
 						$group_forum_id = $flist[$i]['group_forum_id'];
 						$html .= '
 					<tr '.$HTML->boxGetAltRowStyle($i) .'"><td style="width:99%">'.
-					'   - <a href="/forum/forum.php?forum_id='.$group_forum_id.'">'.
-						$flist[$i]['forum_name'].'</a></td>'.
-					'<td class="align-center"><a href="/forum/monitor.php?forum_id='.$group_forum_id.'&group_id='.$group_id.'&stop=1'.
-					'" onClick="return confirm(\''._("Stop monitoring this Forum?").'\')">'.
-					'<img src="'.$HTML->imgroot.'ic/trash.png" height="16" width="16" '.
-					'alt="'._("Stop Monitoring").'" /></a></td></tr>';
+					'   - '.
+					util_make_link('/forum/forum.php?forum_id='.$group_forum_id, $flist[$i]['forum_name']).'</td>'.
+					'<td class="align-center">'.
+					util_make_link('/forum/monitor.php?forum_id='.$group_forum_id.'&group_id='.$group_id.'&stop=1',
+							'<img src="'.$HTML->imgroot.'ic/trash.png" height="16" width="16" alt="'._("Stop Monitoring").'" />',
+							array('onClick' => 'return confirm("'._('Stop monitoring this Forum?').'")')).
+					'</td></tr>';
 					}
 				}
 
@@ -155,7 +156,7 @@ class Widget_MyMonitoredForums extends Widget {
 		$request =& HTTPRequest::instance();
 		$ajax_url = parent::getAjaxUrl($owner_id, $owner_type);
 		if ($request->exist('hide_item_id') || $request->exist('hide_forum')) {
-			$ajax_url .= '&hide_item_id=' . $request->get('hide_item_id') . '&hide_forum=' . $request->get('hide_forum');
+			$ajax_url .= '&hide_item_id='.$request->get('hide_item_id').'&hide_forum='.$request->get('hide_forum');
 		}
 		return $ajax_url;
 	}
diff --git a/src/common/widget/Widget_MyProjects.class.php b/src/common/widget/Widget_MyProjects.class.php
index fda15b9..0f27270 100644
--- a/src/common/widget/Widget_MyProjects.class.php
+++ b/src/common/widget/Widget_MyProjects.class.php
@@ -35,7 +35,7 @@ class Widget_MyProjects extends Widget {
 		$this->Widget('myprojects');
 	}
 	function getTitle() {
-		return _("My Projects");
+		return _('My Projects');
 	}
 
 	function getContent() {
@@ -82,9 +82,10 @@ class Widget_MyProjects extends Widget {
 				}
 				if (!$isadmin) {
 					$html_my_projects .= '</td>'.
-						'<td><a href="rmproject.php?group_id='. $g->getID().
-						'" onClick="return confirm(\''._("Quit this project?").'\')">'.
-						'<img src="'.$HTML->imgroot.'ic/trash.png" alt="'._('Leave project').'" height="16" width="16" /></a></td></tr>';
+						'<td>'.util_make_link('/my/rmproject.php?group_id='.$g->getID(),
+									'<img src="'.$HTML->imgroot.'ic/trash.png" alt="'._('Leave project').'" height="16" width="16" />',
+									array('onClick' => 'return confirm("'._("Quit this project?").'")')).
+						'</td></tr>';
 				} else {
 					$html_my_projects .= '</td><td> </td></tr>';
 				}
@@ -92,7 +93,7 @@ class Widget_MyProjects extends Widget {
 			$html_my_projects .= '</table>';
 			if (isset($private_shown) && $private_shown) {
 				$html_my_projects .= '
-					<span>(*) <em>'._("Private project").'</em></span>';
+					<span>(*) <em>'._('Private project').'</em></span>';
 			}
 
 		}
@@ -147,7 +148,7 @@ class Widget_MyProjects extends Widget {
 	}
 
 	function getDescription() {
-		return _("List the projects you belong to. Selecting any of these projects brings you to the corresponding Project Summary page.");
+		return _('List the projects you belong to. Selecting any of these projects brings you to the corresponding Project Summary page.');
 	}
 }
 
diff --git a/src/common/widget/Widget_ProjectInfo.class.php b/src/common/widget/Widget_ProjectInfo.class.php
index 95ebcf3..2ee4dc4 100644
--- a/src/common/widget/Widget_ProjectInfo.class.php
+++ b/src/common/widget/Widget_ProjectInfo.class.php
@@ -81,11 +81,11 @@ class Widget_ProjectInfo extends Widget {
 				$actv_res=0;
 			}
 			print '<br />'.sprintf (_('Activity Ranking: <strong>%d</strong>'), $actv_res)."\n";
-			print '<br />'.sprintf(_('View project <a href="%s">Statistics</a>'),util_make_url ('/project/stats/?group_id='.$group_id))."\n";
+			print '<br />'.sprintf(_('View project <a href="%s">Statistics</a>'),util_make_url('/project/stats/?group_id='.$group_id))."\n";
 			if ( ($project->usesTracker() && forge_get_config('use_tracker')) || ($project->usesPm() && forge_get_config('use_pm')) ) {
-				print sprintf(_(' or <a href="%s">Activity</a>'),util_make_url ('/project/report/?group_id='.$group_id))."\n";
+				print sprintf(_(' or <a href="%s">Activity</a>'),util_make_url('/project/report/?group_id='.$group_id))."\n";
 			}
-			print '<br />'.sprintf(_('View list of <a href="%s">RSS feeds</a> available for this project.'), util_make_url ('/export/rss_project.php?group_id='.$group_id)). ' ' . html_image('ic/rss.png',16,16,array());
+			print '<br />'.sprintf(_('View list of <a href="%s">RSS feeds</a> available for this project.'), util_make_url('/export/rss_project.php?group_id='.$group_id)). ' ' . html_image('ic/rss.png',16,16,array());
 		}
 
 		if(forge_get_config('use_people')) {
diff --git a/src/www/include/Layout.class.php b/src/www/include/Layout.class.php
index cbfd538..f88549c 100644
--- a/src/www/include/Layout.class.php
+++ b/src/www/include/Layout.class.php
@@ -1346,7 +1346,7 @@ if (isset($params['group']) && $params['group']) {
 			echo '<script type="text/javascript">/* <![CDATA[ */'."
 				jQuery(document).ready(function() {
 						jQuery('#$element_id-ajax').html('".$spinner."');
-						jQuery.ajax({url:'". $widget->getAjaxUrl($owner_id, $owner_type) ."',
+						jQuery.ajax({url:'". util_make_url($widget->getAjaxUrl($owner_id, $owner_type)) ."',
 							success: function(result){jQuery('#$element_id-ajax').html(result)},
 							});
 						});

commit 4020a7fbdd7702e666e316318b2105e3f53359b0
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Tue Mar 25 14:44:36 2014 +0100

    more HTML helpers: util_make_link mostly

diff --git a/src/common/include/utils_crossref.php b/src/common/include/utils_crossref.php
index adb962e..fa1af09 100644
--- a/src/common/include/utils_crossref.php
+++ b/src/common/include/utils_crossref.php
@@ -46,7 +46,7 @@ function util_gen_cross_ref ($text, $group_id) {
 }
 
 function _page2url($prj,$page) {
-	return '<a href="/wiki/g/'.$prj.'/'.rawurlencode($page).'">'.$page.'</a>';
+	return util_make_link('/wiki/g/'.$prj.'/'.rawurlencode($page), $page);
 }
 
 function _artifactid2url ($id, $mode='') {
@@ -58,15 +58,15 @@ function _artifactid2url ($id, $mode='') {
 				array ($id)) ;
 	if (db_numrows($res) == 1) {
 		$row = db_fetch_array($res);
-		$url = '/tracker/?func=detail&aid='.$id.'&group_id='.$row['group_id'].'&atid='.$row['group_artifact_id'];
-		$arg = 'title="'.util_html_secure($row['summary']).'"' ;
+		$url = '/tracker/?func=detail&aid='.$id.'&group_id='.$row['group_id'].'&atid='.$row['group_artifact_id'];
+		$arg['title'] = util_html_secure($row['summary']);
 		if ($row['status_id'] == 2) {
-			$arg .= 'class="artifact_closed"';
+			$arg['class'] = 'artifact_closed';
 		}
 		if ($mode == 'title') {
-			return '<a href="'.$url.'" '.$arg.'>'.$text.'</a> <a href="'.$url.'">'.$row['summary'].'</a><br />';
+			return util_make_link($url, $text, $arg).util_make_link($url, $row['summary']).'<br />';
 		} else {
-			return '<a href="'.$url.'" '.$arg.'>'.$text.'</a>';
+			return util_make_link($url, $text, $arg);
 		}
 	}
 	return $text;
@@ -89,17 +89,17 @@ function _taskid2url($id, $group_id) {
 				array ($id, $group_id));
 	if (db_numrows($res) == 1) {
 		$row = db_fetch_array($res);
-		$url = '/pm/task.php?func=detailtask&project_task_id='.$id.'&group_id='.$row['group_id'].'&group_project_id='.$row['group_project_id'];
-		$arg = 'title="'.$row['summary'].'"' ;
+		$url = '/pm/task.php?func=detailtask&project_task_id='.$id.'&group_id='.$row['group_id'].'&group_project_id='.$row['group_project_id'];
+		$arg['title'] = util_html_secure($row['summary']);
 		if ($row['status_id'] == 2) {
-			$arg .= 'class="task_closed"';
+			$arg['class'] = 'task_closed';
 		}
-		return '<a href="'.$url.'" '.$arg.'>'.$text.'</a>';
+		return util_make_link($url, $text, $arg);
 	}
 	return $text;
 }
 
-function _forumid2url ($id) {
+function _forumid2url($id) {
 	$text = '[forum:'.$id.']';
 	$res = db_query_params ('SELECT group_id, forum.group_forum_id, subject
 			FROM forum, forum_group_list
@@ -108,9 +108,9 @@ function _forumid2url ($id) {
 				array ($id));
 	if (db_numrows($res) == 1) {
 		$row = db_fetch_array($res);
-		$url = '/forum/message.php?msg_id='.$id.'&group_id='.$row['group_id'];
-		$arg = 'title="'.$row['subject'].'"' ;
-		return '<a href="'.$url.'" '.$arg.'>'.$text.'</a>';
+		$url = '/forum/message.php?msg_id='.$id.'&group_id='.$row['group_id'];
+		$arg['title'] = $row['subject'];
+		return util_make_link($url, $text, $arg);
 	}
 	return $text;
 }
diff --git a/src/common/widget/Widget_MyAdmin.class.php b/src/common/widget/Widget_MyAdmin.class.php
index 3785d6e..925c30f 100644
--- a/src/common/widget/Widget_MyAdmin.class.php
+++ b/src/common/widget/Widget_MyAdmin.class.php
@@ -1,7 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012, 2014 Franck Villaume - TrivialDev
  *
  * This file is a part of Fusionforge.
  *
@@ -32,7 +32,7 @@ class Widget_MyAdmin extends Widget {
 		$this->Widget('myadmin');
 	}
 	function getTitle() {
-		return _("Pending administrative tasks");
+		return _('Pending administrative tasks');
 	}
 	function getContent() {
 		$i = 0;
@@ -87,7 +87,7 @@ class Widget_MyAdmin extends Widget {
 
 			$html_my_admin .= $this->_get_admin_row(
 				$i++,
-				'<a href="/news/admin">'. _("Site News Approval") .'</a>',
+				util_make_link('/news/admin', _('Site News Approval')),
 				$pending_news,
 				$this->_get_color($pending_news)
 			);
diff --git a/src/common/widget/Widget_MyMonitoredDocuments.class.php b/src/common/widget/Widget_MyMonitoredDocuments.class.php
index 454ae59..134e4e2 100644
--- a/src/common/widget/Widget_MyMonitoredDocuments.class.php
+++ b/src/common/widget/Widget_MyMonitoredDocuments.class.php
@@ -83,11 +83,11 @@ class Widget_MyMonitoredDocuments extends Widget {
 						$docid = db_result($result2,$i,'docid');
 						$html .= '
 							<tr '. $HTML->boxGetAltRowStyle($i) .'><td style="width:99%">'.
-							'   - <a href="/docman/?group_id='.$group_id.'&view=listfile&dirid='.$doc_group.'">'.
-							stripslashes(db_result($result2,$i,'filename')).'</a></td>'.
-							'<td class="align-center"><a href="/docman/?group_id='.$group_id.'&action=monitorfile&option=remove&view=listfile&dirid='.$doc_group.'&fileid='.$docid.'">'.
-							'<img src="'.$HTML->imgroot.'ic/trash.png" height="16" width="16" '.
-							'alt="'._("Stop Monitoring").'" /></a></td></tr>';
+							'   - '.
+							util_make_link('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$doc_group, stripslashes(db_result($result2,$i,'filename'))).'</td>'.
+							'<td class="align-center">'.
+							util_make_link('/docman/?group_id='.$group_id.'&action=monitorfile&option=remove&view=listfile&dirid='.$doc_group.'&fileid='.$docid,
+							'<img src="'.$HTML->imgroot.'ic/trash.png" height="16" width="16" "alt="'._("Stop Monitoring").'" />').'</td></tr>';
 					}
 				}
 
diff --git a/src/common/widget/Widget_MyProjects.class.php b/src/common/widget/Widget_MyProjects.class.php
index de2906e..fda15b9 100644
--- a/src/common/widget/Widget_MyProjects.class.php
+++ b/src/common/widget/Widget_MyProjects.class.php
@@ -58,8 +58,7 @@ class Widget_MyProjects extends Widget {
 				$i++;
 				$html_my_projects .= '
 				<tr '. $HTML->boxGetAltRowStyle($i) .'><td style="width:99%">'.
-					'<a href="/projects/'. $g->getUnixName() .'/">'.
-					$g->getPublicName().'</a>';
+					util_make_link('/projects/'.$g->getUnixName(), $g->getPublicName());
 
 				$isadmin = false;
 				$role_names = array();
@@ -74,7 +73,7 @@ class Widget_MyProjects extends Widget {
 					}
 				}
 				if ($isadmin) {
-					$html_my_projects .= ' <small>'.util_make_link('/project/admin/?group_id='.$g->getID(), '['._("Admin").']').'</small>';
+					$html_my_projects .= ' <small>'.util_make_link('/project/admin/?group_id='.$g->getID(), '['._('Admin').']').'</small>';
 				}
 				$html_my_projects .= ' <small>('.htmlspecialchars (implode (', ', $role_names)).')</small>';
 				if (!$ra->hasPermission('project_read', $g->getID())) {
@@ -85,7 +84,7 @@ class Widget_MyProjects extends Widget {
 					$html_my_projects .= '</td>'.
 						'<td><a href="rmproject.php?group_id='. $g->getID().
 						'" onClick="return confirm(\''._("Quit this project?").'\')">'.
-						'<img src="'.$GLOBALS['HTML']->imgroot.'ic/trash.png" alt="'._('Leave project').'" height="16" width="16" /></a></td></tr>';
+						'<img src="'.$HTML->imgroot.'ic/trash.png" alt="'._('Leave project').'" height="16" width="16" /></a></td></tr>';
 				} else {
 					$html_my_projects .= '</td><td> </td></tr>';
 				}
diff --git a/src/common/widget/Widget_MyProjectsLastDocuments.class.php b/src/common/widget/Widget_MyProjectsLastDocuments.class.php
index 5eb69a6..f79e363 100644
--- a/src/common/widget/Widget_MyProjectsLastDocuments.class.php
+++ b/src/common/widget/Widget_MyProjectsLastDocuments.class.php
@@ -2,7 +2,7 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  * Copyright 2010, Franck Villaume - Capgemini
- * Copyright 2011-2013, Franck Villaume - TrivialDev
+ * Copyright 2011-2014, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is a part of FusionForge.
@@ -77,8 +77,8 @@ class Widget_MyProjectsLastDocuments extends Widget {
 
 					list($hide_now,$count_diff,$hide_url) = my_hide_url('dmproj', $g->getID(), $hide_item_id, count($df->Documents), $hide_docmanproject);
 					$html_hdr = ($i ? '<tr class="boxitem"><td colspan="4">' : '').
-						$hide_url.'<a href="/docman/?group_id='.$g->getID().'">'.
-						$g->getPublicName().'</a>    </td></tr>';
+						$hide_url.util_make_link('/docman/?group_id='.$g->getID(), $g->getPublicName()).
+						'    </td></tr>';
 
 					$html = '';
 					if (!$hide_now) {
@@ -98,14 +98,14 @@ class Widget_MyProjectsLastDocuments extends Widget {
 								$html .= '<tr '. $HTML->boxGetAltRowStyle($j) .'>';
 								switch ($doc->getFileType()) {
 									case "URL": {
-										$docurl = $doc->getFileName();
+										$docurl = util_make_link($doc->getFileName(), html_image($doc->getFileTypeImage(), '22', '22', array('alt'=>$doc->getFileType())), array(), true);
 										break;
 									}
 									default: {
-										$docurl = util_make_url('/docman/view.php/'.$g->getID().'/'.$doc->getID().'/'.urlencode($doc->getFileName()));
+										$docurl = util_make_link('/docman/view.php/'.$g->getID().'/'.$doc->getID().'/'.urlencode($doc->getFileName()), html_image($doc->getFileTypeImage(), '22', '22', array('alt'=>$doc->getFileType())));
 									}
 								}
-								$html .= '<td><a href="'.$docurl.'">'.html_image($doc->getFileTypeImage(), '22', '22', array('alt'=>$doc->getFileType())).'</a></td>';
+								$html .= '<td>'.$docurl.'</td>';
 								$html .= '<td>'.$doc->getFilename().'</td>';
 								$html .= '<td>'.make_user_link($doc->getCreatorUserName(), $doc->getCreatorRealName()).'</td>';
 								if ( $doc->getUpdated() ) {
diff --git a/src/common/widget/Widget_MySurveys.class.php b/src/common/widget/Widget_MySurveys.class.php
index e4b0ca2..c127a20 100644
--- a/src/common/widget/Widget_MySurveys.class.php
+++ b/src/common/widget/Widget_MySurveys.class.php
@@ -1,7 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
- * Copyright 2013, Franck Villaume - TrivialDev
+ * Copyright 2013-2014, Franck Villaume - TrivialDev
  *
  * This file is a part of Fusionforge.
  *
@@ -111,8 +111,7 @@ class Widget_MySurveys extends Widget {
 				list($hide_now,$count_diff,$hide_url) = my_hide_url('survey',$group_id,$hide_item_id,count($surveys),$hide_survey);
 
 				$html_hdr = '<tr class="boxitem"><td colspan="2">'.
-					$hide_url.'<a href="/survey/?group_id='.$group_id.'">'.
-					$project->getPublicName().'</a>    ';
+					$hide_url.util_make_link('/survey/?group_id='.$group_id, $project->getPublicName()).'    ';
 
 				$html = '';
 				$count_new = max(0, $count_diff);
@@ -124,8 +123,9 @@ class Widget_MySurveys extends Widget {
 						$survey_title = $survey->getTitle();
 						$html .= '
 							<tr '. $HTML->boxGetAltRowStyle($i) .'><td style="width:99%">'.
-							'   - <a href="/survey/survey.php?group_id='.$group_id.'&survey_id='.$group_survey_id.'">'.
-							$survey_title.'</a></td></tr>';
+							'   - '.
+							util_make_link('/survey/survey.php?group_id='.$group_id.'&survey_id='.$group_survey_id, $survey_title).
+							'</td></tr>';
 					}
 				}
 
diff --git a/src/common/widget/Widget_ProjectLatestDocuments.class.php b/src/common/widget/Widget_ProjectLatestDocuments.class.php
index 3c22c70..2f86784 100644
--- a/src/common/widget/Widget_ProjectLatestDocuments.class.php
+++ b/src/common/widget/Widget_ProjectLatestDocuments.class.php
@@ -93,11 +93,11 @@ class Widget_ProjectLatestDocuments extends Widget {
 				$path = $ndg->getPath(true, true);
 				switch ($filetype) {
 					case "URL": {
-						$docurl = $filename;
+						$docurl = util_make_link($filename, $filename, array(), true);
 						break;
 					}
 					default: {
-						$docurl = util_make_url('/docman/view.php/'.$group_id.'/'.$docid.'/'.urlencode($filename));
+						$docurl = util_make_link('/docman/view.php/'.$group_id.'/'.$docid.'/'.urlencode($filename), '<strong>'.$filename.'</strong>');
 					}
 				}
 				echo '
@@ -105,8 +105,8 @@ class Widget_ProjectLatestDocuments extends Widget {
 						<td>'
 							. date(_('Y-m-d'),$realdate) .
 						'</td>
-						<td>
-							<a href="'.$docurl.'" ><strong>' . $filename . '</strong></a>
+						<td>'
+							.$docurl.'
 						</td>
 						<td>'
 							.$title.'
@@ -127,7 +127,7 @@ class Widget_ProjectLatestDocuments extends Widget {
 			}
 			echo $HTML->listTableBottom();
 		}
-		echo '<div class="underline-link">' . util_make_link('/docman/?group_id='.$group_id, _('Browse Documents Manager')) . '</div>';
+		echo '<div class="underline-link">'.util_make_link('/docman/?group_id='.$group_id, _('Browse Documents Manager')) . '</div>';
 	}
 
 	function isAvailable() {
diff --git a/src/www/include/html.php b/src/www/include/html.php
index c8e8bb4..e08126b 100644
--- a/src/www/include/html.php
+++ b/src/www/include/html.php
@@ -98,7 +98,7 @@ function make_user_link($username, $displayname = '') {
 	if (!strcasecmp($username, 'Nobody') || !strcasecmp($username, 'None')) {
 		return $username;
 	} else {
-		return '<a href="/users/'.$username.'">'.$displayname.'</a>';
+		return util_make_link('/users/'.$username, $displayname);
 	}
 }
 
@@ -120,7 +120,7 @@ function html_feedback_bottom($feedback) {
  * @return	string
  */
 function html_blankimage($height, $width) {
-	return html_abs_image("/images/blank.png", $width, $height);
+	return html_abs_image('/images/blank.png', $width, $height);
 }
 
 /**

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

Summary of changes:
 src/common/docman/views/listfile.php               |    4 +--
 src/common/docman/views/listtrashfile.php          |    4 +--
 src/common/docman/views/pendingfiles.php           |    4 +--
 src/common/include/PluginManager.class.php         |    5 ++-
 src/common/include/tag_cloud.php                   |   15 ++++-----
 src/common/include/utils_crossref.php              |   28 ++++++++--------
 src/common/widget/Widget.class.php                 |    2 +-
 src/common/widget/WidgetLayoutManager.class.php    |    2 +-
 src/common/widget/Widget_MyAdmin.class.php         |    6 ++--
 src/common/widget/Widget_MyBookmarks.class.php     |   15 +++++----
 .../widget/Widget_MyMonitoredDocuments.class.php   |   10 +++---
 .../widget/Widget_MyMonitoredForums.class.php      |   17 +++++-----
 src/common/widget/Widget_MyProjects.class.php      |   18 +++++------
 .../Widget_MyProjectsLastDocuments.class.php       |   12 +++----
 src/common/widget/Widget_MySurveys.class.php       |   10 +++---
 src/common/widget/Widget_ProjectInfo.class.php     |    6 ++--
 .../widget/Widget_ProjectLatestDocuments.class.php |   10 +++---
 .../20140325-drop-scmcvs-from-default-groups.sql   |    2 +-
 src/plugins/scmgit/common/GitPlugin.class.php      |    6 ++--
 src/www/include/Layout.class.php                   |    2 +-
 src/www/include/html.php                           |    4 +--
 src/www/terms.php                                  |   11 +++++--
 tests/DEBDebian70TestsSRC.php                      |    4 +--
 tests/TarCentosTests.php                           |    2 +-
 tests/func/PluginsScmGit/gitTest.php               |   34 ++++++++++++++++++++
 25 files changed, 139 insertions(+), 94 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list