diff --git a/SeedDMS_Core/Core/inc.ClassDMS.php b/SeedDMS_Core/Core/inc.ClassDMS.php
index 0f497d1b4..bd4ae8426 100644
--- a/SeedDMS_Core/Core/inc.ClassDMS.php
+++ b/SeedDMS_Core/Core/inc.ClassDMS.php
@@ -1483,57 +1483,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);
} /* }}} */
/**
diff --git a/SeedDMS_Core/Core/inc.ClassGroup.php b/SeedDMS_Core/Core/inc.ClassGroup.php
index ea2ba666f..be5bdd9de 100644
--- a/SeedDMS_Core/Core/inc.ClassGroup.php
+++ b/SeedDMS_Core/Core/inc.ClassGroup.php
@@ -379,5 +379,34 @@ 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;
+ } /* }}} */
+
}
?>
diff --git a/SeedDMS_Core/Core/inc.ClassUser.php b/SeedDMS_Core/Core/inc.ClassUser.php
index 3ff162b61..d32e6a250 100644
--- a/SeedDMS_Core/Core/inc.ClassUser.php
+++ b/SeedDMS_Core/Core/inc.ClassUser.php
@@ -1330,5 +1330,33 @@ class SeedDMS_Core_User { /* {{{ */
return true;
} /* }}} */
+ /**
+ * 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;
+ } /* }}} */
+
} /* }}} */
?>
diff --git a/SeedDMS_Core/package.xml b/SeedDMS_Core/package.xml
index c92752509..8ffac91f4 100644
--- a/SeedDMS_Core/package.xml
+++ b/SeedDMS_Core/package.xml
@@ -958,6 +958,10 @@ by a group or user right
- 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
diff --git a/conf/settings.xml.template b/conf/settings.xml.template
index fb40821a0..32afc7468 100644
--- a/conf/settings.xml.template
+++ b/conf/settings.xml.template
@@ -1,23 +1,28 @@
-
-
-
+ - enableDropUpload: XXX
+ - enableRecursiveCount: XXX
+ - maxRecursiveCount: XXX
+ - enableThemeSelector: XXX
+ - fullSearchEngine: Either "lucene" or "sqlitefts"
+ - sortFoldersDefault: XXX
+ -->
-
-
+ -->
-
+ />
-
-
@@ -86,23 +102,41 @@
partitionSize = "2000000"
dropFolderDir = ""
cacheDir = ""
- >
-
-
-
+ - passwordStrength: XXX
+ - passwordStrengthAlgorithm: XXX
+ - passwordExpiration: XXX
+ - passwordHistory: XXX
+ - loginFailure: XXX
+ - autoLoginUser: XXX
+ - quota: XXX
+ - undelUserIds: XXX
+ - encryptionKey: XXX
+ - cookieLifetime: XXX
+ -->
+ passwordStrength = "0"
+ passwordStrengthAlgorithm = "simple"
+ passwordExpiration = "0"
+ passwordHistory = "0"
+ loginFailure = "0"
+ autoLoginUser = "0"
+ quota = "0"
+ undelUserIds = ""
+ encryptionKey = "b8c75fa53c0c7a18a84adb6ca815bd94"
+ cookieLifetime = "0">
+ -->
-
+ bindDN = ""
+ bindPw = ""
+ filter = ""
+ />
+ - bindDN: XXX
+ - bindPw: XXX
+ -->
-
+ bindDN = ""
+ bindPw = ""
+ />
-
+ - doNotCheckVersion: Whether or not to check the database schema for its correct version.
+ -->
-
-
-
+
+ smtpUser = ""
+ smtpPassword = ""
+ />
-
-
-
+ - showMissingTranslations: XXX
+ -->
-
-
+ -->
-
+ adminIP = ""
+ />
+ - enableOwnerRevApp: XXX
+ - enableSelfRevApp: XXX
+ - presetExpirationDate: XXX
+ - overrideMimeType: XXX
+ -->
-
-
-
-
+ extraPath = ""
+ maxExecutionTime = "30"
+ cmdTimeout = "1"
+ />
+
+
-
+
diff --git a/out/out.Categories.php b/out/out.Categories.php
index d912f67b4..f913b0f3c 100644
--- a/out/out.Categories.php
+++ b/out/out.Categories.php
@@ -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);
}
?>
diff --git a/views/bootstrap/class.BackupTools.php b/views/bootstrap/class.BackupTools.php
index 32898a772..a65f6bdf4 100644
--- a/views/bootstrap/class.BackupTools.php
+++ b/views/bootstrap/class.BackupTools.php
@@ -80,9 +80,6 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
print "\n";
// list backup files
- $this->contentSubHeading(getMLText("backup_list"));
-
- $print_header=true;
$handle = opendir($contentdir);
$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 "
\n";
+ print "\n\n";
+ print " | \n";
+ print "".getMLText("folder")." | \n";
+ print "".getMLText("creation_date")." | \n";
+ print "".getMLText("file_size")." | \n";
+ print " | \n";
+ print "
\n\n\n";
- if ($print_header){
- print "\n";
- print "\n\n";
- print " | \n";
- print "".getMLText("folder")." | \n";
- print "".getMLText("creation_date")." | \n";
- print "".getMLText("file_size")." | \n";
- print " | \n";
- print "
\n\n\n";
- $print_header=false;
+ foreach ($entries as $entry){
+
+ $folderid=substr($entry,strpos($entry,"_")+1);
+ $folder=$dms->getFolder((int)$folderid);
+
+ print "\n";
+ print "".$entry." | \n";
+ if (is_object($folder)) print "".htmlspecialchars($folder->getName())." | \n";
+ else print "".getMLText("unknown_id")." | \n";
+ print "".getLongReadableDate(filectime($contentdir.$entry))." | \n";
+ print "".SeedDMS_Core_File::format_filesize(filesize($contentdir.$entry))." | \n";
+ print "";
+ print " ".getMLText("backup_remove")."";
+ print " | \n";
+ print "
\n";
}
-
- $folderid=substr($entry,strpos($entry,"_")+1);
- $folder=$dms->getFolder((int)$folderid);
-
- print "\n";
- print "".$entry." | \n";
- if (is_object($folder)) print "".htmlspecialchars($folder->getName())." | \n";
- else print "".getMLText("unknown_id")." | \n";
- print "".getLongReadableDate(filectime($contentdir.$entry))." | \n";
- print "".SeedDMS_Core_File::format_filesize(filesize($contentdir.$entry))." | \n";
- print "";
- print " ".getMLText("backup_remove")."";
- print " | \n";
- print "
\n";
+ print "
\n";
}
- if ($print_header) printMLText("empty_notify_list");
- else print "
\n";
-
$this->contentContainerEnd();
// dump creation ///////////////////////////////////////////////////////////////
@@ -141,10 +136,6 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
print "\n";
// list backup files
- $this->contentSubHeading(getMLText("dump_list"));
-
- $print_header=true;
-
$handle = opendir($contentdir);
$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 "\n";
+ print "\n\n";
+ print " | \n";
+ print "".getMLText("creation_date")." | \n";
+ print "".getMLText("file_size")." | \n";
+ print " | \n";
+ print "
\n\n\n";
- if ($print_header){
- print "\n";
- print "\n\n";
- print " | \n";
- print "".getMLText("creation_date")." | \n";
- print "".getMLText("file_size")." | \n";
- print " | \n";
- print "
\n\n\n";
- $print_header=false;
+ foreach ($entries as $entry){
+ print "\n";
+ print "".$entry." | \n";
+ print "".getLongReadableDate(filectime($contentdir.$entry))." | \n";
+ print "".SeedDMS_Core_File::format_filesize(filesize($contentdir.$entry))." | \n";
+ print "";
+ print " ".getMLText("dump_remove")."";
+ print " | \n";
+ print "
\n";
}
-
- print "\n";
- print "".$entry." | \n";
- print "".getLongReadableDate(filectime($contentdir.$entry))." | \n";
- print "".SeedDMS_Core_File::format_filesize(filesize($contentdir.$entry))." | \n";
- print "";
- print " ".getMLText("dump_remove")."";
- print " | \n";
- print "
\n";
+ print "
\n";
}
- if ($print_header) printMLText("empty_notify_list");
- else print "
\n";
-
$this->contentContainerEnd();
// files deletion //////////////////////////////////////////////////////////////
diff --git a/views/bootstrap/class.Categories.php b/views/bootstrap/class.Categories.php
index e373c27a9..fbc3513f9 100644
--- a/views/bootstrap/class.Categories.php
+++ b/views/bootstrap/class.Categories.php
@@ -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'];
?>
-
-
+$(document).ready( function() {
+ $( "#selector" ).change(function() {
+ $('div.ajax').trigger('update', {categoryid: $(this).val()});
+ });
+});
contentHeading(getMLText("global_document_categories"));
-?>
-
-
-
-:
-
+ function info() { /* {{{ */
+ $dms = $this->params['dms'];
+ $selcat = $this->params['selcategory'];
-
-
+ if($selcat) {
+ $this->contentHeading(getMLText("category_info"));
+ $documents = $selcat->getDocumentsByCategory();
+ echo "
\n";
+ echo "".getMLText('document_count')." | ".(count($documents))." |
\n";
+ echo "
";
+ }
+ } /* }}} */
-
-
-
-
-
-
- |
-
-getID()."\" style=\"display : none;\">";
+ function showCategoryForm($category) { /* {{{ */
?>
|
isUsed()) {
+ if($category && !$category->isUsed()) {
?>
|
-
-
-
-
-
+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"));
+?>
+
+
+
+:
+
+
+
getID()."\"" : "") ?>>
+
+
+
+
+
getID()."\"" : "") ?>>
+
+
+
-
htmlEndPage();
} /* }}} */
diff --git a/views/bootstrap/class.ManageNotify.php b/views/bootstrap/class.ManageNotify.php
index f95b1be69..add47d6b2 100644
--- a/views/bootstrap/class.ManageNotify.php
+++ b/views/bootstrap/class.ManageNotify.php
@@ -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 "
".getMLText("owner")." | \n";
print "
".getMLText("actions")." | \n";
print "\n
\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 "";
print " | ";
- print "" . htmlspecialchars($fld->getName()) . " | \n";
+ print "getID()."\">" . htmlspecialchars($fld->getName()) . " | \n";
print "".htmlspecialchars($owner->getFullName())." | ";
print "";
- if ($deleteaction) print " ".getMLText("delete")."";
- else print "".getMLText("edit")."";
+ if ($deleteaction) print " ".getMLText("delete")."";
+ else print "".getMLText("edit")."";
print " |
";
}
}
@@ -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 {
@@ -113,8 +99,8 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
print "".getMLText("status")." | \n";
print "".getMLText("action")." | \n";
print "\n\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();
@@ -129,7 +115,7 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
}
print "";
- print "" . htmlspecialchars($doc->getName()) . "";
+ print " | getID()."\">" . htmlspecialchars($doc->getName()) . "";
print " ".getMLText('owner').": ".htmlspecialchars($owner->getFullName()).", ".getMLText('creation_date').": ".date('Y-m-d', $doc->getDate()).", ".getMLText('version')." ".$latest->getVersion()." - ".date('Y-m-d', $latest->getDate())."";
$comment = $latest->getComment();
if($comment) {
@@ -139,8 +125,8 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
print " | ".getOverallStatusText($status["status"])." | ";
print "";
- if ($deleteaction) print " ".getMLText("delete")."";
- else print "".getMLText("edit")."";
+ if ($deleteaction) print " ".getMLText("delete")."";
+ else print "".getMLText("edit")."";
print " | \n";
}
}
diff --git a/views/bootstrap/class.Timeline.php b/views/bootstrap/class.Timeline.php
index 0246b1402..7aaad57ef 100644
--- a/views/bootstrap/class.Timeline.php
+++ b/views/bootstrap/class.Timeline.php
@@ -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 () {