CoreBOSBB
Use 'onlyonmymodule' in manifest.xml? - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Development (https://discussions.corebos.org/forumdisplay.php?fid=18)
+--- Forum: coreBOS Development (https://discussions.corebos.org/forumdisplay.php?fid=4)
+--- Thread: Use 'onlyonmymodule' in manifest.xml? (/showthread.php?tid=1875)



Use 'onlyonmymodule' in manifest.xml? - Guido1982 - 07-28-2020

In the manifest file, we have the option to add customlinks (which will become business actions), but can we also specify the 'Only on my module' option? And if yes, how? Something like this?

PHP Code:
<customlink>
  <
linktype>DETAILVIEWWIDGET</linktype>
  <
linklabel>InventoryDetailsBlock</linklabel>
  <
linkurl><![CDATA[block://InventoryDetailsBlock:modules/WorkAssignment/InventoryDetailsBlock.php]]></linkurl>
  
<linkicon><![CDATA[]]></linkicon>
  <
sequence>0</sequence>
  <
handler_path><![CDATA[]]></handler_path>
  <
handler_class><![CDATA[]]></handler_class>
  <
handler><![CDATA[]]></handler>
  <
onlyonmymodule>1</onlyonmymodule>
</
customlink



RE: Use 'onlyonmymodule' in manifest.xml? - joebordes - 07-31-2020

seems like it is there: https://github.com/tsolucio/corebos/blob/master/vtlib/Vtiger/PackageImport.php#L835

but with the name <onlyonmodule>


RE: Use 'onlyonmymodule' in manifest.xml? - Guido1982 - 07-31-2020

Seems a bit dubious, since there are two fields in business actions: one checkbox 'onlyonmymodule' that turns limiting on or off, and a 'modules' field that tells which modules the business action should apply to. This seems to indicate it applies to the checkbox, so maybe we should update the import code so that it reflects the fieldname/columnname better?


RE: Use 'onlyonmymodule' in manifest.xml? - joebordes - 08-11-2020

There are some link types that, by default apply to all modules, no matter what module is selected in the module list. Namely

'HEADERSCRIPT_POPUP', 'HEADERCSS_POPUP','FOOTERSCRIPT', 'HEADERLINK','HEADERSCRIPT', 'HEADERCSS'

these normally make sense to be this way, but from time to time you want one of these types only on some modules. In that particular case you can use the OnlyOnMyModule checkbox to revert these to the default behavior of respecting the module selection.

So, I think it is correct as it is. What do you think?


RE: Use 'onlyonmymodule' in manifest.xml? - Guido1982 - 08-11-2020

Well the way I see it we have two directives:
  • Only on module
  • Only on my module
The way I see it the first one is a list of one or more modules you want to limit your business action's application to, with the exception of the types you mentioned. The second is the checkbox that enforces the application of the business action to be limited to the modules in the aforementioned list. If I look at the code, it looks like the name of the first item in the list is actually performing the function of the second, which I think is confusing. I'd rather do:
Code:
<onlyonmymodule>1</onlyonmymodule>
<onlyonmodule>
  <module>SalesOrder</module>
  <module>Accounts</module>
  <module>Quotes</module>
</onlyonmodule>
Would you agree?


RE: Use 'onlyonmymodule' in manifest.xml? - joebordes - 08-11-2020

then we don't have support for the module lists in the manifest file

yes, I would agree on adding the module list in the manifest file (and also in the call). the name can be onlyonmodules or onthesemodules