From: Christian Bayle Date: Sun, 9 Mar 2008 23:15:39 +0000 (+0000) Subject: Migrate to util_make_url() and util_make_link() X-Git-Tag: v4_7_b2~146 X-Git-Url: https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge%2Ffusionforge.git;a=commitdiff_plain;h=da1ceb2bdc2ccf141df587e877154973172db381 Migrate to util_make_url() and util_make_link() --- diff --git a/gforge/ChangeLog b/gforge/ChangeLog index 70aa94a137..26c318e0fe 100644 --- a/gforge/ChangeLog +++ b/gforge/ChangeLog @@ -1,12 +1,13 @@ -2008-03-09 Christian Bayle +2008-03-10 Christian Bayle - * plugins/*: Migrate to util_make_url() and util_make_link() - * snippet/*: Ditto - * include/*: Ditto - * admin/*: Ditto - * my/*: Ditto - * tracker/*: Ditto - * search/*: Ditto + * Removed as much php warning as possible + * Migrate to util_make_url() and util_make_link() + * - www/export/*,www/developer/*,www/themes/* + * - www/frs/*,www/activity/*,www/project/* + * - www/news/*,www/pm/*,www/people/*,www/docman/* + * - plugins/* + * - www/snippet/*,www/include/*,www/admin/* + * - www/my/*,www/tracker/*,www/search/* * introduced $sys_noforcetype to make possible to get rid of /projects and /users forcetype diff --git a/gforge/www/activity/index.php b/gforge/www/activity/index.php index 785c0c3e3b..192d24ed77 100644 --- a/gforge/www/activity/index.php +++ b/gforge/www/activity/index.php @@ -138,39 +138,44 @@ if ($rows<1) { switch ($arr['section']) { case 'commit': { $icon=html_image("ic/cvs16b.png","20","20",array("border"=>"0","alt"=>"SCM")); - $url='Commit for Tracker Item [#'.$arr['subref_id'].'] '.$arr['description'].' '; + $url=util_make_link ('/tracker/?func=detail&atid='.$arr['ref_id'].'&aid='.$arr['subref_id'].'&group_id='.$arr['group_id'],_('Commit for Tracker Item').' [#'.$arr['subref_id'].'] '.$arr['description']); break; } case 'trackeropen': { $icon=html_image("ic/tracker20g.png",'20','20',array('alt'=>'Tracker')); - $url='Tracker Item [#'.$arr['subref_id'].' '.$arr['description'].' ] Opened'; + $url=util_make_link ('/tracker/?func=detail&atid='.$arr['ref_id'].'&aid='.$arr['subref_id'].'&group_id='.$arr['group_id'],_('Tracker Item').' [#'.$arr['subref_id'].' '.$arr['description'].' ] '._('Opened')); break; } case 'trackerclose': { $icon=html_image("ic/tracker20g.png",'20','20',array('alt'=>'Tracker')); - $url='Tracker Item [#'.$arr['subref_id'].' '.$arr['description'].' ] Closed'; + $url=util_make_link ('/tracker/?func=detail&atid='.$arr['ref_id'].'&aid='.$arr['subref_id'].'&group_id='.$arr['group_id'],_('Tracker Item').' [#'.$arr['subref_id'].' '.$arr['description'].' ] '._('Closed')); break; } case 'frsrelease': { $icon=html_image("ic/cvs16b.png","20","20",array("border"=>"0","alt"=>"SCM")); - $url='FRS Release '.$arr['description'].''; + $url=util_make_link ('/frs/?release_id='.$arr['subref_id'].'&group_id='.$arr['group_id'],_('FRS Release').' '.$arr['description']); break; } case 'forumpost': { $icon=html_image("ic/forum20g.png","20","20",array("border"=>"0","alt"=>"Forum")); - $url='Forum Post '.$arr['description'].''; + $url=util_make_link ('/forum/message.php?msg_id='.$arr['subref_id'].'&group_id='.$arr['group_id'],_('Forum Post ').' '.$arr['description']); break; } case 'news': { $icon=html_image("ic/write16w.png","20","20",array("border"=>"0","alt"=>"News")); - $url='News '.$arr['description'].''; + $url=util_make_link ('/forum/forum.php?forum_id='.$arr['subref_id'],_('News').' '.$arr['description']); break; } } + if (isset ($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) { + $userlink='/developer/?user_id='.$arr['user_id']; + } else { + $userlink='/users/'.$arr['user_name'].'/'; + } echo 'boxGetAltRowStyle($j++) . '>     '.date('H:i:s',$arr['activity_date']).' '.$icon .' '.$url.' - '.$arr['realname'].' + '.util_make_link ($userlink,$arr['realname']).' '; } diff --git a/gforge/www/developer/index.php b/gforge/www/developer/index.php index 4b309698e9..81d7c2ea5d 100644 --- a/gforge/www/developer/index.php +++ b/gforge/www/developer/index.php @@ -39,6 +39,18 @@ if (!$user_id) { $user_id=$form_dev; } -header("Location: ".$GLOBALS['sys_urlprefix']."/users/". user_getname($user_id) ."/"); +if (isset ($sys_noforcetype) && $sys_noforcetype) { + if (!$user_id) { + exit_error("Missing User Argument","A user must be specified for this page."); + } else { + $user =& user_get_object($user_id); + if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) { + exit_error(_('That user does not exist.'),_('Invalid User')); + } + include('user_home.php'); + } +} else { + header("Location: ".util_make_url ('/users/'.user_getname($user_id).'/')); +} ?> diff --git a/gforge/www/docman/index.php b/gforge/www/docman/index.php index 122823693a..202e01cb4d 100644 --- a/gforge/www/docman/index.php +++ b/gforge/www/docman/index.php @@ -127,14 +127,14 @@ function docman_recursive_display($docgroup) { } ?> - - + +