public function onPreInit($param) { parent::onPreInit($param); $docname = "tempXML"; $ext = "xml"; $header = "application/xml"; $doc = new TXmlDocument('1.0', 'ISO-8859-1'); $doc->TagName = 'menu'; $doc->setAttribute('id', "0"); $QVFile = new TXmlElement('item'); $QVFile->setAttribute('id', "new_Element"); $QVFile->setAttribute('img', "plus5.gif"); $QVFile->setAttribute('text', "new element"); $ActivityElements = ActivityTypeRecord::finder()->findAll(); foreach ($ActivityElements as $Activitytype) { $ST = new TXmlElement('item'); $ST->setAttribute('id', $Activitytype->idta_activity_type); $ST->setAttribute('img', 's' . $Activitytype->idta_activity_type . ".gif"); $ST->setAttribute('text', utf8_encode($Activitytype->act_type_name)); //hier muss die logik fuer die basiswerte aus den dimensionen hin... //hier hole ich mir die Dimensionsgruppen $QVFile->Elements[] = $ST; } $doc->Elements[] = $QVFile; // $CMdelete=new TXmlElement('item'); // $CMdelete->setAttribute('id',"delete_Element"); // $CMdelete->setAttribute('img',"minus.gif"); // $CMdelete->setAttribute('text',"delete element"); // // $doc->Elements[]=$CMdelete; $this->getResponse()->appendHeader("Content-Type:" . $header); $this->getResponse()->appendHeader("Content-Disposition:inline;filename=" . $docName . '.' . $ext); $doc->saveToFile('php://output'); exit; }
public function OnPreInit($param) { parent::onPreInit($param); //instantiasi database $this->DB = $this->Application->getModule('db')->getLink(); //instantiasi fungsi setup $this->setup = $this->getLogic('Setup'); //setting templaces yang aktif $this->MasterClass = 'Application.layouts.MainTemplate'; $this->Theme = 'cube'; }
public function onPreInit($param) { parent::onPreInit($param); $docname = "tempXML"; $ext = "xml"; $header = "application/xml"; $doc = new TXmlDocument('1.0', 'ISO-8859-1'); $doc->TagName = 'menu'; $doc->setAttribute('id', "0"); $QVFile = new TXmlElement('item'); $QVFile->setAttribute('id', "new_Element"); $QVFile->setAttribute('img', "plus5.gif"); $QVFile->setAttribute('text', "new element"); $StrukturElements = StrukturTypeRecord::finder()->findAll(); foreach ($StrukturElements as $Strukturtype) { $ST = new TXmlElement('item'); $ST->setAttribute('id', 'idta_struktur_type_' . $Strukturtype->idta_struktur_type); $ST->setAttribute('img', 's' . $Strukturtype->idta_struktur_type . ".gif"); $ST->setAttribute('text', $Strukturtype->struktur_type_name); //hier muss die logik fuer die basiswerte aus den dimensionen hin... //hier hole ich mir die Dimensionsgruppen $fstsql = "SELECT stammdaten_group_name, (ta_stammdaten_group.idta_stammdaten_group) AS parent_idta_stammdaten_group FROM ta_stammdaten_group INNER JOIN tm_stammdaten ON tm_stammdaten.idta_stammdaten_group = ta_stammdaten_group.idta_stammdaten_group WHERE idta_struktur_type = " . $Strukturtype->idta_struktur_type . " GROUP BY stammdaten_group_name, parent_idta_stammdaten_group"; $BaseGroupElements = StammdatenGroupRecord::finder()->findAllBySQL($fstsql); foreach ($BaseGroupElements as $BaseGroupElement) { $BGE = new TXmlElement('item'); $BGE->setAttribute('id', 'idta_stammdaten_group_' . $BaseGroupElement->parent_idta_stammdaten_group); $BGE->setAttribute('img', 's' . $Strukturtype->idta_struktur_type . ".gif"); $BGE->setAttribute('text', $BaseGroupElement->stammdaten_group_name); //zuerst hole ich alle Basiselement, die den aktuellen Strukturtypen haben $sql = "SELECT idtm_stammdaten,stammdaten_name, tm_stammdaten.idta_stammdaten_group FROM tm_stammdaten INNER JOIN ta_stammdaten_group ON tm_stammdaten.idta_stammdaten_group = ta_stammdaten_group.idta_stammdaten_group WHERE idta_struktur_type = " . $Strukturtype->idta_struktur_type . " AND ta_stammdaten_group.idta_stammdaten_group = " . $BaseGroupElement->parent_idta_stammdaten_group . " ORDER BY idta_stammdaten_group"; $BaseElements = StammdatenRecord::finder()->findAllBySQL($sql); foreach ($BaseElements as $BaseElement) { $BE = new TXmlElement('item'); $BE->setAttribute('id', 'idtm_stammdaten_' . $BaseElement->idtm_stammdaten); $BE->setAttribute('img', 'str' . $Strukturtype->idta_struktur_type . ".gif"); $BE->setAttribute('text', $BaseElement->stammdaten_name); $BGE->Elements[] = $BE; } $ST->Elements[] = $BGE; } $QVFile->Elements[] = $ST; } $doc->Elements[] = $QVFile; $CMdelete = new TXmlElement('item'); $CMdelete->setAttribute('id', "delete_Element"); $CMdelete->setAttribute('img', "minus.gif"); $CMdelete->setAttribute('text', "delete element"); $doc->Elements[] = $CMdelete; $docName = "temp"; $this->getResponse()->appendHeader("Content-Type:" . $header); $this->getResponse()->appendHeader("Content-Disposition:inline;filename=" . $docName . '.' . $ext); $doc->saveToFile('php://output'); exit; }
/** * (non-PHPdoc) * @see TPage::render() */ public function onPreInit($param) { parent::onPreInit($param); if (isset($_REQUEST['blanklayout']) && intval($_REQUEST['blanklayout']) === 1) { $this->getPage()->setMasterClass("Application.layout.BlankLayout"); } $this->_Load3rdPartyJs(); $this->getClientScript()->registerPradoScript('ajax'); $this->_loadPageJsClass(); $cScripts = self::getLastestJS(get_class($this)); if (isset($cScripts['js']) && ($lastestJs = trim($cScripts['js'])) !== '') { $this->getPage()->getClientScript()->registerScriptFile('pageJs', $this->publishAsset($lastestJs)); } if (isset($cScripts['css']) && ($lastestCss = trim($cScripts['css'])) !== '') { $this->getPage()->getClientScript()->registerStyleSheetFile('pageCss', $this->publishAsset($lastestCss)); } }
public function onPreInit($param) { parent::onPreInit($param); if (isset($_GET['idtm_activity'])) { $openItem = $_GET['idtm_activity']; } else { $openItem = 1; } if (isset($_GET['idta_activity_type'])) { if ($_GET['idta_activity_type'] != '') { $mySQLcond1 = "idta_activity_type = " . $_GET['idta_activity_type'] . " AND "; } else { $mySQLcond1 = ''; } } else { $mySQLcond1 = ''; } if (isset($_GET['idtm_activity_start'])) { $this->setUserStartId($_GET['idtm_activity_start']); } else { $this->setUserStartId($this->user->getStartNode($this->user->getUserId($this->user->Name), "tm_activity")); } // $this->DBConnection = new TDbConnection($this->Application->getModule('db1')->database->getConnectionString(),$this->Application->getModule('db1')->database->getUsername(),$this->Application->getModule('db1')->database->getPassword()); // $this->DBConnection->Active = true; $res = mysql_connect($this->Application->Parameters['Host'], $this->Application->getModule('db1')->database->getUsername(), $this->Application->getModule('db1')->database->getPassword()); mysql_select_db($this->Application->Parameters['Database']); //$tree = new TreeConnector($this->DBConnection); $tree = new TreeConnector($res); $tree->set_encoding("UTF-8"); $tree->enable_log("temp.log", false); $mySQL = "SELECT idtm_activity,parent_idtm_activity,act_name,idta_activity_type FROM tm_activity"; $mySQLOrderBy = " ORDER BY parent_idtm_activity ASC,act_name ASC,act_step"; $this->load_all_cats($mySQL . $mySQLOrderBy); //the start ID $mySQLcond1 .= "idtm_activity IN (" . $this->subCategory_list($this->subcats, $this->UserStartId) . "," . $this->parentCategory_list($this->parentcats, $this->UserStartId) . ")"; function custom_format($data) { $data->set_image("s" . $data->get_value("idta_activity_type") . ".gif"); //$data->setUserData("open",$data->get_value("idtm_organisation")==$openItem?"1":"0"); } $tree->event->attach("beforeRender", custom_format); $SQLComp = $mySQL . " WHERE " . $mySQLcond1 . $mySQLOrderBy; $tree->dynamic_loading(true); //$tree->render_table("tm_struktur", "idtm_struktur", "struktur_name", "parent_idtm_struktur"); $tree->render_sql($SQLComp, "idtm_activity", "act_name,idta_activity_type", "", "parent_idtm_activity"); }
public function onPreInit($param) { parent::onPreInit($param); $this->Theme = $this->Application->Parameters['ThemeName']; }
public function onPreInit($param) { $myTheme = $this->User->getUserTheme($this->User->getUserId(), 'mod_theme'); $this->setTheme($myTheme); parent::onPreInit($param); $this->workbook = new PHPExcel(); $this->sheet = $this->workbook->getActiveSheet(); $this->sheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT); $this->sheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4); if ($this->Request['periode'] != '') { $this->Periode = $this->Request['periode']; } if ($this->Request['idtm_struktur'] != '') { $this->idtm_struktur = $this->Request['idtm_struktur']; } else { $this->idtm_struktur = $this->user->getStartNode($this->user->getUserId($this->user->Name), "idtm_struktur"); $this->idtm_struktur == '' ? $this->idtm_struktur = 1 : ''; } if ($this->Request['per_single'] != '') { $this->SinglePeriode = $this->Request['per_single']; } if ($this->Request['idta_variante'] != '') { $this->Variante = $this->Request['idta_variante']; } if ($this->Request['idta_struktur_bericht'] != '') { $this->idta_struktur_bericht = $this->Request['idta_struktur_bericht']; } else { $this->idta_struktur_bericht = StrukturBerichtRecord::finder()->findBysb_startbericht(1)->idta_struktur_bericht; } //setting up the db-connection $myDBConnection = new TDbConnection($this->Application->getModule('db1')->database->getConnectionString(), $this->Application->getModule('db1')->database->getUsername(), $this->Application->getModule('db1')->database->getPassword()); $myDBConnection->Active = true; //this calculator is used to build the subcats $mySubcatsCalculator = new PFCalculator(); $mySubcatsCalculator->setDBConnection($myDBConnection); $mySubcatsCalculator->setStartNode($this->idtm_struktur, 1); if (!$this->Nested) { $mySubcatsCalculator->load_all_cats(); $mySubcatsCalculator->setsubcats($mySubcatsCalculator->getsubcats()); } //THE REPORT HEADER $this->sheetrow++; $local_column = $this->sheetleftgap; $local_cell = ''; $local_cell = $this->ColumnArray[$local_column] . $this->sheetrow; $this->sheet->setCellValue($local_cell, $mySubcatsCalculator->getCurrentPath($this->idtm_struktur)); $this->workbook->getActiveSheet()->getStyle($local_cell)->getFont()->setSize(14); $this->workbook->getActiveSheet()->getStyle($local_cell)->getFont()->getColor()->setRGB('999900'); $this->sheetrow++; //Adjusting the size $this->sheet->getColumnDimension($this->ColumnArray[$local_column])->setWidth(30); $local_column++; for ($ii = $local_column; $ii < count($this->ColumnArray); $ii++) { $this->sheet->getColumnDimension($this->ColumnArray[$ii])->setWidth(12); } //here we build the statements nthat a stored inside the database $Report = StrukturBerichtRecord::finder()->findByPK($this->idta_struktur_bericht); $this->sheet->setTitle($Report->pivot_struktur_name); $ReportColumns = StrukturBerichtSpaltenRecord::finder()->findAllByidta_struktur_bericht($this->idta_struktur_bericht); $idta_struktur_bericht_spalten = array(); foreach ($ReportColumns as $ReportColumn) { $this->GraphOffset++; $this->InputBericht = $ReportColumn->sbs_input; //$this->StrukturBerichtSaveButton->Visible = $this->InputBericht; //wenn die Variante fix uebergeben wurde if ($ReportColumn->sbs_idta_variante_fix) { $this->Variante = $ReportColumn->idta_variante; } //hier befuelle ich die variablenliste pro if ($ReportColumn->sbs_struktur_switch_type == 1) { $mySubcatsCalculator->setStartNode($ReportColumn->sbs_idtm_struktur, $this->Nested); } else { $mySubcatsCalculator->setStartNode($this->idtm_struktur, $this->Nested); } //das brauchen wir, fuer den fall dass wir die nested informationen noch nicht im modell haben if (!$this->Nested) { $ChildrenNodes[$ReportColumn->idta_struktur_bericht_spalten] = $mySubcatsCalculator->ChildrenNodes; $tmpInString = ''; if (count($ChildrenNodes[$ReportColumn->idta_struktur_bericht_spalten]) > 0) { $counter = 0; foreach ($ChildrenNodes[$ReportColumn->idta_struktur_bericht_spalten] as $key => $value) { if ($value != '') { $counter == 0 ? $tmpInString .= "'" . $value . "' " : ($tmpInString .= ",'" . $value . "' "); $counter++; $this->STRcounter == 0 ? $this->ReportIDsInStringAll .= "'" . $value . "' " : ($this->ReportIDsInStringAll .= ",'" . $value . "' "); $this->STRcounter++; } } } $this->ReportIDsInString[$ReportColumn->idta_struktur_bericht_spalten] = $tmpInString; } else { if ($ReportColumn->sbs_struktur_switch_type == 1) { $StartRecord = StrukturRecord::finder()->findByidtm_struktur($ReportColumn->sbs_idtm_struktur); } else { $StartRecord = StrukturRecord::finder()->findByidtm_struktur($this->idtm_struktur); } $this->ReportIDsLeft[$ReportColumn->idta_struktur_bericht_spalten] = $StartRecord->struktur_lft; $this->ReportIDsRight[$ReportColumn->idta_struktur_bericht_spalten] = $StartRecord->struktur_rgt; } //falls eine zeitliche abweichung festgestellt wurde if ($ReportColumn->sbs_perioden_fix == 1 or !$ReportColumn->idta_perioden_gap == 0 and !$ReportColumn->idta_perioden_gap == '') { $mySubcatsCalculator->setStartPeriod($ReportColumn->idta_perioden_gap, $ReportColumn->sbs_perioden_fix); $this->ReportPerioden[$ReportColumn->idta_struktur_bericht_spalten] = $mySubcatsCalculator->Perioden; } else { $mySubcatsCalculator->setStartPeriod($this->Periode, $this->SinglePeriode); $this->ReportPerioden[$ReportColumn->idta_struktur_bericht_spalten] = $mySubcatsCalculator->Perioden; } $this->ReportOperator[$ReportColumn->idta_struktur_bericht_spalten] = $ReportColumn->sbs_bericht_operator; } foreach ($this->ReportPerioden as $tempPerioden) { foreach ($tempPerioden as $key => $value) { $this->Perioden[] = $value[0]; } } //print_r($this->Perioden); if ($this->InputBericht || !$this->page->isCallback && !$this->page->isPostBack) { $criteria = new TActiveRecordCriteria(); $criteria->Condition = "idta_struktur_bericht = :suchbedingung1"; $criteria->Parameters[':suchbedingung1'] = $this->idta_struktur_bericht; $criteria->OrdersBy['sbz_order'] = "ASC"; $ReportRows = StrukturBerichtZeilenRecord::finder()->findAll($criteria); $rowcounter = 0; foreach ($ReportRows as $SingleRow) { ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"} = new PFCalculator(); ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->setDBConnection($myDBConnection); //${$SingleRow->idta_struktur_bericht_zeilen."RObj"}->setsubcats($mySubcats); ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->setInputReport($this->InputBericht); //hier immer auf 1, da sonst die formate nicht passen... //Perioden muss vor CALCCOLUMNS kommen, sonst ergebnis nicht richtig ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->Perioden = $this->ReportPerioden; //aus der zeile //this needs to be set, before we calc the number of columns ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->setColumns($ReportColumns); ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->calcColumns(); ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->setFeldFunktion($SingleRow->idta_feldfunktion); ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->setVariante($this->Variante); //muss noch aus der definition der spalte geholt werden ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->idta_struktur_bericht_spalten = $idta_struktur_bericht_spalten; //aus der zeile ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->ReportOperator = $this->ReportOperator; //uebergabe des operators an den calculator //hier uebergeben wir die entsprechenden spaltenwerte... if ($this->Nested) { ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->ReportIDsLeft = $this->ReportIDsLeft; ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->ReportIDsRight = $this->ReportIDsRight; } else { ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->ReportIDsInString = $this->ReportIDsInString; ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->ReportIDsInStringAll = $this->ReportIDsInStringAll; ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->ChildrenNodes = $ChildrenNodes; //aus der zeile } //${$SingleRow->idta_struktur_bericht_zeilen."RObj"}->setStartNode($this->Request['idtm_struktur']); if ($rowcounter == 0) { $this->load_header(${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}); $rowcounter++; } if ($SingleRow->sbz_spacer_label != "" or !$SingleRow->sbz_spacer_label == 0) { if ($SingleRow->sbz_type == 4) { } else { $this->draw_spacer(${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}, $SingleRow->sbz_spacer_label); } } if ($SingleRow->sbz_type == 0) { //type == 0 bedeutet die normale listenabfrage $this->draw_cells(${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}, $SingleRow->sbz_label, $SingleRow->sbz_detail); } if ($SingleRow->sbz_type == 1) { //type == 1 bedeutet die dimensionsabfrage ${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}->dimension = $SingleRow->idtm_stammdaten; $this->draw_cells_dimension(${$SingleRow->idta_struktur_bericht_zeilen . "RObj"}, $SingleRow->sbz_label, $SingleRow->sbz_order, $SingleRow->sbz_detail); } if ($SingleRow->sbz_type == 3) { //type == 3 Bedeutet eine Berechnung auf bereits existierende Objekte $this->build_difference_zwischenergebnisse($SingleRow->idta_struktur_bericht_zeilen, $SingleRow->sbz_label); } if ($SingleRow->sbz_type == 4) { //type == 4 bedeutet einen graphen //$this->draw_graph(${$SingleRow->idta_struktur_bericht_zeilen."RObj"},$SingleRow->sbz_label,$SingleRow->sbz_spacer_label); } } } $this->generate('Excel5', 'planlogIQ'); }
public function onPreInit($param) { parent::onPreInit($param); $docname = "tempXML"; $ext = "xml"; $header = "application/xml"; $target_encoding = "UTF-8"; if (!isset($_GET['idta_berichte'])) { $this->idta_berichte = 0; } else { $this->idta_berichte = $_GET['idta_berichte']; } if ($this->idta_berichte == 0) { $myRecords = BerichteRecord::finder()->findAll(); $doc = new TXmlDocument('1.0', $target_encoding); $doc->TagName = 'Reporting'; foreach ($myRecords as $SingleReport) { $Report = new TXmlElement('Reports'); $QVFile = new TXmlElement('QlikViewFile'); $QVFile->Value = mb_convert_encoding($SingleReport->ber_local_path, $target_encoding); $Report->Elements[] = $QVFile; $BerName = new TXmlElement('ReportName'); $BerName->Value = mb_convert_encoding($SingleReport->ber_name, $target_encoding); $Report->Elements[] = $BerName; $BerID = new TXmlElement('ReportId'); $BerID->Value = mb_convert_encoding($SingleReport->ber_id, $target_encoding); $Report->Elements[] = $BerID; $BerMailSub = new TXmlElement('MailSubject'); $BerMailSub->Value = mb_convert_encoding($SingleReport->ber_mail_subject, $target_encoding); $Report->Elements[] = $BerMailSub; $BerMailBody = new TXmlElement('MailBody'); $BerMailBody->Value = mb_convert_encoding(htmlspecialchars_decode($SingleReport->ber_mail_body), $target_encoding); $Report->Elements[] = $BerMailBody; $Recipients = new TXmlElement('Recipients'); $RCPS = BerichteOrganisationRecord::finder()->findAllByidta_berichte($SingleReport->idta_berichte); //schleife für alle empfänger foreach ($RCPS as $RCP) { $USER = OrganisationRecord::finder()->findByPK($RCP->idtm_organisation); $Mailer = new TXmlElement('Recipient'); $Mailer->setAttribute('ID', $RCP->bho_id); $Mailer->setAttribute('TABLE', $RCP->bho_modul); $Mailer->setAttribute('NTNAME', $USER->org_ntuser); $Mailer->Value = mb_convert_encoding(htmlspecialchars_decode(KommunikationRecord::finder()->find('idtm_organisation=? AND kom_ismain=1 AND kom_type = 3', $RCP->idtm_organisation)->kom_information), $target_encoding); $Recipients->Elements[] = $Mailer; unset($Mailer); } $Report->Elements[] = $Recipients; $doc->Elements[] = $Report; } } else { $doc = new TXmlDocument('1.0', 'utf-8'); $SingleReport = BerichteRecord::finder()->findByidta_berichte($this->idta_berichte); $doc->TagName = 'Reporting'; $Report = new TXmlElement('Reports'); $QVFile = new TXmlElement('QlikViewFile'); $QVFile->Value = mb_convert_encoding($SingleReport->ber_local_path, $target_encoding); $Report->Elements[] = $QVFile; $BerName = new TXmlElement('ReportName'); $BerName->Value = mb_convert_encoding($SingleReport->ber_name, $target_encoding); $Report->Elements[] = $BerName; $BerID = new TXmlElement('ReportId'); $BerID->Value = mb_convert_encoding($SingleReport->ber_id, $target_encoding); $Report->Elements[] = $BerID; $BerMailSub = new TXmlElement('MailSubject'); $BerMailSub->Value = mb_convert_encoding($SingleReport->ber_mail_subject, $target_encoding); $Report->Elements[] = $BerMailSub; $BerMailBody = new TXmlElement('MailBody'); $BerMailBody->Value = mb_convert_encoding(htmlspecialchars_decode($SingleReport->ber_mail_body), $target_encoding); $Report->Elements[] = $BerMailBody; $Recipients = new TXmlElement('Recipients'); $RCPS = BerichteOrganisationRecord::finder()->findAllByidta_berichte($SingleReport->idta_berichte); //schleife für alle empfänger foreach ($RCPS as $RCP) { $USER = OrganisationRecord::finder()->findByPK($RCP->idtm_organisation); $Mailer = new TXmlElement('Recipient'); $Mailer->setAttribute('ID', $RCP->bho_id); $Mailer->setAttribute('TABLE', $RCP->bho_modul); $Mailer->setAttribute('NTNAME', $USER->org_ntuser); $Mailer->Value = mb_convert_encoding(htmlspecialchars_decode(KommunikationRecord::finder()->find('idtm_organisation=? AND kom_ismain=1 AND kom_type = 3', $RCP->idtm_organisation)->kom_information), $target_encoding); $Recipients->Elements[] = $Mailer; unset($Mailer); } $Report->Elements[] = $Recipients; $doc->Elements[] = $Report; } # $query=new TXmlElement('Query'); # $query->setAttribute('ID','xxxx'); # $proc->Elements[]=$query; # # $attr=new TXmlElement('Attr'); # $attr->setAttribute('Name','aaa'); # $attr->Value='1'; # $query->Elements[]=$attr; $this->getResponse()->appendHeader("Content-Type:" . $header); $this->getResponse()->appendHeader("Content-Disposition:inline;filename=" . $docName . '.' . $ext); $doc->saveToFile('php://output'); exit; }
protected function onPreInit($param) { if (!strlen($this->masterPageName)) { $this->masterPageName = $this->getDefinition(get_class($this))->getMasterPageName(); } if (strlen($this->masterPageName)) { $this->masterPage = pradoGetApplication()->loadPage($this->masterPageName); $this->masterPage->onPreInit($param); } }
public function onPreInit($param) { parent::onPreInit($param); $completeCounter = 1; $this->idtm_termin = $_GET['idtm_termin']; $this->idtm_protokoll = $_GET['idtm_protokoll']; $idtm_termin = $this->idtm_termin; $idtm_protokoll = $this->idtm_protokoll; $this->workbook = new PHPExcel(); $sheet = $this->workbook->getActiveSheet(); $sheet->setTitle('Protokoll'); $sheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT); $sheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4); $sheet->getRowDimension('1')->setRowHeight(40); $sheet->getColumnDimension('A')->setWidth(5); $sheet->getColumnDimension('B')->setWidth(30); $sheet->getColumnDimension('C')->setWidth(20); $sheet->getColumnDimension('D')->setWidth(5); $sheet->getColumnDimension('E')->setWidth(20); $sheet->getColumnDimension('F')->setWidth(20); $this->workbook->getActiveSheet()->getStyle('A1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $this->workbook->getActiveSheet()->getStyle('A1')->getFill()->getStartColor()->setRGB('898989'); $this->workbook->getActiveSheet()->getStyle('A1')->getFont()->setSize(16); $this->workbook->getActiveSheet()->getStyle('A1')->getFont()->getColor()->setRGB('FFFFFF'); $sheet->mergeCells('A1:B1'); $sheet->setCellValue('A1', "Protokoll"); $this->workbook->getActiveSheet()->duplicateStyle($this->workbook->getActiveSheet()->getStyle('A1'), 'A' . $completeCounter . ':H' . $completeCounter); $counter = 5; $completeCounter = $counter; $this->workbook->getActiveSheet()->getStyle('B5')->applyFromArray(array('font' => array('bold' => true, 'size' => 12, 'color' => array('argb' => 'FFFFFFFF')), 'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT), 'borders' => array('top' => array('style' => PHPExcel_Style_Border::BORDER_THIN)), 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, 'startcolor' => array('argb' => 'FFA0A0A0')))); $this->workbook->getActiveSheet()->duplicateStyle($this->workbook->getActiveSheet()->getStyle('B5'), 'B' . $counter . ':C' . $counter); $this->workbook->getActiveSheet()->duplicateStyle($this->workbook->getActiveSheet()->getStyle('B5'), 'E' . $counter . ':G' . $counter); //der header fuer den Bereich $sheet->setCellValue('B' . $counter, "Name"); $sheet->setCellValue('C' . $counter, "Projektrolle"); $sheet->setCellValue('E' . $counter, "Name"); $sheet->setCellValue('F' . $counter, "Kommentar"); $sheet->setCellValue('G' . $counter, "AV"); $counter++; $criteria = new TActiveRecordCriteria(); $criteria->Condition = "idtm_termin = :suchtext"; $criteria->Parameters[':suchtext'] = $idtm_termin; $criteria->OrdersBy["idtm_organisation"] = 'asc'; $Records = TerminOrganisationView::finder()->findAll($criteria); foreach ($Records as $Record) { $sheet->setCellValue('B' . $counter, htmlentities($Record->org_name)); $sheet->setCellValue('C' . $counter, htmlentities($Record->user_role_name)); $counter++; } $counter2 = $completeCounter; $counter2++; $criteria2 = new TActiveRecordCriteria(); $criteria2->Condition = "idtm_activity = :suchtext"; $criteria2->Parameters[':suchtext'] = $idtm_termin; $Records2 = ActivityParticipantsView::finder()->findAll($criteria2); foreach ($Records2 as $Record) { $sheet->setCellValue('E' . $counter2, htmlentities($Record->org_name)); $sheet->setCellValue('F' . $counter2, htmlentities($Record->act_part_notiz)); $sheet->setCellValue('G' . $counter2, htmlentities($Record->act_part_anwesend)); $counter2++; } $counter >= $counter2 ? $completeCounter = $counter : ($completeCounter = $counter2); $completeCounter++; $counter3 = $completeCounter; $counter3++; $this->workbook->getActiveSheet()->getStyle('B' . $completeCounter)->getAlignment()->setWrapText(true); $this->workbook->getActiveSheet()->getStyle('B' . $completeCounter)->getAlignment()->setShrinkToFit(true); $this->workbook->getActiveSheet()->getStyle('B' . $completeCounter)->getFont()->setSize(12); $this->workbook->getActiveSheet()->getStyle('B' . $completeCounter)->getFont()->getColor()->setRGB('232323'); $SQL = "SELECT a.* FROM `vv_protokoll_detail_aufgabe` a INNER JOIN ta_protokoll_detail_group b ON a.idta_protokoll_detail_group = b.idta_protokoll_detail_group"; $SQL .= " WHERE idtm_protokoll = " . $idtm_protokoll; $Records3 = ProtokollDetailAufgabeView::finder()->findAllBySQL($SQL); foreach ($Records3 as $Record) { $sheet->setCellValue('B' . $counter3, htmlentities($Record->idta_protokoll_detail_group)); $sheet->mergeCells('C' . $counter3 . ':D' . $counter3); $sheet->setCellValue('C' . $counter3, htmlentities($Record->prtdet_cdate)); $sheet->setCellValue('E' . $counter3, htmlentities($Record->prtdet_topic)); $this->workbook->getActiveSheet()->getStyle('B' . $counter3)->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $this->workbook->getActiveSheet()->getStyle('B' . $counter3)->getFill()->getStartColor()->setRGB('A9AB78'); $this->workbook->getActiveSheet()->duplicateStyle($this->workbook->getActiveSheet()->getStyle('B' . $counter3), 'B' . $counter3 . ':G' . $counter3); $counter3++; $sheet->mergeCells('B' . $counter3 . ':G' . $counter3); $sheet->setCellValue('B' . $counter3, utf8_decode(strip_tags($Record->prtdet_descr))); $this->workbook->getActiveSheet()->duplicateStyle($this->workbook->getActiveSheet()->getStyle('B' . $completeCounter), 'B' . $counter3 . ':G' . $counter3); $counter3++; } $this->generate('Excel2007', 'risklogiq2009'); }
public function onPreInit($param) { parent::onPreInit($param); $docname = "tempXML"; $ext = "xml"; $header = "application/xml"; $doc = new TXmlDocument('1.0', 'ISO-8859-1'); $doc->TagName = 'menu'; $doc->setAttribute('id', "0"); $QVFile = new TXmlElement('item'); $QVFile->setAttribute('id', "Main_App"); $QVFile->setAttribute('img', "help_book.gif"); $QVFile->setAttribute('text', "planlogIQ"); $Home = new TXmlElement('item'); $Home->setAttribute('id', 'Home'); $Home->setAttribute('img', 'xpMyComp.gif'); $Home->setAttribute('text', utf8_encode("Startpage")); $QVFile->Elements[] = $Home; if (!$this->User->isGuest) { $mod_user = new TXmlElement('item'); $mod_user->setAttribute('id', 'mod_user'); $mod_user->setAttribute('img', 'org5.gif'); $mod_user->setAttribute('text', utf8_encode("Mein Konto")); $ComMyAccount = new TXmlElement('item'); $ComMyAccount->setAttribute('id', 'user.myaccount'); $ComMyAccount->setAttribute('img', 'oJornal.gif'); $ComMyAccount->setAttribute('text', utf8_encode("Mein Konto")); $mod_user->Elements[] = $ComMyAccount; if ($this->User->isInRole('Administrator')) { $ComADMyAccount = new TXmlElement('item'); $ComADMyAccount->setAttribute('id', 'user.user'); $ComADMyAccount->setAttribute('img', 'org1.gif'); $ComADMyAccount->setAttribute('text', utf8_encode("Alle Benutzer")); $mod_user->Elements[] = $ComADMyAccount; } $QVFile->Elements[] = $mod_user; } $SepMan = new TXmlElement('item'); $SepMan->setAttribute('id', 'sep_modMan'); $SepMan->setAttribute('type', 'seperator'); $QVFile->Elements[] = $SepMan; $Manual = new TXmlElement('item'); $Manual->setAttribute('id', 'Handbuch'); $Manual->setAttribute('img', 'memobook.gif'); $Manual->setAttribute('text', utf8_encode("Handbuch")); $ManualLink = new TXmlElement('href'); $ManualLink->setAttribute('target', '_blank'); $ManualLink->setValue('http://wiki.planlogiq.com'); $Manual->Elements[] = $ManualLink; $QVFile->Elements[] = $Manual; $ST = new TXmlElement('item'); $ST->setAttribute('id', 'user.logoutuser'); $ST->setAttribute('img', 'radio_off.gif'); $ST->setAttribute('text', utf8_encode("Logout")); $QVFile->Elements[] = $ST; $doc->Elements[] = $QVFile; if (!$this->User->isGuest) { if ($this->User->getModulRights('mod_organisation')) { $ModOrganisation = new TXmlElement('item'); $ModOrganisation->setAttribute('id', "mod_organisation"); $ModOrganisation->setAttribute('img', "org6.gif"); $ModOrganisation->setAttribute('text', "Organisation"); $ComOrganisation = new TXmlElement('item'); $ComOrganisation->setAttribute('id', 'organisation.orgworkspace'); $ComOrganisation->setAttribute('img', 'org6.gif'); $ComOrganisation->setAttribute('text', utf8_encode("Organisation")); $ModOrganisation->Elements[] = $ComOrganisation; $ComTermine = new TXmlElement('item'); $ComTermine->setAttribute('id', 'termin.terworkspace'); $ComTermine->setAttribute('img', 'oJornal.gif'); $ComTermine->setAttribute('text', utf8_encode("Termine")); $ModOrganisation->Elements[] = $ComTermine; if ($this->User->getModulRights('mod_zeiterfassung')) { $ComZeiterfassung = new TXmlElement('item'); $ComZeiterfassung->setAttribute('id', 'organisation.zeiterfassung'); $ComZeiterfassung->setAttribute('img', 'oJornal.gif'); $ComZeiterfassung->setAttribute('text', utf8_encode("Zeiterfassung")); $ModOrganisation->Elements[] = $ComZeiterfassung; if ($this->User->getModulRights('mod_zeiterfassung_reports')) { $SepRepZeit = new TXmlElement('item'); $SepRepZeit->setAttribute('id', 'sep_modRepZeit'); $SepRepZeit->setAttribute('type', 'seperator'); $ModOrganisation->Elements[] = $SepRepZeit; $ComZeiterfassungRepMB = new TXmlElement('item'); $ComZeiterfassungRepMB->setAttribute('id', 'reports.zeiterfassung.a_Zeiterfassung_Mitarbeiter'); $ComZeiterfassungRepMB->setAttribute('img', 'org7.gif'); $ComZeiterfassungRepMB->setAttribute('text', utf8_encode("REP: Zeiterfassung MB")); $ModOrganisation->Elements[] = $ComZeiterfassungRepMB; } } $ComOrgBelegung = new TXmlElement('item'); $ComOrgBelegung->setAttribute('id', 'organisation.organisationbelegung'); $ComOrgBelegung->setAttribute('img', 'oJornal.gif'); $ComOrgBelegung->setAttribute('text', utf8_encode("Organisation Belegung")); $ModOrganisation->Elements[] = $ComOrgBelegung; if ($this->User->getModulRights('mod_process')) { $ModProzess = new TXmlElement('item'); $ModProzess->setAttribute('id', 'mod_process'); $ModProzess->setAttribute('img', 'oJornal.gif'); $ModProzess->setAttribute('text', utf8_encode("Prozesse")); $ComProzess = new TXmlElement('item'); $ComProzess->setAttribute('id', 'prozess.proworkspace'); $ComProzess->setAttribute('img', 'org7.gif'); $ComProzess->setAttribute('text', utf8_encode("Definition")); $ModProzess->Elements[] = $ComProzess; $ModOrganisation->Elements[] = $ModProzess; } if ($this->User->isInRole('Administrator')) { $SepImporter = new TXmlElement('item'); $SepImporter->setAttribute('id', 'sep_modImporter'); $SepImporter->setAttribute('type', 'seperator'); $ModOrganisation->Elements[] = $SepImporter; $ModImporter = new TXmlElement('item'); $ModImporter->setAttribute('id', 'mod_importer'); $ModImporter->setAttribute('img', 'oOutlook.gif'); $ModImporter->setAttribute('text', utf8_encode("Import")); $ModOrganisation->Elements[] = $ModImporter; $ComImportImmo = new TXmlElement('item'); $ComImportImmo->setAttribute('id', 'importer.ImportImmo'); $ComImportImmo->setAttribute('img', 'oOutlook.gif'); $ComImportImmo->setAttribute('text', utf8_encode("Import NPF")); $ModImporter->Elements[] = $ComImportImmo; $ComImportHTC = new TXmlElement('item'); $ComImportHTC->setAttribute('id', 'importer.ImportHTC'); $ComImportHTC->setAttribute('img', 'oOutlook.gif'); $ComImportHTC->setAttribute('text', utf8_encode("Import HTC")); $ModImporter->Elements[] = $ComImportHTC; $ComImportTasks = new TXmlElement('item'); $ComImportTasks->setAttribute('id', 'importer.ImportTasks'); $ComImportTasks->setAttribute('img', 'oOutlook.gif'); $ComImportTasks->setAttribute('text', utf8_encode("Import Tasks")); $ModImporter->Elements[] = $ComImportTasks; } $doc->Elements[] = $ModOrganisation; } if ($this->User->getModulRights('mod_risiko')) { $ModRisiko = new TXmlElement('item'); $ModRisiko->setAttribute('id', "mod_risiko"); $ModRisiko->setAttribute('img', "org1.gif"); $ModRisiko->setAttribute('text', "Risiken"); $ComRisikoarten = new TXmlElement('item'); $ComRisikoarten->setAttribute('id', 'risiko.risworkspace'); $ComRisikoarten->setAttribute('img', 'oOutlook.gif'); $ComRisikoarten->setAttribute('text', utf8_encode("Risikoarten")); $ModRisiko->Elements[] = $ComRisikoarten; $doc->Elements[] = $ModRisiko; } if ($this->User->getModulRights('mod_activity')) { $ModActivity = new TXmlElement('item'); $ModActivity->setAttribute('id', "mod_activity"); $ModActivity->setAttribute('img', "oInboxF.gif"); $ModActivity->setAttribute('text', "Projektmanagement"); $ComActivity = new TXmlElement('item'); $ComActivity->setAttribute('id', 'activity.actworkspace'); $ComActivity->setAttribute('img', 'BookY.gif'); $ComActivity->setAttribute('text', utf8_encode("Projektstruktur")); $ModActivity->Elements[] = $ComActivity; $ComZiele = new TXmlElement('item'); $ComZiele->setAttribute('id', 'ziele.zieworkspace'); $ComZiele->setAttribute('img', 'watch.gif'); $ComZiele->setAttribute('text', utf8_encode("Ziele")); $ModActivity->Elements[] = $ComZiele; $ComNetplan = new TXmlElement('item'); $ComNetplan->setAttribute('id', 'activity.actlistview'); $ComNetplan->setAttribute('img', 'BookY.gif'); $ComNetplan->setAttribute('text', utf8_encode("Netzplan")); $ModActivity->Elements[] = $ComNetplan; $ComTimeplan = new TXmlElement('item'); $ComTimeplan->setAttribute('id', 'activity.actterminlistview'); $ComTimeplan->setAttribute('img', 'watch.gif'); $ComTimeplan->setAttribute('text', utf8_encode("Zeitplan")); $ModActivity->Elements[] = $ComTimeplan; $SepRess = new TXmlElement('item'); $SepRess->setAttribute('id', 'sep_comRess'); $SepRess->setAttribute('type', 'seperator'); $ModActivity->Elements[] = $SepRess; $ComRess = new TXmlElement('item'); $ComRess->setAttribute('id', 'organisation.ressourcenworkspace'); $ComRess->setAttribute('img', 'org4.gif'); $ComRess->setAttribute('text', utf8_encode("Ressourcen")); $ModActivity->Elements[] = $ComRess; $ComRessPlan = new TXmlElement('item'); $ComRessPlan->setAttribute('id', 'organisation.ressourcenbelegung'); $ComRessPlan->setAttribute('img', 'org5.gif'); $ComRessPlan->setAttribute('text', utf8_encode("Ressourcen Plan")); $ModActivity->Elements[] = $ComRessPlan; $doc->Elements[] = $ModActivity; } if ($this->User->getModulRights('mod_protokoll')) { $ModProtokoll = new TXmlElement('item'); $ModProtokoll->setAttribute('id', "mod_protokoll"); $ModProtokoll->setAttribute('img', "org6.gif"); $ModProtokoll->setAttribute('text', "Dokumentation"); $ComProtokoll = new TXmlElement('item'); $ComProtokoll->setAttribute('id', 'protokoll.prtworkspace'); $ComProtokoll->setAttribute('img', 'book.gif'); $ComProtokoll->setAttribute('text', utf8_encode("Protokolle")); $ModProtokoll->Elements[] = $ComProtokoll; $ComChangeManagement = new TXmlElement('item'); $ComChangeManagement->setAttribute('id', 'changemanagement.rfcworkspace'); $ComChangeManagement->setAttribute('img', 'book.gif'); $ComChangeManagement->setAttribute('text', utf8_encode("Changemanagement")); $ModProtokoll->Elements[] = $ComChangeManagement; $doc->Elements[] = $ModProtokoll; } if ($this->User->getModulRights('mod_planung')) { $ModPlanung = new TXmlElement('item'); $ModPlanung->setAttribute('id', "mod_planung"); $ModPlanung->setAttribute('img', "oDrafts.gif"); $ModPlanung->setAttribute('text', "Planung"); $ComPlanung = new TXmlElement('item'); $ComPlanung->setAttribute('id', 'reports.StrukturBerichtViewer'); $ComPlanung->setAttribute('img', 'oDrafts.gif'); $ComPlanung->setAttribute('text', utf8_encode("Planung")); $ModPlanung->Elements[] = $ComPlanung; if ($this->User->isInRole('Administrator')) { $SepPlaOne = new TXmlElement('item'); $SepPlaOne->setAttribute('id', 'sep_plaone'); $SepPlaOne->setAttribute('type', 'seperator'); $ModPlanung->Elements[] = $SepPlaOne; $ModPlanungAdmin = new TXmlElement('item'); $ModPlanungAdmin->setAttribute('id', "mod_planung_admin"); $ModPlanungAdmin->setAttribute('img', "tree.gif"); $ModPlanungAdmin->setAttribute('text', "Administration"); $ModPlanung->Elements[] = $ModPlanungAdmin; $ComDimensionen = new TXmlElement('item'); $ComDimensionen->setAttribute('id', 'struktur.dimmappingview'); $ComDimensionen->setAttribute('img', 'org7.gif'); $ComDimensionen->setAttribute('text', utf8_encode("Dimensionsmanager")); $ModPlanungAdmin->Elements[] = $ComDimensionen; $ComStrtypen = new TXmlElement('item'); $ComStrtypen->setAttribute('id', 'struktur.strukturtypen'); $ComStrtypen->setAttribute('img', 'org6.gif'); $ComStrtypen->setAttribute('text', utf8_encode("Strukturtypen")); $ModPlanungAdmin->Elements[] = $ComStrtypen; $ComSplash = new TXmlElement('item'); $ComSplash->setAttribute('id', 'struktur.splasherworkspace'); $ComSplash->setAttribute('img', 'org7.gif'); $ComSplash->setAttribute('text', utf8_encode("Splashing")); $ModPlanungAdmin->Elements[] = $ComSplash; $SepPlaTree = new TXmlElement('item'); $SepPlaTree->setAttribute('id', 'sep_platree'); $SepPlaTree->setAttribute('type', 'seperator'); $ModPlanung->Elements[] = $SepPlaTree; $ComStrElemente = new TXmlElement('item'); $ComStrElemente->setAttribute('id', 'struktur.strworkspace'); $ComStrElemente->setAttribute('img', 'org1.gif'); $ComStrElemente->setAttribute('text', utf8_encode("Struktur manuell")); $ModPlanung->Elements[] = $ComStrElemente; $ComBerWorkspace = new TXmlElement('item'); $ComBerWorkspace->setAttribute('id', 'protokoll.berichteworkspace'); $ComBerWorkspace->setAttribute('img', 'book.gif'); $ComBerWorkspace->setAttribute('text', utf8_encode("Berichtsmanager")); $ModPlanung->Elements[] = $ComBerWorkspace; $SepPlaTwo = new TXmlElement('item'); $SepPlaTwo->setAttribute('id', 'sep_platwo'); $SepPlaTwo->setAttribute('type', 'seperator'); $ModPlanung->Elements[] = $SepPlaTwo; $ModStrImporter = new TXmlElement('item'); $ModStrImporter->setAttribute('id', 'mod_strimporter'); $ModStrImporter->setAttribute('img', 'oOutlook.gif'); $ModStrImporter->setAttribute('text', utf8_encode("Import")); $ModPlanung->Elements[] = $ModStrImporter; $ComImportStruktur = new TXmlElement('item'); $ComImportStruktur->setAttribute('id', 'importer.importerworkspace'); $ComImportStruktur->setAttribute('img', 'oOutlook.gif'); $ComImportStruktur->setAttribute('text', utf8_encode("Import Saldenliste")); $ModStrImporter->Elements[] = $ComImportStruktur; $ComImportDimStruktur = new TXmlElement('item'); $ComImportDimStruktur->setAttribute('id', 'importer.importerworkspacedim'); $ComImportDimStruktur->setAttribute('img', 'oOutlook.gif'); $ComImportDimStruktur->setAttribute('text', utf8_encode("Import 2 Dimensionen")); $ModStrImporter->Elements[] = $ComImportDimStruktur; } $ComPivots = new TXmlElement('item'); $ComPivots->setAttribute('id', 'struktur.pivotworkspace'); $ComPivots->setAttribute('img', 'org1.gif'); $ComPivots->setAttribute('text', utf8_encode("Pivotberichte (beta)")); $ModPlanung->Elements[] = $ComPivots; $doc->Elements[] = $ModPlanung; } } //hier muss die logik fuer die basiswerte aus den dimensionen hin... //hier hole ich mir die Dimensionsgruppen $docName = "temp"; $this->getResponse()->appendHeader("Content-Type:" . $header); $this->getResponse()->appendHeader("Content-Disposition:inline;filename=" . $docName . '.' . $ext); $doc->saveToFile('php://output'); exit; }