Пример #1
0
 function ReportPrintPage(&$params)
 {
     parent::ReportPage($params);
     $this->crossTable = $this->pSet->isCrossTabReport() ? 1 : 0;
     $this->jsSettings['tableSettings'][$this->tName]['reportType'] = $this->crossTable;
     if (isRTL()) {
         $this->jsSettings['tableSettings'][$this->tName]['isRTL'] = true;
     }
     $this->jsSettings['tableSettings'][$this->tName]['reportPrintPartitionType'] = $this->pSet->getReportPrintPartitionType();
     $this->jsSettings['tableSettings'][$this->tName]['reportPrintGroupsPerPage'] = $this->pSet->getReportPrintGroupsPerPage();
     $this->jsSettings['tableSettings'][$this->tName]['reportPrintLayout'] = $this->pSet->getReportPrintLayout();
     $this->jsSettings['tableSettings'][$this->tName]['lowGroup'] = $this->pSet->getLowGroup();
     $this->jsSettings['tableSettings'][$this->tName]['printerPagePDF'] = $this->pSet->isPrinterPagePDF();
     $this->jsSettings['tableSettings'][$this->tName]['printerPageOrientation'] = $this->pSet->getPrinterPageOrientation();
     $this->jsSettings['tableSettings'][$this->tName]['printerPageScale'] = $this->pSet->getPrinterPageScale();
     $this->jsSettings['tableSettings'][$this->tName]['isPrinterPageFitToPage'] = $this->pSet->isPrinterPageFitToPage();
     $this->jsSettings['tableSettings'][$this->tName]['printerSplitRecords'] = $this->pSet->getPrinterSplitRecords();
     $this->jsSettings['tableSettings'][$this->tName]['printerPDFSplitRecords'] = $this->pSet->getPrinterPDFSplitRecords();
 }
Пример #2
0
 function ReportPrintPage(&$params)
 {
     parent::ReportPage($params);
     $this->crossTable = $this->pSet->isCrossTabReport() ? 1 : 0;
     $this->jsSettings['tableSettings'][$this->tName]['reportType'] = $this->crossTable;
     if ($this->pdfMode) {
         //	pdf mode
         if ($this->pSet->getReportPrintPDFGroupsPerPage() != 0) {
             $this->splitAtServer = true;
             $this->splitByGroups = $this->pSet->getReportPrintPDFGroupsPerPage();
         }
     } else {
         if ($this->format == "excel" || $this->format == "word") {
             //	export mode
             $this->splitAtServer = false;
             $this->splitByGroups = 0;
         } else {
             //	print mode
             if ($this->pSet->getReportPrintPartitionType() != 0) {
                 $this->splitAtServer = true;
                 $this->splitByGroups = $this->pSet->getReportPrintGroupsPerPage();
             }
         }
     }
     if (isRTL()) {
         $this->jsSettings['tableSettings'][$this->tName]['isRTL'] = true;
     }
     $this->jsSettings['tableSettings'][$this->tName]['reportPrintPartitionType'] = $this->pSet->getReportPrintPartitionType();
     $this->jsSettings['tableSettings'][$this->tName]['reportPrintGroupsPerPage'] = $this->pSet->getReportPrintGroupsPerPage();
     $this->jsSettings['tableSettings'][$this->tName]['reportPrintLayout'] = $this->pSet->getReportPrintLayout();
     $this->jsSettings['tableSettings'][$this->tName]['lowGroup'] = $this->pSet->getLowGroup();
     $this->jsSettings['tableSettings'][$this->tName]['printerPagePDF'] = $this->pSet->isPrinterPagePDF();
     $this->jsSettings['tableSettings'][$this->tName]['printerPageOrientation'] = $this->pSet->getPrinterPageOrientation();
     $this->jsSettings['tableSettings'][$this->tName]['printerPageScale'] = $this->pSet->getPrinterPageScale();
     $this->jsSettings['tableSettings'][$this->tName]['isPrinterPageFitToPage'] = $this->pSet->isPrinterPageFitToPage();
     if ($this->pSet->getReportPrintPartitionType() == 0) {
         $this->jsSettings['tableSettings'][$this->tName]['printerSplitRecords'] = 0;
     } else {
         $this->jsSettings['tableSettings'][$this->tName]['printerSplitRecords'] = $this->pSet->getReportPrintGroupsPerPage();
     }
     $this->jsSettings['tableSettings'][$this->tName]['printerPDFSplitRecords'] = $this->pSet->getReportPrintPDFGroupsPerPage();
 }
			$options["mainMasterPageType"] = PAGE_VIEW;
			$options['masterTable'] = "webreport_users";
			$options['firstTime'] = 1;
			
			$strTableName = $dpParams['strTableNames'][$d];
			include_once("include/".GetTableURL($strTableName)."_settings.php");
			if(!CheckSecurity(@$_SESSION["_".$strTableName."_OwnerID"],"Search"))
			{
				$strTableName = "webreport_users";
				continue;
			}
			
			$layout = GetPageLayout(GoodFieldName($strTableName), PAGE_LIST);
			if($layout)
			{
				$pageObject->AddCSSFile($layout->getCSSFiles(isRTL(), isMobile()));
			}
			
			$options['xt'] = new Xtempl( true ); //#9607 1. Temporary fix
			$options['id'] = $dpParams['ids'][$d];
			$options['flyId'] = $pageObject->genId()+1;
			$mkr = 1;
			foreach($mKeys[$strTableName] as $mk)
			{
				$options['masterKeysReq'][$mkr++] = $data[$mk];
			}

			$listPageObject = ListPage::createListPage($strTableName, $options);
			
			// prepare code
			$listPageObject->prepareForBuildPage();
            $class = ' rnr-field-checkbox';
        }
        if ($format == FORMAT_NUMBER || IsNumberType($pSet->getFieldType("LastUpdate"))) {
            $class = ' rnr-field-number';
        }
        $row["LastUpdate_class"] = $class;
        $rowinfo[] = $row;
        if ($b) {
            $rowinfo2[] = $row;
            $b = false;
        }
        $data = $cipherer->DecryptFetchedArray($qResult->fetchAssoc());
    }
    $xt->assign_loopsection("details_row", $rowinfo);
    $xt->assign_loopsection("details_row_header", $rowinfo2);
    // assign class for header
}
$returnJSON = array("success" => true);
$xt->load_template(GetTemplateName("StockMaster", "detailspreview"));
$returnJSON["body"] = $xt->fetch_loaded();
if ($mode != "inline") {
    $returnJSON["counter"] = postvalue("counter");
    $layout = GetPageLayout(GoodFieldName($strTableName), 'detailspreview');
    if ($layout) {
        foreach ($layout->getCSSFiles(isRTL(), isMobile()) as $css) {
            $returnJSON['CSSFiles'][] = $css;
        }
    }
}
echo printJSON($returnJSON);
exit;
Пример #5
0
 protected function prepareJsSettings()
 {
     if (isRTL()) {
         $this->jsSettings['tableSettings'][$this->tName]['isRTL'] = true;
     }
     if ($this->pSet->isPrinterPagePDF()) {
         $this->jsSettings['tableSettings'][$this->tName]['printerPagePDF'] = true;
     }
     $this->jsSettings['tableSettings'][$this->tName]['printerPageOrientation'] = $this->pSet->getPrinterPageOrientation();
     $this->jsSettings['tableSettings'][$this->tName]['printerPageScale'] = $this->pSet->getPrinterPageScale();
     $this->jsSettings['tableSettings'][$this->tName]['isPrinterPageFitToPage'] = $this->pSet->isPrinterPageFitToPage();
     $this->jsSettings['tableSettings'][$this->tName]['printerSplitRecords'] = $this->pSet->getPrinterSplitRecords();
     $this->jsSettings['tableSettings'][$this->tName]['printerPDFSplitRecords'] = $this->pSet->getPrinterPDFSplitRecords();
     $printGridLayout = $this->pSet->getPrintGridLayout();
     if ($printGridLayout) {
         $this->jsSettings['tableSettings'][$this->tName]['printGridLayout'] = $printGridLayout;
     }
 }
Пример #6
0
 /**
  * @param Boolean hideAddedCharts (optional) #9607 1.
  */
 function XTempl($hideAddedCharts = false)
 {
     global $mlang_charsets;
     $this->xt_vars = array();
     $this->xt_stack = array();
     $this->xt_stack[] =& $this->xt_vars;
     if (!isMobile()) {
         xtempl_include_header($this, "header", "include/header.php");
         xtempl_include_header($this, "footer", "include/footer.php");
     } else {
         xtempl_include_header($this, "header", "include/mheader.php");
         xtempl_include_header($this, "footer", "include/mfooter.php");
     }
     $this->assign_method("event", $this, "xt_doevent", array());
     $this->assign_function("label", "xt_label", array());
     $this->assign_function("custom", "xt_custom", array());
     $this->assign_function("caption", "xt_caption", array());
     $this->assign_function("pagetitlelabel", "xt_pagetitlelabel", array());
     $this->assign_method("mainmenu", $this, "xt_displaymainmenu", array());
     $this->assign_method("menu", $this, "xt_displaymenu", array());
     $this->assign_function("TabGroup", "xt_displaytabs", array());
     $this->assign_function("Section", "xt_displaytabs", array());
     if (!$hideAddedCharts) {
     }
     $mlang_charsets = array();
     $mlang_charsets["Spanish"] = "Windows-1252";
     $this->charsets =& $mlang_charsets;
     $html_attrs = '';
     if (isRTL()) {
         $this->assign("RTL_block", true);
         $this->assign("rtlCSS", true);
         $html_attrs .= 'dir="RTL" ';
     } else {
         $this->assign("LTR_block", true);
     }
     if (mlang_getcurrentlang() == 'English') {
         $html_attrs .= 'lang="en"';
     }
     $this->assign("html_attrs", $html_attrs);
     $this->assign("menu_block", true);
 }
Пример #7
0
function htmlTag($locale)
{
    // Initialize the tag
    $html = '<html xml:lang="' . $locale . '" lang="' . $locale . '" dir="';
    // Set the good text direction
    $html .= isRTL($locale) ? 'rtl' : 'ltr';
    // Close the tag
    $html .= '">';
    echo $html;
}
Пример #8
0
 /**
  * Add detail JS and CSS files to the master's files list
  * @param &RunnerPage dtPageObject
  */
 protected function copyDetailPreviewJSAndCSS(&$dtPageObject)
 {
     $layout = GetPageLayout(GoodFieldName($dtPageObject->tName), $dtPageObject->pageType);
     if ($layout) {
         $this->AddCSSFile($layout->getCSSFiles(isRTL(), isPageLayoutMobile($this->templatefile)));
     }
     //Add detail's js files to master's files
     $this->copyAllJSFiles($dtPageObject->grabAllJSFiles());
     //Add detail's css files to master's files
     $this->copyAllCSSFiles($dtPageObject->grabAllCSSFiles());
 }
Пример #9
0
 /**
  * @param Boolean hideAddedCharts (optional) #9607 1.
  */
 function XTempl($hideAddedCharts = false)
 {
     global $mlang_charsets;
     $this->xt_vars = array();
     $this->xt_stack = array();
     $this->xt_stack[] =& $this->xt_vars;
     if (!isMobile()) {
         xtempl_include_header($this, "header", "include/header.php");
         xtempl_include_header($this, "footer", "include/footer.php");
     } else {
         xtempl_include_header($this, "header", "include/mheader.php");
         xtempl_include_header($this, "footer", "include/mfooter.php");
     }
     $this->assign_method("event", $this, "xt_doevent", array());
     $this->assign_function("label", "xt_label", array());
     $this->assign_function("custom", "xt_custom", array());
     $this->assign_function("caption", "xt_caption", array());
     $this->assign_function("pagetitlelabel", "xt_pagetitlelabel", array());
     $this->assign_method("mainmenu", $this, "xt_displaymainmenu", array());
     $this->assign_method("menu", $this, "xt_displaymenu", array());
     $this->assign_function("TabGroup", "xt_displaytabs", array());
     $this->assign_function("Section", "xt_displaytabs", array());
     if (!$hideAddedCharts) {
         $this->assign_function("Current_Year_Sales_chart", "xt_showchart", array("chartname" => "Current_Year_Sales", "table" => "Current Year Sales", "ctype" => "Line"));
         $this->assign_function("Sales_By_SalesPerson_Chart_chart", "xt_showchart", array("chartname" => "Sales_By_SalesPerson_Chart", "table" => "Sales By SalesPerson Chart", "ctype" => "2DBar"));
         $this->assign_function("Sales_By_Department_chart", "xt_showchart", array("chartname" => "Sales_By_Department", "table" => "Sales By Department", "ctype" => "2DBar"));
         $this->assign_function("Current___Last_Year_Sales_Comparison_chart", "xt_showchart", array("chartname" => "Current___Last_Year_Sales_Comparison", "table" => "Current - Last Year Sales Comparison", "ctype" => "2DColumn"));
         $this->assign_function("Current___Last_Year_GP_Comparison_chart", "xt_showchart", array("chartname" => "Current___Last_Year_GP_Comparison", "table" => "Current - Last Year GP Comparison", "ctype" => "2DColumn"));
         $this->assign_function("Current___Last_Year_GP___Comparison_chart", "xt_showchart", array("chartname" => "Current___Last_Year_GP___Comparison", "table" => "Current - Last Year GP % Comparison", "ctype" => "2DColumn"));
         $this->assign_function("Fact_SalesTransaction_Chart_chart", "xt_showchart", array("chartname" => "Fact_SalesTransaction_Chart", "table" => "Fact_SalesTransaction Chart", "ctype" => "2DColumn"));
         $this->assign_function("Top_Selling_Products_Current_Year_chart", "xt_showchart", array("chartname" => "Top_Selling_Products_Current_Year", "table" => "Top Selling Products Current Year", "ctype" => "2DBar"));
         $this->assign_function("Worst_Selling_Products_Current_Year_chart", "xt_showchart", array("chartname" => "Worst_Selling_Products_Current_Year", "table" => "Worst Selling Products Current Year", "ctype" => "2DBar"));
         $this->assign_function("Non_Selling_Products_with_Stock_Current_Year_chart", "xt_showchart", array("chartname" => "Non_Selling_Products_with_Stock_Current_Year", "table" => "Non Selling Products with Stock Current Year", "ctype" => "2DBar"));
         $this->assign_function("Top_Grossing_Products_YTD_chart", "xt_showchart", array("chartname" => "Top_Grossing_Products_YTD", "table" => "Top Grossing Products YTD", "ctype" => "2DBar"));
     }
     $mlang_charsets = array();
     $mlang_charsets["English"] = "Windows-1252";
     $this->charsets =& $mlang_charsets;
     $html_attrs = '';
     if (isRTL()) {
         $this->assign("RTL_block", true);
         $this->assign("rtlCSS", true);
         $html_attrs .= 'dir="RTL" ';
     } else {
         $this->assign("LTR_block", true);
     }
     if (mlang_getcurrentlang() == 'English') {
         $html_attrs .= 'lang="en"';
     }
     $this->assign("html_attrs", $html_attrs);
     $this->assign("menu_block", true);
 }
