Merge with master

This commit is contained in:
Romain Neutron
2012-01-06 13:30:56 +01:00
6 changed files with 87 additions and 32 deletions

View File

@@ -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)
);
@@ -578,8 +580,17 @@ class User_Query implements User_QueryInterface
* @return User_Query
*/
public function like($like_field, $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;

View File

@@ -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("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 . ";");
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;
}

View File

@@ -36,11 +36,11 @@
{% if record.get_type() == 'image' and document.get_width() and document.get_height() %}
{% trans 'Dimensions a l\'impression' %}
<br/>
{% 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) %}
<br/> 72 dpi : {{size_w|round(1)}}x{{size_h|round(1)}} cm
{% endif %}

View File

@@ -360,7 +360,7 @@
<br/>
<br>
<b>
<h4>{% trans 'prod::editing:indexation en cours' %}<f/h4>
<h4>{% trans 'prod::editing:indexation en cours' %}</h4>
</b>
<span id='saveeditPbarI'></span> / <span id='saveeditPbarN'></span>
<br/><br/><br/>

View File

@@ -1135,6 +1135,11 @@
<div id="modal_feed" title="{% trans 'action : publier' %}" style="display:none;">
</div>
<form id="push_form" style="display:none;" method="post" target="download" action="/prod/pushdoc.php">
<input name="lst" value=""/>
<input name="ACT" value="LOAD"/>
<input name="SSTTID" value="LOAD"/>
</form>
<div id="dialog_dwnl" title="{% trans 'action : exporter' %}" style="display:none;"></div>
<div title="{% trans 'Re-ordonner' %}" id="reorder_dialog" style="position:relative;overflow:hidden;">

View File

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