Merge branch 'seeddms-4.3.x' into seeddms-5.0.x

This commit is contained in:
Uwe Steinmann 2016-02-15 17:08:01 +01:00
commit 202d994e1c
58 changed files with 186 additions and 99 deletions

View File

@ -24,6 +24,7 @@
- further pages with content security policy turned on
- various translation updates
- check for document expiration when showing search result and folder content
- more rest api functions
--------------------------------------------------------------------------------
Changes in version 4.3.23

View File

@ -861,7 +861,7 @@ class SeedDMS_Core_User { /* {{{ */
function getDocumentsLocked() { /* {{{ */
$db = $this->_dms->getDB();
$queryStr = "SELECT `tblDocuments`.* ".
$queryStr = "SELECT `tblDocuments`.*, `tblDocumentLocks`.`userID` as `lockUser` ".
"FROM `tblDocumentLocks` LEFT JOIN `tblDocuments` ON `tblDocuments`.`id` = `tblDocumentLocks`.`document` ".
"WHERE `tblDocumentLocks`.`userID` = '".$this->_id."' ".
"ORDER BY `id` DESC";

View File

@ -964,6 +964,7 @@ by a group or user right
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>
</changelog>

View File

@ -37,7 +37,13 @@ class SeedDMS_Preview_Previewer {
*/
protected $width;
function __construct($previewDir, $width=40) {
/**
* @var integer $timeout maximum time for execution of external commands
* @access protected
*/
protected $timeout;
function __construct($previewDir, $width=40, $timeout=5) {
if(!is_dir($previewDir)) {
if (!SeedDMS_Core_File::makeDir($previewDir)) {
$this->previewDir = '';
@ -48,9 +54,10 @@ class SeedDMS_Preview_Previewer {
$this->previewDir = $previewDir;
}
$this->width = intval($width);
$this->timeout = intval($timeout);
}
static function execWithTimeout($cmd, $timeout=2) { /* {{{ */
static function execWithTimeout($cmd, $timeout=5) { /* {{{ */
$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
@ -155,7 +162,7 @@ class SeedDMS_Preview_Previewer {
if($cmd) {
//exec($cmd);
try {
self::execWithTimeout($cmd);
self::execWithTimeout($cmd, $this->timeout);
} catch(Exception $e) {
}
}
@ -216,7 +223,7 @@ class SeedDMS_Preview_Previewer {
if($cmd) {
//exec($cmd);
try {
self::execWithTimeout($cmd);
self::execWithTimeout($cmd, $this->timeout);
} catch(Exception $e) {
}
}

View File

@ -24,6 +24,7 @@
<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>
<contents>
<dir baseinstalldir="SeedDMS" name="/">

View File

@ -31,14 +31,16 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common {
case "version":
if(!$this->callHook('version')) {
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($dms->contentDir . $content->getPath() ));
$efilename = rawurlencode($content->getOriginalFileName());
header("Content-Disposition: attachment; filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
header("Content-Type: " . $content->getMimeType());
header("Cache-Control: must-revalidate");
if(file_exists($dms->contentDir . $content->getPath()) {
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($dms->contentDir . $content->getPath() ));
$efilename = rawurlencode($content->getOriginalFileName());
header("Content-Disposition: attachment; filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
header("Content-Type: " . $content->getMimeType());
header("Cache-Control: must-revalidate");
readfile($dms->contentDir . $content->getPath());
readfile($dms->contentDir . $content->getPath());
}
}
break;
}

View File

@ -890,6 +890,7 @@ URL: [url]',
'select_one' => 'اختر واحد',
'select_users' => 'اضغط لاختيار المستخدم',
'select_workflow' => 'اختر مسار العمل',
'send_test_mail' => '',
'september' => 'سبتمبر',
'sequence' => 'تتابع',
'seq_after' => 'بعد "[prevname]"',

View File

@ -755,6 +755,7 @@ $text = array(
'select_one' => 'Избери един',
'select_users' => 'Кликни да избереш потребители',
'select_workflow' => 'Избери процес',
'send_test_mail' => '',
'september' => 'септември',
'sequence' => 'Последователност',
'seq_after' => 'След "[prevname]"',

View File

@ -760,6 +760,7 @@ URL: [url]',
'select_one' => 'Seleccionar un',
'select_users' => '',
'select_workflow' => '',
'send_test_mail' => '',
'september' => 'Setembre',
'sequence' => 'Seqüència',
'seq_after' => 'Després "[prevname]"',

View File

@ -899,6 +899,7 @@ URL: [url]',
'select_one' => 'Vyberte jeden',
'select_users' => 'Kliknutím vyberte uživatele',
'select_workflow' => 'Vyberte postup práce',
'send_test_mail' => '',
'september' => 'Září',
'sequence' => 'Posloupnost',
'seq_after' => 'Po "[prevname]"',

View File

@ -19,7 +19,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// Translators: Admin (2170), dgrutsch (21)
// Translators: Admin (2171), dgrutsch (21)
$text = array(
'accept' => 'Übernehmen',
@ -936,6 +936,7 @@ URL: [url]',
'select_one' => 'Bitte wählen',
'select_users' => 'Klicken zur Auswahl eines Benutzers',
'select_workflow' => 'Workflow auswählen',
'send_test_mail' => 'Sende Test-Email',
'september' => 'September',
'sequence' => 'Reihenfolge',
'seq_after' => 'Nach "[prevname]"',

View File

@ -19,7 +19,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// Translators: Admin (1305), dgrutsch (7), netixw (14)
// Translators: Admin (1306), dgrutsch (7), netixw (14)
$text = array(
'accept' => 'Accept',
@ -936,6 +936,7 @@ URL: [url]',
'select_one' => 'Select one',
'select_users' => 'Click to select users',
'select_workflow' => 'Select workflow',
'send_test_mail' => 'Send test mail',
'september' => 'September',
'sequence' => 'Sequence',
'seq_after' => 'After "[prevname]"',

View File

@ -905,6 +905,7 @@ URL: [url]',
'select_one' => 'Seleccionar uno',
'select_users' => 'Haga Click para seleccionar usuarios',
'select_workflow' => 'Selecionar Flujo de Trabajo',
'send_test_mail' => '',
'september' => 'Septiembre',
'sequence' => 'Secuencia',
'seq_after' => 'Después "[prevname]"',

View File

@ -19,7 +19,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// Translators: Admin (1009), jeromerobert (50), lonnnew (9)
// Translators: Admin (1011), jeromerobert (50), lonnnew (9)
$text = array(
'accept' => 'Accepter',
@ -881,6 +881,7 @@ URL: [url]',
'select_one' => 'Selectionner',
'select_users' => 'Cliquer pour choisir un utilisateur',
'select_workflow' => 'Choisir un workflow',
'send_test_mail' => '',
'september' => 'Septembre',
'sequence' => 'Position dans le répertoire',
'seq_after' => 'Après "[prevname]"',
@ -936,7 +937,7 @@ URL: [url]',
'settings_dbVersion' => 'Schéma de base de données trop ancien',
'settings_defaultSearchMethod' => '',
'settings_defaultSearchMethod_desc' => '',
'settings_defaultSearchMethod_valdatabase' => '',
'settings_defaultSearchMethod_valdatabase' => 'base de données',
'settings_defaultSearchMethod_valfulltext' => '',
'settings_delete_install_folder' => 'Pour utiliser SeedDMS, vous devez supprimer le fichier ENABLE_INSTALL_TOOL dans le répertoire de configuration',
'settings_disableSelfEdit' => 'Désactiver auto modification',
@ -970,7 +971,7 @@ URL: [url]',
'settings_enableGuestAutoLogin_desc' => '',
'settings_enableGuestLogin' => 'Activer la connexion Invité',
'settings_enableGuestLogin_desc' => 'Si vous voulez vous connecter en tant qu\'invité, cochez cette option. Remarque: l\'utilisateur invité ne doit être utilisé que dans un environnement de confiance',
'settings_enableHelp' => '',
'settings_enableHelp' => 'Activer l\'aide',
'settings_enableHelp_desc' => '',
'settings_enableLanguageSelector' => 'Activer la sélection de langue',
'settings_enableLanguageSelector_desc' => 'Montrer le sélecteur de langue d\'interface après connexion de l\'utilisateur.',

View File

@ -926,6 +926,7 @@ Internet poveznica: [url]',
'select_one' => 'Odaberite jednog',
'select_users' => 'Kliknite za odabir korisnika',
'select_workflow' => 'Odaberite tok rada',
'send_test_mail' => '',
'september' => 'Rujan',
'sequence' => 'Redoslijed',
'seq_after' => 'Nakon "[prevname]"',

View File

@ -904,6 +904,7 @@ URL: [url]',
'select_one' => 'Vßlasszon egyet',
'select_users' => 'Kattintson a felhasználó kiválasztásához',
'select_workflow' => 'Munkafolyamat választás',
'send_test_mail' => '',
'september' => 'September',
'sequence' => 'Sorrend',
'seq_after' => '"[prevname]" utßn',

View File

@ -928,6 +928,7 @@ URL: [url]',
'select_one' => 'Seleziona uno',
'select_users' => 'Clicca per selezionare gli utenti',
'select_workflow' => 'Seleziona il flusso di lavoro',
'send_test_mail' => '',
'september' => 'Settembre',
'sequence' => 'Posizione',
'seq_after' => 'Dopo "[prevname]"',

View File

@ -919,6 +919,7 @@ URL : [url]',
'select_one' => '선택',
'select_users' => '사용자를 선택합니다',
'select_workflow' => '선택 워크플로우',
'send_test_mail' => '',
'september' => '9월',
'sequence' => '순서',
'seq_after' => '"[prevname] "후',

View File

@ -901,6 +901,7 @@ URL: [url]',
'select_one' => 'Selecteer een',
'select_users' => 'Klik om gebruikers te selecteren',
'select_workflow' => 'Selecteer workflow',
'send_test_mail' => '',
'september' => 'september',
'sequence' => 'Volgorde',
'seq_after' => 'Na "[prevname]"',

View File

@ -884,6 +884,7 @@ URL: [url]',
'select_one' => 'Wybierz',
'select_users' => 'Kliknij by wybrać użytkowników',
'select_workflow' => 'Wybierz proces',
'send_test_mail' => '',
'september' => 'Wrzesień',
'sequence' => 'Kolejność',
'seq_after' => 'Za "[prevname]"',

View File

@ -902,6 +902,7 @@ URL: [url]',
'select_one' => 'Selecione um',
'select_users' => 'Clique para selecionar os usuários',
'select_workflow' => 'Selecione o fluxo de trabalho',
'send_test_mail' => '',
'september' => 'September',
'sequence' => 'Sequência',
'seq_after' => 'Depois "[prevname]"',

View File

@ -927,6 +927,7 @@ URL: [url]',
'select_one' => 'Selectați unul',
'select_users' => 'Click pentru a selecta utilizatori',
'select_workflow' => 'Selectați workflow',
'send_test_mail' => '',
'september' => 'Septembrie',
'sequence' => 'Poziție',
'seq_after' => 'După "[prevname]"',

View File

@ -895,6 +895,7 @@ URL: [url]',
'select_one' => 'Выберите',
'select_users' => 'Выберите пользователей',
'select_workflow' => 'Выберите процесс',
'send_test_mail' => '',
'september' => 'Сентябрь',
'sequence' => 'Позиция',
'seq_after' => 'После «[prevname]»',

View File

@ -759,6 +759,7 @@ URL: [url]',
'select_one' => 'Vyberte jeden',
'select_users' => '',
'select_workflow' => '',
'send_test_mail' => '',
'september' => 'September',
'sequence' => 'Postupnosť',
'seq_after' => 'Po "[prevname]"',

View File

@ -890,6 +890,7 @@ URL: [url]',
'select_one' => 'Välj',
'select_users' => 'Välj användare',
'select_workflow' => 'Välj arbetsflöde',
'send_test_mail' => '',
'september' => 'september',
'sequence' => 'Position',
'seq_after' => 'efter "[prevname]"',

View File

@ -906,6 +906,7 @@ URL: [url]',
'select_one' => 'Birini seçiniz',
'select_users' => 'Kullanıcı seçmek için tıklayın',
'select_workflow' => 'İş akışı seç',
'send_test_mail' => '',
'september' => 'Eylül',
'sequence' => 'Sıralama',
'seq_after' => 'Şundan sonra: "[prevname]"',

View File

@ -917,6 +917,7 @@ URL: [url]',
'select_one' => 'Виберіть',
'select_users' => 'Виберіть користувачів',
'select_workflow' => 'Виберіть процес',
'send_test_mail' => '',
'september' => 'Вересень',
'sequence' => 'Позиція',
'seq_after' => 'Після «[prevname]»',

View File

@ -761,6 +761,7 @@ URL: [url]',
'select_one' => '选择一个',
'select_users' => '点击选择用户',
'select_workflow' => '',
'send_test_mail' => '',
'september' => '九 月',
'sequence' => '次序',
'seq_after' => '在"[prevname]"之后',

View File

@ -759,6 +759,7 @@ URL: [url]',
'select_one' => '選擇一個',
'select_users' => '點擊選擇用戶',
'select_workflow' => '',
'send_test_mail' => '',
'september' => '九 月',
'sequence' => '次序',
'seq_after' => '在"[prevname]"之後',

View File

@ -100,6 +100,10 @@ if (isset($_GET["version"])) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_file_id"));
}
if(!file_exists($dms->contentDir . $file->getPath())) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("missing_file"));
}
header("Content-Type: application/force-download; name=\"" . $file->getOriginalFileName() . "\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($dms->contentDir . $file->getPath() ));
@ -123,10 +127,14 @@ if (isset($_GET["version"])) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
if (!isset($filename) || !file_exists($settings->_contentDir.$filename) ) {
if (!isset($filename)) {
UI::exitError(getMLText("admin_tools"),getMLText("unknown_id"));
}
if (!file_exists($settings->_contentDir.$filename) ) {
UI::exitError(getMLText("admin_tools"),getMLText("missing_file"));
}
header('Content-Description: File Transfer');
//header("Content-Type: application/force-download; name=\"" . $filename . "\"");
//header("Content-Type: application/octet-stream");
@ -154,10 +162,14 @@ if (isset($_GET["version"])) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
if (!isset($filename) || !file_exists($settings->_contentDir.$filename) ) {
if (!isset($filename)) {
UI::exitError(getMLText("admin_tools"),getMLText("unknown_id"));
}
if (!file_exists($settings->_contentDir.$filename) ) {
UI::exitError(getMLText("admin_tools"),getMLText("missing_file"));
}
header("Content-Type: text/plain; name=\"" . $filename . "\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($settings->_contentDir . $filename ));
@ -207,10 +219,14 @@ if (isset($_GET["version"])) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
if (!isset($filename) || !file_exists($settings->_contentDir.$filename) ) {
if (!isset($filename)) {
UI::exitError(getMLText("admin_tools"),getMLText("unknown_id"));
}
if (!file_exists($settings->_contentDir.$filename) ) {
UI::exitError(getMLText("admin_tools"),getMLText("missing_file"));
}
header("Content-Type: application/zip; name=\"" . $filename . "\"");
//header("Content-Type: application/force-download; name=\"" . $filename . "\"");
header("Content-Transfer-Encoding: binary");
@ -245,17 +261,20 @@ if (isset($_GET["version"])) {
}
$filename = $dms->contentDir . $document->getDir().'r'.(int) $_GET['reviewlogid'];
if(file_exists($filename)) {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mimetype = finfo_file($finfo, $filename);
header("Content-Type: ".$mimetype."; name=\"review-" . $document->getID()."-".(int) $_GET['reviewlogid'] . get_extension($mimetype) . "\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($filename ));
header("Content-Disposition: attachment; filename=\"review-" . $document->getID()."-".(int) $_GET['reviewlogid'] . get_extension($mimetype) . "\"");
header("Cache-Control: must-revalidate");
readfile($filename);
if (!file_exists($filename) ) {
UI::exitError(getMLText("admin_tools"),getMLText("missing_file"));
}
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mimetype = finfo_file($finfo, $filename);
header("Content-Type: ".$mimetype."; name=\"review-" . $document->getID()."-".(int) $_GET['reviewlogid'] . get_extension($mimetype) . "\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($filename ));
header("Content-Disposition: attachment; filename=\"review-" . $document->getID()."-".(int) $_GET['reviewlogid'] . get_extension($mimetype) . "\"");
header("Cache-Control: must-revalidate");
readfile($filename);
} elseif (isset($_GET["approvelogid"])) {
if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
@ -276,17 +295,19 @@ if (isset($_GET["version"])) {
}
$filename = $dms->contentDir . $document->getDir().'a'.(int) $_GET['approvelogid'];
if(file_exists($filename)) {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mimetype = finfo_file($finfo, $filename);
header("Content-Type: ".$mimetype."; name=\"approval-" . $document->getID()."-".(int) $_GET['approvelogid'] . get_extension($mimetype) . "\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($filename ));
header("Content-Disposition: attachment; filename=\"approval-" . $document->getID()."-".(int) $_GET['approvelogid'] . get_extension($mimetype) . "\"");
header("Cache-Control: must-revalidate");
readfile($filename);
if (!file_exists($filename) ) {
UI::exitError(getMLText("admin_tools"),getMLText("missing_file"));
}
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mimetype = finfo_file($finfo, $filename);
header("Content-Type: ".$mimetype."; name=\"approval-" . $document->getID()."-".(int) $_GET['approvelogid'] . get_extension($mimetype) . "\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($filename ));
header("Content-Disposition: attachment; filename=\"approval-" . $document->getID()."-".(int) $_GET['approvelogid'] . get_extension($mimetype) . "\"");
header("Cache-Control: must-revalidate");
readfile($filename);
}
add_log_line();

View File

@ -36,7 +36,7 @@ if ($user->isGuest()) {
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'cachedir'=>$settings->_cacheDir, 'previewWidthList'=>$settings->_previewWidthList));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'cachedir'=>$settings->_cacheDir, 'previewWidthList'=>$settings->_previewWidthList, 'timeout'=>$settings->_cmdTimeout));
if($view) {
$view->show();
exit;

View File

@ -52,6 +52,7 @@ if($view) {
$view->setParam('enableRecursiveCount', $settings->_enableRecursiveCount);
$view->setParam('maxRecursiveCount', $settings->_maxRecursiveCount);
$view->setParam('previewWidthList', $settings->_previewWidthList);
$view->setParam('timeout', $settings->_cmdTimeout);
$view($_GET);
}

View File

@ -70,7 +70,7 @@ $folder = $document->getFolder();
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version, 'viewonlinefiletypes'=>$settings->_viewOnlineFileTypes, 'enableversionmodification'=>$settings->_enableVersionModification, 'previewwidthdetail'=>$settings->_previewWidthDetail, 'cachedir'=>$settings->_cacheDir));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version, 'viewonlinefiletypes'=>$settings->_viewOnlineFileTypes, 'enableversionmodification'=>$settings->_enableVersionModification, 'previewWidthDetail'=>$settings->_previewWidthDetail, 'cachedir'=>$settings->_cacheDir, 'timeout'=>$settings->_cmdTimeout));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();

View File

@ -43,6 +43,7 @@ $view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'dropfold
if($view) {
$view->setParam('cachedir', $settings->_cacheDir);
$view->setParam('previewWidthList', $settings->_previewWidthList);
$view->setParam('timeout', $settings->_cmdTimeout);
$view($_GET);
exit;
}

View File

@ -53,7 +53,7 @@ if(isset($_GET['groupid']) && $_GET['groupid']) {
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'selgroup'=>$selgroup, 'allgroups'=>$allGroups, 'allusers'=>$allUsers, 'strictformcheck'=>$settings->_strictFormCheck, 'cachedir'=>$settings->_cacheDir, 'previewWidthList'=>$settings->_previewWidthList, 'workflowmode'=>$settings->_workflowMode));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'selgroup'=>$selgroup, 'allgroups'=>$allGroups, 'allusers'=>$allUsers, 'strictformcheck'=>$settings->_strictFormCheck, 'cachedir'=>$settings->_cacheDir, 'previewWidthList'=>$settings->_previewWidthList, 'workflowmode'=>$settings->_workflowMode, 'timeout'=>$settings->_cmdTimeout));
if($view) {
$view($_GET);
}

View File

@ -34,7 +34,7 @@ if ($user->isGuest()) {
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'cachedir'=>$settings->_cacheDir, 'previewWidthList'=>$settings->_previewWidthList));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'cachedir'=>$settings->_cacheDir, 'previewWidthList'=>$settings->_previewWidthList, 'timeout'=>$settings->_cmdTimeout));
if($view) {
$view($_GET);
exit;

View File

@ -48,7 +48,7 @@ if (isset($_GET["orderby"]) && strlen($_GET["orderby"])==1 ) {
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'orderby'=>$orderby, 'showinprocess'=>$showInProcess, 'workflowmode'=>$settings->_workflowMode, 'cachedir'=>$settings->_cacheDir, 'previewWidthList'=>$settings->_previewWidthList));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'orderby'=>$orderby, 'showinprocess'=>$showInProcess, 'workflowmode'=>$settings->_workflowMode, 'cachedir'=>$settings->_cacheDir, 'previewWidthList'=>$settings->_previewWidthList, 'timeout'=>$settings->_cmdTimeout));
if($view) {
$view->show();
exit;

View File

@ -37,7 +37,7 @@ if ($user->isGuest()) {
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'cachedir'=>$settings->_cacheDir, 'previewWidthList'=>$settings->_previewWidthList));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'cachedir'=>$settings->_cacheDir, 'previewWidthList'=>$settings->_previewWidthList, 'timeout'=>$settings->_cmdTimeout));
if($view) {
$view->show();
exit;

View File

@ -436,6 +436,7 @@ if(count($entries) == 1) {
$view->setParam('workflowmode', $settings->_workflowMode);
$view->setParam('enablefullsearch', $settings->_enableFullSearch);
$view->setParam('previewWidthList', $settings->_previewWidthList);
$view->setParam('timeout', $settings->_cmdTimeout);
$view($_GET);
exit;
}

View File

@ -64,6 +64,7 @@ if($view) {
$view->setParam('cachedir', $settings->_cacheDir);
$view->setParam('previewWidthList', $settings->_previewWidthList);
$view->setParam('previewWidthDetail', $settings->_previewWidthDetail);
$view->setParam('timeout', $settings->_cmdTimeout);
$view($_GET);
exit;
}

View File

@ -78,6 +78,7 @@ if($view) {
$view->setParam('previewWidthList', $settings->_previewWidthList);
$view->setParam('previewWidthDetail', $settings->_previewWidthDetail);
$view->setParam('currenttab', isset($_GET['currenttab']) ? $_GET['currenttab'] : "");
$view->setParam('timeout', $settings->_cmdTimeout);
$view($_GET);
exit;
}

View File

@ -68,6 +68,7 @@ if($view) {
$view->setParam('enableRecursiveCount', $settings->_enableRecursiveCount);
$view->setParam('maxRecursiveCount', $settings->_maxRecursiveCount);
$view->setParam('previewWidthList', $settings->_previewWidthList);
$view->setParam('timeout', $settings->_cmdTimeout);
$view($_GET);
exit;
}

View File

@ -37,7 +37,7 @@ if ($user->isGuest()) {
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'cachedir'=>$settings->_cacheDir, 'workflowmode'=>$settings->_workflowMode, 'previewWidthList'=>$settings->_previewWidthList));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'cachedir'=>$settings->_cacheDir, 'workflowmode'=>$settings->_workflowMode, 'previewWidthList'=>$settings->_previewWidthList, 'timeout'=>$settings->_cmdTimeout));
if($view) {
$view->show();
exit;

View File

@ -1136,46 +1136,57 @@ function changeFolderAccess($id, $operationType, $userOrGroup) { /* {{{ */
return;
}
if ($app->request()->put('id') == null)
{
$app->response()->header('Content-Type', 'application/json');
echo json_encode(array('success'=>false, 'message'=>'Please PUT the user or group Id', 'data'=>''));
return;
}
if ($app->request()->put('mode') == null)
{
$app->response()->header('Content-Type', 'application/json');
echo json_encode(array('success'=>false, 'message'=>'Please PUT the access mode', 'data'=>''));
return;
}
$userOrGroupIdInput = $app->request()->put('id');
$modeInput = $app->request()->put('mode');
if ($operationType == 'add')
{
if ($app->request()->put('id') == null)
{
$app->response()->header('Content-Type', 'application/json');
echo json_encode(array('success'=>false, 'message'=>'Please PUT the user or group Id', 'data'=>''));
return;
}
$mode = M_NONE;
if ($modeInput == 'read')
{
$mode = M_READ;
}
if ($modeInput == 'readwrite')
{
$mode = M_READWRITE;
}
if ($modeInput == 'all')
{
$mode = M_ALL;
}
if ($app->request()->put('mode') == null)
{
$app->response()->header('Content-Type', 'application/json');
echo json_encode(array('success'=>false, 'message'=>'Please PUT the access mode', 'data'=>''));
return;
}
$modeInput = $app->request()->put('mode');
$mode = M_NONE;
if ($modeInput == 'read')
{
$mode = M_READ;
}
if ($modeInput == 'readwrite')
{
$mode = M_READWRITE;
}
if ($modeInput == 'all')
{
$mode = M_ALL;
}
}
$userOrGroupId = $userOrGroupIdInput;
if(!is_numeric($userOrGroupIdInput) && $userOrGroup == 'user')
{
$userOrGroupObj = $dms->getUserByLogin($userOrGroupIdInput);
$userOrGroupObj = $dms->getUserByLogin($userOrGroupIdInput);
}
if(!is_numeric($userOrGroupIdInput) && $userOrGroup == 'group')
{
$userOrGroupObj = $dms->getGroupByName($userOrGroupIdInput);
$userOrGroupObj = $dms->getGroupByName($userOrGroupIdInput);
}
if(is_numeric($userOrGroupIdInput) && $userOrGroup == 'user')
{
$userOrGroupObj = $dms->getUser($userOrGroupIdInput);
}
if(is_numeric($userOrGroupIdInput) && $userOrGroup == 'group')
{
$userOrGroupObj = $dms->getGroup($userOrGroupIdInput);
}
if (!$userOrGroupObj) {
$app->response()->status(404);
@ -1232,15 +1243,15 @@ function clearFolderAccessList($id) { /* {{{ */
}
if (!$folder)
{
$app->response()->status(404);
return;
$app->response()->status(404);
return;
}
$operationResult = $folder->clearAccessList();
$data = array();
$app->response()->header('Content-Type', 'application/json');
if (!$operationResult)
{
echo json_encode(array('success'=>false, 'message'=>'Something went wrong. Could not clear access list for this folder.', 'data'=>$data));
echo json_encode(array('success'=>false, 'message'=>'Something went wrong. Could not clear access list for this folder.', 'data'=>$data));
}
echo json_encode(array('success'=>true, 'message'=>'', 'data'=>$data));
} /* }}} */
@ -1299,14 +1310,12 @@ $app->post('/groups', 'createGroup');
$app->get('/groups/:id', 'getGroup');
$app->put('/groups/:id/addUser', 'addUserToGroup');
$app->put('/groups/:id/removeUser', 'removeUserFromGroup');
$app->put('/groups/:id/removeUser', 'removeUserFromGroup');
$app->put('/folder/:id/setInherit', 'setFolderInheritsAccess');
$app->put('/folder/:id/access/group/add', 'addGroupAccessToFolder'); //
$app->put('/folder/:id/access/user/add', 'addUserAccessToFolder'); //
$app->put('/folder/:id/access/group/remove', 'removeGroupAccessFromFolder');
$app->put('/folder/:id/access/user/remove', 'removeUserAccessFromFolder');
$app->put('/folder/:id/access/clear', 'clearFolderAccessList');
$app->run();
?>

View File

@ -36,8 +36,9 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style {
$user = $this->params['user'];
$cachedir = $this->params['cachedir'];
$previewwidth = $this->params['previewWidthList'];
$timeout = $this->params['timeout'];
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
$this->htmlStartPage(getMLText("approval_summary"));
$this->globalNavigation();

View File

@ -59,6 +59,7 @@ $(document).ready( function() {
$previewwidth = $this->params['previewWidthList'];
$enableRecursiveCount = $this->params['enableRecursiveCount'];
$maxRecursiveCount = $this->params['maxRecursiveCount'];
$timeout = $this->params['timeout'];
if($selattrdef) {
$this->contentHeading(getMLText("attrdef_info"));
@ -108,7 +109,7 @@ $(document).ready( function() {
foreach($res['folders'] as $subFolder) {
echo $this->folderListRow($subFolder);
}
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
foreach($res['docs'] as $document) {
echo $this->documentListRow($document, $previewer);
}
@ -124,7 +125,7 @@ $(document).ready( function() {
print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("action")."</th>\n";
print "</tr>\n</thead>\n<tbody>\n";
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
foreach($res['contents'] as $content) {
$doc = $content->getDocument();
echo $this->documentListRow($doc, $previewer);

View File

@ -40,7 +40,8 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
$viewonlinefiletypes = $this->params['viewonlinefiletypes'];
$enableversionmodification = $this->params['enableversionmodification'];
$cachedir = $this->params['cachedir'];
$previewwidthdetail = $this->params['previewwidthdetail'];
$previewwidthdetail = $this->params['previewWidthDetail'];
$timeout = $this->params['timeout'];
$latestContent = $document->getLatestContent();
$status = $version->getStatus();
@ -147,7 +148,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
print "<td><ul class=\"unstyled\">";
print "</ul>";
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidthdetail);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidthdetail, $timeout);
$previewer->createPreview($version);
if($previewer->hasPreview($version)) {
print("<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=".$previewwidthdetail."\" title=\"".htmlspecialchars($version->getMimeType())."\">");

View File

@ -48,8 +48,9 @@ $('#fileselect').click(function(ev) {
$dropfolderdir = $this->params['dropfolderdir'];
$cachedir = $this->params['cachedir'];
$previewwidth = $this->params['previewWidthList'];
$timeout = $this->params['timeout'];
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
// $this->htmlStartPage(getMLText("choose_target_file"));
// $this->globalBanner();

View File

@ -107,9 +107,10 @@ $(document).ready( function() {
$cachedir = $this->params['cachedir'];
$previewwidth = $this->params['previewWidthList'];
$workflowmode = $this->params['workflowmode'];
$timeout = $this->params['timeout'];
if($selgroup) {
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
$this->contentHeading(getMLText("group_info"));
echo "<table class=\"table table-condensed\">\n";
if($workflowmode == "traditional") {

View File

@ -90,7 +90,7 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
printMLText("empty_notify_list");
}
else {
$previewer = new SeedDMS_Preview_Previewer($this->cachedir, $this->previewwidth);
$previewer = new SeedDMS_Preview_Previewer($this->cachedir, $this->previewwidth, $this->timeout);
print "<table class=\"table-condensed\">";
print "<thead>\n<tr>\n";
@ -147,6 +147,7 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
$this->cachedir = $this->params['cachedir'];
$this->previewwidth = $this->params['previewWidthList'];
$this->db = $this->dms->getDB();
$this->timeout = $this->params['timeout'];
$this->htmlStartPage(getMLText("my_account"));
$this->globalNavigation();

View File

@ -39,9 +39,10 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
$cachedir = $this->params['cachedir'];
$workflowmode = $this->params['workflowmode'];
$previewwidth = $this->params['previewWidthList'];
$timeout = $this->params['timeout'];
$db = $dms->getDB();
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
$this->htmlStartPage(getMLText("my_documents"));
$this->globalNavigation();
@ -776,7 +777,7 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
print "<th><a href=\"../out/out.MyDocuments.php?orderby=e\">".getMLText("expires")."</a></th>\n";
print "</tr>\n</thead>\n<tbody>\n";
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
foreach ($resArr as $res) {
$document = $dms->getDocument($res["documentID"]);
$document->verifyLastestContentExpriry();

View File

@ -36,8 +36,9 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style {
$user = $this->params['user'];
$cachedir = $this->params['cachedir'];
$previewwidth = $this->params['previewWidthList'];
$timeout = $this->params['timeout'];
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
$this->htmlStartPage(getMLText("my_documents"));
$this->globalNavigation();

View File

@ -89,6 +89,7 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
$searchin = $this->params['searchin'];
$cachedir = $this->params['cachedir'];
$previewwidth = $this->params['previewWidthList'];
$timeout = $this->params['timeout'];
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/bootbox/bootbox.min.js"></script>'."\n", 'js');
@ -454,7 +455,7 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
print "<th>".getMLText("action")."</th>\n";
print "</tr>\n</thead>\n<tbody>\n";
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
foreach ($entries as $entry) {
if(get_class($entry) == $dms->getClassname('document')) {
$txt = $this->callHook('documentListItem', $entry, $previewer);

View File

@ -38,8 +38,10 @@ class SeedDMS_View_Timeline extends SeedDMS_Bootstrap_Style {
$cachedir = $this->params['cachedir'];
$previewwidthlist = $this->params['previewWidthList'];
$previewwidthdetail = $this->params['previewWidthDetail'];
$timeout = $this->params['timeout'];
if($document) {
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidthdetail);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidthdetail, $timeout);
$previewer->createPreview($version);
$this->contentHeading(getMLText("timeline_selected_item"));

View File

@ -80,6 +80,7 @@ $(document).ready( function() {
function info() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$seluser = $this->params['seluser'];
$quota = $this->params['quota'];
$workflowmode = $this->params['workflowmode'];
@ -134,7 +135,8 @@ $(document).ready( function() {
}
echo "</table>";
echo "<a href=\"../op/op.SubstituteUser.php?userid=".$seluser->getID()."\" class=\"btn btn-primary\">".getMLText("substitute_user")."</a>\n";
if($user->isAdmin() && $seluser->getID() != $user->getID())
echo "<a href=\"../op/op.SubstituteUser.php?userid=".$seluser->getID()."\" class=\"btn btn-primary\">".getMLText("substitute_user")."</a>\n";
}
} /* }}} */

View File

@ -171,6 +171,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$previewwidthdetail = $this->params['previewWidthDetail'];
$documentid = $document->getId();
$currenttab = $this->params['currenttab'];
$timeout = $this->params['timeout'];
$versions = $document->getContent();
@ -423,7 +424,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "</ul>";
*/
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidthdetail);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidthdetail, $timeout);
$previewer->createPreview($latestContent);
if ($file_exists) {
if ($viewonlinefiletypes && in_array(strtolower($latestContent->getFileType()), $viewonlinefiletypes)) {

View File

@ -113,6 +113,7 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
$enableRecursiveCount = $this->params['enableRecursiveCount'];
$maxRecursiveCount = $this->params['maxRecursiveCount'];
$previewwidth = $this->params['previewWidthList'];
$timeout = $this->params['timeout'];
$folderid = $folder->getId();
@ -130,7 +131,7 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
$this->pageNavigation($this->getFolderPathHTML($folder), "view_folder", $folder);
}
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
echo $this->callHook('preContent');

View File

@ -36,6 +36,7 @@ class SeedDMS_View_WorkflowSummary extends SeedDMS_Bootstrap_Style {
$user = $this->params['user'];
$cachedir = $this->params['cachedir'];
$previewwidth = $this->params['previewWidthList'];
$timeout = $this->params['timeout'];
$this->htmlStartPage(getMLText("my_documents"));
$this->globalNavigation();
@ -48,7 +49,7 @@ class SeedDMS_View_WorkflowSummary extends SeedDMS_Bootstrap_Style {
// Get document list for the current user.
$workflowStatus = $user->getWorkflowStatus();
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
$printheader=true;
$iRev = array();