Bladeren bron

Assignment save and search bugfix

Juergen 'eTM' Mangler 3 jaren geleden
bovenliggende
commit
4ea5abc4dc
7 gewijzigde bestanden met toevoegingen van 47 en 27 verwijderingen
  1. 2 1
      server/json/ProductCode.json
  2. 2 2
      server/was.conf
  3. 37 16
      server/was.rb
  4. 3 3
      ui/config.php
  5. 2 2
      ui/index.html
  6. 1 1
      ui/js/config.js
  7. 0 2
      ui/js/imageSlicer.js

+ 2 - 1
server/json/ProductCode.json

@@ -76,7 +76,8 @@
         "K46",
         "K51",
         "K56",
-        "K61"
+        "K61",
+        "K66"
       ]
     },
     {

+ 2 - 2
server/was.conf

@@ -1,5 +1,5 @@
 :port: 9323
 :appconf:
-  wizurl: https://centurio.work/wiz/wiztest/
-  wasurl: https://centurio.work/customers/evva/was/
+  wizurl: https://centurio.evva.com/wiz/wiztest/
+  wasurl: https://centurio.evva.com/departments/emontage/WAS/
   stations: [ 1, 2, 3, 8, 99]

+ 37 - 16
server/was.rb

@@ -646,8 +646,16 @@ class SearchImages < Riddl::Implementation
     if result.length > 0
       result.each do |item| 
         result2 = $db.execute "SELECT DISTINCT internalID, imageID FROM image WHERE internalID = #{item[0]} ORDER BY imageID ASC"
+        
+        
+        
         result2.each do |item2|
-          ret << @r[0] + "/" + item2[0].to_s + "/" + item2[1].to_s
+        
+          result3 = $db.execute "SELECT DISTINCT station FROM stationpattern WHERE internalID = #{item2[0]} AND station = #{@r[0]}"
+          if(result3[0] != nil)
+          
+            ret << @r[0] + "/" + item2[0].to_s + "/" + item2[1].to_s
+          end
         end
       end
     end
@@ -677,24 +685,39 @@ class SearchImagesSingle < Riddl::Implementation
           result.each do |item|
             result2 = $db.execute "SELECT DISTINCT internalID, imageID FROM image WHERE internalID = #{item[0]} ORDER BY imageID ASC"
             result2.each do |item2|
-              if(count == @r[3].to_i)
+            
+            
+            
+            
                 result3 = $db.execute "SELECT DISTINCT internalID, imageID, language, label FROM image WHERE internalID = #{item[0]} and imageID =#{item2[1]}"
                 
-                result3.each do |item3|                
-                  uri = @a[0][:appconf]["wasurl"] + "ui/imageReplacement.php?___image___=" +  @r[0].to_s + "/" + item3[0].to_s + "/" + item3[1].to_s + "/" + item3[2].to_s + ".svg"
-                  
-                  @p.each_with_index do |item, index|
-                    if index != 0
-                      uri += "&" + item.name.to_s + "=" + item.value.to_s
+                result3.each do |item3|       
+                
+                  result4 = $db.execute "SELECT DISTINCT station FROM stationpattern WHERE internalID = #{item3[0]} AND station = #{@r[0]}"
+                  if(result4[0] != nil)
+                
+                    if(count == @r[3].to_i)
+              
+                    #ret << @r[0] + "/" + item2[0].to_s + "/" + item2[1].to_s
+              
+                    
+                      uri = @a[0][:appconf]["wasurl"] + "ui/imageReplacement.php?___image___=" +  @r[0].to_s + "/" + item3[0].to_s + "/" + item3[1].to_s + "/" + item3[2].to_s + ".svg"
+                      
+                      @p.each_with_index do |item, index|
+                        if index != 0
+                          uri += "&" + item.name.to_s + "=" + item.value.to_s
+                        end
+                      end
+                    
+                      xml.variant(:lang => item3[2].to_s, :label => item3[3].to_s){
+                        xml.text(uri)
+                      }
                     end
+                    count += 1
                   end
-                
-                  xml.variant(:lang => item3[2].to_s, :label => item3[3].to_s){
-                    xml.text(uri)
-                  }
                 end
-              end
-              count += 1
+              
+              
             end
           end
         end
@@ -850,8 +873,6 @@ class ListAssignmentSearch < Riddl::Implementation
   def response
   
     #https://centurio.work/customers/evva/was/ui/TransformProductCode.php?ProductCode=E.A.PZ.DZ-S.31.31.MP.SEP
-  
-
     pattern = JSON.parse(Net::HTTP.get URI(@a[0][:appconf]["wasurl"] + "ui/TransformProductCode.php?ProductCode=" + @p[0].value))
 
   #$db.execute "CREATE TABLE IF NOT EXISTS patternassignments(ID INT, AssID INT, type CHARACTER(20), value CHARACTER(20), FOREIGN KEY(ID) REFERENCES assignments(ID) ON DELETE CASCADE)"

+ 3 - 3
ui/config.php

@@ -1,5 +1,5 @@
 <?php
-  $wasUrl ="https://centurio.work/customers/evva/was/";
-  $transformCodeUrl ="https://centurio.work/customers/evva/was/";
-  $universalStorageEinzelbilder = "https://centurio.work/customers/evva/universal-storage/storage/Stationsbilder/Einzelbilder/";
+  $wasUrl ="https://centurio.evva.com/departments/emontage/WAS/";
+  $transformCodeUrl ="https://centurio.evva.com/departments/emontage/WAS/";
+  $universalStorageEinzelbilder = "https://centurio.evva.com/departments/emontage/universal-storage/storage/Stationsbilder/Einzelbilder/";
 ?>

+ 2 - 2
ui/index.html

@@ -14,7 +14,7 @@
   You should have received a copy of the GNU General Public License along with
   centurio.work/commands (file COPYING in the main directory).  If not, see
   <http://www.gnu.org/licenses/>.
--->
+  -->
 
 <!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
@@ -140,7 +140,7 @@
             <div class="wasGroup">
               <div class="wasLeft">Preview</div>
               <div class="wasRight">
-                <a href="https://centurio.work/out/frames/WAS_Test/">WIZ-Preview</a>
+                <a href="https://centurio.evva.com/out/frames/WAS_Test/">WIZ-Preview</a>
               </div>
             </div>
             

+ 1 - 1
ui/js/config.js

@@ -1,2 +1,2 @@
 
-var urlUniversalStorage = "https://centurio.work/customers/evva/universal-storage/";
+var urlUniversalStorage = "https://centurio.evva.com/departments/emontage/universal-storage/";

+ 0 - 2
ui/js/imageSlicer.js

@@ -280,8 +280,6 @@ function submitSlices(skip = false){
         data: { url: $("#sliceImg").attr("src"), savelocation: $("#savelocation").val(), alldata: JSON.stringify(createJsonCutting()) },
         success: function(data){
         
-        
-        
           if ( JSON.stringify(data) === '[]') {
             //clearFormFull();