1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="here/main_template/macros/master">
6 <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7 <title>GRUF Macros</title>
8 <link href="../content/plinn_style.css" rel="stylesheet" media="screen" />
9 <link href="../patch_skins/zpt_stylesheet.css" rel="stylesheet" media="screen">
12 <body tal:omit-tag="" metal:fill-slot="main" i18n:domain="plinn">
15 <table tal:define="treeDict here/makeGrufTree ;
18 rootNode python:rows.pop(0) ;
20 gtool here/portal_groups ;
21 group_prefix here/acl_users/getGroupPrefix ;
22 prefixLength python:len(group_prefix);
23 u0 request/URL0" metal:define-macro="gruf_tree">
25 <th colspan="3" tal:attributes="colspan height" nowrap="nowrap" i18n:translate="">Group Tree</th>
27 <tr tal:repeat="row rows">
28 <td colspan="1" tal:attributes="colspan indent" tal:define="indent python: row.depth - 1" tal:condition="indent">
31 <td tal:define="state row/state ; rlink row/branch ; msg python:state > 0 and 'collapse' or 'expand'" width="16">
32 <a href="#" tal:attributes="name row/id ; href string:$u0${rlink/link}; title msg" tal:condition="state" i18n:attributes="title"><img src="pl.gif" alt="" tal:attributes="src python:state > 0 and '/p_/mi' or '/p_/pl' ; alt msg" border="0" i18n:attributes="alt" /></a><span tal:condition="not:state" tal:omit-tag=""> </span>
34 <td colspan="1" tal:attributes="colspan python: height - row.depth" tal:define="object row/object ; group python:gtool.getGroupById(object.id)" nowrap="nowrap">
35 <a href="." tal:attributes="href string:${template_url}?group=${object/id}"><img src="GRUFGroups.gif" alt="Group id" tal:attributes="src here/GRUFGroups.gif/absolute_url ; alt object/id" border="0" /><span tal:replace="python:group.title or group.id[prefixLength:]">group</span></a>
39 <pre>change_group_data</pre>
41 <form action="change_group" method="post" tal:attributes="action string:${portal_url}/change_group" metal:define-macro="change_group_data">
42 <table class="TwoColumnForm" cellspacing="0" tal:define="wGroup python:here.portal_groups.getGroupById(requestedGroup) ;
43 sharedFolderUrl python:here.portal_groups.getGroupareaURL(id = requestedGroup)">
45 <th i18n:translate="">Identifier</th>
47 <span tal:replace="requestedGroup">Group Name</span><input type="hidden" name="groupId" value="group" tal:attributes="value requestedGroup" />
51 <th i18n:translate="">Title</th>
53 <input type="text" name="title" size="51" tal:attributes="value wGroup/title" />
57 <th i18n:translate="">Description</th>
59 <textarea id="textareaName" name="description" rows="3" cols="38" tal:content="wGroup/description"></textarea>
62 <tr tal:define="creationFlag here/portal_groups/getGroupWorkspacesCreationFlag" tal:condition="creationFlag | sharedFolderUrl">
63 <th i18n:translate="">Shared folder</th>
65 <div tal:condition="sharedFolderUrl">
66 <a href="." tal:attributes="href python:sharedFolderUrl+'/folder_contents'" i18n:translate="">Open shared folder...</a>
68 <div tal:condition="not:sharedFolderUrl">
69 <label><input type="checkbox" name="createSharedFolder" /><span i18n:translate="" tal:omit-tag="">Create</span></label>
77 <input type="submit" value="Validate" i18n:attributes="value" />
82 <pre>assign_roles</pre>
83 <div tal:condition="python:mtool.checkPermission('Manage portal', portal_object)" tal:omit-tag="" metal:define-macro="assign_roles">
84 <table class="assign_global_roles" cellspacing="0" tal:define="groupId requestedGroup ;
85 group python:here.portal_groups.getGroupById(groupId);
86 explicitRoles python:filter(lambda x: x not in ('Authenticated', 'Shared'), group.getUserRoles());
87 implicitRoles python:[ role for role in group.getRoles() if role not in explicitRoles + ['Authenticated', 'Shared'] ];
88 assignabledRoles python:[ role for role in here.portal_membership.getPortalRoles() if role not in explicitRoles + ['Authenticated', 'Shared'] ]">
90 <th i18n:translate="">Implicit roles</th>
92 <ul tal:condition="implicitRoles">
93 <li tal:content="role" tal:repeat="role implicitRoles" i18n:translate="">role</li>
98 <th i18n:translate="">Explicit roles</th>
100 <form action="." method="post" tal:attributes="action here/portal_url">
101 <div tal:condition="explicitRoles" tal:omit-tag="">
102 <div tal:repeat="role explicitRoles">
103 <input type="checkbox" name="roles:list" value="role" tal:attributes="value role" /><span tal:content="role" tal:omit-tag="" i18n:translate="">role</span>
105 <input type="submit" name="remove_group_roles:method" value="Remove" i18n:attributes="value" /><br />
108 <input type="hidden" name="groupId" value="group" tal:attributes="value groupId"/>
109 <div tal:condition="assignabledRoles">
110 <select name="role" size="1">
111 <option tal:attributes="value role" tal:content="role" tal:repeat="role assignabledRoles" i18n:translate="">role</option>
112 </select><input type="submit" name="append_group_role:method" value="Append" i18n:attributes="value" />
120 <pre>assign_members</pre>
122 <form action="." method="post" tal:attributes="action portal_url" metal:define-macro="assign_members">
123 <table class="twins_list" tal:define="
124 uNamesOfGroup python:here.portal_groups.getUserNamesOfGroup(requestedGroup) ;
125 memberMetadata python:mtool.getMembersMetadata(uNamesOfGroup);
126 insideList memberMetadata/memberList ;
127 outsideList memberMetadata/complementList">
129 <th i18n:translate="">Outside group</th>
131 <th i18n:translate="">Inside group</th>
135 <select name="append_members:list" size="20" multiple="multiple">
136 <option value="one" tal:attributes="value member/id" tal:content="member/fullname" tal:repeat="member outsideList">NAME Surname or login</option>
139 <td class="twins_list">
140 <input type="submit" name="append_users_in_group:method" value=">>>" />
142 <input type="submit" name="remove_users_in_group:method" value="<<<" tal:condition="insideList" />
145 <select name="remove_members:list" size="20" multiple="multiple" tal:condition="insideList">
146 <option value="one" tal:attributes="value member/id" tal:content="member/fullname" tal:repeat="member insideList">NAME Surname or login</option>
148 <div class="info_message" tal:condition="not:insideList" i18n:translate="">None</div>
152 <input type="hidden" name="groupId" value="group" tal:attributes="value requestedGroup" />
154 <pre>assign_groups</pre>
156 <form action="." method="post" tal:attributes="action portal_url" metal:define-macro="assign_groups">
157 <table class="twins_list"
159 gtool here/portal_groups ;
160 groupsOfGroup python:gtool.getGroupsOfGroup(requestedGroup) ;
161 insideList python:gtool.getGroups(groupsOfGroup) ;
162 outsideList python:gtool.getOtherGroups(groupsOfGroup)">
164 <th i18n:translate="">Outside group</th>
166 <th i18n:translate="">Inside group</th>
170 <select name="append_groups:list" size="6" multiple="multiple">
171 <option tal:attributes="value group/id" tal:content="python:group.title or group.id[prefixLength:]" tal:repeat="group outsideList">group1</option>
175 <input type="submit" name="append_groups_in_group:method" value=">>>"/><br/>
177 <input type="submit" name="remove_groups_in_group:method" value="<<<" tal:condition="insideList" />
180 <select name="remove_groups:list" size="6" multiple="multiple" tal:condition="insideList">
181 <option tal:attributes="value group/id" tal:content="python:group.title or group.id[prefixLength:]" tal:repeat="group insideList">group2</option>
183 <div class="info_message" tal:condition="not:insideList" i18n:translate="">
189 <input type="hidden" name="groupId" value="groupId" tal:attributes="value requestedGroup" />
192 <pre>all_members</pre>
194 <form action="." method="post" tal:attributes="action portal_url" metal:define-macro="all_members">
195 <table class="TwoColumnForm" cellspacing="0">
197 <th i18n:translate="">All members</th>
201 <select name="memberIds:list" size="20" multiple="multiple"
202 tal:attributes="ondblclick string:javascript:openMemberPopup(this.value);;"
203 tal:define="membersMetadata python:mtool.getMembersMetadata([])['complementList']">
204 <option value="userid" tal:attributes="value member/id" tal:content="member/fullname" tal:repeat="member membersMetadata">NAME surname</option>
210 <input type="submit" name="member_properties_form:method" value="Edit" i18n:attributes="value" /><br/>
211 <input type="submit" name="delete_members:method" value="Remove selected" i18n:attributes="value" />
216 <pre>all_groups</pre>
218 <form action="." method="post" tal:attributes="action portal_url" metal:define-macro="all_groups">
219 <table class="TwoColumnForm" cellspacing="0"
220 tal:define="gtool here/portal_groups ;
221 group_prefix here/acl_users/getGroupPrefix ;
222 prefixLength python:len(group_prefix)">
224 <th i18n:translate="">All groups</th>
228 <select name="groups:list" size="20" multiple="multiple">
229 <option value="group1" tal:repeat="group python:gtool.getOtherGroups([])" tal:attributes="value group/id" tal:content="python:group.title or group.id[prefixLength:]" >Group 1</option>
235 <input type="submit" name="remove_groups:method" value="Remove selected" i18n:attributes="value"
236 tal:define="DeleteGroups python:modules['Products.Plinn.permissions'].DeleteGroups"
237 tal:attributes="disabled python:not mtool.checkPermission(DeleteGroups, portal_object)"/>
242 <pre>add_member</pre>
244 <form action="." method="post" tal:attributes="action portal_url" metal:define-macro="add_member">
245 <table class="TwoColumnForm" cellspacing="0">
247 <th colspan="2" nowrap="nowrap" i18n:translate="">Add new member</th>
250 <th nowrap="nowrap" i18n:translate="">Login</th>
252 <input type="text" name="username" size="40"/>
256 <th nowrap="nowrap" i18n:translate="">Name</th>
258 <input type="text" name="name" size="40"/>
262 <th nowrap="nowrap" i18n:translate="">Given Name</th>
264 <input type="text" name="given_name" size="40"/>
268 <th nowrap="nowrap" i18n:translate="">Password</th>
270 <input type="password" name="password" size="40"/>
274 <th nowrap="nowrap" i18n:translate="">Confirm</th>
276 <input type="password" name="confirm" size="40"/>
280 <th nowrap="nowrap" i18n:translate="">Email address</th>
282 <input type="text" name="email" size="40"/>
286 <th nowrap="nowrap" i18n:translate=""></th>
288 <input type="submit" name="add_member:method" value="Add" i18n:attributes="value" />
295 <form action="." method="post" tal:attributes="action portal_url" metal:define-macro="add_group">
296 <table class="TwoColumnForm" cellspacing="0">
298 <th colspan="2" i18n:translate="">Add new group</th>
301 <th i18n:translate="">Id</th>
303 <input type="text" name="groupname" size="45"/>
307 <th i18n:translate="">Title</th>
309 <input type="text" name="title" size="45"/>
313 <th i18n:translate="">Description</th>
315 <textarea name="description" rows="4" cols="34"></textarea>
318 <tr tal:condition="here/portal_groups/getGroupWorkspacesCreationFlag|nothing">
319 <th i18n:translate="">Shared folder</th>
321 <label><input type="checkbox" name="createArea" /><span i18n:translate="" tal:omit-tag="">Create</span></label>
327 <input type="submit" name="add_group:method" value="Add" i18n:attributes="value"
328 tal:define="AddGroups python:modules['Products.Plinn.permissions'].AddGroups"
329 tal:attributes="disabled python:not mtool.checkPermission(AddGroups, portal_object)"/>
334 <pre>gruf_settings</pre>
336 <table class="config" metal:define-macro="gruf_settings">
338 <td tal:define="ai_dicts here/group_actions;
339 useQueryString python:0">
340 <div metal:use-macro="here/widgets/macros/tabs">
347 <div metal:define-slot="form">
354 <pre>member_properties_form</pre>
355 <div metal:define-macro="member_properties_form"
356 tal:define="selectedMember python:here.portal_membership.getMemberById(request.form['member_id']);
357 gtool here/portal_groups ;
358 group_prefix here/acl_users/getGroupPrefix ;
359 prefixLength python:len(group_prefix) ;
360 implExpl python:gtool.getExplAndImplGroupsByUserId(selectedMember.getId());
361 mq nocall:modules/ZTUtils/make_query">
362 <form action="." method="post" tal:attributes="action portal_url">
363 <table class="TwoColumnForm" cellspacing="0">
365 <th nowrap="nowrap" i18n:translate="">Login</th>
367 <span tal:replace="selectedMember/getId"></span><input type="hidden" name="username" tal:attributes="value selectedMember/getId" />
370 <tr tal:condition="implExpl/explicit|implExpl/implicit">
371 <th nowrap="nowrap" i18n:translate="">Groups</th>
373 <div tal:condition="implExpl/explicit"><span i18n:translate="" tal:omit-tag="">explicitly:</span> <span tal:repeat="group implExpl/explicit"><span tal:replace="python:group.title or group.id[prefixLength:]">group</span><span tal:condition="not:repeat/group/end">, </span></span></div>
374 <div tal:condition="implExpl/implicit"><span i18n:translate="" tal:omit-tag="">implicitly:</span> <span tal:repeat="group implExpl/implicit"><span tal:replace="python:group.title or group.id[prefixLength:]">group</span><span tal:condition="not:repeat/group/end">, </span></span></div>
378 <th nowrap="nowrap" i18n:translate="">Name</th>
380 <input type="text" name="name" size="40" tal:attributes="value python:selectedMember.getProperty('name')" />
384 <th nowrap="nowrap" i18n:translate="">Given Name</th>
386 <input type="text" name="given_name" size="40" tal:attributes="value python:selectedMember.getProperty('given_name')" />
390 <th nowrap="nowrap" i18n:translate="">Password</th>
392 <input type="password" name="password" size="40" />
396 <th nowrap="nowrap" i18n:translate="">Confirm</th>
398 <input type="password" name="confirm" size="40"/>
402 <th nowrap="nowrap" i18n:translate="">Email address</th>
404 <input type="text" name="email" size="40" tal:attributes="value python:selectedMember.getProperty('email')" />
408 <th nowrap="nowrap" i18n:translate=""></th>
410 <input type="submit" name="edit_member_settings:method" value="Validate" i18n:attributes="value" />
415 <h2 i18n:translate="">Tree view by this member</h2>
416 <a href="." onclick="openMemberTreeView(event)" tal:attributes="href python:'%s/portal_members?%s' % ( portal_url, mq(member_id=selectedMember.getId(), macroName='member_tree_view') )" i18n:translate="">Click here to see the tree viewed by this member >></a>
419 <pre>member_tree_view</pre>
420 <div metal:define-macro="member_tree_view"
421 class="boxes_container"
422 tal:define="selectedMember python:here.portal_membership.getMemberById(request.member_id);
423 treeRoot portal_object;
424 treeDict python:here.make_nav_tree(rootObject=treeRoot, filtered_meta_types=['Huge Plinn Folder', 'Portfolio', 'Topic'], userid=request.member_id );
428 rootNode python:rows.pop(0);
429 box_id string:tree_box_${rootNode/object/id}_${request/member_id};
430 mq nocall:modules/ZTUtils/make_query"
432 tal:on-error="string:Path Error"
434 <table class="tree_box" cellspacing="0">
439 <td width="16" tal:condition="nothing">
440 <a title="collapse all" href="." tal:attributes="href string:?collapse_all=${rootNode/object/id}" i18n:attributes="title"><img src="../skins/collapse_all.gif" alt="collapse all" height="16" width="16" border="0" tal:attributes="src here/collapse_all.gif/absolute_url" i18n:attributes="alt" /></a>
442 <th tal:content="rootNode/object/title_or_id" style="border : none">Root Node</th>
450 <table cellspacing="0">
451 <tbody tal:attributes="id box_id">
452 <tr tal:repeat="row rows">
453 <td tal:define="indent python: row.depth - 1" tal:attributes="colspan indent" tal:condition="indent"> </td>
454 <td tal:define="state row/state ; rlink row/branch ; msg python:state > 0 and 'collapse' or 'expand'" width="16"
455 ><a href="#" tal:condition="state" tal:attributes="name row/id ; href python:'%s/portal_members?%s' % (portal_url, mq(member_id=selectedMember.getId(), macroName='member_tree_view') + '&' + rlink['link'][1:]) ; title msg" i18n:attributes="title"
456 ><img src="/p_/pl" alt="" tal:attributes="src python:state > 0 and '/p_/mi' or '/p_/pl' ; alt msg" i18n:attributes="alt" height="16" width="16" border="0" /></a>
457 <a href="#" tal:attributes="name row/id ; href rlink/link" tal:condition="not:state"> </a>
459 <td colspan="1" tal:define="obj nocall: row/object"
460 tal:attributes="colspan python: height - row.depth"
461 width="99%" tal:on-error="string:erreur"
462 ><img src="." alt="" tal:define="icon python:context.restrictedTraverse(obj.getIcon())" tal:attributes="src icon/absolute_url; height icon/height; width icon/width; alt obj/getPortalTypeName" i18n:attributes="alt" border="0" />
463 <span tal:replace="obj/title_or_id">Title</span></td>
471 <a href="." tal:attributes="href python:'%s/portal_members?%s' % ( portal_url, mq(member_id=selectedMember.getId(), macroName='member_properties_form') )" i18n:translate=""><< Back to member properties</a>