Example #1
0
 public function onInit($param)
 {
     parent::onInit($param);
     //Globale definition f�r dieses Dokument
     $this->finder = StrukturRecord::finder();
     $this->MASTERRECORD = new StrukturRecord();
     if (!$this->isPostBack && !$this->isCallback) {
         switch ($this->Request['modus']) {
             case 0:
                 $sql = "SELECT idta_struktur_type, struktur_type_name FROM ta_struktur_type";
                 $data = PFH::convertdbObjectArray(StrukturTypeRecord::finder()->findAllBySql($sql), array("idta_struktur_type", "struktur_type_name"));
                 $this->idta_struktur_type->DataSource = $data;
                 $this->idta_struktur_type->dataBind();
                 $HRKEYTest = new PFHierarchyPullDown();
                 $HRKEYTest->setStructureTable("tm_struktur");
                 $HRKEYTest->setRecordClass(StrukturRecord::finder());
                 $HRKEYTest->setPKField("idtm_struktur");
                 $HRKEYTest->setField("struktur_name");
                 $HRKEYTest->letsrun();
                 $this->parent_idtm_struktur->DataSource = $HRKEYTest->myTree;
                 $this->parent_idtm_struktur->dataBind();
                 $this->idtm_stammdaten->DataSource = PFH::build_SQLPullDown(StammdatenRecord::finder(), "tm_stammdaten", array("idtm_stammdaten", "stammdaten_name"));
                 $this->idtm_stammdaten->dataBind();
                 break;
             case 1:
                 $sql = "SELECT idta_struktur_type, struktur_type_name FROM ta_struktur_type";
                 $data = PFH::convertdbObjectArray(StrukturTypeRecord::finder()->findAllBySql($sql), array("idta_struktur_type", "struktur_type_name"));
                 $this->edidta_struktur_type->DataSource = $data;
                 $this->edidta_struktur_type->dataBind();
                 if ($this->Request[$this->primarykey] != 1) {
                     $HRKEYTest = new PFHierarchyPullDown();
                     $HRKEYTest->setStructureTable("tm_struktur");
                     $HRKEYTest->setRecordClass(StrukturRecord::finder());
                     $HRKEYTest->setPKField("idtm_struktur");
                     $HRKEYTest->setField("struktur_name");
                     $HRKEYTest->letsrun();
                     $data = $HRKEYTest->myTree;
                 } else {
                     $data = array();
                     $data[0] = "START";
                 }
                 $this->edparent_idtm_struktur->DataSource = $data;
                 $this->edparent_idtm_struktur->dataBind();
                 $this->fillValues($this->getSelected($this->Request[$this->primarykey]));
                 $this->edidtm_stammdaten->DataSource = PFH::build_SQLPullDown(StammdatenRecord::finder(), "tm_stammdaten", array("idtm_stammdaten", "stammdaten_name"));
                 $this->edidtm_stammdaten->dataBind();
                 $Usersql = "SELECT idtm_user, user_name FROM tm_user";
                 $Userdata = PFH::convertdbObjectArray(UserRecord::finder()->findAllBySql($Usersql), array("idtm_user", "user_name"));
                 $this->idtm_user->DataSource = $Userdata;
                 $this->idtm_user->dataBind();
                 $this->loadBerechtigung();
                 break;
             default:
                 break;
         }
         $this->viewPanel->ActiveViewIndex = $this->Request['modus'];
         $this->StrukturStammdatenGroupContainer->RCedidtm_struktur->Text = $this->Request[$this->primarykey];
     }
 }
 public function buildStammdatenGroupPullDown()
 {
     $this->RCedidta_struktur_type->DataSource = PFH::build_SQLPullDown(StrukturTypeRecord::finder(), "ta_struktur_type", array("idta_struktur_type", "struktur_type_name"));
     $this->RCedidta_struktur_type->dataBind();
     $Usersql = "SELECT idtm_user, user_name FROM tm_user";
     $Userdata = PFH::convertdbObjectArray(UserRecord::finder()->findAllBySql($Usersql), array("idtm_user", "user_name"));
     $this->idtm_user->DataSource = $Userdata;
     $this->idtm_user->dataBind();
 }
 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;
 }
Example #4
0
 public function RCSavedButtonClicked($sender, $param)
 {
     $tempus = $this->PREFIX . $this->RCprimarykey;
     if ($this->strukturtype_edit_status->Text == '1') {
         $RCEditRecord = StrukturTypeRecord::finder()->findByPK($this->{$tempus}->Text);
     } else {
         $RCEditRecord = new StrukturTypeRecord();
     }
     //HIDDEN
     foreach ($this->RChiddenfields as $recordfield) {
         $edrecordfield = $this->PREFIX . $recordfield;
         $RCEditRecord->{$recordfield} = $this->{$edrecordfield}->Value;
     }
     //DATUM
     foreach ($this->RCdatfields as $recordfield) {
         $edrecordfield = $this->PREFIX . $recordfield;
         $RCEditRecord->{$recordfield} = date('Y-m-d', $this->{$edrecordfield}->TimeStamp);
     }
     //BOOL
     foreach ($this->RCboolfields as $recordfield) {
         $edrecordfield = $this->PREFIX . $recordfield;
         $RCEditRecord->{$recordfield} = $this->{$edrecordfield}->Checked ? 1 : 0;
     }
     foreach ($this->RCtimefields as $recordfield) {
         $edrecordfield = $this->PREFIX . $recordfield;
         $RCEditRecord->{$recordfield} = $this->{$edrecordfield}->Text;
     }
     foreach ($this->RCfields as $recordfield) {
         $edrecordfield = $this->PREFIX . $recordfield;
         $RCEditRecord->{$recordfield} = $this->{$edrecordfield}->Text;
     }
     $RCEditRecord->save();
     $this->bindListStrukturTypen();
 }