adressed @romainneutron's comments

This commit is contained in:
Nicolas Le Goff
2013-08-07 11:58:46 +02:00
committed by Romain Neutron
parent aa92dbe124
commit 93b48fdcea
6 changed files with 73 additions and 51 deletions

View File

@@ -94,7 +94,7 @@ class Install extends Command
$abConn = $this->getABConn($input, $output, $dialog); $abConn = $this->getABConn($input, $output, $dialog);
list($dbConn, $template) = $this->getDBConn($input, $output, $abConn, $dialog); list($dbConn, $template) = $this->getDBConn($input, $output, $abConn, $dialog);
list($email, $password) = $this->getCredentials($input, $output, $dialog); list($email, $password) = $this->getCredentials($input, $output, $dialog);
$dataPath = $this->getDataPath($input, $output,$dialog); $dataPath = $this->getDataPath($input, $output, $dialog);
$serverName = $this->getServerName($input, $output, $dialog); $serverName = $this->getServerName($input, $output, $dialog);
$indexer = $this->getindexer($input, $output); $indexer = $this->getindexer($input, $output);

View File

@@ -871,6 +871,7 @@ class Databox implements ControllerProviderInterface
{ {
$msg = _('An error occurred'); $msg = _('An error occurred');
$success = false; $success = false;
$taskCreated = false;
try { try {
$databox = $app['phraseanet.appbox']->get_databox($databox_id); $databox = $app['phraseanet.appbox']->get_databox($databox_id);
@@ -879,11 +880,17 @@ class Databox implements ControllerProviderInterface
foreach ($databox->get_collections() as $collection) { foreach ($databox->get_collections() as $collection) {
if ($collection->get_record_amount() <= 500) { if ($collection->get_record_amount() <= 500) {
$collection->empty_collection(500); $collection->empty_collection(500);
if (false === $taskCreated) {
$msg = _('Base empty successful'); $msg = _('Base empty successful');
}
} else { } else {
$settings = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><tasksettings><base_id>" . $collection->get_base_id() . "</base_id></tasksettings>"; $settings = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><tasksettings><base_id>" . $collection->get_base_id() . "</base_id></tasksettings>";
\task_period_emptyColl::create($app, $settings); \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 { } else {

View File

@@ -658,12 +658,10 @@ class task_period_cindexer extends task_abstract
*/ */
public static function getDefaultSettings(Configuration $config, array $params = array()) public static function getDefaultSettings(Configuration $config, array $params = array())
{ {
$binaries = $config['binaries'];
$database = $config['main']['database']; $database = $config['main']['database'];
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<tasksettings>\n<binpath>" return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<tasksettings>\n"
. (array_key_exists('phraseanet_indexer', $binaries) ? str_replace('/phraseanet_indexer', '', $binaries['phraseanet_indexer']) : '') ."<host>" . $database['host'] . "</host><port>"
. "</binpath><host>" . $database['host'] . "</host><port>"
. $database['port'] . "</port><base>" . $database['port'] . "</port><base>"
. $database['dbname'] . "</base><user>" . $database['dbname'] . "</base><user>"
. $database['user'] . "</user><password>" . $database['user'] . "</user><password>"

View File

@@ -13,7 +13,6 @@ use Alchemy\Phrasea\Exception\InvalidArgumentException;
use Alchemy\Phrasea\Notification\Mail\MailSuccessFTPSender; use Alchemy\Phrasea\Notification\Mail\MailSuccessFTPSender;
use Alchemy\Phrasea\Notification\Receiver; use Alchemy\Phrasea\Notification\Receiver;
class task_period_ftp extends task_appboxAbstract class task_period_ftp extends task_appboxAbstract
{ {
protected $proxy; protected $proxy;
@@ -707,7 +706,6 @@ class task_period_ftp extends task_appboxAbstract
return $this; return $this;
} }
/** /**
* @param array $params * @param array $params
*/ */

View File

@@ -238,8 +238,29 @@
{% endif %} {% endif %}
</div> </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">&times;</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"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
$('#invalid-modal').modal({
"show": false
});
//add admins //add admins
$( ".admin_adder" ).autocomplete({ $( ".admin_adder" ).autocomplete({
source: "/admin/users/typeahead/search/?have_not_right[]=order_master&on_base[]={{ bas_id }}", source: "/admin/users/typeahead/search/?have_not_right[]=order_master&on_base[]={{ bas_id }}",
@@ -330,9 +351,7 @@
add: function(e, data) { add: function(e, data) {
if (typeof data.files[0].type !== "undefined") { if (typeof data.files[0].type !== "undefined") {
if( ! /(\.|\/)(png|jpeg|jpg|pjpg|gif)$/i.test(data.files[0].type)) { if( ! /(\.|\/)(png|jpeg|jpg|pjpg|gif)$/i.test(data.files[0].type)) {
{% set supported_file_types = ['jpg', 'jpeg', 'pjpg', 'gif', 'png']|join(' | ') %} $('#invalid-modal').modal('toggle');
alert("{% trans %} Invalid file type, only ({{ supported_file_types }}) file formats are supported {% endtrans %}");
return false; return false;
} }
} }