mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
merge
This commit is contained in:
@@ -44,9 +44,9 @@ doctrine_dev:
|
||||
#Metadata cache : is used to cache entity class metadatas
|
||||
#If No cache is provided all cache are setted to default_cache which is an array cache type
|
||||
cache:
|
||||
query: array
|
||||
result: array
|
||||
metadata: array
|
||||
query: array_cache
|
||||
result: array_cache
|
||||
metadata: array_cache
|
||||
# Assign a service to log doctrine queries
|
||||
log: query_logger
|
||||
|
||||
@@ -59,9 +59,9 @@ doctrine_test:
|
||||
dbal: test_connexion
|
||||
orm:
|
||||
cache:
|
||||
query: array
|
||||
result: array
|
||||
metadata: array
|
||||
query: array_cache
|
||||
result: array_cache
|
||||
metadata: array_cache
|
||||
log: query_logger
|
||||
|
||||
# Doctrine production service options
|
||||
@@ -72,9 +72,9 @@ doctrine_prod:
|
||||
dbal: main_connexion
|
||||
orm:
|
||||
cache:
|
||||
query: apc
|
||||
result: apc
|
||||
metadata: apc
|
||||
query: apc_cache
|
||||
result: apc_cache
|
||||
metadata: apc_cache
|
||||
log: query_logger
|
||||
|
||||
|
||||
|
@@ -122,11 +122,14 @@ return call_user_func(
|
||||
|
||||
/* @var $repository \Repositories\BasketElementRepository */
|
||||
|
||||
if ($repository->findReceivedValidationElementsByRecord($record, $user)->count() > 0)
|
||||
$ValidationByRecord = $repository->findReceivedValidationElementsByRecord($record, $user);
|
||||
$ReceptionByRecord = $repository->findReceivedElementsByRecord($record, $user);
|
||||
|
||||
if ($ValidationByRecord && $ValidationByRecord->count() > 0)
|
||||
{
|
||||
$watermark = false;
|
||||
}
|
||||
elseif ($repository->findReceivedElementsByRecord($record, $user)->count() > 0)
|
||||
elseif ($ReceptionByRecord && $ReceptionByRecord->count() > 0)
|
||||
{
|
||||
$watermark = false;
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ class Story implements ControllerProviderInterface
|
||||
$metadatas[] = array(
|
||||
'meta_struct_id' => $meta->get_id()
|
||||
, 'meta_id' => null
|
||||
, 'value' => array($value)
|
||||
, 'value' => $value
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -102,17 +102,12 @@ class Tooltip implements ControllerProviderInterface
|
||||
$record = new \record_adapter($sbas_id, $record_id, $number);
|
||||
|
||||
$search_engine = null;
|
||||
$option = new \searchEngine_options();
|
||||
$options_serial = $app['request']->get('options_serial');
|
||||
|
||||
if ($options_serial)
|
||||
{
|
||||
if (($search_engine_options = $option->unserialize($app['request']->get('options_serial'))) !== false)
|
||||
if (($search_engine_options = unserialize($app['request']->get('options_serial'))) !== false)
|
||||
{
|
||||
$search_engine = new \searchEngine_adapter($app['appbox']->get_registry());
|
||||
$search_engine->set_options($search_engine_options);
|
||||
}
|
||||
}
|
||||
|
||||
/* @var $twig \Twig_Environment */
|
||||
$twig = $app['Core']->getTwig();
|
||||
|
@@ -19,8 +19,6 @@ use Silex\Application;
|
||||
use Silex\ControllerProviderInterface;
|
||||
use Silex\ControllerCollection;
|
||||
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
|
||||
/**
|
||||
*
|
||||
* @package
|
||||
@@ -80,7 +78,7 @@ class Installer implements ControllerProviderInterface
|
||||
$twig = new \Twig_Environment($loader);
|
||||
|
||||
$html = $twig->render(
|
||||
'/setup/index.twig'
|
||||
'/setup/index.html.twig'
|
||||
, array_merge($constraints_coll, array(
|
||||
'locale' => Session_Handler::get_locale()
|
||||
, 'available_locales' => $app['Core']::getAvailableLanguages()
|
||||
@@ -112,7 +110,7 @@ class Installer implements ControllerProviderInterface
|
||||
}
|
||||
|
||||
$html = $twig->render(
|
||||
'/setup/step2.twig'
|
||||
'/setup/step2.html.twig'
|
||||
, array(
|
||||
'locale' => \Session_Handler::get_locale()
|
||||
, 'available_locales' => $app['Core']::getAvailableLanguages()
|
||||
@@ -135,6 +133,9 @@ class Installer implements ControllerProviderInterface
|
||||
\phrasea::use_i18n(\Session_Handler::get_locale());
|
||||
$request = $app['request'];
|
||||
|
||||
$setupRegistry = new \Setup_Registry();
|
||||
$setupRegistry->set('GV_ServerName', $servername);
|
||||
|
||||
$conn = $connbas = null;
|
||||
|
||||
$hostname = $request->get('ab_hostname');
|
||||
@@ -147,7 +148,7 @@ class Installer implements ControllerProviderInterface
|
||||
|
||||
try
|
||||
{
|
||||
$conn = new \connection_pdo('appbox', $hostname, $port, $user_ab, $password, $appbox_name);
|
||||
$conn = new \connection_pdo('appbox', $hostname, $port, $user_ab, $password, $appbox_name, array(), $setupRegistry);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
@@ -158,13 +159,14 @@ class Installer implements ControllerProviderInterface
|
||||
{
|
||||
if ($databox_name)
|
||||
{
|
||||
$connbas = new \connection_pdo('databox', $hostname, $port, $user_ab, $password, $databox_name);
|
||||
$connbas = new \connection_pdo('databox', $hostname, $port, $user_ab, $password, $databox_name, array(), $setupRegistry);
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return $app->redirect('/setup/installer/step2/?error=' . _('Databox is unreachable'));
|
||||
}
|
||||
|
||||
\setup::rollback($conn, $connbas);
|
||||
|
||||
try
|
||||
@@ -208,6 +210,7 @@ class Installer implements ControllerProviderInterface
|
||||
// Create SchemaTool
|
||||
$tool = new \Doctrine\ORM\Tools\SchemaTool($em);
|
||||
// Create schema
|
||||
$tool->dropSchema($metadatas);
|
||||
$tool->createSchema($metadatas);
|
||||
}
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ class Upgrader implements ControllerProviderInterface
|
||||
$twig = $app['Core']->getTwig();
|
||||
|
||||
$html = $twig->render(
|
||||
'/setup/upgrader.twig'
|
||||
'/setup/upgrader.html.twig'
|
||||
, array(
|
||||
'locale' => \Session_Handler::get_locale()
|
||||
, 'upgrade_status' => $upgrade_status
|
||||
|
@@ -178,6 +178,7 @@ class Core extends \Pimple
|
||||
{
|
||||
ini_set('display_errors', 'on');
|
||||
error_reporting(E_ALL);
|
||||
// \Symfony\Component\HttpKernel\Debug\ErrorHandler::register();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -29,7 +29,7 @@ class Application implements Specification
|
||||
*/
|
||||
public function getConfigurationFilePath()
|
||||
{
|
||||
return __DIR__ . '/../../../../../config';
|
||||
return realpath(__DIR__ . '/../../../../../config');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,7 +97,7 @@ class Application implements Specification
|
||||
*/
|
||||
public function getServiceFile()
|
||||
{
|
||||
return new \SplFileObject(__DIR__ . '/../../../../../config/services.yml');
|
||||
return new \SplFileObject(realpath(__DIR__ . '/../../../../../config/services.yml'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ class Application implements Specification
|
||||
*/
|
||||
public function getConnexionFile()
|
||||
{
|
||||
return new \SplFileObject(__DIR__ . '/../../../../../config/connexions.yml');
|
||||
return new \SplFileObject(realpath(__DIR__ . '/../../../../../config/connexions.yml'));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -234,11 +234,20 @@ class Edit extends RecordHelper
|
||||
continue;
|
||||
}
|
||||
|
||||
$values = array();
|
||||
foreach ($field->get_values() as $value)
|
||||
{
|
||||
$values[$value->getId()] = array(
|
||||
'meta_id' => $value->getId(),
|
||||
'value' => $value->getValue()
|
||||
);
|
||||
}
|
||||
|
||||
$_lst[$indice]['fields'][$meta_struct_id] = array(
|
||||
'dirty' => false,
|
||||
'meta_id' => $field->get_meta_id(),
|
||||
// 'meta_id' => $field->get_meta_id(),
|
||||
'meta_struct_id' => $meta_struct_id,
|
||||
'value' => $field->get_value()
|
||||
'values' => $values
|
||||
);
|
||||
}
|
||||
|
||||
@@ -515,16 +524,26 @@ class Edit extends RecordHelper
|
||||
$record->set_metadatas($rec['metadatas']);
|
||||
}
|
||||
|
||||
if ($write_edit_el instanceof \Acmedatabox_field)
|
||||
/**
|
||||
*todo : this should not work
|
||||
*/
|
||||
if ($write_edit_el instanceof \databox_field)
|
||||
{
|
||||
$fields = $record->get_caption()->get_fields(array($write_edit_el->get_name()));
|
||||
$field = array_pop($fields);
|
||||
|
||||
$meta_id = null;
|
||||
|
||||
if($field && !$field->is_multi())
|
||||
{
|
||||
$meta_id = array_pop($field->get_values())->getId();
|
||||
}
|
||||
|
||||
$metas = array(
|
||||
array(
|
||||
'meta_struct_id' => $write_edit_el->get_id()
|
||||
, 'meta_id' => ($field ? $field->get_meta_id() : null)
|
||||
, 'value' => array($date_obj->format('Y-m-d h:i:s'))
|
||||
, 'meta_id' => $meta_id
|
||||
, 'value' => $date_obj->format('Y-m-d h:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
|
@@ -543,7 +543,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
|
||||
|
||||
$users = $this->users;
|
||||
|
||||
$user = \User_adapter::getInstance(array_pop($users), appbox::get_instance());
|
||||
$user = \User_adapter::getInstance(array_pop($users), \appbox::get_instance());
|
||||
|
||||
if ($user->is_template())
|
||||
{
|
||||
|
@@ -39,16 +39,9 @@ class Manage extends \Alchemy\Phrasea\Helper\Helper
|
||||
*/
|
||||
protected $usr_id;
|
||||
|
||||
public function __construct(Symfony\Component\HttpFoundation\Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function export(Symfony\Component\HttpFoundation\Request $request)
|
||||
public function export()
|
||||
{
|
||||
$request = $this->request;
|
||||
$appbox = appbox::get_instance();
|
||||
$session = $appbox->get_session();
|
||||
|
||||
@@ -84,8 +77,9 @@ class Manage extends \Alchemy\Phrasea\Helper\Helper
|
||||
return $this->results->get_results();
|
||||
}
|
||||
|
||||
public function search(Symfony\Component\HttpFoundation\Request $request)
|
||||
public function search()
|
||||
{
|
||||
$request = $this->request;
|
||||
$appbox = \appbox::get_instance();
|
||||
|
||||
$offset_start = (int) $this->request->get('offset_start');
|
||||
|
@@ -317,7 +317,7 @@ class PDF
|
||||
$this->pdf->Write(5, $field->get_name() . " : ");
|
||||
|
||||
$this->pdf->SetFont(PhraseaPDF::FONT, '', 12);
|
||||
$this->pdf->Write(5, $field->get_value(true));
|
||||
$this->pdf->Write(5, $field->get_serialized_values());
|
||||
|
||||
$this->pdf->Write(6, "\n");
|
||||
$nf++;
|
||||
@@ -512,7 +512,7 @@ class PDF
|
||||
$t = str_replace(
|
||||
array("<", ">", "&")
|
||||
, array("<", ">", "&")
|
||||
, $field->get_value(true)
|
||||
, $field->get_serialized_values()
|
||||
);
|
||||
|
||||
$this->pdf->Write(5, $t);
|
||||
|
@@ -298,8 +298,7 @@ class ACL implements cache_cacheableInterface
|
||||
, 'nowatermark', 'order_master'
|
||||
);
|
||||
|
||||
$bas_to_acces = array();
|
||||
$rights_to_give = array();
|
||||
$bas_to_acces = $masks_to_give = $rights_to_give = array();
|
||||
|
||||
/**
|
||||
* map masks (and+xor) of template to masks to apply to user on base
|
||||
@@ -355,11 +354,22 @@ class ACL implements cache_cacheableInterface
|
||||
$m[$k] .= $sbmap[$ax][$k];
|
||||
}
|
||||
}
|
||||
$this->set_masks_on_base($base_id, $m['aa'], $m['ao'], $m['xa'], $m['xo']);
|
||||
|
||||
$masks_to_give[$base_id] = array(
|
||||
'aa' => $m['aa']
|
||||
, 'ao' => $m['ao']
|
||||
, 'xa' => $m['xa']
|
||||
, 'xo' => $m['xo']
|
||||
);
|
||||
}
|
||||
|
||||
$this->give_access_to_base($bas_to_acces);
|
||||
|
||||
foreach ($masks_to_give as $base_id => $mask)
|
||||
{
|
||||
$this->set_masks_on_base($base_id, $mask['aa'], $mask['ao'], $mask['xa'], $mask['xo']);
|
||||
}
|
||||
|
||||
foreach ($rights_to_give as $base_id => $rights)
|
||||
{
|
||||
$this->update_rights_to_base($base_id, $rights);
|
||||
@@ -629,14 +639,23 @@ class ACL implements cache_cacheableInterface
|
||||
$this->load_rights_bas();
|
||||
$ret = array();
|
||||
|
||||
foreach ($this->_rights_bas as $base_id => $datas)
|
||||
foreach($this->appbox->get_databoxes() as $databox)
|
||||
{
|
||||
$continue = false;
|
||||
|
||||
if ($sbas_ids && !in_array(phrasea::sbasFromBas($base_id), $sbas_ids))
|
||||
if ($sbas_ids && !in_array($databox->get_sbas_id(), $sbas_ids))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($databox->get_collections() as $collection)
|
||||
{
|
||||
$continue = false;
|
||||
|
||||
if(!array_key_exists($collection->get_base_id(), $this->_rights_bas))
|
||||
continue;
|
||||
|
||||
$base_id = $collection->get_base_id();
|
||||
$datas = $this->_rights_bas[$base_id];
|
||||
|
||||
foreach ($rights as $right)
|
||||
{
|
||||
if (!$this->has_right_on_base($base_id, $right))
|
||||
@@ -657,6 +676,7 @@ class ACL implements cache_cacheableInterface
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
@@ -1080,7 +1080,10 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
$ret = array();
|
||||
foreach ($caption->get_fields() as $field)
|
||||
{
|
||||
$ret[$field->get_meta_id()] = $this->list_record_caption_field($field);
|
||||
foreach($field->get_values as $value)
|
||||
{
|
||||
$ret[$value->getId()] = $this->list_record_caption_field($value);
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
@@ -1092,17 +1095,17 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
* @param caption_field $field
|
||||
* @return array
|
||||
*/
|
||||
protected function list_record_caption_field(caption_field $field)
|
||||
protected function list_record_caption_field(caption_Field_Value $value, caption_field $field)
|
||||
{
|
||||
/**
|
||||
* @todo ajouter une option pour avoir les values serialisées
|
||||
* dans un cas multi
|
||||
*/
|
||||
return array(
|
||||
'meta_id' => $field->get_meta_id()
|
||||
'meta_id' => $value->getId()
|
||||
, 'meta_structure_id' => $field->get_meta_struct_id()
|
||||
, 'name' => $field->get_name()
|
||||
, 'value' => $field->get_value()
|
||||
, 'value' => $value->getValue()
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -9,8 +9,12 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
$new_include_path = __DIR__ . "/../../../../vendor/" . PATH_SEPARATOR . get_include_path();
|
||||
$include_path = realpath(__DIR__ . '/../../../../vendor/');
|
||||
if(strpos(get_include_path(), $include_path) === false)
|
||||
{
|
||||
$new_include_path = $include_path . PATH_SEPARATOR . get_include_path();
|
||||
set_include_path($new_include_path);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -9,8 +9,13 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
$new_include_path = __DIR__ . "/../../../vendor/" . PATH_SEPARATOR . get_include_path();
|
||||
|
||||
$include_path = realpath(__DIR__ . '/../../../vendor/');
|
||||
if(strpos(get_include_path(), $include_path) === false)
|
||||
{
|
||||
$new_include_path = $include_path . PATH_SEPARATOR . get_include_path();
|
||||
set_include_path($new_include_path);
|
||||
}
|
||||
|
||||
use \Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
|
@@ -9,8 +9,12 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
$new_include_path = __DIR__ . '/../../../vendor/gdata/' . PATH_SEPARATOR . get_include_path();
|
||||
$include_path = realpath(__DIR__ . '/../../../vendor/gdata/');
|
||||
if(strpos(get_include_path(), $include_path) === false)
|
||||
{
|
||||
$new_include_path = $include_path . PATH_SEPARATOR . get_include_path();
|
||||
set_include_path($new_include_path);
|
||||
}
|
||||
|
||||
require_once('Zend/Loader.php');
|
||||
Zend_Loader::loadClass('Zend_Gdata_YouTube');
|
||||
|
@@ -235,7 +235,7 @@ abstract class Feed_XML_Abstract
|
||||
$title_field = $content->get_record()->get_caption()->get_dc_field(databox_Field_DCESAbstract::Title);
|
||||
if ($title_field)
|
||||
{
|
||||
$str_title = $title_field->get_value(true, ' ');
|
||||
$str_title = $title_field->get_serialized_values(' ');
|
||||
$title = $this->addTag($document, $group, 'media:title', $str_title);
|
||||
$title->setAttribute('type', 'plain');
|
||||
}
|
||||
@@ -243,7 +243,7 @@ abstract class Feed_XML_Abstract
|
||||
$desc_field = $content->get_record()->get_caption()->get_dc_field(databox_Field_DCESAbstract::Description);
|
||||
if ($desc_field)
|
||||
{
|
||||
$str_desc = $desc_field->get_value(true, ' ');
|
||||
$str_desc = $desc_field->get_serialized_values(' ');
|
||||
$desc = $this->addTag($document, $group, 'media:description', $str_desc);
|
||||
$desc->setAttribute('type', 'plain');
|
||||
}
|
||||
@@ -251,7 +251,7 @@ abstract class Feed_XML_Abstract
|
||||
$contrib_field = $content->get_record()->get_caption()->get_dc_field(databox_Field_DCESAbstract::Contributor);
|
||||
if ($contrib_field)
|
||||
{
|
||||
$str_contrib = $contrib_field->get_value(true, ' ');
|
||||
$str_contrib = $contrib_field->get_serialized_values(' ');
|
||||
$contrib = $this->addTag($document, $group, 'media:credit', $str_contrib);
|
||||
$contrib->setAttribute('role', 'contributor');
|
||||
$contrib->setAttribute('scheme', 'urn:ebu');
|
||||
@@ -260,7 +260,7 @@ abstract class Feed_XML_Abstract
|
||||
$director_field = $content->get_record()->get_caption()->get_dc_field(databox_Field_DCESAbstract::Creator);
|
||||
if ($director_field)
|
||||
{
|
||||
$str_director = $director_field->get_value(true, ' ');
|
||||
$str_director = $director_field->get_serialized_values(' ');
|
||||
$director = $this->addTag($document, $group, 'media:credit', $str_director);
|
||||
$director->setAttribute('role', 'director');
|
||||
$director->setAttribute('scheme', 'urn:ebu');
|
||||
@@ -269,7 +269,7 @@ abstract class Feed_XML_Abstract
|
||||
$publisher_field = $content->get_record()->get_caption()->get_dc_field(databox_Field_DCESAbstract::Publisher);
|
||||
if ($publisher_field)
|
||||
{
|
||||
$str_publisher = $publisher_field->get_value(true, ' ');
|
||||
$str_publisher = $publisher_field->get_serialized_values(' ');
|
||||
$publisher = $this->addTag($document, $group, 'media:credit', $str_publisher);
|
||||
$publisher->setAttribute('role', 'publisher');
|
||||
$publisher->setAttribute('scheme', 'urn:ebu');
|
||||
@@ -278,14 +278,14 @@ abstract class Feed_XML_Abstract
|
||||
$rights_field = $content->get_record()->get_caption()->get_dc_field(databox_Field_DCESAbstract::Rights);
|
||||
if ($rights_field)
|
||||
{
|
||||
$str_rights = $rights_field->get_value(true, ' ');
|
||||
$str_rights = $rights_field->get_serialized_values(' ');
|
||||
$rights = $this->addTag($document, $group, 'media:copyright', $str_rights);
|
||||
}
|
||||
|
||||
$keyword_field = $content->get_record()->get_caption()->get_dc_field(databox_Field_DCESAbstract::Subject);
|
||||
if ($keyword_field)
|
||||
{
|
||||
$str_keywords = $keyword_field->get_value(true, ', ');
|
||||
$str_keywords = $keyword_field->get_serialized_values(', ');
|
||||
$keywords = $this->addTag($document, $group, 'media:keywords', $str_keywords);
|
||||
}
|
||||
|
||||
|
@@ -381,7 +381,7 @@ class Feed_XML_Cooliris extends Feed_XML_Abstract implements Feed_XML_Interface
|
||||
$title_field = $content->get_record()->get_caption()->get_dc_field(databox_Field_DCESAbstract::Title);
|
||||
if ($title_field)
|
||||
{
|
||||
$str_title = $title_field->get_value(true, ' ');
|
||||
$str_title = $title_field->get_serialized_values(' ');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -394,7 +394,7 @@ class Feed_XML_Cooliris extends Feed_XML_Abstract implements Feed_XML_Interface
|
||||
$desc_field = $content->get_record()->get_caption()->get_dc_field(databox_Field_DCESAbstract::Description);
|
||||
if ($desc_field)
|
||||
{
|
||||
$str_desc = $desc_field->get_value(true, ' ');
|
||||
$str_desc = $desc_field->get_serialized_values(' ');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -299,7 +299,7 @@ class appbox extends base
|
||||
|
||||
public function forceUpgrade(Setup_Upgrade &$upgrader)
|
||||
{
|
||||
$upgrader->add_steps(7 + count($this->get_databoxes()));
|
||||
$upgrader->add_steps(8 + count($this->get_databoxes()));
|
||||
|
||||
$registry = $this->get_registry();
|
||||
|
||||
@@ -313,6 +313,21 @@ class appbox extends base
|
||||
}
|
||||
$upgrader->add_steps_complete(1);
|
||||
|
||||
|
||||
$upgrader->set_current_message(_('Creating new tables'));
|
||||
$core = bootstrap::getCore();
|
||||
$em = $core->getEntityManager();
|
||||
//create schema
|
||||
|
||||
if($em->getConnection()->getDatabasePlatform()->supportsAlterTable())
|
||||
{
|
||||
$tool = new \Doctrine\ORM\Tools\SchemaTool($em);
|
||||
$metas = $em->getMetadataFactory()->getAllMetadata();
|
||||
$tool->updateSchema($metas, true);
|
||||
}
|
||||
|
||||
$upgrader->add_steps_complete(1);
|
||||
|
||||
/**
|
||||
* Step 2
|
||||
*/
|
||||
|
236
lib/classes/caption/Field/Value.class.php
Normal file
236
lib/classes/caption/Field/Value.class.php
Normal file
@@ -0,0 +1,236 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2010 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
class caption_Field_Value
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $id;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $value;
|
||||
/**
|
||||
*
|
||||
* @var databox_field
|
||||
*/
|
||||
protected $databox_field;
|
||||
/**
|
||||
*
|
||||
* @var record_adapter
|
||||
*/
|
||||
protected $record;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param databox_field $databox_field
|
||||
* @param record_adapter $record
|
||||
* @param type $id
|
||||
* @return \caption_Field_Value
|
||||
*/
|
||||
public function __construct(databox_field $databox_field, record_adapter $record, $id)
|
||||
{
|
||||
$this->id = (int) $id;
|
||||
$this->databox_field = $databox_field;
|
||||
$this->record = $record;
|
||||
|
||||
$connbas = $databox_field->get_databox()->get_connection();
|
||||
|
||||
$sql = 'SELECT record_id, value FROM metadatas WHERE id = :id';
|
||||
|
||||
$stmt = $connbas->prepare($sql);
|
||||
$stmt->execute(array(':id' => $id));
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
$this->value = $row ? $row['value'] : null;
|
||||
|
||||
return $this;
|
||||
}
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getValue() {
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function getDatabox_field() {
|
||||
return $this->databox_field;
|
||||
}
|
||||
|
||||
public function getRecord() {
|
||||
return $this->record;
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$connbas = $this->databox_field->get_connection();
|
||||
|
||||
$sql = 'DELETE FROM metadatas WHERE id = :id';
|
||||
$stmt = $connbas->prepare($sql);
|
||||
$stmt->execute(array(':id' => $this->id));
|
||||
$stmt->closeCursor();
|
||||
$this->delete_data_from_cache();
|
||||
|
||||
$sbas_id = $this->record->get_sbas_id();
|
||||
$this->record->get_caption()->delete_data_from_cache();
|
||||
|
||||
try
|
||||
{
|
||||
$registry = registry::get_instance();
|
||||
$sphinx_rt = sphinxrt::get_instance($registry);
|
||||
|
||||
$sbas_params = phrasea::sbas_params();
|
||||
|
||||
if (isset($sbas_params[$sbas_id]))
|
||||
{
|
||||
$params = $sbas_params[$sbas_id];
|
||||
$sbas_crc = crc32(str_replace(array('.', '%'), '_', sprintf('%s_%s_%s_%s', $params['host'], $params['port'], $params['user'], $params['dbname'])));
|
||||
$sphinx_rt->delete(array("metadatas" . $sbas_crc, "metadatas" . $sbas_crc . "_stemmed_fr", "metadatas" . $sbas_crc . "_stemmed_en"), "metas_realtime" . $sbas_crc, $this->id);
|
||||
$sphinx_rt->delete(array("documents" . $sbas_crc, "documents" . $sbas_crc . "_stemmed_fr", "documents" . $sbas_crc . "_stemmed_en"), "docs_realtime" . $sbas_crc, $this->record->get_record_id());
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
unset($e);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function set_value($value)
|
||||
{
|
||||
$sbas_id = $this->databox_field->get_databox()->get_sbas_id();
|
||||
$connbas = $this->databox_field->get_connection();
|
||||
|
||||
$params = array(
|
||||
':meta_id' => $this->id
|
||||
, ':value' => $value
|
||||
);
|
||||
|
||||
$sql_up = 'UPDATE metadatas SET value = :value WHERE id = :meta_id';
|
||||
$stmt_up = $connbas->prepare($sql_up);
|
||||
$stmt_up->execute($params);
|
||||
$stmt_up->closeCursor();
|
||||
|
||||
try
|
||||
{
|
||||
$registry = registry::get_instance();
|
||||
$sphinx_rt = sphinxrt::get_instance($registry);
|
||||
|
||||
$sbas_params = phrasea::sbas_params();
|
||||
|
||||
if (isset($sbas_params[$sbas_id]))
|
||||
{
|
||||
$params = $sbas_params[$sbas_id];
|
||||
$sbas_crc = crc32(str_replace(array('.', '%'), '_', sprintf('%s_%s_%s_%s', $params['host'], $params['port'], $params['user'], $params['dbname'])));
|
||||
$sphinx_rt->delete(array("metadatas" . $sbas_crc, "metadatas" . $sbas_crc . "_stemmed_fr", "metadatas" . $sbas_crc . "_stemmed_en"), "", $this->id);
|
||||
$sphinx_rt->delete(array("documents" . $sbas_crc, "documents" . $sbas_crc . "_stemmed_fr", "documents" . $sbas_crc . "_stemmed_en"), "", $this->record->get_record_id());
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
$this->update_cache_value($value);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param array $value
|
||||
* @return caption_field
|
||||
*/
|
||||
public function update_cache_value($value)
|
||||
{
|
||||
// $this->delete_data_from_cache();
|
||||
$this->record->get_caption()->delete_data_from_cache();
|
||||
$sbas_id = $this->databox_field->get_databox()->get_sbas_id();
|
||||
try
|
||||
{
|
||||
$registry = registry::get_instance();
|
||||
|
||||
$sbas_params = phrasea::sbas_params();
|
||||
|
||||
if (isset($sbas_params[$sbas_id]))
|
||||
{
|
||||
$params = $sbas_params[$sbas_id];
|
||||
$sbas_crc = crc32(str_replace(array('.', '%'), '_', sprintf('%s_%s_%s_%s', $params['host'], $params['port'], $params['user'], $params['dbname'])));
|
||||
|
||||
$sphinx_rt = sphinxrt::get_instance($registry);
|
||||
$sphinx_rt->replace_in_metas(
|
||||
"metas_realtime" . $sbas_crc, $this->id, $this->databox_field->get_id(), $this->record->get_record_id(), $sbas_id, phrasea::collFromBas($this->record->get_base_id()), ($this->record->is_grouping() ? '1' : '0'), $this->record->get_type(), $value, $this->record->get_creation_date()
|
||||
);
|
||||
|
||||
$all_datas = array();
|
||||
foreach ($this->record->get_caption()->get_fields() as $field)
|
||||
{
|
||||
if (!$field->is_indexable())
|
||||
continue;
|
||||
$all_datas[] = $field->get_serialized_values();
|
||||
}
|
||||
$all_datas = implode(' ', $all_datas);
|
||||
|
||||
$sphinx_rt->replace_in_documents(
|
||||
"docs_realtime" . $sbas_crc, //$this->id,
|
||||
$this->record->get_record_id(), $all_datas, $sbas_id, phrasea::collFromBas($this->record->get_base_id()), ($this->record->is_grouping() ? '1' : '0'), $this->record->get_type(), $this->record->get_creation_date()
|
||||
);
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
unset($e);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function create(databox_field &$databox_field, record_Interface $record, $value)
|
||||
{
|
||||
|
||||
$sbas_id = $databox_field->get_databox()->get_sbas_id();
|
||||
$connbas = $databox_field->get_connection();
|
||||
|
||||
$sql_ins = 'INSERT INTO metadatas (id, record_id, meta_struct_id, value)
|
||||
VALUES
|
||||
(null, :record_id, :field, :value)';
|
||||
$stmt_ins = $connbas->prepare($sql_ins);
|
||||
$stmt_ins->execute(
|
||||
array(
|
||||
':record_id' => $record->get_record_id(),
|
||||
':field' => $databox_field->get_id(),
|
||||
':value' => $value
|
||||
)
|
||||
);
|
||||
$stmt_ins->closeCursor();
|
||||
$meta_id = $connbas->lastInsertId();
|
||||
|
||||
$caption_field_value = new self($databox_field, $record, $meta_id);
|
||||
$caption_field_value->update_cache_value($value);
|
||||
|
||||
// $record->get_caption()->delete_data_from_cache();
|
||||
|
||||
return $caption_field_value;
|
||||
}
|
||||
}
|
@@ -15,7 +15,7 @@
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
class caption_field implements cache_cacheableInterface
|
||||
class caption_field //implements cache_cacheableInterface
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -28,13 +28,13 @@ class caption_field implements cache_cacheableInterface
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $value;
|
||||
protected $values;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $id;
|
||||
// /**
|
||||
// *
|
||||
// * @var int
|
||||
// */
|
||||
// protected $id;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -49,45 +49,53 @@ class caption_field implements cache_cacheableInterface
|
||||
* @param int $id
|
||||
* @return caption_field
|
||||
*/
|
||||
public function __construct(databox_field &$databox_field, record_Interface $record, $id)
|
||||
public function __construct(databox_field &$databox_field, record_Interface $record)
|
||||
{
|
||||
$this->record = $record;
|
||||
$this->id = (int) $id;
|
||||
|
||||
$row = false;
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
$row = $this->get_data_from_cache();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
// $this->id = (int) $id;
|
||||
$this->databox_field = $databox_field;
|
||||
$this->values = array();
|
||||
|
||||
$connbas = $databox_field->get_connection();
|
||||
|
||||
$sql = 'SELECT record_id, value FROM metadatas WHERE id = :id';
|
||||
$stmt = $connbas->prepare($sql);
|
||||
$stmt->execute(array(':id' => $id));
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
$this->set_data_to_cache($row);
|
||||
unset($e);
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
unset($e);
|
||||
}
|
||||
if (!$row)
|
||||
throw new Exception('Unknown metadata');
|
||||
$sql = 'SELECT id FROM metadatas
|
||||
WHERE record_id = :record_id
|
||||
AND meta_struct_id = :meta_struct_id';
|
||||
|
||||
$this->databox_field = $databox_field;
|
||||
$this->value = $row['value'];
|
||||
$params = array(
|
||||
':record_id' => $record->get_record_id()
|
||||
, ':meta_struct_id' => $databox_field->get_id()
|
||||
);
|
||||
|
||||
$stmt = $connbas->prepare($sql);
|
||||
$stmt->execute($params);
|
||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
if (!$databox_field->is_multi() && count($rs) > 1)
|
||||
{
|
||||
/**
|
||||
* TRIGG CORRECTION;
|
||||
*/
|
||||
}
|
||||
|
||||
foreach ($rs as $row)
|
||||
{
|
||||
$this->values[$row['id']] = new caption_Field_Value($databox_field, $record, $row['id']);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return record_adapter
|
||||
*/
|
||||
public function get_record()
|
||||
{
|
||||
return $this->record;
|
||||
}
|
||||
|
||||
public function is_required()
|
||||
{
|
||||
return $this->databox_field->is_required();
|
||||
@@ -103,108 +111,108 @@ class caption_field implements cache_cacheableInterface
|
||||
return $this->databox_field->is_readonly();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return caption_field
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$connbas = $this->databox_field->get_connection();
|
||||
|
||||
$sql = 'DELETE FROM metadatas WHERE id = :id';
|
||||
$stmt = $connbas->prepare($sql);
|
||||
$stmt->execute(array(':id' => $this->id));
|
||||
$stmt->closeCursor();
|
||||
$this->delete_data_from_cache();
|
||||
|
||||
$sbas_id = $this->record->get_sbas_id();
|
||||
$this->record->get_caption()->delete_data_from_cache();
|
||||
|
||||
try
|
||||
{
|
||||
$registry = registry::get_instance();
|
||||
$sphinx_rt = sphinxrt::get_instance($registry);
|
||||
|
||||
$sbas_params = phrasea::sbas_params();
|
||||
|
||||
if (isset($sbas_params[$sbas_id]))
|
||||
{
|
||||
$params = $sbas_params[$sbas_id];
|
||||
$sbas_crc = crc32(str_replace(array('.', '%'), '_', sprintf('%s_%s_%s_%s', $params['host'], $params['port'], $params['user'], $params['dbname'])));
|
||||
$sphinx_rt->delete(array("metadatas" . $sbas_crc, "metadatas" . $sbas_crc . "_stemmed_fr", "metadatas" . $sbas_crc . "_stemmed_en"), "metas_realtime" . $sbas_crc, $this->id);
|
||||
$sphinx_rt->delete(array("documents" . $sbas_crc, "documents" . $sbas_crc . "_stemmed_fr", "documents" . $sbas_crc . "_stemmed_en"), "docs_realtime" . $sbas_crc, $this->record->get_record_id());
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
unset($e);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Part of the cache_cacheableInterface
|
||||
*
|
||||
* @param string $option
|
||||
* @return string
|
||||
*/
|
||||
public function get_cache_key($option = null)
|
||||
{
|
||||
return 'captionfield_' . $this->record->get_serialize_key()
|
||||
. $this->id . ($option ? '_' . $option : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Part of the cache_cacheableInterface
|
||||
*
|
||||
* @param string $option
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_data_from_cache($option = null)
|
||||
{
|
||||
$databox = databox::get_instance($this->record->get_sbas_id());
|
||||
|
||||
return $databox->get_data_from_cache($this->get_cache_key($option));
|
||||
}
|
||||
|
||||
/**
|
||||
* Part of the cache_cacheableInterface
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param string $option
|
||||
* @param int $duration
|
||||
* @return caption_field
|
||||
*/
|
||||
public function set_data_to_cache($value, $option = null, $duration = 0)
|
||||
{
|
||||
$databox = databox::get_instance($this->record->get_sbas_id());
|
||||
$databox->set_data_to_cache($value, $this->get_cache_key($option), $duration);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Part of the cache_cacheableInterface
|
||||
*
|
||||
* @param string $option
|
||||
* @return caption_field
|
||||
*/
|
||||
public function delete_data_from_cache($option = null)
|
||||
{
|
||||
$databox = databox::get_instance($this->record->get_sbas_id());
|
||||
$databox->delete_data_from_cache($this->get_cache_key($option));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param array $value
|
||||
* @param databox_field $databox_field
|
||||
* @return string
|
||||
*/
|
||||
protected static function serialize_value(Array $value, $separator)
|
||||
// /**
|
||||
// *
|
||||
// * @return caption_field
|
||||
// */
|
||||
// public function delete()
|
||||
// {
|
||||
// $connbas = $this->databox_field->get_connection();
|
||||
//
|
||||
// $sql = 'DELETE FROM metadatas WHERE id = :id';
|
||||
// $stmt = $connbas->prepare($sql);
|
||||
// $stmt->execute(array(':id' => $this->id));
|
||||
// $stmt->closeCursor();
|
||||
// $this->delete_data_from_cache();
|
||||
//
|
||||
// $sbas_id = $this->record->get_sbas_id();
|
||||
// $this->record->get_caption()->delete_data_from_cache();
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// $registry = registry::get_instance();
|
||||
// $sphinx_rt = sphinxrt::get_instance($registry);
|
||||
//
|
||||
// $sbas_params = phrasea::sbas_params();
|
||||
//
|
||||
// if (isset($sbas_params[$sbas_id]))
|
||||
// {
|
||||
// $params = $sbas_params[$sbas_id];
|
||||
// $sbas_crc = crc32(str_replace(array('.', '%'), '_', sprintf('%s_%s_%s_%s', $params['host'], $params['port'], $params['user'], $params['dbname'])));
|
||||
// $sphinx_rt->delete(array("metadatas" . $sbas_crc, "metadatas" . $sbas_crc . "_stemmed_fr", "metadatas" . $sbas_crc . "_stemmed_en"), "metas_realtime" . $sbas_crc, $this->id);
|
||||
// $sphinx_rt->delete(array("documents" . $sbas_crc, "documents" . $sbas_crc . "_stemmed_fr", "documents" . $sbas_crc . "_stemmed_en"), "docs_realtime" . $sbas_crc, $this->record->get_record_id());
|
||||
// }
|
||||
// }
|
||||
// catch (Exception $e)
|
||||
// {
|
||||
// unset($e);
|
||||
// }
|
||||
//
|
||||
// return $this;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Part of the cache_cacheableInterface
|
||||
// *
|
||||
// * @param string $option
|
||||
// * @return string
|
||||
// */
|
||||
// public function get_cache_key($option = null)
|
||||
// {
|
||||
// return 'captionfield_' . $this->record->get_serialize_key()
|
||||
// . $this->id . ($option ? '_' . $option : '');
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Part of the cache_cacheableInterface
|
||||
// *
|
||||
// * @param string $option
|
||||
// * @return mixed
|
||||
// */
|
||||
// public function get_data_from_cache($option = null)
|
||||
// {
|
||||
// $databox = databox::get_instance($this->record->get_sbas_id());
|
||||
//
|
||||
// return $databox->get_data_from_cache($this->get_cache_key($option));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Part of the cache_cacheableInterface
|
||||
// *
|
||||
// * @param mixed $value
|
||||
// * @param string $option
|
||||
// * @param int $duration
|
||||
// * @return caption_field
|
||||
// */
|
||||
// public function set_data_to_cache($value, $option = null, $duration = 0)
|
||||
// {
|
||||
// $databox = databox::get_instance($this->record->get_sbas_id());
|
||||
// $databox->set_data_to_cache($value, $this->get_cache_key($option), $duration);
|
||||
//
|
||||
// return $this;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Part of the cache_cacheableInterface
|
||||
// *
|
||||
// * @param string $option
|
||||
// * @return caption_field
|
||||
// */
|
||||
// public function delete_data_from_cache($option = null)
|
||||
// {
|
||||
// $databox = databox::get_instance($this->record->get_sbas_id());
|
||||
// $databox->delete_data_from_cache($this->get_cache_key($option));
|
||||
//
|
||||
// return $this;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// *
|
||||
// * @param array $value
|
||||
// * @param databox_field $databox_field
|
||||
// * @return string
|
||||
// */
|
||||
protected static function serialize_value(Array $values, $separator)
|
||||
{
|
||||
if (strlen($separator) > 1)
|
||||
$separator = $separator[0];
|
||||
@@ -214,97 +222,104 @@ class caption_field implements cache_cacheableInterface
|
||||
else
|
||||
$separator = ' ' . $separator . ' ';
|
||||
|
||||
return implode($separator, $value);
|
||||
}
|
||||
$array_values = array();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param array $value
|
||||
* @return caption_field
|
||||
*/
|
||||
public function set_value(Array $value)
|
||||
foreach($values as $value)
|
||||
{
|
||||
$sbas_id = $this->databox_field->get_databox()->get_sbas_id();
|
||||
$connbas = $this->databox_field->get_connection();
|
||||
|
||||
$sql_up = 'UPDATE metadatas SET value = :value WHERE id = :meta_id';
|
||||
$stmt_up = $connbas->prepare($sql_up);
|
||||
$stmt_up->execute(array(':meta_id' => $this->get_meta_id(), ':value' => self::serialize_value($value, $this->databox_field->get_separator())));
|
||||
$stmt_up->closeCursor();
|
||||
|
||||
try
|
||||
{
|
||||
$registry = registry::get_instance();
|
||||
$sphinx_rt = sphinxrt::get_instance($registry);
|
||||
|
||||
$sbas_params = phrasea::sbas_params();
|
||||
|
||||
if (isset($sbas_params[$sbas_id]))
|
||||
{
|
||||
$params = $sbas_params[$sbas_id];
|
||||
$sbas_crc = crc32(str_replace(array('.', '%'), '_', sprintf('%s_%s_%s_%s', $params['host'], $params['port'], $params['user'], $params['dbname'])));
|
||||
$sphinx_rt->delete(array("metadatas" . $sbas_crc, "metadatas" . $sbas_crc . "_stemmed_fr", "metadatas" . $sbas_crc . "_stemmed_en"), "", $this->get_meta_id());
|
||||
$sphinx_rt->delete(array("documents" . $sbas_crc, "documents" . $sbas_crc . "_stemmed_fr", "documents" . $sbas_crc . "_stemmed_en"), "", $this->record->get_record_id());
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
|
||||
$array_values[] = $value->getValue();
|
||||
}
|
||||
|
||||
$this->update_cache_value($value);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param array $value
|
||||
* @return caption_field
|
||||
*/
|
||||
public function update_cache_value(Array $value)
|
||||
{
|
||||
$this->delete_data_from_cache();
|
||||
$this->record->get_caption()->delete_data_from_cache();
|
||||
$sbas_id = $this->databox_field->get_databox()->get_sbas_id();
|
||||
try
|
||||
{
|
||||
$registry = registry::get_instance();
|
||||
|
||||
$sbas_params = phrasea::sbas_params();
|
||||
|
||||
if (isset($sbas_params[$sbas_id]))
|
||||
{
|
||||
$params = $sbas_params[$sbas_id];
|
||||
$sbas_crc = crc32(str_replace(array('.', '%'), '_', sprintf('%s_%s_%s_%s', $params['host'], $params['port'], $params['user'], $params['dbname'])));
|
||||
|
||||
$sphinx_rt = sphinxrt::get_instance($registry);
|
||||
$sphinx_rt->replace_in_metas(
|
||||
"metas_realtime" . $sbas_crc, $this->id, $this->databox_field->get_id(), $this->record->get_record_id(), $sbas_id, phrasea::collFromBas($this->record->get_base_id()), ($this->record->is_grouping() ? '1' : '0'), $this->record->get_type(), $value, $this->record->get_creation_date()
|
||||
);
|
||||
|
||||
$all_datas = array();
|
||||
foreach ($this->record->get_caption()->get_fields() as $field)
|
||||
{
|
||||
if (!$field->is_indexable())
|
||||
continue;
|
||||
$all_datas[] = $field->get_value(true);
|
||||
}
|
||||
$all_datas = implode(' ', $all_datas);
|
||||
|
||||
$sphinx_rt->replace_in_documents(
|
||||
"docs_realtime" . $sbas_crc, //$this->id,
|
||||
$this->record->get_record_id(), $all_datas, $sbas_id, phrasea::collFromBas($this->record->get_base_id()), ($this->record->is_grouping() ? '1' : '0'), $this->record->get_type(), $this->record->get_creation_date()
|
||||
);
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
unset($e);
|
||||
}
|
||||
|
||||
return $this;
|
||||
return implode($separator, $array_values);
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// *
|
||||
// * @param array $value
|
||||
// * @return caption_field
|
||||
// */
|
||||
// public function set_value(Array $value)
|
||||
// {
|
||||
// $sbas_id = $this->databox_field->get_databox()->get_sbas_id();
|
||||
// $connbas = $this->databox_field->get_connection();
|
||||
//
|
||||
// $sql_up = 'UPDATE metadatas SET value = :value WHERE id = :meta_id';
|
||||
// $stmt_up = $connbas->prepare($sql_up);
|
||||
// $stmt_up->execute(array(':meta_id' => $this->get_meta_id(), ':value' => self::serialize_value($value, $this->databox_field->get_separator())));
|
||||
// $stmt_up->closeCursor();
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// $registry = registry::get_instance();
|
||||
// $sphinx_rt = sphinxrt::get_instance($registry);
|
||||
//
|
||||
// $sbas_params = phrasea::sbas_params();
|
||||
//
|
||||
// if (isset($sbas_params[$sbas_id]))
|
||||
// {
|
||||
// $params = $sbas_params[$sbas_id];
|
||||
// $sbas_crc = crc32(str_replace(array('.', '%'), '_', sprintf('%s_%s_%s_%s', $params['host'], $params['port'], $params['user'], $params['dbname'])));
|
||||
// $sphinx_rt->delete(array("metadatas" . $sbas_crc, "metadatas" . $sbas_crc . "_stemmed_fr", "metadatas" . $sbas_crc . "_stemmed_en"), "", $this->get_meta_id());
|
||||
// $sphinx_rt->delete(array("documents" . $sbas_crc, "documents" . $sbas_crc . "_stemmed_fr", "documents" . $sbas_crc . "_stemmed_en"), "", $this->record->get_record_id());
|
||||
// }
|
||||
// }
|
||||
// catch (Exception $e)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// $this->update_cache_value($value);
|
||||
//
|
||||
// return $this;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// *
|
||||
// * @param array $value
|
||||
// * @return caption_field
|
||||
// */
|
||||
// public function update_cache_value(Array $value)
|
||||
// {
|
||||
// $this->delete_data_from_cache();
|
||||
// $this->record->get_caption()->delete_data_from_cache();
|
||||
// $sbas_id = $this->databox_field->get_databox()->get_sbas_id();
|
||||
// try
|
||||
// {
|
||||
// $registry = registry::get_instance();
|
||||
//
|
||||
// $sbas_params = phrasea::sbas_params();
|
||||
//
|
||||
// if (isset($sbas_params[$sbas_id]))
|
||||
// {
|
||||
// $params = $sbas_params[$sbas_id];
|
||||
// $sbas_crc = crc32(str_replace(array('.', '%'), '_', sprintf('%s_%s_%s_%s', $params['host'], $params['port'], $params['user'], $params['dbname'])));
|
||||
//
|
||||
// $sphinx_rt = sphinxrt::get_instance($registry);
|
||||
// $sphinx_rt->replace_in_metas(
|
||||
// "metas_realtime" . $sbas_crc, $this->id, $this->databox_field->get_id(), $this->record->get_record_id(), $sbas_id, phrasea::collFromBas($this->record->get_base_id()), ($this->record->is_grouping() ? '1' : '0'), $this->record->get_type(), $value, $this->record->get_creation_date()
|
||||
// );
|
||||
//
|
||||
// $all_datas = array();
|
||||
// foreach ($this->record->get_caption()->get_fields() as $field)
|
||||
// {
|
||||
// if (!$field->is_indexable())
|
||||
// continue;
|
||||
// $all_datas[] = $field->get_value(true);
|
||||
// }
|
||||
// $all_datas = implode(' ', $all_datas);
|
||||
//
|
||||
// $sphinx_rt->replace_in_documents(
|
||||
// "docs_realtime" . $sbas_crc, //$this->id,
|
||||
// $this->record->get_record_id(), $all_datas, $sbas_id, phrasea::collFromBas($this->record->get_base_id()), ($this->record->is_grouping() ? '1' : '0'), $this->record->get_type(), $this->record->get_creation_date()
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// catch (Exception $e)
|
||||
// {
|
||||
// unset($e);
|
||||
// }
|
||||
//
|
||||
// return $this;
|
||||
// }
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -312,62 +327,93 @@ class caption_field implements cache_cacheableInterface
|
||||
* @param record_Interface $record
|
||||
* @param array $value
|
||||
* @return caption_field
|
||||
*/
|
||||
public static function create(databox_field &$databox_field, record_Interface $record, Array $value)
|
||||
// */
|
||||
// public static function create(databox_field &$databox_field, record_Interface $record, Array $value)
|
||||
// {
|
||||
//
|
||||
// $sbas_id = $databox_field->get_databox()->get_sbas_id();
|
||||
// $connbas = $databox_field->get_connection();
|
||||
// $sql_ins = 'INSERT INTO metadatas (id, record_id, meta_struct_id, value)
|
||||
// VALUES
|
||||
// (null, :record_id, :field, :value)';
|
||||
// $stmt_ins = $connbas->prepare($sql_ins);
|
||||
// $stmt_ins->execute(
|
||||
// array(
|
||||
// ':record_id' => $record->get_record_id(),
|
||||
// ':field' => $databox_field->get_id(),
|
||||
// ':value' => self::serialize_value($value, $databox_field->get_separator())
|
||||
// )
|
||||
// );
|
||||
// $stmt_ins->closeCursor();
|
||||
// $meta_id = $connbas->lastInsertId();
|
||||
//
|
||||
// $caption_field = new self($databox_field, $record, $meta_id);
|
||||
// $caption_field->update_cache_value($value);
|
||||
//
|
||||
// $record->get_caption()->delete_data_from_cache();
|
||||
//
|
||||
// return $caption_field;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// *
|
||||
// * @return string
|
||||
// */
|
||||
// public function get_value($as_string = false, $custom_separator = false)
|
||||
// {
|
||||
// if ($this->databox_field->is_multi() === true)
|
||||
// {
|
||||
// if ($as_string === true && $custom_separator === false)
|
||||
// {
|
||||
// return $this->value;
|
||||
// }
|
||||
// $separator = $this->databox_field->get_separator();
|
||||
// $array_values = self::get_multi_values($this->value, $separator);
|
||||
//
|
||||
// if ($as_string === true && $custom_separator !== false)
|
||||
// return self::serialize_value($array_values, $custom_separator);
|
||||
// else
|
||||
// return $array_values;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return $this->value;
|
||||
// }
|
||||
// }
|
||||
|
||||
public function get_values()
|
||||
{
|
||||
|
||||
$sbas_id = $databox_field->get_databox()->get_sbas_id();
|
||||
$connbas = $databox_field->get_connection();
|
||||
$sql_ins = 'INSERT INTO metadatas (id, record_id, meta_struct_id, value)
|
||||
VALUES
|
||||
(null, :record_id, :field, :value)';
|
||||
$stmt_ins = $connbas->prepare($sql_ins);
|
||||
$stmt_ins->execute(
|
||||
array(
|
||||
':record_id' => $record->get_record_id(),
|
||||
':field' => $databox_field->get_id(),
|
||||
':value' => self::serialize_value($value, $databox_field->get_separator())
|
||||
)
|
||||
);
|
||||
$stmt_ins->closeCursor();
|
||||
$meta_id = $connbas->lastInsertId();
|
||||
|
||||
$caption_field = new self($databox_field, $record, $meta_id);
|
||||
$caption_field->update_cache_value($value);
|
||||
|
||||
$record->get_caption()->delete_data_from_cache();
|
||||
|
||||
return $caption_field;
|
||||
return $this->values;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_value($as_string = false, $custom_separator = false)
|
||||
public function get_value($meta_id)
|
||||
{
|
||||
return $this->values[$meta_id];
|
||||
}
|
||||
|
||||
public function get_serialized_values($custom_separator = false)
|
||||
{
|
||||
if ($this->databox_field->is_multi() === true)
|
||||
{
|
||||
if ($as_string === true && $custom_separator === false)
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
if($custom_separator !== false)
|
||||
$separator = $custom_separator;
|
||||
else
|
||||
$separator = $this->databox_field->get_separator();
|
||||
$array_values = self::get_multi_values($this->value, $separator);
|
||||
|
||||
if ($as_string === true && $custom_separator !== false)
|
||||
|
||||
return self::serialize_value($array_values, $custom_separator);
|
||||
else
|
||||
|
||||
return $array_values;
|
||||
return self::serialize_value($this->values, $separator);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->value;
|
||||
foreach($this->values as $value)
|
||||
{
|
||||
/* @var $value Caption_Field_Value */
|
||||
return $value->getValue();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
@@ -395,14 +441,14 @@ class caption_field implements cache_cacheableInterface
|
||||
return $this->databox_field->is_indexable();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function get_meta_id()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
// /**
|
||||
// *
|
||||
// * @return int
|
||||
// */
|
||||
// public function get_meta_id()
|
||||
// {
|
||||
// return $this->id;
|
||||
// }
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -426,7 +472,7 @@ class caption_field implements cache_cacheableInterface
|
||||
|
||||
$sbas_id = $this->databox_field->get_databox()->get_sbas_id();
|
||||
|
||||
$value = $this->get_value(true);
|
||||
$value = $this->get_serialized_values();
|
||||
|
||||
$databox = databox::get_instance($sbas_id);
|
||||
$XPATH_thesaurus = $databox->get_xpath_thesaurus();
|
||||
|
@@ -85,7 +85,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
|
||||
try
|
||||
{
|
||||
$databox_meta_struct = databox_field::get_instance($this->databox, $row['structure_id']);
|
||||
$metadata = new caption_field($databox_meta_struct, $this->record, $row['meta_id']);
|
||||
$metadata = new caption_field($databox_meta_struct, $this->record);
|
||||
|
||||
$rec_fields[$databox_meta_struct->get_id()] = $metadata;
|
||||
$dces_element = $metadata->get_databox_field()->get_dces_element();
|
||||
|
@@ -18,6 +18,7 @@
|
||||
class connection_pdo extends connection_abstract implements connection_interface
|
||||
{
|
||||
|
||||
protected $registry;
|
||||
/**
|
||||
*
|
||||
* @param string $name
|
||||
@@ -29,8 +30,9 @@ class connection_pdo extends connection_abstract implements connection_interface
|
||||
* @param array $options
|
||||
* @return connection_pdo
|
||||
*/
|
||||
public function __construct($name, $hostname, $port, $user, $passwd, $dbname=false, $options=array())
|
||||
public function __construct($name, $hostname, $port, $user, $passwd, $dbname=false, $options=array(), registryInterface $registry = null)
|
||||
{
|
||||
$this->registry = $registry ? $registry : registry::get_instance();
|
||||
$this->name = $name;
|
||||
if ($dbname)
|
||||
$dsn = 'mysql:dbname=' . $dbname . ';host=' . $hostname . ';port=' . $port . ';';
|
||||
@@ -63,8 +65,7 @@ class connection_pdo extends connection_abstract implements connection_interface
|
||||
*/
|
||||
public function prepare($statement, $driver_options = array())
|
||||
{
|
||||
$registry = registry::get_instance();
|
||||
if ($registry->get('GV_debug'))
|
||||
if ($this->registry->get('GV_debug'))
|
||||
|
||||
return new connection_pdoStatementDebugger(parent::prepare($statement, $driver_options));
|
||||
else
|
||||
|
@@ -95,9 +95,17 @@ function deleteRecord($lst, $del_children)
|
||||
$ret[] = implode('_', array($oneson->get_sbas_id(), $oneson->get_record_id(), $oneson->get_base_id()));
|
||||
}
|
||||
}
|
||||
$ret[] = implode('_', $rid);
|
||||
|
||||
$basket_elements = $BE_repository->findElementsByRecord($record);
|
||||
|
||||
foreach($basket_elements as $basket_element)
|
||||
{
|
||||
$em->remove($basket_element);
|
||||
}
|
||||
|
||||
$record->delete();
|
||||
unset($record);
|
||||
$ret[] = implode('_', $rid);
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
@@ -106,12 +114,6 @@ function deleteRecord($lst, $del_children)
|
||||
}
|
||||
}
|
||||
|
||||
$basket_elements = $BE_repository->findElementsByRecord($record);
|
||||
|
||||
foreach($basket_elements as $basket_element)
|
||||
{
|
||||
$em->remove($basket_element);
|
||||
}
|
||||
$em->flush();
|
||||
|
||||
return p4string::jsonencode($ret);
|
||||
|
@@ -39,7 +39,7 @@ class random
|
||||
$registry = registry::get_instance();
|
||||
|
||||
$sql = 'SELECT * FROM tokens WHERE expire_on < :date
|
||||
AND datas IS NOT NULL AND type="download"';
|
||||
AND datas IS NOT NULL AND (type="download" OR type="email")';
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->execute(array(':date' => $date));
|
||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
@@ -49,6 +49,7 @@ class random
|
||||
switch ($row['type'])
|
||||
{
|
||||
case 'download':
|
||||
case 'email':
|
||||
$file = $registry->get('GV_RootPath') . 'tmp/download/' . $row['value'] . '.zip';
|
||||
if (is_file($file))
|
||||
unlink($file);
|
||||
@@ -56,7 +57,7 @@ class random
|
||||
}
|
||||
}
|
||||
|
||||
$sql = 'DELETE FROM tokens WHERE expire_on < :date and type="download"';
|
||||
$sql = 'DELETE FROM tokens WHERE expire_on < :date and (type="download" OR type="email")';
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->execute(array(':date' => $date));
|
||||
$stmt->closeCursor();
|
||||
|
@@ -140,7 +140,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
const CACHE_GROUPING = 'grouping';
|
||||
const CACHE_STATUS = 'status';
|
||||
|
||||
|
||||
protected static $_regfields;
|
||||
|
||||
/**
|
||||
@@ -784,16 +783,17 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
|
||||
foreach ($caption->get_fields() as $field)
|
||||
{
|
||||
if ($field->is_multi())
|
||||
$values = $field->get_value();
|
||||
else
|
||||
$values = array($field->get_value());
|
||||
$values = $field->get_values();
|
||||
// if ($field->is_multi())
|
||||
// $values = $field->get_value();
|
||||
// else
|
||||
// $values = array($field->get_value());
|
||||
|
||||
foreach ($values as $value)
|
||||
{
|
||||
$elem = $dom_doc->createElement($field->get_name());
|
||||
$elem->appendChild($dom_doc->createTextNode($value));
|
||||
$elem->setAttribute('meta_id', $field->get_meta_id());
|
||||
$elem->appendChild($dom_doc->createTextNode($value->getValue()));
|
||||
$elem->setAttribute('meta_id', $value->getId());
|
||||
$elem->setAttribute('meta_struct_id', $field->get_meta_struct_id());
|
||||
$description->appendChild($elem);
|
||||
}
|
||||
@@ -836,14 +836,27 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
continue;
|
||||
}
|
||||
|
||||
/* @var $field caption_field */
|
||||
/**
|
||||
* Replacing original name in multi values is non sense
|
||||
*/
|
||||
if (!$field->is_multi())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = array_pop($field->get_values());
|
||||
|
||||
$this->set_metadatas(
|
||||
array(
|
||||
'meta_struct_id' => $field->get_meta_struct_id()
|
||||
, 'meta_id' => get_meta_id
|
||||
, 'value' => array($original_name)
|
||||
, 'meta_id' => $value->getId()
|
||||
, 'value' => $original_name
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = 'UPDATE record
|
||||
SET originalname = :originalname WHERE record_id = :record_id';
|
||||
@@ -955,9 +968,12 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
|
||||
foreach ($desc->get_fields() as $caption_field)
|
||||
{
|
||||
/* @var $caption_field caption_field */
|
||||
$meta_struct_id = $caption_field->get_meta_struct_id();
|
||||
if (array_key_exists($meta_struct_id, $array))
|
||||
$fields[$array[$meta_struct_id]] = $caption_field->get_value();
|
||||
{
|
||||
$fields[$array[$meta_struct_id]] = $caption_field->get_serialized_values();
|
||||
}
|
||||
}
|
||||
|
||||
return $fields;
|
||||
@@ -1251,29 +1267,32 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_array($params['value']))
|
||||
throw new Exception();
|
||||
if (!is_scalar($params['value']))
|
||||
throw new Exception('Metadata value should be scalar');
|
||||
|
||||
$databox_field = databox_field::get_instance($databox, $params['meta_struct_id']);
|
||||
|
||||
$caption_field = new caption_field($databox_field, $this);
|
||||
|
||||
if (trim($params['meta_id']) !== '')
|
||||
{
|
||||
$tmp_val = trim(implode('', $params['value']));
|
||||
$caption_field = new caption_field($databox_field, $this, $params['meta_id']);
|
||||
$tmp_val = trim($params['value']);
|
||||
|
||||
$caption_field_value = $caption_field->get_value($params['meta_id']);
|
||||
|
||||
if ($tmp_val === '')
|
||||
{
|
||||
$caption_field->delete();
|
||||
unset($caption_field);
|
||||
$caption_field_value->delete();
|
||||
unset($caption_field_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$caption_field->set_value($params['value']);
|
||||
$caption_field_value->set_value($params['value']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$caption_field = caption_field::create($databox_field, $this, $params['value']);
|
||||
$caption_field_value = caption_Field_Value::create($databox_field, $this, $params['value']);
|
||||
}
|
||||
|
||||
$this->caption_record = null;
|
||||
|
@@ -1135,10 +1135,10 @@ class system_file extends SplFileObject
|
||||
|
||||
foreach ($tmpval as $val)
|
||||
{
|
||||
$ret[$meta->get_id()] = array(
|
||||
$ret[] = array(
|
||||
'meta_struct_id' => $meta->get_id(),
|
||||
'meta_id' => null,
|
||||
'value' => array($val)
|
||||
'value' => $val
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1211,16 +1211,19 @@ class system_file extends SplFileObject
|
||||
$fv = array($fv);
|
||||
}
|
||||
|
||||
if (isset($metadatas[$meta->get_id()]) && $meta->is_multi() === true)
|
||||
{
|
||||
$fv = array_unique(array_merge($metadatas[$meta->get_id()], $fv));
|
||||
}
|
||||
// if (isset($metadatas[$meta->get_id()]) && $meta->is_multi() === true)
|
||||
// {
|
||||
// $fv = array_unique(array_merge($metadatas[$meta->get_id()], $fv));
|
||||
// }
|
||||
|
||||
$metadatas[$meta->get_id()] = array(
|
||||
foreach($fv as $value)
|
||||
{
|
||||
$metadatas[] = array(
|
||||
'meta_struct_id' => $meta->get_id(),
|
||||
'meta_id' => null,
|
||||
'value' => $fv
|
||||
'value' => $value
|
||||
);
|
||||
}
|
||||
|
||||
unset($meta);
|
||||
}
|
||||
|
@@ -5335,8 +5335,8 @@
|
||||
</fields>
|
||||
</index>
|
||||
<index>
|
||||
<name>unique</name>
|
||||
<type>UNIQUE</type>
|
||||
<name>index_meta</name>
|
||||
<type>INDEX</type>
|
||||
<fields>
|
||||
<field>record_id</field>
|
||||
<field>meta_struct_id</field>
|
||||
|
@@ -609,16 +609,19 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract
|
||||
*/
|
||||
foreach ($caption->get_fields() as $field)
|
||||
{
|
||||
$old_datas[$field->get_meta_id()] = $field->get_value();
|
||||
foreach($field->get_values() as $value)
|
||||
{
|
||||
$old_datas[$value->getId()] = $value->getValue();
|
||||
if ($field->is_readonly() === false && $field->is_multi() === false)
|
||||
{
|
||||
$toupdate[$field->get_meta_id()] = array(
|
||||
$toupdate[$value->getId()] = array(
|
||||
'meta_struct_id' => $field->get_meta_struct_id(),
|
||||
'meta_id' => $field->get_meta_id(),
|
||||
'value' => array($field->get_value() . ' test')
|
||||
'meta_id' => $value->getId(),
|
||||
'value' => array($value->getValue() . ' test')
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->evaluateMethodNotAllowedRoute($route, array('GET', 'PUT', 'DELETE'));
|
||||
|
||||
$crawler = $this->client->request('POST', $route, array('metadatas' => $toupdate));
|
||||
@@ -634,11 +637,13 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract
|
||||
|
||||
foreach ($caption->get_fields() as $field)
|
||||
{
|
||||
|
||||
foreach($field->get_values() as $value)
|
||||
{
|
||||
if ($field->is_readonly() === false && $field->is_multi() === false)
|
||||
{
|
||||
$saved_value = $toupdate[$field->get_meta_id()]['value'][0];
|
||||
$this->assertEquals($field->get_value(), $saved_value);
|
||||
$saved_value = $toupdate[$value->getId()]['value'][0];
|
||||
$this->assertEquals($value->getValue(), $saved_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->evaluateRecordsMetadataResponse($content);
|
||||
|
@@ -616,16 +616,19 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract
|
||||
*/
|
||||
foreach ($caption->get_fields() as $field)
|
||||
{
|
||||
$old_datas[$field->get_meta_id()] = $field->get_value();
|
||||
foreach($field->get_values() as $value)
|
||||
{
|
||||
$old_datas[$value->getId()] = $value->getValue();
|
||||
if ($field->is_readonly() === false && $field->is_multi() === false)
|
||||
{
|
||||
$toupdate[$field->get_meta_id()] = array(
|
||||
$toupdate[$value->getId()] = array(
|
||||
'meta_struct_id' => $field->get_meta_struct_id(),
|
||||
'meta_id' => $field->get_meta_id(),
|
||||
'value' => array($field->get_value() . ' test')
|
||||
'meta_id' => $value->getId(),
|
||||
'value' => array($value->getValue() . ' test')
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->evaluateMethodNotAllowedRoute($route, array('GET', 'PUT', 'DELETE'));
|
||||
|
||||
$crawler = $this->client->request('POST', $route, array('metadatas' => $toupdate), array(), array("HTTP_ACCEPT" => "application/yaml"));
|
||||
@@ -641,11 +644,13 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract
|
||||
|
||||
foreach ($caption->get_fields() as $field)
|
||||
{
|
||||
|
||||
foreach($field->get_values() as $value)
|
||||
{
|
||||
if ($field->is_readonly() === false && $field->is_multi() === false)
|
||||
{
|
||||
$saved_value = $toupdate[$field->get_meta_id()]['value'][0];
|
||||
$this->assertEquals($field->get_value(), $saved_value);
|
||||
$saved_value = $toupdate[$value->getId()]['value'][0];
|
||||
$this->assertEquals($value->getValue(), $saved_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->evaluateRecordsMetadataResponse($content);
|
||||
|
@@ -32,6 +32,7 @@ class ApplicationLightboxTest extends PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
if($this->feed instanceof Feed_Adapter)
|
||||
$this->feed->delete();
|
||||
parent::tearDown();
|
||||
}
|
||||
|
@@ -58,11 +58,6 @@ class oauthv2_application_test extends \PhraseanetWebTestCaseAuthenticatedAbstra
|
||||
self::deleteInsertedRow(appbox::get_instance(), self::$appli);
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
@@ -24,11 +24,6 @@ class ApplicationRootTest extends PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testRouteSlash()
|
||||
{
|
||||
$this->markTestIncomplete(
|
||||
|
@@ -24,11 +24,6 @@ class ApplicationSetupTest extends PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testRouteSlash()
|
||||
{
|
||||
$this->markTestIncomplete(
|
||||
|
@@ -38,11 +38,6 @@ class ControllerFieldsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default route test
|
||||
*/
|
||||
|
@@ -28,11 +28,6 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function createApplication()
|
||||
{
|
||||
return require __DIR__ . '/../../../../../Alchemy/Phrasea/Application/Admin.php';
|
||||
|
@@ -39,11 +39,6 @@ class ControllerSubdefsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default route test
|
||||
*/
|
||||
|
@@ -38,11 +38,6 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default route test
|
||||
*/
|
||||
|
@@ -50,6 +50,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
if(self::$api instanceof Bridge_Api)
|
||||
self::$api->delete();
|
||||
if (self::$account instanceof Bridge_Account)
|
||||
self::$account->delete();
|
||||
|
@@ -41,11 +41,6 @@ class ControllerEditTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default route test
|
||||
*/
|
||||
|
@@ -84,8 +84,9 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
if($this->feed instanceof Feed_Adapter)
|
||||
$this->feed->delete();
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function createApplication()
|
||||
|
@@ -39,11 +39,6 @@ class ControllerMoveCollectionTest extends \PhraseanetWebTestCaseAuthenticatedAb
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default route test
|
||||
*/
|
||||
|
@@ -39,11 +39,6 @@ class ControllerPrinterTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default route test
|
||||
*/
|
||||
|
@@ -39,11 +39,6 @@ class ControllerPushTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default route test
|
||||
*/
|
||||
|
@@ -38,11 +38,6 @@ class ControllerRootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default route test
|
||||
*/
|
||||
|
@@ -40,8 +40,11 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
if(self::$publisher instanceof Feed_Publisher_Adapter)
|
||||
self::$publisher->delete();
|
||||
if(self::$entry instanceof Feed_Entry_Adapter)
|
||||
self::$entry->delete();
|
||||
if(self::$feed instanceof Feed_Adapter)
|
||||
self::$feed->delete();
|
||||
parent::tearDown();
|
||||
}
|
||||
@@ -473,7 +476,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
||||
{
|
||||
if ($p4field = $entry_item->get_record()->get_caption()->get_dc_field($field["dc_field"]))
|
||||
{
|
||||
$this->assertEquals($p4field->get_value(true, $field["separator"]), $node->nodeValue
|
||||
$this->assertEquals($p4field->get_serialized_values($field["separator"]), $node->nodeValue
|
||||
, sprintf('Asserting good value for DC %s', $field["dc_field"]));
|
||||
if (sizeof($field["media_field"]["attributes"]) > 0)
|
||||
{
|
||||
|
@@ -38,11 +38,6 @@ class ControllerInstallerTest extends \PhraseanetWebTestCaseAbstract
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default route test
|
||||
*/
|
||||
|
@@ -38,11 +38,6 @@ class ControllerUpgraderTest extends \PhraseanetWebTestCaseAbstract
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default route test
|
||||
*/
|
||||
|
@@ -39,11 +39,6 @@ class ControllerConnectionTestTest extends \PhraseanetWebTestCaseAbstract
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default route test
|
||||
*/
|
||||
|
@@ -38,11 +38,6 @@ class ControllerPathFileTestTest extends \PhraseanetWebTestCaseAbstract
|
||||
$this->client = $this->createClient();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default route test
|
||||
*/
|
||||
|
@@ -32,11 +32,6 @@ class ApplicationTest extends \PhraseanetPHPUnitAbstract
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testGetConfigurationFilePath()
|
||||
{
|
||||
$app = new Application();
|
||||
|
@@ -28,11 +28,6 @@ class ConfigurationTest extends \PhraseanetPHPUnitAbstract
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testInitialization()
|
||||
{
|
||||
$spec = $this->getMock(
|
||||
|
@@ -23,16 +23,6 @@ use Alchemy\Phrasea\Core\Configuration\Application;
|
||||
class handlerTest extends \PhraseanetPHPUnitAbstract
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testGetSpec()
|
||||
{
|
||||
$spec = $this->getMock(
|
||||
|
@@ -23,16 +23,6 @@ use Alchemy\Phrasea\Core\Configuration\Parser\Yaml;
|
||||
class parserTest extends \PhraseanetPHPUnitAbstract
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testParser()
|
||||
{
|
||||
$parser = new Yaml();
|
||||
|
@@ -22,20 +22,6 @@ use Alchemy\Phrasea\Core\Version;
|
||||
class VersionTest extends \PhraseanetPHPUnitAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @var \Alchemy\Phrasea\Core\Configuration\Application
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testGetNumber()
|
||||
{
|
||||
$this->assertTrue(is_string(Version::getNumber()));
|
||||
|
@@ -24,7 +24,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testPropose_editing().
|
||||
*/
|
||||
public function testPropose_editing()
|
||||
@@ -36,7 +36,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testHas_thesaurus().
|
||||
*/
|
||||
public function testHas_thesaurus()
|
||||
@@ -48,7 +48,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_javascript_elements_ids().
|
||||
*/
|
||||
public function testGet_javascript_elements_ids()
|
||||
@@ -60,7 +60,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_javascript_elements().
|
||||
*/
|
||||
public function testGet_javascript_elements()
|
||||
@@ -72,7 +72,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_javascript_sugg_values().
|
||||
*/
|
||||
public function testGet_javascript_sugg_values()
|
||||
@@ -84,7 +84,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_javascript_status().
|
||||
*/
|
||||
public function testGet_javascript_status()
|
||||
@@ -96,7 +96,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_javascript_fields().
|
||||
*/
|
||||
public function testGet_javascript_fields()
|
||||
@@ -108,7 +108,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_status().
|
||||
*/
|
||||
public function testGet_status()
|
||||
@@ -120,7 +120,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_fields().
|
||||
*/
|
||||
public function testGet_fields()
|
||||
@@ -132,7 +132,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testExecute().
|
||||
*/
|
||||
public function testExecute()
|
||||
|
@@ -24,7 +24,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testIs_basket().
|
||||
*/
|
||||
public function testIs_basket()
|
||||
@@ -36,7 +36,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_original_basket().
|
||||
*/
|
||||
public function testGet_original_basket()
|
||||
@@ -48,7 +48,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testIs_single_grouping().
|
||||
*/
|
||||
public function testIs_single_grouping()
|
||||
@@ -60,7 +60,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_grouping_head().
|
||||
*/
|
||||
public function testGet_grouping_head()
|
||||
@@ -72,7 +72,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_elements().
|
||||
*/
|
||||
public function testGet_elements()
|
||||
@@ -84,7 +84,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testHas_many_sbas().
|
||||
*/
|
||||
public function testHas_many_sbas()
|
||||
@@ -96,7 +96,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testIs_possible().
|
||||
*/
|
||||
public function testIs_possible()
|
||||
@@ -108,7 +108,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_count_not_actionable().
|
||||
*/
|
||||
public function testGet_count_not_actionable()
|
||||
@@ -120,7 +120,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_count_actionable().
|
||||
*/
|
||||
public function testGet_count_actionable()
|
||||
@@ -132,7 +132,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_count_actionable_groupings().
|
||||
*/
|
||||
public function testGet_count_actionable_groupings()
|
||||
@@ -144,7 +144,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_count_element_received().
|
||||
*/
|
||||
public function testGet_count_element_received()
|
||||
@@ -156,7 +156,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_sbas_id().
|
||||
*/
|
||||
public function testGet_sbas_id()
|
||||
@@ -168,7 +168,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_serialize_list().
|
||||
*/
|
||||
public function testGet_serialize_list()
|
||||
@@ -180,7 +180,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGrep_records().
|
||||
*/
|
||||
public function testGrep_records()
|
||||
|
@@ -24,7 +24,7 @@ class HelperMoveCollectionTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testAvailable_destination().
|
||||
*/
|
||||
public function testAvailable_destination()
|
||||
@@ -36,7 +36,7 @@ class HelperMoveCollectionTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testPropose().
|
||||
*/
|
||||
public function testPropose()
|
||||
@@ -48,7 +48,7 @@ class HelperMoveCollectionTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testExecute().
|
||||
*/
|
||||
public function testExecute()
|
||||
|
@@ -24,7 +24,7 @@ class HelperPrinterTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_count_preview().
|
||||
*/
|
||||
public function testGet_count_preview()
|
||||
@@ -36,7 +36,7 @@ class HelperPrinterTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_count_thumbnail().
|
||||
*/
|
||||
public function testGet_count_thumbnail()
|
||||
|
@@ -21,12 +21,11 @@ class HelperPushTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->object = new Push(self::$core, \Symfony\Component\HttpFoundation\Request::createFromGlobals());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testSearch().
|
||||
*/
|
||||
public function testSearch()
|
||||
|
@@ -3,9 +3,12 @@
|
||||
require_once __DIR__ . '/../../../PhraseanetPHPUnitAuthenticatedAbstract.class.inc';
|
||||
require_once __DIR__ . '/../../Bridge_datas.inc';
|
||||
|
||||
$new_include_path = realpath(__DIR__ . '/../../../../vendor/gdata/') . PATH_SEPARATOR . get_include_path();
|
||||
$include_path = realpath(__DIR__ . '/../../../../vendor/gdata/');
|
||||
if(strpos(get_include_path(), $include_path) === false)
|
||||
{
|
||||
$new_include_path = $include_path . PATH_SEPARATOR . get_include_path();
|
||||
set_include_path($new_include_path);
|
||||
|
||||
}
|
||||
|
||||
require_once('Zend/Loader.php');
|
||||
Zend_Loader::loadClass('Zend_Gdata_YouTube');
|
||||
|
@@ -3,9 +3,12 @@
|
||||
require_once __DIR__ . '/../../../PhraseanetPHPUnitAuthenticatedAbstract.class.inc';
|
||||
require_once __DIR__ . '/../../Bridge_datas.inc';
|
||||
|
||||
$new_include_path = realpath(__DIR__ . '/../../../../vendor/gdata/') . PATH_SEPARATOR . get_include_path();
|
||||
$include_path = realpath(__DIR__ . '/../../../../vendor/gdata/');
|
||||
if(strpos(get_include_path(), $include_path) === false)
|
||||
{
|
||||
$new_include_path = $include_path . PATH_SEPARATOR . get_include_path();
|
||||
set_include_path($new_include_path);
|
||||
|
||||
}
|
||||
|
||||
require_once('Zend/Loader.php');
|
||||
Zend_Loader::loadClass('Zend_Gdata_YouTube');
|
||||
|
@@ -2,8 +2,12 @@
|
||||
|
||||
require_once __DIR__ . '/../../bootstrap.php';
|
||||
|
||||
$new_include_path = realpath(__DIR__ . "/../../vendor/") . PATH_SEPARATOR . get_include_path();
|
||||
$include_path = realpath(__DIR__ . '/../../vendor/');
|
||||
if(strpos(get_include_path(), $include_path) === false)
|
||||
{
|
||||
$new_include_path = $include_path . PATH_SEPARATOR . get_include_path();
|
||||
set_include_path($new_include_path);
|
||||
}
|
||||
|
||||
require_once __DIR__ . "/../../vendor/Phlickr/Api.php";
|
||||
|
||||
|
@@ -842,10 +842,6 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
unlink(Setup_Upgrade::get_lock_file());
|
||||
}
|
||||
|
||||
$upgrader = new Setup_Upgrade($appbox);
|
||||
$appbox->forceUpgrade($upgrader);
|
||||
unset($upgrader);
|
||||
|
||||
if (null !== self::$core)
|
||||
{
|
||||
/* @var $em \Doctrine\ORM\EntityManager */
|
||||
@@ -866,6 +862,10 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
$tool->createSchema($metas);
|
||||
}
|
||||
|
||||
$upgrader = new Setup_Upgrade($appbox);
|
||||
$appbox->forceUpgrade($upgrader);
|
||||
unset($upgrader);
|
||||
|
||||
self::$updated = true;
|
||||
}
|
||||
|
||||
@@ -898,12 +898,12 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
if (!$usr_alt1_id)
|
||||
{
|
||||
$user = User_Adapter::create($appbox, 'test_phpunit_alt1', random::generatePassword(), 'noonealt1@example.com', false);
|
||||
$usr_id = $user->get_id();
|
||||
$usr_alt1_id = $user->get_id();
|
||||
}
|
||||
if (!$usr_alt2_id)
|
||||
{
|
||||
$user = User_Adapter::create($appbox, 'test_phpunit_alt2', random::generatePassword(), 'noonealt2@example.com', false);
|
||||
$usr_id = $user->get_id();
|
||||
$usr_alt2_id = $user->get_id();
|
||||
}
|
||||
|
||||
self::$user = User_Adapter::getInstance($usr_id, $appbox);
|
||||
@@ -1001,7 +1001,8 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
}
|
||||
if (!$collection_no_acces instanceof collection)
|
||||
{
|
||||
self::fail('Unable to find a second collection');
|
||||
$collection_no_acces = collection::create($databox, $appbox, 'BIBOO', self::$user);
|
||||
// self::fail('Unable to find a second collection');
|
||||
}
|
||||
|
||||
self::$collection = $coll;
|
||||
|
@@ -248,13 +248,17 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
//valide metas
|
||||
$metadatas = array();
|
||||
foreach (self::$record_1->get_caption()->get_fields() as $field)
|
||||
{
|
||||
$values = $field->get_values();
|
||||
foreach($values as $value)
|
||||
{
|
||||
$metadatas[] = array(
|
||||
'meta_id' => $field->get_meta_id()
|
||||
'meta_id' => $value->getId()
|
||||
, 'meta_struct_id' => $field->get_meta_struct_id()
|
||||
, 'value' => $field->get_value()
|
||||
, 'value' => $value->getValue()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$metadatas = array_shift($metadatas);
|
||||
$metadatas["value"] = array("new_value");
|
||||
|
@@ -38,7 +38,6 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
parent::tearDownAfterClass();
|
||||
}
|
||||
|
||||
|
||||
public function testGet_creation_date()
|
||||
{
|
||||
$date_obj = new DateTime();
|
||||
@@ -169,7 +168,6 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function testGet_sha256()
|
||||
{
|
||||
$this->assertNotNull(static::$record_1->get_sha256());
|
||||
@@ -257,7 +255,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
foreach (self::$record_1->get_caption()->get_fields() as $field)
|
||||
{
|
||||
$tagname = $field->get_name();
|
||||
$this->assertEquals($field->get_value(true), (string) $sxe->description->$tagname);
|
||||
$this->assertEquals($field->get_serialized_values(), (string) $sxe->description->$tagname);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,18 +306,69 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
$current_caption = self::$record_1->get_caption();
|
||||
|
||||
$metadatas = array();
|
||||
|
||||
foreach ($meta_structure_el as $meta_el)
|
||||
{
|
||||
$current_fields = $current_caption->get_fields(array($meta_el->get_name()));
|
||||
$meta_id = null;
|
||||
|
||||
$field = null;
|
||||
|
||||
if (count($current_fields) > 0)
|
||||
{
|
||||
$meta_id = $current_fields[0]->get_meta_id();
|
||||
$field = array_pop($current_fields);
|
||||
}
|
||||
|
||||
$value = $meta_el->is_multi() ? array('un', 'jeu', 'de', 'test') : array('un jeu de test');
|
||||
if($meta_el->is_multi())
|
||||
{
|
||||
if($field)
|
||||
{
|
||||
foreach($field->get_values() as $value)
|
||||
{
|
||||
$metadatas[] = array(
|
||||
'meta_struct_id' => $meta_el->get_id()
|
||||
, 'meta_id' => $value->getId()
|
||||
, 'value' => ''
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$metadatas[] = array('meta_struct_id' => $meta_el->get_id(), 'meta_id' => $meta_id, 'value' => $value);
|
||||
$metadatas[] = array(
|
||||
'meta_struct_id' => $meta_el->get_id()
|
||||
, 'meta_id' => null
|
||||
, 'value' => 'un'
|
||||
);
|
||||
$metadatas[] = array(
|
||||
'meta_struct_id' => $meta_el->get_id()
|
||||
, 'meta_id' => null
|
||||
, 'value' => 'jeu'
|
||||
);
|
||||
$metadatas[] = array(
|
||||
'meta_struct_id' => $meta_el->get_id()
|
||||
, 'meta_id' => null
|
||||
, 'value' => 'de'
|
||||
);
|
||||
$metadatas[] = array(
|
||||
'meta_struct_id' => $meta_el->get_id()
|
||||
, 'meta_id' => null
|
||||
, 'value' => 'test'
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$meta_id = null;
|
||||
|
||||
if($field)
|
||||
{
|
||||
$meta_id = array_pop($field->get_values())->getId();
|
||||
}
|
||||
|
||||
$metadatas[] = array(
|
||||
'meta_struct_id' => $meta_el->get_id()
|
||||
, 'meta_id' => $meta_id
|
||||
, 'value' => 'un jeu de test'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
self::$record_1->set_metadatas($metadatas);
|
||||
@@ -339,11 +388,17 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
if ($meta_el->is_multi())
|
||||
{
|
||||
$this->assertEquals($multi_imploded, implode(' ' . $meta_el->get_separator() . ' ', $field->get_value(false)));
|
||||
$this->assertEquals($multi_imploded, $field->get_value(true));
|
||||
$initial_values = array();
|
||||
foreach($field->get_values() as $value)
|
||||
{
|
||||
$initial_values[] = $value->getValue();
|
||||
}
|
||||
|
||||
$this->assertEquals($multi_imploded, implode(' ' . $meta_el->get_separator() . ' ', $initial_values));
|
||||
$this->assertEquals($multi_imploded, $field->get_serialized_values());
|
||||
}
|
||||
else
|
||||
$this->assertEquals('un jeu de test', $field->get_value());
|
||||
$this->assertEquals('un jeu de test', $field->get_serialized_values());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,7 +567,6 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
if (!$found)
|
||||
$this->fail();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
*/
|
||||
public function testSet_locale()
|
||||
{
|
||||
@@ -43,7 +43,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_locale().
|
||||
*/
|
||||
public function testGet_locale()
|
||||
@@ -54,7 +54,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testSet_sort().
|
||||
*/
|
||||
public function testSet_sort()
|
||||
@@ -70,7 +70,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_sortby().
|
||||
*/
|
||||
public function testGet_sortby()
|
||||
@@ -83,7 +83,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_sortord().
|
||||
*/
|
||||
public function testGet_sortord()
|
||||
@@ -96,7 +96,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testSet_use_stemming().
|
||||
*/
|
||||
public function testSet_use_stemming()
|
||||
@@ -110,7 +110,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_use_stemming().
|
||||
*/
|
||||
public function testGet_use_stemming()
|
||||
@@ -124,7 +124,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testSet_search_type().
|
||||
*/
|
||||
public function testSet_search_type()
|
||||
@@ -141,7 +141,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_search_type().
|
||||
*/
|
||||
public function testGet_search_type()
|
||||
@@ -158,7 +158,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testSet_bases().
|
||||
*/
|
||||
public function testSet_bases()
|
||||
@@ -169,7 +169,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_bases().
|
||||
*/
|
||||
public function testGet_bases()
|
||||
@@ -180,7 +180,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testSet_fields().
|
||||
*/
|
||||
public function testSet_fields()
|
||||
@@ -192,7 +192,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_fields().
|
||||
*/
|
||||
public function testGet_fields()
|
||||
@@ -204,7 +204,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testSet_status().
|
||||
*/
|
||||
public function testSet_status()
|
||||
@@ -216,7 +216,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_status().
|
||||
*/
|
||||
public function testGet_status()
|
||||
@@ -228,7 +228,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testSet_record_type().
|
||||
*/
|
||||
public function testSet_record_type()
|
||||
@@ -240,7 +240,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_record_type().
|
||||
*/
|
||||
public function testGet_record_type()
|
||||
@@ -252,7 +252,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testSet_min_date().
|
||||
*/
|
||||
public function testSet_min_date()
|
||||
@@ -264,7 +264,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_min_date().
|
||||
*/
|
||||
public function testGet_min_date()
|
||||
@@ -276,7 +276,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testSet_max_date().
|
||||
*/
|
||||
public function testSet_max_date()
|
||||
@@ -288,7 +288,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_max_date().
|
||||
*/
|
||||
public function testGet_max_date()
|
||||
@@ -300,7 +300,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testSet_date_fields().
|
||||
*/
|
||||
public function testSet_date_fields()
|
||||
@@ -312,7 +312,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testGet_date_fields().
|
||||
*/
|
||||
public function testGet_date_fields()
|
||||
@@ -324,7 +324,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testSerialize().
|
||||
*/
|
||||
public function testSerialize()
|
||||
@@ -344,7 +344,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers {className}::{origMethodName}
|
||||
*
|
||||
* @todo Implement testUnserialize().
|
||||
*/
|
||||
public function testUnserialize()
|
||||
|
@@ -190,14 +190,15 @@
|
||||
<form id="export_form" method="post" target="exportwindow" action="/admin/users/search/export/">
|
||||
<input name="srt" value="{{parm['srt']}}" type="hidden" />
|
||||
<input name="ord" value="{{parm.ord}}" type="hidden" />
|
||||
<input name="act" value="{{parm.act}}" type="hidden" />
|
||||
{% for sbas_id in parm.sbas_id %}
|
||||
<input name="sbas_id[]" value="{{sbas_id}}" type="hidden" />
|
||||
{% endfor %}
|
||||
{% for base_id in parm.base_id %}
|
||||
<input name="base_id[]" value="{{base_id}}" type="hidden" />
|
||||
{% endfor %}
|
||||
{% if parm['usr_ids'] is defined %}
|
||||
<input name="usr_ids" value="{{parm.usr_ids}}" type="hidden" />
|
||||
{% endif %}
|
||||
<input name="like_value" value="{{parm.like_value}}" type="hidden" />
|
||||
<input name="like_field" value="{{parm.like_field}}" type="hidden" />
|
||||
<input name="inactives" value="{{parm.inactives}}" type="hidden" />
|
||||
|
@@ -66,7 +66,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<input class='required_field' type='text' name='{{name}}' value="{{ caption.get_dc_field('Subject') is not none ? caption.get_dc_field('Subject').get_value(true, ' ') : ''}}"/>
|
||||
<input class='required_field' type='text' name='{{name}}' value="{{ caption.get_dc_field('Subject') is not none ? caption.get_dc_field('Subject').get_serialized_values(' ') : ''}}"/>
|
||||
<br />
|
||||
{{ error_form.display_errors(name, constraint_errors) }}
|
||||
</td>
|
||||
|
@@ -74,7 +74,7 @@
|
||||
<label for='{{ name }}'>{% trans 'Tags' %}</label>
|
||||
</td>
|
||||
<td>
|
||||
<input class='required_field' type='text' style="width:150px;" name='{{ name }}' value="{{ caption.get_dc_field('Subject') is not none ? caption.get_dc_field('Subject').get_value(true, ' ') : '' }}"/>
|
||||
<input class='required_field' type='text' style="width:150px;" name='{{ name }}' value="{{ caption.get_dc_field('Subject') is not none ? caption.get_dc_field('Subject').get_serialized_values(' ') : '' }}"/>
|
||||
<br />
|
||||
{{ error_form.display_errors(name, constraint_errors) }}
|
||||
</td>
|
||||
|
@@ -78,7 +78,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<input class='required_field' type='text' name='{{ name }}' value="{{ caption.get_dc_field('Subject') is not none ? caption.get_dc_field('Subject').get_value(true, ' ') : ""}}"/>
|
||||
<input class='required_field' type='text' name='{{ name }}' value="{{ caption.get_dc_field('Subject') is not none ? caption.get_dc_field('Subject').get_serialized_values(' ') : ""}}"/>
|
||||
<br />
|
||||
{{ error_form.display_errors(name, constraint_errors) }}
|
||||
</td>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
{# This file MUST NOT CONTAINS trans tag #}
|
||||
|
||||
{% extends '/setup/wrapper.twig' %}
|
||||
{% extends '/setup/wrapper.html.twig' %}
|
||||
|
||||
{% macro constraint_format(constraint) %}
|
||||
{% if not constraint.is_ok() %}
|
@@ -1,4 +1,4 @@
|
||||
{% extends '/setup/wrapper.twig' %}
|
||||
{% extends '/setup/wrapper.html.twig' %}
|
||||
|
||||
{% block extrahead %}
|
||||
<script type="text/javascript">
|
@@ -1,4 +1,4 @@
|
||||
{% extends '/setup/wrapper.twig' %}
|
||||
{% extends '/setup/wrapper.html.twig' %}
|
||||
|
||||
{% block extrahead %}
|
||||
<script type="text/javascript">
|
@@ -44,7 +44,7 @@ switch ($parm['action'])
|
||||
$twig = $core->getTwig();
|
||||
|
||||
$search_engine = null;
|
||||
if (($options = unserialize($parm['options_serial'])) !== false)
|
||||
if ($parm['env'] == 'RESULT' && ($options = unserialize($parm['options_serial'])) !== false)
|
||||
{
|
||||
$search_engine = new searchEngine_adapter($registry);
|
||||
$search_engine->set_options($options);
|
||||
|
Reference in New Issue
Block a user