private function getInPeriods($per_intern) { $SQLInString = $per_intern; $ResultsRecord = PeriodenRecord::finder()->findAllByparent_idta_perioden(PeriodenRecord::finder()->findByper_intern($per_intern)->idta_perioden); if (count($ResultsRecord) >= 1) { foreach ($ResultsRecord as $ResultRecord) { $SQLInString .= "," . $ResultRecord->per_intern; } } return $SQLInString; }
public function onLoad($param) { parent::onLoad($param); if (!$this->page->isPostBack && !$this->page->isCallback) { $this->bindListStammdatenValue(); $this->RCedidta_stammdaten_group->DataSource = PFH::build_SQLPullDown(StammdatenGroupRecord::finder(), "ta_stammdaten_group", array("idta_stammdaten_group", "stammdaten_group_name")); $this->RCedidta_stammdaten_group->dataBind(); $this->RCTedidta_variante->DataSource = PFH::build_SQLPullDown(VarianteRecord::finder(), "ta_variante", array("idta_variante", "var_descr")); $this->RCTedidta_variante->dataBind(); $this->RCTedidta_periode->DataSource = PFH::build_SQLPullDown(PeriodenRecord::finder(), "ta_perioden", array("idta_perioden", "per_extern")); $this->RCTedidta_periode->dataBind(); } }
public function onLoad($param) { parent::onLoad($param); //if(!$this->isPostBack && !$this->isCallback){ $this->DWH_idta_variante->DataSource = PFH::build_SQLPullDown(VarianteRecord::finder(), "ta_variante", array("idta_variante", "var_descr")); $this->DWH_idta_variante->dataBind(); $this->DWH_idta_perioden->DataSource = PFH::build_SQLPullDown(PeriodenRecord::finder(), "ta_perioden", array("per_intern", "per_extern")); $this->DWH_idta_perioden->dataBind(); $tree = $this->MyTree; //$this->addContextMenu($tree->getID()); $node = new StrukturRecord(); $this->fullInTreeStrukturRecord($tree, $node); //} }
public function onLoad($param) { parent::onLoad($param); if (!$this->page->IsPostBack && !$this->page->IsCallback) { $PeriodPullDown = new PFPeriodPullDown(); $PeriodPullDown->setStructureTable("ta_perioden"); $PeriodPullDown->setRecordClass(PeriodenRecord::finder()); $PeriodPullDown->setPKField("idta_perioden"); $PeriodPullDown->setField("per_extern"); $PeriodPullDown->letsrun(); $this->RCedidta_perioden->DataSource = $PeriodPullDown->myTree; $this->RCedidta_perioden->dataBind(); $Usersql = "SELECT idtm_user, user_name FROM tm_user"; $Userdata = PFH::convertdbObjectArray(UserRecord::finder()->findAllBySql($Usersql), array("idtm_user", "user_name")); $this->var_idtm_user->DataSource = $Userdata; $this->var_idtm_user->dataBind(); $this->bindListVariantenValue(); } }
public function onLoad($param) { parent::onLoad($param); if ($this->Request['periode'] != '') { $this->Periode = $this->Request['periode']; } if (!$this->isPostBack && !$this->isCallback) { $this->DWH_idta_perioden->DataSource = PFH::build_SQLPullDown(PeriodenRecord::finder(), "ta_perioden", array("per_intern", "per_extern")); $this->DWH_idta_perioden->dataBind(); $this->DWH_idta_perioden->Text = $this->Periode; $this->idta_pivot_bericht->Text = $this->Request['idta_pivot_bericht']; $this->PivotBerichtRecord = PivotBerichtRecord::finder()->findByPK($this->Request['idta_pivot_bericht']); $this->pivot_bericht_name->Text = $this->PivotBerichtRecord->pivot_bericht_name; //hier berechne ich die Anzahl der Elemente auf der untersten Ebene if (count(PivotRecord::finder()->findByidta_pivot_bericht($this->PivotBerichtRecord->idta_pivot_bericht)) > 0) { $this->calc_NumberOfElements(PivotRecord::finder()->findByidta_pivot_bericht($this->PivotBerichtRecord->idta_pivot_bericht)); $this->calc_NumerOfAllElements(); $this->buildPivotReport(); //$this->generateGraph($this->zwischenergebnisse); } } }
public function onPreInit($param) { //error_reporting(E_ALL ^ E_NOTICE); $request_user = $_GET['user']; $request_password = $_GET['pass']; $authManager = $this->Application->getModule('auth'); if (!$authManager->login($request_user, $request_password)) { exit; } $this->getResponse()->appendHeader("Content-Type:" . $this->header); echo '<?xml version="1.0" ?><ta_perioden>'; $SQL = "SELECT * FROM ta_perioden"; $Results = PeriodenRecord::finder()->findAllBySQL($SQL); foreach ($Results as $Result) { echo "<row idta_perioden='" . $Result->idta_perioden . "'>"; echo "<parent_idta_perioden>" . $Result->parent_idta_perioden . "</parent_idta_perioden>"; echo "<per_intern>" . $Result->per_intern . "</per_intern>"; echo "<per_extern>" . $Result->per_extern . "</per_extern>"; echo "</row>"; } echo '</ta_perioden>'; exit; }
public function SCRunSeasonsButtonClicked($sender, $param) { //Step One, find all relevant IDs $FieldstToChange = array(); //inside this array, the fields that needed to be changed are listed $idta_variante = $this->Request['idta_variante']; $idta_struktur_type = FeldfunktionRecord::finder()->findByidta_feldfunktion($this->sai_idta_feldfunktion->Text)->idta_struktur_type; $idta_feldfunktion = $this->sai_idta_feldfunktion->Text; $FieldsToChange[] = $idta_feldfunktion; //this value needs always to be included $this->load_all_cats(); $SQLINCondition = $this->subCategory_Inlist($this->subcats, $this->sai_idtm_struktur->Text); //the two must be replaced with the value from the usermanager $sql = "SELECT idtm_struktur FROM tm_struktur WHERE idtm_struktur IN (" . $SQLINCondition . ") AND idta_struktur_type = " . $idta_struktur_type; //here I recieve the array of values containing the elements to be changed $ElementsToChange = StrukturRecord::finder()->findAllBySQL($sql); //before the change can start, I need to identify the affected rows $FieldsToChangeBrutto = CollectorRecord::finder()->findAllBycol_idtafeldfunktion($idta_feldfunktion); foreach ($FieldsToChangeBrutto as $TmpField) { $FieldsToChange[] = $TmpField->idta_feldfunktion; } $SeasonToWrite = TTSaisonRecord::finder()->findAllByidta_saisonalisierung($this->sai_idta_saisonalisierung->Text); foreach ($ElementsToChange as $Element) { foreach ($FieldsToChange as $Field) { foreach ($SeasonToWrite as $Season) { $year_idta_periode = PeriodenRecord::finder()->find('idta_perioden = ?', PeriodenRecord::finder()->findByPK($Season->idta_periode)->parent_idta_perioden)->per_intern; $sqlYEAR = "SELECT w_wert FROM tt_werte WHERE w_jahr = " . $year_idta_periode . " AND w_monat = " . $year_idta_periode . " AND idtm_struktur = " . $Element->idtm_struktur . " AND w_id_variante = " . $idta_variante . " AND idta_feldfunktion = " . $Field; $YEARValue = WerteRecord::finder()->findBySQL($sqlYEAR)->w_wert; $newMonthValue = $YEARValue * $Season->sai_wert; //$sqlMONTH = "SELECT w_wert FROM tt_werte WHERE w_jahr = ".$year_idta_periode." AND w_monat = ".PeriodenRecord::finder()->findByPK($Season->idta_periode)->per_intern." AND idtm_struktur = ".$Element->idtm_struktur." AND w_id_variante = ".$idta_variante." AND idta_feldfunktion = ".$Field; if (count(WerteRecord::finder()->find('w_jahr = ? AND w_monat = ? AND idtm_struktur = ? AND w_id_variante = ? AND idta_feldfunktion = ?', $year_idta_periode, PeriodenRecord::finder()->findByPK($Season->idta_periode)->per_intern, $Element->idtm_struktur, $idta_variante, $Field))) { $RecordToUpdate = WerteRecord::finder()->find('w_jahr = ? AND w_monat = ? AND idtm_struktur = ? AND w_id_variante = ? AND idta_feldfunktion = ?', $year_idta_periode, PeriodenRecord::finder()->findByPK($Season->idta_periode)->per_intern, $Element->idtm_struktur, $idta_variante, $Field); $RecordToUpdate->w_wert = $newMonthValue; $RecordToUpdate->save(); } } } } }
public function getYearByMonth($periode_intern) { $Result = PeriodenRecord::finder()->findByper_Intern($periode_intern); if ($Result->parent_idta_perioden != 0) { $Result2 = PeriodenRecord::finder()->findByidta_perioden($Result->parent_idta_perioden); return $Result2->per_intern; } else { return $periode_intern; } }
private function getIdtafeldfunktion($Field) { preg_match('/XXX([0-9]*)XXX([0-9]*)XXX.*/', $Field, $matches); $month = $matches[2]; return PeriodenRecord::finder()->findByper_intern($month)->idta_perioden; }
private function load_header($PFCALCULATOR) { $PFCALCULATOR->buildTitle("Zeit"); $FirstRow = new TActiveTableRow(); $FirstRow->setID("R" . $this->sheetrow . "G"); //new for grouping $this->resulttable->Rows[] = $FirstRow; $ii = 1; //the startpoint of the columncounter $ControlListCell = array(); //clean the children foreach ($PFCALCULATOR->getTitle() as $value) { //i need to check, if it´s original level or not preg_match('/.x([0-9]+$)/', $value, $matches); if (isset($matches[1])) { $per_intern = $matches[1]; } else { $per_intern = ''; } $cell = new TActiveTableCell(); $ControlListCellChildren = array(); //clean the children if ($per_intern >= 9999) { $cell->setID("R" . $this->sheetrow . "C" . $ii . "G"); $imagebutton = new TActiveImageButton(); $imagebutton->setID("R" . $this->sheetrow . "C" . $ii . "GIB"); $imagebutton->setImageUrl("/rliq/themes/basic/gfx/group-collapse.gif"); $imagebutton->setText("collapse"); $imagebutton->onCallback = "page.hideColumnGroup"; $imagebutton->setCommandParameter($ii); $cell->Controls->add($imagebutton); $ControlListCellChildren[] = array("class" => "TActiveImageButton", "id" => "R" . $this->sheetrow . "C" . $ii . "GIB", "OnCallback" => "page.hideColumnGroup", "CommandParameter" => $ii); //$cell->Text=$title; $activeLabel = new TActiveLabel(); $activeLabel->setID("R" . $this->sheetrow . "C" . $ii . "GAL"); $yearlabel = explode('x', $value); $activeLabel->setText("<b> " . $yearlabel[0] . "</b>"); $cell->Controls->add($activeLabel); $ControlListCellChildren[] = array("class" => "TActiveLabel", "id" => "R" . $this->sheetrow . "C" . $ii . "GAL", "OnCallback" => "", "CommandParameter" => ""); $ControlListCell[] = array("class" => "TActiveTableCell", "id" => "R" . $this->sheetrow . "C" . $ii . "G", "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCellChildren); } else { $monthlabel = explode('x', $value); if ($value == 'Zeit') { $cell->setID("R" . $this->sheetrow . "CGG" . $ii); $imagebutton = new TActiveImageButton(); $imagebutton->setID("R" . $this->sheetrow . "CGG" . $ii . "IB"); $imagebutton->setImageUrl("/rliq/themes/basic/gfx/group-collapse.gif"); $imagebutton->setText("collapse"); $imagebutton->onCallback = "page.hideAllRows"; $imagebutton->setCommandParameter($ii); $cell->Controls->add($imagebutton); $ControlListCellChildren[] = array("class" => "TActiveImageButton", "id" => "R" . $this->sheetrow . "CGG" . $ii . "IB", "OnCallback" => "page.hideAllRows", "CommandParameter" => $ii); $activeLabel = new TActiveLabel(); $activeLabel->setID("R" . $this->sheetrow . "CGG" . $ii . "AL"); $activeLabel->setText("<b> " . $monthlabel[0] . "</b>"); $cell->Controls->add($activeLabel); $ControlListCellChildren[] = array("class" => "TActiveLabel", "id" => "R" . $this->sheetrow . "CGG" . $ii . "AL", "OnCallback" => "", "CommandParameter" => ""); $ControlListCell[] = array("class" => "TActiveTableCell", "id" => "R" . $this->sheetrow . "CGG" . $ii, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCellChildren); } else { $cell->setID("R" . $this->sheetrow . "C" . $ii); $yearKennung = $PFCALCULATOR->getYearByMonth($monthlabel[1]); $yearLabelObj = PeriodenRecord::finder()->findByper_intern($yearKennung); if (is_Object($yearLabelObj)) { $yearLabel = $yearLabelObj->per_extern; } else { $yearLabel = ' '; } $cell->Text = "<b> " . strtoupper($monthlabel[0]) . " " . substr($yearLabel, 2, 2) . "</b>"; $ControlListCell[] = array("class" => "TActiveTableCell", "id" => "R" . $this->sheetrow . "C" . $ii, "OnCallback" => "", "CommandParameter" => "", "children" => ""); } } $cell->EnableViewState = true; $FirstRow->Cells[] = $cell; $ii++; //increment of the columncounter } $FirstRow->setCssClass('thead'); $this->dynamicControlList[] = array("class" => "TActiveTableRow", "id" => "R" . $this->sheetrow . "G", "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCell); $this->sheetrow++; }
public function callback_MyCallbackTime($sender, $param) { if ($this->page->isCallback && $this->page->isPostBack) { $theObjectContainingParameters = $param->CallbackParameter; $Record = PeriodenRecord::finder()->findByPK($theObjectContainingParameters->idta_perioden); $StrRecord = StrukturRecord::finder()->findBy_idtm_struktur($this->DWH_idtm_struktur->Text); if ($this->check_forChildren($StrRecord)) { $page = 'reports.StrukturBerichtViewer'; } else { $page = 'struktur.streingabemaske'; } $parameter['periode'] = $Record->per_intern; $parameter['idta_stammdatensicht'] = $this->DWH_idta_stammdatensicht->Text; $parameter['idta_variante'] = $this->DWH_idta_variante->Text; $parameter['idta_struktur_bericht'] = $this->DWH_idta_struktur_bericht->Text; $parameter['per_single'] = $this->DWH_per_single->Checked ? 1 : 0; $parameter['idtm_struktur'] = $this->DWH_idtm_struktur->Text; $parameter['idta_struktur_type'] = $StrRecord->idta_struktur_type; $anchor = $this->getAnchor() !== null ? "#" . $this->getAnchor() : ""; $url = $this->getApplication()->getRequest()->constructUrl('page', $page, $parameter) . $anchor; $StrRecord->idta_struktur_type != '' ? $this->Response->redirect($url) : ''; } }
private function getPeriodeBefore($periode_intern) { if ($periode_intern == 1 or $periode_intern == 10001) { return 10001; } else { if ($periode_intern < 10000) { $tester = $periode_intern - 1; //achtung, wenn nicht monate sondern andere detaillierung if (fmod($tester, 12) == 0) { return 10000 + round($periode_intern / 12, 0); } else { return $periode_intern - 1; } } else { $criteria = new TActiveRecordCriteria(); $criteria->Condition = "per_intern < 10000"; if (count(PeriodenRecord::finder()->findAll($criteria)) > 0) { $tester = ($periode_intern - 10001) * 12; //achtung, wenn detaillierter als monat geplant wird, dann stimmt das nicht mehr return $tester; } else { return $periode_intern - 1; } } } }
public function initPullDowns() { $this->from_idta_stammdaten_group->DataSource = PFH::build_SQLPullDown(StammdatenGroupRecord::finder(), "ta_stammdaten_group", array("idta_stammdaten_group", "stammdaten_group_name")); $this->from_idta_stammdaten_group->dataBind(); $this->to_idta_stammdaten_group->DataSource = PFH::build_SQLPullDown(StammdatenGroupRecord::finder(), "ta_stammdaten_group", array("idta_stammdaten_group", "stammdaten_group_name")); $this->to_idta_stammdaten_group->dataBind(); $this->from_idta_feldfunktion->DataSource = PFH::build_SQLPullDown(FeldfunktionRecord::finder(), "ta_feldfunktion", array("idta_feldfunktion", "ff_name")); $this->from_idta_feldfunktion->dataBind(); $this->to_idta_feldfunktion->DataSource = PFH::build_SQLPullDown(FeldfunktionRecord::finder(), "ta_feldfunktion", array("idta_feldfunktion", "ff_name")); $this->to_idta_feldfunktion->dataBind(); $PeriodPullDown = new PFPeriodPullDown(); $PeriodPullDown->setStructureTable("ta_perioden"); $PeriodPullDown->setRecordClass(PeriodenRecord::finder()); $PeriodPullDown->setPKField("idta_perioden"); $PeriodPullDown->setSQLCondition("per_intern > 9999"); $PeriodPullDown->setField("per_extern"); $PeriodPullDown->letsrun(); $this->DWH_idta_perioden->DataSource = $PeriodPullDown->myTree; $this->DWH_idta_perioden->dataBind(); $this->DWH_idta_variante->DataSource = PFH::build_SQLPullDown(VarianteRecord::finder(), "ta_variante", array("idta_variante", "var_descr")); $this->DWH_idta_variante->dataBind(); }
function display_options($tree) { if (is_array($tree)) { foreach ($tree as $value) { $PeriodRecord = PeriodenRecord::finder()->findByidta_perioden($value[$this->PKField]); $PeriodKey = $PeriodRecord->per_intern; $sufix = ''; if ($PeriodKey < 10000) { $sufix = PeriodenRecord::finder()->findByidta_perioden($PeriodRecord->parent_idta_perioden)->per_extern; } $displayvalue = $value[$this->FieldName] . ' ' . $sufix; $this->myTree[$PeriodKey] = $displayvalue; } } }
public function initPullDowns($sender, $param) { $this->idta_variante->DataSource = VarianteRecord::finder()->findAll(); $this->idta_variante->dataBind(); $this->idta_perioden->DataSource = PeriodenRecord::finder()->findAll(); $this->idta_perioden->dataBind(); $this->idta_feldfunktion->DataSource = FeldfunktionRecord::finder()->findAll(); $this->idta_feldfunktion->dataBind(); $this->cuf_numberformat->DataSource = array("0" => "Ganzzahl", "1" => "Prozent", "2" => "Zahl"); $this->cuf_numberformat->dataBind(); $criteria = new TActiveRecordCriteria(); $criteria->OrdersBy['idta_stammdaten_group'] = 'desc'; $this->idtm_stammdaten->DataSource = StammdatenRecord::finder()->findAll($criteria); $this->idtm_stammdaten->dataBind(); }