mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
64658c06cd
|
@ -214,6 +214,10 @@
|
|||
- propperly check for translation of html email body (Closes: #510)
|
||||
- set mandatory group reviewer/approver when adding a new document or version
|
||||
- fix sending notification mails to group when uploading document via drag&drop
|
||||
- guest login can use any user account
|
||||
- issue warning if document cannot be approved/reviewed anymore, because it has
|
||||
expired
|
||||
- much better form validation based on jquery validation
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.22
|
||||
|
|
|
@ -58,17 +58,15 @@ class SeedDMS_Controller_Login extends SeedDMS_Controller_Common {
|
|||
*/
|
||||
if(!$user && $settings->_enableGuestLogin && (int) $settings->_guestID) {
|
||||
$guestUser = $dms->getUser((int) $settings->_guestID);
|
||||
if(!$guestUser) {
|
||||
$this->setErrorMsg("login_error_text");
|
||||
return false;
|
||||
}
|
||||
if(($login != $guestUser->getLogin())) {
|
||||
if ((!isset($pwd) || strlen($pwd)==0)) {
|
||||
$this->setErrorMsg("login_error_text");
|
||||
return false;
|
||||
if($guestUser) {
|
||||
if(($login != $guestUser->getLogin())) {
|
||||
if ((!isset($pwd) || strlen($pwd)==0)) {
|
||||
$this->setErrorMsg("login_error_text");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$user = $guestUser;
|
||||
}
|
||||
} else {
|
||||
$user = $guestUser;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ ALTER TABLE tblDocuments ADD CONSTRAINT `tblDocuments_folder` FOREIGN KEY (`fold
|
|||
|
||||
CALL DROPFK('tblDocumentContent', 'tblDocumentContent_document');
|
||||
|
||||
ALTER TABLE tblDocumentContent DROP PRIMARY KEY;
|
||||
-- ALTER TABLE tblDocumentContent DROP PRIMARY KEY;
|
||||
|
||||
ALTER TABLE tblDocumentContent ADD CONSTRAINT `tblDocumentContent_document` FOREIGN KEY (`document`) REFERENCES `tblDocuments` (`id`);
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
SET SQL_MODE='ALLOW_INVALID_DATES';
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE tblDocumentLinks ADD CONSTRAINT `tblDocumentLinks_target` FOREIGN KEY (`target`) REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE;
|
||||
|
|
|
@ -28,6 +28,8 @@ ALTER TABLE `tblWorkflowDocumentContent` CHANGE `date` `date` datetime NOT NULL;
|
|||
|
||||
ALTER TABLE `tblVersion` CHANGE `date` `date` datetime NOT NULL;
|
||||
|
||||
UPDATE `tblUsers` SET `theme`='bootstrap' WHERE `theme` != '';
|
||||
|
||||
UPDATE tblVersion set major=5, minor=1, subminor=0;
|
||||
|
||||
COMMIT;
|
||||
|
|
|
@ -111,6 +111,7 @@ if(!empty($recs)) {
|
|||
include('update-'.$_GET['version'].'/update.php');
|
||||
}
|
||||
} else {
|
||||
echo "<h3>Error Messages</h3>";
|
||||
echo $errorMsg;
|
||||
}
|
||||
echo "<p><a href=\"install.php\" class=\"btn btn-primary\">Go back to installation and recheck.</a></p>";
|
||||
|
|
|
@ -522,7 +522,7 @@ switch($command) {
|
|||
$notifier->sendDeleteFolderMail($folder, $user);
|
||||
}
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>true, 'message'=>'', 'data'=>''));
|
||||
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_folder_deleted'), 'data'=>''));
|
||||
add_log_line();
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
|
@ -567,7 +567,7 @@ switch($command) {
|
|||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>true, 'message'=>'', 'data'=>''));
|
||||
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_deleted'), 'data'=>''));
|
||||
add_log_line();
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
|
|
|
@ -64,6 +64,9 @@ if (!is_object($version)) {
|
|||
}
|
||||
|
||||
$comment = $_POST["comment"];
|
||||
if ($settings->_strictFormCheck && !$comment) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("version_comment_missing"));
|
||||
}
|
||||
|
||||
if (($oldcomment = $version->getComment()) != $comment) {
|
||||
if($version->setComment($comment)) {
|
||||
|
|
|
@ -44,7 +44,13 @@ if ($action == "addgroup") {
|
|||
}
|
||||
|
||||
$name = $_POST["name"];
|
||||
if(!$name) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("group_name_missing"));
|
||||
}
|
||||
$comment = $_POST["comment"];
|
||||
if ($settings->_strictFormCheck && !$comment) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("group_comment_missing"));
|
||||
}
|
||||
|
||||
if (is_object($dms->getGroupByName($name))) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("group_exists"));
|
||||
|
|
|
@ -51,13 +51,18 @@ if ($action == "adduser") {
|
|||
$pwdexpiration = '';
|
||||
else
|
||||
$pwdexpiration = $_POST["pwdexpiration"];
|
||||
if(!isset($_POST["quota"]))
|
||||
$quota = 0;
|
||||
else
|
||||
$quota = (int) $_POST["quota"];
|
||||
$name = $_POST["name"];
|
||||
if(!$name) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("user_name_missing"));
|
||||
}
|
||||
$email = $_POST["email"];
|
||||
if(!$email) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("user_email_missing"));
|
||||
}
|
||||
$comment = $_POST["comment"];
|
||||
if ($settings->_strictFormCheck && !$comment) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("user_comment_missing"));
|
||||
}
|
||||
$role = $dms->getRole($_POST["role"]);
|
||||
$isHidden = (isset($_POST["ishidden"]) && $_POST["ishidden"]==1 ? 1 : 0);
|
||||
$isDisabled = (isset($_POST["isdisabled"]) && $_POST["isdisabled"]==1 ? 1 : 0);
|
||||
|
|
|
@ -48,9 +48,10 @@ if (isset($_GET["msg"]) && strlen($_GET["msg"])>0) {
|
|||
$themes = UI::getStyles();
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array());
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms));
|
||||
if($view) {
|
||||
$view->setParam('enableguestlogin', $settings->_enableGuestLogin);
|
||||
$view->setParam('guestid', $settings->_guestID);
|
||||
$view->setParam('enablepasswordforgotten', $settings->_enablePasswordForgotten);
|
||||
$view->setParam('referrer', $refer);
|
||||
$view->setParam('themes', $themes);
|
||||
|
|
|
@ -40,6 +40,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, 'userfile', 'adddocform');
|
||||
}
|
||||
|
@ -79,16 +80,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) {
|
||||
?>
|
||||
|
@ -179,6 +170,7 @@ $(document).ready(function() {
|
|||
$accessop = $this->params['accessobject'];
|
||||
|
||||
$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');
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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');
|
||||
|
@ -323,6 +332,9 @@ $(document).ready( function() {
|
|||
$selattrdef = $this->params['selattrdef'];
|
||||
$accessop = $this->params['accessobject'];
|
||||
|
||||
$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();
|
||||
|
@ -405,7 +417,7 @@ $(document).ready( function() {
|
|||
$this->columnStart(6);
|
||||
?>
|
||||
<?php if($accessop->check_view_access($this, array('action'=>'form'))) { ?>
|
||||
<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 } ?>
|
||||
<?php
|
||||
$this->columnEnd();
|
||||
|
|
|
@ -1463,6 +1463,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
function printFileChooserJs() { /* {{{ */
|
||||
?>
|
||||
$(document).ready(function() {
|
||||
/* Triggered after the file has been selected */
|
||||
$(document).on('change', '.btn-file :file', function() {
|
||||
var input = $(this),
|
||||
numFiles = input.get(0).files ? input.get(0).files.length : 1,
|
||||
|
@ -1490,9 +1491,9 @@ $(document).ready(function() {
|
|||
<div id="'.$id.'-upload-files">
|
||||
<div id="'.$id.'-upload-file" class="upload-file">
|
||||
<div class="input-append">
|
||||
<input type="text" class="form-control" readonly>
|
||||
<input type="text" class="form-control" id="kkll'.$id.'" readonly>
|
||||
<span class="btn btn-secondary btn-file">
|
||||
'.getMLText("browse").'… <input id="'.$id.'" type="file" name="'.$varname.'"'.($multiple ? " multiple" : "").($accept ? ' accept="'.$accept.'"' : "").'>
|
||||
'.getMLText("browse").'… <input id="'.$id.'" type="file" name="'.$varname.'"'.($multiple ? " multiple" : "").($accept ? ' accept="'.$accept.'"' : "").' data-target-highlight="kkll'.$id.'">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1600,7 +1601,7 @@ $(document).ready(function() {
|
|||
else
|
||||
$folderid = $folder->getID();
|
||||
$content = '';
|
||||
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
|
||||
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" data-target-highlight=\"choosedocsearch".$formid."\" value=\"". (($default) ? $default->getID() : "") ."\">";
|
||||
$content .= "<div class=\"input-append\">\n";
|
||||
$content .= "<input type=\"text\" id=\"choosedocsearch".$formid."\" data-target=\"".$formid."\" data-provide=\"typeahead\" name=\"docname".$formid."\" value=\"". (($default) ? htmlspecialchars($default->getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\"".($default ? ' title="'.htmlspecialchars($default->getFolder()->getFolderPathPlain().' / '.$default->getName()).'"' : '')." />";
|
||||
$content .= "<button type=\"button\" class=\"btn\" id=\"cleardocument".$form."\" data-target=\"".$formid."\"><i class=\"fa fa-remove\"></i></button>";
|
||||
|
@ -1664,7 +1665,7 @@ function folderSelected<?php echo $formid ?>(id, name) {
|
|||
$formname = "targetid";
|
||||
$formid = md5($formname.$form);
|
||||
$content = '';
|
||||
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
|
||||
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\" data-target-highlight=\"choosefoldersearch".$formid."\">";
|
||||
$content .= "<div class=\"input-append\">\n";
|
||||
$content .= "<input type=\"text\" id=\"choosefoldersearch".$formid."\" data-target=\"".$formid."\" data-provide=\"typeahead\" name=\"targetname".$formid."\" value=\"". (($default) ? htmlspecialchars($default->getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\" target=\"".$formid."\"".($default ? ' title="'.htmlspecialchars($default->getFolderPathPlain()).'"' : '')."/>";
|
||||
$content .= "<button type=\"button\" class=\"btn\" id=\"clearfolder".$formid."\" data-target=\"".$formid."\"><i class=\"fa fa-remove\"></i></button>";
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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>";
|
||||
|
|
|
@ -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());
|
||||
|
@ -297,6 +281,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();
|
||||
|
@ -335,7 +322,7 @@ $(document).ready( function() {
|
|||
$this->columnStart(8);
|
||||
if($accessop->check_view_access($this, array('action'=>'form'))) {
|
||||
?>
|
||||
<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();
|
||||
|
|
|
@ -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'];
|
||||
|
@ -112,6 +93,7 @@ $(document).ready( function() {
|
|||
$enable2factauth = $this->params['enable2factauth'];
|
||||
|
||||
$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();
|
||||
|
@ -120,9 +102,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)."'/>";
|
||||
}
|
||||
|
@ -187,13 +169,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";
|
||||
|
|
|
@ -133,9 +133,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();
|
||||
} /* }}} */
|
||||
|
@ -150,6 +174,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();
|
||||
|
@ -159,7 +186,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(
|
||||
|
@ -186,7 +213,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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -250,16 +250,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')); ?>
|
||||
|
@ -672,9 +669,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();
|
||||
} /* }}} */
|
||||
|
|
|
@ -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) {
|
||||
?>
|
||||
|
@ -156,6 +147,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');
|
||||
|
|
|
@ -36,44 +36,52 @@ 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'));
|
||||
$this->printFolderChooserJs("form");
|
||||
?>
|
||||
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());
|
||||
|
@ -237,7 +245,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');
|
||||
|
@ -282,7 +290,7 @@ $(document).ready( function() {
|
|||
'name'=>'pwdconf',
|
||||
)
|
||||
);
|
||||
if($passwordexpiration > 0) {
|
||||
if($passwordexpiration > 0 && (!$currUser || !$currUser->isAdmin())) {
|
||||
$options = array();
|
||||
if($currUser)
|
||||
$options[] = array('', getMLText("keep"));
|
||||
|
@ -574,6 +582,9 @@ $(document).ready( function() {
|
|||
$quota = $this->params['quota'];
|
||||
$accessobject = $this->params['accessobject'];
|
||||
|
||||
$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();
|
||||
|
@ -614,7 +625,7 @@ $(document).ready( function() {
|
|||
$this->columnStart(8);
|
||||
?>
|
||||
<?php if($accessobject->check_view_access($this, array('action'=>'form'))) { ?>
|
||||
<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>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
|
|
|
@ -167,7 +167,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
$document = $this->params['document'];
|
||||
|
||||
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(){
|
||||
$("#filterRecipientsInput").on("keyup", function() {
|
||||
|
@ -184,10 +184,24 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
$latestContent = $document->getLatestContent();
|
||||
$this->printTimelineJs('out.ViewDocument.php?action=timelinedata&documentid='.$latestContent->getDocument()->getID(), 300, '', date('Y-m-d'));
|
||||
}
|
||||
// $this->printDocumentChooserJs("form1");
|
||||
$this->printDeleteDocumentButtonJs();
|
||||
/* Add js for catching click on document in one page mode */
|
||||
$this->printClickDocumentJs();
|
||||
?>
|
||||
$(document).ready( function() {
|
||||
$("#form1").validate({
|
||||
ignore: [],
|
||||
rules: {
|
||||
docid: {
|
||||
required: true
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
docid: "<?php printMLText("js_no_document");?>",
|
||||
},
|
||||
});
|
||||
});
|
||||
<?php
|
||||
} /* }}} */
|
||||
|
||||
function documentInfos() { /* {{{ */
|
||||
|
@ -532,9 +546,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
$this->columnStart(4);
|
||||
if ($file_exists) {
|
||||
if ($viewonlinefiletypes && (in_array(strtolower($latestContent->getFileType()), $viewonlinefiletypes) || in_array(strtolower($latestContent->getMimeType()), $viewonlinefiletypes))) {
|
||||
print "<a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$latestContent->getDocument()->getId()."&version=". $latestContent->getVersion()."\">";
|
||||
if($accessobject->check_controller_access('ViewOnline', array('action'=>'run')))
|
||||
print "<a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$latestContent->getDocument()->getId()."&version=". $latestContent->getVersion()."\">";
|
||||
} else {
|
||||
print "<a href=\"../op/op.Download.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion()."\">";
|
||||
if($accessobject->check_controller_access('Download', array('action'=>'version')))
|
||||
print "<a href=\"../op/op.Download.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion()."\">";
|
||||
}
|
||||
}
|
||||
$previewer->createPreview($latestContent);
|
||||
|
@ -543,7 +559,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
} else {
|
||||
print "<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
}
|
||||
if ($file_exists) {
|
||||
if ($file_exists && ($accessobject->check_controller_access('ViewOnline', array('action'=>'run')) || $accessobject->check_controller_access('Download', array('action'=>'version')))) {
|
||||
print "</a>";
|
||||
}
|
||||
// print "</td>\n";
|
||||
|
@ -587,9 +603,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
$this->columnStart(4);
|
||||
if ($file_exists){
|
||||
$items = array();
|
||||
$items[] = array('link'=>"../op/op.Download.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'download', 'label'=>'download');
|
||||
if ($viewonlinefiletypes && (in_array(strtolower($latestContent->getFileType()), $viewonlinefiletypes) || in_array(strtolower($latestContent->getMimeType()), $viewonlinefiletypes)))
|
||||
$items[] = array('link'=>"../op/op.ViewOnline.php?documentid=".$latestContent->getDocument()->getId()."&version=". $latestContent->getVersion(), 'icon'=>'eye', 'label'=>'view_online', 'target'=>'_blank');
|
||||
if($accessobject->check_controller_access('Download', array('action'=>'version')))
|
||||
$items[] = array('link'=>"../op/op.Download.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'download', 'label'=>'download');
|
||||
if($accessobject->check_controller_access('ViewOnline', array('action'=>'run')))
|
||||
if ($viewonlinefiletypes && (in_array(strtolower($latestContent->getFileType()), $viewonlinefiletypes) || in_array(strtolower($latestContent->getMimeType()), $viewonlinefiletypes)))
|
||||
$items[] = array('link'=>"../op/op.ViewOnline.php?documentid=".$latestContent->getDocument()->getId()."&version=". $latestContent->getVersion(), 'icon'=>'eye', 'label'=>'view_online', 'target'=>'_blank');
|
||||
if($newitems = $this->callHook('extraVersionViews', $latestContent))
|
||||
$items = array_merge($items, $newitems);
|
||||
if($items) {
|
||||
|
@ -692,6 +710,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
$this->htmlAddHeader('<link href="../styles/bootstrap/timeline/timeline.css" rel="stylesheet">'."\n", 'css');
|
||||
$this->htmlAddHeader('<script type="text/javascript" src="../styles/bootstrap/timeline/timeline-min.js"></script>'."\n", 'js');
|
||||
$this->htmlAddHeader('<script type="text/javascript" src="../styles/bootstrap/timeline/timeline-locales.js"></script>'."\n", 'js');
|
||||
$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);
|
||||
|
@ -882,6 +902,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
?>
|
||||
<div class="tab-pane <?php if($currenttab == 'revapp') echo 'active'; ?>" id="revapp" role="tabpanel">
|
||||
<?php
|
||||
if($document->hasExpired())
|
||||
$this->warningMsg(getMLText('cannot_revapp_expired_docs'));
|
||||
$this->rowStart();
|
||||
/* Just check fo an exting reviewStatus, even workflow mode is set
|
||||
* to traditional_only_approval. There may be old documents which
|
||||
|
@ -1753,7 +1775,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
if ($accessobject->check_view_access('AddDocumentLink')){
|
||||
?>
|
||||
<br>
|
||||
<form action="../op/op.AddDocumentLink.php" name="form1" class="form-horizontal">
|
||||
<form action="../op/op.AddDocumentLink.php" id="form1" name="form1" class="form-horizontal">
|
||||
<input type="hidden" name="documentid" value="<?php print $documentid;?>">
|
||||
<?php echo createHiddenFieldWithKey('adddocumentlink'); ?>
|
||||
<?php $this->contentContainerStart(); ?>
|
||||
|
|
|
@ -226,9 +226,9 @@ $('body').on('click', '.order-btn', function(ev) {
|
|||
echo "SeedDMSUpload.setEditBtnLabel('".getMLText("edit_document_props")."');";
|
||||
$mus2 = SeedDMS_Core_File::parse_filesize(ini_get("upload_max_filesize"));
|
||||
if($maxuploadsize && $maxuploadsize < $mus2)
|
||||
echo "SeedDMSUpload.setMaxFileSize($maxuploadsize);";
|
||||
echo "SeedDMSUpload.setMaxFileSize($maxuploadsize);\n";
|
||||
else
|
||||
echo "SeedDMSUpload.setMaxFileSize($mus2);";
|
||||
echo "SeedDMSUpload.setMaxFileSize($mus2);\n";
|
||||
echo "SeedDMSUpload.setMaxFileSizeMsg('".getMLText("uploading_maxsize")."');";
|
||||
}
|
||||
|
||||
|
|
|
@ -33,33 +33,22 @@ class SeedDMS_View_WorkflowActionsMgr 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(num)
|
||||
{
|
||||
msg = new Array()
|
||||
|
||||
if($("#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 runValidation() {
|
||||
$("#form1").validate({
|
||||
rules: {
|
||||
name: {
|
||||
required: true
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
name: "<?php printMLText("js_no_name");?>",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready( function() {
|
||||
$('body').on('submit', '#form', function(ev){
|
||||
if(checkForm()) return;
|
||||
ev.preventDefault();
|
||||
});
|
||||
$( "#selector" ).change(function() {
|
||||
$('div.ajax').trigger('update', {workflowactionid: $(this).val()});
|
||||
});
|
||||
|
@ -106,21 +95,13 @@ $(document).ready( function() {
|
|||
$selworkflowaction = $this->params['selworkflowaction'];
|
||||
|
||||
if($selworkflowaction && !$selworkflowaction->isUsed()) {
|
||||
?>
|
||||
<div class="btn-group">
|
||||
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<?php echo getMLText('action'); ?>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<?php
|
||||
if(!$selworkflowaction->isUsed()) {
|
||||
echo '<li><a href="../op/op.RemoveWorkflowAction.php?workflowactionid='.$selworkflowaction->getID().'&formtoken='.createFormKey('removeworkflowaction').'"><i class="fa fa-remove"></i> '.getMLText("rm_workflow_action").'</a><li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
$button = array(
|
||||
'label'=>getMLText('action'),
|
||||
'menuitems'=>array(
|
||||
)
|
||||
);
|
||||
$button['menuitems'][] = array('label'=>'<i class="fa fa-remove"></i> '.getMLText("rm_workflow_action"), 'link'=>'../op/op.RemoveWorkflowAction.php?workflowactionid='.$selworkflowaction->getID().'&formtoken='.createFormKey('removeworkflowaction'));
|
||||
self::showButtonwithMenu($button);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
|
@ -131,7 +112,7 @@ $(document).ready( function() {
|
|||
}
|
||||
}
|
||||
?>
|
||||
<form action="../op/op.WorkflowActionsMgr.php" method="post" class="form-horizontal">
|
||||
<form action="../op/op.WorkflowActionsMgr.php" method="post" class="form-horizontal" id="form1" name="form1">
|
||||
<?php
|
||||
if($action) {
|
||||
echo createHiddenFieldWithKey('editworkflowaction');
|
||||
|
@ -176,6 +157,9 @@ $(document).ready( function() {
|
|||
|
||||
$workflowactions = $dms->getAllWorkflowActions();
|
||||
|
||||
$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();
|
||||
|
@ -209,7 +193,7 @@ $(document).ready( function() {
|
|||
$this->columnEnd();
|
||||
$this->columnStart(8);
|
||||
?>
|
||||
<div class="ajax" data-view="WorkflowActionsMgr" data-action="form" <?php echo ($selworkflowaction ? "data-query=\"workflowactionid=".$selworkflowaction->getID()."\"" : "") ?>></div>
|
||||
<div class="ajax" data-view="WorkflowActionsMgr" data-action="form" data-afterload="()=>{runValidation();}" <?php echo ($selworkflowaction ? "data-query=\"workflowactionid=".$selworkflowaction->getID()."\"" : "") ?>></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -33,7 +33,23 @@ class SeedDMS_View_WorkflowMgr 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() {
|
||||
$("#form1").validate({
|
||||
rules: {
|
||||
name: {
|
||||
required: true
|
||||
},
|
||||
initstate: {
|
||||
required: true
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
name: "<?php printMLText("js_no_name");?>",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function checkForm(num)
|
||||
{
|
||||
|
@ -154,8 +170,7 @@ $(document).ready(function() {
|
|||
}
|
||||
}
|
||||
?>
|
||||
<?php $this->contentContainerStart(); ?>
|
||||
<form class="form-horizontal" action="../op/op.WorkflowMgr.php" method="post" enctype="multipart/form-data">
|
||||
<form class="form-horizontal" action="../op/op.WorkflowMgr.php" method="post" enctype="multipart/form-data" id="form1" name="form1">
|
||||
<?php
|
||||
if($workflow) {
|
||||
echo createHiddenFieldWithKey('editworkflow');
|
||||
|
@ -169,6 +184,7 @@ $(document).ready(function() {
|
|||
<input type="hidden" name="action" value="addworkflow">
|
||||
<?php
|
||||
}
|
||||
$this->contentContainerStart();
|
||||
$this->formField(
|
||||
getMLText("workflow_name"),
|
||||
array(
|
||||
|
@ -191,10 +207,10 @@ $(document).ready(function() {
|
|||
'options'=>$options
|
||||
)
|
||||
);
|
||||
$this->contentContainerEnd();
|
||||
$this->formSubmit('<i class="fa fa-save"></i> '.getMLText("save"));
|
||||
?>
|
||||
</form>
|
||||
<?php $this->contentContainerEnd(); ?>
|
||||
<?php
|
||||
if($workflow) {
|
||||
$actions = $dms->getAllWorkflowActions();
|
||||
|
@ -250,7 +266,7 @@ $(document).ready(function() {
|
|||
}
|
||||
echo "</tbody></table>";
|
||||
?>
|
||||
<form class="form-inline" action="../op/op.AddTransitionToWorkflow.php" method="post">
|
||||
<form class="form-inline" action="../op/op.AddTransitionToWorkflow.php" method="post" id="form2" name="form2">
|
||||
<?php
|
||||
echo "<table class=\"table table-condensed\"><thead></thead><tbody>";
|
||||
echo "<tr>";
|
||||
|
@ -294,7 +310,7 @@ $(document).ready(function() {
|
|||
?>
|
||||
<?php echo createHiddenFieldWithKey('addtransitiontoworkflow'); ?>
|
||||
<input type="hidden" name="workflow" value="<?php print $workflow->getID();?>">
|
||||
<input type="submit" class="btn" value="<?php printMLText("add");?>">
|
||||
<input type="submit" class="btn btn-primary" value="<?php printMLText("add");?>">
|
||||
<?php
|
||||
echo "</td>";
|
||||
echo "</tr>\n";
|
||||
|
@ -319,6 +335,9 @@ $(document).ready(function() {
|
|||
$workflows = $this->params['allworkflows'];
|
||||
$workflowstates = $this->params['allworkflowstates'];
|
||||
|
||||
$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();
|
||||
|
@ -352,7 +371,7 @@ $(document).ready(function() {
|
|||
$this->columnEnd();
|
||||
$this->columnStart(7);
|
||||
?>
|
||||
<div class="ajax" data-view="WorkflowMgr" data-action="form" <?php echo ($selworkflow ? "data-query=\"workflowid=".$selworkflow->getID()."\"" : "") ?>></div>
|
||||
<div class="ajax" data-view="WorkflowMgr" data-action="form" data-afterload="()=>{runValidation();}" <?php echo ($selworkflow ? "data-query=\"workflowid=".$selworkflow->getID()."\"" : "") ?>></div>
|
||||
<?php
|
||||
$this->columnEnd();
|
||||
$this->rowEnd();
|
||||
|
|
|
@ -33,34 +33,22 @@ class SeedDMS_View_WorkflowStatesMgr 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(num)
|
||||
{
|
||||
msg = new Array();
|
||||
|
||||
if($("#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 runValidation() {
|
||||
$("#form1").validate({
|
||||
rules: {
|
||||
name: {
|
||||
required: true
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
name: "<?php printMLText("js_no_name");?>",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('body').on('submit', '#form1', function(ev){
|
||||
if(checkForm()) return;
|
||||
ev.preventDefault();
|
||||
});
|
||||
$( "#selector" ).change(function() {
|
||||
$('div.ajax').trigger('update', {workflowstateid: $(this).val()});
|
||||
});
|
||||
|
@ -107,21 +95,13 @@ $(document).ready(function() {
|
|||
$selworkflowstate = $this->params['selworkflowstate'];
|
||||
|
||||
if($selworkflowstate && !$selworkflowstate->isUsed()) {
|
||||
?>
|
||||
<div class="btn-group">
|
||||
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<?php echo getMLText('action'); ?>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<?php
|
||||
if(!$selworkflowstate->isUsed()) {
|
||||
echo '<li><a href="../op/op.RemoveWorkflowState.php?workflowstateid='.$selworkflowstate->getID().'&formtoken='.createFormKey('removeworkflowstate').'"><i class="fa fa-remove"></i> '.getMLText("rm_workflow_state").'</a><li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
$button = array(
|
||||
'label'=>getMLText('action'),
|
||||
'menuitems'=>array(
|
||||
)
|
||||
);
|
||||
$button['menuitems'][] = array('label'=>'<i class="fa fa-remove"></i> '.getMLText("rm_workflow_state"), 'link'=>'../op/op.RemoveWorkflowState.php?workflowstateid='.$selworkflowstate->getID().'&formtoken='.createFormKey('removeworkflowstate'));
|
||||
self::showButtonwithMenu($button);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
|
@ -132,7 +112,7 @@ $(document).ready(function() {
|
|||
}
|
||||
}
|
||||
?>
|
||||
<form action="../op/op.WorkflowStatesMgr.php" method="post" class="form-horizontal">
|
||||
<form action="../op/op.WorkflowStatesMgr.php" method="post" class="form-horizontal" id="form1" name="form1">
|
||||
<?php
|
||||
if($state) {
|
||||
echo createHiddenFieldWithKey('editworkflowstate');
|
||||
|
@ -189,6 +169,9 @@ $(document).ready(function() {
|
|||
|
||||
$workflowstates = $dms->getAllWorkflowStates();
|
||||
|
||||
$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();
|
||||
|
@ -222,7 +205,7 @@ $(document).ready(function() {
|
|||
$this->columnEnd();
|
||||
$this->columnStart(8);
|
||||
?>
|
||||
<div class="ajax" data-view="WorkflowStatesMgr" data-action="form" <?php echo ($selworkflowstate ? "data-query=\"workflowstateid=".$selworkflowstate->getID()."\"" : "") ?>></div>
|
||||
<div class="ajax" data-view="WorkflowStatesMgr" data-action="form" data-afterload="()=>{runValidation();}" <?php echo ($selworkflowstate ? "data-query=\"workflowstateid=".$selworkflowstate->getID()."\"" : "") ?>></div>
|
||||
<?php
|
||||
$this->columnEnd();
|
||||
$this->rowEnd();
|
||||
|
|
34
views/bootstrap/styles/validation-default.js
Normal file
34
views/bootstrap/styles/validation-default.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
jQuery.validator.setDefaults({
|
||||
errorElement: "em",
|
||||
errorClass: 'help-block',
|
||||
errorPlacement: function ( error, element ) {
|
||||
// Add the `error` class to the control-group
|
||||
$(element).closest('.control-group').addClass('error');
|
||||
if ( element.prop( "type" ) === "checkbox" ) {
|
||||
error.insertAfter( element.parent( "label" ) );
|
||||
} else {
|
||||
error.insertAfter( element );
|
||||
}
|
||||
|
||||
// Add the span element, if doesn't exists, and apply the icon classes to it.
|
||||
if ( !element.next( "span" )[ 0 ] ) {
|
||||
$( "<span class='glyphicon glyphicon-remove form-control-feedback'></span>" ).insertAfter( element );
|
||||
}
|
||||
},
|
||||
invalidHandler: function(e, validator) {
|
||||
noty({
|
||||
text: (validator.numberOfInvalids() == 1) ? trans.js_form_error.replace('#', validator.numberOfInvalids()) : trans.js_form_errors.replace('#', validator.numberOfInvalids()),
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
timeout: 3500,
|
||||
});
|
||||
},
|
||||
highlight: function ( element, errorClass, validClass ) {
|
||||
$( element ).parents( ".control-group" ).addClass( "error" ).removeClass( "success" );
|
||||
},
|
||||
unhighlight: function ( element, errorClass, validClass ) {
|
||||
$( element ).parents( ".control-group" ).addClass( "success" ).removeClass( "error" );
|
||||
}
|
||||
});
|
|
@ -1086,7 +1086,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
function formField($title, $value, $params=array()) { /* {{{ */
|
||||
if($title !== null) {
|
||||
echo "<div class=\"form-group row\">";
|
||||
echo " <label class=\"col-sm-4 col-lg-4 pt-0 col-form-label\"".(!empty($params['help']) ? " title=\"".$params['help']."\" style=\"cursor: help;\"" : "").">".$title.":</label>";
|
||||
echo " <label class=\"col-sm-4 col-lg-4 pt-0 col-form-label\"".(!empty($params['help']) ? " title=\"".$params['help']."\" style=\"cursor: help;\"" : "").(!empty($value['id']) ? ' for="'.$value['id'].'"' : '').">".$title.":</label>";
|
||||
echo " <div class=\"col-sm-8 col-lg-8\">";
|
||||
}
|
||||
if(isset($params['field_wrap'][0]))
|
||||
|
@ -1386,6 +1386,15 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
function printFileChooserJs() { /* {{{ */
|
||||
?>
|
||||
$(document).ready(function() {
|
||||
/* do not use bootstrap4 custom form element because it is difficult to localize
|
||||
$(document).on('change', '.custom-file-input',function(){
|
||||
//get the file name
|
||||
var fileName = $(this).val().replace(/\\/g, '/').replace(/.*\//, '');
|
||||
//replace the "Choose a file" label
|
||||
$(this).next('.custom-file-label').html(fileName);
|
||||
})
|
||||
*/
|
||||
/* Triggered after the file has been selected */
|
||||
$(document).on('change', '.btn-file :file', function() {
|
||||
var input = $(this),
|
||||
numFiles = input.get(0).files ? input.get(0).files.length : 1,
|
||||
|
@ -1409,14 +1418,23 @@ $(document).ready(function() {
|
|||
|
||||
function getFileChooserHtml($varname='userfile', $multiple=false, $accept='') { /* {{{ */
|
||||
$id = preg_replace('/[^A-Za-z]/', '', $varname);
|
||||
/* do not use bootstrap4 custom form element because it is difficult to localize
|
||||
$html = '
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="'.$id.'" name="'.$varname.'">
|
||||
<label class="custom-file-label" for="'.$id.'">'.getMLText("browse").'…'.'</label>
|
||||
</div>
|
||||
';
|
||||
return $html;
|
||||
*/
|
||||
$html = '
|
||||
<div id="'.$id.'-upload-files">
|
||||
<div id="'.$id.'-upload-file" class="upload-file">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" readonly>
|
||||
<input type="text" class="form-control" id="kkll'.$id.'" readonly>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary btn-file">
|
||||
'.getMLText("browse").'… <input id="'.$id.'" type="file" name="'.$varname.'"'.($multiple ? " multiple" : "").($accept ? ' accept="'.$accept.'"' : "").'">
|
||||
'.getMLText("browse").'… <input id="'.$id.'" type="file" name="'.$varname.'"'.($multiple ? " multiple" : "").($accept ? ' accept="'.$accept.'"' : "").' data-target-highlight="kkll'.$id.'">
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1528,7 +1546,7 @@ $(document).ready(function() {
|
|||
else
|
||||
$folderid = $folder->getID();
|
||||
$content = '';
|
||||
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
|
||||
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" data-target-highlight=\"choosedocsearch".$formid."\" value=\"". (($default) ? $default->getID() : "") ."\">";
|
||||
$content .= "<div class=\"input-group\">\n";
|
||||
$content .= "<input class=\"form-control\" type=\"text\" id=\"choosedocsearch".$formid."\" data-target=\"".$formid."\" data-provide=\"typeahead\" name=\"docname".$formid."\"value=\"" . (($default) ? htmlspecialchars($default->getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\" />";
|
||||
$content .= '<div class="input-group-append">';
|
||||
|
@ -1595,7 +1613,7 @@ function folderSelected<?php echo $formid ?>(id, name) {
|
|||
$formname = "targetid";
|
||||
$formid = md5($formname.$form);
|
||||
$content = '';
|
||||
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
|
||||
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\" data-target-highlight=\"choosefoldersearch".$formid."\">";
|
||||
$content .= "<div class=\"input-group\">\n";
|
||||
$content .= "<input class=\"form-control\" type=\"text\" id=\"choosefoldersearch".$formid."\" data-target=\"".$formid."\" data-provide=\"typeahead\" name=\"targetname".$formid."\" value=\"". (($default) ? htmlspecialchars($default->getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\" target=\"".$formid."\"/>";
|
||||
$content .= '<div class="input-group-append">';
|
||||
|
|
|
@ -23,6 +23,7 @@ chzn_template_func = function (state) {
|
|||
var $newstate = $(html);
|
||||
return $newstate;
|
||||
};
|
||||
|
||||
function escapeHtml(text) {
|
||||
var map = {
|
||||
'&': '&',
|
||||
|
@ -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");
|
||||
|
|
33
views/bootstrap4/styles/validation-default.js
Normal file
33
views/bootstrap4/styles/validation-default.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
jQuery.validator.setDefaults({
|
||||
errorElement: 'div',
|
||||
errorClass: 'invalid-feedback',
|
||||
errorPlacement: function(error, element) {
|
||||
if(element.parent('.input-group').length) {
|
||||
error.insertAfter(element.parent());
|
||||
} else {
|
||||
error.insertAfter(element);
|
||||
}
|
||||
},
|
||||
invalidHandler: function(e, validator) {
|
||||
noty({
|
||||
text: (validator.numberOfInvalids() == 1) ? trans.js_form_error.replace('#', validator.numberOfInvalids()) : trans.js_form_errors.replace('#', validator.numberOfInvalids()),
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
timeout: 3500,
|
||||
});
|
||||
},
|
||||
highlight: function (element, errorClass, validClass) {
|
||||
if($(element).data('target-highlight'))
|
||||
$('#'+$(element).data('target-highlight')).addClass('is-invalid');
|
||||
else
|
||||
$(element).addClass('is-invalid');
|
||||
},
|
||||
unhighlight: function (element, errorClass, validClass) {
|
||||
if($(element).data('target-highlight'))
|
||||
$('#'+$(element).data('target-highlight')).removeClass('is-invalid');
|
||||
else
|
||||
$(element).removeClass('is-invalid');
|
||||
}
|
||||
});
|
|
@ -160,6 +160,8 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
|||
require_once("../inc/inc.ClassLdapAuthentication.php");
|
||||
$authobj = new SeedDMS_LdapAuthentication($this->dms, $settings);
|
||||
$userobj = $authobj->authenticate($user, $pass);
|
||||
if($userobj && $this->logger)
|
||||
$this->logger->log('check_auth: type='.$type.', user='.$user.' authenticated against LDAP', PEAR_LOG_INFO);
|
||||
} /* }}} */
|
||||
|
||||
/* Authenticate against SeedDMS database {{{ */
|
||||
|
@ -167,6 +169,8 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
|||
require_once("../inc/inc.ClassDbAuthentication.php");
|
||||
$authobj = new SeedDMS_DbAuthentication($this->dms, $settings);
|
||||
$userobj = $authobj->authenticate($user, $pass);
|
||||
if($userobj && $this->logger)
|
||||
$this->logger->log('check_auth: type='.$type.', user='.$user.' authenticated against database', PEAR_LOG_INFO);
|
||||
} /* }}} */
|
||||
|
||||
if(!$userobj) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user