From 88796657603a05bc0d312bf6e95c5e0ef35e74e4 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 5 Jan 2012 17:22:37 +0100 Subject: [PATCH 1/7] Fix #163 : Dpi sizes --- templates/web/common/technical_datas.twig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 %} From 5d0965f48fc0b6217d3210866191bdd82f620b88 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 5 Jan 2012 17:29:15 +0100 Subject: [PATCH 2/7] Fix Query on user name --- lib/classes/User/Query.class.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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; From d429c81401914e7be69984aebd3be3b3500638e7 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 5 Jan 2012 18:32:42 +0100 Subject: [PATCH 3/7] Fix #165 : push with long urls does not work --- templates/web/prod/index.html | 5 +++++ www/prod/page0.js | 25 +++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/templates/web/prod/index.html b/templates/web/prod/index.html index e7603784a4..549445acf8 100644 --- a/templates/web/prod/index.html +++ b/templates/web/prod/index.html @@ -1151,6 +1151,11 @@ +
diff --git a/www/prod/page0.js b/www/prod/page0.js index 96ad4d2e2c..175b38a7e5 100644 --- a/www/prod/page0.js +++ b/www/prod/page0.js @@ -2578,11 +2578,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; @@ -2935,32 +2940,32 @@ function activeIcons() }); $('.TOOL_pushdoc_btn').live('click', function(){ - var value=""; + var value="",type="",sstt_id=""; if($(this).hasClass('results_window')) { if(p4.sel.length > 0) - value = "lst=" + p4.sel.join(';'); + value = p4.sel.join(';'); } else { if($(this).hasClass('basket_window')) { if(p4.baskSel.length > 0) - value = "lst=" + p4.baskSel.join(';'); + value = p4.baskSel.join(';'); 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 { From 8ff2f6fc5918eabba2328365e188b716192365d2 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 5 Jan 2012 23:44:54 +0100 Subject: [PATCH 4/7] Fix download IE6 --- www/include/download_anonymous.php | 2 +- www/include/download_prepare.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/www/include/download_anonymous.php b/www/include/download_anonymous.php index 0b863296c6..77e043d9d4 100644 --- a/www/include/download_anonymous.php +++ b/www/include/download_anonymous.php @@ -123,7 +123,7 @@ if (!$zip_done) else { ?> -

', ''); ?>

+

', ''); ?>

diff --git a/www/include/download_prepare.php b/www/include/download_prepare.php index 758b8a13da..85951d4bda 100644 --- a/www/include/download_prepare.php +++ b/www/include/download_prepare.php @@ -153,7 +153,7 @@ phrasea::headers();
-

', ''); ?>

+

', ''); ?>

From d9b611ccebebe6265bf2054606eda8cb3f13a8c8 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Fri, 6 Jan 2012 13:14:53 +0100 Subject: [PATCH 5/7] Fix download IE6 --- lib/classes/set/export.class.php | 55 ++++++++++++++++++++++-------- www/include/download_anonymous.php | 2 +- www/include/download_prepare.php | 2 +- 3 files changed, 42 insertions(+), 17 deletions(-) diff --git a/lib/classes/set/export.class.php b/lib/classes/set/export.class.php index ac78226378..c94bf1fe04 100644 --- a/lib/classes/set/export.class.php +++ b/lib/classes/set/export.class.php @@ -980,6 +980,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 . ";"); @@ -989,12 +990,16 @@ class set_export extends set_abstract } else { + 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; } } @@ -1010,22 +1015,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/www/include/download_anonymous.php b/www/include/download_anonymous.php index 77e043d9d4..0b863296c6 100644 --- a/www/include/download_anonymous.php +++ b/www/include/download_anonymous.php @@ -123,7 +123,7 @@ if (!$zip_done) else { ?> -

', ''); ?>

+

', ''); ?>

diff --git a/www/include/download_prepare.php b/www/include/download_prepare.php index 85951d4bda..758b8a13da 100644 --- a/www/include/download_prepare.php +++ b/www/include/download_prepare.php @@ -153,7 +153,7 @@ phrasea::headers();
-

', ''); ?>

+

', ''); ?>

From a1624c4a6bb45796070e436d89009329dbe016a3 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Fri, 6 Jan 2012 13:17:35 +0100 Subject: [PATCH 6/7] Adding todo --- lib/classes/set/export.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/classes/set/export.class.php b/lib/classes/set/export.class.php index c94bf1fe04..69518ecf52 100644 --- a/lib/classes/set/export.class.php +++ b/lib/classes/set/export.class.php @@ -990,6 +990,15 @@ 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"); From 66f7efa3922aa4831cb51dbc2ed16b3199d888e7 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Fri, 6 Jan 2012 13:21:33 +0100 Subject: [PATCH 7/7] Fix #167 : HTML tag error --- templates/web/prod/actions/edit_default.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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' %}

/