mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-08 02:24:26 +00:00
Merge branch '3.8'
Conflicts: lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php lib/classes/API/OAuth2/Adapter.php lib/classes/API/V1/adapter.php lib/classes/Feed/Adapter.php lib/classes/Feed/Collection.php lib/classes/Feed/Entry/Adapter.php lib/classes/Feed/Entry/Item.php lib/classes/Feed/Publisher/Adapter.php lib/classes/User/Adapter.php lib/classes/base.php lib/classes/connection.php lib/classes/databox/cgu.php lib/classes/eventsmanager/notify/autoregister.php lib/classes/eventsmanager/notify/bridgeuploadfail.php lib/classes/eventsmanager/notify/order.php lib/classes/eventsmanager/notify/orderdeliver.php lib/classes/eventsmanager/notify/ordernotdelivered.php lib/classes/eventsmanager/notify/push.php lib/classes/eventsmanager/notify/register.php lib/classes/eventsmanager/notify/validate.php lib/classes/eventsmanager/notify/validationdone.php lib/classes/eventsmanager/notify/validationreminder.php lib/classes/module/console/taskState.php lib/classes/module/console/taskrun.php lib/classes/record/adapter.php lib/classes/registry.php lib/classes/set/order.php lib/classes/task/abstract.php lib/classes/task/appboxAbstract.php lib/classes/task/databoxAbstract.php lib/classes/task/manager.php lib/classes/task/period/RecordMover.php lib/classes/task/period/apibridge.php lib/classes/task/period/archive.php lib/classes/task/period/ftp.php lib/classes/task/period/ftpPull.php templates/web/prod/upload/lazaret.html.twig
This commit is contained in:
@@ -631,6 +631,8 @@ class Application extends SilexApplication
|
||||
$twig->addFilter('stripdoublequotes', new \Twig_Filter_Function('stripdoublequotes'));
|
||||
$twig->addFilter('get_collection_logo', new \Twig_Filter_Function('collection::getLogo'));
|
||||
$twig->addFilter('floor', new \Twig_Filter_Function('floor'));
|
||||
$twig->addFilter('ceil', new \Twig_Filter_Function('ceil'));
|
||||
$twig->addFilter('max', new \Twig_Filter_Function('max'));
|
||||
$twig->addFilter('min', new \Twig_Filter_Function('min'));
|
||||
$twig->addFilter('bas_labels', new \Twig_Filter_Function('phrasea::bas_labels'));
|
||||
$twig->addFilter('sbas_names', new \Twig_Filter_Function('phrasea::sbas_names'));
|
||||
|
@@ -83,18 +83,20 @@ class Lazaret implements ControllerProviderInterface
|
||||
$baseIds = array_keys($app['acl']->get($app['authentication']->getUser())->get_granted_base(['canaddrecord']));
|
||||
|
||||
$lazaretFiles = null;
|
||||
$perPage = 10;
|
||||
$page = max(1, $request->query->get('page', 1));
|
||||
$offset = ($page - 1) * $perPage;
|
||||
|
||||
if (count($baseIds) > 0) {
|
||||
$lazaretRepository = $app['EM']->getRepository('Phraseanet:LazaretFile');
|
||||
|
||||
$lazaretFiles = $lazaretRepository->findPerPage(
|
||||
$baseIds, $request->query->get('offset', 0), $request->query->get('limit', 10)
|
||||
);
|
||||
$lazaretFiles = $lazaretRepository->findPerPage($baseIds, $offset, $perPage);
|
||||
}
|
||||
|
||||
return $app['twig']->render(
|
||||
'prod/upload/lazaret.html.twig', ['lazaretFiles' => $lazaretFiles]
|
||||
);
|
||||
return $app['twig']->render('prod/upload/lazaret.html.twig', array(
|
||||
'lazaretFiles' => $lazaretFiles,
|
||||
'currentPage' => $page,
|
||||
'perPage' => $perPage,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -493,7 +493,7 @@ class Basket
|
||||
$totSize += $basket_element->getRecord($app)
|
||||
->get_subdef('document')
|
||||
->get_size();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\Model\Repositories;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\Tools\Pagination\Paginator;
|
||||
|
||||
/**
|
||||
* LazaretFileRepository
|
||||
@@ -21,12 +22,11 @@ use Doctrine\ORM\EntityRepository;
|
||||
*/
|
||||
class LazaretFileRepository extends EntityRepository
|
||||
{
|
||||
|
||||
public function findPerPage(array $base_ids, $offset = 0, $perPage = 10)
|
||||
{
|
||||
$base_ids = implode(', ', array_map(function ($int) {
|
||||
return (int) $int;
|
||||
}, $base_ids));
|
||||
return (int) $int;
|
||||
}, $base_ids));
|
||||
|
||||
$dql = '
|
||||
SELECT f
|
||||
@@ -38,8 +38,6 @@ class LazaretFileRepository extends EntityRepository
|
||||
$query->setFirstResult($offset)
|
||||
->setMaxResults($perPage);
|
||||
|
||||
$paginator = new \Doctrine\ORM\Tools\Pagination\Paginator($query, true);
|
||||
|
||||
return $paginator;
|
||||
return new Paginator($query, true);
|
||||
}
|
||||
}
|
||||
|
@@ -234,7 +234,7 @@ class ACL implements cache_cacheableInterface
|
||||
$subdef_class = $record->get_databox()->get_subdef_structure()
|
||||
->get_subdef($record->get_type(), $subdef_name)
|
||||
->get_class();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -741,7 +741,7 @@ class ACL implements cache_cacheableInterface
|
||||
|
||||
try {
|
||||
$ret[$sbas_id] = $this->app['phraseanet.appbox']->get_databox((int) $sbas_id);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -792,7 +792,7 @@ class ACL implements cache_cacheableInterface
|
||||
$this->_rights_records_document = $tmp_rights['document'];
|
||||
|
||||
return $this;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
$sql = 'SELECT sbas_id, record_id, preview, document
|
||||
@@ -834,7 +834,7 @@ class ACL implements cache_cacheableInterface
|
||||
$this->is_admin = $this->get_data_from_cache(self::CACHE_IS_ADMIN);
|
||||
|
||||
return $this;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
$sql = 'SELECT create_db
|
||||
@@ -928,7 +928,7 @@ class ACL implements cache_cacheableInterface
|
||||
$this->_limited = $this->get_data_from_cache(self::CACHE_LIMITS_BAS);
|
||||
|
||||
return $this;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -181,7 +181,7 @@ class API_OAuth2_Adapter extends OAuth2
|
||||
}
|
||||
|
||||
return ($application->get_client_secret() === $client_secret);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ class API_OAuth2_Adapter extends OAuth2
|
||||
, 'oauth_token' => $token->get_value()
|
||||
];
|
||||
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ class API_OAuth2_Adapter extends OAuth2
|
||||
, 'expires' => $code->get_expires()
|
||||
, 'account_id' => $code->get_account()->get_id()
|
||||
];
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ class API_OAuth2_Adapter extends OAuth2
|
||||
, 'expires' => $token->get_expires()->format('U')
|
||||
, 'client_id' => $token->get_account()->get_application()->get_client_id()
|
||||
];
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ class API_OAuth2_Adapter extends OAuth2
|
||||
try {
|
||||
$user = User_Adapter::getInstance($usr_id, $this->app);
|
||||
$account = API_OAuth2_Account::load_with_user($this->app, $this->client, $user);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$account = $this->createAccount($usr_id);
|
||||
}
|
||||
|
||||
@@ -575,7 +575,7 @@ class API_OAuth2_Adapter extends OAuth2
|
||||
$token->set_session_id($ses_id);
|
||||
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1088,9 +1088,9 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
}
|
||||
|
||||
$record->set_metadatas($metadatas);
|
||||
$result->set_datas(["record_metadatas" => $this->list_record_caption($record->get_caption())]);
|
||||
} catch (Exception $e) {
|
||||
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, $this->app->trans('An error occured'));
|
||||
$result->set_datas(array("record_metadatas" => $this->list_record_caption($record->get_caption())));
|
||||
} catch (\Exception $e) {
|
||||
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured'));
|
||||
}
|
||||
|
||||
return $result;
|
||||
@@ -1135,7 +1135,7 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
$this->list_record_status($databox, $record->get_status())
|
||||
]
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, $this->app->trans('An error occured'));
|
||||
}
|
||||
|
||||
@@ -1161,7 +1161,7 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
|
||||
$record->move_to_collection($collection, $this->app['phraseanet.appbox']);
|
||||
$result->set_datas(["record" => $this->list_record($record)]);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, $e->getMessage());
|
||||
}
|
||||
|
||||
@@ -1183,9 +1183,9 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
try {
|
||||
$record = $databox->get_record($record_id);
|
||||
$result->set_datas(['record' => $this->list_record($record)]);
|
||||
} catch (NotFoundHttpException $e) {
|
||||
} catch (\NotFoundHttpException $e) {
|
||||
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, $this->app->trans('Record Not Found'));
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, $this->app->trans('An error occured'));
|
||||
}
|
||||
|
||||
@@ -1207,9 +1207,9 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
try {
|
||||
$story = $databox->get_record($story_id);
|
||||
$result->set_datas(['story' => $this->list_story($story)]);
|
||||
} catch (NotFoundHttpException $e) {
|
||||
} catch (\NotFoundHttpException $e) {
|
||||
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, $this->app->trans('Story Not Found'));
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, $this->app->trans('An error occured'));
|
||||
}
|
||||
|
||||
|
@@ -328,7 +328,7 @@ class Bridge_Account
|
||||
if ( ! isset($apis[$api_id])) {
|
||||
try {
|
||||
$apis[$api_id] = new Bridge_Api($app, $api_id);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@@ -430,7 +430,7 @@ class Bridge_Api
|
||||
$ret = $action($this);
|
||||
|
||||
return $ret;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$this->get_connector()->handle_Exception($e);
|
||||
|
||||
if ($e instanceof Bridge_Exception_ActionAuthNeedReconnect) {
|
||||
@@ -524,7 +524,7 @@ class Bridge_Api
|
||||
foreach ($rs as $row) {
|
||||
try {
|
||||
$results[] = new Bridge_Api($app, $row['id']);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -457,7 +457,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
||||
$this->get_element_from_id($ticket["dist_id"], $element->get_type());
|
||||
$element->set_dist_id($ticket["dist_id"]);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return self::UPLOAD_STATE_FAILED;
|
||||
}
|
||||
|
||||
|
@@ -295,7 +295,7 @@ class Bridge_Element
|
||||
if (! $this->connector_element) {
|
||||
try {
|
||||
$this->connector_element = $this->account->get_api()->get_element_from_id($this->dist_id, $this->type);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@@ -315,7 +315,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
try {
|
||||
self::$_instance[$id] = $app['phraseanet.appbox']->get_data_from_cache('_user_' . $id);
|
||||
self::$_instance[$id]->set_app($app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
self::$_instance[$id] = new self($id, $app);
|
||||
$app['phraseanet.appbox']->set_data_to_cache(self::$_instance[$id], '_user_' . $id);
|
||||
}
|
||||
@@ -1132,7 +1132,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
':value' => $value
|
||||
]);
|
||||
$this->delete_data_from_cache();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -1229,7 +1229,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
$stmt->closeCursor();
|
||||
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -436,7 +436,7 @@ class appbox extends base
|
||||
{
|
||||
try {
|
||||
return $this->get_data_from_cache(self::CACHE_SBAS_IDS);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
$sql = 'SELECT sbas_id FROM sbas';
|
||||
|
@@ -312,7 +312,7 @@ abstract class base implements cache_cacheableInterface
|
||||
$stmt = $this->get_connection()->prepare($sql);
|
||||
$stmt->execute();
|
||||
$stmt->closeCursor();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$recommends[] = [
|
||||
'message' => $app->trans('Erreur lors de la tentative ; errreur : %message%', ['%message%' => $e->getMessage()]),
|
||||
'sql' => $sql
|
||||
@@ -368,7 +368,7 @@ abstract class base implements cache_cacheableInterface
|
||||
|
||||
return true;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
throw new Exception('Unable to set the database version : '.$e->getMessage());
|
||||
}
|
||||
|
||||
@@ -534,7 +534,7 @@ abstract class base implements cache_cacheableInterface
|
||||
$stmt = $this->get_connection()->prepare($def['sql']);
|
||||
$stmt->execute($def['params']);
|
||||
$stmt->closeCursor();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$recommends[] = [
|
||||
'message' => $this->app->trans('Erreur lors de la tentative ; errreur : %message%', ['%message%' => $e->getMessage()]),
|
||||
'sql' => $def['sql']
|
||||
@@ -748,7 +748,7 @@ abstract class base implements cache_cacheableInterface
|
||||
$stmt = $this->get_connection()->prepare($a);
|
||||
$stmt->execute();
|
||||
$stmt->closeCursor();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$return[] = [
|
||||
'message' => $this->app->trans('Erreur lors de la tentative ; errreur : %message%', ['%message%' => $e->getMessage()]),
|
||||
'sql' => $a
|
||||
@@ -761,7 +761,7 @@ abstract class base implements cache_cacheableInterface
|
||||
$stmt = $this->get_connection()->prepare($a);
|
||||
$stmt->execute();
|
||||
$stmt->closeCursor();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$return[] = [
|
||||
'message' => $this->app->trans('Erreur lors de la tentative ; errreur : %message%', ['%message%' => $e->getMessage()]),
|
||||
'sql' => $a
|
||||
|
@@ -334,7 +334,7 @@ class caption_field implements cache_cacheableInterface
|
||||
*/
|
||||
$app['phraseanet.SE']->updateRecord($record);
|
||||
unset($record);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -388,7 +388,7 @@ class caption_field implements cache_cacheableInterface
|
||||
$app['phraseanet.SE']->updateRecord($record);
|
||||
unset($caption_field);
|
||||
unset($record);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -67,7 +67,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
|
||||
$fields = [];
|
||||
try {
|
||||
$fields = $this->get_data_from_cache();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$sql = "SELECT m.id as meta_id, s.id as structure_id
|
||||
FROM metadatas m, metadatas_structure s
|
||||
WHERE m.record_id = :record_id AND s.id = m.meta_struct_id
|
||||
|
@@ -64,7 +64,7 @@ class collection implements cache_cacheableInterface
|
||||
$this->labels = $datas['labels'];
|
||||
|
||||
return $this;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -143,7 +143,7 @@ class connection
|
||||
|
||||
try {
|
||||
self::$_PDO_instance[$name] = new connection_pdo($name, $hostname, $port, $user, $password, $dbname, [], $app['debug']);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
throw new Exception('Connection not available');
|
||||
}
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ class connection_pdoStatementDebugger
|
||||
$exception = null;
|
||||
try {
|
||||
$result = $this->statement->execute($params);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$exception = $e;
|
||||
}
|
||||
$time = microtime(true) - $start;
|
||||
|
@@ -208,7 +208,7 @@ class databox extends base
|
||||
foreach ($this->get_available_collections() as $coll_id) {
|
||||
try {
|
||||
$ret[] = collection::get_from_coll_id($this->app, $this, $coll_id);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -220,7 +220,7 @@ class databox extends base
|
||||
{
|
||||
try {
|
||||
return $this->get_data_from_cache(self::CACHE_COLLECTIONS);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ class databox extends base
|
||||
$stmt = $connection->prepare($sql);
|
||||
$stmt->execute();
|
||||
$stmt->closeCursor();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ class databox extends base
|
||||
|
||||
try {
|
||||
$metaStructData = $this->get_data_from_cache(self::CACHE_META_STRUCT);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$sql = 'SELECT id, name FROM metadatas_structure ORDER BY sorter ASC';
|
||||
$stmt = $this->get_connection()->prepare($sql);
|
||||
$stmt->execute();
|
||||
@@ -958,7 +958,7 @@ class databox extends base
|
||||
|
||||
try {
|
||||
$meta_struct_field->set_tag(\databox_field::loadClassFromTagName($src))->save();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1003,7 +1003,7 @@ class databox extends base
|
||||
if ( ! empty($row['logo'])) {
|
||||
file_put_contents($this->app['root.path'] . '/config/minilogos/' . $base_id, $row['logo']);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
unset($e);
|
||||
}
|
||||
}
|
||||
@@ -1134,7 +1134,7 @@ class databox extends base
|
||||
$this->thesaurus = $this->get_data_from_cache(self::CACHE_THESAURUS);
|
||||
|
||||
return $this->thesaurus;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
unset($e);
|
||||
}
|
||||
|
||||
@@ -1146,7 +1146,7 @@ class databox extends base
|
||||
$stmt->closeCursor();
|
||||
$this->thesaurus = $row['thesaurus'];
|
||||
$this->set_data_to_cache($this->thesaurus, self::CACHE_THESAURUS);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
unset($e);
|
||||
}
|
||||
|
||||
@@ -1171,7 +1171,7 @@ class databox extends base
|
||||
{
|
||||
try {
|
||||
return $this->get_data_from_cache(self::CACHE_STRUCTURE);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -1362,7 +1362,7 @@ class databox extends base
|
||||
$this->cgus = $this->get_data_from_cache(self::CACHE_CGUS);
|
||||
|
||||
return $this;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -67,7 +67,7 @@ class databox_cgu
|
||||
|
||||
if ($userValidation)
|
||||
$terms[$name] = ['sbas_id' => $databox->get_sbas_id(), 'terms' => $value, 'date' => $update];
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -275,7 +275,7 @@ class databox_field implements cache_cacheableInterface
|
||||
if ( ! isset(self::$_instance[$instance_id]) || (self::$_instance[$instance_id] instanceof self) === false) {
|
||||
try {
|
||||
self::$_instance[$instance_id] = $databox->get_data_from_cache($cache_key);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
self::$_instance[$instance_id] = new self($app, $databox, $id);
|
||||
$databox->set_data_to_cache(self::$_instance[$instance_id], $cache_key);
|
||||
}
|
||||
|
@@ -137,7 +137,7 @@ class databox_status
|
||||
foreach ($sbas_ids as $databox) {
|
||||
try {
|
||||
$statuses[$databox->get_sbas_id()] = $databox->get_statusbits();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -166,7 +166,7 @@ class databox_status
|
||||
}
|
||||
try {
|
||||
$statuses[$databox->get_sbas_id()] = $databox->get_statusbits();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -112,7 +112,7 @@ class eventsmanager_broker
|
||||
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||
$stmt->execute($params);
|
||||
$stmt->closeCursor();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -73,7 +73,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
|
||||
|
||||
$mailColl[$row['usr_id']][] = $row['base_id'];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
|
||||
|
||||
try {
|
||||
$registered_user = User_Adapter::getInstance($params['usr_id'], $this->app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
|
||||
if ($this->shouldSendNotificationFor($usr_id)) {
|
||||
try {
|
||||
$admin_user = User_Adapter::getInstance($usr_id, $this->app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
|
||||
$usr_id = (string) $sx->usr_id;
|
||||
try {
|
||||
User_Adapter::getInstance($usr_id, $this->app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
|
||||
try {
|
||||
$receiver = Receiver::fromUser($to);
|
||||
$readyToSend = true;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -120,7 +120,7 @@ class eventsmanager_notify_bridgeuploadfail extends eventsmanager_notifyAbstract
|
||||
try {
|
||||
$account = Bridge_Account::load_account($this->app, $account_id);
|
||||
$record = new record_adapter($this->app, $sbas_id, $rid);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@@ -63,7 +63,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
|
||||
$users = $query->on_base_ids($base_ids)
|
||||
->who_have_right(['order_master'])
|
||||
->execute()->get_results();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
|
||||
|
||||
try {
|
||||
User_Adapter::getInstance($usr_id, $this->app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@@ -146,7 +146,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract
|
||||
|
||||
try {
|
||||
User_Adapter::getInstance($from, $this->app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract
|
||||
|
||||
try {
|
||||
$basket = $this->app['converter.basket']->convert($ssel_id);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
$ret = [
|
||||
|
@@ -82,7 +82,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac
|
||||
$emitter = Emitter::fromUser($user_from);
|
||||
|
||||
$readyToSend = true;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac
|
||||
|
||||
try {
|
||||
User_Adapter::getInstance($from, $this->app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@@ -121,7 +121,7 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract
|
||||
|
||||
try {
|
||||
User_Adapter::getInstance($from, $this->app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@@ -74,7 +74,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
|
||||
|
||||
$mailColl[$row['usr_id']][] = $row['base_id'];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
|
||||
|
||||
try {
|
||||
User_Adapter::getInstance($usr_id, $this->app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@@ -139,7 +139,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract
|
||||
|
||||
try {
|
||||
User_Adapter::getInstance($from, $this->app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract
|
||||
try {
|
||||
$basket = $this->app['converter.basket']->convert($ssel_id);
|
||||
$basket_name = trim($basket->getName()) ? : $this->app->trans('Une selection');
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$basket_name = $this->app->trans('Une selection');
|
||||
}
|
||||
|
||||
|
@@ -133,7 +133,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
|
||||
|
||||
try {
|
||||
$registered_user = User_Adapter::getInstance($from, $this->app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
|
||||
|
||||
try {
|
||||
$basket = $this->app['converter.basket']->convert($ssel_id);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@@ -89,7 +89,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
|
||||
try {
|
||||
$user_from = User_Adapter::getInstance($params['from'], $this->app);
|
||||
$user_to = User_Adapter::getInstance($params['to'], $this->app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
|
||||
|
||||
try {
|
||||
User_Adapter::getInstance($from, $this->app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
|
||||
try {
|
||||
$basket = $this->app['converter.basket']->convert($ssel_id);
|
||||
$basket_name = trim($basket->getName()) ? : $this->app->trans('Une selection');
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$basket_name = $this->app->trans('Une selection');
|
||||
}
|
||||
|
||||
|
@@ -209,7 +209,7 @@ class ftpclient
|
||||
echo "Resume seems not to be supported, try again from scratch\n<br>";
|
||||
try {
|
||||
$this->unlink($remotefile);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
echo $e;
|
||||
}
|
||||
$ret = $this->nb_put($remotefile, $localfile, 0);
|
||||
@@ -252,7 +252,7 @@ class ftpclient
|
||||
echo "Resume seems not to be supported, try again from scratch\n<br>";
|
||||
try {
|
||||
$this->unlink($localfile);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
echo $e;
|
||||
}
|
||||
$ret = $this->nb_get($localfile, $remotefile, 0);
|
||||
|
@@ -254,7 +254,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea
|
||||
$this->label = $datas['label'];
|
||||
|
||||
return $this;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea
|
||||
{
|
||||
try {
|
||||
return new self($app, $databox, $media_subdef);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -173,7 +173,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
||||
$this->creation_date = $datas['creation_date'];
|
||||
|
||||
return $this;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -71,7 +71,7 @@ class module_console_sphinxGenerateSuggestion extends Command
|
||||
|
||||
try {
|
||||
$connbas = connection::getPDOConnection($this->container, $sbas_id);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -90,7 +90,7 @@ class module_console_systemMailCheck extends Command
|
||||
$tmp_user->set_email(null);
|
||||
|
||||
unset($users[$id]);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$output->writeln('<error>Wrong id</error>');
|
||||
}
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ class module_console_systemTemplateGenerator extends Command
|
||||
$this->container['twig']->loadTemplate(str_replace($tplDir, '', $file->getPathname()));
|
||||
$output->writeln('' . $file . '');
|
||||
$n_ok ++;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$output->writeln('<error>' . $e->getMessage() . '</error>');
|
||||
$n_error ++;
|
||||
}
|
||||
|
@@ -850,7 +850,7 @@ class module_report
|
||||
$this->setReport();
|
||||
|
||||
return $this->report;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
@@ -80,7 +80,7 @@ class module_report_add extends module_report
|
||||
try {
|
||||
$user = User_Adapter::getInstance($value, $this->app);
|
||||
$caption = $user->get_display_name();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
} elseif ($field == 'date')
|
||||
|
@@ -328,7 +328,7 @@ class module_report_dashboard implements module_report_dashboard_componentInterf
|
||||
$this->app, $sbasid, $coll, $this->dmin, $this->dmax
|
||||
);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
$i ++;
|
||||
|
@@ -76,7 +76,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
|
||||
$result->setApplication($app);
|
||||
|
||||
return $result;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -113,7 +113,7 @@ class module_report_download extends module_report
|
||||
if (array_key_exists('record_id', $row)) {
|
||||
try {
|
||||
$record = new \record_adapter($app, $this->sbas_id, $row['record_id']);
|
||||
} catch (Exception_Record_AdapterNotFound $e) {
|
||||
} catch (\Exception_Record_AdapterNotFound $e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -80,7 +80,7 @@ class module_report_edit extends module_report
|
||||
try {
|
||||
$user = User_Adapter::getInstance($value, $this->app);
|
||||
$caption = $user->get_display_name();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
} elseif ($field == 'date') {
|
||||
|
@@ -496,7 +496,7 @@ class module_report_nav extends module_report
|
||||
|
||||
try {
|
||||
$record = new record_adapter($this->app, $sbas_id, $rid);
|
||||
} catch (Exception_Record_AdapterNotFound $e) {
|
||||
} catch (\Exception_Record_AdapterNotFound $e) {
|
||||
return $this->report;
|
||||
}
|
||||
|
||||
|
@@ -81,7 +81,7 @@ class module_report_push extends module_report
|
||||
try {
|
||||
$user = User_Adapter::getInstance($value, $this->app);
|
||||
$caption = $user->get_display_name();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
} elseif ($field == 'date') {
|
||||
|
@@ -81,7 +81,7 @@ class module_report_sent extends module_report
|
||||
try {
|
||||
$user = User_Adapter::getInstance($value, $this->app);
|
||||
$caption = $user->get_display_name();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
} elseif ($field == 'date') {
|
||||
|
@@ -81,7 +81,7 @@ class module_report_validate extends module_report
|
||||
try {
|
||||
$user = User_Adapter::getInstance($value, $this->app);
|
||||
$caption = $user->get_display_name();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
} elseif ($field == 'date') {
|
||||
|
@@ -69,7 +69,7 @@ class patch_320alpha4b implements patchInterface
|
||||
$stmt = $appbox->get_connection()->prepare($sql);
|
||||
$stmt->execute();
|
||||
$stmt->closeCursor();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -49,7 +49,7 @@ class phrasea
|
||||
self::$_sbas_params = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_PARAMS);
|
||||
|
||||
return self::$_sbas_params;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ class phrasea
|
||||
if (!self::$_bas2sbas) {
|
||||
try {
|
||||
self::$_bas2sbas = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_FROM_BAS);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$sql = 'SELECT base_id, sbas_id FROM bas';
|
||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||
$stmt->execute();
|
||||
@@ -189,7 +189,7 @@ class phrasea
|
||||
if (!self::$_sbas_names) {
|
||||
try {
|
||||
self::$_sbas_names = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_NAMES);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
foreach ($app['phraseanet.appbox']->get_databoxes() as $databox) {
|
||||
self::$_sbas_names[$databox->get_sbas_id()] = $databox->get_viewname();
|
||||
}
|
||||
@@ -205,7 +205,7 @@ class phrasea
|
||||
if (!self::$_sbas_labels) {
|
||||
try {
|
||||
self::$_sbas_labels = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_LABELS);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
foreach ($app['phraseanet.appbox']->get_databoxes() as $databox) {
|
||||
self::$_sbas_labels[$databox->get_sbas_id()] = [
|
||||
'fr' => $databox->get_label('fr'),
|
||||
@@ -230,7 +230,7 @@ class phrasea
|
||||
if (!self::$_bas_labels) {
|
||||
try {
|
||||
self::$_bas_labels = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_BAS_LABELS);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
foreach ($app['phraseanet.appbox']->get_databoxes() as $databox) {
|
||||
foreach ($databox->get_collections() as $collection) {
|
||||
self::$_bas_labels[$collection->get_base_id()] = [
|
||||
|
@@ -76,7 +76,7 @@ class random
|
||||
$stmt->closeCursor();
|
||||
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ class random
|
||||
$stmt->closeCursor();
|
||||
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ class random
|
||||
$stmt->closeCursor();
|
||||
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -183,7 +183,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
$this->base_id = $datas['base_id'];
|
||||
|
||||
return $this;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -513,7 +513,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
|
||||
try {
|
||||
return $this->get_subdef('thumbnailGIF');
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
{
|
||||
try {
|
||||
return $this->get_data_from_cache(self::CACHE_STATUS);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
$sql = 'SELECT BIN(status) as status FROM record
|
||||
@@ -705,7 +705,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
{
|
||||
try {
|
||||
return $this->get_data_from_cache(self::CACHE_SUBDEFS);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -750,7 +750,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
if (!$this->technical_datas) {
|
||||
try {
|
||||
$this->technical_datas = $this->get_data_from_cache(self::CACHE_TECHNICAL_DATAS);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$this->technical_datas = [];
|
||||
$connbas = $this->get_databox()->get_connection();
|
||||
$sql = 'SELECT name, value FROM technical_datas WHERE record_id = :record_id';
|
||||
@@ -935,7 +935,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
$this->get_subdef('preview');
|
||||
|
||||
return $this->get_subdef('preview')->is_physically_present();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
unset($e);
|
||||
}
|
||||
|
||||
@@ -1203,7 +1203,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
':coll_id' => $collection->get_coll_id()
|
||||
]);
|
||||
$stmt->closeCursor();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
unset($e);
|
||||
}
|
||||
|
||||
@@ -1258,7 +1258,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
':coll_id' => $file->getCollection()->get_coll_id()
|
||||
]);
|
||||
$stmt->closeCursor();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
unset($e);
|
||||
}
|
||||
|
||||
|
@@ -370,7 +370,7 @@ class record_preview extends record_adapter
|
||||
|
||||
try {
|
||||
$user = \User_Adapter::getInstance($row['usr_id'], $this->app);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -59,7 +59,7 @@ class recordutils_image extends recordutils
|
||||
if (MediaInterface::TYPE_IMAGE === $image->getType()) {
|
||||
$rotation = $image->getOrientation();
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
// getting orientation failed but we don't care the reason
|
||||
}
|
||||
|
||||
|
@@ -93,7 +93,7 @@ class set_export extends set_abstract
|
||||
|
||||
try {
|
||||
$record = new record_adapter($this->app, $basrec[0], $basrec[1]);
|
||||
} catch (Exception_Record_AdapterNotFound $e) {
|
||||
} catch (\Exception_Record_AdapterNotFound $e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -100,7 +100,7 @@ class set_selection extends set_abstract
|
||||
if ($num_rows == 0) {
|
||||
$to_remove[] = $id;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -125,7 +125,7 @@ class set_selection extends set_abstract
|
||||
if (count($basrec) == 2) {
|
||||
try {
|
||||
$record = new record_adapter($this->app, (int) $basrec[0], (int) $basrec[1], count($this->elements));
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
continue;
|
||||
}
|
||||
if ($record->is_grouping() && $flatten_groupings === true) {
|
||||
|
@@ -2,10 +2,27 @@
|
||||
|
||||
{% if lazaretFiles is not none %}
|
||||
{% if lazaretFiles|length > 0 %}
|
||||
<div class="btn-group" style="text-align:center; padding:5px 0;">
|
||||
<button class="btn empty-lazaret" title="{{ "Empty quarantine" | trans }}">
|
||||
<img src="/skins/icons/delete.png">{{ "Empty quarantine" | trans }}
|
||||
</button>
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group" style="text-align:center; padding:5px 0;">
|
||||
<button class="btn empty-lazaret" title="{{ "Empty quarantine" | trans }}">
|
||||
<img src="/skins/icons/delete.png">{{ "Empty quarantine" | trans }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group" style="text-align:center; padding:5px 0;">
|
||||
<button class="btn" title="{{ "Page" | trans }}">
|
||||
{{ "Page" | trans }}
|
||||
</button>
|
||||
{% set items = lazaretFiles | length %}
|
||||
{% set pages = (items / perPage) | ceil | min(10) %}
|
||||
|
||||
{% for i in 1..pages %}
|
||||
<button class="btn page-lazaret{% if currentPage == i %} active{% endif %}" title="{{ i }}">
|
||||
<a href="{{ path('lazaret_elements', { 'page' : i }) }}">
|
||||
{{ i }}
|
||||
</a>
|
||||
</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="unstyled">
|
||||
|
@@ -10,7 +10,7 @@
|
||||
</li>
|
||||
<li>
|
||||
{# template prod/upload/lazaret.html.twig loaded via ajax #}
|
||||
<a href="{{ path('lazaret_elements') }}">
|
||||
<a class="lazaret-target" href="{{ path('lazaret_elements') }}">
|
||||
{# <span> </span> element is required for the jQuery loading spinner appears && disappears properly #}
|
||||
{{ 'Quarantine' | trans }}<span> </span>
|
||||
</a>
|
||||
@@ -174,11 +174,18 @@ $(document).ready(function () {
|
||||
$( anchor.hash ).html(language.error);
|
||||
});
|
||||
|
||||
ui.tab.find('span').html(language.loading + '<img src="/skins/icons/loader404040.gif"/>');
|
||||
ui.tab.find('span').html(' <img src="/skins/icons/loader404040.gif"/>');
|
||||
},
|
||||
load: function(event, ui)
|
||||
{
|
||||
ui.tab.find('span').empty();
|
||||
$('.btn.page-lazaret', UploaderManager.getContainer()).bind('click', function () {
|
||||
$('.lazaret-target').attr('href', $('a', $(this)).attr('href'));
|
||||
$(".upload-tabs", UploaderManager.getContainer()).tabs('load', 1);
|
||||
$('#lazaretBox').empty();
|
||||
|
||||
return false;
|
||||
});
|
||||
},
|
||||
create : function () {
|
||||
$('#tab-upload').css('overflow', 'hidden');
|
||||
@@ -488,3 +495,8 @@ $(document).ready(function () {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.btn.page-lazaret a {
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user