Merge branch 'seeddms-4.3.x' into seeddms-5.0.x

This commit is contained in:
Uwe Steinmann 2015-12-15 21:04:45 +01:00
commit 1acad75f83
19 changed files with 259 additions and 152 deletions

View File

@ -51,7 +51,7 @@ $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'strictformcheck'=>$settings->_strictFormCheck, 'enablelargefileupload'=>$settings->_enableLargeFileUpload));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
$view($_GET);
exit;
}

View File

@ -53,7 +53,7 @@ $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'allusers'=>$allUsers, 'allgroups'=>$allGroups));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
$view($_GET);
exit;
}

View File

@ -51,7 +51,7 @@ $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'sortusersinlist'=>$settings->_sortUsersInList));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
$view($_GET);
exit;
}

View File

@ -43,7 +43,7 @@ $view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'dropfold
if($view) {
$view->setParam('cachedir', $settings->_cacheDir);
$view->setParam('previewWidthList', $settings->_previewWidthList);
$view->show();
$view($_GET);
exit;
}

View File

@ -57,7 +57,7 @@ $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'attrdefs'=>$attrdefs, 'strictformcheck'=>$settings->_strictFormCheck, 'orderby'=>$settings->_sortFoldersDefault));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
$view($_GET);
exit;
}

View File

@ -44,7 +44,7 @@ if($_GET['target']) {
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'categories'=>$categories, 'form'=>$target));
if($view) {
$view->show();
$view($_GET);
exit;
}

View File

@ -70,7 +70,7 @@ $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'target'=>$target));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
$view($_GET);
exit;
}

View File

@ -387,7 +387,7 @@ if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) {
$totalPages = (int) (count($entries)/$limit);
if(count($entries)%$limit)
$totalPages++;
if (strcasecmp($_GET["pg"], "all"))
if (!isset($_GET["pg"]) || strcasecmp($_GET["pg"], "all"))
$entries = array_slice($entries, ($pageNumber-1)*$limit, $limit);
// }}}
}

View File

@ -64,7 +64,7 @@ $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'strictformcheck'=>$settings->_strictFormCheck, 'enablelargefileupload'=>$settings->_enableLargeFileUpload, 'enableadminrevapp'=>$settings->_enableAdminRevApp, 'enableownerrevapp'=>$settings->_enableOwnerRevApp, 'enableselfrevapp'=>$settings->_enableSelfRevApp, 'dropfolderdir'=>$settings->_dropFolderDir, 'workflowmode'=>$settings->_workflowMode, 'presetexpiration'=>$settings->_presetExpirationDate));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
$view($_GET);
exit;
}

View File

