Merge branch 'seeddms-5.0.x' into develop

This commit is contained in:
Uwe Steinmann 2016-02-08 13:24:40 +01:00
commit 2da2f0af9a
11 changed files with 372 additions and 286 deletions

View File

@ -1825,57 +1825,27 @@ class SeedDMS_Core_DMS {
/**
* Get all notifications for a group
*
* deprecated: User {@link SeedDMS_Core_Group::getNotifications()}
*
* @param object $group group for which notifications are to be retrieved
* @param integer $type type of item (T_DOCUMENT or T_FOLDER)
* @return array array of notifications
*/
function getNotificationsByGroup($group, $type=0) { /* {{{ */
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ".
"WHERE `tblNotify`.`groupID` = ". $group->getID();
if($type) {
$queryStr .= " AND `tblNotify`.`targetType` = ". (int) $type;
}
$resArr = $this->db->getResultArray($queryStr);
if (is_bool($resArr) && !$resArr)
return false;
$notifications = array();
foreach ($resArr as $row) {
$not = new SeedDMS_Core_Notification($row["target"], $row["targetType"], $row["userID"], $row["groupID"]);
$not->setDMS($this);
array_push($notifications, $cat);
}
return $notifications;
return $group->getNotifications($type);
} /* }}} */
/**
* Get all notifications for a user
*
* deprecated: User {@link SeedDMS_Core_User::getNotifications()}
*
* @param object $user user for which notifications are to be retrieved
* @param integer $type type of item (T_DOCUMENT or T_FOLDER)
* @return array array of notifications
*/
function getNotificationsByUser($user, $type=0) { /* {{{ */
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ".
"WHERE `tblNotify`.`userID` = ". $user->getID();
if($type) {
$queryStr .= " AND `tblNotify`.`targetType` = ". (int) $type;
}
$resArr = $this->db->getResultArray($queryStr);
if (is_bool($resArr) && !$resArr)
return false;
$notifications = array();
foreach ($resArr as $row) {
$not = new SeedDMS_Core_Notification($row["target"], $row["targetType"], $row["userID"], $row["groupID"]);
$not->setDMS($this);
array_push($notifications, $cat);
}
return $notifications;
return $user->getNotifications($type);
} /* }}} */
/**

View File

@ -469,5 +469,33 @@ class SeedDMS_Core_Group {
return $status;
} /* }}} */
/**
* Get all notifications of group
*
* @param integer $type type of item (T_DOCUMENT or T_FOLDER)
* @return array array of notifications
*/
function getNotificationsByGroup($type=0) { /* {{{ */
$db = $this->_dms->getDB();
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ".
"WHERE `tblNotify`.`groupID` = ". $this->_id;
if($type) {
$queryStr .= " AND `tblNotify`.`targetType` = ". (int) $type;
}
$resArr = $db->getResultArray($queryStr);
if (is_bool($resArr) && !$resArr)
return false;
$notifications = array();
foreach ($resArr as $row) {
$not = new SeedDMS_Core_Notification($row["target"], $row["targetType"], $row["userID"], $row["groupID"]);
$not->setDMS($this);
array_push($notifications, $not);
}
return $notifications;
} /* }}} */
}
?>

View File

@ -1712,5 +1712,33 @@ class SeedDMS_Core_User { /* {{{ */
return false;
} /* }}} */
/**
* Get all notifications of user
*
* @param integer $type type of item (T_DOCUMENT or T_FOLDER)
* @return array array of notifications
*/
function getNotifications($type=0) { /* {{{ */
$db = $this->_dms->getDB();
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ".
"WHERE `tblNotify`.`userID` = ". $this->_id;
if($type) {
$queryStr .= " AND `tblNotify`.`targetType` = ". (int) $type;
}
$resArr = $db->getResultArray($queryStr);
if (is_bool($resArr) && !$resArr)
return false;
$notifications = array();
foreach ($resArr as $row) {
$not = new SeedDMS_Core_Notification($row["target"], $row["targetType"], $row["userID"], $row["groupID"]);
$not->setDMS($this);
array_push($notifications, $not);
}
return $notifications;
} /* }}} */
} /* }}} */
?>

