mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
Merge branch 'seeddms-4.3.x' into seeddms-5.0.x
This commit is contained in:
commit
6e80f025cf
|
@ -25,17 +25,26 @@
|
|||
* @version Release: @package_version@
|
||||
*/
|
||||
class SeedDMS_View_Common {
|
||||
var $theme;
|
||||
protected $theme;
|
||||
|
||||
var $params;
|
||||
|
||||
// var $settings;
|
||||
protected $params;
|
||||
|
||||
function __construct($params, $theme='blue') {
|
||||
$this->theme = $theme;
|
||||
$this->params = $params;
|
||||
}
|
||||
|
||||
function __invoke($get=array()) {
|
||||
if(isset($get['action']) && $get['action']) {
|
||||
if(method_exists($this, $get['action'])) {
|
||||
$this->{$get['action']}();
|
||||
} else {
|
||||
echo "Missing action '".$get['action']."'";
|
||||
}
|
||||
} else
|
||||
$this->show();
|
||||
}
|
||||
|
||||
function setParams($params) {
|
||||
$this->params = $params;
|
||||
}
|
||||
|
@ -49,12 +58,6 @@ class SeedDMS_View_Common {
|
|||
unset($this->params[$name]);
|
||||
}
|
||||
|
||||
/*
|
||||
function setConfiguration($conf) {
|
||||
$this->settings = $conf;
|
||||
}
|
||||
*/
|
||||
|
||||
function show() {
|
||||
}
|
||||
|
||||
|
|
|
@ -49,14 +49,7 @@ if(isset($_GET['userid']) && $_GET['userid']) {
|
|||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'seluser'=>$seluser, 'allusers'=>$users, 'allgroups'=>$groups, 'passwordstrength'=>$settings->_passwordStrength, 'passwordexpiration'=>$settings->_passwordExpiration, 'httproot'=>$settings->_httpRoot, 'enableuserimage'=>$settings->_enableUserImage, 'undeluserids'=>explode(',', $settings->_undelUserIds), 'workflowmode'=>$settings->_workflowMode, 'quota'=>$settings->_quota));
|
||||
if($view) {
|
||||
if(isset($_GET['action']) && $_GET['action']) {
|
||||
if(method_exists($view, $_GET['action'])) {
|
||||
$view->{$_GET['action']}();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
$view->show();
|
||||
exit;
|
||||
$view($_GET);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -421,15 +421,30 @@ $(document).ready( function() {
|
|||
|
||||
$('div.ajax').each(function(index) {
|
||||
var element = $(this);
|
||||
var url = element.data('href');
|
||||
console.log('Calling '+url);
|
||||
var url = '';
|
||||
var href = element.data('href');
|
||||
var view = element.data('view');
|
||||
var action = element.data('action');
|
||||
if(view && action)
|
||||
url = "out."+view+".php?action="+action;
|
||||
else
|
||||
url = href;
|
||||
// console.log('Calling '+url);
|
||||
$.get(url, function(data) {
|
||||
element.html(data);
|
||||
$(".chzn-select").chosen();
|
||||
});
|
||||
});
|
||||
$('div.ajax').on('update', function(event, param1) {
|
||||
var element = $(this);
|
||||
var url = element.data('href');
|
||||
var url = '';
|
||||
var href = element.data('href');
|
||||
var view = element.data('view');
|
||||
var action = element.data('action');
|
||||
if(view && action)
|
||||
url = "out."+view+".php?action="+action;
|
||||
else
|
||||
url = href;
|
||||
if(typeof param1 === 'object') {
|
||||
for(var key in param1) {
|
||||
url += "&"+key+"="+param1[key];
|
||||
|
@ -437,11 +452,11 @@ $(document).ready( function() {
|
|||
} else {
|
||||
url += "&"+param1;
|
||||
}
|
||||
console.log("Calling: "+url);
|
||||
// console.log("Calling: "+url);
|
||||
element.prepend('<div style="position: absolute; overflow: hidden; background: #f7f7f7; z-index: 1000; height: '+element.height()+'px; width: '+element.width()+'px; opacity: 0.7; display: table;"><div style="display: table-cell;text-align: center; vertical-align: middle; "><img src="../views/bootstrap/images/ajax-loader.gif"></div>');
|
||||
// element.html('<div class="ajaxloader" style="min-height: '+element.height()+'px;"><img src="typo3conf/ext/mmk_gocoachtmpl/template/Public/img/ajax-loader.gif"></div>');
|
||||
$.get(url, function(data) {
|
||||
element.html(data);
|
||||
$(".chzn-select").chosen();
|
||||
});
|
||||
});
|
||||
$("body").on("click", ".ajax-click", function() {
|
||||
|
|
|
@ -2080,5 +2080,27 @@ mayscript>
|
|||
</table>
|
||||
<?php
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Show progressbar
|
||||
*
|
||||
* @param double $value value
|
||||
* @param double $max 100% value
|
||||
*/
|
||||
protected function getProgressBar($value, $max=100.0) { /* {{{ */
|
||||
if($max > $value) {
|
||||
$used = (int) ($value/$max*100.0+0.5);
|
||||
$free = 100-$used;
|
||||
} else {
|
||||
$free = 0;
|
||||
$used = 100;
|
||||
}
|
||||
$html .= '
|
||||
<div class="progress">
|
||||
<div class="bar bar-danger" style="width: '.$used.'%;"></div>
|
||||
<div class="bar bar-success" style="width: '.$free.'%;"></div>
|
||||
</div>';
|
||||
return $html;
|
||||
} /* }}} */
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -76,27 +76,10 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style {
|
|||
echo "<td>";
|
||||
echo SeedDMS_Core_File::format_filesize($currUser->getUsedDiskSpace());
|
||||
if($quota) {
|
||||
$qt = $currUser->getQuota();
|
||||
if($qt == 0)
|
||||
$qt = $quota;
|
||||
if($qt > $currUser->getUsedDiskSpace()) {
|
||||
$used = (int) ($currUser->getUsedDiskSpace()/$qt*100.0+0.5);
|
||||
$free = 100-$used;
|
||||
} else {
|
||||
$free = 0;
|
||||
$used = 100;
|
||||
}
|
||||
echo " / ";
|
||||
if($currUser->getQuota() != 0)
|
||||
echo SeedDMS_Core_File::format_filesize($currUser->getQuota())."<br />";
|
||||
else
|
||||
echo SeedDMS_Core_File::format_filesize($quota)."<br />";
|
||||
?>
|
||||
<div class="progress">
|
||||
<div class="bar bar-danger" style="width: <?php echo $used; ?>%;"></div>
|
||||
<div class="bar bar-success" style="width: <?php echo $free; ?>%;"></div>
|
||||
</div>
|
||||
<?php
|
||||
$qt = $currUser->getQuota() ? $currUser->getQuota() : $quota;
|
||||
echo SeedDMS_Core_File::format_filesize($qt)."<br />";
|
||||
echo $this->getProgressBar($currUser->getUsedDiskSpace(), $qt);
|
||||
}
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
|
|
|
@ -31,6 +31,30 @@ require_once("class.Bootstrap.php");
|
|||
*/
|
||||
class SeedDMS_View_UsrMgr extends SeedDMS_Bootstrap_Style {
|
||||
|
||||
function info() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$seluser = $this->params['seluser'];
|
||||
$quota = $this->params['quota'];
|
||||
|
||||
$sessionmgr = new SeedDMS_SessionMgr($dms->getDB());
|
||||
|
||||
$this->contentHeading(getMLText("user_info"));
|
||||
echo "<table class=\"table table-condensed\">\n";
|
||||
echo "<tr><td>".getMLText('discspace')."</td><td>";
|
||||
$qt = $seluser->getQuota() ? $seluser->getQuota() : $quota;
|
||||
echo SeedDMS_Core_File::format_filesize($seluser->getUsedDiskSpace())." / ".SeedDMS_Core_File::format_filesize($qt)."<br />";
|
||||
echo $this->getProgressBar($seluser->getUsedDiskSpace(), $qt);
|
||||
echo "</td></tr>\n";
|
||||
$documents = $seluser->getDocuments();
|
||||
echo "<tr><td>".getMLText('documents')."</td><td>".count($documents)."</td></tr>\n";
|
||||
$sessions = $sessionmgr->getUserSessions($seluser);
|
||||
if($sessions) {
|
||||
$session = array_shift($sessions);
|
||||
echo "<tr><td>".getMLText('lastaccess')."</td><td>".getLongReadableDate($session->getLastAccess())."</td></tr>\n";
|
||||
}
|
||||
echo "</table>";
|
||||
} /* }}} */
|
||||
|
||||
function form() { /* {{{ */
|
||||
$seluser = $this->params['seluser'];
|
||||
|
||||
|
@ -422,11 +446,12 @@ function showUser(selectObj) {
|
|||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="ajax" data-view="UsrMgr" data-action="info"></div>
|
||||
</div>
|
||||
|
||||
<div class="span8">
|
||||
<div class="well">
|
||||
<div class="ajax" data-href="../out/out.UsrMgr.php?action=form<?php if($seluser) echo "&userid=".$seluser->getID();?>"></div>
|
||||
<div class="ajax" data-view="UsrMgr" data-action="form"></div>
|
||||
<?php if(0): ?>
|
||||
<div id="keywords0" style="display : none;">
|
||||
<?php $this->showUserForm(false); ?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user