Commit 4c617ce56305f6caae7028b2a4159896bdea19db

Authored by Neil Blakey-Milner
1 parent b08b869b

Remove more old document field management files.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3698 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/editDocFieldBL.php deleted
1 -<?php  
2 -/**  
3 - * $Id$  
4 - *  
5 - * Edit document field.  
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 Mukhtar Dharsey, Jam Warehouse (Pty) Ltd, South Africa  
25 - * @package administration.docfieldmanagement  
26 - */  
27 -/**  
28 -* BL information for adding a DocField  
29 -*  
30 -* @author Mukhtar Dharsey  
31 -* @date 5 February 2003  
32 -* @package presentation.lookAndFeel.knowledgeTree.  
33 -*  
34 -*/  
35 -require_once("../../../../../config/dmsDefaults.php");  
36 -  
37 -KTUtil::extractGPC('fDocFieldDataType', 'fDocFieldHasLookup', 'fDocFieldID', 'fDocFieldIsGeneric', 'fDocFieldName', 'fForStore');  
38 -  
39 -if (checkSession()) {  
40 - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc");  
41 - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternEditableListFromQuery.inc");  
42 - require_once("editDocFieldUI.inc");  
43 - require_once("$default->fileSystemRoot/lib/security/Permission.inc");  
44 - require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentField.inc");  
45 - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");  
46 - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");  
47 - require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc");  
48 - require_once("$default->fileSystemRoot/presentation/Html.inc");  
49 -  
50 - $oPatternCustom = & new PatternCustom();  
51 -  
52 - if (isset($fForStore)) {  
53 -  
54 - $oDocField = DocumentField::get($fDocFieldID);  
55 - $oDocField->setName($fDocFieldName);  
56 - $oDocField->setDataType($fDocFieldDataType);  
57 -  
58 - //check if checkbox checked || hidden value  
59 - if ($fDocFieldIsGeneric) {  
60 - $oDocField->setIsGeneric(true);  
61 - } else {  
62 - $oDocField->setIsGeneric(false);  
63 - }  
64 - //check if checkbox checked  
65 - if (isset($fDocFieldHasLookup)) {  
66 - $oDocField->setHasLookup(true);  
67 - } else {  
68 - $oDocField->setHasLookup(false);  
69 - }  
70 - if ($oDocField->update()) {  
71 -  
72 - // if we're setting lookup to be true, then prompt for an initial lookup value??  
73 - if (isset($fDocFieldHasLookup)) {  
74 - // and there are no metadata values for this lookup  
75 - if (DocumentField::getLookupCount($fDocFieldID) == 0) {  
76 - // then redirect to the edit metadata page  
77 - controllerRedirect("addMetaDataForField", "fDocFieldID=$fDocFieldID");  
78 - exit;  
79 - }  
80 - }  
81 - // otherwise, go to the list page  
82 - controllerRedirect("listDocFields", "");  
83 - } else {  
84 - // if fail print out fail message  
85 - $oPatternCustom->setHtml(getEditPageFail());  
86 - }  
87 - } else if (isset($fDocFieldID)){  
88 - // post back on DocField select from manual edit page  
89 - $oPatternCustom->setHtml(getEditPage($fDocFieldID));  
90 - $sFormAction = $_SERVER["PHP_SELF"] . "?fForStore=1";  
91 - } else {  
92 - // if nothing happens...just reload edit page  
93 - $oPatternCustom->setHtml(getEditPage(null));  
94 - $sFormAction = $_SERVER["PHP_SELF"];  
95 - }  
96 -  
97 - //render the page  
98 - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");  
99 - $main->setFormAction($sFormAction);  
100 - $main->setCentralPayload($oPatternCustom);  
101 - $main->setHasRequiredFields(true);  
102 - $main->render();  
103 -}  
104 -?>  
presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/editDocFieldLookupsBL.php deleted
1 -<?php  
2 -/**  
3 - * $Id$  
4 - *  
5 - * Edit document field lookups.  
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 Mukhtar Dharsey, Jam Warehouse (Pty) Ltd, South Africa  
25 - * @package administration.docfieldmanagement  
26 - */  
27 -  
28 -require_once("../../../../../config/dmsDefaults.php");  
29 -  
30 -KTUtil::extractGPC('fDocFieldID');  
31 -  
32 -if (checkSession()) {  
33 - require_once("editDocFieldLookupsUI.inc");  
34 - require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentField.inc");  
35 - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");  
36 - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");  
37 -  
38 - $oPatternCustom = & new PatternCustom();  
39 -  
40 - if(isset($fDocFieldID)) {  
41 - $oDocField = DocumentField::get($fDocFieldID);  
42 - if ($oDocField->getHasLookup()){  
43 - // do a check to see both drop downs selected  
44 - $oPatternCustom->setHtml(getPage($oDocField));  
45 - } else {  
46 - $_SESSION["KTErrorMessage"][] = _("Document Field is not Lookup enabled.");  
47 - exit(controllerRedirect("listDocFields"));  
48 - }  
49 - } else {  
50 - $_SESSION["KTErrorMessage"][] = _("No document field lookup selected");  
51 - exit(controllerRedirect("listDocFields"));  
52 - }  
53 -  
54 - // render page  
55 - $main->setCentralPayload($oPatternCustom);  
56 - $main->render();  
57 -}  
58 -?>  
presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/editDocFieldLookupsUI.inc deleted
1 -<?php  
2 -/**  
3 - * $Id$  
4 - *  
5 - * Edit document field lookups UI functions  
6 - *  
7 - * Copyright (c) 2003, 2005 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 Mukhtar Dharsey, Jam Warehouse (Pty) Ltd, South Africa  
25 - * @package administration.docfieldmanagement  
26 - */  
27 -  
28 -require_once("$default->fileSystemRoot/presentation/Html.inc");  
29 -  
30 -function getPage($oDocField) {  
31 - global $default;  
32 -  
33 - $iDocFieldID = $oDocField->getID();  
34 -  
35 - $LookupDisplay .= "<b>" . _("Current Lookups") . "</b><br>\n";  
36 - $sQuery = array("SELECT * FROM " . $default->metadata_table .  
37 - " WHERE document_field_id = ?",  
38 - array($iDocFieldID));  
39 -  
40 - $aColumns = array("name");  
41 - $aColumnNames = array(_("Lookup name"));  
42 - $aColumnTypes = array(1);  
43 - $aDBColumnArray = array("id");  
44 - $aQueryStringVariableNames = array("fDocFieldLookupID");  
45 -  
46 - $oSearchResults = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL,$aDBColumnArray,$aQueryStringVariableNames);  
47 - $oSearchResults->setEmptyTableMessage("<font color=\"red\">" . _("You must enter at least one value!") . "</font>");  
48 - $LookupDisplay .= $oSearchResults->render() ;  
49 -  
50 - $sFontTag .= "<font face=\"Arial\" color=\"#0066cc\">";  
51 - $sTableTag .= "<table width=100% border=0 cellspacing=0>";  
52 - $sBgColor = "#F5F6EE";  
53 -  
54 - $sToRender .= renderHeading(_("Edit Document Field Lookups"));  
55 -  
56 - $sToRender .= "<table width=\"600\" border=0>";  
57 - $sToRender .= "<tr><td width=100%><br><b>" . _("Field Name") . ": &nbsp;</b>" . $oDocField->getName() . "<br><br></td><td>";  
58 - $sToRender .= "<a href=\"$default->rootUrl/control.php?action=listDocFields\"><img src =\"" . KTHtml::getBackButton() . "\" border = \"0\" /></a>";  
59 -  
60 - $sToRender .= "</td></tr>\n";  
61 - $sToRender .= "</table>";  
62 -  
63 - $sToRender .= "<table width=\"600\" border=0 ><tr><td>";  
64 - $sToRender .= "<table border=0 >";  
65 -  
66 - $sToRender .= "<tr ><td valign=top>" . $LookupDisplay . "</td></tr>\n";  
67 - $sToRender .= "<tr><td height=130><br></td></tr>\n";  
68 - $sToRender .= "</table>";  
69 -  
70 - $sToRender .= "</td><td valign=top>\n";  
71 -  
72 - $sToRender .= "<table border=0 cellspacing=1>\n";  
73 - $sToRender .= "<tr><td><b>Options</b></td></tr>";  
74 - $sToRender .= "<tr><td width=200 bgcolor=$sBgColor>";  
75 - $sToRender .= "<br><a href=\"$default->rootUrl/control.php?action=addMetaDataForField&fDocFieldID=$iDocFieldID\">&nbsp;&nbsp;" . _("Add Document Field Lookups") . "</a><br><br>";  
76 - $sToRender .= "</td><td>";  
77 - $sToRender .= "</td></tr>";  
78 -  
79 - $iDocFieldLookupCount = DocumentField::getLookupCount($iDocFieldID);  
80 - if ($iDocFieldLookupCount > 0) {  
81 -  
82 - $sToRender .= "<tr><td width=200 bgcolor=$sBgColor>";  
83 - $sToRender .= "<br><a href=\"$default->rootUrl/control.php?action=editMetadataForField&fDocFieldID=$iDocFieldID\">&nbsp;&nbsp;" . _("Edit Document Field Lookups") . "</a><br><br>";  
84 - $sToRender .= "</td><td>";  
85 - $sToRender .= "</td></tr>";  
86 -  
87 - $sToRender .= "<tr><td width=200 bgcolor=$sBgColor>";  
88 - $sToRender .= "<br><a href=\"$default->rootUrl/control.php?action=removeMetaDataFromField&fDocFieldID=$iDocFieldID\">&nbsp;&nbsp;" . _("Remove Document Field Lookups") . "</a><br><br>";  
89 - $sToRender .= "</td><td>";  
90 - $sToRender .= "</td></tr>";  
91 - }  
92 - $sToRender .= "</table>\n";  
93 -  
94 - $sToRender .= "</td></tr>";  
95 - $sToRender .= "</table>\n";  
96 -  
97 - return $sToRender;  
98 -}  
99 -  
100 -?>  
presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/editDocFieldUI.inc deleted
1 -<?php  
2 -/**  
3 - * $Id$  
4 - *  
5 - * Edit document field UI functions.  
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 Mukhtar Dharsey, Jam Warehouse (Pty) Ltd, South Africa  
25 - * @package administration.docfieldmanagement  
26 - */  
27 -  
28 -// if its the manual edit page..then display normally  
29 -function getEditPage($iDocFieldID) {  
30 - global $default;  
31 - $oDocField = null;  
32 - if (isset($iDocFieldID)) {  
33 - $oDocField = DocumentField::get($iDocFieldID);  
34 - $checkBox = $oDocField->isFieldLinkedToType();  
35 - $aDataTypes = $oDocField->getAllDataTypes();  
36 - $currentDataType = $oDocField->getDataType();  
37 - }  
38 -  
39 - $sToRender .= renderHeading(_("Edit Document Field"));  
40 - $sToRender .= "<table>\n";  
41 - $sToRender .= "<tr></tr>\n";  
42 - $sToRender .= "<tr>\n";  
43 - $sToRender .= "<td>" . _("Document Field Name:") . " </td><td>" . getDocFieldDisplay($oDocField) . "</td>\n";  
44 - $sToRender .= "</tr>\n";  
45 - $sToRender .= "<tr>\n";  
46 - $sToRender .= "</tr>\n";  
47 - $sToRender .= "<tr>\n";  
48 -  
49 - // if a DocField selected...show checkboxes  
50 - if (isset($iDocFieldID)) {  
51 - $sToRender .= "</tr>\n";  
52 - $sToRender .= "<tr>\n";  
53 - $sToRender .= "<td>" . _("Data Type") . ": </td><td>" . getDataTypesList($aDataTypes, $currentDataType ) . "</td>\n";  
54 - $sToRender .= "</tr>\n";  
55 - $sToRender .= "<tr>\n";  
56 -  
57 - // allow changing the generic status if the field is not linked to a document type  
58 - // and if this isn't the category field  
59 - if ( ($checkBox == false) && $oDocField->getName() != "Category") {  
60 - $sToRender .= "<td>" . _("Is Generic") . ": </td><td>" . getIsGenericCheckBox($oDocField) . "</td>\n";  
61 - } else {  
62 - $sToRender .= "<input type=\"hidden\" name=\"fDocFieldIsGeneric\" value=\"" . $oDocField->getIsGeneric() . "\">\n";  
63 - }  
64 -  
65 - $sToRender .= "</tr>\n";  
66 - $sToRender .= "<tr>\n";  
67 - $sToRender .= "<td>" . _("Has MetaData Lookup:") . " </td><td>" . getHasLookupCheckBox($oDocField) . "</td>\n";  
68 - $sToRender .= "</tr>\n";  
69 - $sToRender .= "<tr>\n";  
70 - $sToRender .= "</tr>\n";  
71 - }  
72 -  
73 -  
74 - $sToRender .= "<tr>\n";  
75 - $sToRender .= "</tr>\n";  
76 - $sToRender .= "<td></td>" . getUpdateButton($oDocField);  
77 - $sToRender .= getCancelButton($oDocField);  
78 - $sToRender .= "</table>\n";  
79 -  
80 - $sToRender .= "\n\n<script language=\"javascript\">\n<!--\n";  
81 - $sToRender .= "function validateForm(theForm) {\n";  
82 - $sToRender .= "\tif (!(validRequired(theForm.fDocFieldName, 'Document Field Name'))) {\n";  
83 - $sToRender .= "\t\treturn false;\n";  
84 - $sToRender .= "\t}\n";  
85 - $sToRender .= "return true;\n}\n";  
86 - $sToRender .= "//-->\n</script>\n\n";  
87 -  
88 - return $sToRender;  
89 -}  
90 -  
91 -// if edition is successful print otu success page  
92 -function getEditPageSuccess() {  
93 - global $default;  
94 -  
95 - $sToRender .= renderHeading(_("Edit Document Field"));  
96 - $sToRender .= "<b>" . _("Success") . "!</b>\n";  
97 - $sToRender .= "<table>\n";  
98 - $sToRender .= "<br></br>\n";  
99 - $sToRender .= "<tr></tr>\n";  
100 - $sToRender .= "<tr><td>" . _("The Document Field was successfully modified") . "</td></tr>\n";  
101 - $sToRender .= "<tr></tr>\n";  
102 - $sToRender .= "<tr></tr>\n";  
103 - $sToRender .= "<tr>\n";  
104 - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=listDocFields\"><img src =\"" . KTHtml::getBackButton() . "\" border = \"0\" /></a></td>\n";  
105 - $sToRender .= "</tr>\n";  
106 - $sToRender .= "</table>\n";  
107 -  
108 - return $sToRender;  
109 -}  
110 -  
111 -  
112 -// gets the page if edition fails  
113 -function getEditPageFail() {  
114 - global $default;  
115 -  
116 - $sToRender .= renderHeading(_("Edit Document Field"));  
117 - $sToRender .= "<b>" . strtoupper(_("Failure")) . "!</b>\n";  
118 - $sToRender .= "<table>\n";  
119 - $sToRender .= "<br></br>\n";  
120 - $sToRender .= "<tr></tr>\n";  
121 - $sToRender .= "<tr><td>" . _("The Document Field modification Failed!") . "</td></tr>\n";  
122 - $sToRender .= "<tr></tr>\n";  
123 - $sToRender .= "<tr></tr>\n";  
124 - $sToRender .= "<tr>\n";  
125 - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=listDocFields\"><img src =\"" . KTHtml::getBackButton() . "\" border = \"0\" /></a></td>\n";  
126 - $sToRender .= "</tr>\n";  
127 - $sToRender .= "</table>\n";  
128 -  
129 - return $sToRender;  
130 -}  
131 -  
132 -// show the list box when no DocField selected  
133 -// then shows a text box with the DocField's name  
134 -function getDocFieldDisplay($oDocField) {  
135 - global $default;  
136 - if (!isset($oDocField)) {  
137 - $oPatternListBox = & new PatternListBox($default->document_fields_table, "name", "id", "fDocFieldID");  
138 - $oPatternListBox->setPostBackOnChange(true);  
139 - return $oPatternListBox->render();  
140 - } else {  
141 - $sToRender .= "<input type=\"hidden\" name=\"fDocFieldID\" value=\"" . $oDocField->iId . "\">\n";  
142 - if ($oDocField->getName() == "Category") {  
143 - $sToRender .= "<input type=\"hidden\" name=\"fDocFieldName\" value=\"" . $oDocField->getName() . "\">\n";  
144 - $sToRender .= $oDocField->getName();  
145 - } else {  
146 - $sToRender .= "<input size=\"40\" type=\"text\" name=\"fDocFieldName\" value=\"" . $oDocField->getName() . "\">";  
147 - }  
148 - return $sToRender;  
149 - }  
150 -}  
151 -  
152 -// show Group details on confirm deletion page  
153 -function getDataTypesList($aDataTypes, $sCurrent) {  
154 - global $default;  
155 -  
156 - $sDataype = "<Select Name=\"fDocFieldDataType\">";  
157 -  
158 - for ($i=0;$i < count($aDataTypes);$i++) {  
159 -  
160 - if($aDataTypes[$i]["name"] == $sCurrent) {  
161 - $Options .= "<OPTION value= \"". $aDataTypes[$i]["name"]. "\" SELECTED>". $aDataTypes[$i]["name"] ."</OPTION>\n";  
162 - } else {  
163 - // $oDocField= DocField::get($aAllSpecific[$i]["id"]);  
164 - $Options .= "<OPTION value= \"". $aDataTypes[$i]["name"] . "\">". $aDataTypes[$i]["name"] ."</OPTION>\n";  
165 - }  
166 - }  
167 - $sDataype .= $Options . "</SELECT>";  
168 - return $sDataype;  
169 -}  
170 -  
171 -  
172 -// returns the checkbox ticked or unticked  
173 -function getIsGenericCheckBox($oDocField) {  
174 - if (!isset($oDocField)) {  
175 - return "";  
176 - } else {  
177 - return "<input type=\"checkbox\" name=\"fDocFieldIsGeneric\" " . ($oDocField->getIsGeneric() ? "CHECKED " : " ") . " />";  
178 - }  
179 -}  
180 -  
181 -// returns the checkbox ticked or unticked  
182 -function getHasLookupCheckBox($oDocField) {  
183 - if (!isset($oDocField)) {  
184 - return "";  
185 - } else {  
186 - return "<input type=\"checkbox\" name=\"fDocFieldHasLookup\" " . ($oDocField->getHasLookup() ? "CHECKED " : " ") . " />";  
187 - }  
188 -  
189 -}  
190 -  
191 -// gets the updatebutton when a DocField is selected  
192 -function getUpdateButton($oDocField) {  
193 - global $default;  
194 - if (!isset($oDocField)) {  
195 - return _("Please select a Document Field:") . " ";  
196 - } else {  
197 - return "<td align = right><input type=\"image\" src =\"" . KTHtml::getUpdateButton() . "\" value=\"submit\" border=\"0\"/></td>\n";  
198 - }  
199 -}  
200 -  
201 -// gets the cancel button when a DocField is selected  
202 -function getCancelButton($oDocField) {  
203 - global $default;  
204 - if (!isset($oDocField)) {  
205 - return "<td align = right><a href=\"$default->rootUrl/control.php?action=docfield\"><img src =\"" . KTHtml::getCancelButton() . "\" value=\"cancel\" border=\"0\"/></a></td>\n";  
206 - }  
207 - else {  
208 - return "<td align = right><a href=\"$default->rootUrl/control.php?action=listDocFields\"><img src =\"" . KTHtml::getCancelButton() . "\" border=\"0\" /></a></td>\n";  
209 - }  
210 -}  
211 -?>