Menu

Welcome, Guest
Username: Password: Remember me

TOPIC: Custom behavior in document download

Custom behavior in document download 5 days 19 hours ago #69221

  • simone_osmosit
  • simone_osmosit's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
Greetings everyone,

I am tasked to implement some custom behavior in response to a click on a document link.
The link provided by SuiteCRM is like the following one:
http://<<partial_url>>/index.php?entryPoint=download&id=<<doc_id>>&type=<<my_custom_module>>

Is there a way of customizing the default behavior? (which in this case is the plain download of the locally stored file)
Should I try overriding the existing logic or should I implement a new entry point from scratch?
And if so, how can I have the UI provide the correct url to the user?

----
Environment information: Apache 2.4.17, PHP 5.6.23
Last Edit: 5 days 19 hours ago by simone_osmosit. Reason: added environment information
The administrator has disabled public write access.

Custom behavior in document download 5 days 13 hours ago #69236

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 6868
  • Thank you received: 1048
  • Karma: 244
Check here to see where the entrypoint maps to:

include/MVC/Controller/entry_point_registry.php

In this case, it is download.php at the root.

Changing it won't be upgrade-safe, though... There are ways to add custom entrypoints to SuiteCRM, but what you're asking about is to override a default entrypoint, which is a bit different.

Remember you might be better off doing things from the UI, not from the entrypoint. So it might be easier to override the view classes and have Javascript change bits of the screen. You can also make it point to a custom entrypoint instead.
The administrator has disabled public write access.
The following user(s) said Thank You: simone_osmosit

Custom behavior in document download 5 days 13 hours ago #69247

  • simone_osmosit
  • simone_osmosit's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
Thank you pgr,

that ultimately was what we did:
we created a customized detailviewdefs.php in custom/modules/<my_module>/metadata which was a copy of the original one, except for the fact that we introduced a customized version of the "default" panels.
A panel with a dynamically forged link was defined, and then we defined a particular entry point to handle the call to this link.

So far, it is working as intended.
The administrator has disabled public write access.

Custom behavior in document download 5 days 13 hours ago #69253

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 6868
  • Thank you received: 1048
  • Karma: 244
Cool, I'm glad you got it working :-)
The administrator has disabled public write access.
Time to create page: 0.099 seconds
Powered by Kunena Forum