public function getHTML($id)
 {
     $this->loadMeOrEmpty();
     #if($this->A == null AND $id != -1) $this->loadMe();
     #if($id == -1) $this->A = new InstallationAttributes();
     BPS::setProperty("mInstallationGUI", "showErrorText", "1");
     $gui = new HTMLGUI();
     if (!Session::isPluginLoaded("multiInstall")) {
         $this->A->httpHost = "*";
         $gui->setType("httpHost", "hidden");
     } else {
         $gui->insertSpaceAbove("httpHost");
     }
     $gui->setObject($this);
     $gui->setName("Zugangsdaten");
     $gui->setType("password", "password");
     $gui->setLabel("datab", "Datenbank");
     $gui->setLabel("user", "Benutzer");
     $gui->setLabel("password", "Passwort");
     $gui->setLabel("httpHost", "Domain");
     $gui->setFieldDescription("host", "Der Rechner, auf dem die Datenbank liegt. Das kann 'localhost' sein, oder eine IP wie '192.168.8.243' oder ein Hostname wie 'rdbms.strato.de'.");
     $gui->setFieldDescription("httpHost", "unter der phynx erreichbar ist oder * für alle Domains");
     #$this->loadGUITranslation($gui);
     $gui->translate($this->loadTranslation());
     $gui->setJSEvent("onSave", "\n\t\t\t\tfunction() {\n\t\t\t\t\tcontentManager.emptyFrame('contentLeft');\n\t\t\t\t\tcontentManager.emptyFrame('contentBelow');\n\t\t\t\t\tcontentManager.reloadFrame('contentRight');" . "\n\t\t\t\t}");
     $gui->setStandardSaveButton($this);
     return $gui->getEditHTML();
 }
 public static function setCallback($forPlugin, $methodToCall, $selector = "general")
 {
     $used = BPS::getProperty("R" . $forPlugin . "S" . $selector, "callbacks", "");
     $methodToCall = str_replace(":", "###DP###", $methodToCall);
     if (strpos($used, $methodToCall) !== false) {
         return;
     }
     BPS::setProperty("R" . $forPlugin . "S" . $selector, "callbacks", ($used != "" ? $used . "%%" : "") . $methodToCall);
 }
 function showInfo($name, $language)
 {
     $Ad = new thetvdbcomAdapter();
     $info = $Ad->getInfo($name, $language);
     if ($info === null) {
         die("<p>Sorry, there is no information available for '{$name}({$language})'</p>");
     }
     BPS::setProperty("NewSeriesGUI", "loadBanner", str_replace("http://", "", $info->Banner));
     $B = new Button("save\nseries", "./trinityDB/Serien/Serien.png");
     $B->rmePCR("Serie", "-1", "newSeriesFromID", array("'{$info->Name}'", "'{$language}'", "'{$info->SeriesID}'"), "contentManager.loadFrame('contentLeft', 'Serie', transport.responseText);");
     #$B->style("float:right;");
     echo "\n\t\t\t<div style=\"margin-left:10px;width:765px;border-right-width:1px;border-right-style:solid;\" class=\"borderColor1\">\n\t\t\t\t{$B}\n\t\t\t\t<div style=\"height:20px;\"></div>\n\t\t\t\t<img src=\"" . DBImageGUI::imageLink("NewSeriesGUI", "loadBanner" . $info->SeriesID, "Banner") . "\" style=\"width:758px;height:140px;\" /><br />\n\t\t\t\t<p style=\"-moz-column-count: 3;-moz-column-gap: 1em;-moz-column-rule: 1px solid black;-webkit-column-count: 3;-webkit-column-gap: 1em;-webkit-column-rule: 1px solid black;\">" . $info->Overview . "</p>\n\t\t\t</div>";
 }
 public function setFlag($class, $flag, $value)
 {
     BPS::setProperty($class, $flag, $value);
 }
 public static function stamp($args, $die = true)
 {
     #if(strtolower($args["P0"]) == "303005f7b4")
     #	die('{"status":"command", "action":"reload"}');
     if (!isset($_SESSION["BPS"])) {
         $_SESSION["BPS"] = new BackgroundPluginState();
     }
     addClassPath(Util::getRootPath() . "personalKartei/Zeiterfassung/");
     addClassPath(Util::getRootPath() . "personalKartei/Personal/");
     addClassPath(Util::getRootPath() . "personalKartei/ObjekteL/");
     #if(file_exists(Util::getRootPath()."personalKartei/Schichten/"))
     #	addClassPath(Util::getRootPath()."personalKartei/Schichten/");
     addClassPath(Util::getRootPath() . "open3A/Kategorien/");
     $CCP = new CCPage();
     $CCP->loadPlugin("personalKartei", "Schichten", true);
     $T = anyC::getFirst("ZETerminal", "ZETerminalID", $args["P1"]);
     if (!$T) {
         if ($die) {
             die('{"status":"error", "message":"Unbekanntes Terminal"}');
         } else {
             return;
         }
     }
     $CT = FileStorage::getFilesDir() . "ChipTrans.csv";
     if ($args["P3"] and $args["P4"] > 0) {
         $P = new Personal($args["P4"]);
         if (trim($P->A("PersonalChipNummer")) == "") {
             $P->changeA("PersonalChipNummer", trim(strtolower($args["P0"])));
             $P->saveMe();
         } else {
             file_put_contents($CT, "{$args['P4']}:" . trim(strtolower($args["P0"])) . "\n", FILE_APPEND);
         }
     }
     $A = new stdClass();
     $Date = new Datum();
     $Date->subDay();
     $Date->addDay();
     $A->ChipID = trim(strtolower($args["P0"]));
     $A->Date = $Date->time();
     $A->Time = Util::parseTime("de_DE", date("H:i", !isset($args["P5"]) ? time() : $args["P5"]));
     $A->Type = $args["P2"];
     $A->Mode = "";
     $A->TerminalID = $args["P1"];
     try {
         $ok = ZEData::addTime($A);
     } catch (Exception $e) {
         try {
             $hex = str_pad(trim(strtolower(dechex($args["P0"]))), 10, "0", STR_PAD_LEFT);
             $A->ChipID = $hex;
             $ok = ZEData::addTime($A);
         } catch (Exception $e) {
             try {
                 if (!$args["P3"]) {
                     throw new Exception("Chip unknown", 100);
                 }
                 if (!file_exists($CT)) {
                     file_put_contents($CT, "");
                 }
                 $trans = file_get_contents($CT);
                 $found = false;
                 foreach (explode("\n", $trans) as $line) {
                     $line = trim($line);
                     $ex = explode(":", $line);
                     if (trim(strtolower($ex[1])) != trim(strtolower($args["P0"]))) {
                         continue;
                     }
                     $P = new Personal($ex[0]);
                     $A->ChipID = $P->A("PersonalChipNummer");
                     $found = true;
                 }
                 if (!$found) {
                     throw new Exception("Learn", 200);
                 }
                 #if(!$found)
                 #	throw new Exception ("Chip unknown", 100);
                 $ok = ZEData::addTime($A);
             } catch (Exception $e) {
                 switch ($e->getCode()) {
                     case 100:
                         try {
                             $F = new Factory("ZETerminalFail");
                             $F->sA("ZETerminalFailTime", time());
                             $F->sA("ZETerminalFailData", json_encode($args));
                             $F->sA("ZETerminalFailZETerminalID", $args["P1"]);
                             $F->store();
                         } catch (Exception $e) {
                         }
                         if ($die) {
                             die('{"status":"error", "message":"Unbekannter Chip"}');
                         } else {
                             return;
                         }
                         break;
                     case 200:
                         $AC = anyC::get("Personal", "isDeleted", "0");
                         $AC->setFieldsV3(array("CONCAT(nachname, ' ', vorname) AS name"));
                         $AC->addAssocV3("TRIM(CONCAT(nachname, vorname))", "!=", "");
                         $AC->addOrderV3("nachname");
                         $AC->addOrderV3("vorname");
                         $knownPID = array();
                         $file = file($CT);
                         foreach ($file as $line) {
                             $line = trim($line);
                             $ex = explode(":", $line);
                             $knownPID[$ex[0]] = true;
                         }
                         $array = array();
                         while ($A = $AC->n()) {
                             if (isset($knownPID[$A->getID()])) {
                                 continue;
                             }
                             $subArray = array();
                             foreach ($A->getA() as $key => $value) {
                                 $subArray[$key] = $value;
                             }
                             $array[] = $subArray;
                         }
                         if ($die) {
                             die('{"status":"learn", "message":' . json_encode($array, defined("JSON_UNESCAPED_UNICODE") ? JSON_UNESCAPED_UNICODE : 0) . '}');
                         } else {
                             return;
                         }
                         break;
                     default:
                         try {
                             $F = new Factory("ZETerminalFail");
                             $F->sA("ZETerminalFailTime", time());
                             $F->sA("ZETerminalFailData", $e->getMessage());
                             $F->sA("ZETerminalFailZETerminalID", $args["P1"]);
                             $F->store();
                         } catch (Exception $e) {
                         }
                         if ($die) {
                             die('{"status":"error", "message":"' . $e->getMessage() . '"}');
                         } else {
                             return;
                         }
                 }
             }
         }
     }
     if ($args["P2"] == "G") {
         $AC = anyC::get("ZEData", "ZEDataPersonalID", $ok["Personal"]->getID());
         $AC->addAssocV3("ZEDataType", "=", "K");
         $AC->addAssocV3("ZEDataDate + ZEDataTime", ">", time() - 3600 * 13);
         $AC->addAssocV3("ZEDataDate + ZEDataTime", "<", time());
         $AC->addAssocV3("ZEDataIsDeleted", "=", "0");
         $AC->addOrderV3("ZEDataDate + ZEDataTime", "DESC");
         $AC->setLimitV3("1");
         $Kommen = $AC->getNextEntry();
         if ($Kommen != null) {
             $Gehen = $ok["ZEData"];
             $T = new ZETerminal($args["P1"]);
             $AC2 = anyC::get("PZuO", "ObjektLID", $T->A("ZETerminalObjektLID"));
             $AC2->addAssocV3("PersonalID", "=", $Kommen->A("ZEDataPersonalID"));
             $PZuO = $AC2->n();
             if ($PZuO !== null) {
                 $worked = $Gehen->A("ZEDataDate") + $Gehen->A("ZEDataTime") - ($Kommen->A("ZEDataDate") + $Kommen->A("ZEDataTime"));
                 $AZ = mZEArbeitsZeit::getArbeitszeiten($PZuO->getID(), time());
                 if (isset($AZ[0])) {
                     $hasTo = $AZ[0]->A("ZEArbeitsZeitEnde") - $AZ[0]->A("ZEArbeitsZeitStart");
                     if ($worked > 0 and $worked / $hasTo > 0.9) {
                         # AND $hasTo / $worked < 1.15){
                         $DE = $ok["ZEData"];
                         $DE->changeA("ZEDataPause", $AZ[0]->A("ZEArbeitsZeitMittag"));
                         $DE->saveMe(false, false);
                     }
                 }
             }
         }
     }
     #303046a1b7
     BPS::setProperty("ZEAuswertung", "objektLID", $T->A("ZETerminalObjektLID"));
     BPS::setProperty("ZEAuswertung", "personalID", $ok["Personal"]->getID());
     BPS::setProperty("ZEAuswertung", "month", date("Ym"));
     #$ZEA = new ZEAuswertung($A->ChipID);
     #$ZEA->debug = false;
     #$current = $ZEA->getContent();
     if ($die) {
         die('{"status":"OK", "message": "' . addslashes($ok["Personal"]->A("vorname") . " " . $ok["Personal"]->A("nachname")) . '", "details": ""}');
     } else {
         return;
     }
 }
