[evolvis-commits] r17637: Backup commit. Switching Development Environment.

messer at evolvis.org messer at evolvis.org
Tue Oct 25 16:47:41 CEST 2011


Author: messer
Date: 2011-10-25 16:47:41 +0200 (Tue, 25 Oct 2011)
New Revision: 17637

Added:
   branches/evolvis-me/www/tracker/search.php
Removed:
   branches/evolvis-me/www/tracker/services/search.php
Modified:
   branches/evolvis-me/www/tracker/browse.php
   branches/evolvis-me/www/tracker/tracker.php
Log:
Backup commit. Switching Development Environment.

Modified: branches/evolvis-me/www/tracker/browse.php
===================================================================
--- branches/evolvis-me/www/tracker/browse.php	2011-10-25 14:46:36 UTC (rev 17636)
+++ branches/evolvis-me/www/tracker/browse.php	2011-10-25 14:47:41 UTC (rev 17637)
@@ -372,6 +372,54 @@
  * New advaced search begins here!
  */
 ?>
+<script>
+	$(function() {
+		function split( val ) {
+			return val.split( / \s*/ );
+		}
+		function extractLast( term ) {
+			return split( term ).pop();
+		}
+
+		$( "#birds" )
+			// don't navigate away from the field on tab when selecting an item
+			.bind( "keydown", function( event ) {
+				if ( event.keyCode === $.ui.keyCode.TAB &&
+						$( this ).data( "autocomplete" ).menu.active ) {
+					event.preventDefault();
+				}
+			})
+			.autocomplete({
+				source: function( request, response ) {
+					$.getJSON( "search.php?tracker_id=<?php echo $_GET['atid'];?>&cur_input=" + request.term, {
+						term: extractLast( request.term )
+					}, response );
+				},
+				search: function() {
+					// custom minLength
+					var term = extractLast( this.value );
+					if ( term.length < 0 ) {
+						return false;
+					}
+				},
+				focus: function() {
+					// prevent value inserted on focus
+					return false;
+				},
+				select: function( event, ui ) {
+					var terms = split( this.value );
+					// remove the current input
+					terms.pop();
+					// add the selected item
+					terms.push( ui.item.value );
+					// add placeholder to get the comma-and-space at the end
+					terms.push( "" );
+					this.value = terms.join( " " );
+					return false;
+				}
+			});
+	});
+	</script>
 <div class="ui-widget">
 	<label for="birds">Search Input: </label>
 	<input id="birds" />

Copied: branches/evolvis-me/www/tracker/search.php (from rev 17489, branches/evolvis-me/www/tracker/services/search.php)
===================================================================
--- branches/evolvis-me/www/tracker/search.php	                        (rev 0)
+++ branches/evolvis-me/www/tracker/search.php	2011-10-25 14:47:41 UTC (rev 17637)
@@ -0,0 +1,21 @@
+<?php
+
+require_once '/usr/share/gforge/common/advanced_search/FusionForgeDFIProvider.class.php';
+require_once '/usr/share/gforge/common/advanced_search/ASInputAnalyzer.class.php';
+//require_once '/usr/share/gforge/common/advanced_search/ASTokenizer.class.php';
+
+//Get the required paramters.
+$params = array();
+$params['tracker_id'] = $_GET['tracker_id'];
+
+$input = $_GET['cur_input'];
+
+$dfiProvider   = new FusionForgeDFIProvider();
+$inputAnalyzer = new ASInputAnalyzer();
+
+$inputAnalyzer->setDFIProvider($dfiProvider);
+
+$autoComplete = $inputAnalyzer->analyzeInput($input, $params);
+
+echo json_encode($autoComplete);
+?>

Modified: branches/evolvis-me/www/tracker/tracker.php
===================================================================
--- branches/evolvis-me/www/tracker/tracker.php	2011-10-25 14:46:36 UTC (rev 17636)
+++ branches/evolvis-me/www/tracker/tracker.php	2011-10-25 14:47:41 UTC (rev 17637)
@@ -288,6 +288,7 @@
 		$extra_fields = getStringFromRequest('extra_fields');
 		$was_error = false;
 		
+                
 		/*
 			Technicians can modify limited fields - to be certain
 			no one is hacking around, we override any fields they don't have
@@ -323,7 +324,7 @@
 
 			*/
 			if ($ath->userIsAdmin() || $ath->userIsTechnician()) {
-
+echo "Assigend to: ".$assigned_to."<br>Status id: ".$status_id."<br>canned_response:".$canned_response."<br>New At Id:".$new_artifact_type_id;
 				//admin and techs can do everything
 				//techs will have certain fields overridden inside the update() function call
 				if (!$ah->update($priority,$status_id,



More information about the evolvis-commits mailing list