Browse Source

#785 Share the results of a query phrase (preview of the results in the query details page -iif it has NO parameter)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2923 a333f486-631f-4898-b8df-5754b55c2be0
romainq 11 năm trước cách đây
mục cha
commit
4f4a2d1abb
1 tập tin đã thay đổi với 14 bổ sung6 xóa
  1. 14 6
      application/query.class.inc.php

+ 14 - 6
application/query.class.inc.php

@@ -103,17 +103,25 @@ class QueryOQL extends Query
 				{
 					$sUrl .= '&arg_'.$sParam.'=["'.$sParam.'"]';
 				}
+
+				$oPage->p(Dict::S('UI:Query:UrlForExcel').':<br/><textarea cols="80" rows="3" READONLY>'.$sUrl.'</textarea>');
+
+				if (count($aParameters) == 0)
+				{
+					$oBlock = new DisplayBlock($oSearch, 'list');
+					$aExtraParams = array(
+						//'menu' => $sShowMenu,
+						'table_id' => 'query_preview_'.$this->getKey(),
+					);
+					$sBlockId = 'block_query_preview_'.$this->GetKey(); // make a unique id (edition occuring in the same DOM)
+					$oBlock->Display($oPage, $sBlockId, $aExtraParams);
+				}
 			}
 			catch (OQLException $e)
 			{
 				$sMessage = '<div class="message message_error" style="padding-left: 30px;"><div style="padding: 10px;">'.Dict::Format('UI:RunQuery:Error', $e->getHtmlDesc()).'</div></div>';
-			}
-
-			$oPage->p(Dict::S('UI:Query:UrlForExcel').':<br/><textarea cols="80" rows="3" READONLY>'.$sUrl.'</textarea>');
-			if (!is_null($sMessage))
-			{
 				$oPage->p($sMessage);
-			}		
+			}
 		}
 		return $aFieldsMap;
 	}