Merge branch '3.8'

Conflicts:
	composer.lock
	lib/Alchemy/Phrasea/Core/Version.php
This commit is contained in:
Romain Neutron
2013-11-08 19:04:26 +01:00
68 changed files with 250 additions and 158 deletions

View File

@@ -41,6 +41,7 @@
"themattharris/tmhoauth" : "~0.7", "themattharris/tmhoauth" : "~0.7",
"twig/twig" : "~1.14, >=1.14.2", "twig/twig" : "~1.14, >=1.14.2",
"twig/extensions" : "~1.0", "twig/extensions" : "~1.0",
"vierbergenlars/php-semver" : "~2.1",
"zend/gdata" : "~1.12.1" "zend/gdata" : "~1.12.1"
}, },
"require-dev": { "require-dev": {

View File

@@ -17,6 +17,7 @@ use Alchemy\Phrasea\Exception\RuntimeException;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputOption;
use vierbergenlars\SemVer\version;
class BowerInstall extends Command class BowerInstall extends Command
{ {
@@ -42,7 +43,7 @@ class BowerInstall extends Command
$version = trim($bower->command('-v')); $version = trim($bower->command('-v'));
if (!version_compare('1.0.0-alpha.1', $version, '<=')) { if (version::lt($version, '1.0.0-alpha.1')) {
throw new RuntimeException(sprintf( throw new RuntimeException(sprintf(
'Bower version 1.0.0-alpha.1 is required (version %s provided), please install bower-canary : `npm install -g bower-canary or run npm install from root directory`', $version 'Bower version 1.0.0-alpha.1 is required (version %s provided), please install bower-canary : `npm install -g bower-canary or run npm install from root directory`', $version
)); ));

View File

@@ -17,6 +17,7 @@ use Alchemy\Phrasea\Command\Upgrade\Step35;
use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use vierbergenlars\SemVer\version;
/** /**
* *
@@ -69,7 +70,7 @@ EOF
if (null !== $input->getOption('from')) { if (null !== $input->getOption('from')) {
foreach ($versions as $classname => $version) { foreach ($versions as $classname => $version) {
if (version_compare($input->getOption('from'), $version) > 0) { if (version::lt($version, $input->getOption('from'))) {
continue; continue;
} }

View File

@@ -18,7 +18,7 @@ namespace Alchemy\Phrasea\Core;
*/ */
class Version class Version
{ {
protected static $number = '3.9.0.a8'; protected static $number = '3.9.0-alpha.8';
protected static $name = 'Epanterias'; protected static $name = 'Epanterias';
public static function getNumber() public static function getNumber()

View File

@@ -15,7 +15,8 @@ use Alchemy\Phrasea\Application;
use JsonSchema\Validator as JsonValidator; use JsonSchema\Validator as JsonValidator;
use Alchemy\Phrasea\Exception\InvalidArgumentException; use Alchemy\Phrasea\Exception\InvalidArgumentException;
use Alchemy\Phrasea\Plugin\Exception\JsonValidationException; use Alchemy\Phrasea\Plugin\Exception\JsonValidationException;
use Alchemy\Phrasea\Core\Version; use Alchemy\Phrasea\Core\Version as PhraseaVersion;
use vierbergenlars\SemVer\version;
class ManifestValidator class ManifestValidator
{ {
@@ -23,7 +24,7 @@ class ManifestValidator
private $version; private $version;
private $schemaData; private $schemaData;
public function __construct(JsonValidator $validator, $schemaData, Version $version) public function __construct(JsonValidator $validator, $schemaData, PhraseaVersion $version)
{ {
if (!is_object($schemaData)) { if (!is_object($schemaData)) {
throw new InvalidArgumentException('Json Schema must be an object'); throw new InvalidArgumentException('Json Schema must be an object');
@@ -56,7 +57,7 @@ class ManifestValidator
} }
if (isset($data->{'minimum-phraseanet-version'})) { if (isset($data->{'minimum-phraseanet-version'})) {
if (true !== version_compare($this->version->getNumber(), $data->{'minimum-phraseanet-version'}, '>=')) { if (version::lt($this->version->getNumber(), $data->{'minimum-phraseanet-version'})) {
throw new JsonValidationException(sprintf( throw new JsonValidationException(sprintf(
'Version incomptibility : Minimum Phraseanet version required is %s, current version is %s', 'Version incomptibility : Minimum Phraseanet version required is %s, current version is %s',
$data->{'minimum-phraseanet-version'}, $data->{'minimum-phraseanet-version'},
@@ -66,7 +67,7 @@ class ManifestValidator
} }
if (isset($data->{'maximum-phraseanet-version'})) { if (isset($data->{'maximum-phraseanet-version'})) {
if (true !== version_compare($this->version->getNumber(), $data->{'maximum-phraseanet-version'}, '<')) { if (version::gte($this->version->getNumber(), $data->{'maximum-phraseanet-version'})) {
throw new JsonValidationException(sprintf( throw new JsonValidationException(sprintf(
'Version incomptibility : Maximum Phraseanet version required is %s, current version is %s', 'Version incomptibility : Maximum Phraseanet version required is %s, current version is %s',
$data->{'maximum-phraseanet-version'}, $data->{'maximum-phraseanet-version'},

View File

@@ -27,6 +27,7 @@ use Alchemy\Phrasea\Setup\Probe\PhraseaProbe;
use Alchemy\Phrasea\Setup\Probe\SearchEngineProbe; use Alchemy\Phrasea\Setup\Probe\SearchEngineProbe;
use Alchemy\Phrasea\Setup\Probe\SubdefsPathsProbe; use Alchemy\Phrasea\Setup\Probe\SubdefsPathsProbe;
use Alchemy\Phrasea\Setup\Probe\SystemProbe; use Alchemy\Phrasea\Setup\Probe\SystemProbe;
use vierbergenlars\SemVer\version;
class ConfigurationTester class ConfigurationTester
{ {
@@ -109,11 +110,11 @@ class ConfigurationTester
return false; return false;
} }
$upgradable = version_compare($this->app['phraseanet.appbox']->get_version(), $this->app['phraseanet.version']->getNumber(), ">"); $upgradable = version::lt($this->app['phraseanet.appbox']->get_version(), $this->app['phraseanet.version']->getNumber());
if (!$upgradable) { if (!$upgradable) {
foreach ($this->app['phraseanet.appbox']->get_databoxes() as $databox) { foreach ($this->app['phraseanet.appbox']->get_databoxes() as $databox) {
if (version_compare($databox->get_version(), $this->app['phraseanet.version']->getNumber(), "<")) { if (version::lt($databox->get_version(), $this->app['phraseanet.version']->getNumber())) {
$upgradable = true; $upgradable = true;
break; break;
} }

View File

@@ -16,6 +16,7 @@ use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\File\File as SymfoFile; use Symfony\Component\HttpFoundation\File\File as SymfoFile;
use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use vierbergenlars\SemVer\version;
/** /**
* *
@@ -389,13 +390,13 @@ class appbox extends base
$upgrader->add_steps_complete(1); $upgrader->add_steps_complete(1);
if (version_compare($from_version, '3.1') < 0) { if (version::lt($from_version, '3.1')) {
$upgrader->addRecommendation(_('Your install requires data migration, please execute the following command'), 'bin/setup system:upgrade-datas --from=3.1'); $upgrader->addRecommendation(_('Your install requires data migration, please execute the following command'), 'bin/setup system:upgrade-datas --from=3.1');
} elseif (version_compare($from_version, '3.5') < 0) { } elseif (version::lt($from_version, '3.5')) {
$upgrader->addRecommendation(_('Your install requires data migration, please execute the following command'), 'bin/setup system:upgrade-datas --from=3.5'); $upgrader->addRecommendation(_('Your install requires data migration, please execute the following command'), 'bin/setup system:upgrade-datas --from=3.5');
} }
if (version_compare($from_version, '3.7') < 0) { if (version::lt($from_version, '3.7')) {
$upgrader->addRecommendation(_('Your install might need to re-read technical datas'), 'bin/console records:rescan-technical-datas'); $upgrader->addRecommendation(_('Your install might need to re-read technical datas'), 'bin/console records:rescan-technical-datas');
$upgrader->addRecommendation(_('Your install might need to build some sub-definitions'), 'bin/console records:build-missing-subdefs'); $upgrader->addRecommendation(_('Your install might need to build some sub-definitions'), 'bin/console records:build-missing-subdefs');
} }

View File

@@ -10,7 +10,8 @@
*/ */
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Core\Version; use Alchemy\Phrasea\Core\Version as PhraseaVersion;
use vierbergenlars\SemVer\version;
abstract class base implements cache_cacheableInterface abstract class base implements cache_cacheableInterface
{ {
@@ -347,7 +348,7 @@ abstract class base implements cache_cacheableInterface
return $recommends; return $recommends;
} }
protected function setVersion(Version $version) protected function setVersion(PhraseaVersion $version)
{ {
try { try {
$sql = ''; $sql = '';
@@ -773,7 +774,7 @@ abstract class base implements cache_cacheableInterface
protected function apply_patches($from, $to, $post_process, Setup_Upgrade $upgrader, Application $app) protected function apply_patches($from, $to, $post_process, Setup_Upgrade $upgrader, Application $app)
{ {
if (version_compare($from, $to, '=')) { if (version::eq($from, $to)) {
return true; return true;
} }
@@ -799,7 +800,12 @@ abstract class base implements cache_cacheableInterface
if ( ! ! $post_process !== ! ! $patch->require_all_upgrades()) if ( ! ! $post_process !== ! ! $patch->require_all_upgrades())
continue; continue;
if ( ! version_compare($patch->get_release(), $from, '>') || ! version_compare($patch->get_release(), $to, '<=')) { // if patch is older than current install
if (version::lte($patch->get_release(), $from)) {
continue;
}
// if patch is new than current target
if (version::gt($patch->get_release(), $to)) {
continue; continue;
} }

View File

@@ -17,13 +17,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_320 implements patchInterface class patch_320alpha1a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.2.0.0.a1'; private $release = '3.2.0-alpha.1';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_320ab implements patchInterface class patch_320alpha1b implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.2.0.0.a1'; private $release = '3.2.0-alpha.1';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_320a implements patchInterface class patch_320alpha2a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.2.0.0.a2'; private $release = '3.2.0-alpha.2';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_320b implements patchInterface class patch_320alpha3a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.2.0.0.a3'; private $release = '3.2.0-alpha.3';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_320c implements patchInterface class patch_320alpha4a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.2.0.0.a4'; private $release = '3.2.0-alpha.4';
/** /**
* *

View File

@@ -22,13 +22,13 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_320f implements patchInterface class patch_320alpha4b implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.2.0.0.a4'; private $release = '3.2.0-alpha.4';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_320d implements patchInterface class patch_320alpha5a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.2.0.0.a5'; private $release = '3.2.0-alpha.5';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_320e implements patchInterface class patch_320alpha6a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.2.0.0.a6'; private $release = '3.2.0-alpha.6';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_320h implements patchInterface class patch_320alpha8a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.2.0.0.a8'; private $release = '3.2.0-alpha.8';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_360 implements patchInterface class patch_360alpha1a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.6.0.a1'; private $release = '3.6.0-alpha.1';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_3602 implements patchInterface class patch_360alpha1b implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.6.0.a1'; private $release = '3.6.0-alpha.1';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_3603 implements patchInterface class patch_360alpha2a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.6.0.a2'; private $release = '3.6.0-alpha.2';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_3604 implements patchInterface class patch_360alpha2b implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.6.0.a2'; private $release = '3.6.0-alpha.2';
/** /**
* *

View File

@@ -17,13 +17,13 @@ use Doctrine\ORM\Tools\Pagination\Paginator;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_361 implements patchInterface class patch_361alpha1a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.6.1'; private $release = '3.6.1-alpha.1';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_370 implements patchInterface class patch_370alpha1a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.7.0.a2'; private $release = '3.7.0-alpha.1';
/** /**
* *

View File

@@ -17,13 +17,13 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_370a3 implements patchInterface class patch_370alpha3a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.7.0.a3'; private $release = '3.7.0-alpha.3';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_370a4 implements patchInterface class patch_370alpha4a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.7.0.a4'; private $release = '3.7.0-alpha.4';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_370a5 implements patchInterface class patch_370alpha5a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.7.0.a5'; private $release = '3.7.0-alpha.5';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_370a6 implements patchInterface class patch_370alpha6a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.7.0.a6'; private $release = '3.7.0-alpha.6';
/** /**
* *

View File

@@ -20,13 +20,13 @@ use MediaAlchemyst\Specification\Image as ImageSpec;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_370a7 implements patchInterface class patch_370alpha7a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.7.0.a7'; private $release = '3.7.0-alpha.7';
/** /**
* *

View File

@@ -17,13 +17,13 @@ use Alchemy\Phrasea\Model\Entities\Task;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_370a8 implements patchInterface class patch_370alpha8a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.7.0.a8'; private $release = '3.7.0-alpha.8';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_370a9 implements patchInterface class patch_370alpha9a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.7.0.a9'; private $release = '3.7.0-alpha.9';
/** /**
* *

View File

@@ -12,12 +12,12 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class patch_3715 implements patchInterface class patch_3715alpha1a implements patchInterface
{ {
/** /**
* @var string * @var string
*/ */
private $release = '3.7.15'; private $release = '3.7.15-alpha1';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_371 implements patchInterface class patch_371alpha1a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.7.1'; private $release = '3.7.1-alpha1';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_373 implements patchInterface class patch_373alpha1a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.7.3'; private $release = '3.7.3-alpha1';
/** /**
* *

View File

@@ -11,13 +11,13 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
class patch_379 implements patchInterface class patch_379alpha1a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.7.9'; private $release = '3.7.9-alpha1';
/** /**
* *

View File

@@ -11,10 +11,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
class patch_3810 implements patchInterface class patch_380alpha10a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.0.a10'; private $release = '3.8.0-alpha.10';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -13,10 +13,10 @@ use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Model\Entities\Session; use Alchemy\Phrasea\Model\Entities\Session;
use Alchemy\Phrasea\Model\Entities\SessionModule; use Alchemy\Phrasea\Model\Entities\SessionModule;
class patch_3811 implements patchInterface class patch_380alpha11a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.0.a11'; private $release = '3.8.0-alpha.11';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -11,10 +11,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
class patch_3813 implements patchInterface class patch_380alpha13a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.0.a13'; private $release = '3.8.0-alpha.13';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -11,10 +11,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
class patch_3814 implements patchInterface class patch_380alpha14a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.0.a14'; private $release = '3.8.0-alpha.14';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -11,10 +11,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
class patch_3815 implements patchInterface class patch_380alpha15a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.0.a15'; private $release = '3.8.0-alpha.15';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -11,10 +11,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
class patch_3816 implements patchInterface class patch_380alpha16a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.0.a16'; private $release = '3.8.0-alpha.16';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -11,10 +11,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
class patch_3817 implements patchInterface class patch_380alpha17a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.0.a17'; private $release = '3.8.0-alpha.17';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -12,10 +12,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Symfony\Component\Process\ExecutableFinder; use Symfony\Component\Process\ExecutableFinder;
class patch_3818 implements patchInterface class patch_380alpha18a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.0.a18'; private $release = '3.8.0-alpha.18';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_380 implements patchInterface class patch_380alpha2a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.8.0.a2'; private $release = '3.8.0-alpha.2';
/** /**
* *

View File

@@ -16,13 +16,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_3802 implements patchInterface class patch_380alpha2b implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.8.0.a2'; private $release = '3.8.0-alpha.2';
/** /**
* *

View File

@@ -17,13 +17,13 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_380a3 implements patchInterface class patch_380alpha3a implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.8.0.a3'; private $release = '3.8.0-alpha.3';
/** /**
* *

View File

@@ -16,14 +16,14 @@ use Alchemy\Phrasea\Application;
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class patch_3803 implements patchInterface class patch_380alpha3b implements patchInterface
{ {
/** /**
* *
* @var string * @var string
*/ */
private $release = '3.8.0.a3'; private $release = '3.8.0-alpha.3';
/** /**
* *

View File

@@ -12,10 +12,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Model\Entities\AuthFailure; use Alchemy\Phrasea\Model\Entities\AuthFailure;
class patch_3805 implements patchInterface class patch_380alpha4a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.0.a4'; private $release = '3.8.0-alpha.4';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -11,10 +11,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
class patch_3806 implements patchInterface class patch_380alpha6a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.0.a6'; private $release = '3.8.0-alpha.6';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -11,10 +11,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
class patch_3808 implements patchInterface class patch_380alpha8a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.0.a8'; private $release = '3.8.0-alpha.8';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -11,10 +11,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
class patch_3809 implements patchInterface class patch_380alpha9a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.0.a9'; private $release = '3.8.0-alpha.9';
/** @var array */ /** @var array */
private $concern = array(base::DATA_BOX); private $concern = array(base::DATA_BOX);

View File

@@ -11,10 +11,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
class patch_3819 implements patchInterface class patch_381alpha1a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.1'; private $release = '3.8.1-alpha.1';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -11,10 +11,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
class patch_3820 implements patchInterface class patch_381alpha1b implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.8.1'; private $release = '3.8.1-alpha.1';
/** @var array */ /** @var array */
private $concern = array(base::DATA_BOX); private $concern = array(base::DATA_BOX);

View File

@@ -0,0 +1,57 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2012 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Alchemy\Phrasea\Application;
class patch_381alpha2a implements patchInterface
{
/** @var string */
private $release = '3.8.1-alpha.2';
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
if (false !== strpos($app['phraseanet.registry']->get('GV_i18n_service'), 'localization.webservice.alchemyasp.com')) {
$app['phraseanet.registry']->set('GV_i18n_service', 'http://geonames.alchemyasp.com/', \registry::TYPE_STRING);
}
return true;
}
}

View File

@@ -12,10 +12,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Model\Entities\FtpCredential; use Alchemy\Phrasea\Model\Entities\FtpCredential;
class patch_390 implements patchInterface class patch_390alpha1a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.9.0.a1'; private $release = '3.9.0-alpha.1';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -14,10 +14,10 @@ use Alchemy\Phrasea\Model\Entities\Order;
use Alchemy\Phrasea\Model\Entities\OrderElement; use Alchemy\Phrasea\Model\Entities\OrderElement;
use Gedmo\Timestampable\TimestampableListener; use Gedmo\Timestampable\TimestampableListener;
class patch_3901 implements patchInterface class patch_390alpha1b implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.9.0.a1'; private $release = '3.9.0-alpha.1';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -14,10 +14,10 @@ use Doctrine\ORM\EntityManager;
use Alchemy\Phrasea\Model\Entities\User; use Alchemy\Phrasea\Model\Entities\User;
use Gedmo\Timestampable\TimestampableListener; use Gedmo\Timestampable\TimestampableListener;
class patch_3902 implements patchInterface class patch_390alpha2a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.9.0.a2'; private $release = '3.9.0-alpha.2';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -12,10 +12,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Model\Entities\UserQuery; use Alchemy\Phrasea\Model\Entities\UserQuery;
class patch_3903 implements patchInterface class patch_390alpha3a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.9.0.a3'; private $release = '3.9.0-alpha.3';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -12,10 +12,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Model\Entities\UserSetting; use Alchemy\Phrasea\Model\Entities\UserSetting;
class patch_3904 implements patchInterface class patch_390alpha4a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.9.0.a4'; private $release = '3.9.0-alpha.4';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -12,10 +12,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Model\Entities\UserNotificationSetting; use Alchemy\Phrasea\Model\Entities\UserNotificationSetting;
class patch_3905 implements patchInterface class patch_390alpha5a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.9.0.a5'; private $release = '3.9.0-alpha.5';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -14,10 +14,10 @@ use Alchemy\Phrasea\Model\Entities\FtpExport;
use Alchemy\Phrasea\Model\Entities\FtpExportElement; use Alchemy\Phrasea\Model\Entities\FtpExportElement;
use Gedmo\Timestampable\TimestampableListener; use Gedmo\Timestampable\TimestampableListener;
class patch_3906 implements patchInterface class patch_390alpha6a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.9.0.a6'; private $release = '3.9.0-alpha.6';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -17,10 +17,10 @@ use Alchemy\Phrasea\Model\Entities\FeedItem;
use Alchemy\Phrasea\Model\Entities\FeedPublisher; use Alchemy\Phrasea\Model\Entities\FeedPublisher;
use Alchemy\Phrasea\Model\Entities\FeedToken; use Alchemy\Phrasea\Model\Entities\FeedToken;
class patch_3907 implements patchInterface class patch_390alpha7a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.9.0.a7'; private $release = '3.9.0-alpha.7';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -12,10 +12,10 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Model\Entities\Task; use Alchemy\Phrasea\Model\Entities\Task;
class patch_3908 implements patchInterface class patch_390alpha8a implements patchInterface
{ {
/** @var string */ /** @var string */
private $release = '3.9.0.a8'; private $release = '3.9.0-alpha.8';
/** @var array */ /** @var array */
private $concern = array(base::APPLICATION_BOX); private $concern = array(base::APPLICATION_BOX);

View File

@@ -347,10 +347,10 @@
<option value="{{ ord }}">{{ ord_name }}</option> <option value="{{ ord }}">{{ ord_name }}</option>
{% endfor %} {% endfor %}
</select> </select>
{% if app['phraseanet.SE'].hasStemming() %} {% if app['phraseanet.SE'].hasStemming() and app['phraseanet.SE'].isStemmingEnabled() %}
<div> <div>
<label class="checkbox"> <label class="checkbox">
<input type="checkbox" {% if app['phraseanet.SE'].isStemmingEnabled() %} checked="checked" {% endif %} name="stemme" /> {% trans 'rechercher par stemme' %} <input type="checkbox" checked="checked" name="stemme" /> {% trans 'rechercher par stemme' %}
</label> </label>
</div> </div>
{% endif %} {% endif %}

View File

@@ -93,7 +93,7 @@ class ConfigurationTesterTest extends AbstractSetupTester
/** /**
* Must return version + 1 * Must return version + 1
*/ */
$app['phraseanet.version']->expects($this->any()) $app['phraseanet.version']::staticExpects($this->any())
->method('getNumber') ->method('getNumber')
->will($this->returnValue('3.9')); ->will($this->returnValue('3.9'));
@@ -134,7 +134,7 @@ class ConfigurationTesterTest extends AbstractSetupTester
/** /**
* Must return version + 1 * Must return version + 1
*/ */
$app['phraseanet.version']->expects($this->any()) $app['phraseanet.version']::staticExpects($this->any())
->method('getNumber') ->method('getNumber')
->will($this->returnValue('3.9')); ->will($this->returnValue('3.9'));

View File

@@ -1,13 +1,13 @@
<?php <?php
class patch_3803Test extends PhraseanetPHPUnitAbstract class patch_380alpha3bTest extends PhraseanetPHPUnitAbstract
{ {
/** /**
* @covers patch_3803::apply * @covers patch_380alpha3b::apply
*/ */
public function testApplyInPhraseaEnvironment() public function testApplyInPhraseaEnvironment()
{ {
$patch = new patch_3803(); $patch = new patch_380alpha3b();
$appbox = $this->getMockBuilder('appbox') $appbox = $this->getMockBuilder('appbox')
->disableOriginalConstructor() ->disableOriginalConstructor()

View File

@@ -134,38 +134,43 @@ define([
return this; return this;
}, },
tagFieldChangedAction: function(e) { tagFieldChangedAction: function(e) {
var $this = this;
var fieldTag = $(e.target); var fieldTag = $(e.target);
var fieldTagId = fieldTag.attr("id"); var fieldTagId = fieldTag.attr("id");
var fieldTagValue = fieldTag.val(); var fieldTagValue = fieldTag.val();
var notValid = "" === fieldTagValue;
// check for format tag var onFieldValid = function() {
if (notValid) { if (fieldTag.closest(".control-group").hasClass("error")) {
fieldTag // remove error
.closest(".control-group") AdminFieldApp.errorManager.removeModelFieldError(
.addClass("error") $this.model, fieldTagId
.find(".help-block") );
.empty()
.append(i18n.t("validation_tag_invalid"));
// add error
AdminFieldApp.errorManager.addModelFieldError(new Error(
this.model, fieldTagId, i18n.t("validation_tag_invalid")
));
} else if (fieldTag.closest(".control-group").hasClass("error")) {
// remove error
AdminFieldApp.errorManager.removeModelFieldError(
this.model, fieldTagId
);
fieldTag fieldTag
.closest(".control-group") .closest(".control-group")
.removeClass("error") .removeClass("error")
.find(".help-block") .find(".help-block")
.empty(); .empty();
} else {
$this.fieldChangedAction(e);
}
} }
if (!notValid) { if ("" !== fieldTagValue) {
this.fieldChangedAction(e); var jqxhr = $.get( "/admin/fields/tags/"+fieldTagValue, onFieldValid).fail(function() {
fieldTag
.closest(".control-group")
.addClass("error")
.find(".help-block")
.empty()
.append(i18n.t("validation_tag_invalid"));
// add error
AdminFieldApp.errorManager.addModelFieldError(new Error(
$this.model, fieldTagId, i18n.t("validation_tag_invalid")
));
});
} else {
onFieldValid();
} }
}, },
deleteAction: function() { deleteAction: function() {

View File

@@ -208,6 +208,23 @@ define([
var model = new FieldModel({"id": 1, "sbas-id": sbasId, "name": "Categorie", "tag": "XMP:Categorie"}); var model = new FieldModel({"id": 1, "sbas-id": sbasId, "name": "Categorie", "tag": "XMP:Categorie"});
this.view = new EditView({"model": model}); this.view = new EditView({"model": model});
AdminFieldApp.fieldsCollection.reset();
AdminFieldApp.fieldsCollection.add({"sbas-id": sbasId, "name": "Categorie", "tag": "XMP:Categorie"});
AdminFieldApp.dcFieldsCollection.add({
"label": "Contributor",
"definition": "An entity responsible for making contributions to the resource.",
"URI": "http://dublincore.org/documents/dces/#contributor"
});
AdminFieldApp.saveView = new SaveView();
AdminFieldApp.fieldErrorView = new FieldErrorView();
AdminFieldApp.fieldListView = new ListItemView({
collection: AdminFieldApp.fieldsCollection,
el: AdminFieldApp.$leftBlock
});
// render views
AdminFieldApp.saveView.render();
AdminFieldApp.fieldListView.render();
}); });
it("render() should return the view object", function() { it("render() should return the view object", function() {
@@ -218,12 +235,12 @@ define([
this.view.render().el.nodeName.should.equal("DIV"); this.view.render().el.nodeName.should.equal("DIV");
}); });
it("should render an error message if provided tag is empty", function() { it("should not render an error message if provided tag is empty", function() {
var view = this.view.render(); var view = this.view.render();
view.$('input#tag').val("").blur(); view.$('input#tag').val("").blur();
assert.isTrue(view.$('input#tag').closest(".control-group").hasClass("error")); assert.isFalse(view.$('input#tag').closest(".control-group").hasClass("error"));
}); });
it("should uncheck vocabulary restricted if provided vocabulary is empty", function() { it("should uncheck vocabulary restricted if provided vocabulary is empty", function() {
@@ -288,6 +305,7 @@ define([
describe("Edge cases", function() { describe("Edge cases", function() {
beforeEach(function() { beforeEach(function() {
AdminFieldApp.fieldsCollection.reset();
AdminFieldApp.fieldsCollection.add({"sbas-id": sbasId, "name": "Categorie", "tag": "XMP:Categorie"}); AdminFieldApp.fieldsCollection.add({"sbas-id": sbasId, "name": "Categorie", "tag": "XMP:Categorie"});
AdminFieldApp.dcFieldsCollection.add({ AdminFieldApp.dcFieldsCollection.add({
"label": "Contributor", "label": "Contributor",

View File

@@ -234,7 +234,7 @@ function checkFilters(save)
checked.each(function(){ checked.each(function(){
nbSelectedColls++; nbSelectedColls++;
search.bases[sbas_id].push($this.val()); search.bases[sbas_id].push($(this).val());
}); });
}); });
@@ -341,7 +341,7 @@ function clearAnswers(){
function reset_adv_search() function reset_adv_search()
{ {
$('#sbasfiltercont select').val(''); $('#sbasfiltercont select[name="sort"]').val($('#sbasfiltercont select[name="sort"] option.default-selection').attr('value'));
$('#sbasfiltercont input:checkbox.field_switch').removeAttr('checked'); $('#sbasfiltercont input:checkbox.field_switch').removeAttr('checked');
$('#sbasfiltercont .datepicker').val(''); $('#sbasfiltercont .datepicker').val('');
$('form.adv_search_bind input:text').val(''); $('form.adv_search_bind input:text').val('');