Skip to content

Conversation

@lavipr
Copy link
Owner

@lavipr lavipr commented May 27, 2019

Pull Request for Issue #1 .

Summary of Changes

See Step 1. Adjustment to the toolbar and the ListView of com_associations #3
See Step 2. Set a global Masterlanguage WIP #4
See Step 3. Adding Association States #5

Testing Instructions

  1. Have at least two languages installed, install the multilanguage sample data. Go the the List view of Multilingual Associations test also 'Delete all Associations'.
  2. Go to the settings of the Languagefilter Plugin.

Expected result

    • There should be displayed a list with the default item type 'Articles' with the default site language.
    • Also the buttons ''Delete all Associations' and 'Delete Orphans' are displayed.
    • There is just one column with associatons and the colors are set as expected and the links works correctly
    • After clicking on Delete: The confirmation message changed, so there is a information from which context the associations will be deleted. Just the associations with the given context will be deleted. The other associations are still there as before.
    • There is a new tab 'Masterlanguage' with two fields. Depending on the setting of item-associations and if the plugin is enabled or not, the parameter 'global master language' is set correctly in the database.
    • Depending on this setting, the layout of the associations column within the List Views changes. With the global master lannguage there is displayed a master/child - relationship.
    • Also the links of the association languages within the Associations View are changed when using the global master language. So that the reference is now oriented to the master item and target to the children.

Actual result

Documentation Changes Required

lavipr added 3 commits May 27, 2019 17:15
Since this list view is the only one in which an empty table is displayed before the user specifies what he wants to see via the select boxes, a preselection is defined by "default-values". The default language is set with the default site language, because normally the translations start from this language.
Since the selectboxes now always have a value, the buttons Delete associations and delete orphans of the toolbar are now always displayed.

The "delete associations"-button now only deletes associations in which the user is currently located.
- In addition, the button was adapted to a Confirm button, so that the associated js file and the associated message text could be removed.
- The context is now also included as info in the message text.
- picked code from Wang-Yu-Chao/gsoc18_automatic_multilingual_association@55d46a1
-- remove column "Not Associated" from table
-- removed now unused string
-- removed parameter from function, as it is useless now
--- remove all code using this parameter
-- change color of the language-links
--- grey (secondary) for not associated items
--- green (success) for associated items
@lavipr lavipr changed the title Feature multilingual associations WIP - Feature multilingual associations May 27, 2019
lavipr added 24 commits May 28, 2019 13:37
This add two fields for setting a masterlanguage in the languagefilter plugin.
To set these parameters correctly there has been added an onExtensionAfterSave event, because these parameters depends on others.
The master item is the one written in the language of the global master language.
- New Column 'parent_id' for saving relationsship of items of an association.
  If an association contains no items with the masterlanguage (it may be not used) the value is -1.
  If an association contains an item with the masterlanguage, this is now the parent and is set with 0.
  The other items of this association get the id of the master item / parent.
- Add new method to get the global master language parameter.
- Change save-methods for the associations table concidering the new column
- Add methods to change the master item in the associations table after saving the Languagefilter Plugin.
- set global master language parameters in multi sample data
After the colors in the association view have changed after the columns have been merged, they are now adjusted for the other lists.
In addition, the association column has been centered in each list.
If a global master language has been set, it is displayed as info in the Language select box , so that it is recognizable which master language has been set.
In order to display the Master-Child relationship of the associations in the lists, the layout was adapted.
So now all children of an association are displayed, if the item in the row is a master item. Otherwise, only the current child-item is displayed with its master item, since there is no direct relationship between the children.
In addition, the links of the association items in the Associations View have been adjusted so that the reference is now oriented to the master item and target to the children.
This adds a new column "assocParams" to the association table where the modified date of the master item is stored. The column for the master item always gets its latest modified date, its children get the modified date when the association is created.

The table of menu items does not yet have a modified date, so the column remains empty.

Also, a new AssociationsHelperClass is added for all Masterlanguage matters.
Adding this filter allows to quickly determine if a master element is associated or not and if child elements are either associated, not associated or obsolete.
Set parent id correctly if no master item is present.
To prevent associations from receiving the same association key, since id and language can be the same in different contexts, the context is also added as differentiation.
As described in WCAG 3.3.2: 'Labels or instructions are provided when content requires user input. (Level A)'
Remove the fieldset for the master language and position its fields after the item association field, as the master fields depend on it.
Filtering for "not associated" did not work correctly when either a child of a master item is not associated or when there is no master item for a child.
lavipr added 27 commits June 15, 2019 13:22
- If Version is enabled then store the save_date of the ucm_history table into assocParams. This update the table just in cases when there were changes made when saving an item.
- simplify the conditions in getMasterLanguageValues().
- when the languagefilter plugin get saved it doesn't reset the master id and his modified date when the global master language doesn't changed.
- add a horizontal before item_associations and after global master language within the languagefilter plugin
- changed option values to names instead of numbers
- no longer displays child elements of a master element that do not match when filtering.
Since it seems difficult to determine whether content versions are enabled or not, conflicts would arise if you simply set the modified date of the master item instead. Therefore, the changes are undone. The master language must now be explicitly activated in the plugin language filter.
This finds the table name using the getSupportedExtension function, except for categories.

There are also changes for the field description and some comments. Also removed hardcoded error messages.
This adds a new edit view for updating a child item when it is oudated with the master item. There it is just possible to save the target and update his masters modified date.
When versions are enabled for this itemtype then there is a compare view displayed for the reference/master otherwise the edit view is displayed.
This revert the following changes when no master language is used:
- the column 'Not Associated' in Associations is back
- centering the associations column in all list views has been reverted

Changes for List Views when a global master language is set:
- centering the associations column in all list views
- the toolip has been adjusted
  - - check if versions are enabled, if not the text for outdated items has been adjusted to "might be outdated" as we have no comparison if there has been made changes when the master item has been saved. So the user has to check manually if the child is really outdated. But he knows now that the master item has been saved at least.
When opening the association edit view via the associations-button from an item, then open this item as target, if an associated master item exists, and the master item as reference.
In Association Edit View:
When a child item is the current reference then the target has to be the master language. Other child languages has no direct relationship to this child, so it makes no sense to display them in the language filter.
The same code is now moved to a function where the class name and the info text of the association status are set.
The code style improvements include changes to variable names, the position of variables, improving comments, and text alignments.
@lavipr lavipr closed this Aug 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants