Commit 84dfb3b239e7e1c5c99af44c75165c6d73a8ee67
1 parent
6d7e0d60
Doc Type admin changed
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2107 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
9 changed files
with
1022 additions
and
56 deletions
presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/addDocTypeFieldsLinkBL.php
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* BL information for adding a Org | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | +require_once("../../../../../config/dmsDefaults.php"); | |
| 11 | + | |
| 12 | +global $default; | |
| 13 | + | |
| 14 | +if (checkSession()) { | |
| 15 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 16 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc"); | |
| 17 | + require_once("addDocTypeFieldsLinkUI.inc"); | |
| 18 | + require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentField.inc"); | |
| 19 | + require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTypeFieldLink.inc"); | |
| 20 | + require_once("$default->fileSystemRoot/lib/security/permission.inc"); | |
| 21 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 22 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 23 | + require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | |
| 24 | + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 25 | + require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 26 | + | |
| 27 | + $oPatternCustom = & new PatternCustom(); | |
| 28 | + | |
| 29 | + if (isset($fAdd)){ | |
| 30 | + if (isset($fDocTypeID)){ | |
| 31 | + | |
| 32 | + if ($bMandatory){ $bMandatory = true; } | |
| 33 | + else { $bMandatory = false; } | |
| 34 | + | |
| 35 | + if ($fFieldID > 0){ // Use Existing Non-generic field | |
| 36 | + | |
| 37 | + $oDocTypeFieldLink = new DocumentTypeFieldLink($fDocTypeID,$fFieldID,$bMandatory); | |
| 38 | + | |
| 39 | + if ($oDocTypeFieldLink->create()){ | |
| 40 | + $oPatternCustom->setHtml(addSuccessPage($fDocTypeID)); | |
| 41 | + }else { | |
| 42 | + $oPatternCustom->setHtml(addFailPage($fDocTypeID));; | |
| 43 | + } | |
| 44 | + | |
| 45 | + } else if (strlen($fNewField) > 0){ // Create a New Field | |
| 46 | + | |
| 47 | + if ($bHasLookup){ $bHasLookup = true; } | |
| 48 | + else { $bHasLookup = false; } | |
| 49 | + | |
| 50 | + $oDocField = new DocumentField($fNewField, $fDataType, false, $bHasLookup); | |
| 51 | + if ($oDocField->create()) { | |
| 52 | + $fFieldID = $oDocField->getID(); | |
| 53 | + $oDocTypeFieldLink = new DocumentTypeFieldLink($fDocTypeID,$fFieldID,$bMandatory); | |
| 54 | + | |
| 55 | + if ($oDocTypeFieldLink->create()){ | |
| 56 | + $oPatternCustom->setHtml(getCreateNewSuccess($fDocTypeID)); | |
| 57 | + }else { | |
| 58 | + $oPatternCustom->setHtml(getCreateNewFail($fDocTypeID)); | |
| 59 | + } | |
| 60 | + } else { | |
| 61 | + $oPatternCustom->setHtml(getCreateNewFail($fDocTypeID)); | |
| 62 | + } | |
| 63 | + } else { | |
| 64 | + $oPatternCustom->setHtml(getFail_NoFieldID($fDocTypeID)); | |
| 65 | + } | |
| 66 | + }else{ //error | |
| 67 | + $oPatternCustom->setHtml(getMissingDocTypeIDPage($fDocTypeID)); | |
| 68 | + } | |
| 69 | + | |
| 70 | + } else if (isset($fDocTypeID)){ | |
| 71 | + if (isset($fFromList)){ | |
| 72 | + $sNewTableName = $default->owl_fields_table; | |
| 73 | + $sNewDisplayColumn = "name"; | |
| 74 | + $sNewValueColumn = "id"; | |
| 75 | + $sNewSelectName = "fFieldID"; | |
| 76 | + $sNewWhereClause = "is_generic != 1"; | |
| 77 | + $bNewOrderAsc = true; | |
| 78 | + | |
| 79 | + $oSelectBox = & new PatternListBox($sNewTableName, $sNewDisplayColumn, $sNewValueColumn, $sNewSelectName, $sNewWhereClause , $bNewOrderAsc ); | |
| 80 | + if (count($oSelectBox->getEntries()) > 0) { | |
| 81 | + | |
| 82 | + $main->setFormAction($_SERVER['PHP_SELF'] . "?fAdd=1&fDocTypeID=$fDocTypeID"); | |
| 83 | + | |
| 84 | + $htmlListBox = $oSelectBox->render(); | |
| 85 | + $oPatternCustom->addHtml(getFirstPage($htmlListBox, $fDocTypeID)); | |
| 86 | + | |
| 87 | + } else { //Go to -> no Non-generic fields exist | |
| 88 | + $oPatternCustom->addHtml(getListFailPage($fDocTypeID)); | |
| 89 | + } | |
| 90 | + } else if(isset($fNewField)){//A new Field Entry | |
| 91 | + $main->setFormAction($_SERVER['PHP_SELF'] . "?fAdd=1&fDocTypeID=$fDocTypeID"); | |
| 92 | + $oPatternCustom->addHtml(getFirstPage($Nothing, $fDocTypeID, true)); | |
| 93 | + } else { // get OptionPage | |
| 94 | + $oPatternCustom->addHtml(getOptionPage($fDocTypeID)); | |
| 95 | + } | |
| 96 | + } else { | |
| 97 | + $oPatternCustom->setHtml(getMissingDocTypeIDPage()); | |
| 98 | + } | |
| 99 | + | |
| 100 | + $main->setCentralPayload($oPatternCustom); | |
| 101 | + $main->setHasRequiredFields(true); | |
| 102 | + $main->render(); | |
| 103 | +} | |
| 104 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/addDocTypeFieldsLinkUI.inc
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information for adding a Org | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | + | |
| 11 | +function getOptionPage($fDocTypeID = null){ | |
| 12 | + global $default; | |
| 13 | + | |
| 14 | + $sToRender .= renderHeading("Add Type Specific Field to Document Type"); | |
| 15 | + $sToRender .= "<br>"; | |
| 16 | + $sToRender .= "<table>\n"; | |
| 17 | + $sToRender .= "<tr><td>New type specific field?</td><td><a href=\"$default->rootUrl/control.php?action=addDocTypeFieldsLink&fNewField=1&fDocTypeID=$fDocTypeID\"><img src =\"$default->graphicsUrl/widgets/select.gif\" border = \"0\" /></a></td></tr>\n"; | |
| 18 | + $sToRender .= "<tr><td>Choose from existing type specific fields</td><td><a href=\"$default->rootUrl/control.php?action=addDocTypeFieldsLink&fFromList=1&fDocTypeID=$fDocTypeID\"><img src =\"$default->graphicsUrl/widgets/select.gif\" border = \"0\" /></a></td></tr>\n"; | |
| 19 | + $sToRender .= "<tr><td></td><td>" . getCancelButton($fDocTypeID) . "</td></tr>\n"; | |
| 20 | + $sToRender .= "</table>\n"; | |
| 21 | + | |
| 22 | + return $sToRender; | |
| 23 | +} | |
| 24 | + | |
| 25 | + | |
| 26 | +function genericMessage($sMsg, $fDocTypeID = null){ | |
| 27 | + global $default; | |
| 28 | + | |
| 29 | + $sToRender .= "<table>\n"; | |
| 30 | + $sToRender .= "<tr><td>$sMsg</td></tr>\n"; | |
| 31 | + $sToRender .= "<tr><td></td><td>" . getBackButton($fDocTypeID) . "</td></tr>\n"; | |
| 32 | + $sToRender .= "</table>\n"; | |
| 33 | + | |
| 34 | + return $sToRender; | |
| 35 | +} | |
| 36 | + | |
| 37 | +function getCreateNewFail($fDocTypeID){ | |
| 38 | + $sToRender = genericMessage("Error creating new Type Specific Field and Linking it", $fDocTypeID); | |
| 39 | + return $sToRender; | |
| 40 | +} | |
| 41 | + | |
| 42 | + | |
| 43 | +function getCreateNewSuccess($fDocTypeID){ | |
| 44 | + $sToRender = genericMessage("New Type specific Field Created and Linked.", $fDocTypeID); | |
| 45 | + return $sToRender; | |
| 46 | +} | |
| 47 | + | |
| 48 | +function getFail_NoFieldID($fDocTypeID = null){ | |
| 49 | + $sToRender = genericMessage("Linking cannot be done. Please select a field to link to.", $fDocTypeID); | |
| 50 | + return $sToRender; | |
| 51 | +} | |
| 52 | + | |
| 53 | +function addSuccessPage($fDocTypeID = null){ | |
| 54 | + $sToRender = genericMessage("Field is successfully linked to the Document Type.", $fDocTypeID); | |
| 55 | + return $sToRender; | |
| 56 | +} | |
| 57 | + | |
| 58 | +function addFailPage($fDocTypeID = null ){ | |
| 59 | + $sToRender = genericMessage("Error: Field Could not be linked to the Document Type.", $fDocTypeID); | |
| 60 | + return $sToRender; | |
| 61 | +} | |
| 62 | + | |
| 63 | +function getMissingDocTypeIDPage($iDocTypeID = null ){ | |
| 64 | + $sToRender = genericMessage("Error: Page expects a Document Type ID.", $fDocTypeID); | |
| 65 | + return $sToRender; | |
| 66 | +} | |
| 67 | + | |
| 68 | + | |
| 69 | +function getListFailPage($iDocTypeID = null){ | |
| 70 | + $sToRender = genericMessage("There are no Non-generic fields in the database.", $fDocTypeID); | |
| 71 | + return $sToRender; | |
| 72 | +} | |
| 73 | + | |
| 74 | +// get add pages | |
| 75 | +function getFirstPage($sHtmlListBox = null, $iDocTypeID, $bIsNew = null) { | |
| 76 | + global $default; | |
| 77 | + | |
| 78 | + $sToRender .= renderHeading("Add Type Specific Field to Document Type"); | |
| 79 | + $sToRender .= "<br>\n"; | |
| 80 | + $sToRender .= "<table>\n"; | |
| 81 | + | |
| 82 | + if ($bIsNew) { | |
| 83 | + $sNewTableName = $default->owl_data_types_table; | |
| 84 | + $sNewDisplayColumn = "name"; | |
| 85 | + $sNewValueColumn = "name"; | |
| 86 | + $sNewSelectName = "fDataType"; | |
| 87 | + $bNewOrderAsc = true; | |
| 88 | + | |
| 89 | + $oSelectBox = & new PatternListBox($sNewTableName, $sNewDisplayColumn, $sNewValueColumn, $sNewSelectName, $sNewWhereClause , $bNewOrderAsc ); | |
| 90 | + $oSelectBox->setIncludeDefaultValue(false); | |
| 91 | + $sToRender .= "<tr>"; | |
| 92 | + $sToRender .= "<td>New non-generic field: </td><td><input type=text name=fNewField></td>"; | |
| 93 | + $sToRender .= "</tr>"; | |
| 94 | + $sToRender .= "<tr>"; | |
| 95 | + $sToRender .= "<td>Field data type: </td><td>" . $oSelectBox->render() . "</td>"; | |
| 96 | + $sToRender .= "</tr>"; | |
| 97 | + $sToRender .= "<tr>"; | |
| 98 | + $sToRender .= "<td align=right>Has Lookup? </td><td><input type=checkbox name=bHasLookup></td>"; | |
| 99 | + $sToRender .= "</tr>"; | |
| 100 | + | |
| 101 | + } else { | |
| 102 | + $sToRender .= "<tr>"; | |
| 103 | + $sToRender .= "<td>Non-generic fields: </td><td>" . $sHtmlListBox . "</td>"; | |
| 104 | + $sToRender .= "</tr>"; | |
| 105 | + } | |
| 106 | + | |
| 107 | + $sToRender .= "<tr><td align=right>Mandatory? </td><td><input type=checkbox name=bMandatory> </td></tr>\n"; | |
| 108 | + $sToRender .= "<tr><td></td><td align=right><input type=\"image\" src =\"$default->graphicsUrl/widgets/select.gif\" border=0 value=\"submit\"/></td>"; | |
| 109 | + | |
| 110 | + //$sToRender .= "<td><a href=\"$default->rootUrl/control.php?action=listDocTypes\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td></tr>\n"; | |
| 111 | + $sToRender .= "<td>" . getCancelButton($iDocTypeID) . "</td></tr>\n"; | |
| 112 | + | |
| 113 | + $sToRender .= "</table>\n"; | |
| 114 | + | |
| 115 | + return $sToRender; | |
| 116 | +} | |
| 117 | + | |
| 118 | +// gets the cancel button | |
| 119 | +function getCancelButton($iDocTypeID = null) { | |
| 120 | + global $default; | |
| 121 | + //return "<a href=\"$default->rootUrl/control.php?action=listDocTypes\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a>\n"; | |
| 122 | + return "<a href=\"$default->rootUrl/control.php?action=editDocTypeFields&fDocTypeSelected=1&fDocTypeID=" . $iDocTypeID . "\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a>\n"; | |
| 123 | +} | |
| 124 | + | |
| 125 | +// gets the cancel button | |
| 126 | +function getBackButton($iDocTypeID = null) { | |
| 127 | + global $default; | |
| 128 | + return "<a href=\"$default->rootUrl/control.php?action=editDocTypeFields&fDocTypeSelected=1&fDocTypeID=" . $iDocTypeID . "\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a>\n"; | |
| 129 | +} | |
| 130 | +?> | |
| 0 | 131 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/editDocTypeBL.php
| ... | ... | @@ -32,13 +32,7 @@ if (checkSession()) { |
| 32 | 32 | |
| 33 | 33 | $oDocType = DocumentType::get($fDocTypeID); |
| 34 | 34 | $oDocType->setName($fDocTypeName); |
| 35 | - | |
| 36 | - // store type specific field id's in an array | |
| 37 | - //$aGenericDocFields = DocumentField::getGenericFields(); | |
| 38 | - //$aSpecificDocFields = DocumentTypeFieldLink::getSpecificFields($fDocTypeID); | |
| 39 | - | |
| 40 | - // echo "<li><pre>" . arrayToString($aSpecificDocFields ) . "</pre></li></ul>"; | |
| 41 | - | |
| 35 | + | |
| 42 | 36 | if ($oDocType->update()) { |
| 43 | 37 | // if successfull print out success message |
| 44 | 38 | $oPatternCustom->setHtml(getEditPageSuccess()); |
| ... | ... | @@ -48,23 +42,9 @@ if (checkSession()) { |
| 48 | 42 | $oPatternCustom->setHtml(getEditPageFail()); |
| 49 | 43 | } |
| 50 | 44 | } else if (isset($fDocTypeSelected)){ |
| 51 | - // post back on DocType select from manual edit page | |
| 52 | - // store type generic field id's in an array | |
| 53 | - $aGenericFields = DocumentField::getGenericFields(); | |
| 54 | - | |
| 55 | - // get all specific fields | |
| 56 | - $aAllSpecificFields = DocumentField::getAllSpecificFields(); | |
| 57 | - | |
| 58 | - | |
| 59 | - // store type specific field id's and names in an array for specifc doctype | |
| 60 | - $aSpecificFields = DocumentTypeFieldLink::getSpecificFields($fDocTypeID); | |
| 61 | - | |
| 62 | - | |
| 63 | - | |
| 64 | - $oPatternCustom->setHtml(getDetailsPage($fDocTypeID, $aGenericFields, $aSpecificFields, $aAllSpecificFields)); | |
| 65 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fShowDetails=1"); | |
| 66 | - | |
| 67 | - | |
| 45 | + | |
| 46 | + $oPatternCustom->setHtml(getDetailsPage($fDocTypeID)); | |
| 47 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fUpdate=1"); | |
| 68 | 48 | }else if(isset($fAdd)) |
| 69 | 49 | { |
| 70 | 50 | if($fIsMandatory == 1){ | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/editDocTypeFieldsBL.php
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* BL information for editing a documentType | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | +require_once("../../../../../config/dmsDefaults.php"); | |
| 11 | + | |
| 12 | +if (checkSession()) { | |
| 13 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 14 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternEditableListFromQuery.inc"); | |
| 15 | + require_once("editDocTypeFieldsUI.inc"); | |
| 16 | + require_once("$default->fileSystemRoot/lib/security/permission.inc"); | |
| 17 | + require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentType.inc"); | |
| 18 | + require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentField.inc"); | |
| 19 | + require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTypeFieldLink.inc"); | |
| 20 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 21 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 22 | + require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | |
| 23 | + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 24 | + require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 25 | + | |
| 26 | + | |
| 27 | + $oPatternCustom = & new PatternCustom(); | |
| 28 | + | |
| 29 | + // if a new DocType has been added | |
| 30 | + // coming from manual edit page | |
| 31 | + if (isset($fUpdate)) { | |
| 32 | + | |
| 33 | + //$oDocType = DocumentType::get($fDocTypeID); | |
| 34 | + //$oDocType->setName($fDocTypeName); | |
| 35 | + | |
| 36 | + // store type specific field id's in an array | |
| 37 | + $aGenericDocFields = DocumentField::getGenericFields(); | |
| 38 | + $aSpecificDocFields = DocumentTypeFieldLink::getSpecificFields($fDocTypeID); | |
| 39 | + | |
| 40 | + echo "<li><pre>" . arrayToString($aSpecificDocFields ) . "</pre></li></ul>"; | |
| 41 | + | |
| 42 | + /** | |
| 43 | + if ($oDocType->update()) { | |
| 44 | + // if successfull print out success message | |
| 45 | + $oPatternCustom->setHtml(getEditPageSuccess()); | |
| 46 | + | |
| 47 | + } else { | |
| 48 | + // if fail print out fail message | |
| 49 | + $oPatternCustom->setHtml(getEditPageFail()); | |
| 50 | + } | |
| 51 | + **/ | |
| 52 | + } else if (isset($fDocTypeSelected)){ | |
| 53 | + // post back on DocType select from manual edit page | |
| 54 | + // store type generic field id's in an array | |
| 55 | + $aGenericFields = DocumentField::getGenericFields(); | |
| 56 | + | |
| 57 | + // get all specific fields | |
| 58 | + $aAllSpecificFields = DocumentField::getAllSpecificFields(); | |
| 59 | + | |
| 60 | + | |
| 61 | + // store type specific field id's and names in an array for specifc doctype | |
| 62 | + $aSpecificFields = DocumentTypeFieldLink::getSpecificFields($fDocTypeID); | |
| 63 | + | |
| 64 | + | |
| 65 | + $oPatternCustom->setHtml(getDetailsPage($fDocTypeID, $aGenericFields, $aSpecificFields, $aAllSpecificFields)); | |
| 66 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fShowDetails=1"); | |
| 67 | + | |
| 68 | + | |
| 69 | + }else if(isset($fAdd)) | |
| 70 | + { | |
| 71 | + if($fIsMandatory == 1){ | |
| 72 | + $iMandatory = 1; | |
| 73 | + }else{ | |
| 74 | + $iMandatory = 0; | |
| 75 | + } | |
| 76 | + | |
| 77 | + $oDocTypeField = new DocumentTypeFieldLink($fDocTypeID, $fDocFieldTypeID, $iMandatory); | |
| 78 | + | |
| 79 | + $oDocTypeField->create(); | |
| 80 | + | |
| 81 | + | |
| 82 | + // post back on DocType select from manual edit page | |
| 83 | + // store type generic field id's in an array | |
| 84 | + //$oDocFieldType = new DocumentTypeFieldLink( | |
| 85 | + $aGenericFields = DocumentField::getGenericFields(); | |
| 86 | + | |
| 87 | + // get all specific fields | |
| 88 | + $aAllSpecificFields = DocumentField::getAllSpecificFields(); | |
| 89 | + | |
| 90 | + | |
| 91 | + // store type specific field id's and names in an array for specifc doctype | |
| 92 | + $aSpecificFields = DocumentTypeFieldLink::getSpecificFields($fDocTypeID); | |
| 93 | + | |
| 94 | + $oPatternCustom->setHtml(getDetailsPage($fDocTypeID, $aGenericFields, $aSpecificFields, $aAllSpecificFields)); | |
| 95 | + | |
| 96 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fDocTypeSelected=1"); | |
| 97 | + //$oPatternCustom->setHtml(getEditPageSuccess()); | |
| 98 | + | |
| 99 | + | |
| 100 | + }else if(isset($fRemove)){ | |
| 101 | + | |
| 102 | + $fFieldID = $fRemove; | |
| 103 | + | |
| 104 | + // does'nt matter wot ismandatory is..not checking for it when deleting | |
| 105 | + $iMandatory = 0; | |
| 106 | + //create new object | |
| 107 | + $oDocTypeField = new DocumentTypeFieldLink($fDocTypeID, $fFieldID, $iMandatory); | |
| 108 | + | |
| 109 | + //delete it by first getting hte corresponding id | |
| 110 | + $oDocTypeField ->setDocTypeFieldID($fDocTypeID, $fFieldID); | |
| 111 | + $oDocTypeField->delete(); | |
| 112 | + | |
| 113 | + // post back on DocType select from manual edit page | |
| 114 | + // store type generic field id's in an array | |
| 115 | + //$oDocFieldType = new DocumentTypeFieldLink( | |
| 116 | + $aGenericFields = DocumentField::getGenericFields(); | |
| 117 | + | |
| 118 | + // get all specific fields | |
| 119 | + $aAllSpecificFields = DocumentField::getAllSpecificFields(); | |
| 120 | + | |
| 121 | + | |
| 122 | + // store type specific field id's and names in an array for specifc doctype | |
| 123 | + $aSpecificFields = DocumentTypeFieldLink::getSpecificFields($fDocTypeID); | |
| 124 | + | |
| 125 | + $oPatternCustom->setHtml(getDetailsPage($fDocTypeID, $aGenericFields, $aSpecificFields, $aAllSpecificFields)); | |
| 126 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fDocTypeSelected=1"); | |
| 127 | + | |
| 128 | + }else if(isset($fEdit)){ | |
| 129 | + $fFieldID = $fEdit; | |
| 130 | + | |
| 131 | + $iMandatory = 0; | |
| 132 | + | |
| 133 | + $oDocTypeField = new DocumentTypeFieldLink($fDocTypeID, $fFieldID, $iMandatory); | |
| 134 | + | |
| 135 | + //delete it by first getting hte corresponding id | |
| 136 | + $oDocTypeField ->setDocTypeFieldID($fDocTypeID, $fFieldID); | |
| 137 | + | |
| 138 | + $iDocTypeFieldID = $oDocTypeField->getID(); | |
| 139 | + | |
| 140 | + $oPatternCustom->setHtml(getMandatoryPage($fFieldID,$iDocTypeFieldID)); | |
| 141 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fUpdateMandatory=1"); | |
| 142 | + | |
| 143 | + | |
| 144 | + } else if(isset($fUpdateMandatory)){ | |
| 145 | + | |
| 146 | + $oDocTypeField = new DocumentTypeFieldLink($fDocTypeID, $fFieldID, $fMandatory); | |
| 147 | + | |
| 148 | + //delete it by first getting hte corresponding id | |
| 149 | + $oDocTypeField->setDocTypeFieldID($fDocTypeID, $fFieldID); | |
| 150 | + | |
| 151 | + if(isset($fIsMandatory)){ | |
| 152 | + $oDocTypeField->setIsMandatory(true); | |
| 153 | + }else{ | |
| 154 | + $oDocTypeField->setIsMandatory(false); | |
| 155 | + } | |
| 156 | + | |
| 157 | + $oDocTypeField->update(); | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + // post back on DocType select from manual edit page | |
| 162 | + // store type generic field id's in an array | |
| 163 | + //$oDocFieldType = new DocumentTypeFieldLink( | |
| 164 | + $aGenericFields = DocumentField::getGenericFields(); | |
| 165 | + | |
| 166 | + // get all specific fields | |
| 167 | + $aAllSpecificFields = DocumentField::getAllSpecificFields(); | |
| 168 | + | |
| 169 | + | |
| 170 | + // store type specific field id's and names in an array for specifc doctype | |
| 171 | + $aSpecificFields = DocumentTypeFieldLink::getSpecificFields($fDocTypeID); | |
| 172 | + | |
| 173 | + $oPatternCustom->setHtml(getDetailsPage($fDocTypeID, $aGenericFields, $aSpecificFields, $aAllSpecificFields)); | |
| 174 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fDocTypeSelected=1"); | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + }else { | |
| 180 | + // if nothing happens...just reload edit page | |
| 181 | + $oPatternCustom->setHtml(getEditPage(null)); | |
| 182 | + $main->setFormAction($_SERVER["PHP_SELF"] ."?fDocTypeSelected=1"); | |
| 183 | + | |
| 184 | + | |
| 185 | + } | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + //render the page | |
| 193 | + $main->setCentralPayload($oPatternCustom); | |
| 194 | + $main->render(); | |
| 195 | +} | |
| 196 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/editDocTypeFieldsUI.inc
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information for renaming a DocType | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | + | |
| 11 | +// if its the manual edit page..then display normally | |
| 12 | +function getEditPage($iDocTypeID) { | |
| 13 | + global $default; | |
| 14 | + $oDocType = null; | |
| 15 | + if (isset($iDocTypeID)) { | |
| 16 | + $oDocType = DocumentType::get($iDocTypeID); | |
| 17 | + | |
| 18 | + } | |
| 19 | + | |
| 20 | + $sToRender .= renderHeading("Edit Document Type"); | |
| 21 | + $sToRender .= "<table>\n"; | |
| 22 | + $sToRender .= "<tr></tr>\n"; | |
| 23 | + $sToRender .= "<tr>\n"; | |
| 24 | + $sToRender .= "<td>Document Type Name: </td><td>" . getDocTypeDisplay($oDocType) . "</td>\n"; | |
| 25 | + $sToRender .= "</tr>\n"; | |
| 26 | + $sToRender .= "<tr>\n"; | |
| 27 | + $sToRender .= "</tr>\n"; | |
| 28 | + $sToRender .= "<tr>\n"; | |
| 29 | + $sToRender .= "</tr>\n"; | |
| 30 | + $sToRender .= "<tr>\n"; | |
| 31 | + $sToRender .= "</tr>\n"; | |
| 32 | + $sToRender .= "<tr>\n"; | |
| 33 | + $sToRender .= "</tr>\n"; | |
| 34 | + $sToRender .= "<tr>\n"; | |
| 35 | + $sToRender .= "</tr>\n"; | |
| 36 | + $sToRender .= "<tr>\n"; | |
| 37 | + $sToRender .= "</tr>\n"; | |
| 38 | + $sToRender .= "<tr>\n"; | |
| 39 | + $sToRender .= "<td></td>" . getUpdateButton($oDocType); | |
| 40 | + $sToRender .= getCancelButton($oDocType); | |
| 41 | + $sToRender .= "</tr>\n"; | |
| 42 | + $sToRender .= "</table>\n"; | |
| 43 | + | |
| 44 | + | |
| 45 | + return $sToRender; | |
| 46 | +} | |
| 47 | + | |
| 48 | +// if its the manual edit page..then display normally | |
| 49 | +function getDetailsPage($iDocTypeID,$aGeneric,$aSpecific, $aAllSpecific) { | |
| 50 | + global $default; | |
| 51 | + $oDocType = null; | |
| 52 | + if (isset($iDocTypeID)) { | |
| 53 | + $oDocType = DocumentType::get($iDocTypeID); | |
| 54 | + | |
| 55 | + } | |
| 56 | + | |
| 57 | + $sToRender .= renderHeading("Edit Document Type"); | |
| 58 | + | |
| 59 | + $sToRender .= "<table border=0 width=100%>\n"; | |
| 60 | + $sToRender .= "<tr><td><br></br></td><td><td></td><td></td><td></td>" . getCancelButton($oDocType) . "</td></tr>\n"; | |
| 61 | + $sToRender .= "<tr>\n"; | |
| 62 | + $sToRender .= "<td>Document Type Name: </td><td><input type=hidden name=\"fDocTypeID\" value=\"" . $iDocTypeID . "\">" . getDocTypeDisplay($oDocType) . "</td>\n"; | |
| 63 | + $sToRender .= "</tr>\n"; | |
| 64 | + $sToRender .= "<tr></tr>\n"; | |
| 65 | + $sToRender .= "<tr></tr>\n"; | |
| 66 | + $sToRender .= "<tr>\n"; | |
| 67 | + $sToRender .= "<td>Current Generic Fields: </td><td>" . getGenericFieldsList($aGeneric) . "</td>\n"; | |
| 68 | + $sToRender .= "</tr>\n"; | |
| 69 | + $sToRender .= "<tr></tr>\n"; | |
| 70 | + $sToRender .= "<tr></tr>\n"; | |
| 71 | + $sToRender .= "<tr>\n"; | |
| 72 | + $sToRender .= "<td>Current Type Specific Fields: </td>"; | |
| 73 | + $sToRender .= "</td></tr>" . getSpecificFieldsList($aSpecific, $iDocTypeID) . "</td>\n"; | |
| 74 | + $sToRender .= "<td></td><td colspan=3>"; | |
| 75 | + $sToRender .= "<hr><a href=\"$default->rootUrl/control.php?action=addDocTypeFieldsLink&fDocTypeID=$iDocTypeID\" ><img border=0 src =\"$default->graphicsUrl/widgets/add.gif\" /><a>"; | |
| 76 | + $sToRender .= " Add new Type Specific Field "; | |
| 77 | + $sToRender .= "</td>"; | |
| 78 | + $sToRender .= "</tr>\n"; | |
| 79 | + $sToRender .= "<tr></tr>\n"; | |
| 80 | + $sToRender .= "<tr><td><br></br></td></tr>\n"; | |
| 81 | + $sToRender .= "<tr></tr>\n"; | |
| 82 | + $sToRender .= "<tr>\n"; | |
| 83 | + /*if(count($aAllSpecific) > 0) { | |
| 84 | + $sToRender .= "<td>Add New Type Specific Field: </td><td>" . addSpecificFieldsList($aAllSpecific) ; | |
| 85 | + $sToRender .= "</td></tr><td></td><td>Mandatory: <input type=\"checkbox\" name=\"fIsMandatory\" value=\"1\" CHECKED></td><td>" . getAddSpecificFieldButton() . "</td>\n"; | |
| 86 | + }*/ | |
| 87 | + $sToRender .= "</tr>\n"; | |
| 88 | + $sToRender .= "<tr><td><br></br></td></tr>\n"; | |
| 89 | + $sToRender .= "<tr></tr>\n"; | |
| 90 | + $sToRender .= "<tr>\n"; | |
| 91 | + //$sToRender .= "<td></td>" . getUpdateButton($oDocType); | |
| 92 | + $sToRender .= "</tr>\n"; | |
| 93 | + $sToRender .= "</table>\n"; | |
| 94 | + | |
| 95 | + | |
| 96 | + return $sToRender; | |
| 97 | +} | |
| 98 | + | |
| 99 | +// if its the manual edit page..then display normally | |
| 100 | +function getMandatoryPage($iDocFieldID,$iDocTypeFieldID) { | |
| 101 | + global $default; | |
| 102 | + $oDocField = null; | |
| 103 | + | |
| 104 | + if (isset($iDocFieldID)) { | |
| 105 | + $oDocField = DocumentField::get($iDocFieldID); | |
| 106 | + | |
| 107 | + } | |
| 108 | + | |
| 109 | + if (isset($iDocTypeFieldID)) { | |
| 110 | + $oDocTypeField = DocumentTypeFieldLink::get($iDocTypeFieldID); | |
| 111 | + | |
| 112 | + } | |
| 113 | + | |
| 114 | + $sToRender .= "<input type=\"hidden\" height=0 name=\"fDocTypeID\" value=\"" . $oDocTypeField->iDocumentTypeID . "\">\n" ; | |
| 115 | + $sToRender .= "<input type=\"hidden\" height=0 name=\"fFieldID\" value=\"" . $oDocTypeField->iFieldID . "\">\n" . | |
| 116 | + //$sToRender .= renderHeading("Edit Mandatory settings"); | |
| 117 | + $sToRender .= "<br></br>\n"; | |
| 118 | + | |
| 119 | + $sToRender .= "<b>Change Mandatory Setting:</b>\n"; | |
| 120 | + $sToRender .= "<table>\n"; | |
| 121 | + $sToRender .= "<br></br>\n"; | |
| 122 | + $sToRender .= "<tr></tr>\n"; | |
| 123 | + $sToRender .= "<tr>\n"; | |
| 124 | + $sToRender .= "<td>Document Field Name: </td><td>" . $oDocField->getName() . "</td>\n"; | |
| 125 | + $sToRender .= "</tr>\n"; | |
| 126 | + $sToRender .= "<tr>\n"; | |
| 127 | + $sToRender .= "</tr>\n"; | |
| 128 | + $sToRender .= "<tr>\n"; | |
| 129 | + if($oDocTypeField->getIsMandatory() == 1) { | |
| 130 | + $sToRender .= "<td>Is Mandatory: </td><td><input type=\"checkbox\" name=\"fIsMandatory\" value=\"1\" CHECKED></td><td>\n"; | |
| 131 | + } else { | |
| 132 | + $sToRender .= "<td>Is Mandatory: </td><td><input type=\"checkbox\" name=\"fIsMandatory\" value=\"0\" ></td><td>\n"; | |
| 133 | + } | |
| 134 | + | |
| 135 | + $sToRender .= "</tr>\n"; | |
| 136 | + $sToRender .= "<tr>\n"; | |
| 137 | + $sToRender .= "</tr>\n"; | |
| 138 | + $sToRender .= "<tr>\n"; | |
| 139 | + $sToRender .= "</tr>\n"; | |
| 140 | + $sToRender .= "<tr>\n"; | |
| 141 | + $sToRender .= "</tr>\n"; | |
| 142 | + $sToRender .= "<tr>\n"; | |
| 143 | + $sToRender .= "</tr>\n"; | |
| 144 | + $sToRender .= "<tr>\n"; | |
| 145 | + $sToRender .= "<td></td>" . getDocTypeFieldUpdateButton() ; | |
| 146 | + $sToRender .= "</tr>\n"; | |
| 147 | + | |
| 148 | + $sToRender .= "</table>\n"; | |
| 149 | + | |
| 150 | + | |
| 151 | + return $sToRender; | |
| 152 | +} | |
| 153 | + | |
| 154 | +// if edition is successful print otu success page | |
| 155 | +function getEditPageSuccess() { | |
| 156 | + global $default; | |
| 157 | + | |
| 158 | + $sToRender .= renderHeading("Edit Document Type"); | |
| 159 | + $sToRender .= "<table>\n"; | |
| 160 | + $sToRender .= "<tr><td><b>Success!</b></td></tr>\n"; | |
| 161 | + $sToRender .= "<tr><td>The Document Type was successfully modified</td></tr>\n"; | |
| 162 | + $sToRender .= "<tr></tr>\n"; | |
| 163 | + $sToRender .= "<tr></tr>\n"; | |
| 164 | + $sToRender .= "<tr>\n"; | |
| 165 | + $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=listDocTypes\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 166 | + $sToRender .= "</tr>\n"; | |
| 167 | + $sToRender .= "</table>\n"; | |
| 168 | + | |
| 169 | + return $sToRender; | |
| 170 | +} | |
| 171 | + | |
| 172 | +// gets the page if editing fails | |
| 173 | +function getEditPageFail() { | |
| 174 | + global $default; | |
| 175 | + | |
| 176 | + $sToRender .= renderHeading("Edit Document Type"); | |
| 177 | + $sToRender .= "<table>\n"; | |
| 178 | + $sToRender .= "<tr><td><b>Failure!</b></td></tr>\n"; | |
| 179 | + $sToRender .= "<tr><td>Document Type modification Failed!</td></tr>\n"; | |
| 180 | + $sToRender .= "<tr></tr>\n"; | |
| 181 | + $sToRender .= "<tr></tr>\n"; | |
| 182 | + $sToRender .= "<tr>\n"; | |
| 183 | + $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=listDocTypes\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 184 | + $sToRender .= "</tr>\n"; | |
| 185 | + $sToRender .= "</table>\n"; | |
| 186 | + | |
| 187 | + return $sToRender; | |
| 188 | +} | |
| 189 | + | |
| 190 | +// show the list box when no DocType selected | |
| 191 | +// then shows a text box with the DocType's name | |
| 192 | +function getDocTypeDisplay($oDocType) { | |
| 193 | + global $default; | |
| 194 | + if (!isset($oDocType)) { | |
| 195 | + $oPatternListBox = & new PatternListBox($default->owl_document_types_table, "name", "id", "fDocTypeID"); | |
| 196 | + // only restrict doc type editing for non sys admins | |
| 197 | + if (!Permission::userIsSystemAdministrator()) { | |
| 198 | + $oPatternListBox->setFromClause("LEFT OUTER JOIN $default->owl_documents_table D on ST.id=D.document_type_id"); | |
| 199 | + $oPatternListBox->setWhereClause("ISNULL(D.id)"); | |
| 200 | + } | |
| 201 | + $oPatternListBox->setPostBackOnChange(true); | |
| 202 | + return $oPatternListBox->render(); | |
| 203 | + } else { | |
| 204 | + return $oDocType->getName(); | |
| 205 | + } | |
| 206 | + | |
| 207 | +} | |
| 208 | + | |
| 209 | +function getGenericFieldsList($aGeneric) { | |
| 210 | + global $default; | |
| 211 | + | |
| 212 | + $sList = "</tr><tr><td></td><td>"; | |
| 213 | + for($i = 0; $i < count($aGeneric);$i++) { | |
| 214 | + $sList .= "<li>" . $aGeneric[$i]["name"]. "</li>\n"; | |
| 215 | + } | |
| 216 | + $sList .= "</td></tr>"; | |
| 217 | + return $sList; | |
| 218 | +} | |
| 219 | + | |
| 220 | +function getSpecificFieldsList1($aSpecific) { | |
| 221 | + global $default; | |
| 222 | + $sList .= "<select name=fEdit>"; | |
| 223 | + for($i = 0; $i < count($aSpecific);$i++) { | |
| 224 | + $oDocField = DocumentField::get($aSpecific[$i]); | |
| 225 | + $sList .= "<tr><td></td><td><li>" . $oDocField->getName() . "</li></td><td>" . getEditSpecificFieldButton($aSpecific[$i]) ." ". getRemoveSpecificFieldButton($aSpecific[$i]) . "</td></tr>\n"; | |
| 226 | + } | |
| 227 | + return $sList; | |
| 228 | +} | |
| 229 | + | |
| 230 | +function getSpecificFieldsList($aSpecific, $iDocTypeID = null) { | |
| 231 | + global $default; | |
| 232 | + for($i = 0; $i < count($aSpecific);$i++) { | |
| 233 | + $oDocField = DocumentField::get($aSpecific[$i]); | |
| 234 | + $sList .= "<tr><td></td><td><li>" . $oDocField->getName() . "</li></td><td>" . getEditSpecificFieldButton($aSpecific[$i],$iDocTypeID) ." ". getRemoveSpecificFieldButton($aSpecific[$i], $iDocTypeID) . "</td></tr>\n"; | |
| 235 | + } | |
| 236 | + return $sList; | |
| 237 | +} | |
| 238 | + | |
| 239 | +// show Group details on confirm deletion page | |
| 240 | +function addSpecificFieldsList($aAllSpecific) { | |
| 241 | + global $default; | |
| 242 | + | |
| 243 | + $sDocFieldType = "<Select Name=\"fDocFieldTypeID\">"; | |
| 244 | + for ($i=0;$i < count($aAllSpecific);$i++) { | |
| 245 | + $Options .= "<OPTION value= \"". $aAllSpecific[$i]["id"] . "\">". $aAllSpecific[$i]["name"] ."</OPTION>\n"; | |
| 246 | + } | |
| 247 | + $sDocFieldType .= $Options . "</SELECT>"; | |
| 248 | + | |
| 249 | + return $sDocFieldType; | |
| 250 | +} | |
| 251 | + | |
| 252 | +// gets the updatebutton when a DocType is selected | |
| 253 | +function getUpdateButton($oDocType) { | |
| 254 | + global $default; | |
| 255 | + if (!isset($oDocType)) { | |
| 256 | + return "Please select a Document Type: "; | |
| 257 | + } else { | |
| 258 | + return "<td align = right><input ONCLICK=\" setActionAndSubmit('" . $_SERVER["PHP_SELF"] ."?fUpdate=1')\" type=\"image\" src =\"$default->graphicsUrl/widgets/update.gif\" value=\"submit\" /></td>\n"; | |
| 259 | + } | |
| 260 | +} | |
| 261 | + | |
| 262 | +// gets the updatebutton when a DocType is selected | |
| 263 | +function getDocTypeFieldUpdateButton() { | |
| 264 | + global $default; | |
| 265 | + return "<td align = right><input ONCLICK=\" setActionAndSubmit('" . $_SERVER["PHP_SELF"] ."?fUpdateMandatory=1')\" type=\"image\" src =\"$default->graphicsUrl/widgets/update.gif\" value=\"submit\" /></td>\n"; | |
| 266 | +} | |
| 267 | + | |
| 268 | +function getRemoveSpecificFieldButton($iNumber, $iDocTypeID=null) { | |
| 269 | + global $default; | |
| 270 | + //Return "<input ONCLICK=\" setActionAndSubmit('" . $_SERVER["PHP_SELF"] ."?fRemove=$iNumber')\" align = \"absmiddle\" type=\"image\" src =\"$default->graphicsUrl/widgets/remove.gif\" value=\"remove\" />\n"; | |
| 271 | + return "<a href=\"" . $_SERVER["PHP_SELF"] . "?fRemove=" . $iNumber . "&fDocTypeID=" . $iDocTypeID . "\"> <img border=0 src =\"$default->graphicsUrl/widgets/remove.gif\" value=\"edit\" /></a>\n"; | |
| 272 | +} | |
| 273 | + | |
| 274 | +function getEditSpecificFieldButton($iNumber, $iDocTypeID=null) { | |
| 275 | + global $default; | |
| 276 | + //return "<input ONCLICK=\" setActionAndSubmit('" . $_SERVER["PHP_SELF"] ."?fEdit=$iNumber')\" align = \"absmiddle\" type=\"image\" src =\"$default->graphicsUrl/widgets/edit.gif\" value=\"edit\" />\n"; | |
| 277 | + return "<a href=\"" . $_SERVER["PHP_SELF"] . "?fEdit=" . $iNumber . "&fDocTypeID=" . $iDocTypeID . "\"> <img border=0 src =\"$default->graphicsUrl/widgets/edit.gif\" value=\"edit\" /></a>\n"; | |
| 278 | +} | |
| 279 | + | |
| 280 | +function getAddSpecificFieldButton() { | |
| 281 | + global $default; | |
| 282 | + return "<input ONCLICK=\" setActionAndSubmit('" . $_SERVER["PHP_SELF"] ."?fAdd=1')\" align = \"absmiddle\" type=\"image\" src =\"$default->graphicsUrl/widgets/add.gif\" value=\"add\" />\n"; | |
| 283 | +} | |
| 284 | + | |
| 285 | +// gets the cancel button when a DocType is selected | |
| 286 | +function getCancelButton($oDocType) { | |
| 287 | + global $default; | |
| 288 | + if (!isset($oDocType)) { | |
| 289 | + return "<td align = right><a href=\"$default->rootUrl/control.php?action=doctypeManagement\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" value=\"cancel\" border = \"0\"/></a></td>\n"; | |
| 290 | + } | |
| 291 | + else { | |
| 292 | + return "<td align = right><a href=\"$default->rootUrl/control.php?action=listDocTypes\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 293 | + } | |
| 294 | +} | |
| 295 | +?> | |
| 0 | 296 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/editDocTypeUI.inc
| ... | ... | @@ -46,42 +46,21 @@ function getEditPage($iDocTypeID) { |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | // if its the manual edit page..then display normally |
| 49 | -function getDetailsPage($iDocTypeID,$aGeneric,$aSpecific, $aAllSpecific) { | |
| 49 | +function getDetailsPage($iDocTypeID) { | |
| 50 | 50 | global $default; |
| 51 | 51 | $oDocType = null; |
| 52 | + | |
| 52 | 53 | if (isset($iDocTypeID)) { |
| 53 | 54 | $oDocType = DocumentType::get($iDocTypeID); |
| 54 | 55 | |
| 55 | 56 | } |
| 56 | - | |
| 57 | + | |
| 57 | 58 | $sToRender .= renderHeading("Edit Document Type"); |
| 58 | 59 | $sToRender .= "<table>\n"; |
| 59 | 60 | $sToRender .= "<tr><td><br></br></td></tr>\n"; |
| 60 | 61 | $sToRender .= "<tr>\n"; |
| 61 | 62 | $sToRender .= "<td>Document Type Name: </td><td>" . getDocTypeDisplay($oDocType) . "</td>\n"; |
| 62 | 63 | $sToRender .= "</tr>\n"; |
| 63 | - $sToRender .= "<tr></tr>\n"; | |
| 64 | - $sToRender .= "<tr></tr>\n"; | |
| 65 | - $sToRender .= "<tr>\n"; | |
| 66 | - $sToRender .= "<td>Current Generic Fields: </td><td>" . getGenericFieldsList($aGeneric) . "</td>\n"; | |
| 67 | - $sToRender .= "</tr>\n"; | |
| 68 | - $sToRender .= "<tr></tr>\n"; | |
| 69 | - $sToRender .= "<tr></tr>\n"; | |
| 70 | - $sToRender .= "<tr>\n"; | |
| 71 | - $sToRender .= "<td>Current Type Specific Fields: </td></tr>" . getSpecificFieldsList($aSpecific) . "</td>\n"; | |
| 72 | - | |
| 73 | - $sToRender .= "</tr>\n"; | |
| 74 | - $sToRender .= "<tr></tr>\n"; | |
| 75 | - $sToRender .= "<tr><td><br></br></td></tr>\n"; | |
| 76 | - $sToRender .= "<tr></tr>\n"; | |
| 77 | - $sToRender .= "<tr>\n"; | |
| 78 | - if(count($aAllSpecific) > 0) { | |
| 79 | - $sToRender .= "<td>Add New Type Specific Field: </td><td>" . addSpecificFieldsList($aAllSpecific) ; | |
| 80 | - $sToRender .= "</td></tr><td></td><td>Mandatory: <input type=\"checkbox\" name=\"fIsMandatory\" value=\"1\" CHECKED></td><td>" . getAddSpecificFieldButton() . "</td>\n"; | |
| 81 | - } | |
| 82 | - $sToRender .= "</tr>\n"; | |
| 83 | - $sToRender .= "<tr><td><br></br></td></tr>\n"; | |
| 84 | - $sToRender .= "<tr></tr>\n"; | |
| 85 | 64 | $sToRender .= "<tr>\n"; |
| 86 | 65 | $sToRender .= "<td></td>" . getUpdateButton($oDocType); |
| 87 | 66 | $sToRender .= getCancelButton($oDocType); |
| ... | ... | @@ -155,7 +134,7 @@ function getEditPageSuccess() { |
| 155 | 134 | $sToRender .= "<tr></tr>\n"; |
| 156 | 135 | $sToRender .= "<tr></tr>\n"; |
| 157 | 136 | $sToRender .= "<tr>\n"; |
| 158 | - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=editDocType\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 137 | + $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=listDocTypes\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 159 | 138 | $sToRender .= "</tr>\n"; |
| 160 | 139 | $sToRender .= "</table>\n"; |
| 161 | 140 | |
| ... | ... | @@ -173,7 +152,7 @@ function getEditPageFail() { |
| 173 | 152 | $sToRender .= "<tr></tr>\n"; |
| 174 | 153 | $sToRender .= "<tr></tr>\n"; |
| 175 | 154 | $sToRender .= "<tr>\n"; |
| 176 | - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=editDocType\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 155 | + $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=listDocTypes\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 177 | 156 | $sToRender .= "</tr>\n"; |
| 178 | 157 | $sToRender .= "</table>\n"; |
| 179 | 158 | |
| ... | ... | @@ -239,14 +218,14 @@ function getUpdateButton($oDocType) { |
| 239 | 218 | if (!isset($oDocType)) { |
| 240 | 219 | return "Please select a Document Type: "; |
| 241 | 220 | } else { |
| 242 | - return "<td align = right><input ONCLICK=\" setActionAndSubmit('" . $_SERVER["PHP_SELF"] ."?fUpdate=1')\" type=\"image\" src =\"$default->graphicsUrl/widgets/update.gif\" value=\"submit\" /></td>\n"; | |
| 221 | + return "<td align = right><input ONCLICK=\"// setActionAndSubmit('" . $_SERVER["PHP_SELF"] ."?fUpdate=1');\" type=\"image\" src =\"$default->graphicsUrl/widgets/update.gif\" border=0 value=\"submit\" /></td>\n"; | |
| 243 | 222 | } |
| 244 | 223 | } |
| 245 | 224 | |
| 246 | 225 | // gets the updatebutton when a DocType is selected |
| 247 | 226 | function getDocTypeFieldUpdateButton() { |
| 248 | 227 | global $default; |
| 249 | - return "<td align = right><input ONCLICK=\" setActionAndSubmit('" . $_SERVER["PHP_SELF"] ."?fUpdateMandatory=1')\" type=\"image\" src =\"$default->graphicsUrl/widgets/update.gif\" value=\"submit\" /></td>\n"; | |
| 228 | + return "<td align = right><input ONCLICK=\" setActionAndSubmit('" . $_SERVER["PHP_SELF"] ."?fUpdateMandatory=1')\" type=\"image\" src =\"$default->graphicsUrl/widgets/update.gif\" border=0 value=\"submit\" /></td>\n"; | |
| 250 | 229 | } |
| 251 | 230 | |
| 252 | 231 | function getRemoveSpecificFieldButton($iNumber) { |
| ... | ... | @@ -271,7 +250,7 @@ function getCancelButton($oDocType) { |
| 271 | 250 | return "<td align = right><a href=\"$default->rootUrl/control.php?action=doctypeManagement\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" value=\"cancel\" border = \"0\"/></a></td>\n"; |
| 272 | 251 | } |
| 273 | 252 | else { |
| 274 | - return "<td align = right><a href=\"$default->rootUrl/control.php?action=editDocType\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 253 | + return "<td align = right><a href=\"$default->rootUrl/control.php?action=listDocTypes\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 275 | 254 | } |
| 276 | 255 | } |
| 277 | 256 | ?> |
| 278 | 257 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/listDocTypesBL.php
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* BL information for viewing a Discussion | |
| 4 | +* | |
| 5 | +* @author Omar Rahbeeni | |
| 6 | +* @date 19 May 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | + | |
| 11 | + require_once("../../../../../config/dmsDefaults.php"); | |
| 12 | + | |
| 13 | +if (checkSession()) { | |
| 14 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc"); | |
| 15 | + //require_once("listDocTypesUI.inc"); | |
| 16 | + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 17 | + require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); | |
| 18 | + require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | |
| 19 | + require_once("$default->fileSystemRoot/lib/users/User.inc"); | |
| 20 | + require_once("$default->fileSystemRoot/lib/security/permission.inc"); | |
| 21 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 22 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 23 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc"); | |
| 24 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc"); | |
| 25 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 26 | + require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 27 | + | |
| 28 | + | |
| 29 | + $oPatternCustom = & new PatternCustom(); | |
| 30 | + | |
| 31 | +if(checkSession()) { | |
| 32 | + global $default; | |
| 33 | + | |
| 34 | + $oPatternCustom->addHtml(renderHeading("Current System Organisations")); // Create the Heading | |
| 35 | + | |
| 36 | + $main->setFormAction($_SERVER['PHP_SELF']); | |
| 37 | + | |
| 38 | + $sQuery = "SELECT id as DocTypeID, name as DocTypeName, " . | |
| 39 | + "'Edit', 'Delete', 'Edit Fields' " . | |
| 40 | + "FROM " . $default->owl_document_types_table . " " . | |
| 41 | + "ORDER BY name"; | |
| 42 | + | |
| 43 | + $aColumns = array("DocTypeName", "Edit", "Delete", "Edit Fields"); | |
| 44 | + $aColumnNames = array("Name", "Edit", "Delete", "Edit Fields"); | |
| 45 | + $aColumnTypes = array(1,3,3,3); | |
| 46 | + $aDBColumnArray = array("DocTypeID"); | |
| 47 | + $aQueryStringVariableNames = array("fDocTypeID"); | |
| 48 | + | |
| 49 | + $aHyperLinkURL = array( 1=> "$default->rootUrl/control.php?action=editDocType&fDocTypeSelected=1", | |
| 50 | + 2=> "$default->rootUrl/control.php?action=removeDocType", | |
| 51 | + 3=> "$default->rootUrl/control.php?action=editDocTypeFields&fDocTypeSelected=1"); | |
| 52 | + | |
| 53 | + $oSearchResults = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL,$aDBColumnArray,$aQueryStringVariableNames); | |
| 54 | + $oSearchResults->setDisplayColumnHeadings(true); | |
| 55 | + $htmlTables = $oSearchResults->render() ; | |
| 56 | + | |
| 57 | + $oPatternCustom->addHtml($htmlTables); | |
| 58 | + | |
| 59 | + } // end of if checksession | |
| 60 | + | |
| 61 | + $main->setCentralPayload($oPatternCustom); | |
| 62 | + $main->render(); | |
| 63 | +} | |
| 64 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/listDocTypesUI.inc
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information for adding a unit | |
| 4 | +* | |
| 5 | +* @author Omar Rahbeeni | |
| 6 | +* @date 19 May 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | + | |
| 11 | +function getSubmit() { | |
| 12 | + global $default; | |
| 13 | + $sToRender = "<input type=\"image\" src =\"$default->graphicsUrl/widgets/select.gif\" value=\"submit\" border=\"0\"/>\n"; | |
| 14 | + return $sToRender; | |
| 15 | +} | |
| 16 | + | |
| 17 | +// display the listbox initially ..then just display the text | |
| 18 | +function getGroupDisplay($oGroup, $iSelectedValue = 0) { | |
| 19 | + global $default; | |
| 20 | + if (!isset($oGroup)) { | |
| 21 | + if (Permission::userIsSystemAdministrator()) { | |
| 22 | + // if this is the system administrator, prepend group names with unit name | |
| 23 | + $oPatternListBox = & new PatternListBox($default->owl_groups_table, "name", "id", "fGroupID"); | |
| 24 | + $oPatternListBox->setFromClause("LEFT OUTER JOIN groups_units_link GUL on ST.id=GUL.group_id " . | |
| 25 | + "LEFT OUTER JOIN units_lookup UL on GUL.unit_id=UL.id"); | |
| 26 | + $oPatternListBox->setCompositeDisplayName("DISTINCT COALESCE(CONCAT(CONCAT(UL.name, '-'),ST.name),ST.name)"); | |
| 27 | + } else if (Permission::userIsUnitAdministrator()) { | |
| 28 | + // else if this is a unit administrator, only display the groups in your unit | |
| 29 | + $oPatternListBox = & new PatternListBox($default->owl_groups_table, "name", "id", "fGroupID"); | |
| 30 | + $oPatternListBox->setFromClause("INNER JOIN $default->owl_groups_units_table GUL on ST.id=GUL.group_id"); | |
| 31 | + $oPatternListBox->setWhereClause("GUL.unit_id=" . User::getUnitID($_SESSION["userID"])); | |
| 32 | + } | |
| 33 | + if ($iSelectedValue != 0) { | |
| 34 | + $oPatternListBox->setSelectedValue($iSelectedValue); | |
| 35 | + } | |
| 36 | + | |
| 37 | + return $oPatternListBox->render(); | |
| 38 | + } else { | |
| 39 | + return "<input type=\"hidden\" name=\"fGroupID\" value=\"" . $oGroup->iId . "\">\n" . | |
| 40 | + $oGroup->getName(); | |
| 41 | + } | |
| 42 | + | |
| 43 | +} | |
| 44 | + | |
| 45 | + | |
| 46 | +function getFilterOptions($fGroupID = 0){ | |
| 47 | + global $default; | |
| 48 | + $sToRender .= getGroupDisplay($aGroups, $fGroupID); | |
| 49 | + /* | |
| 50 | + $sToRender .= "<table width=100%><tr>\n"; | |
| 51 | + $sToRender .= "<td align=right width=100%><a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $oThread->getDocumentID() . "&fAddComment=1") . "\"><img src=\"$default->graphicsUrl/widgets/addcomment.gif\" border=\"0\" /></a></td>\n"; | |
| 52 | + $sToRender .= "<td align=right width=10><img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" /></td>\n"; | |
| 53 | + | |
| 54 | + $sToRender .= "</tr></table>\n";*/ | |
| 55 | + return $sToRender ; | |
| 56 | +} | |
| 57 | + | |
| 58 | +function getPageButtons($oThread){ | |
| 59 | + global $default; | |
| 60 | + | |
| 61 | + $sToRender .= "<table width=100%><tr>\n"; | |
| 62 | + $sToRender .= "<td align=right width=100%><a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $oThread->getDocumentID() . "&fAddComment=1") . "\"><img src=\"$default->graphicsUrl/widgets/addcomment.gif\" border=\"0\" /></a></td>\n"; | |
| 63 | + $sToRender .= "<td align=right width=10><img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" /></td>\n"; | |
| 64 | + | |
| 65 | + $sToRender .= "</tr></table>\n"; | |
| 66 | + //$sToRender .= "<a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $oThread->getDocumentID() . "&fAddComment=1") . "\"><img src=\"$default->graphicsUrl/widgets/addcomment.gif\" border=\"0\" /></a>\n"; | |
| 67 | + //$sToRender .= "<img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" />\n"; | |
| 68 | + | |
| 69 | + return $sToRender ; | |
| 70 | +} | |
| 71 | + | |
| 72 | +// If there are no threads to view for a document | |
| 73 | +function getViewFailPage($sMessage) | |
| 74 | +{ | |
| 75 | + global $default; | |
| 76 | + | |
| 77 | + if (strlen($sMessage)>0){ | |
| 78 | + $sToRender = $sMessage; | |
| 79 | + } | |
| 80 | + else $sToRender = "Current document has no discussion. Press the ADD button to start a discussion."; | |
| 81 | + | |
| 82 | + return $sToRender; | |
| 83 | +} | |
| 84 | + | |
| 85 | +/** | |
| 86 | + * Page to create a new thread | |
| 87 | + * | |
| 88 | + * @param $fDocumentID -> a valid document ID | |
| 89 | + */ | |
| 90 | +function getNewThreadOption($fDocumentID) { | |
| 91 | + global $default; | |
| 92 | + | |
| 93 | + $sToRender .= "Would you like to create a new Discussion thread for this document?"; | |
| 94 | + $sToRender .= " "; | |
| 95 | + $sToRender .= "<a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $fDocumentID . "&fNewThread=1") . "\"><img src=\"$default->graphicsUrl/widgets/new.gif\" border=\"0\"></a>"; | |
| 96 | + $sToRender .= "<a href=\"" . generateControllerLink("viewDocument", "fDocumentID=" . $fDocumentID) . "\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"></a>"; | |
| 97 | + | |
| 98 | + return $sToRender; | |
| 99 | +} | |
| 100 | + | |
| 101 | +/** | |
| 102 | + * Renders the heading for the page | |
| 103 | + * | |
| 104 | + * @param $sHeading -> text heading for the page | |
| 105 | + */ | |
| 106 | +function renderHeading1($sHeading) { | |
| 107 | + global $default; | |
| 108 | + | |
| 109 | + $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); | |
| 110 | + $sColor = $default->siteMap->getSectionColour($sSectionName, "th"); | |
| 111 | + $sToRender = "<table border=\"0\" width=\"600\">\n"; | |
| 112 | + $sToRender .= "<tr align=\"left\"><th class=\"sectionHeading\" bgcolor=\"$sColor\"><font color=\"ffffff\">$sHeading</font></th></tr>\n"; | |
| 113 | + $sToRender .= "<tr/>\n"; | |
| 114 | + $sToRender .= "<tr/>\n"; | |
| 115 | + $sToRender .= "</table>\n"; | |
| 116 | + return $sToRender; | |
| 117 | +} | |
| 118 | + | |
| 119 | +/** | |
| 120 | + * Renders the path for the document | |
| 121 | + * | |
| 122 | + * @param $fDocumentID -> a valid document ID | |
| 123 | + */ | |
| 124 | +function renderDocumentPath($iDocumentID) { | |
| 125 | + global $default; | |
| 126 | + | |
| 127 | + $oDocument = & Document::get($iDocumentID); | |
| 128 | + $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); | |
| 129 | + $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td"); | |
| 130 | + $sDocumentPath = displayFolderPathLink(Folder::getFolderPathAsArray($oDocument->getFolderID()), Folder::getFolderPathNamesAsArray($oDocument->getFolderID()), "$default->rootUrl/control.php?action=browse") . " > "; | |
| 131 | + $sDocumentPath .= "<a href=\"$default->rootUrl/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php?fDocumentID=" . $oDocument->getID() . "&fForInlineView=1\">" . $oDocument->getName() . "</a>"; | |
| 132 | + return "<table border=0 cellpadding=\"5\" width = 100%><tr><td bgcolor=\"$sTDBGColour\">$sDocumentPath</td></tr></table>\n"; | |
| 133 | +} | |
| 134 | + | |
| 135 | +/** | |
| 136 | + * Views the list of comments for a document | |
| 137 | + * Prints out 1 comment | |
| 138 | + * User needs to call this function many times to list all comments | |
| 139 | + * | |
| 140 | + * @param $iNum -> its the iterative index of the current comment | |
| 141 | + * @param $iThread -> a valid Thread Object | |
| 142 | + * @param $oComment -> a valid Comment Object | |
| 143 | + * @param $oUser -> a valid User Object (Logged in user) | |
| 144 | + */ | |
| 145 | +function getViewComment($iNum,$oThread,$oComment,$oUser) { | |
| 146 | + global $default; | |
| 147 | + | |
| 148 | + $iSubjectChars = 59; | |
| 149 | + // If iNum is odd then highlight it | |
| 150 | + if (($iNum%2) == 1) $BGcolor = "#F5F6EE"; | |
| 151 | + if (($iNum%2) == 0) $UserBGcolor = "#F5F6EE"; | |
| 152 | + | |
| 153 | + // If the Subject string is too long | |
| 154 | + if (strlen($oComment->getSubject())>$iSubjectChars ) $dotdot = " ..."; | |
| 155 | + if (strlen($oUser->getUserName())> 13 ) $Userdotdot = " ..."; | |
| 156 | + | |
| 157 | + // If this is the first Subject line then create a table | |
| 158 | + if ($iNum == 1) { | |
| 159 | + $sHeading = "Document Discussion Comments"; | |
| 160 | + | |
| 161 | + $sToRender .= renderHeading($sHeading ); | |
| 162 | + $sToRender .= renderDocumentPath($oThread->getDocumentID()); | |
| 163 | + $sToRender .= "<table border=0 width=100%><tr>"; | |
| 164 | + $sToRender .= "<td width=100><b>Views: </b> " . $oThread->getNumberOfViews() . "</td>"; | |
| 165 | + $sToRender .= "<td width=20></td>"; | |
| 166 | + $sToRender .= "<td><b>Replies: </b> " . $oThread->getNumberOfReplies() . "</td>"; | |
| 167 | + $sToRender .= "<td align=right><a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $oThread->getDocumentID() . "&fAddComment=1") . "\"><img src=\"$default->graphicsUrl/widgets/addcomment.gif\" border=\"0\" /></a>"; | |
| 168 | + $sToRender .= "<img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" ></td>"; | |
| 169 | + $sToRender .= "</tr></table><br>\n"; | |
| 170 | + $sToRender .= "<table border=\"0\" width=\"100%\">\n"; | |
| 171 | + $sToRender .= "<tr><td></td>\n"; | |
| 172 | + $sToRender .= "<td><b>Subject</b></td>\n"; | |
| 173 | + $sToRender .= "<td><b>Author</b></td>\n"; | |
| 174 | + $sToRender .= "<td><b>Date</b></td>\n"; | |
| 175 | + $sToRender .= "</tr>\n"; | |
| 176 | + } | |
| 177 | + | |
| 178 | + $sToRender .= "<tr><td>$iNum </td><td style=\"background-color:$BGcolor\" width=450><a style=\"width:94%\" href=\"" . $_SERVER['PHP_SELF'] . "?fViewComment=1&iCommentID=" . $oComment->getID() . "&iDocumentID=" . $oThread->getDocumentID() . "\" title=\"" . $oComment->getSubject() . "\">" . substr($oComment->getSubject(),0,$iSubjectChars ) . $dotdot . "</a></td>\n"; | |
| 179 | + $sToRender .= "<td style=\"background-color:$UserBGcolor\" width=\"100\" title=\"$oUser->getUserName()\">" . substr($oUser->getUserName(),0,10) . $Userdotdot . "</td>\n"; | |
| 180 | + $sToRender .= "<td style=\"background-color:$BGcolor\" width=\"80\">" . $oComment->getDate() . "<td></tr>\n"; | |
| 181 | + | |
| 182 | + // If this is the last subject line then close the table | |
| 183 | + if ($iNum == ($oThread->getNumberOfReplies())) { $sToRender .= "\n</table>\n\n";} | |
| 184 | + return $sToRender; | |
| 185 | +} | |
| 186 | + | |
| 187 | +/** | |
| 188 | + * Views a single thread comment with its text body | |
| 189 | + * | |
| 190 | + * @param $iDocumentID -> a valid Document ID | |
| 191 | + * @param $oComment -> a valid Comment Object | |
| 192 | + * @param $oUser -> a valid User Object (Logged in user) | |
| 193 | + */ | |
| 194 | +function getCommentBody($oComment, $iDocumentID, $oUser) { | |
| 195 | + global $default; | |
| 196 | + | |
| 197 | + $sHeading = "Document Comment"; | |
| 198 | + | |
| 199 | + $sToRender .= renderHeading($sHeading); | |
| 200 | + $sToRender .= renderDocumentPath($iDocumentID); | |
| 201 | + | |
| 202 | + $sToRender .= "<br><table width=100% border=0><tr ><td colspan=2><b>Author: </b>" . $oUser->getUserName() . "</td>\n"; | |
| 203 | + $sToRender .= "<td align=right>\n"; | |
| 204 | + $sToRender .= "<a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $iDocumentID . "&fReplyComment=1&fCommentID=" . $oComment->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/reply.gif\" border=\"0\" /></a>"; | |
| 205 | + $sToRender .= "</td><td width=30><img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" ></td></tr>\n"; | |
| 206 | + $sToRender .= "<tr><td width=\"1\" style=\"background-color:#F5F6EE;\" valign=\"top\"><b>Subject: </b></td><td width=405 style=\"background-color:#F5F6EE;\">"; | |
| 207 | + $sToRender .= "<a>" . $oComment->getSubject() . "</a>"; | |
| 208 | + $sToRender .= "</td><td colspan=2><b>Date: </b><font color=\"#056DCE\">" . $oComment->getDate() . "</font> </td></tr><tr><td colspan=4 valign=top>"; | |
| 209 | + $sToRender .= "<DIV> "; | |
| 210 | + $sToRender .= urldecode(str_replace("%0D%0A","<br>",str_replace("+", " ",$oComment->getBody()))); // Div Views as HTML | |
| 211 | + $sToRender .= "</DIV></td>"; | |
| 212 | + | |
| 213 | + $sToRender .= "</tr></table> "; | |
| 214 | + | |
| 215 | + return $sToRender; | |
| 216 | +} | |
| 217 | + | |
| 218 | +?> | |
| 0 | 219 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/removeDocTypeUI.inc
| ... | ... | @@ -54,7 +54,7 @@ function getDeleteSuccessPage() { |
| 54 | 54 | $sToRender .= "<tr></tr>\n"; |
| 55 | 55 | $sToRender .= "<tr></tr>\n"; |
| 56 | 56 | $sToRender .= "<tr>\n"; |
| 57 | - $sToRender .= "<td align = right><a href=\"$default->rootUrl/control.php?action=removeDocType\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 57 | + $sToRender .= "<td align = right><a href=\"$default->rootUrl/control.php?action=listDocTypes\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 58 | 58 | $sToRender .= "</tr>\n"; |
| 59 | 59 | $sToRender .= "</table>\n"; |
| 60 | 60 | |
| ... | ... | @@ -76,7 +76,7 @@ function getDeleteFailPage() { |
| 76 | 76 | $sToRender .= "<tr><td>Please Ensure that the Document Type has been Removed from ALL Folders</td></tr>\n"; |
| 77 | 77 | $sToRender .= "<tr></tr>\n"; |
| 78 | 78 | $sToRender .= "</tr>\n"; |
| 79 | - $sToRender .= "<tr><td align = right><a href=\"$default->rootUrl/control.php?action=removeDocType\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td></tr>\n"; | |
| 79 | + $sToRender .= "<tr><td align = right><a href=\"$default->rootUrl/control.php?action=listDocTypes\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td></tr>\n"; | |
| 80 | 80 | $sToRender .= "</table>\n"; |
| 81 | 81 | |
| 82 | 82 | return $sToRender; |
| ... | ... | @@ -105,7 +105,7 @@ function getDeleteButton($oDocType) { |
| 105 | 105 | global $default; |
| 106 | 106 | if (isset($oDocType)) { |
| 107 | 107 | return "<td align = right><input type=\"image\" src =\"$default->graphicsUrl/widgets/delete.gif\" value=\"submit\" border=\"0\"/></td>\n". |
| 108 | - "<td align = right><a href=\"$default->rootUrl/control.php?action=removeDocType\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 108 | + "<td align = right><a href=\"$default->rootUrl/control.php?action=listDocTypes\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | ?> | ... | ... |