Example #1
0
 public function bindListTermine()
 {
     $today = date("Y-m-d");
     $SQL = "SELECT tm_termin.* FROM tm_termin INNER JOIN tm_termin_organisation ON tm_termin.idtm_termin = tm_termin_organisation.idtm_termin WHERE tm_termin_organisation.idtm_organisation='" . $this->User->getUserOrgId($this->User->getUserId()) . "' ORDER BY ter_startdate ASC";
     $this->lstTermine->DataSource = TerminRecord::finder()->findAllBySQL($SQL);
     $this->lstTermine->dataBind();
 }
 /**
  *
  * @param <int> $ResZeitID The time id, passed by the repeater: 61 => 15:00 -> 15*4+1
  * @param <int> $idtm_ressource The Key-Field for the Ressource
  */
 public function checkRessourceStatus($ResZeitID, $idtm_organisation)
 {
     $filterDate = date('Y-m-d', $this->res_selected_date->TimeStamp);
     //the calculation of the time-string
     $hourresult = round(($ResZeitID - 1) / 4 - 0.26, 0);
     $minuteresult = round((($ResZeitID - 1) / 4 - $hourresult) * 60 + 1, 0);
     $mySQL = "SELECT tm_termin.* FROM tm_termin INNER JOIN vv_termin_organisation ON tm_termin.idtm_termin = vv_termin_organisation.idtm_termin WHERE ter_starttime <= '" . $hourresult . ":" . $minuteresult . "'";
     $mySQL .= " AND ter_endtime >= '" . $hourresult . ":" . $minuteresult . "' AND idtm_organisation = " . $idtm_organisation . " AND ter_startdate = DATE('" . $filterDate . "')";
     //print_r($mySQL);
     $Results = TerminRecord::finder()->findAllBySQL($mySQL);
     if (count($Results) >= 1) {
         return "resFull";
     } else {
         return "resFree";
     }
 }
 public function onPreInit($param)
 {
     if (isset($_GET['idtm_termin'])) {
         $TerminRecord = TerminRecord::finder()->findByPK($_GET['idtm_termin']);
     } else {
         echo "Kein Termin";
         exit;
     }
     date_default_timezone_set('Europe/Berlin');
     $v = new vcalendar();
     // initiate new CALENDAR
     $v->setConfig('pliq_hpartner', 'planlogiq.com');
     // config with site domain
     $e = new vevent();
     // initiate a new EVENT
     $SDateArray = explode('-', $TerminRecord->ter_startdate);
     $EDateArray = explode('-', $TerminRecord->ter_enddate);
     $STimeArray = explode(':', $TerminRecord->ter_starttime);
     $ETimeArray = explode(':', $TerminRecord->ter_endtime);
     $e->setProperty('categories', ActivityRecord::finder()->findByPK($TerminRecord->idtm_activity)->act_name);
     // catagorize
     $e->setProperty('dtstart', $SDateArray[0], $SDateArray[1], $SDateArray[2], $STimeArray[0], $STimeArray[1], 00);
     // 24 dec 2006 19.30
     $e->setProperty('dtend', $EDateArray[0], $EDateArray[1], $EDateArray[2], $ETimeArray[0], $ETimeArray[1], 00);
     // 24 dec 2006 19.30
     //$e->setProperty( 'duration'
     //               , 0, 0, 3 );                    // 3 hours
     $e->setProperty('summary', $TerminRecord->ter_betreff);
     // describe the event
     $e->setProperty('description', $TerminRecord->ter_descr);
     // describe the event
     $e->setProperty('location', $TerminRecord->ter_ort);
     // locate the event
     $v->addComponent($e);
     // add component to calendar
     /* alt. production */
     // $v->returnCalendar();                       // generate and redirect output to user browser
     /* alt. dev. and test */
     $str = $v->createCalendar();
     // generate and get output in string, for testing?
     $this->getResponse()->appendHeader("Content-Type:" . $this->header);
     $this->getResponse()->appendHeader("Content-Disposition:inline;filename=" . $this->docName . '.' . $this->ext);
     echo $str;
     $writer->save('php://output');
     exit;
 }
 public function initPullDown()
 {
     $this->idta_protokoll_ergebnistype->dataSource = PFH::build_SQLPullDown(ProtokollErgebnistypeRecord::finder(), "ta_protokoll_ergebnistype", array("idta_protokoll_ergebnistype", "prt_ergtype_name"));
     $this->idta_protokoll_ergebnistype->dataBind();
     $HRKEYTest = new PFHierarchyPullDown();
     $HRKEYTest->setStructureTable("tm_activity");
     $HRKEYTest->setRecordClass(ActivityRecord::finder());
     $HRKEYTest->setPKField("idtm_activity");
     $HRKEYTest->setField("act_name");
     $CheckStart = TerminRecord::finder()->findByPK($this->page->edidtm_termin->Text)->idtm_activity;
     if ($CheckStart > 0) {
         $HRKEYTest->setStartNode($CheckStart);
     }
     $HRKEYTest->letsrun();
     $this->idtm_activity->DataSource = $HRKEYTest->myTree;
     $this->idtm_activity->dataBind();
 }
