Commit 82afb9d8afc4fcefc270807571fc848b53d118db

Authored by nbm
1 parent 5d81f168

Remove old archive document page.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4098 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/archiving/archiveDocumentBL.php deleted
1 -<?php  
2 -  
3 -require_once("../../../../../config/dmsDefaults.php");  
4 -  
5 -KTUtil::extractGPC('fConfirmed', 'fDocumentID');  
6 -  
7 -require_once("$default->fileSystemRoot/lib/archiving/DocumentArchiveSettingsFactory.inc");  
8 -require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");  
9 -require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionEngine.inc");  
10 -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternMainPage.inc");  
11 -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");  
12 -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc");  
13 -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc");  
14 -require_once("$default->fileSystemRoot/presentation/Html.inc");  
15 -require_once("$default->uiDirectory/documentmanagement/documentUI.inc");  
16 -require_once("$default->uiDirectory/foldermanagement/folderUI.inc");  
17 -require_once("$default->uiDirectory/documentmanagement/archiving/archiveSettingsUI.inc");  
18 -/**  
19 - * $Id$  
20 - *  
21 - * Business logic for archiving a document.  
22 - *  
23 - * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com  
24 - *  
25 - * This program is free software; you can redistribute it and/or modify  
26 - * it under the terms of the GNU General Public License as published by  
27 - * the Free Software Foundation; either version 2 of the License, or  
28 - * (at your option) any later version.  
29 - *  
30 - * This program is distributed in the hope that it will be useful,  
31 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
32 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
33 - * GNU General Public License for more details.  
34 - *  
35 - * You should have received a copy of the GNU General Public License  
36 - * along with this program; if not, write to the Free Software  
37 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  
38 - *  
39 - * @version $Revision$  
40 - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa  
41 - * @package documentmanagement.archiving  
42 - */  
43 -  
44 -if (checkSession()) {  
45 - global $default;  
46 -  
47 - // instantiate my content pattern  
48 - $oContent = new PatternCustom();  
49 -  
50 - if ($fDocumentID) {  
51 - if ($fConfirmed) {  
52 - $oDocument = Document::get($fDocumentID);  
53 - if ($oDocument) {  
54 - // change the document status to archived  
55 - $oDocument->setStatusID(ARCHIVED);  
56 -  
57 - if ($oDocument->update()) {  
58 - $default->log->info("archiveDocumentBL.php successfully archived document id $fDocumentID");  
59 -  
60 - // fire subscription alerts for the archived document  
61 - $count = SubscriptionEngine::fireSubscription($fDocumentID, SubscriptionConstants::subscriptionAlertType("ArchivedDocument"),  
62 - SubscriptionConstants::subscriptionType("DocumentSubscription"),  
63 - array( "folderID" => $oDocument->getFolderID(),  
64 - "modifiedDocumentName" => $oDocument->getName()));  
65 - $default->log->info("archiveDocumentBL.php fired $count subscription alerts for archived document " . $oDocument->getName());  
66 -  
67 - // redirect to folder browse  
68 - redirect("$default->rootUrl/control.php?action=browse&fBrowseType=folder&fFolderID=" . $oDocument->getFolderID());  
69 - } else {  
70 - // error  
71 - $default->log->error("archiveDocumentBL.php error archiving document id $fDocumentID");  
72 - // display form with error  
73 - $oContent->setHtml(renderArchiveDocumentPage(null, "The archive settings for this document could not be updated"));  
74 - }  
75 - } else {  
76 - $default->log->error("archiveDocumentBL.php couldn't retrieve document id $fDocumentID from the db");  
77 - // display page with error?  
78 - }  
79 - } else {  
80 - // display the confirmation form  
81 - $oContent->setHtml(renderArchiveConfirmationPage($fDocumentID));  
82 - }  
83 - } else {  
84 - // error- no document reference  
85 - $oContent->setHtml(renderArchiveConfirmationPage(null, _("No document supplied for archiving")));  
86 - }  
87 -  
88 - // build the page  
89 - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");  
90 - $main->setCentralPayload($oContent);  
91 - $main->setFormAction($_SERVER['PHP_SELF']);  
92 - $main->setHasRequiredFields(true);  
93 - $main->render();  
94 -}  
95 -?>