Exemple #1
0
 public function getInvitees($TodoID)
 {
     $AC = anyC::get("TodoInvitation", "TodoInvitationTodoID", $TodoID);
     $AC->addOrderV3("TodoInvitationID", "DESC");
     $T = new HTMLTable(3, "Teilnehmer");
     $T->setColWidth(1, 20);
     $T->setColWidth(3, 20);
     $T->maxHeight(200);
     while ($I = $AC->n()) {
         $IH = new HTMLInput("TodoInvitationIsHead", "checkbox", $I->A("TodoInvitationIsHead"));
         $IH->activateMultiEdit("TodoInvitation", $I->getID());
         $IH->title("Moderator?");
         $BD = new Button("Teilnehmer entfernen", "trash_stroke", "iconic");
         $BD->rmePCR("mTodo", "-1", "removeInvitee", array($TodoID, $I->getID()), "function(t){ \$j('#eventSideContent').html(t.responseText); }");
         $T->addRow(array($IH, $I->A("TodoInvitationName") . "<br><small style=\"color:grey;\">&lt;" . $I->A("TodoInvitationUserEmail") . "&gt;</small>", $BD));
     }
     if ($AC->numLoaded() == 0) {
         $T->addRow(array("Keine Teilnehmer"));
         $T->addRowColspan(1, 2);
     }
     #$T->addRow(array("HI", "HO"));
     echo $T;
     $Todo = new Todo($TodoID);
     $BN = new Button("Neuer Teilnehmer", "new", "icon");
     $BN->className("highlight");
     $BN->style("padding:10px;");
     $BN->onclick("\$j('#containerButtons .highlight').removeClass('highlight'); \$j(this).addClass('highlight'); \$j('.teilnehmerContainer').hide(); \$j('#containerNew').show(); ");
     $BS = new Button("Systembenutzer", "users", "icon");
     $BS->style("padding:10px;");
     $BS->onclick("\$j('#containerButtons .highlight').removeClass('highlight'); \$j(this).addClass('highlight'); \$j('.teilnehmerContainer').hide(); \$j('#containerSystem').show(); ");
     $BA = "";
     if (Session::isPluginLoaded("mAnsprechpartner") and $Todo->A("TodoClass") == "WAdresse") {
         $BA = new Button("Ansprechpartner", "./ubiquitous/Ansprechpartner/Ansprechpartner.png", "icon");
         $BA->style("padding:10px;");
         $BA->onclick("\$j('#containerButtons .highlight').removeClass('highlight'); \$j(this).addClass('highlight'); \$j('.teilnehmerContainer').hide(); \$j('#containerAnsprech').show(); ");
     }
     echo "<div style=\"height:30px;\"></div><div id=\"containerButtons\">{$BN}{$BS}{$BA}</div>";
     $F = new HTMLForm("neuerTeilnehmer", array("TodoID", "name", "email"), " Neuer Teilnehmer");
     $F->getTable()->setColWidth(1, 120);
     $F->setValue("TodoID", $TodoID);
     $F->setLabel("email", "E-Mail");
     $F->setType("TodoID", "hidden");
     $F->setSaveRMEPCR("Hinzufügen", "", "mTodo", -1, "addInvitee", "function(t){ \$j('#eventSideContent').html(t.responseText); }");
     echo "<div id=\"containerNew\" class=\"teilnehmerContainer\" style=\"padding-bottom:10px;\">" . $F . "</div>";
     $S = new HTMLList();
     $AC = Users::getUsers();
     while ($U = $AC->n()) {
         $S->addItem("<a href=\"#\" onclick=\"" . OnEvent::rme(new mTodoGUI(-1), "addInvitee", array($TodoID, "'" . $U->A("name") . "'", "'" . $U->A("UserEmail") . "'"), "function(t){ \$j('#eventSideContent').html(t.responseText); }") . " return false;\">" . $U->A("name") . "</a>");
         if ($U->getID() == Session::currentUser()->getID()) {
             $S->addItemClass("confirm");
             $S->addItemStyle("padding-top:5px;padding-bottom:5px;");
         }
     }
     echo "<div id=\"containerSystem\" class=\"teilnehmerContainer\" style=\"display:none;padding-bottom:10px;\">" . $S . "</div>";
     $T = new HTMLTable(1);
     if ($Todo->A("TodoClass") == "WAdresse" and Session::isPluginLoaded("mAnsprechpartner")) {
         $S = new HTMLList();
         $AC = Ansprechpartner::getAllAnsprechpartnerToAdresse($Todo->A("TodoClassID"));
         while ($U = $AC->n()) {
             $S->addItem("<a href=\"#\" onclick=\"" . OnEvent::rme(new mTodoGUI(-1), "addInvitee", array($TodoID, "'" . $U->A("AnsprechpartnerVorname") . " " . $U->A("AnsprechpartnerNachname") . "'", "'" . $U->A("AnsprechpartnerEmail") . "'"), "function(t){ \$j('#eventSideContent').html(t.responseText); }") . " return false;\">" . $U->A("AnsprechpartnerVorname") . " " . $U->A("AnsprechpartnerNachname") . "</a>");
         }
         if ($AC->numLoaded() == 0) {
             $S->addItem("Keine Ansprechpartner");
         }
         echo "<div id=\"containerAnsprech\" class=\"teilnehmerContainer\" style=\"display:none;padding-bottom:10px;\">{$S}</div>";
     }
 }