/** * Set up by customInfo: * - Header list * - Action menu * @param customInfo includes acl and customInfo. */ public function setupByCustomInfo($customInfo) { //Prepare customInfo $acl = $customInfo['acl']; $listInfo = $customInfo['listInfo']->getColList(); //build a map of currentView first. $this->headerListMap = array(); $this->customColMap = array(); $this->headerList = array(); //Allocating width based on total width minus a margin. $tot = 0; foreach ($listInfo as $col) { $tot += $col->getWidth(); } foreach ($listInfo as $col) { if ($acl[$col->getId()]) { continue; } //skip fields that in the acl. $w = CalemReportUtil::getColWidth($tot, $col->getWidth()); $col->setWidth($w); $this->customColMap[$col->getId()] = $col; $this->addColumn($col->getId(), true); } }
public function renderField() { //Find the real render to do the job. $impl = $this->controller->getFieldRender($this->tableDd->getNormalizedType($this->field)); $this->render = CalemReportUtil::getRenderInstance($impl); $this->render->init($this->id, $this->info, $this->controller); return $this->render->render(); }
public static function getReportDesignTarget() { global $_CALEM_conf; if (CalemReportUtil::getUid() == $_CALEM_conf['design_target']['dev_admin_id'] && $_CALEM_conf['design_target']['devDesignPhase'] && CalemReportUtil::getGid() == CUSTOM_SYSTEM) { $grp = $_CALEM_conf['design_target']['devDesignGroup']; $rtn = new CalemDesignTargetInfo(CalemDesignTargetInfo::GROUP, $grp, ''); } else { //Design for CUSTOM_SYSTEM $rtn = new CalemDesignTargetInfo(CalemDesignTargetInfo::GROUP, CUSTOM_SYSTEM, ''); } return $rtn; }
/** * Rendering Excel is supported for list type report only at this time. */ public function renderExcel($customInfo) { $this->customInfo = $customInfo; $this->tableDd = $this->controller->getModelItem()->getTableDd(); //Get grid out and render it. $itemInfo = CalemReportUtil::getItemInfo(self::GRID_ID, $this->info, $this->tableDd); $impl = $this->controller->getReportRender($itemInfo); //Created an instance if (!$impl) { $this->logger->error("Error in locating render for: " . var_export($itemInfo, true)); } $render = CalemReportUtil::getRenderInstance($impl); //Init the render $render->init(self::GRID_ID, $itemInfo, $this->controller); $render->renderExcel(); }
public static function getItemInfo($id, $viewInfo, $tableDd) { $item = $viewInfo->getItem($id); if (!$item) { if ($tableDd->isField($id)) { $item = $tableDd->getFieldInfo($id); } else { if (CalemReportUtil::isFieldLabel($id)) { $item = $tableDd->getFieldLabelInfo(CalemReportUtil::getFieldFromLabel($id)); } } } return $item; }
public function createRender() { $vId = $this->formInfo->getView()->getId(); $vInfo = CalemReportUtil::getReportDefById($vId, $this->mod); $this->render = $this->_createRender($vId, $vInfo); }
public function renderOneItem($cid, $checkAcl = true) { if ($checkAcl && !$this->checkViewAcl($cid)) { return; } $itemInfo = CalemReportUtil::getItemInfo($cid, $this->info, $this->tableDd); $impl = $this->controller->getReportRender($itemInfo); //Created an instance if (!$impl) { $this->logger->error("Error in locating render for: " . var_export($itemInfo, true)); } $render = CalemReportUtil::getRenderInstance($impl); //Init the render $render->init($cid, $itemInfo, $this->controller); $doc = $render->render(); $this->append($doc); }
public function getCustomInfoById($id, $oid, $isUser) { $info = CalemReportUtil::getCustomReportById($id, $oid, $isUser); return $info; }