Example #1
0
 public function importTASK($data)
 {
     $Aufgabe = new AufgabenRecord();
     $Aufgabe->auf_tdate = $data[0];
     $Aufgabe->auf_cdate = date($data[0]);
     $Aufgabe->auf_tag = $data[3];
     $Aufgabe->auf_name = 'AC Imp';
     $Aufgabe->auf_zeichen_eigen = utf8_encode($data[7]);
     $Aufgabe->auf_zeichen_fremd = '';
     $Aufgabe->idta_aufgaben_type = 1;
     $Aufgabe->idtm_organisation = $this->responsible_idtm_organisation->Text;
     $Aufgabe->auf_tabelle = "tm_organisation";
     if ($data[2] * 1 < 1000) {
         $data[2] = '0' . $data[2];
     }
     $Organisation = OrganisationRecord::finder()->findByorg_fk_internal('0' . trim($data[2]));
     if (count($Organisation) == 1) {
         $Aufgabe->auf_id = $Organisation->idtm_organisation;
     } else {
         $Aufgabe->auf_id = $this->responsible_idtm_organisation->Text;
     }
     $Aufgabe->auf_done = $data[6];
     if ($data[5] != '') {
         $Aufgabe->auf_ddate = $data[5];
     } else {
         $Aufgabe->auf_ddate = $data[0];
     }
     $html_string = "<b>" . utf8_encode($data[8]) . "</b><br/>";
     $html_string .= utf8_encode($data[9]) . "<br/>";
     $html_string .= "<b>" . utf8_encode($data[10]) . "</b><br/>";
     $html_string .= utf8_encode($data[11]);
     $Aufgabe->auf_beschreibung = $html_string;
     $Aufgabe->save();
     unset($Aufgabe, $Organisation);
 }
Example #2
0
 public function bindListAufgaben()
 {
     $criteria = new TActiveRecordCriteria();
     $criteria->Condition = "auf_tabelle = 'tm_activity' AND auf_id = :suchtext1";
     $criteria->Parameters[':suchtext1'] = $this->idtm_activity;
     $this->RepAufgabenListe->DataSource = AufgabenRecord::finder()->findAll($criteria);
     $this->RepAufgabenListe->dataBind();
 }
 public function setTaskDone($sender, $param)
 {
     $AufgabenRecord = AufgabenRecord::finder()->findByPK($this->DMSFileId->Text);
     if ($AufgabenRecord->auf_done == 0) {
         $AufgabenRecord->auf_done = 1;
     } else {
         $AufgabenRecord->auf_done = 0;
     }
     $AufgabenRecord->save();
     $this->parent->parent->parent->bindListTAValue();
 }
 private function LetterContent($idtm_protokoll)
 {
     $SQL = "SELECT idtm_protokoll_detail_group FROM ta_protokoll_detail_group WHERE idtm_protokoll = " . $idtm_protokoll;
     $execSQL = "SELECT * FROM vv_protokoll_detail WHERE idtm_protokoll_detail_group IN (" . $SQL . ") ORDER BY idtm_protokoll_detail DESC";
     $ProtokollDetails = ProtokollDetailView::finder()->findAllBySQL($execSQL);
     $this->pdf->Ln(10);
     $this->pdf->SetX(25);
     $this->pdf->SetFillColor(234, 242, 220);
     $this->pdf->SetDrawColor(234, 242, 220);
     $this->pdf->SetFont('Helvetica', '', 12);
     $this->pdf->Cell(185, 6, strtoupper('Protokoll'), 0, 1);
     $this->InternalCounter++;
     foreach ($ProtokollDetails as $ProtokollDetail) {
         $this->pdf->Ln(7);
         $this->pdf->SetX(25);
         $this->pdf->SetFont('Arial', '', 11);
         $this->pdf->SetFillColor(116, 145, 97);
         $this->pdf->SetDrawColor(116, 145, 97);
         $this->pdf->SetTextColor(0, 0, 0);
         $this->pdf->Cell(150, 4, $this->InternalCounter . ' \\\\ ' . utf8_decode($ProtokollDetail->prtdet_topic), 'B', 1);
         $this->InternalCounter++;
         $this->pdf->SetLeftMargin(25);
         $this->pdf->SetFillColor(255, 255, 255);
         $this->pdf->SetTextColor(0, 0, 0);
         $myHTML = $this->wiki2html($ProtokollDetail->prtdet_descr);
         $this->pdf->WriteHTML(utf8_decode($myHTML));
         if ($ProtokollDetail->idta_protokoll_ergebnistype < 3) {
             $SubSQL = "SELECT * FROM tm_aufgaben WHERE auf_tabelle = 'tm_protokoll_detail' AND auf_id = " . $ProtokollDetail->idtm_protokoll_detail . " AND auf_deleted = 0";
             $PrtSubAufagben = AufgabenRecord::finder()->findAllBySQL($SubSQL);
             foreach ($PrtSubAufagben as $PrtAufgabe) {
                 $this->pdf->SetFont('Arial', '', 10);
                 $this->pdf->Cell(5, 5, '\\\\', 0, 0);
                 $this->pdf->SetTextColor(217, 0, 0);
                 $this->pdf->Cell(145, 5, ' Auftrag', 0, 1);
                 $this->pdf->SetFillColor(255, 255, 255);
                 $this->pdf->SetFont('Arial', '', 10);
                 $this->pdf->SetTextColor(43, 51, 43);
                 $this->pdf->MultiCell(150, 6, utf8_decode($PrtAufgabe->auf_beschreibung), 0, 1);
                 $this->pdf->SetDrawColor(217, 0, 0);
                 $this->pdf->Cell(90, 5, ' Wer', 'B', 0);
                 $this->pdf->Cell(30, 5, ' Bis', 'B', 0);
                 $this->pdf->Cell(30, 5, ' Erledigt', 'B', 1);
                 $this->pdf->Cell(90, 8, " " . utf8_decode(OrganisationRecord::finder()->findByPk($PrtAufgabe->idtm_organisation)->org_name), 0, 0);
                 $this->pdf->Cell(30, 8, $PrtAufgabe->auf_tdate, 0, 0);
                 $this->pdf->Cell(30, 8, $PrtAufgabe->auf_done == 1 ? $PrtAufgabe->auf_ddate : '-', 0, 1);
             }
             $SubSQL = "";
         }
     }
 }
 public function TASavedButtonClicked($sender, $param)
 {
     $tempus = 'Ted' . $this->RCprimarykey;
     if ($this->Tedaufgaben_edit_status->Text == '1') {
         $RCEditRecord = AufgabenRecord::finder()->findByPK($this->{$tempus}->Text);
     } else {
         $RCEditRecord = new AufgabenRecord();
     }
     //HIDDEN
     foreach ($this->RChiddenfields as $recordfield) {
         $edrecordfield = 'Ted' . $recordfield;
         $RCEditRecord->{$recordfield} = $this->{$edrecordfield}->Value;
     }
     //DATUM
     foreach ($this->RCdatfields as $recordfield) {
         $edrecordfield = 'Ted' . $recordfield;
         $RCEditRecord->{$recordfield} = date('Y-m-d', $this->{$edrecordfield}->TimeStamp);
     }
     //BOOL
     foreach ($this->RCboolfields as $recordfield) {
         $edrecordfield = 'Ted' . $recordfield;
         $RCEditRecord->{$recordfield} = $this->{$edrecordfield}->Checked ? 1 : 0;
     }
     foreach ($this->RCtimefields as $recordfield) {
         $edrecordfield = 'Ted' . $recordfield;
         $RCEditRecord->{$recordfield} = $this->{$edrecordfield}->Text;
     }
     foreach ($this->RCfields as $recordfield) {
         $edrecordfield = 'Ted' . $recordfield;
         $RCEditRecord->{$recordfield} = $this->{$edrecordfield}->Text;
     }
     $RCEditRecord->save();
     $this->bindListTAValue();
 }
 public function editPrtAufgabe($sender, $param)
 {
     if ($param->CommandName == "edit") {
         $this->prtAufgabenDialog->setDisplay("Dynamic");
         $this->initPullDowns();
         $AufgabeRecord = AufgabenRecord::finder()->findByPK($param->CommandParameter);
         $this->Tedidtm_aufgaben->Text = $AufgabeRecord->idtm_aufgaben;
         $this->Tedauf_tabelle->Text = $AufgabeRecord->auf_tabelle;
         $this->Tedauf_id->Text = $AufgabeRecord->auf_id;
         $this->idtm_organisation->Text = $AufgabeRecord->idtm_organisation;
         $this->auf_idtm_organisation->Text = $AufgabeRecord->auf_idtm_organisation;
         $this->auf_priority->Text = $AufgabeRecord->auf_priority;
         $this->auf_dauer->Text = $AufgabeRecord->auf_dauer;
         //$AEditRecord->auf_name = $this->prtdet_topic->Text;
         $this->auf_beschreibung->Text = $AufgabeRecord->auf_beschreibung;
         $this->auf_tdate->setDate($AufgabeRecord->auf_tdate);
         $this->auf_ddate->setDate($AufgabeRecord->auf_ddate);
         $this->auf_done->setChecked($AufgabeRecord->auf_done);
         $this->Tedauf_edit_status->Text = 1;
         $this->AddOrSaveButtonPRTAUF->Text = "speichern";
         $this->getPage()->getClientScript()->registerEndScript('XCOL', "constructCollapsableFieldsets();");
     }
     if ($param->CommandName == "taskdone") {
         $tmpstartdate = new DateTime();
         $AufgabenRecord = AufgabenRecord::finder()->findByPK($param->CommandParameter);
         $AufgabenRecord->auf_done = 1;
         $AufgabenRecord->auf_ddate = $tmpstartdate->format("Y-m-d");
         $AufgabenRecord->save();
         $this->bindListPrtAufgaben();
     }
     if ($param->CommandName == "mail") {
         $Aufgabe = AufgabenRecord::finder()->findByPK($param->CommandParameter);
         $MailEmpfaenger = OrganisationRecord::finder()->findByPk($Aufgabe->idtm_organisation);
         $mail = new PHPMailer();
         $mail->From = "*****@*****.**";
         $mail->FromName = "planlogIQ";
         $mail->Host = "smtp.1und1.de";
         $mail->Mailer = "smtp";
         $mail->SMTPAuth = true;
         $mail->IsSendmail();
         //nur bei 1und1
         $mail->Username = "******";
         $mail->Password = "";
         $mail->AddAddress(KommunikationRecord::finder()->find('idtm_organisation=? AND kom_ismain=1 AND kom_type = 3', $Aufgabe->idtm_organisation)->kom_information, $MailEmpfaenger->org_name);
         $mail->Subject = $Aufgabe->auf_name;
         $HTMLMessage = "Sehr geehrte(r) Frau/Herr " . $MailEmpfaenger->org_name . ",<br/><br/>";
         $HTMLMessage .= "die folgende Aufgabe wurde Ihnen zugeordnet:<br/>";
         $HTMLMessage .= "<p><table><tr><td bgcolor='#efefef'>Task Nr.:</td><td>" . $Aufgabe->idtm_aufgaben . " </td><td bgcolor='#efefef'>Thema: </td><td>" . utf8_decode($Aufgabe->auf_name) . "</td></tr>";
         $HTMLMessage .= "<tr><td bgcolor='#efefef'>Bis:</td><td colspan='3'><b>" . $Aufgabe->auf_tdate . "</b></td></tr></table>";
         //$HTMLMessage.="<p style='background-color:#efefef'><hr/>".utf8_decode($Aufgabe->prtdet_descr)."</p>";
         $HTMLMessage .= "<p style='background-color:#efefef'><hr/>" . utf8_decode($Aufgabe->auf_beschreibung) . "<hr/></p>";
         $HTMLMessage .= "Bitte nicht Antworten! Diese Mail wurde automatisch generiert...";
         $mail->MsgHTML($HTMLMessage);
         if (!$mail->Send()) {
             $this->getPage()->getClientScript()->registerEndScript('XER', "alert('Fehler!');");
         } else {
             $this->getPage()->getClientScript()->registerEndScript('XER', "alert('Done')");
         }
     }
 }
 public function bindRepeaterAufgabenZiele($sender, $param)
 {
     $item = $param->Item;
     if ($item->ItemType === 'Item' || $item->ItemType === 'AlternatingItem') {
         $criteria = new TActiveRecordCriteria();
         $criteria->Condition = "auf_tabelle = :suchtext1 AND auf_id = :suchtext2";
         $criteria->Parameters[':suchtext1'] = "tt_ziele";
         $criteria->Parameters[':suchtext2'] = $item->Data->idtt_ziele;
         $item->RepAufZiele->DataSource = AufgabenRecord::finder()->findAll($criteria);
         $item->RepAufZiele->dataBind();
     }
 }
 private function ContentSubject($idtm_aufgaben)
 {
     $Aufgabe = AufgabenRecord::finder()->findByidtm_aufgaben($idtm_aufgaben);
     $this->pdf->SetXY(135, 102);
     $this->pdf->Cell(60, 0, $Aufgabe->auf_cdate, 0);
     $this->pdf->SetY(102);
     $this->pdf->SetX(24);
     $this->pdf->SetFont('Arial', 'B', 12);
     $subject = 'Betreff: ' . $Aufgabe->auf_name;
     $this->pdf->Cell(0, 10, $subject);
     $this->pdf->Ln(15);
 }
Example #9
0
 public function DetailGroupDone($sender, $param)
 {
     $tmpstartdate = new DateTime();
     $AufgabenRecord = AufgabenRecord::finder()->find('auf_tabelle = ? AND auf_id = ?', 'tm_protokoll_detail', $param->CallbackParameter);
     $AufgabenRecord->auf_done = 1;
     $AufgabenRecord->auf_ddate = $tmpstartdate->format("Y-m-d");
     $AufgabenRecord->save();
     $this->bindActivityProtokollListe($this->edidtm_activity->Text);
 }
Example #10
0
 public function removeDetailGroup($sender, $param)
 {
     $deleteRecord = ProtokollDetailRecord::finder();
     $deleteRecord->deleteByidtm_protokoll_detail($param->CallbackParameter);
     $deleteAufgabe = AufgabenRecord::finder();
     $deleteAufgabe->deleteAll('auf_tabelle = ? AND auf_id = ?', 'tm_protokoll_detail', $param->CallbackParameter);
     $this->load_prtdetailsgroup();
 }
 public function lstCCAufgabenRepeaterSave($sender, $param)
 {
     $item = $param->Item;
     $RCEditRecord = AufgabenRecord::finder()->findByidtm_aufgaben($item->Tedidtm_aufgaben->Text);
     $temp_idta_aufgaben_type = $RCEditRecord->idta_aufgaben_type;
     //HIDDEN
     foreach ($this->RChiddenfields as $recordfield) {
         $edrecordfield = 'Ted' . $recordfield;
         $RCEditRecord->{$recordfield} = $item->{$edrecordfield}->Value;
     }
     //DATUM
     foreach ($this->RCdatfields as $recordfield) {
         $edrecordfield = 'Ted' . $recordfield;
         $RCEditRecord->{$recordfield} = date('Y-m-d', $item->{$edrecordfield}->TimeStamp);
     }
     //BOOL
     foreach ($this->RCboolfields as $recordfield) {
         $edrecordfield = 'Ted' . $recordfield;
         $RCEditRecord->{$recordfield} = $item->{$edrecordfield}->Checked ? 1 : 0;
     }
     foreach ($this->RCtimefields as $recordfield) {
         $edrecordfield = 'Ted' . $recordfield;
         $RCEditRecord->{$recordfield} = $item->{$edrecordfield}->Text;
     }
     foreach ($this->RCfields as $recordfield) {
         $edrecordfield = 'Ted' . $recordfield;
         $RCEditRecord->{$recordfield} = $item->{$edrecordfield}->Text;
     }
     if ($item->Tedidta_aufgaben_type->Text == '') {
         $RCEditRecord->idta_aufgaben_type = $temp_idta_aufgaben_type;
     }
     $RCEditRecord->save();
     $this->CCAufgabenRepeater->EditItemIndex = -1;
     if ($this->Tedidtm_aufgaben_single->Text == 0) {
         $this->bindListTAValue();
     } else {
         $this->bindListTAValue($this->Tedidtm_aufgaben->Text);
     }
     $this->session['loadCounter'] = 0;
 }