Commit 906466c3df1635911f57f4eeba9f54cbab5f0769

Authored by Neil Blakey-Milner
1 parent 4866cd8e

Remove obsolete long-unused files.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4148 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/foldermanagement/deleteFolderDocTypeBL.php deleted
1 -<?php  
2 -/**  
3 - * $Id$  
4 - *  
5 - * Business logic for removing a document type from a folder.  
6 - *  
7 - * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com  
8 - *  
9 - * This program is free software; you can redistribute it and/or modify  
10 - * it under the terms of the GNU General Public License as published by  
11 - * the Free Software Foundation; either version 2 of the License, or  
12 - * (at your option) any later version.  
13 - *  
14 - * This program is distributed in the hope that it will be useful,  
15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
17 - * GNU General Public License for more details.  
18 - *  
19 - * You should have received a copy of the GNU General Public License  
20 - * along with this program; if not, write to the Free Software  
21 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  
22 - *  
23 - * @version $Revision$  
24 - * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
25 - * @package foldermanagement  
26 - */  
27 -  
28 -require_once("../../../../config/dmsDefaults.php");  
29 -  
30 -KTUtil::extractGPC('fFolderDocTypeID', 'fFolderID');  
31 -  
32 -if (checkSession()) {  
33 - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");  
34 - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");  
35 - require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");  
36 - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc");  
37 - require_once("$default->fileSystemRoot/lib/foldermanagement/FolderDocTypeLink.inc");  
38 - require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc");  
39 - require_once("$default->fileSystemRoot/presentation/Html.inc");  
40 - require_once("deleteFolderDocTypeUI.inc");  
41 -  
42 - $oPatternCustom = & new PatternCustom();  
43 -  
44 - $oFolder = Folder::get($fFolderID);  
45 - if (Permission::userHasFolderWritePermission($oFolder)) {  
46 - //user has permission to delete  
47 - if (isset($fFolderDocTypeID)) {  
48 - //the required variables exist  
49 -  
50 - if (Document::documentIsAssignedDocTypeInFolder($fFolderID, $fFolderDocTypeID)) {  
51 - //there is a document in the folder assigned this type, so  
52 - //it may not be deleted  
53 - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");  
54 - $oPatternCustom->setHtml(getPage($fFolderID));  
55 - $main->setCentralPayload($oPatternCustom);  
56 - $main->setErrorMessage(_("A document in this folder is currently assigned this type. You may not delete it."));  
57 - $main->render();  
58 - } else if (count(FolderDocTypeLink::getList(array("folder_id = ?", $fFolderID))) == 1) {/*ok*/  
59 - // there is only one document type mapped to this folder- not allowed to delete the last one  
60 - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");  
61 - $oPatternCustom->setHtml(getPage($fFolderID));  
62 - $main->setCentralPayload($oPatternCustom);  
63 - $main->setErrorMessage(_("You may not delete the last document type for this folder."));  
64 - $main->render();  
65 - } else {  
66 - //go ahead and delete  
67 - $oFolderDocTypeLink = FolderDocTypeLink::get($fFolderDocTypeID);  
68 - if ($oFolderDocTypeLink->delete()) {  
69 - controllerRedirect("editFolder", "fFolderID=$fFolderID&fShowSection=documentTypes");  
70 - } else {  
71 - //there was a problem deleting from the database  
72 - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");  
73 - $oPatternCustom->setHtml(getPage($fFolderID));  
74 - $main->setCentralPayload($oPatternCustom);  
75 - $main->setErrorMessage(_("An error was encountered while attempting to delete this link from the database"));  
76 - $main->render();  
77 - }  
78 - }  
79 - }  
80 - } else {  
81 - //user does not have permission to delete this document type  
82 - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");  
83 - $oPatternCustom->setHtml(getPage($fFolderID));  
84 - $main->setCentralPayload($oPatternCustom);  
85 - $main->setErrorMessage(_("You do not have permission to remove this document type from this folder"));  
86 - $main->render();  
87 - }  
88 -}  
89 -?>  
presentation/lookAndFeel/knowledgeTree/foldermanagement/deleteFolderDocTypeUI.inc deleted
1 -<?php  
2 -/**  
3 - * $Id$  
4 - *  
5 - * Presentation information used by deleteFolderDocTypeUI.inc.  
6 - *  
7 - * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com  
8 - *  
9 - * This program is free software; you can redistribute it and/or modify  
10 - * it under the terms of the GNU General Public License as published by  
11 - * the Free Software Foundation; either version 2 of the License, or  
12 - * (at your option) any later version.  
13 - *  
14 - * This program is distributed in the hope that it will be useful,  
15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
17 - * GNU General Public License for more details.  
18 - *  
19 - * You should have received a copy of the GNU General Public License  
20 - * along with this program; if not, write to the Free Software  
21 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  
22 - *  
23 - * @version $Revision$  
24 - * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
25 - * @package foldermanagement  
26 - */  
27 -  
28 -function getPage($iFolderID) {  
29 - global $default;  
30 - $sToRender = "<table border=\"0\" width=\"100%\">\n";  
31 - $sToRender .= "<tr>\n";  
32 - $sToRender .= "\t<td>" . renderFolderPath($iFolderID, generateControllerUrl("editFolder", "fFolderID=$iFolderID&fShowSection=documentTypes", false), false) . "</td>\n";  
33 - $sToRender .= "</tr>\n";  
34 - $sToRender .= "</table>\n";  
35 - $sToRender .= "<table border=\"0\">\n";  
36 - $sToRender .= "<tr>\n";  
37 - $sToRender .= "<td>" . generateControllerLink("editFolder", "fFolderID=$iFolderID&fShowSection=documentTypes", "<img src=\"" . KTHtml::getBackButton() . "\" border=\"0\">") . "</td>\n";  
38 - $sToRender .= "</tr>\n";  
39 - $sToRender .= "</table><br>\n";  
40 -  
41 - return $sToRender;  
42 -}  
43 -  
44 -?>