Open
Conversation
Replace update_helptable.php with external function. Extract html code to templates
Use bootstrap classes to make the table visually appealing
The "print_res_selection" was added a long time ago but never used. For now it will be removed
Due to previous changes, the lib_his.php needs this additions
… handling and correctnes - Replace per-iteration pg_query in do-while with in-memory lookup via $lsfcategories array - Replace find_origin_category DB queries with in-memory traversal - Use insert_records for bulk relation inserts instead of individual insert_record calls - Replace get_record + update_record with set_field for txt2 updates - Wrap all DB writes in a single transaction; roll back on failure - Remove nested try-catch blocks that silently swallowed errors - Improve mtrace logging for sync summary and failure messages
cab4ec9 to
e5f75bd
Compare
Sometimes a category does not have subcategories. In this case the "mapping_submit" stage should directly show the category it will map to.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔀 Purpose of this PR:
📝 Description:
This pull requests redesigns the "update_helptable" feature.
Refactor function
insert_missing_helptable_entries:The main job of it is to fill and update the datatables of ´lsf_unification´, that contain all the course categories from the
lsf_view. ´lsf_unification´ saves a full category tree and saves the distance between two categories.Example: In the lsf_view this categories exists:
Every category knows is predecessor and successor.
lsf_unificationfills 2 tables:local_lsf_unification_category:local_lsf_unification_categoryparenthood: This table saves the distance between each categoryChanges made in the function:
mtracefor nowIn a more or less manual testing the DB calls were reduced (with testdata from the lsf_view) from 1116 to 203 👍🏼 .
Beautify the
helptablemanager.php:This page shows the category tree of the lsf to the admin and lets the admin create mappings from the lsf-categories to moodle-categories.
What was changed?:
echo-statements to mustache templatesThis is how the new mapping table looks:
📋 Checklist
Please confirm the following (check all that apply):
var_dump()orvar_exportor any other debugging statements (or commented out code) thatshould not appear on the productive branch.
🔍 Related Issues