Skip to content
Snippets Groups Projects
Commit c56c9644 authored by Carsten  Rose's avatar Carsten Rose
Browse files

FormAction.php, Store.php: code cleanup

parent 1bb4cea6
No related branches found
No related tags found
No related merge requests found
......@@ -289,161 +289,3 @@ class FormAction {
return $slaveId;
}
}
//
///********************************************************
// * doAddNUpdate
// * RC: TRUE ok
// * FALSE,$err bei Fehler
// *********************************************************/
//function doAddNUpdate($formId, $masterId, $tableName, &$err) {
// global $FeId;
//
// if ($this->DebugLevel > 3) t3lib_div::debug("doAddNUpdate");
//
// // Selektiere alle 'addNupdate'-DS des aktuellen Formulars
// $sql = "SELECT * FROM form_element WHERE form_id=" . $formId . " AND typ='addNupdate' AND active='Yes' ORDER BY ord";
// if ($this->DebugLevel > 3) t3lib_div::debug($sql);
// if (!($formDs = mysql(MATH_DB_NAME, $sql))) return ($this->buildMySQLErrMsg($err, $sql, __FILE__, __LINE__));
//
// // Falls nix zu tun ist (kein DS vorhanden), gleich zurueck.
// if (mysql_num_rows($formDs) == 0) return (TRUE);
//
// // Durchlaufe alle 'addNupdate' DS
// while ($formularDs = mysql_fetch_array($formDs, MYSQL_ASSOC)) {
//
// $FeId = $formularDs['id']; // Just for logging
//
// if ($this->DebugLevel > 3) t3lib_div::debug($formularDs);
//
// // Lese den zuvor gespeicherten Master DS
// // Der Master DS sollte nach jedem AddNUpdate neu gelesen werden, evtl. wurde etwas eingetragen
//
// $masterDs = $this->doQuerySingle("SELECT * FROM " . $tableName . " WHERE id=" . $masterId, $err);
// if ($err) return (FALSE);
//
// // Check ob addNUpadte ueberhaupt ausgefuehrt werden soll: Ist 'param' gesetzt ?
// // JA: dann auswerten ob die in 'param' aufgefuehrten Formularfelder gefuellt sind
// // Wenn nein, naechsten addNUpdate DS bearbeiten
// // NEIN: normal weiter machen
// if ($formularDs["param"]) {
// $arr = explode(",", $formularDs["param"]);
// $t = TRUE;
// foreach ($arr as $elem) {
// if ($GLOBALS[HTTP_POST_VARS][FRM . $elem]) {
// $t = FALSE;
// break; //foreach
// }
// }
// if ($t) {
// if ($this->DebugLevel > 3) t3lib_div::debug("doAddNUpdate() nicht ausfuehren, da param gesetzt ist und angegebene Felder leer sind.");
// continue; //while
// }
// }
//
// # Falls in 'value' ein select Statement angegeben ist, dieses ausführen.
// # Es sollte 0 oder 1 DS gefunden werden.
// # Die Spalte 'id' muss vorhanden sein und diese die slaveID angeben.
// if ($formularDs["value"]) {
// $sql = $this->substituteAssoc($formularDs["value"], $masterDs);
// $slaveDs = $this->doQuerySingle($sql, $err, EMPTY_IS_OK);
// $slaveId = $slaveDs["id"];
// } else {
//
// // Name des aktuellen addNupdate Formularelementes, kann gleichzeitig eine ID im masterDs auf eine slaveDS sein
// // Ist so eine ID>0 muss ein Update durchgefuehrt werden, sonst ein insert.
// // Bsp: Formular 'publikation_mit_upload_new' - zur aktuellen Publikation wird ein Notiz DS mit dem Dateinamen der Publikation angelegt.
// if ($masterDs[$formularDs["name"]])
// $slaveId = $masterDs[$formularDs["name"]];
// else
// $slaveId = $GLOBALS[HTTP_POST_VARS][FRM . $formularDs["name"]]; // einige spezielle doAddNUpdate benutzen temporaere Variablen (z.B. Formular publikation_mit_upload: my_pid
// }
//
// if ($slaveId > 0) {
//
// // if($GLOBALS[HTTP_POST_VARS][FRM."id".$post]>0) { // Es existiert ein zugehoeriger DS (=Slave)
//
// // Check ob ein Update Statement existiert
// if (!$formularDs["sql_update"])
// continue;
//
// // Ersetze Variablen in dem SQL update Statement.
// $sql = $this->substituteAssoc($formularDs["sql_update"], $masterDs);
//
// if ($this->DebugLevel > 0) echo("doAddNUpdate(update):" . $sql . "<BR>");
//
// // Fuehre das Update auf den Slave DS aus.
// if ($this->DebugLevel > 3) t3lib_div::debug($sql);
// if (!($res = $this->doSQL(MATH_DB_NAME, $sql . " "))) return ($this->buildMySQLErrMsg($err, $sql . " ", __FILE__, __LINE__, $formularDs));
//
// } else { // Es existiert noch kein zugehoeriger DS (=Slave)
//
// // Check ob ein Insert Statement existiert
// if (!$formularDs["sqlq"])
// continue;
//
// // Ersetze Variablen in dem SQL insert Statement.
// $sql = $this->substituteAssoc($formularDs["sqlq"], $masterDs);
//
// // Fuehre das Update auf den Slave DS aus.
// if ($this->DebugLevel > 1) t3lib_div::debug($sql);
// if (!($res = $this->doSQL(MATH_DB_NAME, $sql))) {
// $this->buildMySQLErrMsg($err, $sql, __FILE__, __LINE__);
// return (FALSE);
// }
//
// // Bestimme den Tabellennamen der im Slave SQL Statement benutzt wird
// $arr = explode(" ", $sql); //
// if ("insert" == mb_strtolower(mb_substr(ltrim($sql), 0, 6))) {
//
// if (mysql_affected_rows() > 0) {
// // Lade gerade geschriebenen Record
// $slaveTableName = mb_strtolower($arr[1]) == "into" ? $arr[2] : $arr[1]; // sql: "insert into <table> ..... der dritte Parameter ist der Tabellenname
//
// // Lese die Id des neu angelegten DS
// $slaveId = mysql_insert_id();
//
// // Bei einigen Tabellen gibt es keine Spalte 'id' - darum die gesuchte Spalte ueber die Definition von auto_increment bestimmen. I.d.R. 'id'
// // Bsp: einfuegen von fe_usern in die T3 Tabelle 'fe_users'
// $sql = "show fields from $slaveTableName where Extra like 'auto_increment'";
// if (!($tmp = $this->doQuerySingle($sql, $err))) {
// $this->buildMySQLErrMsg($err, $sql, __FILE__, __LINE__);
// return (FALSE);
// }
// $colNameId = $tmp["Field"];
//
// // Lade den durch addNupdate erzeugten record
// $sql = "select *, $colNameId as id from $slaveTableName where $colNameId = $slaveId ";
// if (!($slaveDs = $this->doQuerySingle($sql, $err))) {
// $this->buildMySQLErrMsg($err, $sql, __FILE__, __LINE__);
// return (FALSE);
// }
// }
//
//
// // Ersetze Variablen in dem SQL do after Statement
// $sql = $this->substituteAssoc($formularDs["sql_do_after"], $masterDs); // masterDs
// if ($sql) {
//
// if ($this->DebugLevel > 0)
// echo("doAddNUpdate/sql_do_after(new):" . $sql . "<BR>");
//
// $sql = str_replace("~_", "~", $sql);
// $sql = $this->substituteAssoc($sql, $slaveDs); // slaveDs
//
// if ($this->DebugLevel > 0) t3lib_div::debug("doAddNUpdate/sql_do_after(insert):" . $sql);
//
// // Führe das Update auf den Slave DS aus.
// if ($this->DebugLevel > 1) t3lib_div::debug($sql);
// if (!($res = $this->doSQL(MATH_DB_NAME, $sql))) {
// $this->buildMySQLErrMsg($err, $sql, __FILE__, __LINE__);
// return (FALSE);
// }
// }
// } else {
// if ($this->DebugLevel > 0) echo("doAddNUpdate/sql_do_after - in sql kein select gefunden:" . $sql . "<BR>");
// }
// }
// } // while()
//
// return (TRUE);
//} // doAddNUpdate
......@@ -118,7 +118,6 @@ class Store {
CLIENT_REQUEST_URI => SANITIZE_ALLOW_ALL,
CLIENT_SCRIPT_NAME => SANITIZE_ALLOW_ALNUMX,
CLIENT_PHP_SELF => SANITIZE_ALLOW_ALNUMX,
CLIENT_UPLOAD_FILENAME => SANITIZE_ALLOW_ALLBUT,
// SYSTEM_DBUSER => SANITIZE_ALLOW_ALNUMX,
// SYSTEM_DBSERVER => SANITIZE_ALLOW_ALNUMX,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment