Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Primary Relationship #544

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open

Primary Relationship #544

wants to merge 48 commits into from

Conversation

jegelstaff
Copy link
Owner

See related issue(s)

@jegelstaff
Copy link
Owner Author

This needs to handle empty/new systems, where there are no forms, no connections. We should setup the Primary Relationship, with no links, as part of the install.

@jegelstaff
Copy link
Owner Author

This needs to handle empty/new systems, where there are no forms, no connections. We should setup the Primary Relationship, with no links, as part of the install.

Done. Simply always created on loading admin page. Formal DB update not required.

@jegelstaff
Copy link
Owner Author

jegelstaff commented Sep 27, 2024

  • Need to present primary relationship in privileged position in UI, and make it not editable.
  • Need to make all screens default to -1 instead of 0 for relationship
  • Create link when making linked element in form
  • Change link/delete link when target of linked element changes
  • Delete link if linked element is deleted and there are no other links between the forms -- disallow deletion if linked element is used in a subform -- provide big warning when deleting elements that are used in relationship
  • Allow creation of subforms to any form, make linked element creation part of process, wizard process to select format of subforms, and select link or create new link if necessary (and creation of element sets up link in PR)
  • when subform is made, subform screen version of form is made automatically for use in popup/full form, and linking element is excluded. All other elements on one page.
  • add option to the Advanced tab of the element editing page, to specify a one-to-one connection to any other element in any form. Wording needs perfecting.
  • Remove relationship restrictions on saved view loading
  • Make formulize_checkForLinks_oneToOneMetaData respond to inverse of one-to-many connections (check that nothing else keys off that) -- so that Massey won't need explicit one-to-one links for people in activities conditional one to one behaviour
  • Make conditional one to one behaviour kick in based on inverse one-to-many connections (in formdisplay.php, where one to ones are added to the conditional connection)
  • When making Primary Relationship, do not include elements that are not actually linked together (as in ESAT skills)
  • Verify that programs linking to programs in ESAT is OK??
  • Provide delete button on Details popup for onetoone links
  • Enabling saving of primary identifier, necessary for automatic link creation when adding subform elements
  • Add read out of the elements that actually do the joining, to the list of relationship connections
  • Make default singular/plural creation apply plural/singular logic somehow??
  • relationship UI needs revamping to use the "Each entry in X connects to One/Many entries in Y" format. One X --> one/many Y. As part of this, normalize the presentation and recording of relationship data (essentially, deprecate type 3, Many to One)
  • Part of this that would make sense would be a "singular plural noun" setup part as part of the form creation process. ie: Provincial Record Form 12, noun "each entry is a: " 'Activity Log' plural: 'Activity Logs' or whatever. Let us use that for buttons in the screen creation, and relationships, etc
  • Make singular/plural work smart enough to remove " Form" from the end of the name and put it back after.
  • Properly show the Primary Relationship in the screen UI, even when the form is not contained in the relationship
  • Test that cloning form works, and cloned screens are created correctly, with correct language

@jegelstaff
Copy link
Owner Author

jegelstaff commented Sep 28, 2024

Stretch goals:

  • provide way of managing connections/links between forms, outside relationship UI? Or revamped relationship UI. Allow dragging forms to link them up, and prompt with wizard for connection details
  • Add cookie to store user's pref for byname/custom sorting
  • Default sorting to byname if no cookie
  • Re-organize checkboxes to be cleaner looking vertical
  • Remake form boxes to be simpler, highlight focus and give slide out options in panel
  • Add a filter option to limit the forms that are shown
  • Add metadata about entries, users, etc
  • Provide one-to-one admin option in panel that triggers Primary Relationship one-to-one connection

Key thing is this would allow for more obvious one to one connection. But the utility of one to one is not obvious/easily surfaced in Formulize right now, so keeping it in existing relationship UI would be OK.

Make this an alternate sort/display order for the main form list.

@@ -96,8 +96,8 @@ function addlink($form1_id, $form2_id, $relationship_id) {

// write the link to the links table
$writelink = "INSERT INTO " . $xoopsDB->prefix("formulize_framework_links") .
" (fl_frame_id, fl_form1_id, fl_form2_id, fl_key1, fl_key2, fl_relationship, fl_unified_display, fl_unified_delete, fl_common_value)".
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs reverting, we need the explicit value in the DB at all times, even though we're moving ahead with everything always being this way, and not worrying about the value, we want the data to be clean. (?) or have we/can we delete the field from the DB entirely and remove all references to it??

@jegelstaff jegelstaff force-pushed the FEATURE/primary-relationship branch from c80d5c3 to f3b4626 Compare December 7, 2024 20:35
@@ -112,7 +111,7 @@ function patch40() {
}
}

if (!$needsPatch AND !file_exists(XOOPS_ROOT_PATH.'/modules/formulize/custom_code') AND (!isset($_GET['op']) OR ($_GET['op'] != 'patch40' AND $_GET['op'] != 'patchDB'))) {
if (!$needsPatch AND primaryRelationshipExists() AND !file_exists(XOOPS_ROOT_PATH.'/modules/formulize/custom_code') AND (!isset($_GET['op']) OR ($_GET['op'] != 'patch40' AND $_GET['op'] != 'patchDB'))) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make the custom code detection smarter... if code folder has only one file, and there are code features to convert... needs to be its own function :(

@jegelstaff jegelstaff force-pushed the FEATURE/primary-relationship branch from bb894a9 to c0de2e7 Compare December 20, 2024 03:43
jegelstaff and others added 26 commits December 19, 2024 22:57
@jegelstaff jegelstaff force-pushed the FEATURE/primary-relationship branch from c0de2e7 to a24cae3 Compare December 20, 2024 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant