Commit 37bc6b786755d346c7157db12d7649c0f4832ad1
1 parent
b05bca4d
removed old link-type admin code.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4089 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
9 changed files
with
0 additions
and
775 deletions
presentation/lookAndFeel/knowledgeTree/administration/doclinkmanagement/addLinkTypeBL.php deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * Add a document link type | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 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 Neil Blakey-Milner, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - */ | ||
| 26 | - | ||
| 27 | -require_once("../../../../../config/dmsDefaults.php"); | ||
| 28 | - | ||
| 29 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc"); | ||
| 30 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | ||
| 31 | - | ||
| 32 | -require_once("$default->fileSystemRoot/presentation/Html.inc"); | ||
| 33 | -require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/administration/adminUI.inc"); | ||
| 34 | -require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | ||
| 35 | - | ||
| 36 | -require_once("$default->fileSystemRoot/lib/documentmanagement/LinkType.inc"); | ||
| 37 | -require_once("addLinkTypeUI.inc"); | ||
| 38 | - | ||
| 39 | -if (!checkSession()) { | ||
| 40 | - die("Session failed"); | ||
| 41 | -} | ||
| 42 | - | ||
| 43 | -KTUtil::extractGPC('fLinkID'); | ||
| 44 | - | ||
| 45 | -if ($submitted) { | ||
| 46 | - // include the page template (with navbar) | ||
| 47 | - | ||
| 48 | - $sToRender = renderHeading(_("Add Link Type")); | ||
| 49 | - $sToRender .= "<TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\">\n"; | ||
| 50 | - $sToRender .= "<tr>\n"; | ||
| 51 | - if ($fLinkID != -1) { | ||
| 52 | - $sToRender .= "<td><b>" . _("New Link Type Added SuccessFully") . "!<b></td></tr>\n"; | ||
| 53 | - } else { | ||
| 54 | - $sToRender .= "<td><b>" . _("Addition Unsuccessful") . "</b>...</td>\n"; | ||
| 55 | - $sToRender .= "</tr>\n"; | ||
| 56 | - $sToRender .= "<tr></tr>\n"; | ||
| 57 | - $sToRender .= "<tr></tr>\n"; | ||
| 58 | - $sToRender .= "<tr>\n"; | ||
| 59 | - $sToRender .= "<td>Please Check Name and Rank for duplicates!</td>\n"; | ||
| 60 | - $sToRender .= "</tr>\n"; | ||
| 61 | - $sToRender .= "<tr>\n"; | ||
| 62 | - $sToRender .="<td> </td>\n"; | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - $sToRender .= "<tr></tr>\n"; | ||
| 66 | - $sToRender .= "<tr></tr>\n"; | ||
| 67 | - $sToRender .= "<tr></tr>\n"; | ||
| 68 | - $sToRender .= "<tr></tr>\n"; | ||
| 69 | - $sToRender .= "<tr>\n"; | ||
| 70 | - $sToRender .= "<td align = right><a href=\"$default->rootUrl/control.php?action=addLinkType\">" . KTHtml::getBackButton() . "</a></td>\n"; | ||
| 71 | - $sToRender .= "</tr>\n"; | ||
| 72 | - $sToRender .= "</table>\n"; | ||
| 73 | - | ||
| 74 | - $oPatternCustom = & new PatternCustom(); | ||
| 75 | - $oPatternCustom->setHtml($sToRender); | ||
| 76 | - $main->setCentralPayload($oPatternCustom); | ||
| 77 | - $main->render(); | ||
| 78 | -} else { | ||
| 79 | - $oPatternCustom = & new PatternCustom(); | ||
| 80 | - $oPatternCustom->setHtml(getPage()); | ||
| 81 | - $main->setCentralPayload($oPatternCustom); | ||
| 82 | - $main->setFormAction("$default->rootUrl/presentation/lookAndFeel/knowledgeTree/create.php?fRedirectURL=".urlencode("$default->rootUrl/control.php?action=addLinkTypeSuccess&fLinkID=")); | ||
| 83 | - $main->setHasRequiredFields(true); | ||
| 84 | - $main->render(); | ||
| 85 | -} | ||
| 86 | - | ||
| 87 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/doclinkmanagement/addLinkTypeSuccess.php deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * Add a document link type success page. | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 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 Neil Blakey-Milner, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - */ | ||
| 26 | - | ||
| 27 | -require_once("../../../../../config/dmsDefaults.php"); | ||
| 28 | - | ||
| 29 | -require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | ||
| 30 | - | ||
| 31 | -KTUtil::extractGPC('fLinkID'); | ||
| 32 | - | ||
| 33 | -if(checkSession()) { | ||
| 34 | - | ||
| 35 | - // include the page template (with navbar) | ||
| 36 | - $Center .= renderHeading(_("Add Link Type")); | ||
| 37 | - $Center .= "<TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\">\n"; | ||
| 38 | - $Center .= "<tr>\n"; | ||
| 39 | - if ($fLinkID != -1) { | ||
| 40 | - $Center .= "<td><b>" . _("New Link Type Added Successfully") . "!<b></td></tr>\n"; | ||
| 41 | - } else { | ||
| 42 | - $Center .= "<td><b>" . _("Addition Unsuccessful") . "</b>...</td>\n"; | ||
| 43 | - $Center .= "</tr>\n"; | ||
| 44 | - $Center .= "<tr></tr>\n"; | ||
| 45 | - $Center .= "<tr></tr>\n"; | ||
| 46 | - $Center .= "<tr>\n"; | ||
| 47 | - $Center .= "<td>Please Check Name and Rank for duplicates!</td>\n"; | ||
| 48 | - $Center .= "</tr>\n"; | ||
| 49 | - $Center .= "<tr>\n"; | ||
| 50 | - $Center .="<td> </td>\n"; | ||
| 51 | - } | ||
| 52 | - | ||
| 53 | - $Center .= "<tr></tr>\n"; | ||
| 54 | - $Center .= "<tr></tr>\n"; | ||
| 55 | - $Center .= "<tr></tr>\n"; | ||
| 56 | - $Center .= "<tr></tr>\n"; | ||
| 57 | - $Center .= "<tr>\n"; | ||
| 58 | - $Center .= "<td align = right><a href=\"$default->rootUrl/control.php?action=addLinkType\"><img src=\"" . KTHtml::getBackButton() . "\" border = \"0\" /></a></td>\n"; | ||
| 59 | - $Center .= "</tr>\n"; | ||
| 60 | - $Center .= "</table>\n"; | ||
| 61 | - | ||
| 62 | - $oPatternCustom = & new PatternCustom(); | ||
| 63 | - $oPatternCustom->setHtml($Center); | ||
| 64 | - $main->setCentralPayload($oPatternCustom); | ||
| 65 | - $main->render(); | ||
| 66 | -} | ||
| 67 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/doclinkmanagement/addLinkTypeUI.inc deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * Add a document link type UI functions. | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 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 Neil Blakey-Milner, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - */ | ||
| 26 | -// get add pages | ||
| 27 | -function getPage() { | ||
| 28 | - | ||
| 29 | - global $default; | ||
| 30 | - | ||
| 31 | - $aDisplayRowNames = array(_("Name") . ":", _("Description") . ":"); | ||
| 32 | - $aParameterNumbers = array(0,1); | ||
| 33 | - $aDisplayColumnTypes = array(1,1); | ||
| 34 | - $aRequired = array(1,1); | ||
| 35 | - | ||
| 36 | - // create a text field that is required | ||
| 37 | - $oPatternCreate = & new PatternCreate("LinkType", "documentmanagement/LinkType.inc",$aDisplayRowNames, $aParameterNumbers, $aDisplayColumnTypes, $aRequired); | ||
| 38 | - $oPatternCreate->setUniqueName("linktype"); | ||
| 39 | - | ||
| 40 | - $sToRender .= renderHeading(_("Add Link Type")); | ||
| 41 | - $sToRender .= "<table>\n"; | ||
| 42 | - $sToRender .= "<tr>\n"; | ||
| 43 | - $sToRender .= "<tr>\n"; | ||
| 44 | - $sToRender .= "<td>" . $oPatternCreate->render() . "</td>\n"; | ||
| 45 | - $sToRender .= "</tr>\n"; | ||
| 46 | - $sToRender .= "<tr>\n"; | ||
| 47 | - $sToRender .= "</tr>\n"; | ||
| 48 | - $sToRender .= "<tr><td align = right><input type=\"image\" src =\"" . KTHtml::getAddButton() . "\" value=\"Submit\" border=\"0\"/>"; | ||
| 49 | - $sToRender .= getCancelButton("listLinkTypes") . "</td>\n"; | ||
| 50 | - $sToRender .= "</table>\n"; | ||
| 51 | - | ||
| 52 | - return $sToRender; | ||
| 53 | -} | ||
| 54 | - | ||
| 55 | - // TODO .. do a check if rank already taken...as well as do a check if name already exists when inserting | ||
| 56 | - // if edition is successful print out success page | ||
| 57 | -function getAddPageFail() { | ||
| 58 | - global $default; | ||
| 59 | - | ||
| 60 | - $sToRender .= renderHeading(_("Add Link Type")); | ||
| 61 | - $sToRender .= "<table>\n"; | ||
| 62 | - $sToRender .= "<tr><td><b>" . _("Addition Unsuccessful") . "</b></td></tr>\n"; | ||
| 63 | - $sToRender .= "<tr></tr>\n"; | ||
| 64 | - $sToRender .= "<tr></tr>\n"; | ||
| 65 | - $sToRender .= "<tr>\n"; | ||
| 66 | - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=addLinkType\">" . KTHtml::getBackButton() . "</a></td>\n"; | ||
| 67 | - $sToRender .= "</tr>\n"; | ||
| 68 | - $sToRender .= "</table>\n"; | ||
| 69 | - | ||
| 70 | - return $sToRender; | ||
| 71 | -} | ||
| 72 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/doclinkmanagement/editLinkTypeBL.php deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * Edit a document link type. | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 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 Neil Blakey-Milner, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - */ | ||
| 26 | - | ||
| 27 | -require_once("../../../../../config/dmsDefaults.php"); | ||
| 28 | - | ||
| 29 | -KTUtil::extractGPC('fLinkID', 'fLinkName', 'fDescription', 'fForStore'); | ||
| 30 | - | ||
| 31 | -if (checkSession()) { | ||
| 32 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | ||
| 33 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternEditableListFromQuery.inc"); | ||
| 34 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | ||
| 35 | - | ||
| 36 | - require_once("$default->fileSystemRoot/presentation/Html.inc"); | ||
| 37 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | ||
| 38 | - | ||
| 39 | - require_once("$default->fileSystemRoot/lib/documentmanagement/LinkType.inc"); | ||
| 40 | - require_once("editLinkTypeUI.inc"); | ||
| 41 | - | ||
| 42 | - | ||
| 43 | - $oPatternCustom = & new PatternCustom(); | ||
| 44 | - | ||
| 45 | - if (isset($fForStore)){ | ||
| 46 | - $oLink = LinkType::get($fLinkID); | ||
| 47 | - $oLink->setName($fLinkName); | ||
| 48 | - $oLink->setDescription($fDescription); | ||
| 49 | - | ||
| 50 | - if ($oLink->update()) { | ||
| 51 | - // if successfull print out success message | ||
| 52 | - $oPatternCustom->setHtml(getEditPageSuccess()); | ||
| 53 | - | ||
| 54 | - } else { | ||
| 55 | - // if fail print out fail message | ||
| 56 | - $oPatternCustom->setHtml(getEditPageFail()); | ||
| 57 | - } | ||
| 58 | - } else if (isset($fLinkID)){ | ||
| 59 | - // post back on Link select from manual edit page | ||
| 60 | - $oPatternCustom->setHtml(getEditPage($fLinkID)); | ||
| 61 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForStore=1"); | ||
| 62 | - | ||
| 63 | - | ||
| 64 | - } else { | ||
| 65 | - // if nothing happens...just reload edit page | ||
| 66 | - $oPatternCustom->setHtml(getEditPage(null)); | ||
| 67 | - $main->setFormAction($_SERVER["PHP_SELF"]); | ||
| 68 | - | ||
| 69 | - } | ||
| 70 | - //render the page | ||
| 71 | - $main->setCentralPayload($oPatternCustom); | ||
| 72 | - $main->setHasRequiredFields(true); | ||
| 73 | - $main->render(); | ||
| 74 | -} | ||
| 75 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/doclinkmanagement/editLinkTypeUI.inc deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * Edit a document link type UI functions. | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 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 Neil Blakey-Milner, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - */ | ||
| 26 | - | ||
| 27 | -function getEditPage($iLinkID) { | ||
| 28 | - global $default; | ||
| 29 | - $oLink = null; | ||
| 30 | - if (isset($iLinkID)) { | ||
| 31 | - $oLink = LinkType::get($iLinkID); | ||
| 32 | - } else { | ||
| 33 | - $sHeading = _("Please select a Link") . ":"; | ||
| 34 | - } | ||
| 35 | - $sToRender .= renderHeading(_("Edit Link Type")); | ||
| 36 | - $sToRender .= "<table>\n"; | ||
| 37 | - $sToRender .= "<tr><td>$sHeading</td></tr>\n"; | ||
| 38 | - $sToRender .= "<tr>\n"; | ||
| 39 | - $sToRender .= "<td>" . _("Link Name") . ": </td><td>" . getLinkDisplay($oLink) . "</td>\n"; | ||
| 40 | - $sToRender .= "</tr>\n"; | ||
| 41 | - $sToRender .= "<tr>\n"; | ||
| 42 | - $sToRender .= "</tr>\n"; | ||
| 43 | - $sToRender .= "<tr>\n"; | ||
| 44 | - | ||
| 45 | - // if a Link selected...show checkboxes | ||
| 46 | - if (isset($iLinkID)) { | ||
| 47 | - $sToRender .= "</tr>\n"; | ||
| 48 | - $sToRender .= "<tr>\n"; | ||
| 49 | - $sToRender .= "<td>" . _("Description") . ": </td><td>" . getDescr($oLink) . "</td>\n"; | ||
| 50 | - $sToRender .= "</tr>\n"; | ||
| 51 | - $sToRender .= "<tr>\n"; | ||
| 52 | - $sToRender .= "</tr>\n"; | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | - | ||
| 56 | - $sToRender .= "<tr>\n"; | ||
| 57 | - $sToRender .= "</tr>\n"; | ||
| 58 | - $sToRender .= "<td></td>" . getUpdateButton($oLink); | ||
| 59 | - $sToRender .= getCancelButton($oLink); | ||
| 60 | - $sToRender .= "</table>\n"; | ||
| 61 | - | ||
| 62 | - $sToRender .= "\n\n<script language=\"javascript\">\n<!--\n"; | ||
| 63 | - $sToRender .= "function validateForm(theForm) {\n"; | ||
| 64 | - $sToRender .= "\tif (!(validRequired(theForm.fLinkName, 'Link Name'))) {\n"; | ||
| 65 | - $sToRender .= "\t\treturn false;\n"; | ||
| 66 | - $sToRender .= "\t}\n"; | ||
| 67 | - $sToRender .= "\tif (!(validRequired(theForm.fDescription, 'Description'))) {\n"; | ||
| 68 | - $sToRender .= "\t\treturn false;\n"; | ||
| 69 | - $sToRender .= "\t}\n"; | ||
| 70 | - $sToRender .= "return true;\n}\n"; | ||
| 71 | - $sToRender .= "//-->\n</script>\n\n"; | ||
| 72 | - | ||
| 73 | - return $sToRender; | ||
| 74 | -} | ||
| 75 | - | ||
| 76 | -// if edition is successful print otu success page | ||
| 77 | -function getEditPageSuccess() { | ||
| 78 | - global $default; | ||
| 79 | - | ||
| 80 | - $sToRender .= renderHeading(_("Edit Link Type")); | ||
| 81 | - $sToRender .= "<b>Success!</b>\n"; | ||
| 82 | - $sToRender .= "<table>\n"; | ||
| 83 | - $sToRender .= "<br></br>\n"; | ||
| 84 | - $sToRender .= "<tr></tr>\n"; | ||
| 85 | - $sToRender .= "<tr><td>" . _("The Link Type was successfully modified") . "</td></tr>\n"; | ||
| 86 | - $sToRender .= "<tr></tr>\n"; | ||
| 87 | - $sToRender .= "<tr></tr>\n"; | ||
| 88 | - $sToRender .= "<tr>\n"; | ||
| 89 | - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=listLinkTypes\">" . generateImage(KTHtml::getBackButton()) . "</a></td>\n"; | ||
| 90 | - $sToRender .= "</tr>\n"; | ||
| 91 | - $sToRender .= "</table>\n"; | ||
| 92 | - | ||
| 93 | - | ||
| 94 | - return $sToRender; | ||
| 95 | -} | ||
| 96 | - | ||
| 97 | - | ||
| 98 | -// gets the page if edition fails | ||
| 99 | -function getEditPageFail() { | ||
| 100 | - global $default; | ||
| 101 | - | ||
| 102 | - $sToRender .= renderHeading(_("Edit Link Type")); | ||
| 103 | - $sToRender .= "<b>" . _("Success") . "!</b>\n"; | ||
| 104 | - $sToRender .= "<table>\n"; | ||
| 105 | - $sToRender .= "<br></br>\n"; | ||
| 106 | - $sToRender .= "<tr></tr>\n"; | ||
| 107 | - $sToRender .= "<tr><td>" . _("The Link Type modification failed") . "!</td></tr>\n"; | ||
| 108 | - $sToRender .= "<tr></tr>\n"; | ||
| 109 | - $sToRender .= "<tr></tr>\n"; | ||
| 110 | - $sToRender .= "<tr>\n"; | ||
| 111 | - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=listLinkTypes\">" . generateImage(KTHtml::getBackButton()) . "</a></td>\n"; | ||
| 112 | - $sToRender .= "</tr>\n"; | ||
| 113 | - $sToRender .= "</table>\n"; | ||
| 114 | - | ||
| 115 | - | ||
| 116 | - return $sToRender; | ||
| 117 | -} | ||
| 118 | - | ||
| 119 | -// show the list box when no Link selected | ||
| 120 | -// then shows a text box with the Link's name | ||
| 121 | -function getLinkDisplay($oLink) { | ||
| 122 | - global $default; | ||
| 123 | - if (!isset($oLink)) { | ||
| 124 | - $oPatternListBox = & new PatternListBox($default->document_links_types_table, "name", "id", "fLinkID"); | ||
| 125 | - //$oPatternListBox->setIncludeDefaultValue(true); | ||
| 126 | - $oPatternListBox->setPostBackOnChange(true); | ||
| 127 | - return $oPatternListBox->render(); | ||
| 128 | - } else { | ||
| 129 | - return "<input type=\"hidden\" name=\"fLinkID\" value=\"" . $oLink->iId . "\">\n" . | ||
| 130 | - "<input size = \"40\" type=\"text\" name=\"fLinkName\" value=\"" . $oLink->getName() . "\">"; | ||
| 131 | - } | ||
| 132 | - | ||
| 133 | -} | ||
| 134 | - | ||
| 135 | - | ||
| 136 | -// returns the checkbox ticked or unticked | ||
| 137 | -function getDescr($oLink) { | ||
| 138 | - if (!isset($oLink)) { | ||
| 139 | - return ""; | ||
| 140 | - } else { | ||
| 141 | - return "<input size = \"40\" type=\"text\" name=\"fDescription\" value=\"" . $oLink->getDescription() . "\">"; | ||
| 142 | - } | ||
| 143 | -} | ||
| 144 | - | ||
| 145 | - | ||
| 146 | -// gets the updatebutton when a Link is selected | ||
| 147 | -function getUpdateButton($oLink) { | ||
| 148 | - global $default; | ||
| 149 | - if (isset($oLink)) { | ||
| 150 | - return "<td align = right><input type=\"image\" src =\"" . KTHtml::getUpdateButton() . "\" value=\"submit\" border=\"0\"/></td>\n"; | ||
| 151 | - } | ||
| 152 | -} | ||
| 153 | - | ||
| 154 | -// gets the cancel button when a Link is selected | ||
| 155 | -function getCancelButton($oLink) { | ||
| 156 | - global $default; | ||
| 157 | - if (!isset($oLink)) { | ||
| 158 | - //return "<td align = right><a href=\"$default->rootUrl/control.php?action=LinkManagement\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" value=\"cancel\" /></a></td>\n"; | ||
| 159 | - } else { | ||
| 160 | - return "<td align = right><a href=\"$default->rootUrl/control.php?action=listLinkTypes\">" . generateImage(KTHtml::getCancelButton()) . "</a></td>\n"; | ||
| 161 | - } | ||
| 162 | -} | ||
| 163 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/doclinkmanagement/listLinkTypesBL.php deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * List document link types. | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 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 Neil Blakey-Milner, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - */ | ||
| 26 | - | ||
| 27 | -require_once("../../../../../config/dmsDefaults.php"); | ||
| 28 | - | ||
| 29 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc"); | ||
| 30 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | ||
| 31 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc"); | ||
| 32 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc"); | ||
| 33 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | ||
| 34 | - | ||
| 35 | -require_once("$default->fileSystemRoot/presentation/Html.inc"); | ||
| 36 | -require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | ||
| 37 | -require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/administration/adminUI.inc"); | ||
| 38 | - | ||
| 39 | -require_once("listLinkTypesUI.inc"); | ||
| 40 | - | ||
| 41 | -if (checkSession()) { | ||
| 42 | - $oPatternCustom = & new PatternCustom(); | ||
| 43 | - $oPatternCustom->setHtml(getPage()); | ||
| 44 | - $main->setCentralPayload($oPatternCustom); | ||
| 45 | - $main->setFormAction($_SERVER['PHP_SELF']); | ||
| 46 | - $main->render(); | ||
| 47 | -} | ||
| 48 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/doclinkmanagement/listLinkTypesUI.inc deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * List document link types UI functions. | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 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 Neil Blakey-Milner, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - */ | ||
| 26 | - | ||
| 27 | -function getLinkTypes() { | ||
| 28 | - global $default; | ||
| 29 | - $sQuery = "SELECT id as LinkID, name as LinkName, description as LinkDescr, " . | ||
| 30 | - "'Edit', 'Delete' " . | ||
| 31 | - "FROM " . $default->document_link_types_table . " " . | ||
| 32 | - "ORDER BY name"; | ||
| 33 | - | ||
| 34 | - $aColumns = array("LinkName", "LinkDescr", "Edit", "Delete"); | ||
| 35 | - $aColumnNames = array("Linktype Name","Description", "Edit", "Delete"); | ||
| 36 | - $aColumnTypes = array(1,1,3,3); | ||
| 37 | - $aDBColumnArray = array("LinkID"); | ||
| 38 | - $aQueryStringVariableNames = array("fLinkID"); | ||
| 39 | - | ||
| 40 | - $aHyperLinkDescr = array( 2=> "$default->rootUrl/control.php?action=editLinkType", | ||
| 41 | - 3=> "$default->rootUrl/control.php?action=removeLinkType"); | ||
| 42 | - | ||
| 43 | - | ||
| 44 | - $oSearchResults = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkDescr,$aDBColumnArray,$aQueryStringVariableNames); | ||
| 45 | - $oSearchResults->setDisplayColumnHeadings(true); | ||
| 46 | - return $oSearchResults->render() ; | ||
| 47 | -} | ||
| 48 | - | ||
| 49 | -function getPage() { | ||
| 50 | - global $default; | ||
| 51 | - $sToRender .= renderHeading(_("Link Types Management")); | ||
| 52 | - | ||
| 53 | - // add user link | ||
| 54 | - $sToRender .= getAddLink("addLinkType", "Add A Link Type"); | ||
| 55 | - $sToRender .= getLinkTypes(); | ||
| 56 | - return $sToRender; | ||
| 57 | -} | ||
| 58 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/doclinkmanagement/removeLinkTypeBL.php deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * Remove a document link type. | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 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 Neil Blakey-Milner, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - */ | ||
| 26 | -require_once("../../../../../config/dmsDefaults.php"); | ||
| 27 | - | ||
| 28 | -KTUtil::extractGPC('fLinkID', 'fLinkName', 'fForDelete'); | ||
| 29 | - | ||
| 30 | -if (checkSession()) { | ||
| 31 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | ||
| 32 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternEditableListFromQuery.inc"); | ||
| 33 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | ||
| 34 | - | ||
| 35 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | ||
| 36 | - require_once("$default->fileSystemRoot/presentation/Html.inc"); | ||
| 37 | - | ||
| 38 | - require_once("$default->fileSystemRoot/lib/documentmanagement/LinkType.inc"); | ||
| 39 | - require_once("removeLinkTypeUI.inc"); | ||
| 40 | - | ||
| 41 | - $oPatternCustom = & new PatternCustom(); | ||
| 42 | - | ||
| 43 | - // get main page | ||
| 44 | - if (isset($fLinkID)) { | ||
| 45 | - | ||
| 46 | - $oPatternCustom->setHtml(getDeletePage($fLinkID)); | ||
| 47 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForDelete=1"); | ||
| 48 | - | ||
| 49 | - // get delete page | ||
| 50 | - } else { | ||
| 51 | - $oPatternCustom->setHtml(getDeletePage(null)); | ||
| 52 | - $main->setFormAction($_SERVER["PHP_SELF"]); | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | - // if delete entry | ||
| 56 | - if (isset($fForDelete)) { | ||
| 57 | - $oLink = LinkType::get($fLinkID); | ||
| 58 | - $oLink->setName($fLinkName); | ||
| 59 | - | ||
| 60 | - if ($oLink->delete()) { | ||
| 61 | - $oPatternCustom->setHtml(getDeleteSuccessPage()); | ||
| 62 | - | ||
| 63 | - } else { | ||
| 64 | - $oPatternCustom->setHtml(getDeleteFailPage()); | ||
| 65 | - } | ||
| 66 | - } | ||
| 67 | - | ||
| 68 | - $main->setCentralPayload($oPatternCustom); | ||
| 69 | - $main->render(); | ||
| 70 | -} | ||
| 71 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/doclinkmanagement/removeLinkTypeUI.inc deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * Remove document link type UI functions. | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 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 Neil Blakey-Milner, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - */ | ||
| 26 | - | ||
| 27 | -// gets the delete stuff | ||
| 28 | -function getDeletePage($iLinkID) { | ||
| 29 | - global $default; | ||
| 30 | - $oLink = null; | ||
| 31 | - if (isset($iLinkID)) { | ||
| 32 | - $oLink = LinkType::get($iLinkID); | ||
| 33 | - $sHeading .= "<b>" . _("Are you sure you wish to memove this Link Type?") . ":</b>\n"; | ||
| 34 | - } else { | ||
| 35 | - $sHeading .= _("Please select a Link Type") . ":"; | ||
| 36 | - } | ||
| 37 | - | ||
| 38 | - $sToRender .= renderHeading(_("Remove Document Link Type")); | ||
| 39 | - $sToRender .= "<table>\n"; | ||
| 40 | - $sToRender .= "<tr><td colspan=\"2\">$sHeading</td></tr>\n"; | ||
| 41 | - $sToRender .= "<tr>\n"; | ||
| 42 | - $sToRender .= "<td>Link Name: </td><td>" . getLinkDisplay($oLink) . "</td>\n"; | ||
| 43 | - $sToRender .= "</tr>\n"; | ||
| 44 | - $sToRender .= "<tr>\n"; | ||
| 45 | - $sToRender .= "</tr>\n"; | ||
| 46 | - $sToRender .= "<tr>\n"; | ||
| 47 | - $sToRender .= "<td>" . getDescr($oLink) . "</td>\n"; | ||
| 48 | - $sToRender .= "</tr>\n"; | ||
| 49 | - $sToRender .= "<tr>\n"; | ||
| 50 | - $sToRender .= "</tr>\n"; | ||
| 51 | - $sToRender .= "<tr>\n"; | ||
| 52 | - $sToRender .= "</tr>\n"; | ||
| 53 | - $sToRender .= "<tr><td/>" . getDeleteButton($oLink) . "</tr>\n"; | ||
| 54 | - $sToRender .= "</table>\n"; | ||
| 55 | - | ||
| 56 | - return $sToRender; | ||
| 57 | -} | ||
| 58 | - | ||
| 59 | -// get successfully deletion page | ||
| 60 | -function getDeleteSuccessPage() { | ||
| 61 | - | ||
| 62 | - global $default; | ||
| 63 | - | ||
| 64 | - $sToRender .= renderHeading(_("Remove Document Link Type")); | ||
| 65 | - $sToRender .= "<TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\">\n"; | ||
| 66 | - $sToRender .= "<tr>\n"; | ||
| 67 | - $sToRender .= "<td><b>" . _("Document Link Type successfully removed") . "!</b></td>\n"; | ||
| 68 | - $sToRender .= "</tr>\n"; | ||
| 69 | - $sToRender .= "<tr></tr>\n"; | ||
| 70 | - $sToRender .= "<tr></tr>\n"; | ||
| 71 | - $sToRender .= "<tr></tr>\n"; | ||
| 72 | - $sToRender .= "<tr></tr>\n"; | ||
| 73 | - $sToRender .= "<tr>\n"; | ||
| 74 | - $sToRender .= "<td align = right><a href=\"$default->rootUrl/control.php?action=listLinkTypes\">" . generateImage(KTHtml::getBackButton()) . "</a></td>\n"; | ||
| 75 | - $sToRender .= "</tr>\n"; | ||
| 76 | - $sToRender .= "</table>\n"; | ||
| 77 | - | ||
| 78 | - return $sToRender; | ||
| 79 | -} | ||
| 80 | - | ||
| 81 | -// get deletion failed page | ||
| 82 | -function getDeleteFailPage() { | ||
| 83 | - | ||
| 84 | - global $default; | ||
| 85 | - | ||
| 86 | - $sToRender .= renderHeading(_("Remove Document Link Type")); | ||
| 87 | - $sToRender .= "<TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\">\n"; | ||
| 88 | - $sToRender .= "<tr>\n"; | ||
| 89 | - $sToRender .= "<td><b>" . _("Deletion failed") . "!</b></td>\n"; | ||
| 90 | - $sToRender .= "</tr>\n"; | ||
| 91 | - $sToRender .= "<tr></tr>\n"; | ||
| 92 | - $sToRender .= "<tr></tr>\n"; | ||
| 93 | - $sToRender .= "<tr><td>" . _("Please ensure that all document links from this type have been removed") . ".</td></tr>\n"; | ||
| 94 | - $sToRender .= "<tr></tr>\n"; | ||
| 95 | - $sToRender .= "<tr></tr>\n"; | ||
| 96 | - $sToRender .= "</tr>\n"; | ||
| 97 | - $sToRender .= "<tr><td align = right><a href=\"$default->rootUrl/control.php?action=listLinkTypes\">" . generateImage(KTHtml::getBackButton()) . "</a></td></tr>\n"; | ||
| 98 | - $sToRender .= "</table>\n"; | ||
| 99 | - | ||
| 100 | - return $sToRender; | ||
| 101 | -} | ||
| 102 | - | ||
| 103 | -// show listbox...or the text name | ||
| 104 | -function getLinkDisplay($oLink) { | ||
| 105 | - global $default; | ||
| 106 | - if (!isset($oLink)) { | ||
| 107 | - $oPatternListBox = & new PatternListBox($default->quicklinks_table, "name", "id", "fLinkID"); | ||
| 108 | - $oPatternListBox->setIncludeDefaultValue(true); | ||
| 109 | - $oPatternListBox->setPostBackOnChange(true); | ||
| 110 | - return $oPatternListBox->render(); | ||
| 111 | - } else { | ||
| 112 | - return "<input type=\"hidden\" name=\"fLinkID\" value=\"" . $oLink->iId . "\">\n" . | ||
| 113 | - "<b>" . $oLink->getName() . "</b>"; | ||
| 114 | - } | ||
| 115 | -} | ||
| 116 | - | ||
| 117 | -// show check box | ||
| 118 | -function getDescr($oLink) { | ||
| 119 | - if (!isset($oLink)) { | ||
| 120 | - return ""; | ||
| 121 | - } else { | ||
| 122 | - return _("Description") . ": </td><td>" . $oLink->getDescription(); | ||
| 123 | - } | ||
| 124 | -} | ||
| 125 | - | ||
| 126 | -// show delete button | ||
| 127 | -function getDeleteButton($oLink) { | ||
| 128 | - global $default; | ||
| 129 | - if (isset($oLink)) { | ||
| 130 | - return "<td colspan=\"2\" align=\"right\"><input type=\"image\" src=\"" . KTHtml::getDeleteButton() . "\" value=\"submit\" border=\"0\"/>\n". | ||
| 131 | - "<a href=\"$default->rootUrl/control.php?action=listLinks\">" . generateImage(KTHtml::getCancelButton()) . "</a></td>\n"; | ||
| 132 | - } | ||
| 133 | -} | ||
| 134 | -?> |