mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 05:23:21 +00:00
Update substitution
This commit is contained in:
@@ -11,9 +11,10 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\Helper\Record;
|
namespace Alchemy\Phrasea\Helper\Record;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Core,
|
use Alchemy\Phrasea\Core;
|
||||||
Alchemy\Phrasea\Helper\Record\Helper as RecordHelper,
|
use Alchemy\Phrasea\Helper\Record\Helper as RecordHelper;
|
||||||
Symfony\Component\HttpFoundation\Request;
|
use MediaVorus\MediaVorus;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit Record Helper
|
* Edit Record Helper
|
||||||
@@ -401,7 +402,6 @@ class Edit extends RecordHelper
|
|||||||
{
|
{
|
||||||
$i = count($this->javascript_fields);
|
$i = count($this->javascript_fields);
|
||||||
|
|
||||||
$source = $meta->get_source();
|
|
||||||
$separator = $meta->get_separator();
|
$separator = $meta->get_separator();
|
||||||
|
|
||||||
$datas = array(
|
$datas = array(
|
||||||
@@ -416,8 +416,8 @@ class Edit extends RecordHelper
|
|||||||
, 'format' => ''
|
, 'format' => ''
|
||||||
, 'explain' => ''
|
, 'explain' => ''
|
||||||
, 'tbranch' => $meta->get_tbranch()
|
, 'tbranch' => $meta->get_tbranch()
|
||||||
, 'maxLength' => $source ? $source->maxlength() : 0
|
, 'maxLength' => $meta->get_tag()->getMaxLength()
|
||||||
, 'minLength' => $source ? $source->minLength() : 0
|
, 'minLength' => $meta->get_tag()->getMinLength()
|
||||||
, 'multi' => $meta->is_multi()
|
, 'multi' => $meta->is_multi()
|
||||||
, 'separator' => $separator
|
, 'separator' => $separator
|
||||||
, 'vocabularyControl' => $meta->getVocabularyControl() ? $meta->getVocabularyControl()->getType() : null
|
, 'vocabularyControl' => $meta->getVocabularyControl() ? $meta->getVocabularyControl()->getType() : null
|
||||||
@@ -450,9 +450,8 @@ class Edit extends RecordHelper
|
|||||||
throw new \Exception('A reg image must come from image data');
|
throw new \Exception('A reg image must come from image data');
|
||||||
|
|
||||||
foreach ($newsubdef_reg->get_subdefs() as $name => $value) {
|
foreach ($newsubdef_reg->get_subdefs() as $name => $value) {
|
||||||
$pathfile = $value->get_pathfile();
|
$media = MediaVorus::guess(new \SplFileInfo($value->get_pathfile()));
|
||||||
$system_file = new \system_file($pathfile);
|
$reg_record->substitute_subdef($name, $media);
|
||||||
$reg_record->substitute_subdef($name, $system_file);
|
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
@@ -469,8 +468,9 @@ class Edit extends RecordHelper
|
|||||||
$write_edit_el = false;
|
$write_edit_el = false;
|
||||||
$date_obj = new \DateTime();
|
$date_obj = new \DateTime();
|
||||||
foreach ($meta_struct->get_elements() as $meta_struct_el) {
|
foreach ($meta_struct->get_elements() as $meta_struct_el) {
|
||||||
if ($meta_struct_el->get_metadata_namespace() == "PHRASEANET" && $meta_struct_el->get_metadata_tagname() == 'tf-editdate')
|
if ($meta_struct_el->get_tag() instanceof \Alchemy\Phrasea\Metadata\Tag\TfEditdate) {
|
||||||
$write_edit_el = $meta_struct_el;
|
$write_edit_el = $meta_struct_el;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$elements = $this->selection->get_elements();
|
$elements = $this->selection->get_elements();
|
||||||
|
Reference in New Issue
Block a user