Project

General

Profile

1
 /*
2
  *   '$RCSfile$'
3
  *     Purpose: Basic funtions to support showing the schedule workflows 
4
  *              pages
5
  *   Copyright: 2009 Regents of the University of California and the
6
  *               National Center for Ecological Analysis and Synthesis
7
  *     Authors: Michael Daigle
8
  *
9
  *    '$Author: leinfelder $'
10
  *      '$Date: 2008-06-17 13:16:32 -0700 (Tue, 17 Jun 2008) $'
11
  *  '$Revision: 4006 $'
12
  *
13
  * This program is free software; you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License as published by
15
  * the Free Software Foundation; either version 2 of the License, or
16
  * (at your option) any later version.
17
  *
18
  * This program is distributed in the hope that it will be useful,
19
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
  * GNU General Public License for more details.
22
  *
23
  * You should have received a copy of the GNU General Public License
24
  * along with this program; if not, write to the Free Software
25
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
  */ 
27
  
28
/* puts together the url to get the workflow section of a page given the workflow 
29
 * id.  
30
 *  Params:
31
 *    url - metacat url to hit
32
 *    workflowId - get all runs for this id 
33
 *    workflowName - used for display purposes.  
34
 *    divId - the name of the div where the results should be put
35
 */  
36
function getAccessSection(url, workflowId, workflowname, divId) {
37
	var requestUrl = url + '?action=getaccesscontrol&docid=' + workflowId + 
38
		"&workflowname=" + workflowname + '&qformat=sanparks';
39
	//alert('getAccessSection - url: ' + requestUrl);
40
	var submitResults = submitUrlIntoDiv(requestUrl, divId);
41
}
42

    
43
function setPermission(formObj) {
44
	
45
	//alert("principal: " + formObj.principal.value);		
46
	if ( formObj.principal.value == null || formObj.principal.value == "") {
47
		alert("you must provide a pricipal");
48
		return;
49
	}
50

    
51
	var permission = "";
52
	if (formObj.permission_read_checkbox.checked) {
53
		permission += "READ";
54
	}
55
	if (formObj.permission_write_checkbox.checked) {
56
		if (permission.length > 0) {
57
			permission += "|";
58
		}
59
		permission += "WRITE";
60
	}
61
	if (formObj.permission_chmod_checkbox.checked) {
62
		if (permission.length > 0) {
63
			permission += "|";
64
		}
65
		permission += "CHANGEPERMISSION";
66
	}
67
//	if (formObj.permission_all_checkbox.checked) {
68
//		if (permission.length > 0) {
69
//			permission += "|";
70
//		}
71
//		permission += "ALL";
72
//	}
73
	//alert("permission: " + permission);
74
	formObj.permission.value = permission;
75
	
76
	if (permission == "") {
77
		alert("You must choose a permission value");
78
		return;
79
	}
80
}
81

    
82
function doNothing() {
83
}
84

    
85
	
(36-36/38)