Explorar o código

Printable view: do not show pagination controls (show the full list), must work with plugins calling cmdbAbstractObject::DiplaySet AND cmdbAbstractObjectObject::GetDisplaySet. Sill, GetDisplayExtendedSet should be hacked as well (?)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3690 a333f486-631f-4898-b8df-5754b55c2be0
romainq %!s(int64=9) %!d(string=hai) anos
pai
achega
b7ed3bd0ea
Modificáronse 1 ficheiros con 9 adicións e 11 borrados
  1. 9 11
      application/cmdbabstract.class.inc.php

+ 9 - 11
application/cmdbabstract.class.inc.php

@@ -769,25 +769,18 @@ EOF
 	
 	public static function DisplaySet(WebPage $oPage, CMDBObjectSet $oSet, $aExtraParams = array())
 	{
-		if ($oPage->is_pdf())
-		{
-			$oPage->add(self::DisplaySetForPrinting($oPage, $oSet, $aExtraParams));
-		}
-		else
-		{
-			$oPage->add(self::GetDisplaySet($oPage, $oSet, $aExtraParams));
-		}
+		$oPage->add(self::GetDisplaySet($oPage, $oSet, $aExtraParams));
 	}
 	
 	/**
 	 * Simplifed version of GetDisplaySet() with less "decoration" around the table (and no paging)
-	 * that fits better into a printed document (like a PDF)
-	 * @param PDFPage $oPage
+	 * that fits better into a printed document (like a PDF or a printable view)
+	 * @param WebPage $oPage
 	 * @param DBObjectSet $oSet
 	 * @param hash $aExtraParams
 	 * @return string The HTML representation of the table
 	 */
-	public static function DisplaySetForPrinting(PDFPage $oPage, DBObjectSet $oSet, $aExtraParams = array())
+	public static function GetDisplaySetForPrinting(WebPage $oPage, DBObjectSet $oSet, $aExtraParams = array())
 	{
 		$iListId = empty($aExtraParams['currentId']) ? $oPage->GetUniqueId() : $aExtraParams['currentId'];
 		$sTableId = isset($aExtraParams['table_id']) ? $aExtraParams['table_id'] : null;
@@ -819,6 +812,11 @@ EOF
 	 */	
 	public static function GetDisplaySet(WebPage $oPage, CMDBObjectSet $oSet, $aExtraParams = array())
 	{
+		if ($oPage->IsPrintableVersion() || $oPage->is_pdf())
+		{
+			return self::GetDisplaySetForPrinting($oPage, $oSet, $aExtraParams);
+		}
+
 		if (empty($aExtraParams['currentId']))
 		{
 			$iListId = $oPage->GetUniqueId(); // Works only if not in an Ajax page !!