mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 13:03:20 +00:00
adressed @romainneutron's comments
This commit is contained in:

committed by
Romain Neutron

parent
aa92dbe124
commit
93b48fdcea
@@ -871,6 +871,7 @@ class Databox implements ControllerProviderInterface
|
||||
{
|
||||
$msg = _('An error occurred');
|
||||
$success = false;
|
||||
$taskCreated = false;
|
||||
|
||||
try {
|
||||
$databox = $app['phraseanet.appbox']->get_databox($databox_id);
|
||||
@@ -879,11 +880,17 @@ class Databox implements ControllerProviderInterface
|
||||
foreach ($databox->get_collections() as $collection) {
|
||||
if ($collection->get_record_amount() <= 500) {
|
||||
$collection->empty_collection(500);
|
||||
if (false === $taskCreated) {
|
||||
$msg = _('Base empty successful');
|
||||
}
|
||||
} else {
|
||||
$settings = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><tasksettings><base_id>" . $collection->get_base_id() . "</base_id></tasksettings>";
|
||||
\task_period_emptyColl::create($app, $settings);
|
||||
$msg = _('A task has been creted, please run it to complete empty collection');
|
||||
|
||||
if (false === $taskCreated) {
|
||||
$msg = _('A task has been created, please run it to complete empty collection');
|
||||
$taskCreated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@@ -658,12 +658,10 @@ class task_period_cindexer extends task_abstract
|
||||
*/
|
||||
public static function getDefaultSettings(Configuration $config, array $params = array())
|
||||
{
|
||||
$binaries = $config['binaries'];
|
||||
$database = $config['main']['database'];
|
||||
|
||||
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<tasksettings>\n<binpath>"
|
||||
. (array_key_exists('phraseanet_indexer', $binaries) ? str_replace('/phraseanet_indexer', '', $binaries['phraseanet_indexer']) : '')
|
||||
. "</binpath><host>" . $database['host'] . "</host><port>"
|
||||
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<tasksettings>\n"
|
||||
."<host>" . $database['host'] . "</host><port>"
|
||||
. $database['port'] . "</port><base>"
|
||||
. $database['dbname'] . "</base><user>"
|
||||
. $database['user'] . "</user><password>"
|
||||
|
@@ -13,7 +13,6 @@ use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
||||
use Alchemy\Phrasea\Notification\Mail\MailSuccessFTPSender;
|
||||
use Alchemy\Phrasea\Notification\Receiver;
|
||||
|
||||
|
||||
class task_period_ftp extends task_appboxAbstract
|
||||
{
|
||||
protected $proxy;
|
||||
@@ -707,7 +706,6 @@ class task_period_ftp extends task_appboxAbstract
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
*/
|
||||
|
@@ -238,8 +238,29 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Invalid file type modal shown when uploaded logo file is invalid #}
|
||||
<div id="invalid-modal" class="modal hide fade">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{% trans %}Invalid file type{% endtrans %}</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
{% set supported_file_types = ['jpg', 'jpeg', 'pjpg', 'gif', 'png']|join(' | ') %}
|
||||
{% trans %} Invalid file type, only ({{ supported_file_types }}) file formats are supported {% endtrans %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn" data-dismiss="modal" aria-hidden="true">Close</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('#invalid-modal').modal({
|
||||
"show": false
|
||||
});
|
||||
|
||||
//add admins
|
||||
$( ".admin_adder" ).autocomplete({
|
||||
source: "/admin/users/typeahead/search/?have_not_right[]=order_master&on_base[]={{ bas_id }}",
|
||||
@@ -330,9 +351,7 @@
|
||||
add: function(e, data) {
|
||||
if (typeof data.files[0].type !== "undefined") {
|
||||
if( ! /(\.|\/)(png|jpeg|jpg|pjpg|gif)$/i.test(data.files[0].type)) {
|
||||
{% set supported_file_types = ['jpg', 'jpeg', 'pjpg', 'gif', 'png']|join(' | ') %}
|
||||
alert("{% trans %} Invalid file type, only ({{ supported_file_types }}) file formats are supported {% endtrans %}");
|
||||
|
||||
$('#invalid-modal').modal('toggle');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user