掲示板

Create URL for SO tasks and calendar events

8年前 に Jack Palm によって更新されました。

Create URL for SO tasks and calendar events

Junior Member 投稿: 28 参加年月日: 15/04/13 最新の投稿
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
8年前 に Alexey Kakunin によって更新されました。

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

Liferay Master 投稿: 621 参加年月日: 08/07/07 最新の投稿
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.
8年前 に Jack Palm によって更新されました。

RE: Create URL for SO tasks and calendar events

Junior Member 投稿: 28 参加年月日: 15/04/13 最新の投稿
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
8年前 に Alexey Kakunin によって更新されました。

RE: Create URL for SO tasks and calendar events

Liferay Master 投稿: 621 参加年月日: 08/07/07 最新の投稿
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).