Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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>";
 }
Exemplo n.º 3
0
 function __construct()
 {
     $this->dataFile = "chart";
     parent::__construct();
     $this->bps = BPS::getAllProperties("StatistikControllingGUI");
     $D1 = new Datum(time());
     $D1->setToJan1st(date("Y"));
     $D2 = new Datum(time());
     $D2->setToJan1st(date("Y") + 1);
     $D2->subDay();
     $this->startDatum = isset($this->bps["start"]) ? $this->bps["start"] : Util::CLFormatDate($D1->time());
     $this->endDatum = isset($this->bps["ende"]) ? $this->bps["ende"] : Util::CLFormatDate($D2->time());
     $this->mK = null;
 }
Exemplo n.º 4
0
 public static function getCallbacks($forPlugin, $selector = "general")
 {
     if (is_object($forPlugin) and $forPlugin instanceof PersistentObject) {
         $forPlugin = $forPlugin->getClearClass();
     }
     if (is_object($forPlugin) and !$forPlugin instanceof PersistentObject) {
         $forPlugin = get_class($forPlugin);
     }
     $used = BPS::getProperty("R" . $forPlugin . "S" . $selector, "callbacks", null);
     $used = str_replace("###DP###", ":", $used);
     if ($used == null) {
         return null;
     }
     return explode("%%", $used);
 }
Exemplo n.º 5
0
 function getHTML($id)
 {
     $this->loadMeOrEmpty();
     $gui = new HTMLGUIX($this);
     $gui->name("Gericht");
     $gui->label("GerichtName", "Name");
     $gui->label("GerichtRezeptBuch", "Buch");
     $gui->label("GerichtRezeptBuchSeite", "Seite");
     $gui->space("GerichtRezept", "Rezept");
     #$gui->setLabel("GerichtBemerkung","Bemerkung");
     //$gui->setLabel("GerichtZuletztAm","gekocht am");
     $gui->type("GerichtZuletztAm", "hidden");
     $gui->type("GerichtRezept", "textarea");
     $gui->type("GerichtBemerkung", "textarea");
     #$gui->setStandardSaveButton($this);
     if (BPS::popProperty("GerichtGUI", "mode", "default") == "popup") {
         $gui->displayMode("popup");
     }
     return $gui->getEditHTML();
 }
Exemplo n.º 6
0
 public static function getCallbacks($forPlugin, $selector = "general", $skip = array())
 {
     if (is_object($forPlugin) and $forPlugin instanceof PersistentObject) {
         $forPlugin = $forPlugin->getClearClass();
     }
     if (is_object($forPlugin) and !$forPlugin instanceof PersistentObject) {
         $forPlugin = get_class($forPlugin);
     }
     $used = BPS::getProperty("R" . $forPlugin . "S" . $selector, "callbacks", null);
     $used = str_replace("###DP###", ":", $used);
     if ($used == null) {
         return null;
     }
     $u = explode("%%", $used);
     foreach ($skip as $s) {
         foreach ($u as $k => $e) {
             if (strpos($e, $s . "::") === 0) {
                 unset($u[$k]);
             }
         }
     }
     return $u;
 }
Exemplo n.º 7
0
 public function getTable($GUI)
 {
     $bps = BPS::getAllProperties("mKalenderGUI");
     $K = $GUI->getData($this->first, $this->last, isset($bps["KID"]) ? $bps["KID"] : Session::currentUser()->getID());
     $cols = $this->cols;
     $rows = $this->rows;
     #"<table id=\"KalenderHeader\" style=\"position:absolute;margin-left:10px;border-spacing: 0px;width:auto;\" class=\"backgroundColor0\">
     $tableHeader = "\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th style=\"border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#EEE;padding-top:10px;text-align:right;\" class=\"backgroundColor0\">Monat</th>";
     for ($j = 0; $j < $this->cols; $j++) {
         $tableHeader .= "\n\t\t\t\t<th style=\"border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#EEE;padding-top:10px;\" class=\"backgroundColor0\">" . ($j + 1) . "</th>";
     }
     $tableHeader .= "\n\t\t</tr>\n\t\t</thead>\n\t\t";
     #</table>
     $html = "\n\t\t\t\n\t\t<div style=\"\">\n\t\t<!--<table id=\"KalenderHeader\" style=\"position:absolute;margin-left:10px;border-spacing: 0px;\">\n\t\t\t{$tableHeader}\n\t\t</table>-->\n\t\t<table style=\"margin-left:10px;border-spacing: 0px;\" id=\"KalenderTable\">\n\t\t\t<colgroup>\n\t\t\t\t<col></col>";
     for ($j = 0; $j < $cols; $j++) {
         #
         $html .= "\n\t\t\t\t<col style=\"width:" . 100 / $cols . "%;\" />";
     }
     $html .= "";
     $html .= "\n\t\t{$tableHeader}\n\t\t<tbody>";
     $D = clone $this->date;
     for ($i = 0; $i < $rows; $i++) {
         $html .= "\n\t\t\t<tr class=\"cellHeight\">\n\t\t\t\t<td class=\"Day borderColor1 backgroundColor3\" style=\"text-align:right;\">" . Util::CLMonthName($i + 1) . "</td>";
         for ($j = 0; $j < $cols; $j++) {
             $entry = "";
             $events = $K->getEventsOnDay(date("dmY", $D->time()));
             $holidays = $K->getHolidaysOnDay(date("dmY", $D->time()));
             #$hasMultiDay = $K->hasMultiDayEvents($this->first, $this->last);
             if ($events != null) {
                 foreach ($events as $ev) {
                     foreach ($ev as $v) {
                         $entry .= $v->getMinimal($D->time());
                     }
                 }
             }
             if ($holidays != null) {
                 foreach ($holidays as $ev) {
                     foreach ($ev as $v) {
                         $entry .= $v->getMinimal($D->time());
                     }
                 }
             }
             $bgColor = "none";
             if (date("w", $D->time()) == 6) {
                 $bgColor = $this->colorBgSaturday;
             }
             if (date("w", $D->time()) == 0) {
                 $bgColor = $this->colorBgSunday;
             }
             #".((date("m.Y",$D->time()) != date("m.Y",$currentMonth->time())) ? "color:grey;" : "")."
             if ($j < $cols) {
                 $html .= "\n\t\t\t\t<td\n\t\t\t\t\tstyle=\"vertical-align:top;padding:0px;background-color:{$bgColor};overflow:auto;\"\n\t\t\t\t\tclass=\"" . (date("d.m.Y", $D->time()) == date("d.m.Y") ? "backgroundColor1" : "") . " Day borderColor1\">\n\t\t\t\t\t<div style=\"font-size:10px;\">{$entry}</div>\n\t\t\t\t</td>";
             }
             $D->addDay();
             #if(date("d", $D->time()) == 1){
             #for(;$j < $cols;$j++)
             #	$html .= "<td class=\"Day borderColor1\"></td>";
             #}
         }
         $html .= "\n\t\t\t</tr>";
     }
     $html .= "\n\t\t\t</tbody>\n\t\t</table>\n\t\t</div>";
     #.OnEvent::script("\$j('#KalenderTable thead th').each(function(k, v){ \$j(\$j('#KalenderHeader thead th').get(k)).css('width', \$j(v).width()); console.log(\$j(v).width()); }); \$j('#KalenderHeader').css('width', \$j('#KalenderTable').width())");#.OnEvent::script("\$j('#KalenderTable').fixedHeaderTable({ footer: false, cloneHeadToFoot: false, fixedColumn: true });");
     return $html;
 }
Exemplo n.º 8
0
 public static function firmaParser($w, $a, $p)
 {
     if (!is_array($p)) {
         $s = HTMLGUI::getArrayFromParametersString($p);
     } else {
         $s = $p;
     }
     $SM = BPS::getProperty("AdressenGUI", "selectionMode", false);
     if ($s[9] == "mAdresseGUI") {
         $SM = BPS::getProperty("mAdresseGUI", "selectionMode", false);
     }
     $symbols = "";
     if ($s[8] != "") {
         $symbols .= "<a href=\"{$s['8']}\" target=\"_blank\"><img class=\"mouseoverFade\" style=\"float:right;margin-left:4px;\" src=\"./images/i2/flowers.gif\" title=\"{$s['8']}\" /></a>";
     }
     if ($s[7] != "") {
         if (Session::isPluginLoaded("mGemeinschaft")) {
             $B = Gemeinschaft::getCallButton($s[7], "mobile");
             $B->style("float:right;margin-left:4px;");
             $symbols .= $B;
         } else {
             $symbols .= "<img class=\"mouseoverFade\" style=\"float:right;margin-left:4px;\" src=\"./images/i2/mobile.png\" title=\"{$s['7']}\" />";
         }
     }
     if ($s[6] != "") {
         $symbols .= "<a href=\"mailto:{$s['6']}\"><img class=\"mouseoverFade\" style=\"float:right;margin-left:4px;\" src=\"./images/i2/email.png\" title=\"{$s['6']}\" /></a>";
     }
     if ($s[5] != "") {
         $symbols .= "<img class=\"mouseoverFade\" style=\"float:right;margin-left:4px;\" src=\"./images/i2/fax.png\" title=\"{$s['5']}\" />";
     }
     if ($s[4] != "") {
         if (Session::isPluginLoaded("mGemeinschaft")) {
             $B = Gemeinschaft::getCallButton($s[7]);
             $B->style("float:right;margin-left:4px;");
             $symbols .= $B;
         } else {
             $symbols .= "<img class=\"mouseoverFade\" style=\"float:right;margin-left:4px;\" src=\"./images/i2/telephone.png\" title=\"{$s['4']}\" />";
         }
     }
     return $symbols . (($_SESSION["S"]->checkForPlugin("Kunden") and $s[3] == "default" and !$SM) ? "<img src=\"./images/i2/kunde.png\" title=\"Kundendaten anzeigen/erstellen\" onclick=\"contentManager.selectRow(this); contentManager.loadFrame('contentLeft', 'Kunde', -1, 0, 'KundeGUI;AdresseID:{$s['2']};action:Kappendix');\" style=\"float:left;margin-right:4px;\" class=\"mouseoverFade\" />" : "") . (($_SESSION["S"]->checkForPlugin("Kundenpreise") and $s[3] == "default" and !$SM) ? "<img src=\"./images/i2/kundenpreis.png\" title=\"Kundenpreise festlegen\" onclick=\"contentManager.selectRow(this); contentManager.loadFrame('contentLeft','Kunde', -1, 0,'KundeGUI;AdresseID:{$s['2']};action:Kundenpreise');\" style=\"float:left;margin-right:4px;\" class=\"mouseoverFade\" />" : "") . (($_SESSION["S"]->checkForPlugin("labelPrinter") and $s[3] == "default") ? "<img src=\"./images/i2/printer.png\" title=\"Etikette mit Adresse drucken\" onclick=\"rme('labelPrinter','','printEtikette','{$s['2']}');\" style=\"float:left;margin-right:4px;\" class=\"mouseoverFade\" />" : "") . ($w != "" ? stripslashes($w) . (($s[1] != "" or $s[0] != "") ? "<br /><small>{$s['0']} {$s['1']}</small>" : "") : $s[0] . " " . $s[1]);
 }
 protected function getMyBPSData()
 {
     return BPS::getAllProperties(get_class($this));
 }
Exemplo n.º 10
0
 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).'
 }
Exemplo n.º 11
0
 *  (at your option) any later version.
 *  phynx is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  2007 - 2013, Rainer Furtmeier - Rainer@Furtmeier.IT
 */
require "../classes/backend/BackgroundPluginState.class.php";
require "../classes/toolbox/BPS.class.php";
require "../classes/toolbox/Util.class.php";
session_name("phynx_" . sha1(str_replace("" . DIRECTORY_SEPARATOR . "interface" . DIRECTORY_SEPARATOR . "showPDF.php", "" . DIRECTORY_SEPARATOR . "system" . DIRECTORY_SEPARATOR . "connect.php", __FILE__)));
session_start();
if (!isset($_SESSION["BPS"])) {
    die(Util::getBasicHTMLError("Ihre Sitzung ist nicht bekannt. Bitte loggen Sie sich ein.", "Sitzung unbekannt"));
}
$_SESSION["BPS"]->setActualClass("showPDF");
$f = $_SESSION["BPS"]->getACProperty("filename");
if ($f == "") {
    die("No filename set!");
}
header('Content-Type: application/pdf');
header('Content-Length: ' . filesize($f));
header("Content-Disposition: inline; filename=\"" . basename($f) . "\"");
readfile($f);
if (BPS::getProperty("showPDF", "delete", true)) {
    unlink($f);
}
exit;
Exemplo n.º 12
0
 public function popupRadio()
 {
     $AC = anyC::get("UPnP");
     $AC->addAssocV3("UPnPAVTransport", "=", "1");
     $I = new HTMLInput("radioSelection", "select", BPS::getProperty("mUPnPGUI", "lastStation", "0"));
     $I->setOptions($AC, "UPnPName", "Abspielgerät auswählen");
     echo $I;
     $AC = anyC::get("UPnPRadioStation");
     $I = new HTMLInput("radioStation", "select", BPS::getProperty("mUPnPGUI", "lastStation", "0"));
     $I->setOptions($AC, "UPnPRadioStationName", "Sender auswählen");
     echo $I;
     $B = new Button("Play", "play", "touch");
     $B->rmePCR("mUPnP", "-1", "playRadio", array("\$j('select[name=radioSelection]').val()", "\$j('select[name=radioStation]').val()"));
     $B->style("display:inline-block;width:30%;");
     echo $B;
     $B = new Button("Stop", "stop", "touch");
     $B->rmePCR("mUPnP", "-1", "stopRadio", array("\$j('select[name=radioSelection]').val()", "\$j('select[name=radioStation]').val()"));
     $B->style("display:inline-block;width:30%;");
     echo $B;
 }
Exemplo n.º 13
0
 function getHTML($id)
 {
     #$showHelp = true;
     if ($this->collector == null) {
         $this->lCV3($id);
     }
     $singularLanguageClass = $this->loadLanguageClass("Installation");
     $text = $singularLanguageClass != null ? $singularLanguageClass->getText() : "";
     if ($id == -1) {
         echo OnEvent::script(OnEvent::rme($this, "getActions", "", "function(transport){ contentManager.contentBelow(transport.responseText); }"));
     }
     $hasDBConnection = false;
     try {
         mUserdata::getGlobalSettingValue("DBVersion", false);
         $hasDBConnection = true;
     } catch (Exception $e) {
     }
     $g = "";
     $DBFilePath = Util::getRootPath() . "system/DBData/Installation.pfdb.php";
     $writable = new HTMLTable(1);
     $File = new File($DBFilePath);
     $File->loadMe();
     if (!$File->A("FileIsWritable") and !$hasDBConnection) {
         return;
     }
     if (!$File->A("FileIsWritable")) {
         $writable->addRow("<img src=\"./images/navi/restrictions.png\" style=\"float:left;margin-right:10px;\"/>Die Datei " . $DBFilePath . " ist nicht beschreibbar, Änderungen können nicht gespeichert werden.<br /><br />Machen Sie die Datei mit einem FTP-Programm beschreibbar. Klicken Sie dazu mit der rechten Maustaste auf die Datei auf dem Server, wählen Sie \"Eigenschaften\", und geben Sie den Modus 666 an, damit sie durch den Besitzer, die Gruppe und alle Anderen les- und schreibbar ist.");
         $g .= $writable->getHTML();
     }
     $gui = new HTMLGUI();
     $gui->setName("Datenbank-Zugangsdaten");
     if ($this->collector != null) {
         $gui->setAttributes($this->collector);
     }
     $gui->setCollectionOf($this->collectionOf, "Datenbank-Zugangsdaten");
     $gui->hideAttribute("password");
     $gui->hideAttribute("httpHost");
     $gui->hideAttribute("InstallationID");
     if (strstr($_SERVER["SCRIPT_FILENAME"], "demo")) {
         $UA = $_SESSION["S"]->getCurrentUser()->getA();
         if ($UA->name != "Installations-Benutzer") {
             $g = "In der Demo können keine Datenbank-Zugangsdaten geändert werden!";
             $gui->setIsDisplayMode(true);
         }
     }
     if (!Session::isPluginLoaded("multiInstall")) {
         $gui->setIsDisplayMode(true);
         $gui->setEditInDisplayMode(true, "contentLeft");
     }
     #try {
     $g .= $gui->getBrowserHTML($id);
     #} catch (Exception $e){
     #	$t->addRow(array("Etwas stimmt nicht, eine ".get_class($e)." wurde abgefangen!"));
     #	$t->addRow(array("<span style=\"font-size:8px;\">".nl2br(str_replace("#","\n#", $e->getTraceAsString()))."</span>"));
     #}
     /*	$help = "
     	<script type=\"text/javascript\">
     		contentManager.rmePCR('mInstallation','','getHelp','true','if(checkResponse(transport)) { Popup.create(\'123\', \'Installation\', \'Hilfe\'); Popup.update(transport, \'123\', \'Installation\'); }');
     	</script>";*/
     $ST = new HTMLSideTable("left");
     try {
         #$MailServer = LoginData::get("MailServerUserPass");
         #$MailServerID = $MailServer == null ? -1 : $MailServer->getID();
         $BMail = $ST->addButton("Mail-Server", "./plugins/Installation/serverMail.png");
         #$BMail->popup("edit", "Mail-Server", "LoginData", $MailServerID, "getPopup", "", "LoginDataGUI;preset:mailServer");
         $BMail->popup("edit", "Mail-Server", "mInstallation", -1, "manageMailservers");
         $BTestMail = $ST->addButton("Mailversand\ntesten", "mail");
         $BTestMail->popup("mailTest", "Mailversand testen", "mInstallation", "-1", "testMailGUI");
         if (Session::isPluginLoaded("mJabber")) {
             $JabberServer = LoginData::get("JabberServerUserPass");
             $JabberServerID = $JabberServer == null ? -1 : $JabberServer->getID();
             $BJabber = $ST->addButton("Jabber-Server", "./plugins/Installation/serverMail.png");
             $BJabber->popup("edit", "Jabber-Server", "LoginData", $JabberServerID, "getPopup", "", "LoginDataGUI;preset:jabberServer");
         }
         $BackupButton = $ST->addButton("Daten-\nsicherungen", "disk");
         $BackupButton->onclick("contentManager.loadFrame('contentLeft','BackupManager');");
     } catch (Exception $e) {
     }
     return $ST . $g;
     #.$t->getHTML();
     $t = new HTMLTable(1);
     try {
         $user = new User(1);
         $user->loadMe();
     } catch (DatabaseNotSelectedException $e) {
         if (BPS::getProperty("mInstallationGUI", "showErrorText", false)) {
             $t->addRow(isset($text["noDatabase"]) ? $text["noDatabase"] : "Es wurde kein korrekter Datenbankname angegeben.<br /><br />Bitte geben Sie eine existierende Datenbank an, sie wird nicht automatisch erzeugt.");
             $t->addRowClass("backgroundColor0");
             $t->addRowStyle("color:red;");
         }
         return $g . $t->getHTML();
         #.$help;
     } catch (NoDBUserDataException $e) {
         if (BPS::getProperty("mInstallationGUI", "showErrorText", false)) {
             $t->addRow(isset($text["wrongData"]) ? $text["wrongData"] : "Mit den angegebenen Datenbank-Zugangsdaten kann keine Verbindung aufgebaut werden.<br /><br />Wenn sie korrekt sind, werden hier weitere Möglichkeiten angezeigt angezeigt.");
             $t->addRowClass("backgroundColor0");
             $t->addRowStyle("color:red;");
         }
         if (PHYNX_MAIN_STORAGE == "MySQL") {
             try {
                 $DB1 = new DBStorageU();
                 $B = new Button("Hinweis", "notice", "icon");
                 $B->style("float:left;margin-right:10px;");
                 $File = new File(Util::getRootPath() . "system/connect.php");
                 $BR = new Button("DB-Verbindung\numstellen", "lieferschein");
                 $BR->style("float:right;margin-left:10px;");
                 $BR->rmePCR("mInstallation", "-1", "switchDBToMySQLo", "", "Installation.reloadApp();");
                 $BR = "Verwenden Sie den nebenstehenden Knopf, um die Verbindungsart auf die ältere Version umzustellen.<br />{$BR} Sie müssen sich anschließend erneut anmelden.";
                 $BReload = new Button("Ansicht\naktualisieren", "refresh");
                 $BReload->onclick("contentManager.emptyFrame('contentLeft'); contentManager.loadFrame('contentRight', 'mInstallation', -1, 0, 'mInstallationGUI;-');Popup.closeNonPersistent();");
                 $BReload->style("float:right;margin:10px;");
                 if (!$File->A("FileIsWritable")) {
                     $BR = "Bitte machen Sie die Datei /system/connect.php für den Webserver beschreibbar, damit phynx auf die ältere Verbindungsart umstellen kann.<br /><br />Verwenden Sie dazu Ihr FTP-Programm. Klicken Sie mit der rechten Maustaste auf die Datei auf dem Server, wählen Sie \"Eigenschaften\", und geben Sie den Modus 666 an, damit sie durch den Besitzer, die Gruppe und alle Anderen les- und schreibbar ist.{$BReload}";
                 }
                 $t->addRow(array("{$B} <b>Möglicherweise ist die MySQLi-Erweiterung auf Ihrem Server nicht korrekt konfiguriert.</b><br /><br />{$BR}"));
                 $t->addRowClass("backgroundColor0");
             } catch (Exception $e) {
                 #echo "MySQL geht auch nicht!";
             }
         }
         return $g . $t->getHTML();
         #.$help;
     } catch (TableDoesNotExistException $e) {
     } catch (StorageException $e) {
     }
     /*$help = "
     	<script type=\"text/javascript\">
     		rme('mInstallation','','getHelp','false','if(checkResponse(transport)) { Popup.create(\'123\', \'Installation\', \'Hilfe\'); Popup.update(transport, \'123\', \'Installation\'); }');
     	</script>";*/
     /*if(false AND $id == -1) {
     			$BackupTab = new HTMLTable(1);
     
     			$BackupButton = new Button("Backup-\nManager","disk");
     			$BackupButton->style("float:right;");
     			$BackupButton->onclick("contentManager.loadFrame('contentLeft','BackupManager');");
     
     			$BackupTab->addRow($BackupButton);
     
     			$BUT = new Button((isset($text["alle Tabellen aktualisieren"]) ? $text["alle Tabellen aktualisieren"] : "alle Tabellen\naktualisieren"), "update");
     			$BUT->rmePCR("mInstallation", "", "updateAllTables", "", "$('contentLeft').update(transport.responseText);");
     
     			$g .= "
     	<div style=\"height:30px;\"></div>
     	$BackupTab
     	<div class=\"Tab backgroundColor1\"><p>Plugins</p></div>
     	<table>
     		<colgroup>
     			<col style=\"width:100px;\" class=\"backgroundColor2\" />
     			<col class=\"backgroundColor3\" />
     		</colgroup>
     		<tr>
     			<td colspan=\"3\">
     				<span style=\"float:right;\">".Installation::getReloadButton()."</span>
     				$BUT
     			</td>
     		</tr>
     		<tr>
     			<td style=\"background-color:white;\"></td>
     		</tr>";
     
     			$p = array_flip($_SESSION["CurrentAppPlugins"]->getAllPlugins());
     			
     			
     			foreach($p as $key => $value){
     				try {
     					if(method_exists($_SESSION["CurrentAppPlugins"], "isPluginGeneric") AND $_SESSION["CurrentAppPlugins"]->isPluginGeneric($key)){
     						$c = new mGenericGUI('', $key);
     					} else {
     						$c = new $key();
     					}
     				} catch (ClassNotFoundException $e){
     					$key2 = $key."GUI";
     					
     					try {
     						$c = new $key2();
     					} catch (ClassNotFoundException $e2){
     						continue;
     					}
     				}
     				if($key == "CIs") continue;
     				
     
     				if($c->checkIfMyTableExists() AND $c->checkIfMyDBFileExists()) $showHelp = false;
     
     				if(!$c->checkIfMyDBFileExists())
     					continue;
     
     				$g .= "
     		<tr>
     			<td style=\"font-weight:bold;text-align:right;\">".($value != -1 ? $value : $key )."</td>
     			<td>".(!$c->checkIfMyTableExists() ? ($c->checkIfMyDBFileExists() ? "<input type=\"button\" value=\"".(isset($text["Tabelle anlegen"]) ? $text["Tabelle anlegen"] : "Tabelle anlegen")."\" onclick=\"installTable('$key');\" />" : "keine DB-Info-Datei" ) : ($c->checkIfMyDBFileExists() ? "<input type=\"button\" onclick=\"checkFields('$key');\" value=\"Tabellenupdate\" style=\"float:right;width:140px;\" />".(isset($text["Tabelle existiert"]) ? $text["Tabelle existiert"] : "Tabelle existiert") : (isset($text["keine DB-Info-Datei"]) ? $text["keine DB-Info-Datei"] : "keine DB-Info-Datei"))."")."</td>
     		</tr>";
     			}
     
     			$g .= "
     	</table>";
     		}*/
     #$showHelp = false;
     #if(!$showHelp)
     #	$help = OnEvent::script(OnEvent::closePopup("123", "Installation"));
     return $ST . $g;
     #.$help;
 }
Exemplo n.º 14
0
 function getHTML($id)
 {
     $forReload = "";
     $displayMode = null;
     $AuftragID = -1;
     $bps = $this->getMyBPSData();
     if ($bps != -1 and isset($bps["AuftragID"])) {
         $AuftragID = $bps["AuftragID"];
     }
     if ($bps != -1 and isset($bps["displayMode"])) {
         $displayMode = $bps["displayMode"];
     }
     $_SESSION["BPS"]->unsetACProperty("AuftragID");
     $_SESSION["BPS"]->unsetACProperty("displayMode");
     #if($this->A == null AND $id != -1) $this->loadMe();
     $this->loadMeOrEmpty();
     if ($id * 1 == -1) {
         $this->A = $this->newAttributes();
         $this->A->AuftragID = $AuftragID;
         if ($displayMode != null) {
             $this->A->type = $displayMode;
         }
         //Has to stay or lieferAdresse will also overwrite a normal Auftrags-Adresse
         if (Session::isPluginLoaded("mAdressBuch")) {
             $AB = BPS::getProperty("AdressenGUI", "AdressBuch", null);
             if ($AB) {
                 $this->A->type = "AB{$AB}";
             }
         }
         $id = $this->newMe(true, false);
         $this->forceReload();
         try {
             $K = new Kunden();
             if ($displayMode == null and $this->A("type") == "default") {
                 //Or else a lieferAdresse will get a Kundennummer
                 $K->createKundeToAdresse($id, false);
             }
         } catch (ClassNotFoundException $e) {
         }
         $forReload = "<script type=\"text/javascript\">lastLoadedLeft = {$id}; lastLoadedLeftPlugin = 'Adresse';</script>";
     }
     $OptTab = new HTMLSideTable("right");
     if (Session::isPluginLoaded("Kunden") and $this->A->AuftragID == -1) {
         $B = new Button("Kundendaten", "kunden");
         $B->loadFrame("contentLeft", "Kunde", "-1", "0", "KundeGUI;AdresseID:{$this->getID()};action:Kappendix");
         $OptTab->addRow($B);
     }
     if ($_SESSION["applications"]->getActiveApplication() == "open3A") {
         if ($displayMode != null) {
             $OptTab->setTableStyle("width:160px;margin:0px;margin-left:-170px;float:left;");
         }
         if (($id == -1 or $forReload != "") and Session::isPluginLoaded("mImport")) {
             $OTBV = new Button("Schnell-\nImport", "import");
             #$OTBV->rmePCR("importAdresse", "", "getFastImportWindow", "", "Popup.display('Adresse importieren:',transport);");
             $OTBV->onclick("Import.openSchnellImportAdresse('Adresse importieren:');");
             $OTBV->id("ButtonAdresseSchnellImport");
             $OptTab->addRow($OTBV);
         }
         if ($id != -1 and Session::isPluginLoaded("Kundenpreise") and $this->A->AuftragID == -1 and $this->A->type == "default") {
             $ButtonKundenpreise = new Button("Kundenpreise", "package");
             $ButtonKundenpreise->onclick("contentManager.loadFrame('contentLeft','Kunde', -1, 0, 'KundeGUI;AdresseID:{$this->ID};action:Kundenpreise');");
             $OptTab->addRow($ButtonKundenpreise);
         }
         if ($this->A->AuftragID == -1 and (Session::isPluginLoaded("mAnsprechpartner") or Session::isPluginLoaded("mOSM"))) {
             $OptTab->addRow("");
             $OptTab->addCellStyle(1, "height:30px;");
         }
         if ($id != -1 and Session::isPluginLoaded("mAnsprechpartner") and $this->A->AuftragID == -1) {
             $OptTab->addRow(Ansprechpartner::getButton("Adresse", $this->getID()));
         }
         if ($id != -1 and Session::isPluginLoaded("mOSM") and $this->A("AuftragID") == -1) {
             $OptTab->addRow(OpenLayers::getButton("Adresse", $this->getID()));
         }
     }
     if (Session::isPluginLoaded("mklickTel") and $this->A->AuftragID == -1) {
         $OptTab->addRow(klickTel::getButton($this->getID()));
     }
     $this->loadMeOrEmpty();
     $gui = $this->gui;
     $gui->insertSpaceAbove("tel", "Kontakt");
     $gui->insertSpaceAbove("strasse", "Adresse");
     $gui->insertSpaceAbove("homepage", "Sonstiges");
     $gui->setFormID("AdresseForm");
     $fields = array("firma", "position", "anrede", "vorname", "nachname", "AdresseSpracheID", "strasse", "bezirk", "zusatz1", "ort", "land", "tel", "fax", "mobil", "email", "homepage", "gebRem", "gebRemMail", "AuftragID", "KategorieID", "type", "geb", "bemerkung");
     if (Session::isPluginLoaded("mLDAP")) {
         $fields[] = "exportToLDAP";
     }
     $gui->setShowAttributes($fields);
     $gui->setLabel("bemerkung", "Notizen");
     if (Session::isPluginLoaded("mSprache")) {
         $gui->setLabel("AdresseSpracheID", "Sprache");
         $gui->setLabelDescription("AdresseSpracheID", "und Währung");
         #$ACS = anyC::get("Sprache");
         #$S = array();
         #while($SLW = $ACS->getNextEntry())
         #	$S[$SLW->getID()] = $SLW->A("SpracheSprache")." "." ".$SLW->A("SpracheWaehrung");
         $gui->selectWithCollection("AdresseSpracheID", new mSprache(), "SpracheName");
         #$gui->setType("AdresseSpracheID", "select");
         #$gui->setOptions("AdresseSpracheID", array_keys($S), array_values($S));
         #$gui->insertSpaceAbove("firma");
     } else {
         $gui->setType("AdresseSpracheID", "hidden");
     }
     #$gui->setAttributes($this->A);
     $gui->setObject($this);
     $gui->setName("Adresse");
     $gui->setOptions("anrede", array_keys(self::getAnreden()), array_values(self::getAnreden()));
     $gui->setType("anrede", "select");
     $gui->setType("geb", "hidden");
     $gui->setType("gebRemMail", "hidden");
     $gui->setType("gebRem", "hidden");
     $gui->setType("exportToLDAP", "checkbox");
     $gui->insertSpaceAbove("exportToLDAP");
     $gui->setFieldDescription("exportToLDAP", "Soll die Adresse auf einen LDAP-Server exportiert werden?");
     $gui->setType("AuftragID", "hidden");
     $gui->setType("type", "hidden");
     #$gui->setLabel("geb","Jahrestag");
     $gui->setLabel("ort", "PLZ/Ort");
     $gui->setLabel("strasse", "Straße/Hausnr.");
     $gui->setLabel("tel", "Telefon");
     $gui->setLabel("email", "E-Mail");
     $gui->setLabel("exportToLDAP", "LDAP-Export?");
     $gui->setParser("strasse", "AdresseGUI::parserStrasse", array($this->A("nr")));
     $gui->setParser("ort", "AdresseGUI::parserOrt", array($this->A("plz")));
     #$gui->useAutoCompletion("plz", (Session::isPluginLoaded("Postleitzahlen") ? "Postleitzahlen" : "Adressen"));
     if (Session::isPluginLoaded("mStammdaten") or Applications::activeApplication() == "MMDB") {
         /*if($this->A("land") == ""){
         			$S = Stammdaten::getActiveStammdaten();
         			if($S->A("land") == "D") $S->changeA("land","DE");
         			$this->changeA("land", ISO3166::getCountryToCode($S->A("land")));
         		}*/
         $gui->setType("land", "select");
         $countries = ISO3166::getCountries();
         $labels = array_merge(array("" => "keine Angabe"), $countries);
         $values = array_merge(array("" => ""), $countries);
         $gui->setOptions("land", array_values($values), array_values($labels));
         if ($this->A("land") != ISO3166::getCountryToCode("GB") and $this->A("land") != ISO3166::getCountryToCode("US") and $this->A("land") != ISO3166::getCountryToCode("CH")) {
             $gui->setLineStyle("zusatz1", "display:none;");
             $gui->setLineStyle("position", "display:none;");
         }
         if ($this->A("land") != ISO3166::getCountryToCode("DK") and $this->A("land") != ISO3166::getCountryToCode("ES")) {
             $gui->setLineStyle("bezirk", "display:none;");
         }
         $gui->setLabel("zusatz1", "Zusatz 1");
         $gui->setInputJSEvent("land", "onchange", "contentManager.toggleFormFields((this.value == '" . ISO3166::getCountryToCode("GB") . "' || this.value == '" . ISO3166::getCountryToCode("US") . "' || this.value == '" . ISO3166::getCountryToCode("CH") . "') ? 'show' : 'hide', ['zusatz1', 'position']); contentManager.toggleFormFields((this.value == '" . ISO3166::getCountryToCode("DK") . "' || this.value == '" . ISO3166::getCountryToCode("ES") . "') ? 'show' : 'hide', ['bezirk']);");
     }
     if (Session::isPluginLoaded("mGemeinschaft")) {
         $gui->activateFeature("addCustomButton", $this, "tel", Gemeinschaft::getCallButton($this->A("tel")));
         $gui->activateFeature("addCustomButton", $this, "mobil", Gemeinschaft::getCallButton($this->A("mobil"), "mobile"));
     }
     $kat = new Kategorien();
     $kat->addAssocV3("type", "=", $displayMode != "" ? $displayMode : "1");
     $keys = $kat->getArrayWithKeys();
     $keys[] = "0";
     $values = $kat->getArrayWithValues();
     $values[] = "bitte auswählen";
     $gui->setOptions("KategorieID", $keys, $values);
     $gui->setType("bemerkung", "textarea");
     $gui->setLabel("KategorieID", "Kategorie");
     if ($AuftragID == -1) {
         $gui->setType("KategorieID", "select");
     } else {
         $gui->setType("KategorieID", "hidden");
         $gui->setType("bemerkung", "hidden");
         $gui->setType("tel", "hidden");
         $gui->setType("fax", "hidden");
         $gui->insertSpaceAbove("email");
         $gui->setType("homepage", "hidden");
         $gui->setType("exportToLDAP", "hidden");
         $gui->setType("mobil", "hidden");
     }
     switch ($displayMode) {
         case "auftragsAdresse":
             $gui->setJSEvent("onSave", "function() {\n\t\t\t\t\tcontentManager.loadFrame('contentLeft','Auftrag',{$this->A->AuftragID});\n\t\t\t\t\tcontentManager.loadFrame('contentRight','Auftraege');\n\t\t\t\t}");
             break;
         case "lieferAdresse":
             $this->A->type = "lieferAdresse";
             $gui->setJSEvent("onSave", "function() {\n\t\t\t\t\tcontentManager.loadFrame('contentRight','Auftraege');\n\t\t\t\t\tcontentManager.loadFrame('subframe','GRLBM',{$this->A->AuftragID});\n\t\t\t\t}");
             break;
     }
     Aspect::joinPoint("buttons", $this, __METHOD__, $OptTab);
     $gui->setStandardSaveButton($this, "Adressen");
     $gui->customize($this->customizer);
     return $forReload . $OptTab . $gui->getEditHTML();
 }
Exemplo n.º 15
0
 *  (at your option) any later version.
 *  phynx is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  2007 - 2016, Rainer Furtmeier - Rainer@Furtmeier.IT
 */
require "../classes/backend/BackgroundPluginState.class.php";
require "../classes/toolbox/BPS.class.php";
require "../classes/toolbox/Util.class.php";
session_name("phynx_" . sha1(str_replace("" . DIRECTORY_SEPARATOR . "interface" . DIRECTORY_SEPARATOR . "showPDF.php", "" . DIRECTORY_SEPARATOR . "system" . DIRECTORY_SEPARATOR . "connect.php", __FILE__)));
session_start();
if (!isset($_SESSION["BPS"])) {
    die(Util::getBasicHTMLError("Ihre Sitzung ist nicht bekannt. Bitte loggen Sie sich ein.", "Sitzung unbekannt"));
}
$_SESSION["BPS"]->setActualClass("showPDF");
$f = $_SESSION["BPS"]->getACProperty("filename");
if ($f == "") {
    die("No filename set!");
}
header('Content-Type: application/pdf');
header('Content-Length: ' . filesize($f));
header("Content-Disposition: inline; filename=\"" . basename($f) . "\"");
readfile($f);
if (BPS::getProperty("showPDF", "delete", true) and strpos($f, "/tmp") !== 0) {
    unlink($f);
}
exit;
Exemplo n.º 16
0
 function getBrowserHTML($lineWithId = -1, $useBPS = true)
 {
     $bps = BPS::getAllProperties("m" . $this->className . "GUI");
     if (!$useBPS) {
         $bps = false;
     }
     $GUIF = $this->GUIFactory;
     $GUIF->setMultiPageDetails($this->multiPageDetails);
     $GUIF->setTableMode($this->displayMode);
     $GUIF->options($this->showTrash, $this->showEdit, $this->showNew);
     if ($this->blacklists != null) {
         $GUIF->blacklists($this->blacklists);
     }
     if (isset($bps["selectionMode"])) {
         $GUIF->selection($bps["selectionMode"]);
     }
     #$GUIF->features($this->features);
     #$this->multiPageDetails["target"] = $this->frame;#"contentRight";
     #$GUIF->setMultiPageDetails($this->multiPageDetails);
     $E = $this->object->getNextEntry();
     if ($this->attributes == null and $E != null) {
         $this->attributes = PMReflector::getAttributesArrayAnyObject($E->getA());
     }
     if ($E == null) {
         //To fix display error when no entry
         $this->attributes = array("");
     }
     if ($this->caption == null) {
         $this->caption("Bitte " . ($this->name == null ? $this->className : $this->name) . " auswählen:");
     }
     $Tab = $GUIF->getTable($this->attributes, $this->colStyle, $this->caption);
     $Tab->setTableID("Browserm{$this->className}");
     if ($this->header != null) {
         $Tab->addHeaderRow($this->header);
     }
     if ($lineWithId == -1) {
         if ($this->showQuicksearch) {
             $GUIF->buildQuickSearchLine();
         }
         if ($this->multiPageDetails["total"] > $this->multiPageDetails["perPage"]) {
             $GUIF->buildFlipPageLine("top");
         }
         $GUIF->buildNewEntryLine(($this->name == null ? $this->className : $this->name) . " neu anlegen");
         if ($this->object->isFiltered()) {
             $GUIF->buildFilteredWarningLine();
         }
     }
     $this->object->resetPointer();
     $DisplayGroup = null;
     while ($E = $this->object->getNextEntry()) {
         /**
          * DisplayGroup
          */
         if ($lineWithId == -1 and $this->displayGroup != null and $DisplayGroup != $E->A($this->displayGroup[0])) {
             if ($this->displayGroup[1] != null) {
                 $DGP = explode("::", $this->displayGroup[1]);
                 $GUIF->buildGroupLine(Util::invokeStaticMethod($DGP[0], $DGP[1], array($E->A($this->displayGroup[0]), $E)));
             } else {
                 $GUIF->buildGroupLine($E->A($this->displayGroup[0]));
             }
         }
         $Line = array();
         foreach ($this->attributes as $attributeName) {
             $LineContent = $E->A($attributeName);
             if (isset($this->parsers[$attributeName])) {
                 $LineContent = $this->invokeParser($this->parsers[$attributeName], $LineContent, $E);
             } else {
                 $LineContent = htmlspecialchars($LineContent);
             }
             $Line[] = $LineContent;
         }
         $GUIF->buildLine($E->getID(), $Line);
         if ($this->displayGroup != null) {
             $DisplayGroup = $E->A($this->displayGroup[0]);
         }
     }
     if ($lineWithId == -1) {
         if ($this->object->isFiltered()) {
             $GUIF->buildFilteredWarningLine();
         }
         if ($this->multiPageDetails["total"] > $this->multiPageDetails["perPage"]) {
             $GUIF->buildFlipPageLine("bottom");
         }
     } else {
         return $Tab->getHTMLForUpdate();
     }
     return $this->topButtons($bps) . $this->sideButtons($bps) . $GUIF->getContainer($Tab, $this->caption) . str_replace("%CLASSNAME", $this->className, $this->sortable) . $this->tip;
 }
Exemplo n.º 17
0
 public function getTable($GUI)
 {
     $bps = BPS::getAllProperties("mKalenderGUI");
     $K = $GUI->getData($this->first, $this->last, isset($bps["KID"]) ? $bps["KID"] : Session::currentUser()->getID());
     $cols = $this->cols;
     $rows = $this->rows;
     $html = "<div style=\"border-top:1px solid #DDD;width:" . ($cols * 65 + 80) . "px;\">";
     $D = clone $this->date;
     for ($i = 0; $i < $rows; $i++) {
         #if($i == 0){
         $html .= "<div style=\"width:" . ($cols * 65 + 80) . "px;\">" . "<div class=\"backgroundColor3\" style=\"vertical-align:top;display:inline-block;width:76px;padding:2px;\">" . Util::CLMonthName($i + 1) . "</div>";
         for ($j = 0; $j < $cols; $j++) {
             $Max = $D->getMaxDaysOfMonth();
             $day = "&nbsp;";
             if ($j < $Max) {
                 $day = $j + 1;
             }
             $html .= "<div class=\"MonthDay MonthDayHeader backgroundColor3\" style=\"vertical-align:top;display:inline-block;width:60px;padding:2px;text-align:right;color:grey;\"><small>{$day}</small></div>";
         }
         $html .= "</div>";
         #}
         $html .= "<div style=\"width:" . ($cols * 65 + 80) . "px;height:300px;min-height:70px;border-bottom:0px;\" class=\"Month\">" . "<div style=\"vertical-align:top;display:inline-block;width:80px;\"></div>";
         $DM = clone $D;
         $monthFirst = $DM->time();
         $DM->setToMonthLast();
         $monthLast = $DM->time();
         $K->getEventsOnDay(date("dmY", $DM->time()));
         //initializes data
         #echo Util::CLDateParser($monthFirst)."-".Util::CLDateParser($monthLast).":";
         $hasMultiDay = $K->hasMultiDayEvents($monthFirst, $monthLast);
         for ($j = 0; $j < $cols; $j++) {
             $bgColor = "none";
             if (date("w", $D->time()) == 6) {
                 $bgColor = $this->colorBgSaturday;
             }
             if (date("w", $D->time()) == 0) {
                 $bgColor = $this->colorBgSunday;
             }
             if ($j >= $D->getMaxDaysOfMonth()) {
                 $bgColor = "none";
             }
             $html .= "<div class=\"MonthDay\" style=\"background-Color:{$bgColor};position:relative;min-height:70px;display:inline-block;width:64px;vertical-align:top;\">";
             if ($j < $D->getMaxDaysOfMonth()) {
                 $entry = "";
                 $events = $K->getEventsOnDay(date("dmY", $D->time()));
                 $holidays = $K->getHolidaysOnDay(date("dmY", $D->time()));
                 $entry .= "<div class=\"MonthMultiDay backgroundColor4\" style=\"min-height:" . $hasMultiDay * 17 . "px;\">";
                 if ($events != null) {
                     foreach ($events as $ev) {
                         foreach ($ev as $v) {
                             $entry .= $v->getMinimal($D->time());
                         }
                     }
                 }
                 $entry .= "</div>";
                 if ($holidays != null) {
                     foreach ($holidays as $ev) {
                         foreach ($ev as $v) {
                             $entry .= $v->getMinimal($D->time());
                         }
                     }
                 }
                 $html .= $entry;
             }
             $html .= "</div>";
             if ($D->d() >= $D->getMaxDaysOfMonth()) {
                 continue;
             }
             $D->addDay();
         }
         $D->addDay();
         $html .= "</div>";
     }
     $html .= "</div>";
     return $html . OnEvent::script("\$j('.Month').each(function(k, v){ var max = 0; max += \$j(this).find('.MonthMultiDay').outerHeight(); \$j(this).find('.MonthDay').each(function(k, v){ var l =\$j(this).find('div').each(function(){ var mt = parseInt(\$j(this).css('margin-top')); if(mt > max) max = mt + \$j(this).outerHeight(); }); }); \$j(this).css('height', max + \$j('.MonthDayHeader').outerHeight()).find('.MonthDay').css('height', max + \$j('.MonthDayHeader').outerHeight()); })");
     #"<table id=\"KalenderHeader\" style=\"position:absolute;margin-left:10px;border-spacing: 0px;width:auto;\" class=\"backgroundColor0\">
     $tableHeader = "\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th style=\"border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#EEE;padding-top:10px;text-align:right;\" class=\"backgroundColor0\">Monat</th>";
     for ($j = 0; $j < $this->cols; $j++) {
         $tableHeader .= "\n\t\t\t\t<th style=\"border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#EEE;padding-top:10px;\" class=\"backgroundColor0\">" . ($j + 1) . "</th>";
     }
     $tableHeader .= "\n\t\t</tr>\n\t\t</thead>\n\t\t";
     #</table>
     $html = "\n\t\t\t\n\t\t<div style=\"\">\n\t\t<!--<table id=\"KalenderHeader\" style=\"position:absolute;margin-left:10px;border-spacing: 0px;\">\n\t\t\t{$tableHeader}\n\t\t</table>-->\n\t\t<table style=\"margin-left:10px;border-spacing: 0px;\" id=\"KalenderTable\">\n\t\t\t<colgroup>\n\t\t\t\t<col></col>";
     for ($j = 0; $j < $cols; $j++) {
         #
         $html .= "\n\t\t\t\t<col style=\"width:" . 100 / $cols . "%;\" />";
     }
     $html .= "\n\t\t{$tableHeader}\n\t\t<tbody>";
     $D = clone $this->date;
     for ($i = 0; $i < $rows; $i++) {
         $html .= "\n\t\t\t<tr class=\"cellHeight\">\n\t\t\t\t<td class=\"Day borderColor1 backgroundColor3\" style=\"text-align:right;\">" . Util::CLMonthName($i + 1) . "</td>";
         for ($j = 0; $j < $cols; $j++) {
             $entry = "";
             $events = $K->getEventsOnDay(date("dmY", $D->time()));
             $holidays = $K->getHolidaysOnDay(date("dmY", $D->time()));
             #$hasMultiDay = $K->hasMultiDayEvents($this->first, $this->last);
             if ($events != null) {
                 foreach ($events as $ev) {
                     foreach ($ev as $v) {
                         $entry .= $v->getMinimal($D->time());
                     }
                 }
             }
             if ($holidays != null) {
                 foreach ($holidays as $ev) {
                     foreach ($ev as $v) {
                         $entry .= $v->getMinimal($D->time());
                     }
                 }
             }
             $bgColor = "none";
             if (date("w", $D->time()) == 6) {
                 $bgColor = $this->colorBgSaturday;
             }
             if (date("w", $D->time()) == 0) {
                 $bgColor = $this->colorBgSunday;
             }
             #".((date("m.Y",$D->time()) != date("m.Y",$currentMonth->time())) ? "color:grey;" : "")."
             if ($j < $cols) {
                 $html .= "\n\t\t\t\t<td\n\t\t\t\t\tstyle=\"vertical-align:top;padding:0px;background-color:{$bgColor};overflow:auto;\"\n\t\t\t\t\tclass=\"" . (date("d.m.Y", $D->time()) == date("d.m.Y") ? "backgroundColor1" : "") . " Day borderColor1\">\n\t\t\t\t\t<div style=\"font-size:10px;\">{$entry}</div>\n\t\t\t\t</td>";
             }
             $D->addDay();
             #if(date("d", $D->time()) == 1){
             #for(;$j < $cols;$j++)
             #	$html .= "<td class=\"Day borderColor1\"></td>";
             #}
         }
         $html .= "\n\t\t\t</tr>";
     }
     $html .= "\n\t\t\t</tbody>\n\t\t</table>\n\t\t</div>";
     #.OnEvent::script("\$j('#KalenderTable thead th').each(function(k, v){ \$j(\$j('#KalenderHeader thead th').get(k)).css('width', \$j(v).width()); console.log(\$j(v).width()); }); \$j('#KalenderHeader').css('width', \$j('#KalenderTable').width())");#.OnEvent::script("\$j('#KalenderTable').fixedHeaderTable({ footer: false, cloneHeadToFoot: false, fixedColumn: true });");
     return $html;
 }
