Fórum

Create URL for SO tasks and calendar events

Jack Palm, modificado 8 Anos atrás.

Create URL for SO tasks and calendar events

Junior Member Postagens: 28 Data de Entrada: 13/04/15 Postagens Recentes
I have developed a portlet that shows all tasks for the current user. Problem is I do not know how to make links from my portlet directly to the tasks...

When I enter a task the "normal" way. The URL is: "/user/564534/so/tasks". The task is opened in some kind of modal box? And doesnt get a certain url...

So how do I create, with code, a URL to open a certain task?

Same goes for calendar events?

Thank you!
thumbnail
Alexey Kakunin, modificado 8 Anos atrás.

RE: Create URL for SO tasks and calendar events (Resposta)

Liferay Master Postagens: 621 Data de Entrada: 07/07/08 Postagens Recentes
Hi!

If you will check source of link. used in task portlet you will see there something like:


<a class="tasks-title normal" href="javascript:;" onclick="Liferay.Tasks.openTask('http://localhost/user/akakunin/so/tasks?p_p_id=1_WAR_tasksportlet&amp;p_p_lifecycle=0&amp;p_p_state=pop_up&amp;p_p_mode=view&amp;_1_WAR_tasksportlet_mvcPath=%2Ftasks%2Fview_task.jsp&amp;_1_WAR_tasksportlet_tasksEntryId=149107');" id="yui_patched_v3_11_0_1_1438434988269_1707">Do something!</a>


So, you can try to call "Liferay.Tasks.openTask" JS (but you will need to load JS file from tasks portlet -not sure how correctly do it).
Simple way - to use URL provided in "openTask" - with some minor modifications -

http://localhost/user/USER_ID/so/tasks?p_p_id=1_WAR_tasksportlet&p_p_lifecycle=0&p_p_mode=view&_1_WAR_tasksportlet_mvcPath=%2Ftasks%2Fview_task.jsp&_1_WAR_tasksportlet_tasksEntryId=TASK_ID

It will open Task (please note - since task form designed to be displayed in popup - in full window is may be now shown nicely).

Hope it will help.
Jack Palm, modificado 8 Anos atrás.

RE: Create URL for SO tasks and calendar events

Junior Member Postagens: 28 Data de Entrada: 13/04/15 Postagens Recentes
Thank you very much. Helped me alot emoticon

Tried to implement the javascript but didnt get it to work.. Tried to open the task in my own modal dialog but then it opened the menu and all as well. Don't have the time to dig deeper into the js but made it work for now with normal linking to the task.
thumbnail
Alexey Kakunin, modificado 8 Anos atrás.

RE: Create URL for SO tasks and calendar events

Liferay Master Postagens: 621 Data de Entrada: 07/07/08 Postagens Recentes
Hi!

If you like to display task in your modal window - add p_p_state=pop_up into parameters - it will display only portlet content (without menu, header, footer and other theme staff).