Example #1
0
 private function checkAdresse()
 {
     if (!isset($_POST["lead_id"])) {
         die("Keine Lead-ID übergeben!");
     }
     $S = anyC::get("Sync", "SyncGUID", $_POST["lead_id"]);
     $S->addAssocV3("SyncOwnerClass", "=", "Adresse");
     $Sync = $S->getNextEntry();
     #if($Sync == null){
     $Adresse = new Adresse(-1);
     $A = $Adresse->newAttributes();
     $F = new Factory("Adresse", $Sync == null ? -1 : $Sync->A("SyncOwnerClassID"));
     foreach ($_POST as $k => $v) {
         if (!isset($A->{$k})) {
             continue;
         }
         $F->sA($k, $v);
     }
     $F->store();
     $Adresse = $F->gO();
     if ($Sync == null) {
         $K = new Kunden();
         $K->createKundeToAdresse($Adresse->getID());
         mSync::updateGUID("Adresse", $Adresse->getID(), $_POST["lead_id"]);
     }
     return $Adresse;
 }
Example #2
0
 function newMe($checkUserData = true, $output = false)
 {
     $ps = mUserdata::getPluginSpecificData("Adressen");
     if (isset($ps["pluginSpecificCanUse1xAdresse"]) and $this->A->AuftragID == -1) {
         die("<p>Erstellen nicht möglich!<br />Plugin-spezifische Einstellungen aktiv.<br /><br />Sie können das Erstellen von Einträgen im Adressen-Plugin auch verbieten, dann wird die Option \"Adresse neu anlegen\" nicht mehr angezeigt.<br />Neue 1x-Adressen können weiterhin verwendet werden.</p>");
     } elseif (!isset($ps["pluginSpecificCanUse1xAdresse"])) {
         mUserdata::checkRestrictionOrDie("cantCreate" . str_replace("GUI", "", get_class($this)));
     }
     $this->changeA("lastChange", time());
     $id = parent::newMe(false, $output);
     if ($this->A("AuftragID") != -1 and $this->A("type") == "auftragsAdresse") {
         $Auftrag = new Auftrag($this->A("AuftragID"));
         $Auftrag->updateAdressID($id);
     }
     if (Session::isPluginLoaded("mSync") and $this->A("AuftragID") == -1) {
         mSync::newGUID("Adresse", $id, null, false);
     }
     return $id;
 }
Example #3
0
    die("incorrect date format");
}
if (!preg_match("/^[0-9]*\$/i", $cutoffDateFuture)) {
    die("incorrect date format");
}
if (empty($cutoffDatePast)) {
    $cutoffDatePast = time() - 14 * 24 * 3600;
}
if (empty($cutoffDateFuture)) {
    $cutoffDateFuture = time() + 84 * 24 * 3600;
}
if (isset($_GET["auth_token"])) {
    if (file_exists($absolutePathToPhynx . "/ubiquitous/Sync/mSync.class.php")) {
        require_once $absolutePathToPhynx . "/ubiquitous/Sync/mSync.class.php";
    }
    $userToken = $_GET["auth_token"];
    if (!preg_match("/^[a-z0-9]+\$/i", $userToken)) {
        die("incorrect login information");
    }
    $user = mSync::getUserByToken($userToken);
    $E->login($user->A("username"), $user->A("SHApassword"));
} else {
    $E->login($_GET["username"], $_GET["password"]);
}
$calendar = mTodoGUI::getCalendarData($cutoffDatePast, $cutoffDateFuture);
$events = array();
foreach ($calendar->getEventsList() as $calendarEvent) {
    $events[] = $calendarEvent->toXCal();
}
echo xCalUtil::getXCal($events);
$E->cleanUp();
Example #4
0
 public function newMe($checkUserData = true, $output = false)
 {
     $this->changeA("TodoLastChange", time());
     if (Session::currentUser() != null) {
         $this->changeA("TodoCreatorUserID", Session::currentUser()->getID());
     }
     #if($this->A("TodoGUID") == "")
     #	$this->changeA("TodoGUID", uniqid()."-".uniqid());
     if ($this->A("TodoClass") != "" and $this->A("TodoClass") != "Kalender" and $this->A("TodoName") == "") {
         $this->changeA("TodoName", $this->getOwnerObject()->getCalendarTitle());
     }
     $id = parent::newMe($checkUserData, false);
     if (Session::isPluginLoaded("mSync") and ($this->A("TodoExceptionForID") == "0" or $this->A("TodoExceptionForID") == "")) {
         mSync::newGUID("Todo", $id);
     }
     #$name = $this->getOwnerObject()->getCalendarTitle();
     if (Session::isPluginLoaded("mGoogle") and $this->updateGoogle) {
         if ($this->A("TodoUserID") == Session::currentUser()->getID()) {
             Google::calendarCreateEvent(mTodoGUI::getCalendarDetails("Todo", $id));
         }
     }
     if ($this->A("TodoClass") == "DBMail" and Session::isPluginLoaded("mMail")) {
         Mail::assign("Todo", $id, $this->A("TodoClassID"));
     }
     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", $id);
         $F->sA("AufgabeUserID", $this->A("TodoUserID"));
         $F->sA("AufgabeText", "Bericht für Termin eintragen");
         $F->sA("AufgabeCreated", time());
         $F->sA("AufgabeUntil", $this->A("TodoFromDay"));
         $F->sA("AufgabeUhrzeitVon", $this->A("TodoTillTime"));
         $F->store();
     }
     return $id;
 }
Example #5
0
        return $output;
    }
    /*process*/
    function process()
    {
        error_log(PHP_EOL . PHP_EOL . date("F j, Y, g:i a"), 3, "mSync.log");
        $this->create_table();
        $this->update();
        $this->alter_table($this->alter, "CHANGE");
        $this->alter_table($this->new_field, "ADD");
        $this->alter_table($this->delete_field, "DROP");
    }
}
if (PHP_SAPI == "cli") {
    $host = isset($argv[2]) && $argv[2][0] != "-" ? trim($argv[2]) : "";
    $mSync = new mSync($host);
    //force delete
    if (in_array('-f', $argv)) {
        $mSync->is_force_delete = true;
    }
    $mSync->db_check();
    switch (trim($argv[1])) {
        case "create":
            $mSync->create_json();
            break;
        case "update":
            $mSync->process();
            break;
        default:
            print_r($argv);
            break;