Exemplo n.º 18
0
 public static function adviceAboveList()
 {
     $bps = BPS::getAllProperties("FileManagerGUI");
     #
     $bps["path"] = str_replace('\\', "/", preg_replace("/^([A-Z]):/", "\\1%", $bps["path"]));
     #print_r($bps);
     $mF = new mFileGUI();
     return $mF->getUploadForm($bps["path"], BPS::getProperty("FileManagerGUI", "reloadFunction", "contentManager.reloadFrame('contentLeft');"), false, "width:100%;");
 }
Exemplo n.º 19
0
 public function getTable($GUI)
 {
     $bps = BPS::getAllProperties("mKalenderGUI");
     $K = $GUI->getData($this->first, $this->last, isset($bps["KID"]) ? $bps["KID"] : Session::currentUser()->getID());
     $ansicht = $this->ansicht;
     $cols = $this->cols;
     $rows = $this->rows;
     $html = "<table style=\"margin-left:10px;border-spacing: 0px;\" id=\"KalenderTable\">\n\t\t\t<colgroup>";
     for ($j = 0; $j < $cols - 2; $j++) {
         #
         $html .= "\n\t\t\t\t<col " . ($ansicht == "woche" ? "class=\"backgroundColor" . ($j % 2 + 2) . "\" " : "") . " style=\"width:" . 100 / $cols . "%;\" />";
     }
     $html .= "\n\t\t\t\t<col style=\"background-color:{$this->colorBgSaturday};width:" . 100 / $cols . "%;\" />\n\t\t\t\t<col style=\"background-color:{$this->colorBgSunday};width:" . 100 / $cols . "%;\" />\n\t\t\t</colgroup>";
     if ($ansicht != "tag") {
         $html .= "\n\t\t\t\t<tr>";
         $D2 = clone $this->date;
         for ($j = 0; $j < $cols; $j++) {
             $html .= "\n\t\t\t\t\t\t<th style=\"border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#EEE;padding-top:10px;\" class=\"backgroundColor0\">" . Util::CLWeekdayName(date("w", $D2->time())) . "</th>";
             $D2->addDay();
         }
         unset($D2);
         $html .= "\n\t\t\t</tr>";
     }
     $D = clone $this->date;
     for ($i = 0; $i < $rows; $i++) {
         $html .= "\n\t\t\t<tr class=\"cellHeight noHover\">";
         for ($j = 0; $j < $cols; $j++) {
             $entry = "";
             $events = $K->getEventsOnDay(date("dmY", $D->time()));
             $holidays = $K->getHolidaysOnDay(date("dmY", $D->time()));
             $hasMultiDay = $K->hasMultiDayEvents($this->first, $this->last);
             if ($ansicht == "tag") {
                 #$dayContent = "";
                 $dayDivs = "";
                 for ($i = 0; $i < 24; $i++) {
                     $dayDivs .= "\n\t\t\t\t\t\t<div style=\"height:40px;z-index:10;\" class=\"backgroundColor" . ($i % 2 == 0 ? "3" : "2") . "\">\n\t\t\t\t\t\t\t";
                     $BN = "";
                     if (Session::isPluginLoaded("mTodo")) {
                         $BN = new Button("Neuer Termin", "./ubiquitous/Kalender/addToDo.png", "icon");
                         $BN->className("KalenderButton");
                         $BN->popup("", "Neuer Termin", "mKalender", "-1", "newTodo", array("-1", $D->time(), "'Kalender'", "-1", $i), "", "Kalender.popupOptions");
                         $BN->style("float:left;margin-left:5px;margin-top:5px;");
                     }
                     $dayDivs .= "\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"borderColor1\" style=\"height:35px;border-right-width:1px;border-right-style:dotted;float:left;width:40px;padding-top:5px;padding-right:5px;font-weight:bold;text-align:right;color:grey;\">" . ($i < 10 ? "0" : "") . "{$i}:00</div>\n\t\t\t\t\t\t{$BN}</div>";
                 }
                 $eventsDiv = "";
                 for ($i = 0; $i < 24; $i++) {
                     if (count($events) > 0) {
                         foreach ($events as $time => $ev) {
                             if (substr($time, 0, 2) * 1 != $i) {
                                 continue;
                             }
                             foreach ($ev as $KE) {
                                 $eventsDiv .= $KE->getDayViewHTML($D->time());
                             }
                         }
                     }
                 }
                 $entry = "\n\t\t\t\t\t\t<div class=\"cellHeight\" style=\"overflow:auto;width:961px;\" id=\"tagDiv\">\n\t\t\t\t\t\t\t<div style=\"height:961px;\">\n\t\t\t\t\t\t\t{$dayDivs}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div style=\"margin-top:-961px;\">\n\t\t\t\t\t\t\t\t{$eventsDiv}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>";
             } elseif ($ansicht == "woche") {
                 $dayDivs = "";
                 for ($k = 0; $k < $hasMultiDay; $k++) {
                     $dayDivs .= "<div style=\"height:22px;z-index:10;\" class=\"borderColor0\"></div>";
                 }
                 for ($k = 0; $k < 24; $k++) {
                     $bgColor = "";
                     if ($k < 7 or $k > 19) {
                         $bgColor = "background-color:rgba(255, 255, 255, 0.3)";
                     }
                     $border = "border-top:1px dotted white;";
                     if ($k == 23) {
                         $border .= "border-bottom:1px dotted white;";
                     }
                     if ($k == 12) {
                         $border = "border-top:1px solid white;";
                     }
                     $dayDivs .= "\n\t\t\t\t\t\t<div style=\"height:" . ($k < 6 ? "10" : "21") . "px;z-index:10;{$border}{$bgColor}\" class=\"borderColor0\">\n\t\t\t\t\t\t\t";
                     if ($k > 5 and $k < 21 and $k % 2 == 0 and $j % 2 == 1) {
                         $dayDivs .= "\n\t\t\t\t\t\t\t\t<div class=\"borderColor1\" style=\"color:#777;padding-left:3px;\">" . ($k < 10 ? "0" : "") . "{$k}</div>";
                     }
                     $dayDivs .= "\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</div>";
                 }
                 $eventsDiv = "";
                 for ($i = 0; $i < 24; $i++) {
                     if (count($events) > 0) {
                         foreach ($events as $time => $ev) {
                             if (substr($time, 0, 2) * 1 != $i) {
                                 continue;
                             }
                             foreach ($ev as $KE) {
                                 $eventsDiv .= $KE->getWeekViewHTML($D->time(), $hasMultiDay);
                             }
                         }
                     }
                 }
                 $entry = "\n\t\t\t\t\t\t<div style=\"overflow:auto;height:" . (11 * 6 + 22 * 18 + 1 + $hasMultiDay * 22) . "px;width:100%;\">\n\t\t\t\t\t\t\t<div style=\"height:" . (11 * 6 + 22 * 18 + 1) . "px;\">\n\t\t\t\t\t\t\t\t{$dayDivs}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div style=\"margin-top:-" . (11 * 6 + 22 * 18 + 1) . "px;\">\n\t\t\t\t\t\t\t\t{$eventsDiv}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>";
             } else {
                 if ($events != null) {
                     foreach ($events as $time => $ev) {
                         foreach ($ev as $v) {
                             $entry .= $v->getMinimal($D->time());
                         }
                     }
                 }
                 if ($holidays != null) {
                     foreach ($holidays as $ev) {
                         foreach ($ev as $v) {
                             $entry .= $v->getMinimal($D->time());
                         }
                     }
                 }
             }
             $BD = new Button("Tagesansicht", "./ubiquitous/Kalender/showDetails.png");
             $BD->type("icon");
             $BD->rmePCR("mKalender", "-1", "setView", array("'tag'", "'" . $D->time() . "'"), "contentManager.loadFrame('contentScreen','mKalender');");
             $BD->style("float:left;");
             $BN = "";
             if (Session::isPluginLoaded("mTodo")) {
                 $BN = new Button("Neuer Termin", "./ubiquitous/Kalender/addToDo.png");
                 $BN->type("icon");
                 $BN->popup("", "Neuer Termin", "mKalender", "-1", "newTodo", array("-1", $D->time(), "'Kalender'", "-1"), "", "Kalender.popupOptions");
                 $BN->style("float:left;margin-left:5px;");
             }
             #".((date("m.Y",$D->time()) != date("m.Y",$currentMonth->time())) ? "color:grey;" : "")."
             if ($j < $cols) {
                 $html .= "\n\t\t\t\t<td\n\t\t\t\t\tstyle=\"vertical-align:top;padding:0px;\"\n\t\t\t\t\tclass=\"" . ((date("d.m.Y", $D->time()) == date("d.m.Y") and $ansicht != "tag") ? "backgroundColor1" : "") . " Day borderColor1\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle=\"" . ($ansicht == "tag" ? "display:none;" : "") . "height:21px;padding-top:2px;padding-left:5px;text-align:right;padding-right:5px;\"\n\t\t\t\t\t\tclass=\"innerCellTitle\">\n\t\t\t\t\t\t" . ($ansicht != "tag" ? "<span class=\"dayOptions\">{$BD}{$BN}</span>" : "") . "\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tstyle=\"color:grey;\">\n\t\t\t\t\t\t\t" . ($ansicht != "tag" ? date("d", $D->time()) : "&nbsp;") . "\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"overflow:auto;" . ($ansicht == "monat" ? "margin-top:0px;width:100%;" : "") . "\" class=\"" . ($ansicht == "monat" ? "innerCellHeight" : "") . "\">{$entry}</div>\n\t\t\t\t</td>";
             }
             $D->addDay();
         }
         for ($j = 0; $j < 7 - $cols; $j++) {
             $D->addDay();
         }
         $html .= "\n\t\t\t</tr>";
     }
     $html .= "\n\t\t</table>";
     return $html;
 }
Exemplo n.º 20
0
 function getHTML($id)
 {
     // <editor-fold defaultstate="collapsed" desc="Aspect:jP">
     try {
         $MArgs = func_get_args();
         return Aspect::joinPoint("around", $this, __METHOD__, $MArgs);
     } catch (AOPNoAdviceException $e) {
     }
     Aspect::joinPoint("before", $this, __METHOD__, $MArgs);
     // </editor-fold>
     $this->loadMeOrEmpty();
     $bps = $this->getMyBPSData();
     $allowed = array();
     $ACS = anyC::get("Userdata", "name", "shareCalendarTo" . Session::currentUser()->getID());
     $ACS->addAssocV3("name", "=", "shareCalendarTo0", "OR");
     while ($Share = $ACS->getNextEntry()) {
         $allowed[$Share->A("UserID")] = $Share->A("wert");
     }
     if ($id == -1) {
         $this->A->TodoTillDay = Util::CLDateParser(time() + 7 * 24 * 3600);
         $this->A->TodoTillTime = Util::CLTimeParser(10 * 3600);
         $this->A->TodoFromDay = Util::CLDateParser(time() + 7 * 24 * 3600);
         $this->A->TodoFromTime = Util::CLTimeParser(9 * 3600);
         $this->A->TodoType = "2";
         if ($bps != -1 and isset($bps["TodoTillDay"])) {
             $this->A->TodoTillDay = $bps["TodoTillDay"];
             $this->A->TodoFromDay = $bps["TodoTillDay"];
             BPS::unsetProperty("TodoGUI", "TodoTillDay");
         }
         if ($bps != -1 and isset($bps["TodoFromTime"])) {
             $this->A->TodoFromTime = Util::CLTimeParser($bps["TodoFromTime"] * 3600);
             $this->A->TodoTillTime = Util::CLTimeParser(($bps["TodoFromTime"] + 1) * 3600);
             BPS::unsetProperty("TodoGUI", "TodoFromTime");
         }
         if ($bps != -1 and isset($bps["TodoDescription"])) {
             $this->A->TodoDescription = $bps["TodoDescription"];
             BPS::unsetProperty("TodoGUI", "TodoDescription");
         }
         if ($bps != -1 and isset($bps["TodoLocation"])) {
             $this->A->TodoLocation = $bps["TodoLocation"];
             BPS::unsetProperty("TodoGUI", "TodoLocation");
         }
         if ($bps != -1 and isset($bps["TodoName"])) {
             $this->A->TodoName = $bps["TodoName"];
             BPS::unsetProperty("TodoGUI", "TodoName");
         }
         $for = BPS::getProperty("mKalenderGUI", "KID", Session::currentUser()->getID());
         if ($for != Session::currentUser()->getID() and strpos($allowed[$for], "create") === false) {
             $for = Session::currentUser()->getID();
         }
         $this->A->TodoUserID = $for;
         $this->A->TodoClass = BPS::getProperty("mTodoGUI", "ownerClass");
         $this->A->TodoClassID = BPS::getProperty("mTodoGUI", "ownerClassID");
     }
     $gui = $this->GUI;
     $gui->name("Termin");
     $gui->label("TodoDescription", "Details");
     $gui->label("TodoTillDay", "Ende");
     $gui->label("TodoTillTime", "Uhrzeit");
     $gui->label("TodoFromDay", "Anfang");
     $gui->label("TodoFromTime", "Uhrzeit");
     $gui->label("TodoType", "Typ");
     $gui->label("TodoUserID", "Zuständig");
     $gui->label("TodoStatus", "Status");
     $gui->label("TodoRemind", "Erinnerung");
     $gui->label("TodoName", "Betreff");
     $gui->label("TodoRepeat", "Wiederholen");
     #$gui->label("TodoRepeatInterval","Intervall");
     $gui->label("TodoClassID", "Kunde");
     $gui->label("TodoLocation", "Ort");
     $gui->label("TodoAllDay", "Ganzer Tag");
     $gui->space("TodoRemind", "Optionen");
     $gui->space("TodoFromDay", "Zeit");
     if ($this->A("TodoFromDay") == "01.01.1970" and $this->A("TodoFromTime") == "00:00") {
         $this->changeA("TodoFromDay", $this->A("TodoTillDay"));
         $this->changeA("TodoFromTime", $this->A("TodoTillTime"));
     }
     $gui->attributes(array("TodoType", "TodoClass", "TodoClassID", "TodoDescription", "TodoLocation", "TodoFromDay", "TodoTillDay", "TodoAllDay", "TodoRemind", "TodoUserID"));
     $gui->type("TodoType", "select", TodoGUI::types());
     $gui->type("TodoRemind", "select", array("-1" => "keine Erinnerung", "60" => "1 Minute vorher", "300" => "5 Minuten vorher", "600" => "10 Minuten vorher", "900" => "15 Minuten vorher", "1800" => "30 Minuten vorher", "2700" => "45 Minuten vorher", "3600" => "1 Stunde vorher"));
     $gui->type("TodoClass", "hidden");
     $gui->type("TodoDescription", "textarea");
     $gui->type("TodoAllDay", "checkbox");
     $gui->addFieldEvent("TodoAllDay", "onchange", "\$j('#TodoFromTimeDisplay').css('display', this.checked ? 'none' : 'inline'); \$j('#TodoTillTimeDisplay').css('display', this.checked ? 'none' : 'inline');");
     $gui->parser("TodoFromDay", "TodoGUI::dayFromParser");
     $gui->parser("TodoTillDay", "TodoGUI::dayTillParser");
     $ac = Users::getUsers();
     $users = array();
     while ($u = $ac->getNextEntry()) {
         if (!isset($allowed[$u->getID()]) and $u->getID() != Session::currentUser()->getID()) {
             continue;
         }
         if (isset($allowed[$u->getID()]) and strpos($allowed[$u->getID()], "create") === false) {
             continue;
         }
         $users[$u->getID()] = $u->A("name");
     }
     $ac = Users::getUsers(1);
     while ($u = $ac->getNextEntry()) {
         if (!isset($allowed[$u->getID()]) and $u->getID() != Session::currentUser()->getID()) {
             continue;
         }
         if (isset($allowed[$u->getID()]) and strpos($allowed[$u->getID()], "create") === false) {
             continue;
         }
         $users[$u->getID()] = $u->A("name");
     }
     $users["-1"] = "Alle";
     if (Session::isPluginLoaded("mWAdresse") and ($this->A("TodoClass") == "WAdresse" or $this->A("TodoClass") == "Kalender")) {
         $gui->parser("TodoClassID", "TodoGUI::parserKunde");
     } else {
         $gui->type("TodoClassID", "hidden");
     }
     $gui->type("TodoUserID", "select", $users);
     $gui->type("TodoStatus", "select", $this->getStatus());
     $gui->activateFeature("CRMEditAbove", $this);
     if ($gui instanceof CRMHTMLGUI) {
         return $gui->getEditTableHTML(4);
     }
 }
Exemplo n.º 21
0
 public function setFlag($class, $flag, $value)
 {
     BPS::setProperty($class, $flag, $value);
 }
Exemplo n.º 22
0
 public function getHTML($id, $page)
 {
     $TID = BPS::getProperty("mphimGUI", "with", 0);
     if ($TID[0] != "g") {
         $this->addAssocV3("phimFromUserID", "=", Session::currentUser()->getID(), "AND", "1");
         $this->addAssocV3("phimToUserID", "=", $TID, "AND", "1");
         $this->addAssocV3("phimphimGruppeID", "=", "0", "AND", "1");
         $this->addAssocV3("phimFromUserID", "=", $TID, "OR", "2");
         $this->addAssocV3("phimToUserID", "=", Session::currentUser()->getID(), "AND", "2");
         $this->addAssocV3("phimphimGruppeID", "=", "0", "AND", "2");
     } else {
         $this->addAssocV3("phimphimGruppeID", "=", str_replace("g", "", $TID));
     }
     #$this->addJoinV3("User", $field1)
     #$this->addOrderV3("phimToUserID", "DESC");
     #$this->addOrderV3($order)
     $this->addOrderV3("phimTime", "DESC");
     $this->addOrderV3("phimID", "DESC");
     $this->setFieldsV3(array("phimRead", "phimFromUserID", "phimMessage", "DATE_FORMAT(FROM_UNIXTIME(phimTime), '%Y-%m-%d') AS grouper"));
     $this->loadMultiPageMode($id, $page, 0);
     $gui = new HTMLGUIX($this);
     $gui->version("mphim");
     $gui->colWidth("phimRead", 20);
     $gui->name("phim");
     $gui->displayGroup("grouper", "mphimGUI::parserDG");
     $gui->options(true, true, false);
     $gui->parser("phimRead", "parserRead");
     $gui->parser("phimFromUserID", "parserFrom");
     $gui->attributes(array("phimRead", "phimFromUserID", "phimMessage"));
     $B = $gui->addSideButton("Gruppen", "./ubiquitous/phim/group.png");
     $B->loadPlugin("contentRight", "mphimGruppe");
     $B = $gui->addSideButton("System-\nBenutzer", "./ubiquitous/phim/phimUser.png");
     $B->loadPlugin("contentRight", "mphimUser");
     $B = $gui->addSideButton("Benutzer\nausblenden", "./ubiquitous/phim/hidden.png");
     $B->loadPlugin("contentRight", "mphimUserHidden");
     $B = $gui->addSideButton("phim\nanzeigen", "new");
     $B->onclick("windowWithRme('mphim', -1, 'chatPopup', [], '', 'window', {height: 300, width:550, left: \$j.jStorage.get('phimX', 20), top: \$j.jStorage.get('phimY', 20), name: 'phim', scroll: false});");
     $B = $gui->addSideButton("Config-Datei", "new");
     $B->windowRme("mphim", "-1", "getConfigFile");
     $users = self::$users = Users::getUsersArray("Alle", true);
     $T = new HTMLTable(1, "Konversation mit");
     $T->setTableStyle("width:100%");
     $T->weight("light");
     $T->useForSelection(false);
     foreach ($users as $ID => $U) {
         $T->addRow(array($U));
         $T->addRowEvent("click", OnEvent::frame("contentRight", "mphim", "-1", 0, "", "mphimGUI;with:{$ID}"));
         if ($ID . "" === $TID . "") {
             $T->addRowClass("highlight");
         }
     }
     $AC = anyC::get("phimGruppe");
     $AC->addAssocV3("INSTR(phimGruppeMembers, ';" . Session::currentUser()->getID() . ";')", ">", "0");
     $TG = new HTMLTable(1, "Gruppen");
     $TG->setTableStyle("width:100%");
     $TG->weight("light");
     $TG->useForSelection(false);
     while ($G = $AC->n()) {
         $TG->addRow(array($G->A("phimGruppeName")));
         $TG->addRowEvent("click", OnEvent::frame("contentRight", "mphim", "-1", 0, "", "mphimGUI;with:g" . $G->getID()));
         if ("g" . $G->getID() === $TID . "") {
             $TG->addRowClass("highlight");
         }
     }
     $gui->addSideRow($T);
     $gui->addSideRow($TG);
     return $gui->getBrowserHTML($id);
 }
Exemplo n.º 23
0
 function getBrowserHTML($lineWithId = -1, $useBPS = true)
 {
     T::load(Util::getRootPath() . "libraries");
     $canDelete = mUserdata::isDisallowedTo("cantDelete" . $this->className);
     #$canEdit = mUserdata::isDisallowedTo("cantEdit".$this->className);
     if (!$canDelete) {
         $this->showTrash = false;
     }
     #if(!$canEdit) //KILLS SEARCH-FIELD!!
     #	$this->showEdit = false;
     $bps = BPS::getAllProperties("m" . $this->className . "GUI");
     if (!$useBPS) {
         $bps = false;
     }
     $GUIF = $this->GUIFactory;
     $GUIF->setMultiPageDetails($this->multiPageDetails);
     $GUIF->setTableMode($this->displayMode);
     $GUIF->options($this->showTrash, $this->showEdit, $this->showNew);
     if ($this->blacklists != null) {
         $GUIF->blacklists($this->blacklists);
     }
     if (isset($bps["selectionMode"])) {
         $GUIF->selection($bps["selectionMode"]);
     }
     #$GUIF->features($this->features);
     #$this->multiPageDetails["target"] = $this->frame;#"contentRight";
     #$GUIF->setMultiPageDetails($this->multiPageDetails);
     if ($this->targetFrame != null) {
         $GUIF->targetFrame($this->targetFrame);
     }
     $E = $this->object->getNextEntry();
     if ($this->attributes == null and $E != null) {
         $this->attributes = PMReflector::getAttributesArrayAnyObject($E->getA());
     }
     #if($E == null) //To fix display error when no entry
     #	$this->attributes = array("");
     if ($this->caption == null and $this->caption !== false) {
         $this->caption($this->displayMode == "BrowserLeft" ? $this->name == null ? $this->className : $this->name : "");
     }
     #"Bitte ".($this->name == null ? $this->className : $this->name)." auswählen:");
     $Tab = $GUIF->getTable($E == null ? array("") : $this->attributes, $this->colStyle, $this->caption);
     if ($this->tableWeight) {
         $Tab->weight($this->tableWeight);
     }
     $Tab->setTableID("Browserm{$this->className}");
     $Tab->addTableClass("contentBrowser");
     if ($this->useScreenHeight) {
         $Tab->useScreenHeight();
     }
     if ($this->header != null and $this->object->numLoaded() > 0) {
         $Tab->addHeaderRow($this->header);
     }
     if ($lineWithId == -1) {
         if ($this->showQuicksearch) {
             $GUIF->buildQuickSearchLine();
         }
         #if($this->multiPageDetails["total"] > $this->multiPageDetails["perPage"])
         if ($this->showPageFlip) {
             $GUIF->buildFlipPageLine("top");
         }
         if ($this->object->isFiltered()) {
             $GUIF->buildFilteredWarningLine($this->object->isFilteredLabel());
         }
         $GUIF->buildNewEntryLine(($this->name == null ? $this->className : $this->name) . " neu anlegen");
     }
     $this->object->resetPointer();
     $DisplayGroup = null;
     while ($E = $this->object->getNextEntry()) {
         /**
          * DisplayGroup
          */
         if ($lineWithId == -1 and $this->displayGroup != null and $DisplayGroup != $E->A($this->displayGroup[0])) {
             if ($this->displayGroup[1] != null) {
                 $DGP = explode("::", $this->displayGroup[1]);
                 $GUIF->buildGroupLine(Util::invokeStaticMethod($DGP[0], $DGP[1], array($E->A($this->displayGroup[0]), $E)));
             } else {
                 $GUIF->buildGroupLine($E->A($this->displayGroup[0]));
             }
         }
         $Line = array();
         foreach ($this->attributes as $attributeName) {
             $LineContent = $E->A($attributeName);
             if (isset($this->parsers[$attributeName])) {
                 $LineContent = $this->invokeParser($this->parsers[$attributeName], $LineContent, $E);
             } else {
                 $LineContent = htmlspecialchars($LineContent);
             }
             $Line[] = $LineContent;
         }
         $GUIF->buildLine($E->getID(), $Line);
         if ($this->displayGroup != null) {
             $DisplayGroup = $E->A($this->displayGroup[0]);
         }
     }
     if ($lineWithId == -1) {
         if ($this->object->isFiltered()) {
             $GUIF->buildFilteredWarningLine($this->object->isFilteredLabel());
         }
         if ($this->multiPageDetails["total"] > $this->multiPageDetails["perPage"] and $this->showPageFlip) {
             $GUIF->buildFlipPageLine("bottom");
         }
         if ($this->object->numLoaded() == 0) {
             $GUIF->buildNoEntriesLine();
         }
     } else {
         return $Tab->getHTMLForUpdate();
     }
     $prepend = "";
     foreach ($this->prepended as $PE) {
         $prepend .= $PE;
     }
     $appended = "";
     foreach ($this->appended as $PE) {
         $appended .= $PE;
     }
     return "<div class=\"browserContainer contentBrowser\">" . $prepend . $this->sideButtons($bps) . $GUIF->getContainer($Tab, $this->caption, $appended, $this->topButtons($bps)) . "</div>" . str_replace("%CLASSNAME", $this->className, $this->sortable) . $this->tip;
 }
Exemplo n.º 24
0
 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;
     }
 }
Exemplo n.º 25
0
 public function getEditHTML()
 {
     if (BPS::getProperty($this->className . "GUI", "edit") == "ok") {
         return $this->getEditTableHTML();
     }
     ################################################################################
     if ($this->name == null) {
         $this->name = $this->className;
     }
     if ($this->attributes == null) {
         $this->attributes = PMReflector::getAttributesArrayAnyObject($this->object->getA());
     }
     $widths = Aspect::joinPoint("changeWidths", $this, __METHOD__);
     if ($widths == null) {
         $widths = array(700, 132, 218);
     }
     $tab = new HTMLTable(2);
     $tab->setTableStyle("width:{$widths['0']}px;margin-left:10px;");
     $tab->setColWidth(1, "50%");
     $tab->setColWidth(2, "50%");
     $A = $this->object->getA();
     $TSub = new HTMLTable(2);
     $TSub->setColWidth(1, 120);
     $TSub->setColClass(1, "");
     $TSub->setColClass(2, "");
     $TC = clone $TSub;
     $row = array();
     foreach ($this->attributes as $k => $v) {
         if (isset($this->types[$v]) and $this->types[$v] == "hidden") {
             continue;
         }
         if (isset($this->parsers[$v])) {
             $A->{$v} = $this->invokeParser($this->parsers[$v], $A->{$v}, $this->object);
         }
         if (isset($this->types[$v]) and $this->types[$v] == "select") {
             if (isset($this->options[$v]) and isset($this->options[$v][$A->{$v}])) {
                 $A->{$v} = $this->options[$v][$A->{$v}];
             }
         }
         if (isset($this->spaces[$v]) and $this->spaces[$v] != "") {
             if ($k > 0) {
                 $row[] = $TC;
             }
             if ($this->forceNewRow[$v]) {
                 $row[] = "";
                 $tab->addRow($row);
                 $tab->addRowClass("backgroundColor0");
                 $tab->addRowStyle("vertical-align:top;");
                 $row = array();
             }
             if (count($row) == 2) {
                 $tab->addRow($row);
                 $tab->addRowClass("backgroundColor0");
                 $tab->addRowStyle("vertical-align:top;");
                 $row = array();
             }
             $TC = clone $TSub;
             if (trim($this->spaces[$v]) != "") {
                 $TC->addRow(array($this->spaces[$v]));
                 $TC->addRowClass("backgroundColor2");
                 $TC->addRowColspan(1, 2);
             }
         }
         if ($A->{$v} != "") {
             $B = "";
             if (isset($this->fieldButtons[$v])) {
                 $B = $this->fieldButtons[$v];
                 $B->style("float:right;");
             }
             $TC->addLV($this->labels($v) . ":", $B . nl2br($A->{$v}));
             $TC->addRowStyle("vertical-align:top;");
         }
         /*
         			$label = isset($this->labels[$v]) ? $this->labels[$v] : $v;
         
         			$row[] = "<label>".($label != "" ? ucfirst($label).":" : "")."</label>";
         
         
         
         			$row[] = nl2br($A->$v);*/
         /*if(count($row) == 4){
         			$tab->addRow($row);
         			$row = array();
         		}*/
     }
     $row[] = $TC;
     if (count($row) == 1) {
         $row[] = "";
     }
     if (count($row) == 2) {
         $tab->addRow($row);
         $tab->addRowClass("backgroundColor0");
         $tab->addRowStyle("vertical-align:top;");
     }
     $BE = new Button("Eintrag\nbearbeiten", "edit");
     $BE->onclick(str_replace(array("%CLASSNAME", "%CLASSID"), array($this->className, $this->object->getID()), $this->functionEdit));
     $BE->style("float:left;margin-left:10px;");
     $BD = new Button("Eintrag\nlöschen", "trash");
     $BD->onclick(str_replace(array("%CLASSNAME", "%CLASSID"), array($this->className, $this->object->getID()), $this->functionDelete));
     $BD->style("float:left;margin-left:10px;");
     $options = "<div style=\"width:{$widths['0']}px;\">" . $BE . $BD . implode("", $this->topButtons) . "</div><div style=\"clear:left;height:10px;width:{$widths['0']}px;\"></div>";
     $appended = "";
     if (count($this->appended) > 0) {
         foreach ($this->appended as $k => $v) {
             $appended .= $v->getHTML();
         }
     }
     $prepended = "";
     if (count($this->prepended) > 0) {
         foreach ($this->prepended as $k => $v) {
             $prepended .= $v->getHTML();
         }
     }
     /*
     		if(count($this->CRMGUIappendedElements) > 0)
     			foreach($this->CRMGUIappendedElements as $k => $v)
     				$appended .= $v->getHTML();*/
     return $options . $prepended . $tab . $appended;
 }
Exemplo n.º 26
0
 public function rightCol($return = false)
 {
     $useDir = realpath(FileStorage::getFilesDir());
     $path = BPS::getProperty("mFileGUI", "path", false);
     if ($path) {
         $path = preg_replace("/^([A-Z])%/", "\\1:", $path);
         if (strpos($path, realpath(FileStorage::getFilesDir())) === 0) {
             $useDir = $path;
         }
     }
     $writable = is_writable($useDir);
     $readable = is_readable($useDir);
     $this->setDir($useDir);
     $this->loadMultiPageMode(-1, 0, 10000);
     $showPath = str_replace(realpath(FileStorage::getFilesDir()), "", $useDir);
     $BH = new Button("Root", "home", "iconicL");
     $BH->onclick($this->pather(FileStorage::getFilesDir()));
     $BH->style("float:left;");
     $way = realpath(FileStorage::getFilesDir());
     $bread = "<div style=\"vertical-align:top;display:inline-block;border-right:1px solid #aaa;\" class=\"isFolder\" data-path=\"{$way}\">{$BH}&nbsp;</div>";
     foreach (explode(DIRECTORY_SEPARATOR, $showPath) as $k => $v) {
         if ($k == 0) {
             continue;
         }
         $way .= DIRECTORY_SEPARATOR . "{$v}";
         $bread .= "<div class=\"selectionRow isFolder\" data-path=\"{$way}\" onclick=\"" . $this->pather($way) . "\" style=\"padding:8px;cursor:pointer;border-right:1px solid #aaa;color:#555;vertical-align:top;display:inline-block;padding-left:20px;padding-right:20px;border-bottom:0px;\">{$v}</div>";
     }
     $I = new HTMLInput("upload", "file", null, array("path" => $way, "class" => "File"));
     $I->style("width:250px;");
     $I->onchange($this->pather($way));
     $IN = new HTMLInput("newDir", "text");
     $IN->placeholder("Neues Verzeichnis");
     $IN->style("width:250px;margin-right:20px;");
     $IN->onEnter(OnEvent::rme($this, "makeDir", array("'{$way}'", "\$j(this).val()"), "function(){ " . $this->pather($way) . " }"));
     $ISA = new HTMLInput("selectAll", "checkbox");
     $ISA->onchange("console.log(\$j(this).prop('checked')); \$j('.selectFile').prop('checked', \$j(this).prop('checked'));");
     if (!$writable or !$readable) {
         $I = "";
         $IN = "";
     }
     $html = "\n\t\t\t<div style=\"background-color:#F7F7F7;border-bottom:1px solid #ddd;\">\n\t\t\t\t{$bread}\n\t\t\t\t<div style=\"display:inline-block;margin-top:2px;float:right;\">{$IN}</div>\n\t\t\t\t<div style=\"display:inline-block;margin-top:1px;float:right;\">{$I}</div>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div id=\"filesFrame\" style=\"overflow:auto;\">\n\t\t\t<form id=\"dlFiles\">\n\t\t\t<div style=\"border-bottom:1px solid #ddd;color:#777;\">\n\t\t\t\t<div style=\"display:inline-block;float:right;padding:5px;\">\n\t\t\t\t\tGröße\n\t\t\t\t\t<div style=\"display:inline-block;width:64px;\">&nbsp;</div>\n\t\t\t\t</div>\n\t\t\t\t<!--<div style=\"display:inline-block;width:57px;float:left;padding-left:5px;\">{$ISA}</div>-->\n\t\t\t\t<div style=\"display:inline-block;width:26px;float:left;padding-left:5px;\">&nbsp;</div>\n\t\t\t\t<div style=\"padding:5px;\">Dateiname</div>\n\t\t\t</div>";
     if (!$readable) {
         $html .= "<div style=\"padding:5px;\" class=\"highlight\">Das Verzeichnis <code>{$useDir}</code> ist nicht lesbar.</div>";
         return $html;
     }
     if (!$writable) {
         $html .= "<div style=\"padding:5px;\" class=\"highlight\">Das Verzeichnis {$useDir} ist nicht beschreibbar.<br />\n\t\t\t\tEs können keine Unterverzeichnisse angelegt oder Dateien hochgeladen werden.<br />\n\t\t\t\tBitte machen Sie das Verzeichnis mit <code>chmod 777 " . basename($useDir) . "</code> durch den Webserver beschreibbar.</div>";
     }
     $i = 0;
     while ($F = $this->getNextEntry()) {
         if ($F->A("FileName") == "." or $F->A("FileName") == "..") {
             continue;
         }
         $ext = Util::ext($F->A("FileName"));
         $B = "";
         if ($F->A("FileIsDir")) {
             $B = new Button("Verzeichnis öffnen", "./plugins/Files/icons/folder.png", "icon");
             $B->style("margin-right:5px;margin-top:2px;");
         } elseif (!$F->A("FileIsDir") and file_exists(dirname(__FILE__) . "/icons/file_extension_{$ext}.png")) {
             $B = new Button("", "./plugins/Files/icons/file_extension_{$ext}.png", "icon");
             $B->style("margin-right:5px;margin-top:2px;");
         } elseif (!$F->A("FileIsDir") and !file_exists(dirname(__FILE__) . "/icons/file_extension_{$ext}.png")) {
             $B = new Button("", "./plugins/Files/icons/file_extension_unknown.png", "icon");
             $B->style("margin-right:5px;margin-top:2px;");
         }
         $BDL = new Button("Datei herunterladen", "download", "iconic");
         $BDL->style("margin-right:10px;");
         $BDL->windowRme("File", $F->getID(), "download");
         $size = "<div style=\"display:inline-block;margin-right:20px;color:grey;width:60px;text-align:right;\"></div>";
         if ($F->A("FileIsDir")) {
             $onclick = $this->pather($F->getID());
             $BDL = "";
         } else {
             $onclick = OnEvent::popup("Vorschau", "File", $F->getID(), "previewWindow", "", "", "{width:600, hPosition: 'center'}");
             $size = "<div style=\"display:inline-block;margin-right:20px;color:grey;width:60px;text-align:right;\">" . Util::formatByte($F->A("FileSize")) . "</div>";
         }
         $onRename = OnEvent::rme($F, "rename", array("\$j('input[name=renameFile{$i}]').val()"), "function(t){ \$j('.fileName{$i}').html(t.responseText); \$j('#default{$i}').show(); \$j('#rename{$i}').hide(); }");
         $BD = new Button("Element löschen", "trash_stroke", "iconic");
         #$BD->style("float:right;");
         $BD->onclick("deleteClass('File','" . $F->getID() . "', function() { " . $this->pather(realpath(dirname($F->getID()))) . " },'Element wirklich löschen?');");
         $BR = new Button("Element umbenennen", "pen_alt2", "iconic");
         $BR->style("margin-right:10px;");
         $BR->onclick("\$j('.fileDefault').show(); \$j('.fileRename, #default{$i}').hide(); \$j('#rename{$i}').show();");
         $IR = new HTMLInput("renameFile{$i}", "text", $F->A("FileName"));
         $IR->style("width:350px;");
         $IR->onEnter($onRename);
         $BC = new Button("Umbenennen abbrechen", "x", "iconic");
         $BC->onclick("\$j('#default{$i}').show(); \$j('#rename{$i}').hide();");
         $BC->style("margin-left:10px;");
         $BO = new Button("Umbenennen abschließen", "check", "iconic");
         $BO->onclick($onRename);
         $BO->style("margin-left:10px;");
         $IC = new HTMLInput("select{$i}", "checkbox");
         $IC->setClass("selectFile");
         $IC->style("margin-top:2px;margin-right:10px;display:none;");
         $html .= "\n\t\t\t<div data-path=\"" . $F->getID() . "\" class=\"selectionRow " . ($F->A("FileIsDir") ? "isFolder" : "") . "\" style=\"\">\n\t\t\t\t<div class=\"selectionRowHeightSetter\" style=\"display:inline-block;float:left;\">{$IC}{$B}</div>\n\t\t\t\t<div class=\"selectionRowHeightSetter\" style=\"display:inline-block;float:right;\">{$BDL}{$BR}{$size}{$BD}</div>\n\t\t\t\t\t\n\t\t\t\t<div id=\"rename{$i}\" class=\"fileRename selectionRowHeightSetter\" style=\"display:none;margin-bottom:-3px;\">{$IR}{$BC}{$BO}</div>\n\t\t\t\t<div id=\"default{$i}\" class=\"selectionRowHeightSetter fileDefault\" onclick=\"" . $onclick . "\" style=\"padding:5px;padding-top:9px;cursor:pointer;\">\n\t\t\t\t\t<span class=\"fileName{$i}\">" . str_replace(".{$ext}", "<span style=\"color:grey;\">.{$ext}</span>", $F->A("FileName")) . "</span>\n\t\t\t\t\t\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t</div>";
         $i++;
     }
     $html .= "</form></div>" . OnEvent::script("\n\$j('.selectionRow').draggable({\n\trevert: true,\n\thelper: function(v){\n\t\tvar newE = \$j(v.target).closest('.selectionRow').clone();\n\t\tnewE.css('width', '400px').css('opacity', '0.7').addClass('selectionRow');\n\t\tnewE.find('.iconic').remove();\n\t\treturn newE;\n\t}/*,\n\tstart: function (event, ui) {\n\t\t \$j(ui.helper).css('margin-left', event.clientX - \$j(event.target).offset().left + 10);\n\t\t \$j(ui.helper).css('margin-top', event.clientY - \$j(event.target).offset().top + 10);\n\t }*/\n});\n\n\$j('.isFolder').droppable({\n\thoverClass: 'highlight',\n\taccept: '.selectionRow',\n\ttolerance: 'pointer',\n\tdrop: function(event, ui) {\n\t\tvar newE = ui.helper.clone();\n\t\tui.helper.remove();\n\t\t" . OnEvent::rme($this, "moveFile", array("\$j(ui.draggable).data('path')", "\$j(this).data('path')"), "function(){ \n\t\t\t\$j(ui.draggable).fadeOut(400, function(){ \$j(this).remove(); }); \n\t\t\t\$j('body').append(newE);\n\t\t\t\$j(newE).fadeOut(400, function(){ \$j(this).remove(); }); \n\t\t}") . "\n\t}\n});\n");
     if (!$return) {
         echo $html;
     } else {
         return $html;
     }
 }
Exemplo n.º 27
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();
 }
Exemplo n.º 28
0
 public static function getCalendarCategories()
 {
     $tabs = array();
     $bps = BPS::getAllProperties("mKalenderGUI");
     $tabs[] = new stdClass();
     $tabs[0]->onclick = OnEvent::reload("Screen", "_mKalenderGUI;KID:" . Session::currentUser()->getID());
     $tabs[0]->elementID = "TodoCurrentUser";
     $tabs[0]->label = "Mein Kalender";
     $tabs[0]->isCurrent = (!isset($bps["KID"]) or $bps["KID"] == Session::currentUser()->getID());
     $ACS = anyC::get("Userdata", "name", "shareCalendarTo" . Session::currentUser()->getID());
     $ACS->addAssocV3("name", "=", "shareCalendarTo0", "OR");
     while ($Share = $ACS->getNextEntry()) {
         $U = new User($Share->A("UserID"));
         $C = new stdClass();
         $C->onclick = OnEvent::reload("Screen", "_mKalenderGUI;KID:" . $U->getID());
         $C->elementID = "TodoCurrentUser";
         $C->label = $U->A("name");
         $C->isCurrent = $bps["KID"] == $U->getID();
         $tabs[] = $C;
     }
     return $tabs;
 }