Commit be79881b174ed5750c294c47a017238d6eb41399
1 parent
1a5a7cb4
*** empty log message ***
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1852 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
31 additions
and
7 deletions
presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsBL.php
| @@ -16,6 +16,7 @@ require_once("../../../../config/dmsDefaults.php"); | @@ -16,6 +16,7 @@ require_once("../../../../config/dmsDefaults.php"); | ||
| 16 | 16 | ||
| 17 | if (checkSession()) { | 17 | if (checkSession()) { |
| 18 | if (isset($fFolderID) && isset($fFolderCollaborationID)) { | 18 | if (isset($fFolderID) && isset($fFolderCollaborationID)) { |
| 19 | + echo $fUserID; | ||
| 19 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | 20 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); |
| 20 | require_once("$default->fileSystemRoot/lib/foldermanagement/FolderCollaboration.inc"); | 21 | require_once("$default->fileSystemRoot/lib/foldermanagement/FolderCollaboration.inc"); |
| 21 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | 22 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); |
| @@ -29,8 +30,7 @@ if (checkSession()) { | @@ -29,8 +30,7 @@ if (checkSession()) { | ||
| 29 | $oFolderCollaboration = FolderCollaboration::get($fFolderCollaborationID); | 30 | $oFolderCollaboration = FolderCollaboration::get($fFolderCollaborationID); |
| 30 | if ($oFolderCollaboration->hasDocumentInProcess()) { | 31 | if ($oFolderCollaboration->hasDocumentInProcess()) { |
| 31 | //can't add document links if a document is currently undergoing the | 32 | //can't add document links if a document is currently undergoing the |
| 32 | - //collaboration process | ||
| 33 | - echo "in here"; | 33 | + //collaboration process |
| 34 | 34 | ||
| 35 | } if (isset($fForAdd)) { | 35 | } if (isset($fForAdd)) { |
| 36 | //we are adding a new dependant document | 36 | //we are adding a new dependant document |
| @@ -38,7 +38,8 @@ if (checkSession()) { | @@ -38,7 +38,8 @@ if (checkSession()) { | ||
| 38 | $oPatternCustom = & new PatternCustom(); | 38 | $oPatternCustom = & new PatternCustom(); |
| 39 | $oPatternCustom->setHtml(getAddPage($fFolderCollaborationID, $fFolderID, (isset($fUnitID) ? $fUnitID : -1), (isset($fDocumentTitle) ? $fDocumentTitle : ""))); | 39 | $oPatternCustom->setHtml(getAddPage($fFolderCollaborationID, $fFolderID, (isset($fUnitID) ? $fUnitID : -1), (isset($fDocumentTitle) ? $fDocumentTitle : ""))); |
| 40 | $main->setCentralPayload($oPatternCustom); | 40 | $main->setCentralPayload($oPatternCustom); |
| 41 | - $main->setFormAction("document.MainForm.action = " . $_SERVER["PHP_SELF"] . "?fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID&fForAdd=1;document.MainForm.submit();"); | 41 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID&fForStore=1"); |
| 42 | + $main->setHasRequiredFields(true); | ||
| 42 | $main->render(); | 43 | $main->render(); |
| 43 | } else { | 44 | } else { |
| 44 | include_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | 45 | include_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsUI.inc
| @@ -82,14 +82,15 @@ function getAddPage($iFolderCollaborationID, $iFolderID, $iUnitID, $sDocumentTit | @@ -82,14 +82,15 @@ function getAddPage($iFolderCollaborationID, $iFolderID, $iUnitID, $sDocumentTit | ||
| 82 | $sToRender .= "<td>User</td><td>" . getUserDropDown($iUnitID) . "</td>\n"; | 82 | $sToRender .= "<td>User</td><td>" . getUserDropDown($iUnitID) . "</td>\n"; |
| 83 | $sToRender .= "</tr>\n"; | 83 | $sToRender .= "</tr>\n"; |
| 84 | $sToRender .= "<tr>\n"; | 84 | $sToRender .= "<tr>\n"; |
| 85 | - $sToRender .= "<td>Template document</td><td><input type=\"text\" /></td>\n"; | 85 | + $sToRender .= "<td>Template document</td><td><input type=\"text\" DISABLED name=\"fTemplateDocument\" /><input type=\"button\" value=\"Browse\" onClick=\"newWindow('http://ktdev/control.php?action=templateBrowse','window2')\"></td>\n"; |
| 86 | $sToRender .= "</tr>\n"; | 86 | $sToRender .= "</tr>\n"; |
| 87 | $sToRender .= "<tr>\n"; | 87 | $sToRender .= "<tr>\n"; |
| 88 | - $sToRender .= "<td><table><tr><td><input type=\"image\" src=\"$default->graphicsUrl/widgets/add.gif\" border=\"0\"/></td><td></td></tr></table>\n"; | 88 | + $sToRender .= "<td><table><tr><td><input type=\"image\" src=\"$default->graphicsUrl/widgets/done.gif\" border=\"0\"/></td><td><a href=\"" . $default->rootUrl . "\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"/></a></td></tr></table>\n"; |
| 89 | $sToRender .= "</tr>\n"; | 89 | $sToRender .= "</tr>\n"; |
| 90 | - $sToRender .= "</table>\n"; | 90 | + $sToRender .= "</table>\n"; |
| 91 | + $sToRender .= "<input type=\"hidden\" name=\"fTemplateDocumentID\" value=\"\" />\n"; | ||
| 91 | 92 | ||
| 92 | - return $sToRender; | 93 | + return $sToRender . "\n\n" . getValidationJavaScript() . "\n\n" . getBrowseJavaScript(); |
| 93 | } | 94 | } |
| 94 | 95 | ||
| 95 | function getUserDropDown($iUnitID) { | 96 | function getUserDropDown($iUnitID) { |
| @@ -112,5 +113,27 @@ function getUnitDropDown($iFolderCollaborationID, $iFolderID, $iUnitID) { | @@ -112,5 +113,27 @@ function getUnitDropDown($iFolderCollaborationID, $iFolderID, $iUnitID) { | ||
| 112 | return $oPatternListBox->render(); | 113 | return $oPatternListBox->render(); |
| 113 | } | 114 | } |
| 114 | 115 | ||
| 116 | +function getValidationJavaScript() { | ||
| 117 | + $sToRender .= "\n\n<script language=\"javascript\">\n<!--\n"; | ||
| 118 | + $sToRender .= "function validateForm(theForm) {\n"; | ||
| 119 | + $sToRender .= "\tif (!(validRequired(theForm.fDocumentTitle,'Document title') && validRequired(theForm.fUserID,'User'))) {\n"; | ||
| 120 | + $sToRender .= "\t\treturn false;\n\t}\n"; | ||
| 121 | + $sToRender .= "return true;\n}\n"; | ||
| 122 | + $sToRender .= "//-->\n</script>\n\n"; | ||
| 123 | + return $sToRender; | ||
| 124 | +} | ||
| 125 | + | ||
| 126 | +function getBrowseJavaScript() { | ||
| 127 | + $sToRender = "<script language=\"JavaScript\"><!--\n "; | ||
| 128 | + $sToRender .= "function newWindow(file,window) {\n "; | ||
| 129 | + $sToRender .= "\tmsgWindow=open(file,window,'resizable=yes,scrollbars=yes, width=400,height=600');\n "; | ||
| 130 | + $sToRender .= "\tif (msgWindow.opener == null) msgWindow.opener = self; \n "; | ||
| 131 | + $sToRender .= "}\n"; | ||
| 132 | + $sToRender .= "//--></script>\n"; | ||
| 133 | + return $sToRender; | ||
| 134 | +} | ||
| 135 | + | ||
| 136 | + | ||
| 137 | + | ||
| 115 | 138 | ||
| 116 | ?> | 139 | ?> |
| 117 | \ No newline at end of file | 140 | \ No newline at end of file |