switch to jquery validation of forms

This commit is contained in:
Uwe Steinmann 2021-05-27 21:57:12 +02:00
parent 3a3b4ec953
commit c75ae806ae
22 changed files with 375 additions and 508 deletions

View File

@ -39,6 +39,7 @@ class SeedDMS_View_AddDocument extends SeedDMS_Theme_Style {
$enablemultiupload = $this->params['enablemultiupload'];
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
if($enablelargefileupload) {
$this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, $maxuploadsize, $enablemultiupload);
}
@ -73,16 +74,6 @@ $(document).ready(function() {
$("#adddocform").validate({
debug: false,
ignore: ":hidden:not(.do_validate)",
invalidHandler: function(e, validator) {
noty({
text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
timeout: 1500,
});
},
<?php
if($enablelargefileupload) {
?>
@ -165,6 +156,7 @@ $(document).ready(function() {
$folderid = $folder->getId();
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
if($enablelargefileupload) {
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/fine-uploader/jquery.fine-uploader.min.js"></script>'."\n", 'js');
$this->htmlAddHeader($this->getFineUploaderTemplate(), 'js');

View File

@ -34,37 +34,21 @@ class SeedDMS_View_AddEvent extends SeedDMS_Theme_Style {
function js() { /* {{{ */
$strictformcheck = $this->params['strictformcheck'];
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
function checkForm()
{
msg = new Array();
if (document.form1.name.value == "") msg.push("<?php printMLText("js_no_name");?>");
<?php
if ($strictformcheck) {
?>
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
<?php
}
?>
if (msg != "") {
noty({
text: msg.join('<br />'),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
_timeout: 1500,
});
return false;
}
else
return true;
}
$(document).ready(function() {
$('body').on('submit', '#form1', function(ev){
if(checkForm()) return;
ev.preventDefault();
$("#form1").validate({
rules: {
from: {
required: true
},
to: {
required: true
}
},
messages: {
name: "<?php printMLText("js_no_name");?>",
},
});
});
<?php
@ -72,6 +56,9 @@ $(document).ready(function() {
function show() { /* {{{ */
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("calendar"));
$this->globalNavigation();
$this->contentStart();

View File

@ -36,6 +36,7 @@ class SeedDMS_View_AddFile extends SeedDMS_Theme_Style {
$partitionsize = $this->params['partitionsize'];
$maxuploadsize = $this->params['maxuploadsize'];
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
if($enablelargefileupload)
$this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, $maxuploadsize);
@ -60,22 +61,6 @@ $(document).ready( function() {
$("#form1").validate({
debug: false,
ignore: ":hidden:not(.do_validate)",
invalidHandler: function(e, validator) {
noty({
text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
timeout: 1500,
});
},
highlight: function(e, errorClass, validClass) {
$(e).parent().parent().removeClass(validClass).addClass(errorClass);
},
unhighlight: function(e, errorClass, validClass) {
$(e).parent().parent().removeClass(errorClass).addClass(validClass);
},
<?php
if($enablelargefileupload) {
?>
@ -129,6 +114,7 @@ $(document).ready( function() {
$maxuploadsize = $this->params['maxuploadsize'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
if($enablelargefileupload) {
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/fine-uploader/jquery.fine-uploader.min.js"></script>'."\n", 'js');
$this->htmlAddHeader($this->getFineUploaderTemplate(), 'js');

View File

@ -34,25 +34,10 @@ class SeedDMS_View_AddSubFolder extends SeedDMS_Theme_Style {
function js() { /* {{{ */
$strictformcheck = $this->params['strictformcheck'];
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
$(document).ready( function() {
$("#form1").validate({
invalidHandler: function(e, validator) {
noty({
text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
timeout: 1500,
});
},
highlight: function(e, errorClass, validClass) {
$(e).parent().parent().removeClass(validClass).addClass(errorClass);
},
unhighlight: function(e, errorClass, validClass) {
$(e).parent().parent().removeClass(errorClass).addClass(validClass);
},
messages: {
name: "<?php printMLText("js_no_name");?>",
comment: "<?php printMLText("js_no_comment");?>"
@ -70,6 +55,7 @@ $(document).ready( function() {
$orderby = $this->params['orderby'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
$this->globalNavigation($folder);

View File

@ -33,59 +33,39 @@ class SeedDMS_View_ApproveDocument extends SeedDMS_Theme_Style {
function js() { /* {{{ */
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
function checkIndForm()
{
msg = new Array();
if (document.formind.approvalStatus.value == "") msg.push("<?php printMLText("js_no_approval_status");?>");
if (document.formind.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,
});
return false;
}
else
return true;
}
function checkGrpForm()
{
msg = new Array();
// if (document.formgrp.approvalGroup.value == "") msg.push("<?php printMLText("js_no_approval_group");?>");
if (document.formgrp.approvalStatus.value == "") msg.push("<?php printMLText("js_no_approval_status");?>");
if (document.formgrp.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,
});
return false;
}
else
return true;
}
$(document).ready(function() {
$('body').on('submit', '#formind', function(ev){
if(checkIndForm()) return;
ev.preventDefault();
$("#formind").validate({
rules: {
comment: {
required: true
},
approvalStatus: {
required: true
},
},
messages: {
comment: "<?php printMLText("js_no_comment");?>",
approvalStatus: "<?php printMLText("js_no_approval_status");?>",
},
});
$('body').on('submit', '#formgrp', function(ev){
if(checkGrpForm()) return;
ev.preventDefault();
$("#formgrp").validate({
rules: {
comment: {
required: true
},
approvalStatus: {
required: true
},
},
messages: {
comment: "<?php printMLText("js_no_comment");?>",
approvalStatus: "<?php printMLText("js_no_approval_status");?>",
},
});
});
<?php
$this->printFileChooserJs();
} /* }}} */
@ -105,6 +85,9 @@ $(document).ready(function() {
}
}
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);
$this->contentStart();
@ -139,6 +122,7 @@ $(document).ready(function() {
array(
'element'=>'textarea',
'name'=>'comment',
'required'=>true,
'rows'=>4,
'cols'=>80
)

View File

@ -39,14 +39,23 @@ class SeedDMS_View_AttributeMgr extends SeedDMS_Theme_Style {
function js() { /* {{{ */
$selattrdef = $this->params['selattrdef'];
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('cancel', 'splash_move_document', 'confirm_move_document', 'move_document', 'confirm_transfer_link_document', 'transfer_content', 'link_document', 'splash_move_folder', 'confirm_move_folder', 'move_folder'));
parent::jsTranslations(array('js_form_error', 'js_form_errors', 'cancel', 'splash_move_document', 'confirm_move_document', 'move_document', 'confirm_transfer_link_document', 'transfer_content', 'link_document', 'splash_move_folder', 'confirm_move_folder', 'move_folder'));
?>
$(document).ready( function() {
$('body').on('submit', '#form', function(ev){
// if(checkForm()) return;
// ev.preventDefault();
function runValidation() {
$("#form1").validate({
rules: {
name: {
required: true
}
},
messages: {
name: "<?php printMLText("js_no_name");?>",
},
});
}
$(document).ready( function() {
$( "#selector" ).change(function() {
$('div.ajax').trigger('update', {attrdefid: $(this).val()});
window.history.pushState({"html":"","pageTitle":""},"", '../out/out.AttributeMgr.php?attrdefid=' + $(this).val());
@ -180,7 +189,7 @@ $(document).ready( function() {
function showAttributeForm($attrdef) { /* {{{ */
?>
<form class="form-horizontal" action="../op/op.AttributeMgr.php" method="post">
<form class="form-horizontal" action="../op/op.AttributeMgr.php" id="form1" name="form1" method="post">
<?php
if($attrdef) {
echo createHiddenFieldWithKey('editattrdef');
@ -322,6 +331,9 @@ $(document).ready( function() {
$attrdefs = $this->params['attrdefs'];
$selattrdef = $this->params['selattrdef'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
$this->contentStart();
@ -401,7 +413,7 @@ $(document).ready( function() {
$this->columnEnd();
$this->columnStart(6);
?>
<div class="ajax" data-view="AttributeMgr" data-action="form" <?php echo ($selattrdef ? "data-query=\"attrdefid=".$selattrdef->getID()."\"" : "") ?>></div>
<div class="ajax" data-view="AttributeMgr" data-action="form" data-afterload="()=>{runValidation();}" <?php echo ($selattrdef ? "data-query=\"attrdefid=".$selattrdef->getID()."\"" : "") ?>></div>
<?php
$this->columnEnd();
$this->rowEnd();

View File

@ -228,6 +228,7 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style {
$user = $this->params['user'];
$strictformcheck = $this->params['strictformcheck'];
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
$(document).ready(function() {
@ -307,16 +308,6 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style {
$('#calendar').fullCalendar('refetchEvents');
}, "json");
},
invalidHandler: function(e, validator) {
noty({
text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
timeout: 1500,
});
},
messages: {
name: "<?php printMLText("js_no_name");?>",
comment: "<?php printMLText("js_no_comment");?>"
@ -382,6 +373,7 @@ $(document).ready(function() {
$user = $this->params['user'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/moment/moment.min.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/fullcalendar/fullcalendar.min.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/fullcalendar/locale-all.js"></script>'."\n", 'js');

View File

@ -33,83 +33,42 @@ class SeedDMS_View_DefaultKeywords extends SeedDMS_Theme_Style {
function js() { /* {{{ */
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
function checkForm()
{
msg = new Array();
if($("#form .name").val() == "") msg.push("<?php printMLText("js_no_name");?>");
if (msg != "")
{
noty({
text: msg.join('<br />'),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
_timeout: 1500,
});
return false;
}
else
return true;
}
function checkFormName()
{
msg = new Array();
if($(".formn .name").val() == "") msg.push("<?php printMLText("js_no_name");?>");
if (msg != "")
{
noty({
text: msg.join('<br />'),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
_timeout: 1500,
});
return false;
}
else
return true;
}
function checkKeywordForm()
{
msg = new Array();
if($(".formk .keywords").val() == "") msg.push("<?php printMLText("js_no_name");?>");
if (msg != "")
{
noty({
text: msg.join('<br />'),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
_timeout: 1500,
});
return false;
}
else
return true;
function runValidation() {
$("#form").validate({
rules: {
name: {
required: true
},
},
messages: {
name: "<?php printMLText("js_no_name");?>",
}
});
$(".formk").validate({
rules: {
keywords: {
required: true
},
},
messages: {
keywords: "<?php printMLText("js_no_name");?>",
}
});
$(".formn").validate({
rules: {
keywords: {
required: true
},
},
messages: {
keywords: "<?php printMLText("js_no_name");?>",
}
});
}
$(document).ready( function() {
$('body').on('submit', '#form', function(ev){
if(checkForm()) return;
ev.preventDefault();
});
$('body').on('submit', '.formk', function(ev){
if(checkKeywordForm()) return;
ev.preventDefault();
});
$('body').on('submit', '.formn', function(ev){
if(checkFormName()) return;
ev.preventDefault();
});
$( "#selector" ).change(function() {
$('div.ajax').trigger('update', {categoryid: $(this).val()});
});
@ -199,7 +158,7 @@ $(document).ready( function() {
else
foreach ($lists as $list) {
?>
<form class="form-inline form mb-3" style="display: inline-block;" method="post" action="../op/op.DefaultKeywords.php">
<form class="form-inline form formn mb-3" style="display: inline-block;" method="post" action="../op/op.DefaultKeywords.php">
<?php echo createHiddenFieldWithKey('editkeywords'); ?>
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
<input type="Hidden" name="keywordsid" value="<?php echo $list["id"]?>">
@ -242,6 +201,9 @@ $(document).ready( function() {
$categories = $this->params['categories'];
$selcategory = $this->params['selcategory'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
$this->contentStart();
@ -278,7 +240,7 @@ $(document).ready( function() {
$this->columnEnd();
$this->columnStart(8);
?>
<div class="ajax" data-view="DefaultKeywords" data-action="form" <?php echo ($selcategory ? "data-query=\"categoryid=".$selcategory->getId()."\"" : "") ?>></div>
<div class="ajax" data-view="DefaultKeywords" data-action="form" data-afterload="()=>{runValidation();}" <?php echo ($selcategory ? "data-query=\"categoryid=".$selcategory->getId()."\"" : "") ?>></div>
</div>
<?php
$this->columnEnd();

View File

@ -34,38 +34,24 @@ class SeedDMS_View_EditComment extends SeedDMS_Theme_Style {
function js() { /* {{{ */
$strictformcheck = $this->params['strictformcheck'];
header('Content-Type: application/javascript; charset=UTF-8');
?>
function checkForm()
{
msg = new Array();
<?php
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
if ($strictformcheck) {
?>
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
function runValidation() {
$("#form1").validate({
rules: {
comment: {
required: true
},
},
messages: {
comment: "<?php printMLText("js_no_comment");?>",
}
});
}
runValidation();
<?php
}
?>
if (msg != "")
{
noty({
text: msg.join('<br />'),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
_timeout: 1500,
});
return false;
}
else return true;
}
$(document).ready(function() {
$('body').on('submit', '#form1', function(ev){
if(checkForm()) return;
ev.preventDefault();
});
});
<?php
} /* }}} */
function show() { /* {{{ */
@ -76,6 +62,9 @@ $(document).ready(function() {
$version = $this->params['version'];
$strictformcheck = $this->params['strictformcheck'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);
$this->contentStart();

View File

@ -34,20 +34,11 @@ class SeedDMS_View_EditDocument extends SeedDMS_Theme_Style {
function js() { /* {{{ */
$strictformcheck = $this->params['strictformcheck'];
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
$this->printKeywordChooserJs('form1');
?>
$(document).ready( function() {
$("#form1").validate({
invalidHandler: function(e, validator) {
noty({
text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
timeout: 1500,
});
},
messages: {
name: "<?php printMLText("js_no_name");?>",
comment: "<?php printMLText("js_no_comment");?>",
@ -75,6 +66,7 @@ $(document).ready( function() {
$orderby = $this->params['orderby'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);

View File

@ -34,25 +34,10 @@ class SeedDMS_View_EditFolder extends SeedDMS_Theme_Style {
function js() { /* {{{ */
$strictformcheck = $this->params['strictformcheck'];
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
$(document).ready(function() {
$("#form1").validate({
invalidHandler: function(e, validator) {
noty({
text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
timeout: 1500,
});
},
highlight: function(e, errorClass, validClass) {
$(e).parent().parent().removeClass(validClass).addClass(errorClass);
},
unhighlight: function(e, errorClass, validClass) {
$(e).parent().parent().removeClass(errorClass).addClass(validClass);
},
messages: {
name: "<?php printMLText("js_no_name");?>",
comment: "<?php printMLText("js_no_comment");?>"
@ -72,6 +57,7 @@ $(document).ready(function() {
$orderby = $this->params['orderby'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
$this->globalNavigation($folder);

View File

@ -33,25 +33,10 @@ class SeedDMS_View_EditUserData extends SeedDMS_Theme_Style {
function js() { /* {{{ */
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
$(document).ready( function() {
$("#form").validate({
invalidHandler: function(e, validator) {
noty({
text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
timeout: 1500,
});
},
highlight: function(e, errorClass, validClass) {
$(e).parent().parent().removeClass(validClass).addClass(errorClass);
},
unhighlight: function(e, errorClass, validClass) {
$(e).parent().parent().removeClass(errorClass).addClass(validClass);
},
rules: {
currentpwd: {
required: true
@ -93,6 +78,7 @@ $(document).ready( function() {
$httproot = $this->params['httproot'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("edit_user_details"));
$this->globalNavigation();

View File

@ -33,7 +33,30 @@ class SeedDMS_View_ForcePasswordChange extends SeedDMS_Theme_Style {
function js() { /* {{{ */
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
function runValidation() {
$("#form").validate({
rules: {
currentpwd: {
required: true
},
pwd: {
required: true
},
pwdconf: {
equalTo: "#pwd"
}
},
messages: {
currentpwd: "<?php printMLText("js_no_pwd");?>",
pwd: "<?php printMLText("js_no_pwd");?>",
pwdconf: "<?php printMLText("js_pwd_not_conf");?>",
}
});
}
runValidation();
function checkForm()
{
msg = new Array();
@ -57,10 +80,10 @@ function checkForm()
}
$(document).ready( function() {
$('body').on('submit', '#form', function(ev){
if(checkForm()) return;
ev.preventDefault();
});
// $('body').on('submit', '#form', function(ev){
// if(checkForm()) return;
// ev.preventDefault();
// });
});
<?php
} /* }}} */
@ -70,16 +93,19 @@ $(document).ready( function() {
$user = $this->params['user'];
$passwordstrength = $this->params['passwordstrength'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("sign_in"), "forcepasswordchange");
$this->globalBanner();
$this->contentStart();
$this->contentHeading(getMLText('password_expiration'));
$this->warningMsg(getMLText('password_expiration_text'));
$this->contentContainerStart();
?>
<form class="form-horizontal" action="../op/op.EditUserData.php" method="post" id="form" name="form1">
<?php echo createHiddenFieldWithKey('edituserdata'); ?>
<?php
$this->contentContainerStart();
$this->formField(
getMLText("current_password"),
array(
@ -111,6 +137,7 @@ $(document).ready( function() {
'autocomplete'=>'off',
)
);
$this->contentContainerEnd();
$this->formSubmit("<i class=\"fa fa-save\"></i> ".getMLText('submit_password'));
?>
<input type="hidden" name="fullname" value="<?php print htmlspecialchars($user->getFullName());?>" />
@ -119,7 +146,6 @@ $(document).ready( function() {
</form>
<?php
$this->contentContainerEnd();
$tmpfoot = array();
$tmpfoot[] = "<a href=\"../op/op.Logout.php\">" . getMLText("logout") . "</a>\n";
print "<p>";

View File

@ -41,64 +41,48 @@ class SeedDMS_View_GroupMgr extends SeedDMS_Theme_Style {
$strictformcheck = $this->params['strictformcheck'];
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
function checkForm1() {
msg = new Array();
if($("#name").val() == "") msg.push("<?php printMLText("js_no_name");?>");
function runValidation() {
$("#form_1").validate({
rules: {
name: {
required: true
},
<?php
if ($strictformcheck) {
?>
if($("#comment").val() == "") msg.push("<?php printMLText("js_no_comment");?>");
comment: {
required: true
},
<?php
}
?>
if (msg != "") {
noty({
text: msg.join('<br />'),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
_timeout: 1500,
});
return false;
} else
return true;
},
messages: {
name: "<?php printMLText("js_no_name");?>",
<?php
if ($strictformcheck) {
?>
comment: "<?php printMLText("js_no_comment");?>",
<?php
}
?>
}
});
$("#form_2").validate({
rules: {
userid: {
required: true
},
},
messages: {
userid: "<?php printMLText("js_select_user");?>",
}
});
}
function checkForm2() {
msg = "";
if($("#userid").val() == -1) msg += "<?php printMLText("js_select_user");?>\n";
if (msg != "") {
noty({
text: msg,
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
_timeout: 1500,
});
return false;
} else
return true;
}
$(document).ready( function() {
$('body').on('submit', '#form_1', function(ev){
if(checkForm1())
return;
ev.preventDefault();
});
$('body').on('submit', '#form_2', function(ev){
if(checkForm2())
return;
ev.preventDefault();
});
$( "#selector" ).change(function() {
$('div.ajax').trigger('update', {groupid: $(this).val()});
window.history.pushState({"html":"","pageTitle":""},"", '../out/out.GroupMgr.php?groupid=' + $(this).val());
@ -296,6 +280,9 @@ $(document).ready( function() {
$allGroups = $this->params['allgroups'];
$strictformcheck = $this->params['strictformcheck'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
$this->contentStart();
@ -331,7 +318,7 @@ $(document).ready( function() {
$this->columnEnd();
$this->columnStart(8);
?>
<div class="ajax" data-view="GroupMgr" data-action="form" <?php echo ($selgroup ? "data-query=\"groupid=".$selgroup->getID()."\"" : "") ?>></div>
<div class="ajax" data-view="GroupMgr" data-action="form" data-afterload="()=>{runValidation();}" <?php echo ($selgroup ? "data-query=\"groupid=".$selgroup->getID()."\"" : "") ?>></div>
<?php
$this->columnEnd();
$this->rowEnd();

View File

@ -32,65 +32,44 @@
class SeedDMS_View_Login extends SeedDMS_Theme_Style {
function js() { /* {{{ */
$dms = $this->params['dms'];
$enableguestlogin = $this->params['enableguestlogin'];
$guest = null;
if($enableguestlogin) {
$guestid = $this->params['guestid'];
$guest = $dms->getUser((int) $guestid);
}
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
document.form1.login.focus();
function checkForm()
{
msg = new Array()
if($("#login").val() == "") msg.push("<?php printMLText("js_no_login");?>");
if($("#pwd").val() == "") msg.push("<?php printMLText("js_no_pwd");?>");
if (msg != "") {
noty({
text: msg.join('<br />'),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
_timeout: 1500,
});
return false;
}
else
return true;
}
function guestLogin()
{
theme = $("#themeselector").val();
lang = $("#languageselector").val();
url = "../op/op.Login.php?login=guest";
if(theme)
url += "&sesstheme=" + theme;
if(lang)
url += "&lang=" + lang;
if (document.form1.referuri) {
url += "&referuri=" + escape(document.form1.referuri.value);
}
document.location.href = url;
}
$(document).ready( function() {
/*
$('body').on('submit', '#form', function(ev){
if(checkForm()) return;
ev.preventDefault();
});
*/
<?php
if($guest) {
?>
function guestLogin()
{
theme = $("#themeselector").val();
lang = $("#languageselector").val();
url = "../op/op.Login.php?login=<?= $guest->getLogin() ?>";
if(theme)
url += "&sesstheme=" + theme;
if(lang)
url += "&lang=" + lang;
if (document.form1.referuri) {
url += "&referuri=" + escape(document.form1.referuri.value);
}
document.location.href = url;
}
$('body').on('click', '#guestlogin', function(ev){
ev.preventDefault();
guestLogin();
});
<?php
}
?>
$("#form").validate({
invalidHandler: function(e, validator) {
noty({
text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
timeout: 1500,
});
},
messages: {
login: "<?php printMLText("js_no_login");?>",
pwd: "<?php printMLText("js_no_pwd");?>"
@ -101,7 +80,9 @@ $(document).ready( function() {
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$enableguestlogin = $this->params['enableguestlogin'];
$guestid = $this->params['guestid'];
$enablepasswordforgotten = $this->params['enablepasswordforgotten'];
$refer = $this->params['referrer'];
$themes = $this->params['themes'];
@ -111,6 +92,7 @@ $(document).ready( function() {
$enableThemeSelector = $this->params['enablethemeselector'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("sign_in"), "login");
$this->globalBanner();
@ -119,9 +101,9 @@ $(document).ready( function() {
if($msg)
$this->errorMsg(htmlspecialchars($msg));
?>
<?php $this->contentContainerStart(); ?>
<form class="form-horizontal" action="../op/op.Login.php" method="post" name="form1" id="form">
<?php
$this->contentContainerStart();
if ($refer) {
echo "<input type='hidden' name='referuri' value='".htmlspecialchars($refer)."'/>";
}
@ -172,13 +154,13 @@ $(document).ready( function() {
$html
);
}
$this->contentContainerEnd();
$this->formSubmit(getMLText('submit_login'));
?>
</form>
<?php
$this->contentContainerEnd();
$tmpfoot = array();
if ($enableguestlogin)
if ($enableguestlogin && $guestid && $dms->getUser((int) $guestid))
$tmpfoot[] = "<a href=\"\" id=\"guestlogin\">" . getMLText("guest_login") . "</a>\n";
if ($enablepasswordforgotten)
$tmpfoot[] = "<a href=\"../out/out.PasswordForgotten.php\">" . getMLText("password_forgotten") . "</a>\n";

View File

@ -132,9 +132,33 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Theme_Style {
function js() { /* {{{ */
header('Content-Type: application/javascript; charset=UTF-8');
// $this->printFolderChooserJs("form1");
// $this->printDocumentChooserJs("form2");
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
$(document).ready( function() {
$("#form1").validate({
ignore: [],
rules: {
targetid: {
required: true
},
},
messages: {
targetid: "<?php printMLText("js_no_folder");?>",
},
});
$("#form2").validate({
ignore: [],
rules: {
docid: {
required: true
},
},
messages: {
docid: "<?php printMLText("js_no_document");?>",
},
});
});
<?php
$this->printClickDocumentJs();
$this->printClickFolderJs();
} /* }}} */
@ -148,6 +172,9 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Theme_Style {
$this->timeout = $this->params['timeout'];
$this->xsendfile = $this->params['xsendfile'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("my_account"));
$this->globalNavigation();
$this->contentStart();
@ -157,7 +184,7 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Theme_Style {
$this->columnStart(6);
$this->contentHeading(getMLText("edit_folder_notify"));
print "<form class=\"form-horizontal\" method=\"post\" action=\"../op/op.ManageNotify.php?type=folder&action=add\" name=\"form1\">";
print "<form class=\"form-horizontal\" method=\"post\" action=\"../op/op.ManageNotify.php?type=folder&action=add\" id=\"form1\" name=\"form1\">";
$this->contentContainerStart();
$this->formField(getMLText("choose_target_folder"), $this->getFolderChooserHtml("form1", M_READ));
$this->formField(
@ -184,7 +211,7 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Theme_Style {
$this->columnEnd();
$this->columnStart(6);
$this->contentHeading(getMLText("edit_document_notify"));
print "<form method=\"post\" action=\"../op/op.ManageNotify.php?type=document&action=add\" name=\"form2\">";
print "<form method=\"post\" action=\"../op/op.ManageNotify.php?type=document&action=add\" id=\"form2\" name=\"form2\">";
/* 'form1' must be passed to printDocumentChooser() because the typeahead
* function is currently hardcoded on this value */
$this->contentContainerStart();

View File

@ -33,30 +33,19 @@ class SeedDMS_View_PasswordForgotten extends SeedDMS_Theme_Style {
function js() { /* {{{ */
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
function checkForm()
{
msg = new Array();
if (document.form1.login.value == "") msg.push("<?php printMLText("js_no_login");?>");
if (document.form1.email.value == "") msg.push("<?php printMLText("js_no_email");?>");
if (msg != "") {
noty({
text: msg.join('<br />'),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
_timeout: 1500,
});
return false;
}
else
return true;
}
$(document).ready(function() {
$('body').on('submit', '#form1', function(ev){
if(checkForm()) return;
ev.preventDefault();
$("#form1").validate({
rules: {
email: {
email: true
}
},
messages: {
login: "<?php printMLText("js_no_login");?>",
email: "<?php printMLText("js_no_email");?>"
},
});
});
document.form1.email.focus();
@ -66,6 +55,9 @@ document.form1.email.focus();
function show() { /* {{{ */
$referrer = $this->params['referrer'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("password_forgotten"), "passwordforgotten");
$this->globalBanner();
$this->contentStart();

View File

@ -33,59 +33,39 @@ class SeedDMS_View_ReviewDocument extends SeedDMS_Theme_Style {
function js() { /* {{{ */
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
function checkIndForm()
{
msg = new Array();
if (document.formind.reviewStatus.value == "") msg.push("<?php printMLText("js_no_review_status");?>");
if (document.formind.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,
});
return false;
}
else
return true;
}
function checkGrpForm()
{
msg = new Array();
// if (document.formgrp.reviewGroup.value == "") msg.push("<?php printMLText("js_no_review_group");?>");
if (document.formgrp.reviewStatus.value == "") msg.push("<?php printMLText("js_no_review_status");?>");
if (document.formgrp.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,
});
return false;
}
else
return true;
}
$(document).ready(function() {
$('body').on('submit', '#formind', function(ev){
if(checkIndForm()) return;
ev.preventDefault();
$("#formind").validate({
rules: {
comment: {
required: true
},
reviewStatus: {
required: true
},
},
messages: {
comment: "<?php printMLText("js_no_comment");?>",
reviewStatus: "<?php printMLText("js_no_review_status");?>",
},
});
$('body').on('submit', '#formgrp', function(ev){
if(checkGrpForm()) return;
ev.preventDefault();
$("#formgrp").validate({
rules: {
comment: {
required: true
},
reviewStatus: {
required: true
},
},
messages: {
comment: "<?php printMLText("js_no_comment");?>",
reviewStatus: "<?php printMLText("js_no_review_status");?>",
},
});
});
<?php
$this->printFileChooserJs();
} /* }}} */
@ -104,6 +84,9 @@ $(document).ready(function() {
}
}
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);
$this->contentStart();
@ -138,6 +121,7 @@ $(document).ready(function() {
array(
'element'=>'textarea',
'name'=>'comment',
'required'=>true,
'rows'=>4,
'cols'=>80
)

View File

@ -248,16 +248,13 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
$this->contentHeading(getMLText("settings"));
$this->rowStart();
$this->columnStart(8);
?>
<form action="../op/op.Settings.php" method="post" enctype="multipart/form-data" name="form0" >
<?php echo createHiddenFieldWithKey('savesettings'); ?>
<input type="hidden" name="action" value="saveSettings" />
<input type="hidden" id="currenttab" name="currenttab" value="<?php echo $currenttab ? $currenttab : 'site'; ?>" />
<?php
if(!is_writeable($settings->_configFilePath)) {
$this->warningMsg(getMLText("settings_notwritable"));
}
?>
<ul class="nav nav-pills" id="settingstab" role="tablist">
<?php $this->showPaneHeader('site', getMLText('settings_Site'), (!$currenttab || $currenttab == 'site')); ?>
@ -649,9 +646,24 @@ if(is_writeable($settings->_configFilePath)) {
}
?>
</form>
<?php
$this->columnEnd();
$this->columnStart(4);
if(!is_writeable($settings->_configFilePath)) {
$this->warningMsg(getMLText("settings_notwritable"));
}
if($settings->_enableGuestLogin && $settings->_guestID) {
$guest = $dms->getUser((int) $settings->_guestID);
if(!$guest) {
$this->warningMsg(getMLText("settings_invalid_guestid"));
} elseif($guest->isDisabled()) {
$this->warningMsg(getMLText("settings_guestid_is_disabled"));
} elseif($guest->isAdmin()) {
$this->warningMsg(getMLText("settings_guestid_is_admin"));
}
}
$this->columnEnd(4);
$this->rowEnd(4);
$this->contentEnd();
$this->htmlEndPage();
} /* }}} */

View File

@ -38,6 +38,7 @@ class SeedDMS_View_UpdateDocument extends SeedDMS_Theme_Style {
$partitionsize = $this->params['partitionsize'];
$maxuploadsize = $this->params['maxuploadsize'];
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
$this->printDropFolderChooserJs("form1");
$this->printSelectPresetButtonJs();
$this->printInputPresetButtonJs();
@ -71,16 +72,6 @@ $(document).ready( function() {
$("#form1").validate({
debug: false,
ignore: ":hidden:not(.do_validate)",
invalidHandler: function(e, validator) {
noty({
text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
timeout: 1500,
});
},
<?php
if($enablelargefileupload) {
?>
@ -154,6 +145,7 @@ console.log(element);
$documentid = $document->getId();
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
if($enablelargefileupload) {
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/fine-uploader/jquery.fine-uploader.min.js"></script>'."\n", 'js');
$this->htmlAddHeader($this->getFineUploaderTemplate(), 'js');

View File

@ -36,43 +36,51 @@ class SeedDMS_View_UsrMgr extends SeedDMS_Theme_Style {
$strictformcheck = $this->params['strictformcheck'];
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
function checkForm()
{
msg = new Array();
if($("#login").val() == "") msg.push("<?php printMLText("js_no_login");?>");
if(($("#userid").val() == "0") && ($("#pwd").val() == "")) msg.push("<?php printMLText("js_no_pwd");?>");
if(($("#pwd").val() != $("#pwdconf").val())&&($("#pwd").val() != "")&&($("#pwdconf").val() != "")) msg.push("<?php printMLText("js_pwd_not_conf");?>");
if($("#name").val() == "") msg.push("<?php printMLText("js_no_name");?>");
if($("#email").val() == "") msg.push("<?php printMLText("js_no_email");?>");
function runValidation() {
$("#form1").validate({
rules: {
login: {
required: true
},
name: {
required: true
},
<?php
if ($strictformcheck) {
?>
if($("#comment").val() == "") msg.push("<?php printMLText("js_no_comment");?>");
comment: {
required: true
},
<?php
}
?>
if (msg != "") {
noty({
text: msg.join('<br />'),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
_timeout: 1500,
});
return false;
email: {
required: true,
email: true
},
pwdconf: {
equalTo: "#pwd"
}
},
messages: {
login: "<?php printMLText("js_no_login");?>",
name: "<?php printMLText("js_no_name");?>",
<?php
if ($strictformcheck) {
?>
comment: "<?php printMLText("js_no_comment");?>",
<?php
}
else
return true;
?>
email: "<?php printMLText("js_no_email");?>",
pwdconf: "<?php printMLText("js_pwd_not_conf");?>",
}
});
}
$(document).ready( function() {
$('body').on('submit', '#form', function(ev){
if(checkForm()) return;
ev.preventDefault();
});
$( "#selector" ).change(function() {
$('div.ajax').trigger('update', {userid: $(this).val()});
window.history.pushState({"html":"","pageTitle":""},"", '../out/out.UsrMgr.php?userid=' + $(this).val());
@ -212,7 +220,7 @@ $(document).ready( function() {
$workflowmode = $this->params['workflowmode'];
$quota = $this->params['quota'];
?>
<form class="form-horizontal" action="../op/op.UsrMgr.php" method="post" enctype="multipart/form-data" name="form" id="form">
<form class="form-horizontal" action="../op/op.UsrMgr.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<?php
if($currUser) {
echo createHiddenFieldWithKey('edituser');
@ -257,7 +265,7 @@ $(document).ready( function() {
'name'=>'pwdconf',
)
);
if($passwordexpiration > 0) {
if($passwordexpiration > 0 && (!$currUser || !$currUser->isAdmin())) {
$options = array();
if($currUser)
$options[] = array('', getMLText("keep"));
@ -523,6 +531,9 @@ $(document).ready( function() {
$workflowmode = $this->params['workflowmode'];
$quota = $this->params['quota'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
$this->contentStart();
@ -558,7 +569,7 @@ $(document).ready( function() {
$this->columnEnd();
$this->columnStart(4);
?>
<div class="ajax" data-view="UsrMgr" data-action="form" <?php echo ($seluser ? "data-query=\"userid=".$seluser->getID()."\"" : "") ?>></div>
<div class="ajax" data-view="UsrMgr" data-action="form" data-afterload="()=>{runValidation();}" <?php echo ($seluser ? "data-query=\"userid=".$seluser->getID()."\"" : "") ?>></div>
</div>
<?php
$this->columnEnd();

View File

@ -23,6 +23,7 @@ chzn_template_func = function (state) {
var $newstate = $(html);
return $newstate;
};
function escapeHtml(text) {
var map = {
'&': '&amp;',
@ -245,7 +246,6 @@ function initMost() {
}
$(document).ready( function() {
// $('.dropdown-menu a.dropdown-toggle').on('click', function(e) {
$('body').on('click', '.dropdown-menu a.dropdown-toggle', function (e) {
if (!$(this).next().hasClass('show')) {
$(this).parents('.dropdown-menu').first().find('.show').removeClass("show");