Commit b31f08aff136f8726e4e933565649f3292d750b7
1 parent
b23cac32
KTS-1447
"Add a delete "bin" icon to "Items that require your attention..." Dashboard item and don't delete the item automatically" Fixed. Removed the delete call on viewing the document/folder/etc. Added the standard delete icon next the the 'Clear Alert' link. Committed by: Megan Watson Reviewed by: Jonathan Byrne git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7600 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
17 changed files
with
285 additions
and
153 deletions
lib/dashboard/Notification.inc.php
| @@ -5,32 +5,32 @@ | @@ -5,32 +5,32 @@ | ||
| 5 | * KnowledgeTree Open Source Edition | 5 | * KnowledgeTree Open Source Edition |
| 6 | * Document Management Made Simple | 6 | * Document Management Made Simple |
| 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited | 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited |
| 8 | - * | 8 | + * |
| 9 | * This program is free software; you can redistribute it and/or modify it under | 9 | * This program is free software; you can redistribute it and/or modify it under |
| 10 | * the terms of the GNU General Public License version 3 as published by the | 10 | * the terms of the GNU General Public License version 3 as published by the |
| 11 | * Free Software Foundation. | 11 | * Free Software Foundation. |
| 12 | - * | 12 | + * |
| 13 | * This program is distributed in the hope that it will be useful, but WITHOUT | 13 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 16 | * details. | 16 | * details. |
| 17 | - * | 17 | + * |
| 18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | - * | 20 | + * |
| 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, | 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, |
| 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. | 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 23 | - * | 23 | + * |
| 24 | * The interactive user interfaces in modified source and object code versions | 24 | * The interactive user interfaces in modified source and object code versions |
| 25 | * of this program must display Appropriate Legal Notices, as required under | 25 | * of this program must display Appropriate Legal Notices, as required under |
| 26 | * Section 5 of the GNU General Public License version 3. | 26 | * Section 5 of the GNU General Public License version 3. |
| 27 | - * | 27 | + * |
| 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, | 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 29 | * these Appropriate Legal Notices must retain the display of the "Powered by | 29 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 30 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | 30 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the |
| 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 32 | - * must display the words "Powered by KnowledgeTree" and retain the original | ||
| 33 | - * copyright notice. | 32 | + * must display the words "Powered by KnowledgeTree" and retain the original |
| 33 | + * copyright notice. | ||
| 34 | * Contributor( s): ______________________________________ | 34 | * Contributor( s): ______________________________________ |
| 35 | * | 35 | * |
| 36 | */ | 36 | */ |
| @@ -58,7 +58,7 @@ class KTNotification extends KTEntity { | @@ -58,7 +58,7 @@ class KTNotification extends KTEntity { | ||
| 58 | /** primary key value */ | 58 | /** primary key value */ |
| 59 | var $iId = -1; | 59 | var $iId = -1; |
| 60 | var $iUserId; | 60 | var $iUserId; |
| 61 | - | 61 | + |
| 62 | // sType and sLabel provide the title of the dashboard alert. | 62 | // sType and sLabel provide the title of the dashboard alert. |
| 63 | var $sLabel; // a simple label - e.g. the document's title, or so forth. | 63 | var $sLabel; // a simple label - e.g. the document's title, or so forth. |
| 64 | var $sType; // namespaced item type. (e.g. ktcore/subscriptions, word/officeupload) | 64 | var $sType; // namespaced item type. (e.g. ktcore/subscriptions, word/officeupload) |
| @@ -73,34 +73,34 @@ class KTNotification extends KTEntity { | @@ -73,34 +73,34 @@ class KTNotification extends KTEntity { | ||
| 73 | var $iData2; | 73 | var $iData2; |
| 74 | // sData1 and sData2 are 255-length character fields | 74 | // sData1 and sData2 are 255-length character fields |
| 75 | var $sData1; | 75 | var $sData1; |
| 76 | - var $sData2; | 76 | + var $sData2; |
| 77 | // sText1 is a 65535-length text field | 77 | // sText1 is a 65535-length text field |
| 78 | - var $sText1; | ||
| 79 | - | 78 | + var $sText1; |
| 79 | + | ||
| 80 | var $_bUsePearError = true; | 80 | var $_bUsePearError = true; |
| 81 | - | 81 | + |
| 82 | function getId() { return $this->iId; } | 82 | function getId() { return $this->iId; } |
| 83 | - | ||
| 84 | - function getLabel() { return $this->sLabel; } | 83 | + |
| 84 | + function getLabel() { return $this->sLabel; } | ||
| 85 | function setLabel($sLabel) { $this->sLabel = $sLabel; } | 85 | function setLabel($sLabel) { $this->sLabel = $sLabel; } |
| 86 | - function getType() { return $this->sType; } | 86 | + function getType() { return $this->sType; } |
| 87 | function setType($sType) { $this->sType = $sType; } | 87 | function setType($sType) { $this->sType = $sType; } |
| 88 | - | ||
| 89 | - function getIntData1() { return $this->iData1; } | 88 | + |
| 89 | + function getIntData1() { return $this->iData1; } | ||
| 90 | function setIntData1($iData1) { $this->iData1 = $iData1; } | 90 | function setIntData1($iData1) { $this->iData1 = $iData1; } |
| 91 | - function getIntData2() { return $this->iData2; } | 91 | + function getIntData2() { return $this->iData2; } |
| 92 | function setIntData2($iData2) { $this->iData2 = $iData2; } | 92 | function setIntData2($iData2) { $this->iData2 = $iData2; } |
| 93 | - function getStrData1() { return $this->sData1; } | 93 | + function getStrData1() { return $this->sData1; } |
| 94 | function setStrData1($sData1) { $this->sData1 = $sData1; } | 94 | function setStrData1($sData1) { $this->sData1 = $sData1; } |
| 95 | - function getStrData2() { return $this->sData2; } | ||
| 96 | - function setStrData2($sData2) { $this->sData2 = $sData2; } | ||
| 97 | - function getTextData1() { return $this->sText1; } | ||
| 98 | - function setTextData1($mValue) { $this->sText1 = $mValue; } | 95 | + function getStrData2() { return $this->sData2; } |
| 96 | + function setStrData2($sData2) { $this->sData2 = $sData2; } | ||
| 97 | + function getTextData1() { return $this->sText1; } | ||
| 98 | + function setTextData1($mValue) { $this->sText1 = $mValue; } | ||
| 99 | 99 | ||
| 100 | var $_aFieldToSelect = array( | 100 | var $_aFieldToSelect = array( |
| 101 | "iId" => "id", | 101 | "iId" => "id", |
| 102 | "iUserId" => "user_id", | 102 | "iUserId" => "user_id", |
| 103 | - "sLabel" => "label", | 103 | + "sLabel" => "label", |
| 104 | "sType" => "type", | 104 | "sType" => "type", |
| 105 | "dCreationDate" => "creation_date", | 105 | "dCreationDate" => "creation_date", |
| 106 | "iData1" => "data_int_1", | 106 | "iData1" => "data_int_1", |
| @@ -109,7 +109,7 @@ class KTNotification extends KTEntity { | @@ -109,7 +109,7 @@ class KTNotification extends KTEntity { | ||
| 109 | "sData2" => "data_str_2", | 109 | "sData2" => "data_str_2", |
| 110 | "sText1" => "data_text_1", | 110 | "sText1" => "data_text_1", |
| 111 | ); | 111 | ); |
| 112 | - | 112 | + |
| 113 | function _table () { | 113 | function _table () { |
| 114 | return KTUtil::getTableName('notifications'); | 114 | return KTUtil::getTableName('notifications'); |
| 115 | } | 115 | } |
| @@ -118,11 +118,11 @@ class KTNotification extends KTEntity { | @@ -118,11 +118,11 @@ class KTNotification extends KTEntity { | ||
| 118 | $notificationRegistry =& KTNotificationRegistry::getSingleton(); | 118 | $notificationRegistry =& KTNotificationRegistry::getSingleton(); |
| 119 | $handler = $notificationRegistry->getHandler($this->sType); | 119 | $handler = $notificationRegistry->getHandler($this->sType); |
| 120 | 120 | ||
| 121 | - if (is_null($handler)) { return null; } | ||
| 122 | - | 121 | + if (is_null($handler)) { return null; } |
| 122 | + | ||
| 123 | return $handler->handleNotification($this); | 123 | return $handler->handleNotification($this); |
| 124 | } | 124 | } |
| 125 | - | 125 | + |
| 126 | function &getHandler() { | 126 | function &getHandler() { |
| 127 | $notificationRegistry =& KTNotificationRegistry::getSingleton(); | 127 | $notificationRegistry =& KTNotificationRegistry::getSingleton(); |
| 128 | $handler =& $notificationRegistry->getHandler($this->sType); | 128 | $handler =& $notificationRegistry->getHandler($this->sType); |
| @@ -131,10 +131,10 @@ class KTNotification extends KTEntity { | @@ -131,10 +131,10 @@ class KTNotification extends KTEntity { | ||
| 131 | 131 | ||
| 132 | // Static function | 132 | // Static function |
| 133 | function &get($iId) { return KTEntityUtil::get('KTNotification', $iId); } | 133 | function &get($iId) { return KTEntityUtil::get('KTNotification', $iId); } |
| 134 | - function &getList($sWhereClause = null, $aOptions = null ) { | 134 | + function &getList($sWhereClause = null, $aOptions = null ) { |
| 135 | if(!is_array($aOptions)) $aOptions = array($aOptions); | 135 | if(!is_array($aOptions)) $aOptions = array($aOptions); |
| 136 | $aOptions['orderby'] = KTUtil::arrayGet($aOptions, 'orderby', 'creation_date DESC'); | 136 | $aOptions['orderby'] = KTUtil::arrayGet($aOptions, 'orderby', 'creation_date DESC'); |
| 137 | - return KTEntityUtil::getList2('KTNotification', $sWhereClause, $aOptions); | 137 | + return KTEntityUtil::getList2('KTNotification', $sWhereClause, $aOptions); |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | function &createFromArray($aOptions) { return KTEntityUtil::createFromArray('KTNotification', $aOptions); } | 140 | function &createFromArray($aOptions) { return KTEntityUtil::createFromArray('KTNotification', $aOptions); } |
| @@ -151,14 +151,15 @@ class KTNotificationHandler extends KTStandardDispatcher { | @@ -151,14 +151,15 @@ class KTNotificationHandler extends KTStandardDispatcher { | ||
| 151 | function handleNotification($oKTNotification) { | 151 | function handleNotification($oKTNotification) { |
| 152 | $oTemplating =& KTTemplating::getSingleton(); | 152 | $oTemplating =& KTTemplating::getSingleton(); |
| 153 | $oTemplate = $oTemplating->loadTemplate("kt3/notifications/generic"); | 153 | $oTemplate = $oTemplating->loadTemplate("kt3/notifications/generic"); |
| 154 | - $aTemplateData = array("context" => $oKTNotification,); | 154 | + |
| 155 | + $aTemplateData = array("context" => $oKTNotification, "oKTConfig" => $oKTConfig); | ||
| 155 | return $oTemplate->render($aTemplateData); | 156 | return $oTemplate->render($aTemplateData); |
| 156 | } | 157 | } |
| 157 | 158 | ||
| 158 | function do_main() { | 159 | function do_main() { |
| 159 | $this->resolveNotification($this->notification); | 160 | $this->resolveNotification($this->notification); |
| 160 | } | 161 | } |
| 161 | - | 162 | + |
| 162 | // called to resolve the notification (typically from /notify.php?id=xxxxx | 163 | // called to resolve the notification (typically from /notify.php?id=xxxxx |
| 163 | function resolveNotification($oKTNotification) { | 164 | function resolveNotification($oKTNotification) { |
| 164 | $_SESSION['KTErrorMessage'][] = _kt("This notification handler does not support publication."); | 165 | $_SESSION['KTErrorMessage'][] = _kt("This notification handler does not support publication."); |
| @@ -172,10 +173,10 @@ class KTSubscriptionNotification extends KTNotificationHandler { | @@ -172,10 +173,10 @@ class KTSubscriptionNotification extends KTNotificationHandler { | ||
| 172 | /* Subscription Notifications | 173 | /* Subscription Notifications |
| 173 | * | 174 | * |
| 174 | * Subscriptions are a large part of the notification volume. | 175 | * Subscriptions are a large part of the notification volume. |
| 175 | - * That said, notifications cater to a larger group, so there is some | 176 | + * That said, notifications cater to a larger group, so there is some |
| 176 | * degree of mismatch between the two. | 177 | * degree of mismatch between the two. |
| 177 | * | 178 | * |
| 178 | - * Mapping the needs of subscriptions onto the provisions of notifications | 179 | + * Mapping the needs of subscriptions onto the provisions of notifications |
| 179 | * works as: | 180 | * works as: |
| 180 | * | 181 | * |
| 181 | * $oKTN->label: object name [e.g. Document Name] | 182 | * $oKTN->label: object name [e.g. Document Name] |
| @@ -183,9 +184,9 @@ class KTSubscriptionNotification extends KTNotificationHandler { | @@ -183,9 +184,9 @@ class KTSubscriptionNotification extends KTNotificationHandler { | ||
| 183 | * $oKTN->strData2: _location_ name. (e.g. folder of the subscription.) | 184 | * $oKTN->strData2: _location_ name. (e.g. folder of the subscription.) |
| 184 | * $oKTN->intData1: object id (e.g. document_id, folder_id) | 185 | * $oKTN->intData1: object id (e.g. document_id, folder_id) |
| 185 | * $oKTN->intData2: actor id (e.g. user_id) | 186 | * $oKTN->intData2: actor id (e.g. user_id) |
| 186 | - * | 187 | + * |
| 187 | */ | 188 | */ |
| 188 | - | 189 | + |
| 189 | var $notificationType = 'ktcore/subscriptions'; | 190 | var $notificationType = 'ktcore/subscriptions'; |
| 190 | 191 | ||
| 191 | var $_eventObjectMap = array( | 192 | var $_eventObjectMap = array( |
| @@ -202,7 +203,7 @@ class KTSubscriptionNotification extends KTNotificationHandler { | @@ -202,7 +203,7 @@ class KTSubscriptionNotification extends KTNotificationHandler { | ||
| 202 | "ArchivedDocument" => 'document', // can go through and request un-archival (?) | 203 | "ArchivedDocument" => 'document', // can go through and request un-archival (?) |
| 203 | "RestoredArchivedDocument" => 'document', | 204 | "RestoredArchivedDocument" => 'document', |
| 204 | "DiscussDocument" => 'document', | 205 | "DiscussDocument" => 'document', |
| 205 | - ); | 206 | + ); |
| 206 | 207 | ||
| 207 | function KTSubscriptionNotification() { | 208 | function KTSubscriptionNotification() { |
| 208 | $this->_eventTypeNames = array( | 209 | $this->_eventTypeNames = array( |
| @@ -218,7 +219,7 @@ class KTSubscriptionNotification extends KTNotificationHandler { | @@ -218,7 +219,7 @@ class KTSubscriptionNotification extends KTNotificationHandler { | ||
| 218 | "MovedDocument" => _kt('Document moved'), | 219 | "MovedDocument" => _kt('Document moved'), |
| 219 | "ArchivedDocument" => _kt('Document archived'), // can go through and request un-archival (?) | 220 | "ArchivedDocument" => _kt('Document archived'), // can go through and request un-archival (?) |
| 220 | "RestoredArchivedDocument" => _kt('Document restored'), | 221 | "RestoredArchivedDocument" => _kt('Document restored'), |
| 221 | - "DiscussDocument" => _kt('Document Discussions updated'), | 222 | + "DiscussDocument" => _kt('Document Discussions updated'), |
| 222 | ); | 223 | ); |
| 223 | //parent::KTNotificationHandler(); | 224 | //parent::KTNotificationHandler(); |
| 224 | } | 225 | } |
| @@ -233,9 +234,9 @@ class KTSubscriptionNotification extends KTNotificationHandler { | @@ -233,9 +234,9 @@ class KTSubscriptionNotification extends KTNotificationHandler { | ||
| 233 | 'has_actor' => false, | 234 | 'has_actor' => false, |
| 234 | 'notify_id' => $oKTNotification->getId(), | 235 | 'notify_id' => $oKTNotification->getId(), |
| 235 | ); | 236 | ); |
| 236 | - | 237 | + |
| 237 | $info['title'] = KTUtil::arrayGet($this->_eventTypeNames, $info['event_type'], 'Subscription alert:') .': ' . $info['object_name']; | 238 | $info['title'] = KTUtil::arrayGet($this->_eventTypeNames, $info['event_type'], 'Subscription alert:') .': ' . $info['object_name']; |
| 238 | - | 239 | + |
| 239 | if ($info['actor_id'] !== null) { | 240 | if ($info['actor_id'] !== null) { |
| 240 | $oTempUser = User::get($info['actor_id']); | 241 | $oTempUser = User::get($info['actor_id']); |
| 241 | if (PEAR::isError($oTempUser) || ($oTempUser == false)) { | 242 | if (PEAR::isError($oTempUser) || ($oTempUser == false)) { |
| @@ -246,31 +247,31 @@ class KTSubscriptionNotification extends KTNotificationHandler { | @@ -246,31 +247,31 @@ class KTSubscriptionNotification extends KTNotificationHandler { | ||
| 246 | $info['has_actor'] = true; | 247 | $info['has_actor'] = true; |
| 247 | } | 248 | } |
| 248 | } | 249 | } |
| 249 | - | 250 | + |
| 250 | if ($info['object_id'] !== null) { | 251 | if ($info['object_id'] !== null) { |
| 251 | $info['object'] = $this->_getEventObject($info['event_type'], $info['object_id']); | 252 | $info['object'] = $this->_getEventObject($info['event_type'], $info['object_id']); |
| 252 | } | 253 | } |
| 253 | - | 254 | + |
| 254 | return $info; | 255 | return $info; |
| 255 | } | 256 | } |
| 256 | - | 257 | + |
| 257 | // resolve the object type based on the alert type. | 258 | // resolve the object type based on the alert type. |
| 258 | function _getEventObject($sAlertType, $id) { | 259 | function _getEventObject($sAlertType, $id) { |
| 259 | $t = KTUtil::arrayGet($this->_eventObjectMap, $sAlertType ,''); | 260 | $t = KTUtil::arrayGet($this->_eventObjectMap, $sAlertType ,''); |
| 260 | - | 261 | + |
| 261 | if ($t == 'document') { | 262 | if ($t == 'document') { |
| 262 | $o = Document::get($id); | 263 | $o = Document::get($id); |
| 263 | - if (PEAR::isError($o) || ($o == false)) { return null; | 264 | + if (PEAR::isError($o) || ($o == false)) { return null; |
| 264 | } else { return $o; } | 265 | } else { return $o; } |
| 265 | } else if ($t == 'folder') { | 266 | } else if ($t == 'folder') { |
| 266 | $o = Folder::get($id); | 267 | $o = Folder::get($id); |
| 267 | - if (PEAR::isError($o) || ($o == false)) { return null; | 268 | + if (PEAR::isError($o) || ($o == false)) { return null; |
| 268 | } else { return $o; } | 269 | } else { return $o; } |
| 269 | } else { | 270 | } else { |
| 270 | return null; | 271 | return null; |
| 271 | } | 272 | } |
| 272 | } | 273 | } |
| 273 | - | 274 | + |
| 274 | function _getEventObjectType($sAlertType) { | 275 | function _getEventObjectType($sAlertType) { |
| 275 | return KTUtil::arrayGet($this->_eventObjectMap, $sAlertType ,''); | 276 | return KTUtil::arrayGet($this->_eventObjectMap, $sAlertType ,''); |
| 276 | } | 277 | } |
| @@ -286,21 +287,21 @@ class KTSubscriptionNotification extends KTNotificationHandler { | @@ -286,21 +287,21 @@ class KTSubscriptionNotification extends KTNotificationHandler { | ||
| 286 | /* | 287 | /* |
| 287 | "iId" => "id", | 288 | "iId" => "id", |
| 288 | "iUserId" => "user_id", | 289 | "iUserId" => "user_id", |
| 289 | - "sLabel" => "label", | 290 | + "sLabel" => "label", |
| 290 | "sType" => "type", | 291 | "sType" => "type", |
| 291 | "dCreationDate" => "creation_date", | 292 | "dCreationDate" => "creation_date", |
| 292 | "iData1" => "data_int_1", | 293 | "iData1" => "data_int_1", |
| 293 | "iData2" => "data_int_2", | 294 | "iData2" => "data_int_2", |
| 294 | "sData1" => "data_str_1", | 295 | "sData1" => "data_str_1", |
| 295 | "sData2" => "data_str_2", | 296 | "sData2" => "data_str_2", |
| 296 | - | 297 | + |
| 297 | 'object_name' => $oKTNotification->getLabel(), | 298 | 'object_name' => $oKTNotification->getLabel(), |
| 298 | 'event_type' => $oKTNotification->getStrData1(), | 299 | 'event_type' => $oKTNotification->getStrData1(), |
| 299 | 'location_name' => $oKTNotification->getStrData2(), | 300 | 'location_name' => $oKTNotification->getStrData2(), |
| 300 | 'object_id' => $oKTNotification->getIntData1(), | 301 | 'object_id' => $oKTNotification->getIntData1(), |
| 301 | 'actor_id' => $oKTNotification->getIntData2(), | 302 | 'actor_id' => $oKTNotification->getIntData2(), |
| 302 | - 'has_actor' => false, | ||
| 303 | - | 303 | + 'has_actor' => false, |
| 304 | + | ||
| 304 | */ | 305 | */ |
| 305 | $creationInfo['sLabel'] = $aOptions['target_name']; | 306 | $creationInfo['sLabel'] = $aOptions['target_name']; |
| 306 | $creationInfo['sData1'] = $aOptions['event_type']; | 307 | $creationInfo['sData1'] = $aOptions['event_type']; |
| @@ -312,20 +313,23 @@ class KTSubscriptionNotification extends KTNotificationHandler { | @@ -312,20 +313,23 @@ class KTSubscriptionNotification extends KTNotificationHandler { | ||
| 312 | $creationInfo['dCreationDate'] = getCurrentDateTime(); // erk. | 313 | $creationInfo['dCreationDate'] = getCurrentDateTime(); // erk. |
| 313 | 314 | ||
| 314 | global $default; | 315 | global $default; |
| 315 | - | 316 | + |
| 316 | //$default->log->debug('subscription notification: from ' . print_r($aOptions, true)); | 317 | //$default->log->debug('subscription notification: from ' . print_r($aOptions, true)); |
| 317 | $default->log->debug('subscription notification: using ' . print_r($creationInfo, true)); | 318 | $default->log->debug('subscription notification: using ' . print_r($creationInfo, true)); |
| 318 | - | 319 | + |
| 319 | $oNotification =& KTNotification::createFromArray($creationInfo); | 320 | $oNotification =& KTNotification::createFromArray($creationInfo); |
| 320 | - | ||
| 321 | - | 321 | + |
| 322 | + | ||
| 322 | $default->log->debug('subscription notification: created ' . print_r($oNotification, true)); | 323 | $default->log->debug('subscription notification: created ' . print_r($oNotification, true)); |
| 323 | - | 324 | + |
| 324 | return $oNotification; // $res. | 325 | return $oNotification; // $res. |
| 325 | } | 326 | } |
| 326 | - | ||
| 327 | - | ||
| 328 | - | 327 | + |
| 328 | + /** | ||
| 329 | + * View the notification, and clear if requested | ||
| 330 | + * | ||
| 331 | + * @param unknown_type $oKTNotification | ||
| 332 | + */ | ||
| 329 | function resolveNotification($oKTNotification) { | 333 | function resolveNotification($oKTNotification) { |
| 330 | $notify_action = KTUtil::arrayGet($_REQUEST, 'notify_action', null); | 334 | $notify_action = KTUtil::arrayGet($_REQUEST, 'notify_action', null); |
| 331 | if ($notify_action == 'clear') { | 335 | if ($notify_action == 'clear') { |
| @@ -333,38 +337,38 @@ class KTSubscriptionNotification extends KTNotificationHandler { | @@ -333,38 +337,38 @@ class KTSubscriptionNotification extends KTNotificationHandler { | ||
| 333 | $oKTNotification->delete(); | 337 | $oKTNotification->delete(); |
| 334 | exit(redirect(generateControllerLink('dashboard'))); | 338 | exit(redirect(generateControllerLink('dashboard'))); |
| 335 | } | 339 | } |
| 336 | - | 340 | + |
| 337 | // otherwise, we want to redirect the to object represented by the item. | 341 | // otherwise, we want to redirect the to object represented by the item. |
| 338 | // - viewDocument and viewFolder are the appropriate items. | 342 | // - viewDocument and viewFolder are the appropriate items. |
| 339 | - // - object_id | 343 | + // - object_id |
| 340 | $info = $this->_getSubscriptionData($oKTNotification); | 344 | $info = $this->_getSubscriptionData($oKTNotification); |
| 341 | - | 345 | + |
| 342 | $object_type = $this->_getEventObjectType($info['event_type']); | 346 | $object_type = $this->_getEventObjectType($info['event_type']); |
| 343 | - | 347 | + |
| 344 | if ($object_type == '') { | 348 | if ($object_type == '') { |
| 345 | - $_SESSION['KTErrorMessage'][] = 'This notification has no "target". Please report as a bug that this subscription should only have a clear action.' . $object_type; | 349 | + $_SESSION['KTErrorMessage'][] = 'This notification has no "target". Please report as a bug that this subscription should only have a clear action.' . $object_type; |
| 346 | exit(redirect(generateControllerLink('dashboard'))); | 350 | exit(redirect(generateControllerLink('dashboard'))); |
| 347 | - } | ||
| 348 | - | 351 | + } |
| 352 | + | ||
| 349 | if ($object_type == 'document') { | 353 | if ($object_type == 'document') { |
| 350 | if ($info['object_id'] !== null) { // fails and generates an error with no doc-id. | 354 | if ($info['object_id'] !== null) { // fails and generates an error with no doc-id. |
| 351 | $params = 'fDocumentId=' . $info['object_id']; | 355 | $params = 'fDocumentId=' . $info['object_id']; |
| 352 | $url = generateControllerLink('viewDocument', $params); | 356 | $url = generateControllerLink('viewDocument', $params); |
| 353 | - $oKTNotification->delete(); // clear the alert. | 357 | + //$oKTNotification->delete(); // clear the alert. |
| 354 | exit(redirect($url)); | 358 | exit(redirect($url)); |
| 355 | - } | 359 | + } |
| 356 | } else if ($object_type == 'folder') { | 360 | } else if ($object_type == 'folder') { |
| 357 | if ($info['object_id'] !== null) { // fails and generates an error with no doc-id. | 361 | if ($info['object_id'] !== null) { // fails and generates an error with no doc-id. |
| 358 | $params = 'fFolderId=' . $info['object_id']; | 362 | $params = 'fFolderId=' . $info['object_id']; |
| 359 | $url = generateControllerLink('browse', $params); | 363 | $url = generateControllerLink('browse', $params); |
| 360 | - $oKTNotification->delete(); // clear the alert. | 364 | + //$oKTNotification->delete(); // clear the alert. |
| 361 | exit(redirect($url)); | 365 | exit(redirect($url)); |
| 362 | - } | 366 | + } |
| 363 | } | 367 | } |
| 364 | - $_SESSION['KTErrorMessage'][] = sprintf('This notification has no "target". Please inform the %s developers that there is a target bug with type: ' . $info['event_type'], APP_NAME); | 368 | + $_SESSION['KTErrorMessage'][] = sprintf('This notification has no "target". Please inform the %s developers that there is a target bug with type: ' . $info['event_type'], APP_NAME); |
| 365 | exit(redirect(generateControllerLink('dashboard'))); | 369 | exit(redirect(generateControllerLink('dashboard'))); |
| 366 | } | 370 | } |
| 367 | - | 371 | + |
| 368 | } | 372 | } |
| 369 | 373 | ||
| 370 | class KTWorkflowNotification extends KTNotificationHandler { | 374 | class KTWorkflowNotification extends KTNotificationHandler { |
| @@ -374,41 +378,41 @@ class KTWorkflowNotification extends KTNotificationHandler { | @@ -374,41 +378,41 @@ class KTWorkflowNotification extends KTNotificationHandler { | ||
| 374 | foreach ($aNotifications as $oNotification) { | 378 | foreach ($aNotifications as $oNotification) { |
| 375 | $oNotification->delete(); | 379 | $oNotification->delete(); |
| 376 | } | 380 | } |
| 377 | - | 381 | + |
| 378 | } | 382 | } |
| 379 | 383 | ||
| 380 | - function & newNotificationForDocument($oDocument, $oUser, $oState, $oActor, $sComments) { | ||
| 381 | - $aInfo = array(); | 384 | + function & newNotificationForDocument($oDocument, $oUser, $oState, $oActor, $sComments) { |
| 385 | + $aInfo = array(); | ||
| 382 | $aInfo['sData1'] = $oState->getName(); | 386 | $aInfo['sData1'] = $oState->getName(); |
| 383 | $aInfo['sData2'] = $sComments; | 387 | $aInfo['sData2'] = $sComments; |
| 384 | $aInfo['iData1'] = $oDocument->getId(); | 388 | $aInfo['iData1'] = $oDocument->getId(); |
| 385 | $aInfo['iData2'] = $oActor->getId(); | 389 | $aInfo['iData2'] = $oActor->getId(); |
| 386 | $aInfo['sType'] = 'ktcore/workflow'; | 390 | $aInfo['sType'] = 'ktcore/workflow'; |
| 387 | - $aInfo['dCreationDate'] = getCurrentDateTime(); | 391 | + $aInfo['dCreationDate'] = getCurrentDateTime(); |
| 388 | $aInfo['iUserId'] = $oUser->getId(); | 392 | $aInfo['iUserId'] = $oUser->getId(); |
| 389 | $aInfo['sLabel'] = $oDocument->getName(); | 393 | $aInfo['sLabel'] = $oDocument->getName(); |
| 390 | - | 394 | + |
| 391 | $oNotification = KTNotification::createFromArray($aInfo); | 395 | $oNotification = KTNotification::createFromArray($aInfo); |
| 392 | - | 396 | + |
| 393 | $handler = new KTWorkflowNotification(); | 397 | $handler = new KTWorkflowNotification(); |
| 394 | - | 398 | + |
| 395 | if ($oUser->getEmailNotification() && (strlen($oUser->getEmail()) > 0)) { | 399 | if ($oUser->getEmailNotification() && (strlen($oUser->getEmail()) > 0)) { |
| 396 | $emailContent = $handler->handleNotification($oNotification); | 400 | $emailContent = $handler->handleNotification($oNotification); |
| 397 | $emailSubject = sprintf(_kt('Workflow Notification: %s'), $oDocument->getName()); | 401 | $emailSubject = sprintf(_kt('Workflow Notification: %s'), $oDocument->getName()); |
| 398 | $oEmail = new EmailAlert($oUser->getEmail(), $emailSubject, $emailContent); | 402 | $oEmail = new EmailAlert($oUser->getEmail(), $emailSubject, $emailContent); |
| 399 | $oEmail->send(); | 403 | $oEmail->send(); |
| 400 | } | 404 | } |
| 401 | - | 405 | + |
| 402 | return $oNotification; | 406 | return $oNotification; |
| 403 | } | 407 | } |
| 404 | 408 | ||
| 405 | - function handleNotification($oKTNotification) { | 409 | + function handleNotification($oKTNotification) { |
| 406 | $oTemplating =& KTTemplating::getSingleton(); | 410 | $oTemplating =& KTTemplating::getSingleton(); |
| 407 | $oTemplate =& $oTemplating->loadTemplate('ktcore/workflow/workflow_notification'); | 411 | $oTemplate =& $oTemplating->loadTemplate('ktcore/workflow/workflow_notification'); |
| 408 | - | 412 | + |
| 409 | $oDoc = Document::get($oKTNotification->getIntData1()); | 413 | $oDoc = Document::get($oKTNotification->getIntData1()); |
| 410 | $isBroken = (PEAR::isError($oDoc) || ($oDoc->getStatusID() != LIVE)); | 414 | $isBroken = (PEAR::isError($oDoc) || ($oDoc->getStatusID() != LIVE)); |
| 411 | - | 415 | + |
| 412 | $oTemplate->setData(array( | 416 | $oTemplate->setData(array( |
| 413 | 'context' => $this, | 417 | 'context' => $this, |
| 414 | 'document_id' => $oKTNotification->getIntData1(), | 418 | 'document_id' => $oKTNotification->getIntData1(), |
| @@ -421,7 +425,7 @@ class KTWorkflowNotification extends KTNotificationHandler { | @@ -421,7 +425,7 @@ class KTWorkflowNotification extends KTNotificationHandler { | ||
| 421 | )); | 425 | )); |
| 422 | return $oTemplate->render(); | 426 | return $oTemplate->render(); |
| 423 | } | 427 | } |
| 424 | - | 428 | + |
| 425 | function resolveNotification($oKTNotification) { | 429 | function resolveNotification($oKTNotification) { |
| 426 | $notify_action = KTUtil::arrayGet($_REQUEST, 'notify_action', null); | 430 | $notify_action = KTUtil::arrayGet($_REQUEST, 'notify_action', null); |
| 427 | if ($notify_action == 'clear') { | 431 | if ($notify_action == 'clear') { |
| @@ -429,10 +433,10 @@ class KTWorkflowNotification extends KTNotificationHandler { | @@ -429,10 +433,10 @@ class KTWorkflowNotification extends KTNotificationHandler { | ||
| 429 | $oKTNotification->delete(); | 433 | $oKTNotification->delete(); |
| 430 | exit(redirect(generateControllerLink('dashboard'))); | 434 | exit(redirect(generateControllerLink('dashboard'))); |
| 431 | } | 435 | } |
| 432 | - | 436 | + |
| 433 | $params = 'fDocumentId=' . $oKTNotification->getIntData1(); | 437 | $params = 'fDocumentId=' . $oKTNotification->getIntData1(); |
| 434 | $url = generateControllerLink('viewDocument', $params); | 438 | $url = generateControllerLink('viewDocument', $params); |
| 435 | - $oKTNotification->delete(); // clear the alert. | 439 | + //$oKTNotification->delete(); // clear the alert. |
| 436 | exit(redirect($url)); | 440 | exit(redirect($url)); |
| 437 | } | 441 | } |
| 438 | } | 442 | } |
templates/kt3/notifications/subscriptions.AddDocument.smarty
| 1 | <dt class="actionitem subscription">{$info.title|sanitize}</dt> | 1 | <dt class="actionitem subscription">{$info.title|sanitize}</dt> |
| 2 | <dd class="actionmessage"> | 2 | <dd class="actionmessage"> |
| 3 | + | ||
| 3 | <!-- could break this up. --> | 4 | <!-- could break this up. --> |
| 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" was added{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}to "#location_name#"{/i18n}{/if}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. | 5 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" was added{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}to "#location_name#"{/i18n}{/if}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. |
| 5 | <div class="actionoptions"> | 6 | <div class="actionoptions"> |
| 6 | - {if !$is_broken} | ||
| 7 | - <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Document{/i18n}</a> | ||
| 8 | - {else} | ||
| 9 | - <span class="descriptiveText">{i18n}Document is no longer available{/i18n}</span> | ||
| 10 | - {/if} | ||
| 11 | - | <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 7 | + <div style="float:left; position: relative;"> |
| 8 | + {if !$is_broken} | ||
| 9 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Document{/i18n}</a> | ||
| 10 | + {else} | ||
| 11 | + <span class="descriptiveText">{i18n}Document is no longer available{/i18n}</span> | ||
| 12 | + {/if} | ||
| 13 | + | ||
| 14 | + | | ||
| 15 | + | ||
| 16 | + </div> | ||
| 17 | + <div> | ||
| 18 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 19 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 20 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 21 | + | ||
| 22 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 23 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}">{i18n}Clear Alert{/i18n}</a> | ||
| 24 | + </div> | ||
| 12 | </div> | 25 | </div> |
| 13 | </dd> | 26 | </dd> |
templates/kt3/notifications/subscriptions.AddFolder.smarty
| @@ -3,11 +3,22 @@ | @@ -3,11 +3,22 @@ | ||
| 3 | <!-- could break this up. --> | 3 | <!-- could break this up. --> |
| 4 | {i18n arg_object_name=$info.object_name|sanitize}The folder "#object_name#" was added{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}to "#location_name#"{/i18n}{/if}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. | 4 | {i18n arg_object_name=$info.object_name|sanitize}The folder "#object_name#" was added{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}to "#location_name#"{/i18n}{/if}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. |
| 5 | <div class="actionoptions"> | 5 | <div class="actionoptions"> |
| 6 | + <div style="float:left; position: relative;"> | ||
| 6 | {if !$is_broken} | 7 | {if !$is_broken} |
| 7 | - <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View New Folder{/i18n}</a> | ||
| 8 | - {else} | ||
| 9 | - <span class="descriptiveText">{i18n}Folder is no longer available{/i18n}</span> | ||
| 10 | - {/if} | ||
| 11 | - | <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 8 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View New Folder{/i18n}</a> |
| 9 | + {else} | ||
| 10 | + <span class="descriptiveText">{i18n}Folder is no longer available{/i18n}</span> | ||
| 11 | + {/if} | ||
| 12 | + | | ||
| 13 | + | ||
| 14 | + </div> | ||
| 15 | + <div> | ||
| 16 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 17 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 18 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 19 | + | ||
| 20 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | ||
| 21 | + </div> | ||
| 22 | + | ||
| 12 | </div> | 23 | </div> |
| 13 | </dd> | 24 | </dd> |
templates/kt3/notifications/subscriptions.ArchivedDocument.smarty
| @@ -3,6 +3,9 @@ | @@ -3,6 +3,9 @@ | ||
| 3 | <!-- could break this up. --> | 3 | <!-- could break this up. --> |
| 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#"{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}from "#location_name#"{/i18n}{/if} {i18n}was archived{/i18n}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. | 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#"{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}from "#location_name#"{/i18n}{/if} {i18n}was archived{/i18n}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. |
| 5 | <div class="actionoptions"> | 5 | <div class="actionoptions"> |
| 6 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 7 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 8 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 6 | <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 9 | <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> |
| 7 | </div> | 10 | </div> |
| 8 | </dd> | 11 | </dd> |
templates/kt3/notifications/subscriptions.CheckInDocument.smarty
| @@ -3,11 +3,18 @@ | @@ -3,11 +3,18 @@ | ||
| 3 | <!-- could break this up. --> | 3 | <!-- could break this up. --> |
| 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" has been checked in{/i18n}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}{if ($info.location_name !== null)}, {i18n arg_location_name=$info.location_name}in the folder "#location_name#"{/i18n}{/if}. | 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" has been checked in{/i18n}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}{if ($info.location_name !== null)}, {i18n arg_location_name=$info.location_name}in the folder "#location_name#"{/i18n}{/if}. |
| 5 | <div class="actionoptions"> | 5 | <div class="actionoptions"> |
| 6 | - {if !$is_broken} | ||
| 7 | - <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Document{/i18n}</a> | ||
| 8 | - {else} | ||
| 9 | - <span class="descriptiveText">{i18n}Document is no longer available{/i18n}</span> | ||
| 10 | - {/if} | ||
| 11 | - | <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 6 | + <div style="float:left; position: relative;"> |
| 7 | + {if !$is_broken} | ||
| 8 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Document{/i18n}</a> | ||
| 9 | + {else} | ||
| 10 | + <span class="descriptiveText">{i18n}Document is no longer available{/i18n}</span> | ||
| 11 | + {/if} | ||
| 12 | + | | ||
| 13 | + </div> | ||
| 14 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 15 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 16 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 17 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 18 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}">{i18n}Clear Alert{/i18n}</a> | ||
| 12 | </div> | 19 | </div> |
| 13 | </dd> | 20 | </dd> |
templates/kt3/notifications/subscriptions.CheckOutDocument.smarty
| @@ -3,11 +3,18 @@ | @@ -3,11 +3,18 @@ | ||
| 3 | <!-- could break this up. --> | 3 | <!-- could break this up. --> |
| 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" has been checked out{/i18n}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}{if ($info.location_name !== null)}, {i18n arg_location_name=$info.location_name}from the folder "#location_name#"{/i18n}{/if}. | 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" has been checked out{/i18n}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}{if ($info.location_name !== null)}, {i18n arg_location_name=$info.location_name}from the folder "#location_name#"{/i18n}{/if}. |
| 5 | <div class="actionoptions"> | 5 | <div class="actionoptions"> |
| 6 | - {if !$is_broken} | ||
| 7 | - <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Document{/i18n}</a> | ||
| 8 | - {else} | ||
| 9 | - <span class="descriptiveText">{i18n}Document is no longer available{/i18n}</span> | ||
| 10 | - {/if} | ||
| 11 | - | <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 6 | + <div style="float:left; position: relative;"> |
| 7 | + {if !$is_broken} | ||
| 8 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Document{/i18n}</a> | ||
| 9 | + {else} | ||
| 10 | + <span class="descriptiveText">{i18n}Document is no longer available{/i18n}</span> | ||
| 11 | + {/if} | ||
| 12 | + | | ||
| 13 | + </div> | ||
| 14 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 15 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 16 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 17 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 18 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}">{i18n}Clear Alert{/i18n}</a> | ||
| 12 | </div> | 19 | </div> |
| 13 | </dd> | 20 | </dd> |
templates/kt3/notifications/subscriptions.DiscussDocument.smarty
| @@ -7,11 +7,20 @@ | @@ -7,11 +7,20 @@ | ||
| 7 | The discussion around document "{$info.object_name|sanitize}" has been updated. | 7 | The discussion around document "{$info.object_name|sanitize}" has been updated. |
| 8 | {/if} | 8 | {/if} |
| 9 | <div class="actionoptions"> | 9 | <div class="actionoptions"> |
| 10 | - {if !$is_broken} | ||
| 11 | - <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Document{/i18n}</a> | ||
| 12 | - {else} | ||
| 13 | - <span class="descriptiveText">{i18n}Document is no longer available{/i18n}</span> | ||
| 14 | - {/if} | ||
| 15 | - | <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 10 | + <div style="float:left; position: relative;"> |
| 11 | + {if !$is_broken} | ||
| 12 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Document{/i18n}</a> | ||
| 13 | + {else} | ||
| 14 | + <span class="descriptiveText">{i18n}Document is no longer available{/i18n}</span> | ||
| 15 | + {/if} | ||
| 16 | + | | ||
| 17 | + </div> | ||
| 18 | + | ||
| 19 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 20 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 21 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 22 | + | ||
| 23 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 24 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}">{i18n}Clear Alert{/i18n}</a> | ||
| 16 | </div> | 25 | </div> |
| 17 | </dd> | 26 | </dd> |
templates/kt3/notifications/subscriptions.ModifyDocument.smarty
| @@ -3,11 +3,20 @@ | @@ -3,11 +3,20 @@ | ||
| 3 | <!-- could break this up. --> | 3 | <!-- could break this up. --> |
| 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" has been changed{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}in the folder "#location_name#"{/i18n}{/if}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. | 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" has been changed{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}in the folder "#location_name#"{/i18n}{/if}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. |
| 5 | <div class="actionoptions"> | 5 | <div class="actionoptions"> |
| 6 | - {if !$is_broken} | ||
| 7 | - <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Document{/i18n}</a> | ||
| 8 | - {else} | ||
| 9 | - <span class="descriptiveText">{i18n}Document is no longer available{/i18n}</span> | ||
| 10 | - {/if} | ||
| 11 | - | <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 6 | + <div style="float:left; position: relative;"> |
| 7 | + {if !$is_broken} | ||
| 8 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Document{/i18n}</a> | ||
| 9 | + {else} | ||
| 10 | + <span class="descriptiveText">{i18n}Document is no longer available{/i18n}</span> | ||
| 11 | + {/if} | ||
| 12 | + | | ||
| 13 | + </div> | ||
| 14 | + | ||
| 15 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 16 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 17 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 18 | + | ||
| 19 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 20 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}">{i18n}Clear Alert{/i18n}</a> | ||
| 12 | </div> | 21 | </div> |
| 13 | </dd> | 22 | </dd> |
templates/kt3/notifications/subscriptions.MoveDocument.smarty
| @@ -3,12 +3,21 @@ | @@ -3,12 +3,21 @@ | ||
| 3 | <!-- could break this up. --> | 3 | <!-- could break this up. --> |
| 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" has been moved{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}to the folder "#location_name#"{/i18n}{/if}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. | 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" has been moved{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}to the folder "#location_name#"{/i18n}{/if}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. |
| 5 | <div class="actionoptions"> | 5 | <div class="actionoptions"> |
| 6 | - {if !$is_broken} | ||
| 7 | - <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View New Location{/i18n}</a> | ||
| 8 | - {else} | ||
| 9 | - <span class="descriptiveText">{i18n}Location is no longer available{/i18n}</span> | ||
| 10 | - {/if} | 6 | + <div style="float:left; position: relative;"> |
| 7 | + {if !$is_broken} | ||
| 8 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View New Location{/i18n}</a> | ||
| 9 | + {else} | ||
| 10 | + <span class="descriptiveText">{i18n}Location is no longer available{/i18n}</span> | ||
| 11 | + {/if} | ||
| 11 | 12 | ||
| 12 | - | <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 13 | + | |
| 14 | + </div> | ||
| 15 | + | ||
| 16 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 17 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 18 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 19 | + | ||
| 20 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 21 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}">{i18n}Clear Alert{/i18n}</a> | ||
| 13 | </div> | 22 | </div> |
| 14 | </dd> | 23 | </dd> |
templates/kt3/notifications/subscriptions.RemoveChildDocument.smarty
| @@ -3,11 +3,20 @@ | @@ -3,11 +3,20 @@ | ||
| 3 | <!-- could break this up. --> | 3 | <!-- could break this up. --> |
| 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" has been removed{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}from the folder "#location_name#"{/i18n} ({i18n}to which you are subscribed{/i18n}){/if}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. | 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" has been removed{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}from the folder "#location_name#"{/i18n} ({i18n}to which you are subscribed{/i18n}){/if}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. |
| 5 | <div class="actionoptions"> | 5 | <div class="actionoptions"> |
| 6 | - {if !$is_broken} | ||
| 7 | - <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Folder{/i18n}</a> | ||
| 8 | - {else} | ||
| 9 | - <span class="descriptiveText">{i18n}Folder is no longer available{/i18n}</span> | ||
| 10 | - {/if} | ||
| 11 | - | <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 6 | + <div style="float:left; position: relative;"> |
| 7 | + {if !$is_broken} | ||
| 8 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Folder{/i18n}</a> | ||
| 9 | + {else} | ||
| 10 | + <span class="descriptiveText">{i18n}Folder is no longer available{/i18n}</span> | ||
| 11 | + {/if} | ||
| 12 | + | | ||
| 13 | + </div> | ||
| 14 | + | ||
| 15 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 16 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 17 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 18 | + | ||
| 19 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 20 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}">{i18n}Clear Alert{/i18n}</a> | ||
| 12 | </div> | 21 | </div> |
| 13 | </dd> | 22 | </dd> |
templates/kt3/notifications/subscriptions.RemoveChildFolder.smarty
| @@ -3,12 +3,21 @@ | @@ -3,12 +3,21 @@ | ||
| 3 | <!-- could break this up. --> | 3 | <!-- could break this up. --> |
| 4 | {i18n arg_object_name=$info.object_name|sanitize}The folder "#object_name#" has been removed{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}from "#location_name#"{/i18n}{/if}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. | 4 | {i18n arg_object_name=$info.object_name|sanitize}The folder "#object_name#" has been removed{/i18n}{if ($info.location_name !== null)} {i18n arg_location_name=$info.location_name}from "#location_name#"{/i18n}{/if}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. |
| 5 | <div class="actionoptions"> | 5 | <div class="actionoptions"> |
| 6 | - {if !$is_broken} | ||
| 7 | - <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Folder{/i18n}</a> | ||
| 8 | - {else} | ||
| 9 | - <span class="descriptiveText">{i18n}Location is no longer available{/i18n}</span> | ||
| 10 | - {/if} | 6 | + <div style="float:left; position: relative;"> |
| 7 | + {if !$is_broken} | ||
| 8 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`"}">{i18n}View Folder{/i18n}</a> | ||
| 9 | + {else} | ||
| 10 | + <span class="descriptiveText">{i18n}Location is no longer available{/i18n}</span> | ||
| 11 | + {/if} | ||
| 11 | 12 | ||
| 12 | - | <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 13 | + | |
| 14 | + <div> | ||
| 15 | + | ||
| 16 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 17 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 18 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 19 | + | ||
| 20 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 21 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}">{i18n}Clear Alert{/i18n}</a> | ||
| 13 | </div> | 22 | </div> |
| 14 | </dd> | 23 | </dd> |
templates/kt3/notifications/subscriptions.RemoveSubscribedDocument.smarty
| @@ -3,6 +3,12 @@ | @@ -3,6 +3,12 @@ | ||
| 3 | <!-- could break this up. --> | 3 | <!-- could break this up. --> |
| 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" to which you were subscribed, has been removed{/i18n}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. | 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" to which you were subscribed, has been removed{/i18n}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. |
| 5 | <div class="actionoptions"> | 5 | <div class="actionoptions"> |
| 6 | - <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 6 | + |
| 7 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 8 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 9 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 10 | + | ||
| 11 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 12 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}">{i18n}Clear Alert{/i18n}</a> | ||
| 7 | </div> | 13 | </div> |
| 8 | </dd> | 14 | </dd> |
templates/kt3/notifications/subscriptions.RemoveSubscribedFolder.smarty
| @@ -3,6 +3,12 @@ | @@ -3,6 +3,12 @@ | ||
| 3 | <!-- could break this up. --> | 3 | <!-- could break this up. --> |
| 4 | {i18n arg_object_name=$info.object_name|sanitize}The folder "#object_name#" to which you were subscribed, has been removed{/i18n}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. | 4 | {i18n arg_object_name=$info.object_name|sanitize}The folder "#object_name#" to which you were subscribed, has been removed{/i18n}{if ($info.has_actor)} {i18n arg_actor_name=$info.actor_name}by #actor_name#{/i18n}{/if}. |
| 5 | <div class="actionoptions"> | 5 | <div class="actionoptions"> |
| 6 | - <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 6 | + |
| 7 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 8 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 9 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 10 | + | ||
| 11 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 12 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}">{i18n}Clear Alert{/i18n}</a> | ||
| 7 | </div> | 13 | </div> |
| 8 | </dd> | 14 | </dd> |
templates/kt3/notifications/subscriptions.RestoreDocument.smarty
| @@ -3,6 +3,12 @@ | @@ -3,6 +3,12 @@ | ||
| 3 | <!-- could break this up. --> | 3 | <!-- could break this up. --> |
| 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" has been restored by an administrator.{/i18n} | 4 | {i18n arg_object_name=$info.object_name|sanitize}The document "#object_name#" has been restored by an administrator.{/i18n} |
| 5 | <div class="actionoptions"> | 5 | <div class="actionoptions"> |
| 6 | - <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 6 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" |
| 7 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 8 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 9 | + | ||
| 10 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 11 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}">{i18n}Clear Alert{/i18n}</a> | ||
| 12 | + | ||
| 7 | </div> | 13 | </div> |
| 8 | </dd> | 14 | </dd> |
templates/kt3/notifications/subscriptions.generic.smarty
| 1 | <dt class="actionitem subscription">{$info.title|sanitize}</dt> | 1 | <dt class="actionitem subscription">{$info.title|sanitize}</dt> |
| 2 | <dd class="actionmessage"> | 2 | <dd class="actionmessage"> |
| 3 | <div class="actionoptions"> | 3 | <div class="actionoptions"> |
| 4 | - <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 4 | + |
| 5 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 6 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 7 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 8 | + | ||
| 9 | + <a href="{ktLink base="notify.php" query="id=`$info.notify_id`¬ify_action=clear"}" | ||
| 10 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}">{i18n}Clear Alert{/i18n}</a> | ||
| 5 | </div> | 11 | </div> |
| 6 | </dd> | 12 | </dd> |
templates/ktcore/assist/assist_notification.smarty
| @@ -4,11 +4,20 @@ | @@ -4,11 +4,20 @@ | ||
| 4 | user, <b>#user#</b>, has requested help on the document <b>#name#</b>, and you are | 4 | user, <b>#user#</b>, has requested help on the document <b>#name#</b>, and you are |
| 5 | the owner or an admin of this document.{/i18n} | 5 | the owner or an admin of this document.{/i18n} |
| 6 | <div class="actionoptions"> | 6 | <div class="actionoptions"> |
| 7 | - {if !$is_broken} | ||
| 8 | - <a href="{ktLink base="notify.php" query="id=`$notify_id`"}">{i18n}View Help Request{/i18n}</a> | ||
| 9 | - {else} | ||
| 10 | - <span class="descriptiveText">{i18n}Document is no longer available{/i18n}</span> | ||
| 11 | - {/if} | ||
| 12 | - | <a href="{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 7 | + <div style="float:left; position: relative;"> |
| 8 | + {if !$is_broken} | ||
| 9 | + <a href="{ktLink base="notify.php" query="id=`$notify_id`"}">{i18n}View Help Request{/i18n}</a> | ||
| 10 | + {else} | ||
| 11 | + <span class="descriptiveText">{i18n}Document is no longer available{/i18n}</span> | ||
| 12 | + {/if} | ||
| 13 | + | | ||
| 14 | + </div> | ||
| 15 | + | ||
| 16 | + <a href="{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"} | ||
| 17 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 18 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 19 | + | ||
| 20 | + <a href="{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"} | ||
| 21 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}"">{i18n}Clear Alert{/i18n}</a> | ||
| 13 | </div> | 22 | </div> |
| 14 | </dd> | 23 | </dd> |
templates/ktcore/assist/assist_notification_details.smarty
| @@ -12,7 +12,16 @@ | @@ -12,7 +12,16 @@ | ||
| 12 | </dl> | 12 | </dl> |
| 13 | 13 | ||
| 14 | <div class="actionoptions"> | 14 | <div class="actionoptions"> |
| 15 | - <a href="{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=view"}">{i18n}View Document{/i18n}</a> | ||
| 16 | - | <a href="{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"}">{i18n}Clear Alert{/i18n}</a> | 15 | + <div style="float:left; position: relative;"> |
| 16 | + <a href="{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=view"}">{i18n}View Document{/i18n}</a> | ||
| 17 | + | | ||
| 18 | + </div> | ||
| 19 | + | ||
| 20 | + <a href="{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"} | ||
| 21 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | ||
| 22 | + class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | ||
| 23 | + | ||
| 24 | + <a href="{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"} | ||
| 25 | + kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}"">{i18n}Clear Alert{/i18n}</a> | ||
| 17 | </div> | 26 | </div> |
| 18 | 27 |