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 <div class="input-form">
\r
20 <form name="filter_form" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
\r
21 <fieldset class="group_form"><legend class="group_form"><?php echo _AT("filter"); ?></legend>
\r
22 <table class="filter">
\r
24 <td colspan="2"><h2><?php echo _AT('results_found', $this->num_results); ?></h2></td>
\r
28 <th><?php echo _AT('user_status'); ?>:</th>
\r
30 <input type="radio" name="status" value="0" id="s0" <?php if ($_GET['status'] == TR_STATUS_DISABLED) { echo 'checked="checked"'; } ?> /><label for="s0"><?php echo _AT('disabled'); ?></label>
\r
31 <input type="radio" name="status" value="1" id="s1" <?php if ($_GET['status'] == TR_STATUS_ENABLED) { echo 'checked="checked"'; } ?> /><label for="s1"><?php echo _AT('enabled'); ?></label>
\r
32 <input type="radio" name="status" value="" id="s" <?php if ($_GET['status'] === '') { echo 'checked="checked"'; } ?> /><label for="s"><?php echo _AT('all'); ?></label>
\r
36 <?php if (is_array($this->all_user_groups)) { ?>
\r
38 <th><label for="user_group_id"><?php echo _AT('user_group'); ?></label>:</th>
\r
40 <select name="user_group_id" id="user_group_id">
\r
41 <option value="-1">- <?php echo _AT('select'); ?> -</option>
\r
42 <?php foreach ($this->all_user_groups as $user_group) {?>
\r
43 <option value="<?php echo $user_group['user_group_id']; ?>" <?php if($_GET['user_group_id']==$user_group['user_group_id']) { echo 'selected="selected"';}?>><?php echo $user_group['title']; ?></option>
\r
51 <th><label for="search"><?php echo _AT('search'); ?>:</label></th>
\r
52 <td><input type="text" name="search" id="search" size="40" value="<?php echo htmlspecialchars($_GET['search']); ?>" /><br /><small>· <?php echo _AT('login_name').', '._AT('first_name').', '._AT('last_name') .', '._AT('email'); ?></small></td>
\r
56 <td colspan="2" align="center">
\r
57 <input type="radio" name="include" value="all" id="match_all" <?php echo $this->checked_include_all; ?> /><label for="match_all"><?php echo _AT('match_all_words'); ?></label>
\r
58 <input type="radio" name="include" value="one" id="match_one" <?php echo $this->checked_include_one; ?> /><label for="match_one"><?php echo _AT('match_any_word'); ?></label>
\r
63 <td colspan="2"><p class="submit_button">
\r
64 <input type="submit" name="filter" value="<?php echo _AT('filter'); ?>" />
\r
65 <input type="submit" name="reset_filter" value="<?php echo _AT('reset_filter'); ?>" />
\r
73 <div id="output_div" class="input-form">
\r
74 <fieldset class="group_form"><legend class="group_form"><?php echo _AT("users"); ?></legend>
\r
75 <?php print_paginator($this->page, $this->num_results, $this->page_string . htmlspecialchars(SEP) . $this->order .'='. $this->col, $this->results_per_page); ?>
\r
77 <form name="form" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
\r
78 <input type="hidden" name="status" value="<?php echo $_GET['status']; ?>" />
\r
79 <input type="hidden" name="search" value="<?php echo htmlspecialchars($_GET['search']); ?>" />
\r
80 <input type="hidden" name="include" value="<?php echo htmlspecialchars($_GET['include']); ?>" />
\r
82 <table summary="<?php echo _AT('user_table_summary'); ?>" class="data" rules="rows" id="editable_table">
\r
84 <?php if ($this->col == 'login'): ?>
\r
86 <col class="sort" />
\r
87 <col span="<?php echo 5 + $this->col_counts; ?>" />
\r
88 <?php elseif($this->col == 'public_field'): ?>
\r
89 <col span="<?php echo 1 + $this->col_counts; ?>" />
\r
90 <col class="sort" />
\r
92 <?php elseif($this->col == 'first_name'): ?>
\r
93 <col span="<?php echo 2 + $this->col_counts; ?>" />
\r
94 <col class="sort" />
\r
96 <?php elseif($this->col == 'last_name'): ?>
\r
97 <col span="<?php echo 3 + $this->col_counts; ?>" />
\r
98 <col class="sort" />
\r
100 <?php elseif($this->col == 'user_group'): ?>
\r
101 <col span="<?php echo 4 + $this->col_counts; ?>" />
\r
102 <col class="sort" />
\r
104 <?php elseif($this->col == 'email'): ?>
\r
105 <col span="<?php echo 5 + $this->col_counts; ?>" />
\r
106 <col class="sort" />
\r
108 <?php elseif($this->col == 'status'): ?>
\r
109 <col span="<?php echo 6 + $this->col_counts; ?>" />
\r
110 <col class="sort" />
\r
112 <?php elseif($this->col == 'last_login'): ?>
\r
113 <col span="<?php echo 7 + $this->col_counts; ?>" />
\r
114 <col class="sort" />
\r
119 <th scope="col" align="left" width="5%"><input type="checkbox" value="<?php echo _AT('select_all'); ?>" id="all" title="<?php echo _AT('select_all'); ?>" name="selectall" onclick="CheckAll();" /></th>
\r
121 <th scope="col" width="15%"><a href="user/index.php?<?php echo $this->orders[$this->order]; ?>=login<?php echo $page_string; ?>"><?php echo _AT('login_name'); ?></a></th>
\r
122 <th scope="col" width="15%"><a href="user/index.php?<?php echo $this->orders[$this->order]; ?>=first_name<?php echo $page_string; ?>"><?php echo _AT('first_name'); ?></a></th>
\r
123 <th scope="col" width="10%"><a href="user/index.php?<?php echo $this->orders[$this->order]; ?>=last_name<?php echo $page_string; ?>"><?php echo _AT('last_name'); ?></a></th>
\r
124 <th scope="col" width="10%"><a href="user/index.php?<?php echo $this->orders[$this->order]; ?>=user_group<?php echo $page_string; ?>"><?php echo _AT('user_group'); ?></a></th>
\r
125 <th scope="col" width="15%"><a href="user/index.php?<?php echo $this->orders[$this->order]; ?>=email<?php echo $page_string; ?>"><?php echo _AT('email'); ?></a></th>
\r
126 <th scope="col" width="10%"><a href="user/index.php?<?php echo $this->orders[$this->order]; ?>=status<?php echo $page_string; ?>"><?php echo _AT('user_status'); ?></a></th>
\r
127 <th scope="col" width="20%"><a href="user/index.php?<?php echo $this->orders[$this->order]; ?>=last_login<?php echo $page_string; ?>"><?php echo _AT('last_login'); ?></a></th>
\r
131 <?php if ($this->num_results > 0): ?>
\r
134 <td colspan="<?php echo 8 + $this->col_counts; ?>">
\r
135 <input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" />
\r
136 <input type="submit" name="password" value="<?php echo _AT('password'); ?>" />
\r
137 <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" />
\r
142 <?php if (is_array($this->user_rows)){ foreach ($this->user_rows as $row) {?>
\r
143 <tr onmousedown="document.form['m<?php echo $row['user_id']; ?>'].checked = !document.form['m<?php echo $row['user_id']; ?>'].checked; togglerowhighlight(this, 'm<?php echo $row['user_id']; ?>');"
\r
144 onkeydown="document.form['m<?php echo $row['user_id']; ?>'].checked = !document.form['m<?php echo $row['user_id']; ?>'].checked; togglerowhighlight(this, 'm<?php echo $row['user_id']; ?>');"
\r
145 id="rm<?php echo $row['user_id']; ?>">
\r
146 <td><input type="checkbox" name="id[]" value="<?php echo $row['user_id']; ?>" id="m<?php echo $row['user_id']; ?>"
\r
147 onmouseup="this.checked=!this.checked" onkeyup="this.checked=!this.checked" /></td>
\r
148 <td><label for="m<?php echo $row['user_id']; ?>"><span class="inlineEdits" id="<?php echo "login-".$row['user_id']; ?>"><?php echo $row['login']; ?></span></label></td>
\r
149 <td><span class="inlineEdits" id="<?php echo "first_name-".$row['user_id']; ?>"><?php echo $row['first_name']; ?></span></td>
\r
150 <td><span class="inlineEdits" id="<?php echo "last_name-".$row['user_id']; ?>"><?php echo $row['last_name']; ?></span></td>
\r
151 <td><?php echo $row['user_group']; ?></td>
\r
152 <td><span class="inlineEdits" id="<?php echo "email-".$row['user_id']; ?>"><?php echo $row['email']; ?></span></td>
\r
153 <td><?php echo get_status_by_code($row['status']); ?></td>
\r
154 <td nowrap="nowrap">
\r
155 <?php if ($row['last_login'] == 0): ?>
\r
156 <?php echo _AT('never'); ?>
\r
159 echo $row['last_login'];
\r
168 <td colspan="<?php echo 8 + $this->col_counts; ?>"><?php echo _AT('none_found'); ?></td>
\r
172 <small class="data-table-tip"><?php echo _AT('inline_editor_tip'); ?></small>
\r
178 <script language="JavaScript" type="text/javascript">
\r
180 function CheckAll() {
\r
181 for (var i=0;i<document.form.elements.length;i++) {
\r
182 var e = document.form.elements[i];
\r
183 if ((e.name == 'id[]') && (e.type=='checkbox')) {
\r
184 e.checked = document.form.selectall.checked;
\r
185 togglerowhighlight(document.getElementById("r" + e.id), e.id);
\r
190 function togglerowhighlight(obj, boxid) {
\r
191 if (document.getElementById(boxid).checked) {
\r
192 obj.className = 'selected';
\r
194 obj.className = '';
\r
198 jQuery(document).ready(function () {
\r
199 var tableEdit = fluid.inlineEdits("#editable_table", {
\r
202 editables : "td:has(span.inlineEdits)"
\r
204 defaultViewText: "",
\r
207 afterFinishEdit : function (newValue, oldValue, editNode, viewNode) {
\r
208 if (newValue != oldValue)
\r
209 rtn = jQuery.post("<?php echo TR_BASE_HREF; ?>user/index_inline_editor_submit.php", { "field":viewNode.id, "value":newValue },
\r
210 function(data) { handleAjaxResponse(data, viewNode, oldValue); }, "json");
\r
218 <?php require(TR_INCLUDE_PATH.'footer.inc.php'); ?>