Merge branch 'seeddms-4.3.9' into develop

Conflicts:
	styles/bootstrap/application.js
	views/bootstrap/class.Bootstrap.php
This commit is contained in:
Uwe Steinmann 2014-07-08 08:49:14 +02:00
commit 4d8f9731d5
11 changed files with 27 additions and 28 deletions

View File

@ -21,6 +21,7 @@
- much improved document handling
- list mandatory approvers/reviewers on AddDocument and UpdateDocument page (Bug #154)
₋ search in attributes of folders
- fix document selection on ManageNotify page
--------------------------------------------------------------------------------
Changes in version 4.3.8

View File

@ -157,10 +157,10 @@ function createFolderTar($folder,$ark) { /* {{{ */
return true;
} /* }}} */
if (!isset($_GET["targetidform2"]) || !is_numeric($_GET["targetidform2"]) || intval($_GET["targetidform2"])<1) {
if (!isset($_GET["targetid"]) || !is_numeric($_GET["targetid"]) || intval($_GET["targetid"])<1) {
UI::exitError(getMLText("admin_tools"),getMLText("invalid_folder_id"));
}
$folderid = $_GET["targetidform2"];
$folderid = $_GET["targetid"];
$folder = $dms->getFolder($folderid);
if (!is_object($folder)) {

View File

@ -47,10 +47,10 @@ function createVersionigFiles($folder)
return true;
}
if (!isset($_GET["targetidform1"]) || !is_numeric($_GET["targetidform1"]) || intval($_GET["targetidform1"])<1) {
if (!isset($_GET["targetid"]) || !is_numeric($_GET["targetid"]) || intval($_GET["targetid"])<1) {
UI::exitError(getMLText("admin_tools"),getMLText("invalid_folder_id"));
}
$folderid = $_GET["targetidform1"];
$folderid = $_GET["targetid"];
$folder = $dms->getFolder($folderid);
if (!is_object($folder)) {

View File

@ -46,6 +46,7 @@ if (isset($_GET["userid"]) && (!is_numeric($_GET["userid"]) || $_GET["userid"]<-
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("unknown_user"));
}
$userid = 0;
if(isset($_GET["userid"]))
$userid = $_GET["userid"];
@ -71,7 +72,7 @@ if ($document->getAccessMode($user) < M_READ) {
// delete notification
if ($action == "delnotify"){
if (isset($userid)) {
if ($userid) {
$obj = $dms->getUser($userid);
$res = $document->removeNotify($userid, true);
} elseif (isset($groupid)) {
@ -134,7 +135,7 @@ if ($action == "delnotify"){
// add notification
else if ($action == "addnotify") {
if ($userid != -1) {
if ($userid) {
$res = $document->addNotify($userid, true);
switch ($res) {
case -1:

View File

@ -84,8 +84,8 @@ if ($_GET["type"]=="document"){
} else if ($_GET["type"]=="folder") {
if ($_GET["action"]=="add"){
if (!isset($_POST["targetidform1"])) UI::exitError(getMLText("my_account"),getMLText("error_occured"));
$folderid = $_POST["targetidform1"];
if (!isset($_POST["targetid"])) UI::exitError(getMLText("my_account"),getMLText("error_occured"));
$folderid = $_POST["targetid"];
}else if ($_GET["action"]=="del"){
if (!isset($_GET["id"])) UI::exitError(getMLText("my_account"),getMLText("error_occured"));
$folderid = $_GET["id"];

View File

@ -38,11 +38,11 @@ if (!is_object($document)) {
$oldFolder = $document->getFolder();
if (!isset($_GET["targetidform1"]) || !is_numeric($_GET["targetidform1"]) || $_GET["targetidform1"]<1) {
if (!isset($_GET["targetid"]) || !is_numeric($_GET["targetid"]) || $_GET["targetid"]<1) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_target_folder"));
}
$targetid = $_GET["targetidform1"];
$targetid = $_GET["targetid"];
$targetFolder = $dms->getFolder($targetid);
if (!is_object($targetFolder)) {

View File

@ -39,11 +39,11 @@ if ($folderid == $settings->_rootFolderID || !$folder->getParent()) {
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("cannot_move_root"));
}
if (!isset($_GET["targetidform1"]) || !is_numeric($_GET["targetidform1"]) || intval($_GET["targetidform1"])<1) {
if (!isset($_GET["targetid"]) || !is_numeric($_GET["targetid"]) || intval($_GET["targetid"])<1) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
}
$targetid = $_GET["targetidform1"];
$targetid = $_GET["targetid"];
$targetFolder = $dms->getFolder($targetid);
if (!is_object($targetFolder)) {

View File

@ -221,8 +221,8 @@ if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) {
// Check to see if the search has been restricted to a particular sub-tree in
// the folder hierarchy.
if (isset($_GET["targetidform1"]) && is_numeric($_GET["targetidform1"]) && $_GET["targetidform1"]>0) {
$targetid = $_GET["targetidform1"];
if (isset($_GET["targetid"]) && is_numeric($_GET["targetid"]) && $_GET["targetid"]>0) {
$targetid = $_GET["targetid"];
$startFolder = $dms->getFolder($targetid);
}
else {

View File

@ -26,11 +26,11 @@ if (!$user->isAdmin()) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
if (!isset($_GET["targetidform3"]) || !is_numeric($_GET["targetidform3"]) || intval($_GET["targetidform3"])<1) {
if (!isset($_GET["targetid"]) || !is_numeric($_GET["targetid"]) || intval($_GET["targetid"])<1) {
UI::exitError(getMLText("admin_tools"),getMLText("invalid_folder_id"));
}
$folder = $dms->getFolder(intval($_GET["targetidform3"]));
$folder = $dms->getFolder(intval($_GET["targetid"]));
if (!is_object($folder)) {
UI::exitError(getMLText("admin_tools"),getMLText("invalid_folder_id"));

View File

@ -74,7 +74,6 @@ $(document).ready( function() {
/* Document chooser */
$("[id^=choosedocsearch]").typeahead({
minLength: 3,
formname: 'form1',
source: function(query, process) {
// console.log(this.options);
$.get('../op/op.Ajax.php', { command: 'searchdocument', query: query, limit: 8 }, function(data) {
@ -86,8 +85,8 @@ $(document).ready( function() {
* we use it to update a second input field with the doc id. */
updater: function (item) {
strarr = item.split("#");
//console.log(this.options.formname);
$('#docid' + this.options.formname).attr('value', strarr[0]);
target = this.$element.data('target');
$('#'+target).attr('value', strarr[0]);
return strarr[1];
},
/* Set a matcher that allows any returned value */
@ -103,7 +102,6 @@ $(document).ready( function() {
/* Folder chooser */
$("[id^=choosefoldersearch]").typeahead({
minLength: 3,
formname: 'form1',
source: function(query, process) {
// console.log(this.options);
$.get('../op/op.Ajax.php', { command: 'searchfolder', query: query, limit: 8 }, function(data) {
@ -115,10 +113,9 @@ $(document).ready( function() {
* it to set the document location. */
updater: function (item) {
strarr = item.split("#");
//console.log(this.options.formname);
// console.log(this.$element.attr('target'));
/* Attribute target has the field name storing the selected id */
$('#'+this.$element.attr('target')).attr('value', strarr[0]);
//console.log(this.$element.data('target'));
target = this.$element.data('target');
$('#'+target).attr('value', strarr[0]);
return strarr[1];
},
/* Set a matcher that allows any returned value */

View File

@ -893,9 +893,9 @@ $(document).ready(function () {
} /* }}} */
function printDocumentChooser($formName) { /* {{{ */
print "<input type=\"hidden\" id=\"docid".$formName."\" name=\"docid\">";
print "<input type=\"hidden\" id=\"docid".$formName."\" name=\"docid\" value=\"\">";
print "<div class=\"input-append\">\n";
print "<input type=\"text\" id=\"choosedocsearch\" data-provide=\"typeahead\" name=\"docname".$formName."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\" />";
print "<input type=\"text\" id=\"choosedocsearch\" data-target=\"docid".$formName."\" data-provide=\"typeahead\" name=\"docname".$formName."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\" />";
print "<a data-target=\"#docChooser".$formName."\" href=\"out.DocumentChooser.php?form=".$formName."&folderid=".$this->params['rootfolderid']."\" role=\"button\" class=\"btn\" data-toggle=\"modal\">".getMLText("document")."…</a>\n";
print "</div>\n";
?>
@ -927,10 +927,10 @@ function folderSelected<?php echo $formName ?>(id, name) {
function printFolderChooser($form, $accessMode, $exclude = -1, $default = false, $formname) { /* {{{ */
$formid = "targetid".$form;
if(!$formname)
$formname = "targetid".$form;
$formname = "targetid";
print "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
print "<div class=\"input-append\">\n";
print "<input type=\"text\" id=\"choosefoldersearch".$form."\" data-provide=\"typeahead\" name=\"targetname".$form."\" value=\"". (($default) ? htmlspecialchars($default->getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\" target=\"".$formid."\"/>";
print "<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."\"/>";
print "<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";
print "</div>\n";
?>