コード例 #1
0
ファイル: Todo.class.php プロジェクト: nemiah/fheME
 public function saveMe($checkUserData = true, $output = false, $update = true)
 {
     $old = new Todo($this->getID());
     $old->loadMe();
     #$fromDay = date("Y-m-d", Util::CLDateParser($this->A("TodoFromDay"), "store"));
     #$fromTime = Util::formatTime("de_DE", Util::CLTimeParser($this->A("TodoFromTime"), "store"));
     #die($this->getID());
     if ($update) {
         $this->changeA("TodoLastChange", time());
         $this->changeA("TodoReminded", "0");
     }
     #$name = $this->getOwnerObject()->getCalendarTitle();
     if ($this->A("TodoAllDay")) {
         $this->changeA("TodoFromTime", Util::CLTimeParser(0));
         $this->changeA("TodoTillTime", Util::CLTimeParser(0));
     }
     if ($this->A("TodoRepeatWeekOfMonth") > 0 and $this->A("TodoRepeatWeekOfMonth") != 127) {
         $D = new Datum($this->hasParsers ? Util::CLDateParser($this->A("TodoFromDay"), "store") : $this->A("TodoFromDay"));
         $nthDay = $D->getNthDayOfMonth();
         if ($nthDay > 4) {
             $nthDay = 4;
         }
         $this->changeA("TodoRepeatWeekOfMonth", $nthDay);
     }
     if ($this->A("TodoClass") != "" and $this->A("TodoClass") != "Kalender" and $this->A("TodoName") == "") {
         $this->changeA("TodoName", $this->getOwnerObject()->getCalendarTitle());
     }
     if (Session::isPluginLoaded("mAufgabe") and ($this->A("TodoType") == 3 or $this->A("TodoType") == 4 or $this->A("TodoType") == 5) and $this->A("TodoUserID") > 0) {
         $F = new Factory("Aufgabe");
         $F->sA("AufgabeByClass", "Todo");
         $F->sA("AufgabeByClassID", $this->getID());
         $E = $F->exists(true);
         if (!$E) {
             $F->sA("AufgabeUserID", $this->A("TodoUserID"));
             $F->sA("AufgabeText", "Bericht für Termin '" . $this->A("TodoName") . "' eintragen");
             $F->sA("AufgabeCreated", time());
             if ($this->A("TodoDoneTime") > 0) {
                 $F->sA("AufgabeStatus", "5");
                 $F->sA("AufgabeDone", time());
             }
             if ($this->hasParsers) {
                 $F->sA("AufgabeUntil", Util::CLDateParser($this->A("TodoFromDay"), "store"));
                 $F->sA("AufgabeUhrzeitVon", Util::CLTimeParser($this->A("TodoTillTime"), "store"));
             } else {
                 $F->sA("AufgabeUntil", $this->A("TodoFromDay"));
                 $F->sA("AufgabeUhrzeitVon", $this->A("TodoTillTime"));
             }
             $F->store();
         } else {
             $E->changeA("AufgabeText", "Bericht für Termin '" . $this->A("TodoName") . "' eintragen");
             if ($this->hasParsers) {
                 $E->changeA("AufgabeUntil", Util::CLDateParser($this->A("TodoFromDay"), "store"));
                 $E->changeA("AufgabeUhrzeitVon", Util::CLTimeParser($this->A("TodoTillTime"), "store"));
             } else {
                 $E->changeA("AufgabeUntil", $this->A("TodoFromDay"));
                 $E->changeA("AufgabeUhrzeitVon", $this->A("TodoTillTime"));
             }
             if ($this->A("TodoDoneTime") > 0) {
                 $E->changeA("AufgabeStatus", "5");
                 $E->changeA("AufgabeDone", time());
             }
             $E->saveMe();
         }
     }
     parent::saveMe($checkUserData, false);
     if (Session::isPluginLoaded("mGoogle") and $this->updateGoogle) {
         $KE = mTodoGUI::getCalendarDetails("Todo", $this->getID());
         if ($this->A("TodoUserID") == Session::currentUser()->getID()) {
             if ($old->A("TodoUserID") == $this->A("TodoUserID")) {
                 Google::calendarUpdateEvent(mTodoGUI::getCalendarDetails("Todo", $this->getID()));
             } else {
                 Google::calendarDeleteEvent($KE);
                 #"Todo", $this->getID());
                 Google::calendarCreateEvent($KE);
             }
         } else {
             Google::calendarDeleteEvent($KE);
             #"Todo", $this->getID());
             Google::calendarCreateEvent($KE, $this->A("TodoUserID"));
         }
     }
 }
コード例 #2
0
ファイル: mTodoGUI.class.php プロジェクト: nemiah/fheME
 public function editRepeatable($todoID)
 {
     $F = new HTMLForm("RepeatableForm", array("TodoRepeat", "TodoRepeatWeekOfMonth", "TodoRepeatDayOfWeek", "TodoRepeatInterval", "TodoRepeatUntil"), "Wiederholungen");
     $F->getTable()->setColWidth(1, 120);
     $T = new Todo($todoID);
     $F->setValues($T);
     $F->setValue("TodoRepeatUntil", Util::CLDateParserE($T->A("TodoRepeatUntil")));
     $F->setLabel("TodoRepeat", "Wiederholen");
     $F->setLabel("TodoRepeatWeekOfMonth", "Tag");
     $F->setLabel("TodoRepeatDayOfWeek", "Tage");
     $F->setLabel("TodoRepeatInterval", "Intervall");
     $F->setLabel("TodoRepeatDayOfWeek", "Tage");
     $F->setLabel("TodoRepeatUntil", "Bis");
     $F->setType("TodoRepeatInterval", "select", null, array("Wöchentlich", "Jede 2. Woche", "Jede 3. Woche", "Jede 4. Woche"));
     $F->setType("TodoRepeatUntil", "date");
     #$currentWeek = ceil((date("d", $T->A("TodoFromDay")) - date("w", $T->A("TodoFromDay")) - 1) / 7) + 1;
     #echo $currentWeek;
     $D = new Datum($T->A("TodoFromDay"));
     $nthDay = $D->getNthDayOfMonth();
     if ($nthDay > 4) {
         $nthDay = 4;
     }
     $weeks = array(0 => "am " . date("d", $T->A("TodoFromDay")) . ". jeden Monats");
     $weeks[$nthDay] = "jeden {$nthDay}. " . Util::CLWeekdayName(date("w", $T->A("TodoFromDay"))) . " des Monats";
     $weeks[127] = "am letzten Tag des Monats";
     $F->setType("TodoRepeat", "select", "", Todo::$repeatTypes);
     $F->setType("TodoRepeatWeekOfMonth", "select", "", $weeks);
     #$F->setType("TodoRepeatDayOfWeek", "checkbox");
     $F->setType("TodoRepeatDayOfWeek", "parser", $T->A("TodoRepeatDayOfWeek"), array("mTodoGUI::parserDayOfWeek"));
     $F->hideIf("TodoRepeat", "!=", "monthly", "onchange", array("TodoRepeatWeekOfMonth"));
     $F->hideIf("TodoRepeat", "!=", "daily", "onchange", array("TodoRepeatDayOfWeek"));
     $F->hideIf("TodoRepeat", "!=", "weekly", "onchange", array("TodoRepeatInterval", "TodoRepeatUntil"));
     $F->setSaveClass("Todo", $todoID, "function(){ /*\$j('#eventAdditionalContent').slideUp();*/ contentManager.reloadFrame('contentScreen'); Kalender.refreshInfoPopup(); }", "Aktivität");
     return $F;
 }