瀏覽代碼

fixed proces editor namespace bug

Piotr Labudda 9 年之前
父節點
當前提交
ccca52dab3
共有 2 個文件被更改,包括 36 次插入35 次删除
  1. 3 2
      SE/se-lib/Route/UrlAction/ProcesEditor.php
  2. 33 33
      SE/static/procesEditor.js

+ 3 - 2
SE/se-lib/Route/UrlAction/ProcesEditor.php

@@ -6,6 +6,7 @@ Lib::loadClass('Config');
 Lib::loadClass('UI');
 Lib::loadClass('Request');
 Lib::loadClass('Response');
+Lib::loadClass('Api_WfsNs');
 
 class Route_UrlAction_ProcesEditor extends RouteBase {// TODO: UrlActionBase @see Route_UrlAction
 
@@ -132,9 +133,9 @@ class Route_UrlAction_ProcesEditor extends RouteBase {// TODO: UrlActionBase @se
 				</div>
 			</div>
 		</div>
-		<script>var BASE_URL = '<?= Request::getPathUri(); ?>';var mainProces_id = <?= $id; ?>;</script>
+		<script>var BASE_URL = '<?= Request::getPathUri(); ?>';var BASE_WFS_URL = '<?= Api_WfsNs::getBaseWfsUri(); ?>';var mainProces_id = <?= $id; ?>;</script>
 		<script src="static/sweetalert2.min.js"></script>
-		<script src="static/procesEditor.js?v=18<?php if (V::get('DBG', '', $_GET)) echo "&_time=" . time(); ?>"></script>
+		<script src="static/procesEditor.js?v=19<?php if (V::get('DBG', '', $_GET)) echo "&_time=" . time(); ?>"></script>
 <?php
 	}
 

+ 33 - 33
SE/static/procesEditor.js

@@ -77,7 +77,7 @@ $(document).ready(function() {
         var sFiltr = "";
         sFiltr += `
           <GetFeature xmlns="http://www.opengis.net/wfs/2.0"
-          xmlns:p5_default_db="` + BASE_URL + `wfs/default_db"
+          xmlns:p5_default_db="` + BASE_WFS_URL + `/default_db"
           xmlns:ogc="http://www.opengis.net/ogc"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           service="WFS"
@@ -234,17 +234,17 @@ $(document).ready(function() {
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     version="1.0.0"
     service="WFS"
-    xmlns:p5_default_db="` + BASE_URL + `wfs/default_db/CRM_PROCES"
-    xsi:schemaLocation="` + BASE_URL + `wfs/default_db/CRM_PROCES ` + BASE_URL + `dev-pl/se-feature-api/wfs.php/xml/wfs/default_db/CRM_PROCES/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=p5_default_db:CRM_PROCES&amp;SRSNAME=EPSG:4326&amp;"
+    xmlns:p5_default_db="` + BASE_WFS_URL + `/default_db/CRM_PROCES"
     xmlns:gml="http://www.opengis.net/gml">
     `;
+    // xsi:schemaLocation="` + BASE_WFS_URL + `/default_db/CRM_PROCES ` + BASE_URL + `dev-pl/se-feature-api/wfs.php/xml/wfs/default_db/CRM_PROCES/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=p5_default_db:CRM_PROCES&amp;SRSNAME=EPSG:4326&amp;"
 
         $.each(state, function(i, e) {
             if (e['id'] < 0) {
                 genReq += `
             <Insert xmlns="http://www.opengis.net/wfs">
-            <CRM_PROCES xmlns="` + BASE_URL + `wfs/default_db/CRM_PROCES">
-            <PARENT_ID xmlns="` + BASE_URL + `wfs/default_db/CRM_PROCES">-1</PARENT_ID>
+            <CRM_PROCES xmlns="` + BASE_WFS_URL + `/default_db/CRM_PROCES">
+            <PARENT_ID xmlns="` + BASE_WFS_URL + `/default_db/CRM_PROCES">-1</PARENT_ID>
             </CRM_PROCES>
             </Insert>`;
             }
@@ -285,40 +285,40 @@ $(document).ready(function() {
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             version="1.0.0"
             service="WFS"
-            xmlns:p5_default_db="` + BASE_URL + `wfs/default_db/CRM_PROCES"
-            xsi:schemaLocation="` + BASE_URL + `wfs/default_db/CRM_PROCES ` + BASE_URL + `dev-pl/se-feature-api/wfs.php/xml/wfs/default_db/CRM_PROCES/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=p5_default_db:CRM_PROCES&amp;SRSNAME=EPSG:4326&amp;"
+            xmlns:p5_default_db="` + BASE_WFS_URL + `/default_db/CRM_PROCES"
             xmlns:gml="http://www.opengis.net/gml">
             `;
+            // xsi:schemaLocation="` + BASE_URL + `wfs/default_db/CRM_PROCES ` + BASE_URL + `dev-pl/se-feature-api/wfs.php/xml/wfs/default_db/CRM_PROCES/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=p5_default_db:CRM_PROCES&amp;SRSNAME=EPSG:4326&amp;"
 
                 $.each(state, function(i, e) {
                     request += `
     <Insert xmlns="http://www.opengis.net/wfs">
-      <CRM_PROCES xmlns="` + BASE_URL + `wfs/default_db/CRM_PROCES">
+      <CRM_PROCES xmlns="` + BASE_WFS_URL + `/default_db/CRM_PROCES">
     `;
                     if (e["id"] >= 0)
-                        request += '<ID xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES">' + e["id"] + '</ID>';
+                        request += '<ID xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES">' + e["id"] + '</ID>';
                     else
-                        request += '<ID xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES">' + newIdTab[e["id"]] + '</ID>';
+                        request += '<ID xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES">' + newIdTab[e["id"]] + '</ID>';
 
 
                     if (e["parent_id"] != false) {
                         if (e["parent_id"] >= 0)
-                            request += '<PARENT_ID xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES">' + e["parent_id"] + '</PARENT_ID>';
+                            request += '<PARENT_ID xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES">' + e["parent_id"] + '</PARENT_ID>';
                         else
-                            request += '<PARENT_ID xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES">' + newIdTab[e["parent_id"]] + '</PARENT_ID>';
+                            request += '<PARENT_ID xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES">' + newIdTab[e["parent_id"]] + '</PARENT_ID>';
 
-                        request += '<SORT_PRIO xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES">' + e["SORT_PRIO"] + '</SORT_PRIO>';
+                        request += '<SORT_PRIO xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES">' + e["SORT_PRIO"] + '</SORT_PRIO>';
                     }
                     if (typeof e["goto"] !== typeof undefined && e["goto"]["id"] !== null && e["goto"]["id"] !== 0 && e["goto"]["id"] !== "") {
-                        request += '<IF_TRUE_GOTO xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES">' + e["goto"]["id"] + '</IF_TRUE_GOTO>';
-                        request += '<IF_TRUE_GOTO_FLAG xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES">' + e["goto"]["flag"] + '</IF_TRUE_GOTO_FLAG>';
+                        request += '<IF_TRUE_GOTO xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES">' + e["goto"]["id"] + '</IF_TRUE_GOTO>';
+                        request += '<IF_TRUE_GOTO_FLAG xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES">' + e["goto"]["flag"] + '</IF_TRUE_GOTO_FLAG>';
                     } else {
-                        request += '<IF_TRUE_GOTO xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES">0</IF_TRUE_GOTO>';
-                        request += '<IF_TRUE_GOTO_FLAG xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES"></IF_TRUE_GOTO_FLAG>';
+                        request += '<IF_TRUE_GOTO xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES">0</IF_TRUE_GOTO>';
+                        request += '<IF_TRUE_GOTO_FLAG xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES"></IF_TRUE_GOTO_FLAG>';
                     }
 
-                    request += '<DESC xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES">' + e["desc"] + '</DESC>';
-                    request += '<OPIS xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES">' + e["opis"] + '</OPIS>';
+                    request += '<DESC xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES">' + e["desc"] + '</DESC>';
+                    request += '<OPIS xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES">' + e["opis"] + '</OPIS>';
                     request += `
     </CRM_PROCES>
   </Insert>
@@ -333,19 +333,19 @@ $(document).ready(function() {
                         sort_prio++;
                         request += `
   <Insert xmlns="http://www.opengis.net/wfs">
-    <CRM_WSKAZNIK xmlns="` + BASE_URL + `wfs/default_db/CRM_WSKAZNIK">
+    <CRM_WSKAZNIK xmlns="` + BASE_WFS_URL + `/default_db/CRM_WSKAZNIK">
   `;
                         if (eR["id"] >= 0) {
-                            request += '<ID xmlns="' + BASE_URL + 'wfs/default_db/CRM_WSKAZNIK">' + eR["id"] + '</ID>';
+                            request += '<ID xmlns="' + BASE_WFS_URL + '/default_db/CRM_WSKAZNIK">' + eR["id"] + '</ID>';
                         }
-                        request += '<ID_ZASOB xmlns="' + BASE_URL + 'wfs/default_db/CRM_WSKAZNIK">' + eR["id_zasob"] + '</ID_ZASOB>';
-                        request += '<ID_PROCES xmlns="' + BASE_URL + 'wfs/default_db/CRM_WSKAZNIK">' + id + '</ID_PROCES>';
-                        request += '<ID_PRZYPADEK xmlns="' + BASE_URL + 'wfs/default_db/CRM_WSKAZNIK">' + eR["id_przypadek"] + '</ID_PRZYPADEK>';
+                        request += '<ID_ZASOB xmlns="' + BASE_WFS_URL + '/default_db/CRM_WSKAZNIK">' + eR["id_zasob"] + '</ID_ZASOB>';
+                        request += '<ID_PROCES xmlns="' + BASE_WFS_URL + '/default_db/CRM_WSKAZNIK">' + id + '</ID_PROCES>';
+                        request += '<ID_PRZYPADEK xmlns="' + BASE_WFS_URL + '/default_db/CRM_WSKAZNIK">' + eR["id_przypadek"] + '</ID_PRZYPADEK>';
 
                         var opis = eR["komentarz"];
                         opis = opis.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&apos;');
-                        request += '<SORT_PRIO xmlns="' + BASE_URL + 'wfs/default_db/CRM_WSKAZNIK">' + sort_prio + '</SORT_PRIO>';
-                        request += '<OPIS_ZASOB xmlns="' + BASE_URL + 'wfs/default_db/CRM_WSKAZNIK">' + opis + '</OPIS_ZASOB>';
+                        request += '<SORT_PRIO xmlns="' + BASE_WFS_URL + '/default_db/CRM_WSKAZNIK">' + sort_prio + '</SORT_PRIO>';
+                        request += '<OPIS_ZASOB xmlns="' + BASE_WFS_URL + '/default_db/CRM_WSKAZNIK">' + opis + '</OPIS_ZASOB>';
                         request += `
 </CRM_WSKAZNIK>
 </Insert>
@@ -355,12 +355,12 @@ $(document).ready(function() {
                 $.each(deletedId, function(key, value) {
                     request += `
     <Insert xmlns="http://www.opengis.net/wfs">
-      <CRM_PROCES xmlns="` + BASE_URL + `wfs/default_db/CRM_PROCES">
+      <CRM_PROCES xmlns="` + BASE_WFS_URL + `/default_db/CRM_PROCES">
     `;
 
-                    request += '<ID xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES">' + value + '</ID>';
-                    request += '<PARENT_ID xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES">-1</PARENT_ID>';
-                    request += '<A_STATUS xmlns="' + BASE_URL + 'wfs/default_db/CRM_PROCES">DELETED</A_STATUS>';
+                    request += '<ID xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES">' + value + '</ID>';
+                    request += '<PARENT_ID xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES">-1</PARENT_ID>';
+                    request += '<A_STATUS xmlns="' + BASE_WFS_URL + '/default_db/CRM_PROCES">DELETED</A_STATUS>';
                     request += `
     </CRM_PROCES>
   </Insert>
@@ -370,11 +370,11 @@ $(document).ready(function() {
                 $.each(deletedRes, function(key, value) {
                     request += `
     <Insert xmlns="http://www.opengis.net/wfs">
-      <CRM_WSKAZNIK xmlns="` + BASE_URL + `wfs/default_db/CRM_WSKAZNIK">
+      <CRM_WSKAZNIK xmlns="` + BASE_WFS_URL + `/default_db/CRM_WSKAZNIK">
     `;
 
-                    request += '<ID xmlns="' + BASE_URL + 'wfs/default_db/CRM_WSKAZNIK">' + value + '</ID>';
-                    request += '<A_STATUS xmlns="' + BASE_URL + 'wfs/default_db/CRM_WSKAZNIK">DELETED</A_STATUS>';
+                    request += '<ID xmlns="' + BASE_WFS_URL + '/default_db/CRM_WSKAZNIK">' + value + '</ID>';
+                    request += '<A_STATUS xmlns="' + BASE_WFS_URL + '/default_db/CRM_WSKAZNIK">DELETED</A_STATUS>';
                     request += `
     </CRM_WSKAZNIK>
   </Insert>