diff --git a/views/bootstrap/class.AttributeMgr.php b/views/bootstrap/class.AttributeMgr.php index b39c2d09c..ec2a739d1 100644 --- a/views/bootstrap/class.AttributeMgr.php +++ b/views/bootstrap/class.AttributeMgr.php @@ -31,29 +31,218 @@ require_once("class.Bootstrap.php"); */ class SeedDMS_View_AttributeMgr extends SeedDMS_Bootstrap_Style { + function js() { /* {{{ */ + $selattrdef = $this->params['selattrdef']; +?> + +$(document).ready( function() { + $('body').on('submit', '#form', function(ev){ +// if(checkForm()) return; +// event.preventDefault(); + }); + $( "#selector" ).change(function() { + $('div.ajax').trigger('update', {attrdefid: $(this).val()}); + }); +}); +params['dms']; + $user = $this->params['user']; + $attrdefs = $this->params['attrdefs']; + $selattrdef = $this->params['selattrdef']; + $cachedir = $this->params['cachedir']; + $previewwidth = $this->params['previewWidthList']; + $enableRecursiveCount = $this->params['enableRecursiveCount']; + $maxRecursiveCount = $this->params['maxRecursiveCount']; + + if($selattrdef) { + $this->contentHeading(getMLText("attrdef_info")); + $res = $selattrdef->getStatistics(30); +?> +
+
+
+ + + +
+
+
+"; + print "\n\n"; + print "".getMLText("attribute_value")."\n"; + print "".getMLText("attribute_count")."\n"; + print "\n\n"; + foreach($res['frequencies'][$type] as $entry) { + echo "".$entry['value']."".$entry['c'].""; + } + print ""; + } + } +?> +
+
+
+
+"; + print "\n\n"; + print "\n"; + print "".getMLText("name")."\n"; + print "".getMLText("status")."\n"; + print "".getMLText("action")."\n"; + print "\n\n\n"; + foreach($res['folders'] as $subFolder) { + echo $this->folderListRow($subFolder); + } + $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth); + foreach($res['docs'] as $document) { + echo $this->documentListRow($document, $previewer); + } + + echo "\n\n"; + } + + if($res['contents']) { + print ""; + print "\n\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n\n\n"; + $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth); + foreach($res['contents'] as $content) { + $doc = $content->getDocument(); + echo $this->documentListRow($doc, $previewer); + } + print "
".getMLText("name")."".getMLText("status")."".getMLText("action")."
"; + } + } + } /* }}} */ + + function showAttributeForm($attrdef) { /* {{{ */ + if($attrdef && !$attrdef->isUsed()) { +?> +
+ + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ : + + +
+ : + + +
+ : + + +
+ : + + getMultipleValues()) ? "checked" : "" ?>/> +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+ +
+
+params['selattrdef']; + + $this->showAttributeForm($selattrdef); + } /* }}} */ + function show() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; $attrdefs = $this->params['attrdefs']; + $selattrdef = $this->params['selattrdef']; $this->htmlStartPage(getMLText("admin_tools")); -?> - - -globalNavigation(); $this->contentStart(); $this->pageNavigation(getMLText("admin_tools"), "admin_tools"); @@ -61,19 +250,15 @@ function showAttributeDefinitions(selectObj) { ?>
-
+
: -
+
getID()."\"" : "") ?>>
-
- - -getID()."\" style=\"display : none;\">"; - if($attrdef->isUsed()) - echo '
'.getMLText('attrdef_in_use').'
'; -?> -
-isUsed()) { - $res = $attrdef->getStatistics(3); - if(isset($res['frequencies']) && $res['frequencies']) { - print ""; - print "\n\n"; - print "\n"; - print "\n"; - print "\n\n"; - foreach($res['frequencies'] as $entry) { - echo ""; - } - print "
".getMLText("attribute_count")."".getMLText("attribute_value")."
".$entry['c']."".$entry['value']."
"; - } - if($res['docs']) { - print ""; - print "\n\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n\n"; - foreach($res['docs'] as $doc) { - $owner = $doc->getOwner(); - $latest = $doc->getLatestContent(); - $status = $latest->getStatus(); - print "\n"; - print ""; - print "\n"; - print ""; - print ""; - $value = $doc->getAttributeValue($attrdef); - if(is_array($value)) - print ""; - else - print ""; - print "\n"; - } - print "
".getMLText("name")."".getMLText("owner")."".getMLText("status")."".getMLText("attribute_value")."".getMLText("actions")."
getID()."\">" . htmlspecialchars($doc->getName()) . "".htmlspecialchars($owner->getFullName())."".getOverallStatusText($status["status"])."".implode('; ', $value)."".$value.""; - print " ".getMLText("edit").""; - print "
"; - } - - if($res['folders']) { - print ""; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n\n"; - foreach($res['folders'] as $folder) { - $owner = $folder->getOwner(); - print ""; - print ""; - print "\n"; - print ""; - $value = $folder->getAttributeValue($attrdef); - if(is_array($value)) - print ""; - else - print ""; - print ""; - } - print "
".getMLText("name")."".getMLText("owner")."".getMLText("attribute_value")."".getMLText("actions")."
getID()."\">" . htmlspecialchars($folder->getName()) . "".htmlspecialchars($owner->getFullName())."".implode('; ', $value)."".$value.""; - print " ".getMLText("edit").""; - print "
"; - } - - if($res['contents']) { - print ""; - print "\n\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n\n"; - foreach($res['contents'] as $content) { - $doc = $content->getDocument(); - $owner = $doc->getOwner(); - print "\n"; - print ""; - print "\n"; - print ""; - print ""; - print ""; - $value = $content->getAttributeValue($attrdef); - if(is_array($value)) - print ""; - else - print ""; - print "\n"; - } - print "
".getMLText("name")."".getMLText("owner")."".getMLText("mimetype")."".getMLText("version")."".getMLText("attribute_value")."".getMLText("actions")."
getID()."\">" . htmlspecialchars($doc->getName()) . "".htmlspecialchars($owner->getFullName())."".$content->getMimeType()."".$content->getVersion()."".implode('; ', $value)."".$value.""; - print " ".getMLText("edit").""; - print "
"; - } - } else { -?> -
- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - : - - -
- : - - -
- : - - -
- : - - getMultipleValues() ? "checked" : "" ?>/> -
- : - - -
- : - - -
- : - - -
- : - - -
- -
-
-
- +
+
+
getID()."\"" : "") ?>>
+
-
-
- - htmlEndPage();