mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
cleanup & refactor
This commit is contained in:
@@ -30,7 +30,7 @@ class Collection implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$controllers = $app['controllers_factory'];
|
$controllers = $app['controllers_factory'];
|
||||||
|
|
||||||
$controllers->before(function() use ($app) {
|
$controllers->before(function(Request $request) use ($app) {
|
||||||
if (null !== $response = $app['phraseanet.core']['Firewall']->requireAdmin($app)) {
|
if (null !== $response = $app['phraseanet.core']['Firewall']->requireAdmin($app)) {
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,7 @@ class Dashboard implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$controllers = $app['controllers_factory'];
|
$controllers = $app['controllers_factory'];
|
||||||
|
|
||||||
$controllers->before(function() use ($app) {
|
$controllers->before(function(Request $request) use ($app) {
|
||||||
return $app['phraseanet.core']['Firewall']->requireAdmin($app);
|
return $app['phraseanet.core']['Firewall']->requireAdmin($app);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -30,7 +30,7 @@ class Databox implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$controllers = $app['controllers_factory'];
|
$controllers = $app['controllers_factory'];
|
||||||
|
|
||||||
$controllers->before(function() use ($app) {
|
$controllers->before(function(Request $request) use ($app) {
|
||||||
return $app['phraseanet.core']['Firewall']->requireAdmin($app);
|
return $app['phraseanet.core']['Firewall']->requireAdmin($app);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ class Databoxes implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$controllers = $app['controllers_factory'];
|
$controllers = $app['controllers_factory'];
|
||||||
|
|
||||||
$controllers->before(function() use ($app) {
|
$controllers->before(function(Request $request) use ($app) {
|
||||||
return $app['phraseanet.core']['Firewall']->requireAdmin($app);
|
return $app['phraseanet.core']['Firewall']->requireAdmin($app);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -206,7 +206,7 @@ class Root implements ControllerProviderInterface
|
|||||||
$structure = $databox->get_structure();
|
$structure = $databox->get_structure();
|
||||||
$errors = \databox::get_structure_errors($structure);
|
$errors = \databox::get_structure_errors($structure);
|
||||||
|
|
||||||
if ('ok' === $updateOk = $request->get('update', false)) {
|
if ($updateOk = ! ! $request->get('success', false)) {
|
||||||
$updateOk = true;
|
$updateOk = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,10 +244,10 @@ class Root implements ControllerProviderInterface
|
|||||||
$databox = $app['phraseanet.appbox']->get_databox($databox_id);
|
$databox = $app['phraseanet.appbox']->get_databox($databox_id);
|
||||||
$databox->saveStructure($domst);
|
$databox->saveStructure($domst);
|
||||||
|
|
||||||
return $app->redirect('/admin/structure/' . $databox_id . '/?update=ok');
|
return $app->redirect('/admin/structure/' . $databox_id . '/?success=1');
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
return $app->redirect('/admin/structure/' . $databox_id . '/?error=struct');
|
return $app->redirect('/admin/structure/' . $databox_id . '/?success=0&error=struct');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->assert('databox_id', '\d+')
|
->assert('databox_id', '\d+')
|
||||||
@@ -388,7 +388,7 @@ class Root implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $app->redirect('/admin/statusbit/' . $databox_id . '/?update=ok');
|
return $app->redirect('/admin/statusbit/' . $databox_id . '/?success=1');
|
||||||
})
|
})
|
||||||
->assert('databox_id', '\d+')
|
->assert('databox_id', '\d+')
|
||||||
->assert('bit', '\d+')
|
->assert('bit', '\d+')
|
||||||
|
@@ -34,7 +34,7 @@ class Setup implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$controllers = $app['controllers_factory'];
|
$controllers = $app['controllers_factory'];
|
||||||
|
|
||||||
$controllers->before(function() use ($app) {
|
$controllers->before(function(Request $request) use ($app) {
|
||||||
return $app['phraseanet.core']['Firewall']->requireAdmin($app);
|
return $app['phraseanet.core']['Firewall']->requireAdmin($app);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ class Setup implements ControllerProviderInterface
|
|||||||
require_once __DIR__ . "/../../../../conf.d/_GV_template.inc";
|
require_once __DIR__ . "/../../../../conf.d/_GV_template.inc";
|
||||||
|
|
||||||
if (null !== $update = $request->get('update')) {
|
if (null !== $update = $request->get('update')) {
|
||||||
if ('ok' === $update) {
|
if ( ! ! $update) {
|
||||||
$update = _('Update succeed');
|
$update = _('Update succeed');
|
||||||
} else {
|
} else {
|
||||||
$update = _('Update failed');
|
$update = _('Update failed');
|
||||||
@@ -111,10 +111,10 @@ class Setup implements ControllerProviderInterface
|
|||||||
public function postGlobals(Application $app, Request $request)
|
public function postGlobals(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
if (\setup::create_global_values($app['phraseanet.core']['Registry'], $request->request->all())) {
|
if (\setup::create_global_values($app['phraseanet.core']['Registry'], $request->request->all())) {
|
||||||
return $app->redirect('/admin/globals/?update=ok');
|
return $app->redirect('/admin/globals/?success=1');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $app->redirect('/admin/globals/?update=ko');
|
return $app->redirect('/admin/globals/?success=0');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -29,7 +29,7 @@ class Sphinx implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$controllers = $app['controllers_factory'];
|
$controllers = $app['controllers_factory'];
|
||||||
|
|
||||||
$controllers->before(function() use ($app) {
|
$controllers->before(function(Request $request) use ($app) {
|
||||||
return $app['phraseanet.core']['Firewall']->requireAdmin($app);
|
return $app['phraseanet.core']['Firewall']->requireAdmin($app);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ class Sphinx implements ControllerProviderInterface
|
|||||||
'sphinx_user_stemmer', $request->request->get('libstemmer', array()), \registry::TYPE_ARRAY
|
'sphinx_user_stemmer', $request->request->get('libstemmer', array()), \registry::TYPE_ARRAY
|
||||||
);
|
);
|
||||||
|
|
||||||
return $app->redirect('/admin/sphinx/configuration/?update=ok');
|
return $app->redirect('/admin/sphinx/configuration/?success=1');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -150,8 +150,8 @@ class Installer implements ControllerProviderInterface
|
|||||||
$user_ab = $request->request->get('ab_user');
|
$user_ab = $request->request->get('ab_user');
|
||||||
$password = $request->request->get('ab_password');
|
$password = $request->request->get('ab_password');
|
||||||
|
|
||||||
$appbox_name = $request->get('ab_name');
|
$appbox_name = $request->request->get('ab_name');
|
||||||
$databox_name = $request->get('db_name');
|
$databox_name = $request->request->get('db_name');
|
||||||
$setupRegistry = new \Setup_Registry();
|
$setupRegistry = new \Setup_Registry();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -962,27 +962,11 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
|||||||
$stmt->execute(array(':usr_id' => $this->get_id()));
|
$stmt->execute(array(':usr_id' => $this->get_id()));
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
/**
|
|
||||||
* @todo does usrlist not exists anymore ?
|
|
||||||
*/
|
|
||||||
// $sql = 'DELETE FROM usrlist WHERE usr_id = :usr_id';
|
|
||||||
// $stmt = $this->appbox->get_connection()->prepare($sql);
|
|
||||||
// $stmt->execute(array(':usr_id' => $this->get_id()));
|
|
||||||
// $stmt->closeCursor();
|
|
||||||
|
|
||||||
$sql = 'DELETE FROM usr_settings WHERE usr_id = :usr_id';
|
$sql = 'DELETE FROM usr_settings WHERE usr_id = :usr_id';
|
||||||
$stmt = $this->appbox->get_connection()->prepare($sql);
|
$stmt = $this->appbox->get_connection()->prepare($sql);
|
||||||
$stmt->execute(array(':usr_id' => $this->get_id()));
|
$stmt->execute(array(':usr_id' => $this->get_id()));
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
/**
|
|
||||||
* @todo table usrlistusers does not exists anymore ?
|
|
||||||
*/
|
|
||||||
// $sql = 'DELETE FROM usrlistusers WHERE usr_id = :usr_id';
|
|
||||||
// $stmt = $this->appbox->get_connection()->prepare($sql);
|
|
||||||
// $stmt->execute(array(':usr_id' => $this->get_id()));
|
|
||||||
// $stmt->closeCursor();
|
|
||||||
|
|
||||||
$sql = 'DELETE FROM ssel WHERE usr_id = :usr_id';
|
$sql = 'DELETE FROM ssel WHERE usr_id = :usr_id';
|
||||||
$stmt = $this->appbox->get_connection()->prepare($sql);
|
$stmt = $this->appbox->get_connection()->prepare($sql);
|
||||||
$stmt->execute(array(':usr_id' => $this->get_id()));
|
$stmt->execute(array(':usr_id' => $this->get_id()));
|
||||||
|
@@ -83,12 +83,6 @@ class databox extends base
|
|||||||
*/
|
*/
|
||||||
protected static $_sxml_thesaurus = array();
|
protected static $_sxml_thesaurus = array();
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
protected static $_instances = array();
|
|
||||||
|
|
||||||
const BASE_TYPE = self::DATA_BOX;
|
const BASE_TYPE = self::DATA_BOX;
|
||||||
const CACHE_META_STRUCT = 'meta_struct';
|
const CACHE_META_STRUCT = 'meta_struct';
|
||||||
const CACHE_THESAURUS = 'thesaurus';
|
const CACHE_THESAURUS = 'thesaurus';
|
||||||
|
@@ -62,21 +62,27 @@ class format
|
|||||||
$separateur = ",";
|
$separateur = ",";
|
||||||
|
|
||||||
// For mac
|
// For mac
|
||||||
|
$autoDetectLineEndings = ini_get("auto_detect_line_endings");
|
||||||
|
|
||||||
ini_set("auto_detect_line_endings", true);
|
ini_set("auto_detect_line_endings", true);
|
||||||
|
|
||||||
if ($FILE = fopen($filename, "r")) {
|
if ($file = fopen($filename, "r")) {
|
||||||
$test1 = fgetcsv($FILE, 1024, ",");
|
$test1 = fgetcsv($file, 1024, ",");
|
||||||
rewind($FILE);
|
rewind($file);
|
||||||
$test2 = fgetcsv($FILE, 1024, ";");
|
$test2 = fgetcsv($file, 1024, ";");
|
||||||
rewind($FILE);
|
rewind($file);
|
||||||
if (count($test1) == 1 || ( count($test2) > count($test1) && count($test2) < 20))
|
|
||||||
|
if (count($test1) == 1 || ( count($test2) > count($test1) && count($test2) < 20)) {
|
||||||
$separateur = ";";
|
$separateur = ";";
|
||||||
|
}
|
||||||
|
|
||||||
while ($ARRAY[] = fgetcsv($FILE, 1024, $separateur));
|
while ($array[] = fgetcsv($file, 1024, $separateur));
|
||||||
fclose($FILE);
|
fclose($file);
|
||||||
array_pop($ARRAY);
|
array_pop($array);
|
||||||
|
|
||||||
return $ARRAY;
|
ini_set("auto_detect_line_endings", $autoDetectLineEndings);
|
||||||
|
|
||||||
|
return $array;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{% if reloadTree %}
|
{% if reloadTree %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
parent.reloadTree('base:{{ collection.get_sbas_id() }}');
|
reloadTree('base:{{ collection.get_sbas_id() }}');
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@
|
|||||||
success: function(datas) {
|
success: function(datas) {
|
||||||
if(datas.success) {
|
if(datas.success) {
|
||||||
if(submitLink.hasClass('reload')) {
|
if(submitLink.hasClass('reload')) {
|
||||||
parent.reloadTree('base:{{ collection.get_sbas_id() }}');
|
reloadTree('base:{{ collection.get_sbas_id() }}');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
alert(datas.msg);
|
alert(datas.msg);
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{% if reloadTree %}
|
{% if reloadTree %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
parent.reloadTree('bases:bases');
|
reloadTree('bases:bases');
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@
|
|||||||
success: function(datas) {
|
success: function(datas) {
|
||||||
if(datas.success) {
|
if(datas.success) {
|
||||||
if(submitLink.hasClass('reload')) {
|
if(submitLink.hasClass('reload')) {
|
||||||
parent.reloadTree('base:{{ databox.get_sbas_id() }}');
|
reloadTree('base:{{ databox.get_sbas_id() }}');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
alert(datas.msg);
|
alert(datas.msg);
|
||||||
@@ -327,7 +327,7 @@
|
|||||||
success: function(datas) {
|
success: function(datas) {
|
||||||
if(datas.success) {
|
if(datas.success) {
|
||||||
if(submitLink.hasClass('reload')) {
|
if(submitLink.hasClass('reload')) {
|
||||||
parent.reloadTree('base:{{ databox.get_sbas_id() }}');
|
reloadTree('base:{{ databox.get_sbas_id() }}');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
alert(datas.msg);
|
alert(datas.msg);
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
{% if app.request.query.get('success') == '1' %}
|
||||||
|
<div class="alert alert-success">
|
||||||
|
<a class="close" data-dismiss="alert" href="#">×</a>
|
||||||
|
{% trans 'Successful update' %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<form class="well form-inline" method='post' action='/admin/sphinx/configuration/'>
|
<form class="well form-inline" method='post' action='/admin/sphinx/configuration/'>
|
||||||
<select name="charset_tables[]" multiple="multiple">
|
<select name="charset_tables[]" multiple="multiple">
|
||||||
{% for charset, charset_obj in configuration.get_available_charsets() %}
|
{% for charset, charset_obj in configuration.get_available_charsets() %}
|
||||||
|
@@ -48,11 +48,11 @@
|
|||||||
<td>{{ statusbit['searchable'] is defined and statusbit['searchable'] == '1' ? 'oui'| trans : 'non'| trans }}</td>
|
<td>{{ statusbit['searchable'] is defined and statusbit['searchable'] == '1' ? 'oui'| trans : 'non'| trans }}</td>
|
||||||
<td>{{ statusbit['printable'] is defined and statusbit['printable'] == '1' ? 'oui'| trans : 'non'| trans }}</td>
|
<td>{{ statusbit['printable'] is defined and statusbit['printable'] == '1' ? 'oui'| trans : 'non'| trans }}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td />
|
<td></td>
|
||||||
<td />
|
<td></td>
|
||||||
<td />
|
<td></td>
|
||||||
<td />
|
<td></td>
|
||||||
<td />
|
<td></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@@ -5,7 +5,6 @@ require_once __DIR__ . '/../../../../PhraseanetWebTestCaseAuthenticatedAbstract.
|
|||||||
class AdminCollectionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
class AdminCollectionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||||
{
|
{
|
||||||
protected $client;
|
protected $client;
|
||||||
protected $StubbedACL;
|
|
||||||
public static $createdCollections = array();
|
public static $createdCollections = array();
|
||||||
|
|
||||||
public function createApplication()
|
public function createApplication()
|
||||||
@@ -41,46 +40,6 @@ class AdminCollectionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
parent::tearDownAfterClass();
|
parent::tearDownAfterClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
|
|
||||||
$this->client = $this->createClient();
|
|
||||||
$this->StubbedACL = $this->getMockBuilder('\ACL')
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setAdmin($bool)
|
|
||||||
{
|
|
||||||
$stubAuthenticatedUser = $this->getMockBuilder('\User_Adapter')
|
|
||||||
->setMethods(array('is_admin', 'ACL'))
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$stubAuthenticatedUser->expects($this->any())
|
|
||||||
->method('is_admin')
|
|
||||||
->will($this->returnValue($bool));
|
|
||||||
|
|
||||||
$this->StubbedACL->expects($this->any())
|
|
||||||
->method('has_right_on_base')
|
|
||||||
->will($this->returnValue($bool));
|
|
||||||
|
|
||||||
$stubAuthenticatedUser->expects($this->any())
|
|
||||||
->method('ACL')
|
|
||||||
->will($this->returnValue($this->StubbedACL));
|
|
||||||
|
|
||||||
$stubCore = $this->getMockBuilder('\Alchemy\Phrasea\Core')
|
|
||||||
->setMethods(array('getAuthenticatedUser'))
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$stubCore->expects($this->any())
|
|
||||||
->method('getAuthenticatedUser')
|
|
||||||
->will($this->returnValue($stubAuthenticatedUser));
|
|
||||||
|
|
||||||
$this->app['phraseanet.core'] = $stubCore;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getJson($response)
|
public function getJson($response)
|
||||||
{
|
{
|
||||||
$this->assertTrue($response->isOk());
|
$this->assertTrue($response->isOk());
|
||||||
|
@@ -5,7 +5,6 @@ require_once __DIR__ . '/../../../../PhraseanetWebTestCaseAuthenticatedAbstract.
|
|||||||
class AdminDashboardTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
class AdminDashboardTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||||
{
|
{
|
||||||
protected $client;
|
protected $client;
|
||||||
protected $StubbedACL;
|
|
||||||
|
|
||||||
public function createApplication()
|
public function createApplication()
|
||||||
{
|
{
|
||||||
@@ -17,45 +16,6 @@ class AdminDashboardTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
return $app;
|
return $app;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
$this->client = $this->createClient();
|
|
||||||
$this->StubbedACL = $this->getMockBuilder('\ACL')
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setAdmin($bool)
|
|
||||||
{
|
|
||||||
$stubAuthenticatedUser = $this->getMockBuilder('\User_Adapter')
|
|
||||||
->setMethods(array('is_admin', 'ACL'))
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$stubAuthenticatedUser->expects($this->any())
|
|
||||||
->method('is_admin')
|
|
||||||
->will($this->returnValue($bool));
|
|
||||||
|
|
||||||
$this->StubbedACL->expects($this->any())
|
|
||||||
->method('has_right_on_base')
|
|
||||||
->will($this->returnValue($bool));
|
|
||||||
|
|
||||||
$stubAuthenticatedUser->expects($this->any())
|
|
||||||
->method('ACL')
|
|
||||||
->will($this->returnValue($this->StubbedACL));
|
|
||||||
|
|
||||||
$stubCore = $this->getMockBuilder('\Alchemy\Phrasea\Core')
|
|
||||||
->setMethods(array('getAuthenticatedUser'))
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$stubCore->expects($this->any())
|
|
||||||
->method('getAuthenticatedUser')
|
|
||||||
->will($this->returnValue($stubAuthenticatedUser));
|
|
||||||
|
|
||||||
$this->app['phraseanet.core'] = $stubCore;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Symfony\Component\HttpKernel\Exception\HttpException
|
* @expectedException Symfony\Component\HttpKernel\Exception\HttpException
|
||||||
* @covers \Alchemy\Phrasea\Controller\Admin\Dashboard::slash
|
* @covers \Alchemy\Phrasea\Controller\Admin\Dashboard::slash
|
||||||
|
@@ -5,7 +5,6 @@ require_once __DIR__ . '/../../../../PhraseanetWebTestCaseAuthenticatedAbstract.
|
|||||||
class DataboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
class DataboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||||
{
|
{
|
||||||
protected $client;
|
protected $client;
|
||||||
protected $StubbedACL;
|
|
||||||
protected static $createdCollections = array();
|
protected static $createdCollections = array();
|
||||||
protected static $createdDataboxes = array();
|
protected static $createdDataboxes = array();
|
||||||
|
|
||||||
@@ -19,62 +18,6 @@ class DataboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
return $app;
|
return $app;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
|
|
||||||
$this->client = $this->createClient();
|
|
||||||
$this->StubbedACL = $this->getMockBuilder('\ACL')
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setAdmin($bool)
|
|
||||||
{
|
|
||||||
$stubAuthenticatedUser = $this->getMockBuilder('\User_Adapter')
|
|
||||||
->setMethods(array('is_admin', 'ACL'))
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$stubAuthenticatedUser->expects($this->any())
|
|
||||||
->method('is_admin')
|
|
||||||
->will($this->returnValue($bool));
|
|
||||||
|
|
||||||
$this->StubbedACL->expects($this->any())
|
|
||||||
->method('give_access_to_sbas')
|
|
||||||
->will($this->returnValue($this->StubbedACL));
|
|
||||||
|
|
||||||
$this->StubbedACL->expects($this->any())
|
|
||||||
->method('update_rights_to_sbas')
|
|
||||||
->will($this->returnValue($this->StubbedACL));
|
|
||||||
|
|
||||||
$this->StubbedACL->expects($this->any())
|
|
||||||
->method('update_rights_to_bas')
|
|
||||||
->will($this->returnValue($this->StubbedACL));
|
|
||||||
|
|
||||||
$this->StubbedACL->expects($this->any())
|
|
||||||
->method('has_right_on_base')
|
|
||||||
->will($this->returnValue($bool));
|
|
||||||
|
|
||||||
$this->StubbedACL->expects($this->any())
|
|
||||||
->method('has_right_on_sbas')
|
|
||||||
->will($this->returnValue($bool));
|
|
||||||
|
|
||||||
$stubAuthenticatedUser->expects($this->any())
|
|
||||||
->method('ACL')
|
|
||||||
->will($this->returnValue($this->StubbedACL));
|
|
||||||
|
|
||||||
$stubCore = $this->getMockBuilder('\Alchemy\Phrasea\Core')
|
|
||||||
->setMethods(array('getAuthenticatedUser'))
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$stubCore->expects($this->any())
|
|
||||||
->method('getAuthenticatedUser')
|
|
||||||
->will($this->returnValue($stubAuthenticatedUser));
|
|
||||||
|
|
||||||
$this->app['phraseanet.core'] = $stubCore;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||||
|
@@ -5,7 +5,6 @@ require_once __DIR__ . '/../../../../PhraseanetWebTestCaseAuthenticatedAbstract.
|
|||||||
class DataboxesTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
class DataboxesTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||||
{
|
{
|
||||||
protected $client;
|
protected $client;
|
||||||
protected $StubbedACL;
|
|
||||||
|
|
||||||
public function createApplication()
|
public function createApplication()
|
||||||
{
|
{
|
||||||
@@ -17,45 +16,6 @@ class DataboxesTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
return $app;
|
return $app;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
$this->client = $this->createClient();
|
|
||||||
$this->StubbedACL = $this->getMockBuilder('\ACL')
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setAdmin($bool)
|
|
||||||
{
|
|
||||||
$stubAuthenticatedUser = $this->getMockBuilder('\User_Adapter')
|
|
||||||
->setMethods(array('is_admin', 'ACL'))
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$stubAuthenticatedUser->expects($this->any())
|
|
||||||
->method('is_admin')
|
|
||||||
->will($this->returnValue($bool));
|
|
||||||
|
|
||||||
$this->StubbedACL->expects($this->any())
|
|
||||||
->method('has_right_on_base')
|
|
||||||
->will($this->returnValue($bool));
|
|
||||||
|
|
||||||
$stubAuthenticatedUser->expects($this->any())
|
|
||||||
->method('ACL')
|
|
||||||
->will($this->returnValue($this->StubbedACL));
|
|
||||||
|
|
||||||
$stubCore = $this->getMockBuilder('\Alchemy\Phrasea\Core')
|
|
||||||
->setMethods(array('getAuthenticatedUser'))
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$stubCore->expects($this->any())
|
|
||||||
->method('getAuthenticatedUser')
|
|
||||||
->will($this->returnValue($stubAuthenticatedUser));
|
|
||||||
|
|
||||||
$this->app['phraseanet.core'] = $stubCore;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers Alchemy\Phrasea\Controller\Admin\Databases::getDatabases
|
* @covers Alchemy\Phrasea\Controller\Admin\Databases::getDatabases
|
||||||
* @covers Alchemy\Phrasea\Controller\Admin\Databases::connect
|
* @covers Alchemy\Phrasea\Controller\Admin\Databases::connect
|
||||||
@@ -115,5 +75,4 @@ class DataboxesTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
$this->assertTrue($this->client->getResponse()->isRedirect());
|
$this->assertTrue($this->client->getResponse()->isRedirect());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,6 @@ require_once __DIR__ . '/../../../../PhraseanetWebTestCaseAuthenticatedAbstract.
|
|||||||
class SetupTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
class SetupTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||||
{
|
{
|
||||||
protected $client;
|
protected $client;
|
||||||
protected $StubbedACL;
|
|
||||||
|
|
||||||
public function createApplication()
|
public function createApplication()
|
||||||
{
|
{
|
||||||
@@ -17,45 +16,6 @@ protected $StubbedACL;
|
|||||||
return $app;
|
return $app;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
$this->client = $this->createClient();
|
|
||||||
$this->StubbedACL = $this->getMockBuilder('\ACL')
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setAdmin($bool)
|
|
||||||
{
|
|
||||||
$stubAuthenticatedUser = $this->getMockBuilder('\User_Adapter')
|
|
||||||
->setMethods(array('is_admin','ACL'))
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$stubAuthenticatedUser->expects($this->any())
|
|
||||||
->method('is_admin')
|
|
||||||
->will($this->returnValue($bool));
|
|
||||||
|
|
||||||
$this->StubbedACL->expects($this->any())
|
|
||||||
->method('has_right_on_base')
|
|
||||||
->will($this->returnValue($bool));
|
|
||||||
|
|
||||||
$stubAuthenticatedUser->expects($this->any())
|
|
||||||
->method('ACL')
|
|
||||||
->will($this->returnValue($this->StubbedACL));
|
|
||||||
|
|
||||||
$stubCore = $this->getMockBuilder('\Alchemy\Phrasea\Core')
|
|
||||||
->setMethods(array('getAuthenticatedUser'))
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$stubCore->expects($this->any())
|
|
||||||
->method('getAuthenticatedUser')
|
|
||||||
->will($this->returnValue($stubAuthenticatedUser));
|
|
||||||
|
|
||||||
$this->app['phraseanet.core'] = $stubCore;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers Alchemy\Phrasea\Controller\Admin\Setup::getGlobals
|
* @covers Alchemy\Phrasea\Controller\Admin\Setup::getGlobals
|
||||||
*/
|
*/
|
||||||
|
@@ -17,45 +17,6 @@ class SphinxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
return $app;
|
return $app;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
$this->client = $this->createClient();
|
|
||||||
$this->StubbedACL = $this->getMockBuilder('\ACL')
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setAdmin($bool)
|
|
||||||
{
|
|
||||||
$stubAuthenticatedUser = $this->getMockBuilder('\User_Adapter')
|
|
||||||
->setMethods(array('is_admin', 'ACL'))
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$stubAuthenticatedUser->expects($this->any())
|
|
||||||
->method('is_admin')
|
|
||||||
->will($this->returnValue($bool));
|
|
||||||
|
|
||||||
$this->StubbedACL->expects($this->any())
|
|
||||||
->method('has_right_on_base')
|
|
||||||
->will($this->returnValue($bool));
|
|
||||||
|
|
||||||
$stubAuthenticatedUser->expects($this->any())
|
|
||||||
->method('ACL')
|
|
||||||
->will($this->returnValue($this->StubbedACL));
|
|
||||||
|
|
||||||
$stubCore = $this->getMockBuilder('\Alchemy\Phrasea\Core')
|
|
||||||
->setMethods(array('getAuthenticatedUser'))
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$stubCore->expects($this->any())
|
|
||||||
->method('getAuthenticatedUser')
|
|
||||||
->will($this->returnValue($stubAuthenticatedUser));
|
|
||||||
|
|
||||||
$this->app['phraseanet.core'] = $stubCore;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers Alchemy\Phrasea\Controller\Admin\Sphinx::getConfiguration
|
* @covers Alchemy\Phrasea\Controller\Admin\Sphinx::getConfiguration
|
||||||
* @covers Alchemy\Phrasea\Controller\Admin\Sphinx::connect
|
* @covers Alchemy\Phrasea\Controller\Admin\Sphinx::connect
|
||||||
|
@@ -323,7 +323,6 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
|
|
||||||
$this->client->request('POST', '/users/rights/reset/', array('users' => $user->get_id()));
|
$this->client->request('POST', '/users/rights/reset/', array('users' => $user->get_id()));
|
||||||
$response = $this->client->getResponse();
|
$response = $this->client->getResponse();
|
||||||
@@ -363,17 +362,4 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
$this->assertTrue($this->client->getResponse()->isOk());
|
$this->assertTrue($this->client->getResponse()->isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function testPostDemands()
|
|
||||||
// {
|
|
||||||
// $collection = \collection::create(array_shift($this->app['phraseanet.appbox']->get_databoxes()), $this->app['phraseanet.appbox'], 'TESTTODELETE');
|
|
||||||
// $register = new \appbox_register($this->app['phraseanet.appbox']);
|
|
||||||
// $register->add_request(self::$user, $collection);
|
|
||||||
//
|
|
||||||
// $this->client->request('POST', '/users/demands/', array(
|
|
||||||
// 'accept'
|
|
||||||
// ));
|
|
||||||
//
|
|
||||||
// $this->assertTrue($this->client->getResponse()->isOk());
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
|
|
||||||
abstract class PhraseanetWebTestCaseAuthenticatedAbstract extends PhraseanetPHPUnitAuthenticatedAbstract
|
abstract class PhraseanetWebTestCaseAuthenticatedAbstract extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||||
{
|
{
|
||||||
|
protected $StubbedACL;
|
||||||
|
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
@@ -25,4 +26,44 @@ abstract class PhraseanetWebTestCaseAuthenticatedAbstract extends PhraseanetPHPU
|
|||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$session->logout();
|
$session->logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setUp()
|
||||||
|
{
|
||||||
|
parent::setUp();
|
||||||
|
|
||||||
|
$this->client = $this->createClient();
|
||||||
|
$this->StubbedACL = $this->getMockBuilder('\ACL')
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setAdmin($bool)
|
||||||
|
{
|
||||||
|
$stubAuthenticatedUser = $this->getMockBuilder('\User_Adapter')
|
||||||
|
->setMethods(array('is_admin', 'ACL'))
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
|
|
||||||
|
$stubAuthenticatedUser->expects($this->any())
|
||||||
|
->method('is_admin')
|
||||||
|
->will($this->returnValue($bool));
|
||||||
|
|
||||||
|
$this->StubbedACL->expects($this->any())
|
||||||
|
->method('has_right_on_base')
|
||||||
|
->will($this->returnValue($bool));
|
||||||
|
|
||||||
|
$stubAuthenticatedUser->expects($this->any())
|
||||||
|
->method('ACL')
|
||||||
|
->will($this->returnValue($this->StubbedACL));
|
||||||
|
|
||||||
|
$stubCore = $this->getMockBuilder('\Alchemy\Phrasea\Core')
|
||||||
|
->setMethods(array('getAuthenticatedUser'))
|
||||||
|
->getMock();
|
||||||
|
|
||||||
|
$stubCore->expects($this->any())
|
||||||
|
->method('getAuthenticatedUser')
|
||||||
|
->will($this->returnValue($stubAuthenticatedUser));
|
||||||
|
|
||||||
|
$this->app['phraseanet.core'] = $stubCore;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,9 +25,6 @@ $parm = $request->get_parms('action', 'position', 'test', 'renew', 'path', 'test
|
|||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
switch ($parm['action']) {
|
switch ($parm['action']) {
|
||||||
// case 'TREE':
|
|
||||||
// $output = module_admin::getTree($parm['position']);
|
|
||||||
// break;
|
|
||||||
case 'APACHE':
|
case 'APACHE':
|
||||||
if ($parm['test'] == 'success') {
|
if ($parm['test'] == 'success') {
|
||||||
$output = '1';
|
$output = '1';
|
||||||
@@ -39,73 +36,6 @@ switch ($parm['action']) {
|
|||||||
$output = $registry->get('GV_ServerName') . 'admin/runscheduler.php?key=' . urlencode(phrasea::scheduler_key( ! ! $parm['renew']));
|
$output = $registry->get('GV_ServerName') . 'admin/runscheduler.php?key=' . urlencode(phrasea::scheduler_key( ! ! $parm['renew']));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// case 'TESTPATH':
|
|
||||||
// $tests = true;
|
|
||||||
// foreach ($parm['tests'] as $test) {
|
|
||||||
// switch ($test) {
|
|
||||||
// case 'writeable':
|
|
||||||
// if ( ! is_writable($parm['path'])) {
|
|
||||||
// $tests = false;
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
// case 'readable':
|
|
||||||
// default:
|
|
||||||
// if ( ! is_readable($parm['path'])) {
|
|
||||||
// $tests = true;
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// $output = p4string::jsonencode(array('results' => ($tests ? '1' : '0')));
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// case 'EMPTYBASE':
|
|
||||||
// $parm = $request->get_parms(array('sbas_id' => http_request::SANITIZE_NUMBER_INT));
|
|
||||||
// $message = _('Base empty successful');
|
|
||||||
// try {
|
|
||||||
// $sbas_id = (int) $parm['sbas_id'];
|
|
||||||
// $databox = $appbox->get_databox($sbas_id);
|
|
||||||
// $class_name = 'task_period_emptyColl';
|
|
||||||
// foreach ($databox->get_collections() as $collection) {
|
|
||||||
// if ($collection->get_record_amount() <= 500) {
|
|
||||||
// $collection->empty_collection(500);
|
|
||||||
// } else {
|
|
||||||
// $settings = "<?xml version=\"1.0\" encoding=\"UTF-8\"
|
|
||||||
// task_abstract::create($appbox, $class_name, $settings);
|
|
||||||
// $message = _('A task has been creted, please run it to complete empty collection');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } catch (Exception $e) {
|
|
||||||
// $message = _('An error occurred');
|
|
||||||
// }
|
|
||||||
// $output = p4string::jsonencode(array('message' => $message));
|
|
||||||
// break;
|
|
||||||
// case 'EMPTYCOLL':
|
|
||||||
// $message = _('Collection empty successful');
|
|
||||||
// $parm = $request->get_parms(
|
|
||||||
// array(
|
|
||||||
// "sbas_id" => http_request::SANITIZE_NUMBER_INT
|
|
||||||
// , "coll_id" => http_request::SANITIZE_NUMBER_INT
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
// try {
|
|
||||||
// $databox = $appbox->get_databox($parm['sbas_id']);
|
|
||||||
// $collection = collection::get_from_coll_id($databox, $parm['coll_id']);
|
|
||||||
//
|
|
||||||
// if ($collection->get_record_amount() <= 500) {
|
|
||||||
// $collection->empty_collection(500);
|
|
||||||
// } else {
|
|
||||||
// $class_name = 'task_period_emptyColl';
|
|
||||||
//
|
|
||||||
// task_abstract::create($appbox, $class_name, $settings);
|
|
||||||
// $message = _('A task has been creted, please run it to complete empty collection');
|
|
||||||
// }
|
|
||||||
// } catch (Exception $e) {
|
|
||||||
// $message = _('An error occurred');
|
|
||||||
// }
|
|
||||||
// $output = p4string::jsonencode(array('message' => $message));
|
|
||||||
// break;
|
|
||||||
|
|
||||||
case 'SETTASKSTATUS':
|
case 'SETTASKSTATUS':
|
||||||
$parm = $request->get_parms('task_id', 'status', 'signal');
|
$parm = $request->get_parms('task_id', 'status', 'signal');
|
||||||
try {
|
try {
|
||||||
@@ -218,126 +148,6 @@ switch ($parm['action']) {
|
|||||||
$output = p4string::jsonencode($ret);
|
$output = p4string::jsonencode($ret);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// case 'UNMOUNTBASE':
|
|
||||||
// $parm = $request->get_parms(array('sbas_id' => http_request::SANITIZE_NUMBER_INT));
|
|
||||||
// $ret = array('sbas_id' => null);
|
|
||||||
//
|
|
||||||
// $databox = $appbox->get_databox((int) $parm['sbas_id']);
|
|
||||||
// $databox->unmount_databox($appbox);
|
|
||||||
//
|
|
||||||
// $ret['sbas_id'] = $parm['sbas_id'];
|
|
||||||
// $output = p4string::jsonencode($ret);
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// case 'P_BAR_INFO':
|
|
||||||
// $parm = $request->get_parms(array('sbas_id' => http_request::SANITIZE_NUMBER_INT));
|
|
||||||
// $ret = array(
|
|
||||||
// 'sbas_id' => null,
|
|
||||||
// 'indexable' => false,
|
|
||||||
// 'records' => 0,
|
|
||||||
// 'xml_indexed' => 0,
|
|
||||||
// 'thesaurus_indexed' => 0,
|
|
||||||
// 'viewname' => null,
|
|
||||||
// 'printLogoURL' => NULL
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// $databox = $appbox->get_databox((int) $parm['sbas_id']);
|
|
||||||
//
|
|
||||||
// $ret['indexable'] = $appbox->is_databox_indexable($databox);
|
|
||||||
// $ret['viewname'] = (($databox->get_dbname() == $databox->get_viewname()) ? _('admin::base: aucun alias') : $databox->get_viewname());
|
|
||||||
//
|
|
||||||
// $ret['records'] = $databox->get_record_amount();
|
|
||||||
//
|
|
||||||
// $datas = $databox->get_indexed_record_amount();
|
|
||||||
//
|
|
||||||
// $ret['sbas_id'] = $parm['sbas_id'];
|
|
||||||
// $tot = $idxxml = $idxth = 0;
|
|
||||||
//
|
|
||||||
// $ret['xml_indexed'] = $datas['xml_indexed'];
|
|
||||||
// $ret['thesaurus_indexed'] = $datas['thesaurus_indexed'];
|
|
||||||
//
|
|
||||||
// if (file_exists($registry->get('GV_RootPath') . 'config/minilogos/logopdf_' . $parm['sbas_id'] . '.jpg')) {
|
|
||||||
// $ret['printLogoURL'] = '/print/' . $parm['sbas_id'];
|
|
||||||
// }
|
|
||||||
// $output = p4string::jsonencode($ret);
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// case 'CHGVIEWNAME':
|
|
||||||
//
|
|
||||||
// $parm = $request->get_parms('sbas_id', 'viewname');
|
|
||||||
// $ret = array('sbas_id' => null, 'viewname' => null);
|
|
||||||
// $sbas_id = (int) $parm['sbas_id'];
|
|
||||||
// $databox = $appbox->get_databox($sbas_id);
|
|
||||||
// $appbox->set_databox_viewname($databox, $parm['viewname']);
|
|
||||||
// $output = p4string::jsonencode($ret);
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// case 'MAKEINDEXABLE':
|
|
||||||
//
|
|
||||||
// $parm = $request->get_parms('sbas_id', 'INDEXABLE');
|
|
||||||
// $ret = array('sbas_id' => null, 'indexable' => null);
|
|
||||||
// $sbas_id = (int) $parm['sbas_id'];
|
|
||||||
// $databox = $appbox->get_databox($sbas_id);
|
|
||||||
// $appbox->set_databox_indexable($databox, $parm['INDEXABLE']);
|
|
||||||
// $ret['sbas_id'] = $parm['sbas_id'];
|
|
||||||
// $ret['indexable'] = $parm['INDEXABLE'];
|
|
||||||
// $output = p4string::jsonencode($ret);
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// case 'REINDEX':
|
|
||||||
//
|
|
||||||
// $parm = $request->get_parms(array('sbas_id' => http_request::SANITIZE_NUMBER_INT));
|
|
||||||
// $ret = array('sbas_id' => null);
|
|
||||||
// $sbas_id = (int) $parm['sbas_id'];
|
|
||||||
// $databox = $appbox->get_databox($sbas_id);
|
|
||||||
// $databox->reindex();
|
|
||||||
// $output = p4string::jsonencode($ret);
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// case 'CLEARALLLOG':
|
|
||||||
//
|
|
||||||
// $parm = $request->get_parms(array('sbas_id' => http_request::SANITIZE_NUMBER_INT));
|
|
||||||
// $ret = array('sbas_id' => null);
|
|
||||||
// $sbas_id = (int) $parm['sbas_id'];
|
|
||||||
// $databox = $appbox->get_databox($sbas_id);
|
|
||||||
// $databox->clear_logs();
|
|
||||||
// $ret['sbas_id'] = $parm['sbas_id'];
|
|
||||||
// $output = p4string::jsonencode($ret);
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// case 'DELLOGOPDF':
|
|
||||||
// $parm = $request->get_parms(array('sbas_id' => http_request::SANITIZE_NUMBER_INT));
|
|
||||||
// $ret = array('sbas_id' => null);
|
|
||||||
// $sbas_id = (int) $parm['sbas_id'];
|
|
||||||
// $databox = $appbox->get_databox($sbas_id);
|
|
||||||
// $appbox->write_databox_pic($databox, null, databox::PIC_PDF);
|
|
||||||
// $ret['sbas_id'] = $parm['sbas_id'];
|
|
||||||
//
|
|
||||||
// $output = p4string::jsonencode($ret);
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// case 'DELETEBASE':
|
|
||||||
// $parm = $request->get_parms(array('sbas_id' => http_request::SANITIZE_NUMBER_INT));
|
|
||||||
//
|
|
||||||
// $ret = array('sbas_id' => null, 'err' => -1, 'errmsg' => null);
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
// $sbas_id = (int) $parm['sbas_id'];
|
|
||||||
// $databox = $appbox->get_databox($sbas_id);
|
|
||||||
// if ($databox->get_record_amount() == 0) {
|
|
||||||
// $databox->unmount_databox($appbox);
|
|
||||||
// $appbox->write_databox_pic($databox, null, databox::PIC_PDF);
|
|
||||||
// $databox->delete();
|
|
||||||
// $ret['sbas_id'] = $parm['sbas_id'];
|
|
||||||
// $ret['err'] = 0;
|
|
||||||
// } else {
|
|
||||||
// $ret['errmsg'] = _('admin::base: vider la base avant de la supprimer');
|
|
||||||
// }
|
|
||||||
// } catch (Exception $e) {
|
|
||||||
// $ret['errmsg'] = $e->getMessage();
|
|
||||||
// }
|
|
||||||
// $output = p4string::jsonencode($ret);
|
|
||||||
// break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($appbox);
|
unset($appbox);
|
||||||
|
@@ -38,7 +38,6 @@ $groups = array(
|
|||||||
, '//include/vendor/jquery-file-upload/js/vendor/jquery.ui.widget.js'
|
, '//include/vendor/jquery-file-upload/js/vendor/jquery.ui.widget.js'
|
||||||
, '//include/vendor/jquery-file-upload/js/jquery.iframe-transport.js'
|
, '//include/vendor/jquery-file-upload/js/jquery.iframe-transport.js'
|
||||||
, '//include/vendor/jquery-file-upload/js/jquery.fileupload.js'
|
, '//include/vendor/jquery-file-upload/js/jquery.fileupload.js'
|
||||||
, '//prod/jquery.Phraseanet.js'
|
|
||||||
),
|
),
|
||||||
'report' => array(
|
'report' => array(
|
||||||
'//include/jslibs/jquery-ui-1.8.17/jquery-ui-i18n.js'
|
'//include/jslibs/jquery-ui-1.8.17/jquery-ui-i18n.js'
|
||||||
|
Reference in New Issue
Block a user