[evolvis-commits] r17714: theme-tracker pending merges:↵ Thorsten Glaser 2011-11-09 [merge] [#2030] tracker-merge-mod-limited pending merges:↵ Thorsten Glaser 2011-11-04 properly exit; after ending this file↵ Thorsten Glaser 2011-11-04 use fixed column width, to avoid content jumping around↵ Thorsten Glaser 2011-11-04 remove the now no longer needed files↵ Thorsten Glaser 2011-11-04 also merge add.php into item.php↵ Thorsten Glaser 2011-11-04 fix obvious typo↵ Thorsten Glaser 2011-11-04 switch tracker/{mod,mod-limited,detail} → tracker/item↵ Thorsten Glaser 2011-11-04 another case of “fix the XHTML”↵ Thorsten Glaser 2011-11-04 cosmetic fix; make submit button always stay in the upper-right 80% c...↵ Thorsten Glaser 2011-11-04 fix PHP and XHTML errors↵ Thorsten Glaser 2011-11-04 make html_build_priority_select_box _really_ return, not echo, the bo...↵ Thorsten Glaser 2011-11-04 in all but one case, build_priority_select_box was being abused↵ Thorsten Glaser 2011-11-04 add debugging function for Forge developers↵ Thorsten Glaser 2011-11-04 fix use of getselfhref (is passed an array)↵ Thorsten Glaser 2011-11-04 now merge detail.php and improve↵ Thorsten Glaser 2011-11-04 deduplicate↵ Thorsten Glaser 2011-11-04 merge mod and mod-limited into item↵ Thorsten Glaser 2011-11-04 add stub new file item.php; add access levels, logic from tracker.php↵ Thorsten Glaser 2011-11-04 [merge] tarent-5.1 pending merges:↵ Thorsten Glaser 2011-11-04 eek, this is theme-tracker of course↵ Thorsten Glaser 2011-11-04 [merge] tracker-merge-mod-limited pending merges:↵ Thorsten Glaser 2011-11-04 add a file detailing this branch's purpose
mirabilos at evolvis.org
mirabilos at evolvis.org
Wed Nov 9 10:58:23 CET 2011
Author: mirabilos
Date: 2011-11-09 10:58:23 +0100 (Wed, 09 Nov 2011)
New Revision: 17714
Added:
trunk/gforge_base/evolvisforge-5.1/src/www/tracker/item.php
Removed:
trunk/gforge_base/evolvisforge-5.1/src/www/tracker/add.php
trunk/gforge_base/evolvisforge-5.1/src/www/tracker/detail.php
trunk/gforge_base/evolvisforge-5.1/src/www/tracker/mod-limited.php
trunk/gforge_base/evolvisforge-5.1/src/www/tracker/mod.php
Modified:
trunk/gforge_base/evolvisforge-5.1/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeOSLCConnector.php
trunk/gforge_base/evolvisforge-5.1/src/www/include/html.php
trunk/gforge_base/evolvisforge-5.1/src/www/pm/add_task.php
trunk/gforge_base/evolvisforge-5.1/src/www/pm/browse_task.php
trunk/gforge_base/evolvisforge-5.1/src/www/pm/mod_task.php
trunk/gforge_base/evolvisforge-5.1/src/www/themes/funky/css/theme-pages.css
trunk/gforge_base/evolvisforge-5.1/src/www/tracker/browse.php
trunk/gforge_base/evolvisforge-5.1/src/www/tracker/tracker.php
Log:
theme-tracker pending merges:
Thorsten Glaser 2011-11-09 [merge] [#2030] tracker-merge-mod-limited pending merges:
Thorsten Glaser 2011-11-04 properly exit; after ending this file
Thorsten Glaser 2011-11-04 use fixed column width, to avoid content jumping around
Thorsten Glaser 2011-11-04 remove the now no longer needed files
Thorsten Glaser 2011-11-04 also merge add.php into item.php
Thorsten Glaser 2011-11-04 fix obvious typo
Thorsten Glaser 2011-11-04 switch tracker/{mod,mod-limited,detail} → tracker/item
Thorsten Glaser 2011-11-04 another case of “fix the XHTML”
Thorsten Glaser 2011-11-04 cosmetic fix; make submit button always stay in the upper-right 80% c...
Thorsten Glaser 2011-11-04 fix PHP and XHTML errors
Thorsten Glaser 2011-11-04 make html_build_priority_select_box _really_ return, not echo, the bo...
Thorsten Glaser 2011-11-04 in all but one case, build_priority_select_box was being abused
Thorsten Glaser 2011-11-04 add debugging function for Forge developers
Thorsten Glaser 2011-11-04 fix use of getselfhref (is passed an array)
Thorsten Glaser 2011-11-04 now merge detail.php and improve
Thorsten Glaser 2011-11-04 deduplicate
Thorsten Glaser 2011-11-04 merge mod and mod-limited into item
Thorsten Glaser 2011-11-04 add stub new file item.php; add access levels, logic from tracker.php
Thorsten Glaser 2011-11-04 [merge] tarent-5.1 pending merges:
Thorsten Glaser 2011-11-04 eek, this is theme-tracker of course
Thorsten Glaser 2011-11-04 [merge] tracker-merge-mod-limited pending merges:
Thorsten Glaser 2011-11-04 add a file detailing this branch's purpose
Modified: trunk/gforge_base/evolvisforge-5.1/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeOSLCConnector.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeOSLCConnector.php 2011-11-07 15:30:57 UTC (rev 17713)
+++ trunk/gforge_base/evolvisforge-5.1/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeOSLCConnector.php 2011-11-09 09:58:23 UTC (rev 17714)
@@ -338,7 +338,7 @@
$data['assigned_to'] = $ath->technicianBox('assigned_to');
// Add priority data. We use default FusionForge UI for priority selectBox.
- $data['priority'] = build_priority_select_box('priority');
+ $data['priority'] = html_build_priority_select_box('priority');
// Add summary and detailed description.
$data['summary'] = '';
Modified: trunk/gforge_base/evolvisforge-5.1/src/www/include/html.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/include/html.php 2011-11-07 15:30:57 UTC (rev 17713)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/include/html.php 2011-11-09 09:58:23 UTC (rev 17714)
@@ -625,15 +625,6 @@
/**
- * build_priority_select_box() - Wrapper for html_build_priority_select_box()
- *
- * @see html_build_priority_select_box()
- */
-function build_priority_select_box ($name='priority', $checked_val='3', $nochange=false) {
- echo html_build_priority_select_box ($name, $checked_val, $nochange);
-}
-
-/**
* html_build_priority_select_box() - Return a select box of standard priorities.
* The name of this select box is optional and so is the default checked value.
*
@@ -642,19 +633,33 @@
* @param bool Whether to make 'No Change' selected.
*/
function html_build_priority_select_box ($name='priority', $checked_val='3', $nochange=false) {
-?>
- <select id="tracker-<?php echo $name ?>" name="<?php echo $name; ?>" title="<?php echo util_html_secure(html_get_tooltip_description($name)) ?>">
-<?php if($nochange) { ?>
- <option value="100"<?php if ($nochange) {echo " selected=\"selected\"";} ?>><?php echo _('No Change') ?></option>
-<?php } ?>
- <option value="1"<?php if ($checked_val=="1") {echo " selected=\"selected\"";} ?>>1 - <?php echo _('Lowest') ?></option>
- <option value="2"<?php if ($checked_val=="2") {echo " selected=\"selected\"";} ?>>2</option>
- <option value="3"<?php if ($checked_val=="3") {echo " selected=\"selected\"";} ?>>3</option>
- <option value="4"<?php if ($checked_val=="4") {echo " selected=\"selected\"";} ?>>4</option>
- <option value="5"<?php if ($checked_val=="5") {echo " selected=\"selected\"";} ?>>5 - <?php echo _('Highest') ?></option>
- </select>
-<?php
-
+ $rv = '<select id="tracker-' . $name . '" name="' . $name . '" title="' .
+ util_html_secure(html_get_tooltip_description($name)) . '">' . "\n";
+ if ($nochange) {
+ $rv .= '<option value="100"';
+ /*XXX this comparison is redundant; sure it was meant? */
+ if ($nochange) {
+ $rv .= ' selected="selected"';
+ }
+ /*XXX should it be selected at all, anyway? -mirabilos */
+ $rv .= '>' . _('No Change') . "</option>\n";
+ }
+ $vals = array(
+ '1' => '1 - ' . _('Lowest'),
+ '2' => '2',
+ '3' => '3',
+ '4' => '4',
+ '5' => '5 - ' . _('Highest'),
+ );
+ foreach ($vals as $k => $v) {
+ $rv .= '<option value="' . $k . '"';
+ if ($checked_val == $k) {
+ $rv .= ' selected="selected"';
+ }
+ $rv .= '>' . $v . "</option>\n";
+ }
+ $rv .= "</select>\n";
+ return $rv;
}
/**
Modified: trunk/gforge_base/evolvisforge-5.1/src/www/pm/add_task.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/pm/add_task.php 2011-11-07 15:30:57 UTC (rev 17713)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/pm/add_task.php 2011-11-09 09:58:23 UTC (rev 17714)
@@ -60,7 +60,7 @@
</td>
<td>
<strong><?php echo _('Priority') ?>:</strong><br />
- <?php echo build_priority_select_box(); ?>
+ <?php echo html_build_priority_select_box(); ?>
</td>
</tr>
Modified: trunk/gforge_base/evolvisforge-5.1/src/www/pm/browse_task.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/pm/browse_task.php 2011-11-07 15:30:57 UTC (rev 17713)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/pm/browse_task.php 2011-11-09 09:58:23 UTC (rev 17714)
@@ -659,7 +659,7 @@
_('No Change')) .'</td>
<td><strong>'._('Priority').
'</strong><br />';
- echo build_priority_select_box ('priority', '100', true);
+ echo html_build_priority_select_box ('priority', '100', true);
echo '</td>
</tr>
Modified: trunk/gforge_base/evolvisforge-5.1/src/www/pm/mod_task.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/pm/mod_task.php 2011-11-07 15:30:57 UTC (rev 17713)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/pm/mod_task.php 2011-11-09 09:58:23 UTC (rev 17714)
@@ -149,7 +149,7 @@
<td>
<strong><?php echo _('Priority') ?>:</strong><br />
- <?php echo build_priority_select_box('priority',$pt->getPriority()); ?>
+ <?php echo html_build_priority_select_box('priority',$pt->getPriority()); ?>
</td>
<td colspan="2">
Modified: trunk/gforge_base/evolvisforge-5.1/src/www/themes/funky/css/theme-pages.css
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/themes/funky/css/theme-pages.css 2011-11-07 15:30:57 UTC (rev 17713)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/themes/funky/css/theme-pages.css 2011-11-09 09:58:23 UTC (rev 17714)
@@ -226,12 +226,12 @@
/*
tracker
*/
-#trackermodform table
+#trackeritemform table
{
width: 100%;
}
-#trackermodform input[type=submit]
+#trackeritemform input[type=submit]
{
float: right;
}
Modified: trunk/gforge_base/evolvisforge-5.1/src/www/tracker/browse.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/tracker/browse.php 2011-11-07 15:30:57 UTC (rev 17713)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/tracker/browse.php 2011-11-09 09:58:23 UTC (rev 17714)
@@ -712,7 +712,7 @@
$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 html_build_priority_select_box('priority', '100', true);
echo '</td><td>';
echo '</td>
Added: trunk/gforge_base/evolvisforge-5.1/src/www/tracker/item.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/tracker/item.php (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/tracker/item.php 2011-11-09 09:58:23 UTC (rev 17714)
@@ -0,0 +1,506 @@
+<?php
+/*-
+ * Tracker Item detail view / modification interface for FusionForge
+ *
+ * Copyright © 2011
+ * Thorsten “mirabilos” Glaser <t.glaser at tarent.de>
+ * Copyright © 2011
+ * Alain Peyrat – Alcatel-Lucent
+ * Copyright © 2010
+ * Franck Villaume – Capgemini
+ * Copyright © 2005
+ * GForge, LLC
+ * Copyright © 1999-2001
+ * VA Linux Systems
+ * All rights reserved.
+ *
+ * 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.
+ *-
+ * Calling chain for this file:
+ * www/tracker/index.php
+ * includes necessary classes
+ * provides $group_id, $atid (≠ 0), $aid
+ * sets and checks $group
+ * www/tracker/tracker.php (func='detail' or 'add')
+ * enables tooltips
+ * sets and checks $ath ($group, $atid)
+ * calls form submission actions
+ * sets and checks $ah ($ath, $aid) for 'detail'
+ * define $is_add = false for 'detail' or true for 'add'
+ *
+ * That means we can use the following variables already:
+ * $group_id = $group->getID()
+ * $atid = $ath->getID()
+ * $aid = $ah->getID() for 'detail'
+ */
+
+define('TRK_VIEW', 0);
+define('TRK_TECH', 1);
+define('TRK_FULL', 2);
+
+if (forge_check_perm('tracker', $atid, 'manager')) {
+ $accesslevel = TRK_FULL;
+} else if (forge_check_perm('tracker', $atid, 'tech')) {
+ $accesslevel = TRK_TECH;
+} else {
+ $accesslevel = TRK_VIEW;
+}
+
+if ($accesslevel >= TRK_FULL && $sysdebug_enable) {
+ /* debugging function: look at this page the way a user would */
+ $reduce_accesslevel = getIntFromRequest('reduce_accesslevel');
+ if ($reduce_accesslevel == 1) {
+ $accesslevel = TRK_TECH;
+ } else if ($reduce_accesslevel == 2) {
+ $accesslevel = TRK_VIEW;
+ }
+}
+
+if ($is_add) {
+ $ath->header(array(
+ 'title' => _('Submit New'),
+ ));
+ echo $ath->renderSubmitInstructions();
+} else {
+ html_use_lightbox();
+ $ath->header(array(
+ 'title' => '[#' . $aid . '] ' . $ah->getSummary(),
+ 'atid' => $atid,
+ ));
+}
+echo notepad_func();
+
+function getselfhref($p=array(),$return_encoded=true) {
+ global $group_id, $atid, $aid, $is_add;
+
+ $p['group_id'] = $group_id;
+ $p['atid'] = $atid;
+ if (!$is_add) {
+ /* grml… */
+ $p['aid'] = $aid;
+ $p['artifact_id'] = $aid;
+ }
+ /* make link */
+ $selfurl = getStringFromServer('PHP_SELF');
+ $sep = '?';
+ foreach ($p as $k => $v) {
+ $selfurl .= $sep . $k . '=' . $v;
+ $sep = '&';
+ }
+ if ($return_encoded) {
+ $selfurl = htmlspecialchars($selfurl);
+ }
+ return $selfurl;
+}
+
+function gettipspan($idpart, $content) {
+ return '<span id="tracker-' . $idpart . '" title="' .
+ util_html_secure(html_get_tooltip_description($idpart)) .
+ '">' . $content . '</span>';
+}
+
+?>
+<form id="trackeritemform" action="<?php echo getselfhref(); ?>"
+ enctype="multipart/form-data" method="post">
+<input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>" />
+<input type="hidden" name="func" value="<?php echo ($is_add ? "postadd" : "postmod"); ?>" />
+<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
+
+<?php
+if ($is_add) {
+?>
+<table width="80%"><tr>
+<?php
+ if (!session_loggedin()) {
+?>
+ <td colspan="2">
+ <span class="warning_msg"><?php
+ printf(_('Please %1$s login %2$s'), '<a href="' .
+ util_make_url('/account/login.php?return_to=' .
+ urlencode(getselfhref(array('func' => 'add'), false))) .
+ '">', '</a>'); ?></span>
+ <p><?php echo _('If you <strong>cannot</strong> login, then enter your email address here'); ?>:</p>
+ <p><input type="text" name="user_email" size="50" maxlength="255" /></p>
+ </td>
+</tr><tr>
+<?php
+ /* !session_loggedin */
+ }
+?>
+ <td><strong><?php echo _('For project') ?>:</strong><br /><?php
+ echo $group->getPublicName();
+ ?></td>
+ <td align="right">
+ <input type="submit" name="submit" value="<?php echo _('Submit'); ?>" />
+ </td>
+</tr>
+</table>
+<?php
+ /* is_add */
+} else if (session_loggedin()) {
+ $num_td = 2;
+ if ($accesslevel >= TRK_TECH && $group->usesPM()) {
+ ++$num_td;
+ }
+ if ($accesslevel >= TRK_FULL) {
+ ++$num_td;
+ }
+ if ($num_td == 2) {
+ $w_td = '50%';
+ } else if ($num_td == 3) {
+ $w_td = '33%';
+ } else {
+ $w_td = '25%';
+ }
+?>
+<table width="80%"><tr>
+ <td width="<?php echo $w_td; ?>">
+ <?php
+ if ($ah->isMonitoring()) {
+ $img = "xmail16w.png";
+ $key = "monitorstop";
+ $txt = _('Stop monitor');
+ } else {
+ $img = "mail16w.png";
+ $key = "monitor";
+ $txt = _('Monitor');
+ }
+ echo gettipspan('monitor', '<a href="' .
+ getselfhref(array('func' => 'monitor')) . '"><strong>' .
+ html_image('ic/' . $img, '20', '20') . ' ' . $txt .
+ '</strong></a>');
+?>
+ </td>
+<?php
+ if ($accesslevel >= TRK_TECH && $group->usesPM()) {
+?>
+ <td width="<?php echo $w_td; ?>"><?php
+ echo '<a href="' . getselfhref(array('func' => 'taskmgr')) .
+ '">' . html_image('ic/taskman20w.png', '20', '20') .
+ '<strong>' . _('Build Task Relation') . '</strong></a>';
+?></td>
+<?php
+ /* TRK_TECH && usesPM */
+ }
+ if ($accesslevel >= TRK_FULL) {
+?>
+ <td width="<?php echo $w_td; ?>"><a href="<?php
+ echo getselfhref(array('func' => 'deleteartifact'));
+?>"><strong><?php
+ echo html_image('ic/trash.png', '16', '16') .
+ _('Delete');
+?></strong></a></td>
+<?php
+ /* TRK_FULL */
+ }
+?>
+ <td width="<?php echo $w_td; ?>" align="right">
+ <input type="submit" name="submit" value="<?php echo _('Save Changes') ?>" />
+ </td>
+<?php
+ if ($accesslevel >= TRK_FULL && $sysdebug_enable) {
+ /* debugging function: look at this page the way a user would */
+?>
+</tr>
+<tr><td colspan="<?php echo $num_td; ?>" style="border:1px solid green;">
+ You have <tt>TRK_FULL</tt> access, and this is a debugging system.
+ If you want, you can look at this page with reduced access levels,
+ e.g. if you’re a Forge developer. – <a href="<?php
+ echo getselfhref(array('func' => 'detail',
+ 'reduce_accesslevel' => 1)); ?>">TRK_TECH</a> – <a href="<?php
+ echo getselfhref(array('func' => 'detail',
+ 'reduce_accesslevel' => 2)); ?>">TRK_VIEW</a> – To get back,
+ just access the Permalink of this entry, or remove the HTTP GET
+ parameter <tt>reduce_accesslevel</tt> and reload.
+</td>
+<?php
+ /* TRK_FULL && sysdebug_enable */
+ }
+?>
+</tr></table>
+<?php
+ /* logged in */
+}
+?>
+<table border="0" width="80%">
+<?php if (!$is_add) { ?>
+<tr>
+ <td width="50%">
+ <strong><?php echo _('Submitted by') ?>:</strong><br /><?php
+ echo $ah->getSubmittedRealName();
+ if ($ah->getSubmittedBy() != 100) {
+ echo ' (<tt>' . util_make_link_u($ah->getSubmittedUnixName(),
+ $ah->getSubmittedBy(), $ah->getSubmittedUnixName()) .
+ '</tt>)';
+ }
+?></td>
+ <td width="50%">
+ <strong><?php echo _('Date Submitted') ?>:</strong><br /><?php
+ echo date(_('Y-m-d H:i'), $ah->getOpenDate());
+ $close_date = $ah->getCloseDate();
+ /*XXX hardcoded status ID */
+ if ($ah->getStatusID() == 2 && $close_date > 1) {
+ echo '<br /><strong>' . _('Date Closed') . ':</strong><br />' .
+ date(_('Y-m-d H:i'), $close_date);
+ }
+?></td>
+</tr>
+<?php
+ /* !is_add */
+}
+?>
+<tr>
+ <td><?php
+if (!$is_add && $accesslevel >= TRK_FULL) {
+ ?><strong><?php echo _('Data Type') ?>:</strong><br /><?php
+ $atf = new ArtifactTypeFactory($group);
+ $tids = array();
+ foreach ($atf->getArtifactTypes() as $at) {
+ if (forge_check_perm('tracker', $at->getID(), 'manager')) {
+ $tids[] = $at->getID();
+ }
+ }
+ $res = db_query_params('SELECT group_artifact_id, name
+ FROM artifact_group_list WHERE group_artifact_id = ANY ($1)',
+ array(db_int_array_to_any_clause($tids)));
+ echo html_build_select_box($res, 'new_artifact_type_id', $atid, false);
+ /* !is_add && TRK_FULL */
+}
+?>
+ </td>
+ <td><?php
+if (!$is_add) {
+ $permalink = util_make_url('/tracker/t_follow.php/' . $aid);
+?><strong><a href="<?php echo $permalink; ?>">Permalink</a>:</strong><br /><?php
+ echo $permalink;
+}
+?></td>
+</tr>
+<?php
+
+$ath->renderExtraFields($is_add ? array() : $ah->getExtraFieldData(), true,
+ 'none', false, 'Any', array(), false,
+ ($is_add || ($accesslevel >= TRK_TECH) ? 'UPDATE' : 'DISPLAY'));
+
+if (!$is_add || $accesslevel >= TRK_FULL) {
+?>
+<tr>
+ <td><strong><?php echo _('Assigned to')?>:</strong><br /><?php
+ if ($accesslevel >= TRK_FULL) {
+ echo $ath->technicianBox('assigned_to',
+ $is_add ? 'xzxz' : $ah->getAssignedTo()) . ' ' .
+ util_make_link('/tracker/admin/?group_id=' . $group_id .
+ '&atid=' . $atid . '&update_users=1', '(' .
+ _('Admin') . ')');
+ } else {
+ echo gettipspan('assigned_to', $ah->getAssignedRealName() .
+ ' (' . $ah->getAssignedUnixName() . ')');
+ }
+?></td>
+ <td<?php if ($is_add) { echo ' align="right"'; }?>>
+ <strong><?php echo _('Priority') ?>:</strong><br /><?php
+ if ($accesslevel >= TRK_FULL) {
+ echo html_build_priority_select_box('priority',
+ $is_add ? 3 : $ah->getPriority());
+ } else {
+ echo gettipspan('priority', $ah->getPriority());
+ }
+?></td>
+</tr>
+<?php
+ /* !is_add || TRK_FULL */
+}
+if (!$is_add && !$ath->usesCustomStatuses()) {
+?>
+<tr>
+ <td colspan="2"><strong><?php echo _('State') ?>:</strong><br /><?php
+ if ($accesslevel >= TRK_FULL) {
+ echo $ath->statusBox('status_id', $ah->getStatusID());
+ } else {
+ echo gettipspan('status_id', $ah->getStatusID());
+ }
+?></td>
+</tr>
+<?php } ?>
+<tr>
+ <td colspan="2"><strong><?php echo _('Summary') .
+ utils_requiredField(); ?>:</strong><br /><?php
+$x = '<input type="text" name="summary" size="80" maxlength="255"';
+if ($is_add) {
+ $x .= ' />';
+} else {
+ if ($accesslevel >= TRK_FULL) {
+ $x .= ' value="';
+ } else {
+ $x = '';
+ }
+ $x .= $ah->getSummary();
+ if ($accesslevel >= TRK_FULL) {
+ $x .= '" />';
+ }
+}
+echo gettipspan('summary', $x);
+?></td>
+</tr>
+<tr>
+ <td colspan="2">
+<?php
+if ($is_add || $accesslevel >= TRK_FULL) {
+ if (!$is_add) {
+?>
+ <div id="edit" style="display:none;">
+<?php
+ }
+ $ndsc = $is_add ? "details" : "description";
+ echo '<strong>' . _('Detailed description') . utils_requiredField() .
+ ': ' . notepad_button('document.forms.trackeritemform.' . $ndsc) .
+ '</strong><br />';
+ echo gettipspan('description', '<textarea rows="30" cols="79" name="' .
+ $ndsc . '">' . ($is_add ? "" : $ah->getDetails()) . '</textarea>');
+ if (!$is_add) {
+?>
+ </div>
+<?php
+ }
+ /* is_add || TRK_FULL */
+}
+if (!$is_add) {
+?>
+ <div id="show" style="display:block;"><?php
+ echo $ah->showDetails($accesslevel >= TRK_FULL);
+?></div>
+<?php } ?>
+ </td>
+</tr>
+<?php if ($is_add) { ?>
+<tr><td colspan="2" align="center">
+ <span class="veryimportant"><?php
+ echo _('DO NOT enter passwords or confidential information in your message!');
+ ?></span>
+</td></tr>
+<tr><td colspan="2">
+<?php
+ /* is_add */
+} else {
+?>
+</table>
+
+<div id="tabber" class="tabber">
+<div class="tabbertab" title="<?php echo _('Followups'); ?>">
+<?php
+ if ($accesslevel >= TRK_FULL) {
+?>
+ <p><strong><?php echo _('Use Canned Response'); ?>:</strong>
+ <br />
+<?php
+ echo $ath->cannedResponseBox('canned_response') . ' ' .
+ util_make_link('/tracker/admin/?group_id=' . $group_id .
+ '&atid=' . $atid . '&add_canned=1', '(' .
+ _('Admin') . ')') . "</p>\n";
+ }
+ if ($accesslevel >= TRK_TECH || $ath->allowsAnon() ||
+ session_loggedin()) {
+?>
+ <p><strong><?php echo _('OR Attach A Comment') . ': ' .
+ notepad_button('document.forms.trackeritemform.details');
+ ?></strong><br /><?php echo gettipspan('comment',
+ '<textarea name="details" rows="7" cols="60"></textarea>');
+ ?></p>
+<?php
+}
+echo '<h2>' . _('Followups') . ': ';
+$commentsort_chrono = getStringFromRequest('commentsort') != 'anti';
+if ($commentsort_chrono) {
+ $tgt = getselfhref(array('func' => 'detail',
+ 'commentsort' => 'anti'));
+ $txt = _('Sort comments antichronologically');
+} else {
+ $tgt = getselfhref(array('func' => 'detail',
+ 'commentsort' => 'chrono'));
+ $txt = _('Sort comments chronologically');
+}
+echo '<a href="' . $tgt . '">' . $txt . "</a></h2>\n";
+
+echo $ah->showMessages($commentsort_chrono);
+?>
+</div>
+<?php
+ if ($accesslevel >= TRK_FULL && $group->usesPM()) {
+?>
+<div class="tabbertab" title="<?php echo _('Related Tasks'); ?>">
+ <table border="0" width="80%">
+ <tr><td colspan="2"><!-- dummy in case this is empty --></td></tr>
+<?php $ath->renderRelatedTasks($group, $ah); ?>
+ </table>
+</div>
+<?php } ?>
+<div class="tabbertab" title="<?php echo _('Attachments'); ?>">
+<?php
+ /* !is_add */
+}
+if ($is_add || $accesslevel >= TRK_TECH ||
+ (session_loggedin() && ($ah->getSubmittedBy() == user_getid()))) {
+ echo _('Attach Files'); ?><a href="javascript:help_window('<?php
+ echo util_make_url('/help/tracker.php?helpname=attach_file');
+ ?>');"><strong>(?)</strong></a><br />
+ <input type="file" name="input_file0" size="30" /><br />
+ <input type="file" name="input_file1" size="30" /><br />
+ <input type="file" name="input_file2" size="30" /><br />
+ <input type="file" name="input_file3" size="30" /><br />
+ <input type="file" name="input_file4" size="30" /><br />
+<?php
+}
+if ($is_add) {
+?>
+</td></tr>
+<tr><td colspan="2" align="right">
+ <?php echo utils_requiredField() . ' ' .
+ _('Indicates required fields.'); ?>
+</td></tr>
+<tr><td colspan="2" align="left">
+ <input type="submit" name="submit" value="<?php echo _('Submit'); ?>" />
+</td></tr>
+</table>
+<?php
+ /* is_add */
+} else {
+?>
+ <h2><?php echo _('Attached Files') ?>:</h2>
+<?php $ath->renderFiles($group_id, $ah); ?>
+</div>
+<div class="tabbertab" title="<?php echo _('Commits'); ?>">
+<table border="0" width="80%"><?php
+ $hookParams['artifact_id'] = $aid;
+ plugin_hook("artifact_extra_detail", $hookParams);
+?><tr><td colspan="2"><!-- dummy in case the hook is empty --></td></tr>
+</table>
+</div>
+<div class="tabbertab" title="<?php echo _('Changes'); ?>">
+ <h2><?php echo _('Changes') ?>:</h2>
+<?php echo $ah->showHistory(); ?>
+</div>
+<?php
+ $ah->showRelations();
+ /* close div#tabber */
+ echo "</div>\n";
+ /* !is_add */
+}
+?>
+</form>
+<?php
+
+$ath->footer(array());
+exit;
Modified: trunk/gforge_base/evolvisforge-5.1/src/www/tracker/tracker.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/tracker/tracker.php 2011-11-07 15:30:57 UTC (rev 17713)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/tracker/tracker.php 2011-11-09 09:58:23 UTC (rev 17714)
@@ -61,7 +61,8 @@
if (!$ath->allowsAnon() && !session_loggedin()) {
exit_permission_denied('tracker');
}
- include $gfwww.'tracker/add.php';
+ $is_add = true;
+ include $gfwww.'tracker/item.php';
break;
}
case 'postadd' : {
@@ -570,13 +571,8 @@
} else if ($ah->isError()) {
exit_error($ah->getErrorMessage(),'tracker');
} else {
- if (forge_check_perm ('tracker', $ath->getID(), 'manager')) {
- include $gfwww.'tracker/mod.php';
- } elseif (forge_check_perm ('tracker', $ath->getID(), 'tech')) {
- include $gfwww.'tracker/mod-limited.php';
- } else {
- include $gfwww.'tracker/detail.php';
- }
+ $is_add = false;
+ include $gfwww.'tracker/item.php';
}
break;
}
More information about the evolvis-commits
mailing list