mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 08:55:54 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
9f491dce6d
|
@ -186,6 +186,8 @@
|
|||
- move lots of javascript packages into views/bootstrap/vendors and update
|
||||
them with npm and grunt
|
||||
- update to font-awesome 4.7.1
|
||||
- add new attribute types 'document', 'folder', 'user', 'group'
|
||||
- overhaul of folder tree which can now be used more than once on a page
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.18
|
||||
|
|
2
Makefile
2
Makefile
|
@ -2,7 +2,7 @@ VERSION=$(shell php -r 'include("inc/inc.Version.php"); $$v=new SeedDMS_Version(
|
|||
SRC=CHANGELOG inc conf utils index.php .htaccess languages views op out controllers doc styles TODO LICENSE webdav install restapi pdfviewer
|
||||
# webapp
|
||||
|
||||
NODISTFILES=utils/importmail.php utils/seedddms-importmail utils/remote-email-upload utils/remote-upload utils/da-bv-reminder.php utils/seeddms-da-bv-reminder .svn .gitignore styles/blue styles/hc styles/clean views/blue views/hc views/clean views/pca
|
||||
NODISTFILES=utils/importmail.php utils/seedddms-importmail utils/remote-email-upload utils/remote-upload utils/da-bv-reminder.php utils/seeddms-da-bv-reminder .svn .gitignore styles/blue styles/hc styles/clean views/blue views/hc views/clean views/pca views/tdk
|
||||
|
||||
EXTENSIONS := \
|
||||
dynamic_content.tar.gz\
|
||||
|
|
|
@ -130,7 +130,8 @@ class SeedDMS_Core_Attribute { /* {{{ */
|
|||
* the value set and later turned into a multi value attribute.
|
||||
*/
|
||||
$sep = substr($this->_value, 0, 1);
|
||||
$vsep = $this->_attrdef->getValueSetSeparator();
|
||||
if(!($vsep = $this->_attrdef->getValueSetSeparator()))
|
||||
$vsep = $sep;
|
||||
if($sep == $vsep)
|
||||
return(explode($sep, substr($this->_value, 1)));
|
||||
else
|
||||
|
@ -156,38 +157,54 @@ class SeedDMS_Core_Attribute { /* {{{ */
|
|||
$db = $this->_dms->getDB();
|
||||
|
||||
if($this->_attrdef->getMultipleValues()) {
|
||||
$valuesetstr = $this->_attrdef->getValueSet();
|
||||
/* Multiple values without a value set is not allowed */
|
||||
if(!$valuesetstr = $this->_attrdef->getValueSet())
|
||||
/* No need to have valueset anymore. If none is given, the values are
|
||||
* expected to be separated by ','
|
||||
if(!$valuesetstr)
|
||||
return false;
|
||||
*/
|
||||
$valueset = $this->_attrdef->getValueSetAsArray();
|
||||
|
||||
if(is_array($values)) {
|
||||
if($values) {
|
||||
$error = false;
|
||||
foreach($values as $v) {
|
||||
if(!in_array($v, $valueset)) { $error = true; break; }
|
||||
if($valueset) {
|
||||
$error = false;
|
||||
foreach($values as $v) {
|
||||
if(!in_array($v, $valueset)) { $error = true; break; }
|
||||
}
|
||||
if($error)
|
||||
return false;
|
||||
$valuesetstr = $this->_attrdef->getValueSet();
|
||||
$value = $valuesetstr[0].implode($valuesetstr[0], $values);
|
||||
} else {
|
||||
$value = ','.implode(',', $values);
|
||||
}
|
||||
if($error)
|
||||
return false;
|
||||
$valuesetstr = $this->_attrdef->getValueSet();
|
||||
$value = $valuesetstr[0].implode($valuesetstr[0], $values);
|
||||
} else {
|
||||
$value = '';
|
||||
}
|
||||
} else {
|
||||
if($values) {
|
||||
if($valuesetstr[0] != $values[0])
|
||||
$values = explode($valuesetstr[0], $values);
|
||||
else
|
||||
$values = explode($valuesetstr[0], substr($values, 1));
|
||||
|
||||
$error = false;
|
||||
foreach($values as $v) {
|
||||
if(!in_array($v, $valueset)) { $error = true; break; }
|
||||
if($valuesetstr) {
|
||||
if($valuesetstr[0] != $values[0])
|
||||
$values = explode($valuesetstr[0], $values);
|
||||
else
|
||||
$values = explode($valuesetstr[0], substr($values, 1));
|
||||
} else {
|
||||
$values = explode(',', substr($values, 1));
|
||||
}
|
||||
|
||||
if($valueset) {
|
||||
$error = false;
|
||||
foreach($values as $v) {
|
||||
if(!in_array($v, $valueset)) { $error = true; break; }
|
||||
}
|
||||
if($error)
|
||||
return false;
|
||||
$value = $valuesetstr[0].implode($valuesetstr[0], $values);
|
||||
} else {
|
||||
$value = ','.implode(',', $values);
|
||||
}
|
||||
if($error)
|
||||
return false;
|
||||
$value = $valuesetstr[0].implode($valuesetstr[0], $values);
|
||||
} else {
|
||||
$value = $values;
|
||||
}
|
||||
|
@ -395,6 +412,15 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
|
|||
const type_email = '6';
|
||||
const type_date = '7';
|
||||
|
||||
/*
|
||||
* Addtional data types of an attribute representing objects in seeddms
|
||||
*/
|
||||
const type_folder = '101';
|
||||
const type_document = '102';
|
||||
//const type_documentcontent = '103';
|
||||
const type_user = '104';
|
||||
const type_group = '105';
|
||||
|
||||
/*
|
||||
* The object type for which a attribute may be used
|
||||
*/
|
||||
|
|
|
@ -238,7 +238,10 @@ class SeedDMS_Core_Object { /* {{{ */
|
|||
break;
|
||||
}
|
||||
if($attrdef->getMultipleValues() && is_array($value)) {
|
||||
$sep = substr($attrdef->getValueSet(), 0, 1);
|
||||
if(in_array($attrdef->getType(), array(SeedDMS_Core_AttributeDefinition::type_user, SeedDMS_Core_AttributeDefinition::type_group)))
|
||||
$sep = ',';
|
||||
else
|
||||
$sep = substr($attrdef->getValueSet(), 0, 1);
|
||||
$value = $sep.implode($sep, $value);
|
||||
}
|
||||
if(!isset($this->_attributes[$attrdef->getId()])) {
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
- clear the save content list and latest content in SeedDMS_Core_Document after
|
||||
a version has been deleted.
|
||||
- new method SeedDMS_Core_Document::isLatestVersion()
|
||||
- add new attribute types 'document', 'folder', 'user', 'group'
|
||||
</notes>
|
||||
<contents>
|
||||
<dir baseinstalldir="SeedDMS" name="/">
|
||||
|
|
|
@ -57,10 +57,12 @@ class SeedDMS_Controller_ExtensionMgr extends SeedDMS_Controller_Common {
|
|||
$extmgr = $this->params['extmgr'];
|
||||
$file = $this->params['file'];
|
||||
|
||||
if($extmgr->updateExtension($file))
|
||||
if($extmgr->updateExtension($file)) {
|
||||
$extmgr->createExtensionConf();
|
||||
else
|
||||
} else {
|
||||
$this->setErrorMsg($extmgr->getErrorMsg());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} /* }}} */
|
||||
|
||||
|
|
16
doc/README.npm
Normal file
16
doc/README.npm
Normal file
|
@ -0,0 +1,16 @@
|
|||
Installation of external js packages
|
||||
-------------------------------------
|
||||
|
||||
All javascript was located in styles/bootstrap until SeedDMS 5.1.18 and 6.0.11.
|
||||
Since 5.1.19 and 6.0.12 most of it has moved into the view at views/boostrap/vendors
|
||||
and is no longer placed in git but must be installed by npm and grunt.
|
||||
|
||||
Run
|
||||
|
||||
`npm install`
|
||||
|
||||
and afterwards
|
||||
|
||||
`grunt`
|
||||
|
||||
to download the js packages and copy them into the new location.
|
|
@ -71,7 +71,7 @@ if ($action == "addattrdef") {
|
|||
if($minvalues > $maxvalues) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_min_greater_max"));
|
||||
}
|
||||
if($multiple && $valueset == '') {
|
||||
if($multiple && $valueset == '' && !in_array($type, array(SeedDMS_Core_AttributeDefinition::type_user, SeedDMS_Core_AttributeDefinition::type_group))) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_multiple_needs_valueset"));
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,7 @@ else if ($action == "editattrdef") {
|
|||
if($minvalues > $maxvalues) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_min_greater_max"));
|
||||
}
|
||||
if($multiple && $valueset == '') {
|
||||
if($multiple && $valueset == '' && !in_array($type, array(SeedDMS_Core_AttributeDefinition::type_user, SeedDMS_Core_AttributeDefinition::type_group))) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_multiple_needs_valueset"));
|
||||
}
|
||||
|
||||
|
|
|
@ -76,10 +76,10 @@ elseif ($action == "upload") { /* {{{ */
|
|||
UI::exitError(getMLText("admin_tools"),getMLText("extension_mgr_no_upload"));
|
||||
}
|
||||
if($_FILES['userfile']['error']) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("extension_mgr_error_upload"));
|
||||
}
|
||||
if(!in_array($_FILES['userfile']['type'], array('application/zip', 'application/x-zip-compressed'))) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("extension_mgr_no_zipfile"));
|
||||
}
|
||||
// $extMgr = new SeedDMS_Extension_Mgr($settings->_rootDir."/ext", $settings->_cacheDir);
|
||||
$controller->setParam('extmgr', $extMgr);
|
||||
|
|
|
@ -34,6 +34,19 @@ function escapeHtml(text) {
|
|||
|
||||
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
|
||||
}
|
||||
|
||||
function treeFolderSelected(formid, nodeid, nodename) {
|
||||
$('#targetid'+formid).val(nodeid);
|
||||
$('#choosefoldersearch'+formid).val(nodename);
|
||||
$('#folderChooser'+formid).modal('hide');
|
||||
}
|
||||
|
||||
function treeDocumentSelected(formid, nodeid, nodename) {
|
||||
$('#docid'+formid).val(nodeid);
|
||||
$('#choosedocsearch'+formid).val(nodename);
|
||||
$('#docChooser'+formid).modal('hide');
|
||||
}
|
||||
|
||||
$(document).ready( function() {
|
||||
/* close popovers when clicking somewhere except in the popover or the
|
||||
* remove icon
|
||||
|
@ -169,6 +182,22 @@ $(document).ready( function() {
|
|||
}
|
||||
}); /* }}} */
|
||||
|
||||
$('body').on('click', '[id^=clearfolder]', function(ev) { /* {{{ */
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
target = $(this).data('target');
|
||||
$('#choosefoldersearch'+target).val('');
|
||||
$('#'+target).val('');
|
||||
}); /* }}} */
|
||||
|
||||
$('body').on('click', '[id^=cleardocument]', function(ev) { /* {{{ */
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
target = $(this).data('target');
|
||||
$('#choosedocsearch'+target).val('');
|
||||
$('#'+target).val('');
|
||||
}); /* }}} */
|
||||
|
||||
$('body').on('click', '#clipboard-float', function(ev) { /* {{{ */
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
|
|
|
@ -336,7 +336,7 @@ $(document).ready(function() {
|
|||
}
|
||||
}
|
||||
}
|
||||
$arrs = $this->callHook('addDocumentAttributes', $folder);
|
||||
$arrs = $this->callHook('addDocumentAttributes', null);
|
||||
if(is_array($arrs)) {
|
||||
foreach($arrs as $arr) {
|
||||
$this->formField($arr[0], $arr[1]);
|
||||
|
|
|
@ -109,6 +109,10 @@ $(document).ready( function() {
|
|||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_folder, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
/* The second parameter is null, to make this function call equal
|
||||
* to 'editFolderAttribute', which expects the folder as the second
|
||||
* parameter.
|
||||
*/
|
||||
$arr = $this->callHook('addFolderAttribute', null, $attrdef);
|
||||
if(is_array($arr)) {
|
||||
if($arr) {
|
||||
|
@ -119,7 +123,11 @@ $(document).ready( function() {
|
|||
}
|
||||
}
|
||||
}
|
||||
$arrs = $this->callHook('addFolderAttributes', $folder);
|
||||
/* The second parameter is null, to make this function call equal
|
||||
* to 'editFolderAttributes', which expects the folder as the second
|
||||
* parameter.
|
||||
*/
|
||||
$arrs = $this->callHook('addFolderAttributes', null);
|
||||
if(is_array($arrs)) {
|
||||
foreach($arrs as $arr) {
|
||||
$this->formField($arr[0], $arr[1]);
|
||||
|
|
|
@ -57,6 +57,7 @@ $(document).ready( function() {
|
|||
$this->printDeleteDocumentButtonJs();
|
||||
$this->printDeleteAttributeValueButtonJs();
|
||||
$this->printClickDocumentJs();
|
||||
$this->printClickFolderJs();
|
||||
} /* }}} */
|
||||
|
||||
function info() { /* {{{ */
|
||||
|
@ -217,6 +218,7 @@ $(document).ready( function() {
|
|||
<label class="control-label"><?php printMLText("attrdef_type");?>:</label>
|
||||
<div class="controls">
|
||||
<select name="type">
|
||||
<optgroup label="<?= getMLText('types_generic') ?>">
|
||||
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_int ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_int) echo "selected"; ?>><?php printMLText('attrdef_type_int'); ?></option>
|
||||
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_float ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_float) echo "selected"; ?>><?php printMLText('attrdef_type_float'); ?></option>
|
||||
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_string ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_string) echo "selected"; ?>><?php printMLText('attrdef_type_string'); ?></option>
|
||||
|
@ -224,6 +226,13 @@ $(document).ready( function() {
|
|||
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_date ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) echo "selected"; ?>><?php printMLText('attrdef_type_date'); ?></option>
|
||||
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_email ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_email) echo "selected"; ?>><?php printMLText('attrdef_type_email'); ?></option>
|
||||
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_url ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_url) echo "selected"; ?>><?php printMLText('attrdef_type_url'); ?></option>
|
||||
</optgroup>
|
||||
<optgroup label="SeedDMS">
|
||||
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_folder ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_folder) echo "selected"; ?>><?php printMLText('attrdef_type_folder'); ?></option>
|
||||
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_document ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_document) echo "selected"; ?>><?php printMLText('attrdef_type_document'); ?></option>
|
||||
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_user ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_user) echo "selected"; ?>><?php printMLText('attrdef_type_user'); ?></option>
|
||||
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_group ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_group) echo "selected"; ?>><?php printMLText('attrdef_type_group'); ?></option>
|
||||
</optgroup>
|
||||
<?php
|
||||
if($moreoptions = $this->callHook('additionalTypes', $attrdef)) {
|
||||
foreach($moreoptions as $option) {
|
||||
|
@ -355,6 +364,18 @@ $(document).ready( function() {
|
|||
case SeedDMS_Core_AttributeDefinition::type_boolean:
|
||||
$t = getMLText("attrdef_type_boolean");
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_folder:
|
||||
$t = getMLText("attrdef_type_folder");
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_document:
|
||||
$t = getMLText("attrdef_type_document");
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_user:
|
||||
$t = getMLText("attrdef_type_user");
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_group:
|
||||
$t = getMLText("attrdef_type_group");
|
||||
break;
|
||||
}
|
||||
print "<option value=\"".$attrdef->getID()."\" ".($selattrdef && $attrdef->getID()==$selattrdef->getID() ? 'selected' : '')." data-subtitle=\"".htmlspecialchars($ot.", ".$t)."\">" . htmlspecialchars($attrdef->getName()/* ." (".$ot.", ".$t.")"*/);
|
||||
}
|
||||
|
|
|
@ -34,9 +34,9 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
|||
function js() { /* {{{ */
|
||||
header('Content-Type: application/javascript');
|
||||
|
||||
$this->printFolderChooserJs("form1");
|
||||
$this->printFolderChooserJs("form2");
|
||||
$this->printFolderChooserJs("form3");
|
||||
// $this->printFolderChooserJs("form1");
|
||||
// $this->printFolderChooserJs("form2");
|
||||
// $this->printFolderChooserJs("form3");
|
||||
} /* }}} */
|
||||
|
||||
function show() { /* {{{ */
|
||||
|
|
|
@ -1363,22 +1363,24 @@ $(document).ready(function() {
|
|||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
function getDocumentChooserHtml($form, $accessMode=M_READ, $exclude = -1, $default = false, $formname = '', $folder='', $partialtree=0) { /* {{{ */
|
||||
$formid = "docid".$form;
|
||||
function getDocumentChooserHtml($form, $accessMode=M_READ, $exclude = -1, $default = false, $formname = '', $folder='', $partialtree=0, $skiptree=false) { /* {{{ */
|
||||
if(!$formname)
|
||||
$formname = "docid";
|
||||
$formid = md5($formname.$form);
|
||||
if(!$folder)
|
||||
$folderid = $this->params['rootfolderid'];
|
||||
else
|
||||
$folderid = $folder->getID();
|
||||
$content = '';
|
||||
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
|
||||
$content .= "<input type=\"hidden\" id=\"docid".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
|
||||
$content .= "<div class=\"input-append\">\n";
|
||||
$content .= "<input type=\"text\" id=\"choosedocsearch".$form."\" data-target=\"docid".$form."\" data-provide=\"typeahead\" name=\"docname".$form."\" value=\"". (($default) ? htmlspecialchars($default->getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\" />";
|
||||
$content .= "<a data-target=\"#docChooser".$form."\" href=\"out.DocumentChooser.php?form=".$form."&folderid=".$folderid."&partialtree=".$partialtree."\" role=\"button\" class=\"btn\" data-toggle=\"modal\">".getMLText("document")."…</a>\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\" />";
|
||||
if(!$skiptree)
|
||||
$content .= "<a data-target=\"#docChooser".$formid."\" href=\"out.DocumentChooser.php?form=".$formid."&folderid=".$folderid."&partialtree=".$partialtree."\" role=\"button\" class=\"btn\" data-toggle=\"modal\">".getMLText("document")."…</a>\n";
|
||||
$content .= "</div>\n";
|
||||
$content .= '
|
||||
<div class="modal hide" id="docChooser'.$form.'" tabindex="-1" role="dialog" aria-labelledby="docChooserLabel" aria-hidden="true">
|
||||
if(!$skiptree)
|
||||
$content .= '
|
||||
<div class="modal hide" id="docChooser'.$formid.'" tabindex="-1" role="dialog" aria-labelledby="docChooserLabel" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="docChooserLabel">'.getMLText("choose_target_document").'</h3>
|
||||
|
@ -1398,14 +1400,22 @@ $(document).ready(function() {
|
|||
echo self::getDocumentChooserHtml($form, $accessMode, $exclude, $default, $formname, $folder, $partialtree);
|
||||
} /* }}} */
|
||||
|
||||
function printDocumentChooserJs($formName) { /* {{{ */
|
||||
/**
|
||||
* This function is deprecated. Don't use it anymore. There is a generic
|
||||
* folderSelected and documentSelected function in application.js
|
||||
* If you extra functions to be called then define them in your own js code
|
||||
*/
|
||||
function printDocumentChooserJs($form, $formname='') { /* {{{ */
|
||||
if(!$formname)
|
||||
$formname = "docid";
|
||||
$formid = md5($formname.$form);
|
||||
?>
|
||||
function documentSelected<?php echo $formName ?>(id, name) {
|
||||
$('#docid<?php echo $formName ?>').val(id);
|
||||
$('#choosedocsearch<?php echo $formName ?>').val(name);
|
||||
$('#docChooser<?php echo $formName ?>').modal('hide');
|
||||
function documentSelected<?php echo $formid ?>(id, name) {
|
||||
$('#docid<?php echo $formid ?>').val(id);
|
||||
$('#choosedocsearch<?php echo $formid ?>').val(name);
|
||||
$('#docChooser<?php echo $formid ?>').modal('hide');
|
||||
}
|
||||
function folderSelected<?php echo $formName ?>(id, name) {
|
||||
function folderSelected<?php echo $formid ?>(id, name) {
|
||||
}
|
||||
<?php
|
||||
} /* }}} */
|
||||
|
@ -1421,22 +1431,25 @@ function folderSelected<?php echo $formName ?>(id, name) {
|
|||
<?php
|
||||
} /* }}} */
|
||||
|
||||
function getFolderChooserHtml($form, $accessMode, $exclude = -1, $default = false, $formname = '') { /* {{{ */
|
||||
function getFolderChooserHtml($form, $accessMode, $exclude = -1, $default = false, $formname = '', $skiptree = false) { /* {{{ */
|
||||
if(!$formname)
|
||||
$formname = "targetid";
|
||||
$formid = md5($formname.$form);
|
||||
$content = '';
|
||||
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
|
||||
$content .= "<input type=\"hidden\" id=\"targetid".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
|
||||
$content .= "<div class=\"input-append\">\n";
|
||||
$content .= "<input type=\"text\" id=\"choosefoldersearch".$form."\" data-target=\"".$formid."\" data-provide=\"typeahead\" name=\"targetname".$form."\" value=\"". (($default) ? htmlspecialchars($default->getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\" target=\"".$formid."\"/>";
|
||||
$content .= "<button type=\"button\" class=\"btn\" id=\"clearfolder".$form."\"><i class=\"fa fa-remove\"></i></button>";
|
||||
$content .= "<a data-target=\"#folderChooser".$form."\" href=\"../out/out.FolderChooser.php?form=".$form."&mode=".$accessMode."&exclude=".$exclude."\" role=\"button\" class=\"btn\" data-toggle=\"modal\">".getMLText("folder")."…</a>\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."\"/>";
|
||||
$content .= "<button type=\"button\" class=\"btn\" id=\"clearfolder".$formid."\" data-target=\"".$formid."\"><i class=\"fa fa-remove\"></i></button>";
|
||||
if(!$skiptree) {
|
||||
$content .= "<a data-target=\"#folderChooser".$formid."\" href=\"../out/out.FolderChooser.php?form=".$formid."&mode=".$accessMode."&exclude=".$exclude."\" role=\"button\" class=\"btn\" data-toggle=\"modal\">".getMLText("folder")."…</a>\n";
|
||||
}
|
||||
$content .= "</div>\n";
|
||||
$content .= '
|
||||
<div class="modal hide" id="folderChooser'.$form.'" tabindex="-1" role="dialog" aria-labelledby="folderChooser'.$form.'Label" aria-hidden="true">
|
||||
if(!$skiptree) {
|
||||
$content .= '
|
||||
<div class="modal hide" id="folderChooser'.$formid.'" tabindex="-1" role="dialog" aria-labelledby="folderChooser'.$formid.'Label" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="folderChooser'.$form.'Label">'.getMLText("choose_target_folder").'</h3>
|
||||
<h3 id="folderChooser'.$formid.'Label">'.getMLText("choose_target_folder").'</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>'.getMLText('tree_loading').'</p>
|
||||
|
@ -1446,6 +1459,7 @@ function folderSelected<?php echo $formName ?>(id, name) {
|
|||
</div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
|
@ -1453,22 +1467,29 @@ function folderSelected<?php echo $formName ?>(id, name) {
|
|||
echo self::getFolderChooserHtml($form, $accessMode, $exclude, $default, $formname);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* This function is deprecated. Don't use it anymore. There is a generic
|
||||
* folderSelected and documentSelected function in application.js
|
||||
* If you extra functions to be called then define them in your own js code
|
||||
*/
|
||||
function printFolderChooserJs($form, $formname='') { /* {{{ */
|
||||
if(!$formname)
|
||||
$formname = "targetid";
|
||||
$formid = md5($formname.$form);
|
||||
?>
|
||||
function folderSelected<?php echo $form ?>(id, name) {
|
||||
$('#<?php echo $formid ?>').val(id);
|
||||
$('#choosefoldersearch<?php echo $form ?>').val(name);
|
||||
$('#folderChooser<?php echo $form ?>').modal('hide');
|
||||
function folderSelected<?php echo $formid ?>(id, name) {
|
||||
$('#targetid<?php echo $formid ?>').val(id);
|
||||
$('#choosefoldersearch<?php echo $formid ?>').val(name);
|
||||
$('#folderChooser<?php echo $formid ?>').modal('hide');
|
||||
}
|
||||
/*
|
||||
$(document).ready(function() {
|
||||
$('#clearfolder<?php print $form ?>').click(function(ev) {
|
||||
$('#choosefoldersearch<?php echo $form ?>').val('');
|
||||
$('#<?php echo $formid ?>').val('');
|
||||
$('#clearfolder<?php print $formid ?>').click(function(ev) {
|
||||
$('#choosefoldersearch<?php echo $formid ?>').val('');
|
||||
$('#targetid<?php echo $formid ?>').val('');
|
||||
});
|
||||
});
|
||||
*/
|
||||
<?php
|
||||
} /* }}} */
|
||||
|
||||
|
@ -1592,8 +1613,12 @@ $(document).ready(function() {
|
|||
*
|
||||
* @param object $attribute attribute
|
||||
*/
|
||||
protected function printAttributeValue($attribute, $noecho=false) { /* {{{ */
|
||||
$content = '';
|
||||
protected function printAttributeValue($attribute) { /* {{{ */
|
||||
echo self::getAttributeValue($attribute);
|
||||
} /* }}} */
|
||||
|
||||
function getAttributeValue($attribute) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
switch($attrdef->getType()) {
|
||||
case SeedDMS_Core_AttributeDefinition::type_url:
|
||||
|
@ -1602,7 +1627,7 @@ $(document).ready(function() {
|
|||
foreach($attrs as $attr) {
|
||||
$tmp[] = '<a href="'.htmlspecialchars($attr).'">'.htmlspecialchars($attr).'</a>';
|
||||
}
|
||||
$content .= implode('<br />', $tmp);
|
||||
return implode('<br />', $tmp);
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_email:
|
||||
$attrs = $attribute->getValueAsArray();
|
||||
|
@ -1610,30 +1635,47 @@ $(document).ready(function() {
|
|||
foreach($attrs as $attr) {
|
||||
$tmp[] = '<a mailto="'.htmlspecialchars($attr).'">'.htmlspecialchars($attr).'</a>';
|
||||
}
|
||||
$content .= implode('<br />', $tmp);
|
||||
return implode('<br />', $tmp);
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_folder:
|
||||
$attrs = $attribute->getValueAsArray();
|
||||
$tmp = array();
|
||||
foreach($attrs as $attr) {
|
||||
if($targetfolder = $dms->getFolder(intval($attr)))
|
||||
$tmp[] = '<a href="../out/out.ViewFolder.php?folderid='.$targetfolder->getId().'">'.htmlspecialchars($targetfolder->getName()).'</a>';
|
||||
}
|
||||
return implode('<br />', $tmp);
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_document:
|
||||
$attrs = $attribute->getValueAsArray();
|
||||
$tmp = array();
|
||||
foreach($attrs as $attr) {
|
||||
if($targetdoc = $dms->getDocument(intval($attr)))
|
||||
$tmp[] = '<a href="../out/out.ViewDocument.php?documentid='.$targetdoc->getId().'">'.htmlspecialchars($targetdoc->getName()).'</a>';
|
||||
}
|
||||
return implode('<br />', $tmp);
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_user:
|
||||
$attrs = $attribute->getValueAsArray();
|
||||
$tmp = array();
|
||||
foreach($attrs as $attr) {
|
||||
$curuser = $dms->getUser((int) $attr);
|
||||
$tmp[] = $curuser->getFullname()." (".$curuser->getLogin().")";
|
||||
}
|
||||
return implode('<br />', $tmp);
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_group:
|
||||
$attrs = $attribute->getValueAsArray();
|
||||
$tmp = array();
|
||||
foreach($attrs as $attr) {
|
||||
$curgroup = $dms->getGroup((int) $attr);
|
||||
$tmp[] = $curgroup->getName();
|
||||
}
|
||||
return implode('<br />', $tmp);
|
||||
break;
|
||||
default:
|
||||
$content .= htmlspecialchars(implode(', ', $attribute->getValueAsArray()));
|
||||
return htmlspecialchars(implode(', ', $attribute->getValueAsArray()));
|
||||
}
|
||||
if($noecho)
|
||||
return $content;
|
||||
else
|
||||
echo $content;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Output a single attribute in the document info section
|
||||
*
|
||||
* @param object $attribute attribute
|
||||
*/
|
||||
protected function printAttribute($attribute) { /* {{{ */
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||
<td><?php $this->printAttributeValue($attribute); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
} /* }}} */
|
||||
|
||||
function printAttributeEditField($attrdef, $attribute, $fieldname='attributes', $norequire=false) { /* {{{ */
|
||||
|
@ -1641,6 +1683,7 @@ $(document).ready(function() {
|
|||
} /* }}} */
|
||||
|
||||
function getAttributeEditField($attrdef, $attribute, $fieldname='attributes', $norequire=false) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$content = '';
|
||||
switch($attrdef->getType()) {
|
||||
case SeedDMS_Core_AttributeDefinition::type_boolean:
|
||||
|
@ -1662,6 +1705,58 @@ $(document).ready(function() {
|
|||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
|
||||
$content .= "<input type=\"text\" id=\"".$fieldname."_".$attrdef->getId()."\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"".htmlspecialchars($objvalue)."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required' : '')." data-rule-number=\"true\"/>";
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_folder:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? (int) $attribute->getValue() : (int) $attribute) : 0;
|
||||
if($objvalue)
|
||||
$target = $dms->getFolder($objvalue);
|
||||
else
|
||||
$target = null;
|
||||
$content .= $this->getFolderChooserHtml("attr".$attrdef->getId(), M_READWRITE, -1, $target, $fieldname."[".$attrdef->getId()."]", false);
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_document:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? (int) $attribute->getValue() : (int) $attribute) : 0;
|
||||
if($objvalue)
|
||||
$target = $dms->getDocument($objvalue);
|
||||
else
|
||||
$target = null;
|
||||
$content .= $this->getDocumentChooserHtml("attr".$attrdef->getId(), $target, $fieldname."[".$attrdef->getId()."]");
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_user:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : $attribute) : array();
|
||||
$users = $dms->getAllUsers();
|
||||
if($users) {
|
||||
$allowempty = $attrdef->getMinValues() == 0;
|
||||
$allowmultiple = $attrdef->getMultipleValues();
|
||||
$content .= "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")."\" name=\"".$fieldname."[".$attrdef->getId()."]".($allowmultiple ? '[]' : '')."\"".($allowmultiple ? " multiple" : "")." data-placeholder=\"".getMLText("select_user")."\">";
|
||||
if($allowempty)
|
||||
$content .= "<option value=\"\"></option>";
|
||||
foreach($users as $curuser) {
|
||||
$content .= "<option value=\"".$curuser->getID()."\"";
|
||||
if(in_array($curuser->getID(), $objvalue))
|
||||
$content .= " selected";
|
||||
$content .= ">".htmlspecialchars($curuser->getLogin()." - ".$curuser->getFullName())."</option>";
|
||||
}
|
||||
$content .= "</select>";
|
||||
}
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_group:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : $attribute) : array();
|
||||
$groups = $dms->getAllGroups();
|
||||
if($groups) {
|
||||
$allowempty = $attrdef->getMinValues() == 0;
|
||||
$allowmultiple = $attrdef->getMultipleValues();
|
||||
$content .= "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")."\" name=\"".$fieldname."[".$attrdef->getId()."]".($allowmultiple ? '[]' : '')."\"".($allowmultiple ? " multiple" : "")." data-placeholder=\"".getMLText("select_group")."\">";
|
||||
if($allowempty)
|
||||
$content .= "<option value=\"\"></option>";
|
||||
foreach($groups as $curgroup) {
|
||||
$content .= "<option value=\"".$curgroup->getID()."\"";
|
||||
if(in_array($curgroup->getID(), $objvalue))
|
||||
$content .= " selected";
|
||||
$content .= ">".htmlspecialchars($curgroup->getName())."</option>";
|
||||
}
|
||||
$content .= "</select>";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if($valueset = $attrdef->getValueSetAsArray()) {
|
||||
$content .= "<input type=\"hidden\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"\"/>";
|
||||
|
@ -1974,12 +2069,17 @@ $(function() {
|
|||
saveState: 'jqtree<?php echo $formid; ?>',
|
||||
openedIcon: $('<i class="fa fa-minus-circle"></i>'),
|
||||
closedIcon: $('<i class="fa fa-plus-circle"></i>'),
|
||||
/*
|
||||
_onCanSelectNode: function(node) {
|
||||
if(node.is_folder) {
|
||||
folderSelected<?php echo $formid ?>(node.id, node.name);
|
||||
} else
|
||||
documentSelected<?php echo $formid ?>(node.id, node.name);
|
||||
folderSelected<?= $formid ?>(node.id, node.name);
|
||||
treeFolderSelected('<?= $formid ?>', node.id, node.name);
|
||||
} else {
|
||||
documentSelected<?= $formid ?>(node.id, node.name);
|
||||
treeDocumentSelected('<?= $formid ?>', node.id, node.name);
|
||||
}
|
||||
},
|
||||
*/
|
||||
autoOpen: false,
|
||||
drapAndDrop: true,
|
||||
onCreateLi: function(node, $li) {
|
||||
|
@ -1998,18 +2098,32 @@ $(function() {
|
|||
var node = event.node;
|
||||
if(!node)
|
||||
return;
|
||||
$('#jqtree<?php echo $formid ?>').tree('openNode', node);
|
||||
// event.preventDefault();
|
||||
if(node.is_folder) {
|
||||
<?php if($showdocs) { ?>
|
||||
$('#jqtree<?php echo $formid ?>').tree('openNode', node);
|
||||
// event.preventDefault();
|
||||
if(typeof node.fetched == 'undefined') {
|
||||
node.fetched = true;
|
||||
$(this).tree('loadDataFromUrl', node, function () {
|
||||
$(this).tree('openNode', node);
|
||||
});
|
||||
}
|
||||
folderSelected<?php echo $formid ?>(node.id, node.name);
|
||||
} else
|
||||
documentSelected<?php echo $formid ?>(node.id, node.name);
|
||||
<?php } ?>
|
||||
/* folderSelectedXXXX() can still be set, e.g. for the main tree
|
||||
* to update the folder list.
|
||||
*/
|
||||
if (typeof folderSelected<?= $formid ?> === 'function') {
|
||||
folderSelected<?= $formid ?>(node.id, node.name);
|
||||
}
|
||||
treeFolderSelected('<?= $formid ?>', node.id, node.name);
|
||||
} else {
|
||||
<?php if($showdocs) { ?>
|
||||
if (typeof documentSelected<?= $formid ?> === 'function') {
|
||||
documentSelected<?= $formid ?>(node.id, node.name);
|
||||
}
|
||||
treeDocumentSelected('<?= $formid ?>', node.id, node.name);
|
||||
<?php } ?>
|
||||
}
|
||||
}
|
||||
);
|
||||
$('#jqtree<?php echo $formid ?>').on(
|
||||
|
|
|
@ -34,7 +34,7 @@ class SeedDMS_View_ImportFS extends SeedDMS_Bootstrap_Style {
|
|||
function js() { /* {{{ */
|
||||
header('Content-Type: application/javascript');
|
||||
|
||||
$this->printFolderChooserJs("form1");
|
||||
// $this->printFolderChooserJs("form1");
|
||||
$this->printDropFolderChooserJs("form1", 1);
|
||||
} /* }}} */
|
||||
|
||||
|
|
|
@ -134,8 +134,8 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
|
|||
function js() { /* {{{ */
|
||||
header('Content-Type: application/javascript');
|
||||
|
||||
$this->printFolderChooserJs("form1");
|
||||
$this->printDocumentChooserJs("form2");
|
||||
// $this->printFolderChooserJs("form1");
|
||||
// $this->printDocumentChooserJs("form2");
|
||||
$this->printClickDocumentJs();
|
||||
$this->printClickFolderJs();
|
||||
} /* }}} */
|
||||
|
|
|
@ -34,7 +34,7 @@ class SeedDMS_View_MoveDocument extends SeedDMS_Bootstrap_Style {
|
|||
function js() { /* {{{ */
|
||||
header('Content-Type: application/javascript');
|
||||
|
||||
$this->printFolderChooserJs("form1");
|
||||
// $this->printFolderChooserJs("form1");
|
||||
} /* }}} */
|
||||
|
||||
function show() { /* {{{ */
|
||||
|
|
|
@ -34,7 +34,7 @@ class SeedDMS_View_MoveFolder extends SeedDMS_Bootstrap_Style {
|
|||
function js() { /* {{{ */
|
||||
header('Content-Type: application/javascript');
|
||||
|
||||
$this->printFolderChooserJs("form1");
|
||||
// $this->printFolderChooserJs("form1");
|
||||
} /* }}} */
|
||||
|
||||
function show() { /* {{{ */
|
||||
|
|
|
@ -65,7 +65,7 @@ $(document).ready( function() {
|
|||
});
|
||||
});
|
||||
<?php
|
||||
$this->printFolderChooserJs("form1");
|
||||
// $this->printFolderChooserJs("form1");
|
||||
$this->printDeleteFolderButtonJs();
|
||||
$this->printDeleteDocumentButtonJs();
|
||||
/* Add js for catching click on document in one page mode */
|
||||
|
|
|
@ -66,7 +66,7 @@ $(document).ready(function() {
|
|||
});
|
||||
});
|
||||
<?php
|
||||
$this->printFolderChooserJs("form1");
|
||||
// $this->printFolderChooserJs("form1");
|
||||
} /* }}} */
|
||||
|
||||
function show() { /* {{{ */
|
||||
|
|
|
@ -236,23 +236,6 @@ class SeedDMS_View_Settings extends SeedDMS_Bootstrap_Style {
|
|||
});
|
||||
});
|
||||
<?php
|
||||
foreach($extmgr->getExtensionConfiguration() as $extname=>$extconf) {
|
||||
if($extconf['config']) {
|
||||
foreach($extconf['config'] as $confkey=>$conf) {
|
||||
switch($conf['type']) {
|
||||
case 'select':
|
||||
if(!empty($conf['internal'])) {
|
||||
switch($conf['internal']) {
|
||||
case "folders":
|
||||
$this->printFolderChooserJs("form".$extname.$confkey, 'extensions['.$extname."][".$confkey."]");
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
function show() { /* {{{ */
|
||||
|
@ -609,7 +592,10 @@ $this->showStartPaneContent('site', (!$currenttab || $currenttab == 'site'));
|
|||
}
|
||||
break;
|
||||
case "attributedefinitions":
|
||||
$recs = $dms->getAllAttributeDefinitions();
|
||||
if(empty($conf['objtype']))
|
||||
$recs = $dms->getAllAttributeDefinitions();
|
||||
else
|
||||
$recs = $dms->getAllAttributeDefinitions(explode(',', $conf['objtype']));
|
||||
if($recs) {
|
||||
echo "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")."\" name=\"extensions[".$extname."][".$confkey."][]\"".(!empty($conf['multiple']) ? " multiple" : "").(!empty($conf['size']) ? " size=\"".$conf['size']."\"" : "")." data-placeholder=\"".getMLText("select_attribute_value")."\">";
|
||||
if($allowempty)
|
||||
|
|
|
@ -370,9 +370,6 @@ $(document).ready( function() {
|
|||
)
|
||||
);
|
||||
$this->formField(getMLText("home_folder"), $this->getFolderChooserHtml("form".($currUser ? $currUser->getId() : '0'), M_READ, -1, $currUser ? $dms->getFolder($currUser->getHomeFolder()) : 0, 'homefolder'));
|
||||
echo '<script language="JavaScript">';
|
||||
$this->printFolderChooserJs("form".($currUser ? $currUser->getId() : '0'));
|
||||
echo '</script>';
|
||||
|
||||
$this->formField(
|
||||
getMLText("quota"),
|
||||
|
|
|
@ -174,7 +174,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
$latestContent = $document->getLatestContent();
|
||||
$this->printTimelineJs('out.ViewDocument.php?action=timelinedata&documentid='.$latestContent->getDocument()->getID(), 300, '', date('Y-m-d'));
|
||||
}
|
||||
$this->printDocumentChooserJs("form1");
|
||||
// $this->printDocumentChooserJs("form1");
|
||||
$this->printDeleteDocumentButtonJs();
|
||||
/* Add js for catching click on document in one page mode */
|
||||
$this->printClickDocumentJs();
|
||||
|
@ -338,7 +338,13 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
} elseif(is_string($arr)) {
|
||||
echo $arr;
|
||||
} else {
|
||||
$this->printAttribute($attribute);
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||
<td><?php echo $this->getAttributeValue($attribute); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
|
|||
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'));
|
||||
?>
|
||||
seeddms_folder = <?= $folder->getID() ?>;
|
||||
function folderSelected(id, name) {
|
||||
function folderSelectedmaintree(id, name) {
|
||||
<?php if(!$onepage) { ?>
|
||||
window.location = '../out/out.ViewFolder.php?folderid=' + id;
|
||||
<?php } else { ?>
|
||||
|
@ -177,7 +177,7 @@ console.log(JSON.stringify(event.state));
|
|||
/* catch click on 'goto parent button' */
|
||||
$('body').on('click', '#goto-parent', function(ev) {
|
||||
attr_id = $(ev.currentTarget).data('parentid');
|
||||
folderSelected(attr_id, '');
|
||||
folderSelectedmaintree(attr_id, '');
|
||||
$([document.documentElement, document.body]).animate({
|
||||
scrollTop: 200
|
||||
}, 200);
|
||||
|
@ -192,7 +192,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
attr_id = $(ev.currentTarget).parent().data('target-id');
|
||||
if(typeof attr_id == 'undefined')
|
||||
attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3];
|
||||
folderSelected(attr_id, '');
|
||||
folderSelectedmaintree(attr_id, '');
|
||||
$([document.documentElement, document.body]).animate({
|
||||
scrollTop: 200
|
||||
}, 200);
|
||||
|
@ -209,7 +209,7 @@ $('body').on('click', '.order-btn', function(ev) {
|
|||
<?php } ?>
|
||||
<?php
|
||||
if($showtree == 1)
|
||||
$this->printNewTreeNavigationJs($folder->getID(), M_READ, 0, '', ($expandFolderTree == 1) ? -1 : 3, $orderby);
|
||||
$this->printNewTreeNavigationJs($folder->getID(), M_READ, 0, 'maintree', ($expandFolderTree == 1) ? -1 : 3, $orderby);
|
||||
|
||||
if ($enableDropUpload && $folder->getAccessMode($user) >= M_READWRITE) {
|
||||
echo "SeedDMSUpload.setUrl('../op/op.Ajax.php');";
|
||||
|
@ -295,7 +295,13 @@ $('body').on('click', '.order-btn', function(ev) {
|
|||
} elseif(is_string($arr)) {
|
||||
echo $arr;
|
||||
} else {
|
||||
$this->printAttribute($attribute);
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||
<td><?php echo $this->getAttributeValue($attribute); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -575,7 +581,7 @@ $('body').on('click', '.order-btn', function(ev) {
|
|||
* access expandFolderTree with $this->params because it can
|
||||
* be changed by preContent hook.
|
||||
*/
|
||||
$this->printNewTreeNavigationHtml($folderid, M_READ, 0, '', ($this->params['expandFolderTree'] == 1) ? -1 : 3, $orderby);
|
||||
$this->printNewTreeNavigationHtml($folderid, M_READ, 0, 'maintree', ($this->params['expandFolderTree'] == 1) ? -1 : 3, $orderby);
|
||||
$this->contentContainerEnd();
|
||||
} else {
|
||||
$this->contentHeading("<a href=\"../out/out.ViewFolder.php?folderid=". $folderid."&showtree=1\"><i class=\"fa fa-plus-circle\"></i></a>", true);
|
||||
|
|
Loading…
Reference in New Issue
Block a user