Skip to content

Commit

Permalink
redesign mytasks/favorites portlet
Browse files Browse the repository at this point in the history
Issue #465
  • Loading branch information
rsoika committed Nov 6, 2021
1 parent f493f69 commit fad65ff
Show file tree
Hide file tree
Showing 5 changed files with 257 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,13 @@ IMIXS.org.imixs.workflow.office = (function() {
}
},

setCookie = function(cname, cvalue, exdays=999) {
var d = new Date();
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
var expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
},

// redirect to a given workitem uid
openWorkitemByID = function(uid) {
document.location.href=imixsOfficeMain.contextPath+"/pages/workitems/workitem.xhtml?id="+uid;
Expand All @@ -266,7 +273,8 @@ IMIXS.org.imixs.workflow.office = (function() {
layoutAjaxEvent : layoutAjaxEvent,
initLayout : initLayout,
openWorkitemByID : openWorkitemByID,
layoutOfficeEditor : layoutOfficeEditor
layoutOfficeEditor : layoutOfficeEditor,
setCookie : setCookie
};

}());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@
rendered="#{!userController.isFavorite(workitem.item['$uniqueid'])}"
actionListener="#{userController.addFavorite(workitem.item['$uniqueid'])}">
<span class="typcn typcn-star-outline"></span>
<f:ajax render="marked_id :notes_form:portlet_favorites:portlet_worklist"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, 'notes_form:portlet_favorites:portlet_worklist') }" />
<f:ajax render="marked_id :notes_form:portlet_mytasks:portlet_worklist"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, 'notes_form:portlet_mytasks:portlet_worklist') }"
/>

</h:commandLink>
<h:commandLink title="#{message['worklist.favorite.help']}"
rendered="#{userController.isFavorite(workitem.item['$uniqueid'])}"
actionListener="#{userController.removeFavorite(workitem.item['$uniqueid'])}">
<span class="typcn typcn-star imixs-info"></span>
<f:ajax render="marked_id :notes_form:portlet_favorites:portlet_worklist"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, 'notes_form:portlet_favorites:portlet_worklist') }" />
<f:ajax render="marked_id :notes_form:portlet_mytasks:portlet_worklist"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, 'notes_form:portlet_mytasks:portlet_worklist') }" />
</h:commandLink>
</h:panelGroup>

Expand Down
24 changes: 6 additions & 18 deletions imixs-office-workflow-app/src/main/webapp/pages/notes.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<div class="row imixs-notes">

<!-- My Tasks -->
<!-- My Tasklist -->
<f:subview id="portlet_owner">
<ui:include src="/pages/portlet_worklist.xhtml">
<ui:param name="view" value="#{portletWorklistTasks}" />
Expand All @@ -53,29 +53,17 @@



<!-- My Favorites -->
<f:subview id="portlet_favorites">
<ui:include src="/pages/portlet_worklist.xhtml">
<!-- My Tasks -->
<f:subview id="portlet_mytasks">
<ui:include src="/pages/portlet_mytasks.xhtml">
<ui:param name="view" value="#{portletWorklistFavorites}" />
<ui:param name="title" value="#{message['worklist.favorite']}" />
<ui:param name="portletclassname" value="imixs-portlet-favorites" />
</ui:include>
</f:subview>

<!-- Start Process -->
<ui:include src="/pages/portlet_startprocess.xhtml" />


<!-- My Requests -->
<f:subview id="portlet_creator">
<ui:include src="/pages/portlet_worklist.xhtml">
<ui:param name="view" value="#{portletWorklistCreator}" />
<ui:param name="title" value="#{message['worklist.creator']}" />
<ui:param name="viewType" value="worklist.creator" />
<ui:param name="portletclassname" value="imixs-portlet-worklist" />
</ui:include>
</f:subview>

<!-- Start Process -->
<ui:include src="/pages/portlet_startprocess.xhtml" />

<!-- Administration -->
<c:choose>
Expand Down
114 changes: 114 additions & 0 deletions imixs-office-workflow-app/src/main/webapp/pages/portlet_mytasks.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
xmlns:marty="http://xmlns.jcp.org/jsf/composite/marty"
xmlns:i="http://xmlns.jcp.org/jsf/composite/imixs">


<h:panelGroup id="portlet_worklist" layout="block"
class="imixs-portlet #{portletclassname}">

<!-- pre-compute: #{viewHandler.onLoad(view)} -->

