[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gforge-commits] gforge/www/tracker add.php, 1.13, 1.14 browse.php, 1.14
From: |
tperdue |
Subject: |
[Gforge-commits] gforge/www/tracker add.php, 1.13, 1.14 browse.php, 1.14, 1.15 index.php, 1.22, 1.23 massupdate-fields.php, 1.1, 1.2 tracker.php, 1.2, 1.3 update-fields.php, 1.1, 1.2 |
Date: |
Wed, 06 Oct 2004 11:27:20 -0500 |
Update of /cvsroot/gforge/gforge/www/tracker
In directory db.perdue.net:/home/tperdue/share/dev.gforge.org/www/tracker
Modified Files:
add.php browse.php index.php massupdate-fields.php tracker.php
update-fields.php
Log Message:
Pugliese patch for cloning fields in tracker
Index: add.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/tracker/add.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- add.php 12 Sep 2004 17:36:10 -0000 1.13
+++ add.php 6 Oct 2004 16:27:12 -0000 1.14
@@ -43,28 +43,10 @@
?>
</td>
</tr>
+
<?php
-//
-// build input pop-up boxes for boxes and choices configured by ADMIN
-//
- $result=$ath->getSelectionBoxes();
- echo "<p> </p>";
- $rows=db_numrows($result);
- if ($result &&$rows > 0) {
- echo '<tr>';
- for ($i=0; $i < $rows; $i++) {
- $newrow= is_integer($i/2);
- echo
'<td><strong>'.db_result($result,$i,'selection_box_name').'</strong><br \>';
- echo
$ath->selectionBox(db_result($result,$i,'id','choice_id'));
- echo ' <a
href="/tracker/admin/?group_id='.$group_id.'&atid='. $ath->getID()
.'&build_box=1">('.$Language->getText('tracker','admin').')</a>';
-
- if (!$newrow) {
- echo '</tr><tr>';
- }
- }
- }
- ?>
- <?php
+
+ $ath->buildPopUpBoxes();
if ($ath->userIsAdmin()) {
echo '<tr>
@@ -76,6 +58,7 @@
echo build_priority_select_box('priority');
echo '</td></tr>';
}
+
?>
<tr>
<td colspan="2"><strong><?php echo
$Language->getText('tracker','summary') ?>: <a
href="javascript:help_window('/help/tracker.php?helpname=summary')"></strong><?php
echo utils_requiredField(); ?><strong>(?)</strong></a><br />
Index: browse.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/tracker/browse.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- browse.php 5 Oct 2004 16:05:23 -0000 1.14
+++ browse.php 6 Oct 2004 16:27:12 -0000 1.15
@@ -18,8 +18,6 @@
exit_permission_denied();
}
- include 'search-fields.php';
-
$af = new ArtifactFactory($ath);
if (!$af || !is_object($af)) {
exit_error('Error','Could Not Get Factory');
@@ -152,11 +150,8 @@
for ($i=0; $i < $rows; $i++) {
$newrow=is_integer(($i+1)/5);
echo '<td><span
style="font-size:smaller">'.db_result($result,$i,'selection_box_name').'</span></br
\>';
- if ($source=='custom') {
- $choice= $value[$i];
- } else {
- $choice='xzxz';
- }
+
+ $choice=$extra_fields_choice[$i];
echo
$ath->selectionBox(db_result($result,$i,'id'),$choice,$Language->getText('tracker_admin_build_boxes','status_any'));
echo '</td>';
if ($newrow) {
@@ -181,7 +176,7 @@
if ($art_arr && count($art_arr) > 0) {
- if ($source=='custom') {
+ if ($set=='custom') {
//
// validate that any admin configured extra fields meet its selection
criteria
@@ -194,13 +189,13 @@
$resultc =
$ath->getArtifactChoices($art_arr[$i]->getID());
$browserows = db_numrows($resultc);
for ($j=0; $j < $browserows; $j++) {
- if ((db_result($resultc,$j,'choice_id')
== $value[$j])|| $value[$j]=='100'){
+ if ((db_result($resultc,$j,'choice_id')
== $extra_fields_choice[$j])|| $extra_fields_choice[$j]=='100'){
$matches=$matches+1;
}
}
if ($rows > $browserows && $matches ==
$browserows) {
for ($k = $browserows; $k < $rows;
$k++){
- if
((db_result($resultc,$k,'choice_id') == $value[$k]) || $value[$k] == '100') {
+ if
((db_result($resultc,$k,'choice_id') == $extra_fields_choice[$k]) ||
$extra_fields_choice[$k] == '100') {
$matches = $matches+1;
}
}
Index: index.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/tracker/index.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- index.php 17 Sep 2004 05:39:52 -0000 1.22
+++ index.php 6 Oct 2004 16:27:12 -0000 1.23
@@ -32,7 +32,6 @@
if ($group_id && $atid) {
-
include('tracker.php');
} elseif ($group_id) {
Index: massupdate-fields.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/tracker/massupdate-fields.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- massupdate-fields.php 26 Aug 2004 15:32:07 -0000 1.1
+++ massupdate-fields.php 6 Oct 2004 16:27:12 -0000 1.2
@@ -29,32 +29,24 @@
$transferct=0;
$changect=0;
if($result &&$rows > 0) {
- if(!is_array($value)){
- foreach($_POST as$KEY=>$post_value){
- $value_array[]=$post_value;
- }
- $post_value=implode(",",$value_array);
- $post_value=explode(",",$post_value);
- }
for ($j=0; $j < $rows; $j++){
- $value[$j]=$post_value[$j+4];
if ($j < $setrows) {
- if ($value[$j] != 100){
- if (db_result($resultc,$j,'choice_id') !==
($value[$j])) {
+ if ($extra_fields_choice[$j] != 100){
+ if (db_result($resultc,$j,'choice_id') !==
($extra_fields_choice[$j])) {
-
$ah->updateExtraFields(db_result($resultc,$j,'id'),$value[$j]);
+
$ah->updateExtraFields(db_result($resultc,$j,'id'),$extra_fields_choice[$j]);
$old=(db_result($resultc,$j,'choice_id'));
$oldnames
=$ath->getBoxOptionsName($old);
$ah->addHistory(db_result($result,$j,'selection_box_name'),db_result($oldnames,'0','box_options_name'));
$changect=$changect+1;
}
- }
+ }
}else {
- $ah->createExtraFields($value[$j]);
- if ($value[$j] !=='100') {
+
$ah->createExtraFields($extra_fields_choice[$j]);
+ if ($extra_fields_choice[$j] !=='100') {
$transferct=$transferct+1;
}
- }
+ }
}
}
?>
Index: tracker.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/tracker/tracker.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- tracker.php 5 Oct 2004 14:59:08 -0000 1.2
+++ tracker.php 6 Oct 2004 16:27:12 -0000 1.3
@@ -1,5 +1,6 @@
<?php
+
//
// get the Group object
//
@@ -14,7 +15,6 @@
exit_error($Language->getText('general','error'),
$group->getErrorMessage());
}
}
-
//
// Create the ArtifactType object
//
@@ -30,7 +30,6 @@
exit_error($Language->getText('general','error'),
$ath->getErrorMessage());
}
}
-
switch ($func) {
case 'add' : {
@@ -39,7 +38,6 @@
}
case 'postadd' : {
/*
-
Create a new Artifact
*/
@@ -60,8 +58,17 @@
//
// Include extra fields configured by ADMIN
//
- include ('add-fields.php');
-
+
+ $result=$ath->getSelectionBoxes();
+ $rows=db_numrows($result);
+
+ if ($result && $rows > 0) {
+ for ($i=0; $i < $rows; $i++) {
+
$ah->createExtraFields($extra_fields_choice[$i]);
+ }
+ unset ($extra_fields_choice);
+ }
+
//
// Attach file to this Artifact.
//
@@ -69,8 +76,8 @@
$afh=new ArtifactFileHtml($ah);
if (!$afh || !is_object($afh)) {
$feedback .= 'Could Not Create
File Object';
-// } elseif ($afh->isError()) {
-// $feedback .=
$afh->getErrorMessage();
+// } elseif ($afh->isError()) {
+// $feedback .=
$afh->getErrorMessage();
} else {
if
(!$afh->upload($input_file,$input_file_name,$input_file_type,$file_description))
{
$feedback .= ' Could
Not Attach File to Item: '.$afh->getErrorMessage();
@@ -121,12 +128,12 @@
}
}
unset($ah);
-
-
+
+
if (!$was_error) {
- $feedback =
$Language->getText('tracker','updated_successful');
- }
+ $feedback =
$Language->getText('tracker','updated_successful'); }
}
+ unset ($extra_fields_choice);
include ('browse.php');
break;
}
@@ -143,8 +150,8 @@
exit_error('ERROR',$ah->getErrorMessage());
} else {
if (!$ath->userIsAdmin() && $ath->userIsTechnician()) {
-// && !(session_loggedin() &&
($ah->getSubmittedBy() == user_getid()))
-// && (session_loggedin() &&
($ah->getAssignedTo() == user_getid()))) {
+// && !(session_loggedin() &&
($ah->getSubmittedBy() == user_getid()))
+// && (session_loggedin() && ($ah->getAssignedTo()
== user_getid()))) {
$priority=$ah->getPriority();
$category_id=$ah->getCategoryID();
$artifact_group_id=$ah->getArtifactGroupID();
@@ -168,8 +175,8 @@
$afh=new ArtifactFileHtml($ah);
if (!$afh || !is_object($afh)) {
$feedback .= 'Could Not Create File
Object';
-// } elseif ($afh->isError()) {
-// $feedback .=
$afh->getErrorMessage();
+// } elseif ($afh->isError()) {
+// $feedback .= $afh->getErrorMessage();
} else {
if
(!util_check_fileupload($input_file)) {
exit_error("Error","Invalid
filename");
@@ -216,7 +223,7 @@
//
}
}
-
+
}
include ('browse.php');
}
@@ -225,7 +232,6 @@
case 'postaddcomment' : {
/*
Attach a comment to an artifact
-
Used by non-admins
*/
$ah=new ArtifactHtml($ath,$artifact_id);
@@ -248,8 +254,7 @@
$ah=new ArtifactHtml($ath,$artifact_id);
if (!$ah || !is_object($ah)) {
exit_error('ERROR','Artifact Could Not Be Created');
- } else if ($ah->isError()) {
- exit_error('ERROR',$ah->getErrorMessage());
+ } else if ($ah->isError()) {
exit_error('ERROR',$ah->getErrorMessage());
} else {
$ah->setMonitor();
$feedback=$ah->getErrorMessage();
@@ -277,8 +282,7 @@
//
$ah=new ArtifactHtml($ath,$aid);
if (!$ah || !is_object($ah)) {
- exit_error('ERROR','Artifact Could Not Be Created');
- } else if ($ah->isError()) {
+ exit_error('ERROR','Artifact Could Not Be Created');
} else if ($ah->isError()) {
exit_error('ERROR',$ah->getErrorMessage());
} else {
if ($ath->userIsAdmin() || (session_loggedin() &&
($ah->getSubmittedBy() == user_getid()))) {
@@ -296,5 +300,4 @@
break;
}
}
-
?>
Index: update-fields.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/tracker/update-fields.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- update-fields.php 26 Aug 2004 15:32:07 -0000 1.1
+++ update-fields.php 6 Oct 2004 16:27:12 -0000 1.2
@@ -29,29 +29,23 @@
$changect=0;
$transferct=0;
if($result &&$rows > 0) {
- foreach($_POST as$KEY=>$post_value) {
- $value_array[]=$post_value;
- }
-$post_value=implode(",",$value_array);
-}
-$post_value=explode(",",$post_value);
for ($i=0; $i < $rows; $i++) {
- $value[$i]=$post_value[$i+7];
if ($i < $setrows) {
- if (db_result($resultc,$i,'choice_id') != $value[$i]){
-
$ah->updateExtraFields(db_result($resultc,$i,'id'),$value[$i]);
+ if (db_result($resultc,$i,'choice_id') !=
$extra_fields_choice[$i]){
+
$ah->updateExtraFields(db_result($resultc,$i,'id'),$extra_fields_choice[$i]);
$old=(db_result($resultc,$i,'choice_id'));
$oldnames=$ath->getBoxOptionsName($old);
$ah->addHistory(db_result($result,$i,'selection_box_name'),db_result($oldnames,'0','box_options_name'));
$changect=$changect+1;
}
}else{
- $ah->createExtraFields($value[$i]);
- if ($value[$i] !== '100') {
+ $ah->createExtraFields($extra_fields_choice[$i]);
+ if ($extra_fields_choice[$i] !== '100') {
$transferct=$transferct+1;
}
- }
-}
-
+ }
+ }
+ unset ($extra_fields_choice);
+}
?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gforge-commits] gforge/www/tracker add.php, 1.13, 1.14 browse.php, 1.14, 1.15 index.php, 1.22, 1.23 massupdate-fields.php, 1.1, 1.2 tracker.php, 1.2, 1.3 update-fields.php, 1.1, 1.2,
tperdue <=
- Prev by Date:
[Gforge-commits] gforge/common/tracker Artifact.class, 1.20, 1.21 ArtifactBoxOptions.class, 1.1, 1.2 ArtifactSelectionBox.class, 1.1, 1.2 ArtifactType.class, 1.25, 1.26
- Next by Date:
[Gforge-commits] gforge/www/include/languages French.tab, 1.110, 1.111
- Previous by thread:
[Gforge-commits] gforge/common/tracker Artifact.class, 1.20, 1.21 ArtifactBoxOptions.class, 1.1, 1.2 ArtifactSelectionBox.class, 1.1, 1.2 ArtifactType.class, 1.25, 1.26
- Next by thread:
[Gforge-commits] gforge/www/include/languages French.tab, 1.110, 1.111
- Index(es):