Remove obsolete files from commonservices subdirectory
This commit is contained in:
parent
e0d3cd7f45
commit
abad767ea0
|
@ -1,150 +0,0 @@
|
|||
<?PHP
|
||||
declare(strict_types = 1);
|
||||
|
||||
/**
|
||||
* Gets auswahl array
|
||||
*
|
||||
* @param MDTlLoader $tlLoader Translation loader.
|
||||
*
|
||||
* @return array{0: array<string>, 1: array<string>}
|
||||
*/
|
||||
function proveAuswahlArray(MDTlLoader $tlLoader) :array {
|
||||
|
||||
include __DIR__ . "/" . $tlLoader->getLang() . "/search_all_fields.php";
|
||||
|
||||
$auswahl = []; $auswahl_feld = [];
|
||||
|
||||
$auswahl[] = '[' . $tlLoader->tl("object_addendum", "object_add", "ignore") . ']';
|
||||
$auswahl_feld[] = 'ignore';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("basis", "basis", "image");
|
||||
$auswahl_feld[] = 'image';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("object_basis", "object_basis", "inventory_number");
|
||||
$auswahl_feld[] = 'objekt_inventarnr';
|
||||
|
||||
$auswahl[] = 'md:number';
|
||||
$auswahl_feld[] = 'objekt_id';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("object_basis", "object_basis", "object_type");
|
||||
$auswahl_feld[] = 'objektart';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("object_basis", "object_basis", "object_name");
|
||||
$auswahl_feld[] = 'objekt_name';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("object_basis", "object_basis", "description");
|
||||
$auswahl_feld[] = 'objekt_beschreibung';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("object_basis", "object_basis", "mattech");
|
||||
$auswahl_feld[] = 'objekt_material_technik';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("object_basis", "object_basis", "measurements");
|
||||
$auswahl_feld[] = 'objekt_masse';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("object", "object", "updated") . " / " . $tlLoader->tl("object_addendum", "object_add", "by");
|
||||
$auswahl_feld[] = 'objekt_erfasst_von';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("object", "object", "updated") . " / " . $tlLoader->tl("basis", "basis", "time");
|
||||
$auswahl_feld[] = 'objekt_erfasst_am';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("object", "object", "added") . " / " . $tlLoader->tl("object_addendum", "object_add", "by");
|
||||
$auswahl_feld[] = 'objekt_ersterfasst_von';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("object", "object", "added") . " / " . $tlLoader->tl("basis", "basis", "time");
|
||||
$auswahl_feld[] = 'objekt_ersterfasst_am';
|
||||
|
||||
$auswahl[] = $searchvar[0][0];
|
||||
$auswahl_feld[] = 'titel2_name';
|
||||
|
||||
$auswahl[] = $searchvar[46][0];
|
||||
$auswahl_feld[] = 'detaileddescription2';
|
||||
|
||||
$auswahl[] = $searchvar[2][0];
|
||||
$auswahl_feld[] = 'beschriftung2';
|
||||
|
||||
$auswahl[] = $searchvar[1][0];
|
||||
$auswahl_feld[] = 'ort2_name';
|
||||
|
||||
$auswahl[] = $searchvar[3][0];
|
||||
$auswahl_feld[] = 'mass2_laenge_wert';
|
||||
|
||||
$auswahl[] = $searchvar[4][0];
|
||||
$auswahl_feld[] = 'mass2_hoehe_wert';
|
||||
|
||||
$auswahl[] = $searchvar[5][0];
|
||||
$auswahl_feld[] = 'mass2_breite_wert';
|
||||
|
||||
$auswahl[] = $searchvar[6][0];
|
||||
$auswahl_feld[] = 'mass2_gewicht_wert';
|
||||
|
||||
$auswahl[] = $searchvar[7][0];
|
||||
$auswahl_feld[] = 'mass2_durchmesser_wert';
|
||||
|
||||
$auswahl[] = $searchvar[8][0];
|
||||
$auswahl_feld[] = 'wandungsstaerke_wert';
|
||||
|
||||
$auswahl[] = $searchvar[9][0];
|
||||
$auswahl_feld[] = 'mass2_seitenzahl';
|
||||
|
||||
$auswahl[] = $searchvar[10][0];
|
||||
$auswahl_feld[] = 'stueckzahl';
|
||||
|
||||
$auswahl[] = $searchvar[11][0];
|
||||
$auswahl_feld[] = 'vergleichsobjekte2';
|
||||
|
||||
$auswahl[] = $searchvar[31][0];
|
||||
$auswahl_feld[] = 'standort_aktuell';
|
||||
|
||||
$auswahl[] = $searchvar[32][0];
|
||||
$auswahl_feld[] = 'standort_eigentlich';
|
||||
|
||||
$auswahl[] = $searchvar[33][0];
|
||||
$auswahl_feld[] = 'ausstellung';
|
||||
|
||||
$auswahl[] = $searchvar[34][0];$auswahl_feld[] = 'verliehen_an';
|
||||
|
||||
$auswahl[] = $searchvar[12][0];$auswahl_feld[] = 'eingangsnummer';
|
||||
|
||||
$auswahl[] = $searchvar[13][0];$auswahl_feld[] = 'invnr2';
|
||||
|
||||
$auswahl[] = $searchvar[14][0];$auswahl_feld[] = 'konvolut';
|
||||
|
||||
$auswahl[] = $searchvar[15][0];$auswahl_feld[] = 'teilvon';
|
||||
|
||||
$auswahl[] = $searchvar[16][0];$auswahl_feld[] = 'sachgruppe';
|
||||
|
||||
$auswahl[] = $searchvar[17][0];$auswahl_feld[] = 'systematik';
|
||||
|
||||
$auswahl[] = $searchvar[18][0];$auswahl_feld[] = 'vorbesitzer';
|
||||
|
||||
$auswahl[] = $searchvar[19][0];$auswahl_feld[] = 'zeitpunkt_zugang';
|
||||
$auswahl[] = $searchvar[20][0];$auswahl_feld[] = 'zugang_art';
|
||||
$auswahl[] = $searchvar[22][0];$auswahl_feld[] = 'objektgeschichte';
|
||||
$auswahl[] = $searchvar[25][0];$auswahl_feld[] = 'wert_zahl';
|
||||
$auswahl[] = $searchvar[28][0];$auswahl_feld[] = 'wert2_zahl';
|
||||
$auswahl[] = $searchvar[29][0];$auswahl_feld[] = 'zustand';
|
||||
$auswahl[] = $searchvar[30][0];$auswahl_feld[] = 'restaurierung';
|
||||
$auswahl[] = $searchvar[39][0];$auswahl_feld[] = 'urheberrechte';
|
||||
$auswahl[] = $searchvar[40][0];$auswahl_feld[] = 'nutzungsrechte';
|
||||
$auswahl[] = $searchvar[41][0];$auswahl_feld[] = 'rechte_anmerkungen';
|
||||
$auswahl[] = $searchvar[42][0];$auswahl_feld[] = 'notizen_text2';
|
||||
$auswahl[] = $searchvar[43][0];$auswahl_feld[] = 'notizen_text1';
|
||||
$auswahl[] = $searchvar[44][0];$auswahl_feld[] = 'bilder_lokal';
|
||||
$auswahl[] = $searchvar[45][0];$auswahl_feld[] = 'dokumente_lokal';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("basis", "basis", "actor");$auswahl_feld[] = 'actor';
|
||||
$auswahl[] = $tlLoader->tl("basis", "basis", "place");$auswahl_feld[] = 'place';
|
||||
$auswahl[] = $tlLoader->tl("basis", "basis", "time");$auswahl_feld[] = 'time';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("basis", "basis", "collection");
|
||||
$auswahl_feld[] = 'collection';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("basis", "basis", "literature");
|
||||
$auswahl_feld[] = 'literature';
|
||||
|
||||
$auswahl[] = $tlLoader->tl("basis", "basis", "tag");
|
||||
$auswahl_feld[] = 'tag';
|
||||
|
||||
return [$auswahl, $auswahl_feld];
|
||||
|
||||
}
|
|
@ -1,145 +0,0 @@
|
|||
<?PHP
|
||||
/**
|
||||
* Functions for connecting to and checking other DBs.
|
||||
*
|
||||
* @file
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
*/
|
||||
|
||||
if (!file_exists(__DIR__ . '/../conf/dbsToCompare.php')) return;
|
||||
|
||||
/**
|
||||
* Function to connect to all versions to compare the current one with.
|
||||
* Returns an array of database connections.
|
||||
*
|
||||
* @return array<MDMysqli>
|
||||
*/
|
||||
function connectToCompareDBs():array {
|
||||
|
||||
include __DIR__ . '/../conf/dbsToCompare.php';
|
||||
if (empty($dbsToCompare)) return [];
|
||||
|
||||
$connections = [];
|
||||
foreach ($dbsToCompare as $key => $db) {
|
||||
$connections[$key] = md_mysqli_connect($db['hostname'], $db['username'], $db['password'], $db['databasename']);
|
||||
if (mysqli_connect_error()) {
|
||||
throw new Exception("Error connecting to database " . $db['hostname']);
|
||||
}
|
||||
}
|
||||
return $connections;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the number a given set of times appeared in eveents in a given version.
|
||||
*
|
||||
* @param array<MDMysqli> $connections Array of DB connections from which to query.
|
||||
* @param integer $timeID ID of the time entry to check.
|
||||
* @param string $currentSubset Name of the current version.
|
||||
*
|
||||
* @return array{0: integer, 1: integer}
|
||||
*/
|
||||
function checkTimes(array $connections, int $timeID, string $currentSubset):array {
|
||||
|
||||
list($numberofusage, $currentAmount) = [[], 0]; // Set defaults
|
||||
foreach ($connections as $dbName => $connection) {
|
||||
|
||||
$eergebnis = $connection->do_read_query("SELECT 1
|
||||
FROM `ereignis`
|
||||
WHERE `zeiten_id` = " . $connection->escape_string((string)$timeID) . "
|
||||
LIMIT 2");
|
||||
|
||||
$numberofusage[$dbName] = $anzahl_ergebnis = $eergebnis->num_rows;
|
||||
if (strtolower($dbName) == strtolower($currentSubset)) $currentAmount = $anzahl_ergebnis;
|
||||
|
||||
$eergebnis->close(); unset($eergebnis);
|
||||
}
|
||||
return [(int)array_sum($numberofusage), $currentAmount];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the number a given person / institution appeared in events across versions.
|
||||
*
|
||||
* @param array<MDMysqli> $connections Array of DB connections from which to query.
|
||||
* @param integer $timeID ID of the time entry to check.
|
||||
* @param string $currentSubset Name of the current version.
|
||||
*
|
||||
* @return array{0: integer, 1: integer}
|
||||
*/
|
||||
function checkPersinst(array $connections, int $timeID, string $currentSubset):array {
|
||||
|
||||
list($numberofusage, $currentAmount) = [[], 0]; // Set defaults
|
||||
foreach ($connections as $dbName => $connection) {
|
||||
|
||||
$eergebnis = $connection->do_read_query("SELECT 1
|
||||
FROM `ereignis`
|
||||
WHERE `persinst_id` = " . $connection->escape_string((string)$timeID) . "
|
||||
LIMIT 2");
|
||||
|
||||
$numberofusage[$dbName] = $anzahl_ergebnis = $eergebnis->num_rows;
|
||||
if (strtolower($dbName) == strtolower($currentSubset)) $currentAmount = $anzahl_ergebnis;
|
||||
|
||||
$eergebnis->close(); unset($eergebnis);
|
||||
}
|
||||
return [(int)array_sum($numberofusage), $currentAmount];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the number a given place appeared in events across versions.
|
||||
*
|
||||
* @param array<MDMysqli> $connections Array of DB connections from which to query.
|
||||
* @param integer $timeID ID of the time entry to check.
|
||||
* @param string $currentSubset Name of the current version.
|
||||
*
|
||||
* @return array{0: integer, 1: integer}
|
||||
*/
|
||||
function checkPlace(array $connections, int $timeID, string $currentSubset):array {
|
||||
|
||||
list($numberofusage, $currentAmount) = [[], 0]; // Set defaults
|
||||
foreach ($connections as $dbName => $connection) {
|
||||
|
||||
$eergebnis = $connection->do_read_query("SELECT 1
|
||||
FROM `ereignis`
|
||||
WHERE `orte_id` = " . $connection->escape_string((string)$timeID) . "
|
||||
LIMIT 2");
|
||||
|
||||
$numberofusage[$dbName] = $anzahl_ergebnis = $eergebnis->num_rows;
|
||||
if (strtolower($dbName) == strtolower($currentSubset)) $currentAmount = $anzahl_ergebnis;
|
||||
|
||||
$eergebnis->close(); unset($eergebnis);
|
||||
}
|
||||
return [(int)array_sum($numberofusage), $currentAmount];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the number a given tag appeared in events across versions.
|
||||
*
|
||||
* @param array<MDMysqli> $connections Array of DB connections from which to query.
|
||||
* @param integer $tagID ID of the tag entry to check.
|
||||
* @param string $currentSubset Name of the current version.
|
||||
*
|
||||
* @return array{0: integer, 1: integer}
|
||||
*/
|
||||
function checkTag(array $connections, int $tagID, string $currentSubset):array {
|
||||
|
||||
list($numberofusage, $currentAmount) = [[], 0]; // Set defaults
|
||||
foreach ($connections as $dbName => $connection) {
|
||||
|
||||
$eergebnis = $connection->do_read_query("SELECT 1
|
||||
FROM `v_objekt_tag2`
|
||||
WHERE `tag_id` = " . $connection->escape_string((string)$tagID) . "
|
||||
LIMIT 2");
|
||||
|
||||
$numberofusage[$dbName] = $anzahl_ergebnis = $eergebnis->num_rows;
|
||||
if (strtolower($dbName) == strtolower($currentSubset)) $currentAmount = $anzahl_ergebnis;
|
||||
|
||||
$eergebnis->close(); unset($eergebnis);
|
||||
}
|
||||
return [(int)array_sum($numberofusage), $currentAmount];
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user