Merge branch 'seeddms-4.3.9' into develop

Conflicts:
	Makefile
	op/op.RemoveDocument.php
	op/op.UpdateDocument.php
	out/out.RemoveDocument.php
This commit is contained in:
Uwe Steinmann 2014-06-04 07:58:06 +02:00
commit f13ef894b2
41 changed files with 217 additions and 65 deletions

View File

@ -12,6 +12,8 @@
cookie lifetime is set to 0
- add more information on user list page
- admins can edit their account details even if 'self edit' is turned off
- consistent handling of document locking
- op/op.ViewOnline.php returns the latest version if version<1
--------------------------------------------------------------------------------
Changes in version 4.3.8

View File

@ -1,4 +1,4 @@
VERSION=4.3.8
VERSION=4.3.9
SRC=CHANGELOG inc conf utils index.php languages views op out controllers README.md README.Notification README.Ubuntu drop-tables-innodb.sql styles js TODO LICENSE Makefile webdav install restapi
# webapp

View File

@ -103,13 +103,13 @@ class SeedDMS_Preview_Previewer {
break;
case "application/pdf":
case "application/postscript":
$cmd = 'convert -density 18 -resize '.$width.'x '.$file.'[0] '.$target;
$cmd = 'convert -density 100 -resize '.$width.'x '.$file.'[0] '.$target;
break;
case "text/plain":
$cmd = 'convert -resize '.$width.'x '.$file.'[0] '.$target;
break;
case "application/x-compressed-tar":
$cmd = 'tar tzvf '.$file.' | convert -resize '.$width.'x text:-[0] '.$target;
$cmd = 'tar tzvf '.$file.' | convert -density 100 -resize '.$width.'x text:-[0] '.$target;
break;
}
if($cmd) {

View File

@ -153,6 +153,12 @@ class SeedDMS_AccessOperation {
*/
function mayEditComment() { /* {{{ */
if(get_class($this->obj) == 'SeedDMS_Core_Document') {
if($this->obj->isLocked()) {
$lockingUser = $this->obj->getLockingUser();
if (($lockingUser->getID() != $this->user->getID()) && ($this->obj->getAccessMode($this->user) != M_ALL)) {
return false;
}
}
$latestContent = $this->obj->getLatestContent();
$status = $latestContent->getStatus();
if ((($this->settings->_enableVersionModification && ($this->obj->getAccessMode($this->user) >= M_READWRITE)) || $this->user->isAdmin()) && ($status["status"]!=S_OBSOLETE)) {

View File

@ -470,6 +470,7 @@ URL: [url]',
'keywords' => 'كلمات البحث',
'keyword_exists' => 'كلمات البحث بالفعل موجودة',
'language' => 'اللغة',
'lastaccess' => '',
'last_update' => 'اخر تحديث',
'legend' => 'دليل',
'linked_documents' => 'مستندات متعلقة',

View File

@ -403,6 +403,7 @@ $text = array(
'keywords' => 'Mots clau',
'keyword_exists' => 'El mot clau ja existeix',
'language' => 'Llenguatge',
'lastaccess' => '',
'last_update' => 'Última modificació',
'legend' => '',
'linked_documents' => 'Documents relacionats',

View File

@ -477,6 +477,7 @@ URL: [url]',
'keywords' => 'Klíčová slova',
'keyword_exists' => 'Klíčové slovo už existuje',
'language' => 'Jazyk',
'lastaccess' => '',
'last_update' => 'Naposledy aktualizoval',
'legend' => 'Popisek',
'linked_documents' => 'Související dokumenty',

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 (1886)
// Translators: Admin (1887)
$text = array(
'accept' => 'Übernehmen',
@ -477,6 +477,7 @@ URL: [url]',
'keywords' => 'Stichworte',
'keyword_exists' => 'Stichwort besteht bereits',
'language' => 'Sprache',
'lastaccess' => 'Letzter Zugriff',
'last_update' => 'Letzte Aktualisierung',
'legend' => 'Legende',
'linked_documents' => 'verknüpfte Dokumente',

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 (1026), netixw (14)
// Translators: Admin (1027), netixw (14)
$text = array(
'accept' => 'Accept',
@ -477,6 +477,7 @@ URL: [url]',
'keywords' => 'Keywords',
'keyword_exists' => 'Keyword already exists',
'language' => 'Language',
'lastaccess' => 'Last access',
'last_update' => 'Last Update',
'legend' => 'Legend',
'linked_documents' => 'Related Documents',

View File

@ -477,6 +477,7 @@ URL: [url]',
'keywords' => 'Palabras clave',
'keyword_exists' => 'La palabra clave ya existe',
'language' => 'Idioma',
'lastaccess' => '',
'last_update' => 'Última modificación',
'legend' => 'Leyenda',
'linked_documents' => 'Documentos relacionados',

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 (883), jeromerobert (50), lonnnew (9)
// Translators: Admin (889), jeromerobert (50), lonnnew (9)
$text = array(
'accept' => 'Accepter',
@ -159,14 +159,14 @@ URL: [url]',
'change_password' => 'Changer de mot de passe',
'change_password_message' => 'Votre mot de passe a été changé.',
'change_status' => 'Modifier le statut',
'charts' => '',
'chart_docsaccumulated_title' => '',
'chart_docspercategory_title' => '',
'charts' => 'Graphiques',
'chart_docsaccumulated_title' => 'Nombre de documents',
'chart_docspercategory_title' => 'Documents par catégorie',
'chart_docspermimetype_title' => '',
'chart_docspermonth_title' => '',
'chart_docsperstatus_title' => '',
'chart_docspermonth_title' => 'Nouveau document par mois',
'chart_docsperstatus_title' => 'Documents par status',
'chart_docsperuser_title' => '',
'chart_selection' => '',
'chart_selection' => 'Sélectionnez un graphique',
'chart_sizeperuser_title' => '',
'choose_attrdef' => 'Choisissez une définition d\'attribut',
'choose_category' => 'SVP choisir',
@ -470,6 +470,7 @@ URL: [url]',
'keywords' => 'Mots-clés',
'keyword_exists' => 'Mot-clé déjà existant',
'language' => 'Langue',
'lastaccess' => '',
'last_update' => 'Dernière modification',
'legend' => 'Légende',
'linked_documents' => 'Documents liés',

View File

@ -470,6 +470,7 @@ URL: [url]',
'keywords' => 'Kulcsszavak',
'keyword_exists' => 'Kulcsszó már létezik',
'language' => 'Nyelv',
'lastaccess' => '',
'last_update' => 'Utolsó frissítés',
'legend' => 'Jelmagyarázat',
'linked_documents' => 'Kapcsolódó dokumentumok',

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 (694)
// Translators: Admin (700)
$text = array(
'accept' => 'Accetta',
@ -54,7 +54,7 @@ $text = array(
'add_multiple_documents' => 'Aggiungi documenti multipli',
'add_multiple_files' => 'Aggiungi documenti multipli (il nome del file verrà usato come nome del documento)',
'add_subfolder' => 'Aggiungi sottocartella',
'add_to_clipboard' => '',
'add_to_clipboard' => 'Aggiungi agli appunti',
'add_user' => 'Aggiungi nuovo utente',
'add_user_to_group' => 'Aggiungi utente al gruppo',
'add_workflow' => '',
@ -349,7 +349,7 @@ $text = array(
'include_documents' => 'Includi documenti',
'include_subdirectories' => 'Includi sottocartelle',
'index_converters' => 'Indice di conversione documenti',
'index_folder' => '',
'index_folder' => 'Indice cartelle',
'individuals' => 'Singoli',
'inherited' => 'ereditato',
'inherits_access_copy_msg' => 'Modifica la lista degli accessi ereditati',
@ -403,6 +403,7 @@ $text = array(
'keywords' => 'Parole chiave',
'keyword_exists' => 'Parola chiave già presente',
'language' => 'Lingua',
'lastaccess' => '',
'last_update' => 'Ultima modifica',
'legend' => '',
'linked_documents' => 'Documenti collegati',
@ -433,7 +434,7 @@ $text = array(
'may' => 'Maggio',
'mimetype' => '',
'minutes' => '',
'misc' => '',
'misc' => 'Varie',
'missing_checksum' => '',
'missing_filesize' => '',
'missing_transition_user_group' => '',
@ -564,7 +565,7 @@ Se hai ancora problemi al login, allora contatta il tuo amministratore di sistem
'reviewer_already_removed' => 'già rimosso dal processo di revisione oppure già inserito come revisione',
'review_deletion_email' => 'Cancellata la richiesta di revisione',
'review_group' => 'Gruppo revisori',
'review_log' => '',
'review_log' => 'Rivedi log',
'review_request_email' => 'Richiesta di revisione',
'review_status' => 'Stato revisioni',
'review_submit_email' => 'Sottoposta revisione',
@ -615,7 +616,7 @@ Se hai ancora problemi al login, allora contatta il tuo amministratore di sistem
'search_time' => 'Tempo trascorso: [time] sec.',
'seconds' => '',
'selection' => 'Selezione',
'select_category' => '',
'select_category' => 'Clicca per selezionare la categoria',
'select_groups' => '',
'select_grp_approvers' => '',
'select_grp_reviewers' => '',
@ -871,7 +872,7 @@ Se hai ancora problemi al login, allora contatta il tuo amministratore di sistem
'sign_out_user' => '',
'sk_SK' => 'Slovacco',
'space_used_on_data_folder' => 'Spazio utilizzato dai dati',
'splash_added_to_clipboard' => '',
'splash_added_to_clipboard' => 'Aggiunto agli appunti',
'splash_add_attribute' => '',
'splash_add_group' => '',
'splash_add_group_member' => '',

View File

@ -470,6 +470,7 @@ URL: [url]',
'keywords' => 'Sleutelwoorden',
'keyword_exists' => 'Sleutelwoord bestaat al',
'language' => 'Talen',
'lastaccess' => '',
'last_update' => 'Laatste Update',
'legend' => 'Legenda',
'linked_documents' => 'Gerelateerde Documenten',

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 (674), netixw (84), romi (93), uGn (112)
// Translators: Admin (675), netixw (84), romi (93), uGn (112)
$text = array(
'accept' => 'Akceptuj',
@ -470,6 +470,7 @@ URL: [url]',
'keywords' => 'Słowa kluczowe',
'keyword_exists' => 'Słowo kluczowe już istnieje',
'language' => 'Język',
'lastaccess' => '',
'last_update' => 'Ostatnia aktualizacja',
'legend' => 'Legenda',
'linked_documents' => 'Powiązane dokumenty',
@ -664,7 +665,7 @@ URL: [url]',
'return_from_subworkflow' => 'Powróć z sub procesu',
'return_from_subworkflow_email_body' => 'Powrót z sub procesu dokumentu: [name] Wersja: [version] Proces: [workflow] Sub proces: [subworkflow] folderu nadrzędnego: [folder_path] Użytkownik: [username] URL: [url]',
'return_from_subworkflow_email_subject' => '[sitename]: [name] - Powrót z sub procesu',
'reverse_links' => '',
'reverse_links' => 'Dokument który posiada link do aktualnego dokumentu',
'reviewers' => 'Recenzenci',
'reviewer_already_assigned' => 'jest już przypisany jako recenzent',
'reviewer_already_removed' => 'został już usunięty z procesu opiniowania lub już wydał swoją opinię',

View File

@ -476,6 +476,7 @@ URL: [url]',
'keywords' => 'Palavras-chaves',
'keyword_exists' => 'Palavra-chave já existe',
'language' => 'Linguagem',
'lastaccess' => '',
'last_update' => 'Última versƒão',
'legend' => 'Legenda',
'linked_documents' => 'Documentos relacionados',

View File

@ -470,6 +470,7 @@ URL: [url]',
'keywords' => 'Метки',
'keyword_exists' => 'Метка существует',
'language' => 'Язык',
'lastaccess' => '',
'last_update' => 'Последнее обновление',
'legend' => 'Обозначения',
'linked_documents' => 'Связанные документы',

View File

@ -403,6 +403,7 @@ $text = array(
'keywords' => 'Kľúčové slová',
'keyword_exists' => 'Kľúčové slovo už existuje',
'language' => 'Jazyk',
'lastaccess' => '',
'last_update' => 'Posledná aktualizácia',
'legend' => '',
'linked_documents' => 'Súvisiace dokumenty',

View File

@ -470,6 +470,7 @@ URL: [url]',
'keywords' => 'Nyckelord',
'keyword_exists' => 'Nyckelordet finns redan',
'language' => 'Språk',
'lastaccess' => '',
'last_update' => 'Senast uppdaterat',
'legend' => 'Förteckning',
'linked_documents' => 'Relaterade dokument',

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 (485), fengjohn (5)
// Translators: Admin (508), fengjohn (5)
$text = array(
'accept' => '接受',
@ -38,7 +38,7 @@ $text = array(
URL: [url]',
'access_permission_changed_email_subject' => '[sitename]: [name] - 权限已变更',
'according_settings' => '相应的设置',
'action' => '',
'action' => '执行',
'actions' => '动作',
'action_approve' => '',
'action_complete' => '',
@ -58,7 +58,7 @@ URL: [url]',
'add_multiple_documents' => '添加多个文件',
'add_multiple_files' => '批量添加文档(文档名无法手动修改)',
'add_subfolder' => '添加子文件夹',
'add_to_clipboard' => '',
'add_to_clipboard' => '复制',
'add_user' => '添加新用户',
'add_user_to_group' => '',
'add_workflow' => '',
@ -66,8 +66,8 @@ URL: [url]',
'add_workflow_state' => '',
'admin' => '管理员',
'admin_tools' => '管理员工具',
'all' => '',
'all_categories' => '',
'all' => '所有',
'all_categories' => '所有分类',
'all_documents' => '所有文档',
'all_pages' => '所有页面',
'all_users' => '所有用户',
@ -97,23 +97,23 @@ URL: [url]',
'assumed_released' => '假定发布',
'attrdef_exists' => '',
'attrdef_in_use' => '',
'attrdef_management' => '',
'attrdef_maxvalues' => '',
'attrdef_minvalues' => '',
'attrdef_management' => '属性定义管理',
'attrdef_maxvalues' => '最大值',
'attrdef_minvalues' => '最小值',
'attrdef_min_greater_max' => '',
'attrdef_multiple' => '',
'attrdef_multiple' => '允许多个值',
'attrdef_must_be_multiple' => '',
'attrdef_name' => '',
'attrdef_name' => '名称',
'attrdef_noname' => '',
'attrdef_objtype' => '',
'attrdef_regex' => '',
'attrdef_type' => '',
'attrdef_valueset' => '',
'attrdef_objtype' => '类别',
'attrdef_regex' => '正则表达式',
'attrdef_type' => '类型',
'attrdef_valueset' => '属性值',
'attributes' => '属性',
'attribute_changed_email_body' => '',
'attribute_changed_email_subject' => '',
'attribute_count' => '',
'attribute_value' => '',
'attribute_count' => '使用次数',
'attribute_value' => '属性值',
'attr_no_regex_match' => '',
'at_least_n_users_of_group' => '',
'august' => '八 月',
@ -138,7 +138,7 @@ URL: [url]',
'cannot_retrieve_review_snapshot' => '无法检索到该文件版本的校对快照.',
'cannot_rm_root' => '错误:不能删除根目录.',
'categories' => '分类',
'category' => '',
'category' => '分类',
'category_exists' => '',
'category_filter' => '指定分类',
'category_in_use' => '',
@ -157,7 +157,7 @@ URL: [url]',
'chart_docsperuser_title' => '',
'chart_selection' => '',
'chart_sizeperuser_title' => '',
'choose_attrdef' => '',
'choose_attrdef' => '请选择属性',
'choose_category' => '请选择',
'choose_group' => '选择组别',
'choose_target_category' => '',
@ -407,6 +407,7 @@ URL: [url]',
'keywords' => '关键字',
'keyword_exists' => '关键字已存在',
'language' => '语言',
'lastaccess' => '',
'last_update' => '上次更新',
'legend' => '',
'linked_documents' => '相关文档',
@ -435,7 +436,7 @@ URL: [url]',
'march' => '三 月',
'max_upload_size' => '最大上传文件大小',
'may' => '五 月',
'mimetype' => '',
'mimetype' => 'MIME类型',
'minutes' => '',
'misc' => '其他',
'missing_checksum' => '',
@ -454,7 +455,7 @@ URL: [url]',
'name' => '名称',
'needs_workflow_action' => '',
'new' => 'New',
'new_attrdef' => '',
'new_attrdef' => '添加属性',
'new_default_keywords' => '添加关键字',
'new_default_keyword_category' => '添加类别',
'new_document_category' => '',
@ -611,7 +612,7 @@ URL: [url]',
'search_time' => '耗时:[time]秒',
'seconds' => '',
'selection' => '选择',
'select_category' => '',
'select_category' => '选中分类',
'select_groups' => '点击选择组',
'select_grp_approvers' => '',
'select_grp_reviewers' => '',
@ -867,7 +868,7 @@ URL: [url]',
'sign_out_user' => '',
'sk_SK' => '斯洛伐克语',
'space_used_on_data_folder' => '数据文件夹使用空间',
'splash_added_to_clipboard' => '',
'splash_added_to_clipboard' => '已复制',
'splash_add_attribute' => '',
'splash_add_group' => '',
'splash_add_group_member' => '',
@ -930,11 +931,11 @@ URL: [url]',
'trigger_workflow' => '',
'tuesday' => 'Tuesday',
'tuesday_abbr' => '',
'type_to_search' => '',
'type_to_search' => '搜索类型',
'under_folder' => '文件夹内',
'unknown_attrdef' => '',
'unknown_command' => '未知命令',
'unknown_document_category' => '',
'unknown_document_category' => '未知文件分类',
'unknown_group' => '未知组ID号',
'unknown_id' => '未知ID号',
'unknown_keyword_category' => '未知类别',

View File

@ -403,6 +403,7 @@ $text = array(
'keywords' => '',
'keyword_exists' => '',
'language' => '',
'lastaccess' => '',
'last_update' => '',
'legend' => '',
'linked_documents' => '',

View File

@ -43,13 +43,17 @@ if (!is_object($document)) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$folder = $document->getFolder();
$docPathHTML = getFolderPathHTML($folder, true). " / <a href=\"../out/out.ViewDocument.php?documentid=".$documentid."\">".$document->getName()."</a>";
if ($document->getAccessMode($user) < M_READWRITE) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
if($document->isLocked()) {
$lockingUser = $document->getLockingUser();
if (($lockingUser->getID() != $user->getID()) && ($document->getAccessMode($user) != M_ALL)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => htmlspecialchars($lockingUser->getFullName()))));
}
}
$versionid = $_POST["version"];
$version = $document->getContentByVersion($versionid);
@ -63,6 +67,7 @@ if (($oldcomment = $version->getComment()) != $comment) {
if($version->setComment($comment)) {
if($notifier) {
$notifyList = $document->getNotifyList();
$folder = $document->getFolder();
/*
$subject = "###SITENAME###: ".$document->getName().", v.".$version->_version." - ".getMLText("document_comment_changed_email");

View File

@ -44,6 +44,13 @@ if ($document->getAccessMode($user) < M_READWRITE) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
if($document->isLocked()) {
$lockingUser = $document->getLockingUser();
if (($lockingUser->getID() != $user->getID()) && ($document->getAccessMode($user) != M_ALL)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => htmlspecialchars($lockingUser->getFullName()))));
}
}
$name = $_POST["name"];
$comment = $_POST["comment"];
$keywords = $_POST["keywords"];

View File

@ -53,6 +53,13 @@ if (($document->getAccessMode($user) < M_READWRITE) || ($targetFolder->getAccess
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
if($document->isLocked()) {
$lockingUser = $document->getLockingUser();
if (($lockingUser->getID() != $user->getID()) && ($document->getAccessMode($user) != M_ALL)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => htmlspecialchars($lockingUser->getFullName()))));
}
}
if ($targetid != $oldFolder->getID()) {
if ($document->setFolder($targetFolder)) {
// Send notification to subscribers.

View File

@ -48,9 +48,12 @@ if ($document->getAccessMode($user) < M_READ) {
if(isset($_GET['version'])) {
$version = $_GET["version"];
if (!is_numeric($version) || intval($version)<1)
if (!is_numeric($version))
exit;
$object = $document->getContentByVersion($version);
if(intval($version)<1)
$object = $document->getLatestContent();
else
$object = $document->getContentByVersion($version);
} elseif(isset($_GET['file'])) {
$file = $_GET['file'];
if (!is_numeric($file) || intval($file)<1)
@ -65,6 +68,8 @@ if (!is_object($object)) {
}
$previewer = new SeedDMS_Preview_Previewer($settings->_cacheDir, $_GET["width"]);
if(!$previewer->hasPreview($object))
$previewer->createPreview($object);
header('Content-Type: image/png');
$previewer->getPreview($object);

View File

@ -49,12 +49,18 @@ if ($document->getAccessMode($user) < M_ALL) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("access_denied"));
}
if($document->isLocked()) {
$lockingUser = $document->getLockingUser();
if (($lockingUser->getID() != $user->getID()) && ($document->getAccessMode($user) != M_ALL)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => htmlspecialchars($lockingUser->getFullName()))));
}
}
if($settings->_enableFullSearch) {
if(!empty($settings->_luceneClassDir))
require_once($settings->_luceneClassDir.'/Lucene.php');
else
require_once('SeedDMS/Lucene.php');
$index = SeedDMS_Lucene_Indexer::open($settings->_luceneDir);
} else {
$index = null;

View File

@ -42,18 +42,20 @@ if ($document->getAccessMode($user) < M_READWRITE) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
if (!$document->isLocked()) {
if($document->isLocked()) {
$lockingUser = $document->getLockingUser();
if (($lockingUser->getID() != $user->getID()) && ($document->getAccessMode($user) != M_ALL)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => htmlspecialchars($lockingUser->getFullName()))));
}
} else {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("document_is_not_locked"));
}
$lockingUser = $document->getLockingUser();
if (($lockingUser->getID() == $user->getID()) || ($document->getAccessMode($user) == M_ALL)) {
if (!$document->setLocked(false)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
}
}
else {
} else {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}

View File

@ -48,11 +48,14 @@ if ($document->getAccessMode($user) < M_READ) {
if(isset($_GET["version"])) {
$version = $_GET["version"];
if (!isset($version) || !is_numeric($version) || intval($version)<1) {
if (!is_numeric($version)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
}
$content = $document->getContentByVersion($version);
if(intval($version)<1)
$content = $document->getLatestContent();
else
$content = $document->getContentByVersion($version);
if (!is_object($content)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));

View File

@ -23,6 +23,7 @@ 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["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
@ -43,9 +44,13 @@ $folder = $document->getFolder();
$allUsers = $dms->getAllUsers($settings->_sortUsersInList);
$allGroups = $dms->getAllGroups();
/* Create object for checking access to certain operations */
$accessop = new SeedDMS_AccessOperation($document, $user, $settings);
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'allusers'=>$allUsers, 'allgroups'=>$allGroups));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
exit;
}

View File

@ -23,6 +23,7 @@ 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["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"]<1)) {
@ -41,9 +42,13 @@ if ($document->getAccessMode($user) < M_READ) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
}
/* Create object for checking access to certain operations */
$accessop = new SeedDMS_AccessOperation($document, $user, $settings);
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'sortusersinlist'=>$settings->_sortUsersInList));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
exit;
}

View File

@ -23,6 +23,7 @@ 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["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
@ -33,6 +34,13 @@ if (!is_object($document)) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
if($document->isLocked()) {
$lockingUser = $document->getLockingUser();
if (($lockingUser->getID() != $user->getID()) && ($document->getAccessMode($user) != M_ALL)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => htmlspecialchars($lockingUser->getFullName()))));
}
}
$version = $document->getContentByVersion($_GET["version"]);
if (!is_object($version)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
@ -40,9 +48,13 @@ if (!is_object($version)) {
$folder = $document->getFolder();
/* Create object for checking access to certain operations */
$accessop = new SeedDMS_AccessOperation($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, 'strictformcheck'=>$settings->_strictFormCheck));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
exit;
}

View File

@ -22,6 +22,7 @@ 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["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
@ -37,12 +38,23 @@ if ($document->getAccessMode($user) < M_READWRITE) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
}
if($document->isLocked()) {
$lockingUser = $document->getLockingUser();
if (($lockingUser->getID() != $user->getID()) && ($document->getAccessMode($user) != M_ALL)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => htmlspecialchars($lockingUser->getFullName()))));
}
}
$folder = $document->getFolder();
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_all));
/* Create object for checking access to certain operations */
$accessop = new SeedDMS_AccessOperation($document, $user, $settings);
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'attrdefs'=>$attrdefs, 'strictformcheck'=>$settings->_strictFormCheck));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
exit;
}

View File

@ -22,6 +22,7 @@ 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["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
@ -37,6 +38,13 @@ if ($document->getAccessMode($user) < M_READWRITE) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
}
if($document->isLocked()) {
$lockingUser = $document->getLockingUser();
if (($lockingUser->getID() != $user->getID()) && ($document->getAccessMode($user) != M_ALL)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => htmlspecialchars($lockingUser->getFullName()))));
}
}
if(isset($_GET['targetid']) && $_GET['targetid']) {
$target = $dms->getFolder($_GET["targetid"]);
if (!is_object($target)) {
@ -53,9 +61,13 @@ if(isset($_GET['targetid']) && $_GET['targetid']) {
$folder = $document->getFolder();
/* Create object for checking access to certain operations */
$accessop = new SeedDMS_AccessOperation($document, $user, $settings);
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'target'=>$target));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
exit;
}

