Commit f23f543b1588015adb19cd5bce1bc0112aceaa7a
1 parent
2566701f
update form variables to suit more generic template browser
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1896 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
14 additions
and
12 deletions
presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsBL.php
| ... | ... | @@ -33,12 +33,12 @@ if (checkSession()) { |
| 33 | 33 | |
| 34 | 34 | if (Permission::userHasFolderWritePermission($fFolderID)) { |
| 35 | 35 | //user has folder write permission |
| 36 | - if (isset($fForStore)) { | |
| 36 | + if (isset($fForStore)) { | |
| 37 | 37 | $oDependantDocumentTemplate; |
| 38 | - if ($fTemplateDocumentID == "-1") { | |
| 38 | + if ($fTargetDocumentID == "-1") { | |
| 39 | 39 | $oDependantDocumentTemplate = & new DependantDocumentTemplate($fDocumentTitle, $fUserID, $fFolderCollaborationID); |
| 40 | 40 | } else { |
| 41 | - $oDependantDocumentTemplate = & new DependantDocumentTemplate($fDocumentTitle, $fUserID, $fFolderCollaborationID, $fTemplateDocumentID); | |
| 41 | + $oDependantDocumentTemplate = & new DependantDocumentTemplate($fDocumentTitle, $fUserID, $fFolderCollaborationID, $fTargetDocumentID); | |
| 42 | 42 | } |
| 43 | 43 | if (!($oDependantDocumentTemplate->create())) { |
| 44 | 44 | include_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| ... | ... | @@ -69,7 +69,7 @@ if (checkSession()) { |
| 69 | 69 | include_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 70 | 70 | |
| 71 | 71 | $oPatternCustom = & new PatternCustom(); |
| 72 | - $oPatternCustom->setHtml(getAddPage($fFolderCollaborationID, $fFolderID, (isset($fUnitID) ? $fUnitID : -1), (isset($fDocumentTitle) ? $fDocumentTitle : ""), (isset($fTemplateDocument) ? $fTemplateDocument : ""), (isset($fDocumentID) ? $fDocumentID : "") )); | |
| 72 | + $oPatternCustom->setHtml(getAddPage($fFolderCollaborationID, $fFolderID, (isset($fUnitID) ? $fUnitID : -1), (isset($fDocumentTitle) ? $fDocumentTitle : ""), (isset($fDocument) ? $fDocument : ""), (isset($fTargetDocumentID) ? $fTargetDocumentID : "") )); | |
| 73 | 73 | $main->setCentralPayload($oPatternCustom); |
| 74 | 74 | $main->setFormAction($_SERVER["PHP_SELF"] . "?fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID&fForStore=1"); |
| 75 | 75 | $main->setHasRequiredFields(true); |
| ... | ... | @@ -107,7 +107,7 @@ if (checkSession()) { |
| 107 | 107 | $oDependantDocumentTemplate = DependantDocumentTemplate::get($fDependantDocumentTemplateID); |
| 108 | 108 | $oDependantDocumentTemplate->setDefaultUserID($fUserID); |
| 109 | 109 | $oDependantDocumentTemplate->setDocumentTitle($fDocumentTitle); |
| 110 | - $oDependantDocumentTemplate->setTemplateDocumentID((isset($fTemplateDocumentID) ? $fTemplateDocumentID : null)); | |
| 110 | + $oDependantDocumentTemplate->setTemplateDocumentID((isset($fTargetDocumentID) ? $fDocument : null)); | |
| 111 | 111 | $oDependantDocumentTemplate->update(); |
| 112 | 112 | |
| 113 | 113 | redirect("$default->rootUrl/control.php?action=viewDependantDocument&fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID"); | ... | ... |
presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsUI.inc
| ... | ... | @@ -35,7 +35,7 @@ function getDocumentLinkFolderCollaborationData($iFolderCollaborationID) { |
| 35 | 35 | $aColumnTypes = array(1,1,3,3,3); |
| 36 | 36 | //$aDBColumnArray = array("id","group_folder_approval_link_id","template_document_id"); |
| 37 | 37 | $aDBColumnArray = array("id","group_folder_approval_link_id","folder_id"); |
| 38 | - //$aQueryStringVariableNames = array("fDependantDocumentTemplateID", "fFolderCollaborationID", "fDocumentID"); | |
| 38 | + //$aQueryStringVariableNames = array("fDependantDocumentTemplateID", "fFolderCollaborationID", "fTargetDocumentID"); | |
| 39 | 39 | $aQueryStringVariableNames = array("fDependantDocumentTemplateID","fFolderCollaborationID","fFolderID"); |
| 40 | 40 | $aLinkURLs = array(2=>"$default->rootUrl/control.php?action=viewDocument", 3=>"$default->rootUrl/control.php?action=viewDependantDocument&fForEdit=1", 4=>"$default->rootUrl/control.php?action=deleteDependantDocument"); |
| 41 | 41 | |
| ... | ... | @@ -88,10 +88,10 @@ function getEditPage($iFolderID, $iDependantDocumentID, $iFolderCollaborationID, |
| 88 | 88 | $bAddNetscapeScript = false; |
| 89 | 89 | if (! (($default->phpSniff->property("browser") == "moz") && ($default->phpSniff->property("version") <= "4.79")) ) { |
| 90 | 90 | //for any other browser but netscape 4.7 do this |
| 91 | - $sToRender .= "<td>Template document</td><td><input type=\"text\" DISABLED name=\"fTemplateDocument\" value=\"$sTemplateDocumentName\" /><input type=\"button\" value=\"Browse\" onClick=\"newWindow('http://ktdev/control.php?action=templateBrowse','window2')\"></td>\n"; | |
| 91 | + $sToRender .= "<td>Template document</td><td><input type=\"text\" DISABLED name=\"fTargetDocument\" value=\"$sTemplateDocumentName\" /><input type=\"button\" value=\"Browse\" onClick=\"newWindow('http://ktdev/control.php?action=templateBrowse','window2')\"></td>\n"; | |
| 92 | 92 | }else { |
| 93 | 93 | //for netscape 4.7 do this |
| 94 | - $sToRender .= "<td>Template document</td><td><input type=\"text\" value=\"$sTemplateDocumentName\" name=\"fTemplateDocument\" onblur=\"disable(document.MainForm.fTemplateDocument);\" /><input type=\"button\" value=\"Browse\" onClick=\"disable(document.MainForm.fTemplateDocument);newWindow('http://ktdev/control.php?action=templateBrowse','window2')\"></td>\n"; | |
| 94 | + $sToRender .= "<td>Template document</td><td><input type=\"text\" value=\"$sTemplateDocumentName\" name=\"fTargetDocument\" onblur=\"disable(document.MainForm.fTargetDocument);\" /><input type=\"button\" value=\"Browse\" onClick=\"disable(document.MainForm.fTargetDocument);newWindow('http://ktdev/control.php?action=templateBrowse','window2')\"></td>\n"; | |
| 95 | 95 | $bAddNetscapeScript = true; |
| 96 | 96 | } |
| 97 | 97 | $sToRender .= "</tr>\n"; |
| ... | ... | @@ -99,7 +99,7 @@ function getEditPage($iFolderID, $iDependantDocumentID, $iFolderCollaborationID, |
| 99 | 99 | $sToRender .= "<td><table><tr><td><input type=\"image\" src=\"$default->graphicsUrl/widgets/update.gif\" border=\"0\"/></td><td><a href=\"" . $default->rootUrl . "/control.php?action=viewDependantDocument&fFolderID=$iFolderID&fFolderCollaborationID=$iFolderCollaborationID\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"/></a></td></tr></table>\n"; |
| 100 | 100 | $sToRender .= "</tr>\n"; |
| 101 | 101 | $sToRender .= "</table>\n"; |
| 102 | - $sToRender .= "<input type=\"hidden\" name=\"fTemplateDocumentID\" value=\"-1\" />\n"; | |
| 102 | + $sToRender .= "<input type=\"hidden\" name=\"fTargetDocumentID\" value=\"-1\" />\n"; | |
| 103 | 103 | |
| 104 | 104 | return $sToRender . "\n\n" . getValidationJavaScript() . "\n\n" . getBrowseJavaScript() . ($bAddNetscapeScript ? getNetscapeDisableScript() : ""); |
| 105 | 105 | } |
| ... | ... | @@ -126,10 +126,12 @@ function getAddPage($iFolderCollaborationID, $iFolderID, $iUnitID, $sDocumentTit |
| 126 | 126 | $bAddNetscapeScript = false; |
| 127 | 127 | if (! (($default->phpSniff->property("browser") == "moz") && ($default->phpSniff->property("version") <= "4.79")) ) { |
| 128 | 128 | //for any other browser but netscape 4.7 do this |
| 129 | - $sToRender .= "<td>Template document</td><td><input type=\"text\" DISABLED name=\"fTemplateDocument\" value=\"$sTemplateDocument\" /><input type=\"button\" value=\"Browse\" onClick=\"newWindow('http://ktdev/control.php?action=templateBrowse','window2')\"></td>\n"; | |
| 129 | + //$sToRender .= "<td>Template document</td><td><input type=\"text\" DISABLED name=\"fTargetDocument\" value=\"$sTemplateDocument\" /><input type=\"button\" value=\"Browse\" onClick=\"newWindow('http://ktdev/control.php?action=templateBrowse','window2')\"></td>\n"; | |
| 130 | + $sToRender .= "<td>Template document</td><td><input type=\"text\" DISABLED name=\"fTargetDocument\" value=\"$sTemplateDocument\" /><input type=\"button\" value=\"Browse\" onClick=\"newWindow('$default->rootUrl/control.php?action=templateBrowse','window2')\"></td>\n"; | |
| 130 | 131 | }else { |
| 131 | 132 | //for netscape 4.7 do this |
| 132 | - $sToRender .= "<td>Template document</td><td><input type=\"text\" name=\"fTemplateDocument\" onblur=\"disable(document.MainForm.fTemplateDocument);\" /><input type=\"button\" value=\"Browse\" onClick=\"disable(document.MainForm.fTemplateDocument);newWindow('http://ktdev/control.php?action=templateBrowse','window2')\"></td>\n"; | |
| 133 | + //$sToRender .= "<td>Template document</td><td><input type=\"text\" name=\"fTargetDocument\" onblur=\"disable(document.MainForm.fTargetDocument);\" /><input type=\"button\" value=\"Browse\" onClick=\"disable(document.MainForm.fTargetDocument);newWindow('http://ktdev/control.php?action=templateBrowse','window2')\"></td>\n"; | |
| 134 | + $sToRender .= "<td>Template document</td><td><input type=\"text\" name=\"fTargetDocument\" onblur=\"disable(document.MainForm.fTargetDocument);\" /><input type=\"button\" value=\"Browse\" onClick=\"disable(document.MainForm.fTargetDocument);newWindow('$default->rootUrl/control.php?action=templateBrowse','window2')\"></td>\n"; | |
| 133 | 135 | $bAddNetscapeScript = true; |
| 134 | 136 | } |
| 135 | 137 | $sToRender .= "</tr>\n"; |
| ... | ... | @@ -137,7 +139,7 @@ function getAddPage($iFolderCollaborationID, $iFolderID, $iUnitID, $sDocumentTit |
| 137 | 139 | $sToRender .= "<td><table><tr><td><input type=\"image\" src=\"$default->graphicsUrl/widgets/done.gif\" border=\"0\"/></td><td><a href=\"" . $default->rootUrl . "/control.php?action=viewDependantDocument&fFolderID=$iFolderID&fFolderCollaborationID=$iFolderCollaborationID\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"/></a></td></tr></table>\n"; |
| 138 | 140 | $sToRender .= "</tr>\n"; |
| 139 | 141 | $sToRender .= "</table>\n"; |
| 140 | - $sToRender .= "<input type=\"hidden\" name=\"fTemplateDocumentID\" value=\"-1\" />\n"; | |
| 142 | + $sToRender .= "<input type=\"hidden\" name=\"fTargetDocumentID\" value=\"-1\" />\n"; | |
| 141 | 143 | |
| 142 | 144 | return $sToRender . "\n\n" . getValidationJavaScript() . "\n\n" . getBrowseJavaScript() . ($bAddNetscapeScript ? getNetscapeDisableScript() : ""); |
| 143 | 145 | } | ... | ... |