[evolvis-commits] r17653: branch 5.1 trunk into messer-51-suche

mirabilos at evolvis.org mirabilos at evolvis.org
Fri Oct 28 18:13:21 CEST 2011


Author: mirabilos
Date: 2011-10-28 18:13:21 +0200 (Fri, 28 Oct 2011)
New Revision: 17653

Added:
   branches/messer-51-suche/
   branches/messer-51-suche/src/www/themes/evolvis/Theme.class.php
   branches/messer-51-suche/src/www/tracker/browse.php
Removed:
   branches/messer-51-suche/src/common/advanced_search/
   branches/messer-51-suche/src/www/scripts/jquery-tipsy/
   branches/messer-51-suche/src/www/scripts/jquery/
   branches/messer-51-suche/src/www/themes/css/smoothness/
   branches/messer-51-suche/src/www/themes/evolvis/Theme.class.php
   branches/messer-51-suche/src/www/tracker/browse.php
   branches/messer-51-suche/src/www/tracker/search.php
Log:
branch 5.1 trunk into messer-51-suche


Copied: branches/messer-51-suche/src/www/themes/evolvis/Theme.class.php (from rev 17651, trunk/gforge_base/evolvisforge-5.1/src/www/themes/evolvis/Theme.class.php)
===================================================================
--- branches/messer-51-suche/src/www/themes/evolvis/Theme.class.php	                        (rev 0)
+++ branches/messer-51-suche/src/www/themes/evolvis/Theme.class.php	2011-10-28 16:13:21 UTC (rev 17653)
@@ -0,0 +1,625 @@
+<?php
+/*-
+ * Evolvis theme for tarent solutions GmbH
+ * heavily modified version of the Mac OS X like theme.
+ *
+ * Copyright (c) 2009, 2010, 2011
+ *	Thorsten Glaser <t.glaser at tarent.de>
+ * Copyright (c) 2007 Thorsten Glaser <t.glaser at aurisp.de>
+ *	on behalf of tarent GmbH
+ * Copyright (c) 2007 Waldemar Brodkorb <w.brodkorb at tarent.de>
+ *
+ * Copyright (c) 2002-2003 Richard Offer. All rights reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation.
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the author shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from the author.
+ *
+ * Based on the "debian" theme, which is apparantly
+ * Copyright 1999-2001 (c) VA Linux Systems
+ */
+
+class Theme extends Layout {
+
+	/**
+	 * Theme() - Constructor
+	 */
+	function Theme() {
+		// Parent constructor
+		$this->Layout();
+
+		// The root location for images
+		$this->imgroot = '/themes/evolvis/images/';
+
+		//XXX same as in evolvis.css
+		$this->COLOR_HTMLBOX_BACK = '#FFFFFF';
+
+		$this->addStylesheet('/themes/css/evolvis.css', 'all');
+		// $this->addStylesheet('/themes/css/screen.css', 'screen');
+		$this->addStylesheet('/themes/css/print.css', 'print');
+		$this->addJavascript('/js/common.js');
+		$this->addJavascript('/js/css.js');
+		$this->project = false;
+		$this->emit_forgebar = true;
+		$this->collapsible_counter = 0;
+		$this->collapsible_ids = array();
+	}
+
+	function header($params) {
+		$this->emit_html_head = true;
+		return $this->internal_header($params);
+	}
+
+	function bodyHeader($params) {
+		$this->emit_html_head = false;
+		return $this->internal_header($params);
+	}
+
+	function disableForgebar() {
+		$this->emit_forgebar = false;
+	}
+
+	function emit_headlink($inblock,$tooltip,$redtext,$target,$text) {
+		$tooltip = util_html_secure(util_ifsetor($tooltip,""));
+		if ($tooltip && $tooltip[0] == '-') {
+			$tooltip = "";
+		}
+
+		if ($inblock || $tooltip) {
+			$rv = '<span';
+			if ($inblock) {
+				$rv .= ' class="headblock"';
+			}
+			if ($tooltip) {
+				$rv .= ' title="' . $tooltip . '"';
+			}
+			$rv .= ">";
+			$rq = "</span>";
+		} else {
+			$rv = "";
+			$rq = "";
+		}
+		$rv .= '<span class="headlinks">//</span>' .
+		    '<a class="headlink" href="' . $target . '">' .
+		    '<span class="headlink' .
+		    ($redtext ? "s" : "") . '">' .
+		    util_html_secure($text) . "</span></a>" . $rq;
+		return $rv;
+	}
+
+	function internal_header($params) {
+		global $_SERVER, $group_id, $sysDTDs, $sysXMLNSs;
+
+		$has_group = false;
+		if (array_key_exists('group', $params)) {
+			$this->project = group_get_object($params['group']);
+			if (isset($this->project) && is_object($this->project) &&
+			    !$this->project->isError() && $this->project->isProject()) {
+				$group_id = $this->project->getID();
+				$has_group = true;
+			}
+		}
+
+		$params['title'] = isset($params['title']) && $params['title'] ?
+		    forge_get_config('forge_name') . ': ' . $params['title'] :
+		    forge_get_config('forge_name');
+
+		if ($this->emit_html_head) {
+			echo '<' .
+			    '?xml version="1.0" encoding="utf-8" ?' . ">\n";
+			echo $sysDTDs['transitional']['doctype'];
+?>
+<html <?php echo $sysXMLNSs; ?> xml:lang="en" lang="<?php echo _('en'); ?>">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title><?php echo util_html_secure($params['title']); ?></title>
+<?php
+			$this->headerCSS();
+			$this->headerJS();
+			$this->headerForgepluckerMeta();
+			if (strpos(util_ifsetor($_SERVER['HTTP_USER_AGENT'],
+			    ""), "Gecko")) {
+				/*
+				 * Work around a bug in Mozilla™ related
+				 * browsers which display a selected option
+				 * as black-on-white always, no matter the
+				 * style, when leaving the select’s focus.
+				 */
+?>
+<style type="text/css">
+	option { background-color:black; color:white; }
+</style><!-- https://bugzilla.mozilla.org/show_bug.cgi?id=554620 --><?php
+			}
+			echo "\n</head><body>\n";
+		}
+		if ($this->emit_forgebar) {
+			$pagetop = 'page_top';
+			if (eregi("(msie) ([0-9]{1,2}.[0-9]{1,3})",
+			    util_ifsetor($_SERVER['HTTP_USER_AGENT'], ""), $regs)) {
+				$pagetop .= '_ie';
+			}
+?><div id="ev_forgebar">
+<div id="red_headbar"></div>
+<div id="<?php echo $pagetop; ?>" class="hidePartForPrinting">
+	<div id="logo">
+		<div style="height:48px; padding-top:3px;">
+			<span style="overflow:hidden;"><a href="/"><img
+			 src="/themes/evolvis/images/logo_internal_repo.png"
+			 name="logo" border="0" style="height:44px;"
+			 alt="evolvis" /></a></span>
+			<div class="forgeglobalmenu">
+			<table style="white-space:nowrap;"><tr>
+<?php	if (session_loggedin()) {
+		echo "\t\t\t<td style=\"padding-left:1em;\">" .
+		    $this->emit_headlink(false,
+		    _('Log out of the session with the Forge system'),
+		    false, "/account/logout.php?return_to=" .
+		    urlencode(getStringFromServer('REQUEST_URI')),
+		    _('Log Out')) . "</td>\n";
+		echo "\t\t\t<td style=\"padding-left:1em;\">" .
+		    $this->emit_headlink(false,
+		    _('Configure Account settings, Password & SSH keys'),
+		    false, "/account/",
+		    _('My Account')) . "</td>\n";
+		echo "\t\t\t<td style=\"padding-left:1em;\">" .
+		    $this->emit_headlink(false,
+		    _('Manage projects, assigned tasks, bugs, etc.'),
+		    false, "/my/",
+		    _('My Page')) . "</td>\n";
+		echo "\t\t\t</tr><tr>\n\t\t\t" .
+		    "<td colspan=\"3\" style=\"padding-left:1em;\">\n";
+	} else {
+		echo "\t\t\t<td style=\"padding-left:1em;\">" .
+		    $this->emit_headlink(false,
+		    _('Log into a new session with the Forge system'),
+		    false, "/account/login.php?return_to=" .
+		    urlencode(getStringFromServer('REQUEST_URI')),
+		    _('Log In')) . "</td>\n";
+		echo "\t\t\t<td style=\"padding-left:1em;\">" .
+		    $this->emit_headlink(false,
+		    _('Register a user account with the Forge system'),
+		    false, "/account/register.php",
+		    _('New Account')) . "</td>\n";
+		echo "\t\t\t</tr><tr>\n\t\t\t" .
+		    "<td colspan=\"2\" style=\"padding-left:1em;\">\n";
+	}
+	echo "\t\t\t\t" . '<form action="' . util_make_url('/pm/t_follow.php') . '"
+				 method="get">' . _('Jump to Task:') . '
+					<input type="text" size="8" name="tid" />
+					<input type="submit" name="j" value="' . _('OK') . '" />
+				</form>
+			</td></tr></table></div>
+		</div><div class="forgeoutertabs">' .
+		    $this->outerTabs($params, 0) . "</div>\n";
+		if ($has_group) {
+			echo '<div class="forgeprojecttabs">' .
+			    $this->projectTabs(util_ifsetor($params['toptab']),
+			    $group_id) . '</div>';
+		}
+?>
+	</div>
+	<div id="backimg"></div>
+	<br clear="all" />
+</div><!-- page top -->
+</div><!-- ev_forgebar -->
+<div id="ev_content" class="content"><?php
+		} else {
+			echo '<div id="ev_content" class="contentnoforgebar">';
+		}
+
+		echo "\n".'<div class="forgegrouptitle"><div id="project_name">';
+		if ($has_group) {
+			echo "Project: " . $this->project->getPublicName();
+		} else {
+			echo "Forge: " . forge_get_config('forge_name');
+		}
+		echo '</div><div class="forgesearchbox">' .
+		    $this->navigation->getSearchBox();
+		echo "</div></div>\n\n";
+
+		$this->handleSubmenu($params);
+
+		echo "<!-- ]internal_header -->\n";
+	}
+
+	function footer($params) {
+		global $group_id;
+
+		echo "\n<!-- footer[ -->\n";
+?><div id="fffooter" class="hidePartForPrinting">
+<span id="imprint"><a href="/impress/">Impressum / imprint</a></span>
+<span id="powerd_by">powered by <a
+ href="https://evolvis.org/">Evolvis</a> by <a
+ href="https://www.tarent.de/">tarent solutions GmbH</a>, based on <a
+ href="https://fusionforge.org/">FusionForge</a></span>
+</div>
+
+<script language="javascript" type="text/javascript" src="/js/awstats_misc_tracker.js"></script>
+<noscript><img src="/js/awstats_misc_tracker.js?nojs=y" height="0" width="0" border="0" style="display:none" alt="stats" /></noscript>
+<div id="red_bottombar"></div>
+</div><!-- content -->
+<?php
+		foreach ($this->footer_hooks as $h) {
+			call_user_func($h, $params);
+		}
+		if ($this->collapsible_counter > 0) {
+?>
+<div id="evcollapsibleicon0min" style="display:none;"><?php
+			echo $this->getPicto($this->_getToggleMinusForWidgets(),
+			    _('Toggle'), 'Toggle', '16', '16');
+ ?></div>
+<div id="evcollapsibleicon0max" style="display:none;"><?php
+			echo $this->getPicto($this->_getTogglePlusForWidgets(),
+			    _('Toggle'), 'Toggle', '16', '16');
+ ?></div>
+<script language="JavaScript" type="text/javascript">//<![CDATA[
+	/* get real (generated) URIs of the pictographs */
+	var i = document.getElementById("evcollapsibleicon0max").getElementsByTagName("img")[0];
+	var icon_maximise = i.getAttributeNode("src").nodeValue;
+	var i = document.getElementById("evcollapsibleicon0min").getElementsByTagName("img")[0];
+	var icon_minimise = i.getAttributeNode("src").nodeValue;
+	/* initialise all collapsibles with them */
+	var evcollapsibleids = [];
+<?php
+	foreach ($this->collapsible_ids as $nr => $cid) {
+		echo "\tevcollapsibleids[" . $nr . "] = '" . $cid . "';\n";
+	}
+?>
+	for (var i = 1; i <= <?php echo $this->collapsible_counter; ?>; ++i) {
+		evcollapse('evcollapsibleicon' + i,
+		    'evcollapsibleelem' + i, 1, evcollapsibleids[i]);
+	}
+//]]></script>
+<?php
+		}
+?>
+</body>
+</html>
+<?php
+	}
+
+	/* internal */
+	function boxTopCollapsible($title, $id, $hidep, $cookie_id) {
+		$nr = ++$this->collapsible_counter;
+		$iid = "evcollapsibleicon" . $nr;
+		$eid = "evcollapsibleelem" . $nr;
+		if ($cookie_id) {
+			$this->collapsible_ids[$nr] = $cookie_id;
+		}
+		$h = $hidep ? ' hidePartForPrinting' : '';
+
+		return '<tr class="boxtitlebar' . $h . '"' .
+		    ($id ? ' id="' . $this->toSlug($id) . '-title"' : "") . '>
+			<td class="ff" align="left"' .
+		    ($id ? ' id="' . $this->toSlug($id) . '-title-content"' : "") . '>
+				' . $title . '
+				<div class="widget_titlebar_minimize hidePartForPrinting"
+				 style="display:none;"
+				 onclick="evcollapse(' . "'" . $iid .
+				    "', '" . $eid . "', 0, '" . $cookie_id .
+				    "'" . ');"
+				 id="' . $iid . '">' .
+				    $this->getPicto($this->_getToggleMinusForWidgets(),
+				    _('Toggle'), 'Toggle', '16', '16') . '
+				</div>
+			</td>
+		</tr><tr class="boxcontent' . $h . '" id="' . $eid . '" align="left">
+			<td' .
+		    ($id ? ' id="' . $this->toSlug($id) . '-content"' : "") .
+		    '>';
+	}
+
+	/**
+	 * boxTop() - Top HTML box
+	 *
+	 * @param	string	Box title
+	 * @param	string	ID attribute (optional)
+	 * @param	bool	hide from printing? (optional)
+	 * @param	string	Collapsible Cookie ID (optional)
+	 */
+	function boxTop($title, $id="", $hidep=false, $ccid="") {
+		return '<!-- boxTop[ -->
+		<table' . ($id ? ' id="' . $this->toSlug($id) . '"' : "") .
+		    ' width="100%" border="0" class="ff" cellspacing="0">
+		' . $this->boxTopCollapsible($title, $id, $hidep, $ccid) .
+		    '<!-- ]boxTop -->';
+	}
+
+	/**
+	 * boxMiddle() - Middle HTML box
+	 *
+	 * @param	string	Box title
+	 * @param	string	ID attribute (optional)
+	 * @param	bool	hide from printing? (optional)
+	 * @param	string	Collapsible Cookie ID (optional)
+	 */
+	function boxMiddle($title, $id="", $hidep=false, $ccid="") {
+		return '<!-- boxMiddle[ -->
+			</td>
+		</tr><tr bgcolor="'. $this->COLOR_HTMLBOX_BACK .'"
+		 class="hidePartForPrinting"><td height="1"></td>
+		</tr>' . $this->boxTopCollapsible($title, $id, $hidep, $ccid) .
+		    '<!-- ]boxMiddle -->';
+	}
+
+	/**
+	 * boxGetAltRowStyle() - Get an alternating row style for tables
+	 *
+	 * @param	int	Row number
+	 */
+	function boxGetAltRowStyle($i) {
+		switch ($i % 3 ) {
+		case 0:
+			return 'bgcolor="#F4F4F4"';
+		case 1:
+			return 'bgcolor="#EAEAEA"';
+		case 2:
+			return 'bgcolor="#E0E0E0"';
+		}
+	}
+
+	/**
+	 * boxBottom() - Bottom HTML box
+	 */
+	function boxBottom() {
+		return '<!-- boxBottom[ -->
+			</td>
+		</tr><tr bgcolor="'. $this->COLOR_HTMLBOX_BACK .'"
+		 class="hidePartForPrinting"><td height="1"></td>
+		</tr></table><!-- ]boxBottom -->'."\n";
+	}
+
+	/**
+	 * listTableTop() - Takes an array of titles and builds the first row of a new table.
+	 *
+	 * @param	array	The array of titles
+	 * @param	array	The array of title links
+	 * @param	int	(ignored?!)
+	 * @param	bool	Show a table border (default: false)
+	 */
+	function listTableTop($title_arr,$links_arr=false,$cnt=0,$useborder=false) {
+		$rv = '
+		<!-- listTableTop[ -->
+		<table cellspacing="0" cellpadding="1" width="100%" ' .
+		($useborder ? $useborder : 'border="0"') . '>
+		<tr class="ff"><td class="ff">
+		<table width="100%" border="0" cellspacing="2" cellpadding="0">
+		<thead>
+		<tr class="ff">';
+
+		$count = count($title_arr);
+		if (!$count) {
+			$rv .= '<td style="color:red;">No $title_arr:' .
+			    "<pre>\n" . htmlentities(debug_string_backtrace()) .
+			    "</pre></td>\n";
+		} else if ($links_arr) {
+			for ($i=0; $i<$count; $i++) {
+				$rv .= '
+		<td class="ff" align="left"><a class="titlebar" href="'.$links_arr[$i].'">'.$title_arr[$i].'</a></td>';
+			}
+		} else {
+			for ($i=0; $i<$count; $i++) {
+				$rv .= '
+		<td align="left" class="list_table_top">'.$title_arr[$i].'</td>';
+			}
+		}
+		$rv .= '
+		</tr>
+		</thead><tfoot>
+		<tr class="ff" align="left" bgcolor="'. $this->COLOR_HTMLBOX_BACK .'">
+		<td class="ff" colspan="'.$count.'" height="1"><img src="'.$this->imgroot.'clear.png" height="1" width="1" alt="" /></td>
+		</tr>
+		</tfoot><tbody><!-- ]listTableTop -->'."\n";
+		return $rv;
+	}
+
+	/**
+	 * listTableTopSortable() - Takes an array of titles and builds the first row of a new table and table is sortable.
+	 *
+	 * @param	array	The array of titles
+	 * @param	array	The array of title links
+	 */
+	function listTableTopSortable($title_arr,$links_arr=false) {
+		$rv= '
+		<!-- listTableTopSortable[ -->
+		<table cellspacing="0" cellpadding="1" width="100%" border="0">
+		<tr class="ff"><td class="ff">
+		<table class="sortable" width="100%" border="0" cellspacing="2" cellpadding="0">
+		<thead>
+		<tr class="ff">';
+
+		$count = count($title_arr);
+		if ($links_arr) {
+			for ($i=0; $i<$count; $i++) {
+				$rv.= '
+				<th class="ff" align="left"><a class="titlebar" href="'.$links_arr[$i].'">'.$title_arr[$i].'</a></th>';
+			}
+		} else {
+			for ($i=0; $i<$count; $i++) {
+				$rv.= '
+				<th align="left" class="list_table_top">'.$title_arr[$i].'</th>';
+			}
+		}
+		$rv.= '
+		</tr>
+		</thead>
+		<tfoot><tr class="ff" align="left" bgcolor="'. $this->COLOR_HTMLBOX_BACK .'">
+		<td class="ff" colspan="'.$count.'" height="1"><img src="'.$this->imgroot.'clear.png" height="1" width="1" alt="" /></td>
+		</tr></tfoot>
+		<tbody><!-- ]listTableTopSortable -->'."\n";
+		return $rv;
+	}
+
+	function listTableBottom() {
+		return "<!-- listTableBottom[ --></tbody></table></td></tr></table><!-- ]listTableBottom -->\n";
+	}
+
+
+	function tabGenerator($TABS_DIRS,$TABS_TITLES,$nested=false,$selected=false,$sel_tab_bgcolor='BLACK',$total_width='100%',$TAB_TYPE,$TABS_TOOLTIPS=array()) {
+		$rv = "";
+		for ($i = 0; $i < count($TABS_DIRS); $i++) {
+			$rv .= "\n" . $this->emit_headlink(true,
+			    util_ifsetor($TABS_TOOLTIPS[$i], ""),
+			    ($selected == $i), $TABS_DIRS[$i], $TABS_TITLES[$i]);
+		}
+		return $rv;
+	}
+
+	function outerTabs($params,$write=1) {
+		$menu = $this->navigation->getSiteMenu();
+
+		if (!isset($this->COLOR_SELECTED_TAB)) {
+			$this->COLOR_SELECTED_TAB= '#e0e0e0';
+		}
+
+		$rv = $this->tabGenerator($menu['urls'], $menu['titles'], false,
+		    $menu['selected'], $this->COLOR_SELECTED_TAB, '100%',
+		    "outerTab", util_ifsetor($menu['tooltips'], array()));
+		if (!$write) {
+			return $rv;
+		} else {
+			echo $rv;
+			return "<div>bogus call <pre>{".debug_string_backtrace()."}</pre> & ERROR</div>\n";
+		}
+	}
+
+	/**
+	 *	projectTabs() - Prints out the project tabs, contained here in case
+	 *		we want to allow it to be overriden
+	 *
+	 *	@param	string	Is the tab currently selected
+	 *	@param	string	Is the group we should look up get title info
+	 */
+	function projectTabs($toptab,$group) {
+		$menu = $this->navigation->getProjectMenu($group, $toptab);
+
+		return $this->tabGenerator($menu['urls'], $menu['titles'], true,
+		    $menu['selected'], 'white', '100%', 'projectTab',
+		    util_ifsetor($menu['tooltips'], array()));
+	}
+
+	/**
+	 * multiTableRow() - create a mutlilevel row in a table
+	 *
+	 * @param	string	the row attributes
+	 * @param	array	the array of cell data, each element is an array,
+	 *			the first item being the text,
+	 *			the subsequent items are attributes
+	 * @param	boolean is this row part of the title ?
+	 *
+	 */
+	function multiTableRow($row_attr, $cell_data, $istitle) {
+		$rv = '
+		<!-- multiTableRow -->
+		<tr class="multi_table_row" '.$row_attr;
+		if ( $istitle ) {
+			$rv .=' align="center" ';
+		}
+		$rv .= '>';
+		for ($c = 0; $c < count($cell_data); $c++) {
+			$rv .='<td class="ff" ';
+			for ($a=1; $a < count($cell_data[$c]); $a++) {
+				$rv .= $cell_data[$c][$a].' ';
+			}
+			$rv .= '>';
+			if ($istitle) {
+				$rv .='<span class="titlebar">';
+			}
+			$rv .= $cell_data[$c][0];
+			if ($istitle) {
+				$rv .='</span>';
+			}
+			$rv .= '</td>';
+
+		}
+		$rv .= '</tr>
+		<!-- end multiTableRow -->
+		';
+
+		return $rv;
+	}
+
+	/**
+	 * feedback() - returns the htmlized feedback string when an action is performed.
+	 *
+	 * @param string feedback string
+	 * @return string htmlized feedback
+	 */
+	function feedback($feedback) {
+		if (!$feedback) {
+			return '';
+		} else {
+			return '
+			<h3 style="color:red">'.strip_tags($feedback, '<br>').'</h3>';
+		}
+	}
+
+	/**
+	 * beginSubMenu() - Opening a submenu.
+	 *
+	 * @return	string	HTML to start a submenu
+	 */
+	function beginSubMenu() {
+		return '
+<div class="forgesubmenu">';
+	}
+
+	/**
+	 * endSubMenu() - Closing a submenu.
+	 *
+	 * @return	string	HTML to start a submenu
+	 */
+	function endSubMenu() {
+		return "\n<!-- ]forgesubmenu --></div>\n";
+	}
+
+	/**
+	 * printSubMenu() - Takes two array of titles and links and builds the contents of a menu.
+	 *
+	 * @param	array	The array of titles
+	 * @param	array	The array of title links
+	 * @param	array	The array of tooltips (optional)
+	 * @return	string	HTML to build a submenu
+	 */
+	function printSubMenu($title_arr,$links_arr,$tooltip_arr=array()) {
+		$rv = "";
+
+		for ($i = 0; $i < count($links_arr); ++$i) {
+			if ($i) {
+				/*
+				 * insert spaces between the items
+				 * so that they can wrap around
+				 */
+				$rv .= "\n";
+			}
+			$rv .= $this->emit_headlink(true,
+			    util_ifsetor($tooltip_arr[$i], ""),
+			    false, $links_arr[$i],
+			    util_ifsetor($title_arr[$i], "Link ".$i));
+		}
+		return $rv;
+	}
+}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: branches/messer-51-suche/src/www/tracker/browse.php (from rev 17652, trunk/gforge_base/evolvisforge-5.1/src/www/tracker/browse.php)
===================================================================
--- branches/messer-51-suche/src/www/tracker/browse.php	                        (rev 0)
+++ branches/messer-51-suche/src/www/tracker/browse.php	2011-10-28 16:13:21 UTC (rev 17653)
@@ -0,0 +1,745 @@
+<?php
+/**
+ * FusionForge Tracker
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2010 Roland Mas
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once $gfcommon.'tracker/ArtifactFactory.class.php';
+require_once $gfcommon.'tracker/ArtifactQuery.class.php';
+//
+//  make sure this person has permission to view artifacts
+//
+session_require_perm ('tracker', $ath->getID(), 'read') ;
+
+$query_id = getIntFromRequest('query_id');
+$start = getIntFromRequest('start');
+$paging = 0;
+
+//
+//	The browse page can be powered by a pre-saved query
+//	or by select boxes chosen by the user
+//
+//	If there is a $query_id coming from the request OR the pref
+//	was already saved, use the artifact factory that way.
+//
+//	If the query_id = -1, unset the pref and use regular browse boxes
+//
+if (session_loggedin()) {
+	$u =& session_get_user();
+	if (getStringFromRequest('setpaging')) {
+		/* store paging preferences */
+		$paging = getIntFromRequest('nres');
+		if (!$paging) {
+			$paging = 25;
+		}
+		$u->setPreference("paging", $paging);
+	}
+	
+	if($query_id) {
+		if ($query_id == '-1') {
+			$u->setPreference('art_query'.$ath->getID(),'');
+		} else {
+			$aq = new ArtifactQuery($ath,$query_id);
+			if (!$aq || !is_object($aq)) {
+				exit_error($aq->getErrorMessage(),'tracker');
+			}
+			$aq->makeDefault();
+		}
+	} else {
+		$query_id=$u->getPreference('art_query'.$ath->getID(),'');
+	}
+} elseif ($query_id) {
+	// If user is not logged, then use a cookie to store the current query.
+	if (isset($_COOKIE["GFTrackerQuery"])) {
+		$gf_tracker = unserialize($_COOKIE["GFTrackerQuery"]);
+	} else {
+		$gf_tracker = array();
+	}
+	$gf_tracker[$ath->getID()] = $query_id;
+	// Send the query_id as a cookie to save it.
+	setcookie("GFTrackerQuery", serialize($gf_tracker));
+	$_COOKIE["GFTrackerQuery"] = serialize($gf_tracker);
+} elseif (isset($_COOKIE["GFTrackerQuery"])) {
+	$gf_tracker = unserialize($_COOKIE["GFTrackerQuery"]);
+	$query_id = (int)$gf_tracker[$ath->getID()];
+}
+
+$af = new ArtifactFactory($ath);
+
+if (!$af || !is_object($af)) {
+	exit_error(_('Could Not Get Factory'),'tracker');
+} elseif ($af->isError()) {
+	exit_error($af->getErrorMessage(),'tracker');
+}
+
+if (!isset($_sort_col)) {
+	/* default sort order: highest priority first */
+	$_sort_col = 'priority';
+	$_sort_ord = 'DESC';
+}
+$offset = getStringFromRequest('offset');
+$_sort_col = getStringFromRequest('_sort_col',$_sort_col);
+$_sort_ord = getStringFromRequest('_sort_ord',$_sort_ord);
+$max_rows = getIntFromRequest('max_rows', 25);
+$set = getStringFromRequest('set');
+$_assigned_to = getIntFromRequest('_assigned_to');
+$_status = getIntFromRequest('_status');
+$_extra_fields = array() ;
+$aux_extra_fields = array() ;
+
+if ($set == 'custom') {
+	/* may be past in next/prev url */
+	$i = $ath->getCustomStatusField();
+	$tmp_extra_fields = getArrayFromRequest('extra_fields');
+	if (isset($tmp_extra_fields[$i])) {
+		$_extra_fields[$i] = $tmp_extra_fields[$i];
+	}
+}
+
+if (is_array($_extra_fields)){
+	$keys=array_keys($_extra_fields);
+	foreach ($keys as $key) {
+		if ($_extra_fields[$key] != 'Array') {
+			$aux_extra_fields[$key] = $_extra_fields[$key];
+		}
+	}
+} else {
+	if (isset($_extra_fields)){
+		$aux_extra_fields = $_extra_fields;
+	} else {
+		$aux_extra_fields = '';
+	}
+}
+
+$af->setup($offset,$_sort_col,$_sort_ord,$paging,$set,$_assigned_to,$_status,$aux_extra_fields);
+//
+//	These vals are sanitized and/or retrieved from ArtifactFactory stored settings
+//
+$_sort_col=$af->order_col;
+$_sort_ord=$af->sort;
+$_status=$af->status;
+$_assigned_to=$af->assigned_to;
+$_extra_fields=$af->extra_fields;
+
+$art_arr = $af->getArtifacts();
+
+if (!$art_arr && $af->isError()) {
+	exit_error($af->getErrorMessage(),'tracker');
+}
+
+//build page title to make bookmarking easier
+//if a user was selected, add the user_name to the title
+//same for status
+use_javascript('/tabber/tabber.js');
+
+$ath->header(array('atid'=>$ath->getID(), 'title'=>$ath->getName()));
+
+/**
+ *
+ *	Build the powerful browsing options pop-up boxes
+ *
+ */
+
+//
+//	creating a custom technician box which includes "any" and "unassigned"
+//
+$engine = RBACEngine::getInstance () ;
+$techs = $engine->getUsersByAllowedAction ('tracker', $ath->getID(), 'tech') ;
+
+$tech_id_arr = array () ;
+$tech_name_arr = array () ;
+
+foreach ($techs as $tech) {
+	$tech_id_arr[] = $tech->getID() ;
+	$tech_name_arr[] = $tech->getRealName() ;
+}
+$tech_id_arr[]='0';  //this will be the 'any' row
+$tech_name_arr[]=_('Any');
+
+if (is_array($_assigned_to)) {
+	$_assigned_to='';
+}
+$tech_box=html_build_select_box_from_arrays ($tech_id_arr,$tech_name_arr,'_assigned_to',$_assigned_to,true,_('Unassigned'));
+
+
+//
+//	custom order by arrays to build a pop-up box
+//
+$order_name_arr=array();
+$order_name_arr[]=_('ID');
+$order_name_arr[]=_('Priority');
+$order_name_arr[]=_('Summary');
+$order_name_arr[]=_('Open Date');
+$order_name_arr[]=_('Close Date');
+$order_name_arr[]=_('Submitter');
+$order_name_arr[]=_('Assignee');
+
+
+$order_arr=array();
+$order_arr[]='artifact_id';
+$order_arr[]='priority';
+$order_arr[]='summary';
+$order_arr[]='open_date';
+$order_arr[]='close_date';
+$order_arr[]='submitted_by';
+$order_arr[]='assigned_to';
+
+//
+//	custom sort arrays to build pop-up box
+//
+$sort_name_arr=array();
+$sort_name_arr[]=_('Ascending');
+$sort_name_arr[]=_('Descending');
+
+$sort_arr=array();
+$sort_arr[]='ASC';
+$sort_arr[]='DESC';
+
+//
+//	custom changed arrays to build pop-up box
+//
+$changed_name_arr=array();
+$changed_name_arr[]=_('Any changes');
+$changed_name_arr[]=_('Last 24H');
+$changed_name_arr[]=_('Last 7days');
+$changed_name_arr[]=_('Last 2weeks');
+$changed_name_arr[]=_('Last 1month');
+
+$changed_arr=array();
+$changed_arr[]= 0x7fffffff;	 // Any
+$changed_arr[]= 3600 * 24;	 // 24 hour
+$changed_arr[]= 3600 * 24 * 7; // 1 week
+$changed_arr[]= 3600 * 24 * 14;// 2 week
+$changed_arr[]= 3600 * 24 * 30;// 1 month
+
+if ($art_arr && ($art_cnt = count($art_arr)) > 0) {
+	$focus = getIntFromRequest('focus');
+} else {
+	$art_cnt = 0;
+	$start = 0;
+	$focus = 0;
+}
+$paging = 0;
+if (session_loggedin()) {
+	/* logged in users get configurable paging */
+	$paging = $u->getPreference("paging");
+	echo '<form action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID().'&start='.
+		$start.'" method="post">'."\n";
+}
+if (!$paging) {
+	$paging = 25;
+}
+if ($art_cnt) {
+	if ($focus) {
+		for ($i = 0; $i < $art_cnt; ++$i)
+			if ($art_arr[$i]->getID() == $focus) {
+				$start = $i;
+				break;
+			}
+	}
+	$max = ($art_cnt > ($start + $paging)) ? ($start + $paging) : $art_cnt;
+} else {
+	$max = 0;
+}
+
+printf('<p>' . _('Displaying results %1$d‒%2$d out of %3$d total.'),
+       $start + 1, $max, $art_cnt);
+if (session_loggedin()) {
+	printf(' ' . _('Displaying %2$s results.') . "\n\t<input " .
+	       'type="submit" name="setpaging" value="%1$s" class="hidePartForPrinting" />' .
+	       "\n</p>\n</form>\n", _('Change'),
+	       html_build_select_box_from_array(array(
+							'10', '25', '50', '100', '1000'), 'nres', $paging, 1));
+} else {
+	echo "</p>\n";
+}
+
+/**
+ *
+ *	Show the free-form text submitted by the project admin
+ */
+echo $ath->renderBrowseInstructions();
+
+//
+//	statuses can be custom in GForge 4.5+
+//
+if ($ath->usesCustomStatuses()) {
+	$aux_extra_fields = array();
+	if (is_array($_extra_fields)){
+		$keys=array_keys($_extra_fields);
+		foreach ($keys as $key) {
+			if (!is_array($_extra_fields[$key])) {
+				$aux_extra_fields[$key] = $_extra_fields[$key];
+			}
+		}
+	} else {
+		$aux_extra_fields = $_extra_fields;
+	}
+	$status_box=$ath->renderSelect ($ath->getCustomStatusField(),$aux_extra_fields[$ath->getCustomStatusField()],false,'',true,_('Any'));
+	/*XXX what a fuckup, this… */
+	$status_box_name = 'extra_fields['.$ath->getCustomStatusField().']';
+} else {
+	if (is_array($_status)) {
+		$_status='';
+	}
+	$status_box = $ath->statusBox('_status',$_status,true,_('Any'));
+	$status_box_name = '_status';
+}
+
+// start of RDFa
+$proj_name = $group->getUnixName();
+$proj_url = util_make_url_g($group->getUnixName(),$group_id);
+// the tracker's URIs are constructed in order to support addition of an OSLC-CM REST server
+// inside /tracker/cm/. There each tracker has a URL in the form .../project/PROJ_NAME/atid/ATID
+$tracker_stdzd_uri = util_make_url('/tracker/cm/project/'. $proj_name .'/atid/'. $ath->getID());
+print '<div about="'. $tracker_stdzd_uri
+	.'" typeof="sioc:Container">'."\n";
+print '<span rel="http://www.w3.org/2002/07/owl#sameAs" resource="" />'."\n";
+print '<span rev="doap:bug-database sioc:space_of" resource="'. $proj_url .'" />'."\n";
+print "</div>\n"; // end of about
+
+echo '
+<div id="tabber" class="tabber">
+	<div class="tabbertab" title="'._('Advanced queries').'">';
+
+if (session_loggedin()) {
+	$res = db_query_params ('SELECT artifact_query_id,query_name, CASE WHEN query_type>0 THEN 1 ELSE 0 END as type
+	FROM artifact_query
+	WHERE group_artifact_id=$1 AND (user_id=$2 OR query_type>0)
+	ORDER BY type ASC, query_name ASC',
+				array ($ath->getID(),
+				       user_getid()));
+} else {
+	$res = db_query_params ('SELECT artifact_query_id,query_name, CASE WHEN query_type>0 THEN 1 ELSE 0 END as type
+	FROM artifact_query
+	WHERE group_artifact_id=$1 AND query_type>0
+	ORDER BY type ASC, query_name ASC',
+				array ($ath->getID()));
+}
+
+
+if (db_numrows($res)>0) {
+	echo '<form action="'. getStringFromServer('PHP_SELF') .'" method="get">';
+	echo '<input type="hidden" name="group_id" value="'.$group_id.'" />';
+	echo '<input type="hidden" name="atid" value="'.$ath->getID().'" />';
+	echo '<input type="hidden" name="power_query" value="1" />';
+	echo '	<table width="100%" cellspacing="0">
+	<tr>
+	<td>
+	';
+	$optgroup['key'] = 'type';
+	$optgroup['values'][0] = 'Private queries';
+	$optgroup['values'][1] = 'Project queries';
+	echo '<span style="font-size:smaller">';
+	echo '<select name="query_id">';
+	echo '<option value="100">Select One</option>';
+	$current = '';
+	$selected = $af->getDefaultQuery();
+	while ($row = db_fetch_array($res)) {
+		if ($current != $row['type']) {
+			if ($current !== '') 
+				echo '</optgroup>';
+			$label = $row['type'] ? 'Project' : 'Private';
+			echo '<optgroup label="'.$label.'">';
+			$current = $row['type'];
+		}
+		echo '<option value="'.$row['artifact_query_id'].'"';
+		if ($row['artifact_query_id'] == $selected)
+			echo ' selected="selected"';
+		echo '>'. $row['query_name'] .'</option>'."\n";
+	}
+	if ($current !== '') 
+		echo '</optgroup>';
+	echo '</select>';
+	echo '</span>
+	<input type="submit" name="run" value="'._('Power Query').'" />
+	  <a href="/tracker/?atid='. $ath->getID().'&group_id='.$group_id.'&func=query">'.
+	_('Build Query').'</a>
+	</td></tr></table>
+	</form>';
+} else {
+	echo '<strong>
+	<a href="/tracker/?atid='. $ath->getID().'&group_id='.$group_id.'&func=query">'._('Build Query').'</a></strong>';
+}
+echo '
+	</div>
+	<div class="tabbertab'.($af->query_type == 'custom' ? ' tabbertabdefault' : '').'" title="'._('Simple Filtering and Sorting').'">
+	<form name="headerForm" action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID().'" method="post">
+	<input type="hidden" name="query_id" value="-1" />
+	<input type="hidden" name="set" value="custom" />
+	<table width="100%" cellspacing="0">
+	<tr>
+	<td>
+	'._('Assignee').': '. $tech_box .'
+	</td>
+	<td align="center">
+	'._('State').': '. $status_box .'
+	</td>
+	<td align="right">';
+
+// Compute the list of fields which can be sorted.
+// Currently, only text & integer are taken (for simplicity only).
+	$efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_TEXT,
+					    ARTIFACT_EXTRAFIELDTYPE_TEXTAREA,
+					    ARTIFACT_EXTRAFIELDTYPE_INTEGER,
+					    ARTIFACT_EXTRAFIELDTYPE_SELECT,
+					    ARTIFACT_EXTRAFIELDTYPE_RADIO,
+					    ARTIFACT_EXTRAFIELDTYPE_STATUS));
+$keys=array_keys($efarr);
+for ($k=0; $k<count($keys); $k++) {
+	$i=$keys[$k];
+	$order_name_arr[] = $efarr[$i]['field_name'];
+	$order_arr[] = $efarr[$i]['extra_field_id'];
+}
+
+echo _('Order by').
+	html_build_select_box_from_arrays($order_arr,$order_name_arr,'_sort_col',$_sort_col,false) .
+	html_build_select_box_from_arrays($sort_arr,$sort_name_arr,'_sort_ord',$_sort_ord,false) .
+	'<input type="submit" name="submit" value="'._('Quick Browse').'" />';
+
+echo '
+	</td>
+	</tr>
+	</table>
+	</form>
+
+	<script type="text/javascript">//<![CDATA[
+
+	function submitForm() {
+		document.headerForm.submit.click();
+	}
+
+	document.headerForm._assigned_to.onchange = submitForm;
+	document.headerForm.elements["'.$status_box_name.'"].onchange = submitForm;
+	document.headerForm._sort_col.onchange = submitForm;
+	document.headerForm._sort_ord.onchange = submitForm;
+
+	//]]></script>
+
+	</div>';
+if ($af->query_type == 'default') {
+	echo '<div class="tabbertab tabbertabdefault" title="'._('Default').'">';
+	echo '<strong>'._('Viewing only opened records by default, use \'Advanced queries\' or \'Simple Filtering and Sorting\' to change.').'</strong>';
+	echo '</div>';
+}
+echo '
+</div>';
+
+if ($art_cnt > 0) {
+
+	if ($query_id) {
+		$aq = new ArtifactQuery($ath,$query_id);
+		$has_bargraph = (in_array('bargraph', $aq->getQueryOptions()));
+	} else {
+		$has_bargraph = false;
+	}
+	
+	if ($has_bargraph) {
+		// Display the roadmap block based on the values of the Status field.
+		$colors = array('#a71d16', '#ffa0a0', '#f5f5b5', '#bae0ba', '#16a716');
+		$count = array();
+		$percent = array();
+		foreach($art_arr as $art) {
+			if ($ath->usesCustomStatuses()) {
+				$custom_id = $ath->getCustomStatusField();
+				$extra_data = $art->getExtraFieldDataText();
+				$count[ $extra_data[$custom_id]['value'] ]++;
+			} else {
+				$count[ $art->getStatusName()]++;
+			}
+		}
+		foreach($count as $n => $c) {
+			$percent[$n] = round(100*$c/count($art_arr));
+		}
+		
+		$i=0;
+		$efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_STATUS));
+		$keys=array_keys($efarr);
+		$field_id = $keys[0];
+		$states = $ath->getExtraFieldElements($field_id);
+		$graph = '';
+		$legend = '';
+		if (is_array($states)) {
+			foreach($states as $state) {
+				$name = $state['element_name'];
+				if ($count[$name]) {
+					$graph  .= '<td style="background: '.$colors[$i].'; width: '.$percent[$name].'%;"> </td>';
+					$legend .= '<td style="white-space: nowrap; width: '.$percent[$name].'%;">'."<i>$name: $count[$name] ($percent[$name]%)</i></td>";
+				}
+				$i++;
+			}
+		}
+	
+		if ($graph) {
+		?>
+		<table class="progress">
+      	<tbody>
+      		<tr><?php echo $graph; ?></tr>
+      	</tbody>
+      	</table>
+      	<table class="progress_legend">
+      		<tr><?php echo $legend ?></tr>
+      	</table>
+	<?php
+		}
+	}
+	
+	if ($set=='custom') {
+		$set .= '&_assigned_to='.$_assigned_to.'&_status='.$_status.'&_sort_col='.$_sort_col.'&_sort_ord='.$_sort_ord;
+		if (array_key_exists($ath->getCustomStatusField(),$_extra_fields)) {
+			$set .= '&extra_fields['.$ath->getCustomStatusField().']='.$_extra_fields[$ath->getCustomStatusField()];
+		}
+	}
+
+
+	$IS_ADMIN = forge_check_perm ('tracker', $ath->getID(), 'manager') ;
+
+	if ($IS_ADMIN) {
+		echo '
+		<form name="artifactList" action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID().'" method="post">
+		<input type="hidden" name="form_key" value="'.form_generate_key().'" />
+		<input type="hidden" name="func" value="massupdate" />';
+	}
+
+	$browse_fields = explode(',', "id,".$ath->getBrowseList());
+	$title_arr=array();
+	foreach ($browse_fields as $f) {
+		$title=$f;
+		if (intval($f) > 0) {
+			$title = $ath->getExtraFieldName($f);
+		} else {
+			if ($f == 'id')
+				$title=_('ID');
+			if ($f == 'summary')
+				$title=_('Summary');
+			if ($f == 'details')
+				$title=_('Description');
+			if ($f == 'open_date')
+				$title=_('Open Date');
+			if ($f == 'close_date')
+				$title=_('Close Date');
+			if ($f == 'status_id')
+				$title=_('State');
+			if ($f == 'priority')
+				$title=_('Priority');
+			if ($f == 'assigned_to')
+				$title=_('Assigned to');
+			if ($f == 'submitted_by')
+				$title=_('Submitted by');
+			if ($f == 'related_tasks')
+				$title=_('Related tasks');
+		}
+		$title_arr[] = $title;
+	}
+
+	if ($start < $max) {
+		echo $GLOBALS['HTML']->listTableTop ($title_arr);
+	}
+
+	$then=(time()-$ath->getDuePeriod());
+
+	for ($i=$start; $i<$max; $i++) {
+ 		$extra_data = $art_arr[$i]->getExtraFieldDataText();
+		echo '
+		<tr '. $HTML->boxGetAltRowStyle($i) . '>';
+ 		foreach ($browse_fields as $f) {
+			if ($f == 'id') {
+				echo '<td style="white-space: nowrap;">'.
+				($IS_ADMIN?'<input type="checkbox" name="artifact_id_list[]" value="'.
+				$art_arr[$i]->getID() .'" /> ':'').
+				'<a href="'.getStringFromServer('PHP_SELF').'?func=detail&aid='.
+				$art_arr[$i]->getID() .
+				'&group_id='. $group_id .'&atid='.
+				$ath->getID().'">'.$art_arr[$i]->getID() .
+				'</a></td>';
+			} else if ($f == 'summary') {
+		 		echo '<td><a href="'.getStringFromServer('PHP_SELF').'?func=detail&aid='.
+				$art_arr[$i]->getID() .
+				'&group_id='. $group_id .'&atid='.
+				$ath->getID().'">'.
+				$art_arr[$i]->getSummary().
+				'</a></td>';
+			} else if ($f == 'open_date') {
+				echo '<td>'. (($set != 'closed' && $art_arr[$i]->getOpenDate() < $then)?'* ':'  ') .
+				date(_('Y-m-d H:i'),$art_arr[$i]->getOpenDate()) .'</td>';
+			} else if ($f == 'status_id') {
+				echo '<td>'. $art_arr[$i]->getStatusName() .'</td>';
+			} else if ($f == 'priority') {
+				echo '<td class="priority'.$art_arr[$i]->getPriority()  .'">'. $art_arr[$i]->getPriority() .'</td>';
+			} else if ($f == 'assigned_to') {
+				echo '<td>'. $art_arr[$i]->getAssignedRealName() .'</td>';
+			} else if ($f == 'submitted_by') {
+				echo '<td>'. $art_arr[$i]->getSubmittedRealName() .'</td>';
+			} else if ($f == 'close_date') {
+				echo '<td>'. ($art_arr[$i]->getCloseDate() ? 
+				date(_('Y-m-d H:i'),$art_arr[$i]->getCloseDate()) :'  ') .'</td>';
+			} else if ($f == 'details') {
+				echo '<td>'. $art_arr[$i]->getDetails() .'</td>';
+			} else if ($f == 'related_tasks') {
+				echo '<td>';
+				$tasks_res = $art_arr[$i]->getRelatedTasks();
+				$s ='';
+				while ($rest = db_fetch_array($tasks_res)) {
+					$link = '/pm/task.php?func=detailtask&project_task_id='.$rest['project_task_id'].
+						'&group_id='.$group_id.'&group_project_id='.$rest['group_project_id'];
+					$title = '[T'.$rest['project_task_id'].']';
+					if ($rest['status_id'] == 2) {
+						$title = '<strike>'.$title.'</strike>';
+					}
+					print $s.'<a href="'.$link.'" title="'.util_html_secure($rest['summary']).'">'.$title.'</a>';
+					$s = ' ';
+				}
+				echo '</td>';
+			} else if (intval($f) > 0) {
+				// Now display extra-fields (fields are numbers).
+				$value = $extra_data[$f]['value'];
+				if ($extra_data[$f]['type'] == 9) {
+					$value = preg_replace('/\b(\d+)\b/e', "_artifactid2url('\\1')", $value);
+				} else if ($extra_data[$f]['type'] == 7) {
+					if ($art_arr[$i]->getStatusID() == 2) {
+						$value = '<strike>'.$value.'</strike>';
+					}
+					
+				}
+				echo '<td>' . $value .'</td>';
+			} else {
+				// Display ? for unknown values.
+				echo '<td>?</td>';
+			}
+ 		}
+		echo '</tr>';
+	}
+
+	if ($start < $max) {
+		echo $GLOBALS['HTML']->listTableBottom();
+	}
+	$pages = $art_cnt / $paging;
+	$currentpage = intval($start / $paging);
+
+	if ($pages >= 1) {
+		$skipped_pages=false;
+		for ($j=0; $j<$pages; $j++) {
+			if ($pages > 20) {
+				if ((($j > 4) && ($j < ($currentpage-5))) || (($j > ($currentpage+5)) && ($j < ($pages-5)))) {
+					if (!$skipped_pages) {
+						$skipped_pages=true;
+						echo ".... ";
+					}
+					continue;
+				} else {
+					$skipped_pages=false;
+				}
+			}
+			if ($j * $paging == $start) {
+				echo '<strong>'.($j+1).'</strong>  ';
+			} else {
+				echo '<a href="'.getStringFromServer('PHP_SELF')."?func=browse&group_id=".$group_id.'&atid='.$ath->getID().'&set='. $set.'&start='.($j*$paging).'"><strong>'.($j+1).'</strong></a>  ';
+			}
+		}
+	}
+
+	/*
+		Mass Update Code
+	*/
+	if ($IS_ADMIN) {
+		echo '<script language="JavaScript" type="text/javascript">/* <![CDATA[ */
+	function checkAll(val) {
+		al=document.artifactList;
+		len = al.elements.length;
+		var i=0;
+		for( i=0 ; i<len ; i++) {
+			if (al.elements[i].name==\'artifact_id_list[]\') {
+				al.elements[i].checked=val;
+			}
+		}
+	}
+	/* ]]> */</script>
+
+			<table width="100%" border="0" id="admin_mass_update">
+			<tr><td colspan="2">
+
+<a href="javascript:checkAll(1)">'._('Check  all').'</a>
+-
+  <a href="javascript:checkAll(0)">'._('Clear  all').'</a>
+
+<div class="important">'._('<strong>Admin:</strong> If you wish to apply changes to all items selected above, use these controls to change their properties and click once on "Mass Update".').'</div>
+			</td></tr>';
+
+		//
+		//	build custom fields
+		//
+	$ef = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELD_FILTER_INT));
+	$keys=array_keys($ef);
+
+	$sel=array();
+	for ($i=0; $i<count($keys); $i++) {
+		if (($ef[$keys[$i]]['field_type']==ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) || ($ef[$keys[$i]]['field_type']==ARTIFACT_EXTRAFIELDTYPE_MULTISELECT)) {
+			$sel[$keys[$i]]=array('100');
+		} else {
+			$sel[$keys[$i]]='100';
+		}
+	}
+	$ath->renderExtraFields($sel,true,_('No Change'),false,'',array(ARTIFACT_EXTRAFIELD_FILTER_INT),true);
+		echo   '<tr>
+			<td><strong>'._('Priority').':</strong><br />';
+		echo build_priority_select_box ('priority', '100', true);
+		echo '</td><td>';
+
+		echo '</td>
+			</tr>
+
+			<tr>
+			<td><strong>'._('Assigned to').':</strong><br />'. 
+				$ath->technicianBox ('assigned_to','100.1',true,_('Nobody'),'100.1',_('No Change')) .'</td>
+			<td>';
+		if (!$ath->usesCustomStatuses()) {
+		echo '<strong>'._('State').':</strong>
+				<br />'. $ath->statusBox ('status_id','xzxz',true,_('No Change'));
+		}
+		echo '</td>
+			</tr>
+
+			<tr><td colspan="2"><strong>'._('Canned Response').':</strong><br />'.
+				$ath->cannedResponseBox ('canned_response') .'</td></tr>
+
+			<tr><td colspan="3" align="center"><input type="submit" name="submit" value="'._('Mass update').'" /></td></tr>
+			</table>
+		</form>';
+	}
+
+	printf(_('* Denotes requests > %1$s Days Old'), ($ath->getDuePeriod()/86400));
+
+	if (in_array('priority', $browse_fields)) {
+		show_priority_colors_key();
+	}
+} else {
+	echo '<p class="warning_msg">'._('No items found').'</p>';
+	echo db_error();
+}
+
+$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>



More information about the evolvis-commits mailing list