View File

@ -961,6 +961,10 @@ by a group or user right
<notes>
- make sure boolean attribute is saved as 0/1
- add SeedDMS_Core_User::[g|s]etMandatoryWorkflows()
- add SeedDMS_Core_User::getNotifications()
- add SeedDMS_Core_Group::getNotifications()
- SeedDMS_Core_DMS::getNotificationsByGroup() and
SeedDMS_Core_DMS::getNotificationsByUser() are deprecated
</notes>
</release>
</changelog>

View File

@ -1,23 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<site>
<!-- siteName: Name of site used in the page titles. Default: SeedDMS
<!--
- siteName: Name of site used in the page titles. Default: SeedDMS
- footNote: Message to display at the bottom of every page
- printDisclaimer: if true the disclaimer message the lang.inc files will be print on the bottom of the page
- language: default language (name of a subfolder in folder "languages")
- theme: default style (name of a subfolder in folder "styles")
- previewWidthList: Preview image width in folder list
- previewWidthDetail: Preview image width in document view
-->
<display
siteName = "SeedDMS"
footNote = "SeedDMS free document management system - www.seeddms.org"
printDisclaimer="true"
printDisclaimer = "true"
language = "en_GB"
theme = "bootstrap"
>
</display>
<!-- strictFormCheck: Strict form checking. If set to true, then all fields in the form will be checked for a value. If set to false, then (most) comments and keyword fields become optional. Comments are always required when submitting a review or overriding document status.
previewWidthList = "40"
previewWidthDetail = "100"
/>
<!--
- strictFormCheck: Strict form checking. If set to true, then all fields in the form will be checked for a value. If set to false, then (most) comments and keyword fields become optional. Comments are always required when submitting a review or overriding document status.
- viewOnlineFileTypes: files with one of the following endings can be viewed online (USE ONLY LOWER CASE CHARACTERS)
- enableConverting: enable/disable converting of files
- enableConverting: enable/disable converting of files XXX
- enableEmail: enable/disable automatic email notification
- enableUsersView: enable/disable group and user view for all users
- enableFullSearch: false to don't use fulltext search
@ -26,15 +31,21 @@
- enableFolderTree: false to don't show the folder tree
- expandFolderTree: 0 to start with tree hidden
- 1 to start with tree shown and first level expanded
- 2 to start with tree shown fully expanded
- 2 to start with tree shown fully expanded
- stopWordsFile: path to stop word file for indexer
- sortUsersInList: how to sort users in lists ('fullname' or '' (default))
-->
- enableDropUpload: XXX
- enableRecursiveCount: XXX
- maxRecursiveCount: XXX
- enableThemeSelector: XXX
- fullSearchEngine: Either "lucene" or "sqlitefts"
- sortFoldersDefault: XXX
-->
<edition
strictFormCheck = "false"
viewOnlineFileTypes = ".txt;.text;.html;.htm;.xml;.pdf;.gif;.png;.jpg;.jpeg;.mp4"
enableConverting = "true"
enableEmail = "true"
enableEmail = "true"
enableUsersView = "true"
enableFullSearch = "false"
enableClipboard = "false"
@ -43,26 +54,31 @@
enableLanguageSelector = "true"
stopWordsFile = ""
sortUsersInList = ""
>
</edition>
<!-- enableCalendar: enable/disable calendar
enableDropUpload = "false"
enableRecursiveCount = "false"
maxRecursiveCount = "0"
enableThemeSelector = "false"
fullSearchEngine = "lucene"
sortFoldersDefault = "u"
/>
<!--
- enableCalendar: enable/disable calendar
- calendarDefaultView: calendar default view ("w" for week,"m" for month,"y" for year)
- firstDayOfWeek: first day of the week (0=sunday, 6=saturday)
-->
-->
<calendar
enableCalendar = "true"
calendarDefaultView = "y"
firstDayOfWeek = "0"
>
</calendar>
/>
</site>
<system>
<!-- rootDir: Path to where SeedDMS is located
<!--
- rootDir: Path to where SeedDMS is located
- httpRoot: The relative path in the URL, after the domain part. Do not include the
- http:// prefix or the web host name. e.g. If the full URL is
- http://www.example.com/seeddms/, set $_httpRoot = "/seeddms/".
- If the URL is http://www.example.com/, set $_httpRoot = "/".
- http://www.example.com/seeddms/, set $_httpRoot = "/seeddms/".
- If the URL is http://www.example.com/, set $_httpRoot = "/".
- contentDir: Where the uploaded files are stored (best to choose a directory that
- is not accessible through your web-server)
- stagingDir: Where partial file uploads are saved
@ -70,7 +86,7 @@
- logFileEnable: set false to disable log system
- logFileRotation: the log file rotation (h=hourly, d=daily, m=monthly)
- enableLargeFileUpload: support for jumploader
- partitionsize: size of chunk uploaded by jumploader
- partitionSize: size of chunk uploaded by jumploader
- dropFolderDir: where files for document upload are located
- cacheDir: where the preview images are saved
-->
@ -86,23 +102,41 @@
partitionSize = "2000000"
dropFolderDir = ""
cacheDir = ""
>
</server>
<!-- enableGuestLogin: If you want anybody to login as guest, set the following line to true
/>
<!--
- enableGuestLogin: If you want anybody to login as guest, set the following line to true
- note: guest login should be used only in a trusted environment
- enablePasswordForgotten: Allow users to reset their password
- enablePasswordForgotten: Allow users to reset their password
- restricted: Restricted access: only allow users to log in if they have an entry in the local database (irrespective of successful authentication with LDAP).
- enableUserImage: enable users images
- disableSelfEdit: if true user cannot edit his own profile
-->
- passwordStrength: XXX
- passwordStrengthAlgorithm: XXX
- passwordExpiration: XXX
- passwordHistory: XXX
- loginFailure: XXX
- autoLoginUser: XXX
- quota: XXX
- undelUserIds: XXX
- encryptionKey: XXX
- cookieLifetime: XXX
-->
<authentication
enableGuestLogin = "false"
enablePasswordForgotten = "false"
restricted = "true"
enableUserImage = "false"
disableSelfEdit = "false"
>
passwordStrength = "0"
passwordStrengthAlgorithm = "simple"
passwordExpiration = "0"
passwordHistory = "0"
loginFailure = "0"
autoLoginUser = "0"
quota = "0"
undelUserIds = ""
encryptionKey = "b8c75fa53c0c7a18a84adb6ca815bd94"
cookieLifetime = "0">
<connectors>
<!-- ***** CONNECTOR LDAP *****
- enable: enable/disable connector
@ -111,19 +145,20 @@
- URIs are supported, e.g.: ldaps://ldap.host.com
- port: port of the authentification server
- baseDN: top level of the LDAP directory tree
- bindDN: XXX
- bindPw: XXX
- filter: Additional filters which are to be checked
-->
-->
<connector
enable = "false"
type = "ldap"
host = "ldaps://ldap.host.com"
port = "389"
baseDN = ""
bindDN=""
bindPw=""
filter=""
>
</connector>
bindDN = ""
bindPw = ""
filter = ""
/>
<!-- ***** CONNECTOR Microsoft Active Directory *****
- enable: enable/disable connector
- type: type of connector ldap / AD
@ -131,7 +166,9 @@
- port: port of the authentification server
- baseDN: top level of the LDAP directory tree
- accountDomainName: sample: example.com
-->
- bindDN: XXX
- bindPw: XXX
-->
<connector
enable = "false"
type = "AD"
@ -139,19 +176,20 @@
port = "389"
baseDN = ""
accountDomainName = "example.com"
bindDN=""
bindPw=""
>
</connector>
bindDN = ""
bindPw = ""
/>
</connectors>
</authentication>
<!-- ADOdbPath: Path to adodb. This is the directory containing the adodb directory
<!--
- ADOdbPath: Path to adodb. This is the directory containing the adodb directory
- dbDriver: DB-Driver used by adodb (see adodb-readme)
- dbHostname: DB-Server
- dbDatabase: database where the tables for seeddms are stored (optional - see adodb-readme)
- dbUser: username for database-access
- dbPass: password for database-access
-->
- doNotCheckVersion: Whether or not to check the database schema for its correct version.
-->
<database
ADOdbPath = ""
dbDriver = "_DBC_DBTYPE_"
@ -159,48 +197,56 @@
dbDatabase = "_DBC_DBNAME_"
dbUser = "_DBC_DBUSER_"
dbPass = "_DBC_DBPASS_"
>
</database>
<!-- smtpServer: SMTP Server hostname
doNotCheckVersion = "false"
/>
<!--
- smtpServer: SMTP Server hostname
- smtpPort: SMTP Server port
- smtpSendFrom: Send from
-->
<smtp
smtpServer = "localhost"
smtpPort = "25"
- smtpUser: XXX
- smtpPassword: XXX
-->
<smtp
smtpServer = "localhost"
smtpPort = "25"
smtpSendFrom = "seeddms@localhost"
/>
smtpUser = ""
smtpPassword = ""
/>
</system>
<advanced>
<!-- siteDefaultPage: Default page on login. Defaults to out/out.ViewFolder.php
<!--
-siteDefaultPage: Default page on login. Defaults to out/out.ViewFolder.php
- rootFolderID: ID of root-folder (mostly no need to change)
- titleDisplayHack: Workaround for page titles that go over more than 2 lines.
-->
- showMissingTranslations: XXX
-->
<display
siteDefaultPage =""
siteDefaultPage = ""
rootFolderID = "1"
titleDisplayHack = "true"
>
</display>
<!-- guestID: ID of guest-user used when logged in as guest (mostly no need to change)
showMissingTranslations = "false"
/>
<!--
- guestID: ID of guest-user used when logged in as guest (mostly no need to change)
- adminIP: if enabled admin can login only by specified IP addres, leave empty to avoid the control
- NOTE: works only with local autentication (no LDAP)
-->
-->
<authentication
guestID = "2"
adminIP = ""
>
</authentication>
adminIP = ""
/>
<!-- enableAdminRevApp: false to don't list administrator as reviewer/approver
- versioningFileName: the name of the versioning info file created by the backup tool
- workflowMode: 'traditional' or 'advanced'
- enableVersionDeletion: allow to delete versions after approval
- enableVersionModification: allow to modify versions after approval
- enableDuplicateDocNames: allow duplicate names in a folder
-->
- enableOwnerRevApp: XXX
- enableSelfRevApp: XXX
- presetExpirationDate: XXX
- overrideMimeType: XXX
-->
<edition
enableAdminRevApp = "false"
versioningFileName = "versioning_info.txt"
@ -208,17 +254,24 @@
enableVersionDeletion = "true"
enableVersionModification = "true"
enableDuplicateDocNames = "true"
>
</edition>
<!-- coreDir: Path to SeedDMS_Core (optional)
enableOwnerRevApp = "false"
enableSelfRevApp = "false"
presetExpirationDate = ""
overrideMimeType = "false"
/>
<!--
- coreDir: Path to SeedDMS_Core (optional)
- luceneClassDir: Path to SeedDMS_Lucene (optional)
- contentOffsetDir: To work around limitations in the underlying file system, a new
- directory structure has been devised that exists within the content
- directory ($_contentDir). This requires a base directory from which
- to begin. Usually leave this to the default setting, 1048576, but can
- be any number or string that does not already exist within $_contentDir.
- contentOffsetDir: To work around limitations in the underlying file system, a new
- directory structure has been devised that exists within the content
- directory ($_contentDir). This requires a base directory from which
- to begin. Usually leave this to the default setting, 1048576, but can
- be any number or string that does not already exist within $_contentDir.
- maxDirID: Maximum number of sub-directories per parent directory. Default: 32700.
- updateNotifyTime: users are notified about document-changes that took place within the last "updateNotifyTime" seconds
- extraPath: XXX
- maxExecutionTime: XXX
- cmdTimeout: XXX
-->
<server
coreDir = ""
@ -226,9 +279,20 @@
contentOffsetDir = "1048576"
maxDirID = "0"
updateNotifyTime = "86400"
>
</server>
extraPath = ""
maxExecutionTime = "30"
cmdTimeout = "1"
/>
<!--
- enableNotificationAppRev: XXX
- enableOwnerNotification: XXX
- enableNotificationWorkflow: XXX
-->
<notification
enableNotificationAppRev = "true"
enableOwnerNotification = "false"
enableNotificationWorkflow = "false"
/>
</advanced>
<extensions/>
</configuration>

