parent
b9c1f7356f
commit
2a5df8bed9
|
@ -159,7 +159,25 @@ class User {
|
|||
public static function getUsersDataTablesInfo($datatables_post) {
|
||||
|
||||
$fromTable = "cc_subjs";
|
||||
return StoredFile::searchFiles($fromTable, $datatables_post);
|
||||
|
||||
// get current user
|
||||
$username = "";
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
if ($auth->hasIdentity()) {
|
||||
$username = $auth->getIdentity()->login;
|
||||
}
|
||||
|
||||
$res = StoredFile::searchFiles($fromTable, $datatables_post);
|
||||
|
||||
// mark record which is for the current user
|
||||
foreach($res['aaData'] as &$record){
|
||||
if($record[1] == $username){
|
||||
$record[5] = "self";
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public static function getUserData($id){
|
||||
|
|
|
@ -36,7 +36,11 @@ function removeUserCallback(row_id, nRow){
|
|||
|
||||
function rowCallback( nRow, aData, iDisplayIndex ){
|
||||
$(nRow).click(function(){rowClickCallback(aData[0])});
|
||||
$('td:eq(4)', nRow).append( '<span class="ui-icon ui-icon-closethick"></span>').children('span').click(function(e){e.stopPropagation(); removeUserCallback(aData[0], nRow)});
|
||||
if( aData[5] != "self"){
|
||||
$('td:eq(4)', nRow).append( '<span class="ui-icon ui-icon-closethick"></span>').children('span').click(function(e){e.stopPropagation(); removeUserCallback(aData[0], nRow)});
|
||||
}else{
|
||||
$('td:eq(4)', nRow).empty();
|
||||
}
|
||||
|
||||
if ( aData[4] == "A" )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue