2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2010 */
\r
6 /* Inclusive Design Institute */
\r
8 /* This program is free software. You can redistribute it and/or */
\r
9 /* modify it under the terms of the GNU General Public License */
\r
10 /* as published by the Free Software Foundation. */
\r
11 /************************************************************************/
\r
13 global $_custom_css;
\r
14 $_custom_css = TR_BASE_HREF."include/jscripts/infusion/components/inlineEdit/css/InlineEdit.css";
\r
16 include(TR_INCLUDE_PATH.'header.inc.php');
\r
19 <form name="form" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
\r
21 <table summary="<?php echo _AT("user_group"); ?>" class="data" rules="rows" id="editable_table">
\r
24 <th scope="col" align="left"><input type="checkbox" value="<?php echo _AT('select_all'); ?>" id="all" title="<?php echo _AT('select_all'); ?>" name="selectall" onclick="CheckAll();" /></th>
\r
26 <th scope="col"><?php echo _AT('title'); ?></th>
\r
27 <th scope="col"><?php echo _AT('description'); ?></th>
\r
28 <th scope="col"><?php echo _AT('privileges'); ?></th>
\r
32 <?php if (is_array($this->user_group_rows)): ?>
\r
36 <input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" />
\r
37 <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" />
\r
42 <?php foreach ($this->user_group_rows as $row)
\r
45 $privileges = $this->privilegesDAO->getUserGroupPrivileges($row['user_group_id']);
\r
47 if (is_array($privileges))
\r
50 foreach ($privileges as $priv) $priv_str .= '<li>'. $priv['privilege_desc'].'</li>';
\r
51 $priv_str .= '</ul>';
\r
54 <tr onmousedown="document.form['m<?php echo $row['user_group_id']; ?>'].checked = !document.form['m<?php echo $row['user_group_id']; ?>'].checked; togglerowhighlight(this, 'm<?php echo $row['user_group_id']; ?>');"
\r
55 onkeydown="document.form['m<?php echo $row['user_group_id']; ?>'].checked = !document.form['m<?php echo $row['user_group_id']; ?>'].checked; togglerowhighlight(this, 'm<?php echo $row['user_group_id']; ?>');"
\r
56 id="rm<?php echo $row['user_group_id']; ?>">
\r
57 <td><input type="checkbox" name="id[]" value="<?php echo $row['user_group_id']; ?>" id="m<?php echo $row['user_group_id']; ?>"
\r
58 onmouseup="this.checked=!this.checked" onkeyup="this.checked=!this.checked" /></td>
\r
59 <td width='20%'><label for="m<?php echo $row['user_group_id']; ?>"><span id="<?php echo 'title-'.$row['user_group_id']?>" class="inlineEdits"><?php echo $row['title']; ?></span></label></td>
\r
60 <td width='30%'><span id="<?php echo 'description-'.$row['user_group_id']?>" class="inlineEdits"><?php echo $row['description']; ?></span></td>
\r
61 <td><?php echo $priv_str; ?></td>
\r
67 <td colspan="4"><?php echo _AT('none_found'); ?></td>
\r
74 <script language="JavaScript" type="text/javascript">
\r
76 function CheckAll() {
\r
77 for (var i=0;i<document.form.elements.length;i++) {
\r
78 var e = document.form.elements[i];
\r
79 if ((e.name == 'id[]') && (e.type=='checkbox')) {
\r
80 e.checked = document.form.selectall.checked;
\r
81 togglerowhighlight(document.getElementById("r" + e.id), e.id);
\r
86 function togglerowhighlight(obj, boxid) {
\r
87 if (document.getElementById(boxid).checked) {
\r
88 obj.className = 'selected';
\r
94 jQuery(document).ready(function () {
\r
95 var tableEdit = fluid.inlineEdits("#editable_table", {
\r
98 editables : "td:has(span.inlineEdits)"
\r
100 defaultViewText: "",
\r
103 afterFinishEdit : function (newValue, oldValue, editNode, viewNode)
\r
105 if (newValue != oldValue)
\r
107 rtn = jQuery.post("<?php echo TR_BASE_HREF; ?>user/user_group_inline_editor_submit.php", { "field":viewNode.id, "value":newValue },
\r
110 if (data.status=="fail")
\r
112 for (var i = 0; i < tableEdit.length; i++)
\r
114 if(tableEdit[i].editField[0] == editNode)
\r
115 tableEdit[i].updateModelValue(oldValue);
\r
119 handleAjaxResponse(data);
\r
128 <?php require(TR_INCLUDE_PATH.'footer.inc.php'); ?>