Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("../inc/inc.Settings.php");
- include("../inc/inc.AccessUtils.php");
- include("../inc/inc.ClassAccess.php");
- include("../inc/inc.ClassDocument.php");
- include("../inc/inc.ClassFolder.php");
- include("../inc/inc.ClassGroup.php");
- include("../inc/inc.ClassUser.php");
- include("../inc/inc.DBAccess.php");
- include("../inc/inc.FileUtils.php");
- include("../inc/inc.Language.php");
- include("../inc/inc.ClassUI.php");
- include("../inc/inc.Authentication.php");
- if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
- UI::htmlStartPage(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))));
- UI::globalNavigation();
- UI::pageNavigation(getMLText("invalid_folder_id"));
- UI::htmlEndPage();
- exit;
- }
- $folderid = $_GET["folderid"];
- $folder = getFolder($folderid);
- if (!is_object($folder)) {
- UI::htmlStartPage(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))));
- UI::globalNavigation();
- UI::pageNavigation(getMLText("invalid_folder_id"));
- UI::htmlEndPage();
- exit;
- }
- $folderPathHTML = getFolderPathHTML($folder, true);
- UI::htmlStartPage(getMLText("folder_title", array("foldername" => $folder->getName())));
- UI::globalNavigation($folder);
- ?>
- <script language="javascript" src="../js/D2H_ctxt.js">
- </script>
- <script language="javascript">
- // Replace this with your NetHelp URL:
- helpURL = "../helpsystem/default.htm";
- helpID = 170;
- </script>
- <?php
- UI::pageNavigation($folderPathHTML, "view_folder", $folder);
- if ($folder->getAccessMode($user) < M_READWRITE) {
- UI::contentContainer(getMLText("access_denied"));
- UI::htmlEndPage();
- exit;
- }
- include("../out/out.javascript.php");
- UI::contentHeading(getMLText("add_document"));
- UI::contentContainerStart();
- // Retrieve a list of all users and groups that have review / approve
- // privileges.
- //if (isset ($_GET['pcmpath'])){
- $pcmpath = sanitizeString($_GET['pcmpath']);
- echo $pcmpath;
- //} else { $pcmpath = "";}
- $docAccess = $folder->getApproversList();
- ?>
- <form action="../op/op.AddDocument.php" enctype="multipart/form-data" method="post" name="form1" onsubmit="return checkForm();">
- <input type="Hidden" name="folderid" value="<?php print $folderid; ?>">
- <input type="hidden" name="MAX_FILE_SIZE" value="200000000">
- <table>
- <tr>
- <td><?php printMLText("local_file");?>:</td>
- <td><input type="File" name="userfile" ></td>
- </tr>
- <tr>
- <td><?php printMLText("docname");?>:</td>
- <td><input name="name"></td>
- </tr>
- <tr>
- <td><?php printMLText("comment");?>:</td>
- <td><textarea name="comment" rows="8" cols="50"></textarea></td>
- </tr>
- <tr>
- <td><?php printMLText("keywords");?>:</td>
- <td>
- <textarea name="keywords" rows="2" cols="50"></textarea><br>
- <? /* <a href="javascript:chooseKeywords();"><?php printMLText("use_default_keywords");?></a>
- <script language="JavaScript">
- var openDlg;
- function chooseKeywords() {
- openDlg = open("out.KeywordChooser.php", "openDlg", "width=500,height=400,scrollbars=yes,resizable=yes");
- }
- </script>*/ ?>
- </td>
- </tr>
- <tr>
- <td><?php printMLText("expires");?>:</td>
- <td>
- <input type="radio" name="expires" value="false" checked><?php printMLText("does_not_expire");?><br>
- <input type="radio" name="expires" value="true"><?php UI::printDateChooser(-1, "exp");?>
- </td>
- </tr>
- <? /*
- <tr>
- <td><?php printMLText("sequence");?>:</td>
- <td><?php UI::printSequenceChooser($folder->getDocuments());?></td>
- </tr>
- */?>
- </table>
- <dl>
- <dt><label for="assignDocReviewers"><input onClick="showBlock('docReviewers')" id="assignDocReviewers" type="checkbox" name="assignDocReviewers" value="1">Assign Reviewers</label></dt>
- <dd id="docReviewers">
- <div class="cbSelectTitle">Groups:</div>
- <div class="cbSelectContainer">
- <ul class="cbSelectList">
- <?php
- $isFirst=true;
- foreach ($docAccess["groups"] as $group) {
- ?>
- <li class="cbSelectItem<?php print ($isFirst ? " first" : "");?>"><?php echo "<label for='revGrp".$group->getID()."'><input id='revGrp".$group->getID()."' type='checkbox' name='grpReviewers[]' value='". $group->getID() ."'>".$group->getName()."</label>"; ?></li>
- <?php
- $isFirst=true;
- }
- ?>
- </ul>
- </div>
- <div class="cbSelectTitle cbSelectMargin">Individuals:</div>
- <div class="cbSelectContainer cbSelectMargin">
- <ul class="cbSelectList">
- <?php
- $isFirst=true;
- foreach ($docAccess["users"] as $user) {
- // $cid = $_COOKIE["mydms_compid"];
- // $uid = $user->getID();
- // $queryStr = "SELECT * FROM tblUsers WHERE id = ('".$user->getID()."')";
- // $resArr = $db->getResultArray($queryStr);
- // echo $resArr[9];
- // $check = $resArr[9];
- if ($_COOKIE["mydms_compid"] == $user->getcompID()){
- // $uid = $user->getID();
- ?>
- <li class="cbSelectItem<?php print ($isFirst ? " first" : "");?>"><?php echo "<label for='revInd".$user->getID()."'><input id='revInd".$user->getID()."' type='checkbox' name='indReviewers[]' value='". $user->getID() ."'>". $user->getFullName()." <".$user->getEmail().">"; ?></li>
- <?php
- }
- $isFirst=false;
- }
- ?>
- </ul>
- </div>
- <script language="JavaScript">if (!document.getElementById('assignDocReviewers').checked) hideBlock('docReviewers');</script>
- </dd>
- <?
- $folder2 = $_GET["folderid"];
- global $db;
- $queryStr = "SELECT * FROM tblFolders WHERE id = ".$folder2." LIMIT 0,1";
- $query = mysql_query($queryStr) or die ("error " . mysql_error());
- // $resArr = $db->getResult($queryStr);
- $result = mysql_fetch_assoc($query) or die ("error with array " . mysql_error());
- $defaultapprovers = $result["approvers"];
- if ($defaultapprovers == 'no'){
- ?>
- <dt><label for="assignDocApprovers"><input onClick="showBlock('docApprovers')" id="assignDocApprovers" type="checkbox" name="assignDocApprovers" value="1">Assign Approvers</label></dt>
- <dd id="docApprovers">
- <div class="cbSelectTitle">Groups:</div>
- <div class="cbSelectContainer">
- <ul class="cbSelectList">
- <?php
- $isFirst=true;
- foreach ($docAccess["groups"] as $group) {
- ?>
- <li class="cbSelectItem<?php print ($isFirst ? " first" : "");?>"><?php echo "<label for='appGrp".$group->getID()."'><input id='appGrp".$group->getID()."' type='checkbox' name='grpApprovers[]' value='". $group->getID() ."'>".$group->getName()."</label>"; ?></li>
- <?php
- $isFirst=false;
- }
- ?>
- </ul>
- </div>
- <div class="cbSelectTitle cbSelectMargin">Individuals:</div>
- <div class="cbSelectContainer cbSelectMargin">
- <ul class="cbSelectList">
- <?php
- $isFirst=true;
- foreach ($docAccess["users"] as $user) {
- if ($_COOKIE["mydms_compid"] == $user->getcompID()){
- ?>
- <li class="cbSelectItem<?php print ($isFirst ? " first" : "");?>"><?php echo "<label for='appInd".$user->getID()."'><input id='appInd".$user->getID()."' type='checkbox' name='indApprovers[]' value='". $user->getID() ."'>". $user->getFullName()." <".$user->getEmail().">"; ?></li>
- <?php
- }
- $isFirst=false;
- }
- ?>
- </ul>
- </div>
- <script language="JavaScript">if (!document.getElementById('assignDocApprovers').checked) hideBlock('docApprovers');</script>
- </dd><?php } ?>
- </dl>
- <p><?php printMLText("add_doc_reviewer_approver_warning")?></p>
- <p><input type="Submit" value="<?php printMLText("add_document");?>"></p>
- </form>
- <?php
- UI::contentContainerEnd();
- UI::htmlEndPage();
- ?>
Add Comment
Please, Sign In to add comment