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

CRM-21434: Add activities to recent items on view and edit #11280

Conversation

niels-heinemann
Copy link
Contributor

@niels-heinemann niels-heinemann commented Nov 15, 2017

When viewing activities push them to the recent items stack.


@mlutfy
Copy link
Member

mlutfy commented Nov 15, 2017

Hi,

Can you open a JIRA issue? https://docs.civicrm.org/dev/en/latest/core/contributing/

The test errors seem to be syntax-related, but from the github UI I don't think it shows the presence of tabs. Can you double-check?

This is a new feature that might be somewhat disruptive to users who are not used to seeing activities in the Recent Items.

  • Is it disabled by default?
  • Have you tried implementing this as an extension? (hooks buildForm and pageRun should help)

@niels-heinemann niels-heinemann changed the title Add activities to recent items on view and edit CRM-21434: Add activities to recent items on view and edit Nov 15, 2017
@niels-heinemann
Copy link
Contributor Author

https://issues.civicrm.org/jira/browse/CRM-21434
Changed tabs to spaces.

Activities were added to the stack before but in an inconsistent manner. Some activities were, some not. I couldn't identify a rule which was followed. So this PR brings value to people who want activities to be seen in the stack. People disliking this feature may deselect activities provider in the corresponding setting (civicrm/admin/setting/misc -> Recent Items Providers). I do not think they would benefit from keeping the current random selection.

@mlutfy
Copy link
Member

mlutfy commented Nov 17, 2017

Ah, hmm, right. Looking at other entities, they either get added to Recent Items from the BAO or the Form class, often both.

The Activity BAO has quite a few conditions on how to add activities to the Recent Items (mostly permission-related), as well as parameters such as skipRecentView. Maybe that code should be moved to a function, and call that from the Form class?

Do you have a specific use-case where an activity wasn't being added to the Recent Items?

@niels-heinemann
Copy link
Contributor Author

Thanks for your review! Activity BAO calls RecentItems's Add method only on create. Handling the view action here seems quite complicated and I don't know any massive benefits. Do you?

@eileenmcnaughton
Copy link
Contributor

@mlutfy This has been stalled for a while - do you think it's progressable? I share your reservation about doing the Update on the form layer - esp in the preProcess as it would happen when looking to update & then backing out. I'm OK with adding the VIEW links as they are in this function

Regarding the optionality - CRM_Utils_Recent::add will not add items for entities that are not enabled for recent - ie
$providersPermitted = Civi::settings()->get('recentItemsProviders');

@niels-heinemann
Copy link
Contributor Author

Hmm, I'm not sure if my english skills are sufficient but I'm reading this as "Push the update related code to the BAO". I'm gonna have a look.

@eileenmcnaughton
Copy link
Contributor

@nielosz why don't you start by getting the view only part in a PR & merged since that part seems simple

@eileenmcnaughton
Copy link
Contributor

@nielosz are you OK to rebase this & squash to a single commit.

@mlutfy I will merge the squashed 'view-only' version - unless you comment back to register concerns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants