cancel
Showing results for 
Search instead for 
Did you mean: 

CopyMoveTo hide some 'Destination' list

nikes
Champ on-the-rise
Champ on-the-rise
Hello,

I want to hide "Shared Files" option from Destination list in CopyMoveTo popup box. in Alfresco 4.2.4

I tried commenting "DLGF.VIEW_MODE_SHARED," in tomcat/webapps/share/modules/documentlibrary/copy-move-to.js


this.options = YAHOO.lang.merge(this.options,
      {
         allowedViewModes:
         [
            DLGF.VIEW_MODE_SITE,
            DLGF.VIEW_MODE_RECENT_SITES,
            DLGF.VIEW_MODE_FAVOURITE_SITES,
            //DLGF.VIEW_MODE_SHARED,
            DLGF.VIEW_MODE_REPOSITORY
            DLGF.VIEW_MODE_USERHOME
         ],
         extendedTemplateUrl: Alfresco.constants.URL_SERVICECONTEXT + "modules/documentlibrary/copy-move-to"
      });


But it doesn't work. I tried it in debug mode, and also created minified version. Both doesn't work.
Seems I still miss something.

I checked this similar past post: https://forums.alfresco.com/forum/developer-discussions/alfresco-share-development/hide-options-copy...
But doesn't work with latest version.

Thanks in advance for any suggestion
2 REPLIES 2

steven_okennedy
Star Contributor
Star Contributor
Hi Nikes,

The snippet you've attempted to change contains the default options for the copyTo/moveTo component, which is an internal module used by several different actions.  These options are being overwritten by the functions that are creating the instnace of this module.

In order to see what's going on here, you need to look at the share-documentlibrary-config.xml file and look at the document-copy-to and document-move-to actions defined there.  These both use are going to call the functions onActionCopyTo and onActionMoveTo respectively, which are defined in share/components/documentlibrary/actions.js.  These functions both call the _copyMoveTo function in that file which creates a new instance (if required) of the Alfresco.module.DoclibCopyMoveTo class (which is the file you have referenced above) and then set its options, including the allowedViewModes.

If you want to affect the list of modes avaialble, it's in the _copyMoveTo function you'd have to make the change.

Again, as is standard practice, it's not a good idea to change the out of the box files themselves, so either provide an extension module that replaces actions.js with a custom version, or more cleanly, define your own functions for the document-copy-to and document-move-to actions to call. 

You can see some detail around this latter option here
http://docs.alfresco.com/4.2/concepts/doclib-web-tier.html,
http://docs.alfresco.com/4.2/concepts/doclib-override-extension-examples.html and
http://docs.alfresco.com/4.2/concepts/doclib-client-side-template-and-action-extensions.html
as a starting point

Regards

Steven

nikes
Champ on-the-rise
Champ on-the-rise
Hi Steven,

Thank you very much for such a quick and detailed response. You response is loud and clear!

Thanks,
Nikesh