<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
- <COPYRIGHT>
- Copyright 2003 Gerd Stolpmann
-
- <GPL>
- This file is part of WTimer.
-
- WTimer is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- WTimer is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with WDialog; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- </>
-->
<!-- $Id: admin_access.ui 10 2004-01-28 17:26:48Z gerd $
- ======================================================================
-
-->
<!-- This file defines the dialog "admin-access". It is called "access" dialog
- because of historic reasons.
-->
<ui:dialog name="admin-access" start-page="access-list">
<ui:variable name="session" type="dialog"/>
<!-- The session pseudo dialog, see session.ui -->
<ui:variable name="scroll_position"/>
<!-- See explanations in definitions.ui, basic-grid -->
<ui:enumeration name="bool">
<ui:enum internal="no"/>
<ui:enum internal="yes"/>
</ui:enumeration>
<ui:variable name="modified">
<!-- Is there any unsaved modification of the data? yes/no/load -->
<ui:string-value>load</ui:string-value>
</ui:variable>
<ui:variable name="checksum">
<!-- The checksum of the contents as saved into the database. -->
</ui:variable>
<ui:variable name="inst-del" associative="yes" type="bool">
<!-- The "Del?" checkboxes for every sheet -->
<!--&admin-access-inst-del;--> <!-- test data -->
</ui:variable>
<ui:variable name="inst-name" associative="yes">
<!-- The name for every sheet -->
<!--&admin-access-inst-name;--> <!-- test data -->
</ui:variable>
<ui:variable name="inst-descr" associative="yes">
<!-- The description for every sheet -->
<!--&admin-access-inst-descr;--> <!-- test data -->
</ui:variable>
<ui:variable name="inst-edit" associative="yes">
<!-- Whether the row can be edited: yes/no/new -->
<!--&admin-access-inst-edit;--> <!-- test data -->
</ui:variable>
<ui:variable name="acl-edit" type="dynamic-enumerator"/>
<!-- This is used for the "Edit?" radio. The internal values of the enum
- have the format:
- "r-<ID>", "w-<ID>", or "o-<ID>", if the time sheet <ID> is selected
- for the read, write, and ownership privilege, respectively.
-->
<ui:variable name="acl-users" type="dynamic-enumerator">
<!-- The list of all users -->
<!--&admin-access-acl-users;--> <!-- test data -->
</ui:variable>
<ui:variable name="acl-read" associative="yes" type="dynamic-enumerator">
<!-- For every sheet, this variable enumerates the users with
- read privilege
-->
<!--&admin-access-acl-read;--> <!-- test data -->
</ui:variable>
<ui:variable name="acl-write" associative="yes" type="dynamic-enumerator">
<!-- For every sheet, this variable enumerates the users with
- write privilege
-->
<!--&admin-access-acl-write;--> <!-- test data -->
</ui:variable>
<ui:variable name="acl-owner" associative="yes" type="dynamic-enumerator">
<!-- For every sheet, this variable enumerates the users with
- ownership privilege
-->
<!--&admin-access-acl-owner;--> <!-- test data -->
</ui:variable>
<ui:enumeration name="message">
<ui:enum internal="saved"
external="The list has been saved into the database."/>
<ui:enum internal="error-double-names"
external="One of the sheet names is already used."/>
<ui:enum internal="error-nothing-selected"
external="Please select a row before editing it!"/>
<ui:enum internal="error-bad-ownership"
external="Primary sheets must (at least) be owned by the user with the same name!"/>
<ui:enum internal="error-missing-ownership"
external="Every sheet must have an owner!"/>
</ui:enumeration>
<ui:variable name="message" type="message">
<!-- Messages to display -->
<!--&admin-access-message;--> <!-- test data -->
</ui:variable>
<ui:variable name="deferred-dialog" type="dialog"/>
<!-- While the page "unsaved" is displayed, this variable stores the
- dialog the user tried to call
-->
<ui:page name="access-list">
<t:basic-grid have_scroll_position="yes">
<p:nav-col>
<t:admin-access-nav/>
</p:nav-col>
<p:headline>
<t:admin-access-head/>
</p:headline>
<p:main-col>
<div><a href="#help">Help</a></div>
<br/>
<ui:enumerate variable="message" template="message"/>
<table class="acl">
<tr>
<th class="acl" bgcolor="#8B7E66">
<font color="white">Timesheet</font></th>
<th class="acl" bgcolor="#8B7E66">
<font color="white">Description</font></th>
<th class="acl" bgcolor="#8B7E66">
<font color="white">Privilege</font></th>
<th class="acl" bgcolor="#8B7E66">
<font color="white">Access granted to users</font></th>
<th class="acl" bgcolor="#8B7E66">
<font color="white">Edit ACL?</font></th>
<th class="acl" bgcolor="#8B7E66">
</th>
</tr>
<ui:iterate variable="acl-read" template="access-row">
<ui:iter-empty>
<tr>
<td class="acl-o" colspan="6"><i>The table is empty!</i></td>
</tr>
</ui:iter-empty>
</ui:iterate>
<tr bgcolor="#CDBA96">
<td class="acl-r" colspan="5"> </td>
<td class="acl-r">
<ui:imagebutton name="access-new"
src="&static-url-prefix;row-ins.png"
alt="insert" align="middle"
title="Append another row"/></td>
</tr>
</table>
<div>
<br/>
<br/>
Continue...
</div>
<div>
<table>
<tr>
<td><img src="&static-url-prefix;followup.png" alt="arrow"/></td>
<td>Save your changes:</td>
<td><ui:button name="access-save" label="Save"/></td>
</tr>
</table>
</div>
<div class="help">
<a name="help"/>
<div>
This dialog allows you to create additional sheets, delete sheets,
and to change the permissions associated with sheets (ACLs =
access control lists).
</div>
<div>
To <em>create</em> an additional sheet, press the button
"New Row" or the icon <img src="&static-url-prefix;row-ins.png"
width="10" height="10"/>, fill out the new row, and
press "Save".</div>
<div>
To <em>delete</em> a sheet, click at the icon <img
src="&static-url-prefix;row-del.png" width="10"
height="10"/> in the row of the sheet, and press "Save".</div>
<div>
To <em>change permissions</em> of a sheet, select the sheet
in the "Edit ACL?" column, and press "Edit ACL". After
changing the ACL, press "Save". The <em>Owner</em> is the
person who is allowed to delete the sheet, and to set the
ACL. The <em>Writers</em> can modify the contents of the
sheet. The <em>Readers</em> can only view the contents of
the sheet, but not change it. All other users (except
administrators) do not even see your sheets.</div>
</div>
</p:main-col>
</t:basic-grid>
</ui:page>
<ui:page name="unsaved">
<!-- When somebody tries to leave the access list without saving -->
<t:basic-grid>
<p:nav-col>
<!-- empty nav-col: this is a modal dialog -->
</p:nav-col>
<p:headline>
<t:admin-access-head/>
</p:headline>
<p:main-col>
<q:message int="confirm-unsaved">
<div>
You try to leave this page, but there are unsaved changes.
Do you want to save the access list now?
</div>
<div class="buttonbox">
<ui:button name="unsaved-save" label="Save list"/>
<ui:button name="unsaved-discard" label="Discard changes"/>
<ui:button name="unsaved-cancel" label="Cancel"/>
</div>
</q:message>
</p:main-col>
</t:basic-grid>
</ui:page>
<!-- ERROR HANDLING -->
<!-- See also ocaml class error_behaviour that uses the following
definitions
-->
<ui:variable name="runtime-error"/>
<ui:page name="runtime-error">
<t:basic-grid>
<p:nav-col>
<!-- empty nav-col: this is a modal dialog -->
</p:nav-col>
<p:headline>
<t:admin-access-head/>
</p:headline>
<p:main-col>
<t:error errid="$[runtime-error]"/>
<ui:button name="cont-error" label="Continue"/>
</p:main-col>
</t:basic-grid>
</ui:page>
</ui:dialog>
<!-- ********************************************************************** -->
<ui:template name="admin-access-head">
<!-- The headline -->
<t:admin-head>
<p:suffix>
Manage Sheets
<t:head-modified-flag/>
</p:suffix>
</t:admin-head>
</ui:template>
<ui:template name="admin-access-nav">
<!-- The navigation bar -->
<t:admin-nav current="task-access"/>
<q:nav-section head="Manage Sheets">
<q:nav-entry title="Edit access control list (ALT-E)">
<q:applink label="Edit ACL" name="access-edit" accesskey="E"/>
</q:nav-entry>
<q:nav-entry title="New row (ALT-N)">
<q:applink label="New row" name="access-new" accesskey="N"/>
</q:nav-entry>
<q:nav-entry title="Save changes in database (ALT-S)">
<q:applink label="Save" name="access-save" accesskey="S"/>
</q:nav-entry>
<!--
<q:nav-entry title="Test: Unsaved changes">
<q:applink label="Test 1" name="access-test1"/>
</q:nav-entry>
-->
</q:nav-section>
</ui:template>
<!-- ********************************************************************** -->
<ui:template name="access-row" from-caller="int">
<!-- int: the index of the sheet -->
<tr bgcolor="#CDBA96">
<!--
<td class="acl-r">
<ui:ifvar variable="inst-edit" index="$int" value="no" op="ne">
<ui:checkbox variable="inst-del" index="$int" value="yes"
onchange="set_modified_flag()" />
</ui:ifvar>
</td>
-->
<td class="acl-r">
<ui:cond>
<ui:ifvar variable="inst-del" index="$int" value="yes" op="contains">
<strike>
<ui:if value1="$[assoc(inst-name,$int)]" value2="^[ \t]*$$"
op="match">anonymous</ui:if>
$[assoc(inst-name,$int)]
</strike>
</ui:ifvar>
<ui:ifvar variable="inst-edit" index="$int" value="new">
<ui:text variable="inst-name" index="$int"
onchange="set_modified_flag()" />
</ui:ifvar>
<ui:true>
$[assoc(inst-name,$int)]
</ui:true>
</ui:cond>
</td>
<td class="acl-r">
<ui:cond>
<ui:ifvar variable="inst-del" index="$int" value="yes" op="contains">
<strike>$[assoc(inst-descr,$int)]</strike>
</ui:ifvar>
<ui:ifvar variable="inst-edit" index="$int" value="no" op="ne">
<ui:text variable="inst-descr" index="$int"
onchange="set_modified_flag()" />
</ui:ifvar>
<ui:true>$[assoc(inst-descr,$int)]</ui:true>
</ui:cond>
</td>
<td class="acl-r">Read</td>
<td class="acl-r-users">
<ui:cond>
<ui:ifvar variable="acl-edit" value="r-$int" op="contains">
<ui:select size="$[size(acl-users)]"
variable="acl-read" multiple="yes" base="acl-users"
onchange="set_modified_flag()" class="acl-box"
index="$int"/>
</ui:ifvar>
<ui:true>
<ui:enumerate variable="acl-read" index="$int" template="acl-user">
<ui:iter-separator>, </ui:iter-separator>
</ui:enumerate>
</ui:true>
</ui:cond>
</td>
<td class="acl-r">
<ui:cond>
<ui:ifvar variable="inst-del" index="$int" value="yes" op="contains"/>
<ui:ifvar variable="inst-edit" index="$int" value="no" op="ne">
<ui:radio variable="acl-edit" value="r-$int"
onchange="document.uiform.submit();"/>
</ui:ifvar>
</ui:cond>
</td>
<td class="acl-r">
<ui:cond>
<ui:ifvar variable="inst-edit" index="$int" value="no" op="ne">
<ui:imagebutton name="access-del" index="$int"
src="&static-url-prefix;row-del.png"
alt="delete" align="middle"
title="Delete this sheet"/>
</ui:ifvar>
<ui:true> </ui:true>
</ui:cond>
</td>
</tr>
<tr bgcolor="#CDBA96">
<td class="acl-w"> </td>
<td class="acl-w"> </td>
<td class="acl-w">Write</td>
<td class="acl-w-users">
<ui:cond>
<ui:ifvar variable="acl-edit" value="w-$int" op="contains">
<ui:select size="$[size(acl-users)]"
variable="acl-write" multiple="yes" base="acl-users"
onchange="set_modified_flag()" class="acl-box"
index="$int"/>
</ui:ifvar>
<ui:true>
<ui:enumerate variable="acl-write" index="$int" template="acl-user">
<ui:iter-separator>, </ui:iter-separator>
</ui:enumerate>
</ui:true>
</ui:cond>
</td>
<td class="acl-w">
<ui:cond>
<ui:ifvar variable="inst-del" index="$int" value="yes" op="contains"/>
<ui:ifvar variable="inst-edit" index="$int" value="no" op="ne">
<ui:radio variable="acl-edit" value="w-$int"
onchange="document.uiform.submit();"/>
</ui:ifvar>
</ui:cond>
</td>
<td class="acl-w"> </td>
</tr>
<tr bgcolor="#CDBA96">
<td class="acl-o"> </td>
<td class="acl-o"> </td>
<td class="acl-o">Owner</td>
<td class="acl-o-users">
<ui:cond>
<ui:ifvar variable="acl-edit" value="o-$int" op="contains">
<ui:select size="$[size(acl-users)]"
variable="acl-owner" multiple="yes" base="acl-users"
onchange="set_modified_flag()" class="acl-box"
index="$int"/>
</ui:ifvar>
<ui:true>
<ui:enumerate variable="acl-owner" index="$int" template="acl-user">
<ui:iter-separator>, </ui:iter-separator>
</ui:enumerate>
</ui:true>
</ui:cond>
</td>
<td class="acl-o">
<ui:cond>
<ui:ifvar variable="inst-del" index="$int" value="yes" op="contains"/>
<ui:ifvar variable="inst-edit" index="$int" value="no" op="ne">
<ui:radio variable="acl-edit" value="o-$int"
onchange="document.uiform.submit();"/>
</ui:ifvar>
</ui:cond>
</td>
<td class="acl-o"> </td>
</tr>
</ui:template>
<ui:template name="acl-user" from-caller="int">
<!-- int: the name of the user -->
$[translate(acl-users,$int)]
</ui:template>
<!-- ******************* For Emacs: ********************* -->
<!--
Local Variables:
mode: xml
sgml-parent-document: ("main.ui" "ui:application" "ui:dialog")
End:
-->