Exemple #6
0
 function authenticationPopup()
 {
     $allowedUsers = Environment::getS("allowedUsers", null);
     if ($allowedUsers !== null) {
         return;
     }
     $F = new HTMLForm("appserver", array("appServer"), "Application Server");
     $F->useRecentlyChanged();
     $F->setLabel("appServer", "App-Server");
     if (function_exists("ldap_connect")) {
         $F->getTable()->setTableStyle("margin-bottom:30px;");
     }
     $F->getTable()->setColWidth(1, 120);
     $F->setValue("appServer", mUserdata::getGlobalSettingValue("AppServer", ""));
     $F->setDescriptionField("appServer", "Wenn Sie einen Application Server betreiben, tragen Sie hier bitte die URL ein, um die Benutzer mit diesem Server zu authentifizieren.");
     $F->setSaveRMEPCR("Speichern", "", "Users", "", "saveAppServer", OnEvent::closePopup("Users"));
     echo $F;
     if (!function_exists("ldap_connect")) {
         return;
     }
     echo "<span></span><div class=\"backgroundColor1 Tab\"><p>Active Directory</p></div>";
     $LD = LoginData::get("ADServerUserPass");
     BPS::setProperty("LoginDataGUI", "preset", "adServer");
     $gui = new LoginDataGUI($LD == null ? -1 : $LD->getID());
     $gui->loadMeOrEmpty();
     if ($LD != null) {
         $gui->setA($LD->getA());
     }
     $gui->getPopup();
 }
 public function setOwner($className, $classID)
 {
     BPS::setProperty("FileManagerGUI", "root", $className . ($classID != "" ? "ID" . ($classID < 10 ? "0" : "") . ($classID < 100 ? "0" : "") . ($classID < 1000 ? "0" : "") . $classID : ""));
 }
 public static function stamp($args)
 {
     #if(strtolower($args["P0"]) == "303005f7b4")
     #	die('{"status":"command", "action":"reload"}');
     if (!isset($_SESSION["BPS"])) {
         $_SESSION["BPS"] = new BackgroundPluginState();
     }
     addClassPath(Util::getRootPath() . "personalKartei/Zeiterfassung/");
     addClassPath(Util::getRootPath() . "personalKartei/Personal/");
     addClassPath(Util::getRootPath() . "personalKartei/ObjekteL/");
     addClassPath(Util::getRootPath() . "open3A/Kategorien/");
     $T = anyC::getFirst("ZETerminal", "ZETerminalID", $args["P1"]);
     if (!$T) {
         die('{"status":"error", "message":"Unbekanntes Terminal"}');
     }
     $A = new stdClass();
     $Date = new Datum();
     $Date->subDay();
     $Date->addDay();
     $A->ChipID = trim(strtolower($args["P0"]));
     $A->Date = $Date->time();
     $A->Time = Util::parseTime("de_DE", date("H:i", time()));
     $A->Type = $args["P2"];
     $A->Mode = "";
     $A->TerminalID = $args["P1"];
     try {
         $ok = ZEData::addTime($A);
     } catch (Exception $e) {
         try {
             $A->ChipID = trim(strtolower(dechex($args["P0"])));
             $ok = ZEData::addTime($A);
         } catch (Exception $e) {
             switch ($e->getCode()) {
                 case 100:
                     die('{"status":"error", "message":"Unbekannter Chip"}');
                     break;
                 default:
                     die('{"status":"error", "message":"' . $e->getMessage() . '"}');
             }
         }
     }
     if ($args["P2"] == "G") {
         $AC = anyC::get("ZEData", "ZEDataChipID", $A->ChipID);
         $AC->addAssocV3("ZEDataType", "=", "K");
         $AC->addAssocV3("ZEDataDate + ZEDataTime", ">", time() - 3600 * 13);
         $AC->addOrderV3("ZEDataID", "DESC");
         $AC->addAssocV3("ZEDataIsDeleted", "=", "0");
         $AC->setLimitV3("1");
         $D = $AC->getNextEntry();
         if ($D != null) {
             $pause = ZEAuswertung::calcPause($D, $ok["ZEData"]);
             if ($pause !== null) {
                 $DE = $ok["ZEData"];
                 $DE->changeA("ZEDataPause", $pause);
                 $DE->saveMe(false, false);
             }
         }
     }
     #303046a1b7
     BPS::setProperty("ZEAuswertung", "objektLID", $T->A("ZETerminalObjektLID"));
     BPS::setProperty("ZEAuswertung", "personalID", $ok["Personal"]->getID());
     BPS::setProperty("ZEAuswertung", "month", date("Ym"));
     #$ZEA = new ZEAuswertung($A->ChipID);
     #$ZEA->debug = false;
     #$current = $ZEA->getContent();
     die('{"status":"OK", "message": "' . addslashes($ok["Personal"]->A("vorname") . " " . $ok["Personal"]->A("nachname")) . '", "details": ""}');
     #Stunden '.Util::CLMonthName(date("m")).': '.Util::formatSeconds($current["totalHours"][1], false).'
 }
