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 * 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 object $group group for which notifications are to be retrieved
* @param integer $type type of item (T_DOCUMENT or T_FOLDER) * @param integer $type type of item (T_DOCUMENT or T_FOLDER)
* @return array array of notifications * @return array array of notifications
*/ */
function getNotificationsByGroup($group, $type=0) { /* {{{ */ function getNotificationsByGroup($group, $type=0) { /* {{{ */
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ". return $group->getNotifications($type);
"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;
} /* }}} */ } /* }}} */
/** /**
* Get all notifications for a user * 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 object $user user for which notifications are to be retrieved
* @param integer $type type of item (T_DOCUMENT or T_FOLDER) * @param integer $type type of item (T_DOCUMENT or T_FOLDER)
* @return array array of notifications * @return array array of notifications
*/ */
function getNotificationsByUser($user, $type=0) { /* {{{ */ function getNotificationsByUser($user, $type=0) { /* {{{ */
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ". return $user->getNotifications($type);
"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;
} /* }}} */ } /* }}} */
/** /**

View File

@ -469,5 +469,33 @@ class SeedDMS_Core_Group {
return $status; 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; 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> <notes>
- make sure boolean attribute is saved as 0/1 - make sure boolean attribute is saved as 0/1
- add SeedDMS_Core_User::[g|s]etMandatoryWorkflows() - 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> </notes>
</release> </release>
</changelog> </changelog>

View File

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

View File

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

View File

@ -32,11 +32,16 @@ if (!$user->isAdmin()) {
$categories = $dms->getDocumentCategories(); $categories = $dms->getDocumentCategories();
if(isset($_GET['categoryid']) && $_GET['categoryid']) {
$selcat = $dms->getDocumentCategory($_GET['categoryid']);
} else {
$selcat = null;
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); $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) { if($view) {
$view->show(); $view($_GET);
exit;
} }
?> ?>

View File

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

View File

@ -31,80 +31,37 @@ require_once("class.Bootstrap.php");
*/ */
class SeedDMS_View_Categories extends SeedDMS_Bootstrap_Style { class SeedDMS_View_Categories extends SeedDMS_Bootstrap_Style {
function show() { /* {{{ */ function js() { /* {{{ */
$dms = $this->params['dms']; $selcat = $this->params['selcategory'];
$user = $this->params['user'];
$categories = $this->params['categories'];
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
$this->contentStart();
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
?> ?>
$(document).ready( function() {
<script language="JavaScript"> $( "#selector" ).change(function() {
obj = -1; $('div.ajax').trigger('update', {categoryid: $(this).val()});
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>
<?php <?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 function info() { /* {{{ */
$dms = $this->params['dms'];
$selected=0; $selcat = $this->params['selcategory'];
$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>
</div> if($selcat) {
</div> $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"> function showCategoryForm($category) { /* {{{ */
<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;\">";
?> ?>
<table class="table-condensed"> <table class="table-condensed">
<tr> <tr>
<td></td><td> <td></td><td>
<?php <?php
if(!$category->isUsed()) { if($category && !$category->isUsed()) {
?> ?>
<form style="display: inline-block;" method="post" action="../op/op.Categories.php" > <form style="display: inline-block;" method="post" action="../op/op.Categories.php" >
<?php echo createHiddenFieldWithKey('removecategory'); ?> <?php echo createHiddenFieldWithKey('removecategory'); ?>
@ -125,28 +82,68 @@ function showCategories(selectObj) {
<td><?php echo getMLText("name")?>:</td> <td><?php echo getMLText("name")?>:</td>
<td> <td>
<form class="form-inline" style="margin-bottom: 0px;" action="../op/op.Categories.php" method="post"> <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'); ?> <?php echo createHiddenFieldWithKey('editcategory'); ?>
<input type="Hidden" name="action" value="editcategory"> <input type="Hidden" name="action" value="editcategory">
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>"> <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> <button type="submit" class="btn"><i class="icon-save"></i> <?php printMLText("save");?></button>
</form> </form>
</td> </td>
</tr> </tr>
</table> </table>
</td> <?php
<?php } ?> } /* }}} */
</tr></table>
</div> function form() { /* {{{ */
</div> $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> </div>
<script language="JavaScript">
sel = document.getElementById("selector");
sel.selectedIndex=<?php print $selected ?>;
showCategories(sel);
</script>
<?php <?php
$this->htmlEndPage(); $this->htmlEndPage();
} /* }}} */ } /* }}} */

View File

@ -35,40 +35,26 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
function getNotificationList($as_group, $folders) { /* {{{ */ function getNotificationList($as_group, $folders) { /* {{{ */
// First, get the list of groups of which the user is a member. // First, get the list of groups of which the user is a member.
$notifications = array();
if ($as_group){ if ($as_group){
if(!($groups = $this->user->getGroups()))
$groups = $this->user->getGroups(); return NULL;
if (count($groups)==0) return NULL;
$grpList = "";
foreach ($groups as $group) { 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 { } else {
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ". $notifications = $this->user->getNotifications($folders ? T_FOLDER : T_DOCUMENT);
"WHERE `tblNotify`.`userID` = '". $this->user->getID()."'" ;
} }
$resArr = $this->db->getResultArray($queryStr); return $notifications;
$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;
} /* }}} */ } /* }}} */
function printFolderNotificationList($ret,$deleteaction=true) { /* {{{ */ function printFolderNotificationList($notifications, $deleteaction=true) { /* {{{ */
if (count($ret)==0) { if (count($notifications)==0) {
printMLText("empty_notify_list"); printMLText("empty_notify_list");
} }
else { else {
@ -80,17 +66,17 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
print "<th>".getMLText("owner")."</th>\n"; print "<th>".getMLText("owner")."</th>\n";
print "<th>".getMLText("actions")."</th>\n"; print "<th>".getMLText("actions")."</th>\n";
print "</tr></thead>\n<tbody>\n"; print "</tr></thead>\n<tbody>\n";
foreach($ret as $ID) { foreach($notifications as $notification) {
$fld = $this->dms->getFolder($ID); $fld = $this->dms->getFolder($notification->getTarget());
if (is_object($fld)) { if (is_object($fld)) {
$owner = $fld->getOwner(); $owner = $fld->getOwner();
print "<tr class=\"folder\">"; print "<tr class=\"folder\">";
print "<td><i class=\"icon-folder-close-alt\"></i></td>"; 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>".htmlspecialchars($owner->getFullName())."</td>";
print "<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>"; 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=".$ID."' class=\"btn btn-mini\">".getMLText("edit")."</a>"; else print "<a href='../out/out.FolderNotify.php?folderid=".$fld->getID()."' class=\"btn btn-mini\">".getMLText("edit")."</a>";
print "</td></tr>"; 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"); printMLText("empty_notify_list");
} }
else { else {
@ -114,8 +100,8 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
print "<th>".getMLText("status")."</th>\n"; print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("action")."</th>\n"; print "<th>".getMLText("action")."</th>\n";
print "</tr></thead>\n<tbody>\n"; print "</tr></thead>\n<tbody>\n";
foreach ($ret as $ID) { foreach ($notifications as $notification) {
$doc = $this->dms->getDocument($ID); $doc = $this->dms->getDocument($notification->getTarget());
if (is_object($doc)) { if (is_object($doc)) {
$owner = $doc->getOwner(); $owner = $doc->getOwner();
$latest = $doc->getLatestContent(); $latest = $doc->getLatestContent();
@ -130,7 +116,7 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
} }
print "</td>"; 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>"; 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(); $comment = $latest->getComment();
if($comment) { if($comment) {
@ -140,8 +126,8 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
print "<td>".getOverallStatusText($status["status"])."</td>"; print "<td>".getOverallStatusText($status["status"])."</td>";
print "<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>"; 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=".$ID."' class=\"btn btn-mini\">".getMLText("edit")."</a>"; else print "<a href='../out/out.DocumentNotify.php?documentid=".$doc->getID()."' class=\"btn btn-mini\">".getMLText("edit")."</a>";
print "</td></tr>\n"; 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); echo json_encode($jsondata);
} /* }}} */ } /* }}} */
function js() { /* {{{ */ 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'); header('Content-Type: application/javascript');
?> ?>
$(document).ready(function () { $(document).ready(function () {