From: vincent@cubedesigners.com Date: Tue, 14 Aug 2018 12:49:43 +0000 (+0000) Subject: done #2182 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f2dac15f6a79cf06218c1557179b3e4edcf69d76;p=cubeextranet.git done #2182 @0.25 --- diff --git a/inc/commons/class.common.tools.php b/inc/commons/class.common.tools.php index 90769cc3f..90db7e2d8 100644 --- a/inc/commons/class.common.tools.php +++ b/inc/commons/class.common.tools.php @@ -1,8 +1,10 @@ con->select('SELECT entreprise_id,tva_intra FROM entreprises'); @@ -82,8 +87,8 @@ class commonTools { foreach ($montants as $tva => $d) { $s->getCell('A' . $line)->setValue($tva); $s->getCell('B' . $line)->setValue($d['montant']); - $s->getCell('C' . $line)->setValue(implode(',', $d['rs'])); - $s->getCell('D' . $line)->setValue(implode(', ', $d['factures'])); + $s->getCell('C' . $line)->setValue(implode(',', array_unique($d['rs']))); + $s->getCell('D' . $line)->setValue(" " . implode(', ', $d['factures'])); $line++; } $s->getColumnDimension('A')->setAutoSize(true); @@ -103,7 +108,8 @@ class commonTools { } - public static function urlDecoder($args) { + public static function urlDecoder($args) + { global $js; $js[] = JS_PATH . '/urldecoder.js'; @@ -124,7 +130,8 @@ class commonTools { return $res; } - public static function html2php() { + public static function html2php() + { global $core; if (!isset($_POST['input'])) { @@ -159,7 +166,8 @@ class commonTools { return $res; } - public static function tubeMeta($args) { + public static function tubeMeta($args) + { $url = $_GET['u']; $hash = sha1($url); @@ -175,20 +183,22 @@ class commonTools { } $res = array('width' => $dim[0], - 'height' => $dim[1], - 'ratio' => round($dim[0] / $dim[1], 5)); + 'height' => $dim[1], + 'ratio' => round($dim[0] / $dim[1], 5)); echo json_encode($res); exit; } - public static function url($args) { + public static function url($args) + { ob_end_clean(); echo ''; exit; } - public static function tube($args) { + public static function tube($args) + { global $css, $js, $jsnomerge, $jsvar; $css = array(); @@ -232,10 +242,10 @@ class commonTools { $background = trim($background, '# '); $fv = array('video' => $url, - 'autoPlay' => $autoplay == 1, - 'controls' => $controls == 1, - 'loop' => $loop == 1, - 'background' => $background); + 'autoPlay' => $autoplay == 1, + 'controls' => $controls == 1, + 'loop' => $loop == 1, + 'background' => $background); if (file_exists($dir . 'video.jpg')) { if ($displayPoster) { @@ -281,7 +291,8 @@ class commonTools { echo $res; } - public static function browserInfos($args) { + public static function browserInfos($args) + { global $core; global $jsnomerge; global $js; @@ -324,7 +335,8 @@ class commonTools { } - public static function favicon($args) { + public static function favicon($args) + { global $core; $res = commonPage::barre(); $res .= commonPage::tMain(); @@ -346,7 +358,8 @@ class commonTools { return $res; } - public static function webfonts($args) { + public static function webfonts($args) + { global $core; $res = commonPage::barre(); $res .= commonPage::tMain(); @@ -366,7 +379,8 @@ class commonTools { return $res; } - public static function makeWebfont() { + public static function makeWebfont() + { $tmp = cubeFiles::tempdir(); if (!file_exists($tmp)) { mkdir($tmp, 0777, true); @@ -446,7 +460,8 @@ class commonTools { cubeHTTP::downloadFile($tmpfile, $fontName . '.zip'); } - public static function makeFavicon() { + public static function makeFavicon() + { $tmp = cubeFiles::tempdir(); mkdir($tmp, 0777, true); @@ -539,8 +554,9 @@ class commonTools { `rm -rf $tmp`; } - public static function pngToIcns($file, $res) { - if(!file_exists($file)){ + public static function pngToIcns($file, $res) + { + if (!file_exists($file)) { return; } $icns = array(128, 256, 512); @@ -568,7 +584,8 @@ class commonTools { } } - public static function getDefaultLanguage() { + public static function getDefaultLanguage() + { $available = explode(',', $_GET['available']); $accept = null; if (isset($_GET['accept'])) { @@ -582,7 +599,8 @@ class commonTools { exit; } - public static function uglify() { + public static function uglify() + { $js = ''; if (isset($_POST['js'])) { $js = $_POST['js']; @@ -616,7 +634,8 @@ class commonTools { exit; } - public static function csr() { + public static function csr() + { commonDroits::min(1); global $core; $res = commonPage::barre(); @@ -649,7 +668,8 @@ class commonTools { return $res; } - public static function makeP12() { + public static function makeP12() + { //http://help.adobe.com/en_US/as3/iphone/WS144092a96ffef7cc-371badff126abc17b1f-7fff.html commonDroits::min(1); $tmp = cubeFiles::tempdir(); @@ -724,7 +744,8 @@ class commonTools { cubeHTTP::downloadFile($tmpfile, $base . '.zip'); } - public static function makeCsr() { + public static function makeCsr() + { // http://help.adobe.com/en_US/as3/iphone/WS144092a96ffef7cc-371badff126abc17b1f-8000.html @@ -768,7 +789,8 @@ class commonTools { cubeHTTP::downloadFile($tmpfile, 'csr.zip'); } - public static function geocode() { + public static function geocode() + { $opt = array(); $opt['adapter'] = 'pdo_mysql'; @@ -790,7 +812,8 @@ class commonTools { exit; } - public static function syncftp() { + public static function syncftp() + { commonDroits::min(2); global $core; $res = commonPage::barre(); @@ -812,7 +835,8 @@ class commonTools { return $res; } - public static function googleLucky() { + public static function googleLucky() + { $q = $_GET['q']; $cx = $_GET['cx']; @@ -826,7 +850,8 @@ class commonTools { } } - public static function copyWsAssets() { + public static function copyWsAssets() + { commonDroits::min(5); global $core; $res = commonPage::barre(); @@ -847,7 +872,8 @@ class commonTools { return $res; } - protected static function searchGoogle($q, $cx, $key) { + protected static function searchGoogle($q, $cx, $key) + { global $core; $url = 'https://www.googleapis.com/customsearch/v1?q=' . rawurlencode($q) . '&cx=' . $cx; @@ -885,7 +911,8 @@ class commonTools { } } - public static function devspace() { + public static function devspace() + { commonDroits::min(1); global $core; @@ -917,7 +944,8 @@ class commonTools { return $res; } - public static function mailer() { + public static function mailer() + { commonDroits::min(1); global $core; $res = commonPage::barre(); @@ -939,7 +967,8 @@ class commonTools { return $res; } - public function rasterize() { + public function rasterize() + { $type = isset($_GET['type']) ? $_GET['type'] : 'png'; $intype = CubeIT_Files::getExtension($_GET['src']); @@ -977,7 +1006,8 @@ class commonTools { exit; } - public static function chiffres() { + public static function chiffres() + { global $core; $datas_types = array(); $datas_entreprises = array(); @@ -1031,7 +1061,8 @@ class commonTools { } } - public static function SNCFCodes() { + public static function SNCFCodes() + { //commonDroits::min(1); global $core; $res = commonPage::barre(); @@ -1052,7 +1083,8 @@ class commonTools { return $res; } - public static function makeSNCFCodes() { + public static function makeSNCFCodes() + { $list = explode("\n", file_get_contents($_FILES['file']['tmp_name'])); $labels = []; $links = []; @@ -1082,7 +1114,8 @@ class commonTools { exit; } - public static function _listToALD($list) { + public static function _listToALD($list) + { $res = '< $item) { @@ -1102,7 +1135,8 @@ class commonTools { return $res; } - public static function _actionToALDCode($action) { + public static function _actionToALDCode($action) + { if ($action['type'] == 'gotolabel') { return '@' . $action['action']; } elseif ($action['type'] == 'uri') { @@ -1114,13 +1148,15 @@ class commonTools { } } - public static function proxy() { + public static function proxy() + { ob_end_clean(); echo file_get_contents($_GET['url']); exit; } - public static function phantomjs() { + public static function phantomjs() + { $file = CubeIT_Files::tempnam(); $exportformat = isset($_GET['exportformat']) ? $_GET['exportformat'] : 'pdf'; $pageformat = isset($_GET['pageformat']) ? $_GET['pageformat'] : '210mm*297mm'; diff --git a/inc/extranet/Controlleur/class.extranet.tools.php b/inc/extranet/Controlleur/class.extranet.tools.php index 8152a6fc1..9f5fbfcb1 100644 --- a/inc/extranet/Controlleur/class.extranet.tools.php +++ b/inc/extranet/Controlleur/class.extranet.tools.php @@ -22,6 +22,7 @@ class extranetTools { } } + public static function urlDecoder($args) { global $js; $js[] = JS_PATH.'/urldecoder.js';