diff --git a/lib/classes/User/Query.class.php b/lib/classes/User/Query.class.php index 4794c485c2..1aee467595 100644 --- a/lib/classes/User/Query.class.php +++ b/lib/classes/User/Query.class.php @@ -137,6 +137,7 @@ class User_Query implements User_QueryInterface const LIKE_FIRSTNAME= 'usr_prenom'; const LIKE_LASTNAME= 'usr_nom'; + const LIKE_NAME= 'name'; const LIKE_COMPANY = 'societe'; const LIKE_LOGIN = 'usr_login'; const LIKE_EMAIL = 'usr_mail'; @@ -292,6 +293,7 @@ class User_Query implements User_QueryInterface } $sql_like = array(); + foreach ($this->like_field as $like_field => $like_value) { switch ($like_field) @@ -303,7 +305,7 @@ class User_Query implements User_QueryInterface case self::LIKE_LOGIN: case self::LIKE_COUNTRY: $sql_like[] = sprintf( - ' usr.`%s` LIKE "%s%%" ' + ' usr.`%s` LIKE "%s%%" COLLATE utf8_unicode_ci ' , $like_field , str_replace(array('"', '%'), array('\"', '\%'), $like_value) ); @@ -579,8 +581,17 @@ class User_Query implements User_QueryInterface */ public function like($like_field, $like_value) { - $this->like_field[trim($like_field)] = trim($like_value); - + + if($like_field == self::LIKE_NAME) + { + $this->like_field[self::LIKE_FIRSTNAME] = trim($like_value); + $this->like_field[self::LIKE_LASTNAME] = trim($like_value); + } + else + { + $this->like_field[trim($like_field)] = trim($like_value); + } + $this->total = $this->page = null; return $this; diff --git a/lib/classes/set/export.class.php b/lib/classes/set/export.class.php index 6aa6c29aa9..3b056189bc 100644 --- a/lib/classes/set/export.class.php +++ b/lib/classes/set/export.class.php @@ -984,6 +984,7 @@ class set_export extends set_abstract ); $response->headers->set('X-Sendfile', $file); $response->headers->set('X-Accel-Redirect', $file_xaccel); + $response->headers->set('Pragma', 'public', true); $response->headers->set('Content-Type', $mime); $response->headers->set('Content-Name', $exportname); $response->headers->set('Content-Disposition', $disposition . "; filename=" . $exportname . ";"); @@ -993,12 +994,25 @@ class set_export extends set_abstract } else { + /** + * + * Header "Pragma: public" SHOULD be present. + * In case it is not present, download on IE 8 and previous over HTTPS + * will fail. + * + * @todo : merge this shitty fix with Response object. + * + */ + if(!headers_sent()) + { + header("Pragma: public"); + } + $response->headers->set('Content-Type', $mime); $response->headers->set('Content-Name', $exportname); $response->headers->set('Content-Disposition', $disposition . "; filename=" . $exportname . ";"); $response->headers->set('Content-Length', filesize($file)); $response->setContent(file_get_contents($file)); - return $response; } } @@ -1014,22 +1028,42 @@ class set_export extends set_abstract * @param String $disposition * @return Void */ - function stream_data($data, $exportname, $mime, $disposition='attachment') + public static function stream_data($data, $exportname, $mime, $disposition='attachment') { - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - header("Content-Type: " . $mime); - header("Content-Length: " . strlen($data)); - header("Cache-Control: max-age=3600, must-revalidate "); - header("Content-Disposition: " . $disposition - . "; filename=" . $exportname . ";"); - - echo $data; - + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: public"); + header("Content-Type: " . $mime); + header("Content-Length: " . strlen($data)); + header("Cache-Control: max-age=3600, must-revalidate "); + header("Content-Disposition: " . $disposition . "; filename=" . $exportname . ";"); +echo $data; + exit(); + $response = new \Symfony\Component\HttpFoundation\Response(); + $response->headers->set('Cache-Control', 'must-revalidate, post-check=0, pre-check=0'); + $response->setLastModified(new DateTime()); + $response->headers->set('Pragma', 'public', true); + $response->headers->set('Content-Type', $mime); + $response->headers->set('Content-Length', strlen($data)); + $response->headers->set('Content-Disposition', $disposition. "; filename=" . $exportname . ";"); +// header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +// header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); +// header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); +// +// header("Pragma: public"); +// +// header("Content-Type: " . $mime); +// header("Content-Length: " . strlen($data)); +// header("Cache-Control: max-age=3600, must-revalidate "); +// header("Content-Disposition: " . $disposition +// . "; filename=" . $exportname . ";"); +// +// echo $data; + $response->send(); +exit(); return true; } diff --git a/templates/web/common/technical_datas.twig b/templates/web/common/technical_datas.twig index 0b63b23a9e..42e4af1557 100644 --- a/templates/web/common/technical_datas.twig +++ b/templates/web/common/technical_datas.twig @@ -36,11 +36,11 @@ {% if record.get_type() == 'image' and document.get_width() and document.get_height() %} {% trans 'Dimensions a l\'impression' %}
- {% set size_w = (document.get_width() / (300*254/100)) %} - {% set size_h = (document.get_height() / (300*254/100)) %} + {% set size_w = (document.get_width() * (254/100) / 300) %} + {% set size_h = (document.get_height() * (254/100) / 300) %} 300 dpi : {{size_w|round(1)}}x{{size_h|round(1)}} cm - {% set size_w = (document.get_width() / (72*254/100)) %} - {% set size_h = (document.get_height() / (72*254/100)) %} + {% set size_w = (document.get_width() * (254/100) / 72) %} + {% set size_h = (document.get_height() * (254/100) / 72) %}
72 dpi : {{size_w|round(1)}}x{{size_h|round(1)}} cm {% endif %} diff --git a/templates/web/prod/actions/edit_default.twig b/templates/web/prod/actions/edit_default.twig index 5ebee6f0e5..7d4c3854da 100644 --- a/templates/web/prod/actions/edit_default.twig +++ b/templates/web/prod/actions/edit_default.twig @@ -153,7 +153,7 @@
{{_self.HTML_fieldlist(edit, user)}} -
+
@@ -360,7 +360,7 @@

-

{% trans 'prod::editing:indexation en cours' %} +

{% trans 'prod::editing:indexation en cours' %}

/


diff --git a/templates/web/prod/index.html b/templates/web/prod/index.html index 56911132e4..72b2e7a02d 100644 --- a/templates/web/prod/index.html +++ b/templates/web/prod/index.html @@ -1135,6 +1135,11 @@ +
diff --git a/www/prod/page0.js b/www/prod/page0.js index ed287303b3..e23a07af1b 100644 --- a/www/prod/page0.js +++ b/www/prod/page0.js @@ -1864,11 +1864,16 @@ function chgStatusThis(url) } -function pushThis(url) +function pushThis(sstt_id, lst) { - url = "pushdoc.php?ACT=LOAD&"+url; $('#MODALDL').attr('src','about:blank'); - $('#MODALDL').attr('src',url); + + var $form = $('#push_form'); + + $('input[name="lst"]', $form).val(lst); + $('input[name="SSTTID"]', $form).val(sstt_id); + + $form.submit(); var w = bodySize.x - 40; var h = bodySize.y - 40; @@ -2221,7 +2226,7 @@ function activeIcons() }); $('.TOOL_pushdoc_btn').live('click', function(){ - var value=""; + var value="",type="",sstt_id=""; if($(this).hasClass('results_window')) { if(p4.Results.Selection.length() > 0) @@ -2234,19 +2239,19 @@ function activeIcons() if(p4.WorkZone.Selection.length() > 0) value = "lst=" + p4.WorkZone.Selection.serialize(); else - value = "SSTTID=" + $('.SSTT.active').attr('id').split('_').slice(1,2).pop(); + sstt_id = $('.SSTT.active').attr('id').split('_').slice(1,2).pop(); } else { if($(this).hasClass('basket_element')) { - value = "SSTTID=" + $('.SSTT.active').attr('id').split('_').slice(1,2).pop(); + sstt_id = $('.SSTT.active').attr('id').split('_').slice(1,2).pop(); } } } - if(value !== '') + if(value !== '' || sstt_id !== '') { - pushThis(value); + pushThis(sstt_id, value); } else {