From 51a65495aac8cfdd9828d132b1b83b4982faba4e Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Tue, 2 Apr 2024 15:31:56 +0200 Subject: [PATCH] corrects the insertion of the dms_kategorie profil_aenderung in the checksystem --- .../Cis/Profil/ProfilModal/EditProfil.js | 1 - system/dbupdate_3.4/25999_C4_ma0594.php | 31 +++++++++---------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/public/js/components/Cis/Profil/ProfilModal/EditProfil.js b/public/js/components/Cis/Profil/ProfilModal/EditProfil.js index db94c7cf1..6ef7ccef8 100755 --- a/public/js/components/Cis/Profil/ProfilModal/EditProfil.js +++ b/public/js/components/Cis/Profil/ProfilModal/EditProfil.js @@ -128,7 +128,6 @@ export default { : //? fresh insert of new attachment await Vue.$fhcapi.ProfilUpdate.insertFile(formData).then(res => { - console.log(res.data); return res.data?.map((file) => file.dms_id); }) return result; diff --git a/system/dbupdate_3.4/25999_C4_ma0594.php b/system/dbupdate_3.4/25999_C4_ma0594.php index 2000669ac..071d33bf7 100755 --- a/system/dbupdate_3.4/25999_C4_ma0594.php +++ b/system/dbupdate_3.4/25999_C4_ma0594.php @@ -89,23 +89,20 @@ echo '
public.tbl_profil_update: table created'; } - if(!$result = @$db->db_query("SELECT 1 FROM campus.tbl_dms_kategorie WHERE kategorie_kurzbz = 'profil_aenderung' LIMIT 1")) + // adds the dms_kategorie profil_aenderung to the database + if($result = @$db->db_query("SELECT * FROM campus.tbl_dms_kategorie WHERE kategorie_kurzbz='profil_aenderung'")) { - echo "HELLLOUUU"; - $qry = "INSERT INTO campus.tbl_dms_kategorie VALUES ('profil_aenderung','Dokumente für Profil Änderungen','Dokumente die Belegen ob man eine neue Adresse angemeldet hat oder seinen Namen geändert hat','dokumente',NULL,NULL);"; - if(!$db->db_query($qry)) - echo 'INSERT OF DMS_KATEGORIE profil_aenderung ERROR : '.$db->db_last_error().'
'; - else - echo '
INSERT OF DMS_KATEGORIE profil_aenderung was successful'; + if($db->db_num_rows($result) == 0){ + + $qry = "INSERT INTO campus.tbl_dms_kategorie VALUES ('profil_aenderung','Dokumente fuer Profil Aenderungen','Dokumente die Belegen ob man eine neue Adresse angemeldet hat oder seinen Namen geaendert hat','dokumente',NULL,NULL);"; + + if(!$db->db_query($qry)) + echo 'INSERT OF DMS_KATEGORIE profil_aenderung ERROR : '.$db->db_last_error().'
'; + else + echo '
INSERT OF DMS_KATEGORIE profil_aenderung was successful'; + } + } - //? would add a column if the column is missing in the table - /* if(!$result = @$db->db_query("SELECT topic FROM public.tbl_profil_update LIMIT 1")) - { - $qry = "ALTER TABLE public.tbl_profil_update ADD COLUMN topic varchar(32) NOT NULL;"; - - if(!$db->db_query($qry)) - echo 'public.tbl_profil_update: '.$db->db_last_error().'
'; - else - echo '
public.tbl_profil_update: Spalte topic hinzugefuegt'; - } */ \ No newline at end of file + + \ No newline at end of file