mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
seperate html from javascript to make content security policy possible
This commit is contained in:
parent
ff447ba31f
commit
3f778f9a77
|
@ -49,7 +49,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -43,7 +43,7 @@ class SeedDMS_Bootstrap_Style extends SeedDMS_View_Common {
|
|||
} /* }}} */
|
||||
|
||||
function htmlStartPage($title="", $bodyClass="") { /* {{{ */
|
||||
if(method_exists($this, 'js')) {
|
||||
if(1||method_exists($this, 'js')) {
|
||||
/* We still need unsafe-eval, because printDocumentChooserHtml and
|
||||
* printFolderChooserHtml will include a javascript file with ajax
|
||||
* which is evaled by jquery
|
||||
|
@ -1016,7 +1016,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);?>" />
|
||||
|
@ -1032,12 +1032,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, $objvalue, $fieldname='attributes') { /* {{{ */
|
||||
switch($attrdef->getType()) {
|
||||
case SeedDMS_Core_AttributeDefinition::type_boolean:
|
||||
|
@ -1086,10 +1105,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";
|
||||
?>
|
||||
|
@ -1106,7 +1125,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) {
|
||||
|
@ -1116,7 +1139,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
|
||||
} /* }}} */
|
||||
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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";
|
||||
} /* }}} */
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user