1+ <?php
2+ /**
3+ * control.php
4+ *
5+ * ProcessMaker Open Source Edition
6+ * Copyright (C) 2004 - 2008 Colosa Inc.23
7+ *
8+ * This program is free software: you can redistribute it and/or modify
9+ * it under the terms of the GNU Affero General Public License as
10+ * published by the Free Software Foundation, either version 3 of the
11+ * License, or (at your option) any later version.
12+ *
13+ * This program is distributed in the hope that it will be useful,
14+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+ * GNU Affero General Public License for more details.
17+ *
18+ * You should have received a copy of the GNU Affero General Public License
19+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20+ *
21+ * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
22+ * Coral Gables, FL, 33134, USA, or email info@colosa.com.
23+ */
24+
25+ if ($ RBAC ->userCanAccess ( 'PM_SETUP ' ) != 1 && $ RBAC ->userCanAccess ( 'PM_FACTORY ' ) != 1 ) {
26+ G::SendTemporalMessage ( 'ID_USER_HAVENT_RIGHTS_PAGE ' , 'error ' , 'labels ' );
27+ //G::header('location: ../login/login');
28+ die ();
29+ }
30+
31+ $ G_MAIN_MENU = 'processmaker ' ;
32+ //$G_SUB_MENU = 'setup';
33+ $ G_ID_MENU_SELECTED = 'SETUP ' ;
34+ //$G_ID_SUB_MENU_SELECTED = 'WEBSERVICES';
35+
36+
37+ if (! extension_loaded ( 'soap ' )) {
38+ $ G_PUBLISH = new Publisher ();
39+ $ G_PUBLISH ->AddContent ( 'xmlform ' , 'xmlform ' , 'setup/wsMessage ' );
40+ G::RenderPage ( "publish " );
41+ } else {
42+ $ G_PUBLISH = new Publisher ();
43+ $ G_PUBLISH ->AddContent ( 'view ' , 'setup/webServicesTree ' );
44+ $ G_PUBLISH ->AddContent ( 'smarty ' , 'groups/groups_usersList ' , '' , '' , array () );
45+
46+ G::RenderPage ( "publish-treeview " , 'blank ' );
47+ }
48+
49+ $ link_Edit = G::encryptlink ( 'webServicesSetup ' );
50+ $ link_List = G::encryptlink ( 'webServicesList ' );
51+
52+ ?>
53+ <script>
54+ document.body.style.backgroundColor="#fff";
55+ var oAux = document.getElementById("publisherContent[0]");
56+ oAux.id = "publisherContent[666]";
57+ var currentGroup=false;
58+
59+ function webServicesSetup(){
60+ popupWindow('' , '<?php echo $ link_Edit ?> ' , 500 , 225 );
61+ }
62+
63+ function showFormWS( uid, element ){
64+
65+ currentGroup = uid;
66+ var oRPC = new leimnud.module.rpc.xmlhttp({
67+ url : '../setup/webServicesAjax',
68+ async : false,
69+ method: 'POST',
70+ args : 'action=showForm&wsID=' + uid
71+ });
72+ oRPC.make();
73+ document.getElementById('spanUsersList').innerHTML = oRPC.xmlhttp.responseText;
74+ if ((uid == 'NewCase') || (uid == 'NewCaseImpersonate')) {
75+ var scs=oRPC.xmlhttp.responseText.extractScript();scs.evalScript();
76+ }
77+ }
78+ function execWebService( uid) {
79+ var oRPC = new leimnud.module.rpc.xmlhttp({
80+ url : '../setup/webServicesAjax',
81+ async : true,
82+ method: 'POST',
83+ args : 'action=execWebService&wsID=' + uid
84+ });
85+
86+ oRPC.callback = function(rpc) {
87+
88+ var scs = rpc.xmlhttp.responseText.extractScript();
89+ document.getElementById('spanUsersList').innerHTML = rpc.xmlhttp.responseText;
90+ scs.evalScript();
91+
92+ }.extend(this);
93+
94+ oRPC.make();
95+
96+ }
97+
98+ submitThisForm = function(oForm) {
99+ var oAux;
100+ var bContinue = true;
101+ if(bContinue) {
102+ result = ajax_post(oForm.action, oForm, 'POST', function(response){
103+ var scs = response.extractScript();
104+ document.getElementById('spanUsersList').innerHTML = response;
105+ scs.evalScript();
106+ });
107+ refreshTree();
108+ }
109+ };
110+
111+
112+
113+
114+ function callbackWebService( ) {
115+ /*
116+ var oRPC = new leimnud.module.rpc.xmlhttp({
117+ url : '../setup/webServicesAjax',
118+ async : false,
119+ method: 'POST',
120+ args : 'action=execWebService&wsID=' + uid
121+ });
122+ oRPC.make();
123+ document.getElementById('spanUsersList').innerHTML = oRPC.xmlhttp.responseText;
124+ */
125+ document.getElementById('spanUsersList').innerHTML = 'hola';
126+ }
127+ function saveGroup( form ) {
128+ ajax_post( form.action, form, 'POST' );
129+ currentPopupWindow.remove();
130+ refreshTree();
131+ }
132+
133+ function refreshTree(){
134+ tree.refresh( document.getElementById("publisherContent[666]") , '<?php echo $ link_List ?> ');
135+ }
136+
137+ function showDetails(){
138+ var oRPC = new leimnud.module.rpc.xmlhttp({
139+ url : '../setup/webServicesAjax',
140+ async : false,
141+ method: 'POST',
142+ args : 'action=showDetails'
143+ });
144+ oRPC.make();
145+ document.getElementById('spanUsersList').innerHTML = oRPC.xmlhttp.responseText;
146+ }
147+ showDetails();
148+
149+ function showUploadFilesForm(){
150+ oIFrame = window.document.createElement('iframe');
151+ oIFrame.style.border = '0';
152+ oIFrame.style.width = '700px';
153+ oIFrame.style.height = '400px';
154+ oIFrame.src = 'webServicesAjax?action=showUploadFilesForm&';
155+ document.getElementById('spanUsersList').innerHTML = '';
156+ document.getElementById('spanUsersList').appendChild(oIFrame);
157+ }
158+ </script>
0 commit comments