Example #5
0
 public function lstCCPrtRepSave($sender, $param)
 {
     $item = $param->Item;
     $RCEditRecord = ProtokollDetailRecord::finder()->findByPK($item->idtm_protokoll_detail->Text);
     $RCEditRecord->prtdet_descr = $item->prtdet_descr->Text;
     $RCEditRecord->prtdet_topic = $item->prtdet_topic->Text;
     $RCEditRecord->prtdet_wvl = $item->prtdet_wvl->Checked ? 1 : 0;
     $RCEditRecord->idtm_protokoll = $item->idtm_protokoll->Text;
     $RCEditRecord->idta_protokoll_ergebnistype = $item->idta_protokoll_ergebnistype->Text;
     if ($item->idtm_activity->Text == 0 or $item->idtm_activity->Text == '') {
         $CheckStart = TerminRecord::finder()->findByPK($this->page->edidtm_termin->Text)->idtm_activity;
         if ($CheckStart > 0) {
             $RCEditRecord->idtm_activity = $CheckStart;
         }
     } else {
         $RCEditRecord->idtm_activity = $item->idtm_activity->Text;
     }
     $RCEditRecord->save();
     $sender->EditItemIndex = -1;
     $this->load_prtdetailsgroup();
 }
Example #6
0
 public function TSavedButtonClicked($sender, $param)
 {
     $tempus = $this->primarykey;
     if ($this->termin_edit_status->Text == '1') {
         $AEditRecord = TerminRecord::finder()->findByPK($this->{$tempus}->Text);
     } else {
         $AEditRecord = new TerminRecord();
     }
     //HIDDEN
     foreach ($this->hiddenfields as $recordfield) {
         $edrecordfield = $recordfield;
         $AEditRecord->{$recordfield} = $this->{$edrecordfield}->Value;
     }
     //DATUM
     foreach ($this->datfields as $recordfield) {
         $edrecordfield = $recordfield;
         $AEditRecord->{$recordfield} = date('Y-m-d', $this->{$edrecordfield}->TimeStamp);
     }
     //LIST
     foreach ($this->listfields as $recordfield) {
         $edrecordfield = $recordfield;
         $AEditRecord->{$recordfield} = $this->{$edrecordfield}->Text;
     }
     //BOOL
     foreach ($this->boolfields as $recordfield) {
         $edrecordfield = $recordfield;
         $AEditRecord->{$recordfield} = $this->{$edrecordfield}->Checked ? 1 : 0;
     }
     foreach ($this->timefields as $recordfield) {
         $edrecordfield = $recordfield;
         $AEditRecord->{$recordfield} = $this->{$edrecordfield}->Text;
     }
     foreach ($this->fields as $recordfield) {
         $edrecordfield = $recordfield;
         $AEditRecord->{$recordfield} = $this->{$edrecordfield}->Text;
     }
     $AEditRecord->save();
     $this->bindListTermin();
     $this->ParticipantbindList();
     $this->RessourcebindList();
     $this->termin_edit_status->Text = 1;
     $this->idtm_termin->Text = $AEditRecord->idtm_termin;
     $this->getPage()->getClientScript()->registerEndScript('xdhxs', "scheduler.load('" . $this->getRequest()->constructUrl('page', 'termin.TerminConnector') . "')");
 }