mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 21:16:07 +00:00
Merge branch 'seeddms-4.3.x' into seeddms-5.0.x
This commit is contained in:
commit
29f4ca0710
|
@ -32,7 +32,7 @@ if (!$user->isAdmin()) {
|
||||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'contentdir'=>$settings->_contentDir));
|
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'contentdir'=>$settings->_contentDir));
|
||||||
if($view) {
|
if($view) {
|
||||||
$view->show();
|
$view($_GET);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ $exclude = intval($_GET["exclude"]);
|
||||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'rootfolderid'=>$settings->_rootFolderID, 'form'=>$form, 'mode'=>$mode, 'exclude'=>$exclude));
|
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'rootfolderid'=>$settings->_rootFolderID, 'form'=>$form, 'mode'=>$mode, 'exclude'=>$exclude));
|
||||||
if($view) {
|
if($view) {
|
||||||
$view->show();
|
$view($_GET);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -354,7 +354,7 @@ if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) {
|
||||||
$pageNumber = (int) $_GET["pg"];
|
$pageNumber = (int) $_GET["pg"];
|
||||||
}
|
}
|
||||||
elseif (!strcasecmp($_GET["pg"], "all")) {
|
elseif (!strcasecmp($_GET["pg"], "all")) {
|
||||||
$limit = 0;
|
// $limit = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,7 +387,7 @@ if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) {
|
||||||
$totalPages = (int) (count($entries)/$limit);
|
$totalPages = (int) (count($entries)/$limit);
|
||||||
if(count($entries)%$limit)
|
if(count($entries)%$limit)
|
||||||
$totalPages++;
|
$totalPages++;
|
||||||
if($limit > 0)
|
if (strcasecmp($_GET["pg"], "all"))
|
||||||
$entries = array_slice($entries, ($pageNumber-1)*$limit, $limit);
|
$entries = array_slice($entries, ($pageNumber-1)*$limit, $limit);
|
||||||
// }}}
|
// }}}
|
||||||
}
|
}
|
||||||
|
@ -433,7 +433,7 @@ if(count($entries) == 1) {
|
||||||
$view->setParam('workflowmode', $settings->_workflowMode);
|
$view->setParam('workflowmode', $settings->_workflowMode);
|
||||||
$view->setParam('enablefullsearch', $settings->_enableFullSearch);
|
$view->setParam('enablefullsearch', $settings->_enableFullSearch);
|
||||||
$view->setParam('previewWidthList', $settings->_previewWidthList);
|
$view->setParam('previewWidthList', $settings->_previewWidthList);
|
||||||
$view->show();
|
$view($_GET);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -31,6 +31,12 @@ require_once("class.Bootstrap.php");
|
||||||
*/
|
*/
|
||||||
class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
|
|
||||||
|
function js() { /* {{{ */
|
||||||
|
$this->printFolderChooserJs("form1");
|
||||||
|
$this->printFolderChooserJs("form2");
|
||||||
|
$this->printFolderChooserJs("form3");
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
function show() { /* {{{ */
|
function show() { /* {{{ */
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$user = $this->params['user'];
|
$user = $this->params['user'];
|
||||||
|
@ -53,7 +59,7 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
print "<p>".getMLText("versioning_file_creation_warning")."</p>\n";
|
print "<p>".getMLText("versioning_file_creation_warning")."</p>\n";
|
||||||
|
|
||||||
print "<form class=\"form-inline\" action=\"../op/op.CreateVersioningFiles.php\" name=\"form1\">";
|
print "<form class=\"form-inline\" action=\"../op/op.CreateVersioningFiles.php\" name=\"form1\">";
|
||||||
$this->printFolderChooser("form1",M_READWRITE);
|
$this->printFolderChooserHtml("form1",M_READWRITE);
|
||||||
print "<input type='submit' class='btn' name='' value='".getMLText("versioning_file_creation")."'/>";
|
print "<input type='submit' class='btn' name='' value='".getMLText("versioning_file_creation")."'/>";
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
|
@ -66,7 +72,7 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
print "<p>".getMLText("archive_creation_warning")."</p>\n";
|
print "<p>".getMLText("archive_creation_warning")."</p>\n";
|
||||||
|
|
||||||
print "<form action=\"../op/op.CreateFolderArchive.php\" name=\"form2\">";
|
print "<form action=\"../op/op.CreateFolderArchive.php\" name=\"form2\">";
|
||||||
$this->printFolderChooser("form2",M_READWRITE);
|
$this->printFolderChooserHtml("form2",M_READWRITE);
|
||||||
print "<label class=\"checkbox\"><input type=\"checkbox\" name=\"human_readable\" value=\"1\">".getMLText("human_readable")."</label>";
|
print "<label class=\"checkbox\"><input type=\"checkbox\" name=\"human_readable\" value=\"1\">".getMLText("human_readable")."</label>";
|
||||||
print "<input type='submit' class='btn' name='' value='".getMLText("archive_creation")."'/>";
|
print "<input type='submit' class='btn' name='' value='".getMLText("archive_creation")."'/>";
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
@ -184,7 +190,7 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
print "<p>".getMLText("files_deletion_warning")."</p>\n";
|
print "<p>".getMLText("files_deletion_warning")."</p>\n";
|
||||||
|
|
||||||
print "<form class=\"form-inline\" action=\"../out/out.RemoveFolderFiles.php\" name=\"form3\">";
|
print "<form class=\"form-inline\" action=\"../out/out.RemoveFolderFiles.php\" name=\"form3\">";
|
||||||
$this->printFolderChooser("form3",M_READWRITE);
|
$this->printFolderChooserHtml("form3",M_READWRITE);
|
||||||
print "<input type='submit' class='btn' name='' value='".getMLText("files_deletion")."'/>";
|
print "<input type='submit' class='btn' name='' value='".getMLText("files_deletion")."'/>";
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,15 @@ class SeedDMS_Bootstrap_Style extends SeedDMS_View_Common {
|
||||||
|
|
||||||
function htmlStartPage($title="", $bodyClass="", $base="") { /* {{{ */
|
function htmlStartPage($title="", $bodyClass="", $base="") { /* {{{ */
|
||||||
if(method_exists($this, 'js')) {
|
if(method_exists($this, 'js')) {
|
||||||
$csp_rules = "script-src 'self';"; // style-src 'self';";
|
/* We still need unsafe-eval, because printDocumentChooserHtml and
|
||||||
|
* printFolderChooserHtml will include a javascript file with ajax
|
||||||
|
* which is evaled by jquery
|
||||||
|
* X-WebKit-CSP is deprecated, Chrome understands Content-Security-Policy
|
||||||
|
* since version 25+
|
||||||
|
* X-Content-Security-Policy is deprecated, Firefox understands
|
||||||
|
* Content-Security-Policy since version 23+
|
||||||
|
*/
|
||||||
|
$csp_rules = "script-src 'self' 'unsafe-eval';"; // style-src 'self';";
|
||||||
foreach (array("X-WebKit-CSP", "X-Content-Security-Policy", "Content-Security-Policy") as $csp) {
|
foreach (array("X-WebKit-CSP", "X-Content-Security-Policy", "Content-Security-Policy") as $csp) {
|
||||||
header($csp . ": " . $csp_rules);
|
header($csp . ": " . $csp_rules);
|
||||||
}
|
}
|
||||||
|
@ -310,7 +318,7 @@ $(document).ready(function () {
|
||||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||||
echo " <li><a href=\"../out/out.Help.php?context=".$tmp[1]."\">".getMLText("help")."</a></li>\n";
|
echo " <li><a href=\"../out/out.Help.php?context=".$tmp[1]."\">".getMLText("help")."</a></li>\n";
|
||||||
echo " </ul>\n";
|
echo " </ul>\n";
|
||||||
echo " <form action=\"../op/op.Search.php\" class=\"form-inline navbar-search pull-left\" autocomplete=\"off\">";
|
echo " <form action=\"../out/out.Search.php\" class=\"form-inline navbar-search pull-left\" autocomplete=\"off\">";
|
||||||
if ($folder!=null && is_object($folder) && !strcasecmp(get_class($folder), $dms->getClassname('folder'))) {
|
if ($folder!=null && is_object($folder) && !strcasecmp(get_class($folder), $dms->getClassname('folder'))) {
|
||||||
echo " <input type=\"hidden\" name=\"folderid\" value=\"".$folder->getID()."\" />";
|
echo " <input type=\"hidden\" name=\"folderid\" value=\"".$folder->getID()."\" />";
|
||||||
}
|
}
|
||||||
|
@ -957,7 +965,7 @@ function folderSelected<?php echo $formName ?>(id, name) {
|
||||||
<?php
|
<?php
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function printFolderChooser($form, $accessMode, $exclude = -1, $default = false, $formname = '') { /* {{{ */
|
function printFolderChooserHtml($form, $accessMode, $exclude = -1, $default = false, $formname = '') { /* {{{ */
|
||||||
$formid = "targetid".$form;
|
$formid = "targetid".$form;
|
||||||
if(!$formname)
|
if(!$formname)
|
||||||
$formname = "targetid";
|
$formname = "targetid";
|
||||||
|
@ -979,14 +987,27 @@ function folderSelected<?php echo $formName ?>(id, name) {
|
||||||
<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"><?php printMLText("close") ?></button>
|
<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"><?php printMLText("close") ?></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script language="JavaScript">
|
<?php
|
||||||
/* Set up a callback which is called when a folder in the tree is selected */
|
} /* }}} */
|
||||||
modalFolderChooser<?php echo $form ?> = $('#folderChooser<?php echo $form ?>');
|
|
||||||
function folderSelected<?php echo $form ?>(id, name) {
|
function printFolderChooserJs($formName) { /* {{{ */
|
||||||
$('#<?php echo $formid ?>').val(id);
|
?>
|
||||||
$('#choosefoldersearch<?php echo $form ?>').val(name);
|
modalFolderChooser<?php echo $formName ?> = $('#folderChooser<?php echo $formName ?>');
|
||||||
modalFolderChooser<?php echo $form ?>.modal('hide');
|
function folderSelected<?php echo $formName ?>(id, name) {
|
||||||
|
$('#targetid<?php echo $formName ?>').val(id);
|
||||||
|
$('#choosefoldersearch<?php echo $formName ?>').val(name);
|
||||||
|
modalFolderChooser<?php echo $formName ?>.modal('hide');
|
||||||
}
|
}
|
||||||
|
<?php
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
function printFolderChooser($formName, $accessMode, $exclude = -1, $default = false) { /* {{{ */
|
||||||
|
$this->printFolderChooserHtml($formName, $accessMode, $exclude, $default);
|
||||||
|
?>
|
||||||
|
<script language="JavaScript">
|
||||||
|
<?php
|
||||||
|
$this->printFolderChooserJs($formName);
|
||||||
|
?>
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
|
@ -34,6 +34,8 @@ class SeedDMS_View_DocumentChooser extends SeedDMS_Bootstrap_Style {
|
||||||
function js() { /* {{{ */
|
function js() { /* {{{ */
|
||||||
$folder = $this->params['folder'];
|
$folder = $this->params['folder'];
|
||||||
$form = $this->params['form'];
|
$form = $this->params['form'];
|
||||||
|
|
||||||
|
header('Content-Type: application/json');
|
||||||
$this->printNewTreeNavigationJs($folder->getID(), M_READ, 1, $form);
|
$this->printNewTreeNavigationJs($folder->getID(), M_READ, 1, $form);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -43,12 +45,13 @@ class SeedDMS_View_DocumentChooser extends SeedDMS_Bootstrap_Style {
|
||||||
$folder = $this->params['folder'];
|
$folder = $this->params['folder'];
|
||||||
$form = $this->params['form'];
|
$form = $this->params['form'];
|
||||||
|
|
||||||
$this->htmlStartPage(getMLText("choose_target_document"));
|
// $this->htmlStartPage(getMLText("choose_target_document"));
|
||||||
$this->contentContainerStart();
|
// $this->contentContainerStart();
|
||||||
|
// $this->printNewTreeNavigationHtml($folder->getID(), M_READ, 1, $form);
|
||||||
$this->printNewTreeNavigationHtml($folder->getID(), M_READ, 1, $form);
|
$this->printNewTreeNavigationHtml($folder->getID(), M_READ, 1, $form);
|
||||||
$this->contentContainerEnd();
|
echo '<script src="../out/out.DocumentChooser.php?action=js&'.$_SERVER['QUERY_STRING'].'"></script>'."\n";
|
||||||
$this->htmlEndPage(true);
|
// $this->contentContainerEnd();
|
||||||
// echo "</body>\n</html>\n";
|
// $this->htmlEndPage(true);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -31,6 +31,15 @@ require_once("class.Bootstrap.php");
|
||||||
*/
|
*/
|
||||||
class SeedDMS_View_FolderChooser extends SeedDMS_Bootstrap_Style {
|
class SeedDMS_View_FolderChooser extends SeedDMS_Bootstrap_Style {
|
||||||
|
|
||||||
|
function js() { /* {{{ */
|
||||||
|
$rootfolderid = $this->params['rootfolderid'];
|
||||||
|
$form = $this->params['form'];
|
||||||
|
$mode = $this->params['mode'];
|
||||||
|
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
$this->printNewTreeNavigationJs($rootfolderid, $mode, 0, $form);
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
function show() { /* {{{ */
|
function show() { /* {{{ */
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$user = $this->params['user'];
|
$user = $this->params['user'];
|
||||||
|
@ -39,11 +48,16 @@ class SeedDMS_View_FolderChooser extends SeedDMS_Bootstrap_Style {
|
||||||
$form = $this->params['form'];
|
$form = $this->params['form'];
|
||||||
$rootfolderid = $this->params['rootfolderid'];
|
$rootfolderid = $this->params['rootfolderid'];
|
||||||
|
|
||||||
$this->htmlStartPage(getMLText("choose_target_folder"));
|
// $this->htmlStartPage(getMLText("choose_target_folder"));
|
||||||
$this->contentContainerStart();
|
// $this->contentContainerStart();
|
||||||
|
if(1) {
|
||||||
|
$this->printNewTreeNavigationHtml($rootfolderid, $mode, 0, $form);
|
||||||
|
echo '<script src="../out/out.FolderChooser.php?action=js&'.$_SERVER['QUERY_STRING'].'"></script>'."\n";
|
||||||
|
} else {
|
||||||
$this->printNewTreeNavigation($rootfolderid, $mode, 0, $form);
|
$this->printNewTreeNavigation($rootfolderid, $mode, 0, $form);
|
||||||
$this->contentContainerEnd();
|
}
|
||||||
echo "</body>\n</html>\n";
|
// $this->contentContainerEnd();
|
||||||
|
// $this->htmlEndPage(true);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -47,6 +47,16 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
|
||||||
return $str;
|
return $str;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
function js() { /* {{{ */
|
||||||
|
$user = $this->params['user'];
|
||||||
|
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
|
$this->printFolderChooserJs("form1");
|
||||||
|
$this->printDeleteFolderButtonJs();
|
||||||
|
$this->printDeleteDocumentButtonJs();
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
function show() { /* {{{ */
|
function show() { /* {{{ */
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$user = $this->params['user'];
|
$user = $this->params['user'];
|
||||||
|
@ -82,6 +92,8 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
|
||||||
$cachedir = $this->params['cachedir'];
|
$cachedir = $this->params['cachedir'];
|
||||||
$previewwidth = $this->params['previewWidthList'];
|
$previewwidth = $this->params['previewWidthList'];
|
||||||
|
|
||||||
|
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/bootbox/bootbox.min.js"></script>'."\n", 'js');
|
||||||
|
|
||||||
$this->htmlStartPage(getMLText("search_results"));
|
$this->htmlStartPage(getMLText("search_results"));
|
||||||
$this->globalNavigation();
|
$this->globalNavigation();
|
||||||
$this->contentStart();
|
$this->contentStart();
|
||||||
|
@ -103,7 +115,7 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane <?php echo ($fullsearch == false) ? 'active' : ''; ?>" id="database">
|
<div class="tab-pane <?php echo ($fullsearch == false) ? 'active' : ''; ?>" id="database">
|
||||||
<form action="../op/op.Search.php" name="form1" onsubmit="return checkForm();">
|
<form action="../out/out.Search.php" name="form1">
|
||||||
<?php
|
<?php
|
||||||
// Database search Form {{{
|
// Database search Form {{{
|
||||||
$this->contentContainerStart();
|
$this->contentContainerStart();
|
||||||
|
@ -155,7 +167,7 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php printMLText("under_folder")?>:</td>
|
<td><?php printMLText("under_folder")?>:</td>
|
||||||
<td><?php $this->printFolderChooser("form1", M_READ, -1, $startfolder);?></td>
|
<td><?php $this->printFolderChooserHtml("form1", M_READ, -1, $startfolder);?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php printMLText("creation_date");?>:</td>
|
<td><?php printMLText("creation_date");?>:</td>
|
||||||
|
@ -356,7 +368,7 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
|
||||||
echo "<div class=\"tab-pane ".(($fullsearch == true) ? 'active' : '')."\" id=\"fulltext\">\n";
|
echo "<div class=\"tab-pane ".(($fullsearch == true) ? 'active' : '')."\" id=\"fulltext\">\n";
|
||||||
$this->contentContainerStart();
|
$this->contentContainerStart();
|
||||||
?>
|
?>
|
||||||
<form action="../op/op.Search.php" name="form2" onsubmit="return checkForm();" style="min-height: 330px;">
|
<form action="../out/out.Search.php" name="form2" style="min-height: 330px;">
|
||||||
<input type="hidden" name="fullsearch" value="1" />
|
<input type="hidden" name="fullsearch" value="1" />
|
||||||
<table class="table-condensed">
|
<table class="table-condensed">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -432,7 +444,7 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
print "<div class=\"alert\">".getMLText("search_report", array("doccount" => $totaldocs, "foldercount" => $totalfolders, 'searchtime'=>$searchTime))."</div>";
|
print "<div class=\"alert\">".getMLText("search_report", array("doccount" => $totaldocs, "foldercount" => $totalfolders, 'searchtime'=>$searchTime))."</div>";
|
||||||
$this->pageList($pageNumber, $totalpages, "../op/op.Search.php", $urlparams);
|
$this->pageList($pageNumber, $totalpages, "../out/out.Search.php", $urlparams);
|
||||||
// $this->contentContainerStart();
|
// $this->contentContainerStart();
|
||||||
|
|
||||||
print "<table class=\"table\">";
|
print "<table class=\"table\">";
|
||||||
|
@ -607,7 +619,7 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
print "</tbody></table>\n";
|
print "</tbody></table>\n";
|
||||||
// $this->contentContainerEnd();
|
// $this->contentContainerEnd();
|
||||||
$this->pageList($pageNumber, $totalpages, "../op/op.Search.php", $_GET);
|
$this->pageList($pageNumber, $totalpages, "../out/out.Search.php", $_GET);
|
||||||
} else {
|
} else {
|
||||||
$numResults = $totaldocs + $totalfolders;
|
$numResults = $totaldocs + $totalfolders;
|
||||||
if ($numResults == 0) {
|
if ($numResults == 0) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user