mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
PHRAS-368 #time 3d
wip
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Core\Event\Thesaurus;
|
||||
|
||||
|
||||
class CandidateAccepted extends ThesaurusEvent
|
||||
{
|
||||
private $new_id;
|
||||
|
||||
public function __construct(\databox $databox, $new_id)
|
||||
{
|
||||
parent::__construct($databox);
|
||||
$this->new_id = $new_id;
|
||||
}
|
||||
|
||||
public function getID()
|
||||
{
|
||||
return $this->new_id;
|
||||
}
|
||||
}
|
36
lib/Alchemy/Phrasea/Core/Event/Thesaurus/ConceptDeleted.php
Normal file
36
lib/Alchemy/Phrasea/Core/Event/Thesaurus/ConceptDeleted.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Core\Event\Thesaurus;
|
||||
|
||||
|
||||
class ConceptDeleted extends ThesaurusEvent
|
||||
{
|
||||
private $parent_id; // the former parent
|
||||
private $deleted_synonyms; // the former synonyms (deleted)
|
||||
|
||||
public function __construct(\databox $databox, $parent_id, array $deleted_synonyms)
|
||||
{
|
||||
parent::__construct($databox);
|
||||
$this->parent_id = $parent_id;
|
||||
$this->deleted_synonyms = $deleted_synonyms;
|
||||
}
|
||||
|
||||
public function getParentID()
|
||||
{
|
||||
return $this->parent_id;
|
||||
}
|
||||
|
||||
public function getSynonyms()
|
||||
{
|
||||
return $this->deleted_synonyms;
|
||||
}
|
||||
}
|
17
lib/Alchemy/Phrasea/Core/Event/Thesaurus/FieldLinked.php
Normal file
17
lib/Alchemy/Phrasea/Core/Event/Thesaurus/FieldLinked.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Core\Event\Thesaurus;
|
||||
|
||||
|
||||
class FieldLinked extends ThesaurusEvent
|
||||
{
|
||||
}
|
17
lib/Alchemy/Phrasea/Core/Event/Thesaurus/Imported.php
Normal file
17
lib/Alchemy/Phrasea/Core/Event/Thesaurus/Imported.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Core\Event\Thesaurus;
|
||||
|
||||
|
||||
class Imported extends ThesaurusEvent
|
||||
{
|
||||
}
|
30
lib/Alchemy/Phrasea/Core/Event/Thesaurus/ItemAdded.php
Normal file
30
lib/Alchemy/Phrasea/Core/Event/Thesaurus/ItemAdded.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Core\Event\Thesaurus;
|
||||
|
||||
|
||||
class ItemAdded extends ThesaurusEvent
|
||||
{
|
||||
private $new_id; // the new id
|
||||
|
||||
public function __construct(\databox $databox, $new_id)
|
||||
{
|
||||
parent::__construct($databox);
|
||||
$this->new_id = $new_id;
|
||||
}
|
||||
|
||||
public function getID()
|
||||
{
|
||||
return $this->new_id;
|
||||
}
|
||||
|
||||
}
|
36
lib/Alchemy/Phrasea/Core/Event/Thesaurus/ItemTrashed.php
Normal file
36
lib/Alchemy/Phrasea/Core/Event/Thesaurus/ItemTrashed.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Core\Event\Thesaurus;
|
||||
|
||||
|
||||
class ItemTrashed extends ThesaurusEvent
|
||||
{
|
||||
private $parent_id; // the former parent
|
||||
private $trash_id; // the new id in cterms
|
||||
|
||||
public function __construct(\databox $databox, $parent_id, $trash_id)
|
||||
{
|
||||
parent::__construct($databox);
|
||||
$this->parent_id = $parent_id;
|
||||
$this->trash_id = $trash_id;
|
||||
}
|
||||
|
||||
public function getParentID()
|
||||
{
|
||||
return $this->parent_id;
|
||||
}
|
||||
|
||||
public function getNewID()
|
||||
{
|
||||
return $this->trash_id;
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Core\Event\Thesaurus;
|
||||
|
||||
|
||||
class SynonymLngChanged extends ThesaurusEvent
|
||||
{
|
||||
private $synonym_id;
|
||||
|
||||
public function __construct(\databox $databox, $synonym_id)
|
||||
{
|
||||
parent::__construct($databox);
|
||||
$this->synonym_id = $synonym_id;
|
||||
}
|
||||
|
||||
public function getID()
|
||||
{
|
||||
return $this->synonym_id;
|
||||
}
|
||||
}
|
47
lib/Alchemy/Phrasea/Core/Event/Thesaurus/SynonymParm.php
Normal file
47
lib/Alchemy/Phrasea/Core/Event/Thesaurus/SynonymParm.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Core\Event\Thesaurus;
|
||||
|
||||
/**
|
||||
* Class SynonymParm
|
||||
* @package Alchemy\Phrasea\Core\Event\Thesaurus
|
||||
*
|
||||
* a small object passed as parameter to thesaurus events.
|
||||
* usefull when the synonym does not exists anymore in the thesaurus (after deletion)
|
||||
*/
|
||||
class SynonymParm
|
||||
{
|
||||
private $value; // as the <sy> 'v' attribute in xml
|
||||
private $lng; // the 'lng' attribute
|
||||
|
||||
public function __construct($value, $lng)
|
||||
{
|
||||
$this->value = $value;
|
||||
$this->lng = $lng;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \string
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \string
|
||||
*/
|
||||
public function getLng()
|
||||
{
|
||||
return $this->lng;
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Core\Event\Thesaurus;
|
||||
|
||||
|
||||
class SynonymPositionChanged extends ThesaurusEvent
|
||||
{
|
||||
private $synonym_id;
|
||||
|
||||
public function __construct(\databox $databox, $synonym_id)
|
||||
{
|
||||
parent::__construct($databox);
|
||||
$this->synonym_id = $synonym_id;
|
||||
}
|
||||
|
||||
public function getID()
|
||||
{
|
||||
return $this->synonym_id;
|
||||
}
|
||||
}
|
32
lib/Alchemy/Phrasea/Core/Event/Thesaurus/ThesaurusEvent.php
Normal file
32
lib/Alchemy/Phrasea/Core/Event/Thesaurus/ThesaurusEvent.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Core\Event\Thesaurus;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
|
||||
abstract class ThesaurusEvent extends Event
|
||||
{
|
||||
private $databox;
|
||||
|
||||
public function __construct(\databox $databox)
|
||||
{
|
||||
$this->databox = $databox;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \databox
|
||||
*/
|
||||
public function getDatabox()
|
||||
{
|
||||
return $this->databox;
|
||||
}
|
||||
}
|
@@ -50,4 +50,16 @@ final class PhraseaEvents
|
||||
|
||||
const RECORD_EDIT = 'record.edit';
|
||||
const RECORD_UPLOAD = 'record.upload';
|
||||
|
||||
const THESAURUS_IMPORTED = 'thesaurus.imported';
|
||||
const THESAURUS_FIELD_LINKED = 'thesaurus.field-linked';
|
||||
const THESAURUS_CANDIDATE_ACCEPTED_AS_CONCEPT = 'thesaurus.candidate-accepted-as-concept';
|
||||
const THESAURUS_CANDIDATE_ACCEPTED_AS_SYNONYM = 'thesaurus.candidate-accepted-as-synonym';
|
||||
const THESAURUS_SYNONYM_LNG_CHANGED = 'thesaurus.synonym-lng-changed';
|
||||
const THESAURUS_SYNONYM_POSITION_CHANGED = 'thesaurus.synonym-position-changed';
|
||||
const THESAURUS_SYNONYM_TRASHED = 'thesaurus.synonym-trashed';
|
||||
const THESAURUS_CONCEPT_TRASHED = 'thesaurus.concept-trashed';
|
||||
const THESAURUS_CONCEPT_DELETED = 'thesaurus.concept-deleted';
|
||||
const THESAURUS_SYNONYM_ADDED = 'thesaurus.synonym-added';
|
||||
const THESAURUS_CONCEPT_ADDED = 'thesaurus.concept-added';
|
||||
}
|
||||
|
@@ -57,11 +57,7 @@
|
||||
{% else %}
|
||||
{% if nb_candidates_bad > 0 %}
|
||||
// present dans les candidats, mais aucun champ acceptable : on informe
|
||||
{% if nb_candidates_bad == 1 %}
|
||||
{% set prop_label = 'thesaurus:: est candidat en provenance des champs mais ne peut etre accepte a cet emplacement du thesaurus' | trans %}
|
||||
{% else %}
|
||||
{% set prop_label = 'thesaurus:: est candidat en provenance des champs mais ne peut etre accepte a cet emplacement du thesaurus' | trans %}
|
||||
{% endif %}
|
||||
{% set prop_label = 'thesaurus:: est candidat en provenance des champs mais ne peut etre accepte a cet emplacement du thesaurus' | trans %}
|
||||
{% else %}
|
||||
// pas present dans les candidats
|
||||
{% set prop_label = 'thesaurus:: n\'est pas present dans les candidats' | trans %}
|
||||
|
Reference in New Issue
Block a user