Merge branch '3.8'

This commit is contained in:
Romain Neutron
2013-08-07 17:58:18 +02:00
5 changed files with 165 additions and 115 deletions

View File

@@ -30,7 +30,7 @@
"neutron/recaptcha" : "~0.1.0",
"neutron/temporary-filesystem" : "~2.0",
"php-xpdf/php-xpdf" : "~0.2.1",
"phpexiftool/phpexiftool" : "~0.2, >=0.2.2",
"phpexiftool/phpexiftool" : "~0.3",
"silex/silex" : "~1.0.0",
"silex/web-profiler" : "~1.0.0",
"swiftmailer/swiftmailer" : "~4.3.0",

57
composer.lock generated
View File

@@ -3,7 +3,7 @@
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
"hash": "7f9f9a1dd0a8021cebb26a9a24e968c0",
"hash": "fc4798a0b0a28c7354853a650f70c071",
"packages": [
{
"name": "alchemy/binary-driver",
@@ -46,7 +46,7 @@
"homepage": "http://www.lickmychip.com/"
},
{
"name": "Nicolas Le Goff",
"name": "nlegoff",
"email": "legoff.n@gmail.com"
},
{
@@ -372,7 +372,7 @@
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh",
"homepage": "http://jmsyst.com",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
@@ -565,7 +565,7 @@
"email": "kontakt@beberlei.de"
},
{
"name": "Johannes M. Schmitt",
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "http://jmsyst.com",
"role": "Developer of wrapped JMSSerializerBundle"
@@ -1216,7 +1216,7 @@
],
"authors": [
{
"name": "Johannes Schmitt",
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "http://jmsyst.com",
"role": "Developer of wrapped JMSSerializerBundle"
@@ -2008,7 +2008,7 @@
],
"authors": [
{
"name": "Johannes Schmitt",
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "http://jmsyst.com",
"role": "Developer of wrapped JMSSerializerBundle"
@@ -2062,41 +2062,46 @@
},
{
"name": "phpexiftool/phpexiftool",
"version": "0.2.2",
"version": "0.3.0",
"source": {
"type": "git",
"url": "https://github.com/romainneutron/PHPExiftool.git",
"reference": "0.2.2"
"reference": "0.3.0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/romainneutron/PHPExiftool/zipball/0.2.2",
"reference": "0.2.2",
"url": "https://api.github.com/repos/romainneutron/PHPExiftool/zipball/0.3.0",
"reference": "0.3.0",
"shasum": ""
},
"require": {
"doctrine/cache": ">=1.0,<2.0",
"doctrine/collections": ">=1.0,<2.0",
"monolog/monolog": ">=1.3,<2.0",
"doctrine/cache": "~1.0",
"doctrine/collections": "~1.0",
"monolog/monolog": "~1.3",
"php": ">=5.3.3",
"phpexiftool/exiftool": "9.15",
"symfony/process": ">=2.0,<3.0"
"symfony/process": "~2.0"
},
"require-dev": {
"jms/serializer": ">=0.10.0,<1.0",
"sami/sami": "dev-master@dev",
"silex/silex": "1.0.x-dev@dev",
"symfony/console": ">=2.0,<3.0",
"symfony/css-selector": ">=2.0,<3.0",
"symfony/dom-crawler": ">=2.0,<3.0",
"symfony/finder": ">=2.0,<3.0",
"symfony/yaml": ">=2.0,<3.0"
"jms/serializer": "~0.10",
"sami/sami": "~1.0",
"silex/silex": "~1.0",
"symfony/console": "~2.0",
"symfony/css-selector": "~2.0",
"symfony/dom-crawler": "~2.0",
"symfony/finder": "~2.0",
"symfony/yaml": "~2.0"
},
"suggest": {
"jms/serializer": "To serialize tags",
"symfony/yaml": "To serialize tags in Yaml format"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.3-dev"
}
},
"autoload": {
"psr-0": {
"PHPExiftool": "lib"
@@ -2118,7 +2123,7 @@
"exiftool",
"metadata"
],
"time": "2013-04-17 15:46:49"
"time": "2013-08-07 13:54:27"
},
{
"name": "phpoption/phpoption",
@@ -2154,7 +2159,7 @@
],
"authors": [
{
"name": "Johannes Schmitt",
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "http://jmsyst.com",
"role": "Developer of wrapped JMSSerializerBundle"
@@ -2422,7 +2427,7 @@
},
{
"name": "Phraseanet Team",
"email": "support@alchemy.fr",
"email": "info@alchemy.fr",
"homepage": "http://www.phraseanet.com/"
}
],
@@ -3431,7 +3436,7 @@
{
"name": "Anthon Pang",
"email": "apang@softwaredevelopment.ca",
"role": "Fork Maintainer"
"role": "developer"
}
],
"description": "PHP WebDriver for Selenium 2",

View File

@@ -10,6 +10,8 @@
use Alchemy\Phrasea\Core\Configuration\Configuration;
use MediaAlchemyst\Transmuter\Image2Image;
class task_period_subdef extends task_databoxAbstract
{
const MINMEGS = 20;
@@ -32,6 +34,8 @@ class task_period_subdef extends task_databoxAbstract
*/
protected $record_buffer_size;
protected $thumbnailExtraction;
/**
* Return about text
*
@@ -54,6 +58,13 @@ class task_period_subdef extends task_databoxAbstract
return(_('task::subdef:creation des sous definitions'));
}
protected function loadSettings(SimpleXMLElement $sx_task_settings)
{
$this->thumbnailExtraction = (Boolean) trim($sx_task_settings->embedded);
parent::loadSettings($sx_task_settings);
}
/**
* must return the xml (text) version of the form
*
@@ -64,14 +75,14 @@ class task_period_subdef extends task_databoxAbstract
{
$request = http_request::getInstance();
$parm2 = $request->get_parms('period', 'flush', 'maxrecs', 'maxmegs');
$parm2 = $request->get_parms('period', 'flush', 'maxrecs', 'maxmegs', 'embedded');
$dom = new DOMDocument();
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
if (@$dom->loadXML($oldxml)) {
$xmlchanged = false;
foreach (array('str:period', 'str:flush', 'str:maxrecs', 'str:maxmegs') as $pname) {
foreach (array('str:period', 'str:flush', 'str:maxrecs', 'str:maxmegs', 'boo:embedded') as $pname) {
$ptype = substr($pname, 0, 3);
$pname = substr($pname, 4);
$pvalue = $parm2[$pname];
@@ -137,6 +148,7 @@ class task_period_subdef extends task_databoxAbstract
<?php echo $form ?>.flush.value = "<?php echo p4string::MakeString($sxml->flush, "js", '"') ?>";
<?php echo $form ?>.maxrecs.value = "<?php echo p4string::MakeString($sxml->maxrecs, "js", '"') ?>";
<?php echo $form ?>.maxmegs.value = "<?php echo p4string::MakeString($sxml->maxmegs, "js", '"') ?>";
<?php echo $form ?>.embedded.value = <?php echo (Boolean) trim($sxml->embedded); ?>;
</script>
<?php
@@ -168,6 +180,7 @@ class task_period_subdef extends task_databoxAbstract
flush.value = xml.find("flush").text();
maxrecs.value = xml.find("maxrecs").text();
maxmegs.value = xml.find("maxmegs").text();
embedded.checked = !!parseInt(xml.find("embedded").text());
}
}
}
@@ -235,6 +248,12 @@ class task_period_subdef extends task_databoxAbstract
<span class="help-inline">Mo</span>
</div>
</div>
<div class="control-group">
<label class="control-label"><?php echo _('Try to extract embedded thumbnails') ?></label>
<div class="controls">
<input class="formElem input-mini" type="checkbox" name="embedded" value="1">
</div>
</div>
</form>
<?php
@@ -243,6 +262,8 @@ class task_period_subdef extends task_databoxAbstract
public function retrieveSbasContent(databox $databox)
{
Image2Image::$lookForEmbeddedPreview = $this->thumbnailExtraction;
$connbas = $databox->get_connection();
$sql = 'SELECT coll_id, record_id
@@ -347,6 +368,7 @@ class task_period_subdef extends task_databoxAbstract
<flush>%s</flush>
<maxrecs>%s</maxrecs>
<maxmegs>%s</maxmegs>
<embedded>0</embedded>
</tasksettings>',
min(max($period, self::MINPERIOD), self::MAXPERIOD),
min(max($flush, self::MINFLUSH), self::MAXFLUSH),

View File

@@ -115,7 +115,7 @@
}
catch(e)
{
alert("heu...");
alert("{% trans "An error occured" %}");
console.log(e);
context.acceptTab = false;
}

View File

@@ -1,114 +1,137 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<!--
Make sure that there is a minimum of 1,019 characters before closing head tag
to avoid display issues on IOS devices, so give some lorem ipsum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi cursus
lacus quis lectus lobortis semper. Suspendisse ornare convallis convallis.
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
Mauris tincidunt, lectus in consectetur ultricies, orci ligula pellentesque sem,
vitae faucibus enim neque sed urna. Nunc sodales libero in nulla aliquet porta.
Vivamus tempor orci vitae massa varius, id placerat nibh viverra. Duis adipiscing erat velit,
at egestas orci consectetur in. Fusce non orci nisi. Suspendisse a sapien
ut est dignissim vehicula bibendum pretium lectus. Mauris interdum urna id
turpis accumsan, eget hendrerit sem euismod. Proin vulputate placerat augue,
in imperdiet mi porttitor ac. Maecenas in lacus magna. Fusce lacinia ligula dui,
id ullamcorper erat faucibus a.
-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>{{ subject }}</title>
</head>
<body>
<!-- Wrapper Table: to control the width and the background color consistently, instead of setting attributes on the body tag. -->
<table cellpadding="0" cellspacing="0" border="0" style="margin:0; padding:0; width:100% !important; line-height: 100% !important;">
<body style="margin:0;padding:0;background-color:#f2f2f2;">
<table width="100%" bgcolor="#f2f2f2;" cellpadding="0" cellspacing="0" border="0" style="margin:0; padding:0; width:100% !important; line-height: 100% !important;background-color:#f2f2f2;">
<tr>
<td>
<!-- Header table -->
<table cellpadding="0" cellspacing="0" border="0" align="center" style="border-style:solid; border-width:1px; border-color:#494949; background-color: #494949;">
<td height="40" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:12px; font-weight:normal; color:#999999;line-height:20px;">
Si cet email contient des liens non cliquables, copiez/collez ces liens dans votre navigateur.
</td>
</tr>
<tr>
<td valign="center" align="center">
<!-- Wrapper Table: to control the width and the background color consistently, instead of setting attributes on the body tag. -->
<table width="90%" bgcolor="#ffffff;" cellpadding="0" cellspacing="0" border="0" style="margin:0; padding:0; width:90% !important; line-height: 100% !important;background-color:#ffffff;">
<tr>
<td width="10" height="40" valign="center" align="left" style="font-size:0px;"></td>
<td width="150" height="40" valign="center" align="left" style="font-family:Tahoma,sans-serif; font-size:22px; font-weight:normal; color:#FFF;">
{% if logoUrl is not none %}
<img src="{{ logoUrl }}" alt="{{ logoText }}" title="{{ logoText }}" width="140" height="30" style="display:block; outline:none; text-decoration:none; -ms-interpolation-mode: bicubic;" />
{% else %}
{{ logoText }}
{% endif %}
</td>
<td width="400" height="40" valign="center" align="center" style="font-family:Tahoma,sans-serif; font-size:14px; font-weight:bold; color:#FFF;">
{{ subject }}
</td>
<td width="160" height="40" valign="center" align="left" style="font-size:0px;"></td>
</tr>
</table>
<!-- End of header table -->
<!-- Content table -->
<table cellpadding="0" cellspacing="0" border="0" align="center" style="border-style:solid; border-width:1px; border-color:#494949; background-color:#FFF;">
<tr>
<td width="100" height="130" valign="top" align="center" style="font-size:0px;"></td>
<td width="620" height="130" valign="center" align="center">
<!-- Message Table -->
<table cellpadding="0" cellspacing="0" border="0" align="center">
<td style="border-bottom: 1px solid #f2f2f2;">
<!-- Header table -->
<table width="80%" cellpadding="0" cellspacing="0" border="0" align="center" style="width:80% !important;">
<tr>
<td width="620" height="15" valign="center" align="center" style="font-size:0px;"></td>
</tr>
<tr>
<td width="620" height="115" valign="center" align="left" style="font-family:sans-serif,'Lucida Console'; font-size:14px; color:#494949;">
{% if senderName is not none and senderMail is not none %}
{{ senderName }} - <a href="mailto:{{ senderMail }}" target="_blank" style="color:#FFA500; color:#FFA500 !important; text-decoration:underline; cursor:pointer;">
<span style="color:#FFA500; color:#FFA500 !important; text-decoration:underline; cursor:pointer;">{{ senderMail }}</span></a><br/>
<td height="180" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:22px; font-weight:normal; color:#000;">
{% if logoUrl is not none %}
<img src="{{ logoUrl }}" alt="{{ logoText }}" title="{{ logoText }}" height="180" style="display:block; outline:none; text-decoration:none; -ms-interpolation-mode: bicubic;" />
{% else %}
{{ logoText }}
{% endif %}
<br/>
{{ messageText | nl2br }}
<br/>
</td>
</tr>
</table>
<!-- End of message table -->
</td>
</tr>
{% if expiration is not none %}
<tr>
<td colspan="2" width="720" height="60" valign="center" align="center" style="font-family:sans-serif,'Lucida Console'; font-size:15px; font-weight:bold; text-transform:uppercase; color:#494949;">
Le lien suivant est valable jusque {{ app['date-formatter'].getDate(expiration) }} {{ app['date-formatter'].getTime(expiration) }}
</td>
</tr>
{% endif %}
{% if buttonText is not none and buttonUrl is not none %}
<tr>
<td colspan="2" width="720" height="70" valign="center" align="center" style="">
<!-- Button Table -->
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td colspan="3" width="720" height="15" valign="center" align="center" style="font-size:0px;"></td>
</tr>
<tr>
<td width="255" height="40" valign="center" align="center" style="font-size:0px;"></td>
<td width="210" height="40" valign="center" align="center" style="background-color:#FFA500; font-family:sans-serif,'Lucida Console'; font-size:14px; font-weight:bold; color:#FFF;">
<a href="{{ buttonUrl }}" target="_blank" style="color:#FFFFFF; color:#FFFFFF !important; text-decoration:none; cursor:pointer;">
<span style="color:#FFFFFF; color:#FFFFFF !important; text-decoration:none; cursor:pointer;">{{ buttonText }}</span>
</a>
<!-- End of header table -->
<!-- Subject table -->
<table width="90%" cellpadding="0" cellspacing="0" border="0" align="center" style="width:90% !important;">
<tr style="background-color:#a6aab0">
<td height="50" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:16px; font-weight:bold; color:#ffffff;">
{{ subject }}
</td>
<td width="255" height="40" valign="center" align="center" style="font-size:0px;"></td>
</tr>
<tr>
<td colspan="3" width="720" height="15" valign="center" align="center" style="font-size:0px;"></td>
</tr>
</table>
<!-- End of button table -->
<!-- End of subject table -->
<!-- Content table -->
<table width="90%" bgcolor="#ffffff;" cellpadding="0" cellspacing="0" border="0" align="center" style="background-color:#ffffff;width:90% !important;">
<tr>
<td height="130" valign="center" align="center">
<!-- Message Table -->
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td height="15" valign="center" align="center" style="font-size:0px;"></td>
</tr>
<tr>
<td height="115" valign="center" align="left" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:15px; color:#999999;">
{% if senderName is not none and senderMail is not none %}
{{ senderName }} - <a href="mailto:{{ senderMail }}" target="_blank" style="color:#FFA500; color:#FFA500 !important; text-decoration:underline; cursor:pointer;">
<span style="color:#FFA500; color:#FFA500 !important; text-decoration:underline; cursor:pointer;">{{ senderMail }}</span></a><br/>
{% endif %}
<br/>
{{ messageText | nl2br }}
<br/>
</td>
</tr>
</table>
<!-- End of message table -->
</td>
</tr>
{% if buttonText is not none and buttonUrl is not none %}
<tr>
<td height="70" valign="center" align="center" style="">
<!-- Button Table -->
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:50% !important;">
<tr>
<td colspan="3" height="15" valign="center" align="center" style="font-size:0px;"></td>
</tr>
<tr>
<td height="50" valign="center" align="center" style="background-color:#80cc68; font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:14px; font-weight:bold; color:#ffffff;">
<a href="{{ buttonUrl }}" target="_blank" style="color:#ffffff; color:#ffffff !important; text-decoration:none; cursor:pointer;">
<span style=" color:#ffffff !important; text-decoration:none; cursor:pointer;">{{ buttonText }}</span>
</a>
</td>
</tr>
<tr>
<td colspan="3" height="15" valign="center" align="center" style="font-size:0px;"></td>
</tr>
</table>
<!-- End of button table -->
</td>
</tr>
{% endif %}
{% if expiration is not none %}
<tr>
<td height="60" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:13px; color:#999999;">
Ce lien est valable jusqu'au {{ app['date-formatter'].getDate(expiration) }} {{ app['date-formatter'].getTime(expiration) }}
</td>
</tr>
{% endif %}
</table>
<!-- End of content table -->
</td>
</tr>
{% endif %}
<tr>
<td colspan="2" width="720" height="60" valign="center" align="center" style="font-family:sans-serif,'Lucida Console'; font-size:15px; font-weight:bold; text-transform:uppercase; color:#494949;">
<td height="60" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:13px; font-style:italic; color:#dc4848;">
Le contenu de cet email est confidentiel, ne le divulguez pas.
</td>
</tr>
</table>
<!-- End of content table -->
<!-- Footer table -->
<table cellpadding="0" cellspacing="0" border="0" align="center" style="border-style:solid; border-width:1px; border-color:#494949; background-color:#494949;">
<tr>
<td width="10" height="50" valign="center" align="left" style="font-size:0px;"></td>
<td width="710" height="50" valign="center" align="left" style="font-family:Tahoma,sans-serif; font-size:11px; font-style:italic; color:#FFF;">
Si cet email contient des liens non cliquables, copiez/collez ces liens dans votre navigateur.<br/>
Message automatique de Phraseanet - Pour gérer l'envoi d'email automatique, connectez-vous à
<a href="{{ phraseanetURL }}" target="_blank" style="color:#FFA500; color:#FFA500 !important; text-decoration:underline; font-weight:bold; cursor:pointer;">
<span style="color:#FFA500; color:#FFA500 !important; text-decoration:underline; font-weight:bold; cursor:pointer;">{{ phraseanetTitle }}</span>
</a>
</td>
</tr>
</table>
<!-- End of footer table -->
<!-- End of wrapper table -->
</td>
</tr>
<tr>
<td height="50" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:12px; color:#999999;">
Message automatique de Phraseanet<br />
Pour gérer l'envoi d'email automatique, connectez-vous à
<a href="{{ phraseanetURL }}" target="_blank" style="font-weight:bold; cursor:pointer; color:#999999;">
{{ phraseanetTitle }}
</a>
</td>
</tr>
</table>
<!-- End of wrapper table -->
</body>
</html>