Exemple #9
0
 function editInPopup($id, $date = null, $targetClass = null, $targetClassID = null, $time = null, $description = null, $location = null)
 {
     if ($date != null) {
         BPS::setProperty("TodoGUI", "TodoTillDay", Util::CLDateParser($date));
     }
     if ($time != null) {
         BPS::setProperty("TodoGUI", "TodoFromTime", $time);
     }
     if ($description != null) {
         BPS::setProperty("TodoGUI", "TodoDescription", $description);
     }
     if ($location != null) {
         BPS::setProperty("TodoGUI", "TodoLocation", $location);
     }
     $T = new TodoGUI($id);
     $T->GUI = new HTMLGUIX($T);
     $T->GUI->displayMode("popupS");
     $T->GUI->requestFocus("TodoName");
     #if($id == -1)
     $T->GUI->addToEvent("onSave", OnEvent::popup("Event", "mKalender", "-1", "getInfo", array("'mTodoGUI'", "transport.responseText", "'{$date}'")));
     if ($targetClass != null) {
         BPS::setProperty("mTodoGUI", "ownerClass", $targetClass);
         BPS::setProperty("mTodoGUI", "ownerClassID", $targetClassID);
     }
     $T->getHTML($id);
     #if($T->A("TodoClass") == "Kalender" OR $T->A("TodoClass") == "DBMail")
     $T->GUI->insertAttribute("after", "TodoClassID", "TodoName");
     if (BPS::getProperty("TodoGUI", "overview")) {
         $T->GUI->addFieldEvent("TodoUserID", "onChange", OnEvent::rme($this, "getBusyList", array("this.value", "1"), "function(t){ \$j('#busyList').html(t.responseText); }"));
         $gui = $T->GUI->getEditHTML();
         $html = "<div id=\"busyList\" style=\"display:inline-block;width:400px;vertical-align:top;max-height:450px;overflow:auto;\">" . $this->getBusyList(Session::currentUser()->getID(), false) . "</div><div style=\"display:inline-block;width:400px;vertical-align:top;\">{$gui}</div>";
         BPS::unsetProperty("TodoGUI", "overview");
         die($html);
     }
     echo $T->GUI->getEditHTML();
     #.OnEvent::script("\$j('#editTodoGUI input[name=TodoName]').trigger('focus');");
 }