@ -31,30 +31,17 @@ require_once("class.Bootstrap.php");
*/
class SeedDMS_View_AddFile extends SeedDMS_Bootstrap_Style {
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$folder = $this->params['folder'];
$document = $this->params['document'];
$strictformcheck = $this->params['strictformcheck'];
$enablelargefileupload = $this->params['enablelargefileupload'];
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);
$this->contentStart();
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
function js() { /* {{{ */
?>
<script language="JavaScript">
function checkForm()
{
msg = new Array();
if (document.form1.userfile.value == "") msg.push("<?php printMLText("js_no_file");?>");
if (document.form1.name.value == "") msg.push("<?php printMLText("js_no_name");?>");
if ($("#userfile").val() == "") msg.push("<?php printMLText("js_no_file");?>");
if ($("#name").val() == "") msg.push("<?php printMLText("js_no_name");?>");
<?php
if (isset($settings->_strictFormCheck) && $settings->_strictFormCheck) {
?>
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
if ($("#comment").val() == "") msg.push("<?php printMLText("js_no_comment");?>");
<?php
}
?>
@ -73,8 +60,29 @@ function checkForm()
else
return true;
}
</script>
$(document).ready( function() {
$('body').on('submit', '#fileupload', function(ev){
if(checkForm()) return;
event.preventDefault();
});
});
<?php
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$folder = $this->params['folder'];
$document = $this->params['document'];
$strictformcheck = $this->params['strictformcheck'];
$enablelargefileupload = $this->params['enablelargefileupload'];
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);
$this->contentStart();
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
$this->contentHeading(getMLText("linked_files"));
?>
<div class="alert alert-warning">
@ -89,7 +97,7 @@ function checkForm()
$this->contentContainerStart();
?>
<form action="../op/op.AddFile.php" enctype="multipart/form-data" method="post" name="form1" id="fileupload" onsubmit="return checkForm();">
<form action="../op/op.AddFile.php" enctype="multipart/form-data" method="post" name="form1" id="fileupload">
<input type="hidden" name="documentid" value="<?php print $document->getId(); ?>">
<table class="table-condensed">
<tr>
@ -102,11 +110,11 @@ function checkForm()
</tr>
<tr>
<td><?php printMLText("name");?>:</td>
<td><input type="text" name="name" size="60"></td>
<td><input type="text" name="name" id="name" size="60"></td>
</tr>
<tr>
<td><?php printMLText("comment");?>:</td>
<td><textarea name="comment" rows="4" cols="80"></textarea></td>
<td><textarea name="comment" id="comment" rows="4" cols="80"></textarea></td>
</tr>
<tr>
<td></td>

View File

