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 @@