Пример #10
0
	/**
	 * Calcs pagination info
	 *
	 * @intellisense
	 */
	function buildPagination() 
	{
		//	hide colunm headers if needed
		if($this->pageSize && $this->pageSize!=-1)
			$this->maxPages = ceil($this->numRowsFromSQL / $this->pageSize);
		if($this->myPage > $this->maxPages)
			$this->myPage = $this->maxPages;
		if($this->myPage < 1)
			$this->myPage = 1;
		$this->recordsOnPage = $this->numRowsFromSQL -($this->myPage - 1) * $this->pageSize;
		if($this->recordsOnPage > $this->pageSize && $this->pageSize!=-1)
			$this->recordsOnPage = $this->pageSize;
		
		$this->colsOnPage = $this->recsPerRowList;
		if($this->colsOnPage > $this->recordsOnPage && $this->listGridLayout != gltVERTICAL)
			$this->colsOnPage = $this->recordsOnPage;
		if($this->colsOnPage < 1)
			$this->colsOnPage = 1;
			
		//	 Pagination:
		if((! $this->numRowsFromSQL) && ($this->deleteMessage == ''))
		{
			$this->rowsFound = false;
			$message = ($this->is508 == true ? "<a name=\"skipdata\"></a>" : "")."No records found";
			$message= "<span name=\"notfound_message".$this->id."\">".$message."</span>";
			$this->xt->assign("message",$message);
			$this->xt->assign("message_block",true);
			
			if($this->listAjax || $this->mode == LIST_LOOKUP){
				$this->xt->assign("pagination_block", true);
				$this->xt->displayBrickHidden("pagination");
			}
		} 
		else
		{
			$this->rowsFound = true;
			$this->xt->assign("message_block",false);
			if($this->listAjax || $this->mode == LIST_LOOKUP){
				$this->xt->assign("message_block",true);
				$this->xt->displayBrickHidden("message");
			}
			else if ($this->deleteMessage != ''){
				$this->xt->assign("message_block",true);
			}
			
			$this->xt->assign("records_found", $this->numRowsFromSQL);
			$this->jsSettings["tableSettings"][$this->tName]['maxPages'] = $this->maxPages;
			$this->maxRecs = $this->pageSize;
			$this->xt->assign("page", $this->myPage);
			$this->xt->assign("maxpages", $this->maxPages);
			
			$this->xt->assign("pagination_block", false);
			
			//	write pagination
			if($this->maxPages > 1) 
			{
				$this->xt->assign("pagination_block", true);
				/*$pagination = "<table rows='1' cols='1' align='center' width='auto' border='0' name='paginationTable".$this->id."'>";
				$pagination.= "<tr valign='center'><td align='center'>";*/
				$pagination = '';
				$counterstart = $this->myPage - 9;
				if($this->myPage % 10 != 0)
					$counterstart = $this->myPage -($this->myPage % 10) + 1;
				$counterend = $counterstart + 9;
				if($counterend > $this->maxPages)
					$counterend = $this->maxPages;
				if($counterstart != 1) 
				{
					$pagination.= $this->getPaginationLink(1,"First")."&nbsp;:&nbsp;";
					$pagination.= $this->getPaginationLink($counterstart - 1,"Previous")."&nbsp;";
				}
				$pagination.= "<b>[</b>";
				
				if(isRTL())
				{
					for($counter = $counterend; $counter >= $counterstart; $counter --) 
					{
						if($counter != $this->myPage)
							$pagination.= "&nbsp;".$this->getPaginationLink($counter,$counter,true);
						else
							$pagination.= "&nbsp;<b>".$counter."</b>";
					}
				}
				else
				{
					for($counter = $counterstart; $counter <= $counterend; $counter ++) 
					{
						if($counter != $this->myPage)
							$pagination.= "&nbsp;".$this->getPaginationLink($counter,$counter,true);
						else
							$pagination.= "&nbsp;<b>".$counter."</b>";
					}
				}
				
				$pagination.= "&nbsp;<b>]</b>";
				if($counterend != $this->maxPages) 
				{
					$pagination.= "&nbsp;".$this->getPaginationLink($counterend + 1,"Next")."&nbsp;:&nbsp;";
					$pagination.= $this->getPaginationLink($this->maxPages,"Last");
				}
				/*$pagination.= "</td></tr></table>";*/
				$this->xt->assign("pagination", $pagination);
			}
			else
			{
							if($this->listAjax || $this->mode == LIST_LOOKUP){
					$this->xt->assign("pagination_block", true);
					$this->xt->displayBrickHidden("pagination");
				}
			}
		}
	}