Package: collective.contact.plonegroup
collective.contact.plonegroupIntroductionA Plone add-on that manage organizations and functions, leading to corresponding plone groups creation.
This product makes the link between:collective.contact.core: organization definition containing your organization services (multiple levels)dexterity.localrolesfield: field presenting a list of services for which a local role can be givenHow-toFirst, create a directory in your site (object from collective.contact.core). This directory will contain all the informations related to your contacts.You can then add your organization in it (with a specific id equal to ‘plonegroup-organization’).
An organization can contain organizations (such as services, divisions or department).In the collective.contact.plonegroup configuration panel, you have to :select some services of your organization to be used in localroles fielddefine some function labels that will be used in each selected organizationWhen submitting, for each organization - function combination, a plone group is created with the id “organization-uid”_”function-id” and name “organizations-name” (“function-name”).The generated plone groups will be used in localroles field, where some local roles can be given to some function for each selected service.InstallationAdd collective.contact.plonegroup to your eggs.Re-run buildout.Install the product in your plone site.CreditsHave an idea? Found a bug? Let us know byopening a ticket.ContributorsGauthier Bastien, IMIOStéphan Geulette, IMIOVincent Fretin, EcreallCédric Messiant, EcreallFrédéric Peters, Entr’ouvertChangelog1.48 (2024-02-19)Addedbehaviors.IPlonegroupUserLinkwith userid and primary_organization fields.
[sgeulette]Addedutils.get_person_from_useridandutils.get_persons_from_userid[sgeulette]1.47 (2023-10-19)Fixed typo in french translation.
[gbastien]1.46 (2023-07-07)Added parameteromitted_suffixes=[]toutils.get_all_suffixes.
[gbastien]1.45 (2023-02-27)Avoid useless variable initialization inutils.get_plone_group,
do everything in one line.
[gbastien]1.44 (2022-08-19)Warning, changed behavior ofutils.get_organization, added parameteronly_in_own_org=Truethat will make sure that givenorg_uidis an
organization inside own organization.
[gbastien ]Addedget_selected_org_suffix_principal_idsandvoc_selected_org_suffix_useridsto work only with group and user ids
[sgeulette]Used cached methodget_users_in_plone_groupsfrom imio.helpers
[sgeulette]1.43 (2022-07-01)Addedutils.get_suffixed_groups.
[sgeulette]Do not delete a group (after a function removal) if not empty
[sgeulette]1.42 (2022-06-14)Escape user and group title inDisplayGroupUsersView.
Moreover fixed column to be not sortable.
[gbastien]Addedsafe_utils.pythat will only include safe utils.
[gbastien]Corrected error in search: do not pass empty portal_type criteria.
[sgeulette]Added parameter escaped=True invoc_selected_org_suffix_usersfunction
[sgeulette]Fixed@@display-group-userswhen organization is not selected in plonegroup
so there is no linked Plone groups, added tests for it and the@@suborganizationsview (z3ctable displaying organizations contained in
another organization).
[gbastien]1.41 (2022-05-06)Added adapter with methods to check PloneGroupContact delete and transition.
[sgeulette]1.40 (2022-04-22)Adapted thePloneGroupUsersGroupsColumnto display linked group also when
organization is not selected in plonegroup, this lets display linked Plone groups
of an organization that was selected then unselected.
[gbastien]1.39 (2022-02-03)Distinguished cached calls in vocabularies.
[sgeulette]1.38 (2021-11-26)Inutils.get_organizationandutils.get_organizations, query catalog unrestricted.
[gbastien]RemoveduuidToObjectimported fromplone.app.uuidinsettings.py,
we useuuidToObjectfromimio.helpers.
[gbastien]1.37 (2021-10-20)Corrected cache invalidation bug, that wasn’t done when a previously deactivated
organisation is reactivated. Invalidate now wider.
[sgeulette]1.36 (2021-08-27)Added logging usingcollective.fingerpointingin the@@manage-own-groups-usersview when a user was added or removed.
[gbastien]Addedavailable_exprto the action displaying theManage own groups,
action will be displayed if at least one value is selected in thegroups_managementfield in the configuration.
[gbastien]Useimio.helpers.SortedUsersvocabulary in the@@manage-own-groups-usersview.
[gbastien]1.35 (2021-05-05)FixedaddOrModifyOrganizationGroupscalled when an organization is modified,
that was creating Plone groups for every suffixes without consideringenabledorfct_orgs. Added upgrade step tov8that will delete Plone
groups that were wrongly created.
[gbastien]1.34 (2021-04-20)Fixedsettings.detectContactPlonegroupChangewhere sometimesevent.oldValueis None when value is set several times from different testing layers.
[gbastien]1.33 (2021-01-06)Do not grok the package anymore.
[gbastien]Override vocabularyPositionTypesfromcollective.contact.core, whencontextout of a directory, getposition_typesfromDEFAULT_DIRECTORY_ID.
[gbastien]1.32 (2020-10-26)FixedDisplayGroupUsersView.group_titlewhenDisplayGroupUsersView.short=Trueto only apply if we have a format likeMy config (My suffix)or it removed
last letter.
[gbastien]Added parameterPloneGroupUsersGroupsColumn.short=Trueso@@display-group-usersis rendered short by default.
[gbastien]1.31 (2020-10-11)Combined v6 and v7 upgrade because it fails coming from v5
[sgeulette]Corrected table class name.
[sgeulette]1.30 (2020-10-02)Added manage-own-groups-users view and functions/groups selection configuration.
A user can manage the user assignments of his groups.
[sgeulette]Avoid getting groups (only users) inget_selected_org_suffix_usersfunction.
[sgeulette]Avoid GroupNotFoundError inget_selected_org_suffix_usersif suffix is limited to some organizations.
[sgeulette]AddedBaseOrganizationServicesVocabulary._term_valueandBaseOrganizationServicesVocabulary._term_tokento ease override
of rendered term value and token.
[gbastien]MakeSelectedOrganizationsElephantVocabularyinherits fromOwnOrganizationServicesVocabularyso methods_term_valueand_term_tokenare available.
[gbastien]In@@display-group-usersinstead displaying contained groups without
contained members, display members of contained groups for normal users,
display contained groups and contained members to Managers.
[gbastien]FixedConnectionStateErrorwhile settingregistry[FUNCTIONS_REGISTRY]in tests and profile is applied several times.
[gbastien]1.29.1 (2020-08-26)Fix CSS for@@display-group-usersview when current user not a Manager
and so does not have link on prefixed icon (user/group).
[gbastien]1.29 (2020-08-18)AddedPloneGroupUsersGroupsColumn, a column that displays suffixed groups
and users, to be called on dashboard displaying organizations.
The groups and users are rendered by the@@display-group-usersview
that may also be used outside.
By default, as groups and users may be very long to display, it is hidden
in a collapsible<div>and displayed asynchronously.
[gbastien]Added possibility to disable afunction(enabled=Trueby default),
this is useful to avoid deleting afunctionand re-adding it after,
sometimes faultly.  Adaptedutils.get_all_suffixes(only_enabled=True)to only get enabled functions.
Added upgrade step to version6to manage new valueenabled=Trueinfunctionsstored in theregsitry.
[gbastien]Remove itemUIDfrom link inOrgaPrettyLinkWithAdditionalInfosColumnas it is now displayed as additional information by default.
[gbastien]1.28 (2020-05-26)Inutils.get_organizations, do not use alist comprehensionto turn
result ofget_registry_organizationsinto a list as it is already the case
(was not the case a long time ago),get_registry_organizationsreturns a
new list and values stored in the registry will not be changed anymore by
default.
[gbastien]1.27 (2020-05-08)Make theOrgaPrettyLinkWithAdditionalInfosColumnalso work forpersonandheld_position.
[gbastien]1.26 (2020-03-12)As vocabularyram.cachecachekey are generated based on
module/class names, renamed vocabulariescollective.contact.plonegroup.selected_organization_servicestocollective.contact.plonegroup.browser.settings.SelectedOrganizationsElephantVocabularyandcollective.contact.plonegroup.sorted_selected_organization_servicestocollective.contact.plonegroup.browser.settings.SortedSelectedOrganizationsElephantVocabulary.
Added tests showing that cache is correctly invalidated when selected organizations changed.
[gbastien]1.25 (2020-02-06)Usecollective.contact.plonegroup.sorted_selected_organization_servicesforsettings.IFunctionSchema.fct_orgs(field for restricting a suffix to some organizations).
[gbastien]InvalidateSettingsinvariant check if Plone group is empty usinggetGroupMembersthat ignores<not found>users insteadgetMemberIds.
[gbastien]1.24 (2019-11-25)Added group_as_str param in organizations_with_suffixes function.
[sgeulette]1.23 (2019-11-04)Added parametercaching=Truetoutils.get_organization, this will store
the organization object in the REQUEST and avoid too much catalog queries.
[gbastien]1.22 (2019-09-26)When passingkept_org_uidstoutils.get_organizations,
make sure order is preserved.
[gbastien]1.21 (2019-09-13)AddedBaseOrganizationServicesVocabulary._term_titleto ease override of
rendered term title.
[gbastien]1.20 (2019-09-12)Addedcollective.contact.plonegroup.every_organizationsvocabulary, to do
this needed to writeBaseOrganizationServicesVocabularyfrom whichOwnOrganizationServicesVocabularyandEveryOrganizationsVocabularyinherits.
[gbastien]Removed sorting on term title forcollective.contact.plonegroup.selected_organization_services, terms are
displayed following selection order in plonegroup organizations like before.
Added new vocabulary sorted on term title and available ascollective.contact.plonegroup.sorted_selected_organization_services.
[gbastien]1.19 (2019-08-23)OptimizedOwnOrganizationServicesVocabulary.listSubOrganizations, do the
catalog query only if current organization contains something.
[gbastien]1.18 (2019-08-02)InOrgaPrettyLinkWithAdditionalInfosColumn, setshowContentIconto True
and enablelink-tooltip.
[gbastien]InSelectedInPlonegroupColumn, displayNotin bold.
[gbastien]Addedcollective.contact.plonegroup.functionsvocabulary listing every
functions defined in plonegroup control panel.
[gbastien]1.17 (2019-07-15)Corrected bad full title shortening.
[sgeulette]1.16 (2019-06-30)Fixed error inOrgaPrettyLinkWithAdditionalInfosColumnwhen displaying
organizations out ofPLONEGROUP_ORG.
[gbastien]Fixedutils.get_organizationswhencaching=Trueto store a new list of
organizations in the cache instead returned value or value in cache may be
modified if we modify returned value in a sub method…
[gbastien]Useget_registry_organizations/set_registry_organizationsandget_registry_functions/set_registry_functionsas much as possible.
[gbastien]1.15 (2019-06-07)Fixed problem, linked Plone groups title were not updated when suffix title
changed and somefct_orgswere defined.
[gbastien]Insettings.detectContactPlonegroupChange, setchanges = Trueonly when
relevant, due to wrong indentation, it was done systematically.
[gbastien]1.14 (2019-05-16)MakeOrgaPrettyLinkWithAdditionalInfosColumnwork if displaying theplonegroup-organization, include link to plonegroup configuration panel inSelectedInPlonegroupColumnheader.
[gbastien]Changed first parameter name forutils.get_plone_groupandutils.get_plone_group_idfromorg_uidtoprefixas it can be used in
other cases.
[gbastien]Added helper methodutils.select_org_for_functionto be able to add/remove
an organization uid fromfct_orgsdefined on afunction.
[gbastien]Removed dependency onunittest2.
[gbastien]When callingconfig.get_registry_organizationsandconfig.get_registry_functions, by default return a copy of stored data to
avoid changing it.
[gbastien]Added parameterdefault=Truetoutils.get_own_organization, in this case,
default ids forroot directoryandown organizationare used instead
using a catalog query, it should be faster.
[gbastien]1.13 (2019-01-11)Use unrestrictedSearchResults to check link integrity.
[sgeulette]Added helpers config.get_registry_organizations,
config.get_registry_functions, config.set_registry_organizations and
config.set_registry_functions to easily get and set organizations/functions
registry records.
[gbastien]1.12 (2018-12-11)Added parameterkept_org_uidstoutils.get_organizationsto only keep
organizations having defined UID.
[gbastien]Sortcollective.contact.plonegroup.selected_organization_servicesvocabulary by value title.
[gbastien]Display the organization UID next to title in thesuborganizationsview.
[gbastien]1.11 (2018-11-20)In utils.get_organizations, call uuidsToObjects with ordered=True to get
organizations in correct order because the catalog query is not sorted.
[gbastien]Fixed migration that adds ‘fct_orgs’ to functions.
[gbastien]1.10 (2018-10-12)Removed grok for OwnOrganizationServicesVocabulary.
[gbastien]Added utils.get_organization to get an organization corresponding
to a given plone_group_id.
[gbastien]Added utils.get_organizations to get every plonegroup organizations.  It is
possible to get every selectable or selected organizations, as objects or not
and for which a particular linked Plone group (suffix) is not empty.
[gbastien]Added utils.get_all_suffixes that returns every defined functions ids.
[gbastien]Added possibility to restrict suffixes to only some selected organizations.
Plone groups will only be created for selected organizations.  When selecting or
unselecting organizations, linked Plone groups are created/deleted accordingly.
[gbastien]Moved setting.getOwnOrganizationPath to
utils.get_own_organization/utils.get_own_organization_path.
[gbastien]Added method utils.get_plone_groups that returns every Plone groups of a
given organization.
[gbastien]Added utils.get_plone_group that returns a Plone group for given organization
UID and suffix.
[gbastien]Disabled auto_append on IContactPlonegroupConfig.functions DataGridField.
[gbastien]Notify event PlonegroupGroupCreatedEvent when a Plone group linked to an
organization is created.
[gbastien]z3c.table batching does not work when displaying suborganizations, so set
batchSize and startBatchingAt to 999 instead 200 so we are pretty sure it is
never displayed.
[gbastien]While displaying “@@suborganizations”, display a specific message “No suborganization”
when no suborganizations instead displaying nothing.
[gbastien]Added default logger importable from collective.contact.plonegroup.
[gbastien]Added utils.select_organization to be able to select or unselect an
organization from organizations registry.
[gbastien]While creating Plone groups, translate suffix displayed in title.
[gbastien]1.9 (2018-09-04)Added utils.get_plone_group_id to get Plone group id for given organization and suffix.
[gbastien]Overrided “@@suborganizations” view to display the entire hierarchy of contained
organizations and sub-organizations and more informations in a table.
[gbastien]When the plonegroup-organization is displayed in a tooltip, use original way
to display sub organizations because the new rendering using the table takes
too much place in the tooltip.
[gbastien]1.8.1 (2018-07-30)Sort user vocabulary by fullname
[sgeulette]Added cache on travis.
[sgeulette]1.8 (2017-09-18)Corrected error when deleting site.
[sgeulette]Corrected group modification. Added migration step.
[sgeulette]1.7 (2017-07-25)Check if linkintegrity is enabled in events.
[sgeulette]1.6 (2017-05-30)Use manager role only if necessary to avoid “SystemError: Excessive recursion” when recataloging
[sgeulette]Protect against group deletion
[sgeulette]Corrected subscriber at object paste
[sgeulette]1.5 (2016-12-13)Get selected organizations with manager role because plone.formwidget.masterselect calls ++widget++ as Anonymous.
[sgeulette]1.4 (2016-12-07)Call only once a subscriber.
[sgeulette]Improved util method and added test
[sgeulette]Added method to get selected organizations with customized title
[sgeulette]Added methods to get orgs users and vocabulary
[sgeulette]1.3 (2016-04-15)Use a stored cache key to invalidate cache on all zeo clients
[sgeulette]1.2 (2016-01-13)Made an unrestricted search to list own organizations, possible reason of empty list
[sgeulette]Increase OrderedSelectWidget size to 15 lines.
[sgeulette]Use the same permission to protect config view and configlet.
[sgeulette]1.1 (2015-12-11)Put title as unicode in vocabulary.
[sgeulette]1.0 (2015-11-24)Added link integrity check when deleting a plonegroup organization
[sgeulette]Added marker interfaces to distinguish plonegroup organizations
[sgeulette]Added selected organizations vocabulary as elephantvocabulary: display correctly no more selected terms.
[sgeulette]Don’t deactivate a used plonegroup organization
[sgeulette]Check state to build OwnOrganizationServicesVocabulary.
[cedricmessiant]Set token to UID in OwnOrganizationServicesVocabulary.
[sgeulette]Give access to configlet to Site Administrator
[sgeulette]Flake8 corrections
[sgeulette]0.2 (2014-03-18)Corrected Manifest to include all files.0.1 (2014-02-13)Initial release.
[sgeulette]