2012-12-14 07:53:13 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Implementation of EditUserData view
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS
|
2012-12-14 07:53:13 +00:00
|
|
|
* @license GPL 2
|
|
|
|
* @version @version@
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2012 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Include parent class
|
|
|
|
*/
|
|
|
|
require_once("class.Bootstrap.php");
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class which outputs the html page for EditUserData view
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS
|
2012-12-14 07:53:13 +00:00
|
|
|
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2012 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
2013-02-14 11:10:53 +00:00
|
|
|
class SeedDMS_View_EditUserData extends SeedDMS_Bootstrap_Style {
|
2012-12-14 07:53:13 +00:00
|
|
|
|
2016-01-28 13:56:23 +00:00
|
|
|
function js() { /* {{{ */
|
2016-02-17 10:43:19 +00:00
|
|
|
header('Content-Type: application/javascript');
|
2012-12-14 07:53:13 +00:00
|
|
|
?>
|
|
|
|
function checkForm()
|
|
|
|
{
|
2013-05-23 14:07:00 +00:00
|
|
|
msg = new Array();
|
2016-01-28 13:56:23 +00:00
|
|
|
if ($("#pwd").val() != $("#pwdconf").val()) msg.push("<?php printMLText("js_pwd_not_conf");?>");
|
|
|
|
if ($("#fullname").val() == "") msg.push("<?php printMLText("js_no_name");?>");
|
|
|
|
if ($("#email").val() == "") msg.push("<?php printMLText("js_no_email");?>");
|
2013-05-23 14:07:00 +00:00
|
|
|
// if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
|
|
|
if (msg != "") {
|
|
|
|
noty({
|
|
|
|
text: msg.join('<br />'),
|
|
|
|
type: 'error',
|
|
|
|
dismissQueue: true,
|
|
|
|
layout: 'topRight',
|
|
|
|
theme: 'defaultTheme',
|
|
|
|
_timeout: 1500,
|
|
|
|
});
|
2012-12-14 07:53:13 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-01-28 13:56:23 +00:00
|
|
|
$(document).ready( function() {
|
|
|
|
$('body').on('submit', '#form', function(ev){
|
|
|
|
if(checkForm()) return;
|
2016-03-22 13:47:13 +00:00
|
|
|
ev.preventDefault();
|
2016-01-28 13:56:23 +00:00
|
|
|
});
|
|
|
|
});
|
2012-12-14 07:53:13 +00:00
|
|
|
<?php
|
2016-01-28 13:56:23 +00:00
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
function show() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$user = $this->params['user'];
|
|
|
|
$enableuserimage = $this->params['enableuserimage'];
|
|
|
|
$enablelanguageselector = $this->params['enablelanguageselector'];
|
|
|
|
$enablethemeselector = $this->params['enablethemeselector'];
|
|
|
|
$passwordstrength = $this->params['passwordstrength'];
|
|
|
|
$httproot = $this->params['httproot'];
|
|
|
|
|
|
|
|
$this->htmlStartPage(getMLText("edit_user_details"));
|
|
|
|
$this->globalNavigation();
|
|
|
|
$this->contentStart();
|
|
|
|
$this->pageNavigation(getMLText("my_account"), "my_account");
|
|
|
|
|
2012-12-14 07:53:13 +00:00
|
|
|
$this->contentHeading(getMLText("edit_user_details"));
|
|
|
|
$this->contentContainerStart();
|
|
|
|
?>
|
2016-01-28 13:56:23 +00:00
|
|
|
<form action="../op/op.EditUserData.php" enctype="multipart/form-data" method="post" id="form">
|
2012-12-14 07:53:13 +00:00
|
|
|
<table class="table-condensed">
|
|
|
|
<tr>
|
|
|
|
<td><?php printMLText("current_password");?>:</td>
|
|
|
|
<td><input id="currentpwd" type="password" name="currentpwd" size="30"></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><?php printMLText("new_password");?>:</td>
|
2016-01-28 13:56:23 +00:00
|
|
|
<td><input class="pwd" type="password" rel="strengthbar" id="pwd" name="pwd" size="30"></td>
|
2012-12-14 07:53:13 +00:00
|
|
|
</tr>
|
2012-12-14 20:43:29 +00:00
|
|
|
<?php
|
|
|
|
if($passwordstrength) {
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td><?php printMLText("password_strength");?>:</td>
|
|
|
|
<td>
|
|
|
|
<div id="strengthbar" class="progress" style="width: 220px; height: 30px; margin-bottom: 8px;"><div class="bar bar-danger" style="width: 0%;"></div></div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2012-12-14 07:53:13 +00:00
|
|
|
<tr>
|
|
|
|
<td><?php printMLText("confirm_pwd");?>:</td>
|
2016-01-28 13:56:23 +00:00
|
|
|
<td><input id="pwdconf" type="Password" id="pwdconf" name="pwdconf" size="30"></td>
|
2012-12-14 07:53:13 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><?php printMLText("name");?>:</td>
|
2016-01-28 13:56:23 +00:00
|
|
|
<td><input type="text" id="fullname" name="fullname" value="<?php print htmlspecialchars($user->getFullName());?>" size="30"></td>
|
2012-12-14 07:53:13 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><?php printMLText("email");?>:</td>
|
2016-01-28 13:56:23 +00:00
|
|
|
<td><input type="text" id="email" name="email" value="<?php print htmlspecialchars($user->getEmail());?>" size="30"></td>
|
2012-12-14 07:53:13 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><?php printMLText("comment");?>:</td>
|
|
|
|
<td><textarea name="comment" rows="4" cols="80"><?php print htmlspecialchars($user->getComment());?></textarea></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
if ($enableuserimage){
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td><?php printMLText("user_image");?>:</td>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
if ($user->hasImage())
|
|
|
|
print "<img src=\"".$httproot . "out/out.UserImage.php?userid=".$user->getId()."\">";
|
|
|
|
else printMLText("no_user_image");
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><?php printMLText("new_user_image");?>:</td>
|
2014-05-16 07:19:36 +00:00
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
$this->printFileChooser('userfile', false, "image/jpeg");
|
|
|
|
?>
|
|
|
|
</td>
|
2012-12-14 07:53:13 +00:00
|
|
|
</tr>
|
2014-03-28 17:40:06 +00:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
if ($enablelanguageselector){
|
|
|
|
?>
|
2012-12-14 07:53:13 +00:00
|
|
|
<tr>
|
|
|
|
<td><?php printMLText("language");?>:</td>
|
|
|
|
<td>
|
|
|
|
<select name="language">
|
|
|
|
<?php
|
|
|
|
$languages = getLanguages();
|
|
|
|
foreach ($languages as $currLang) {
|
2013-02-27 19:40:45 +00:00
|
|
|
print "<option value=\"".$currLang."\" ".(($user->getLanguage()==$currLang) ? "selected" : "").">".getMLText($currLang)."</option>";
|
2012-12-14 07:53:13 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2014-03-28 17:40:06 +00:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
if ($enablethemeselector){
|
|
|
|
?>
|
2012-12-14 07:53:13 +00:00
|
|
|
<tr>
|
|
|
|
<td><?php printMLText("theme");?>:</td>
|
|
|
|
<td>
|
|
|
|
<select name="theme">
|
|
|
|
<?php
|
|
|
|
$themes = UI::getStyles();
|
|
|
|
foreach ($themes as $currTheme) {
|
|
|
|
print "<option value=\"".$currTheme."\" ".(($user->getTheme()==$currTheme) ? "selected" : "").">".$currTheme."</option>";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2014-03-28 17:40:06 +00:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2012-12-14 07:53:13 +00:00
|
|
|
<tr>
|
|
|
|
<td></td>
|
2013-04-19 13:22:25 +00:00
|
|
|
<td><button type="submit" class="btn"><i class="icon-save"></i> <?php printMLText("save"); ?></button></td>
|
2012-12-14 07:53:13 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$this->contentContainerEnd();
|
2016-03-15 07:30:53 +00:00
|
|
|
$this->contentEnd();
|
2012-12-14 07:53:13 +00:00
|
|
|
$this->htmlEndPage();
|
|
|
|
} /* }}} */
|
|
|
|
}
|
|
|
|
?>
|