[evolvis-commits] r17724: //backup

papel at evolvis.org papel at evolvis.org
Fri Nov 25 14:55:26 CET 2011


Author: papel
Date: 2011-11-25 14:55:26 +0100 (Fri, 25 Nov 2011)
New Revision: 17724

Modified:
   branches/papel-51/www/include/html.php
   branches/papel-51/www/pm/include/ProjectView.class.php
   branches/papel-51/www/pm/templates/detail_template.php
   branches/papel-51/www/themes/css/tasks.css
Log:
//backup

Modified: branches/papel-51/www/include/html.php
===================================================================
--- branches/papel-51/www/include/html.php	2011-11-24 16:26:14 UTC (rev 17723)
+++ branches/papel-51/www/include/html.php	2011-11-25 13:55:26 UTC (rev 17724)
@@ -922,6 +922,10 @@
 	return '<input type="submit" name="'.$name.'" value="'.$value.'" />';
 }
 
+function html_build_textarea($name, $rows, $cols) {
+	return '<textarea name="'.$name.'" rows="'.$rows.'" cols="'.$cols.'"></textarea>';
+} 
+
 /**
  *	html_build_form_start_tag() - Render form start tag control. The variables $encrypt and 
  *	$acceptCharset have already the default value that will be used if the attributes are not added

Modified: branches/papel-51/www/pm/include/ProjectView.class.php
===================================================================
--- branches/papel-51/www/pm/include/ProjectView.class.php	2011-11-24 16:26:14 UTC (rev 17723)
+++ branches/papel-51/www/pm/include/ProjectView.class.php	2011-11-25 13:55:26 UTC (rev 17724)
@@ -25,6 +25,7 @@
 /* Loads the template and includes the data from the controller and postmodtaskel into the template */
 
 // require_once $gfwww.'include/html.php';
+// require_once $gfcommon.'include/TextSanitizer.class.php';
 require_once $gfcommon.'include/datepick.php';
 require_once $gfcommon.'include/utils.php';
 
@@ -219,12 +220,43 @@
 		}
 	}
 	
+	public function showAddCommentBox() {
+		
+		$GLOBALS['editor_was_set_up']=false;
+		$params = array('name' => 'details', 'width' => '800', 'height' => '300', 'body' => '', 'group' => $this->getProjectTaskHTML()->getProjectGroup()->getGroup()->getID());
+		plugin_hook('text_editor',$params);
+		if (!$GLOBALS['editor_was_set_up']) {
+			return html_build_textarea('details', 5, 80);
+		}
+		unset($GLOBALS['editor_was_set_up']);
+	}
+	
 	public function showComments() {
+		
+			$sanitizer = new TextSanitizer();
+        	$body = $sanitizer->SanitizeHtml($this->getProjectTaskHTML()->getDetails());
+		
 		switch($this->getPageView()) {
 			case 'postmodtask':
-			return html_build_textbox('details', $this->getProjectTaskHTML()->getDetails());
+
+			
+			if (strpos($body,'<') === false) {
+				return nl2br($this->getProjectTaskHTML()->getDetails());
+			} else {
+				return $body;
+			} 
+
+
 			case 'detailtask':
-			return $this->getProjectTaskHTML()->getDetails();
+			
+			
+			if (strpos($body,'<') === false) {
+				return nl2br($this->getProjectTaskHTML()->getDetails());
+			} else {
+				return $body;
+			} 
+			
+			//return $this->getProjectTaskHTML()->getDetails();
 			case 'postaddtask':
 			return;
 		}
@@ -297,13 +329,12 @@
 		}
 	}
 	
-	//later
 	public function showCalendar() {
 		switch($this->getPageView()) {
 			case 'postmodtask':
-			return;
+			return util_make_link('pm/calendar.php?group_id='.$this->getProjectTaskHTML()->getProjectGroup()->getGroup()->getID().'&group_project_id='.$this->getProjectTaskHTML()->getProjectGroup()->getID(), _('View Calendar'), array('target' => '_blank'));
 			case 'detailtask':
-			return;
+			return util_make_link('pm/calendar.php?group_id='.$this->getProjectTaskHTML()->getProjectGroup()->getGroup()->getID().'&group_project_id='.$this->getProjectTaskHTML()->getProjectGroup()->getID(), _('View Calendar'), array('target' => '_blank'));
 			case 'postaddtask':
 			return;
 		}
@@ -327,20 +358,22 @@
 	public function showPermaLink() {
 		switch($this->getPageView()) {
 			case 'postmodtask':
-			return;
+			return util_make_link('pm/t_follow.php/'.$this->getProjectTaskHTML()->getID(), util_make_url('/pm/t_follow_php/'.$this->getProjectTaskHTML()->getID()));
 			case 'detailtask':
-			return;
+			return util_make_link('pm/t_follow.php/'.$this->getProjectTaskHTML()->getID(), util_make_url('/pm/t_follow_php/'.$this->getProjectTaskHTML()->getID()));
 			case 'postaddtask':
 			return;
 		}
 	}
 	
-	public function showTaskdetailtaskInfo() {
+	public function showTaskDetailInfo() {
 		switch($this->getPageView()) {
 			case 'postmodtask':
-			return;
+			return util_make_link('/pm/t_lookup.php?tid='.$this->getProjectTaskHTML()->getID(),'application/json') . ' / ' 
+			.util_make_link('/pm/t_lookup.php?text=1&tid='.$this->getProjectTaskHTML()->getID(),'text/plain');
 			case 'detailtask':
-			return;
+			return util_make_link('/pm/t_lookup.php?tid='.$this->getProjectTaskHTML()->getID(),'application/json') . ' / ' 
+			.util_make_link('/pm/t_lookup.php?text=1&tid='.$this->getProjectTaskHTML()->getID(),'text/plain');
 			case 'postaddtask':
 			return;
 		}
@@ -361,15 +394,12 @@
 	 * Field only available for managers
 	 */
 	public function showCopyTaskFunc() {
-		/*	<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" value="'._('Copy').'" onclick="document.forms[0].func.value = \'copytask\';" />'; ?>
-		 */
 		switch($this->getPageView()) {
 			case 'postmodtask':
-			return;
+			return $this->getProjectGroupHTML()->groupProjectBox('copy_group_project_id', $this->getProjectTaskHTML()->getProjectGroup()->getID(), false). ' ' .
+			'<input type="submit" name="CopySubproject" value="'._('Copy').'" onclick="document.forms[0].func.value = \'copytask\';" />';
 			case 'detailtask':
-			return;
+			return '';
 			case 'postaddtask':
 			return;
 		}
@@ -378,20 +408,20 @@
 	public function showSubscribeLink() {
 		switch($this->getPageView()) {
 			case 'postmodtask':
-			return;
+			return util_make_link('/export/rssAboTask.php?tid='.$this->getProjectTaskHTML()->getID(), html_image('ic/rss.png',16, 16, array('border' => '0')) . '' . _('Subscribe to task'));
 			case 'detailtask':
-			return '';
+			return util_make_link('/export/rssAboTask.php?tid='.$this->getProjectTaskHTML()->getID(), html_image('ic/rss.png',16, 16, array('border' => '0')) . '' . _('Subscribe to task'));
 			case 'postaddtask':
 			return '';
-		} 
+		}
 	}
 	
 	public function showDeleteLink() {
 		switch($this->getPageView()) {
 			case 'postmodtask':
-			return;
+			return util_make_link($this->getUri().'?func=deletetask&group_id='.$this->getProjectTaskHTML()->getProjectGroup()->getGroup()->getID().'&group_project_id='.$this->getProjectTaskHTML()->getProjectGroup()->getID().'&project_task_id='.$this->getProjectTaskHTML()->getID(), html_image('ic/trash.png',16, 16, array('border' => '0')) . '' . _('Delete this task'));
 			case 'detailtask':
-			return;
+			return util_make_link($this->getUri().'?func=deletetask&group_id='.$this->getProjectTaskHTML()->getProjectGroup()->getGroup()->getID().'&group_project_id='.$this->getProjectTaskHTML()->getProjectGroup()->getID().'&project_task_id='.$this->getProjectTaskHTML()->getID(), html_image('ic/trash.png',16, 16, array('border' => '0')) . '' . _('Delete this task'));
 			case 'postaddtask':
 			return;
 		}

Modified: branches/papel-51/www/pm/templates/detail_template.php
===================================================================
--- branches/papel-51/www/pm/templates/detail_template.php	2011-11-24 16:26:14 UTC (rev 17723)
+++ branches/papel-51/www/pm/templates/detail_template.php	2011-11-25 13:55:26 UTC (rev 17724)
@@ -22,11 +22,11 @@
 			<div class="smallTaskContainer">
 				<?php echo _('Assigned to'); ?>
 					<br />
-					<div class="checkBoxTaskContainer">
-						<div class="checkBoxInnerContainer">
-							<?php echo $this->showAssignedTo(); ?>
-						</div>
-					</div>	
+				<div class="checkBoxTaskContainer">
+					<div class="checkBoxInnerContainer">
+						<?php echo $this->showAssignedTo(); ?>
+					</div>
+				</div>	
 			</div>
 		</div>
 
@@ -42,8 +42,6 @@
 				<?php echo $this->showEndDate(); ?>
 			</div>	
 			<div class="smallTaskContainer">
-				<?php echo _('View Calendar'); ?>
-					<br />
 				<?php echo $this->showCalendar(); ?>
 			</div>
 			<div class="smallTaskContainer">
@@ -68,7 +66,7 @@
 				<div class="smallTaskContainer">
 					<?php echo _('Task Detail Information'); ?>
 						<br />
-					<?php echo $this->showTaskdetailtaskInfo(); ?>
+					<?php echo $this->showTaskDetailInfo(); ?>
 				</div>
 				<div class="smallTaskContainer">
 					<?php echo _('Subproject'); ?>
@@ -78,14 +76,16 @@
 				<div class="smallTaskContainer">
 					<?php echo $this->showSubscribeLink(); ?>
 				</div>
-	
+				<div class="smallTaskContainer">
+					<?php echo $this->showDeleteLink(); ?>
+				</div>
 				<?php if($this->getPageView()=='postmodtask') {?>
 					<div class="smallTaskContainer">
-						<?php echo _('Copy to another Subproject'); ?></div>
-					<div class="smallTaskContainer">
-						<?php echo $this->showCopyTaskFunc(); ?></div>
+						<?php echo _('Copy to another Subproject'); ?>
+							<br />
+						<?php echo $this->showCopyTaskFunc(); ?>
+					</div>
 				<?php }?>
-		
 				<br /><br />
 				<div class="taskSubmitButtonContainer"><?php echo $this->showSubmitButton(); ?></div>
 			</div>
@@ -93,7 +93,7 @@
 	<?php echo $this->getHTML()->boxBottom(); ?>
 </div>		
 
-<div class="descriptionTaskContainer">
+<div id="descriptionTaskContainer">
 	<?php echo $this->getHTML()->boxTop(_('Description'), 'description', false, 'toplev_about'); ?>
 		<div class="bigTaskContainer">
 			<div class="smallTaskContainer">
@@ -102,26 +102,42 @@
 				<?php echo $this->showSummary(); ?>
 			</div>
 		</div>
-		
-		<div class="bigTaskContainer">
+		<div class="bigTaskContainer">	
 			<div class="smallTaskContainer">
-				<?php echo _('Summary'); ?>
+				<?php echo _('Details'); ?>
 					<br />
 				<?php echo $this->showComments(); ?>
 			</div>
+			
+			<div class="smallTaskContainer">
+				<?php echo $this->showAddCommentBox(); ?>
+			</div>
+			
+			<br /><br />
+			<div class="taskSubmitButtonContainer"><?php echo $this->showSubmitButton(); ?></div>
 		</div>	
 	<?php echo $this->getHTML()->boxBottom(); ?>
 </div>
 
-<div class="linkTaskContainer">
+<div id="linkTaskContainer">
 	<?php echo $this->getHTML()->boxTop(_('Link'), 'link', false, 'toplev_about'); ?>
-		<div></div>
+		<div class="bigTaskContainer">
+			<div class="smallTaskContainer">
+				 
+			</div>
+			<br /><br />
+			<div class="taskSubmitButtonContainer"><?php echo $this->showSubmitButton(); ?></div>
+		</div>
 	<?php echo $this->getHTML()->boxBottom(); ?>
 </div>
 
-<div class="protocolTaskContainer">
+<div id="protocolTaskContainer">
 	<?php echo $this->getHTML()->boxTop(_('Change protocol'), 'protocol', false, 'toplev_about'); ?>
-		<div></div>
+		<div class="bigTaskContainer">
+			<div class="smallTaskContainer">
+				 
+			</div>
+		</div>
 	<?php echo $this->getHTML()->boxBottom(); ?>
 </div>
 

Modified: branches/papel-51/www/themes/css/tasks.css
===================================================================
--- branches/papel-51/www/themes/css/tasks.css	2011-11-24 16:26:14 UTC (rev 17723)
+++ branches/papel-51/www/themes/css/tasks.css	2011-11-25 13:55:26 UTC (rev 17724)
@@ -1,21 +1,21 @@
 #detailTaskContainer {
 	border: 1px solid #c7c7c7;
-	background-color:#f4f4f4;
+	background-color:#ffffff;
 }
 
 #descriptionTaskContainer {
 	border: 1px solid #c7c7c7;
-	background-color:#f4f4f4;
+	background-color:#ffffff;
 }
 
 #linkTaskContainer {
 	border: 1px solid #c7c7c7;
-	background-color:#f4f4f4;
+	background-color:#ffffff;
 }
 
 #protocolTaskContainer {
 	border: 1px solid #c7c7c7;
-	background-color:#f4f4f4;
+	background-color:#ffffff;
 }
 
 .checkBoxTaskContainer {
@@ -27,17 +27,18 @@
 
 .checkBoxInnerContainer {
 	width:200px;
+	background-color:#ffffff;
 }
 
 .bigTaskContainer {
 	float:left;
 	padding:1em;
-	background-color:#f4f4f4;
+	background-color:#ffffff;
 }
 
 .smallTaskContainer {
 	padding:1em;
-	background-color:#ffffff;
+	background-color:#f4f4f4;
 }
 
 .taskSubmitButtonContainer {



More information about the evolvis-commits mailing list