mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
use new views
This commit is contained in:
parent
c40cb44c79
commit
2f8aef9165
|
@ -1,282 +1,48 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.Utils.php");
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
$folderid = $_GET["folderid"];
|
||||
$folder = $dms->getFolder($folderid);
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
$folderid = $_GET["folderid"];
|
||||
$folder = $dms->getFolder($folderid);
|
||||
if (!is_object($folder)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folderPathHTML = getFolderPathHTML($folder, true);
|
||||
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
if ($folder->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied"));
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($folderPathHTML, "view_folder", $folder);
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
//if (document.form1.userfile[].value == "") msg += "<?php printMLText("js_no_file");?>\n";
|
||||
|
||||
<?php
|
||||
if (isset($settings->_strictFormCheck) && $settings->_strictFormCheck) {
|
||||
?>
|
||||
if(!document.form1.name.disabled){
|
||||
if (document.form1.name.value == "") msg += "<?php printMLText("js_no_name");?>\n";
|
||||
}
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
if (document.form1.keywords.value == "") msg += "<?php printMLText("js_no_keywords");?>\n";
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if (msg != ""){
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'strictformcheck'=>$settings->_strictFormCheck, 'enablelargefileupload'=>$settings->_enableLargeFileUpload, 'dropfolderdir'=>$settings->_dropFolderDir));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
function addFiles()
|
||||
{
|
||||
var li = document.createElement('li');
|
||||
li.innerHTML = '<input type="File" name="userfile[]" size="60">';
|
||||
document.getElementById('files').appendChild(li);
|
||||
// document.getElementById("files").innerHTML += '<br><input type="File" name="userfile[]" size="60">';
|
||||
document.form1.name.disabled=true;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
UI::contentHeading(getMLText("add_document"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
// Retrieve a list of all users and groups that have review / approve
|
||||
// privileges.
|
||||
$docAccess = $folder->getApproversList();
|
||||
?>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="warning"><?php echo getMLText("max_upload_size")." : ".ini_get( "upload_max_filesize"); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if($settings->_enableLargeFileUpload) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php printf(getMLText('link_alt_updatedocument'), "out.AddMultiDocument.php?folderid=".$folderid."&showtree=".showtree()); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php UI::contentSubHeading(getMLText("document_infos")); ?>
|
||||
|
||||
<form action="../op/op.AddDocument.php" enctype="multipart/form-data" method="post" name="form1" onsubmit="return checkForm();">
|
||||
<?php echo createHiddenFieldWithKey('adddocument'); ?>
|
||||
<input type="hidden" name="folderid" value="<?php print $folderid; ?>">
|
||||
<input type="hidden" name="showtree" value="<?php echo showtree();?>">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("name");?>:</td>
|
||||
<td><input name="name" size="60"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="3" cols="80"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("keywords");?>:</td>
|
||||
<td>
|
||||
<textarea name="keywords" rows="1" cols="80"></textarea><br>
|
||||
<a href="javascript:chooseKeywords('form1.keywords');"><?php printMLText("use_default_keywords");?></a>
|
||||
<script language="JavaScript">
|
||||
var openDlg;
|
||||
|
||||
function chooseKeywords(target) {
|
||||
openDlg = open("out.KeywordChooser.php?target="+target, "openDlg", "width=500,height=400,scrollbars=yes,resizable=yes");
|
||||
}
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("categories")?>:</td>
|
||||
<td><?php UI::printCategoryChooser("form1");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("sequence");?>:</td>
|
||||
<td><?php UI::printSequenceChooser($folder->getDocuments());?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_document, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||
<td><?php UI::printAttributeEditField($attrdef, '') ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?php printMLText("expires");?>:</td>
|
||||
<td>
|
||||
<input type="radio" name="expires" value="false" checked><?php printMLText("does_not_expire");?><br>
|
||||
<input type="radio" name="expires" value="true"><?php UI::printDateChooser(-1, "exp");?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<?php UI::contentSubHeading(getMLText("version_info")); ?>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("version");?>:</td>
|
||||
<td><input name="reqversion" value="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("local_file");?>:</td>
|
||||
<td>
|
||||
<a href="javascript:addFiles()"><?php printMLtext("add_multiple_files") ?></a>
|
||||
<ol id="files">
|
||||
<li><input type="File" name="userfile[]" size="60"></li>
|
||||
</ol>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment_for_current_version");?>:</td>
|
||||
<td><textarea name="version_comment" rows="3" cols="80"></textarea></td>
|
||||
</tr>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_documentcontent, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||
<td><?php UI::printAttributeEditField($attrdef, '', 'attributes_version') ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<?php UI::contentSubHeading(getMLText("assign_reviewers")); ?>
|
||||
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
|
||||
$res=$user->getMandatoryReviewers();
|
||||
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
|
||||
if ($usr->getID()==$user->getID()) continue;
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory) print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</li>";
|
||||
else print "<li class=\"cbSelectItem\"><input id='revInd".$usr->getID()."' type='checkbox' name='indReviewers[]' value='". $usr->getID() ."'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['reviewerGroupID']==$grp->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory) print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>".htmlspecialchars($grp->getName())."</li>";
|
||||
else print "<li class=\"cbSelectItem\"><input id='revGrp".$grp->getID()."' type='checkbox' name='grpReviewers[]' value='". $grp->getID() ."'>".htmlspecialchars($grp->getName())."</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php UI::contentSubHeading(getMLText("assign_approvers")); ?>
|
||||
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
$res=$user->getMandatoryApprovers();
|
||||
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
|
||||
if ($usr->getID()==$user->getID()) continue;
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['approverUserID']==$usr->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory) print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName());
|
||||
else print "<li class=\"cbSelectItem\"><input id='appInd".$usr->getID()."' type='checkbox' name='indApprovers[]' value='". $usr->getID() ."'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName());
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['approverGroupID']==$grp->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory) print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>".htmlspecialchars($grp->getName());
|
||||
else print "<li class=\"cbSelectItem\"><input id='appGrp".$grp->getID()."' type='checkbox' name='grpApprovers[]' value='". $grp->getID() ."'>".htmlspecialchars($grp->getName());
|
||||
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p><?php printMLText("add_doc_reviewer_approver_warning")?></p>
|
||||
<p><input type="Submit" value="<?php printMLText("add_document");?>"></p>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,84 +1,36 @@
|
|||
<?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");
|
||||
<?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.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if ($user->isGuest()) {
|
||||
UI::exitError(getMLText("edit_event"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("calendar"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("calendar"), "calendar");
|
||||
|
||||
UI::contentHeading(getMLText("add_event"));
|
||||
UI::contentContainerStart();
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.name.value == "") msg += "<?php printMLText("js_no_name");?>\n";
|
||||
<?php
|
||||
if (isset($settings->_strictFormCheck) && $settings->_strictFormCheck) {
|
||||
?>
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<form action="../op/op.AddEvent.php" name="form1" onsubmit="return checkForm();" method="POST">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("from");?>:</td>
|
||||
<td><?php UI::printDateChooser(-1, "from");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("to");?>:</td>
|
||||
<td><?php UI::printDateChooser(-1, "to");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="inputDescription"><?php printMLText("name");?>:</td>
|
||||
<td><input name="name" size="60"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="inputDescription"><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="4" cols="80"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><br><input type="Submit" value="<?php printMLText("add_event");?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,109 +1,51 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.Utils.php");
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
$documentid = $_GET["documentid"];
|
||||
$document = $dms->getDocument($documentid);
|
||||
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
if (!is_object($document)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
$folder = $document->getFolder();
|
||||
|
||||
if ($document->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$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));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.userfile.value == "") msg += "<?php printMLText("js_no_file");?>\n";
|
||||
if (document.form1.name.value == "") msg += "<?php printMLText("js_no_name");?>\n";
|
||||
<?php
|
||||
if (isset($settings->_strictFormCheck) && $settings->_strictFormCheck) {
|
||||
?>
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
UI::contentHeading(getMLText("linked_files"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="warning"><?php echo getMLText("max_upload_size")." : ".ini_get( "upload_max_filesize"); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printf(getMLText('link_alt_updatedocument'), "out.AddFile2.php?documentid=".$documentid); ?></td>
|
||||
</tr>
|
||||
</table><br>
|
||||
|
||||
<form action="../op/op.AddFile.php" enctype="multipart/form-data" method="post" name="form1" onsubmit="return checkForm();">
|
||||
<input type="Hidden" name="documentid" value="<?php print $documentid; ?>">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("local_file");?>:</td>
|
||||
<td><input type="File" name="userfile" size="60"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("name");?>:</td>
|
||||
<td><input name="name" size="60"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="4" cols="80"></textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><input type="Submit" value="<?php printMLText("add");?>"></p>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -37,21 +37,16 @@ if (!is_object($document)) {
|
|||
}
|
||||
|
||||
$folder = $document->getFolder();
|
||||
$docPathHTML = getFolderPathHTML($folder, true). " / <a href=\"../out/out.ViewDocument.php?documentid=".$documentid."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
if ($document->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::contentHeading(getMLText("linked_files"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
UI::printUploadApplet('../op/op.AddFile2.php', array('documentid'=>$document->getId()), 1, array('name'=>1, 'comment'=>1));
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -32,43 +32,20 @@ if(!$settings->_enableLargeFileUpload) {
|
|||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
$folderid = $_GET["folderid"];
|
||||
$folder = $dms->getFolder($folderid);
|
||||
$folder = $dms->getFolder($_GET['folderid']);
|
||||
if (!is_object($folder)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folderPathHTML = getFolderPathHTML($folder, true);
|
||||
|
||||
if ($folder->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($folderPathHTML, "view_folder", $folder);
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
var openDlg;
|
||||
function chooseKeywords(target) {
|
||||
openDlg = open("out.KeywordChooser.php?target="+target, "openDlg", "width=500,height=400,scrollbars=yes,resizable=yes");
|
||||
}
|
||||
function chooseCategory(form, cats) {
|
||||
openDlg = open("out.CategoryChooser.php?form="+form+"&cats="+cats, "openDlg", "width=480,height=480,scrollbars=yes,resizable=yes,status=yes");
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
UI::contentHeading(getMLText("add_document"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
// Retrieve a list of all users and groups that have review / approve
|
||||
// privileges.
|
||||
$docAccess = $folder->getApproversList();
|
||||
|
||||
UI::printUploadApplet('../op/op.AddMultiDocument.php', array('folderid'=>$folderid));
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,111 +1,48 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2010 Matteo Lucarelli
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2010 Matteo Lucarelli
|
||||
// Copyright (C) 2010-2012 Uwe Steinmann
|
||||
//
|
||||
// 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.Utils.php");
|
||||
//
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
$folderid = $_GET["folderid"];
|
||||
$folder = $dms->getFolder($folderid);
|
||||
}
|
||||
$folder = $dms->getFolder($_GET["folderid"]);
|
||||
if (!is_object($folder)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folderPathHTML = getFolderPathHTML($folder, true);
|
||||
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
if ($folder->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
UI::htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($folderPathHTML, "view_folder", $folder);
|
||||
UI::contentHeading(getMLText("add_subfolder"));
|
||||
UI::contentContainerStart();
|
||||
}
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'strictformcheck'=>$settings->_strictFormCheck));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.name.value == "") msg += "<?php printMLText("js_no_name");?>\n";
|
||||
<?php
|
||||
if (isset($settings->_strictFormCheck) && $settings->_strictFormCheck) {
|
||||
?>
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<form action="../op/op.AddSubFolder.php" name="form1" onsubmit="return checkForm();" method="POST">
|
||||
<?php echo createHiddenFieldWithKey('addsubfolder'); ?>
|
||||
<input type="Hidden" name="folderid" value="<?php print $folderid;?>">
|
||||
<input type="Hidden" name="showtree" value="<?php echo showtree();?>">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="inputDescription"><?php printMLText("name");?>:</td>
|
||||
<td><input name="name" size="60"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="inputDescription"><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="4" cols="80"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="inputDescription"><?php printMLText("sequence");?>:</td>
|
||||
<td><?php UI::printSequenceChooser($folder->getSubFolders());?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_folder, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||
<td><?php UI::printAttributeEditField($attrdef, '') ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2"><br><input type="Submit" value="<?php printMLText("add_subfolder");?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,61 +1,36 @@
|
|||
<?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");
|
||||
<?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.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.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"));
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("admin_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<ul>
|
||||
<li class="first"><a href="../out/out.Statistic.php"><?php echo getMLText("folders_and_documents_statistic")?></a></li>
|
||||
<li><a href="../out/out.BackupTools.php"><?php echo getMLText("backup_tools")?></a></li>
|
||||
<?php
|
||||
if ($settings->_logFileEnable) echo "<li><a href=\"../out/out.LogManagement.php\">".getMLText("log_management")."</a></li>";
|
||||
?>
|
||||
<li><a href="../out/out.UsrMgr.php"><?php echo getMLText("user_management")?></a></li>
|
||||
<li><a href="../out/out.GroupMgr.php"><?php echo getMLText("group_management")?></a></li>
|
||||
<li><a href="../out/out.DefaultKeywords.php"><?php echo getMLText("global_default_keywords")?></a></li>
|
||||
<li><a href="../out/out.Categories.php"><?php echo getMLText("global_document_categories")?></a></li>
|
||||
<li><a href="../out/out.AttributeMgr.php"><?php echo getMLText("global_attributedefinitions")?></a></li>
|
||||
<li><a href="../out/out.Info.php"><?php echo getMLText("version_info")?></a></li>
|
||||
<?php
|
||||
if($settings->_enableFullSearch) {
|
||||
?>
|
||||
<li><a href="../out/out.Indexer.php"><?php echo getMLText("update_fulltext_index")?></a></li>
|
||||
<li><a href="../out/out.Indexer.php?create=1"><?php echo getMLText("create_fulltext_index")?></a></li>
|
||||
<li><a href="../out/out.IndexInfo.php"><?php echo getMLText("fulltext_info")?></a></li>
|
||||
<?php
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'enablefullsearch'=>$settings->_enableFullSearch, 'logfileenable'=>$settings->_logFileEnable));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<li><a href="../out/out.ObjectCheck.php"><?php echo getMLText("objectcheck")?></a></li>
|
||||
<li><a href="../out/out.Settings.php"><?php echo getMLText("settings")?></a></li>
|
||||
</ul>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,187 +1,38 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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");
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if ($user->isGuest()) {
|
||||
UI::exitError(getMLText("my_documents"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (!$db->createTemporaryTable("ttstatid")) {
|
||||
UI::exitError(getMLText("approval_summary"),getMLText("internal_error_exit"));
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("approval_summary"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("my_documents"), "my_documents");
|
||||
UI::contentHeading(getMLText("approval_summary"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
// TODO: verificare scadenza
|
||||
|
||||
// Get document list for the current user.
|
||||
$approvalStatus = $user->getApprovalStatus();
|
||||
|
||||
// reverse order
|
||||
$approvalStatus["indstatus"]=array_reverse($approvalStatus["indstatus"],true);
|
||||
$approvalStatus["grpstatus"]=array_reverse($approvalStatus["grpstatus"],true);
|
||||
|
||||
// Create a comma separated list of all the documentIDs whose information is
|
||||
// required.
|
||||
$dList = array();
|
||||
foreach ($approvalStatus["indstatus"] as $st) {
|
||||
if (!in_array($st["documentID"], $dList)) {
|
||||
$dList[] = $st["documentID"];
|
||||
}
|
||||
}
|
||||
foreach ($approvalStatus["grpstatus"] as $st) {
|
||||
if (!in_array($st["documentID"], $dList)) {
|
||||
$dList[] = $st["documentID"];
|
||||
}
|
||||
}
|
||||
$docCSV = "";
|
||||
foreach ($dList as $d) {
|
||||
$docCSV .= (strlen($docCSV)==0 ? "" : ", ")."'".$d."'";
|
||||
}
|
||||
|
||||
if (strlen($docCSV)>0) {
|
||||
|
||||
$queryStr = "SELECT `tblDocuments`.*, `tblDocumentLocks`.`userID` as `lockUser`, ".
|
||||
"`tblDocumentStatus`.*, `tblDocumentStatusLog`.`status`, ".
|
||||
"`tblDocumentStatusLog`.`comment` AS `statusComment`, `tblDocumentStatusLog`.`date` as `statusDate`, ".
|
||||
"`tblDocumentStatusLog`.`userID`, `oTbl`.`fullName` AS `ownerName`, `sTbl`.`fullName` AS `statusName` ".
|
||||
"FROM `tblDocumentStatus` ".
|
||||
"LEFT JOIN `tblDocumentStatusLog` USING (`statusID`) ".
|
||||
"LEFT JOIN `ttstatid` on `ttstatid`.`maxLogID` = `tblDocumentStatusLog`.`statusLogID` ".
|
||||
"LEFT JOIN `tblDocuments` ON `tblDocuments`.`id` = `tblDocumentStatus`.`documentID` ".
|
||||
"LEFT JOIN `tblDocumentLocks` ON `tblDocuments`.`id`=`tblDocumentLocks`.`document` ".
|
||||
"LEFT JOIN `tblUsers` AS `oTbl` on `oTbl`.`id` = `tblDocuments`.`owner` ".
|
||||
"LEFT JOIN `tblUsers` AS `sTbl` on `sTbl`.`id` = `tblDocumentStatusLog`.`userID` ".
|
||||
"WHERE `ttstatid`.`maxLogID`=`tblDocumentStatusLog`.`statusLogID` ".
|
||||
"AND `tblDocuments`.`id` IN (" . $docCSV . ") ".
|
||||
"ORDER BY `statusDate` DESC";
|
||||
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
UI::exitError(getMLText("approval_summary"),getMLText("internal_error_exit"));
|
||||
}
|
||||
// Create an array to hold all of these results, and index the array by
|
||||
// document id. This makes it easier to retrieve document ID information
|
||||
// later on and saves us having to repeatedly poll the database every time
|
||||
// new document information is required.
|
||||
$docIdx = array();
|
||||
foreach ($resArr as $res) {
|
||||
|
||||
// verify expiry
|
||||
if ( $res["expires"] && time()>$res["expires"]+24*60*60 ){
|
||||
if ( $res["status"]==S_DRAFT_APP || $res["status"]==S_DRAFT_REV ){
|
||||
$res["status"]=S_EXPIRED;
|
||||
}
|
||||
}
|
||||
|
||||
$docIdx[$res["id"]][$res["version"]] = $res;
|
||||
}
|
||||
}
|
||||
|
||||
$iRev = array();
|
||||
$printheader = true;
|
||||
foreach ($approvalStatus["indstatus"] as $st) {
|
||||
|
||||
if (isset($docIdx[$st["documentID"]][$st["version"]])) {
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("owner")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th>".getMLText("last_update")."</th>\n";
|
||||
print "<th>".getMLText("expires")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader = false;
|
||||
}
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["name"])."</a></td>";
|
||||
print "<td>".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["ownerName"])."</td>";
|
||||
print "<td>".getOverallStatusText($docIdx[$st["documentID"]][$st["version"]]["status"])."</td>";
|
||||
print "<td>".$st["version"]."</td>";
|
||||
print "<td>".$st["date"]." ". htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["statusName"]) ."</td>";
|
||||
print "<td>".(!$docIdx[$st["documentID"]][$st["version"]]["expires"] ? "-":getReadableDate($docIdx[$st["documentID"]][$st["version"]]["expires"]))."</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
if ($st["status"]!=-2) {
|
||||
$iRev[] = $st["documentID"];
|
||||
}
|
||||
}
|
||||
if (!$printheader) {
|
||||
echo "</tbody>\n</table>\n";
|
||||
}else{
|
||||
printMLText("no_approval_needed");
|
||||
}
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::contentHeading(getMLText("group_approval_summary"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
$printheader = true;
|
||||
foreach ($approvalStatus["grpstatus"] as $st) {
|
||||
|
||||
if (!in_array($st["documentID"], $iRev) && isset($docIdx[$st["documentID"]][$st["version"]])) {
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("owner")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th>".getMLText("last_update")."</th>\n";
|
||||
print "<th>".getMLText("expires")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader = false;
|
||||
}
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["name"])."</a></td>";
|
||||
print "<td>".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["ownerName"])."</td>";
|
||||
print "<td>".getOverallStatusText($docIdx[$st["documentID"]][$st["version"]]["status"])."</td>";
|
||||
print "<td>".$st["version"]."</td>";
|
||||
print "<td>".$st["date"]." ". htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["statusName"]) ."</td>";
|
||||
print "<td>".(!$docIdx[$st["documentID"]][$st["version"]]["expires"] ? "-":getReadableDate($docIdx[$st["documentID"]][$st["version"]]["expires"]))."</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
if (!$printheader) {
|
||||
echo "</tbody>\n</table>\n";
|
||||
}else{
|
||||
printMLText("empty_notify_list");
|
||||
}
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -29,15 +29,13 @@ if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_
|
|||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
$documentid = $_GET["documentid"];
|
||||
$document = $dms->getDocument($documentid);
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
if ($document->getAccessMode($user) < M_READ) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
|
@ -67,134 +65,11 @@ if(!$approvals) {
|
|||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("no_action"));
|
||||
}
|
||||
|
||||
foreach($approvals as $approval) {
|
||||
if($approval['approveID'] == $_GET['approveid']) {
|
||||
$approvalStatus = $approval;
|
||||
break;
|
||||
}
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
UI::contentHeading(getMLText("submit_approval"));
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkIndForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.approvalStatus.value == "") msg += "<?php printMLText("js_no_approval_status");?>\n";
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
function checkGrpForm()
|
||||
{
|
||||
msg = "";
|
||||
// if (document.form1.approvalGroup.value == "") msg += "<?php printMLText("js_no_approval_group");?>\n";
|
||||
if (document.form1.approvalStatus.value == "") msg += "<?php printMLText("js_no_approval_status");?>\n";
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
UI::contentContainerStart();
|
||||
|
||||
// Display the Approval form.
|
||||
if ($approvalStatus['type'] == 0) {
|
||||
if($approvalStatus["status"]!=0) {
|
||||
|
||||
print "<table class=\"folderView\"><thead><tr>";
|
||||
print "<th>".getMLText("status")."</th>";
|
||||
print "<th>".getMLText("comment")."</th>";
|
||||
print "<th>".getMLText("last_update")."</th>";
|
||||
print "</tr></thead><tbody><tr>";
|
||||
print "<td>";
|
||||
printApprovalStatusText($approvalStatus["status"]);
|
||||
print "</td>";
|
||||
print "<td>".htmlspecialchars($approvalStatus["comment"])."</td>";
|
||||
$indUser = $dms->getUser($approvalStatus["userID"]);
|
||||
print "<td>".$approvalStatus["date"]." - ". $indUser->getFullname() ."</td>";
|
||||
print "</tr></tbody></table><br>\n";
|
||||
}
|
||||
?>
|
||||
<form method="POST" action="../op/op.ApproveDocument.php" name="form1" onsubmit="return checkIndForm();">
|
||||
<table>
|
||||
<tr><td><?php printMLText("comment")?>:</td>
|
||||
<td><textarea name="comment" cols="80" rows="4"></textarea>
|
||||
</td></tr>
|
||||
<tr><td><?php printMLText("approval_status")?>:</td>
|
||||
<td><select name="approvalStatus">
|
||||
<option value=''></option>
|
||||
<option value='1'><?php printMLText("status_approved")?></option>
|
||||
<option value='-1'><?php printMLText("rejected")?></option>
|
||||
</select>
|
||||
</td></tr><tr><td></td><td>
|
||||
<input type='hidden' name='approvalType' value='ind'/>
|
||||
<input type='hidden' name='documentid' value='<?php echo $documentid ?>'/>
|
||||
<input type='hidden' name='version' value='<?php echo $version ?>'/>
|
||||
<input type='submit' name='indApproval' value='<?php printMLText("submit_approval")?>'/>
|
||||
</td></tr></table>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
else if ($approvalStatus['type'] == 1) {
|
||||
|
||||
if($approvalStatus["status"]!=0) {
|
||||
|
||||
print "<table class=\"folderView\"><thead><tr>";
|
||||
print "<th>".getMLText("status")."</th>";
|
||||
print "<th>".getMLText("comment")."</th>";
|
||||
print "<th>".getMLText("last_update")."</th>";
|
||||
print "</tr></thead><tbody><tr>";
|
||||
print "<td>";
|
||||
printApprovalStatusText($approvalStatus["status"]);
|
||||
print "</td>";
|
||||
print "<td>".htmlspecialchars($approvalStatus["comment"])."</td>";
|
||||
$indUser = $dms->getUser($approvalStatus["userID"]);
|
||||
print "<td>".$approvalStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
|
||||
print "</tr></tbody></table><br>\n";
|
||||
}
|
||||
|
||||
?>
|
||||
<form method="POST" action="../op/op.ApproveDocument.php" name="form1" onsubmit="return checkGrpForm();">
|
||||
<table>
|
||||
<tr><td><?php printMLText("comment")?>:</td>
|
||||
<td><textarea name="comment" cols="80" rows="4"></textarea>
|
||||
</td></tr>
|
||||
<tr><td><?php printMLText("approval_status")?>:</td>
|
||||
<td>
|
||||
<select name="approvalStatus">
|
||||
<option value=''></option>
|
||||
<option value='1'><?php printMLText("status_approved")?></option>
|
||||
<option value='-1'><?php printMLText("rejected")?></option>
|
||||
</select>
|
||||
</td></tr>
|
||||
<tr><td></td><td>
|
||||
<input type='hidden' name='approvalGroup' value="<?php echo $approvalStatus['required']; ?>" />
|
||||
<input type='hidden' name='approvalType' value='grp'/>
|
||||
<input type='hidden' name='documentid' value='<?php echo $documentid ?>'/>
|
||||
<input type='hidden' name='version' value='<?php echo $version ?>'/>
|
||||
<input type='submit' name='groupApproval' value='<?php printMLText("submit_approval")?>'/></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -30,218 +30,12 @@ if (!$user->isAdmin()) {
|
|||
}
|
||||
|
||||
$attrdefs = $dms->getAllAttributeDefinitions();
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
obj = -1;
|
||||
function showAttributeDefinitions(selectObj) {
|
||||
if (obj != -1)
|
||||
obj.style.display = "none";
|
||||
|
||||
id = selectObj.options[selectObj.selectedIndex].value;
|
||||
if (id == -1)
|
||||
return;
|
||||
|
||||
obj = document.getElementById("attrdefs" + id);
|
||||
obj.style.display = "";
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'attrdefs'=>$attrdefs));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
|
||||
UI::htmlStartPage(getMLText("admin_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
UI::contentHeading(getMLText("attrdef_management"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo getMLText("selection")?>:</td>
|
||||
<td>
|
||||
<select onchange="showAttributeDefinitions(this)" id="selector">
|
||||
<option value="-1"><?php echo getMLText("choose_attrdef")?>
|
||||
<option value="0"><?php echo getMLText("new_attrdef")?>
|
||||
|
||||
<?php
|
||||
|
||||
$selected=0;
|
||||
$count=2;
|
||||
if($attrdefs) {
|
||||
foreach ($attrdefs as $attrdef) {
|
||||
|
||||
if (isset($_GET["attrdefid"]) && $attrdef->getID()==$_GET["attrdefid"]) $selected=$count;
|
||||
switch($attrdef->getObjType()) {
|
||||
case LetoDMS_Core_AttributeDefinition::objtype_all:
|
||||
$ot = getMLText("all");
|
||||
break;
|
||||
case LetoDMS_Core_AttributeDefinition::objtype_folder:
|
||||
$ot = getMLText("folder");
|
||||
break;
|
||||
case LetoDMS_Core_AttributeDefinition::objtype_document:
|
||||
$ot = getMLText("document");
|
||||
break;
|
||||
case LetoDMS_Core_AttributeDefinition::objtype_documentcontent:
|
||||
$ot = getMLText("version");
|
||||
break;
|
||||
}
|
||||
print "<option value=\"".$attrdef->getID()."\">" . htmlspecialchars($attrdef->getName() ." (".$ot.")");
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
|
||||
<td id="attrdefs0" style="display : none;">
|
||||
<form action="../op/op.AttributeMgr.php" method="post">
|
||||
<?php echo createHiddenFieldWithKey('addattrdef'); ?>
|
||||
<input type="Hidden" name="action" value="addattrdef">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("attrdef_name");?>:</td><td><input type="text" name="name"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("attrdef_objtype");?>:</td><td><select name="objtype"><option value="<?php echo LetoDMS_Core_AttributeDefinition::objtype_all ?>">All</option><option value="<?php echo LetoDMS_Core_AttributeDefinition::objtype_folder ?>">Folder</option><option value="<?php echo LetoDMS_Core_AttributeDefinition::objtype_document ?>"><?php printMLText("document"); ?></option><option value="<?php echo LetoDMS_Core_AttributeDefinition::objtype_documentcontent ?>"><?php printMLText("version"); ?></option></select>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("attrdef_type");?>:</td><td><select name="type"><option value="<?php echo LetoDMS_Core_AttributeDefinition::type_int ?>">Integer</option><option value="<?php echo LetoDMS_Core_AttributeDefinition::type_float ?>">Float</option><option value="<?php echo LetoDMS_Core_AttributeDefinition::type_string ?>">String</option><option value="<?php echo LetoDMS_Core_AttributeDefinition::type_boolean ?>">Boolean</option></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("attrdef_multiple");?>:</td><td><input type="checkbox" value="1" name="multiple" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("attrdef_minvalues");?>:</td><td><input type="text" value="" name="minvalues" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("attrdef_maxvalues");?>:</td><td><input type="text" value="" name="maxvalues" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("attrdef_valueset");?>:</td><td><input type="text" value="" name="valueset" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="Submit" value="<?php printMLText("new_attrdef"); ?>">
|
||||
</form>
|
||||
</td>
|
||||
|
||||
<?php
|
||||
|
||||
if($attrdefs) {
|
||||
foreach ($attrdefs as $attrdef) {
|
||||
|
||||
print "<td id=\"attrdefs".$attrdef->getID()."\" style=\"display : none;\">";
|
||||
?>
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php
|
||||
if(!$attrdef->isUsed()) {
|
||||
?>
|
||||
<form style="display: inline-block;" method="post" action="../op/op.AttributeMgr.php" >
|
||||
<?php echo createHiddenFieldWithKey('removeattrdef'); ?>
|
||||
<input type="Hidden" name="attrdefid" value="<?php echo $attrdef->getID()?>">
|
||||
<input type="Hidden" name="action" value="removeattrdef">
|
||||
<input value="<?php echo getMLText("rm_attrdef")?>" type="submit">
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<p><?php echo getMLText('attrdef_in_use') ?></p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php UI::contentSubHeading("");?>
|
||||
</td>
|
||||
</tr>
|
||||
<form action="../op/op.AttributeMgr.php" method="post">
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo createHiddenFieldWithKey('editattrdef'); ?>
|
||||
<input type="Hidden" name="action" value="editattrdef">
|
||||
<input type="Hidden" name="attrdefid" value="<?php echo $attrdef->getID()?>" />
|
||||
<?php printMLText("attrdef_name");?>:
|
||||
</td>
|
||||
<td>
|
||||
<input name="name" value="<?php echo htmlspecialchars($attrdef->getName()) ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php printMLText("attrdef_type");?>:
|
||||
</td>
|
||||
<td>
|
||||
<select name="type"><option value="<?php echo LetoDMS_Core_AttributeDefinition::type_int ?>" <?php if($attrdef->getType() == LetoDMS_Core_AttributeDefinition::type_int) echo "selected"; ?>>Integer</option><option value="<?php echo LetoDMS_Core_AttributeDefinition::type_float ?>" <?php if($attrdef->getType() == LetoDMS_Core_AttributeDefinition::type_float) echo "selected"; ?>>Float</option><option value="<?php echo LetoDMS_Core_AttributeDefinition::type_string ?>" <?php if($attrdef->getType() == LetoDMS_Core_AttributeDefinition::type_string) echo "selected"; ?>>String</option><option value="<?php echo LetoDMS_Core_AttributeDefinition::type_boolean ?>" <?php if($attrdef->getType() == LetoDMS_Core_AttributeDefinition::type_boolean) echo "selected"; ?>>Boolean</option></select><br />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php printMLText("attrdef_objtype");?>:
|
||||
</td>
|
||||
<td>
|
||||
<select name="objtype"><option value="<?php echo LetoDMS_Core_AttributeDefinition::objtype_all ?>">All</option><option value="<?php echo LetoDMS_Core_AttributeDefinition::objtype_folder ?>" <?php if($attrdef->getObjType() == LetoDMS_Core_AttributeDefinition::objtype_folder) echo "selected"; ?>>Folder</option><option value="<?php echo LetoDMS_Core_AttributeDefinition::objtype_document ?>" <?php if($attrdef->getObjType() == LetoDMS_Core_AttributeDefinition::objtype_document) echo "selected"; ?>>Document</option><option value="<?php echo LetoDMS_Core_AttributeDefinition::objtype_documentcontent ?>" <?php if($attrdef->getObjType() == LetoDMS_Core_AttributeDefinition::objtype_documentcontent) echo "selected"; ?>>Document content</option></select><br />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php printMLText("attrdef_multiple");?>:
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" value="1" name="multiple" /><br />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php printMLText("attrdef_minvalues");?>:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" value="<?php echo $attrdef->getMinValues() ?>" name="minvalues" /><br />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php printMLText("attrdef_maxvalues");?>:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" value="<?php echo $attrdef->getMaxValues() ?>" name="maxvalues" /><br />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php printMLText("attrdef_valueset");?>:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" value="<?php echo $attrdef->getValueSet() ?>" name="valueset" /><br />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="Submit" value="<?php printMLText("save");?>">
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr></table>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
sel = document.getElementById("selector");
|
||||
sel.selectedIndex=<?php print $selected ?>;
|
||||
showAttributeDefinitions(sel);
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,200 +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");
|
||||
<?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");
|
||||
|
||||
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"));
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
// funcion by shalless at rubix dot net dot au (php.net)
|
||||
function dskspace($dir)
|
||||
{
|
||||
$s = stat($dir);
|
||||
$space = $s["blocks"]*512;
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$dh = opendir($dir);
|
||||
while (($file = readdir($dh)) !== false)
|
||||
if ($file != "." and $file != "..")
|
||||
$space += dskspace($dir."/".$file);
|
||||
closedir($dh);
|
||||
}
|
||||
return $space;
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("backup_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
|
||||
UI::contentHeading(getMLText("backup_tools"));
|
||||
UI::contentContainerStart();
|
||||
print getMLText("space_used_on_data_folder")." : ".formatted_size(dskspace($settings->_contentDir));
|
||||
UI::contentContainerEnd();
|
||||
|
||||
// versioning file creation ////////////////////////////////////////////////////
|
||||
|
||||
UI::contentHeading(getMLText("versioning_file_creation"));
|
||||
UI::contentContainerStart();
|
||||
print "<p>".getMLText("versioning_file_creation_warning")."</p>\n";
|
||||
|
||||
print "<form action=\"../op/op.CreateVersioningFiles.php\" name=\"form1\">";
|
||||
UI::printFolderChooser("form1",M_READWRITE);
|
||||
print "<input type='submit' name='' value='".getMLText("versioning_file_creation")."'/>";
|
||||
print "</form>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
// archive creation ////////////////////////////////////////////////////////////
|
||||
|
||||
UI::contentHeading(getMLText("archive_creation"));
|
||||
UI::contentContainerStart();
|
||||
print "<p>".getMLText("archive_creation_warning")."</p>\n";
|
||||
|
||||
print "<form action=\"../op/op.CreateFolderArchive.php\" name=\"form2\">";
|
||||
UI::printFolderChooser("form2",M_READWRITE);
|
||||
print "<input type=\"checkbox\" name=\"human_readable\" value=\"1\">".getMLText("human_readable");
|
||||
print "<input type='submit' name='' value='".getMLText("archive_creation")."'/>";
|
||||
print "</form>\n";
|
||||
|
||||
// list backup files
|
||||
UI::contentSubHeading(getMLText("backup_list"));
|
||||
|
||||
$print_header=true;
|
||||
|
||||
$handle = opendir($settings->_contentDir);
|
||||
$entries = array();
|
||||
while ($e = readdir($handle)){
|
||||
if (is_dir($settings->_contentDir.$e)) continue;
|
||||
if (strpos($e,".tar.gz")==FALSE) continue;
|
||||
$entries[] = $e;
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
sort($entries);
|
||||
$entries = array_reverse($entries);
|
||||
|
||||
foreach ($entries as $entry){
|
||||
|
||||
if ($print_header){
|
||||
print "<table class=\"folderView\">\n";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("folder")."</th>\n";
|
||||
print "<th>".getMLText("creation_date")."</th>\n";
|
||||
print "<th>".getMLText("file_size")."</th>\n";
|
||||
print "<th></th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$print_header=false;
|
||||
}
|
||||
|
||||
$folderid=substr($entry,strpos($entry,"_")+1);
|
||||
$folder=$dms->getFolder((int)$folderid);
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"../op/op.Download.php?arkname=".$entry."\">".$entry."</a></td>\n";
|
||||
if (is_object($folder)) print "<td>".htmlspecialchars($folder->getName())."</td>\n";
|
||||
else print "<td>".getMLText("unknown_id")."</td>\n";
|
||||
print "<td>".getLongReadableDate(filectime($settings->_contentDir.$entry))."</td>\n";
|
||||
print "<td>".formatted_size(filesize($settings->_contentDir.$entry))."</td>\n";
|
||||
print "<td><ul class=\"actions\">";
|
||||
print "<li><a href=\"out.RemoveArchive.php?arkname=".$entry."\">".getMLText("backup_remove")."</a></li>";
|
||||
print "</ul></td>\n";
|
||||
print "</tr>\n";
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'contentdir'=>$settings->_contentDir));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($print_header) printMLText("empty_notify_list");
|
||||
else print "</table>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
// dump creation ///////////////////////////////////////////////////////////////
|
||||
|
||||
UI::contentHeading(getMLText("dump_creation"));
|
||||
UI::contentContainerStart();
|
||||
print "<p>".getMLText("dump_creation_warning")."</p>\n";
|
||||
|
||||
print "<form action=\"../op/op.CreateDump.php\" name=\"form4\">";
|
||||
print "<input type='submit' name='' value='".getMLText("dump_creation")."'/>";
|
||||
print "</form>\n";
|
||||
|
||||
// list backup files
|
||||
UI::contentSubHeading(getMLText("dump_list"));
|
||||
|
||||
$print_header=true;
|
||||
|
||||
$handle = opendir($settings->_contentDir);
|
||||
$entries = array();
|
||||
while ($e = readdir($handle)){
|
||||
if (is_dir($settings->_contentDir.$e)) continue;
|
||||
if (strpos($e,".sql.gz")==FALSE) continue;
|
||||
$entries[] = $e;
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
sort($entries);
|
||||
$entries = array_reverse($entries);
|
||||
|
||||
foreach ($entries as $entry){
|
||||
|
||||
if ($print_header){
|
||||
print "<table class=\"folderView\">\n";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("creation_date")."</th>\n";
|
||||
print "<th>".getMLText("file_size")."</th>\n";
|
||||
print "<th></th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$print_header=false;
|
||||
}
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"../op/op.Download.php?dumpname=".$entry."\">".$entry."</a></td>\n";
|
||||
print "<td>".getLongReadableDate(filectime($settings->_contentDir.$entry))."</td>\n";
|
||||
print "<td>".formatted_size(filesize($settings->_contentDir.$entry))."</td>\n";
|
||||
print "<td><ul class=\"actions\">";
|
||||
print "<li><a href=\"out.RemoveDump.php?dumpname=".$entry."\">".getMLText("dump_remove")."</a></li>";
|
||||
print "</ul></td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
if ($print_header) printMLText("empty_notify_list");
|
||||
else print "</table>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
// files deletion //////////////////////////////////////////////////////////////
|
||||
|
||||
UI::contentHeading(getMLText("files_deletion"));
|
||||
UI::contentContainerStart();
|
||||
print "<p>".getMLText("files_deletion_warning")."</p>\n";
|
||||
|
||||
print "<form action=\"../out/out.RemoveFolderFiles.php\" name=\"form3\">";
|
||||
UI::printFolderChooser("form3",M_READWRITE);
|
||||
print "<input type='submit' name='' value='".getMLText("files_deletion")."'/>";
|
||||
print "</form>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
<?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.Calendar.php");
|
||||
<?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.Calendar.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
|
@ -35,148 +35,11 @@ else $month = (int)date("m", $currDate);
|
|||
if (isset($_GET["day"])&&is_numeric($_GET["day"])) $day=$_GET["day"];
|
||||
else $day = (int)date("d", $currDate);
|
||||
|
||||
adjustDate($day,$month,$year);
|
||||
|
||||
UI::htmlStartPage(getMLText("calendar"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("calendar"), "calendar",array($day,$month,$year));
|
||||
|
||||
if ($mode=="y"){
|
||||
|
||||
UI::contentHeading(getMLText("year_view")." : ".$year);
|
||||
UI::contentContainerStart();
|
||||
|
||||
print "<a href=\"../out/out.Calendar.php?mode=y&year=".($year-1)."\"><img src=\"".UI::getImgPath("m.png")."\" border=0></a> ";
|
||||
print "<a href=\"../out/out.Calendar.php?mode=y\"><img src=\"".UI::getImgPath("c.png")."\" border=0></a> ";
|
||||
print "<a href=\"../out/out.Calendar.php?mode=y&year=".($year+1)."\"><img src=\"".UI::getImgPath("p.png")."\" border=0></a> ";
|
||||
|
||||
printYearTable($year);
|
||||
UI::contentContainerEnd();
|
||||
|
||||
}else if ($mode=="m"){
|
||||
|
||||
if (!isset($dayNamesLong)) generateCalendarArrays();
|
||||
if (!isset($monthNames)) generateCalendarArrays();
|
||||
|
||||
UI::contentHeading(getMLText("month_view")." : ".$monthNames[$month-1]. " ".$year);
|
||||
UI::contentContainerStart();
|
||||
|
||||
print "<a href=\"../out/out.Calendar.php?mode=m&year=".($year)."&month=".($month-1)."\"><img src=\"".UI::getImgPath("m.png")."\" border=0></a> ";
|
||||
print "<a href=\"../out/out.Calendar.php?mode=m\"><img src=\"".UI::getImgPath("c.png")."\" border=0></a> ";
|
||||
print "<a href=\"../out/out.Calendar.php?mode=m&year=".($year)."&month=".($month+1)."\"><img src=\"".UI::getImgPath("p.png")."\" border=0></a> ";
|
||||
|
||||
$days=getDaysInMonth($month, $year);
|
||||
$today = getdate(time());
|
||||
|
||||
$events = getEventsInInterval(mktime(0,0,0, $month, 1, $year), mktime(23,59,59, $month, $days, $year));
|
||||
|
||||
echo "<table class='calendarmonth'>\n";
|
||||
|
||||
for ($i=1; $i<=$days; $i++){
|
||||
|
||||
// separate weeks
|
||||
$date = getdate(mktime(12, 0, 0, $month, $i, $year));
|
||||
if (($date["wday"]==$settings->_firstDayOfWeek) && ($i!=1))
|
||||
echo "<tr><td class='separator' colspan='".(count($events)+2)."'> </td></tr>\n";
|
||||
|
||||
// highlight today
|
||||
$class = ($year == $today["year"] && $month == $today["mon"] && $i == $today["mday"]) ? "todayHeader" : "header";
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td class='".$class."'><a href=\"../out/out.Calendar.php?mode=w&year=".($year)."&month=".($month)."&day=".($i)."\">".$i."</a></td>";
|
||||
echo "<td class='".$class."'><a href=\"../out/out.Calendar.php?mode=w&year=".($year)."&month=".($month)."&day=".($i)."\">".$dayNamesLong[$date["wday"]]."</a></td>";
|
||||
|
||||
if ($class=="todayHeader") $class="today";
|
||||
else $class="";
|
||||
|
||||
$xdate=mktime(0, 0, 0, $month, $i, $year);
|
||||
foreach ($events as $event){
|
||||
if (($event["start"]<=$xdate)&&($event["stop"]>=$xdate)){
|
||||
|
||||
if (strlen($event['name']) > 25) $event['name'] = substr($event['name'], 0, 22) . "...";
|
||||
print "<td class='".$class."'><a href=\"../out/out.ViewEvent.php?id=".$event['id']."\">".htmlspecialchars($event['name'])."</a></td>";
|
||||
}else{
|
||||
print "<td class='".$class."'> </td>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
}else{
|
||||
|
||||
if (!isset($dayNamesLong)) generateCalendarArrays();
|
||||
if (!isset($monthNames)) generateCalendarArrays();
|
||||
|
||||
// get the week interval - TODO: $GET
|
||||
$datestart=getdate(mktime(0,0,0,$month,$day,$year));
|
||||
while($datestart["wday"]!=$settings->_firstDayOfWeek){
|
||||
$datestart=getdate(mktime(0,0,0,$datestart["mon"],$datestart["mday"]-1,$datestart["year"]));
|
||||
}
|
||||
|
||||
$datestop=getdate(mktime(23,59,59,$month,$day,$year));
|
||||
if ($datestop["wday"]==$settings->_firstDayOfWeek){
|
||||
$datestop=getdate(mktime(23,59,59,$datestop["mon"],$datestop["mday"]+1,$datestop["year"]));
|
||||
}
|
||||
while($datestop["wday"]!=$settings->_firstDayOfWeek){
|
||||
$datestop=getdate(mktime(23,59,59,$datestop["mon"],$datestop["mday"]+1,$datestop["year"]));
|
||||
}
|
||||
$datestop=getdate(mktime(23,59,59,$datestop["mon"],$datestop["mday"]-1,$datestop["year"]));
|
||||
|
||||
$starttime=mktime(0,0,0,$datestart["mon"],$datestart["mday"],$datestart["year"]);
|
||||
$stoptime=mktime(23,59,59,$datestop["mon"],$datestop["mday"],$datestop["year"]);
|
||||
|
||||
$today = getdate(time());
|
||||
$events = getEventsInInterval($starttime,$stoptime);
|
||||
|
||||
UI::contentHeading(getMLText("week_view")." : ".getReadableDate(mktime(12, 0, 0, $month, $day, $year)));
|
||||
UI::contentContainerStart();
|
||||
|
||||
print "<a href=\"../out/out.Calendar.php?mode=w&year=".($year)."&month=".($month)."&day=".($day-7)."\"><img src=\"".UI::getImgPath("m.png")."\" border=0></a> ";
|
||||
print "<a href=\"../out/out.Calendar.php?mode=w\"><img src=\"".UI::getImgPath("c.png")."\" border=0></a> ";
|
||||
print "<a href=\"../out/out.Calendar.php?mode=w&year=".($year)."&month=".($month)."&day=".($day+7)."\"><img src=\"".UI::getImgPath("p.png")."\" border=0></a> ";
|
||||
|
||||
echo "<table class='calendarweek'>\n";
|
||||
|
||||
for ($i=$starttime; $i<$stoptime; $i += 86400){
|
||||
|
||||
$date = getdate($i);
|
||||
|
||||
// for daylight saving time TODO: could be better
|
||||
if ( ($i!=$starttime) && ($prev_day==$date["mday"]) ){
|
||||
$i += 3600;
|
||||
$date = getdate($i);
|
||||
}
|
||||
|
||||
// highlight today
|
||||
$class = ($date["year"] == $today["year"] && $date["mon"] == $today["mon"] && $date["mday"] == $today["mday"]) ? "todayHeader" : "header";
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td class='".$class."'>".getReadableDate($i)."</td>";
|
||||
echo "<td class='".$class."'>".$dayNamesLong[$date["wday"]]."</td>";
|
||||
|
||||
if ($class=="todayHeader") $class="today";
|
||||
else $class="";
|
||||
|
||||
foreach ($events as $event){
|
||||
if (($event["start"]<=$i)&&($event["stop"]>=$i)){
|
||||
print "<td class='".$class."'><a href=\"../out/out.ViewEvent.php?id=".$event['id']."\">".htmlspecialchars($event['name'])."</a></td>";
|
||||
}else{
|
||||
print "<td class='".$class."'> </td>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</tr>\n";
|
||||
|
||||
$prev_day=$date["mday"];
|
||||
}
|
||||
echo "</table>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user,'mode'=>$mode, 'year'=>$year, 'month'=>$month, 'day'=>$day, 'firstdayofweek'=>$settings->_firstDayOfWeek));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
||||
?>
|
||||
|
|
|
@ -28,125 +28,13 @@ if (!$user->isAdmin()) {
|
|||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("admin_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
|
||||
$categories = $dms->getDocumentCategories();
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
obj = -1;
|
||||
function showCategories(selectObj) {
|
||||
if (obj != -1)
|
||||
obj.style.display = "none";
|
||||
|
||||
id = selectObj.options[selectObj.selectedIndex].value;
|
||||
if (id == -1)
|
||||
return;
|
||||
|
||||
obj = document.getElementById("categories" + id);
|
||||
obj.style.display = "";
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'categories'=>$categories));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
|
||||
UI::contentHeading(getMLText("global_document_categories"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo getMLText("selection")?>:</td>
|
||||
<td>
|
||||
<select onchange="showCategories(this)" id="selector">
|
||||
<option value="-1"><?php echo getMLText("choose_category")?>
|
||||
<option value="0"><?php echo getMLText("new_document_category")?>
|
||||
|
||||
<?php
|
||||
|
||||
$selected=0;
|
||||
$count=2;
|
||||
foreach ($categories as $category) {
|
||||
|
||||
if (isset($_GET["categoryid"]) && $category->getID()==$_GET["categoryid"]) $selected=$count;
|
||||
print "<option value=\"".$category->getID()."\">" . htmlspecialchars($category->getName());
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
|
||||
<td id="categories0" style="display : none;">
|
||||
<form action="../op/op.Categories.php" method="post">
|
||||
<?php echo createHiddenFieldWithKey('addcategory'); ?>
|
||||
<input type="Hidden" name="action" value="addcategory">
|
||||
<?php printMLText("name");?> : <input name="name">
|
||||
<input type="Submit" value="<?php printMLText("new_document_category"); ?>">
|
||||
</form>
|
||||
</td>
|
||||
|
||||
<?php
|
||||
|
||||
foreach ($categories as $category) {
|
||||
|
||||
print "<td id=\"categories".$category->getID()."\" style=\"display : none;\">";
|
||||
?>
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php
|
||||
if(!$category->isUsed()) {
|
||||
?>
|
||||
<form style="display: inline-block;" method="post" action="../op/op.Categories.php" >
|
||||
<?php echo createHiddenFieldWithKey('removecategory'); ?>
|
||||
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
|
||||
<input type="Hidden" name="action" value="removecategory">
|
||||
<input value="<?php echo getMLText("rm_document_category")?>" type="submit">
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<p><?php echo getMLText('category_in_use') ?></p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php UI::contentSubHeading("");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo getMLText("name")?>:</td>
|
||||
<td>
|
||||
<form action="../op/op.Categories.php" method="post">
|
||||
<?php echo createHiddenFieldWithKey('editcategory'); ?>
|
||||
<input type="Hidden" name="action" value="editcategory">
|
||||
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
|
||||
<input name="name" value="<?php echo htmlspecialchars($category->getName()) ?>">
|
||||
<input type="Submit" value="<?php printMLText("save");?>">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr></table>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
sel = document.getElementById("selector");
|
||||
sel.selectedIndex=<?php print $selected ?>;
|
||||
showCategories(sel);
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -25,60 +25,13 @@ include("../inc/inc.Authentication.php");
|
|||
|
||||
$form = preg_replace('/[^A-Za-z0-9_]+/', '', $_GET["form"]);
|
||||
$selcats = preg_replace('/[^0-9,]+/', '', $_GET["cats"]);
|
||||
$categories = $dms->getDocumentCategories();
|
||||
|
||||
UI::htmlStartPage(getMLText("choose_target_category"));
|
||||
UI::globalBanner();
|
||||
UI::pageNavigation(getMLText("choose_target_category"));
|
||||
?>
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'categories'=>$categories, 'form'=>$form, 'selcats'=>$selcats));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
<script language="JavaScript">
|
||||
var targetName = opener.document.<?php echo $form?>.categoryname<?php print $form ?>;
|
||||
var targetID = opener.document.<?php echo $form?>.categoryid<?php print $form ?>;
|
||||
$(document).ready(function(){
|
||||
$('#getcategories').click(function(){
|
||||
// alert($('#keywordta option:selected').text());
|
||||
var value = '';
|
||||
$('#keywordta option:selected').each(function(){
|
||||
value += ' ' + $(this).text();
|
||||
});
|
||||
targetName.value = value;
|
||||
targetID.value = $('#keywordta').val();
|
||||
window.close();
|
||||
return true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
UI::contentContainerStart();
|
||||
$categories = $dms->getDocumentCategories();
|
||||
$selcatsarr = explode(',', $selcats);
|
||||
?>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" class="inputDescription"><?php echo getMLText("categories")?>:</td>
|
||||
<td>
|
||||
<select id="keywordta" size="5" style="min-width: 100px;" multiple>
|
||||
<?php
|
||||
foreach($categories as $category) {
|
||||
echo "<option value=\"".$category->getId()."\"";
|
||||
if(in_array($category->getID(), $selcatsarr))
|
||||
echo " selected";
|
||||
echo ">".htmlspecialchars($category->getName())."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="button" id='getcategories' value="<?php echo getMLText("accept")?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -22,39 +22,23 @@ include("../inc/inc.Settings.php");
|
|||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
|
||||
UI::htmlStartPage(getMLText("change_password"), "login");
|
||||
UI::globalBanner();
|
||||
UI::pageNavigation(getMLText("change_password"));
|
||||
?>
|
||||
if (isset($_REQUEST["referuri"]) && strlen($_REQUEST["referuri"])>0)
|
||||
$referui = $_REQUEST["referuri"];
|
||||
else
|
||||
$referui = '';
|
||||
|
||||
<?php UI::contentContainerStart(); ?>
|
||||
<form action="../op/op.ChangePassword.php" method="post" name="form1" onsubmit="return checkForm();">
|
||||
<?php
|
||||
if (isset($_REQUEST["referuri"]) && strlen($_REQUEST["referuri"])>0) {
|
||||
echo "<input type='hidden' name='referuri' value='".$_REQUEST["referuri"]."'/>";
|
||||
}
|
||||
if (isset($_REQUEST["hash"]) && strlen($_REQUEST["hash"])>0) {
|
||||
echo "<input type='hidden' name='hash' value='".$_REQUEST["hash"]."'/>";
|
||||
$hash = $_REQUEST["hash"];
|
||||
} else {
|
||||
header("Location: ../out/out.Login.php");
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td><?php printMLText("password");?></td>
|
||||
<td><input type="password" name="newpassword" id="password"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("password_repeat");?></td>
|
||||
<td><input type="password" name="newpasswordrepeat" id="passwordrepeat"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("submit_password") ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php UI::contentContainerEnd(); ?>
|
||||
<script language="JavaScript">document.form1.password.focus();</script>
|
||||
<p><a href="../out/out.Login.php"><?php echo getMLText("login"); ?></a></p>
|
||||
<?php
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'referui'=>$referui, 'hash'=>$hash));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
45
out/out.CreateIndex.php
Normal file
45
out/out.CreateIndex.php
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2010 Matteo Lucarelli
|
||||
// Copyright (C) 2011 Matteo Lucarelli
|
||||
// Copyright (C) 2011-2013 Uwe Steinmann
|
||||
//
|
||||
// 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.Version.php");
|
||||
include("../inc/inc.Settings.php");
|
||||
include("../inc/inc.DBInit.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"));
|
||||
}
|
||||
|
||||
if(!$settings->_enableFullSearch) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("fulltextsearch_disabled"));
|
||||
}
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'enablefullsearch'=>$settings->_enableFullSearch));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,195 +1,45 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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");
|
||||
//
|
||||
// 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.Language.php");
|
||||
include("../inc/inc.ClassUI.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"));
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("admin_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
|
||||
$categories = $dms->getAllUserKeywordCategories($user->getID());
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
obj = -1;
|
||||
function showKeywords(selectObj) {
|
||||
if (obj != -1)
|
||||
obj.style.display = "none";
|
||||
|
||||
id = selectObj.options[selectObj.selectedIndex].value;
|
||||
if (id == -1)
|
||||
return;
|
||||
|
||||
obj = document.getElementById("keywords" + id);
|
||||
obj.style.display = "";
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
|
||||
UI::contentHeading(getMLText("global_default_keywords"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo getMLText("selection")?>:</td>
|
||||
<td>
|
||||
<select onchange="showKeywords(this)" id="selector">
|
||||
<option value="-1"><?php echo getMLText("choose_category")?>
|
||||
<option value="0"><?php echo getMLText("new_default_keyword_category")?>
|
||||
|
||||
<?php
|
||||
|
||||
$selected=0;
|
||||
$count=2;
|
||||
foreach ($categories as $category) {
|
||||
|
||||
$owner = $category->getOwner();
|
||||
if ((!$user->isAdmin()) && ($owner->getID() != $user->getID())) continue;
|
||||
|
||||
if (isset($_GET["categoryid"]) && $category->getID()==$_GET["categoryid"]) $selected=$count;
|
||||
print "<option value=\"".$category->getID()."\">" . htmlspecialchars($category->getName());
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
if(isset($_GET['categoryid']))
|
||||
$selcategoryid = $_GET['categoryid'];
|
||||
else
|
||||
$selcategoryid = 0;
|
||||
|
||||
<td id="keywords0" style="display : none;">
|
||||
<form action="../op/op.DefaultKeywords.php" method="post">
|
||||
<?php echo createHiddenFieldWithKey('addcategory'); ?>
|
||||
<input type="Hidden" name="action" value="addcategory">
|
||||
<?php printMLText("name");?> : <input name="name">
|
||||
<input type="Submit" value="<?php printMLText("new_default_keyword_category"); ?>">
|
||||
</form>
|
||||
</td>
|
||||
|
||||
<?php
|
||||
|
||||
foreach ($categories as $category) {
|
||||
|
||||
$owner = $category->getOwner();
|
||||
if ((!$user->isAdmin()) && ($owner->getID() != $user->getID())) continue;
|
||||
|
||||
print "<td id=\"keywords".$category->getID()."\" style=\"display : none;\">";
|
||||
?>
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<form action="../op/op.DefaultKeywords.php" method="post">
|
||||
<?php echo createHiddenFieldWithKey('removecategory'); ?>
|
||||
<input type="Hidden" name="action" value="removecategory">
|
||||
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
|
||||
<input value="<?php printMLText("rm_default_keyword_category");?>" type="submit" title="<?php echo getMLText("delete")?>">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php UI::contentSubHeading("");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo getMLText("name")?>:</td>
|
||||
<td>
|
||||
<form action="../op/op.DefaultKeywords.php" method="post">
|
||||
<?php echo createHiddenFieldWithKey('editcategory'); ?>
|
||||
<input type="Hidden" name="action" value="editcategory">
|
||||
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
|
||||
<input name="name" value="<?php echo htmlspecialchars($category->getName()) ?>">
|
||||
<input type="Submit" value="<?php printMLText("save");?>">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php UI::contentSubHeading("");?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php echo getMLText("default_keywords")?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
$lists = $category->getKeywordLists();
|
||||
if (count($lists) == 0)
|
||||
print getMLText("no_default_keywords");
|
||||
else
|
||||
foreach ($lists as $list) {
|
||||
?>
|
||||
<form style="display: inline-block;" method="post" action="../op/op.DefaultKeywords.php" >
|
||||
<?php echo createHiddenFieldWithKey('editkeywords'); ?>
|
||||
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
|
||||
<input type="Hidden" name="keywordsid" value="<?php echo $list["id"]?>">
|
||||
<input type="Hidden" name="action" value="editkeywords">
|
||||
<input name="keywords" value="<?php echo htmlspecialchars($list["keywords"]) ?>">
|
||||
<input name="action" value="editkeywords" type="Image" src="images/save.gif" title="<?php echo getMLText("save")?>" style="border: 0px;">
|
||||
<!-- <input name="action" value="removekeywords" type="Image" src="images/del.gif" title="<?php echo getMLText("delete")?>" border="0"> -->
|
||||
</form>
|
||||
<form style="display: inline-block;" method="post" action="../op/op.DefaultKeywords.php" >
|
||||
<?php echo createHiddenFieldWithKey('removekeywords'); ?>
|
||||
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
|
||||
<input type="Hidden" name="keywordsid" value="<?php echo $list["id"]?>">
|
||||
<input type="Hidden" name="action" value="removekeywords">
|
||||
<input name="action" value="removekeywords" type="Image" src="images/del.gif" title="<?php echo getMLText("delete")?>" style="border: 0px;">
|
||||
</form>
|
||||
<br>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<form action="../op/op.DefaultKeywords.php" method="post">
|
||||
<?php echo createHiddenFieldWithKey('newkeywords'); ?>
|
||||
<td><input type="Submit" value="<?php printMLText("new_default_keywords");?>"></td>
|
||||
<td>
|
||||
<input type="Hidden" name="action" value="newkeywords">
|
||||
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
|
||||
<input name="keywords">
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr></table>
|
||||
|
||||
<script language="JavaScript">
|
||||
$categories = $dms->getAllUserKeywordCategories($user->getID());
|
||||
|
||||
sel = document.getElementById("selector");
|
||||
sel.selectedIndex=<?php print $selected ?>;
|
||||
showKeywords(sel);
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'categories'=>$categories, 'selcategoryid'=>$selcategoryid));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -25,264 +25,29 @@ include("../inc/inc.Language.php");
|
|||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
function printAccessModeSelection($defMode) {
|
||||
print "<select name=\"mode\">\n";
|
||||
print "\t<option value=\"".M_NONE."\"" . (($defMode == M_NONE) ? " selected" : "") . ">" . getMLText("access_mode_none") . "</option>\n";
|
||||
print "\t<option value=\"".M_READ."\"" . (($defMode == M_READ) ? " selected" : "") . ">" . getMLText("access_mode_read") . "</option>\n";
|
||||
print "\t<option value=\"".M_READWRITE."\"" . (($defMode == M_READWRITE) ? " selected" : "") . ">" . getMLText("access_mode_readwrite") . "</option>\n";
|
||||
print "\t<option value=\"".M_ALL."\"" . (($defMode == M_ALL) ? " selected" : "") . ">" . getMLText("access_mode_all") . "</option>\n";
|
||||
print "</select>\n";
|
||||
}
|
||||
|
||||
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"));
|
||||
}
|
||||
|
||||
$documentid = $_GET["documentid"];
|
||||
$document = $dms->getDocument($documentid);
|
||||
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
if ($document->getAccessMode($user) < M_ALL) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
$folder = $document->getFolder();
|
||||
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if ((document.form1.userid.options[document.form1.userid.selectedIndex].value == -1) &&
|
||||
(document.form1.groupid.options[document.form1.groupid.selectedIndex].value == -1))
|
||||
msg += "<?php printMLText("js_select_user_or_group");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
$allUsers = $dms->getAllUsers($settings->_sortUsersInList);
|
||||
|
||||
UI::contentHeading(getMLText("edit_document_access"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
if ($user->isAdmin()) {
|
||||
|
||||
UI::contentSubHeading(getMLText("set_owner"));
|
||||
?>
|
||||
<form action="../op/op.DocumentAccess.php">
|
||||
<?php echo createHiddenFieldWithKey('documentaccess'); ?>
|
||||
<input type="Hidden" name="action" value="setowner">
|
||||
<input type="Hidden" name="documentid" value="<?php print $documentid;?>">
|
||||
<?php printMLText("owner");?> : <select name="ownerid">
|
||||
<?php
|
||||
$owner = $document->getOwner();
|
||||
foreach ($allUsers as $currUser) {
|
||||
if ($currUser->isGuest())
|
||||
continue;
|
||||
print "<option value=\"".$currUser->getID()."\"";
|
||||
if ($currUser->getID() == $owner->getID())
|
||||
print " selected";
|
||||
print ">" . htmlspecialchars($currUser->getLogin() . " - " . $currUser->getFullname()) . "</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<input type="Submit" value="<?php printMLText("save")?>">
|
||||
</form>
|
||||
<?php
|
||||
|
||||
}
|
||||
UI::contentSubHeading(getMLText("access_inheritance"));
|
||||
|
||||
if ($document->inheritsAccess()) {
|
||||
printMLText("inherits_access_msg");
|
||||
?>
|
||||
<p>
|
||||
<form action="../op/op.DocumentAccess.php" style="display: inline-block;">
|
||||
<?php echo createHiddenFieldWithKey('documentaccess'); ?>
|
||||
<input type="hidden" name="documentid" value="<?php print $documentid;?>">
|
||||
<input type="hidden" name="action" value="notinherit">
|
||||
<input type="hidden" name="mode" value="copy">
|
||||
<input type="submit" value="<?php printMLText("inherits_access_copy_msg")?>">
|
||||
</form>
|
||||
<form action="../op/op.DocumentAccess.php" style="display: inline-block;">
|
||||
<?php echo createHiddenFieldWithKey('documentaccess'); ?>
|
||||
<input type="hidden" name="documentid" value="<?php print $documentid;?>">
|
||||
<input type="hidden" name="action" value="notinherit">
|
||||
<input type="hidden" name="mode" value="empty">
|
||||
<input type="submit" value="<?php printMLText("inherits_access_empty_msg")?>">
|
||||
</form>
|
||||
</p>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
<form action="../op/op.DocumentAccess.php">
|
||||
<?php echo createHiddenFieldWithKey('documentaccess'); ?>
|
||||
<input type="hidden" name="documentid" value="<?php print $documentid;?>">
|
||||
<input type="hidden" name="action" value="inherit">
|
||||
<input type="submit" value="<?php printMLText("does_not_inherit_access_msg")?>">
|
||||
</form>
|
||||
<?php
|
||||
|
||||
$accessList = $document->getAccessList();
|
||||
|
||||
UI::contentSubHeading(getMLText("default_access"));
|
||||
|
||||
?>
|
||||
<form action="../op/op.DocumentAccess.php">
|
||||
<?php echo createHiddenFieldWithKey('documentaccess'); ?>
|
||||
<input type="Hidden" name="documentid" value="<?php print $documentid;?>">
|
||||
<input type="Hidden" name="action" value="setdefault">
|
||||
<?php printAccessModeSelection($document->getDefaultAccess()); ?>
|
||||
<input type="Submit" value="<?php printMLText("save");?>">
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
UI::contentSubHeading(getMLText("edit_existing_access"));
|
||||
|
||||
if (count($accessList["users"]) != 0 || count($accessList["groups"]) != 0) {
|
||||
|
||||
print "<table class=\"defaultView\">";
|
||||
|
||||
/* memorїze users with access rights */
|
||||
$memusers = array();
|
||||
foreach ($accessList["users"] as $userAccess) {
|
||||
$userObj = $userAccess->getUser();
|
||||
$memusers[] = $userObj->getID();
|
||||
print "<tr>\n";
|
||||
print "<td><img src=\"images/usericon.gif\" class=\"mimeicon\"></td>\n";
|
||||
print "<td>". htmlspecialchars($userObj->getFullName()) . "</td>\n";
|
||||
print "<td>\n";
|
||||
print "<form action=\"../op/op.DocumentAccess.php\">\n";
|
||||
printAccessModeSelection($userAccess->getMode());
|
||||
print "</td>\n";
|
||||
print "<td><span class=\"actions\">\n";
|
||||
echo createHiddenFieldWithKey('documentaccess')."\n";
|
||||
print "<input type=\"Hidden\" name=\"documentid\" value=\"".$documentid."\">\n";
|
||||
print "<input type=\"Hidden\" name=\"action\" value=\"editaccess\">\n";
|
||||
print "<input type=\"Hidden\" name=\"userid\" value=\"".$userObj->getID()."\">\n";
|
||||
print "<input type=\"Image\" class=\"mimeicon\" src=\"images/save.gif\">".getMLText("save")." ";
|
||||
print "</span></td>\n";
|
||||
print "</form>\n";
|
||||
print "<td><span class=\"actions\">\n";
|
||||
print "<form action=\"../op/op.DocumentAccess.php\">\n";
|
||||
echo createHiddenFieldWithKey('documentaccess')."\n";
|
||||
print "<input type=\"Hidden\" name=\"documentid\" value=\"".$documentid."\">\n";
|
||||
print "<input type=\"Hidden\" name=\"action\" value=\"delaccess\">\n";
|
||||
print "<input type=\"Hidden\" name=\"userid\" value=\"".$userObj->getID()."\">\n";
|
||||
print "<input type=\"Image\" class=\"mimeicon\" src=\"images/del.gif\">".getMLText("delete")." ";
|
||||
print "</form>\n";
|
||||
print "<span></td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
/* memorize groups with access rights */
|
||||
$memgroups = array();
|
||||
foreach ($accessList["groups"] as $groupAccess) {
|
||||
$groupObj = $groupAccess->getGroup();
|
||||
$memgroups[] = $groupObj->getID();
|
||||
$mode = $groupAccess->getMode();
|
||||
print "<tr>";
|
||||
print "<td><img src=\"images/groupicon.gif\" class=\"mimeicon\"></td>";
|
||||
print "<td>". htmlspecialchars($groupObj->getName()) . "</td>";
|
||||
print "<form action=\"../op/op.DocumentAccess.php\">";
|
||||
print "<td>";
|
||||
printAccessModeSelection($groupAccess->getMode());
|
||||
print "</td>\n";
|
||||
print "<td><span class=\"actions\">\n";
|
||||
echo createHiddenFieldWithKey('documentaccess')."\n";
|
||||
print "<input type=\"Hidden\" name=\"documentid\" value=\"".$documentid."\">";
|
||||
print "<input type=\"Hidden\" name=\"action\" value=\"editaccess\">";
|
||||
print "<input type=\"Hidden\" name=\"groupid\" value=\"".$groupObj->getID()."\">";
|
||||
print "<input type=\"Image\" class=\"mimeicon\" src=\"images/save.gif\">".getMLText("save")." ";
|
||||
print "</span></td>\n";
|
||||
print "</form>";
|
||||
print "<td><span class=\"actions\">\n";
|
||||
print "<form action=\"../op/op.DocumentAccess.php\">\n";
|
||||
echo createHiddenFieldWithKey('documentaccess')."\n";
|
||||
print "<input type=\"Hidden\" name=\"documentid\" value=\"".$documentid."\">\n";
|
||||
print "<input type=\"Hidden\" name=\"action\" value=\"delaccess\">\n";
|
||||
print "<input type=\"Hidden\" name=\"groupid\" value=\"".$groupObj->getID()."\">\n";
|
||||
print "<input type=\"Image\" class=\"mimeicon\" src=\"images/del.gif\">".getMLText("delete")." ";
|
||||
print "</form>";
|
||||
print "</span></td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
print "</table><br>";
|
||||
}
|
||||
?>
|
||||
<form action="../op/op.DocumentAccess.php" name="form1" onsubmit="return checkForm();">
|
||||
<?php echo createHiddenFieldWithKey('documentaccess'); ?>
|
||||
<input type="Hidden" name="documentid" value="<?php print $documentid?>">
|
||||
<input type="Hidden" name="action" value="addaccess">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("user");?>:</td>
|
||||
<td>
|
||||
<select name="userid">
|
||||
<option value="-1"><?php printMLText("select_one");?></option>
|
||||
<?php
|
||||
foreach ($allUsers as $userObj) {
|
||||
if ($userObj->isGuest() || in_array($userObj->getID(), $memusers)) {
|
||||
continue;
|
||||
}
|
||||
print "<option value=\"".$userObj->getID()."\">" . htmlspecialchars($userObj->getLogin() . " - " . $userObj->getFullName()) . "</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("group");?>:</td>
|
||||
<td>
|
||||
<select name="groupid">
|
||||
<option value="-1"><?php printMLText("select_one");?></option>
|
||||
<?php
|
||||
$allGroups = $dms->getAllGroups();
|
||||
foreach ($allGroups as $groupObj) {
|
||||
if(in_array($groupObj->getID(), $memgroups))
|
||||
continue;
|
||||
print "<option value=\"".$groupObj->getID()."\">" . htmlspecialchars($groupObj->getName()) . "</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("access_mode");?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
printAccessModeSelection(M_READ);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("add");?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
$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->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -27,128 +27,13 @@ include("../inc/inc.Authentication.php");
|
|||
$folderid = intval($_GET["folderid"]);
|
||||
$form = preg_replace('/[^A-Za-z0-9_]+/', '', $_GET["form"]);
|
||||
|
||||
function getImgPath($img) {
|
||||
global $theme;
|
||||
|
||||
if ( is_file("../themes/$theme/images/$img") )
|
||||
{
|
||||
return "../themes/$theme/images/$img";
|
||||
}
|
||||
return "../out/images/$img";
|
||||
$folder = $dms->getFolder($folderid);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'form'=>$form));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
function printTree($path, $level = 0)
|
||||
{
|
||||
GLOBAL $user, $form;
|
||||
|
||||
$folder = $path[$level];
|
||||
$subFolders = LetoDMS_Core_DMS::filterAccess($folder->getSubFolders(), $user, M_READ);
|
||||
$documents = LetoDMS_Core_DMS::filterAccess($folder->getDocuments(), $user, M_READ);
|
||||
|
||||
if ($level+1 < count($path))
|
||||
$nextFolderID = $path[$level+1]->getID();
|
||||
else
|
||||
$nextFolderID = -1;
|
||||
|
||||
if ($level == 0) {
|
||||
print "<ul style='list-style-type: none;'>\n";
|
||||
}
|
||||
print " <li>\n";
|
||||
print "<img class='treeicon' src=\"";
|
||||
if ($level == 0) UI::printImgPath("minus.png");
|
||||
else if (count($subFolders) + count($documents) > 0) UI::printImgPath("minus.png");
|
||||
else UI::printImgPath("blank.png");
|
||||
print "\" border=0>\n";
|
||||
if ($folder->getAccessMode($user) >= M_READ) {
|
||||
print "<img src=\"".UI::getImgPath("folder_opened.gif")."\" border=0>".htmlspecialchars($folder->getName())."\n";
|
||||
}
|
||||
else
|
||||
print "<img src=\"".UI::getImgPath("folder_opened.gif")."\" width=18 height=18 border=0>".htmlspecialchars($folder->getName())."\n";
|
||||
print " </li>\n";
|
||||
|
||||
print "<ul style='list-style-type: none;'>";
|
||||
|
||||
for ($i = 0; $i < count($subFolders); $i++) {
|
||||
if ($subFolders[$i]->getID() == $nextFolderID)
|
||||
printTree($path, $level+1);
|
||||
else {
|
||||
print "<li>\n";
|
||||
$subFolders_ = LetoDMS_Core_DMS::filterAccess($subFolders[$i]->getSubFolders(), $user, M_READ);
|
||||
$documents_ = LetoDMS_Core_DMS::filterAccess($subFolders[$i]->getDocuments(), $user, M_READ);
|
||||
|
||||
if (count($subFolders_) + count($documents_) > 0)
|
||||
print "<a href=\"out.DocumentChooser.php?form=$form&folderid=".$subFolders[$i]->getID()."\"><img class='treeicon' src=\"".getImgPath("plus.png")."\" border=0></a>";
|
||||
else
|
||||
print "<img class='treeicon' src=\"".getImgPath("blank.png")."\">";
|
||||
print "<img src=\"".getImgPath("folder_closed.gif")."\" border=0>".htmlspecialchars($subFolders[$i]->getName())."\n";
|
||||
print "</li>";
|
||||
}
|
||||
}
|
||||
for ($i = 0; $i < count($documents); $i++) {
|
||||
print "<li>\n";
|
||||
print "<img class='treeicon' src=\"images/blank.png\">";
|
||||
print "<a class=\"foldertree_selectable\" href=\"javascript:documentSelected(".$documents[$i]->getID().",'".str_replace("'", "\\'", htmlspecialchars($documents[$i]->getName()))."');\"><img src=\"images/file.gif\" border=0>".htmlspecialchars($documents[$i]->getName())."</a>";
|
||||
print "</li>";
|
||||
}
|
||||
|
||||
print "</ul>\n";
|
||||
if ($level == 0) {
|
||||
print "</ul>\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("choose_target_document"));
|
||||
UI::globalBanner();
|
||||
UI::pageNavigation(getMLText("choose_target_document"));
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
function decodeString(s) {
|
||||
s = new String(s);
|
||||
s = s.replace(/&/, "&");
|
||||
s = s.replace(/%/, "%"); // percent
|
||||
s = s.replace(/"/, "\""); // double quote
|
||||
s = s.replace(//*/, "/*"); // start of comment
|
||||
s = s.replace(/*//, "*/"); // end of comment
|
||||
s = s.replace(/</, "<");
|
||||
s = s.replace(/>/, ">");
|
||||
s = s.replace(/=/, "=");
|
||||
s = s.replace(/)/, ")");
|
||||
s = s.replace(/(/, "(");
|
||||
s = s.replace(/'/, "'");
|
||||
s = s.replace(/+/, "+");
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
var targetName;
|
||||
var targetID;
|
||||
|
||||
function documentSelected(id, name) {
|
||||
targetName.value = name; //decodeString(name);
|
||||
targetID.value = id;
|
||||
window.close();
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
$folder = $dms->getFolder($folderid);
|
||||
echo "<input type=\"text\" class=\"autocomplete\" />";
|
||||
UI::contentContainerStart();
|
||||
echo "<div id=\"resultautocomplete\"></div>";
|
||||
UI::contentContainerEnd();
|
||||
UI::contentContainerStart();
|
||||
printTree($folder->getPath());
|
||||
UI::contentContainerEnd();
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
targetName = opener.document.<?php echo $form?>.docname<?php print $form ?>;
|
||||
targetID = opener.document.<?php echo $form?>.docid<?php print $form ?>;
|
||||
</script>
|
||||
|
||||
<?php
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,157 +1,51 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
}
|
||||
|
||||
$documentid = $_GET["documentid"];
|
||||
$document = $dms->getDocument($documentid);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
if ($document->getAccessMode($user) < M_READ) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$notifyList = $document->getNotifyList();
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
}
|
||||
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
if (!is_object($document)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
$folder = $document->getFolder();
|
||||
|
||||
if ($document->getAccessMode($user) < M_READ) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$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->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if ((document.form1.userid.options[document.form1.userid.selectedIndex].value == -1) &&
|
||||
(document.form1.groupid.options[document.form1.groupid.selectedIndex].value == -1))
|
||||
msg += "<?php printMLText("js_select_user_or_group");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
UI::contentHeading(getMLText("edit_existing_notify"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
$userNotifyIDs = array();
|
||||
$groupNotifyIDs = array();
|
||||
|
||||
print "<table class=\"defaultView\">\n";
|
||||
if ((count($notifyList["users"]) == 0) && (count($notifyList["groups"]) == 0)) {
|
||||
print "<tr><td>".getMLText("empty_notify_list")."</td></tr>";
|
||||
}
|
||||
else {
|
||||
foreach ($notifyList["users"] as $userNotify) {
|
||||
print "<tr>";
|
||||
print "<td><img src=\"images/usericon.gif\" class=\"mimeicon\"></td>";
|
||||
print "<td>" . htmlspecialchars($userNotify->getLogin() . " - " . $userNotify->getFullName()) . "</td>";
|
||||
if ($user->isAdmin() || $user->getID() == $userNotify->getID()) {
|
||||
print "<td><a href=\"../op/op.DocumentNotify.php?documentid=". $documentid . "&action=delnotify&userid=".$userNotify->getID()."\"><img src=\"images/del.gif\" class=\"mimeicon\"></a>".getMLText("delete")."</td>";
|
||||
}else print "<td></td>";
|
||||
print "</tr>";
|
||||
$userNotifyIDs[] = $userNotify->getID();
|
||||
}
|
||||
foreach ($notifyList["groups"] as $groupNotify) {
|
||||
print "<tr>";
|
||||
print "<td><img src=\"images/groupicon.gif\" width=16 height=16 border=0></td>";
|
||||
print "<td>" . htmlspecialchars($groupNotify->getName()) . "</td>";
|
||||
if ($user->isAdmin() || $groupNotify->isMember($user,true)) {
|
||||
print "<td><a href=\"../op/op.DocumentNotify.php?documentid=". $documentid . "&action=delnotify&groupid=".$groupNotify->getID()."\"><img src=\"images/del.gif\" class=\"mimeicon\"></a>".getMLText("delete")."</td>";
|
||||
}else print "<td></td>";
|
||||
print "</tr>";
|
||||
$groupNotifyIDs[] = $groupNotify->getID();
|
||||
}
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
?>
|
||||
<br>
|
||||
|
||||
<form action="../op/op.DocumentNotify.php" name="form1" onsubmit="return checkForm();">
|
||||
<input type="Hidden" name="documentid" value="<?php print $documentid?>">
|
||||
<input type="Hidden" name="action" value="addnotify">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("user");?>:</td>
|
||||
<td>
|
||||
<select name="userid">
|
||||
<option value="-1"><?php printMLText("select_one");?>
|
||||
<?php
|
||||
if ($user->isAdmin()) {
|
||||
$allUsers = $dms->getAllUsers($settings->_sortUsersInList);
|
||||
foreach ($allUsers as $userObj) {
|
||||
if (!$userObj->isGuest() && ($document->getAccessMode($userObj) >= M_READ) && !in_array($userObj->getID(), $userNotifyIDs))
|
||||
print "<option value=\"".$userObj->getID()."\">" . htmlspecialchars($userObj->getLogin() . " - " . $userObj->getFullName()) . "\n";
|
||||
}
|
||||
}
|
||||
elseif (!$user->isGuest() && !in_array($user->getID(), $userNotifyIDs)) {
|
||||
print "<option value=\"".$user->getID()."\">" . htmlspecialchars($user->getLogin() . " - " . $user->getFullName()) . "\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("group");?>:</td>
|
||||
<td>
|
||||
<select name="groupid">
|
||||
<option value="-1"><?php printMLText("select_one");?>
|
||||
<?php
|
||||
$allGroups = $dms->getAllGroups();
|
||||
foreach ($allGroups as $groupObj) {
|
||||
if (($user->isAdmin() || $groupObj->isMember($user,true)) && $document->getGroupAccessMode($groupObj) >= M_READ && !in_array($groupObj->getID(), $groupNotifyIDs)) {
|
||||
print "<option value=\"".$groupObj->getID()."\">" . htmlspecialchars($groupObj->getName()) . "\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("add") ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,277 +1,68 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
}
|
||||
|
||||
$documentid = $_GET["documentid"];
|
||||
$document = $dms->getDocument($documentid);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
if (!is_object($document)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
if ($document->getAccessMode($user) < M_READ) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!isset($_GET["version"]) || !is_numeric($_GET["version"]) || intval($_GET["version"])<1) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
$version = $_GET["version"];
|
||||
|
||||
$version = $_GET["version"];
|
||||
$version = $document->getContentByVersion($version);
|
||||
|
||||
if (!is_object($version)) {
|
||||
|
||||
if (!is_object($version)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
// if version is last got out.ViewDocument
|
||||
$latestContent = $document->getLatestContent();
|
||||
if ($latestContent->getVersion()==$version->getVersion()) {
|
||||
header("Location:../out/out.ViewDocument.php?documentid=".$documentid);
|
||||
}
|
||||
|
||||
$status = $version->getStatus();
|
||||
$reviewStatus = $version->getReviewStatus();
|
||||
$approvalStatus = $version->getApprovalStatus();
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
UI::contentHeading(getMLText("document_infos"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("owner");?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
$owner = $document->getOwner();
|
||||
print "<a class=\"infos\" href=\"mailto:".$owner->getEmail()."\">".htmlspecialchars($owner->getFullName())."</a>";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment");?>:</td>
|
||||
<td><?php print htmlspecialchars($document->getComment());?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("creation_date");?>:</td>
|
||||
<td><?php print getLongReadableDate($document->getDate()); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("keywords");?>:</td>
|
||||
<td><?php print htmlspecialchars($document->getKeywords());?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($document->isLocked()) {
|
||||
$lockingUser = $document->getLockingUser();
|
||||
?>
|
||||
<tr>
|
||||
<td><?php printMLText("lock_status");?>:</td>
|
||||
<td><?php printMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => htmlspecialchars($lockingUser->getFullName())));?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
|
||||
// verify if file exists
|
||||
$file_exists=file_exists($dms->contentDir . $version->getPath());
|
||||
|
||||
UI::contentHeading(getMLText("details_version", array ("version" => $version->getVersion())));
|
||||
UI::contentContainerStart();
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th width='10%'></th>\n";
|
||||
print "<th width='10%'>".getMLText("version")."</th>\n";
|
||||
print "<th width='20%'>".getMLText("file")."</th>\n";
|
||||
print "<th width='25%'>".getMLText("comment")."</th>\n";
|
||||
print "<th width='15%'>".getMLText("status")."</th>\n";
|
||||
print "<th width='20%'></th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
print "<tr>\n";
|
||||
print "<td><ul class=\"actions\">";
|
||||
|
||||
if ($file_exists){
|
||||
print "<li><a href=\"../op/op.Download.php?documentid=".$documentid."&version=".$version->getVersion()."\"><img class=\"mimeicon\" src=\"images/icons/".UI::getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\"> ".getMLText("download")."</a>";
|
||||
if ($settings->_viewOnlineFileTypes && in_array(strtolower($version->getFileType()), $settings->_viewOnlineFileTypes))
|
||||
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&version=".$version->getVersion()."\"><img src=\"images/view.gif\" class=\"mimeicon\">" . getMLText("view_online") . "</a>";
|
||||
}else print "<li><img class=\"mimeicon\" src=\"images/icons/".UI::getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\"> ";
|
||||
|
||||
print "</ul></td>\n";
|
||||
print "<td class=\"center\">".$version->getVersion()."</td>\n";
|
||||
|
||||
print "<td><ul class=\"documentDetail\">\n";
|
||||
print "<li>".$version->getOriginalFileName()."</li>\n";
|
||||
|
||||
if ($file_exists) print "<li>". formatted_size(filesize($dms->contentDir . $version->getPath())) ." ".htmlspecialchars($version->getMimeType())."</li>";
|
||||
else print "<li><span class=\"warning\">".getMLText("document_deleted")."</span></li>";
|
||||
|
||||
$updatingUser = $version->getUser();
|
||||
print "<li>".getMLText("uploaded_by")." <a href=\"mailto:".$updatingUser->getEmail()."\">".htmlspecialchars($updatingUser->getFullName())."</a></li>";
|
||||
print "<li>".getLongReadableDate($version->getDate())."</li>";
|
||||
print "</ul></td>\n";
|
||||
|
||||
print "<td>".htmlspecialchars($version->getComment())."</td>";
|
||||
print "<td>".getOverallStatusText($status["status"])."</td>";
|
||||
print "<td>";
|
||||
|
||||
//if (($document->getAccessMode($user) >= M_READWRITE)) {
|
||||
print "<ul class=\"actions\">";
|
||||
if (($settings->_enableVersionModification && ($document->getAccessMode($user) >= M_READWRITE)) || $user->isAdmin()) {
|
||||
print "<li><a href=\"out.RemoveVersion.php?documentid=".$documentid."&version=".$version->getVersion()."\">".getMLText("rm_version")."</a></li>";
|
||||
}
|
||||
if (($settings->_enableVersionModification && ($document->getAccessMode($user) == M_ALL)) || $user->isAdmin()) {
|
||||
if ( $status["status"]==S_RELEASED || $status["status"]==S_OBSOLETE ){
|
||||
print "<li><a href='../out/out.OverrideContentStatus.php?documentid=".$documentid."&version=".$version->getVersion()."'>".getMLText("change_status")."</a></li>";
|
||||
}
|
||||
}
|
||||
if (($settings->_enableVersionModification && ($document->getAccessMode($user) >= M_READWRITE)) || $user->isAdmin()) {
|
||||
if($status["status"] != S_OBSOLETE)
|
||||
print "<li><a href=\"out.EditComment.php?documentid=".$documentid."&version=".$version->getVersion()."\">".getMLText("edit_comment")."</a></li>";
|
||||
if ( $status["status"] == S_DRAFT_REV){
|
||||
print "<li><a href=\"out.EditAttributes.php?documentid=".$documentid."&version=".$latestContent->getVersion()."\">".getMLText("edit_attributes")."</a></li>";
|
||||
}
|
||||
print "</ul>";
|
||||
}
|
||||
else {
|
||||
print " ";
|
||||
}
|
||||
|
||||
echo "</td>";
|
||||
print "</tr></tbody>\n</table>\n";
|
||||
|
||||
|
||||
print "<table class=\"folderView\">\n";
|
||||
|
||||
if (is_array($reviewStatus) && count($reviewStatus)>0) {
|
||||
|
||||
print "<tr><td colspan=4>\n";
|
||||
UI::contentSubHeading(getMLText("reviewers"));
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td width='20%'><b>".getMLText("name")."</b></td>\n";
|
||||
print "<td width='20%'><b>".getMLText("last_update")."</b></td>\n";
|
||||
print "<td width='25%'><b>".getMLText("comment")."</b></td>";
|
||||
print "<td width='35%'><b>".getMLText("status")."</b></td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ($reviewStatus as $r) {
|
||||
$required = null;
|
||||
switch ($r["type"]) {
|
||||
case 0: // Reviewer is an individual.
|
||||
$required = $dms->getUser($r["required"]);
|
||||
if (!is_object($required)) {
|
||||
$reqName = getMLText("unknown_user")." '".$r["required"]."'";
|
||||
}
|
||||
else {
|
||||
$reqName = htmlspecialchars($required->getFullName());
|
||||
}
|
||||
break;
|
||||
case 1: // Reviewer is a group.
|
||||
$required = $dms->getGroup($r["required"]);
|
||||
if (!is_object($required)) {
|
||||
$reqName = getMLText("unknown_group")." '".$r["required"]."'";
|
||||
}
|
||||
else {
|
||||
$reqName = htmlspecialchars($required->getName());
|
||||
}
|
||||
break;
|
||||
}
|
||||
print "<tr>\n";
|
||||
print "<td>".$reqName."</td>\n";
|
||||
print "<td><ul class=\"documentDetail\"><li>".$r["date"]."</li>";
|
||||
$updateUser = $dms->getUser($r["userID"]);
|
||||
print "<li>".(is_object($updateUser) ? $updateUser->getFullName() : "unknown user id '".$r["userID"]."'")."</li></ul></td>";
|
||||
print "<td>".$r["comment"]."</td>\n";
|
||||
print "<td>".getReviewStatusText($r["status"])."</td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($approvalStatus) && count($approvalStatus)>0) {
|
||||
|
||||
print "<tr><td colspan=4>\n";
|
||||
UI::contentSubHeading(getMLText("approvers"));
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td width='20%'><b>".getMLText("name")."</b></td>\n";
|
||||
print "<td width='20%'><b>".getMLText("last_update")."</b></td>\n";
|
||||
print "<td width='25%'><b>".getMLText("comment")."</b></td>";
|
||||
print "<td width='35%'><b>".getMLText("status")."</b></td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ($approvalStatus as $a) {
|
||||
$required = null;
|
||||
switch ($a["type"]) {
|
||||
case 0: // Approver is an individual.
|
||||
$required = $dms->getUser($a["required"]);
|
||||
if (!is_object($required)) {
|
||||
$reqName = getMLText("unknown_user")." '".$r["required"]."'";
|
||||
}
|
||||
else {
|
||||
$reqName = htmlspecialchars($required->getFullName());
|
||||
}
|
||||
break;
|
||||
case 1: // Approver is a group.
|
||||
$required = $dms->getGroup($a["required"]);
|
||||
if (!is_object($required)) {
|
||||
$reqName = getMLText("unknown_group")." '".$r["required"]."'";
|
||||
}
|
||||
else {
|
||||
$reqName = htmlspecialchars($required->getName());
|
||||
}
|
||||
break;
|
||||
}
|
||||
print "<tr>\n";
|
||||
print "<td>".$reqName."</td>\n";
|
||||
print "<td><ul class=\"documentDetail\"><li>".$a["date"]."</li>";
|
||||
$updateUser = $dms->getUser($a["userID"]);
|
||||
print "<li>".(is_object($updateUser) ? htmlspecialchars($updateUser->getFullName()) : "unknown user id '".$a["userID"]."'")."</li></ul></td>";
|
||||
print "<td>".$a["comment"]."</td>\n";
|
||||
print "<td>".getApprovalStatusText($a["status"])."</td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
header("Location:../out/out.ViewDocument.php?documentid=".$document->getID());
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
$folder = $document->getFolder();
|
||||
|
||||
$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));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
36
out/out.DropFolderChooser.php
Normal file
36
out/out.DropFolderChooser.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2010-2013 Uwe Steinmann
|
||||
//
|
||||
// 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.ClassUI.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
$form = preg_replace('/[^A-Za-z0-9_]+/', '', $_GET["form"]);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'dropfolderdir'=>$settings->_dropFolderDir, 'dropfolderfile'=>$_GET["dropfolderfile"], 'form'=>$form));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
|
@ -28,54 +28,26 @@ include("../inc/inc.Authentication.php");
|
|||
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"));
|
||||
}
|
||||
$documentid = $_GET["documentid"];
|
||||
$document = $dms->getDocument($documentid);
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
$versionid = $_GET["version"];
|
||||
$version = $document->getContentByVersion($versionid);
|
||||
$version = $document->getContentByVersion($_GET["version"]);
|
||||
|
||||
if (!is_object($version)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
$folder = $document->getFolder();
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_documentcontent, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version, 'attrdefs'=>$attrdefs));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::contentHeading(getMLText("edit_attributes"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<form action="../op/op.EditAttributes.php" name="form1" method="POST">
|
||||
<?php echo createHiddenFieldWithKey('editattributes'); ?>
|
||||
<input type="Hidden" name="documentid" value="<?php print $documentid;?>">
|
||||
<input type="Hidden" name="version" value="<?php print $versionid;?>">
|
||||
<table cellpadding="3">
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_documentcontent, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||
<td><?php UI::printAttributeEditField($attrdef, $version->getAttributeValue($attrdef)) ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2"><br><input type="Submit" value="<?php printMLText("save") ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,95 +1,50 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
}
|
||||
$documentid = $_GET["documentid"];
|
||||
$document = $dms->getDocument($documentid);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.
|
||||
|
||||
$versionid = $_GET["version"];
|
||||
$version = $document->getContentByVersion($versionid);
|
||||
|
||||
if (!is_object($version)) {
|
||||
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.Authentication.php");
|
||||
|
||||
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"));
|
||||
}
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
if (!is_object($document)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
$version = $document->getContentByVersion($_GET["version"]);
|
||||
if (!is_object($version)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
$folder = $document->getFolder();
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
<?php
|
||||
if (isset($settings->_strictFormCheck) && $settings->_strictFormCheck) {
|
||||
?>
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
UI::contentHeading(getMLText("edit_comment"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<form action="../op/op.EditComment.php" name="form1" onsubmit="return checkForm();" method="POST">
|
||||
<?php echo createHiddenFieldWithKey('editcomment'); ?>
|
||||
<input type="Hidden" name="documentid" value="<?php print $documentid;?>">
|
||||
<input type="Hidden" name="version" value="<?php print $versionid;?>">
|
||||
<table cellpadding="3">
|
||||
<tr>
|
||||
<td valign="top" class="inputDescription"><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="4" cols="80"><?php print htmlspecialchars($version->getComment());?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><br><input type="Submit" value="<?php printMLText("save") ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
$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->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -27,110 +27,24 @@ include("../inc/inc.Authentication.php");
|
|||
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"));
|
||||
}
|
||||
$documentid = $_GET["documentid"];
|
||||
$document = $dms->getDocument($documentid);
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
if ($document->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
$folder = $document->getFolder();
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_document, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.name.value == "") msg += "<?php printMLText("js_no_name");?>\n";
|
||||
<?php
|
||||
if (isset($settings->_strictFormCheck) && $settings->_strictFormCheck) {
|
||||
?>
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
if (document.form1.keywords.value == "") msg += "<?php printMLText("js_no_keywords");?>\n";
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
$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->show();
|
||||
exit;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
UI::contentHeading(getMLText("edit_document_props"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<form action="../op/op.EditDocument.php" name="form1" onsubmit="return checkForm();" method="POST">
|
||||
<input type="hidden" name="documentid" value="<?php echo $documentid ?>">
|
||||
<table cellpadding="3">
|
||||
<tr>
|
||||
<td class="inputDescription"><?php printMLText("name");?>:</td>
|
||||
<td><input name="name" value="<?php print htmlspecialchars($document->getName());?>" size="60"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="inputDescription"><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="4" cols="80"><?php print htmlspecialchars($document->getComment());?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="inputDescription"><?php printMLText("keywords");?>:</td>
|
||||
<td class="standardText">
|
||||
<textarea name="keywords" rows="2" cols="80"><?php print htmlspecialchars($document->getKeywords());?></textarea><br>
|
||||
<a href="javascript:chooseKeywords('form1.keywords');"><?php printMLText("use_default_keywords");?></a>
|
||||
<script language="JavaScript">
|
||||
var openDlg;
|
||||
|
||||
function chooseKeywords(target) {
|
||||
openDlg = open("out.KeywordChooser.php?target="+target, "openDlg", "width=500,height=400,scrollbars=yes,resizable=yes");
|
||||
}
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("categories")?>:</td>
|
||||
<td><?php UI::printCategoryChooser("form1", $document->getCategories());?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($folder->getAccessMode($user) > M_READ)
|
||||
{
|
||||
print "<tr>";
|
||||
print "<td class=\"inputDescription\">" . getMLText("sequence") . ":</td>";
|
||||
print "<td>";
|
||||
UI::printSequenceChooser($folder->getDocuments(), $document->getID());
|
||||
print "</td></tr>";
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_document, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||
<td><?php UI::printAttributeEditField($attrdef, $document->getAttributeValue($attrdef)) ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2"><br><input type="Submit" value="<?php printMLText("save") ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,102 +1,50 @@
|
|||
<?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");
|
||||
<?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.Language.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Calendar.php");
|
||||
include("../inc/inc.Calendar.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if ($user->isGuest()) {
|
||||
UI::exitError(getMLText("edit_event"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (!isset($_GET["id"]) || !is_numeric($_GET["id"]) || intval($_GET["id"])<1) {
|
||||
UI::exitError(getMLText("edit_event"),getMLText("error_occured"));
|
||||
if (!isset($_GET["id"]) || !is_numeric($_GET["id"]) || intval($_GET["id"])<1) {
|
||||
UI::exitError(getMLText("edit_event"),getMLText("error_occured"));
|
||||
}
|
||||
|
||||
|
||||
$event=getEvent($_GET["id"]);
|
||||
|
||||
if (is_bool($event)&&!$event){
|
||||
UI::exitError(getMLText("edit_event"),getMLText("error_occured"));
|
||||
}
|
||||
if (($user->getID()!=$event["userID"])&&(!$user->isAdmin())){
|
||||
if (($user->getID()!=$event["userID"])&&(!$user->isAdmin())){
|
||||
UI::exitError(getMLText("edit_event"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("calendar"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("calendar"), "calendar");
|
||||
|
||||
UI::contentHeading(getMLText("edit_event"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.name.value == "") msg += "<?php printMLText("js_no_name");?>\n";
|
||||
<?php
|
||||
if (isset($settings->_strictFormCheck) && $settings->_strictFormCheck) {
|
||||
?>
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<form action="../op/op.EditEvent.php" name="form1" onsubmit="return checkForm();" method="POST">
|
||||
<?php echo createHiddenFieldWithKey('editevent'); ?>
|
||||
|
||||
<input type="Hidden" name="eventid" value="<?php echo (int) $_GET["id"]; ?>">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("from");?>:</td>
|
||||
<td><?php UI::printDateChooser($event["start"], "from");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("to");?>:</td>
|
||||
<td><?php UI::printDateChooser($event["stop"], "to");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="inputDescription"><?php printMLText("name");?>:</td>
|
||||
<td><input name="name" value="<?php echo htmlspecialchars($event["name"]);?>" size="60"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="inputDescription"><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="4" cols="80"><?php echo htmlspecialchars($event["comment"])?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><br><input type="Submit" value="<?php printMLText("edit_event");?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'event'=>$event, 'strictformcheck'=>$settings->_strictFormCheck));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,119 +1,49 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folderid = $_GET["folderid"];
|
||||
$folder = $dms->getFolder($folderid);
|
||||
|
||||
if (!is_object($folder)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folderPathHTML = getFolderPathHTML($folder, true);
|
||||
|
||||
if ($folder->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied"));
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folder = $dms->getFolder($_GET["folderid"]);
|
||||
if (!is_object($folder)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
if ($folder->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_folder, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'attrdefs'=>$attrdefs, 'strictformcheck'=>$settings->_strictFormCheck, 'rootfolderid'=>$settings->_rootFolderID));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($folderPathHTML, "view_folder", $folder);
|
||||
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.name.value == "") msg += "<?php printMLText("js_no_name");?>\n";
|
||||
<?php
|
||||
if (isset($settings->_strictFormCheck) && $settings->_strictFormCheck) {
|
||||
?>
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
UI::contentHeading(getMLText("edit_folder_props"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<form action="../op/op.EditFolder.php" name="form1" onsubmit="return checkForm();" method="POST">
|
||||
<input type="Hidden" name="folderid" value="<?php print $folderid;?>">
|
||||
<input type="Hidden" name="showtree" value="<?php echo showtree();?>">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("name");?>:</td>
|
||||
<td><input name="name" value="<?php print htmlspecialchars($folder->getName());?>" size="60"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="4" cols="80"><?php print htmlspecialchars($folder->getComment());?></textarea></td>
|
||||
</tr>
|
||||
<?php
|
||||
$parent = ($folder->getID() == $settings->_rootFolderID) ? false : $folder->getParent();
|
||||
if ($parent && $parent->getAccessMode($user) > M_READ) {
|
||||
print "<tr>";
|
||||
print "<td>" . getMLText("sequence") . ":</td>";
|
||||
print "<td>";
|
||||
UI::printSequenceChooser($parent->getSubFolders(), $folder->getID());
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_folder, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||
<td><?php UI::printAttributeEditField($attrdef, $folder->getAttributeValue($attrdef)) ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("save"); ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -32,97 +32,12 @@ if (!$user->isAdmin() && ($settings->_disableSelfEdit)) {
|
|||
UI::exitError(getMLText("edit_user_details"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("edit_user_details"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("my_account"), "my_account");
|
||||
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.pwd.value != document.form1.pwdconf.value) msg += "<?php printMLText("js_pwd_not_conf");?>\n";
|
||||
if (document.form1.fullname.value == "") msg += "<?php printMLText("js_no_name");?>\n";
|
||||
if (document.form1.email.value == "") msg += "<?php printMLText("js_no_email");?>\n";
|
||||
// if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'enableuserimage'=>$settings->_enableUserImage, 'passwordstrength'=>$settings->_passwordStrength, 'httproot'=>$settings->_httpRoot));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
UI::contentHeading(getMLText("edit_user_details"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<form action="../op/op.EditUserData.php" enctype="multipart/form-data" method="post" name="form1" onsubmit="return checkForm();">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("current_password");?>:</td>
|
||||
<td><input id="currentpwd" type="Password" name="currentpwd" size="30"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("new_password");?>:</td>
|
||||
<td><input id="pwd" type="Password" name="pwd" size="30"> <div id="outerstrength" style="min-width: 100px; height: 14px; display: inline-block; border: 1px solid black; padding: 1px;"><div id="innerstrength" style="width: 0px; height: 14px; display: inline-block; border: 0px; padding: 0px; background-color: red;"> </div> <div id="strength" style="display: inline-block;"></div></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("confirm_pwd");?>:</td>
|
||||
<td><input id="pwdconf" type="Password" name="pwdconf" size="30"></td>
|
||||
<script type="text/javascript" src='../js/jquery.passwordstrength.js'></script>
|
||||
<script>
|
||||
$(document).ready( function() {
|
||||
$("#pwd").passStrength({
|
||||
url: "../op/op.Ajax.php",
|
||||
minscore: <?php echo (int) $settings->_passwordStrength; ?>
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("name");?>:</td>
|
||||
<td><input name="fullname" value="<?php print htmlspecialchars($user->getFullName());?>" size="30"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("email");?>:</td>
|
||||
<td><input name="email" value="<?php print htmlspecialchars($user->getEmail());?>" size="30"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="4" cols="80"><?php print htmlspecialchars($user->getComment());?></textarea></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
if ($settings->_enableUserImage){
|
||||
?>
|
||||
<tr>
|
||||
<td><?php printMLText("user_image");?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($user->hasImage())
|
||||
print "<img src=\"".$settings->_httpRoot . "out/out.UserImage.php?userid=".$user->getId()."\">";
|
||||
else printMLText("no_user_image");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("new_user_image");?>:</td>
|
||||
<td><input type="file" name="userfile" accept="image/jpeg" size="30"></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("submit_userinfo") ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,280 +1,51 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.Utils.php");
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
function printAccessModeSelection($defMode) {
|
||||
print "<select name=\"mode\">\n";
|
||||
print "\t<option value=\"".M_NONE."\"" . (($defMode == M_NONE) ? " selected" : "") . ">" . getMLText("access_mode_none") . "\n";
|
||||
print "\t<option value=\"".M_READ."\"" . (($defMode == M_READ) ? " selected" : "") . ">" . getMLText("access_mode_read") . "\n";
|
||||
print "\t<option value=\"".M_READWRITE."\"" . (($defMode == M_READWRITE) ? " selected" : "") . ">" . getMLText("access_mode_readwrite") . "\n";
|
||||
print "\t<option value=\"".M_ALL."\"" . (($defMode == M_ALL) ? " selected" : "") . ">" . getMLText("access_mode_all") . "\n";
|
||||
print "</select>\n";
|
||||
}
|
||||
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
$folderid = $_GET["folderid"];
|
||||
$folder = $dms->getFolder($folderid);
|
||||
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
$folder = $dms->getFolder($_GET["folderid"]);
|
||||
|
||||
if (!is_object($folder)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folderPathHTML = getFolderPathHTML($folder, true);
|
||||
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
if ($folder->getAccessMode($user) < M_ALL) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($folderPathHTML, "view_folder", $folder);
|
||||
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if ((document.form1.userid.options[document.form1.userid.selectedIndex].value == -1) &&
|
||||
(document.form1.groupid.options[document.form1.groupid.selectedIndex].value == -1))
|
||||
msg += "<?php printMLText("js_select_user_or_group");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
$allUsers = $dms->getAllUsers();
|
||||
$allGroups = $dms->getAllGroups();
|
||||
|
||||
UI::contentHeading(getMLText("edit_folder_access"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
if ($user->isAdmin()) {
|
||||
|
||||
UI::contentSubHeading(getMLText("set_owner"));
|
||||
?>
|
||||
<form action="../op/op.FolderAccess.php">
|
||||
<?php echo createHiddenFieldWithKey('folderaccess'); ?>
|
||||
<input type="Hidden" name="action" value="setowner">
|
||||
<input type="Hidden" name="folderid" value="<?php print $folderid;?>">
|
||||
<?php printMLText("owner");?> : <select name="ownerid">
|
||||
<?php
|
||||
$owner = $folder->getOwner();
|
||||
foreach ($allUsers as $currUser) {
|
||||
if ($currUser->isGuest())
|
||||
continue;
|
||||
print "<option value=\"".$currUser->getID()."\"";
|
||||
if ($currUser->getID() == $owner->getID())
|
||||
print " selected";
|
||||
print ">" . htmlspecialchars($currUser->getLogin() . " - " . $currUser->getFullname()) . "</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<input type="Submit" value="<?php printMLText("save")?>">
|
||||
</form>
|
||||
<?php
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'allusers'=>$allUsers, 'allgroups'=>$allGroups, 'rootfolderid'=>$settings->_rootFolderID));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($folderid != $settings->_rootFolderID && $folder->getParent()){
|
||||
|
||||
UI::contentSubHeading(getMLText("access_inheritance"));
|
||||
|
||||
if ($folder->inheritsAccess()) {
|
||||
printMLText("inherits_access_msg");
|
||||
|
||||
?>
|
||||
<p>
|
||||
<form action="../op/op.FolderAccess.php" style="display: inline-block;">
|
||||
<?php echo createHiddenFieldWithKey('folderaccess'); ?>
|
||||
<input type="hidden" name="folderid" value="<?php print $folderid;?>">
|
||||
<input type="hidden" name="action" value="notinherit">
|
||||
<input type="hidden" name="mode" value="copy">
|
||||
<input type="submit" value="<?php printMLText("inherits_access_copy_msg")?>">
|
||||
</form>
|
||||
<form action="../op/op.FolderAccess.php" style="display: inline-block;">
|
||||
<?php echo createHiddenFieldWithKey('folderaccess'); ?>
|
||||
<input type="hidden" name="folderid" value="<?php print $folderid;?>">
|
||||
<input type="hidden" name="action" value="notinherit">
|
||||
<input type="hidden" name="mode" value="empty">
|
||||
<input type="submit" value="<?php printMLText("inherits_access_empty_msg")?>">
|
||||
</form>
|
||||
</p>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
<form action="../op/op.FolderAccess.php">
|
||||
<?php echo createHiddenFieldWithKey('folderaccess'); ?>
|
||||
<input type="hidden" name="folderid" value="<?php print $folderid;?>">
|
||||
<input type="hidden" name="action" value="inherit">
|
||||
<input type="submit" value="<?php printMLText("does_not_inherit_access_msg")?>">
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
|
||||
$accessList = $folder->getAccessList();
|
||||
|
||||
UI::contentSubHeading(getMLText("default_access"));
|
||||
?>
|
||||
<form action="../op/op.FolderAccess.php">
|
||||
<?php echo createHiddenFieldWithKey('folderaccess'); ?>
|
||||
<input type="Hidden" name="folderid" value="<?php print $folderid;?>">
|
||||
<input type="Hidden" name="action" value="setdefault">
|
||||
<?php printAccessModeSelection($folder->getDefaultAccess()); ?>
|
||||
<input type="Submit" value="<?php printMLText("save");?>">
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
UI::contentSubHeading(getMLText("edit_existing_access"));
|
||||
|
||||
if ((count($accessList["users"]) != 0) || (count($accessList["groups"]) != 0)) {
|
||||
|
||||
print "<table class=\"defaultView\">";
|
||||
|
||||
foreach ($accessList["users"] as $userAccess) {
|
||||
$userObj = $userAccess->getUser();
|
||||
print "<tr>\n";
|
||||
print "<td><img src=\"images/usericon.gif\" class=\"mimeicon\"></td>\n";
|
||||
print "<td>". htmlspecialchars($userObj->getFullName()) . "</td>\n";
|
||||
print "<form action=\"../op/op.FolderAccess.php\">\n";
|
||||
echo createHiddenFieldWithKey('folderaccess')."\n";
|
||||
print "<input type=\"Hidden\" name=\"folderid\" value=\"".$folderid."\">\n";
|
||||
print "<input type=\"Hidden\" name=\"action\" value=\"editaccess\">\n";
|
||||
print "<input type=\"Hidden\" name=\"userid\" value=\"".$userObj->getID()."\">\n";
|
||||
print "<td>\n";
|
||||
printAccessModeSelection($userAccess->getMode());
|
||||
print "</td>\n";
|
||||
print "<td><span class=\"actions\">\n";
|
||||
print "<input type=\"Image\" class=\"mimeicon\" src=\"images/save.gif\">".getMLText("save")." ";
|
||||
print "</span></td>\n";
|
||||
print "</form>\n";
|
||||
print "<td><span class=\"actions\">\n";
|
||||
print "<form action=\"../op/op.FolderAccess.php\">\n";
|
||||
echo createHiddenFieldWithKey('folderaccess')."\n";
|
||||
print "<input type=\"Hidden\" name=\"folderid\" value=\"".$folderid."\">\n";
|
||||
print "<input type=\"Hidden\" name=\"action\" value=\"delaccess\">\n";
|
||||
print "<input type=\"Hidden\" name=\"userid\" value=\"".$userObj->getID()."\">\n";
|
||||
print "<input type=\"Image\" class=\"mimeicon\" src=\"images/del.gif\">".getMLText("delete")." ";
|
||||
print "</form>\n";
|
||||
print "<span></td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
foreach ($accessList["groups"] as $groupAccess) {
|
||||
$groupObj = $groupAccess->getGroup();
|
||||
$mode = $groupAccess->getMode();
|
||||
print "<tr>";
|
||||
print "<td><img src=\"images/groupicon.gif\" class=\"mimeicon\"></td>";
|
||||
print "<td>". htmlspecialchars($groupObj->getName()) . "</td>";
|
||||
print "<form action=\"../op/op.FolderAccess.php\">";
|
||||
echo createHiddenFieldWithKey('folderaccess')."\n";
|
||||
print "<input type=\"Hidden\" name=\"folderid\" value=\"".$folderid."\">";
|
||||
print "<input type=\"Hidden\" name=\"action\" value=\"editaccess\">";
|
||||
print "<input type=\"Hidden\" name=\"groupid\" value=\"".$groupObj->getID()."\">";
|
||||
print "<td>";
|
||||
printAccessModeSelection($groupAccess->getMode());
|
||||
print "</td>\n";
|
||||
print "<td><span class=\"actions\">\n";
|
||||
print "<input type=\"Image\" class=\"mimeicon\" src=\"images/save.gif\">".getMLText("save")." ";
|
||||
print "</span></td>\n";
|
||||
print "</form>";
|
||||
print "<td><span class=\"actions\">\n";
|
||||
print "<form action=\"../op/op.FolderAccess.php\">\n";
|
||||
echo createHiddenFieldWithKey('folderaccess')."\n";
|
||||
print "<input type=\"Hidden\" name=\"folderid\" value=\"".$folderid."\">\n";
|
||||
print "<input type=\"Hidden\" name=\"action\" value=\"delaccess\">\n";
|
||||
print "<input type=\"Hidden\" name=\"groupid\" value=\"".$groupObj->getID()."\">\n";
|
||||
print "<input type=\"Image\" class=\"mimeicon\" src=\"images/del.gif\">".getMLText("delete")." ";
|
||||
print "</form>";
|
||||
print "</span></td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
print "</table><br>";
|
||||
}
|
||||
?>
|
||||
<form action="../op/op.FolderAccess.php" name="form1" onsubmit="return checkForm();">
|
||||
<?php echo createHiddenFieldWithKey('folderaccess'); ?>
|
||||
<input type="Hidden" name="folderid" value="<?php print $folderid?>">
|
||||
<input type="Hidden" name="action" value="addaccess">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("user");?>:</td>
|
||||
<td>
|
||||
<select name="userid">
|
||||
<option value="-1"><?php printMLText("select_one");?>
|
||||
<?php
|
||||
foreach ($allUsers as $userObj) {
|
||||
if ($userObj->isGuest()) {
|
||||
continue;
|
||||
}
|
||||
print "<option value=\"".$userObj->getID()."\">" . htmlspecialchars($userObj->getLogin() . " - " . $userObj->getFullName()) . "</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="inputDescription"><?php printMLText("group");?>:</td>
|
||||
<td>
|
||||
<select name="groupid">
|
||||
<option value="-1"><?php printMLText("select_one");?>
|
||||
<?php
|
||||
$allGroups = $dms->getAllGroups();
|
||||
foreach ($allGroups as $groupObj) {
|
||||
print "<option value=\"".$groupObj->getID()."\">" . htmlspecialchars($groupObj->getName()) . "\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="inputDescription"><?php printMLText("access_mode");?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
printAccessModeSelection(M_READ);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("add");?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -27,65 +27,11 @@ $form = preg_replace('/[^A-Za-z0-9_]+/', '', $_GET["form"]);
|
|||
$mode = intval($_GET["mode"]);
|
||||
$exclude = intval($_GET["exclude"]);
|
||||
|
||||
UI::htmlStartPage(getMLText("choose_target_folder"));
|
||||
UI::globalBanner();
|
||||
UI::pageNavigation(getMLText("choose_target_folder"));
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
function toggleTree(id){
|
||||
|
||||
obj = document.getElementById("tree" + id);
|
||||
|
||||
if ( obj.style.display == "none" ) obj.style.display = "";
|
||||
else obj.style.display = "none";
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'rootfolderid'=>$settings->_rootFolderID, 'form'=>$form, 'mode'=>$mode, 'exclude'=>$exclude));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
function decodeString(s) {
|
||||
s = new String(s);
|
||||
s = s.replace(/&/, "&");
|
||||
s = s.replace(/%/, "%"); // percent
|
||||
s = s.replace(/"/, "\""); // double quote
|
||||
s = s.replace(//*/, "/*"); // start of comment
|
||||
s = s.replace(/*//, "*/"); // end of comment
|
||||
s = s.replace(/</, "<");
|
||||
s = s.replace(/>/, ">");
|
||||
s = s.replace(/=/, "=");
|
||||
s = s.replace(/)/, ")");
|
||||
s = s.replace(/(/, "(");
|
||||
s = s.replace(/'/, "'");
|
||||
s = s.replace(/+/, "+");
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
var targetName;
|
||||
var targetID;
|
||||
|
||||
function folderSelected(id, name) {
|
||||
// targetName.value = decodeString(name);
|
||||
targetName.value = name;
|
||||
targetID.value = id;
|
||||
window.close();
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<?php
|
||||
UI::contentContainerStart();
|
||||
UI::printFoldersTree($mode, $exclude, $settings->_rootFolderID);
|
||||
UI::contentContainerEnd();
|
||||
?>
|
||||
|
||||
|
||||
<script language="JavaScript">
|
||||
targetName = opener.document.<?php echo $form?>.targetname<?php print $form ?>;
|
||||
targetID = opener.document.<?php echo $form?>.targetid<?php print $form ?>;
|
||||
</script>
|
||||
|
||||
<?php
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -28,146 +28,24 @@ include("../inc/inc.Authentication.php");
|
|||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
$folderid = intval($_GET["folderid"]);
|
||||
$folder = $dms->getFolder($folderid);
|
||||
$folder = $dms->getFolder($_GET["folderid"]);
|
||||
|
||||
if (!is_object($folder)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folderPathHTML = getFolderPathHTML($folder, true);
|
||||
|
||||
if ($folder->getAccessMode($user) < M_READ) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$notifyList = $folder->getNotifyList();
|
||||
$allUsers = $dms->getAllUsers($settings->_sortUsersInList);
|
||||
$allGroups = $dms->getAllGroups();
|
||||
|
||||
UI::htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($folderPathHTML, "view_folder", $folder);
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'allusers'=>$allUsers, 'allgroups'=>$allGroups, 'strictformcheck'=>$settings->_strictFormCheck));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if ((document.form1.userid.options[document.form1.userid.selectedIndex].value == -1) &&
|
||||
(document.form1.groupid.options[document.form1.groupid.selectedIndex].value == -1))
|
||||
msg += "<?php printMLText("js_select_user_or_group");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
UI::contentHeading(getMLText("edit_existing_notify"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
$userNotifyIDs = array();
|
||||
$groupNotifyIDs = array();
|
||||
|
||||
print "<table class=\"defaultView\">\n";
|
||||
if (empty($notifyList["users"]) && empty($notifyList["groups"])) {
|
||||
print "<tr><td>".getMLText("empty_notify_list")."</td></tr>";
|
||||
}
|
||||
else {
|
||||
foreach ($notifyList["users"] as $userNotify) {
|
||||
print "<tr>";
|
||||
print "<td><img src=\"images/usericon.gif\" class=\"mimeicon\"></td>";
|
||||
print "<td>" . htmlspecialchars($userNotify->getFullName()) . "</td>";
|
||||
if ($user->isAdmin() || $user->getID() == $userNotify->getID()) {
|
||||
print "<td>";
|
||||
print "<form action=\"../op/op.FolderNotify.php\" method=\"post\">\n";
|
||||
echo createHiddenFieldWithKey('foldernotify')."\n";
|
||||
print "<input type=\"Hidden\" name=\"folderid\" value=\"".$folderid."\">\n";
|
||||
print "<input type=\"Hidden\" name=\"action\" value=\"delnotify\">\n";
|
||||
print "<input type=\"Hidden\" name=\"userid\" value=\"".$userNotify->getID()."\">\n";
|
||||
print "<input type=\"Image\" class=\"mimeicon\" src=\"images/del.gif\">".getMLText("delete")." ";
|
||||
print "</form>\n";
|
||||
print "</td>";
|
||||
}else print "<td></td>";
|
||||
print "</tr>";
|
||||
$userNotifyIDs[] = $userNotify->getID();
|
||||
}
|
||||
|
||||
foreach ($notifyList["groups"] as $groupNotify) {
|
||||
print "<tr>";
|
||||
print "<td><img src=\"images/groupicon.gif\" class=\"mimeicon\"></td>";
|
||||
print "<td>" . htmlspecialchars($groupNotify->getName()) . "</td>";
|
||||
if ($user->isAdmin() || $groupNotify->isMember($user,true)) {
|
||||
print "<td>";
|
||||
print "<form action=\"../op/op.FolderNotify.php\" method=\"post\">\n";
|
||||
echo createHiddenFieldWithKey('foldernotify')."\n";
|
||||
print "<input type=\"Hidden\" name=\"folderid\" value=\"".$folderid."\">\n";
|
||||
print "<input type=\"Hidden\" name=\"action\" value=\"delnotify\">\n";
|
||||
print "<input type=\"Hidden\" name=\"groupid\" value=\"".$groupNotify->getID()."\">\n";
|
||||
print "<input type=\"Image\" class=\"mimeicon\" src=\"images/del.gif\">".getMLText("delete")." ";
|
||||
print "</form>\n";
|
||||
print "</td>";
|
||||
}else print "<td></td>";
|
||||
print "</tr>";
|
||||
$groupNotifyIDs[] = $groupNotify->getID();
|
||||
}
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
?>
|
||||
<br>
|
||||
<form action="../op/op.FolderNotify.php" method="post" name="form1" onsubmit="return checkForm();">
|
||||
<?php echo createHiddenFieldWithKey('foldernotify'); ?>
|
||||
<input type="Hidden" name="folderid" value="<?php print $folderid?>">
|
||||
<input type="Hidden" name="action" value="addnotify">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("user");?>:</td>
|
||||
<td>
|
||||
<select name="userid">
|
||||
<option value="-1"><?php printMLText("select_one");?>
|
||||
<?php
|
||||
if ($user->isAdmin()) {
|
||||
$allUsers = $dms->getAllUsers($settings->_sortUsersInList);
|
||||
foreach ($allUsers as $userObj) {
|
||||
if (!$userObj->isGuest() && ($folder->getAccessMode($userObj) >= M_READ) && !in_array($userObj->getID(), $userNotifyIDs))
|
||||
print "<option value=\"".$userObj->getID()."\">" . htmlspecialchars($userObj->getFullName()) . "\n";
|
||||
}
|
||||
}
|
||||
elseif (!$user->isGuest() && !in_array($user->getID(), $userNotifyIDs)) {
|
||||
print "<option value=\"".$user->getID()."\">" . htmlspecialchars($user->getFullName()) . "\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("group");?>:</td>
|
||||
<td>
|
||||
<select name="groupid">
|
||||
<option value="-1"><?php printMLText("select_one");?>
|
||||
<?php
|
||||
$allGroups = $dms->getAllGroups();
|
||||
foreach ($allGroups as $groupObj) {
|
||||
if (($user->isAdmin() || $groupObj->isMember($user,true)) && $folder->getGroupAccessMode($groupObj) >= M_READ && !in_array($groupObj->getID(), $groupNotifyIDs)) {
|
||||
print "<option value=\"".$groupObj->getID()."\">" . htmlspecialchars($groupObj->getName()) . "\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("add") ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -17,50 +17,11 @@ include("../inc/inc.Language.php");
|
|||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
UI::htmlStartPage(getMLText("sign_in"), "login");
|
||||
UI::globalBanner();
|
||||
echo "<h3>".getMLText('password_expiration')."</h3>";
|
||||
echo "<p>".getMLText('password_expiration_text')."</p>";
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<form action="../op/op.EditUserData.php" method="post" name="form1" onsubmit="return checkForm();">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("current_password");?>:</td>
|
||||
<td><input id="currentpwd" type="Password" name="currentpwd" size="30"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("password");?>:</td>
|
||||
<td><input id="pwd" type="Password" name="pwd" size="30"> <div id="outerstrength" style="min-width: 100px; height: 14px; display: inline-block; border: 1px solid black; padding: 1px;"><div id="innerstrength" style="width: 0px; height: 14px; display: inline-block; border: 0px; padding: 0px; background-color: red;"> </div> <div id="strength" style="display: inline-block;"></div></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("confirm_pwd");?>:</td>
|
||||
<td><input id="pwdconf" type="Password" name="pwdconf" size="30"></td>
|
||||
<script type="text/javascript" src='../js/jquery.passwordstrength.js'></script>
|
||||
<script>
|
||||
$(document).ready( function() {
|
||||
$("#pwd").passStrength({
|
||||
url: "../op/op.Ajax.php",
|
||||
minscore: <?php echo (int) $settings->_passwordStrength; ?>
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("submit_userinfo") ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="fullname" value="<?php print htmlspecialchars($user->getFullName());?>" />
|
||||
<input type="hidden" name="email" value="<?php print htmlspecialchars($user->getEmail());?>" />
|
||||
<input type="hidden" name="comment" value="<?php print htmlspecialchars($user->getComment());?>" />
|
||||
</form>
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'passwordstrength'=>$settings->_passwordStrength));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
$tmpfoot = array();
|
||||
$tmpfoot[] = "<a href=\"../op/op.Logout.php\">" . getMLText("logout") . "</a>\n";
|
||||
print "<p>";
|
||||
print implode(' | ', $tmpfoot);
|
||||
print "</p>\n";
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -30,229 +30,20 @@ if (!$user->isAdmin()) {
|
|||
}
|
||||
|
||||
$allUsers = $dms->getAllUsers($settings->_sortUsersInList);
|
||||
|
||||
if (is_bool($allUsers)) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"));
|
||||
}
|
||||
|
||||
$groups = $dms->getAllGroups();
|
||||
|
||||
if (is_bool($groups)) {
|
||||
$allGroups = $dms->getAllGroups();
|
||||
if (is_bool($allGroups)) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("admin_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
|
||||
function checkForm1(num) {
|
||||
msg = "";
|
||||
eval("var formObj = document.form" + num + "_1;");
|
||||
|
||||
if (formObj.name.value == "") msg += "<?php printMLText("js_no_name");?>\n";
|
||||
<?php
|
||||
if (isset($settings->_strictFormCheck) && $settings->_strictFormCheck) {
|
||||
?>
|
||||
if (formObj.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'allgroups'=>$allGroups, 'allusers'=>$allUsers, 'strictformcheck'=>$settings->_strictFormCheck));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
function checkForm2(num) {
|
||||
msg = "";
|
||||
eval("var formObj = document.form" + num + "_2;");
|
||||
|
||||
if (formObj.userid.options[formObj.userid.selectedIndex].value == -1) msg += "<?php printMLText("js_select_user");?>\n";
|
||||
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
obj = -1;
|
||||
function showUser(selectObj) {
|
||||
if (obj != -1)
|
||||
obj.style.display = "none";
|
||||
|
||||
id = selectObj.options[selectObj.selectedIndex].value;
|
||||
if (id == -1)
|
||||
return;
|
||||
|
||||
obj = document.getElementById("keywords" + id);
|
||||
obj.style.display = "";
|
||||
}
|
||||
|
||||
</script>
|
||||
<?php
|
||||
UI::contentHeading(getMLText("group_management"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<?php echo getMLText("selection")?>:<select onchange="showUser(this)" id="selector">
|
||||
<option value="-1"><?php echo getMLText("choose_group")?>
|
||||
<option value="0"><?php echo getMLText("add_group")?>
|
||||
<?php
|
||||
$selected=0;
|
||||
$count=2;
|
||||
foreach ($groups as $group) {
|
||||
|
||||
if (isset($_GET["groupid"]) && $group->getID()==$_GET["groupid"]) $selected=$count;
|
||||
print "<option value=\"".$group->getID()."\">" . htmlspecialchars($group->getName());
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
|
||||
<td id="keywords0" style="display : none;">
|
||||
|
||||
<form action="../op/op.GroupMgr.php" name="form0_1" method="post" onsubmit="return checkForm1('0');">
|
||||
<?php echo createHiddenFieldWithKey('addgroup'); ?>
|
||||
<input type="Hidden" name="action" value="addgroup">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("name");?>:</td>
|
||||
<td><input name="name"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="4" cols="50"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("add_group");?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
</td>
|
||||
|
||||
<?php
|
||||
|
||||
foreach ($groups as $group) {
|
||||
|
||||
print "<td id=\"keywords".$group->getID()."\" style=\"display : none;\">";
|
||||
|
||||
UI::contentSubHeading(getMLText("group")." : ".htmlspecialchars($group->getName()));
|
||||
|
||||
?>
|
||||
|
||||
<a href="../out/out.RemoveGroup.php?groupid=<?php print $group->getID();?>"><img src="images/del.gif" width="15" height="15" border="0" align="absmiddle" alt=""> <?php printMLText("rm_group");?></a>
|
||||
|
||||
|
||||
<?php UI::contentSubHeading(getMLText("edit_group"));?>
|
||||
|
||||
|
||||
<form action="../op/op.GroupMgr.php" name="form<?php print $group->getID();?>_1" method="post" onsubmit="return checkForm1('<?php print $group->getID();?>');">
|
||||
<?php echo createHiddenFieldWithKey('editgroup'); ?>
|
||||
<input type="Hidden" name="groupid" value="<?php print $group->getID();?>">
|
||||
<input type="Hidden" name="action" value="editgroup">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("name");?>:</td>
|
||||
<td><input name="name" value="<?php print htmlspecialchars($group->getName());?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="4" cols="50"><?php print htmlspecialchars($group->getComment());?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("save");?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentSubHeading(getMLText("group_members"));
|
||||
?>
|
||||
<table class="folderView">
|
||||
<?php
|
||||
$members = $group->getUsers();
|
||||
if (count($members) == 0)
|
||||
print "<tr><td>".getMLText("no_group_members")."</td></tr>";
|
||||
else {
|
||||
|
||||
foreach ($members as $member) {
|
||||
|
||||
print "<tr>";
|
||||
print "<td><img src=\"images/usericon.gif\" width=16 height=16></td>";
|
||||
print "<td>" . htmlspecialchars($member->getFullName()) . "</td>";
|
||||
print "<td>" . ($group->isMember($member,true)?getMLText("manager"):" ") . "</td>";
|
||||
print "<td align=\"right\"><ul class=\"actions\">";
|
||||
print "<li><form action=\"../op/op.GroupMgr.php\" method=\"post\"><input type=\"hidden\" name=\"action\" value=\"rmmember\" /><input type=\"hidden\" name=\"groupid\" value=\"".$group->getID()."\" /><input type=\"hidden\" name=\"userid\" value=\"".$member->getID()."\" />".createHiddenFieldWithKey('rmmember')."<input type=\"submit\" value=\"".getMLText("delete")."\" /></form>";
|
||||
print "<li><form action=\"../op/op.GroupMgr.php\" method=\"post\"><input type=\"hidden\" name=\"groupid\" value=\"".$group->getID()."\" /><input type=\"hidden\" name=\"action\" value=\"tmanager\" /><input type=\"hidden\" name=\"userid\" value=\"".$member->getID()."\" />".createHiddenFieldWithKey('tmanager')."<input type=\"submit\" value=\"".getMLText("toggle_manager")."\" /></form>";
|
||||
print "</td></tr>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
UI::contentSubHeading(getMLText("add_member"));
|
||||
|
||||
?>
|
||||
|
||||
<form action="../op/op.GroupMgr.php" method="POST" name="form<?php print $group->getID();?>_2" onsubmit="return checkForm2('<?php print $group->getID();?>');">
|
||||
<?php echo createHiddenFieldWithKey('addmember'); ?>
|
||||
<input type="Hidden" name="action" value="addmember">
|
||||
<input type="Hidden" name="groupid" value="<?php print $group->getID();?>">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td>
|
||||
<select name="userid">
|
||||
<option value="-1"><?php printMLText("select_one");?>
|
||||
<?php
|
||||
foreach ($allUsers as $currUser)
|
||||
if (!$group->isMember($currUser))
|
||||
print "<option value=\"".$currUser->getID()."\">" . htmlspecialchars($currUser->getLogin()." - ".$currUser->getFullName()) . "\n";
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="manager" value="1"><?php printMLText("manager");?>
|
||||
</td>
|
||||
<td align="right">
|
||||
<input type="Submit" value="<?php printMLText("add");?>">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
<?php } ?>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
sel = document.getElementById("selector");
|
||||
sel.selectedIndex=<?php print $selected ?>;
|
||||
showUser(sel);
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,107 +1,50 @@
|
|||
<?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");
|
||||
<?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.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if ($user->isGuest()) {
|
||||
UI::exitError(getMLText("my_account"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (!$settings->_enableUsersView) {
|
||||
UI::exitError(getMLText("my_account"),getMLText("access_denied"));
|
||||
UI::exitError(getMLText("my_account"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
|
||||
$allUsers = $dms->getAllUsers();
|
||||
|
||||
if (is_bool($allUsers)) {
|
||||
UI::exitError(getMLText("my_account"),getMLText("internal_error"));
|
||||
}
|
||||
|
||||
$groups = $dms->getAllGroups();
|
||||
|
||||
if (is_bool($groups)) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("my_account"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("my_account"), "my_account");
|
||||
|
||||
UI::contentHeading(getMLText("groups"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
echo "<ul class=\"groupView\">\n";
|
||||
$users = $dms->getAllUsers();
|
||||
|
||||
foreach ($groups as $group){
|
||||
|
||||
$members = $group->getUsers();
|
||||
$managers = $group->getManagers();
|
||||
$ismanager = false; /* set to true if current user is manager */
|
||||
|
||||
echo "<li>".htmlspecialchars($group->getName());
|
||||
if($group->getComment())
|
||||
echo " : ".htmlspecialchars($group->getComment());
|
||||
foreach($managers as $manager)
|
||||
if($manager->getId() == $user->getId()) {
|
||||
echo " : you are the manager of this group";
|
||||
$ismanager = true;
|
||||
}
|
||||
echo "</li>";
|
||||
|
||||
echo "<ul>\n";
|
||||
$memberids = array();
|
||||
foreach ($members as $member) {
|
||||
$memberids[] = $member->getId();
|
||||
|
||||
echo "<li>".htmlspecialchars($member->getFullName());
|
||||
if ($member->getEmail()!="")
|
||||
echo " (<a href=\"mailto:".htmlspecialchars($member->getEmail())."\">".htmlspecialchars($member->getEmail())."</a>)";
|
||||
foreach($managers as $manager)
|
||||
if($manager->getId() == $member->getId())
|
||||
echo ", ".getMLText("manager");
|
||||
if($ismanager) {
|
||||
echo ' <a href="../op/op.GroupView.php?action=del&groupid='.$group->getId().'&userid='.$member->getId().'"><img src="images/del.gif" width="15" height="15" border="0" align="absmiddle" alt=""> '.getMLText("rm_user").'</a>';
|
||||
}
|
||||
echo "</li>";
|
||||
}
|
||||
if($ismanager) {
|
||||
echo "<li>".getMLText("add_user_to_group").":";
|
||||
echo "<form action=\"../op/op.GroupView.php\">";
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"add\" /><input type=\"hidden\" name=\"groupid\" value=\"".$group->getId()."\" />";
|
||||
echo "<select name=\"userid\" onChange=\"javascript: submit();\">";
|
||||
echo "<option value=\"\"></option>";
|
||||
foreach($users as $u) {
|
||||
if(!$u->isAdmin() && !$u->isGuest() && !in_array($u->getId(), $memberids))
|
||||
echo "<option value=\"".$u->getId()."\">".htmlspecialchars($u->getFullName())."</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "</form>";
|
||||
echo "</li>";
|
||||
}
|
||||
echo "</ul>\n";
|
||||
UI::exitError(getMLText("my_account"),getMLText("internal_error"));
|
||||
}
|
||||
echo "</ul>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
$allGroups = $dms->getAllGroups();
|
||||
if (is_bool($allGroups)) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"));
|
||||
}
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'allusers'=>$allUsers, 'allgroups'=>$allGroups));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,35 +1,32 @@
|
|||
<?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");
|
||||
<?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.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
UI::htmlStartPage(getMLText("help"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("help"), "");
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::contentContainerStart();
|
||||
|
||||
readfile("../languages/".$user->getLanguage()."/help.htm");
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -30,42 +30,25 @@ if (!$user->isAdmin()) {
|
|||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$v = new LetoDMS_Version;
|
||||
|
||||
UI::htmlStartPage(getMLText('fulltext_info'));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText('fulltext_info'));
|
||||
UI::contentContainerStart();
|
||||
if($settings->_enableFullSearch) {
|
||||
if(!empty($settings->_luceneClassDir))
|
||||
require_once($settings->_luceneClassDir.'/Lucene.php');
|
||||
else
|
||||
require_once('LetoDMS/Lucene.php');
|
||||
|
||||
$index = LetoDMS_Lucene_Indexer::open($settings->_luceneDir);
|
||||
|
||||
$numDocs = $index->count();
|
||||
echo "<pre>";
|
||||
for ($id = 0; $id < $numDocs; $id++) {
|
||||
if (!$index->isDeleted($id)) {
|
||||
$hit = $index->getDocument($id);
|
||||
echo $hit->document_id.": ".htmlspecialchars($hit->title)."\n";
|
||||
}
|
||||
}
|
||||
echo "</pre>";
|
||||
|
||||
|
||||
|
||||
$terms = $index->terms();
|
||||
echo "<p>".count($terms)." Terms</p>";
|
||||
echo "<pre>";
|
||||
foreach($terms as $term) {
|
||||
echo $term->field.":".$term->text."\n";
|
||||
}
|
||||
echo "</pre>";
|
||||
} else {
|
||||
printMLText("fulltextsearch_disabled");
|
||||
if(!$settings->_enableFullSearch) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("fulltextsearch_disabled"));
|
||||
}
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
|
||||
if(!empty($settings->_luceneClassDir))
|
||||
require_once($settings->_luceneClassDir.'/Lucene.php');
|
||||
else
|
||||
require_once('LetoDMS/Lucene.php');
|
||||
|
||||
$index = LetoDMS_Lucene_Indexer::open($settings->_luceneDir);
|
||||
if(!$index) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("no_fulltextindex"));
|
||||
}
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'luceneclassdir'=>$settings->_luceneClassDir, 'lucenedir'=>$settings->_luceneDir, 'index'=>$index));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2010 Matteo Lucarelli
|
||||
// Copyright (C) 2011 Matteo Lucarelli
|
||||
// Copyright (C) 2011-2013 Uwe Steinmann
|
||||
//
|
||||
// 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
|
||||
|
@ -26,103 +27,43 @@ include("../inc/inc.Language.php");
|
|||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
function tree($folder, $indent='') { /* {{{ */
|
||||
global $index, $dms;
|
||||
echo $indent."D ".htmlspecialchars($folder->getName())."\n";
|
||||
$subfolders = $folder->getSubFolders();
|
||||
foreach($subfolders as $subfolder) {
|
||||
tree($subfolder, $indent.' ');
|
||||
}
|
||||
$documents = $folder->getDocuments();
|
||||
foreach($documents as $document) {
|
||||
echo $indent." ".$document->getId().":".htmlspecialchars($document->getName())." ";
|
||||
/* If the document wasn't indexed before then just add it */
|
||||
if(!($hits = $index->find('document_id:'.$document->getId()))) {
|
||||
$index->addDocument(new LetoDMS_Lucene_IndexedDocument($dms, $document, $settings->_convcmd ? $settings->_convcmd : null));
|
||||
echo "(document added)";
|
||||
} else {
|
||||
$hit = $hits[0];
|
||||
/* Check if the attribute created is set or has a value older
|
||||
* than the lasted content. Documents without such an attribute
|
||||
* where added when a new document was added to the dms. In such
|
||||
* a case the document content wasn't indexed.
|
||||
*/
|
||||
try {
|
||||
$created = (int) $hit->getDocument()->getFieldValue('created');
|
||||
} catch (Zend_Search_Lucene_Exception $e) {
|
||||
$created = 0;
|
||||
}
|
||||
$content = $document->getLatestContent();
|
||||
if($created >= $content->getDate()) {
|
||||
echo $indent."(document unchanged)";
|
||||
} else {
|
||||
if($index->delete($hit->id)) {
|
||||
$index->addDocument(new LetoDMS_Lucene_IndexedDocument($dms, $document, $settings->_convcmd ? $settings->_convcmd : null));
|
||||
}
|
||||
echo $indent."(document updated)";
|
||||
}
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$v = new LetoDMS_Version;
|
||||
|
||||
UI::htmlStartPage($v->banner());
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation($v->banner());
|
||||
UI::contentContainerStart();
|
||||
if($settings->_enableFullSearch) {
|
||||
if(!empty($settings->_luceneClassDir))
|
||||
require_once($settings->_luceneClassDir.'/Lucene.php');
|
||||
else
|
||||
require_once('LetoDMS/Lucene.php');
|
||||
|
||||
if(isset($_GET['create']) && $_GET['create'] == 1) {
|
||||
if(isset($_GET['confirm']) && $_GET['confirm'] == 1) {
|
||||
echo "<p>Recreating index</p>";
|
||||
$index = LetoDMS_Lucene_Indexer::create($settings->_luceneDir);
|
||||
LetoDMS_Lucene_Indexer::init($settings->_stopWordsFile);
|
||||
// $index = Zend_Search_Lucene::create($settings->_luceneDir);
|
||||
} else {
|
||||
echo '<p>'.getMLText('create_fulltext_index_warning').'</p>';
|
||||
echo '<a href="out.Indexer.php?create=1&confirm=1">'.getMLText('confirm_create_fulltext_index').'</a>';
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
echo "<p>Updating index</p>";
|
||||
$index = LetoDMS_Lucene_Indexer::open($settings->_luceneDir);
|
||||
LetoDMS_Lucene_Indexer::init($settings->_stopWordsFile);
|
||||
// $index = Zend_Search_Lucene::open($settings->_luceneDir);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
$analyzer = new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive();
|
||||
if($settings->_stopWordsFile && file_exists($settings->_stopWordsFile)) {
|
||||
$stopWordsFilter = new Zend_Search_Lucene_Analysis_TokenFilter_StopWords();
|
||||
$stopWordsFilter->loadFromFile($settings->_stopWordsFile);
|
||||
$analyzer->addFilter($stopWordsFilter);
|
||||
}
|
||||
|
||||
Zend_Search_Lucene_Analysis_Analyzer::setDefault($analyzer);
|
||||
*/
|
||||
|
||||
$folder = $dms->getFolder($settings->_rootFolderID);
|
||||
echo "<pre>";
|
||||
tree($folder);
|
||||
echo "</pre>";
|
||||
|
||||
$index->commit();
|
||||
} else {
|
||||
printMLText("fulltextsearch_disabled");
|
||||
if(!$settings->_enableFullSearch) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("fulltextsearch_disabled"));
|
||||
}
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
|
||||
if(!empty($settings->_luceneClassDir))
|
||||
require_once($settings->_luceneClassDir.'/Lucene.php');
|
||||
else
|
||||
require_once('LetoDMS/Lucene.php');
|
||||
|
||||
if(isset($_GET['create']) && $_GET['create'] == 1) {
|
||||
if(isset($_GET['confirm']) && $_GET['confirm'] == 1) {
|
||||
$index = LetoDMS_Lucene_Indexer::create($settings->_luceneDir);
|
||||
LetoDMS_Lucene_Indexer::init($settings->_stopWordsFile);
|
||||
} else {
|
||||
header('Location: out.CreateIndex.php');
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$index = LetoDMS_Lucene_Indexer::open($settings->_luceneDir);
|
||||
if(!$index) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("no_fulltextindex"));
|
||||
}
|
||||
echo "<p>Updating index</p>";
|
||||
LetoDMS_Lucene_Indexer::init($settings->_stopWordsFile);
|
||||
}
|
||||
|
||||
$folder = $dms->getFolder($settings->_rootFolderID);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'index'=>$index, 'recreate'=>(isset($_GET['create']) && $_GET['create']==1), 'folder'=>$folder));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.
|
||||
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.Version.php");
|
||||
include("../inc/inc.Settings.php");
|
||||
include("../inc/inc.Settings.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.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"));
|
||||
}
|
||||
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$v = new LetoDMS_Version;
|
||||
|
||||
UI::htmlStartPage($v->banner());
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation($v->banner());
|
||||
UI::contentContainerStart();
|
||||
phpinfo();
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'version'=>$v));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -38,191 +38,12 @@ if($_GET['target']) {
|
|||
} else {
|
||||
$target = 'form1';
|
||||
}
|
||||
UI::htmlStartPage(getMLText("use_default_keywords"));
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<script language="JavaScript">
|
||||
var targetObj = opener.document.<?php echo $target ?>;
|
||||
var myTA;
|
||||
|
||||
|
||||
function insertKeywords(keywords) {
|
||||
|
||||
if (navigator.appName == "Microsoft Internet Explorer") {
|
||||
myTA.value += " " + keywords;
|
||||
}
|
||||
//assuming Mozilla
|
||||
else {
|
||||
selStart = myTA.selectionStart;
|
||||
|
||||
myTA.value = myTA.value.substring(0,myTA.selectionStart) + " "
|
||||
+ keywords
|
||||
+ myTA.value.substring(myTA.selectionStart,myTA.value.length);
|
||||
|
||||
myTA.selectionStart = selStart + keywords.length+1;
|
||||
myTA.selectionEnd = selStart + keywords.length+1;
|
||||
}
|
||||
myTA.focus();
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'categories'=>$categories, 'form'=>$target));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
window.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
function acceptKeywords() {
|
||||
targetObj.value = myTA.value;
|
||||
window.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
obj = new Array();
|
||||
obj[0] = -1;
|
||||
obj[1] = -1;
|
||||
function showKeywords(which) {
|
||||
if (obj[which] != -1)
|
||||
obj[which].style.display = "none";
|
||||
|
||||
list = document.getElementById("categories" + which);
|
||||
|
||||
id = list.options[list.selectedIndex].value;
|
||||
if (id == -1)
|
||||
return;
|
||||
|
||||
obj[which] = document.getElementById("keywords" + id);
|
||||
obj[which].style.display = "";
|
||||
}
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<?php
|
||||
UI::contentHeading(getMLText("use_default_keywords"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td valign="top" class="inputDescription"><?php echo getMLText("keywords")?>:</td>
|
||||
<td><textarea id="keywordta" rows="5" cols="30"></textarea></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><hr></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="inputDescription"><?php echo getMLText("global_default_keywords")?>:</td>
|
||||
<td>
|
||||
<select onchange="showKeywords(0)" id="categories0">
|
||||
<option value="-1"><?php echo getMLText("choose_category")?>
|
||||
<?php
|
||||
foreach ($categories as $category) {
|
||||
$owner = $category->getOwner();
|
||||
if (!$owner->isAdmin())
|
||||
continue;
|
||||
|
||||
print "<option value=\"".$category->getID()."\">" . htmlspecialchars($category->getName());
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
foreach ($categories as $category) {
|
||||
$owner = $category->getOwner();
|
||||
if (!$owner->isAdmin())
|
||||
continue;
|
||||
?>
|
||||
<tr id="keywords<?php echo $category->getID()?>" style="display : none;">
|
||||
<td valign="top" class="inputDescription"><?php echo getMLText("default_keywords")?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
$lists = $category->getKeywordLists();
|
||||
|
||||
if (count($lists) == 0) print getMLText("no_default_keywords");
|
||||
else {
|
||||
print "<ul>";
|
||||
foreach ($lists as $list) {
|
||||
print "<li><a href='javascript:insertKeywords(\"".htmlspecialchars($list["keywords"])."\");'>".htmlspecialchars($list["keywords"])."</a></li>";
|
||||
}
|
||||
print "</ul>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td colspan="2"><hr></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="inputDescription"><?php echo getMLText("personal_default_keywords")?>:</td>
|
||||
<td>
|
||||
<select onchange="showKeywords(1)" id="categories1">
|
||||
<option value="-1"><?php echo getMLText("choose_category")?>
|
||||
<?php
|
||||
foreach ($categories as $category) {
|
||||
$owner = $category->getOwner();
|
||||
if ($owner->isAdmin())
|
||||
continue;
|
||||
|
||||
print "<option value=\"".$category->getID()."\">" . htmlspecialchars($category->getName());
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
foreach ($categories as $category) {
|
||||
$owner = $category->getOwner();
|
||||
if ($owner->isAdmin())
|
||||
continue;
|
||||
?>
|
||||
<tr id="keywords<?php echo $category->getID()?>" style="display : none;">
|
||||
<td valign="top" class="inputDescription"><?php echo getMLText("default_keywords")?>:</td>
|
||||
<td class="standardText">
|
||||
<?php
|
||||
$lists = $category->getKeywordLists();
|
||||
if (count($lists) == 0) print getMLText("no_default_keywords");
|
||||
else {
|
||||
print "<ul>";
|
||||
foreach ($lists as $list) {
|
||||
print "<li><a href='javascript:insertKeywords(\"".htmlspecialchars($list["keywords"])."\");'>".htmlspecialchars($list["keywords"])."</a></li>";
|
||||
}
|
||||
print "</ul>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td colspan="2"><hr></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<br>
|
||||
<input type="Button" onclick="acceptKeywords();" value="<?php echo getMLText("accept")?>">
|
||||
<input type="Button" onclick="cancel();" value="<?php echo getMLText("cancel")?>">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
</div>
|
||||
|
||||
<script language="JavaScript">
|
||||
myTA = document.getElementById("keywordta");
|
||||
myTA.value = targetObj.value;
|
||||
myTA.focus();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,106 +1,41 @@
|
|||
<?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");
|
||||
<?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");
|
||||
|
||||
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"));
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (isset($_GET["logname"])) $logname=$_GET["logname"];
|
||||
else $logname=NULL;
|
||||
|
||||
|
||||
UI::htmlStartPage(getMLText("backup_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
|
||||
UI::contentHeading(getMLText("log_management"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
$print_header=true;
|
||||
|
||||
$handle = opendir($settings->_contentDir);
|
||||
$entries = array();
|
||||
while ($e = readdir($handle)){
|
||||
if (is_dir($settings->_contentDir.$e)) continue;
|
||||
if (strpos($e,".log")==FALSE) continue;
|
||||
if (strcmp($e,"current.log")==0) continue;
|
||||
$entries[] = $e;
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
sort($entries);
|
||||
$entries = array_reverse($entries);
|
||||
|
||||
foreach ($entries as $entry){
|
||||
|
||||
if ($print_header){
|
||||
print "<table class=\"folderView\">\n";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("creation_date")."</th>\n";
|
||||
print "<th>".getMLText("file_size")."</th>\n";
|
||||
print "<th></th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$print_header=false;
|
||||
}
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"out.LogManagement.php?logname=".$entry."\">".$entry."</a></td>\n";
|
||||
print "<td>".getLongReadableDate(filectime($settings->_contentDir.$entry))."</td>\n";
|
||||
print "<td>".formatted_size(filesize($settings->_contentDir.$entry))."</td>\n";
|
||||
print "<td><ul class=\"actions\">";
|
||||
|
||||
print "<li><a href=\"out.RemoveLog.php?logname=".$entry."\">".getMLText("rm_file")."</a></li>";
|
||||
|
||||
print "<li><a href=\"../op/op.Download.php?logname=".$entry."\">".getMLText("download")."</a></li>";
|
||||
|
||||
print "</ul></td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
if ($print_header) printMLText("empty_notify_list");
|
||||
else print "</table>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
if ($logname && file_exists($settings->_contentDir.$logname)){
|
||||
|
||||
UI::contentHeading(" ");
|
||||
UI::contentContainerStart();
|
||||
|
||||
UI::contentSubHeading(sanitizeString($logname));
|
||||
|
||||
echo "<div class=\"logview\">";
|
||||
echo "<pre>\n";
|
||||
readfile($settings->_contentDir.$logname);
|
||||
echo "</pre>\n";
|
||||
echo "</div>";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'logname'=>$logname, 'contentdir'=>$settings->_contentDir));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
||||
?>
|
||||
|
|
|
@ -23,106 +23,22 @@ include("../inc/inc.Language.php");
|
|||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Utils.php");
|
||||
|
||||
UI::htmlStartPage(getMLText("sign_in"), "login");
|
||||
UI::globalBanner();
|
||||
UI::pageNavigation(getMLText("sign_in"));
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.login.value == "") msg += "<?php printMLText("js_no_login");?>\n";
|
||||
if (document.form1.pwd.value == "") msg += "<?php printMLText("js_no_pwd");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
function guestLogin()
|
||||
{
|
||||
url = "../op/op.Login.php?login=guest" +
|
||||
"&sesstheme=" + document.form1.sesstheme.options[document.form1.sesstheme.options.selectedIndex].value +
|
||||
"&lang=" + document.form1.lang.options[document.form1.lang.options.selectedIndex].value;
|
||||
if (document.form1.referuri) {
|
||||
url += "&referuri=" + escape(document.form1.referuri.value);
|
||||
}
|
||||
document.location.href = url;
|
||||
}
|
||||
|
||||
</script>
|
||||
<?php UI::contentContainerStart(); ?>
|
||||
<form action="../op/op.Login.php" method="post" name="form1" onsubmit="return checkForm();">
|
||||
<?php
|
||||
if (isset($_GET["referuri"]) && strlen($_GET["referuri"])>0) {
|
||||
$refer=$_GET["referuri"];
|
||||
}
|
||||
else if (isset($_POST["referuri"]) && strlen($_POST["referuri"])>0) {
|
||||
$refer=$_POST["referuri"];
|
||||
} else {
|
||||
$refer = '';
|
||||
}
|
||||
if (isset($refer) && strlen($refer)>0) {
|
||||
echo "<input type='hidden' name='referuri' value='".sanitizeString($refer)."'/>";
|
||||
|
||||
$themes = UI::getStyles();
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('enableguestlogin'=>$settings->_enableGuestLogin, 'enablepasswordforgotten'=>$settings->_enablePasswordForgotten, 'referrer'=>$refer, 'themes'=>$themes));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td><?php printMLText("user_login");?></td>
|
||||
<td><input name="login" id="login"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("password");?></td>
|
||||
<td><input name="pwd" type="Password"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("language");?></td>
|
||||
<td>
|
||||
<?php
|
||||
print "<select name=\"lang\">";
|
||||
print "<option value=\"\">-";
|
||||
$languages = getLanguages();
|
||||
foreach ($languages as $currLang) {
|
||||
print "<option value=\"".$currLang."\">".$currLang;
|
||||
}
|
||||
print "</select>";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("theme");?></td>
|
||||
<td>
|
||||
<?php
|
||||
print "<select name=\"sesstheme\">";
|
||||
print "<option value=\"\">-";
|
||||
$themes = UI::getStyles();
|
||||
foreach ($themes as $currTheme) {
|
||||
print "<option value=\"".$currTheme."\">".$currTheme;
|
||||
}
|
||||
print "</select>";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("submit_login") ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php UI::contentContainerEnd(); ?>
|
||||
<?php
|
||||
$tmpfoot = array();
|
||||
if ($settings->_enableGuestLogin)
|
||||
$tmpfoot[] = "<a href=\"javascript:guestLogin()\">" . getMLText("guest_login") . "</a>\n";
|
||||
if ($settings->_enablePasswordForgotten)
|
||||
$tmpfoot[] = "<a href=\"../out/out.PasswordForgotten.php\">" . getMLText("password_forgotten") . "</a>\n";
|
||||
if($tmpfoot) {
|
||||
print "<p>";
|
||||
print implode(' | ', $tmpfoot);
|
||||
print "</p>\n";
|
||||
}
|
||||
?>
|
||||
<script language="JavaScript">document.form1.login.focus();</script>
|
||||
<?php
|
||||
UI::htmlEndPage();
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,186 +1,36 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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");
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if ($user->isGuest()) {
|
||||
UI::exitError(getMLText("my_account"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
// Get list of subscriptions for documents or folders for user or groups
|
||||
function getNotificationList($as_group, $folders) {
|
||||
global $user,$db;
|
||||
|
||||
// First, get the list of groups of which the user is a member.
|
||||
if ($as_group){
|
||||
|
||||
$groups = $user->getGroups();
|
||||
|
||||
if (count($groups)==0) return NULL;
|
||||
|
||||
$grpList = "";
|
||||
foreach ($groups as $group) {
|
||||
$grpList .= (strlen($grpList)==0 ? "" : ", ") . $group->getID();
|
||||
}
|
||||
|
||||
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ".
|
||||
"WHERE `tblNotify`.`groupID` IN (". $grpList .")";
|
||||
|
||||
} else {
|
||||
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ".
|
||||
"WHERE `tblNotify`.`userID` = '". $user->getID()."'" ;
|
||||
}
|
||||
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
|
||||
$ret=array();
|
||||
|
||||
foreach ($resArr as $res){
|
||||
|
||||
if (($res["targetType"] == T_DOCUMENT)&&(!$folders)) $ret[]=$res["target"];
|
||||
if (($res["targetType"] == T_FOLDER)&&($folders)) $ret[]=$res["target"];
|
||||
}
|
||||
|
||||
return $ret;
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
function printFolderNotificationList($ret,$deleteaction=true) {
|
||||
global $dms;
|
||||
if (count($ret)==0) {
|
||||
printMLText("empty_notify_list");
|
||||
}
|
||||
else {
|
||||
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead><tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("owner")."</th>\n";
|
||||
print "<th>".getMLText("actions")."</th>\n";
|
||||
print "</tr></thead>\n<tbody>\n";
|
||||
foreach($ret as $ID) {
|
||||
$fld = $dms->getFolder($ID);
|
||||
if (is_object($fld)) {
|
||||
$owner = $fld->getOwner();
|
||||
print "<tr class=\"folder\">";
|
||||
print "<td><img src=\"images/folder_closed.gif\" width=18 height=18 border=0></td>";
|
||||
print "<td><a href=\"../out/out.ViewFolder.php?folderid=".$ID."\">" . htmlspecialchars($fld->getName()) . "</a></td>\n";
|
||||
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
||||
print "<td><ul class=\"actions\">";
|
||||
if ($deleteaction) print "<li><a href='../op/op.ManageNotify.php?id=".$ID."&type=folder&action=del'>".getMLText("delete")."</a>";
|
||||
else print "<li><a href='../out/out.FolderNotify.php?folderid=".$ID."'>".getMLText("edit")."</a>";
|
||||
print "</ul></td></tr>";
|
||||
}
|
||||
}
|
||||
print "</tbody></table>";
|
||||
}
|
||||
}
|
||||
|
||||
function printDocumentNotificationList($ret,$deleteaction=true) {
|
||||
global $dms;
|
||||
|
||||
if (count($ret)==0) {
|
||||
printMLText("empty_notify_list");
|
||||
}
|
||||
else {
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("owner")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th>".getMLText("actions")."</th>\n";
|
||||
print "</tr></thead>\n<tbody>\n";
|
||||
foreach ($ret as $ID) {
|
||||
$doc = $dms->getDocument($ID);
|
||||
if (is_object($doc)) {
|
||||
$owner = $doc->getOwner();
|
||||
$latest = $doc->getLatestContent();
|
||||
$status = $latest->getStatus();
|
||||
print "<tr>\n";
|
||||
print "<td><img src=\"images/file.gif\" width=18 height=18 border=0></td>";
|
||||
print "<td><a href=\"../out/out.ViewDocument.php?documentid=".$ID."\">" . htmlspecialchars($doc->getName()) . "</a></td>\n";
|
||||
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
||||
print "<td>".getOverallStatusText($status["status"])."</td>";
|
||||
print "<td class=\"center\">".$latest->getVersion()."</td>";
|
||||
print "<td><ul class=\"actions\">";
|
||||
if ($deleteaction) print "<li><a href='../op/op.ManageNotify.php?id=".$ID."&type=document&action=del'>".getMLText("delete")."</a>";
|
||||
else print "<li><a href='../out/out.DocumentNotify.php?documentid=".$ID."'>".getMLText("edit")."</a>";
|
||||
print "</ul></td></tr>\n";
|
||||
}
|
||||
}
|
||||
print "</tbody></table>";
|
||||
}
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("my_account"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("my_account"), "my_account");
|
||||
|
||||
UI::contentHeading(getMLText("edit_existing_notify"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
print "<form method=POST action=\"../op/op.ManageNotify.php?type=folder&action=add\" name=\"form1\">";
|
||||
UI::contentSubHeading(getMLText("choose_target_folder"));
|
||||
UI::printFolderChooser("form1",M_READ);
|
||||
print "<input type=\"checkbox\" name=\"recursefolder\" value=\"1\">";
|
||||
print getMLText("include_subdirectories");
|
||||
print "<input type=\"checkbox\" name=\"recursedoc\" value=\"1\">";
|
||||
print getMLText("include_documents");
|
||||
print " <input type='submit' name='' value='".getMLText("add")."'/>";
|
||||
print "</form>";
|
||||
|
||||
print "<form method=POST action=\"../op/op.ManageNotify.php?type=document&action=add\" name=\"form2\">";
|
||||
UI::contentSubHeading(getMLText("choose_target_document"));
|
||||
UI::printDocumentChooser("form2");
|
||||
print " <input type=\"Submit\" value=\"".getMLText("add")."\">";
|
||||
print "</form>";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
|
||||
//
|
||||
// Display the results.
|
||||
//
|
||||
UI::contentHeading(getMLText("edit_folder_notify"));
|
||||
UI::contentContainerStart();
|
||||
UI::contentSubHeading(getMLText("user"));
|
||||
$ret=getNotificationList(false,true);
|
||||
printFolderNotificationList($ret);
|
||||
UI::contentSubHeading(getMLText("group"));
|
||||
$ret=getNotificationList(true,true);
|
||||
printFolderNotificationList($ret,false);
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::contentHeading(getMLText("edit_document_notify"));
|
||||
UI::contentContainerStart();
|
||||
UI::contentSubHeading(getMLText("user"));
|
||||
$ret=getNotificationList(false,false);
|
||||
printDocumentNotificationList($ret);
|
||||
UI::contentSubHeading(getMLText("group"));
|
||||
$ret=getNotificationList(true,false);
|
||||
printDocumentNotificationList($ret,false);
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -1,66 +1,50 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
}
|
||||
|
||||
$documentid = intval($_GET["documentid"]);
|
||||
$document = $dms->getDocument($documentid);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
if ($document->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
UI::contentHeading(getMLText("move_document"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<form action="../op/op.MoveDocument.php" name="form1">
|
||||
<input type="Hidden" name="documentid" value="<?php print $documentid;?>">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("choose_target_folder");?>:</td>
|
||||
<td><?php UI::printFolderChooser("form1", M_READWRITE);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><br><input type="Submit" value="<?php printMLText("move");?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
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.Authentication.php");
|
||||
|
||||
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"));
|
||||
}
|
||||
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
if (!is_object($document)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
if ($document->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$folder = $document->getFolder();
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,74 +1,53 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folderid = intval($_GET["folderid"]);
|
||||
$folder = $dms->getFolder($folderid);
|
||||
|
||||
if (!is_object($folder)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folderPathHTML = getFolderPathHTML($folder, true);
|
||||
|
||||
if ($folderid == $settings->_rootFolderID || !$folder->getParent()) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("cannot_move_root"));
|
||||
}
|
||||
|
||||
if ($folder->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied"));
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($folderPathHTML, "view_folder", $folder);
|
||||
UI::contentHeading(getMLText("move_folder"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<form action="../op/op.MoveFolder.php" name="form1">
|
||||
<input type="Hidden" name="folderid" value="<?php print $folderid;?>">
|
||||
<input type="Hidden" name="showtree" value="<?php echo showtree();?>">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("choose_target_folder");?>:</td>
|
||||
<td><?php UI::printFolderChooser("form1", M_READWRITE, $folder->getID());?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("move_folder"); ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
$folder = $dms->getFolder($_GET["folderid"]);
|
||||
|
||||
if (!is_object($folder)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
if ($folder->getID() == $settings->_rootFolderID || !$folder->getParent()) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("cannot_move_root"));
|
||||
}
|
||||
|
||||
if ($folder->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,69 +1,38 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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");
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if ($user->isGuest()) {
|
||||
UI::exitError(getMLText("my_account"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("my_account"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("my_account"), "my_account");
|
||||
|
||||
UI::contentHeading(getMLText("user_info"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
print "<table>\n";
|
||||
|
||||
if ($settings->_enableUserImage){
|
||||
print "<tr>\n";
|
||||
print "<td rowspan=5 id=\"userImage\">".($user->hasImage() ? "<img class=\"userImage\" src=\"".$settings->_httpRoot . "out/out.UserImage.php?userid=".$user->getId()."\">" : getMLText("no_user_image"))."</td>\n";
|
||||
print "</tr>\n";
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'enableuserimage'=>$settings->_enableUserImage, 'passwordexpiration'=>$settings->_passwordExpiration, 'httproot'=>$settings->_httpRoot));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td>".getMLText("name")." : </td>\n";
|
||||
print "<td>".htmlspecialchars($user->getFullName()).($user->isAdmin() ? " (".getMLText("admin").")" : "")."</td>\n";
|
||||
print "</tr>\n<tr>\n";
|
||||
print "<td>".getMLText("user_login")." : </td>\n";
|
||||
print "<td>".$user->getLogin()."</td>\n";
|
||||
print "</tr>\n<tr>\n";
|
||||
print "<td>".getMLText("email")." : </td>\n";
|
||||
print "<td>".htmlspecialchars($user->getEmail())."</td>\n";
|
||||
print "</tr>\n<tr>\n";
|
||||
print "<td>".getMLText("comment")." : </td>\n";
|
||||
print "<td>".htmlspecialchars($user->getComment())."</td>\n";
|
||||
print "</tr>\n";
|
||||
if($settings->_passwordExpiration > 0) {
|
||||
print "<tr>\n";
|
||||
print "<td>".getMLText("password_expiration")." : </td>\n";
|
||||
print "<td>".htmlspecialchars($user->getPwdExpiration())."</td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -1,488 +1,50 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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");
|
||||
//
|
||||
// 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.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if ($user->isGuest()) {
|
||||
UI::exitError(getMLText("my_documents"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
// Check to see if the user wants to see only those documents that are still
|
||||
// in the review / approve stages.
|
||||
$showInProcess = false;
|
||||
if (isset($_GET["inProcess"]) && strlen($_GET["inProcess"])>0 && $_GET["inProcess"]!=0) {
|
||||
$showInProcess = true;
|
||||
|
||||
// Check to see if the user wants to see only those documents that are still
|
||||
// in the review / approve stages.
|
||||
$showInProcess = false;
|
||||
if (isset($_GET["inProcess"]) && strlen($_GET["inProcess"])>0 && $_GET["inProcess"]!=0) {
|
||||
$showInProcess = true;
|
||||
}
|
||||
|
||||
$orderby='n';
|
||||
if (isset($_GET["orderby"]) && strlen($_GET["orderby"])==1 ) {
|
||||
$orderby=$_GET["orderby"];
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("my_documents"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("my_documents"), "my_documents");
|
||||
|
||||
if ($showInProcess){
|
||||
|
||||
if (!$db->createTemporaryTable("ttstatid") || !$db->createTemporaryTable("ttcontentid")) {
|
||||
UI::contentHeading(getMLText("warning"));
|
||||
UI::contentContainer(getMLText("internal_error_exit"));
|
||||
UI::htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Get document list for the current user.
|
||||
$reviewStatus = $user->getReviewStatus();
|
||||
$approvalStatus = $user->getApprovalStatus();
|
||||
|
||||
// Create a comma separated list of all the documentIDs whose information is
|
||||
// required.
|
||||
$dList = array();
|
||||
foreach ($reviewStatus["indstatus"] as $st) {
|
||||
if (!in_array($st["documentID"], $dList)) {
|
||||
$dList[] = $st["documentID"];
|
||||
}
|
||||
}
|
||||
foreach ($reviewStatus["grpstatus"] as $st) {
|
||||
if (!in_array($st["documentID"], $dList)) {
|
||||
$dList[] = $st["documentID"];
|
||||
}
|
||||
}
|
||||
foreach ($approvalStatus["indstatus"] as $st) {
|
||||
if (!in_array($st["documentID"], $dList)) {
|
||||
$dList[] = $st["documentID"];
|
||||
}
|
||||
}
|
||||
foreach ($approvalStatus["grpstatus"] as $st) {
|
||||
if (!in_array($st["documentID"], $dList)) {
|
||||
$dList[] = $st["documentID"];
|
||||
}
|
||||
}
|
||||
$docCSV = "";
|
||||
foreach ($dList as $d) {
|
||||
$docCSV .= (strlen($docCSV)==0 ? "" : ", ")."'".$d."'";
|
||||
}
|
||||
|
||||
if (strlen($docCSV)>0) {
|
||||
// Get the document information.
|
||||
$queryStr = "SELECT `tblDocuments`.*, `tblDocumentLocks`.`userID` as `lockUser`, ".
|
||||
"`tblDocumentContent`.`version`, `tblDocumentStatus`.*, `tblDocumentStatusLog`.`status`, ".
|
||||
"`tblDocumentStatusLog`.`comment` AS `statusComment`, `tblDocumentStatusLog`.`date` as `statusDate`, ".
|
||||
"`tblDocumentStatusLog`.`userID`, `oTbl`.`fullName` AS `ownerName`, `sTbl`.`fullName` AS `statusName` ".
|
||||
"FROM `tblDocumentContent` ".
|
||||
"LEFT JOIN `tblDocuments` ON `tblDocuments`.`id` = `tblDocumentContent`.`document` ".
|
||||
"LEFT JOIN `tblDocumentStatus` ON `tblDocumentStatus`.`documentID` = `tblDocumentContent`.`document` ".
|
||||
"LEFT JOIN `tblDocumentStatusLog` ON `tblDocumentStatusLog`.`statusID` = `tblDocumentStatus`.`statusID` ".
|
||||
"LEFT JOIN `ttstatid` ON `ttstatid`.`maxLogID` = `tblDocumentStatusLog`.`statusLogID` ".
|
||||
"LEFT JOIN `ttcontentid` ON `ttcontentid`.`maxVersion` = `tblDocumentStatus`.`version` AND `ttcontentid`.`document` = `tblDocumentStatus`.`documentID` ".
|
||||
"LEFT JOIN `tblDocumentLocks` ON `tblDocuments`.`id`=`tblDocumentLocks`.`document` ".
|
||||
"LEFT JOIN `tblUsers` AS `oTbl` on `oTbl`.`id` = `tblDocuments`.`owner` ".
|
||||
"LEFT JOIN `tblUsers` AS `sTbl` on `sTbl`.`id` = `tblDocumentStatusLog`.`userID` ".
|
||||
"WHERE `ttstatid`.`maxLogID`=`tblDocumentStatusLog`.`statusLogID` ".
|
||||
"AND `ttcontentid`.`maxVersion` = `tblDocumentContent`.`version` ".
|
||||
"AND `tblDocumentStatusLog`.`status` IN (".S_DRAFT_REV.", ".S_DRAFT_APP.", ".S_EXPIRED.") ".
|
||||
"AND `tblDocuments`.`id` IN (" . $docCSV . ") ".
|
||||
"ORDER BY `statusDate` DESC";
|
||||
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
UI::contentHeading(getMLText("warning"));
|
||||
UI::contentContainer(getMLText("internal_error_exit"));
|
||||
UI::htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Create an array to hold all of these results, and index the array by
|
||||
// document id. This makes it easier to retrieve document ID information
|
||||
// later on and saves us having to repeatedly poll the database every time
|
||||
// new document information is required.
|
||||
$docIdx = array();
|
||||
foreach ($resArr as $res) {
|
||||
|
||||
// verify expiry
|
||||
if ( $res["expires"] && time()>$res["expires"]+24*60*60 ){
|
||||
if ( $res["status"]==S_DRAFT_APP || $res["status"]==S_DRAFT_REV ){
|
||||
$res["status"]=S_EXPIRED;
|
||||
}
|
||||
}
|
||||
|
||||
$docIdx[$res["id"]][$res["version"]] = $res;
|
||||
}
|
||||
|
||||
// List the documents where a review has been requested.
|
||||
UI::contentHeading(getMLText("documents_to_review"));
|
||||
UI::contentContainerStart();
|
||||
$printheader=true;
|
||||
$iRev = array();
|
||||
$dList = array();
|
||||
foreach ($reviewStatus["indstatus"] as $st) {
|
||||
|
||||
if ( $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && !in_array($st["documentID"], $dList) ) {
|
||||
$dList[] = $st["documentID"];
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("owner")."</th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th>".getMLText("last_update")."</th>\n";
|
||||
print "<th>".getMLText("expires")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$st["documentID"]."\">".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["name"])."</a></td>";
|
||||
print "<td>".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["ownerName"])."</td>";
|
||||
print "<td>".$st["version"]."</td>";
|
||||
print "<td>".$st["date"]." ". htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["statusName"]) ."</td>";
|
||||
print "<td".($docIdx[$st["documentID"]][$st["version"]]['status']!=S_EXPIRED?"":" class=\"warning\"").">".(!$docIdx[$st["documentID"]][$st["version"]]["expires"] ? "-":getReadableDate($docIdx[$st["documentID"]][$st["version"]]["expires"]))."</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
foreach ($reviewStatus["grpstatus"] as $st) {
|
||||
|
||||
if (!in_array($st["documentID"], $iRev) && $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && !in_array($st["documentID"], $dList) && $docIdx[$st["documentID"]][$st["version"]]['owner'] != $user->getId()) {
|
||||
$dList[] = $st["documentID"];
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("owner")."</th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th>".getMLText("last_update")."</th>\n";
|
||||
print "<th>".getMLText("expires")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$st["documentID"]."\">".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["name"])."</a></td>";
|
||||
print "<td>".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["ownerName"])."</td>";
|
||||
print "<td>".$st["version"]."</td>";
|
||||
print "<td>".$st["date"]." ". htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["statusName"])."</td>";
|
||||
print "<td".($docIdx[$st["documentID"]][$st["version"]]['status']!=S_EXPIRED?"":" class=\"warning\"").">".(!$docIdx[$st["documentID"]][$st["version"]]["expires"] ? "-":getReadableDate($docIdx[$st["documentID"]][$st["version"]]["expires"]))."</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
if (!$printheader){
|
||||
echo "</tbody>\n</table>";
|
||||
}else{
|
||||
printMLText("no_docs_to_review");
|
||||
}
|
||||
UI::contentContainerEnd();
|
||||
|
||||
// List the documents where an approval has been requested.
|
||||
UI::contentHeading(getMLText("documents_to_approve"));
|
||||
UI::contentContainerStart();
|
||||
$printheader=true;
|
||||
|
||||
foreach ($approvalStatus["indstatus"] as $st) {
|
||||
|
||||
if ( $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]])) {
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("owner")."</th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th>".getMLText("last_update")."</th>\n";
|
||||
print "<th>".getMLText("expires")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$st["documentID"]."\">".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["name"])."</a></td>";
|
||||
print "<td>".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["ownerName"])."</td>";
|
||||
print "<td>".$st["version"]."</td>";
|
||||
print "<td>".$st["date"]." ". htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["statusName"])."</td>";
|
||||
print "<td".($docIdx[$st["documentID"]][$st["version"]]['status']!=S_EXPIRED?"":" class=\"warning\"").">".(!$docIdx[$st["documentID"]][$st["version"]]["expires"] ? "-":getReadableDate($docIdx[$st["documentID"]][$st["version"]]["expires"]))."</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
foreach ($approvalStatus["grpstatus"] as $st) {
|
||||
|
||||
if (!in_array($st["documentID"], $iRev) && $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && $docIdx[$st["documentID"]][$st["version"]]['owner'] != $user->getId()) {
|
||||
if ($printheader){
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("owner")."</th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th>".getMLText("last_update")."</th>\n";
|
||||
print "<th>".getMLText("expires")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$st["documentID"]."\">".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["name"])."</a></td>";
|
||||
print "<td>".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["ownerName"])."</td>";
|
||||
print "<td>".$st["version"]."</td>";
|
||||
print "<td>".$st["date"]." ". htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["statusName"])."</td>";
|
||||
print "<td".($docIdx[$st["documentID"]][$st["version"]]['status']!=S_EXPIRED?"":" class=\"warning\"").">".(!$docIdx[$st["documentID"]][$st["version"]]["expires"] ? "-":getReadableDate($docIdx[$st["documentID"]][$st["version"]]["expires"]))."</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
if (!$printheader){
|
||||
echo "</tbody>\n</table>\n";
|
||||
}else{
|
||||
printMLText("no_docs_to_approve");
|
||||
}
|
||||
UI::contentContainerEnd();
|
||||
}
|
||||
else {
|
||||
|
||||
UI::contentHeading(getMLText("documents_to_review"));
|
||||
UI::contentContainerStart();
|
||||
printMLText("no_review_needed");
|
||||
UI::contentContainerEnd();
|
||||
UI::contentHeading(getMLText("documents_to_approve"));
|
||||
UI::contentContainerStart();
|
||||
printMLText("no_approval_needed");
|
||||
UI::contentContainerEnd();
|
||||
}
|
||||
|
||||
// Get list of documents owned by current user that are pending review or
|
||||
// pending approval.
|
||||
$queryStr = "SELECT `tblDocuments`.*, `tblDocumentLocks`.`userID` as `lockUser`, ".
|
||||
"`tblDocumentContent`.`version`, `tblDocumentStatus`.*, `tblDocumentStatusLog`.`status`, ".
|
||||
"`tblDocumentStatusLog`.`comment` AS `statusComment`, `tblDocumentStatusLog`.`date` as `statusDate`, ".
|
||||
"`tblDocumentStatusLog`.`userID`, `oTbl`.`fullName` AS `ownerName`, `sTbl`.`fullName` AS `statusName` ".
|
||||
"FROM `tblDocumentContent` ".
|
||||
"LEFT JOIN `tblDocuments` ON `tblDocuments`.`id` = `tblDocumentContent`.`document` ".
|
||||
"LEFT JOIN `tblDocumentStatus` ON `tblDocumentStatus`.`documentID` = `tblDocumentContent`.`document` ".
|
||||
"LEFT JOIN `tblDocumentStatusLog` ON `tblDocumentStatusLog`.`statusID` = `tblDocumentStatus`.`statusID` ".
|
||||
"LEFT JOIN `ttstatid` ON `ttstatid`.`maxLogID` = `tblDocumentStatusLog`.`statusLogID` ".
|
||||
"LEFT JOIN `ttcontentid` ON `ttcontentid`.`maxVersion` = `tblDocumentStatus`.`version` AND `ttcontentid`.`document` = `tblDocumentStatus`.`documentID` ".
|
||||
"LEFT JOIN `tblDocumentLocks` ON `tblDocuments`.`id`=`tblDocumentLocks`.`document` ".
|
||||
"LEFT JOIN `tblUsers` AS `oTbl` on `oTbl`.`id` = `tblDocuments`.`owner` ".
|
||||
"LEFT JOIN `tblUsers` AS `sTbl` on `sTbl`.`id` = `tblDocumentStatusLog`.`userID` ".
|
||||
"WHERE `ttstatid`.`maxLogID`=`tblDocumentStatusLog`.`statusLogID` ".
|
||||
"AND `ttcontentid`.`maxVersion` = `tblDocumentContent`.`version` ".
|
||||
"AND `tblDocuments`.`owner` = '".$user->getID()."' ".
|
||||
"AND `tblDocumentStatusLog`.`status` IN (".S_DRAFT_REV.", ".S_DRAFT_APP.") ".
|
||||
"ORDER BY `statusDate` DESC";
|
||||
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
UI::contentHeading(getMLText("warning"));
|
||||
UI::contentContainer("Internal error. Unable to complete request. Exiting.");
|
||||
UI::htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::contentHeading(getMLText("documents_user_requiring_attention"));
|
||||
UI::contentContainerStart();
|
||||
if (count($resArr)>0) {
|
||||
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th>".getMLText("last_update")."</th>\n";
|
||||
print "<th>".getMLText("expires")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
foreach ($resArr as $res) {
|
||||
|
||||
// verify expiry
|
||||
if ( $res["expires"] && time()>$res["expires"]+24*60*60 ){
|
||||
if ( $res["status"]==S_DRAFT_APP || $res["status"]==S_DRAFT_REV ){
|
||||
$res["status"]=S_EXPIRED;
|
||||
}
|
||||
}
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$res["documentID"]."\">" . htmlspecialchars($res["name"]) . "</a></td>\n";
|
||||
print "<td>".getOverallStatusText($res["status"])."</td>";
|
||||
print "<td>".$res["version"]."</td>";
|
||||
print "<td>".$res["statusDate"]." ".htmlspecialchars($res["statusName"])."</td>";
|
||||
print "<td>".(!$res["expires"] ? "-":getReadableDate($res["expires"]))."</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</tbody></table>";
|
||||
|
||||
}
|
||||
else printMLText("no_docs_to_look_at");
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
|
||||
// Get list of documents locked by current user
|
||||
$queryStr = "SELECT `tblDocuments`.*, `tblDocumentLocks`.`userID` as `lockUser`, ".
|
||||
"`tblDocumentContent`.`version`, `tblDocumentStatus`.*, `tblDocumentStatusLog`.`status`, ".
|
||||
"`tblDocumentStatusLog`.`comment` AS `statusComment`, `tblDocumentStatusLog`.`date` as `statusDate`, ".
|
||||
"`tblDocumentStatusLog`.`userID`, `oTbl`.`fullName` AS `ownerName`, `sTbl`.`fullName` AS `statusName` ".
|
||||
"FROM `tblDocumentContent` ".
|
||||
"LEFT JOIN `tblDocuments` ON `tblDocuments`.`id` = `tblDocumentContent`.`document` ".
|
||||
"LEFT JOIN `tblDocumentStatus` ON `tblDocumentStatus`.`documentID` = `tblDocumentContent`.`document` ".
|
||||
"LEFT JOIN `tblDocumentStatusLog` ON `tblDocumentStatusLog`.`statusID` = `tblDocumentStatus`.`statusID` ".
|
||||
"LEFT JOIN `ttstatid` ON `ttstatid`.`maxLogID` = `tblDocumentStatusLog`.`statusLogID` ".
|
||||
"LEFT JOIN `ttcontentid` ON `ttcontentid`.`maxVersion` = `tblDocumentStatus`.`version` AND `ttcontentid`.`document` = `tblDocumentStatus`.`documentID` ".
|
||||
"LEFT JOIN `tblDocumentLocks` ON `tblDocuments`.`id`=`tblDocumentLocks`.`document` ".
|
||||
"LEFT JOIN `tblUsers` AS `oTbl` on `oTbl`.`id` = `tblDocuments`.`owner` ".
|
||||
"LEFT JOIN `tblUsers` AS `sTbl` on `sTbl`.`id` = `tblDocumentStatusLog`.`userID` ".
|
||||
"WHERE `ttstatid`.`maxLogID`=`tblDocumentStatusLog`.`statusLogID` ".
|
||||
"AND `ttcontentid`.`maxVersion` = `tblDocumentContent`.`version` ".
|
||||
"AND `tblDocumentLocks`.`userID` = '".$user->getID()."' ".
|
||||
"ORDER BY `statusDate` DESC";
|
||||
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
UI::contentHeading(getMLText("warning"));
|
||||
UI::contentContainer("Internal error. Unable to complete request. Exiting.");
|
||||
UI::htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::contentHeading(getMLText("documents_locked_by_you"));
|
||||
UI::contentContainerStart();
|
||||
if (count($resArr)>0) {
|
||||
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th>".getMLText("last_update")."</th>\n";
|
||||
print "<th>".getMLText("expires")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
foreach ($resArr as $res) {
|
||||
|
||||
// verify expiry
|
||||
if ( $res["expires"] && time()>$res["expires"]+24*60*60 ){
|
||||
if ( $res["status"]==S_DRAFT_APP || $res["status"]==S_DRAFT_REV ){
|
||||
$res["status"]=S_EXPIRED;
|
||||
}
|
||||
}
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$res["documentID"]."\">" . htmlspecialchars($res["name"]) . "</a></td>\n";
|
||||
print "<td>".getOverallStatusText($res["status"])."</td>";
|
||||
print "<td>".$res["version"]."</td>";
|
||||
print "<td>".$res["statusDate"]." ".htmlspecialchars($res["statusName"])."</td>";
|
||||
print "<td>".(!$res["expires"] ? "-":getReadableDate($res["expires"]))."</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</tbody></table>";
|
||||
|
||||
}
|
||||
else printMLText("no_docs_locked");
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
// Get list of documents owned by current user
|
||||
if (!$db->createTemporaryTable("ttstatid")) {
|
||||
UI::contentHeading(getMLText("warning"));
|
||||
UI::contentContainer(getMLText("internal_error_exit"));
|
||||
UI::htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$db->createTemporaryTable("ttcontentid")) {
|
||||
UI::contentHeading(getMLText("warning"));
|
||||
UI::contentContainer(getMLText("internal_error_exit"));
|
||||
UI::htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
$queryStr = "SELECT `tblDocuments`.*, `tblDocumentLocks`.`userID` as `lockUser`, ".
|
||||
"`tblDocumentContent`.`version`, `tblDocumentStatus`.*, `tblDocumentStatusLog`.`status`, ".
|
||||
"`tblDocumentStatusLog`.`comment` AS `statusComment`, `tblDocumentStatusLog`.`date` as `statusDate`, ".
|
||||
"`tblDocumentStatusLog`.`userID`, `oTbl`.`fullName` AS `ownerName`, `sTbl`.`fullName` AS `statusName` ".
|
||||
"FROM `tblDocumentContent` ".
|
||||
"LEFT JOIN `tblDocuments` ON `tblDocuments`.`id` = `tblDocumentContent`.`document` ".
|
||||
"LEFT JOIN `tblDocumentStatus` ON `tblDocumentStatus`.`documentID` = `tblDocumentContent`.`document` ".
|
||||
"LEFT JOIN `tblDocumentStatusLog` ON `tblDocumentStatusLog`.`statusID` = `tblDocumentStatus`.`statusID` ".
|
||||
"LEFT JOIN `ttstatid` ON `ttstatid`.`maxLogID` = `tblDocumentStatusLog`.`statusLogID` ".
|
||||
"LEFT JOIN `ttcontentid` ON `ttcontentid`.`maxVersion` = `tblDocumentStatus`.`version` AND `ttcontentid`.`document` = `tblDocumentStatus`.`documentID` ".
|
||||
"LEFT JOIN `tblDocumentLocks` ON `tblDocuments`.`id`=`tblDocumentLocks`.`document` ".
|
||||
"LEFT JOIN `tblUsers` AS `oTbl` on `oTbl`.`id` = `tblDocuments`.`owner` ".
|
||||
"LEFT JOIN `tblUsers` AS `sTbl` on `sTbl`.`id` = `tblDocumentStatusLog`.`userID` ".
|
||||
"WHERE `ttstatid`.`maxLogID`=`tblDocumentStatusLog`.`statusLogID` ".
|
||||
"AND `ttcontentid`.`maxVersion` = `tblDocumentContent`.`version` ".
|
||||
"AND `tblDocuments`.`owner` = '".$user->getID()."' ";
|
||||
|
||||
if ($orderby=='e') $queryStr .= "ORDER BY `expires`";
|
||||
else if ($orderby=='u') $queryStr .= "ORDER BY `statusDate`";
|
||||
else if ($orderby=='s') $queryStr .= "ORDER BY `status`";
|
||||
else $queryStr .= "ORDER BY `name`";
|
||||
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
UI::contentHeading(getMLText("warning"));
|
||||
UI::contentContainer(getMLText("internal_error_exit"));
|
||||
UI::htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::contentHeading(getMLText("all_documents"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
if (count($resArr)>0) {
|
||||
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th><a href=\"../out/out.MyDocuments.php?orderby=n\">".getMLText("name")."</a></th>\n";
|
||||
print "<th><a href=\"../out/out.MyDocuments.php?orderby=s\">".getMLText("status")."</a></th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th><a href=\"../out/out.MyDocuments.php?orderby=u\">".getMLText("last_update")."</a></th>\n";
|
||||
print "<th><a href=\"../out/out.MyDocuments.php?orderby=e\">".getMLText("expires")."</a></th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
foreach ($resArr as $res) {
|
||||
|
||||
// verify expiry
|
||||
if ( $res["expires"] && time()>$res["expires"]+24*60*60 ){
|
||||
if ( $res["status"]==S_DRAFT_APP || $res["status"]==S_DRAFT_REV ){
|
||||
$res["status"]=S_EXPIRED;
|
||||
}
|
||||
}
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$res["documentID"]."\">" . htmlspecialchars($res["name"]) . "</a></td>\n";
|
||||
print "<td>".getOverallStatusText($res["status"])."</td>";
|
||||
print "<td>".$res["version"]."</td>";
|
||||
print "<td>".$res["statusDate"]." ". htmlspecialchars($res["statusName"])."</td>";
|
||||
//print "<td>".(!$res["expires"] ? getMLText("does_not_expire"):getReadableDate($res["expires"]))."</td>";
|
||||
print "<td>".(!$res["expires"] ? "-":getReadableDate($res["expires"]))."</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</tbody></table>";
|
||||
}
|
||||
else printMLText("empty_notify_list");
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'orderby'=>$orderby, 'showinprocess'=>$showInProcess));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
||||
?>
|
||||
|
|
|
@ -26,187 +26,30 @@ include("../inc/inc.Language.php");
|
|||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
function tree($folder, $repair, $path=':', $indent='') { /* {{{ */
|
||||
global $dms, $repair, $needsrepair;
|
||||
|
||||
/* Don't do folderlist check for root folder */
|
||||
if($path != ':') {
|
||||
$folderList = $folder->getFolderList();
|
||||
/* Check the folder */
|
||||
if($folderList != $path) {
|
||||
print "<tr>\n";
|
||||
$needsrepair = true;
|
||||
print "<td><a class=\"standardText\" href=\"../out/out.ViewFolder.php?folderid=".$folder->getID()."\"><img src=\"../out/images/folder_closed.gif\" width=18 height=18 border=0></a></td>";
|
||||
print "<td><a class=\"standardText\" href=\"../out/out.ViewFolder.php?folderid=".$folder->getID()."\">";
|
||||
$tmppath = $folder->getPath();
|
||||
for ($i = 1; $i < count($tmppath); $i++) {
|
||||
print "/".htmlspecialchars($tmppath[$i]->getName());
|
||||
}
|
||||
print $foldername;
|
||||
print "</a></td>";
|
||||
|
||||
$owner = $folder->getOwner();
|
||||
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
||||
print "<td>Folderlist is '".$folderList."', should be '".$path."'</td>";
|
||||
if($repair) {
|
||||
$folder->repair();
|
||||
print "<td><span class=\"success\">Repaired</span></td>\n";
|
||||
} else {
|
||||
print "<td></td>\n";
|
||||
}
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$subfolders = $folder->getSubFolders();
|
||||
foreach($subfolders as $subfolder) {
|
||||
tree($subfolder, $indent.' ', $path.$folder->getId().':');
|
||||
}
|
||||
$path .= $folder->getId().':';
|
||||
$documents = $folder->getDocuments();
|
||||
foreach($documents as $document) {
|
||||
/* Check the folder list of the document */
|
||||
$folderList = $document->getFolderList();
|
||||
if($folderList != $path) {
|
||||
print "<tr>\n";
|
||||
$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()."\">/";
|
||||
$folder = $document->getFolder();
|
||||
$tmppath = $folder->getPath();
|
||||
for ($i = 1; $i < count($tmppath); $i++) {
|
||||
print htmlspecialchars($tmppath[$i]->getName())."/";
|
||||
}
|
||||
print htmlspecialchars($document->getName());
|
||||
print "</a></td>";
|
||||
$owner = $document->getOwner();
|
||||
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
||||
print "<td>Folderlist is '".$folderList."', should be '".$path."'</td>";
|
||||
if($repair) {
|
||||
$document->repair();
|
||||
print "<td><span class=\"success\">Repaired</span></td>\n";
|
||||
} else {
|
||||
print "<td></td>\n";
|
||||
}
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
/* Check if the content is available */
|
||||
$versions = $document->getContent();
|
||||
if($versions) {
|
||||
foreach($versions as $version) {
|
||||
$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()."\">/";
|
||||
$folder = $document->getFolder();
|
||||
$tmppath = $folder->getPath();
|
||||
for ($i = 1; $i < count($tmppath); $i++) {
|
||||
print htmlspecialchars($tmppath[$i]->getName())."/";
|
||||
}
|
||||
print htmlspecialchars($document->getName());
|
||||
print "</a></td>";
|
||||
$owner = $document->getOwner();
|
||||
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
||||
print "<td>Document content of version ".$version->getVersion()." is missing ('".$path."')</td>";
|
||||
if($repair) {
|
||||
print "<td><span class=\"warning\">Cannot repaired</span></td>\n";
|
||||
} else {
|
||||
print "<td></td>\n";
|
||||
}
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print "<tr>\n";
|
||||
print "<td></td>\n";
|
||||
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\">/";
|
||||
$folder = $document->getFolder();
|
||||
$tmppath = $folder->getPath();
|
||||
for ($i = 1; $i < count($tmppath); $i++) {
|
||||
print htmlspecialchars($tmppath[$i]->getName())."/";
|
||||
}
|
||||
print htmlspecialchars($document->getName());
|
||||
print "</a></td>";
|
||||
$owner = $document->getOwner();
|
||||
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
||||
print "<td>Document has no content! Delete the document manually.</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$v = new LetoDMS_Version;
|
||||
|
||||
UI::htmlStartPage(getMLText("admin_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
UI::contentHeading(getMLText("objectcheck"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
if(isset($_GET['repair']) && $_GET['repair'] == 1) {
|
||||
$repair = 1;
|
||||
echo "<p>".getMLText('repairing_objects')."</p>";
|
||||
} else {
|
||||
$repair = 0;
|
||||
}
|
||||
|
||||
$folder = $dms->getFolder($settings->_rootFolderID);
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("owner")."</th>\n";
|
||||
print "<th>".getMLText("error")."</th>\n";
|
||||
print "<th></th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$needsrepair = false;
|
||||
tree($folder, $repair);
|
||||
print "</tbody></table>\n";
|
||||
|
||||
if($needsrepair && $repair == 0) {
|
||||
echo '<p><a href="out.ObjectCheck.php?repair=1">'.getMLText('do_object_repair').'</a></p>';
|
||||
}
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::contentHeading(getMLText("unlinked_content"));
|
||||
UI::contentContainerStart();
|
||||
if(isset($_GET['unlink']) && $_GET['unlink'] == 1) {
|
||||
$unlink = 1;
|
||||
echo "<p>".getMLText('unlinking_objects')."</p>";
|
||||
} else {
|
||||
$unlink = 0;
|
||||
}
|
||||
|
||||
if($versions = $dms->getUnlinkedDocumentContent()) {
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th>".getMLText("document")."</th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th>".getMLText("original_filename")."</th>\n";
|
||||
print "<th>".getMLText("mimetype")."</th>\n";
|
||||
print "<th></th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
foreach($versions as $version) {
|
||||
$doc = $version->getDocument();
|
||||
print "<tr><td>".$doc->getId()."</td><td>".$version->getVersion()."</td><td>".$version->getOriginalFileName()."</td><td>".$version->getMimeType()."</td>";
|
||||
if($unlink) {
|
||||
$doc->removeContent($version);
|
||||
}
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</tbody></table>\n";
|
||||
if($unlink == 0) {
|
||||
echo '<p><a href="out.ObjectCheck.php?unlink=1">'.getMLText('do_object_unlink').'</a></p>';
|
||||
}
|
||||
$folder = $dms->getFolder($settings->_rootFolderID);
|
||||
$versions = $dms->getUnlinkedDocumentContent();
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'unlinkedcontent'=>$versions, 'unlink'=>$unlink, 'repair'=>$repair));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,121 +1,68 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
$documentid = intval($_GET["documentid"]);
|
||||
$document = $dms->getDocument($documentid);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
if (!is_object($document)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
if ($document->getAccessMode($user) < M_ALL) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (!isset($_GET["version"]) || !is_numeric($_GET["version"]) || intval($_GET["version"])<1) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
$version = $_GET["version"];
|
||||
$content = $document->getContentByVersion($version);
|
||||
|
||||
if (!is_object($content)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
|
||||
$content = $document->getContentByVersion($_GET["version"]);
|
||||
|
||||
if (!is_object($content)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
|
||||
$overallStatus = $content->getStatus();
|
||||
|
||||
// status change control
|
||||
if ($overallStatus["status"] == S_REJECTED || $overallStatus["status"] == S_EXPIRED || $overallStatus["status"] == S_DRAFT_REV || $overallStatus["status"] == S_DRAFT_APP ) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("cannot_change_final_states"));
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("cannot_change_final_states"));
|
||||
}
|
||||
|
||||
$reviewStatus = $content->getReviewStatus();
|
||||
$approvalStatus = $content->getApprovalStatus();
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
$folder = $document->getFolder();
|
||||
|
||||
UI::contentHeading(getMLText("change_status"));
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.overrideStatus.value == "") msg += "<?php printMLText("js_no_override_status");?>\n";
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
|
||||
UI::contentContainerStart();
|
||||
|
||||
// Display the Review form.
|
||||
?>
|
||||
<form method="POST" action="../op/op.OverrideContentStatus.php" name="form1" onsubmit="return checkForm();">
|
||||
<table>
|
||||
<tr><td><?php echo(printMLText("comment")); ?></td>
|
||||
<td><textarea name="comment" cols="40" rows="4"></textarea>
|
||||
</td></tr>
|
||||
<tr><td><?php echo(printMLText("status")); ?></td>
|
||||
<td><select name="overrideStatus">
|
||||
<option value=''></option>
|
||||
<?php
|
||||
$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->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($overallStatus["status"] == S_OBSOLETE) echo "<option value='".S_RELEASED."'>".getOverallStatusText(S_RELEASED)."</option>";
|
||||
if ($overallStatus["status"] == S_RELEASED) echo "<option value='".S_OBSOLETE."'>".getOverallStatusText(S_OBSOLETE)."</option>";
|
||||
|
||||
?>
|
||||
</select>
|
||||
</td></tr><tr><td></td><td>
|
||||
<input type='hidden' name='documentid' value='<?php echo $documentid ?>'/>
|
||||
<input type='hidden' name='version' value='<?php echo $version ?>'/>
|
||||
<input type='submit' name='overrideContentStatus' value='<?php echo(printMLText("update")); ?>'/>
|
||||
</td></tr></table>
|
||||
</form>
|
||||
<?php
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -22,36 +22,16 @@ include("../inc/inc.Settings.php");
|
|||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
|
||||
UI::htmlStartPage(getMLText("password_forgotten"), "login");
|
||||
UI::globalBanner();
|
||||
UI::pageNavigation(getMLText("password_forgotten"));
|
||||
?>
|
||||
|
||||
<?php UI::contentContainerStart(); ?>
|
||||
<form action="../op/op.PasswordForgotten.php" method="post" name="form1" onsubmit="return checkForm();">
|
||||
<?php
|
||||
if (isset($_REQUEST["referuri"]) && strlen($_REQUEST["referuri"])>0) {
|
||||
echo "<input type='hidden' name='referuri' value='".$_REQUEST["referuri"]."'/>";
|
||||
$referrer = $_REQUEST["referuri"];
|
||||
} else {
|
||||
$referrer = '';
|
||||
}
|
||||
?>
|
||||
<p><?php printMLText("password_forgotten_text"); ?></p>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td><?php printMLText("login");?></td>
|
||||
<td><input name="login" id="login"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("email");?></td>
|
||||
<td><input name="email" id="email"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("submit_password_forgotten") ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php UI::contentContainerEnd(); ?>
|
||||
<script language="JavaScript">document.form1.email.focus();</script>
|
||||
<p><a href="../out/out.Login.php"><?php echo getMLText("login"); ?></a></p>
|
||||
<?php
|
||||
UI::htmlEndPage();
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('referrer'=>$referrer));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,51 +1,42 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
<?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");
|
||||
//
|
||||
// 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.Language.php");
|
||||
include("../inc/inc.ClassUI.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"));
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (!isset($_GET["arkname"]) || !file_exists($settings->_contentDir.$_GET["arkname"]) ) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("unknown_id"));
|
||||
|
||||
if (!isset($_GET["arkname"]) || !file_exists($settings->_contentDir.$_GET["arkname"]) ) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("unknown_id"));
|
||||
}
|
||||
|
||||
$arkname = $_GET["arkname"];
|
||||
|
||||
UI::htmlStartPage(getMLText("backup_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
UI::contentHeading(getMLText("backup_remove"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<form action="../op/op.RemoveArchive.php" name="form1" method="POST">
|
||||
<input type="Hidden" name="arkname" value="<?php echo sanitizeString($arkname); ?>">
|
||||
<?php echo createHiddenFieldWithKey('removearchive'); ?>
|
||||
<p><?php printMLText("confirm_rm_backup", array ("arkname" => sanitizeString($arkname)));?></p>
|
||||
<input type="Submit" value="<?php printMLText("backup_remove");?>">
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
||||
$arkname = $_GET["arkname"];
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'archive'=>$arkname));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,63 +1,50 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
}
|
||||
$documentid = intval($_GET["documentid"]);
|
||||
$document = $dms->getDocument($documentid);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
}
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
if (!is_object($document)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
if ($document->getAccessMode($user) < M_ALL) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
UI::contentHeading(getMLText("rm_document"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<form action="../op/op.RemoveDocument.php" name="form1" method="POST">
|
||||
<input type="Hidden" name="documentid" value="<?php print $documentid;?>">
|
||||
<?php echo createHiddenFieldWithKey('removedocument'); ?>
|
||||
<p>
|
||||
<?php printMLText("confirm_rm_document", array ("documentname" => htmlspecialchars($document->getName())));?>
|
||||
</p>
|
||||
<p><input type="Submit" value="<?php printMLText("rm_document");?>"></p>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$folder = $document->getFolder();
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,73 +1,59 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
<?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.Utils.php");
|
||||
//
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
}
|
||||
|
||||
$documentid = intval($_GET["documentid"]);
|
||||
$document = $dms->getDocument($documentid);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
if (!isset($_GET["fileid"]) || !is_numeric($_GET["fileid"]) || intval($_GET["fileid"])<1) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_file_id"));
|
||||
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
if (!is_object($document)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
$fileid = $_GET["fileid"];
|
||||
$file = $document->getDocumentFile($fileid);
|
||||
|
||||
if (!is_object($file)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_file_id"));
|
||||
|
||||
if (!isset($_GET["fileid"]) || !is_numeric($_GET["fileid"]) || intval($_GET["fileid"])<1) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_file_id"));
|
||||
}
|
||||
|
||||
$file = $document->getDocumentFile($_GET["fileid"]);
|
||||
|
||||
if (!is_object($file)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_file_id"));
|
||||
}
|
||||
|
||||
if (($document->getAccessMode($user) < M_ALL)&&($user->getID()!=$file->getUserID())) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$folder = $document->getFolder();
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
UI::contentHeading(getMLText("rm_file"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<form action="../op/op.RemoveDocumentFile.php" name="form1" method="POST">
|
||||
<?php echo createHiddenFieldWithKey('removedocumentfile'); ?>
|
||||
<input type="Hidden" name="documentid" value="<?php echo $documentid?>">
|
||||
<input type="Hidden" name="fileid" value="<?php echo $fileid?>">
|
||||
<p><?php printMLText("confirm_rm_file", array ("documentname" => htmlspecialchars($document->getName()), "name" => htmlspecialchars($file->getName())));?></p>
|
||||
<input type="Submit" value="<?php printMLText("rm_file");?>">
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'file'=>$file));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,51 +1,42 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
<?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");
|
||||
//
|
||||
// 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.Language.php");
|
||||
include("../inc/inc.ClassUI.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"));
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (!isset($_GET["dumpname"]) || !file_exists($settings->_contentDir.$_GET["dumpname"]) ) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("unknown_id"));
|
||||
|
||||
if (!isset($_GET["dumpname"]) || !file_exists($settings->_contentDir.$_GET["dumpname"]) ) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("unknown_id"));
|
||||
}
|
||||
|
||||
$dumpname = $_GET["dumpname"];
|
||||
|
||||
UI::htmlStartPage(getMLText("backup_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
UI::contentHeading(getMLText("dump_remove"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<form action="../op/op.RemoveDump.php" name="form1" method="POST">
|
||||
<input type="Hidden" name="dumpname" value="<?php echo sanitizeString($dumpname); ?>">
|
||||
<?php echo createHiddenFieldWithKey('removedump'); ?>
|
||||
<p><?php printMLText("confirm_rm_dump", array ("dumpname" => sanitizeString($dumpname)));?></p>
|
||||
<input type="Submit" value="<?php printMLText("dump_remove");?>">
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
||||
$dumpname = $_GET["dumpname"];
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'dumpfile'=>$dumpname));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,56 +1,46 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
<?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");
|
||||
//
|
||||
// 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.Language.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Calendar.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!isset($_GET["id"]) || !is_numeric($_GET["id"]) || intval($_GET["id"])<1) {
|
||||
UI::exitError(getMLText("edit_event"),getMLText("error_occured"));
|
||||
include("../inc/inc.Calendar.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!isset($_GET["id"]) || !is_numeric($_GET["id"]) || intval($_GET["id"])<1) {
|
||||
UI::exitError(getMLText("edit_event"),getMLText("error_occured"));
|
||||
}
|
||||
|
||||
|
||||
$event=getEvent($_GET["id"]);
|
||||
|
||||
if (is_bool($event)&&!$event){
|
||||
UI::exitError(getMLText("edit_event"),getMLText("error_occured"));
|
||||
}
|
||||
if (($user->getID()!=$event["userID"])&&(!$user->isAdmin())){
|
||||
if (($user->getID()!=$event["userID"])&&(!$user->isAdmin())){
|
||||
UI::exitError(getMLText("edit_event"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("calendar"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("calendar"), "calendar");
|
||||
|
||||
UI::contentHeading(getMLText("edit_event"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<form action="../op/op.RemoveEvent.php" name="form1" method="POST">
|
||||
<?php echo createHiddenFieldWithKey('removeevent'); ?>
|
||||
<input type="Hidden" name="eventid" value="<?php echo intval($_GET["id"]); ?>">
|
||||
<p><?php printMLText("confirm_rm_event", array ("name" => htmlspecialchars($event["name"])));?></p>
|
||||
<input type="Submit" value="<?php printMLText("delete");?>">
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'event'=>$event));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,67 +1,52 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folderid = $_GET["folderid"];
|
||||
$folder = $dms->getFolder($folderid);
|
||||
|
||||
if (!is_object($folder)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folderPathHTML = getFolderPathHTML($folder, true);
|
||||
|
||||
if ($folderid == $settings->_rootFolderID || !$folder->getParent()) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("cannot_rm_root"));
|
||||
}
|
||||
|
||||
if ($folder->getAccessMode($user) < M_ALL) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.
|
||||
|
||||
UI::htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($folderPathHTML, "view_folder", $folder);
|
||||
UI::contentHeading(getMLText("rm_folder"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<form action="../op/op.RemoveFolder.php" method="post" name="form1">
|
||||
<input type="Hidden" name="folderid" value="<?php print $folderid;?>">
|
||||
<input type="Hidden" name="showtree" value="<?php echo showtree();?>">
|
||||
<?php echo createHiddenFieldWithKey('removefolder'); ?>
|
||||
<p>
|
||||
<?php printMLText("confirm_rm_folder", array ("foldername" => htmlspecialchars($folder->getName())));?>
|
||||
</p>
|
||||
<p><input type="Submit" value="<?php printMLText("rm_folder");?>"></p>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
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.Authentication.php");
|
||||
|
||||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folder = $dms->getFolder($_GET["folderid"]);
|
||||
|
||||
if (!is_object($folder)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
if ($folder->getID() == $settings->_rootFolderID || !$folder->getParent()) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("cannot_rm_root"));
|
||||
}
|
||||
|
||||
if ($folder->getAccessMode($user) < M_ALL) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,57 +1,46 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
<?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");
|
||||
//
|
||||
// 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.Language.php");
|
||||
include("../inc/inc.ClassUI.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"));
|
||||
}
|
||||
|
||||
if (!isset($_GET["targetidform3"]) || !is_numeric($_GET["targetidform3"]) || intval($_GET["targetidform3"])<1) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("invalid_folder_id"));
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$folderid = intval($_GET["targetidform3"]);
|
||||
$folder = $dms->getFolder($folderid);
|
||||
|
||||
if (!is_object($folder)) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("files_deletion"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
|
||||
UI::contentHeading(getMLText("files_deletion"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<form action="../op/op.RemoveFolderFiles.php" name="form1" method="POST">
|
||||
<?php echo createHiddenFieldWithKey('removefolderfiles'); ?>
|
||||
<input type="Hidden" name="folderid" value="<?php echo $folderid?>">
|
||||
<p><?php printMLText("confirm_rm_folder_files", array ("foldername" => htmlspecialchars($folder->getName())));?></p>
|
||||
<input type="Submit" value="<?php printMLText("accept");?>">
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
if (!isset($_GET["targetidform3"]) || !is_numeric($_GET["targetidform3"]) || intval($_GET["targetidform3"])<1) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folder = $dms->getFolder(intval($_GET["targetidform3"]));
|
||||
|
||||
if (!is_object($folder)) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,60 +1,47 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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");
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
//
|
||||
// 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.Language.php");
|
||||
include("../inc/inc.ClassUI.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"));
|
||||
}
|
||||
|
||||
if (!isset($_GET["groupid"]) || !is_numeric($_GET["groupid"]) || intval($_GET["groupid"])<1) {
|
||||
UI::exitError(getMLText("rm_group"),getMLText("invalid_user_id"));
|
||||
}
|
||||
$groupid = intval($_GET["groupid"]);
|
||||
$currGroup = $dms->getGroup($groupid);
|
||||
|
||||
if (!is_object($currGroup)) {
|
||||
UI::exitError(getMLText("rm_group"),getMLText("invalid_group_id"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("admin_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
UI::contentHeading(getMLText("rm_group"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<form action="../op/op.GroupMgr.php" name="form1" method="POST">
|
||||
<input type="Hidden" name="groupid" value="<?php print $groupid;?>">
|
||||
<input type="Hidden" name="action" value="removegroup">
|
||||
<?php echo createHiddenFieldWithKey('removegroup'); ?>
|
||||
<p>
|
||||
<?php printMLText("confirm_rm_group", array ("groupname" => htmlspecialchars($currGroup->getName())));?>
|
||||
</p>
|
||||
<p><input type="Submit" value="<?php printMLText("rm_group");?>"></p>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (!isset($_GET["groupid"]) || !is_numeric($_GET["groupid"]) || intval($_GET["groupid"])<1) {
|
||||
UI::exitError(getMLText("rm_group"),getMLText("invalid_user_id"));
|
||||
}
|
||||
$group = $dms->getGroup(intval($_GET["groupid"]));
|
||||
|
||||
if (!is_object($group)) {
|
||||
UI::exitError(getMLText("rm_group"),getMLText("invalid_group_id"));
|
||||
}
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'group'=>$group));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,51 +1,42 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
<?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");
|
||||
//
|
||||
// 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.Language.php");
|
||||
include("../inc/inc.ClassUI.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"));
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (!isset($_GET["logname"]) || !file_exists($settings->_contentDir.$_GET["logname"]) ) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("unknown_id"));
|
||||
|
||||
if (!isset($_GET["logname"]) || !file_exists($settings->_contentDir.$_GET["logname"]) ) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("unknown_id"));
|
||||
}
|
||||
|
||||
$logname = sanitizeString($_GET["logname"]);
|
||||
|
||||
UI::htmlStartPage(getMLText("backup_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
UI::contentHeading(getMLText("rm_file"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<form action="../op/op.RemoveLog.php" name="form1" method="POST">
|
||||
<?php echo createHiddenFieldWithKey('removelog'); ?>
|
||||
<input type="Hidden" name="logname" value="<?php echo $logname?>">
|
||||
<p><?php printMLText("confirm_rm_log", array ("logname" => $logname));?></p>
|
||||
<input type="Submit" value="<?php printMLText("rm_file");?>">
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
||||
$logname = sanitizeString($_GET["logname"]);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'logname'=>$logname));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -32,52 +32,23 @@ if (!isset($_GET["userid"]) || !is_numeric($_GET["userid"]) || intval($_GET["use
|
|||
UI::exitError(getMLText("rm_user"),getMLText("invalid_user_id"));
|
||||
}
|
||||
|
||||
$userid = intval($_GET["userid"]);
|
||||
$currUser = $dms->getUser($userid);
|
||||
$rmuser = $dms->getUser(intval($_GET["userid"]));
|
||||
|
||||
if ($userid==$user->getID()) {
|
||||
if ($rmuser->getID()==$user->getID()) {
|
||||
UI::exitError(getMLText("rm_user"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (!is_object($currUser)) {
|
||||
if (!is_object($rmuser)) {
|
||||
UI::exitError(getMLText("rm_user"),getMLText("invalid_user_id"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("admin_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
UI::contentHeading(getMLText("rm_user"));
|
||||
UI::contentContainerStart();
|
||||
$allusers = $dms->getAllUsers($settings->_sortUsersInList);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'rmuser'=>$rmuser, 'allusers'=>$allusers));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<form action="../op/op.UsrMgr.php" name="form1" method="POST">
|
||||
<input type="Hidden" name="userid" value="<?php print $userid;?>">
|
||||
<input type="Hidden" name="action" value="removeuser">
|
||||
<?php echo createHiddenFieldWithKey('removeuser'); ?>
|
||||
<p>
|
||||
<?php printMLText("confirm_rm_user", array ("username" => htmlspecialchars($currUser->getFullName())));?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php printMLText("assign_user_property_to"); ?> :
|
||||
<select name="assignTo">
|
||||
<?php
|
||||
$users = $dms->getAllUsers($settings->_sortUsersInList);
|
||||
foreach ($users as $currUser) {
|
||||
if ($currUser->isGuest() || ($currUser->getID() == $userid) )
|
||||
continue;
|
||||
|
||||
if (isset($_GET["userid"]) && $currUser->getID()==$_GET["userid"]) $selected=$count;
|
||||
print "<option value=\"".$currUser->getID()."\">" . htmlspecialchars($currUser->getLogin()." - ".$currUser->getFullName());
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
<p><input type="Submit" value="<?php printMLText("rm_user");?>"></p>
|
||||
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,78 +1,66 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.Utils.php");
|
||||
//
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
}
|
||||
|
||||
$documentid = intval($_GET["documentid"]);
|
||||
$document = $dms->getDocument($documentid);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
|
||||
$document = $dms->getDocument(intval($_GET["documentid"]));
|
||||
|
||||
if (!is_object($document)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
if (!$settings->_enableVersionDeletion && !$user->isAdmin()) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if ($document->getAccessMode($user) < M_ALL) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (!isset($_GET["version"]) || !is_numeric($_GET["version"]) || intval($_GET["version"])<1) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
$version = $_GET["version"];
|
||||
$version = $document->getContentByVersion($version);
|
||||
|
||||
if (!is_object($version)) {
|
||||
|
||||
if (!isset($_GET["version"]) || !is_numeric($_GET["version"]) || intval($_GET["version"])<1) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
UI::contentHeading(getMLText("rm_version"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<form action="../op/op.RemoveVersion.php" name="form1" method="POST">
|
||||
<?php echo createHiddenFieldWithKey('removeversion'); ?>
|
||||
<input type="Hidden" name="documentid" value="<?php echo $documentid?>">
|
||||
<input type="Hidden" name="version" value="<?php echo $version->getVersion()?>">
|
||||
<p><?php printMLText("confirm_rm_version", array ("documentname" => htmlspecialchars($document->getName()), "version" => $version->getVersion()));?></p>
|
||||
<input type="Submit" value="<?php printMLText("rm_version");?>">
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
$version = $_GET["version"];
|
||||
$version = $document->getContentByVersion($version);
|
||||
|
||||
if (!is_object($version)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
$folder = $document->getFolder();
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -29,15 +29,13 @@ if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_
|
|||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
$documentid = intval($_GET["documentid"]);
|
||||
$document = $dms->getDocument($documentid);
|
||||
$document = $dms->getDocument(intval($_GET["documentid"]));
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
if ($document->getAccessMode($user) < M_READ) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
|
@ -62,140 +60,16 @@ if ($document->hasExpired()){
|
|||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$reviews = $latestContent->getReviewStatus();
|
||||
$reviews = $content->getReviewStatus();
|
||||
if(!$reviews) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("no_action"));
|
||||
}
|
||||
|
||||
foreach($reviews as $review) {
|
||||
if($review['reviewID'] == $_GET['reviewid']) {
|
||||
$reviewStatus = $review;
|
||||
break;
|
||||
}
|
||||
$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->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
UI::contentHeading(getMLText("submit_review"));
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkIndForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.reviewStatus.value == "") msg += "<?php printMLText("js_no_review_status");?>\n";
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
function checkGrpForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.reviewGroup.value == "") msg += "<?php printMLText("js_no_review_group");?>\n";
|
||||
if (document.form1.reviewStatus.value == "") msg += "<?php printMLText("js_no_review_status");?>\n";
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
UI::contentContainerStart();
|
||||
|
||||
// Display the Review form.
|
||||
if ($reviewStatus['type'] == 0) {
|
||||
if($reviewStatus["status"]!=0) {
|
||||
|
||||
print "<table class=\"folderView\"><thead><tr>";
|
||||
print "<th>".getMLText("status")."</th>";
|
||||
print "<th>".getMLText("comment")."</th>";
|
||||
print "<th>".getMLText("last_update")."</th>";
|
||||
print "</tr></thead><tbody><tr>";
|
||||
print "<td>";
|
||||
printReviewStatusText($reviewStatus["status"]);
|
||||
print "</td>";
|
||||
print "<td>".htmlspecialchars($reviewStatus["comment"])."</td>";
|
||||
$indUser = $dms->getUser($reviewStatus["userID"]);
|
||||
print "<td>".$reviewStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
|
||||
print "</tr></tbody></table><br>";
|
||||
}
|
||||
?>
|
||||
<form method="post" action="../op/op.ReviewDocument.php" name="form1" onsubmit="return checkIndForm();">
|
||||
<?php echo createHiddenFieldWithKey('reviewdocument'); ?>
|
||||
<table>
|
||||
<tr><td class='infos' valign='top'><?php printMLText("comment")?>:</td>
|
||||
<td class='infos' valign='top'><textarea name="comment" cols="80" rows="4"></textarea>
|
||||
</td></tr>
|
||||
<tr><td><?php printMLText("review_status")?></td>
|
||||
<td><select name="reviewStatus">
|
||||
<option value=''></option>
|
||||
<option value='1'><?php printMLText("status_reviewed")?></option>
|
||||
<option value='-1'><?php printMLText("rejected")?></option>
|
||||
</select>
|
||||
</td></tr><tr><td></td><td>
|
||||
<input type='hidden' name='reviewType' value='ind'/>
|
||||
<input type='hidden' name='documentid' value='<?php echo $documentid ?>'/>
|
||||
<input type='hidden' name='version' value='<?php echo $version ?>'/>
|
||||
<input type='submit' name='indReview' value='<?php printMLText("submit_review")?>'/>
|
||||
</td></tr></table>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
else if ($reviewStatus['type'] == 1) {
|
||||
|
||||
if($reviewStatus["status"]!=0) {
|
||||
|
||||
print "<table class=\"folderView\"><thead><tr>";
|
||||
print "<th>".getMLText("status")."</th>";
|
||||
print "<th>".getMLText("comment")."</th>";
|
||||
print "<th>".getMLText("last_update")."</th>";
|
||||
print "</tr></thead><tbody><tr>";
|
||||
print "<td>";
|
||||
printReviewStatusText($reviewStatus["status"]);
|
||||
print "</td>";
|
||||
print "<td>".htmlspecialchars($reviewStatus["comment"])."</td>";
|
||||
$indUser = $dms->getUser($reviewStatus["userID"]);
|
||||
print "<td>".$reviewStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
|
||||
print "</tr></tbody></table><br>\n";
|
||||
}
|
||||
|
||||
?>
|
||||
<form method="POST" action="../op/op.ReviewDocument.php" name="form1" onsubmit="return checkGrpForm();">
|
||||
<table>
|
||||
<tr><td><?php printMLText("comment")?>:</td>
|
||||
<td><textarea name="comment" cols="80" rows="4"></textarea>
|
||||
</td></tr>
|
||||
<tr><td><?php printMLText("review_status")?>:</td>
|
||||
<td>
|
||||
<select name="reviewStatus">
|
||||
<option value=''></option>
|
||||
<option value='1'><?php printMLText("status_reviewed")?></option>
|
||||
<option value='-1'><?php printMLText("rejected")?></option>
|
||||
</select>
|
||||
</td></tr>
|
||||
<tr><td></td><td>
|
||||
<input type='hidden' name='reviewType' value='grp'/>
|
||||
<input type='hidden' name='reviewGroup' value='<?php echo $reviewStatus['required']; ?>'/>
|
||||
<input type='hidden' name='documentid' value='<?php echo $documentid ?>'/>
|
||||
<input type='hidden' name='version' value='<?php echo $version ?>'/>
|
||||
<input type='submit' name='groupReview' value='<?php printMLText("submit_review")?>'/></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,186 +1,38 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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");
|
||||
//
|
||||
// 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.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if ($user->isGuest()) {
|
||||
UI::exitError(getMLText("my_documents"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (!$db->createTemporaryTable("ttstatid")) {
|
||||
UI::exitError(getMLText("review_summary"),getMLText("internal_error_exit"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("my_documents"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("my_documents"), "my_documents");
|
||||
|
||||
UI::contentHeading(getMLText("review_summary"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
// TODO: verificare scadenza
|
||||
|
||||
// Get document list for the current user.
|
||||
$reviewStatus = $user->getReviewStatus();
|
||||
|
||||
// reverse order
|
||||
$reviewStatus["indstatus"]=array_reverse($reviewStatus["indstatus"],true);
|
||||
$reviewStatus["grpstatus"]=array_reverse($reviewStatus["grpstatus"],true);
|
||||
|
||||
// Create a comma separated list of all the documentIDs whose information is
|
||||
// required.
|
||||
$dList = array();
|
||||
foreach ($reviewStatus["indstatus"] as $st) {
|
||||
if (!in_array($st["documentID"], $dList)) {
|
||||
$dList[] = $st["documentID"];
|
||||
}
|
||||
}
|
||||
foreach ($reviewStatus["grpstatus"] as $st) {
|
||||
if (!in_array($st["documentID"], $dList)) {
|
||||
$dList[] = $st["documentID"];
|
||||
}
|
||||
}
|
||||
$docCSV = "";
|
||||
foreach ($dList as $d) {
|
||||
$docCSV .= (strlen($docCSV)==0 ? "" : ", ")."'".$d."'";
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (strlen($docCSV)>0) {
|
||||
|
||||
$queryStr = "SELECT `tblDocuments`.*, `tblDocumentLocks`.`userID` as `lockUser`, ".
|
||||
"`tblDocumentStatus`.*, `tblDocumentStatusLog`.`status`, ".
|
||||
"`tblDocumentStatusLog`.`comment` AS `statusComment`, `tblDocumentStatusLog`.`date` as `statusDate`, ".
|
||||
"`tblDocumentStatusLog`.`userID`, `oTbl`.`fullName` AS `ownerName`, `sTbl`.`fullName` AS `statusName` ".
|
||||
"FROM `tblDocumentStatus` ".
|
||||
"LEFT JOIN `tblDocumentStatusLog` USING (`statusID`) ".
|
||||
"LEFT JOIN `ttstatid` on `ttstatid`.`maxLogID` = `tblDocumentStatusLog`.`statusLogID` ".
|
||||
"LEFT JOIN `tblDocuments` ON `tblDocuments`.`id` = `tblDocumentStatus`.`documentID` ".
|
||||
"LEFT JOIN `tblDocumentLocks` ON `tblDocuments`.`id`=`tblDocumentLocks`.`document` ".
|
||||
"LEFT JOIN `tblUsers` AS `oTbl` on `oTbl`.`id` = `tblDocuments`.`owner` ".
|
||||
"LEFT JOIN `tblUsers` AS `sTbl` on `sTbl`.`id` = `tblDocumentStatusLog`.`userID` ".
|
||||
"WHERE `ttstatid`.`maxLogID`=`tblDocumentStatusLog`.`statusLogID` ".
|
||||
"AND `tblDocuments`.`id` IN (" . $docCSV . ") ".
|
||||
"ORDER BY `sequence`";
|
||||
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
UI::exitError(getMLText("review_summary"),getMLText("internal_error_exit"));
|
||||
}
|
||||
// Create an array to hold all of these results, and index the array by
|
||||
// document id. This makes it easier to retrieve document ID information
|
||||
// later on and saves us having to repeatedly poll the database every time
|
||||
// new document information is required.
|
||||
$docIdx = array();
|
||||
foreach ($resArr as $res) {
|
||||
|
||||
// verify expiry
|
||||
if ( $res["expires"] && time()>$res["expires"]+24*60*60 ){
|
||||
if ( $res["status"]==S_DRAFT_APP || $res["status"]==S_DRAFT_REV ){
|
||||
$res["status"]=S_EXPIRED;
|
||||
}
|
||||
}
|
||||
|
||||
$docIdx[$res["id"]][$res["version"]] = $res;
|
||||
}
|
||||
}
|
||||
|
||||
$printheader=true;
|
||||
$iRev = array();
|
||||
foreach ($reviewStatus["indstatus"] as $st) {
|
||||
if (isset($docIdx[$st["documentID"]][$st["version"]])) {
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("owner")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th>".getMLText("last_update")."</th>\n";
|
||||
print "<th>".getMLText("expires")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["name"])."</a></td>";
|
||||
print "<td>".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["ownerName"])."</td>";
|
||||
print "<td>".getOverallStatusText($docIdx[$st["documentID"]][$st["version"]]["status"])."</td>";
|
||||
print "<td>".$st["version"]."</td>";
|
||||
print "<td>".$st["date"]." ". htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["statusName"]) ."</td>";
|
||||
print "<td>".(!$docIdx[$st["documentID"]][$st["version"]]["expires"] ? "-":getReadableDate($docIdx[$st["documentID"]][$st["version"]]["expires"]))."</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
if ($st["status"]!=-2) {
|
||||
$iRev[] = $st["documentID"];
|
||||
}
|
||||
}
|
||||
if (!$printheader) {
|
||||
echo "</tbody>\n</table>";
|
||||
}else{
|
||||
printMLText("empty_notify_list");
|
||||
}
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::contentHeading(getMLText("group_review_summary"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
$printheader=true;
|
||||
foreach ($reviewStatus["grpstatus"] as $st) {
|
||||
if (!in_array($st["documentID"], $iRev) && isset($docIdx[$st["documentID"]][$st["version"]])) {
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("owner")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th>".getMLText("last_update")."</th>\n";
|
||||
print "<th>".getMLText("expires")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["name"])."</a></td>";
|
||||
print "<td>".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["ownerName"])."</td>";
|
||||
print "<td>".getOverallStatusText($docIdx[$st["documentID"]][$st["version"]]["status"])."</td>";
|
||||
print "<td>".$st["version"]."</td>";
|
||||
print "<td>".$st["date"]." ". htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["statusName"]) ."</td>";
|
||||
print "<td>".(!$docIdx[$st["documentID"]][$st["version"]]["expires"] ? "-":getReadableDate($docIdx[$st["documentID"]][$st["version"]]["expires"]))."</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
if (!$printheader) {
|
||||
echo "</tbody>\n</table>";
|
||||
}else{
|
||||
printMLText("empty_notify_list");
|
||||
}
|
||||
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -37,239 +37,15 @@ if (!is_object($folder)) {
|
|||
UI::exitError(getMLText("search"),getMLText("invalid_folder_id"));
|
||||
}
|
||||
|
||||
$folderPathHTML = getFolderPathHTML($folder, true);
|
||||
|
||||
UI::htmlStartPage(getMLText("search"));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($folderPathHTML, "", $folder);
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.query.value == "")
|
||||
{
|
||||
if (!document.form1.creationdate.checked && !document.form1.lastupdate.checked &&
|
||||
!document.form1.pendingReview.checked && !document.form1.pendingApproval.checked)
|
||||
msg += "<?php printMLText("js_no_query");?>\n";
|
||||
}
|
||||
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
UI::contentHeading(getMLText("search"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<?php
|
||||
if($settings->_enableFullSearch) {
|
||||
?>
|
||||
<div style="width: 35%; float: left;">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<h2><?php echo getMLText('databasesearch') ?></h2>
|
||||
<form action="../op/op.Search.php" name="form1" onsubmit="return checkForm();">
|
||||
<table class="searchform">
|
||||
<tr>
|
||||
<td><?php printMLText("search_query");?>:</td>
|
||||
<td>
|
||||
<input name="query">
|
||||
<select name="mode">
|
||||
<option value="1" selected><?php printMLText("search_mode_and");?><br>
|
||||
<option value="0"><?php printMLText("search_mode_or");?>
|
||||
</select>
|
||||
<br />
|
||||
<a href="javascript:chooseKeywords('form1.query');"><?php printMLText("use_default_keywords");?></a>
|
||||
<script language="JavaScript">
|
||||
var openDlg;
|
||||
|
||||
function chooseKeywords(target) {
|
||||
openDlg = open("out.KeywordChooser.php?target="+target, "openDlg", "width=500,height=400,scrollbars=yes,resizable=yes");
|
||||
}
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("search_in");?>:</td>
|
||||
<td><ul class="actions">
|
||||
<li class="first"><input type="Checkbox" id="keywords" name="searchin[]" value="1"><label for="keywords"><?php printMLText("keywords");?></label> (<?php printMLText('documents_only'); ?>)</li>
|
||||
<li><input type="Checkbox" name="searchin[]" id="searchName" value="2"><label for="searchName"><?php printMLText("name");?></label></li>
|
||||
<li><input type="Checkbox" name="searchin[]" id="comment" value="3"><label for="comment"><?php printMLText("comment");?></label></li>
|
||||
<li><input type="Checkbox" name="searchin[]" id="attributes" value="4"><label for="attributes"><?php printMLText("attributes");?></label></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_document, LetoDMS_Core_AttributeDefinition::objtype_documentcontent/*, LetoDMS_Core_AttributeDefinition::objtype_all*/));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||
<td><?php UI::printAttributeEditField($attrdef, '') ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?php printMLText("category");?>:<br />(<?php printMLText('documents_only'); ?>)</td>
|
||||
<td>
|
||||
<select name="categoryids[]" multiple>
|
||||
<option value="-1"><?php printMLText("all_categories");?>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_document, LetoDMS_Core_AttributeDefinition::objtype_documentcontent/*, LetoDMS_Core_AttributeDefinition::objtype_all*/));
|
||||
$allCats = $dms->getDocumentCategories();
|
||||
foreach ($allCats as $catObj) {
|
||||
print "<option value=\"".$catObj->getID()."\">" . htmlspecialchars($catObj->getName()) . "\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("status");?>:<br />(<?php printMLText('documents_only'); ?>)</td>
|
||||
<td>
|
||||
<ul class="actions">
|
||||
<li class="first"><input type="checkbox" id="pendingReview" name="pendingReview" value="1"><label for='pendingReview'><?php printOverallStatusText(S_DRAFT_REV);?></label></li>
|
||||
<li><input type="checkbox" id="pendingApproval" name="pendingApproval" value="1"><label for='pendingApproval'><?php printOverallStatusText(S_DRAFT_APP);?></label></li>
|
||||
<li><input type="checkbox" id="released" name="released" value="1"><label for='released'><?php printOverallStatusText(S_RELEASED);?></label></li>
|
||||
<li><input type="checkbox" id="rejected" name="rejected" value="1"><label for='rejected'><?php printOverallStatusText(S_REJECTED);?></label></li>
|
||||
<li><input type="checkbox" id="obsolete" name="obsolete" value="1"><label for='obsolete'><?php printOverallStatusText(S_OBSOLETE);?></label></li>
|
||||
<li><input type="checkbox" id="expired" name="expired" value="1"><label for='expired'><?php printOverallStatusText(S_EXPIRED);?></label></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("owner");?>:</td>
|
||||
<td>
|
||||
<select name="ownerid">
|
||||
<option value="-1"><?php printMLText("all_users");?>
|
||||
<?php
|
||||
$allUsers = $dms->getAllUsers($settings->_sortUsersInList);
|
||||
foreach ($allUsers as $userObj)
|
||||
{
|
||||
if ($userObj->isGuest())
|
||||
continue;
|
||||
print "<option value=\"".$userObj->getID()."\">" . htmlspecialchars($userObj->getLogin()." - ".$userObj->getFullName()) . "\n";
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'attrdefs'=>$attrdefs, 'allcategories'=>$allCats, 'allusers'=>$allUsers, 'enablefullsearch'=>$settings->_enableFullSearch));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("under_folder")?>:</td>
|
||||
<td><?php UI::printFolderChooser("form1", M_READ, -1, $folder);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("creation_date");?>:</td>
|
||||
<td>
|
||||
<input type="Checkbox" name="creationdate" value="true">
|
||||
<?php
|
||||
printMLText("between");
|
||||
print " ";
|
||||
UI::printDateChooser(-1, "createstart");
|
||||
print " ";
|
||||
printMLText("and");
|
||||
print " ";
|
||||
UI::printDateChooser(-1, "createend");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
/*
|
||||
echo "<tr>\n<td>".getMLText("last_update").":</td>\n";
|
||||
echo "<td><input type=\"Checkbox\" name=\"lastupdate\" value=\"true\">";
|
||||
printMLText("between");
|
||||
print " ";
|
||||
UI::printDateChooser(-1, "updatestart");
|
||||
print " ";
|
||||
printMLText("and");
|
||||
print " ";
|
||||
UI::printDateChooser(-1, "updateend");
|
||||
echo "</td>\n</tr>\n";
|
||||
*/
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("search"); ?>"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
<?php
|
||||
if($settings->_enableFullSearch) {
|
||||
?>
|
||||
</div>
|
||||
<div style="width: 35%; float: left; margin-left: 20px;">
|
||||
<form action="../op/op.SearchFulltext.php" name="form2" onsubmit="return checkForm();">
|
||||
<table class="searchform">
|
||||
<h2><?php echo getMLText('fullsearch') ?></h2>
|
||||
<tr>
|
||||
<td><?php printMLText("search_query");?>:</td>
|
||||
<td>
|
||||
<input name="query">
|
||||
<!--
|
||||
<select name="mode">
|
||||
<option value="1" selected><?php printMLText("search_mode_and");?><br>
|
||||
<option value="0"><?php printMLText("search_mode_or");?>
|
||||
</select>
|
||||
-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("category_filter");?>:</td>
|
||||
<td>
|
||||
<select name="categoryids[]" multiple>
|
||||
<!--
|
||||
<option value="-1"><?php printMLText("all_categories");?>
|
||||
-->
|
||||
<?php
|
||||
$allCats = $dms->getDocumentCategories();
|
||||
foreach ($allCats as $catObj) {
|
||||
print "<option value=\"".$catObj->getID()."\">" . htmlspecialchars($catObj->getName()) . "\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("owner");?>:</td>
|
||||
<td>
|
||||
<select name="ownerid">
|
||||
<option value="-1"><?php printMLText("all_users");?>
|
||||
<?php
|
||||
$allUsers = $dms->getAllUsers($settings->_sortUsersInList);
|
||||
foreach ($allUsers as $userObj)
|
||||
{
|
||||
if ($userObj->isGuest())
|
||||
continue;
|
||||
print "<option value=\"".$userObj->getID()."\">" . htmlspecialchars($userObj->getLogin()." - ".$userObj->getFullName()) . "\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("search"); ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div style="clear: both"></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,74 +1,50 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
<?php
|
||||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// 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.Utils.php");
|
||||
//
|
||||
// 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.Utils.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
}
|
||||
$documentid = intval($_GET["documentid"]);
|
||||
$document = $dms->getDocument($documentid);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
if ($document->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
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"));
|
||||
}
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
if (!is_object($document)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
if ($document->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$folder = $document->getFolder();
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
UI::contentHeading(getMLText("set_expiry"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
|
||||
<form action="../op/op.SetExpires.php" method="POST">
|
||||
<input type="hidden" name="documentid" value="<?php print $documentid;?>">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("expires");?>:</td>
|
||||
<td>
|
||||
<input type="radio" name="expires" value="false" <?php echo ($document->expires()?"":"checked") ?> ><?php printMLText("does_not_expire");?><br>
|
||||
<input type="radio" name="expires" value="true" <?php echo ($document->expires()?"checked":"") ?> ><?php UI::printDateChooser(($document->expires()?$document->getExpires():-1), "exp");?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<input type="Submit" value="<?php printMLText("update");?>">
|
||||
</p>
|
||||
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -28,16 +28,12 @@ include("../inc/inc.Authentication.php");
|
|||
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"));
|
||||
}
|
||||
$documentid = intval($_GET["documentid"]);
|
||||
$document = $dms->getDocument($documentid);
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
if ($document->getAccessMode($user) < M_ALL) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
@ -46,218 +42,24 @@ if (!isset($_GET["version"]) || !is_numeric($_GET["version"]) || intval($_GET["v
|
|||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
$version = $_GET["version"];
|
||||
$content = $document->getContentByVersion($version);
|
||||
$overallStatus = $content->getStatus();
|
||||
|
||||
$content = $document->getContentByVersion($_GET["version"]);
|
||||
if (!is_object($content)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
// control for document state
|
||||
$overallStatus = $content->getStatus();
|
||||
if ($overallStatus["status"]==S_REJECTED || $overallStatus["status"]==S_OBSOLETE ) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("cannot_assign_invalid_state"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
UI::contentHeading(getMLText("change_assignments"));
|
||||
$folder = $document->getFolder();
|
||||
|
||||
// Retrieve a list of all users and groups that have review / approve privileges.
|
||||
$docAccess = $document->getApproversList();
|
||||
|
||||
// Retrieve list of currently assigned reviewers and approvers, along with
|
||||
// their latest status.
|
||||
$reviewStatus = $content->getReviewStatus();
|
||||
$approvalStatus = $content->getApprovalStatus();
|
||||
|
||||
// Index the review results for easy cross-reference with the Approvers List.
|
||||
$reviewIndex = array("i"=>array(), "g"=>array());
|
||||
foreach ($reviewStatus as $i=>$rs) {
|
||||
if ($rs["type"]==0) {
|
||||
$reviewIndex["i"][$rs["required"]] = array("status"=>$rs["status"], "idx"=>$i);
|
||||
}
|
||||
else if ($rs["type"]==1) {
|
||||
$reviewIndex["g"][$rs["required"]] = array("status"=>$rs["status"], "idx"=>$i);
|
||||
}
|
||||
$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->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Index the approval results for easy cross-reference with the Approvers List.
|
||||
$approvalIndex = array("i"=>array(), "g"=>array());
|
||||
foreach ($approvalStatus as $i=>$rs) {
|
||||
if ($rs["type"]==0) {
|
||||
$approvalIndex["i"][$rs["required"]] = array("status"=>$rs["status"], "idx"=>$i);
|
||||
}
|
||||
else if ($rs["type"]==1) {
|
||||
$approvalIndex["g"][$rs["required"]] = array("status"=>$rs["status"], "idx"=>$i);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php UI::contentContainerStart(); ?>
|
||||
|
||||
<form action="../op/op.SetReviewersApprovers.php" method="post" name="form1">
|
||||
|
||||
<?php UI::contentSubHeading(getMLText("update_reviewers"));?>
|
||||
|
||||
<div class="cbSelectTitle cbSelectMargin"><?php printMLText("individuals")?>:</div>
|
||||
<div class="cbSelectContainer cbSelectMargin">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
|
||||
$res=$user->getMandatoryReviewers();
|
||||
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory){
|
||||
|
||||
print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())." <".$usr->getEmail().">";
|
||||
print "<input id='revInd".$usr->getID()."' type='hidden' name='indReviewers[]' value='". $usr->getID() ."'>";
|
||||
|
||||
}else if (isset($reviewIndex["i"][$usr->getID()])) {
|
||||
|
||||
switch ($reviewIndex["i"][$usr->getID()]["status"]) {
|
||||
case 0:
|
||||
print "<li class=\"cbSelectItem\"><input id='revInd".$usr->getID()."' type='checkbox' name='indReviewers[]' value='". $usr->getID() ."' checked='checked'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName());
|
||||
break;
|
||||
case -2:
|
||||
print "<li class=\"cbSelectItem\"><input id='revInd".$usr->getID()."' type='checkbox' name='indReviewers[]' value='". $usr->getID() ."'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName());
|
||||
break;
|
||||
default:
|
||||
print "<li class=\"cbSelectItem\"><input id='revInd".$usr->getID()."' type='checkbox' name='indReviewers[]' value='". $usr->getID() ."' disabled='disabled'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
print "<li class=\"cbSelectItem\"><input id='revInd".$usr->getID()."' type='checkbox' name='indReviewers[]' value='". $usr->getID() ."'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName());
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cbSelectTitle"><?php printMLText("groups")?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
foreach ($docAccess["groups"] as $group) {
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['reviewerGroupID']==$group->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory){
|
||||
|
||||
print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>".htmlspecialchars($group->getName());
|
||||
print "<input id='revGrp".$group->getID()."' type='hidden' name='grpReviewers[]' value='". $group->getID() ."'>";
|
||||
|
||||
}else if (isset($reviewIndex["g"][$group->getID()])) {
|
||||
|
||||
switch ($reviewIndex["g"][$group->getID()]["status"]) {
|
||||
case 0:
|
||||
print "<li class=\"cbSelectItem\"><input id='revGrp".$group->getID()."' type='checkbox' name='grpReviewers[]' value='". $group->getID() ."' checked='checked'>".htmlspecialchars($group->getName());
|
||||
break;
|
||||
case -2:
|
||||
print "<li class=\"cbSelectItem\"><input id='revGrp".$group->getID()."' type='checkbox' name='grpReviewers[]' value='". $group->getID() ."'>".htmlspecialchars($group->getName());
|
||||
break;
|
||||
default:
|
||||
print "<li class=\"cbSelectItem\"><input id='revGrp".$group->getID()."' type='checkbox' name='grpReviewers[]' value='". $group->getID() ."' disabled='disabled'>".htmlspecialchars($group->getName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
print "<li class=\"cbSelectItem\"><input id='revGrp".$group->getID()."' type='checkbox' name='grpReviewers[]' value='". $group->getID() ."'>".htmlspecialchars($group->getName());
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php UI::contentSubHeading(getMLText("update_approvers"));?>
|
||||
|
||||
<div class="cbSelectTitle cbSelectMargin"><?php printMLText("individuals")?>:</div>
|
||||
<div class="cbSelectContainer cbSelectMargin">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
|
||||
$res=$user->getMandatoryApprovers();
|
||||
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['approverUserID']==$usr->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory){
|
||||
|
||||
print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())." <".$usr->getEmail().">";
|
||||
print "<input id='appInd".$usr->getID()."' type='hidden' name='indApprovers[]' value='". $usr->getID() ."'>";
|
||||
|
||||
}else if (isset($approvalIndex["i"][$usr->getID()])) {
|
||||
|
||||
switch ($approvalIndex["i"][$usr->getID()]["status"]) {
|
||||
case 0:
|
||||
print "<li class=\"cbSelectItem\"><input id='appInd".$usr->getID()."' type='checkbox' name='indApprovers[]' value='". $usr->getID() ."' checked='checked'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName());
|
||||
break;
|
||||
case -2:
|
||||
print "<li class=\"cbSelectItem\"><input id='appInd".$usr->getID()."' type='checkbox' name='indApprovers[]' value='". $usr->getID() ."'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName());
|
||||
break;
|
||||
default:
|
||||
print "<li class=\"cbSelectItem\"><input id='appInd".$usr->getID()."' type='checkbox' name='indApprovers[]' value='". $usr->getID() ."' disabled='disabled'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
print "<li class=\"cbSelectItem\"><input id='appInd".$usr->getID()."' type='checkbox' name='indApprovers[]' value='". $usr->getID() ."'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName());
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cbSelectTitle"><?php printMLText("groups")?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
foreach ($docAccess["groups"] as $group) {
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['approverGroupID']==$group->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory){
|
||||
|
||||
print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>".htmlspecialchars($group->getName());
|
||||
print "<input id='appGrp".$group->getID()."' type='hidden' name='grpApprovers[]' value='". $group->getID() ."'>";
|
||||
|
||||
}else if (isset($approvalIndex["g"][$group->getID()])) {
|
||||
|
||||
switch ($approvalIndex["g"][$group->getID()]["status"]) {
|
||||
case 0:
|
||||
print "<li class=\"cbSelectItem\"><input id='appGrp".$group->getID()."' type='checkbox' name='grpApprovers[]' value='". $group->getID() ."' checked='checked'>".htmlspecialchars($group->getName());
|
||||
break;
|
||||
case -2:
|
||||
print "<li class=\"cbSelectItem\"><input id='appGrp".$group->getID()."' type='checkbox' name='grpApprovers[]' value='". $group->getID() ."'>".htmlspecialchars($group->getName());
|
||||
break;
|
||||
default:
|
||||
print "<li class=\"cbSelectItem\"><input id='appGrp".$group->getID()."' type='checkbox' name='grpApprovers[]' value='". $group->getID() ."' disabled='disabled'>".htmlspecialchars($group->getName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
print "<li class=\"cbSelectItem\"><input id='appGrp".$group->getID()."' type='checkbox' name='grpApprovers[]' value='". $group->getID() ."'>".htmlspecialchars($group->getName());
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<input type='hidden' name='documentid' value='<?php echo $documentid ?>'/>
|
||||
<input type='hidden' name='version' value='<?php echo $version ?>'/>
|
||||
<input type="Submit" value="<?php printMLText("update");?>">
|
||||
</p>
|
||||
</form>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -30,457 +30,11 @@ if (!$user->isAdmin()) {
|
|||
if(!trim($settings->_encryptionKey))
|
||||
$settings->_encryptionKey = md5(uniqid());
|
||||
|
||||
UI::htmlStartPage(getMLText("admin_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
UI::contentHeading(getMLText("settings"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
function ShowHide(strId)
|
||||
{
|
||||
|
||||
var objDiv = document.getElementById(strId);
|
||||
|
||||
if (objDiv)
|
||||
{
|
||||
|
||||
if(objDiv.style.display == 'block')
|
||||
{
|
||||
objDiv.style.display = 'none';
|
||||
}
|
||||
else
|
||||
{
|
||||
objDiv.style.display = 'block';
|
||||
}
|
||||
}
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'settings'=>$settings));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
</script>
|
||||
|
||||
<form action="../op/op.Settings.php" method="post" enctype="multipart/form-data" name="form0" >
|
||||
<input type="Hidden" name="action" value="saveSettings" />
|
||||
<?php
|
||||
if(!is_writeable($settings->_configFilePath)) {
|
||||
echo "<p>".getMLText("settings_notwritable")."</p>";
|
||||
} else {
|
||||
?>
|
||||
<input type="Submit" value="<?php printMLText("save");?>" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<div class="contentHeading" onClick="ShowHide('siteID')" style="cursor:pointer">+ <?php printMLText("settings_Site");?></div>
|
||||
<div id="siteID" style="display:block">
|
||||
<table>
|
||||
<!--
|
||||
-- SETTINGS - SITE - DISPLAY
|
||||
-->
|
||||
<tr ><td><b> <?php printMLText("settings_Display");?></b></td> </tr>
|
||||
<tr title="<?php printMLText("settings_siteName_desc");?>">
|
||||
<td><?php printMLText("settings_siteName");?>:</td>
|
||||
<td><input name="siteName" value="<?php echo $settings->_siteName ?>"/></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_footNote_desc");?>">
|
||||
<td><?php printMLText("settings_footNote");?>:</td>
|
||||
<td><input name="footNote" value="<?php echo $settings->_footNote ?>" size="100"/></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_printDisclaimer_desc");?>">
|
||||
<td><?php printMLText("settings_printDisclaimer");?>:</td>
|
||||
<td><input name="printDisclaimer" type="checkbox" <?php if ($settings->_printDisclaimer) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_language_desc");?>">
|
||||
<td><?php printMLText("settings_language");?>:</td>
|
||||
<td>
|
||||
<SELECT name="language">
|
||||
<?php
|
||||
$languages = getLanguages();
|
||||
foreach($languages as $language)
|
||||
{
|
||||
echo '<OPTION VALUE="' . $language . '" ';
|
||||
if ($settings->_language==$language)
|
||||
echo "SELECTED";
|
||||
echo '>' . $language . '</OPTION>';
|
||||
}
|
||||
?>
|
||||
</SELECT>
|
||||
</td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_theme_desc");?>">
|
||||
<td><?php printMLText("settings_theme");?>:</td>
|
||||
<td>
|
||||
<SELECT name="theme">
|
||||
<?php
|
||||
$themes = UI::getStyles();
|
||||
foreach($themes as $theme)
|
||||
{
|
||||
echo '<OPTION VALUE="' . $theme . '" ';
|
||||
if ($settings->_theme==$theme)
|
||||
echo "SELECTED";
|
||||
echo '>' . $theme . '</OPTION>';
|
||||
}
|
||||
?>
|
||||
</SELECT>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!--
|
||||
-- SETTINGS - SITE - EDITION
|
||||
-->
|
||||
<tr><td></td></tr><tr ><td><b> <?php printMLText("settings_Edition");?></b></td> </tr>
|
||||
<tr title="<?php printMLText("settings_strictFormCheck_desc");?>">
|
||||
<td><?php printMLText("settings_strictFormCheck");?>:</td>
|
||||
<td><input name="strictFormCheck" type="checkbox" <?php if ($settings->_strictFormCheck) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_viewOnlineFileTypes_desc");?>">
|
||||
<td><?php printMLText("settings_viewOnlineFileTypes");?>:</td>
|
||||
<td><input name="viewOnlineFileTypes" value="<?php echo $settings->getViewOnlineFileTypesToString() ?>" size="100" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_enableConverting_desc");?>">
|
||||
<td><?php printMLText("settings_enableConverting");?>:</td>
|
||||
<td><input name="enableConverting" type="checkbox" <?php if ($settings->_enableConverting) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_enableEmail_desc");?>">
|
||||
<td><?php printMLText("settings_enableEmail");?>:</td>
|
||||
<td><input name="enableEmail" type="checkbox" <?php if ($settings->_enableEmail) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_enableUsersView_desc");?>">
|
||||
<td><?php printMLText("settings_enableUsersView");?>:</td>
|
||||
<td><input name="enableUsersView" type="checkbox" <?php if ($settings->_enableUsersView) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_enableFullSearch_desc");?>">
|
||||
<td><?php printMLText("settings_enableFullSearch");?>:</td>
|
||||
<td><input name="enableFullSearch" type="checkbox" <?php if ($settings->_enableFullSearch) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_stopWordsFile_desc");?>">
|
||||
<td><?php printMLText("settings_stopWordsFile");?>:</td>
|
||||
<td><input name="stopWordsFile" value="<?php echo $settings->_stopWordsFile; ?>" size="100" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_enableFolderTree_desc");?>">
|
||||
<td><?php printMLText("settings_enableFolderTree");?>:</td>
|
||||
<td><input name="enableFolderTree" type="checkbox" <?php if ($settings->_enableFolderTree) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_expandFolderTree_desc");?>">
|
||||
<td><?php printMLText("settings_expandFolderTree");?>:</td>
|
||||
<td>
|
||||
<SELECT name="expandFolderTree">
|
||||
<OPTION VALUE="0" <?php if ($settings->_expandFolderTree==0) echo "SELECTED" ?> ><?php printMLText("settings_expandFolderTree_val0");?></OPTION>
|
||||
<OPTION VALUE="1" <?php if ($settings->_expandFolderTree==1) echo "SELECTED" ?> ><?php printMLText("settings_expandFolderTree_val1");?></OPTION>
|
||||
<OPTION VALUE="2" <?php if ($settings->_expandFolderTree==2) echo "SELECTED" ?> ><?php printMLText("settings_expandFolderTree_val2");?></OPTION>
|
||||
</SELECT>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_sortUsersInList_desc");?>">
|
||||
<td><?php printMLText("settings_sortUsersInList");?>:</td>
|
||||
<td>
|
||||
<SELECT name="sortUsersInList">
|
||||
<OPTION VALUE="" <?php if ($settings->_sortUsersInList=='') echo "SELECTED" ?> ><?php printMLText("settings_sortUsersInList_val_login");?></OPTION>
|
||||
<OPTION VALUE="fullname" <?php if ($settings->_sortUsersInList=='fullname') echo "SELECTED" ?> ><?php printMLText("settings_sortUsersInList_val_fullname");?></OPTION>
|
||||
</SELECT>
|
||||
</tr>
|
||||
|
||||
<!--
|
||||
-- SETTINGS - SITE - CALENDAR
|
||||
-->
|
||||
<tr><td></td></tr><tr ><td><b> <?php printMLText("settings_Calendar");?></b></td> </tr>
|
||||
<tr title="<?php printMLText("settings_enableCalendar_desc");?>">
|
||||
<td><?php printMLText("settings_enableCalendar");?>:</td>
|
||||
<td><input name="enableCalendar" type="checkbox" <?php if ($settings->_enableCalendar) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_calendarDefaultView_desc");?>">
|
||||
<td><?php printMLText("settings_calendarDefaultView");?>:</td>
|
||||
<td>
|
||||
<SELECT name="calendarDefaultView">
|
||||
<OPTION VALUE="w" <?php if ($settings->_calendarDefaultView=="w") echo "SELECTED" ?> ><?php printMLText("week_view");?></OPTION>
|
||||
<OPTION VALUE="m" <?php if ($settings->_calendarDefaultView=="m") echo "SELECTED" ?> ><?php printMLText("month_view");?></OPTION>
|
||||
<OPTION VALUE="y" <?php if ($settings->_calendarDefaultView=="y") echo "SELECTED" ?> ><?php printMLText("year_view");?></OPTION>
|
||||
</SELECT>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_firstDayOfWeek_desc");?>">
|
||||
<td><?php printMLText("settings_firstDayOfWeek");?>:</td>
|
||||
<td>
|
||||
<SELECT name="firstDayOfWeek">
|
||||
<OPTION VALUE="0" <?php if ($settings->_firstDayOfWeek=="0") echo "SELECTED" ?> ><?php printMLText("sunday");?></OPTION>
|
||||
<OPTION VALUE="1" <?php if ($settings->_firstDayOfWeek=="1") echo "SELECTED" ?> ><?php printMLText("monday");?></OPTION>
|
||||
<OPTION VALUE="2" <?php if ($settings->_firstDayOfWeek=="2") echo "SELECTED" ?> ><?php printMLText("tuesday");?></OPTION>
|
||||
<OPTION VALUE="3" <?php if ($settings->_firstDayOfWeek=="3") echo "SELECTED" ?> ><?php printMLText("wednesday");?></OPTION>
|
||||
<OPTION VALUE="4" <?php if ($settings->_firstDayOfWeek=="4") echo "SELECTED" ?> ><?php printMLText("thursday");?></OPTION>
|
||||
<OPTION VALUE="5" <?php if ($settings->_firstDayOfWeek=="5") echo "SELECTED" ?> ><?php printMLText("friday");?></OPTION>
|
||||
<OPTION VALUE="6" <?php if ($settings->_firstDayOfWeek=="6") echo "SELECTED" ?> ><?php printMLText("saturday");?></OPTION>
|
||||
</SELECT>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br>
|
||||
<div class="contentHeading" onClick="ShowHide('systemID')" style="cursor:pointer">+ <?php printMLText("settings_System");?></div>
|
||||
<div id="systemID" style="display:block">
|
||||
<table>
|
||||
<!--
|
||||
-- SETTINGS - SYSTEM - SERVER
|
||||
-->
|
||||
<tr ><td><b> <?php printMLText("settings_Server");?></b></td> </tr>
|
||||
<tr title="<?php printMLText("settings_rootDir_desc");?>">
|
||||
<td><?php printMLText("settings_rootDir");?>:</td>
|
||||
<td><input name="rootDir" value="<?php echo $settings->_rootDir ?>" size="100" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_httpRoot_desc");?>">
|
||||
<td><?php printMLText("settings_httpRoot");?>:</td>
|
||||
<td><input name="httpRoot" value="<?php echo $settings->_httpRoot ?>" size="100" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_contentDir_desc");?>">
|
||||
<td><?php printMLText("settings_contentDir");?>:</td>
|
||||
<td><input name="contentDir" value="<?php echo $settings->_contentDir ?>" size="100" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_stagingDir_desc");?>">
|
||||
<td><?php printMLText("settings_stagingDir");?>:</td>
|
||||
<td><input name="stagingDir" value="<?php echo $settings->_stagingDir ?>" size="100" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_luceneDir_desc");?>">
|
||||
<td><?php printMLText("settings_luceneDir");?>:</td>
|
||||
<td><input name="luceneDir" value="<?php echo $settings->_luceneDir ?>" size="100" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_logFileEnable_desc");?>">
|
||||
<td><?php printMLText("settings_logFileEnable");?>:</td>
|
||||
<td><input name="logFileEnable" type="checkbox" <?php if ($settings->_logFileEnable) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_logFileRotation_desc");?>">
|
||||
<td><?php printMLText("settings_logFileRotation");?>:</td>
|
||||
<td>
|
||||
<SELECT name="logFileRotation">
|
||||
<OPTION VALUE="h" <?php if ($settings->_logFileRotation=="h") echo "SELECTED" ?> ><?php printMLText("hourly");?></OPTION>
|
||||
<OPTION VALUE="d" <?php if ($settings->_logFileRotation=="d") echo "SELECTED" ?> ><?php printMLText("daily");?></OPTION>
|
||||
<OPTION VALUE="m" <?php if ($settings->_logFileRotation=="m") echo "SELECTED" ?> ><?php printMLText("monthly");?></OPTION>
|
||||
</SELECT>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_enableLargeFileUpload_desc");?>">
|
||||
<td><?php printMLText("settings_enableLargeFileUpload");?>:</td>
|
||||
<td><input name="enableLargeFileUpload" type="checkbox" <?php if ($settings->_enableLargeFileUpload) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_partitionSize_desc");?>">
|
||||
<td><?php printMLText("settings_partitionSize");?>:</td>
|
||||
<td><input name="partitionSize" value="<?php echo $settings->_partitionSize ?>" size="100" /></td>
|
||||
</tr>
|
||||
<!--
|
||||
-- SETTINGS - SYSTEM - AUTHENTICATION
|
||||
-->
|
||||
<tr ><td><b> <?php printMLText("settings_Authentication");?></b></td> </tr>
|
||||
<tr title="<?php printMLText("settings_enableGuestLogin_desc");?>">
|
||||
<td><?php printMLText("settings_enableGuestLogin");?>:</td>
|
||||
<td><input name="enableGuestLogin" type="checkbox" <?php if ($settings->_enableGuestLogin) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_restricted_desc");?>">
|
||||
<td><?php printMLText("settings_restricted");?>:</td>
|
||||
<td><input name="restricted" type="checkbox" <?php if ($settings->_restricted) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_enableUserImage_desc");?>">
|
||||
<td><?php printMLText("settings_enableUserImage");?>:</td>
|
||||
<td><input name="enableUserImage" type="checkbox" <?php if ($settings->_enableUserImage) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_disableSelfEdit_desc");?>">
|
||||
<td><?php printMLText("settings_disableSelfEdit");?>:</td>
|
||||
<td><input name="disableSelfEdit" type="checkbox" <?php if ($settings->_disableSelfEdit) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_enablePasswordForgotten_desc");?>">
|
||||
<td><?php printMLText("settings_enablePasswordForgotten");?>:</td>
|
||||
<td><input name="enablePasswordForgotten" type="checkbox" <?php if ($settings->_enablePasswordForgotten) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_passwordЅtrength_desc");?>">
|
||||
<td><?php printMLText("settings_passwordStrength");?>:</td>
|
||||
<td><input name="passwordStrength" value="<?php echo $settings->_passwordStrength; ?>" size="2" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_passwordStrengthAlgorithm_desc");?>">
|
||||
<td><?php printMLText("settings_passwordStrengthAlgorithm");?>:</td>
|
||||
<td>
|
||||
<select name="passwordStrengthAlgorithm">
|
||||
<option value="simple" <?php if ($settings->_passwordStrengthAlgorithm=='simple') echo "selected" ?>><?php printMLText("settings_passwordStrengthAlgorithm_valsimple");?></option>
|
||||
<option value="advanced" <?php if ($settings->_passwordStrengthAlgorithm=='advanced') echo "selected" ?>><?php printMLText("settings_passwordStrengthAlgorithm_valadvanced");?></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_passwordExpiration_desc");?>">
|
||||
<td><?php printMLText("settings_passwordExpiration");?>:</td>
|
||||
<td><input name="passwordExpiration" value="<?php echo $settings->_passwordExpiration; ?>" size="3" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_passwordHistory_desc");?>">
|
||||
<td><?php printMLText("settings_passwordHistory");?>:</td>
|
||||
<td><input name="passwordHistory" value="<?php echo $settings->_passwordHistory; ?>" size="2" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_loginFailure_desc");?>">
|
||||
<td><?php printMLText("settings_loginFailure");?>:</td>
|
||||
<td><input name="loginFailure" value="<?php echo $settings->_loginFailure; ?>" size="2" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_encryptionKey_desc");?>">
|
||||
<td><?php printMLText("settings_encryptionKey");?>:</td>
|
||||
<td><input name="encryptionKey" value="<?php echo $settings->_encryptionKey; ?>" size="32" /></td>
|
||||
</tr>
|
||||
|
||||
<!-- TODO Connectors -->
|
||||
|
||||
<!--
|
||||
-- SETTINGS - SYSTEM - DATABASE
|
||||
-->
|
||||
<tr ><td><b> <?php printMLText("settings_Database");?></b></td> </tr>
|
||||
<tr title="<?php printMLText("settings_ADOdbPath_desc");?>">
|
||||
<td><?php printMLText("settings_ADOdbPath");?>:</td>
|
||||
<td><input name="ADOdbPath" value="<?php echo $settings->_ADOdbPath ?>" size="100" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_dbDriver_desc");?>">
|
||||
<td><?php printMLText("settings_dbDriver");?>:</td>
|
||||
<td><input name="dbDriver" value="<?php echo $settings->_dbDriver ?>" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_dbHostname_desc");?>">
|
||||
<td><?php printMLText("settings_dbHostname");?>:</td>
|
||||
<td><input name="dbHostname" value="<?php echo $settings->_dbHostname ?>" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_dbDatabase_desc");?>">
|
||||
<td><?php printMLText("settings_dbDatabase");?>:</td>
|
||||
<td><input name="dbDatabase" value="<?php echo $settings->_dbDatabase ?>" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_dbUser_desc");?>">
|
||||
<td><?php printMLText("settings_dbUser");?>:</td>
|
||||
<td><input name="dbUser" value="<?php echo $settings->_dbUser ?>" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_dbPass_desc");?>">
|
||||
<td><?php printMLText("settings_dbPass");?>:</td>
|
||||
<td><input name="dbPass" value="<?php echo $settings->_dbPass ?>" type="password" /></td>
|
||||
</tr>
|
||||
|
||||
<!--
|
||||
-- SETTINGS - SYSTEM - SMTP
|
||||
-->
|
||||
<tr ><td><b> <?php printMLText("settings_SMTP");?></b></td> </tr>
|
||||
<tr title="<?php printMLText("settings_smtpServer_desc");?>">
|
||||
<td><?php printMLText("settings_smtpServer");?>:</td>
|
||||
<td><input name="smtpServer" value="<?php echo $settings->_smtpServer ?>" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_smtpPort_desc");?>">
|
||||
<td><?php printMLText("settings_smtpPort");?>:</td>
|
||||
<td><input name="smtpPort" value="<?php echo $settings->_smtpPort ?>" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_smtpSendFrom_desc");?>">
|
||||
<td><?php printMLText("settings_smtpSendFrom");?>:</td>
|
||||
<td><input name="smtpSendFrom" value="<?php echo $settings->_smtpSendFrom ?>" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="contentHeading" onClick="ShowHide('advancedID')" style="cursor:pointer">+ <?php printMLText("settings_Advanced");?></div>
|
||||
<div id="advancedID" style="display:none">
|
||||
<table>
|
||||
<!--
|
||||
-- SETTINGS - ADVANCED - DISPLAY
|
||||
-->
|
||||
<tr ><td><b> <?php printMLText("settings_Display");?></b></td> </tr>
|
||||
<tr title="<?php printMLText("settings_siteDefaultPage_desc");?>">
|
||||
<td><?php printMLText("settings_siteDefaultPage");?>:</td>
|
||||
<td><input name="siteDefaultPage" value="<?php echo $settings->_siteDefaultPage ?>" size="100" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_rootFolderID_desc");?>">
|
||||
<td><?php printMLText("settings_rootFolderID");?>:</td>
|
||||
<td><input name="rootFolderID" value="<?php echo $settings->_rootFolderID ?>" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_titleDisplayHack_desc");?>">
|
||||
<td><?php printMLText("settings_titleDisplayHack");?>:</td>
|
||||
<td><input name="titleDisplayHack" type="checkbox" <?php if ($settings->_titleDisplayHack) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
|
||||
<!--
|
||||
-- SETTINGS - ADVANCED - AUTHENTICATION
|
||||
-->
|
||||
<tr ><td><b> <?php printMLText("settings_Authentication");?></b></td> </tr>
|
||||
<tr title="<?php printMLText("settings_guestID_desc");?>">
|
||||
<td><?php printMLText("settings_guestID");?>:</td>
|
||||
<td><input name="guestID" value="<?php echo $settings->_guestID ?>" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_adminIP_desc");?>">
|
||||
<td><?php printMLText("settings_adminIP");?>:</td>
|
||||
<td><input name="adminIP" value="<?php echo $settings->_adminIP ?>" /></td>
|
||||
</tr>
|
||||
|
||||
<!--
|
||||
-- SETTINGS - ADVANCED - EDITION
|
||||
-->
|
||||
<tr ><td><b> <?php printMLText("settings_Edition");?></b></td> </tr>
|
||||
<tr title="<?php printMLText("settings_versioningFileName_desc");?>">
|
||||
<td><?php printMLText("settings_versioningFileName");?>:</td>
|
||||
<td><input name="versioningFileName" value="<?php echo $settings->_versioningFileName ?>" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_enableAdminRevApp_desc");?>">
|
||||
<td><?php printMLText("settings_enableAdminRevApp");?>:</td>
|
||||
<td><input name="enableAdminRevApp" type="checkbox" <?php if ($settings->_enableAdminRevApp) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_enableVersionDeletion_desc");?>">
|
||||
<td><?php printMLText("settings_enableVersionDeletion");?>:</td>
|
||||
<td><input name="enableVersionDeletion" type="checkbox" <?php if ($settings->_enableVersionDeletion) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_enableVersionModification_desc");?>">
|
||||
<td><?php printMLText("settings_enableVersionModification");?>:</td>
|
||||
<td><input name="enableVersionModification" type="checkbox" <?php if ($settings->_enableVersionModification) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
|
||||
<!--
|
||||
-- SETTINGS - ADVANCED - NOTIFICATION
|
||||
-->
|
||||
<tr ><td><b> <?php printMLText("settings_Notification");?></b></td> </tr>
|
||||
<tr title="<?php printMLText("settings_enableOwnerNotification_desc");?>">
|
||||
<td><?php printMLText("settings_enableOwnerNotification");?>:</td>
|
||||
<td><input name="enableOwnerNotification" type="checkbox" <?php if ($settings->_enableOwnerNotification) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_enableNotificationAppRev_desc");?>">
|
||||
<td><?php printMLText("settings_enableNotificationAppRev");?>:</td>
|
||||
<td><input name="enableNotificationAppRev" type="checkbox" <?php if ($settings->_enableNotificationAppRev) echo "checked" ?> /></td>
|
||||
</tr>
|
||||
|
||||
<!--
|
||||
-- SETTINGS - ADVANCED - SERVER
|
||||
-->
|
||||
<tr ><td><b> <?php printMLText("settings_Server");?></b></td> </tr>
|
||||
<tr title="<?php printMLText("settings_coreDir_desc");?>">
|
||||
<td><?php printMLText("settings_coreDir");?>:</td>
|
||||
<td><input name="coreDir" value="<?php echo $settings->_coreDir ?>" size="100" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_luceneClassDir_desc");?>">
|
||||
<td><?php printMLText("settings_luceneClassDir");?>:</td>
|
||||
<td><input name="luceneClassDir" value="<?php echo $settings->_luceneClassDir ?>" size="100" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_contentOffsetDir_desc");?>">
|
||||
<td><?php printMLText("settings_contentOffsetDir");?>:</td>
|
||||
<td><input name="contentOffsetDir" value="<?php echo $settings->_contentOffsetDir ?>" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_maxDirID_desc");?>">
|
||||
<td><?php printMLText("settings_maxDirID");?>:</td>
|
||||
<td><input name="maxDirID" value="<?php echo $settings->_maxDirID ?>" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_updateNotifyTime_desc");?>">
|
||||
<td><?php printMLText("settings_updateNotifyTime");?>:</td>
|
||||
<td><input name="updateNotifyTime" value="<?php echo $settings->_updateNotifyTime ?>" /></td>
|
||||
</tr>
|
||||
<tr title="<?php printMLText("settings_maxExecutionTime_desc");?>">
|
||||
<td><?php printMLText("settings_maxExecutionTime");?>:</td>
|
||||
<td><input name="maxExecutionTime" value="<?php echo $settings->_maxExecutionTime ?>" /></td>
|
||||
</tr>
|
||||
|
||||
<tr ><td><b> <?php printMLText("index_converters");?></b></td> </tr>
|
||||
<?php
|
||||
foreach($settings->_converters as $mimetype=>$cmd) {
|
||||
?>
|
||||
<tr title="<?php echo $mimetype;?>">
|
||||
<td><?php echo $mimetype;?>:</td>
|
||||
<td><input name="converters[<?php echo $mimetype;?>]" value="<?php echo $cmd ?>" size="100" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -23,201 +23,16 @@ include("../inc/inc.Language.php");
|
|||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
// TODO: javascript open/close folder
|
||||
if (!$user->isAdmin()) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
$rootfolder = $dms->getFolder($settings->_rootFolderID);
|
||||
|
||||
UI::htmlStartPage(getMLText("folders_and_documents_statistic"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
|
||||
?>
|
||||
<style type="text/css">
|
||||
.folderClass {
|
||||
list-style-image : url(<?php UI::printImgPath("folder_closed.gif");?>);
|
||||
list-style : url(<?php UI::printImgPath("folder_closed.gif");?>);
|
||||
}
|
||||
|
||||
.documentClass {
|
||||
list-style-image : url(<?php UI::printImgPath("file.gif");?>);
|
||||
list-style : url(<?php UI::printImgPath("file.gif");?>);
|
||||
}
|
||||
</style>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
function showDocument(id) {
|
||||
url = "out.DetailedStatistic.php?documentid=" + id;
|
||||
alert(url);
|
||||
}
|
||||
|
||||
function showFolder(id) {
|
||||
url = "out.DetailedStatistic.php?folderid=" + id;
|
||||
alert(url);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
$folder_count=0;
|
||||
$document_count=0;
|
||||
$file_count=0;
|
||||
$storage_size=0;
|
||||
|
||||
function getAccessColor($mode) {
|
||||
if ($mode == M_NONE)
|
||||
return "gray";
|
||||
else if ($mode == M_READ)
|
||||
return "green";
|
||||
else if ($mode == M_READWRITE)
|
||||
return "blue";
|
||||
else // if ($mode == M_ALL)
|
||||
return "red";
|
||||
}
|
||||
|
||||
function printFolder($folder) {
|
||||
global $folder_count,$settings;
|
||||
|
||||
$folder_count++;
|
||||
$folder_size=0;
|
||||
$doc_count=0;
|
||||
|
||||
$color = $folder->inheritsAccess() ? "black" : getAccessColor($folder->getDefaultAccess());
|
||||
|
||||
print "<li class=\"folderClass\">";
|
||||
print "<a style=\"color: $color\" href=\"out.ViewFolder.php?folderid=".$folder->getID()."\">".htmlspecialchars($folder->getName()) ."</a>";
|
||||
|
||||
$owner = $folder->getOwner();
|
||||
$color = getAccessColor(M_ALL);
|
||||
print " [<span style=\"color: $color\">".htmlspecialchars($owner->getFullName())."</span>] ";
|
||||
|
||||
if (! $folder->inheritsAccess())
|
||||
printAccessList($folder);
|
||||
|
||||
$subFolders = $folder->getSubFolders();
|
||||
$documents = $folder->getDocuments();
|
||||
|
||||
print "<ul>";
|
||||
|
||||
foreach ($subFolders as $sub) $folder_size += printFolder($sub);
|
||||
foreach ($documents as $document){
|
||||
$doc_count++;
|
||||
$folder_size += printDocument($document);
|
||||
}
|
||||
|
||||
print "</ul>";
|
||||
|
||||
print "<small>".formatted_size($folder_size).", ".$doc_count." ".getMLText("documents")."</small>\n";
|
||||
|
||||
print "</li>";
|
||||
|
||||
return $folder_size;
|
||||
}
|
||||
|
||||
function printDocument($document) {
|
||||
global $document_count, $file_count, $storage_size, $dms;
|
||||
|
||||
$document_count++;
|
||||
|
||||
$local_file_count=0;
|
||||
$folder_size=0;
|
||||
|
||||
if (file_exists($dms->contentDir.$document->getDir())) {
|
||||
$handle = opendir($dms->contentDir.$document->getDir());
|
||||
while ($entry = readdir($handle) ) {
|
||||
if (is_dir($dms->contentDir.$document->getDir().$entry)) continue;
|
||||
else{
|
||||
$local_file_count++;
|
||||
$folder_size += filesize($dms->contentDir.$document->getDir().$entry);
|
||||
}
|
||||
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
$storage_size += $folder_size;
|
||||
|
||||
$color = $document->inheritsAccess() ? "black" : getAccessColor($document->getDefaultAccess());
|
||||
print "<li class=\"documentClass\">";
|
||||
print "<a style=\"color: $color\" href=\"out.ViewDocument.php?documentid=".$document->getID()."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
$owner = $document->getOwner();
|
||||
$color = getAccessColor(M_ALL);
|
||||
print " [<span style=\"color: $color\">".htmlspecialchars($owner->getFullName())."</span>] ";
|
||||
|
||||
if (! $document->inheritsAccess()) printAccessList($document);
|
||||
|
||||
print "<small>".formatted_size($folder_size).", ".$local_file_count." ".getMLText("files")."</small>\n";
|
||||
|
||||
print "</li>";
|
||||
|
||||
$file_count += $local_file_count;
|
||||
return $folder_size;
|
||||
}
|
||||
|
||||
function printAccessList($obj) {
|
||||
$accessList = $obj->getAccessList();
|
||||
if (count($accessList["users"]) == 0 && count($accessList["groups"]) == 0)
|
||||
return;
|
||||
|
||||
print " <span>(";
|
||||
|
||||
for ($i = 0; $i < count($accessList["groups"]); $i++)
|
||||
{
|
||||
$group = $accessList["groups"][$i]->getGroup();
|
||||
$color = getAccessColor($accessList["groups"][$i]->getMode());
|
||||
print "<span style=\"color: $color\">".htmlspecialchars($group->getName())."</span>";
|
||||
if ($i+1 < count($accessList["groups"]) || count($accessList["users"]) > 0)
|
||||
print ", ";
|
||||
}
|
||||
for ($i = 0; $i < count($accessList["users"]); $i++)
|
||||
{
|
||||
$user = $accessList["users"][$i]->getUser();
|
||||
$color = getAccessColor($accessList["users"][$i]->getMode());
|
||||
print "<span style=\"color: $color\">".htmlspecialchars($user->getFullName())."</span>";
|
||||
if ($i+1 < count($accessList["users"]))
|
||||
print ", ";
|
||||
}
|
||||
print ")</span>";
|
||||
}
|
||||
|
||||
UI::contentHeading(getMLText("folders_and_documents_statistic"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
print "<table><tr><td>\n";
|
||||
|
||||
print "<ul class=\"legend\">\n";
|
||||
print "<li><span style=\"color:black\">".getMLText("access_inheritance")." </span></li>";
|
||||
print "<li><span style=\"color:".getAccessColor(M_ALL)."\">".getMLText("access_mode_all")." </span></li>";
|
||||
print "<li><span style=\"color:".getAccessColor(M_READWRITE)."\">".getMLText("access_mode_readwrite")." </span></li>";
|
||||
print "<li><span style=\"color:".getAccessColor(M_READ)."\">".getMLText("access_mode_read")." </span></li>";
|
||||
print "<li><span style=\"color:".getAccessColor(M_NONE)."\">".getMLText("access_mode_none")." </span></li>";
|
||||
print "</ul>\n";
|
||||
|
||||
print "</td><td>\n";
|
||||
|
||||
print "<ul>\n";
|
||||
printFolder($dms->getFolder($settings->_rootFolderID));
|
||||
print "</ul>\n";
|
||||
|
||||
print "</td></tr>";
|
||||
|
||||
print "<tr><td colspan=\"2\">";
|
||||
|
||||
print "<ul class=\"legend\">\n";
|
||||
print "<li>".getMLText("folders").": ".$folder_count."</li>\n";
|
||||
print "<li>".getMLText("documents").": ".$document_count."</li>\n";
|
||||
print "<li>".getMLText("files").": ".$file_count."</li>\n";
|
||||
print "<li>".getMLText("storage_size").": ".formatted_size($storage_size)."</li>\n";
|
||||
|
||||
print "</ul>\n";
|
||||
|
||||
print "</td></tr>";
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'rootfolder'=>$rootfolder));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -28,221 +28,23 @@ include("../inc/inc.Authentication.php");
|
|||
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"));
|
||||
}
|
||||
$documentid = intval($_GET["documentid"]);
|
||||
$document = $dms->getDocument($documentid);
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
if ($document->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
$folder = $document->getFolder();
|
||||
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.userfile.value == "") msg += "<?php printMLText("js_no_file");?>\n";
|
||||
<?php
|
||||
if (isset($settings->_strictFormCheck) && $settings->_strictFormCheck) {
|
||||
?>
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
UI::contentHeading(getMLText("update_document"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
if ($document->isLocked()) {
|
||||
|
||||
$lockingUser = $document->getLockingUser();
|
||||
|
||||
print "<table><tr><td class=\"warning\">";
|
||||
|
||||
printMLText("update_locked_msg", array("username" => htmlspecialchars($lockingUser->getFullName()), "email" => $lockingUser->getEmail()));
|
||||
|
||||
if ($lockingUser->getID() == $user->getID())
|
||||
printMLText("unlock_cause_locking_user");
|
||||
else if ($document->getAccessMode($user) == M_ALL)
|
||||
printMLText("unlock_cause_access_mode_all");
|
||||
else
|
||||
{
|
||||
printMLText("no_update_cause_locked");
|
||||
print "</td></tr></table>";
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
|
||||
print "</td></tr></table><br>";
|
||||
$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, 'dropfolderdir'=>$settings->_dropFolderDir));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Retrieve a list of all users and groups that have review / approve
|
||||
// privileges.
|
||||
$docAccess = $document->getApproversList();
|
||||
?>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td class="warning"><?php echo getMLText("max_upload_size")." : ".ini_get( "upload_max_filesize"); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if($settings->_enableLargeFileUpload) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php printf(getMLText('link_alt_updatedocument'), "out.UpdateDocument2.php?documentid=".$documentid); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table><br>
|
||||
|
||||
|
||||
<form action="../op/op.UpdateDocument.php" enctype="multipart/form-data" method="post" name="form1" onsubmit="return checkForm();">
|
||||
<input type="Hidden" name="documentid" value="<?php print $documentid; ?>">
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td><?php printMLText("local_file");?>:</td>
|
||||
<td><input type="File" name="userfile" size="60"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment");?>:</td>
|
||||
<td class="standardText">
|
||||
<textarea name="comment" rows="4" cols="80"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("expires");?>:</td>
|
||||
<td class="standardText">
|
||||
<input type="Radio" name="expires" value="false"<?php if (!$document->expires()) print " checked";?>><?php printMLText("does_not_expire");?><br>
|
||||
<input type="radio" name="expires" value="true"<?php if ($document->expires()) print " checked";?>><?php UI::printDateChooser(-1, "exp");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_documentcontent, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||
<td><?php UI::printAttributeEditField($attrdef, '') ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
|
||||
<?php UI::contentSubHeading(getMLText("assign_reviewers")); ?>
|
||||
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
|
||||
<div class="cbSelectContainer cbSelectMargin">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
$res=$user->getMandatoryReviewers();
|
||||
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
|
||||
if ($usr->getID()==$user->getID()) continue;
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory) print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>". htmlspecialchars($usr->getFullName())."</li>";
|
||||
else print "<li class=\"cbSelectItem\"><input id='revInd".$usr->getID()."' type='checkbox' name='indReviewers[]' value='". $usr->getID() ."'>". htmlspecialchars($usr->getFullName())."</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['reviewerGroupID']==$grp->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory) print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>".htmlspecialchars($grp->getName())."</li>";
|
||||
else print "<li class=\"cbSelectItem\"><input id='revGrp".$grp->getID()."' type='checkbox' name='grpReviewers[]' value='". $grp->getID() ."'>".htmlspecialchars($grp->getName())."</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php UI::contentSubHeading(getMLText("assign_approvers")); ?>
|
||||
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
|
||||
<div class="cbSelectContainer cbSelectMargin">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
$res=$user->getMandatoryApprovers();
|
||||
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
|
||||
if ($usr->getID()==$user->getID()) continue;
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['approverUserID']==$usr->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory) print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>". htmlspecialchars($usr->getFullName())."</li>";
|
||||
else print "<li class=\"cbSelectItem\"><input id='appInd".$usr->getID()."' type='checkbox' name='indApprovers[]' value='". $usr->getID() ."'>". htmlspecialchars($usr->getFullName())."</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['approverGroupID']==$grp->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory) print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>".htmlspecialchars($grp->getName());
|
||||
else print "<li class=\"cbSelectItem\"><input id='appGrp".$grp->getID()."' type='checkbox' name='grpApprovers[]' value='". $grp->getID() ."'>".htmlspecialchars($grp->getName());
|
||||
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><?php printMLText("add_doc_reviewer_approver_warning")?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("update_document")?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -33,57 +33,23 @@ if(!$settings->_enableLargeFileUpload) {
|
|||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
$documentid = intval($_GET["documentid"]);
|
||||
$document = $dms->getDocument($documentid);
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
|
||||
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."\">".htmlspecialchars($document->getName())."</a>";
|
||||
|
||||
if ($document->getAccessMode($user) < M_READWRITE) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
$folder = $document->getFolder();
|
||||
|
||||
UI::contentHeading(getMLText("update_document") . ": " . htmlspecialchars($document->getName()));
|
||||
UI::contentContainerStart();
|
||||
|
||||
if ($document->isLocked()) {
|
||||
|
||||
$lockingUser = $document->getLockingUser();
|
||||
|
||||
print "<table><tr><td class=\"warning\">";
|
||||
|
||||
printMLText("update_locked_msg", array("username" => htmlspecialchars($lockingUser->getFullName()), "email" => htmlspecialchars($lockingUser->getEmail())));
|
||||
|
||||
if ($lockingUser->getID() == $user->getID())
|
||||
printMLText("unlock_cause_locking_user");
|
||||
else if ($document->getAccessMode($user) == M_ALL)
|
||||
printMLText("unlock_cause_access_mode_all");
|
||||
else
|
||||
{
|
||||
printMLText("no_update_cause_locked");
|
||||
print "</td></tr></table>";
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
|
||||
print "</td></tr></table><br>";
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Retrieve a list of all users and groups that have review / approve
|
||||
// privileges.
|
||||
$docAccess = $document->getApproversList();
|
||||
|
||||
UI::printUploadApplet('../op/op.UpdateDocument2.php', array('folderid'=>$folder->getId(), 'documentid'=>$document->getId()), 1, array('version_comment'=>1));
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -29,146 +29,11 @@ if ($user->isGuest()) {
|
|||
|
||||
$categories = $dms->getAllUserKeywordCategories($user->getID());
|
||||
|
||||
UI::htmlStartPage(getMLText("edit_default_keywords"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("my_account"), "my_account");
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
obj = -1;
|
||||
function showKeywords(selectObj) {
|
||||
if (obj != -1)
|
||||
obj.style.display = "none";
|
||||
|
||||
id = selectObj.options[selectObj.selectedIndex].value;
|
||||
if (id == -1)
|
||||
return;
|
||||
|
||||
obj = document.getElementById("keywords" + id);
|
||||
obj.style.display = "";
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'categories'=>$categories));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
UI::contentHeading(getMLText("edit_default_keywords"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo getMLText("selection")?>:</td>
|
||||
<td>
|
||||
<select onchange="showKeywords(this)" id="selector">
|
||||
<option value="-1"><?php echo getMLText("choose_category")?>
|
||||
<option value="0"><?php echo getMLText("new_default_keyword_category")?>
|
||||
<?php
|
||||
|
||||
$selected=0;
|
||||
$count=2;
|
||||
foreach ($categories as $category) {
|
||||
|
||||
$owner = $category->getOwner();
|
||||
if ($owner->getID() != $user->getID()) continue;
|
||||
|
||||
if (isset($_GET["categoryid"]) && $category->getID()==$_GET["categoryid"]) $selected=$count;
|
||||
print "<option value=\"".$category->getID()."\">" . htmlspecialchars($category->getName());
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
|
||||
<td id="keywords0" style="display : none;">
|
||||
<form action="../op/op.UserDefaultKeywords.php" method="post" name="addcategory">
|
||||
<input type="Hidden" name="action" value="addcategory">
|
||||
<?php printMLText("name");?> : <input name="name">
|
||||
<input type="Submit" value="<?php printMLText("new_default_keyword_category"); ?>">
|
||||
</form>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
foreach ($categories as $category) {
|
||||
|
||||
$owner = $category->getOwner();
|
||||
if ($owner->getID() != $user->getID()) continue;
|
||||
|
||||
print "<td id=\"keywords".$category->getID()."\" style=\"display : none;\">";
|
||||
?>
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a href="../op/op.UserDefaultKeywords.php?categoryid=<?php print $category->getID();?>&action=removecategory"><img src="images/del.gif" border="0"><?php printMLText("rm_default_keyword_category");?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php UI::contentSubHeading("");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo getMLText("name")?>:</td>
|
||||
<td>
|
||||
<form action="../op/op.UserDefaultKeywords.php" method="post" name="<?php echo "category".$category->getID()?>">
|
||||
<input type="Hidden" name="action" value="editcategory">
|
||||
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
|
||||
<input name="name" value="<?php echo htmlspecialchars($category->getName())?>">
|
||||
<input type="Submit" value="<?php printMLText("save");?>">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php UI::contentSubHeading("");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo getMLText("default_keywords")?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
$lists = $category->getKeywordLists();
|
||||
if (count($lists) == 0)
|
||||
print getMLText("no_default_keywords");
|
||||
else
|
||||
foreach ($lists as $list) {
|
||||
?>
|
||||
<form action="../op/op.UserDefaultKeywords.php" method="post" name="<?php echo "cat".$category->getID().".".$list["id"]?>">
|
||||
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
|
||||
<input type="Hidden" name="keywordsid" value="<?php echo $list["id"]?>">
|
||||
<input type="Hidden" name="action" value="editkeywords">
|
||||
<input name="keywords" value="<?php echo htmlspecialchars($list["keywords"]) ?>">
|
||||
<input name="action" value="editkeywords" type="Image" src="images/save.gif" title="<?php echo getMLText("save")?>" border="0">
|
||||
<!-- <input name="action" value="removekeywords" type="Image" src="images/del.gif" title="<?php echo getMLText("delete")?>" border="0"> -->
|
||||
<a href="../op/op.UserDefaultKeywords.php?categoryid=<?php echo $category->getID()?>&keywordsid=<?php echo $list["id"]?>&action=removekeywords"><img src="images/del.gif" title="<?php echo getMLText("delete")?>" border=0></a>
|
||||
</form>
|
||||
<br>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<form action="../op/op.UserDefaultKeywords.php" method="post" name="<?php echo $category->getID().".add"?>">
|
||||
<td><input type="Submit" value="<?php printMLText("new_default_keywords");?>"></td>
|
||||
<td>
|
||||
<input type="Hidden" name="action" value="newkeywords">
|
||||
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
|
||||
<input name="keywords">
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
<?php } ?>
|
||||
</tr></table>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
sel = document.getElementById("selector");
|
||||
sel.selectedIndex=<?php print $selected ?>;
|
||||
showKeywords(sel);
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::htmlEndPage();
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,94 +1,38 @@
|
|||
<?php
|
||||
// MyDMS. Document Management System
|
||||
<?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.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
//
|
||||
// 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.
|
||||
|
||||
UI::htmlStartPage(getMLText("admin_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
UI::contentHeading(getMLText("user_list"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
$users = $dms->getAllUsers($settings->_sortUsersInList);
|
||||
foreach ($users as $currUser) {
|
||||
if ($currUser->isGuest())
|
||||
continue;
|
||||
|
||||
UI::contentSubHeading(getMLText("user") . ": \"" . $currUser->getFullName() . "\"");
|
||||
?>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td><?php printMLText("user_login");?>:</td>
|
||||
<td><?php print $currUser->getLogin();?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("user_name");?>:</td>
|
||||
<td><?php print $currUser->getFullName();?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("email");?>:</td>
|
||||
<td><a href="mailto:<?php print $currUser->getEmail();?>"><?php print $currUser->getEmail();?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment");?>:</td>
|
||||
<td><?php print $currUser->getComment();?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("groups");?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
$groups = $currUser->getGroups();
|
||||
if (count($groups) == 0) {
|
||||
printMLText("no_groups");
|
||||
}
|
||||
else {
|
||||
for ($j = 0; $j < count($groups); $j++) {
|
||||
print $groups[$j]->getName();
|
||||
if ($j +1 < count($groups))
|
||||
print ", ";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("user_image");?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($currUser->hasImage())
|
||||
print "<img src=\"".$settings->_httpRoot . "out/out.UserImage.php?userid=".$currUser->getId()."\">";
|
||||
else
|
||||
printMLText("no_user_image");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
include("../inc/inc.Settings.php");
|
||||
include("../inc/inc.DBInit.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"));
|
||||
}
|
||||
|
||||
$allUsers = $dms->getAllUsers($settings->_sortUsersInList);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'allusers'=>$allUsers, 'httproot'=>$settings->_httpRoot));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -29,406 +29,20 @@ if (!$user->isAdmin()) {
|
|||
}
|
||||
|
||||
$users = $dms->getAllUsers($settings->_sortUsersInList);
|
||||
|
||||
if (is_bool($users)) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"));
|
||||
}
|
||||
|
||||
$groups = $dms->getAllGroups();
|
||||
|
||||
if (is_bool($groups)) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"));
|
||||
}
|
||||
|
||||
|
||||
UI::htmlStartPage(getMLText("admin_tools"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
|
||||
?>
|
||||
<script type="text/javascript" src='../js/jquery.passwordstrength.js'></script>
|
||||
<script language="JavaScript">
|
||||
|
||||
function checkForm(num)
|
||||
{
|
||||
msg = "";
|
||||
eval("var formObj = document.form" + num + ";");
|
||||
|
||||
if (formObj.login.value == "") msg += "<?php printMLText("js_no_login");?>\n";
|
||||
if ((num == '0') && (formObj.pwd.value == "")) msg += "<?php printMLText("js_no_pwd");?>\n";
|
||||
if ((formObj.pwd.value != formObj.pwdconf.value)&&(formObj.pwd.value != "" )&&(formObj.pwd.value != "" )) msg += "<?php printMLText("js_pwd_not_conf");?>\n";
|
||||
if (formObj.name.value == "") msg += "<?php printMLText("js_no_name");?>\n";
|
||||
if (formObj.email.value == "") msg += "<?php printMLText("js_no_email");?>\n";
|
||||
//if (formObj.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'allusers'=>$users, 'allgroups'=>$groups, 'passwordstrength'=>$settings->_passwordStrength, 'passwordexpiration'=>$settings->_passwordExpiration, 'httproot'=>$settings->_httpRoot, 'enableuserimage'=>$settings->_enableUserImage));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
obj = -1;
|
||||
function showUser(selectObj) {
|
||||
if (obj != -1)
|
||||
obj.style.display = "none";
|
||||
|
||||
id = selectObj.options[selectObj.selectedIndex].value;
|
||||
if (id == -1)
|
||||
return;
|
||||
|
||||
obj = document.getElementById("keywords" + id);
|
||||
obj.style.display = "";
|
||||
}
|
||||
|
||||
$(document).ready( function() {
|
||||
$(".pwd").passStrength({
|
||||
url: "../op/op.Ajax.php",
|
||||
minscore: <?php echo (int) $settings->_passwordStrength; ?>
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
|
||||
UI::contentHeading(getMLText("user_management"));
|
||||
UI::contentContainerStart();
|
||||
?>
|
||||
<table><tr>
|
||||
|
||||
<td><?php echo getMLText("selection")?>:
|
||||
<select onchange="showUser(this)" id="selector">
|
||||
<option value="-1"><?php echo getMLText("choose_user")?>
|
||||
<option value="0"><?php echo getMLText("add_user")?>
|
||||
|
||||
<?php
|
||||
$selected=0;
|
||||
$count=2;
|
||||
foreach ($users as $currUser) {
|
||||
if (isset($_GET["userid"]) && $currUser->getID()==$_GET["userid"]) $selected=$count;
|
||||
print "<option value=\"".$currUser->getID()."\">" . htmlspecialchars($currUser->getLogin() . " - ". $currUser->getFullName());
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
|
||||
<td id="keywords0" style="display : none;">
|
||||
|
||||
<form action="../op/op.UsrMgr.php" method="post" enctype="multipart/form-data" name="form0" onsubmit="return checkForm('0');">
|
||||
<?php echo createHiddenFieldWithKey('adduser'); ?>
|
||||
<input type="Hidden" name="action" value="adduser">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("user_login");?>:</td>
|
||||
<td><input name="login"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("password");?>:</td>
|
||||
<td><input class="pwd" name="pwd" type="Password"> <div id="outerstrength" style="min-width: 100px; height: 14px; display: inline-block; border: 1px solid black; padding: 1px;"><div id="innerstrength" style="width: 0px; height: 14px; display: inline-block; border: 0px; padding: 0px; background-color: red;"> </div> <div id="strength" style="display: inline-block;"></div></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("confirm_pwd");?>:</td>
|
||||
<td><input type="Password" name="pwdconf"></td>
|
||||
</tr>
|
||||
<?php
|
||||
if($settings->_passwordExpiration > 0) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php printMLText("password_expiration");?>:</td>
|
||||
<td><select name="pwdexpiration"><option value="<?php echo date('Y-m-d H:i:s'); ?>"><?php printMLText("now");?></option><option value="<?php echo date('Y-m-d H:i:s', time()+$settings->_passwordExpiration*86400); ?>"><?php printMLText("according_settings");?></option></select></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?php printMLText("user_name");?>:</td>
|
||||
<td><input name="name"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("email");?>:</td>
|
||||
<td><input name="email"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="4" cols="50"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("role");?>:</td>
|
||||
<td><select name="role"><option value="<?php echo LetoDMS_Core_User::role_user ?>"><?php printMLText("role_user"); ?></option><option value="<?php echo LetoDMS_Core_User::role_admin ?>"><?php printMLText("role_admin"); ?></option><option value="<?php echo LetoDMS_Core_User::role_guest ?>"><?php printMLText("role_guest"); ?></option></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("is_hidden");?>:</td>
|
||||
<td><input type="checkbox" name="ishidden" value="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("is_disabled");?>:</td>
|
||||
<td><input type="checkbox" name="isdisabled" value="1"></td>
|
||||
</tr>
|
||||
|
||||
<?php if ($settings->_enableUserImage){ ?>
|
||||
|
||||
<tr>
|
||||
<td><?php printMLText("user_image");?>:</td>
|
||||
<td><input type="File" name="userfile"></td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<tr>
|
||||
<td><?php printMLText("reviewers");?>:</td>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList"><?php
|
||||
foreach ($users as $usr) {
|
||||
|
||||
if ($usr->isGuest()) continue;
|
||||
|
||||
print "<li class=\"cbSelectItem\"><input id='revUsr".$usr->getID()."' type='checkbox' name='usrReviewers[]' value='". $usr->getID() ."'>".htmlspecialchars($usr->getLogin());
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
foreach ($groups as $grp) {
|
||||
|
||||
print "<li class=\"cbSelectItem\"><input id='revGrp".$grp->getID()."' type='checkbox' name='grpReviewers[]' value='". $grp->getID() ."'>".htmlspecialchars($grp->getName());
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php printMLText("approvers");?>:</td>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
foreach ($users as $usr) {
|
||||
|
||||
if ($usr->isGuest()) continue;
|
||||
|
||||
print "<li class=\"cbSelectItem\"><input id='appUsr".$usr->getID()."' type='checkbox' name='usrApprovers[]' value='". $usr->getID() ."'>".htmlspecialchars($usr->getLogin());
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
foreach ($groups as $grp) {
|
||||
|
||||
print "<li class=\"cbSelectItem\"><input id='revGrp".$grp->getID()."' type='checkbox' name='grpApprovers[]' value='". $grp->getID() ."'>".htmlspecialchars($grp->getName());
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("add_user");?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<?php
|
||||
foreach ($users as $currUser) {
|
||||
|
||||
print "<td id=\"keywords".$currUser->getID()."\" style=\"display : none;\">";
|
||||
|
||||
UI::contentSubHeading(getMLText("user")." : ".htmlspecialchars($currUser->getLogin()));
|
||||
?>
|
||||
|
||||
<a class="standardText" href="../out/out.RemoveUser.php?userid=<?php print $currUser->getID();?>"><img src="images/del.gif" width="15" height="15" border="0" align="absmiddle" alt=""> <?php printMLText("rm_user");?></a>
|
||||
|
||||
<?php UI::contentSubHeading(getMLText("edit_user"));?>
|
||||
|
||||
<form action="../op/op.UsrMgr.php" method="post" enctype="multipart/form-data" name="form<?php print $currUser->getID();?>" onsubmit="return checkForm('<?php print $currUser->getID();?>');">
|
||||
<?php echo createHiddenFieldWithKey('edituser'); ?>
|
||||
<input type="Hidden" name="userid" value="<?php print $currUser->getID();?>">
|
||||
<input type="Hidden" name="action" value="edituser">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("user_login");?>:</td>
|
||||
<td><input name="login" value="<?php print htmlspecialchars($currUser->getLogin());?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("password");?>:</td>
|
||||
<td><input type="Password" name="pwd"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("confirm_pwd");?>:</td>
|
||||
<td><input type="Password" name="pwdconf"></td>
|
||||
</tr>
|
||||
<?php
|
||||
if($settings->_passwordExpiration > 0) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php printMLText("password_expiration");?>:</td>
|
||||
<td><select name="pwdexpiration"><option value="<?php echo date('Y-m-d H:i:s'); ?>"><?php printMLText("now");?></option><option value="<?php echo date('Y-m-d H:i:s', time()+$settings->_passwordExpiration*86400); ?>"><?php printMLText("according_settings");?></option></select> <?php echo $currUser->getPwdExpiration(); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?php printMLText("user_name");?>:</td>
|
||||
<td><input name="name" value="<?php print htmlspecialchars($currUser->getFullName());?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("email");?>:</td>
|
||||
<td><input name="email" value="<?php print htmlspecialchars($currUser->getEmail()) ;?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="4" cols="50"><?php print htmlspecialchars($currUser->getComment());?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("role");?>:</td>
|
||||
<td><select name="role"><option value="<?php echo LetoDMS_Core_User::role_user ?>"><?php printMLText("role_user"); ?></option><option value="<?php echo LetoDMS_Core_User::role_admin ?>" <?php if($currUser->getRole() == LetoDMS_Core_User::role_admin) echo "selected"; ?>><?php printMLText("role_admin"); ?></option><option value="<?php echo LetoDMS_Core_User::role_guest ?>" <?php if($currUser->getRole() == LetoDMS_Core_User::role_guest) echo "selected"; ?>><?php printMLText("role_guest"); ?></option></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("is_hidden");?>:</td>
|
||||
<td><input type="checkbox" name="ishidden" value="1"<?php print ($currUser->isHidden() ? " checked='checked'" : "");?>></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("is_disabled");?>:</td>
|
||||
<td><input type="checkbox" name="isdisabled" value="1"<?php print ($currUser->isDisabled() ? " checked='checked'" : "");?>></td>
|
||||
</tr>
|
||||
|
||||
<?php if ($settings->_enableUserImage){ ?>
|
||||
|
||||
<tr>
|
||||
<td><?php printMLText("user_image");?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($currUser->hasImage())
|
||||
print "<img src=\"".$settings->_httpRoot . "out/out.UserImage.php?userid=".$currUser->getId()."\">";
|
||||
else
|
||||
printMLText("no_user_image");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("new_user_image");?>:</td>
|
||||
<td><input type="file" name="userfile" accept="image/jpeg"></td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<tr>
|
||||
<td><?php printMLText("reviewers");?>:</td>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
|
||||
$res=$currUser->getMandatoryReviewers();
|
||||
|
||||
foreach ($users as $usr) {
|
||||
|
||||
if ($usr->isGuest() || ($usr->getID() == $currUser->getID()))
|
||||
continue;
|
||||
|
||||
$checked=false;
|
||||
foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $checked=true;
|
||||
|
||||
print "<li class=\"cbSelectItem\"><input id='revUsr".$usr->getID()."' type='checkbox' ".($checked?"checked='checked' ":"")."name='usrReviewers[]' value='". $usr->getID() ."'>".htmlspecialchars($usr->getLogin())."</li>\n";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
foreach ($groups as $grp) {
|
||||
|
||||
$checked=false;
|
||||
foreach ($res as $r) if ($r['reviewerGroupID']==$grp->getID()) $checked=true;
|
||||
|
||||
print "<li class=\"cbSelectItem\"><input id='revGrp".$grp->getID()."' type='checkbox' ".($checked?"checked='checked' ":"")."name='grpReviewers[]' value='". $grp->getID() ."'>".htmlspecialchars($grp->getName())."</li>\n";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php printMLText("approvers");?>:</td>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
|
||||
$res=$currUser->getMandatoryApprovers();
|
||||
|
||||
foreach ($users as $usr) {
|
||||
|
||||
if ($usr->isGuest() || ($usr->getID() == $currUser->getID()))
|
||||
continue;
|
||||
|
||||
$checked=false;
|
||||
foreach ($res as $r) if ($r['approverUserID']==$usr->getID()) $checked=true;
|
||||
|
||||
print "<li class=\"cbSelectItem\"><input id='appUsr".$usr->getID()."' type='checkbox' ".($checked?"checked='checked' ":"")."name='usrApprovers[]' value='". $usr->getID() ."'>".htmlspecialchars($usr->getLogin())."</li>\n";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div>
|
||||
<div class="cbSelectContainer">
|
||||
<ul class="cbSelectList">
|
||||
<?php
|
||||
foreach ($groups as $grp) {
|
||||
|
||||
$checked=false;
|
||||
foreach ($res as $r) if ($r['approverGroupID']==$grp->getID()) $checked=true;
|
||||
|
||||
print "<li class=\"cbSelectItem\"><input id='revGrp".$grp->getID()."' type='checkbox' ".($checked?"checked='checked' ":"")."name='grpApprovers[]' value='". $grp->getID() ."'>".htmlspecialchars($grp->getName())."</li>\n";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("save");?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr></table>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
sel = document.getElementById("selector");
|
||||
sel.selectedIndex=<?php print $selected ?>;
|
||||
showUser(sel);
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,82 +1,45 @@
|
|||
<?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");
|
||||
<?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.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if ($user->isGuest()) {
|
||||
UI::exitError(getMLText("my_account"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (!$settings->_enableUsersView) {
|
||||
UI::exitError(getMLText("my_account"),getMLText("access_denied"));
|
||||
UI::exitError(getMLText("my_account"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
|
||||
$users = $dms->getAllUsers();
|
||||
|
||||
if (is_bool($users)) {
|
||||
UI::exitError(getMLText("my_account"),getMLText("internal_error"));
|
||||
UI::exitError(getMLText("my_account"),getMLText("internal_error"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("my_account"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("my_account"), "my_account");
|
||||
|
||||
UI::contentHeading(getMLText("users"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
echo "<table class=\"userView\">\n";
|
||||
echo "<thead>\n<tr>\n";
|
||||
echo "<th>".getMLText("name")."</th>\n";
|
||||
echo "<th>".getMLText("email")."</th>\n";
|
||||
echo "<th>".getMLText("comment")."</th>\n";
|
||||
if ($settings->_enableUserImage) echo "<th>".getMLText("user_image")."</th>\n";
|
||||
echo "</tr>\n</thead>\n";
|
||||
|
||||
foreach ($users as $currUser) {
|
||||
|
||||
if ($currUser->isGuest())
|
||||
continue;
|
||||
|
||||
if ($currUser->isHidden()=="1") continue;
|
||||
|
||||
echo "<tr>\n";
|
||||
|
||||
print "<td>".htmlspecialchars($currUser->getFullName())."</td>";
|
||||
|
||||
print "<td><a href=\"mailto:".htmlspecialchars($currUser->getEmail())."\">".htmlspecialchars($currUser->getEmail())."</a></td>";
|
||||
print "<td>".htmlspecialchars($currUser->getComment())."</td>";
|
||||
|
||||
if ($settings->_enableUserImage){
|
||||
print "<td>";
|
||||
if ($currUser->hasImage()) print "<img src=\"".$settings->_httpRoot . "out/out.UserImage.php?userid=".$currUser->getId()."\">";
|
||||
else printMLText("no_user_image");
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
echo "</tr>\n";
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'allusers'=>$users, 'enableuserimage'=>$settings->_enableUserImage, 'httproot'=>$settings->_httpRoot));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
echo "</table>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -27,536 +27,48 @@ include("../inc/inc.ClassUI.php");
|
|||
include("../inc/inc.ClassAccessOperation.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
function filterDocumentLinks($user, $links) { /* {{{ */
|
||||
GLOBAL $settings;
|
||||
|
||||
$tmp = array();
|
||||
foreach ($links as $link)
|
||||
if ($link->isPublic() || ($link->_userID == $user->getID()) || $user->isAdmin())
|
||||
array_push($tmp, $link);
|
||||
return $tmp;
|
||||
} /* }}} */
|
||||
/**
|
||||
* Include class to preview documents
|
||||
*/
|
||||
require_once("LetoDMS_Preview/Preview.php");
|
||||
|
||||
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"));
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1]);
|
||||
if(!$view) {
|
||||
}
|
||||
|
||||
$documentid = intval($_GET["documentid"]);
|
||||
$document = $dms->getDocument($documentid);
|
||||
if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
|
||||
$view->exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
$document = $dms->getDocument($_GET["documentid"]);
|
||||
if (!is_object($document)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
$view->exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||
}
|
||||
|
||||
$folder = $document->getFolder();
|
||||
$docPathHTML = getFolderPathHTML($folder, true). " / ".htmlspecialchars($document->getName());
|
||||
|
||||
if ($document->getAccessMode($user) < M_READ) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
$view->exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if ($document->verifyLastestContentExpriry()){
|
||||
header("Location:../out/out.ViewDocument.php?documentid=".$documentid);
|
||||
header("Location:../out/out.ViewDocument.php?documentid=".$document->getID());
|
||||
}
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new LetoDMS_AccessOperation($document, $user, $settings);
|
||||
|
||||
UI::htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($docPathHTML, "view_document");
|
||||
UI::contentHeading(getMLText("document_infos"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
?>
|
||||
<table>
|
||||
<?php
|
||||
if ($document->isLocked()) {
|
||||
$lockingUser = $document->getLockingUser();
|
||||
?>
|
||||
<tr>
|
||||
<td class="warning" colspan=2><?php printMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => htmlspecialchars($lockingUser->getFullName())));?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?php printMLText("owner");?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
$owner = $document->getOwner();
|
||||
print "<a class=\"infos\" href=\"mailto:".$owner->getEmail()."\">".htmlspecialchars($owner->getFullName())."</a>";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment");?>:</td>
|
||||
<td><?php print htmlspecialchars($document->getComment());?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("creation_date");?>:</td>
|
||||
<td><?php print getLongReadableDate($document->getDate()); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("keywords");?>:</td>
|
||||
<td><?php print htmlspecialchars($document->getKeywords());?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("categories");?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
$cats = $document->getCategories();
|
||||
$ct = array();
|
||||
foreach($cats as $cat)
|
||||
$ct[] = htmlspecialchars($cat->getName());
|
||||
echo implode(', ', $ct);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$attributes = $document->getAttributes();
|
||||
if($attributes) {
|
||||
foreach($attributes as $attribute) {
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||
<td><?php echo htmlspecialchars($attribute->getValue()); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
UI::contentContainerEnd();
|
||||
|
||||
$versions = $document->getContent();
|
||||
if(!$latestContent = $document->getLatestContent()) {
|
||||
UI::contentHeading(getMLText("current_version"));
|
||||
UI::contentContainerStart();
|
||||
print getMLText('document_content_missing');
|
||||
UI::contentContainerEnd();
|
||||
UI::htmlEndPage();
|
||||
if($view) {
|
||||
$view->setParam('dms', $dms);
|
||||
$view->setParam('user', $user);
|
||||
$view->setParam('folder', $folder);
|
||||
$view->setParam('document', $document);
|
||||
$view->setParam('accessobject', $accessop);
|
||||
$view->setParam('viewonlinefiletypes', $settings->_viewOnlineFileTypes);
|
||||
$view->setParam('cachedir', $settings->_cacheDir);
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
$status = $latestContent->getStatus();
|
||||
$reviewStatus = $latestContent->getReviewStatus();
|
||||
$approvalStatus = $latestContent->getApprovalStatus();
|
||||
|
||||
// verify if file exists
|
||||
$file_exists=file_exists($dms->contentDir . $latestContent->getPath());
|
||||
|
||||
UI::contentHeading(getMLText("current_version"));
|
||||
UI::contentContainerStart();
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th width='10%'></th>\n";
|
||||
print "<th width='10%'>".getMLText("version")."</th>\n";
|
||||
print "<th width='20%'>".getMLText("file")."</th>\n";
|
||||
print "<th width='25%'>".getMLText("comment")."</th>\n";
|
||||
print "<th width='15%'>".getMLText("status")."</th>\n";
|
||||
print "<th width='20%'></th>\n";
|
||||
print "</tr></thead><tbody>\n";
|
||||
print "<tr>\n";
|
||||
print "<td><ul class=\"actions\">";
|
||||
|
||||
if ($file_exists){
|
||||
print "<li><a href=\"../op/op.Download.php?documentid=".$documentid."&version=".$latestContent->getVersion()."\"><img class=\"mimeicon\" src=\"images/icons/".UI::getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">".getMLText("download")."</a></li>";
|
||||
if ($settings->_viewOnlineFileTypes && in_array(strtolower($latestContent->getFileType()), $settings->_viewOnlineFileTypes))
|
||||
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&version=". $latestContent->getVersion()."\"><img src=\"images/view.gif\" class=\"mimeicon\">" . getMLText("view_online") . "</a></li>";
|
||||
}else print "<li><img class=\"mimeicon\" src=\"images/icons/".UI::getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\"></li>";
|
||||
|
||||
print "</ul></td>\n";
|
||||
print "<td>".$latestContent->getVersion()."</td>\n";
|
||||
|
||||
print "<td><ul class=\"documentDetail\">\n";
|
||||
print "<li>".$latestContent->getOriginalFileName() ."</li>\n";
|
||||
|
||||
if ($file_exists)
|
||||
print "<li>". formatted_size(filesize($dms->contentDir . $latestContent->getPath())) ." ".htmlspecialchars($latestContent->getMimeType())."</li>";
|
||||
else print "<li><span class=\"warning\">".getMLText("document_deleted")."</span></li>";
|
||||
|
||||
$updatingUser = $latestContent->getUser();
|
||||
print "<li>".getMLText("uploaded_by")." <a href=\"mailto:".$updatingUser->getEmail()."\">".htmlspecialchars($updatingUser->getFullName())."</a></li>";
|
||||
print "<li>".getLongReadableDate($latestContent->getDate())."</li>";
|
||||
|
||||
print "</ul>\n";
|
||||
print "<ul class=\"documentDetail\">\n";
|
||||
$attributes = $latestContent->getAttributes();
|
||||
if($attributes) {
|
||||
foreach($attributes as $attribute) {
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars($attribute->getValue())."</li>\n";
|
||||
}
|
||||
}
|
||||
print "</ul>\n";
|
||||
|
||||
print "<td>".htmlspecialchars($latestContent->getComment())."</td>";
|
||||
|
||||
print "<td width='10%'>".getOverallStatusText($status["status"]);
|
||||
if ( $status["status"]==S_DRAFT_REV || $status["status"]==S_DRAFT_APP || $status["status"]==S_EXPIRED ){
|
||||
print "<br><span".($document->hasExpired()?" class=\"warning\" ":"").">".(!$document->getExpires() ? getMLText("does_not_expire") : getMLText("expires").": ".getReadableDate($document->getExpires()))."</span>";
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print "<td>";
|
||||
|
||||
print "<ul class=\"actions\">";
|
||||
/* Only admin has the right to remove version in any case or a regular
|
||||
* user if enableVersionDeletion is on
|
||||
*/
|
||||
if($accessop->mayRemoveVersion()) {
|
||||
print "<li><a href=\"out.RemoveVersion.php?documentid=".$documentid."&version=".$latestContent->getVersion()."\">".getMLText("rm_version")."</a></li>";
|
||||
}
|
||||
if($accessop->mayOverwriteStatus()) {
|
||||
print "<li><a href='../out/out.OverrideContentStatus.php?documentid=".$documentid."&version=".$latestContent->getVersion()."'>".getMLText("change_status")."</a></li>";
|
||||
}
|
||||
// Allow changing reviewers/approvals only if not reviewed
|
||||
if($accessop->maySetReviewersApprovers()) {
|
||||
print "<li><a href='../out/out.SetReviewersApprovers.php?documentid=".$documentid."&version=".$latestContent->getVersion()."'>".getMLText("change_assignments")."</a></li>";
|
||||
}
|
||||
if($accessop->maySetExpires()) {
|
||||
print "<li><a href='../out/out.SetExpires.php?documentid=".$documentid."'>".getMLText("set_expiry")."</a></li>";
|
||||
}
|
||||
if($accessop->mayEditComment()) {
|
||||
print "<li><a href=\"out.EditComment.php?documentid=".$documentid."&version=".$latestContent->getVersion()."\">".getMLText("edit_comment")."</a></li>";
|
||||
}
|
||||
if($accessop->mayEditAttributes()) {
|
||||
print "<li><a href=\"out.EditAttributes.php?documentid=".$documentid."&version=".$latestContent->getVersion()."\">".getMLText("edit_attributes")."</a></li>";
|
||||
}
|
||||
|
||||
print "<li><a href=\"../op/op.Download.php?documentid=".$documentid."&vfile=1\">".getMLText("versioning_info")."</a></li>";
|
||||
|
||||
print "</ul>";
|
||||
echo "</td>";
|
||||
print "</tr></tbody>\n</table>\n";
|
||||
|
||||
print "<table class=\"folderView\">\n";
|
||||
|
||||
if (is_array($reviewStatus) && count($reviewStatus)>0) {
|
||||
|
||||
print "<tr><td colspan=5>\n";
|
||||
UI::contentSubHeading(getMLText("reviewers"));
|
||||
print "</tr>";
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td width='20%'><b>".getMLText("name")."</b></td>\n";
|
||||
print "<td width='20%'><b>".getMLText("last_update")."</b></td>\n";
|
||||
print "<td width='25%'><b>".getMLText("comment")."</b></td>";
|
||||
print "<td width='15%'><b>".getMLText("status")."</b></td>\n";
|
||||
print "<td width='20%'></td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ($reviewStatus as $r) {
|
||||
$required = null;
|
||||
$is_reviewer = false;
|
||||
switch ($r["type"]) {
|
||||
case 0: // Reviewer is an individual.
|
||||
$required = $dms->getUser($r["required"]);
|
||||
if (!is_object($required)) {
|
||||
$reqName = getMLText("unknown_user")." '".$r["required"]."'";
|
||||
}
|
||||
else {
|
||||
$reqName = htmlspecialchars($required->getFullName());
|
||||
}
|
||||
if($r["required"] == $user->getId())
|
||||
$is_reviewer = true;
|
||||
break;
|
||||
case 1: // Reviewer is a group.
|
||||
$required = $dms->getGroup($r["required"]);
|
||||
if (!is_object($required)) {
|
||||
$reqName = getMLText("unknown_group")." '".$r["required"]."'";
|
||||
}
|
||||
else {
|
||||
$reqName = "<i>".htmlspecialchars($required->getName())."</i>";
|
||||
}
|
||||
if($required->isMember($user) && ($user->getId() != $owner->getId()))
|
||||
$is_reviewer = true;
|
||||
break;
|
||||
}
|
||||
print "<tr>\n";
|
||||
print "<td>".$reqName."</td>\n";
|
||||
print "<td><ul class=\"documentDetail\"><li>".$r["date"]."</li>";
|
||||
/* $updateUser is the user who has done the review */
|
||||
$updateUser = $dms->getUser($r["userID"]);
|
||||
print "<li>".(is_object($updateUser) ? htmlspecialchars($updateUser->getFullName()) : "unknown user id '".$r["userID"]."'")."</li></ul></td>";
|
||||
print "<td>".htmlspecialchars($r["comment"])."</td>\n";
|
||||
print "<td>".getReviewStatusText($r["status"])."</td>\n";
|
||||
print "<td><ul class=\"actions\">";
|
||||
|
||||
if($accessop->mayReview()) {
|
||||
if ($is_reviewer && $r["status"]==0) {
|
||||
print "<li><a href=\"../out/out.ReviewDocument.php?documentid=".$documentid."&version=".$latestContent->getVersion()."&reviewid=".$r['reviewID']."\">".getMLText("submit_review")."</a></li>";
|
||||
}else if (($updateUser==$user)&&(($r["status"]==1)||($r["status"]==-1))&&(!$document->hasExpired())){
|
||||
print "<li><a href=\"../out/out.ReviewDocument.php?documentid=".$documentid."&version=".$latestContent->getVersion()."&reviewid=".$r['reviewID']."\">".getMLText("edit")."</a></li>";
|
||||
}
|
||||
}
|
||||
|
||||
print "</ul></td>\n";
|
||||
print "</td>\n</tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($approvalStatus) && count($approvalStatus)>0) {
|
||||
|
||||
print "<tr><td colspan=5>\n";
|
||||
UI::contentSubHeading(getMLText("approvers"));
|
||||
print "</tr>";
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td width='20%'><b>".getMLText("name")."</b></td>\n";
|
||||
print "<td width='20%'><b>".getMLText("last_update")."</b></td>\n";
|
||||
print "<td width='25%'><b>".getMLText("comment")."</b></td>";
|
||||
print "<td width='15%'><b>".getMLText("status")."</b></td>\n";
|
||||
print "<td width='20%'></td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ($approvalStatus as $a) {
|
||||
$required = null;
|
||||
$is_approver = false;
|
||||
switch ($a["type"]) {
|
||||
case 0: // Approver is an individual.
|
||||
$required = $dms->getUser($a["required"]);
|
||||
if (!is_object($required)) {
|
||||
$reqName = getMLText("unknown_user")." '".$r["required"]."'";
|
||||
}
|
||||
else {
|
||||
$reqName = htmlspecialchars($required->getFullName());
|
||||
}
|
||||
if($a["required"] == $user->getId())
|
||||
$is_approver = true;
|
||||
break;
|
||||
case 1: // Approver is a group.
|
||||
$required = $dms->getGroup($a["required"]);
|
||||
if (!is_object($required)) {
|
||||
$reqName = getMLText("unknown_group")." '".$r["required"]."'";
|
||||
}
|
||||
else {
|
||||
$reqName = "<i>".htmlspecialchars($required->getName())."</i>";
|
||||
}
|
||||
if($required->isMember($user) && ($user->getId() != $owner->getId()))
|
||||
$is_approver = true;
|
||||
break;
|
||||
}
|
||||
print "<tr>\n";
|
||||
print "<td>".$reqName."</td>\n";
|
||||
print "<td><ul class=\"documentDetail\"><li>".$a["date"]."</li>";
|
||||
/* $updateUser is the user who has done the approval */
|
||||
$updateUser = $dms->getUser($a["userID"]);
|
||||
print "<li>".(is_object($updateUser) ? htmlspecialchars($updateUser->getFullName()) : "unknown user id '".$a["userID"]."'")."</li></ul></td>";
|
||||
print "<td>".htmlspecialchars($a["comment"])."</td>\n";
|
||||
print "<td>".getApprovalStatusText($a["status"])."</td>\n";
|
||||
print "<td><ul class=\"actions\">";
|
||||
|
||||
if($accessop->mayApprove()) {
|
||||
if ($is_approver && $status["status"]==S_DRAFT_APP) {
|
||||
print "<li><a href=\"../out/out.ApproveDocument.php?documentid=".$documentid."&version=".$latestContent->getVersion()."&approveid=".$a['approveID']."\">".getMLText("submit_approval")."</a></li>";
|
||||
}else if (($updateUser==$user)&&(($a["status"]==1)||($a["status"]==-1))&&(!$document->hasExpired())){
|
||||
print "<li><a href=\"../out/out.ApproveDocument.php?documentid=".$documentid."&version=".$latestContent->getVersion()."&approveid=".$a['approveID']."\">".getMLText("edit")."</a></li>";
|
||||
}
|
||||
}
|
||||
|
||||
print "</ul></td>\n";
|
||||
print "</td>\n</tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::contentHeading(getMLText("previous_versions"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
if (count($versions)>1) {
|
||||
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th width='10%'></th>\n";
|
||||
print "<th width='10%'>".getMLText("version")."</th>\n";
|
||||
print "<th width='20%'>".getMLText("file")."</th>\n";
|
||||
print "<th width='25%'>".getMLText("comment")."</th>\n";
|
||||
print "<th width='15%'>".getMLText("status")."</th>\n";
|
||||
print "<th width='20%'></th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
for ($i = count($versions)-2; $i >= 0; $i--) {
|
||||
$version = $versions[$i];
|
||||
$vstat = $version->getStatus();
|
||||
|
||||
// verify if file exists
|
||||
$file_exists=file_exists($dms->contentDir . $version->getPath());
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td><ul class=\"actions\">";
|
||||
if ($file_exists){
|
||||
print "<li><a href=\"../op/op.Download.php?documentid=".$documentid."&version=".$version->getVersion()."\"><img class=\"mimeicon\" src=\"images/icons/".UI::getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">".getMLText("download")."</a>";
|
||||
if ($settings->_viewOnlineFileTypes && in_array(strtolower($latestContent->getFileType()), $settings->_viewOnlineFileTypes))
|
||||
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&version=".$version->getVersion()."\"><img src=\"images/view.gif\" class=\"mimeicon\">" . getMLText("view_online") . "</a>";
|
||||
}else print "<li><img class=\"mimeicon\" src=\"images/icons/".UI::getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
|
||||
|
||||
print "</ul></td>\n";
|
||||
print "<td>".$version->getVersion()."</td>\n";
|
||||
print "<td><ul class=\"documentDetail\">\n";
|
||||
print "<li>".$version->getOriginalFileName()."</li>\n";
|
||||
if ($file_exists) print "<li>". formatted_size(filesize($dms->contentDir . $version->getPath())) ." ".htmlspecialchars($version->getMimeType())."</li>";
|
||||
else print "<li><span class=\"warning\">".getMLText("document_deleted")."</span></li>";
|
||||
$updatingUser = $version->getUser();
|
||||
print "<li>".getMLText("uploaded_by")." <a href=\"mailto:".$updatingUser->getEmail()."\">".htmlspecialchars($updatingUser->getFullName())."</a></li>";
|
||||
print "<li>".getLongReadableDate($version->getDate())."</li>";
|
||||
print "</ul>\n";
|
||||
print "<ul class=\"documentDetail\">\n";
|
||||
$attributes = $version->getAttributes();
|
||||
if($attributes) {
|
||||
foreach($attributes as $attribute) {
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars($attribute->getValue())."</li>\n";
|
||||
}
|
||||
}
|
||||
print "</ul>\n";
|
||||
print "<td>".htmlspecialchars($version->getComment())."</td>";
|
||||
print "<td>".getOverallStatusText($vstat["status"])."</td>";
|
||||
print "<td>";
|
||||
print "<ul class=\"actions\">";
|
||||
/* Only admin has the right to remove version in any case or a regular
|
||||
* user if enableVersionDeletion is on
|
||||
*/
|
||||
if($accessop->mayRemoveVersion()) {
|
||||
print "<li><a href=\"out.RemoveVersion.php?documentid=".$documentid."&version=".$version->getVersion()."\">".getMLText("rm_version")."</a></li>";
|
||||
}
|
||||
print "<li><a href='../out/out.DocumentVersionDetail.php?documentid=".$documentid."&version=".$version->getVersion()."'>".getMLText("details")."</a></li>";
|
||||
print "</ul>";
|
||||
print "</td>\n</tr>\n";
|
||||
}
|
||||
print "</tbody>\n</table>\n";
|
||||
}
|
||||
else printMLText("no_previous_versions");
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::contentHeading(getMLText("linked_files"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
$files = $document->getDocumentFiles();
|
||||
|
||||
if (count($files) > 0) {
|
||||
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th width='20%'></th>\n";
|
||||
print "<th width='20%'>".getMLText("file")."</th>\n";
|
||||
print "<th width='40%'>".getMLText("comment")."</th>\n";
|
||||
print "<th width='20%'></th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
foreach($files as $file) {
|
||||
|
||||
$file_exists=file_exists($dms->contentDir . $file->getPath());
|
||||
|
||||
$responsibleUser = $file->getUser();
|
||||
|
||||
print "<tr>";
|
||||
print "<td><ul class=\"actions\">";
|
||||
if ($file_exists)
|
||||
print "<li><a href=\"../op/op.Download.php?documentid=".$documentid."&file=".$file->getID()."\"><img class=\"mimeicon\" src=\"images/icons/".UI::getMimeIcon($file->getFileType())."\" title=\"".htmlspecialchars($file->getMimeType())."\">".htmlspecialchars($file->getName())."</a>";
|
||||
else print "<li><img class=\"mimeicon\" src=\"images/icons/".UI::getMimeIcon($file->getFileType())."\" title=\"".htmlspecialchars($file->getMimeType())."\">";
|
||||
print "</ul></td>";
|
||||
|
||||
print "<td><ul class=\"documentDetail\">\n";
|
||||
print "<li>".$file->getOriginalFileName() ."</li>\n";
|
||||
if ($file_exists)
|
||||
print "<li>". filesize($dms->contentDir . $file->getPath()) ." bytes ".htmlspecialchars($file->getMimeType())."</li>";
|
||||
else print "<li>".htmlspecialchars($file->getMimeType())." - <span class=\"warning\">".getMLText("document_deleted")."</span></li>";
|
||||
|
||||
print "<li>".getMLText("uploaded_by")." <a href=\"mailto:".$responsibleUser->getEmail()."\">".htmlspecialchars($responsibleUser->getFullName())."</a></li>";
|
||||
print "<li>".getLongReadableDate($file->getDate())."</li>";
|
||||
|
||||
print "<td>".htmlspecialchars($file->getComment())."</td>";
|
||||
|
||||
print "<td><span class=\"actions\">";
|
||||
if (($document->getAccessMode($user) == M_ALL)||($file->getUserID()==$user->getID()))
|
||||
print "<form action=\"../out/out.RemoveDocumentFile.php\" method=\"get\"><input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"fileid\" value=\"".$file->getID()."\" /><input type=\"submit\" value=\"".getMLText("delete")."\" /></form>";
|
||||
print "</span></td>";
|
||||
|
||||
print "</tr>";
|
||||
}
|
||||
print "</tbody>\n</table>\n";
|
||||
|
||||
}
|
||||
else printMLText("no_attached_files");
|
||||
|
||||
if ($document->getAccessMode($user) >= M_READWRITE){
|
||||
print "<br>";
|
||||
print "<ul class=\"actions\"><li><a href=\"../out/out.AddFile.php?documentid=".$documentid."\">".getMLText("add")."</a></ul>\n";
|
||||
}
|
||||
UI::contentContainerEnd();
|
||||
|
||||
|
||||
UI::contentHeading(getMLText("linked_documents"));
|
||||
UI::contentContainerStart();
|
||||
$links = $document->getDocumentLinks();
|
||||
$links = filterDocumentLinks($user, $links);
|
||||
|
||||
if (count($links) > 0) {
|
||||
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th width='40%'></th>\n";
|
||||
print "<th width='25%'>".getMLText("comment")."</th>\n";
|
||||
print "<th width='15%'>".getMLText("document_link_by")."</th>\n";
|
||||
print "<th width='20%'></th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
foreach($links as $link) {
|
||||
$responsibleUser = $link->getUser();
|
||||
$targetDoc = $link->getTarget();
|
||||
|
||||
print "<tr>";
|
||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$targetDoc->getID()."\" class=\"linklist\">".htmlspecialchars($targetDoc->getName())."</a></td>";
|
||||
print "<td>".htmlspecialchars($targetDoc->getComment())."</td>";
|
||||
print "<td>".htmlspecialchars($responsibleUser->getFullName());
|
||||
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
|
||||
print "<br>".getMLText("document_link_public").":".(($link->isPublic()) ? getMLText("yes") : getMLText("no"));
|
||||
print "</td>";
|
||||
print "<td><span class=\"actions\">";
|
||||
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
|
||||
print "<form action=\"../op/op.RemoveDocumentLink.php\" method=\"post\">".createHiddenFieldWithKey('removedocumentlink')."<input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"linkid\" value=\"".$link->getID()."\" /><input type=\"submit\" value=\"".getMLText("delete")."\" /></form>";
|
||||
print "</span></td>";
|
||||
print "</tr>";
|
||||
}
|
||||
print "</tbody>\n</table>\n";
|
||||
}
|
||||
else printMLText("no_linked_files");
|
||||
|
||||
if (!$user->isGuest()){
|
||||
?>
|
||||
<br>
|
||||
<form action="../op/op.AddDocumentLink.php" name="form1">
|
||||
<input type="Hidden" name="documentid" value="<?php print $documentid;?>">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("add_document_link");?>:</td>
|
||||
<td><?php UI::printDocumentChooser("form1");?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($document->getAccessMode($user) >= M_READWRITE) {
|
||||
print "<tr><td>".getMLText("document_link_public")."</td>";
|
||||
print "<td><ul class=\"actions\">";
|
||||
print "<li><input type=\"Radio\" name=\"public\" value=\"true\" checked>" . getMLText("yes")."</li>";
|
||||
print "<li><input type=\"Radio\" name=\"public\" value=\"false\">" . getMLText("no")."</li>";
|
||||
print "</ul></td></tr>";
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2"><input type="Submit" value="<?php printMLText("update");?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
<?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");
|
||||
<?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.Language.php");
|
||||
include("../inc/inc.Language.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.Calendar.php");
|
||||
include("../inc/inc.Calendar.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
|
||||
if (!isset($_GET["id"])){
|
||||
|
@ -28,70 +28,16 @@ if (!isset($_GET["id"])){
|
|||
}
|
||||
|
||||
$event=getEvent(intval($_GET["id"]));
|
||||
|
||||
if (is_bool($event)&&!$event){
|
||||
UI::exitError(getMLText("event_details"),getMLText("error_occured"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("calendar"));
|
||||
UI::globalNavigation();
|
||||
UI::pageNavigation(getMLText("calendar"), "calendar");
|
||||
|
||||
UI::contentHeading(getMLText("event_details"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
$u=$dms->getUser($event["userID"]);
|
||||
|
||||
echo "<table>";
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td>".getMLText("name").": </td>";
|
||||
echo "<td>".htmlspecialchars($event["name"])."</td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td>".getMLText("comment").": </td>";
|
||||
echo "<td>".htmlspecialchars($event["comment"])."</td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td>".getMLText("from").": </td>";
|
||||
echo "<td>".getReadableDate($event["start"])."</td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td>".getMLText("to").": </td>";
|
||||
echo "<td>".getReadableDate($event["stop"])."</td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td>".getMLText("last_update").": </td>";
|
||||
echo "<td>".getLongReadableDate($event["date"])."</td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td>".getMLText("user").": </td>";
|
||||
echo "<td>".(is_object($u)?htmlspecialchars($u->getFullName()):getMLText("unknown_user"))."</td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "</table>";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
if (($user->getID()==$event["userID"])||($user->isAdmin())){
|
||||
|
||||
UI::contentHeading(getMLText("edit"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
print "<ul class=\"actions\">";
|
||||
print "<li><a href=\"../out/out.RemoveEvent.php?id=".$event["id"]."\">".getMLText("delete")."</a>";
|
||||
print "<li><a href=\"../out/out.EditEvent.php?id=".$event["id"]."\">".getMLText("edit")."</a>";
|
||||
print "</ul>";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'event'=>$event));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
@ -22,8 +22,16 @@ 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.Authentication.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
|
||||
/**
|
||||
* Include class to preview documents
|
||||
*/
|
||||
require_once("LetoDMS_Preview/Preview.php");
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
||||
|
||||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
$folderid = $settings->_rootFolderID;
|
||||
|
@ -41,123 +49,20 @@ $showtree=showtree();
|
|||
|
||||
if (isset($_GET["orderby"]) && strlen($_GET["orderby"])==1 ) {
|
||||
$orderby=$_GET["orderby"];
|
||||
}else $orderby="";
|
||||
|
||||
$folderPathHTML = getFolderPathHTML($folder);
|
||||
} else $orderby="";
|
||||
|
||||
if ($folder->getAccessMode($user) < M_READ) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
UI::htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
|
||||
if($view) {
|
||||
$view->setParam('folder', $folder);
|
||||
$view->setParam('orderby', $orderby);
|
||||
$view->setParam('enableFolderTree', $settings->_enableFolderTree);
|
||||
$view->setParam('showtree', showtree());
|
||||
$view->setParam('cachedir', $settings->_cacheDir);
|
||||
$view->show();
|
||||
exit;
|
||||
}
|
||||
|
||||
UI::globalNavigation($folder);
|
||||
UI::pageNavigation($folderPathHTML, "view_folder", $folder);
|
||||
|
||||
if ($settings->_enableFolderTree) UI::printTreeNavigation($folderid,$showtree);
|
||||
|
||||
UI::contentHeading(getMLText("folder_infos"));
|
||||
|
||||
$owner = $folder->getOwner();
|
||||
UI::contentContainerStart();
|
||||
print "<table>\n<tr>\n".
|
||||
"<td>".getMLText("owner").":</td>\n".
|
||||
"<td><a class=\"infos\" href=\"mailto:".htmlspecialchars($owner->getEmail())."\">".htmlspecialchars($owner->getFullName())."</a>".
|
||||
"</td>\n</tr>\n<tr>\n".
|
||||
"<td>".getMLText("comment").":</td>\n".
|
||||
"<td>".htmlspecialchars($folder->getComment())."</td>\n</tr>\n";
|
||||
$attributes = $folder->getAttributes();
|
||||
if($attributes) {
|
||||
foreach($attributes as $attribute) {
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||
<td><?php echo htmlspecialchars($attribute->getValue()); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
print "</table>\n";
|
||||
UI::contentContainerEnd();
|
||||
|
||||
UI::contentHeading(getMLText("folder_contents"));
|
||||
UI::contentContainerStart();
|
||||
|
||||
$subFolders = $folder->getSubFolders($orderby);
|
||||
$subFolders = LetoDMS_Core_DMS::filterAccess($subFolders, $user, M_READ);
|
||||
$documents = $folder->getDocuments($orderby);
|
||||
$documents = LetoDMS_Core_DMS::filterAccess($documents, $user, M_READ);
|
||||
|
||||
if ((count($subFolders) > 0)||(count($documents) > 0)){
|
||||
print "<table class=\"folderView\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th><a href=\"../out/out.ViewFolder.php?folderid=". $folderid .($orderby=="n"?"":"&orderby=n")."\">".getMLText("name")."</a></th>\n";
|
||||
print "<th>".getMLText("owner")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("version")."</th>\n";
|
||||
print "<th>".getMLText("comment")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
}
|
||||
else printMLText("empty_notify_list");
|
||||
|
||||
|
||||
foreach($subFolders as $subFolder) {
|
||||
|
||||
$owner = $subFolder->getOwner();
|
||||
$comment = $subFolder->getComment();
|
||||
if (strlen($comment) > 50) $comment = substr($comment, 0, 47) . "...";
|
||||
$subsub = $subFolder->getSubFolders();
|
||||
$subsub = LetoDMS_Core_DMS::filterAccess($subsub, $user, M_READ);
|
||||
$subdoc = $subFolder->getDocuments();
|
||||
$subdoc = LetoDMS_Core_DMS::filterAccess($subdoc, $user, M_READ);
|
||||
|
||||
print "<tr class=\"folder\">";
|
||||
// print "<td><img src=\"images/folder_closed.gif\" width=18 height=18 border=0></td>";
|
||||
print "<td><a href=\"out.ViewFolder.php?folderid=".$subFolder->getID()."&showtree=".$showtree."\"><img src=\"images/folder_closed.gif\" width=18 height=18 border=0></a></td>\n";
|
||||
print "<td><a href=\"out.ViewFolder.php?folderid=".$subFolder->getID()."&showtree=".$showtree."\">" . htmlspecialchars($subFolder->getName()) . "</a></td>\n";
|
||||
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
||||
print "<td colspan=\"1\"><small>".count($subsub)." ".getMLText("folders").", ".count($subdoc)." ".getMLText("documents")."</small></td>";
|
||||
print "<td></td>";
|
||||
print "<td>".htmlspecialchars($comment)."</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
foreach($documents as $document) {
|
||||
|
||||
$owner = $document->getOwner();
|
||||
$comment = $document->getComment();
|
||||
if (strlen($comment) > 50) $comment = substr($comment, 0, 47) . "...";
|
||||
$docID = $document->getID();
|
||||
if($latestContent = $document->getLatestContent()) {
|
||||
$version = $latestContent->getVersion();
|
||||
$status = $latestContent->getStatus();
|
||||
|
||||
print "<tr>";
|
||||
|
||||
if (file_exists($dms->contentDir . $latestContent->getPath()))
|
||||
print "<td><a href=\"../op/op.Download.php?documentid=".$docID."&version=".$version."\"><img class=\"mimeicon\" src=\"images/icons/".UI::getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\"></a></td>";
|
||||
else print "<td><img class=\"mimeicon\" src=\"images/icons/".UI::getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\"></td>";
|
||||
|
||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$docID."&showtree=".$showtree."\">" . htmlspecialchars($document->getName()) . "</a></td>\n";
|
||||
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
||||
print "<td>";
|
||||
if ( $document->isLocked() ) {
|
||||
print "<img src=\"".UI::getImgPath("lock.png")."\" title=\"". getMLText("locked_by").": ".htmlspecialchars($document->getLockingUser()->getFullName())."\"> ";
|
||||
}
|
||||
print getOverallStatusText($status["status"])."</td>";
|
||||
print "<td>".$version."</td>";
|
||||
print "<td>".htmlspecialchars($comment)."</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ((count($subFolders) > 0)||(count($documents) > 0)) echo "</tbody>\n</table>\n";
|
||||
|
||||
UI::contentContainerEnd();
|
||||
|
||||
if ($settings->_enableFolderTree) print "</td></tr></table>";
|
||||
|
||||
UI::htmlEndPage();
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user