@ -1063,7 +1063,7 @@ function folderSelected<?php echo $formName ?>(id, name) {
<?php
} /* }}} */
function printKeywordChooser($formName, $keywords='', $fieldname='keywords') { /* {{{ */
function printKeywordChooserHtml($formName, $keywords='', $fieldname='keywords') { /* {{{ */
?>
<div class="input-append">
<input type="text" name="<?php echo $fieldname; ?>" value="<?php print htmlspecialchars($keywords);?>" />
@ -1079,12 +1079,31 @@ function folderSelected<?php echo $formName ?>(id, name) {
</div>
<div class="modal-footer">
<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"><?php printMLText("close") ?></button>
<button class="btn" data-dismiss="modal" aria-hidden="true" onClick="acceptKeywords();"><i class="icon-save"></i> <?php printMLText("save") ?></button>
<button class="btn" data-dismiss="modal" aria-hidden="true" id="acceptkeywords"><i class="icon-save"></i> <?php printMLText("save") ?></button>
</div>
</div>
<?php
} /* }}} */
function printKeywordChooserJs($formName) { /* {{{ */
?>
$('#acceptkeywords').click(function(ev) {
acceptKeywords();
});
<?php
} /* }}} */
function printKeywordChooser($formName, $keywords='', $fieldname='keywords') { /* {{{ */
$this->printKeywordChooserHtml($formName, $keywords, $fieldname);
?>
<script language="JavaScript">
<?php
$this->printKeywordChooserJs($formName);
?>
</script>
<?php
} /* }}} */
function printAttributeEditField($attrdef, $attribute, $fieldname='attributes') { /* {{{ */
switch($attrdef->getType()) {
case SeedDMS_Core_AttributeDefinition::type_boolean:
@ -1135,10 +1154,10 @@ function folderSelected<?php echo $formName ?>(id, name) {
}
} /* }}} */
function printDropFolderChooser($formName, $dropfolderfile="") { /* {{{ */
function printDropFolderChooserHtml($formName, $dropfolderfile="") { /* {{{ */
print "<div class=\"input-append\">\n";
print "<input readonly type=\"text\" id=\"dropfolderfile".$formName."\" name=\"dropfolderfile".$formName."\" value=\"".$dropfolderfile."\">";
print "<button type=\"button\" class=\"btn\" onclick=\"javascript:clearFilename".$formName."();\"><i class=\"icon-remove\"></i></button>";
print "<button type=\"button\" class=\"btn\" id=\"clearFilename".$formName."\"><i class=\"icon-remove\"></i></button>";
print "<a data-target=\"#dropfolderChooser\" href=\"out.DropFolderChooser.php?form=form1&dropfolderfile=".$dropfolderfile."\" role=\"button\" class=\"btn\" data-toggle=\"modal\">".getMLText("choose_target_file")."…</a>\n";
print "</div>\n";
?>
@ -1155,7 +1174,11 @@ function folderSelected<?php echo $formName ?>(id, name) {
<!-- <button class="btn" data-dismiss="modal" aria-hidden="true" onClick="acceptCategories();"><i class="icon-save"></i> <?php printMLText("save") ?></button> -->
</div>
</div>
<script language="JavaScript">
<?php
} /* }}} */
function printDropFolderChooserJs($formName) { /* {{{ */
?>
/* Set up a callback which is called when a folder in the tree is selected */
modalDropfolderChooser = $('#dropfolderChooser');
function fileSelected(name) {
@ -1165,7 +1188,20 @@ function fileSelected(name) {
function clearFilename<?php print $formName ?>() {
$('#dropfolderfile<?php echo $formName ?>').val('');
}
</script>
$('#clearfilename<?php print $formName ?>').click(function(ev) {
$('#dropfolderfile<?php echo $formName ?>').val('');
});
<?php
} /* }}} */
function printDropFolderChooser($formName, $dropfolderfile="") { /* {{{ */
$this->printDropFolderChooserHtml($formName, $dropfolderfile);
?>
<script language="JavaScript">
<?php
$this->printDropFolderChooserJs($formName);
?>
</script>
<?php
} /* }}} */

View File

@ -40,23 +40,9 @@ class SeedDMS_View_DocumentAccess extends SeedDMS_Bootstrap_Style {
print "</select>\n";
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$document = $this->params['document'];
$folder = $this->params['folder'];
$allUsers = $this->params['allusers'];
$allGroups = $this->params['allgroups'];
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);
$this->contentStart();
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
function js() { /* {{{ */
header('Content-Type: application/json');
?>
<script language="JavaScript">
function checkForm()
{
msg = new Array();
@ -78,9 +64,29 @@ function checkForm()
else
return true;
}
</script>
$(document).ready( function() {
$('body').on('submit', '#form1', function(ev){
if(checkForm()) return;
event.preventDefault();
});
});
<?php
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$document = $this->params['document'];
$folder = $this->params['folder'];
$allUsers = $this->params['allusers'];
$allGroups = $this->params['allgroups'];
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);
$this->contentStart();
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
$this->contentHeading(getMLText("edit_document_access"));
$this->contentContainerStart();
@ -233,7 +239,7 @@ function checkForm()
print "</table><br>";
}
?>
<form action="../op/op.DocumentAccess.php" name="form1" onsubmit="return checkForm();">
<form action="../op/op.DocumentAccess.php" name="form1" id="form1">
<?php echo createHiddenFieldWithKey('documentaccess'); ?>
<input type="Hidden" name="documentid" value="<?php print $document->getId()?>">
<input type="Hidden" name="action" value="addaccess">

View File

@ -31,22 +31,9 @@ require_once("class.Bootstrap.php");
*/
class SeedDMS_View_DocumentNotify extends SeedDMS_Bootstrap_Style {
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$folder = $this->params['folder'];
$document = $this->params['document'];
$sortusersinlist = $this->params['sortusersinlist'];
$notifyList = $document->getNotifyList();
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);
$this->contentStart();
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
function js() { /* {{{ */
header('Content-Type: application/json');
?>
<script language="JavaScript">
function checkForm()
{
msg = new Array();
@ -67,9 +54,30 @@ function checkForm()
else
return true;
}
</script>
$(document).ready( function() {
$('body').on('submit', '#form1', function(ev){
if(checkForm()) return;
event.preventDefault();
});
});
<?php
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$folder = $this->params['folder'];
$document = $this->params['document'];
$sortusersinlist = $this->params['sortusersinlist'];
$notifyList = $document->getNotifyList();
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);
$this->contentStart();
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
$this->contentHeading(getMLText("edit_existing_notify"));
$this->contentContainerStart();
@ -107,7 +115,7 @@ function checkForm()
?>
<br>
<form action="../op/op.DocumentNotify.php" name="form1" onsubmit="return checkForm();">
<form action="../op/op.DocumentNotify.php" name="form1" id="form1">
<input type="hidden" name="documentid" value="<?php print $document->getID()?>">
<input type="hidden" name="action" value="addnotify">
<table class="table-condensed">

View File

@ -31,6 +31,15 @@ require_once("class.Bootstrap.php");
*/
class SeedDMS_View_DropFolderChooser extends SeedDMS_Bootstrap_Style {
function js() { /* {{{ */
?>
$('#fileselect').click(function(ev) {
attr_filename = $(ev.currentTarget).attr('filename');
fileSelected(attr_filename);
});
<?php
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
@ -75,12 +84,13 @@ var targetName = document.<?php echo $form?>.dropfolderfile<?php print $form ?>;
if($previewer->hasRawPreview($dir.'/'.$entry, 'dropfolder/')) {
echo "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.DropFolderPreview.php?filename=".$entry."&width=".$previewwidth."\" title=\"".htmlspecialchars($mimetype)."\">";
}
echo "</td><td><span style=\"cursor: pointer;\" onClick=\"fileSelected('".$entry."');\">".$entry."</span></td><td align=\"right\">".SeedDMS_Core_File::format_filesize(filesize($dir.'/'.$entry))."</td><td>".date('Y-m-d H:i:s', filectime($dir.'/'.$entry))."</td></tr>\n";
echo "</td><td><span style=\"cursor: pointer;\" id=\"fileselect\" filename=\"".$entry."\" _onClick=\"fileSelected('".$entry."');\">".$entry."</span></td><td align=\"right\">".SeedDMS_Core_File::format_filesize(filesize($dir.'/'.$entry))."</td><td>".date('Y-m-d H:i:s', filectime($dir.'/'.$entry))."</td></tr>\n";
}
}
}
echo "</tbody>\n";
echo "</table>\n";
echo '<script src="../out/out.DropFolderChooser.php?action=js&'.$_SERVER['QUERY_STRING'].'"></script>'."\n";
}
}

View File

@ -31,31 +31,19 @@ require_once("class.Bootstrap.php");
*/
class SeedDMS_View_EditDocument extends SeedDMS_Bootstrap_Style {
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$folder = $this->params['folder'];
$document = $this->params['document'];
$attrdefs = $this->params['attrdefs'];
function js() { /* {{{ */
$strictformcheck = $this->params['strictformcheck'];
$orderby = $this->params['orderby'];
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);
$this->contentStart();
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
$this->printKeywordChooserJs();
?>
<script language="JavaScript">
function checkForm()
{
msg = new Array();
if (document.form1.name.value == "") msg.push("<?php printMLText("js_no_name");?>");
if ($("#name").val() == "") msg.push("<?php printMLText("js_no_name");?>");
<?php
if ($strictformcheck) {
?>
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
if (document.form1.keywords.value == "") msg.push("<?php printMLText("js_no_keywords");?>");
if ($("#comment").val() == "") msg.push("<?php printMLText("js_no_comment");?>");
if ($("#keywords").val() == "") msg.push("<?php printMLText("js_no_keywords");?>");
<?php
}
?>
@ -74,9 +62,30 @@ function checkForm()
else
return true;
}
</script>
$(document).ready( function() {
$('body').on('submit', '#form1', function(ev){
if(checkForm()) return;
event.preventDefault();
});
});
<?php
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$folder = $this->params['folder'];
$document = $this->params['document'];
$attrdefs = $this->params['attrdefs'];
$strictformcheck = $this->params['strictformcheck'];
$orderby = $this->params['orderby'];
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);
$this->contentStart();
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
$this->contentHeading(getMLText("edit_document_props"));
$this->contentContainerStart();
@ -85,22 +94,22 @@ function checkForm()
else
$expdate = '';
?>
<form action="../op/op.EditDocument.php" name="form1" onsubmit="return checkForm();" method="post">
<form action="../op/op.EditDocument.php" name="form1" id="form1" method="post">
<input type="hidden" name="documentid" value="<?php echo $document->getID() ?>">
<table cellpadding="3">
<tr>
<td class="inputDescription"><?php printMLText("name");?>:</td>
<td><input type="text" name="name" value="<?php print htmlspecialchars($document->getName());?>" size="60"></td>
<td><input type="text" name="name" id="name" value="<?php print htmlspecialchars($document->getName());?>" size="60"></td>
</tr>
<tr>
<td valign="top" class="inputDescription"><?php printMLText("comment");?>:</td>
<td><textarea name="comment" rows="4" cols="80"><?php print htmlspecialchars($document->getComment());?></textarea></td>
<td><textarea name="comment" id="comment" rows="4" cols="80"><?php print htmlspecialchars($document->getComment());?></textarea></td>
</tr>
<tr>
<td valign="top" class="inputDescription"><?php printMLText("keywords");?>:</td>
<td class="standardText">
<?php
$this->printKeywordChooser('form1', $document->getKeywords());
$this->printKeywordChooserHtml('form1', $document->getKeywords());
?>
</td>
</tr>

View File

@ -31,15 +31,10 @@ require_once("class.Bootstrap.php");
*/
class SeedDMS_View_KeywordChooser extends SeedDMS_Bootstrap_Style {
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$categories = $this->params['categories'];
function js() { /* {{{ */
$form = $this->params['form'];
// $this->htmlStartPage(getMLText("use_default_keywords"));
header('Content-Type: application/json');
?>
<script language="JavaScript">
var targetObj = document.<?php echo $form ?>.keywords;
var myTA;
@ -89,7 +84,34 @@ function showKeywords(which) {
obj[which] = document.getElementById("keywords" + id);
obj[which].style.display = "";
}
</script>
$('#categories0').change(function(ev) {
showKeywords(0);
});
$('#categories1').change(function(ev) {
showKeywords(1);
});
$('.insertkeyword').click(function(ev) {
attr_keyword = $(ev.currentTarget).attr('keyword');
insertKeywords(attr_keyword);
});
myTA = document.getElementById("keywordta");
myTA.value = targetObj.value;
myTA.focus();
<?php
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$categories = $this->params['categories'];
$form = $this->params['form'];
// $this->htmlStartPage(getMLText("use_default_keywords"));
?>
<div>
<?php
@ -106,7 +128,7 @@ function showKeywords(which) {
<tr>
<td class="inputDescription"><?php echo getMLText("global_default_keywords")?>:</td>
<td>
<select onchange="showKeywords(0)" id="categories0">
<select _onchange="showKeywords(0)" id="categories0">
<option value="-1"><?php echo getMLText("choose_category")?>
<?php
foreach ($categories as $category) {
@ -136,7 +158,7 @@ function showKeywords(which) {
else {
print "<ul>";
foreach ($lists as $list) {
print "<li><a href='javascript:insertKeywords(\"".htmlspecialchars($list["keywords"])."\");'>".htmlspecialchars($list["keywords"])."</a></li>";
print "<li><a class=\"insertkeyword\" keyword=\"".htmlspecialchars($list["keywords"])."\">".htmlspecialchars($list["keywords"])."</a></li>";
}
print "</ul>";
}
@ -147,7 +169,7 @@ function showKeywords(which) {
<tr>
<td class="inputDescription"><?php echo getMLText("personal_default_keywords")?>:</td>
<td>
<select onchange="showKeywords(1)" id="categories1">
<select _onchange="showKeywords(1)" id="categories1">
<option value="-1"><?php echo getMLText("choose_category")?>
<?php
foreach ($categories as $category) {
@ -188,13 +210,7 @@ function showKeywords(which) {
<?php
$this->contentContainerEnd();
?>
<script language="JavaScript">
myTA = document.getElementById("keywordta");
myTA.value = targetObj.value;
myTA.focus();
</script>
<?php
echo '<script src="../out/out.KeywordChooser.php?action=js&'.$_SERVER['QUERY_STRING'].'"></script>'."\n";
// $this->htmlEndPage();
// echo "</body>\n</html>\n";
} /* }}} */

View File

@ -31,6 +31,12 @@ require_once("class.Bootstrap.php");
*/
class SeedDMS_View_MoveDocument extends SeedDMS_Bootstrap_Style {
function js() { /* {{{ */
header('Content-Type: application/json');
$this->printFolderChooserJs("form1");
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
@ -50,7 +56,7 @@ class SeedDMS_View_MoveDocument extends SeedDMS_Bootstrap_Style {
<table>
<tr>
<td><?php printMLText("choose_target_folder");?>:</td>
<td><?php $this->printFolderChooser("form1", M_READWRITE, -1, $target);?></td>
<td><?php $this->printFolderChooserHtml("form1", M_READWRITE, -1, $target);?></td>
</tr>
<tr>
<td colspan="2"><input type="submit" class="btn" value="<?php printMLText("move");?>"></td>

View File

@ -48,8 +48,6 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
} /* }}} */
function js() { /* {{{ */
$user = $this->params['user'];
header('Content-Type: application/json');
$this->printFolderChooserJs("form1");

View File

@ -50,6 +50,51 @@ $(document).ready( function() {
<?php
} /* }}} */
function js() { /* {{{ */
$strictformcheck = $this->params['strictformcheck'];
$dropfolderdir = $this->params['dropfolderdir'];
$this->printDropFolderChooserJs("form1");
?>
function checkForm()
{
msg = new Array();
<?php if($dropfolderdir) { ?>
if ($("#userfile").val() == "" && $("#dropfolderfileform1").val() == "") msg.push("<?php printMLText("js_no_file");?>");
<?php } else { ?>
if ($("#userfile").val() == "") msg.push("<?php printMLText("js_no_file");?>");
<?php } ?>
<?php
if ($strictformcheck) {
?>
if ($("#comment").val() == "") 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;
event.preventDefault();
});
});
<?php
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
@ -70,42 +115,7 @@ $(document).ready( function() {
$this->contentStart();
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
$this->contentHeading(getMLText("update_document"));
?>
<script language="JavaScript">
function checkForm()
{
msg = new Array();
<?php if($dropfolderdir) { ?>
if (document.form1.userfile.value == "" && document.form1.dropfolderfileform1.value == "") msg.push("<?php printMLText("js_no_file");?>");
<?php } else { ?>
if (document.form1.userfile.value == "") msg.push("<?php printMLText("js_no_file");?>");
<?php } ?>
<?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;
}
</script>
<?php
if ($document->isLocked()) {
$lockingUser = $document->getLockingUser();
@ -148,7 +158,7 @@ function checkForm()
$this->contentContainerStart();
?>
<form action="../op/op.UpdateDocument.php" enctype="multipart/form-data" method="post" name="form1" onsubmit="return checkForm();">
<form action="../op/op.UpdateDocument.php" enctype="multipart/form-data" method="post" name="form1" id="form1">
<input type="hidden" name="documentid" value="<?php print $document->getID(); ?>">
<table class="table-condensed">
@ -163,7 +173,7 @@ function checkForm()
<?php if($dropfolderdir) { ?>
<tr>
<td><?php printMLText("dropfolder_file");?>:</td>
<td><?php $this->printDropFolderChooser("form1");?></td>
<td><?php $this->printDropFolderChooserHtml("form1");?></td>
</tr>
<?php } ?>
<tr>