]> _ Git - sandvik-apps.git/commitdiff
wip #4336 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 10 Mar 2021 10:29:10 +0000 (11:29 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 10 Mar 2021 10:29:10 +0000 (11:29 +0100)
ScreeningMediaSelection/_doc/data.xlsx
ScreeningMediaSelection/_doc/translations.xlsx
ScreeningMediaSelection/tools/common.php
ScreeningMediaSelection/tools/refreshdata.php

index e5fd1e36b988a52367c822dcdc337e3a44594379..8e1dcb5a9db3f41fa37317718516f8de733d57ef 100644 (file)
Binary files a/ScreeningMediaSelection/_doc/data.xlsx and b/ScreeningMediaSelection/_doc/data.xlsx differ
index 2820265fc39aae916fe86722851911cbced3e56a..962eb9ea853f6e3519656ba0147be64c53a988a5 100644 (file)
Binary files a/ScreeningMediaSelection/_doc/translations.xlsx and b/ScreeningMediaSelection/_doc/translations.xlsx differ
index 88752051e615f1cfbc91a5d11bcaf5490d45e134..78bf41f221abc0a3ead8e9a1c30454fccd82e96a 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-function postFiles($url, $file, $var = 'file')
+function postFiles($url, $file, $var = 'file',$data=[])
 {
     $boundary = '--------------------------' . microtime(true);
     $header = 'Content-Type: multipart/form-data; boundary=' . $boundary;
@@ -7,6 +7,11 @@ function postFiles($url, $file, $var = 'file')
         'Content-Disposition: form-data; name="' . $var . '"; filename="' . basename($file) . "\"\r\n" .
         "Content-Type: application/octet-stream\r\n\r\n" .
         file_get_contents($file) . "\r\n";
+    foreach ($data as $k=>$v){
+        $content .= "--".$boundary."\r\n".
+            "Content-Disposition: form-data; name=\"$k\"\r\n\r\n".
+            "$v\r\n";
+    }
     $content .= '--' . $boundary . "--\r\n";
     $context = stream_context_create(array(
         'http' => array(
index f78e95ec477743e5013a8c32acfa9983bfccd09f..e4a4d482750f266ce03dd8fb669d5bcf93c5608a 100644 (file)
@@ -4,6 +4,6 @@ require_once 'common.php';
 $root = __DIR__ . '/../';
 $js = $root . 'js/data.js';
 $xlsx = $root . '/_doc/data.xlsx';
-$data = postFiles('https://extranet.cubedesigners.com/tools/convertXlsxToJson', $xlsx, 'file');
-file_put_contents($js, 'DATA=' . $data . ';');
+$data = postFiles('https://extranet.cubedesigners.com/tools/convertXlsxToJson', $xlsx, 'file', ['dataorg' => 'excelToArray', 'format' => 'js']);
+file_put_contents($js, $data);
 header('Location: ../');
\ No newline at end of file