Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2023-01-19 07:10:36 +01:00
commit 1506cef2ab
5 changed files with 47 additions and 48 deletions

View File

@ -29,7 +29,7 @@ require_once("inc/inc.ClassConversionServiceTextToImage.php");
*/
class SeedDMS_ConversionMgr {
/**
* List of services for searching fulltext
* List of services for converting documents
*/
public $services;

View File

@ -18,16 +18,12 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.AccessUtils.php");
include("../inc/inc.ClassAccess.php");
include("../inc/inc.ClassDocument.php");
include("../inc/inc.ClassFolder.php");
include("../inc/inc.ClassGroup.php");
include("../inc/inc.ClassUser.php");
include("../inc/inc.DBAccess.php");
include("../inc/inc.FileUtils.php");
include("../inc/inc.Authentication.php");
include("../../inc/inc.Settings.php");
include("../../inc/inc.Utils.php");
include("../../inc/inc.LogInit.php");
include("../../inc/inc.Language.php");
include("../../inc/inc.Init.php");
include("../../inc/inc.DBInit.php");
print "<html></body>";
@ -42,7 +38,7 @@ function update_content()
GLOBAL $db,$settings;
// create temp folder
if (!makedir($settings->_contentDir."/temp")) return false;
if (!SeedDMS_Core_File::makeDir($settings->_contentDir."/temp")) return false;
// for all contents
$queryStr = "SELECT * FROM tblDocumentContent";
@ -53,19 +49,19 @@ function update_content()
for ($i=0;$i<count($contents);$i++){
// create temp/documentID folder
if (!makedir($settings->_contentDir."/temp/".$contents[$i]["document"])) return false;
if (!SeedDMS_Core_File::makeDir($settings->_contentDir."/temp/".$contents[$i]["document"])) return false;
// move every content in temp/documentID/version.fileType
$source = $settings->_contentDir."/".$contents[$i]["dir"]."/data".$contents[$i]["fileType"];
$target = $settings->_contentDir."/temp/".$contents[$i]["document"]."/".$contents[$i]["version"].$contents[$i]["fileType"];
if (!copyFile($source, $target)) return false;
if (!SeedDMS_Core_File::copyFile($source, $target)) return false;
}
// change directory
if (!renameDir($settings->_contentDir."/".$settings->_contentOffsetDir,$settings->_contentDir."/old")) return false;
if (!renameDir($settings->_contentDir."/temp",$settings->_contentDir."/".$settings->_contentOffsetDir)) return false;
if (!SeedDMS_Core_File::renameDir($settings->_contentDir."/".$settings->_contentOffsetDir,$settings->_contentDir."/old")) return false;
if (!SeedDMS_Core_File::renameDir($settings->_contentDir."/temp",$settings->_contentDir."/".$settings->_contentOffsetDir)) return false;
return true;
}

View File

@ -32,7 +32,7 @@ require_once("inc/inc.ClassAccessOperation.php");
//require_once("inc/inc.Authentication.php");
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=null));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>null));
if($view) {
$view($_GET);
exit;

View File

@ -91,6 +91,8 @@ class RestapiController { /* {{{ */
'sequence'=>$document->getSequence(),
'expires'=>$document->getExpires() ? date('Y-m-d H:i:s', $document->getExpires()) : "",
'mimetype'=>$lc->getMimeType(),
'filetype'=>$lc->getFileType(),
'origfilename'=>$lc->getOriginalFileName(),
'version'=>$lc->getVersion(),
'version_comment'=>$lc->getComment(),
'version_date'=>date('Y-m-d H:i:s', $lc->getDate()),

View File

@ -988,38 +988,39 @@ function typeahead() { /* {{{ */
ob_start();
$cats = $dms->getDocumentCategories();
$options = array();
$options[] = array("-1", getMLText("choose_category"));
foreach ($cats as $currcat) {
$options[] = array($currcat->getID(), htmlspecialchars($currcat->getName()), false);
if($cats) {
$options = array();
$options[] = array("-1", getMLText("choose_category"));
foreach ($cats as $currcat) {
$options[] = array($currcat->getID(), htmlspecialchars($currcat->getName()), false);
}
$this->formField(
null,
array(
'element'=>'select',
'id'=>'batchcategory',
'class'=>'chzn-select',
'options'=>$options,
'multiple'=>false,
'placeholder'=>getMLText('select_category'),
'attributes'=>array(array('style', 'width: 100%;'))
)
);
$this->formField(
getMLText("batch_remove_category"),
array(
'element'=>'input',
'type'=>'checkbox',
'id'=>'removecategory',
'value'=>'1',
)
);
print $this->html_link('Search', array_merge($_GET, array('action'=>'changecategory')), array('class'=>'btn btn-primary change-category-btn mt-4', 'id'=>'changecategory'), "<i class=\"fa fa-user\"></i> ".getMLText("batch_change_category"), false, true)."\n";
$content = ob_get_clean();
$this->printAccordion(getMLText('batch_change_category'), $content);
}
$this->formField(
null,
array(
'element'=>'select',
'id'=>'batchcategory',
'class'=>'chzn-select',
'options'=>$options,
'multiple'=>false,
'placeholder'=>getMLText('select_category'),
'attributes'=>array(array('style', 'width: 100%;'))
)
);
$this->formField(
getMLText("batch_remove_category"),
array(
'element'=>'input',
'type'=>'checkbox',
'id'=>'removecategory',
'value'=>'1',
)
);
// print $this->html_link('Search', array_merge($_GET, array('action'=>'changeowner')), array('class'=>'btn btn-primary', 'id'=>'changeowner'), "<i class=\"fa fa-user\"></i> ".getMLText("batch_change_owner"), false, true)."\n";
print $this->html_link('Search', array_merge($_GET, array('action'=>'changecategory')), array('class'=>'btn btn-primary change-category-btn mt-4', 'id'=>'changecategory'), "<i class=\"fa fa-user\"></i> ".getMLText("batch_change_category"), false, true)."\n";
$content = ob_get_clean();
$this->printAccordion(getMLText('batch_change_category'), $content);
}
// }}}