<h:panelGroup id="portlet_worklist_header" layout="block"
class="imixs-header">

<div align="right" style="float: right;margin-bottom:5px;">
<h:commandLink actionListener="#{view.reset()}"
styleClass="imixs-portlet-refresh" title="#{message.refresh}"><span class="typcn typcn-arrow-sync"></span>
<f:ajax render="portlet_worklist"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, '#{component.parent.parent.clientId}') }" />
</h:commandLink>
<h:commandLink actionListener="#{viewHandler.back(view)}"
styleClass="imixs-portlet-prev" title="#{message.prev}"
disabled="#{(view.pageIndex == 0)}"><span
class="typcn #{(view.pageIndex == 0)?'typcn-media-rewind-outline':'typcn-media-rewind'}"></span>
<f:ajax render="portlet_worklist"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, '#{component.parent.parent.clientId}') }" />
</h:commandLink>
<h:commandLink actionListener="#{viewHandler.forward(view)}"
styleClass="imixs-portlet-next" title="#{message.next}"
disabled="#{(view.endOfList)}"><span
class="typcn #{(view.endOfList)?'typcn-media-fast-forward-outline':'typcn-media-fast-forward'}"></span>
<f:ajax render="portlet_worklist"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, '#{component.parent.parent.clientId}') }" />
</h:commandLink>
</div>

<!-- Title -->
<div style="">
<div class="active" style="float:left;margin-right:15px">
<!-- board -->
<ui:fragment rendered="#{! empty viewType}" >
<h:link outcome="/pages/notes_board.xhtml" styleClass="action-search" >
<span class="typcn typcn-th-large-outline"
style="margin-right: 8px;"></span><h:outputText styleClass="portlet-title" value="#{title}" />
<f:param name="viewType" value="#{viewType}" />
</h:link>
</ui:fragment>
<ui:fragment rendered="#{empty viewType}" >
<h:outputText styleClass="portlet-title" value="#{title}" />
</ui:fragment>

</div>


<div style="float:left;padding-top:10px;color:#428bca;font-size:0.9rem;">
<!-- My Tasklist Selector -->
<h:selectOneRadio value="#{portletWorklistFavorites.mode}"
style=" border:none;" onchange="imixsOfficeMain.setCookie('imixs.office.document.mytasks.mode',this.value,14);">
<f:selectItem itemLabel="#{message['worklist.favorite']}" itemValue="1" />
<f:selectItem itemLabel="#{message['worklist.all']}" itemValue="2" />
<f:ajax render="portlet_worklist" listener="#{portletWorklistFavorites.reset}"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, '#{component.parent.parent.clientId}') }" />

</h:selectOneRadio>

</div>

</div>

<div style="clear:both;" />



</h:panelGroup>

<div class="imixs-body">

<!-- **** Workitems ***** -->
<ui:repeat var="workitem" value="#{viewHandler.getData(view)}">
<ui:include src="portlet_worklist_viewentry.xhtml">
<ui:param name="workitem" value="#{workitem}" />
</ui:include>
</ui:repeat>
<h3>
<h:outputText rendered="#{empty viewHandler.getData(view)}"
value="#{message.empty_worklist}" />
</h3>
<!-- navigation -->
<h:panelGroup layout="block" id="portlet_worklist_nav"
class="imixs-footer">
<h:commandLink actionListener="#{viewHandler.back(view)}"
title="#{message.prev}" disabled="#{(view.pageIndex == 0)}"><span
class="typcn #{(view.pageIndex == 0)?'typcn-media-rewind-outline':'typcn-media-rewind'}"></span>
<f:ajax render="portlet_worklist"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, '#{component.parent.parent.clientId}') }" />
</h:commandLink>
<h:commandLink actionListener="#{viewHandler.forward(view)}"
title="#{message.next}" disabled="#{(view.endOfList)}"><span
class="typcn #{(view.endOfList)?'typcn-media-fast-forward-outline':'typcn-media-fast-forward'}"></span>
<f:ajax render="portlet_worklist"
onevent="function(data) { imixsOfficeMain.layoutAjaxEvent(data, '#{component.parent.parent.clientId}') }" />
</h:commandLink>
</h:panelGroup>
<div style="clear: right;" />
</div>

</h:panelGroup>

</ui:composition>

Loading

0 comments on commit fad65ff

Please sign in to comment.