Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First part needed in SimpleScreens to enable Teams in the MarbleERP menu. #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions screen/SimpleScreens/Team.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This software is in the public domain under CC0 1.0 Universal plus a
Grant of Patent License.

To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to the
public domain worldwide. This software is distributed without any
warranty.

You should have received a copy of the CC0 Public Domain Dedication
along with this software (see the LICENSE.md file). If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
-->
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-3.xsd"
default-menu-title="Teams" default-menu-index="5" menu-image="/ssstatic/images/Teams.png">

<subscreens default-item="FindTeam"/>

<widgets>
<subscreens-panel id="task-panel" type="tab"/>
</widgets>
</screen>
40 changes: 40 additions & 0 deletions screen/SimpleScreens/Team/EditTeam.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This software is in the public domain under CC0 1.0 Universal plus a
Grant of Patent License.

To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to the
public domain worldwide. This software is distributed without any
warranty.

You should have received a copy of the CC0 Public Domain Dedication
along with this software (see the LICENSE.md file). If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
-->
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-3.xsd"
default-menu-title="Team" default-menu-index="1">

<parameter name="partyId" required="true"/>

<transition name="updateTeam">
<service-call name="mantle.party.PartyServices.update#PartyDetail" in-map="context"/>
<default-response url="."/>
</transition>

<actions>
<entity-find-one entity-name="mantle.party.PartyDetail" value-field="fieldValues"/>
</actions>
<widgets>
<form-single name="EditTeam" transition="updateTeam">
<field name="partyId"><default-field><hidden/></default-field></field>
<field name="organizationName"><default-field><text-line size="60"/></default-field></field>

<field name="disabled"><default-field><drop-down no-current-selected-key="N" current="selected">
<option key="N"/><option key="Y"/></drop-down></default-field></field>

<field name="submitButton"><default-field title="Update"><submit/></default-field></field>
</form-single>
</widgets>
</screen>
101 changes: 101 additions & 0 deletions screen/SimpleScreens/Team/EditUsers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This software is in the public domain under CC0 1.0 Universal plus a
Grant of Patent License.

To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to the
public domain worldwide. This software is distributed without any
warranty.

You should have received a copy of the CC0 Public Domain Dedication
along with this software (see the LICENSE.md file). If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
-->
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-3.xsd"
default-menu-title="Users" default-menu-index="3">

<parameter name="partyId" required="true"/>

<transition name="addRelationship"><service-call name="create#mantle.party.PartyRelationship" in-map="context"/>
<default-response url="."/></transition>
<transition name="updateRelationship"><service-call name="update#mantle.party.PartyRelationship" in-map="context"/>
<default-response url="."/></transition>
<transition name="editUser"><default-response url="../../User/EditUser"/></transition>

<transition name="getPersonList">
<actions>
<entity-find entity-name="PersonAndUserAccount" list="pauList" limit="20">
<econditions combine="or">
<econdition field-name="firstName" operator="like" value="%${term}%" ignore-case="true"/>
<econdition field-name="lastName" operator="like" value="%${term}%" ignore-case="true"/>
<econdition field-name="username" operator="like" value="%${term}%" ignore-case="true"/>
</econditions>
<order-by field-name="^firstName"/><order-by field-name="^lastName"/><order-by field-name="^username"/>
</entity-find>
<script>
def outList = []
for (def pau in pauList)
outList.add([value:pau.partyId, label:"${pau.firstName} ${pau.lastName} (${pau.username?:'No username'})".toString()])
ec.web.sendJsonResponse(outList)
</script>
</actions>
<default-response type="none"/>
</transition>

<actions>
<set field="teamPartyId" from="partyId"/><!-- set this for the user rel update form since it gets a partyId in each Map in the list -->
<entity-find entity-name="PartyFromAndRelationship" list="pfarList">
<econdition field-name="toPartyId" from="partyId"/></entity-find>
</actions>
<widgets>
<container-dialog id="AddUserAssignDialog" button-text="Add User Assignment">
<form-single name="AddUserRelationshipForm" transition="addRelationship">
<field name="partyId"><default-field><hidden/></default-field></field>
<field name="toPartyId" from="partyId"><default-field><hidden/></default-field></field>
<field name="toRoleTypeId"><default-field><hidden default-value="OrgTeam"/></default-field></field>
<field name="relationshipTypeEnumId"><default-field><hidden default-value="PrtMember"/></default-field></field>

<field name="fromPartyId"><default-field title="Person">
<drop-down><dynamic-options transition="getPersonList" server-search="true" min-length="2"/></drop-down>
</default-field></field>
<field name="fromRoleTypeId"><default-field title="Role">
<drop-down><entity-options key="${roleTypeId}" text="${description}">
<entity-find entity-name="mantle.party.RoleGroupMemberAndType" cache="true">
<econdition field-name="roleGroupEnumId" value="RgpTask"/>
<order-by field-name="description"/></entity-find>
</entity-options></drop-down>
</default-field></field>

<field name="fromDate" from="ec.user.nowTimestamp"><default-field><date-time/></default-field></field>
<field name="thruDate"><default-field><date-time/></default-field></field>
<field name="submitButton"><default-field title="Add Assignment"><submit/></default-field></field>
</form-single>
</container-dialog>

<form-list name="UpdateUserRelForm" list="pfarList" transition="updateRelationship">
<field name="partyId" from="teamPartyId"><default-field><hidden/></default-field></field>
<field name="partyRelationshipId"><default-field><hidden/></default-field></field>
<field name="firstName"><header-field title="First##Name" show-order-by="case-insensitive"/><default-field>
<link url="editUser" text="${firstName}" link-type="anchor">
<parameter name="partyId" from="fromPartyId"/></link>
</default-field></field>
<field name="lastName"><header-field title="Last##Name" show-order-by="case-insensitive"/><default-field>
<link url="editUser" text="${lastName}" link-type="anchor">
<parameter name="partyId" from="fromPartyId"/></link>
</default-field></field>
<field name="fromRoleTypeId"><header-field title="Role" show-order-by="true"/><default-field>
<drop-down><entity-options key="${roleTypeId}" text="${description}">
<entity-find entity-name="mantle.party.RoleGroupMemberAndType" cache="true">
<econdition field-name="roleGroupEnumId" value="RgpTask"/>
<order-by field-name="description"/></entity-find>
</entity-options></drop-down>
<!-- <display-entity entity-name="RoleType" text="${description}"/> -->
</default-field></field>
<field name="fromDate"><header-field show-order-by="true"/><default-field><display/></default-field></field>
<field name="thruDate"><header-field show-order-by="true"/><default-field><date-time/></default-field></field>
<field name="submitButton"><default-field title="Update"><submit/></default-field></field>
</form-list>
</widgets>
</screen>
64 changes: 64 additions & 0 deletions screen/SimpleScreens/Team/FindTeam.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This software is in the public domain under CC0 1.0 Universal plus a
Grant of Patent License.

To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to the
public domain worldwide. This software is distributed without any
warranty.

You should have received a copy of the CC0 Public Domain Dedication
along with this software (see the LICENSE.md file). If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
-->
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-3.xsd"
default-menu-include="false">

<!-- TODO: add TeamSummary (like dashboard... reuse dashboard forms?), Projects, Tasks, Requests -->

<transition name="findTeam"><default-response url="."/></transition>
<transition name="createTeam">
<service-call name="mantle.party.PartyServices.create#Organization" in-map="context"/>
<default-response url="."/>
</transition>
<transition name="editTeam"><default-response url="../EditTeam"/></transition>

<pre-actions>
<set field="html_title" value="Find Team"/>
</pre-actions>

<actions>
<entity-find entity-name="mantle.party.PartyDetailAndRole" list="teamList">
<search-form-inputs default-order-by="organizationName,firstName,lastName"/>
<econdition field-name="roleTypeId" value="OrgTeam"/>
</entity-find>
</actions>
<widgets>
<container>
<container-dialog id="AddTeamDialog" button-text="Add Team">
<form-single name="CreateTeam" transition="createTeam">
<field name="roleTypeId"><default-field><hidden default-value="OrgTeam"/></default-field></field>
<field name="organizationName"><default-field title="Name"><text-line/></default-field></field>
<field name="submitButton"><default-field title="Create Team"><submit/></default-field></field>
</form-single>
</container-dialog>
</container>

<form-list name="TeamList" list="teamList">
<field name="organizationName">
<header-field show-order-by="case-insensitive" title="Name"><text-find/></header-field>
<default-field><link url="editTeam" text="${organizationName}" link-type="anchor"/></default-field>
</field>
<field name="disabled">
<header-field title="Disabled?" show-order-by="case-insensitive"/>
<default-field><display text="${disabled?:'N'}"/></default-field>
</field>
<field name="searchButton">
<header-field title="Find"><submit/></header-field>
<default-field><display text=""/></default-field>
</field>
</form-list>
</widgets>
</screen>
Binary file added screen/ssstatic/images/Teams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.