View File

@ -23,6 +23,7 @@ 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["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
@ -58,9 +59,13 @@ if ($overallStatus["status"] == S_REJECTED || $overallStatus["status"] == S_EXPI
$folder = $document->getFolder();
/* Create object for checking access to certain operations */
$accessop = new SeedDMS_AccessOperation($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'=>$content));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
exit;
}

View File

@ -24,6 +24,7 @@ include("../inc/inc.DBInit.php");
include("../inc/inc.Language.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.Extension.php");
include("../inc/inc.ClassAccessOperation.php");
include("../inc/inc.Authentication.php");
if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
@ -39,11 +40,22 @@ if ($document->getAccessMode($user) < M_ALL) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
}
if($document->isLocked()) {
$lockingUser = $document->getLockingUser();
if (($lockingUser->getID() != $user->getID()) && ($document->getAccessMode($user) != M_ALL)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => htmlspecialchars($lockingUser->getFullName()))));
}
}
$folder = $document->getFolder();
/* Create object for checking access to certain operations */
$accessop = new SeedDMS_AccessOperation($document, $user, $settings);
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
exit;
}

View File

@ -23,6 +23,7 @@ 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["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
@ -40,9 +41,13 @@ if ($document->getAccessMode($user) < M_READWRITE) {
$folder = $document->getFolder();
/* Create object for checking access to certain operations */
$accessop = new SeedDMS_AccessOperation($document, $user, $settings);
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
exit;
}

View File

@ -23,6 +23,7 @@ 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["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
@ -38,6 +39,13 @@ if ($document->getAccessMode($user) < M_READWRITE) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
}
if($document->isLocked()) {
$lockingUser = $document->getLockingUser();
if (($lockingUser->getID() != $user->getID()) && ($document->getAccessMode($user) != M_ALL)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => htmlspecialchars($lockingUser->getFullName()))));
}
}
if($settings->_quota > 0) {
$remain = checkQuota($user);
if ($remain < 0) {
@ -47,9 +55,13 @@ if($settings->_quota > 0) {
$folder = $document->getFolder();
/* Create object for checking access to certain operations */
$accessop = new SeedDMS_AccessOperation($document, $user, $settings);
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'strictformcheck'=>$settings->_strictFormCheck, 'enablelargefileupload'=>$settings->_enableLargeFileUpload, 'enableadminrevapp'=>$settings->_enableAdminRevApp, 'enableownerrevapp'=>$settings->_enableOwnerRevApp, 'enableselfrevapp'=>$settings->_enableSelfRevApp, 'dropfolderdir'=>$settings->_dropFolderDir, 'workflowmode'=>$settings->_workflowMode));
if($view) {
$view->setParam('accessobject', $accessop);
$view->show();
exit;
}

View File

@ -47,6 +47,9 @@ if (!is_object($document)) {
$view->exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
/* Create object for checking access to certain operations */
$accessop = new SeedDMS_AccessOperation($document, $user, $settings);
$folder = $document->getFolder();
if ($document->getAccessMode($user) < M_READ) {
@ -61,9 +64,6 @@ if ($document->verifyLastestContentExpriry()){
header("Location:../out/out.ViewDocument.php?documentid=".$document->getID());
}
/* Create object for checking access to certain operations */
$accessop = new SeedDMS_AccessOperation($document, $user, $settings);
if($view) {
$view->setParam('dms', $dms);
$view->setParam('user', $user);

View File

@ -149,18 +149,26 @@ function getLockedDocuments() { /* {{{ */
function getFolder($id) { /* {{{ */
global $app, $dms, $userobj;
$folder = $dms->getFolder($id);
$forcebyname = $app->request()->get('forcebyname');
if(is_numeric($id) && empty($forcebyname))
$folder = $dms->getFolder($id);
else {
$parentid = $app->request()->get('parentid');
$folder = $dms->getFolderByName($id, $parentid);
}
if($folder) {
if($folder->getAccessMode($userobj) >= M_READ) {
$app->response()->header('Content-Type', 'application/json');
$data = array(
'id'=>$id,
'id'=>$folder->getID(),
'name'=>$folder->getName()
);
echo json_encode(array('success'=>true, 'message'=>'', 'data'=>$data));
} else {
$app->response()->status(404);
}
} else {
$app->response()->status(404);
}
} /* }}} */

View File

@ -412,9 +412,11 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
echo "<li><a href=\"../op/op.UnlockDocument". $docid ."\">".getMLText("unlock_document")."</a></li>";
echo "<li><a href=\"../out/out.EditDocument". $docid ."\">".getMLText("edit_document_props")."</a></li>";
echo "<li><a href=\"../out/out.MoveDocument". $docid ."\">".getMLText("move_document")."</a></li>";
echo "<li><a href=\"../out/out.SetExpires". $docid ."\">".getMLText("expires")."</a></li>";
}
}
if($this->params['accessobject']->maySetExpires()) {
echo "<li><a href=\"../out/out.SetExpires". $docid ."\">".getMLText("expires")."</a></li>";
}
}
if ($accessMode == M_ALL) {
echo "<li><a href=\"../out/out.RemoveDocument". $docid ."\">".getMLText("rm_document")."</a></li>";

View File

@ -391,9 +391,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
}
}
}
/*
if($accessop->maySetExpires()) {
print "<li><a href='../out/out.SetExpires.php?documentid=".$documentid."'><i class=\"icon-time\"></i>".getMLText("set_expiry")."</a></li>";
}
*/
if($accessop->mayEditComment()) {
print "<li><a href=\"out.EditComment.php?documentid=".$documentid."&version=".$latestContent->getVersion()."\"><i class=\"icon-comment\"></i>".getMLText("edit_comment")."</a></li>";
}