From 23badc340482a40f5414aca35fa3109b6e2abc65 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Fri, 27 Sep 2024 12:20:37 +0200 Subject: [PATCH] CIS4 MENU sql update WIP --- public/js/components/Cis/Menu/Entry.js | 19 +++--- system/dbupdate_3.4.php | 1 + system/dbupdate_3.4/25999_C4_Menu.php | 81 ++++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 10 deletions(-) create mode 100755 system/dbupdate_3.4/25999_C4_Menu.php diff --git a/public/js/components/Cis/Menu/Entry.js b/public/js/components/Cis/Menu/Entry.js index 86a0311be..3d01a7cfc 100755 --- a/public/js/components/Cis/Menu/Entry.js +++ b/public/js/components/Cis/Menu/Entry.js @@ -28,25 +28,24 @@ export default { this.entry.menu_open = true; } else { this.entry.menu_open = false; - /* if (this.entry.childs instanceof Array) { - for (let child of this.entry.childs) { - child.menu_open = false; - - } - } */ } } }, 'entry.menu_open': function (newValue,oldValue) { - if (this.entry.titel == "Mein Studium") { + if (this.entry.titel == "Mein Studium") + { console.log("here",this.entry.titel,newValue,"newValue"); } - if (newValue) { - + if (newValue) + { console.log(this.entry.titel,"open") + // only invokes .show if this.collapse is not null this.collapse && this.collapse.show(); - } else { + } + else + { console.log(this.entry.titel,"close") + // only invokes .hide if this.collapse is not null this.collapse && this.collapse.hide(); } }, diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index 621463672..e49fde88a 100755 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -64,6 +64,7 @@ require_once('dbupdate_3.4/28575_softwarebereitstellung.php'); require_once('dbupdate_3.4/41150_oe-pfad_db_view.php'); require_once('dbupdate_3.4/44031_stv_favorites.php'); require_once('dbupdate_3.4/39911_tabulator_in_contentmittitel.php'); +require_once('dbupdate_3.4/25999_C4_Menu.php'); // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; diff --git a/system/dbupdate_3.4/25999_C4_Menu.php b/system/dbupdate_3.4/25999_C4_Menu.php new file mode 100755 index 000000000..c74f2efaf --- /dev/null +++ b/system/dbupdate_3.4/25999_C4_Menu.php @@ -0,0 +1,81 @@ +db_query("SELECT * FROM campus.tbl_content WHERE beschreibung='CIS4_ROOT'")) { + + if ($db->db_num_rows($result) == 0) { + + if (!$db->db_query("BEGIN;")) + { + echo 'wasnt able to start transaction: ' . $db->db_last_error() . '
'; + } + else + { + + $qry = + " + INSERT INTO campus.tbl_content + (template_kurzbz, oe_kurzbz, insertamum, insertvon, updateamum, updatevon, aktiv, menu_open, beschreibung) + VALUES + ( + 'contentmittitel','etw',NOW(),null,null,null,TRUE,FALSE,'CIS4_ROOT' + ); + + INSERT INTO campus.tbl_contentsprache + (sprache, content_id, version, sichtbar, content, reviewvon, reviewamum, updateamum, updatevon, insertamum, insertvon, titel, gesperrt_uid) + VALUES + ( + 'German', + -- queries the content_id for the CIS4_ROOT + (SELECT content_id from campus.tbl_content WHERE beschreibung = 'CIS4_ROOT'), + 1,TRUE,'',null,null,null,null,NOW(),null,'Cis40',null + ); + + INSERT INTO campus.tbl_contentchild + (content_id, child_content_id, insertamum, insertvon, updateamum, updatevon, sort) + VALUES + ( + -- queries the content_id for the CIS4_ROOT + (SELECT content_id from campus.tbl_content WHERE beschreibung = 'CIS4_ROOT'), + 10882, NOW(), null, null, null, 100 + ); + + + "; + + + + + if (!$db->db_query($qry)) + { + echo 'Menu content: ' . $db->db_last_error() . '
'; + + // Rollback + if (!$db->db_query("ROLLBACK;")) + { + echo 'wasnt able to rollback: ' . $db->db_last_error() . '
'; + } + else + { + echo 'ROLLED BACK
'; + } + } + else + { + // Commit + if (!$db->db_query("COMMIT;")) + { + echo 'wasnt able to commit: ' . $db->db_last_error() . '
'; + } + else + { + echo 'COMMITED
'; + } + + echo '
Menu content created'; + } + + } + } +} + +