[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] tasks/skins/default/base.xsl, 1.1.2.9
From: |
nomail |
Subject: |
[Phpgroupware-cvs] tasks/skins/default/base.xsl, 1.1.2.9 |
Date: |
Tue, 6 Jul 2004 09:22:21 +0200 |
Update of /tasks/skins/default
Modified Files:
Branch: proposal-branch
base.xsl
date: 2004/07/06 07:22:21; author: jengo; state: Exp; lines: +167 -12
Log Message:
Initial work to ACL, more info is in the wiki journal
=====================================================================
Index: tasks/skins/default/base.xsl
diff -u tasks/skins/default/base.xsl:1.1.2.8
tasks/skins/default/base.xsl:1.1.2.9
--- tasks/skins/default/base.xsl:1.1.2.8 Wed Jun 30 08:36:48 2004
+++ tasks/skins/default/base.xsl Tue Jul 6 07:22:21 2004
@@ -255,10 +255,28 @@
</tr>
<tr class="row_on" valign="top">
<td align="center">
- Access: <xsl:value-of select="access" />
- <p> </p>
- <p> </p>
- <center><input type="button" value="Add"
onclick="javascript:
window.open('{$baseurl}&op=api.base.acl&location=datamine.records.-1','phpGroupWare
ACL manager','WIDTH=400,HEIGHT=250,resize=yes,resizable=yes');" /></center>
+ <br />
+ <xsl:if
test="count(/PHPGW/APP/acl_list/acl_list_item) = 0">
+ <b>This record is private</b>
+ </xsl:if>
+
+ <xsl:if
test="count(/PHPGW/APP/acl_list/acl_list_item) != 0">
+ <table align="center" width="95%"
border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td>User</td>
+ <td>Allowed</td>
+ <td>Denied</td>
+ </tr>
+
+ <xsl:for-each
select="/PHPGW/APP/acl_list/acl_list_item">
+ <tr>
+ <td><xsl:value-of
select="acl_user" /></td>
+ <td><xsl:value-of
select="allow" /></td>
+ <td><xsl:value-of
select="deny" /></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:if>
<p> </p>
<p> </p>
<p> </p>
@@ -268,19 +286,152 @@
</xsl:template>
<xsl:template name="display_tab_acl_edit">
+ <script>
+ function enable_checkboxes()
+ {
+ for (var i=0; i <
document.phpgw_form.elements.length; i++)
+ {
+ if (document.phpgw_form.elements[i].type ==
'checkbox')
+ {
+
document.phpgw_form.elements[i].disabled = 0;
+
+ if
(document.phpgw_form.elements[i].name == 'acl_allow[]')
+ {
+
document.phpgw_form.elements[i].checked = 0;
+ }
+
+ if
(document.phpgw_form.elements[i].name == 'acl_deny[]')
+ {
+
document.phpgw_form.elements[i].checked = 1;
+ }
+ }
+ }
+ }
+
+ // FIXME: If you click on the same checkbox 2 times, it will
leave it unchecked
+ // Which is not correct, I couldn't find a good way to handle
this without lots of
+ // sloppy code. Needless to say, I suck at Javascript :P
(jengo)
+ function acl_click(value,name)
+ {
+ var other_name;
+ if (name == 'acl_allow[]')
+ {
+ other_name = 'acl_deny[]';
+ }
+ else
+ {
+ other_name = 'acl_allow[]';
+ }
+
+ for (var i=0; i <
document.phpgw_form.elements.length; i++)
+ {
+ if (document.phpgw_form.elements[i].type ==
'checkbox')
+ {
+ if
(document.phpgw_form.elements[i].name == other_name)
+ {
+ if
(document.phpgw_form.elements[i].value == value)
+ {
+
document.phpgw_form.elements[i].checked = 0;
+ }
+ }
+ }
+ }
+ }
+
+ function save()
+ {
+ opener.location.reload();
+ windown.opener.location.reload();
+ window.close();
+ }
+ </script>
+
<table width="100%" border="0" class="tab_body">
<tr class="th">
<td colspan="2">ACL</td>
</tr>
<tr class="row_on" valign="top">
<td align="center">
- <p> </p>
- Private: <input type="checkbox" name="access"
value="true" />
- <p> </p>
- <center><input type="button" value="Add"
onclick="javascript:
window.open('{$baseurl}&op=api.base.acl&location=datamine.records.-1','phpGroupWare
ACL manager','WIDTH=400,HEIGHT=250,resize=yes,resizable=yes');" /></center>
- <p> </p>
+ <br />
+ <xsl:if
test="count(/PHPGW/APP/acl_list/acl_list_item) = 0">
+ <div align="center">
+ <b>No users selected, this
record will be marked private and only viewable to the owner</b>
+ </div>
+ </xsl:if>
+
+ <xsl:if
test="count(/PHPGW/APP/acl_list/acl_list_item) != 0">
+ <table align="center" width="95%"
border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td>User</td>
+ <td>Allowed</td>
+ <td>Denied</td>
+ </tr>
+
+ <xsl:for-each
select="/PHPGW/APP/acl_list/acl_list_item">
+ <tr>
+ <td><xsl:value-of
select="acl_user" /></td>
+ <td><xsl:value-of
select="allow" /></td>
+ <td><xsl:value-of
select="deny" /></td>
+ <xsl:variable
name="position" select="position()" />
+ <td><input type="image"
name="acl_remove" src="{$api_image_path}/delete.png" value="{$position}"
alt="Remove" title="Remove" /></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:if>
+
<p> </p>
<p> </p>
+ <div align="left">
+   To add an ACL entry, select the
user or group bellow, assign permissions and click add.
+ </div>
+ <hr />
+ <table align="center" width="95%" border="0">
+ <tr>
+ <td>
+ <select
name="acl_add_user_id">
+ <xsl:for-each
select="/PHPGW/APP/acl_accounts/acl_accounts_item">
+ <option
value="{account_id}" onclick="javascript: enable_checkboxes();">
+ [<xsl:value-of
select="account_type" />]
+
 <<xsl:value-of select="account_lid" />>
+
 <xsl:value-of select="account_lastname" />,
+
 <xsl:value-of select="account_firstname" />
+ </option>
+ </xsl:for-each>
+ </select>
+ </td>
+
+ <td>
+ <table border="0"
width="100%">
+ <tr>
+
<td> </td>
+ <td
align="left">Allow</td>
+ <td
align="left">Deny</td>
+ </tr>
+
+ <tr>
+ <td
align="left">Read</td>
+
<td><input type="checkbox" name="acl_allow[]" value="1" disabled="true"
onclick="javascript: acl_click(1,'acl_allow[]');" /></td>
+
<td><input type="checkbox" name="acl_deny[]" value="1" disabled="true"
onclick="javascript: acl_click(1,'acl_deny[]');" /></td>
+ </tr>
+ <tr>
+ <td
align="left">Edit</td>
+
<td><input type="checkbox" name="acl_allow[]" value="4" disabled="true"
onclick="javascript: acl_click(4,'acl_allow[]');" /></td>
+
<td><input type="checkbox" name="acl_deny[]" value="4" disabled="true"
onclick="javascript: acl_click(4,'acl_deny[]');" /></td>
+ </tr>
+ <tr>
+ <td
align="left">Delete</td>
+
<td><input type="checkbox" name="acl_allow[]" value="8" disabled="true"
onclick="javascript: acl_click(8,'acl_allow[]');" /></td>
+
<td><input type="checkbox" name="acl_deny[]" value="8" disabled="true"
onclick="javascript: acl_click(8,'acl_deny[]');" /></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td align="right" colspan="2">
+ <input type="submit"
name="acl_add" value="Add ACL" />
+ </td>
+ </tr>
+ </table>
</td>
</tr>
</table>
@@ -426,6 +577,8 @@
<td width="10%">Start date</td>
<td width="10%">End date</td>
<td width="20%">Assigned to</td>
+ <td width="24"> </td>
+ <td width="24"> </td>
</tr>
</table>
</td>
@@ -471,6 +624,8 @@
<td width="10%"><font
color="#000000"><xsl:value-of select="start" /></font></td>
<td width="10%"><font
color="#000000"><xsl:value-of select="end" /></font></td>
<td width="20%"><font
color="#000000"><xsl:value-of select="responsible" /></font></td>
+ <td width="24"
align="right"><a href="{$baseurl}&op=tasks.base.edit&task_id={id}"><img
alt="Edit" title="Edit" src="{$api_image_path}/edit.png" border="0" /></a></td>
+ <td width="24"
align="right"><a
href="{$baseurl}&op=tasks.base.delete&task_id={id}"><img alt="Delete"
title="Delete" src="{$api_image_path}/delete.png" border="0" /></a></td>
</tr>
</xsl:for-each>
</table>
@@ -541,7 +696,7 @@
</font>
</td>
<td
width="*" align="left">
-
<input name="subject" size="64" value="{task_data/subject}">
+
<input name="subject" size="64" value="{task_data/subject}" max="60">
<xsl:if test="missing_fields/subject = 1">
<xsl:attribute name="class">form_object_missing</xsl:attribute>
</xsl:if>
@@ -640,7 +795,7 @@
</font>
</td>
<td
width="*" align="left">
-
<input name="subject" size="64" value="{task_data/subject}">
+
<input name="subject" size="64" value="{task_data/subject}" max="60">
<xsl:if test="missing_fields/subject = 1">
<xsl:attribute name="class">form_object_missing</xsl:attribute>
</xsl:if>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] tasks/skins/default/base.xsl, 1.1.2.9,
nomail <=