//Main Global variable definition. These constants and literals are //used throughout the application var scrolltable = "folder"; var type = "Folder"; var blankalpha = ""; var zeronum = 0; var prevlabel = "Page Up"; var nextlabel = "Page Dn"; var result = 0; var backvalue = "Back"; var administrator = "A"; var returnval = "Return to Folder List"; var toplabel = "Top of List"; // end globals /* The following logic is needed because when coming from sa06, the group/phase is passed as a parm on an HREF command. When this page is accessed via the "back button" from sa07a or pageup or down from sa07, a hidden object is used to pass the group/phase. It appears that the encoding of spaces is treated differently for these two different data types. Therefore an "unescape" command is needed when coming from sa07, but not when coming from sa06*/ if((request.back == backvalue)||(request.prevbutt==prevlabel)||(request.prevbutt==toplabel)||(request.nextbutt==nextlabel)||(request.back==returnval)) { request.group = unescape(request.group); } groupHeader(request.group, type); write("
"); write("

Choose a Folder from the " + request.group + " Phase

") //The following code determins if the user has pressed page up or page down // and sets folderpagenum, which scrolls accordingly if (request.prevbutt == prevlabel) {client.folderpagenum = request.prevpagenum} if (request.prevbutt == toplabel) {client.folderpagenum = 1} if(request.nextbutt==nextlabel) {client.folderpagenum = request.nextpagenum} function CreateModDel_SA07() { //this logic creates the mod and delete buttons for users with system admin authority write("
"); write("
"); } function CursorMaster_SA07() //this is the cursor SELECT statement executed by a user with System Administration // authority. { // This first SELECT gets the scroll keys from the scroll key table temppage3 = new TopPage(client.userid, scrolltable, client.folderpagenum, blankalpha, blankalpha, zeronum, zeronum); temppage3.sel_scroll(); //Once the starting point on the page has been determined, // the cursor for the application specific data can be selected FolderList = database.cursor('SELECT folderid, foldername, folder.interestgroupid, folder.description, interestgroup.interestgroup FROM folder, interestgroup WHERE group = "' + request.group + '" AND folder.interestgroupid = interestgroup.interestgroupid AND ((foldername > "' + temppage3.alphakey1 + '") OR (foldername = "' + temppage3.alphakey1 + '" AND interestgroup.interestgroup >= "' + temppage3.alphakey2 + '")) ORDER BY foldername, interestgroup.interestgroup '); } function CursorUser_SA07() //this is the cursor SELECT statement executed by a user standard User // authority. { // This first SELECT gets the scroll keys from the scroll key table temppage4 = new TopPage(client.userid, scrolltable, client.folderpagenum, blankalpha, blankalpha, zeronum, zeronum); temppage4.sel_scroll(); //Once the starting point on the page has been determined, // the cursor for the application specific data can be selected FolderList = database.cursor('SELECT folderid, foldername, folder.interestgroupid, folder.description, interestgroup.interestgroup FROM folder, interestgroup WHERE group = "' + request.group + '" AND folder.interestgroupid = interestgroup.interestgroupid AND ((foldername > "' + temppage4.alphakey1 + '") OR (foldername = "' + temppage4.alphakey1 + '" AND interestgroup.interestgroup >= "' + temppage4.alphakey2 + '")) AND (folder.interestgroupid = "'+client.interestgroupid+'" OR folder.interestgroupid = 1)ORDER BY foldername, interestgroup.interestgroup '); } function BuildTableHeader_SA07() // Building the column headers for the table { write("
"); write(""); write(""); if(client.accesslevel == administrator) {write(""); write("");} write(""); write(""); write(""); } function BuildTableData_SA07() // Building the selected data and inserting it into the table. Buttons // Are added for modify/delete functionality { var keepfetching = "true"; var indx=1; var printhead = "false"; while(keepfetching == "true") { if(FolderList.next()) {if(printhead == "false") {BuildTableHeader_SA07(); printhead = "true"; } if(indx<11) { if(client.accesslevel == administrator) {CreateModDel_SA07()} foldername = escape(FolderList.foldername); write(""); write(""); write(""); indx++; } else {keepfetching = "false";} } else {keepfetching = "false"; indx = 10;} // needed to prevent page down from printing if 10th row is last one. }; // end WHILE loop // If no rows are found, a message is displayed to the user. if((printhead=="false") && (client.folderpagenum==1)) { Print_No_Found();} // Since the table on the page contains 10 rows, the 11th row is saved. // The data from this row becomes the next entry in Scrollkey, and will tell // the application where to start when the user presses "Page Dn" if(indx == 11) { var nextpage = 0; nextpage = parseInt(client.folderpagenum) + 1; var folname = ""+FolderList.foldername+""; var intgroup = ""+FolderList.interestgroup+""; FolderList.close() temppage1 = new TopPage(client.userid, scrolltable, nextpage, folname, intgroup, zeronum, zeronum); newpageresult = temppage1.ins_scroll(); // If this row already exists, alpha or numeric key data is updated in case // a row has been updated since the user last accessed the page. if(newpageresult !=0) {temppage1.upd_scroll();}; }; write("
Existing Folders, Page " + client.folderpagenum + "
ModDelFolder NameInterest GroupDescription
" + FolderList.foldername + "" + FolderList.interestgroup + "" + FolderList.description + "

"); return indx; } function DeterminePaging_SA07() { write("

"); write(""); // The Top button is displayed if the user in on page > 2 if (client.folderpagenum >2) {CreateTopButton_SA07()}; // The previous button is not displayed if the user in on page 1 if (client.folderpagenum != 1) {CreatePrevButton_SA07()}; // The next button is not displayed if there is no more data to display if(indx == 11) {CreateNextButton_SA07()}; } function CreateTopButton_SA07() { // the page number is set back to 1 on reentry" //this statement packs the spaces with plus signs. var escapegroup = escape(request.group); write(""); } function CreatePrevButton_SA07() { // the page number is set back one value when the user presses "Page Up" var prevpage = parseInt(client.folderpagenum) - 1; //this statement packs the spaces with plus signs. var escapegroup = escape(request.group); write(""); } function CreateNextButton_SA07() { // the page number is set forward one value when the user presses "Page Dn" var newpage = parseInt(client.folderpagenum) + 1; //this statement packs the spaces with plus signs. var escapegroup = escape(request.group); write(""); } function AddButton_SA07() { // the group name is sent because it needs to be returned by sa07a //this statement packs the spaces with plus signs. var escapegroup = escape(request.group); write(""); } if((client.folderpagenum == "null")||(client.folderpagenum == null)) { // Creating the initial Scrollkey value for the first page client.folderpagenum = 1 temppage2 = new TopPage(client.userid, scrolltable, 1, blankalpha, blankalpha, zeronum, zeronum); pageoneresult = temppage2.ins_scroll(); if(pageoneresult !=0) {temppage2.upd_scroll();} } if(client.accesslevel == administrator) //Different SQL and display for users versus administrators. {CursorMaster_SA07();} else {CursorUser_SA07();} indx = BuildTableData_SA07(); DeterminePaging_SA07(); if(client.accesslevel == administrator) //Only an administrator can add a new folder {AddButton_SA07();}
"); write(""); write(""); write("
"); write(""); write(""); write(""); write("
"); write(""); write(""); write(""); write("
"); write(""); write(""); write("