[evolvis-commits] r6641: Added the functionality of the new feature for allowing users to copy tasks to other subprojects . the change include user interface changes and the database changes for the corresponding move .

ukayan at evolvis.org ukayan at evolvis.org
Mon May 17 16:39:04 CEST 2010


Author: ukayan
Date: 2010-05-17 16:39:04 +0200 (Mon, 17 May 2010)
New Revision: 6641

Modified:
   branches/Changes-to-status-field-gforge-4.8.1+evolvis/www/pm/mod_task.php
Log:
Added the functionality of the new feature for allowing users to copy tasks to other subprojects. the change include user interface changes and the database changes for the corresponding move.

Modified: branches/Changes-to-status-field-gforge-4.8.1+evolvis/www/pm/mod_task.php
===================================================================
--- branches/Changes-to-status-field-gforge-4.8.1+evolvis/www/pm/mod_task.php	2010-05-14 14:56:29 UTC (rev 6640)
+++ branches/Changes-to-status-field-gforge-4.8.1+evolvis/www/pm/mod_task.php	2010-05-17 14:39:04 UTC (rev 6641)
@@ -66,6 +66,35 @@
 			echo '<span class="submitErrorInformation">'._('All Fields Are Required.').'</span>';
 		}
 }
+
+if (getStringFromRequest('CopySubproject')) {
+	$copy_group_project_id = getStringFromRequest('copy_group_project_id');
+	//$created_by = getStringFromRequest('created_by');
+	$summary = getStringFromRequest('summary');
+	$details = getStringFromRequest('details');
+	$status_id = 1;//getStringFromRequest('status_id'); //always open for new copied tasks.
+	$category_id = getStringFromRequest('category_id');
+	$priority = getStringFromRequest('priority');
+	$percent_complete = getStringFromRequest('percent_complete');
+	$hours = getStringFromRequest('hours');
+	$duration = getStringFromRequest('duration');
+	$parent_id = getStringFromRequest('parent_id');
+
+
+	$sql = "INSERT INTO project_task (group_project_id,created_by,summary,
+				details,start_date,end_date,status_id,category_id,priority,percent_complete,hours,duration,parent_id) 
+				VALUES ('$copy_group_project_id','".user_getid()."','$summary','$details','$start_date','$end_date','$status_id',
+				'$category_id','$priority','$percent_complete','$hours','$duration','$parent_id')";
+
+	//echo $sql;
+	$result = db_query( $sql );
+	if (!$result || db_affected_rows($result) < 1) {
+		$this->setError( 'ProjectTask::create() Posting Failed '.db_error().$sql );
+		db_rollback();
+		return false;
+	}else{
+		echo '<span class="submitSuccessInformation">'._('Successfully Copied').'</span>';
+	}
 }
 ?>
 <form action="<?php echo getStringFromServer('PHP_SELF')."?group_id=$group_id&amp;group_project_id=$group_project_id"; ?>" method="post">
@@ -95,6 +124,11 @@
 			<strong><?php echo _('Subproject'); ?>:</strong><br />
 			<?php echo $pg->groupProjectBox('new_group_project_id',$group_project_id,false); ?>
 		</td>
+		<td>
+            <strong><a href="<?php echo util_make_url("/pm/t_follow.php/" . $project_task_id); ?>">Permalink</a>:</strong><br />
+            <?php echo util_make_url("/pm/t_follow.php/" . $project_task_id); ?>
+        </td>
+		
 	</tr>
 
 	<tr>
@@ -107,6 +141,14 @@
 		<strong><?php echo _('Priority') ?>:</strong><br />
 		<?php echo build_priority_select_box('priority',$pt->getPriority()); ?>
 		</td>
+		
+		<td>
+        <strong>Task Detail Information (JSON):</strong><br />
+        <a href="<?php echo util_make_url("/pm/t_lookup.php?tid=" . $project_task_id); ?>">application/json</a>
+        or
+        <a href="<?php echo util_make_url("/pm/t_lookup.php?text=1&amp;tid=" . $project_task_id); ?>">text/plain</a>
+        </td>
+		
 	</tr>
 
   	<tr>
@@ -235,6 +277,15 @@
 			<?php echo $pt->showHistory(); ?>
 		</td>
 	</tr>
+	
+	<tr>
+        <td colspan="3" style="text-align:center">
+              <strong><?php echo _('Copy to another Subproject'); ?>:</strong><br />
+              <?php echo $pg->groupProjectBox('copy_group_project_id',$group_project_id,false); ?>
+              <?php echo '<input type="submit" name="CopySubproject"i value="'._('Copy').'"'; ?>
+        </td>
+    </tr>
+	
 
 	<tr>
 		<td colspan="2" style="text-align:center">




More information about the evolvis-commits mailing list