View File

@ -171,7 +171,7 @@ $human_readable = (isset($_GET["human_readable"]) && $_GET["human_readable"]==1
if($settings->_backupDir && file_exists($settings->_backupDir))
$basedir = $settings->_backupDir;
else
$basedir = $setting->_contentDir;
$basedir = $settings->_contentDir;
if ($human_readable)$ark_name = $basedir.time()."_".$folderid."_HR.tar";
else $ark_name = $basedir.time()."_".$folderid.".tar";

View File

@ -32,11 +32,16 @@ if (!$user->isAdmin()) {
$categories = $dms->getDocumentCategories();
if(isset($_GET['categoryid']) && $_GET['categoryid']) {
$selcat = $dms->getDocumentCategory($_GET['categoryid']);
} else {
$selcat = null;
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'categories'=>$categories));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'categories'=>$categories, 'selcategory'=>$selcat));
if($view) {
$view->show();
exit;
$view($_GET);
}
?>

View File

@ -80,9 +80,6 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
print "</form>\n";
// list backup files
$this->contentSubHeading(getMLText("backup_list"));
$print_header=true;
$handle = opendir($backupdir);
$entries = array();
@ -96,38 +93,36 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
sort($entries);
$entries = array_reverse($entries);
foreach ($entries as $entry){
if($entries) {
$this->contentSubHeading(getMLText("backup_list"));
print "<table class=\"table-condensed\">\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";
if ($print_header){
print "<table class=\"table-condensed\">\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;
foreach ($entries as $entry){
$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($backupdir.$entry))."</td>\n";
print "<td>".SeedDMS_Core_File::format_filesize(filesize($backupdir.$entry))."</td>\n";
print "<td>";
print "<a href=\"out.RemoveArchive.php?arkname=".$entry."\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("backup_remove")."</a>";
print "</td>\n";
print "</tr>\n";
}
$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($backupdir.$entry))."</td>\n";
print "<td>".SeedDMS_Core_File::format_filesize(filesize($backupdir.$entry))."</td>\n";
print "<td>";
print "<a href=\"out.RemoveArchive.php?arkname=".$entry."\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("backup_remove")."</a>";
print "</td>\n";
print "</tr>\n";
print "</table>\n";
}
if ($print_header) printMLText("empty_notify_list");
else print "</table>\n";
$this->contentContainerEnd();
// dump creation ///////////////////////////////////////////////////////////////
@ -141,10 +136,6 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
print "</form>\n";
// list backup files
$this->contentSubHeading(getMLText("dump_list"));
$print_header=true;
$handle = opendir($backupdir);
$entries = array();
while ($e = readdir($handle)){
@ -157,32 +148,29 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
sort($entries);
$entries = array_reverse($entries);
foreach ($entries as $entry){
if($entries) {
$this->contentSubHeading(getMLText("dump_list"));
print "<table class=\"table-condensed\">\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";
if ($print_header){
print "<table class=\"table-condensed\">\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;
foreach ($entries as $entry){
print "<tr>\n";
print "<td><a href=\"../op/op.Download.php?dumpname=".$entry."\">".$entry."</a></td>\n";
print "<td>".getLongReadableDate(filectime($backupdir.$entry))."</td>\n";
print "<td>".SeedDMS_Core_File::format_filesize(filesize($backupdir.$entry))."</td>\n";
print "<td>";
print "<a href=\"out.RemoveDump.php?dumpname=".$entry."\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("dump_remove")."</a>";
print "</td>\n";
print "</tr>\n";
}
print "<tr>\n";
print "<td><a href=\"../op/op.Download.php?dumpname=".$entry."\">".$entry."</a></td>\n";
print "<td>".getLongReadableDate(filectime($backupdir.$entry))."</td>\n";
print "<td>".SeedDMS_Core_File::format_filesize(filesize($backupdir.$entry))."</td>\n";
print "<td>";
print "<a href=\"out.RemoveDump.php?dumpname=".$entry."\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("dump_remove")."</a>";
print "</td>\n";
print "</tr>\n";
print "</table>\n";
}
if ($print_header) printMLText("empty_notify_list");
else print "</table>\n";
$this->contentContainerEnd();
// files deletion //////////////////////////////////////////////////////////////

View File

@ -31,80 +31,37 @@ require_once("class.Bootstrap.php");
*/
class SeedDMS_View_Categories extends SeedDMS_Bootstrap_Style {
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$categories = $this->params['categories'];
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
$this->contentStart();
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
function js() { /* {{{ */
$selcat = $this->params['selcategory'];
?>
<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 = "";
}
</script>
$(document).ready( function() {
$( "#selector" ).change(function() {
$('div.ajax').trigger('update', {categoryid: $(this).val()});
});
});
<?php
$this->contentHeading(getMLText("global_document_categories"));
?>
<div class="row-fluid">
<div class="span4">
<div class="well">
<?php echo getMLText("selection")?>:
<select onchange="showCategories(this)" id="selector" class="span9">
<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>
function info() { /* {{{ */
$dms = $this->params['dms'];
$selcat = $this->params['selcategory'];
</div>
</div>
if($selcat) {
$this->contentHeading(getMLText("category_info"));
$documents = $selcat->getDocumentsByCategory();
echo "<table class=\"table table-condensed\">\n";
echo "<tr><td>".getMLText('document_count')."</td><td>".(count($documents))."</td></tr>\n";
echo "</table>";
}
} /* }}} */
<div class="span8">
<div class="well">
<table class="table-condensed"><tr>
<td id="categories0" style="display : none;">
<form class="form-inline" action="../op/op.Categories.php" method="post">
<?php echo createHiddenFieldWithKey('addcategory'); ?>
<input type="Hidden" name="action" value="addcategory">
<?php printMLText("name");?> : <input type="text" name="name">
<input type="submit" class="btn" value="<?php printMLText("new_document_category"); ?>">
</form>
</td>
<?php
foreach ($categories as $category) {
print "<td id=\"categories".$category->getID()."\" style=\"display : none;\">";
function showCategoryForm($category) { /* {{{ */
?>
<table class="table-condensed">
<tr>
<td></td><td>
<?php
if(!$category->isUsed()) {
if($category && !$category->isUsed()) {
?>
<form style="display: inline-block;" method="post" action="../op/op.Categories.php" >
<?php echo createHiddenFieldWithKey('removecategory'); ?>
@ -125,28 +82,68 @@ function showCategories(selectObj) {
<td><?php echo getMLText("name")?>:</td>
<td>
<form class="form-inline" style="margin-bottom: 0px;" action="../op/op.Categories.php" method="post">
<?php if(!$category) { ?>
<?php echo createHiddenFieldWithKey('addcategory'); ?>
<input type="Hidden" name="action" value="addcategory">
<?php } else { ?>
<?php echo createHiddenFieldWithKey('editcategory'); ?>
<input type="Hidden" name="action" value="editcategory">
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
<input name="name" type="text" value="<?php echo htmlspecialchars($category->getName()) ?>">&nbsp;
<?php } ?>
<input name="name" type="text" value="<?php echo $category ? htmlspecialchars($category->getName()) : '' ?>">&nbsp;
<button type="submit" class="btn"><i class="icon-save"></i> <?php printMLText("save");?></button>
</form>
</td>
</tr>
</table>
</td>
<?php } ?>
</tr></table>
</div>
</div>
<?php
} /* }}} */
function form() { /* {{{ */
$selcat = $this->params['selcategory'];
$this->showCategoryForm($selcat);
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$categories = $this->params['categories'];
$selcat = $this->params['selcategory'];
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
$this->contentStart();
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
$this->contentHeading(getMLText("global_document_categories"));
?>
<div class="row-fluid">
<div class="span4">
<div class="well">
<?php echo getMLText("selection")?>:
<select id="selector" class="span9">
<option value="-1"><?php echo getMLText("choose_category")?>
<option value="0"><?php echo getMLText("new_document_category")?>
<?php
foreach ($categories as $category) {
print "<option value=\"".$category->getID()."\" ".($selcat && $category->getID()==$selcat->getID() ? 'selected' : '').">" . htmlspecialchars($category->getName());
}
?>
</select>
</div>
<div class="ajax" data-view="Categories" data-action="info" <?php echo ($selcat ? "data-query=\"categoryid=".$selcat->getID()."\"" : "") ?>></div>
</div>
<div class="span8">
<div class="well">
<div class="ajax" data-view="Categories" data-action="form" <?php echo ($selcat ? "data-query=\"categoryid=".$selcat->getID()."\"" : "") ?>></div>
</div>
</div>
</div>
<script language="JavaScript">
sel = document.getElementById("selector");
sel.selectedIndex=<?php print $selected ?>;
showCategories(sel);
</script>
<?php
$this->htmlEndPage();
} /* }}} */

View File

@ -35,40 +35,26 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
function getNotificationList($as_group, $folders) { /* {{{ */
// First, get the list of groups of which the user is a member.
$notifications = array();
if ($as_group){
$groups = $this->user->getGroups();
if (count($groups)==0) return NULL;
$grpList = "";
if(!($groups = $this->user->getGroups()))
return NULL;
foreach ($groups as $group) {
$grpList .= (strlen($grpList)==0 ? "" : ", ") . $group->getID();
$tmp = $group->getNotifications($folders ? T_FOLDER : T_DOCUMENT);
if($tmp) {
$notifications = array_merge($notifications, $tmp);
}
}
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ".
"WHERE `tblNotify`.`groupID` IN (". $grpList .")";
} else {
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ".
"WHERE `tblNotify`.`userID` = '". $this->user->getID()."'" ;
$notifications = $this->user->getNotifications($folders ? T_FOLDER : T_DOCUMENT);
}
$resArr = $this->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;
return $notifications;
} /* }}} */
function printFolderNotificationList($ret,$deleteaction=true) { /* {{{ */
if (count($ret)==0) {
function printFolderNotificationList($notifications, $deleteaction=true) { /* {{{ */
if (count($notifications)==0) {
printMLText("empty_notify_list");
}
else {
@ -80,17 +66,17 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
print "<th>".getMLText("owner")."</th>\n";
print "<th>".getMLText("actions")."</th>\n";
print "</tr></thead>\n<tbody>\n";
foreach($ret as $ID) {
$fld = $this->dms->getFolder($ID);
foreach($notifications as $notification) {
$fld = $this->dms->getFolder($notification->getTarget());
if (is_object($fld)) {
$owner = $fld->getOwner();
print "<tr class=\"folder\">";
print "<td><i class=\"icon-folder-close-alt\"></i></td>";
print "<td><a href=\"../out/out.ViewFolder.php?folderid=".$ID."\">" . htmlspecialchars($fld->getName()) . "</a></td>\n";
print "<td><a href=\"../out/out.ViewFolder.php?folderid=".$fld->getID()."\">" . htmlspecialchars($fld->getName()) . "</a></td>\n";
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
print "<td>";
if ($deleteaction) print "<a href='../op/op.ManageNotify.php?id=".$ID."&type=folder&action=del' class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</a>";
else print "<a href='../out/out.FolderNotify.php?folderid=".$ID."' class=\"btn btn-mini\">".getMLText("edit")."</a>";
if ($deleteaction) print "<a href='../op/op.ManageNotify.php?id=".$fld->getID()."&type=folder&action=del' class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</a>";
else print "<a href='../out/out.FolderNotify.php?folderid=".$fld->getID()."' class=\"btn btn-mini\">".getMLText("edit")."</a>";
print "</td></tr>";
}
}
@ -98,9 +84,9 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
}
} /* }}} */
function printDocumentNotificationList($ret,$deleteaction=true) { /* {{{ */
function printDocumentNotificationList($notifications,$deleteaction=true) { /* {{{ */
if (count($ret)==0) {
if (count($notifications)==0) {
printMLText("empty_notify_list");
}
else {
@ -114,8 +100,8 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("action")."</th>\n";
print "</tr></thead>\n<tbody>\n";
foreach ($ret as $ID) {
$doc = $this->dms->getDocument($ID);
foreach ($notifications as $notification) {
$doc = $this->dms->getDocument($notification->getTarget());
if (is_object($doc)) {
$owner = $doc->getOwner();
$latest = $doc->getLatestContent();
@ -130,7 +116,7 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
}
print "</td>";
print "<td><a href=\"out.ViewDocument.php?documentid=".$ID."\">" . htmlspecialchars($doc->getName()) . "</a>";
print "<td><a href=\"out.ViewDocument.php?documentid=".$doc->getID()."\">" . htmlspecialchars($doc->getName()) . "</a>";
print "<br /><span style=\"font-size: 85%; font-style: italic; color: #666; \">".getMLText('owner').": <b>".htmlspecialchars($owner->getFullName())."</b>, ".getMLText('creation_date').": <b>".date('Y-m-d', $doc->getDate())."</b>, ".getMLText('version')." <b>".$latest->getVersion()."</b> - <b>".date('Y-m-d', $latest->getDate())."</b></span>";
$comment = $latest->getComment();
if($comment) {
@ -140,8 +126,8 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
print "<td>".getOverallStatusText($status["status"])."</td>";
print "<td>";
if ($deleteaction) print "<a href='../op/op.ManageNotify.php?id=".$ID."&type=document&action=del' class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</a>";
else print "<a href='../out/out.DocumentNotify.php?documentid=".$ID."' class=\"btn btn-mini\">".getMLText("edit")."</a>";
if ($deleteaction) print "<a href='../op/op.ManageNotify.php?id=".$doc->getID()."&type=document&action=del' class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</a>";
else print "<a href='../out/out.DocumentNotify.php?documentid=".$doc->getID()."' class=\"btn btn-mini\">".getMLText("edit")."</a>";
print "</td></tr>\n";
}
}

View File

@ -121,11 +121,27 @@ class SeedDMS_View_Timeline extends SeedDMS_Bootstrap_Style {
);
}
}
header('Content-Type: application/json'),
header('Content-Type: application/json');
echo json_encode($jsondata);
} /* }}} */
function js() { /* {{{ */
$fromdate = $this->params['fromdate'];
$todate = $this->params['todate'];
$skip = $this->params['skip'];
if($fromdate) {
$from = makeTsFromLongDate($fromdate.' 00:00:00');
} else {
$from = time()-7*86400;
}
if($todate) {
$to = makeTsFromLongDate($todate.' 23:59:59');
} else {
$to = time();
}
header('Content-Type: application/javascript');
?>
$(document).ready(function () {