mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
Merge branch 'seeddms-4.3.x' into seeddms-5.0.x
This commit is contained in:
commit
dc3958b456
14
CHANGELOG
14
CHANGELOG
|
@ -1,3 +1,8 @@
|
|||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.0.1
|
||||
--------------------------------------------------------------------------------
|
||||
- merged changes from 4.3.25
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.0.1
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -13,6 +18,15 @@
|
|||
- add .xml to online file types by default
|
||||
- add home folder for users
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 4.3.25
|
||||
--------------------------------------------------------------------------------
|
||||
- much more consistent drag & drop
|
||||
- various translation updates
|
||||
- take out file deletion because it was (and probabbly never has been) useful
|
||||
- send notification if folder is deleted by ajax call
|
||||
- add page ImportFS for mass importing files from drop folder
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 4.3.24
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
|
@ -415,7 +415,7 @@ class SeedDMS_Core_Group {
|
|||
* @param integer $type type of item (T_DOCUMENT or T_FOLDER)
|
||||
* @return array array of notifications
|
||||
*/
|
||||
function getNotificationsByGroup($type=0) { /* {{{ */
|
||||
function getNotifications($type=0) { /* {{{ */
|
||||
$db = $this->_dms->getDB();
|
||||
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ".
|
||||
"WHERE `tblNotify`.`groupID` = ". $this->_id;
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
<email>uwe@steinmann.cx</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<date>2016-01-22</date>
|
||||
<date>2016-03-09</date>
|
||||
<time>14:34:58</time>
|
||||
<version>
|
||||
<release>5.0.1</release>
|
||||
<api>5.0.1</api>
|
||||
<release>5.0.2</release>
|
||||
<api>5.0.2</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
|
@ -24,7 +24,7 @@
|
|||
</stability>
|
||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||
<notes>
|
||||
- all changes from 4.3.24 merged
|
||||
- all changes from 4.3.25 merged
|
||||
</notes>
|
||||
<contents>
|
||||
<dir baseinstalldir="SeedDMS" name="/">
|
||||
|
@ -983,5 +983,45 @@ SeedDMS_Core_DMS::getNotificationsByUser() are deprecated
|
|||
- clean workflow log when a document version was deleted
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2016-01-21</date>
|
||||
<time>07:12:53</time>
|
||||
<version>
|
||||
<release>4.3.24</release>
|
||||
<api>4.3.24</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||
<notes>
|
||||
- make sure boolean attribute is saved as 0/1
|
||||
- add SeedDMS_Core_User::[g|s]etMandatoryWorkflows()
|
||||
- add SeedDMS_Core_User::getNotifications()
|
||||
- add SeedDMS_Core_Group::getNotifications()
|
||||
- SeedDMS_Core_DMS::getNotificationsByGroup() and
|
||||
SeedDMS_Core_DMS::getNotificationsByUser() are deprecated
|
||||
- SeedDMS_Core_DocumentCategory::getDocumentsByCategory() now returns the documents
|
||||
- add SeedDMS_Core_Group::getWorkflowStatus()
|
||||
- SeedDMS_Core_User::getDocumentsLocked() sets locking user propperly
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2016-01-22</date>
|
||||
<time>14:34:58</time>
|
||||
<version>
|
||||
<release>5.0.1</release>
|
||||
<api>5.0.1</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||
<notes>
|
||||
- all changes from 4.3.24 merged
|
||||
</notes>
|
||||
</release>
|
||||
</changelog>
|
||||
</package>
|
||||
|
|
|
@ -98,6 +98,9 @@ class SeedDMS_Preview_Previewer {
|
|||
* @return string file name of preview image
|
||||
*/
|
||||
protected function getFileName($object, $width) { /* }}} */
|
||||
if(!$object)
|
||||
return false;
|
||||
|
||||
$document = $object->getDocument();
|
||||
$dir = $this->previewDir.'/'.$document->getDir();
|
||||
switch(get_class($object)) {
|
||||
|
@ -173,6 +176,9 @@ class SeedDMS_Preview_Previewer {
|
|||
} /* }}} */
|
||||
|
||||
public function createPreview($object, $width=0) { /* {{{ */
|
||||
if(!$object)
|
||||
return false;
|
||||
|
||||
if($width == 0)
|
||||
$width = $this->width;
|
||||
else
|
||||
|
@ -248,6 +254,9 @@ class SeedDMS_Preview_Previewer {
|
|||
} /* }}} */
|
||||
|
||||
public function hasPreview($object, $width=0) { /* {{{ */
|
||||
if(!$object)
|
||||
return false;
|
||||
|
||||
if($width == 0)
|
||||
$width = $this->width;
|
||||
else
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
<email>uwe@steinmann.cx</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<date>2016-02-11</date>
|
||||
<date>2016-03-08</date>
|
||||
<time>09:36:57</time>
|
||||
<version>
|
||||
<release>1.1.5</release>
|
||||
<api>1.1.5</api>
|
||||
<release>1.1.6</release>
|
||||
<api>1.1.6</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
|
@ -23,8 +23,7 @@
|
|||
</stability>
|
||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||
<notes>
|
||||
add method getFilesize()
|
||||
timeout for external commands can be passed to contructor of SeedDMS_Preview_Previewer
|
||||
check if object passed to createPreview(), hasPreview() is not null
|
||||
</notes>
|
||||
<contents>
|
||||
<dir baseinstalldir="SeedDMS" name="/">
|
||||
|
@ -148,5 +147,22 @@ preview images will also be recreated if the object this image belongs is of new
|
|||
command for creating the preview will be called with a given timeout
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2016-02-11</date>
|
||||
<time>09:36:57</time>
|
||||
<version>
|
||||
<release>1.1.5</release>
|
||||
<api>1.1.5</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||
<notes>
|
||||
add method getFilesize()
|
||||
timeout for external commands can be passed to contructor of SeedDMS_Preview_Previewer
|
||||
</notes>
|
||||
</release>
|
||||
</changelog>
|
||||
</package>
|
||||
|
|
|
@ -237,26 +237,26 @@ switch($command) {
|
|||
if($folder->getAccessMode($user) >= M_READWRITE) {
|
||||
if($mfolder->setParent($folder)) {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>true, 'message'=>'Folder moved', 'data'=>''));
|
||||
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_move_folder'), 'data'=>''));
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'Error moving folder', 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No access on destination folder', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('access_denied'), 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No destination folder', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_folder_id'), 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('access_denied'), 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No folder', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_folder_id'), 'data'=>''));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -278,23 +278,23 @@ switch($command) {
|
|||
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_move_document'), 'data'=>''));
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'Error moving folder', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>'Error moving document', 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No access on destination folder', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('access_denied'), 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No destination folder', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_folder_id'), 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('access_denied'), 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No folder', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_doc_id'), 'data'=>''));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -310,6 +310,21 @@ switch($command) {
|
|||
if($folder) {
|
||||
if ($folder->getAccessMode($user) >= M_READWRITE) {
|
||||
if($folder->remove()) {
|
||||
if ($notifier) {
|
||||
$subject = "folder_deleted_email_subject";
|
||||
$message = "folder_deleted_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $foldername;
|
||||
$params['folder_path'] = $parent->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$params['url'] = "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$parent->getID();
|
||||
$notifier->toList($user, $nl["users"], $subject, $message, $params);
|
||||
foreach ($nl["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params);
|
||||
}
|
||||
}
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>true, 'message'=>'', 'data'=>''));
|
||||
} else {
|
||||
|
@ -318,11 +333,11 @@ switch($command) {
|
|||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('access_denied'), 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No folder', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_folder_id'), 'data'=>''));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -382,11 +397,11 @@ switch($command) {
|
|||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('access_denied'), 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No document', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_doc_id'), 'data'=>''));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -405,11 +420,11 @@ switch($command) {
|
|||
echo json_encode(array('success'=>false, 'message'=>'Error unlocking document', 'data'=>''));
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>true, 'message'=>'', 'data'=>''));
|
||||
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_unlocked'), 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('access_denied'), 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
if (!$document->setLocked($user)) {
|
||||
|
@ -417,16 +432,16 @@ switch($command) {
|
|||
echo json_encode(array('success'=>false, 'message'=>'Error locking document', 'data'=>''));
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>true, 'message'=>'', 'data'=>''));
|
||||
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_locked'), 'data'=>''));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('access_denied'), 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No document', 'data'=>''));
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_doc_id'), 'data'=>''));
|
||||
}
|
||||
}
|
||||
break; /* }}} */
|
||||
|
|
82
op/op.ImportFS.php
Normal file
82
op/op.ImportFS.php
Normal file
|
@ -0,0 +1,82 @@
|
|||
<?php
|
||||
include("../inc/inc.Settings.php");
|
||||
include("../inc/inc.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.ClassAccessOperation.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!isset($_GET["targetid"]) || !is_numeric($_GET["targetid"]) || $_GET["targetid"]<1) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("invalid_target_folder"));
|
||||
}
|
||||
$targetid = $_GET["targetid"];
|
||||
$folder = $dms->getFolder($targetid);
|
||||
if (!is_object($folder)) {
|
||||
echo "Could not find specified folder\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ($folder->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (empty($_GET["dropfolderfileform1"])) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("invalid_target_folder"));
|
||||
}
|
||||
$dirname = $settings->_dropFolderDir.'/'.$user->getLogin()."/".$_GET["dropfolderfileform1"];
|
||||
if(!is_dir($dirname)) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("invalid_target_folder"));
|
||||
}
|
||||
|
||||
function import_folder($dirname, $folder) { /* {{{ */
|
||||
global $user;
|
||||
|
||||
$d = dir($dirname);
|
||||
$sequence = 1;
|
||||
while(false !== ($entry = $d->read())) {
|
||||
$path = $dirname.'/'.$entry;
|
||||
if($entry != '.' && $entry != '..' && $entry != '.svn') {
|
||||
if(is_file($path)) {
|
||||
$name = basename($path);
|
||||
$filetmp = $path;
|
||||
|
||||
$reviewers = array();
|
||||
$approvers = array();
|
||||
$comment = '';
|
||||
$version_comment = '';
|
||||
$reqversion = 1;
|
||||
$expires = false;
|
||||
$keywords = '';
|
||||
$categories = array();
|
||||
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
$mimetype = finfo_file($finfo, $path);
|
||||
$lastDotIndex = strrpos($path, ".");
|
||||
if (is_bool($lastDotIndex) && !$lastDotIndex) $filetype = ".";
|
||||
else $filetype = substr($path, $lastDotIndex);
|
||||
|
||||
echo $mimetype." - ".$filetype." - ".$path."\n";
|
||||
$res = $folder->addDocument($name, $comment, $expires, $user, $keywords,
|
||||
$categories, $filetmp, $name,
|
||||
$filetype, $mimetype, $sequence, $reviewers,
|
||||
$approvers, $reqversion, $version_comment);
|
||||
|
||||
if (is_bool($res) && !$res) {
|
||||
echo "Could not add document to folder\n";
|
||||
exit(1);
|
||||
}
|
||||
set_time_limit(1200);
|
||||
} elseif(is_dir($path)) {
|
||||
$name = basename($path);
|
||||
$newfolder = $folder->addSubFolder($name, '', $user, $sequence);
|
||||
import_folder($path, $newfolder);
|
||||
}
|
||||
$sequence++;
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
header("Content-Type: text/plain");
|
||||
import_folder($dirname, $folder);
|
||||
|
|
@ -38,12 +38,18 @@ if(substr($settings->_dropFolderDir, -1, 1) == DIRECTORY_SEPARATOR)
|
|||
else
|
||||
$dropfolderdir = $settings->_dropFolderDir;
|
||||
|
||||
if(isset($_GET['showfolders']) && $_GET['showfolders'])
|
||||
$showfolders = true;
|
||||
else
|
||||
$showfolders = false;
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'dropfolderdir'=>$dropfolderdir, 'dropfolderfile'=>$_GET["dropfolderfile"], 'form'=>$form));
|
||||
if($view) {
|
||||
$view->setParam('cachedir', $settings->_cacheDir);
|
||||
$view->setParam('previewWidthList', $settings->_previewWidthList);
|
||||
$view->setParam('timeout', $settings->_cmdTimeout);
|
||||
$view->setParam('showfolders', $showfolders);
|
||||
$view($_GET);
|
||||
exit;
|
||||
}
|
||||
|
|
37
out/out.ImportFS.php
Normal file
37
out/out.ImportFS.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2010 Matteo Lucarelli
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// 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.DBInit.php");
|
||||
include("../inc/inc.Utils.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'dropfolderdir'=>$settings->_dropFolderDir));
|
||||
if($view) {
|
||||
$view($_GET);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
@ -136,7 +136,6 @@ $(document).ready( function() {
|
|||
$.get('../op/op.Ajax.php',
|
||||
{ command: 'addtoclipboard', type: type, id: id },
|
||||
function(data) {
|
||||
console.log(data);
|
||||
if(data.success) {
|
||||
$("#main-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=mainclipboard')
|
||||
$("#menu-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=menuclipboard')
|
||||
|
@ -172,7 +171,6 @@ $(document).ready( function() {
|
|||
$.get('../op/op.Ajax.php',
|
||||
{ command: 'removefromclipboard', type: type, id: id },
|
||||
function(data) {
|
||||
console.log(data);
|
||||
if(data.success) {
|
||||
$("#main-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=mainclipboard')
|
||||
$("#menu-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=menuclipboard')
|
||||
|
@ -207,7 +205,6 @@ $(document).ready( function() {
|
|||
$.get('../op/op.Ajax.php',
|
||||
{ command: 'tooglelockdocument', id: id },
|
||||
function(data) {
|
||||
console.log(data);
|
||||
if(data.success) {
|
||||
$("#table-row-document-"+id).html('Loading').load('../op/op.Ajax.php?command=view&view=documentlistrow&id='+id)
|
||||
noty({
|
||||
|
@ -243,7 +240,6 @@ $(document).ready( function() {
|
|||
{ command: 'movefolder', folderid: attr_source, targetfolderid: attr_dest, formtoken: attr_formtoken },
|
||||
function(data) {
|
||||
if(data.success) {
|
||||
console.log(data);
|
||||
noty({
|
||||
text: data.msg,
|
||||
type: data.success ? 'success' : 'error',
|
||||
|
@ -268,7 +264,6 @@ $(document).ready( function() {
|
|||
{ command: 'movedocument', docid: attr_source, targetfolderid: attr_dest, formtoken: attr_formtoken },
|
||||
function(data) {
|
||||
if(data.success) {
|
||||
console.log(data);
|
||||
noty({
|
||||
text: data.msg,
|
||||
type: data.success ? 'success' : 'error',
|
||||
|
@ -298,7 +293,6 @@ $(document).ready( function() {
|
|||
phrase: $(ev.target).parent().children('[name=missing-lang-translation]').val()
|
||||
},
|
||||
success: function(data, textStatus) {
|
||||
// console.log(data);
|
||||
noty({
|
||||
text: data.message,
|
||||
type: data.success ? 'success' : 'error',
|
||||
|
@ -343,7 +337,6 @@ $(document).ready( function() {
|
|||
}
|
||||
} else
|
||||
url = href;
|
||||
// console.log('Calling '+url);
|
||||
$.get(url, function(data) {
|
||||
element.html(data);
|
||||
$(".chzn-select").chosen();
|
||||
|
@ -367,7 +360,6 @@ $(document).ready( function() {
|
|||
} else {
|
||||
url += "&"+param1;
|
||||
}
|
||||
// console.log("Calling: "+url);
|
||||
element.prepend('<div style="position: absolute; overflow: hidden; background: #f7f7f7; z-index: 1000; height: '+element.height()+'px; width: '+element.width()+'px; opacity: 0.7; display: table;"><div style="display: table-cell;text-align: center; vertical-align: middle; "><img src="../views/bootstrap/images/ajax-loader.gif"></div>');
|
||||
$.get(url, function(data) {
|
||||
element.html(data);
|
||||
|
@ -487,7 +479,6 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
data: formData,
|
||||
success: function(data){
|
||||
status.setProgress(100);
|
||||
// console.log(data);
|
||||
if(data.success) {
|
||||
noty({
|
||||
text: data.message,
|
||||
|
|
|
@ -174,7 +174,7 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
|||
$this->contentContainerEnd();
|
||||
|
||||
// files deletion //////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
$this->contentHeading(getMLText("files_deletion"));
|
||||
$this->contentContainerStart();
|
||||
print "<p>".getMLText("files_deletion_warning")."</p>\n";
|
||||
|
@ -185,6 +185,7 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
|||
print "</form>\n";
|
||||
|
||||
$this->contentContainerEnd();
|
||||
*/
|
||||
|
||||
$this->htmlEndPage();
|
||||
} /* }}} */
|
||||
|
|
|
@ -1149,11 +1149,11 @@ $('#acceptkeywords').click(function(ev) {
|
|||
}
|
||||
} /* }}} */
|
||||
|
||||
function printDropFolderChooserHtml($formName, $dropfolderfile="") { /* {{{ */
|
||||
function printDropFolderChooserHtml($formName, $dropfolderfile="", $showfolders=0) { /* {{{ */
|
||||
print "<div class=\"input-append\">\n";
|
||||
print "<input readonly type=\"text\" id=\"dropfolderfile".$formName."\" name=\"dropfolderfile".$formName."\" value=\"".$dropfolderfile."\">";
|
||||
print "<button type=\"button\" class=\"btn\" id=\"clearFilename".$formName."\"><i class=\"icon-remove\"></i></button>";
|
||||
print "<a data-target=\"#dropfolderChooser\" href=\"out.DropFolderChooser.php?form=form1&dropfolderfile=".$dropfolderfile."\" role=\"button\" class=\"btn\" data-toggle=\"modal\">".getMLText("choose_target_file")."…</a>\n";
|
||||
print "<a data-target=\"#dropfolderChooser\" href=\"out.DropFolderChooser.php?form=form1&dropfolderfile=".$dropfolderfile."&showfolders=".$showfolders."\" role=\"button\" class=\"btn\" data-toggle=\"modal\">".getMLText("choose_target_file")."…</a>\n";
|
||||
print "</div>\n";
|
||||
?>
|
||||
<div class="modal hide" id="dropfolderChooser" tabindex="-1" role="dialog" aria-labelledby="dropfolderChooserLabel" aria-hidden="true">
|
||||
|
@ -1172,7 +1172,7 @@ $('#acceptkeywords').click(function(ev) {
|
|||
<?php
|
||||
} /* }}} */
|
||||
|
||||
function printDropFolderChooserJs($formName) { /* {{{ */
|
||||
function printDropFolderChooserJs($formName, $showfolders=0) { /* {{{ */
|
||||
?>
|
||||
/* Set up a callback which is called when a folder in the tree is selected */
|
||||
modalDropfolderChooser = $('#dropfolderChooser');
|
||||
|
@ -1180,6 +1180,12 @@ function fileSelected(name) {
|
|||
$('#dropfolderfile<?php echo $formName ?>').val(name);
|
||||
modalDropfolderChooser.modal('hide');
|
||||
}
|
||||
<?php if($showfolders) { ?>
|
||||
function folderSelected(name) {
|
||||
$('#dropfolderfile<?php echo $formName ?>').val(name);
|
||||
modalDropfolderChooser.modal('hide');
|
||||
}
|
||||
<?php } ?>
|
||||
function clearFilename<?php print $formName ?>() {
|
||||
$('#dropfolderfile<?php echo $formName ?>').val('');
|
||||
}
|
||||
|
@ -1189,12 +1195,12 @@ $('#clearfilename<?php print $formName ?>').click(function(ev) {
|
|||
<?php
|
||||
} /* }}} */
|
||||
|
||||
function printDropFolderChooser($formName, $dropfolderfile="") { /* {{{ */
|
||||
$this->printDropFolderChooserHtml($formName, $dropfolderfile);
|
||||
function printDropFolderChooser($formName, $dropfolderfile="", $showfolders=0) { /* {{{ */
|
||||
$this->printDropFolderChooserHtml($formName, $dropfolderfile, $showfolders);
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
<?php
|
||||
$this->printDropFolderChooserJs($formName);
|
||||
$this->printDropFolderChooserJs($formName, $showfolders);
|
||||
?>
|
||||
</script>
|
||||
<?php
|
||||
|
|
|
@ -38,6 +38,10 @@ $('#fileselect').click(function(ev) {
|
|||
attr_filename = $(ev.currentTarget).attr('filename');
|
||||
fileSelected(attr_filename);
|
||||
});
|
||||
$('#folderselect').click(function(ev) {
|
||||
attr_foldername = $(ev.currentTarget).attr('foldername');
|
||||
folderSelected(attr_foldername);
|
||||
});
|
||||
<?php
|
||||
} /* }}} */
|
||||
|
||||
|
@ -50,6 +54,7 @@ $('#fileselect').click(function(ev) {
|
|||
$cachedir = $this->params['cachedir'];
|
||||
$previewwidth = $this->params['previewWidthList'];
|
||||
$timeout = $this->params['timeout'];
|
||||
$showfolders = $this->params['showfolders'];
|
||||
|
||||
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||
|
||||
|
@ -79,20 +84,25 @@ var targetName = document.<?php echo $form?>.dropfolderfile<?php print $form ?>;
|
|||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
while (false !== ($entry = $d->read())) {
|
||||
if($entry != '..' && $entry != '.') {
|
||||
if(!is_dir($entry)) {
|
||||
if(!is_dir($dir.'/'.$entry)) {
|
||||
$mimetype = finfo_file($finfo, $dir.'/'.$entry);
|
||||
$previewer->createRawPreview($dir.'/'.$entry, 'dropfolder/', $mimetype);
|
||||
echo "<tr><td style=\"min-width: ".$previewwidth."px;\">";
|
||||
if($previewer->hasRawPreview($dir.'/'.$entry, 'dropfolder/')) {
|
||||
echo "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.DropFolderPreview.php?filename=".$entry."&width=".$previewwidth."\" title=\"".htmlspecialchars($mimetype)."\">";
|
||||
}
|
||||
echo "</td><td><span style=\"cursor: pointer;\" id=\"fileselect\" filename=\"".$entry."\" _onClick=\"fileSelected('".$entry."');\">".$entry."</span></td><td align=\"right\">".SeedDMS_Core_File::format_filesize(filesize($dir.'/'.$entry))."</td><td>".date('Y-m-d H:i:s', filectime($dir.'/'.$entry))."</td></tr>\n";
|
||||
echo "</td><td><span style=\"cursor: pointer;\" id=\"fileselect\" filename=\"".$entry."\">".$entry."</span></td><td align=\"right\">".SeedDMS_Core_File::format_filesize(filesize($dir.'/'.$entry))."</td><td>".date('Y-m-d H:i:s', filectime($dir.'/'.$entry))."</td></tr>\n";
|
||||
} elseif($showfolders) {
|
||||
echo "<tr>";
|
||||
echo "<td></td>";
|
||||
echo "<td><span style=\"cursor: pointer;\" id=\"folderselect\" foldername=\"".$entry."\" >".$entry."</span></td><td align=\"right\"></td><td></td>";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</tbody>\n";
|
||||
echo "</table>\n";
|
||||
echo '<script src="../out/out.DropFolderChooser.php?action=js&'.$_SERVER['QUERY_STRING'].'"></script>'."\n";
|
||||
echo '<script src="../out/out.DropFolderChooser.php?action=js&'.$_SERVER['QUERY_STRING'].'"></script>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
78
views/bootstrap/class.ImportFS.php
Normal file
78
views/bootstrap/class.ImportFS.php
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
/**
|
||||
* Implementation of ImportFS view
|
||||
*
|
||||
* @category DMS
|
||||
* @package SeedDMS
|
||||
* @license GPL 2
|
||||
* @version @version@
|
||||
* @author Uwe Steinmann <uwe@steinmann.cx>
|
||||
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
||||
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
||||
* 2010-2012 Uwe Steinmann
|
||||
* @version Release: @package_version@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include parent class
|
||||
*/
|
||||
require_once("class.Bootstrap.php");
|
||||
|
||||
/**
|
||||
* Class which outputs the html page for ImportFS view
|
||||
*
|
||||
* @category DMS
|
||||
* @package SeedDMS
|
||||
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
|
||||
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
||||
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
||||
* 2010-2012 Uwe Steinmann
|
||||
* @version Release: @package_version@
|
||||
*/
|
||||
class SeedDMS_View_ImportFS extends SeedDMS_Bootstrap_Style {
|
||||
|
||||
function js() { /* {{{ */
|
||||
header('Content-Type: application/javascript');
|
||||
|
||||
$this->printFolderChooserJs("form1");
|
||||
$this->printDropFolderChooserJs("form1", 1);
|
||||
} /* }}} */
|
||||
|
||||
function show() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$dropfolderdir = $this->params['dropfolderdir'];
|
||||
|
||||
$this->htmlStartPage(getMLText("import_fs"));
|
||||
$this->globalNavigation();
|
||||
$this->contentStart();
|
||||
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
|
||||
$this->contentHeading(getMLText("import_fs"));
|
||||
$this->contentContainerStart();
|
||||
|
||||
print "<form class=\"form-horizontal\" action=\"../op/op.ImportFS.php\" name=\"form1\">";
|
||||
print "<div class=\"control-group\"><label class=\"control-label\"></label><div class=\"controls\">";
|
||||
$this->printFolderChooserHtml("form1",M_READWRITE);
|
||||
print "</div></div>";
|
||||
if($dropfolderdir) {
|
||||
print "<div class=\"control-group\"><label class=\"control-label\">";
|
||||
printMLText("dropfolder_file");
|
||||
echo ": ";
|
||||
print "</label><div class=\"controls\">";
|
||||
/* Setting drop folder dir to "" will force to take the default from settings.xml */
|
||||
$this->printDropFolderChooserHtml("form1", "", 1);
|
||||
print "</div></div>";
|
||||
}
|
||||
print "<div class=\"control-group\"><label class=\"control-label\">";
|
||||
print "</label><div class=\"controls\">";
|
||||
print "<input type='submit' class='btn' name='' value='".getMLText("import")."'/><br />";
|
||||
print "</div></div>";
|
||||
print "</form>\n";
|
||||
|
||||
$this->contentContainerEnd();
|
||||
|
||||
$this->htmlEndPage();
|
||||
} /* }}} */
|
||||
}
|
||||
|
|
@ -96,7 +96,7 @@ class SeedDMS_View_ObjectCheck extends SeedDMS_Bootstrap_Style {
|
|||
print "<tr>\n";
|
||||
$this->needsrepair = true;
|
||||
$lc = $document->getLatestContent();
|
||||
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\"><img class=\"mimeicon\" src=\"../out/images/icons/".UI::getMimeIcon($lc->getFileType())."\" title=\"".$lc->getMimeType()."\"></a></td>";
|
||||
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\"><img class=\"mimeicon\" src=\"../out/images/icons/".$this->getMimeIcon($lc->getFileType())."\" title=\"".$lc->getMimeType()."\"></a></td>";
|
||||
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\">/";
|
||||
$folder = $document->getFolder();
|
||||
$tmppath = $folder->getPath();
|
||||
|
@ -124,7 +124,7 @@ class SeedDMS_View_ObjectCheck extends SeedDMS_Bootstrap_Style {
|
|||
$filepath = $dms->contentDir . $version->getPath();
|
||||
if(!file_exists($filepath)) {
|
||||
print "<tr>\n";
|
||||
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\"><img class=\"mimeicon\" src=\"../out/images/icons/".UI::getMimeIcon($version->getFileType())."\" title=\"".$version->getMimeType()."\"></a></td>";
|
||||
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\"><img class=\"mimeicon\" src=\"../out/images/icons/".$this->getMimeIcon($version->getFileType())."\" title=\"".$version->getMimeType()."\"></a></td>";
|
||||
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\">/";
|
||||
$folder = $document->getFolder();
|
||||
$tmppath = $folder->getPath();
|
||||
|
|
|
@ -608,9 +608,9 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
}
|
||||
else {
|
||||
$reqName = htmlspecialchars($required->getFullName()." (".$required->getLogin().")");
|
||||
if($required->getId() == $user->getId() && ($user->getId() != $owner->getId() || $enableownerrevapp == 1))
|
||||
$is_reviewer = true;
|
||||
}
|
||||
if($r["required"] == $user->getId() && ($user->getId() != $owner->getId() || $enableownerrevapp == 1))
|
||||
$is_reviewer = true;
|
||||
break;
|
||||
case 1: // Reviewer is a group.
|
||||
$required = $dms->getGroup($r["required"]);
|
||||
|
@ -677,9 +677,9 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
}
|
||||
else {
|
||||
$reqName = htmlspecialchars($required->getFullName()." (".$required->getLogin().")");
|
||||
if($required->getId() == $user->getId())
|
||||
$is_approver = true;
|
||||
}
|
||||
if($a["required"] == $user->getId())
|
||||
$is_approver = true;
|
||||
break;
|
||||
case 1: // Approver is a group.
|
||||
$required = $dms->getGroup($a["required"]);
|
||||
|
@ -688,9 +688,9 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
}
|
||||
else {
|
||||
$reqName = "<i>".htmlspecialchars($required->getName())."</i>";
|
||||
if($required->isMember($user) && ($user->getId() != $owner->getId() || $enableownerrevapp == 1))
|
||||
$is_approver = true;
|
||||
}
|
||||
if($required->isMember($user) && ($user->getId() != $owner->getId() || $enableownerrevapp == 1))
|
||||
$is_approver = true;
|
||||
break;
|
||||
}
|
||||
print "<tr>\n";
|
||||
|
|
Loading…
Reference in New Issue
Block a user