User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:devel:corebos_hooks [2019/07/03 23:26]
joebordes [Supported events]
en:devel:corebos_hooks [2021/01/11 01:59] (current)
joebordes [Supported events]
Line 145: Line 145:
  
 ===corebos.footer=== ===corebos.footer===
-Will be triggered in the footer of coreBOS, when the whole execution has ended. If the logged in user is an admin user this event will be used to print out a time execution summary of the events.+Will be triggered in the footer of coreBOS, when the whole execution has ended. If the logged-in user is an admin user this event will be used to print out a time execution summary of the events.
  
 This event does not receive any parameters. This event does not receive any parameters.
Line 187: Line 187:
  
 ===corebos.filter.editview.setObjectValues=== ===corebos.filter.editview.setObjectValues===
-This event will be called when a new record is being created. It will receive the new CRMEntity object so you can add default values to any field using the column_field property. Obviously you could do other verification or functionality tasks.+This event will be called when a new record is being created. It will receive the new CRMEntity object so you can add default values to any field using the column_field property. Obviouslyyou could do other verification or functionality tasks.
  
 You must return the object given. You must return the object given.
  
-<WRAP center round info 75%>The [[https://​github.com/​tsolucio/​coreBOSAddress|coreBOSAddress]] module has an exceptional example of how this works by filling in the address fields when creating a new record from it'​s ​related list.</​WRAP>​+<WRAP center round info 75%>The [[https://​github.com/​tsolucio/​coreBOSAddress|coreBOSAddress]] module has an exceptional example of how this works by filling in the address fields when creating a new record from its related list.</​WRAP>​
  
 ===corebos.filter.link.show=== ===corebos.filter.link.show===
Line 203: Line 203:
  
 ===corebos.filter.ModComments.queryCriteria=== ===corebos.filter.ModComments.queryCriteria===
-This event will be called when constructing the SQL query to retrieve the comments associated ​to a record. We must return a part of the //WHERE// condition that modifies the final query.+This event will be called when constructing the SQL query to retrieve the comments associated ​with a record. We must return a part of the //WHERE// condition that modifies the final query.
  
 ===corebos.entity.link.before=== ===corebos.entity.link.before===
-Action launched BEFORE two entities are about to be related. ​Action ​receives the names and IDs of the records being related.+Action launched BEFORE two entities are about to be related. ​The action ​receives the names and IDs of the records being related.
  
 ===corebos.entity.link.after=== ===corebos.entity.link.after===
-Action launched AFTER two entities have been related. ​Action ​receives the names and IDs of the records being related.+Action launched AFTER two entities have been related. ​The action ​receives the names and IDs of the records being related.
  
 ===corebos.entity.link.delete=== ===corebos.entity.link.delete===
-Action launched when two entities are about to be UNrelated (BEFORE). ​Action ​receives the names and IDs of the records being UNrelated.+Action launched when two entities are about to be UNrelated (BEFORE). ​The action ​receives the names and IDs of the records being UNrelated.
  
 ===corebos.entity.link.delete.final=== ===corebos.entity.link.delete.final===
-Action launched when two entities have just been UNrelated (AFTER). ​Action ​receives the names and IDs of the records being UNrelated.+Action launched when two entities have just been UNrelated (AFTER). ​The action ​receives the names and IDs of the records being UNrelated.
  
 ===corebos.filter.preSaveCheck=== ===corebos.filter.preSaveCheck===
Line 239: Line 239:
 ===corebos.audit.[authenticate|login|login.attempt|logout|action]=== ===corebos.audit.[authenticate|login|login.attempt|logout|action]===
 Actions called on the indicated events Actions called on the indicated events
 +
 +===corebos.filter.inventory.getprice===
 +
 +When the application requires a product/​service price, it will get the unit price field from the database and then call this filter with some information so we can calculate some other price to be returned.
 +
 +This filter receives these parameters:
 +  * the unit price
 +  * the discount (always 0 as the application does not natively calculate this)
 +  * an array with these values:
 +    * inventory module we are on
 +    * module id if we are editing
 +    * accountid (maybe 0 if not selected)
 +    * contactid (maybe 0 if not selected)
 +    * productid/​serviceid
 +    * related_module
 +
 +===corebos.filter.announcement===
 +
 +return the announcement to show. permits creating dynamic announcements
  
 ====Custom Permission Hooks==== ====Custom Permission Hooks====
Line 286: Line 305:
   * [[en:​devel:​corebos_hooks:​popup_query_hook|Popup query hook]]   * [[en:​devel:​corebos_hooks:​popup_query_hook|Popup query hook]]
   * [[en:​devel:​corebos_hooks:​related_list_hook|Related List hook]]   * [[en:​devel:​corebos_hooks:​related_list_hook|Related List hook]]
 +  * afterImportRecord
  
 ===== LINKS: Types and usage ===== ===== LINKS: Types and usage =====
Line 310: Line 330:
 |LISTVIEWBASIC|Button on the top of the list view of a module| |LISTVIEWBASIC|Button on the top of the list view of a module|
 |LISTVIEW|Hover menu on the top of the list view of a module that contains the link| |LISTVIEW|Hover menu on the top of the list view of a module that contains the link|
-|HEADERLINK|Hover menu on the top of the browser screen that contains the link. It appears next to the Prefrences ​icon and is a global action link|+|HEADERLINK|Hover menu on the top of the browser screen that contains the link. It appears next to the Preferences ​icon and is a global action link|
 |HEADERSCRIPT|Permits the inclusion of a javascript file located in the application| |HEADERSCRIPT|Permits the inclusion of a javascript file located in the application|
 |HEADERCSS|Permits the inclusion of a CSS style file located in the application| |HEADERCSS|Permits the inclusion of a CSS style file located in the application|
 |HEADERSCRIPT_POPUP|Permits the inclusion of a javascript file located in the popup screen of the application| |HEADERSCRIPT_POPUP|Permits the inclusion of a javascript file located in the popup screen of the application|
 |HEADERCSS_POPUP|Permits the inclusion of a CSS style file located in the popup screen of the application| |HEADERCSS_POPUP|Permits the inclusion of a CSS style file located in the popup screen of the application|
 +|PRESAVE|Permits us to launch code when the user clicks on the SAVE button BEFORE the operation is done. We will be able to execute code in the PHP application and force the execution of a javascript function. The javascript function takes full control of the save process which means that it must submit the form if it decides to. In order to do that it will receive the parameters: edit_type, formName, action, callback, any parameters sent by the php code|
  
 <WRAP center round info 90%>Get more details in the [[en:​devel:​add_actions|How to add action links to a module]] development tutorial.</​WRAP>​ <WRAP center round info 90%>Get more details in the [[en:​devel:​add_actions|How to add action links to a module]] development tutorial.</​WRAP>​