Merge 3.7

This commit is contained in:
Romain Neutron
2012-09-06 14:30:55 +02:00
22 changed files with 50027 additions and 41599 deletions

View File

@@ -213,7 +213,7 @@ class Browser
*/
public static function getInstance()
{
if ( ! self::$_instance) {
if (!self::$_instance) {
self::$_instance = new self();
}
@@ -289,6 +289,16 @@ class Browser
return $this->_is_html5;
}
/**
* Return true is the browser support the HTML5 File API
*
* @return boolean
*/
public function supportFileAPI()
{
return $this->_is_html5 && ($this->_browser_name !== self::BROWSER_IE || $this->_version >= 10);
}
/**
* Is the Browser very old ?
* @return boolean

View File

@@ -388,11 +388,17 @@ class appbox extends base
*/
$upgrader->set_current_message(_('Copying files'));
$origine = $registry->get('GV_RootPath') . 'config/custom_files/';
$target = $registry->get('GV_RootPath') . 'www/custom/';
$filesystem = $core['file-system'];
$filesystem->mirror($origine, $target);
foreach (array(
'config/custom_files/' => 'www/custom/',
'config/minilogos/' => 'www/custom/minilogos/',
'config/stamp/' => 'www/custom/stamp/',
'config/status/' => 'www/custom/status/',
'config/wm/' => 'www/custom/wm/',
) as $source => $target) {
$filesystem->mirror($registry->get('GV_RootPath') . $source, $registry->get('GV_RootPath') . $target);
}
$upgrader->add_steps_complete(1);

View File

@@ -58,12 +58,12 @@ class module_console_systemUpgrade extends Command
if ($continue == 'y') {
try {
$connexionInc = new \SplFileInfo($old_connexion_file, true);
$configInc = new \SplFileInfo($old_config_file, true);
$connexionInc = new \SplFileInfo($old_connexion_file);
$configInc = new \SplFileInfo($old_config_file);
$Core->getConfiguration()->upgradeFromOldConf($configInc, $connexionInc);
} catch (\Exception $e) {
throw new RuntimeException('Error while upgrading : ' . $e->getMessage());
}
} else {
throw new RuntimeException('Phraseanet is not set up');

View File

@@ -39,7 +39,6 @@ class setup
, "phrasea2"
, "SimpleXML"
, "sockets"
, "sqlite3"
, "xml"
, "zip"
, "zlib"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -79,7 +79,13 @@
{% if module == "prod" %}
{% if user.ACL.has_access_to_module('upload') %}
<li>
<a href="/prod/upload/" class="dialog full-dialog" title="{% trans 'Upload' %}">
{% set link = '/prod/upload/' %}
{% if not browser.supportFileAPI() %}
{% set link = '/prod/upload/flash-version/' %}
{% endif %}
<a href="{{ link }}" class="dialog full-dialog" title="{% trans 'Upload' %}">
<span>
{% trans 'admin::monitor: module upload' %}
</span>

View File

@@ -20,25 +20,28 @@
<div id="tab-upload">
<form id="fileupload" enctype="multipart/form-data" method="POST" action="/prod/upload/">
<div id="uploadBoxLeft" class="well ">
<div id="uploadBoxLeft" class="well">
{# <h5 style="margin-top: 10px;">{% trans 'Choose files to add' %} :</h5> #}
{# action bar #}
<div id="addFileList">
<div class="btn-toolbar">
<span id="spanSWFUploadButton" class="span2"></span>
<br />
<span>
<a href="/prod/upload/" class="dialog full-dialog" title="{% trans 'Upload' %}"><span class="label label-info"><i>{% trans 'Switch to html5 uploader' %}</i></span></a>
</span>
<br />
<span class="comment">
({% trans %} maximum : {{ maxFileSizeReadable }} {% endtrans %})
</span>
{# <button type="button" class="upload-submitter btn btn-inverse input-medium">{% trans 'Send' %}</button> #}
</div>
</div>
<table id="addFileList">
<tr>
<td class='uploader-button'>
<span id="spanSWFUploadButton" class="span2"></span>
<br />
<span class="comment">
({% trans %} maximum : {{ maxFileSizeReadable }} {% endtrans %})
</span>
</td>
<td class='uploader-icon'>
<img src='/skins/icons/logo-flash.png' width="32px" heigh="32px" title="{% trans 'You are using the Flash uploader'%}"/>
</td>
<td class='uploader-info'>
<p>{% trans 'This version does not allow you to access all the features offered by the HTML5 uploader' %}</p>
<a href="/prod/upload/" class="dialog full-dialog">{% trans 'Use the HTML5 uploader' %}</a>
</td>
</tr>
</table>
{# settings box #}
<div class='settings-box'>
<h5>{% trans 'upload:: Destination (collection) :' %} :</h5>
@@ -105,6 +108,7 @@
</div>
<div id="uploadBoxRight" class="well">
<h5 style="margin-top: 10px;">{% trans 'Transmited files' %} : </h5>
<div class='well-small'>
<button id="cancel-all" class="btn disabled" type="button" disabled="disabled">
{% trans "Cancel all" %}
@@ -188,7 +192,9 @@
button_action : SWFUpload.BUTTON_ACTION.SELECT_FILES,
file_queued_handler : function(file) {
var $this = this;
UploaderManager.getUploadBox().closest('.upload-box').show();
if ( ! UploaderManager.getUploadBox().is(':visible')) {
UploaderManager.getUploadBox().closest('.upload-box').show();
}
var formatedFile = {
id: file.id,
@@ -208,35 +214,39 @@
});
},
file_queue_error_handler : function(file, errorCode, message) {
if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
alert(" {% trans "You have attempted to queue too many files" %}");
return false;
if ( ! UploaderManager.getUploadBox().is(':visible')) {
UploaderManager.getUploadBox().closest('.upload-box').show();
}
if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
alert(" {% trans "You have attempted to queue too many files" %}");
return false;
}
var error = "{% trans "Unknow Error" %}";
switch (errorCode) {
case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
error = language.errorFileApiTooBig;
break;
case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
error = "{% trans "Cannot upload Zero Byte files" %}";
break;
case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
error = "{% trans "Invalid file type" %}";
break;
default:
if (file !== null) {
error = "{% trans "Unhandled Error" %}";
}
break;
}
var error = "{% trans "Unknow Error" %}";
switch (errorCode) {
case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
error = language.errorFileApiTooBig;
break;
case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
error = "{% trans "Cannot upload Zero Byte files" %}";
break;
case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
error = "{% trans "Invalid file type" %}";
break;
default:
if (file !== null) {
error = "{% trans "Unhandled Error" %}";
}
break;
}
var params = $.extend({}, file, {error: error, language: language});
p4.Mustache.Render('Upload-Items-Error', params, function(html){
UploaderManager.getUploadBox().append(html);
$("#"+file.id, UploaderManager.getDownloadBox()).find('.canva-wrapper').remove();
});
var params = $.extend({}, file, {error: error, language: language});
p4.Mustache.Render('Upload-Items-Error', params, function(html){
UploaderManager.getUploadBox().append(html);
$("#"+file.id, UploaderManager.getDownloadBox()).find('.canva-wrapper').remove();
});
},
file_dialog_complete_handler : function(numFilesSelected, numFilesQueued) {
if (numFilesQueued > 0) {
@@ -297,7 +307,6 @@
$("#"+file.id, UploaderManager.getDownloadBox()).find('p.error').append(html).show();
});
return false;
},
upload_success_handler : function(file, response) {
var response = $.parseJSON(response);
@@ -354,6 +363,9 @@
}
});
var nbElements = $(".upload-box-addedfiles ul:first li.upload-valid > div").length;
var elementChecked = 0;
$(".upload-box-addedfiles ul:first li.upload-valid > div").each(function(index, element) {
var file = swfu.getFile($(this).attr("id"));
@@ -367,6 +379,12 @@
//Add file
file_order.push(file);
elementChecked++;
if( elementChecked === nbElements) {
//Start upload
swfu.startUpload(file_order.shift().id);
}
});
}
});
@@ -375,10 +393,7 @@
$("button.clear-queue", UploaderManager.getContainer()).attr("disabled", true).addClass("disabled");
$("button.upload-submitter", UploaderManager.getContainer()).attr("disabled", true).addClass('disabled');
if( file_order.length > 0 ) {
//Start upload
swfu.startUpload(file_order.shift().id);
} else {
if (nbElements === 0) {
alert("{% trans 'Please select at least one valid file' %}");
}
});

