diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Description.php b/lib/Alchemy/Phrasea/Controller/Admin/Description.php index c01601ffcb..53944dcdac 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Description.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Description.php @@ -99,18 +99,6 @@ class Description implements ControllerProviderInterface $field->set_dces_element($dces_element); $field->save(); - if ($request->get('regname') == $field->get_id()) - { - $field->set_regname(); - } - if ($request->get('regdate') == $field->get_id()) - { - $field->set_regdate(); - } - if ($request->get('regdesc') == $field->get_id()) - { - $field->set_regdesc(); - } } catch (\Exception $e) { diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Story.php b/lib/Alchemy/Phrasea/Controller/Prod/Story.php index 6e31a2b06b..c5799f8834 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Story.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Story.php @@ -70,10 +70,8 @@ class Story implements ControllerProviderInterface foreach ($collection->get_databox()->get_meta_structure() as $meta) { - if ($meta->is_regname()) + if ($meta->get_thumbtitle()) $value = $request->get('name'); - elseif ($meta->is_regdesc()) - $value = $request->get('description'); else continue; diff --git a/lib/Alchemy/Phrasea/Helper/Record/Edit.php b/lib/Alchemy/Phrasea/Helper/Record/Edit.php index a3b43f14c7..dc66e919aa 100644 --- a/lib/Alchemy/Phrasea/Helper/Record/Edit.php +++ b/lib/Alchemy/Phrasea/Helper/Record/Edit.php @@ -441,8 +441,6 @@ class Edit extends RecordHelper break; } - $regfield = ($meta->is_regname() || $meta->is_regdesc() || $meta->is_regdate()); - $source = $meta->get_source(); $separator = $meta->get_separator(); @@ -460,7 +458,6 @@ class Edit extends RecordHelper , 'tbranch' => $meta->get_tbranch() , 'maxLength' => $source ? $source->maxlength() : 0 , 'minLength' => $source ? $source->minLength() : 0 - , 'regfield' => $regfield , 'multi' => $meta->is_multi() , 'separator' => $separator , 'vocabularyControl' => $meta->getVocabularyControl() ? $meta->getVocabularyControl()->getType() : null @@ -615,55 +612,6 @@ class Edit extends RecordHelper } return $this; - -// foreach ($trecchanges as $fname => $fchange) -// { -// $bool = false; -// if ($regfields && $parm['act_option'] == 'SAVEGRP' -// && $fname == $regfields['regname']) -// { -// try -// { -// $basket = basket_adapter::getInstance($parm['ssel']); -// $basket->name = implode(' ', $fchange['values']); -// $basket->save(); -// $bool = true; -// } -// catch (Exception $e) -// { -// echo $e->getMessage(); -// } -// } -// if ($regfields && $parm['act_option'] == 'SAVEGRP' -// && $fname == $regfields['regdesc']) -// { -// try -// { -// $basket = basket_adapter::getInstance($parm['ssel']); -// $basket->desc = implode(' ', $fchange['values']); -// $basket->save(); -// $bool = true; -// } -// catch (Exception $e) -// { -// echo $e->getMessage(); -// } -// } -// if ($bool) -// { -// try -// { -// $basket = basket_adapter::getInstance($parm['ssel']); -// $basket->delete_cache(); -// } -// catch (Exception $e) -// { -// -// } -// } -// } -// -// return $this; } } diff --git a/lib/classes/databox.class.php b/lib/classes/databox.class.php index 9f923c2e8b..4b25166763 100644 --- a/lib/classes/databox.class.php +++ b/lib/classes/databox.class.php @@ -991,13 +991,6 @@ class databox extends base { } - - if (isset($field['regname'])) - $meta_struct_field->set_regname(); - if (isset($field['regdate'])) - $meta_struct_field->set_regdate(); - if (isset($field['regdesc'])) - $meta_struct_field->set_regdesc(); } return $this; diff --git a/lib/classes/databox/field.class.php b/lib/classes/databox/field.class.php index afdabcc906..fc5cfa961c 100644 --- a/lib/classes/databox/field.class.php +++ b/lib/classes/databox/field.class.php @@ -98,24 +98,6 @@ class databox_field implements cache_cacheableInterface */ protected $thumbtitle; - /** - * - * @var - */ - protected $regdate; - - /** - * - * @var - */ - protected $regdesc; - - /** - * - * @var - */ - protected $regname; - /** * * @var int @@ -163,7 +145,7 @@ class databox_field implements cache_cacheableInterface $connbas = $this->get_connection(); - $sql = "SELECT `regdate`, `regdesc`, `regname`, `thumbtitle`, `separator` + $sql = "SELECT `thumbtitle`, `separator` , `dces_element`, `tbranch`, `type`, `report`, `multi`, `required` , `readonly`, `indexable`, `name`, `src` , `VocabularyControlType`, `RestrictToVocabularyControl` @@ -216,10 +198,6 @@ class databox_field implements cache_cacheableInterface $this->separator = $separator; $this->thumbtitle = $row['thumbtitle']; - $this->regdesc = !!$row['regdesc']; - $this->regname = !!$row['regname']; - $this->regdate = !!$row['regdate']; - return $this; } @@ -621,39 +599,6 @@ class databox_field implements cache_cacheableInterface return $this; } - /** - * - * @return databox_field - */ - public function set_regdate() - { - $this->set_reg_attr('date'); - - return $this; - } - - /** - * - * @return databox_field - */ - public function set_regdesc() - { - $this->set_reg_attr('desc'); - - return $this; - } - - /** - * - * @return databox_field - */ - public function set_regname() - { - $this->set_reg_attr('name'); - - return $this; - } - /** * * @param string $attr @@ -683,33 +628,6 @@ class databox_field implements cache_cacheableInterface return $this; } - /** - * - * @return boolean - */ - public function is_regname() - { - return $this->regname; - } - - /** - * - * @return boolean - */ - public function is_regdesc() - { - return $this->regdesc; - } - - /** - * - * @return boolean - */ - public function is_regdate() - { - return $this->regdate; - } - /** * * @return string @@ -870,7 +788,7 @@ class databox_field implements cache_cacheableInterface $sql = "INSERT INTO metadatas_structure (`id`, `name`, `src`, `readonly`, `indexable`, `type`, `tbranch`, - `thumbtitle`, `multi`, `regname`, `regdesc`, `regdate` , + `thumbtitle`, `multi`, `report`, `sorter`) VALUES (null, :name, '', 0, 1, 'text', '', null, 0, null, null, null, diff --git a/lib/classes/record/Interface.class.php b/lib/classes/record/Interface.class.php index 5583384643..69678b155b 100644 --- a/lib/classes/record/Interface.class.php +++ b/lib/classes/record/Interface.class.php @@ -95,8 +95,6 @@ interface record_Interface public function set_binary_status($status); - public function get_reg_name(); - public function get_hd_file(); public function delete(); diff --git a/lib/classes/record/adapter.class.php b/lib/classes/record/adapter.class.php index 177348f54a..bd8d3323d1 100644 --- a/lib/classes/record/adapter.class.php +++ b/lib/classes/record/adapter.class.php @@ -140,8 +140,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface const CACHE_GROUPING = 'grouping'; const CACHE_STATUS = 'status'; - protected static $_regfields; - /** * * @param $base_id @@ -895,16 +893,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface */ public function get_title($highlight = false, searchEngine_adapter $searchEngine = null) { - $sbas_id = $this->get_sbas_id(); - $record_id = $this->get_record_id(); - - if ($this->is_grouping()) - { - $regfield = self::getRegFields($sbas_id, $this->get_caption()); - - return $regfield['regname']; - } - $title = ''; $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); @@ -944,98 +932,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface return $title; } - public function get_description() - { - - if (!$this->is_grouping()) - throw new \Exception('This record is not a story'); - - $regfield = self::getRegFields($this->get_sbas_id(), $this->get_caption()); - - return $regfield['regdesc']; - } - - /** - * - * @param $sbas_id - * @param caption_record $desc - * @return - */ - protected static function getRegFields($sbas_id, caption_record $desc) - { - if (!self::$_regfields) - self::load_regfields(); - - $arrayRegFields = self::$_regfields[$sbas_id]; - - $array = array(); - - foreach ($arrayRegFields as $k => $f) - { - $array[$f] = $k; - } - - $fields = array(); - $fields["regname"] = ""; - $fields["regdesc"] = ""; - $fields["regdate"] = ""; - - 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_serialized_values(); - } - } - - return $fields; - } - - /** - * get databox reg fields - * - * @todo change this shit - * @return array - */ - protected static function load_regfields() - { - $appbox = appbox::get_instance(\bootstrap::getCore()); - self::$_regfields = array(); - foreach ($appbox->get_databoxes() as $databox) - { - self::$_regfields[$databox->get_sbas_id()] = self::searchRegFields($databox->get_meta_structure()); - } - - return self::$_regfields; - } - - /** - * - * @param databox_descriptionStructure $meta_struct - * @return - */ - protected function searchRegFields(databox_descriptionStructure $meta_struct) - { - $fields = null; - $fields["regname"] = ""; - $fields["regdesc"] = ""; - $fields["regdate"] = ""; - - foreach ($meta_struct as $meta) - { - if ($meta->is_regname()) - $fields["regname"] = $meta->get_id(); - elseif ($meta->is_regdesc()) - $fields["regdesc"] = $meta->get_id(); - elseif ($meta->is_regdate()) - $fields['regdate'] = $meta->get_id(); - } - - return $fields; - } - /** * * @return media_subdef @@ -1487,42 +1383,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface return $this; } - /** - * - * @return string - */ - public function get_reg_name() - { - if (!$this->is_grouping()) - { - return false; - } - - $balisename = ''; - - $struct = $this->databox->get_structure(); - - if ($sxe = simplexml_load_string($struct)) - { - $z = $sxe->xpath('/record/description'); - if ($z && is_array($z)) - { - foreach ($z[0] as $ki => $vi) - { - if ($vi['regname'] == '1') - { - $balisename = $ki; - break; - } - } - } - } - $regname = ''; - if ($sxe = simplexml_load_string($this->get_xml())) - $regname = (string) $sxe->description->$balisename; - - return $regname; - } /** * diff --git a/lib/conf.d/bases_structure.xml b/lib/conf.d/bases_structure.xml index e3ec3251d1..43916d96ad 100644 --- a/lib/conf.d/bases_structure.xml +++ b/lib/conf.d/bases_structure.xml @@ -5160,30 +5160,6 @@ - - regdate - tinyint(1) unsigned - YES - - - - - - regname - tinyint(1) unsigned - YES - - - - - - regdesc - tinyint(1) unsigned - YES - - - - report tinyint(1) unsigned @@ -5261,27 +5237,6 @@ required - - regname - UNIQUE - - regname - - - - regdate - UNIQUE - - regdate - - - - regdesc - UNIQUE - - regdesc - - sorter UNIQUE diff --git a/lib/conf.d/data_templates/en-simple.xml b/lib/conf.d/data_templates/en-simple.xml index b483b3fdc4..1602fc3170 100644 --- a/lib/conf.d/data_templates/en-simple.xml +++ b/lib/conf.d/data_templates/en-simple.xml @@ -149,7 +149,7 @@ - + @@ -170,7 +170,7 @@ - + @@ -179,7 +179,7 @@ - + diff --git a/lib/conf.d/data_templates/fr-simple.xml b/lib/conf.d/data_templates/fr-simple.xml index e2fa5ff18c..f8c5a5ab2a 100755 --- a/lib/conf.d/data_templates/fr-simple.xml +++ b/lib/conf.d/data_templates/fr-simple.xml @@ -149,7 +149,7 @@ - + @@ -170,7 +170,7 @@ - + @@ -179,7 +179,7 @@ - + diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/DescriptionTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/DescriptionTest.php index 0eb1821071..6fdeb3459d 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/DescriptionTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/DescriptionTest.php @@ -59,9 +59,6 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract , 'readonly_' . $id => 0 , 'type_' . $id => 'string' , 'vocabulary_' . $id => 'User' - , 'regname' => $id - , 'regdate' => $id - , 'regdesc' => $id )); $this->assertTrue($this->client->getResponse()->isRedirect()); @@ -149,9 +146,6 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract , 'readonly_' . $id => 0 , 'type_' . $id => 'string' , 'vocabulary_' . $id => 'Unknow_Vocabulary' - , 'regname' => $id - , 'regdate' => $id - , 'regdesc' => $id )); $this->assertTrue($this->client->getResponse()->isRedirect()); @@ -169,9 +163,6 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract , 'readonly_' . $id => 0 , 'type_' . $id => 'string' , 'vocabulary_' . $id => 'Unknow_Vocabulary' - , 'regname' => $id - , 'regdate' => $id - , 'regdesc' => $id )); $this->assertTrue($this->client->getResponse()->isRedirect()); @@ -194,9 +185,6 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract , 'readonly_' . $id => 0 , 'type_' . $id => 'string' , 'vocabulary_' . $id => 'Unknow_Vocabulary' - , 'regname' => $id - , 'regdate' => $id - , 'regdesc' => $id )); $this->assertTrue($this->client->getResponse()->isRedirect()); @@ -220,9 +208,6 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract , 'readonly_' . $id => 0 , 'type_' . $id => 'string' , 'vocabulary_' . $id => 'Unknow_Vocabulary' - , 'regname' => $id - , 'regdate' => $id - , 'regdesc' => $id )); $this->assertTrue($this->client->getResponse()->isRedirect()); @@ -251,9 +236,6 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract , 'readonly_' . $id => 0 , 'type_' . $id => 'string' , 'vocabulary_' . $id => 'User' - , 'regname' => $id - , 'regdate' => $id - , 'regdesc' => $id )); $this->assertTrue($this->client->getResponse()->isOk()); $this->assertEquals("You are not allowed to access this zone", $this->client->getResponse()->getContent()); diff --git a/lib/unitTest/databox/databox_fieldTest.php b/lib/unitTest/databox/databox_fieldTest.php index 1a168ad51c..4bab73b927 100644 --- a/lib/unitTest/databox/databox_fieldTest.php +++ b/lib/unitTest/databox/databox_fieldTest.php @@ -300,72 +300,6 @@ class databox_fieldTest extends PhraseanetPHPUnitAbstract ); } - /** - * @todo Implement testSet_regdate(). - */ - public function testSet_regdate() - { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } - - /** - * @todo Implement testSet_regdesc(). - */ - public function testSet_regdesc() - { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } - - /** - * @todo Implement testSet_regname(). - */ - public function testSet_regname() - { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } - - /** - * @todo Implement testIs_regname(). - */ - public function testIs_regname() - { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } - - /** - * @todo Implement testIs_regdesc(). - */ - public function testIs_regdesc() - { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } - - /** - * @todo Implement testIs_regdate(). - */ - public function testIs_regdate() - { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } - /** * @todo Implement testGet_thumbtitle(). */ diff --git a/lib/unitTest/record/adapterTest.php b/lib/unitTest/record/adapterTest.php index e40721651b..1546aaf5f1 100644 --- a/lib/unitTest/record/adapterTest.php +++ b/lib/unitTest/record/adapterTest.php @@ -468,11 +468,6 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract ); } - public function testGet_reg_name() - { - $this->assertTrue(is_string(self::$story_1->get_reg_name())); - } - public function testGet_record_by_sha() { $tmp_records = record_adapter::get_record_by_sha(self::$record_1->get_sbas_id(), self::$record_1->get_sha256()); diff --git a/templates/web/admin/databox/doc_structure.twig b/templates/web/admin/databox/doc_structure.twig index d6004cfa00..b492435e6a 100644 --- a/templates/web/admin/databox/doc_structure.twig +++ b/templates/web/admin/databox/doc_structure.twig @@ -281,15 +281,6 @@ {% trans 'Affiche dans report' %} - - Regdate - - - Regname - - - Regdesc - {% trans 'Afficher en titre' %} @@ -363,15 +354,6 @@ - - - - - - - - -