Commit 65c819c2a7df26b7d41e9759d9bad7e966804b23

Authored by Michael Joseph
1 parent 57455f25

remove constraint that originators are the only ones allow to request web publishing


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1542 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php
... ... @@ -160,42 +160,30 @@ if (checkSession()) {
160 160 if (isset($fWebSiteID)) {
161 161 // user wishes to publish document
162 162 $oDocument = Document::get($fDocumentID);
163   - if ($_SESSION["userID"] == $oDocument->getCreatorID()) {
164   - //only the creator can send the document for publishing
165   - $aWebDocument = WebDocument::getList("document_id = $fDocumentID");
166   - $oWebDocument = $aWebDocument[0];
167   - $oWebDocument->setStatusID(PENDING);
168   - $oWebDocument->setWebSiteID($fWebSiteID);
169   - if ($oWebDocument->update()) {
170   - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
171   - $oDocumentTransaction = & new DocumentTransaction($fDocumentID, "Document sent for web publishing", UPDATE);
172   - $oDocumentTransaction->create();
173   - $oDocument = Document::get($fDocumentID);
174   - Document::notifyWebMaster($fDocumentID, $fComment);
175   - $oPatternCustom = & new PatternCustom();
176   - $oPatternCustom->setHtml(getEditPage($oDocument));
177   - $main->setCentralPayload($oPatternCustom);
178   - $main->setErrorMessage("The document has been marked as pending publishing and the web publisher has been notified");
179   - $main->render();
180   -
181   - } else {
182   - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
183   - $oDocument = Document::get($fDocumentID);
184   - $oPatternCustom = & new PatternCustom();
185   - $oPatternCustom->setHtml(getEditPage($oDocument));
186   - $main->setCentralPayload($oPatternCustom);
187   - $main->setErrorMessage("An error occured while attempting to update the document for publishing");
188   - $main->render();
189   - }
  163 + $aWebDocument = WebDocument::getList("document_id = $fDocumentID");
  164 + $oWebDocument = $aWebDocument[0];
  165 + $oWebDocument->setStatusID(PENDING);
  166 + $oWebDocument->setWebSiteID($fWebSiteID);
  167 + if ($oWebDocument->update()) {
  168 + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
  169 + $oDocumentTransaction = & new DocumentTransaction($fDocumentID, "Document sent for web publishing", UPDATE);
  170 + $oDocumentTransaction->create();
  171 + $oDocument = Document::get($fDocumentID);
  172 + Document::notifyWebMaster($fDocumentID, $fComment);
  173 + $oPatternCustom = & new PatternCustom();
  174 + $oPatternCustom->setHtml(getEditPage($oDocument));
  175 + $main->setCentralPayload($oPatternCustom);
  176 + $main->setErrorMessage("The document has been marked as pending publishing and the web publisher has been notified");
  177 + $main->render();
  178 +
190 179 } else {
191   - // you're can't publish if you're not the originator
192 180 require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
193 181 $oDocument = Document::get($fDocumentID);
194 182 $oPatternCustom = & new PatternCustom();
195 183 $oPatternCustom->setHtml(getEditPage($oDocument));
196 184 $main->setCentralPayload($oPatternCustom);
197   - $main->setErrorMessage("You can't publish this document because you're not the document originator");
198   - $main->render();
  185 + $main->setErrorMessage("An error occured while attempting to update the document for publishing");
  186 + $main->render();
199 187 }
200 188 } else {
201 189 // prompt for the website to publish to
... ...