View File

@@ -20,27 +20,36 @@
<div id="tab-upload">
<form id="fileupload" enctype="multipart/form-data" method="POST" action="/prod/upload/">
<div id="uploadBoxLeft" class="well ">
<div id="uploadBoxLeft" class="well">
{# <h5 style="margin-top: 10px;">{% trans 'Choose files to add' %} :</h5> #}
{# action bar #}
<div id="addFileList">
<div class="btn-toolbar">
<span class="btn btn-inverse fileinput-button input-medium">
<span>{% trans 'Select files...' %}</span>
<input type="file" name="files[]" multiple>
</span>
<br />
<span>
<a href="/prod/upload/flash-version/" class="dialog full-dialog" title="{% trans 'Upload' %}"><span class="label label-info"><i>{% trans 'Switch to flash uploader' %}</i></span></a>
</span>
<br />
<span class="comment">
({% trans %} maximum : {{ maxFileSizeReadable }} {% endtrans %})
</span>
{# <button type="button" class="upload-submitter btn btn-inverse input-medium">{% trans 'Send' %}</button> #}
</div>
</div>
<table id="addFileList">
<tr>
<td class='uploader-button'>
<span class="btn btn-inverse fileinput-button input-medium">
<span>{% trans 'Select files...' %}</span>
<input type="file" name="files[]" multiple>
</span>
<br />
<span class="comment">
({% trans %} maximum : {{ maxFileSizeReadable }} {% endtrans %})
</span>
</td>
<td class='uploader-icon'>
<img src='/skins/icons/html5-logo.jpeg' width="32px" heigh="32px" title="{% trans 'You are using the HTML5 uploader'%}"/>
</td>
<td class="uploader-info">
<p>
{% trans 'You are using the HTML5 uploader.' %}
{% if not browser.supportFileAPI() %}
{% trans 'Your browser does not support all HTML5 features properly.' %}
{% endif %}
</p>
<a href="/prod/upload/flash-version/" class="dialog full-dialog">{% trans 'Use the Flash uploader' %}</a>
</td>
</tr>
</table>
{# settings box #}
<div class='settings-box'>

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -4084,6 +4084,44 @@ dans l'onglet thesaurus : arbres, menus contextuels
height: 10px;
}
#uploadBox .uploader-button{
text-align: center;
width:50%;
}
#uploadBox #addFileList {
width:100%;
table-layout:fixed;
border:none;
}
#uploadBox #addFileList td{
vertical-align: middle;
}
#uploadBox .uploader-icon {
width:15%;
text-align:left;
}
#uploadBox .uploader-info {
font-size:10px;
width:35%;
text-align:left;
}
#uploadBox .uploader-info p {
line-height:10px;
font-size:10px;
word-wrap: break-word;
}
#uploadBox .uploader-info a {
text-decoration: underline;
color: darkblue;
margin:5px 0;
}
#uploadBoxRight .progress .progress-bar {
height: 10px;
}

View File

@@ -4221,6 +4221,45 @@ dans l'onglet thesaurus : arbres, menus contextuels
height: 10px;
}
#uploadBox .uploader-button{
text-align: center;
width:50%;
}
#uploadBox #addFileList {
width:100%;
table-layout:fixed;
border:none;
}
#uploadBox #addFileList td{
vertical-align: middle;
}
#uploadBox .uploader-icon {
width:15%;
text-align:left;
}
#uploadBox .uploader-info {
font-size:10px;
width:35%;
text-align:left;
}
#uploadBox .uploader-info p {
line-height:10px;
font-size:10px;
word-wrap: break-word;
}
#uploadBox .uploader-info a {
text-decoration: underline;
color: darkblue;
margin:5px 0;
}
#uploadBoxRight .progress .progress-bar {
height: 10px;
}