How to "Calling functions with a URL"

Discuss about Group-Office development here

Moderator: Developers

itsupport
Posts: 6
Joined: Tue Dec 10, 2013 11:37 pm

How to "Calling functions with a URL"

Postby itsupport » Thu Oct 02, 2014 3:59 am

We would like to imbed a URL into an email which would cause Group Office to be loaded in a web browser, the user then logs in, and then our module would load at a particular location in our module.

The page https://www.group-office.com/wiki/Calli ... with_a_URL indicates that you can call your module by calling "createExternalUrl" as in "GO::createExternalUrl('yourmodule', 'showDialog', array('aparameter'));", and then when a user uses the URL in their web browser, "This will call GO.yourmodule.showDialog("aparameter"); "

However we have not managed to get this to work.

In what file should "GO.yourmodule.showDialog("aparameter")" be placed in ? And how what does an example code look like?

Do you have any examples of how to use "createExternalUrl" and "showDialog" ? (which I could use as a guide, please).

We will investigate a bit further and maybe ask more specifically if noone has answered our query by then.
itsupport
Posts: 6
Joined: Tue Dec 10, 2013 11:37 pm

Re: How to "Calling functions with a URL"

Postby itsupport » Thu Oct 02, 2014 6:18 am

we have in partially successful, we can create a URL using "GO::createExternalUrl('pts', 'ShowDialog', array('5410'));".

This creates a URL, that will attempt to access the ShowDialog function when the user access the URL.

To get it working, I needed to create a file called ShowDialog.js within the PTS module (our in house module). I also had to update scripts.txt to call that function.

Within the ShowDialog.js, I have the following code:

GO.pts.ShowDialog = function(config){
if(!config)
{
config = {};
}
window.location = '/modules/pts/index2.php?goto=' + config;
}

This works, but it then bypasses the GO menus etc. So for it to work properly, I need to know how to change a module within javascript. I have done it before in PHP by setting the startmodule variable. However, in this case, I have no idea how to do it.

How do we get all of Group Office to load when a users clicks on the URL and the URL loads Group Office with our module, not just our module? I guess there is some kind of "load Group Office" method we can call, but we have been unable to determine what.


Thanks.
johnniewalk
Posts: 2
Joined: Fri Jun 12, 2015 10:02 am
Location: India
Contact:

Re: How to "Calling functions with a URL"

Postby johnniewalk » Mon Jun 15, 2015 12:25 pm

Hope i think i will work
android apps development company | Windows apps development company
sadesh
Posts: 1
Joined: Fri Apr 15, 2016 6:22 am
Contact:

Re: How to "Calling functions with a URL"

Postby sadesh » Fri Apr 15, 2016 6:53 am

Ya, i think it might be work.
Mobile app development company new york | Mobile apps development company in new york
williamjohn
Posts: 1
Joined: Wed May 25, 2016 6:19 am
Contact:

Re: How to "Calling functions with a URL"

Postby williamjohn » Wed May 25, 2016 6:23 am

I too have same problem. But this doesn't work for me. Can any one share why?
mobile application development services in california | ios application development services california
jamesjohnson5551
Posts: 1
Joined: Mon May 30, 2016 6:42 am

Re: How to "Calling functions with a URL"

Postby jamesjohnson5551 » Mon May 30, 2016 6:43 am

This thread helped me a lot. Thank you so much for sharing.

Return to “Development Chats”

Who is online

Users browsing this forum: No registered users and 1 guest

cron