mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Merge remote-tracking branch 'origin/master' into feature-61164/AbgabetoolQualityGates
# Conflicts: # system/phrasesupdate.php
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
// public.tbl_kontakttyp: add type email unverified
|
||||
if($result = $db->db_query("SELECT 1 FROM public.tbl_kontakttyp WHERE kontakttyp='email_unverifiziert'"))
|
||||
{
|
||||
if($db->db_num_rows($result)==0)
|
||||
{
|
||||
$qry = "INSERT INTO public.tbl_kontakttyp(kontakttyp, beschreibung, bezeichnung_mehrsprachig) VALUES('email_unverifiziert', 'Unverifizierte E-Mail', '{\"Unverifizierte E-Mail\", \"Unverified email\"}');";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>Kontakttyp: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Neuen Kontakttyp E-Mail unverifiziert in public.tbl_kontakttyp hinzugefügt';
|
||||
}
|
||||
}
|
||||
|
||||
// public.tbl_adressentyp: add type Meldeadresse
|
||||
if($result = $db->db_query("SELECT 1 FROM public.tbl_adressentyp WHERE adressentyp_kurzbz='m'"))
|
||||
{
|
||||
if($db->db_num_rows($result)==0)
|
||||
{
|
||||
$qry = "INSERT INTO public.tbl_adressentyp(adressentyp_kurzbz, bezeichnung, bezeichnung_mehrsprachig, sort) VALUES('m', 'Meldeadresse', '{\"Meldeadresse\", \"Registered adress\"}', 6);";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>Adressentyp: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Neue Adressentyp Meldeadresse in public.tbl_adressentyp hinzugefügt';
|
||||
}
|
||||
}
|
||||
|
||||
if (!$result = @$db->db_query('SELECT 1 FROM public.tbl_kontakt_verifikation LIMIT 1'))
|
||||
{
|
||||
$qry = "CREATE SEQUENCE public.tbl_kontakt_verifikation_kontakt_verifikation_id_seq
|
||||
INCREMENT BY 1
|
||||
NO MAXVALUE
|
||||
NO MINVALUE
|
||||
START WITH 1
|
||||
CACHE 1
|
||||
NO CYCLE;
|
||||
|
||||
CREATE TABLE public.tbl_kontakt_verifikation
|
||||
(
|
||||
kontakt_verifikation_id integer DEFAULT nextval('public.tbl_kontakt_verifikation_kontakt_verifikation_id_seq'::regclass),
|
||||
kontakt_id integer UNIQUE NOT NULL,
|
||||
verifikation_code varchar(32) UNIQUE NOT NULL,
|
||||
erstelldatum timestamp without time zone,
|
||||
verifikation_datum timestamp without time zone,
|
||||
app varchar(32),
|
||||
CONSTRAINT pk_tbl_kontakt_verifikation_id PRIMARY KEY (kontakt_verifikation_id)
|
||||
);
|
||||
|
||||
ALTER TABLE public.tbl_kontakt_verifikation ADD CONSTRAINT fk_tbl_kontakt_verifikation_kontakt_id FOREIGN KEY (kontakt_id)
|
||||
REFERENCES public.tbl_kontakt (kontakt_id)
|
||||
ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE public.tbl_kontakt_verifikation ADD CONSTRAINT fk_tbl_kontakt_verifikation_app FOREIGN KEY (app)
|
||||
REFERENCES system.tbl_app (app)
|
||||
ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
COMMENT ON TABLE public.tbl_kontakt_verifikation IS 'Contact verification';
|
||||
COMMENT ON COLUMN public.tbl_kontakt_verifikation.kontakt_id IS 'Contact to verify';
|
||||
COMMENT ON COLUMN public.tbl_kontakt_verifikation.verifikation_code IS 'Code generated for verification';
|
||||
COMMENT ON COLUMN public.tbl_kontakt_verifikation.erstelldatum IS 'Time when verification code was generated';
|
||||
COMMENT ON COLUMN public.tbl_kontakt_verifikation.verifikation_datum IS 'Time when contact was verified';
|
||||
COMMENT ON COLUMN public.tbl_kontakt_verifikation.app IS 'App where contact was verified';
|
||||
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON public.tbl_kontakt_verifikation TO web;
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON public.tbl_kontakt_verifikation TO vilesci;
|
||||
GRANT SELECT, UPDATE ON public.tbl_kontakt_verifikation_kontakt_verifikation_id_seq TO vilesci;
|
||||
GRANT SELECT, UPDATE ON public.tbl_kontakt_verifikation_kontakt_verifikation_id_seq TO web;
|
||||
";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_kontakt_verifikation: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo ' public.tbl_kontakt_verifikation: Tabelle hinzugefuegt<br>';
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
if(!@$db->db_query("SELECT ects FROM campus.tbl_pruefungsanmeldung LIMIT 1"))
|
||||
{
|
||||
$qry = 'ALTER TABLE campus.tbl_pruefungsanmeldung ADD COLUMN ects numeric(5,2);';
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong> campus.tbl_pruefungsanmeldung '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>campus.tbl_pruefungsanmeldung: Neue Spalte ects hinzugefügt';
|
||||
}
|
||||
|
||||
if(!@$db->db_query("SELECT anderer_raum FROM campus.tbl_pruefungstermin LIMIT 1"))
|
||||
{
|
||||
$qry = 'ALTER TABLE campus.tbl_pruefungstermin ADD COLUMN anderer_raum text NULL;';
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong> campus.tbl_pruefungstermin '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>campus.tbl_pruefungstermin: Neue Spalte anderer_raum hinzugefügt';
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
if (!defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
// Add new name type in public.tbl_variablenname
|
||||
if ($result = @$db->db_query("SELECT 1 FROM public.tbl_variablenname WHERE name = 'lv_favorites';"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "INSERT INTO public.tbl_variablenname(name, defaultwert) VALUES('lv_favorites', null);";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_variablenname '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo 'public.tbl_variablenname: Added name "lv_favorites"<br>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
if (!defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
// Change type of wert in public.tbl_variable
|
||||
if ($result = @$db->db_query("
|
||||
SELECT data_type
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'public'
|
||||
AND table_name = 'tbl_variable'
|
||||
AND column_name = 'wert';
|
||||
")) {
|
||||
if ($db->db_num_rows($result) == 1)
|
||||
{
|
||||
$data_type = $db->db_fetch_row($result)[0];
|
||||
|
||||
if (strtolower($data_type) != 'text')
|
||||
{
|
||||
$qry = "ALTER TABLE public.tbl_variable
|
||||
ALTER COLUMN wert
|
||||
TYPE TEXT;";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_variable '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo 'public.tbl_variable: Change type of "wert" to TEXT<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
$xsd= <<<EOD
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
|
||||
<xs:element name="content">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="url" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
EOD;
|
||||
|
||||
$xslt_xhtml= <<<EOD
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="html" encoding="UTF-8"/>
|
||||
<xsl:template match="content">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string(url)">
|
||||
<iframe
|
||||
src="{url}"
|
||||
frameborder="0"
|
||||
style="width:100%; height:90vh; border:0; display:block;"
|
||||
>
|
||||
</iframe>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<div class="alert alert-warning">Keine URL im Inhalt gefunden.</div>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
EOD;
|
||||
|
||||
$xslt_xhtml_c4= <<<EOD
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="html" encoding="UTF-8"/>
|
||||
<xsl:template match="content">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string(url)">
|
||||
<iframe
|
||||
src="{url}"
|
||||
frameborder="0"
|
||||
style="width:100%; height:90vh; border:0; display:block;"
|
||||
>
|
||||
</iframe>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<div class="alert alert-warning">Keine URL im Inhalt gefunden.</div>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
EOD;
|
||||
|
||||
|
||||
if ($result = @$db->db_query("SELECT * FROM campus.tbl_template WHERE template_kurzbz='iframe'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$sql= <<<EOD
|
||||
INSERT INTO campus.tbl_template
|
||||
(template_kurzbz, bezeichnung, xsd, xslt_xhtml, xslfo_pdf, xslt_xhtml_c4)
|
||||
VALUES
|
||||
('iframe','iFrame Content ', '{$xsd}', '{$xslt_xhtml}' , NULL, '{$xslt_xhtml_c4}');
|
||||
EOD;
|
||||
|
||||
if (!$db->db_query($sql))
|
||||
{
|
||||
echo '<strong>campus.tbl_template: ' . $db->db_last_error() . '</strong><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo ' campus.tbl_template: Template "iframe" hinzugefügt.<br>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user