Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-4798

Filter out recently added items when component is disabled

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.0
    • Fix Version/s: 4.3.0
    • Component/s: None
    • Labels:
      None

      Description

      Current "Recent" mechanism doesn't have any way of filtering out items that belong to components that are currently disabled. The way it works right now, is that even if you disable the component, appropriate items in recent objects list stay there, and clicking on them basically allows displaying the object like the component wasn't turned off.

      Right now, places in the code don't know component name or id from which they are called. It's possible to hardcode it, but than it makes further changes a bit more complicated and spread among many places. Simple solution to that is to change the implementation a little bit and make the code call component specific "recent" adding method (implemented in CRM/Core/Component/Info.php) instead of CRM_Utils_Recent::add directly. Component specific method will have more "knowledge" about the object being added, so it will be easier to . There is also a possibility to remove some other hard coded info about objects being added to the recent list (like object type), which will allow removing some code that currently spread among many files (list below) and easier maintenance in the future.

      The list of files that will require changing CRM_Utils_Recent::add call to CRM_<component>_Info::addRecent method call.

      Activity/BAO/Activity.php
      Case/BAO/Case.php
      Case/Form/ActivityView.php
      Case/Form/CaseView.php
      Contact/BAO/Group.php
      Contact/BAO/Relationship.php
      Contact/Form/Contact.php
      Contact/Page/View/Relationship.php
      Contact/Page/View.php
      Contribute/BAO/Contribution.php
      Contribute/Form/ContributionView.php
      Core/BAO/Note.php
      Core/BAO/UFMatch.php
      Event/BAO/Participant.php
      Event/Form/ParticipantView.php
      Grant/BAO/Grant.php
      Grant/Form/GrantView.php
      Member/BAO/Membership.php
      Member/Form/MembershipView.php
      Pledge/BAO/Pledge.php
      Pledge/Form/PledgeView.php

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mover Michał Mach
                Reporter:
                mover Michał Mach
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: