diff --git a/bower.json b/bower.json index 57e618c2d9..a12a7cfaf9 100644 --- a/bower.json +++ b/bower.json @@ -28,7 +28,8 @@ "autobahn": "http://autobahn.s3.amazonaws.com/js/autobahn.min.js", "when": "~2.7.0", "web-socket-js": "~1.0.1", - "jquery.treeview": "1.4.1" + "jquery.treeview": "1.4.1", + "joyride": "https://github.com/zurb/joyride/archive/v2.0.0.zip" }, "devDependencies": { "mocha": "latest", diff --git a/composer.json b/composer.json index 2f0cd873d3..f85123d735 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "gedmo/doctrine-extensions" : "~2.3.0", "alchemy/google-plus-api-client" : "~0.6.2", "alchemy/geonames-api-consumer" : "~0.1.0", - "goodby/csv" : "~1.0", + "goodby/csv" : "dev-master", "guzzle/guzzle" : "~3.0", "imagine/imagine" : "dev-alchemy-0.6.2 as 0.6.2", "igorw/get-in" : "~1.0", diff --git a/composer.lock b/composer.lock index d6a34f4506..e36ac8637b 100644 --- a/composer.lock +++ b/composer.lock @@ -1435,16 +1435,16 @@ }, { "name": "goodby/csv", - "version": "1.2.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/goodby/csv.git", - "reference": "66c376b3bd51bc90fd680bfdf3708c9a22b9d081" + "reference": "b289ca3e3f6ad3c76b7d8c3bef3effd0232ca13a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/goodby/csv/zipball/66c376b3bd51bc90fd680bfdf3708c9a22b9d081", - "reference": "66c376b3bd51bc90fd680bfdf3708c9a22b9d081", + "url": "https://api.github.com/repos/goodby/csv/zipball/b289ca3e3f6ad3c76b7d8c3bef3effd0232ca13a", + "reference": "b289ca3e3f6ad3c76b7d8c3bef3effd0232ca13a", "shasum": "" }, "require": { @@ -1488,7 +1488,7 @@ "export", "import" ], - "time": "2015-01-14 03:58:50" + "time": "2015-02-02 12:29:23" }, { "name": "guzzle/guzzle", @@ -5022,6 +5022,7 @@ ], "minimum-stability": "stable", "stability-flags": { + "goodby/csv": 20, "alchemy/task-manager": 20, "alchemy/zippy": 20, "imagine/imagine": 20, diff --git a/lib/Alchemy/Phrasea/Application/Api.php b/lib/Alchemy/Phrasea/Application/Api.php index 4d0102d82b..ee6dedb33f 100644 --- a/lib/Alchemy/Phrasea/Application/Api.php +++ b/lib/Alchemy/Phrasea/Application/Api.php @@ -54,7 +54,7 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) { $priorities = array('application/json', 'application/yaml', 'text/yaml', 'text/javascript', 'application/javascript'); foreach (V1::$extendedContentTypes['json'] as $priorities[]); foreach (V1::$extendedContentTypes['yaml'] as $priorities[]); - $format = $app['format.negociator']->getBest($request->headers->get('accept') ,$priorities); + $format = $app['format.negociator']->getBest($request->headers->get('accept', 'application/json') ,$priorities); // throw unacceptable http error if API can not handle asked format if (null === $format) { diff --git a/lib/Alchemy/Phrasea/Command/BuildSubdefs.php b/lib/Alchemy/Phrasea/Command/BuildSubdefs.php index bcf1abdb82..bc8bc777df 100644 --- a/lib/Alchemy/Phrasea/Command/BuildSubdefs.php +++ b/lib/Alchemy/Phrasea/Command/BuildSubdefs.php @@ -11,6 +11,7 @@ namespace Alchemy\Phrasea\Command; +use Alchemy\Phrasea\Exception\InvalidArgumentException; use Doctrine\DBAL\Connection; use Doctrine\DBAL\SQLParserUtils; use Symfony\Component\Console\Input\InputArgument; @@ -33,6 +34,8 @@ class BuildSubdefs extends Command $this->addArgument('subdefs', InputArgument::REQUIRED, 'Names of sub-definition to re-build'); $this->addOption('max_record', 'max', InputOption::VALUE_OPTIONAL, 'Max record id'); $this->addOption('min_record', 'min', InputOption::VALUE_OPTIONAL, 'Min record id'); + $this->addOption('with-substitution', 'wsubstit', InputOption::VALUE_NONE, 'Regenerate subdefs for substituted records as well'); + $this->addOption('substitution-only', 'substito', InputOption::VALUE_NONE, 'Regenerate subdefs for substituted records only'); return $this; } @@ -82,6 +85,7 @@ class BuildSubdefs extends Command $params[] = (int) $min; $types[] = \PDO::PARAM_INT; } + if (null !== $max = $input->getOption('max_record')) { $sqlCount .= " AND (r.record_id <= ?)"; @@ -89,16 +93,28 @@ class BuildSubdefs extends Command $types[] = \PDO::PARAM_INT; } + $substitutionOnly = $input->getOption('substitution-only'); + $withSubstitution = $input->getOption('with-substitution'); + + if (false === $withSubstitution) { + if (true === $substitutionOnly) { + $sqlCount .= " AND (s.substit = 1)"; + } else { + $sqlCount .= " AND (s.substit = 0)"; + } + } elseif ($substitutionOnly) { + throw new InvalidArgumentException('Conflict, you can not ask for --substituion-only && --with-substitution parameters at the same time'); + } + list($sqlCount, $stmtParams) = SQLParserUtils::expandListParameters($sqlCount, $params, $types); - $totalRecords = 0; - foreach ($this->container['phraseanet.appbox']->get_databoxes() as $databox) { - $connection = $databox->get_connection(); - $stmt = $connection->prepare($sqlCount); - $stmt->execute($stmtParams); - $row = $stmt->fetch(); - $totalRecords += $row['nb_records']; - } + $databox = $this->container['phraseanet.appbox']->get_databox($input->getArgument('databox')); + + $connection = $databox->get_connection(); + $stmt = $connection->prepare($sqlCount); + $stmt->execute($stmtParams); + $row = $stmt->fetch(); + $totalRecords = $row['nb_records']; if ($totalRecords === 0) { return; @@ -110,8 +126,6 @@ class BuildSubdefs extends Command $progress->display(); - $databox = $this->container['phraseanet.appbox']->get_databox($input->getArgument('databox')); - $sql = " SELECT DISTINCT(r.record_id) FROM record r @@ -137,6 +151,14 @@ class BuildSubdefs extends Command $types[] = \PDO::PARAM_INT; } + if (false === $withSubstitution) { + if (true === $substitutionOnly) { + $sql .= " AND (s.substit = 1)"; + } else { + $sql .= " AND (s.substit = 0)"; + } + } + list($sql, $stmtParams) = SQLParserUtils::expandListParameters($sql, $params, $types); $connection = $databox->get_connection(); @@ -155,6 +177,9 @@ class BuildSubdefs extends Command foreach ($subdefs as $subdef) { $subdef->remove_file(); + if (($withSubstitution && $subdef->is_substituted()) || $substitutionOnly) { + $subdef->set_substituted(false); + } } $record->generate_subdefs($databox, $this->container, $subdefsName); diff --git a/lib/Alchemy/Phrasea/Controller/Api/V1.php b/lib/Alchemy/Phrasea/Controller/Api/V1.php index 3aa18f42ac..bcaf3a9154 100644 --- a/lib/Alchemy/Phrasea/Controller/Api/V1.php +++ b/lib/Alchemy/Phrasea/Controller/Api/V1.php @@ -1326,19 +1326,6 @@ class V1 implements ControllerProviderInterface } } - if($media->get_name() != 'document') { - $databox = $record->get_databox(); - try { - $subDefDefinition = $databox->get_subdef_structure()->get_subdef($record->get_type(), $media->get_name()); - } catch (\Exception_Databox_SubdefNotFound $e) { - return null; - } - } - - if ($media->get_name() != 'document' && false === $subDefDefinition->is_downloadable()) { - return null; - } - if ($media->get_permalink() instanceof \media_Permalink_Adapter) { $permalink = $this->list_permalink($media->get_permalink()); } else { diff --git a/lib/Alchemy/Phrasea/Controller/Client/Root.php b/lib/Alchemy/Phrasea/Controller/Client/Root.php index 039da3711b..be2c4fd72b 100644 --- a/lib/Alchemy/Phrasea/Controller/Client/Root.php +++ b/lib/Alchemy/Phrasea/Controller/Client/Root.php @@ -30,16 +30,6 @@ class Root implements ControllerProviderInterface $controllers = $app['controllers_factory']; $controllers->before(function (Request $request) use ($app) { - /** - * /!\/!\/!\/!\/!\/!\/!\/!\/!\ - * - * Client is not longer used - * - * Redirect to production with a nice message - */ - $app['session']->getFlashBag()->add('client_deprecated', ''); - - return $app->redirectPath('prod'); if (!$app['authentication']->isAuthenticated() && null !== $request->query->get('nolog')) { return $app->redirectPath('login_authenticate_as_guest', ['redirect' => 'client']); @@ -244,6 +234,8 @@ class Root implements ControllerProviderInterface */ public function getClient(Application $app, Request $request) { + $app['session']->getFlashBag()->add('step_by_step', ''); + try { \Session_Logger::updateClientInfos($app, 2); } catch (SessionNotFound $e) { diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php b/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php index aa69e478db..25d3e28d51 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php @@ -319,15 +319,50 @@ class Lazaret implements ControllerProviderInterface */ public function emptyLazaret(Application $app, Request $request) { - $ret = ['success' => false, 'message' => '', 'result' => []]; + $ret = array( + 'success' => false, + 'message' => '', + 'result' => array( + 'tobedone' => 0, + 'done' => 0, + 'todo' => 0, + 'max' => '', + ) + ); + + $maxTodo = -1; // all + if($request->get('max') !== null) { + $maxTodo = (int)($request->get('max')); + $ret['result']['max'] = $maxTodo; + if( $maxTodo <= 0) { + $maxTodo = -1; // all + } + } + $ret['result']['max'] = $maxTodo; + + $repo = $app['orm.em']->getRepository('Entities\LazaretFile'); + + $ret['result']['tobedone'] = $repo->createQueryBuilder('id') + ->select('COUNT(id)') + ->getQuery() + ->getSingleScalarResult(); + + if($maxTodo == -1) { + // all + $lazaretFiles = $repo->findAll(); + } + else { + // limit maxTodo + $lazaretFiles = $repo->findBy(array(), null, $maxTodo); + } - $lazaretFiles = $app['repo.lazaret-files']->findAll(); $app['orm.em']->beginTransaction(); try { foreach ($lazaretFiles as $lazaretFile) { $this->denyLazaretFile($app, $lazaretFile); + $ret['result']['done']++; } $app['orm.em']->commit(); $ret['success'] = true; @@ -335,6 +370,7 @@ class Lazaret implements ControllerProviderInterface $app['orm.em']->rollback(); $ret['message'] = $app->trans('An error occured'); } + $ret['result']['todo'] = $ret['result']['tobedone'] - $ret['result']['done']; return $app->json($ret); } diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Tools.php b/lib/Alchemy/Phrasea/Controller/Prod/Tools.php index 1fc478e435..798bac6df2 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Tools.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Tools.php @@ -96,6 +96,11 @@ class Tools implements ControllerProviderInterface foreach ($record->get_subdefs() as $subdef) { if ($subdef->is_substituted()) { $substituted = true; + + if ($force) { + // unset flag + $subdef->set_substituted(false); + } break; } } diff --git a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineQueryParser.php b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineQueryParser.php index 832622b505..98d6c176b7 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineQueryParser.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineQueryParser.php @@ -729,8 +729,11 @@ class PhraseaEngineQueryParser $prophtml = ""; $this->propAsHTML($domthe->documentElement, $prophtml, $path); $this->proposals["BASES"]["b$bid"]["TERMS"][$path]["HTML"] = $prophtml; + } else { + $tree = NULL; } + return($ambigus); } @@ -1767,7 +1770,7 @@ class PhraseaEngineQueryParser $c_utf8 = ""; for ($i = 0; $i < $l; $i++) { if (!$this->app['unicode']->has_indexer_bad_char(($c_utf8 = mb_substr($this->phq, $i, 1, 'UTF-8')))) { - $t .= $this->app['unicode']->remove_diacritics(mb_strtolower($c_utf8)); + $t .= mb_strtolower($c_utf8); } else break; } diff --git a/lib/classes/base.php b/lib/classes/base.php index ca4ffa23ce..451b3e4502 100644 --- a/lib/classes/base.php +++ b/lib/classes/base.php @@ -810,6 +810,9 @@ abstract class base implements cache_cacheableInterface $success = true; + // disable mail + $app['swiftmailer.transport'] = null; + foreach ($list_patches as $patch) { // Gets doctrine migrations required for current patch foreach ($patch->getDoctrineMigrations() as $doctrineVersion) { diff --git a/lib/classes/p4field.php b/lib/classes/p4field.php index fc9d9176f2..f3a65d5bf1 100644 --- a/lib/classes/p4field.php +++ b/lib/classes/p4field.php @@ -23,6 +23,6 @@ class p4field { $v = mb_strtolower(trim($v)); - return($v == '0' || $v == 'n' || $v == 'no' || $v == 'non' || $v = 'off' || $v == 'false'); + return($v == '0' || $v == 'n' || $v == 'no' || $v == 'non' || $v == 'off' || $v == 'false'); } } diff --git a/lib/classes/record/adapter.php b/lib/classes/record/adapter.php index 92350ed7b5..f5a3999d9e 100644 --- a/lib/classes/record/adapter.php +++ b/lib/classes/record/adapter.php @@ -984,14 +984,10 @@ class record_adapter implements record_Interface, cache_cacheableInterface return $this->get_databox()->get_sbas_id(); } - public function substitute_subdef($name, MediaInterface $media, Application $app) + public function substitute_subdef($name, MediaInterface $media, Application $app, $adapt=true) { $newfilename = $this->record_id . '_0_' . $name . '.' . $media->getFile()->getExtension(); - $base_url = ''; - - $subdef_def = false; - if ($name == 'document') { $baseprefs = $this->get_databox()->get_sxml_structure(); @@ -1021,24 +1017,30 @@ class record_adapter implements record_Interface, cache_cacheableInterface $path_file_dest = $path . $newfilename; } - try { - $app['media-alchemyst']->turnInto( - $media->getFile()->getRealPath(), - $path_file_dest, - $subdef_def->getSpecs() - ); - } catch (\MediaAlchemyst\Exception\ExceptionInterface $e) { - return $this; - } + if($adapt) { + try { + $app['media-alchemyst']->turnInto( + $media->getFile()->getRealPath(), + $path_file_dest, + $subdef_def->getSpecs() + ); + } catch (\MediaAlchemyst\Exception\ExceptionInterface $e) { + return $this; + } - $subdefFile = $path_file_dest; + $subdefFile = $path_file_dest; + } + else{ + $app['filesystem']->copy($media->getFile()->getRealPath(), $path_file_dest); + + $subdefFile = $path_file_dest; + } $meta_writable = $subdef_def->meta_writeable(); } $app['filesystem']->chmod($subdefFile, 0760); $media = $app['mediavorus']->guess($subdefFile); - $subdef = media_subdef::create($app, $this, $name, $media); $subdef->set_substituted(true); @@ -1048,7 +1050,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface $this->write_metas(); } - if ($name == 'document') { + if ($name == 'document' && $adapt) { $this->rebuild_subdefs(); } diff --git a/lib/conf.d/data_templates/DublinCore.xml b/lib/conf.d/data_templates/DublinCore.xml new file mode 100644 index 0000000000..5de4f32945 --- /dev/null +++ b/lib/conf.d/data_templates/DublinCore.xml @@ -0,0 +1,221 @@ + + + {{datapathnoweb}}{{basename}}/documents + + + + {{datapathnoweb}}{{basename}}/subdefs + 1024 + resample + 72 + no + 75 + yes + screen + image + + + + + {{datapathnoweb}}{{basename}}/subdefs + 240 + resample + 72 + yes + 75 + no + screen + image + + + + + 480 + 72 + yes + 75 + {{datapathnoweb}}{{basename}}/subdefs + image + no + handheld + + + + + 150 + 72 + yes + 75 + {{datapathnoweb}}{{basename}}/subdefs + image + no + handheld + + + + + + + {{datapathnoweb}}{{basename}}/subdefs + 240 + screen + image + no + + + + + {{datapathnoweb}}{{basename}}/subdefs + 240 + gif + 150 + screen + no + + + + + {{datapathnoweb}}{{basename}}/subdefs + 748 + video + yes + libfaac + libx264 + screen + 1000 + 128 + 48000 + 25 + 25 + + + + + {{datapathnoweb}}{{basename}}/subdefs + 748 + video + screen + 1000 + 128 + 48000 + libvorbis + 25 + 25 + libvpx + + + + + + + {{datapathnoweb}}{{basename}}/subdefs + image + 240 + screen + no + + + + + {{datapathnoweb}}{{basename}}/subdefs + audio + yes + 128 + 48000 + screen + + + + + {{datapathnoweb}}{{basename}}/subdefs + audio + handheld + + + + + + + {{datapathnoweb}}{{basename}}/subdefs + image + resample + 72 + 240 + no + screen + + + + + {{datapathnoweb}}{{basename}}/subdefs + flexpaper + no + screen + + + + + + + {{datapathnoweb}}{{basename}}/subdefs + image + 240 + no + resample + 72 + screen + + + + + {{datapathnoweb}}{{basename}}/subdefs + image + 800 + no + resample + 72 + screen + + + + + + + + + <Creator src="XMP-dc:Creator" report="1" /> + <Subject src="XMP-dc:Subject" multi="1"/> + <Description src="XMP-dc:Description" report="0" /> + <Publisher src="XMP-dc:Publisher" type="date" report="0" /> + <Contributor src="XMP-dc:Contributor" report="0"/> + <Date src="XMP-dc:Date" type="date" report="0" /> + <Type src="XMP-dc:Type" report="1" /> + <Format src="XMP-dc:Format" report="0" /> + <Identifier src="XMP-dc:Identifier" report="1" /> + <Source src="XMP-dc:Source" report="0" /> + <Language src="XMP-dc:Language" report="0" /> + <Relation src="XMP-dc:Relation" report="0" /> + <Coverage src="XMP-dc:Coverage" report="1" /> + <Rights src="XMP-dc:Rights" report="0" /> + <Comments src="" business="1" report="0" /> + <Filename src="Phraseanet:tf-basename" readonly="1" type="text" report="1"/> + <CameraDevice src="IFD0:Model" readonly="1" report="0" /> + <Latitude src="GPS:GPSLatitude" readonly="1" report="0" /> + <Longitude src="GPS:GPSLongitude" readonly="1" report="0"/> + <ArchiveDate src="Phraseanet:tf-archivedate" readonly="1" type="date" report="0" /> + <LastEditDate src="Phraseanet:tf-editdate" readonly="1" type="date" report="0" /> + </description> + + <statbits> + <bit n="4" labelOn="Caption filled" searchable="0" printable="0" labelOff="Caption not filled"> + <label switch="off" code="de">Nicht gefüllt</label> + <label switch="off" code="en">Caption not filled</label> + <label switch="off" code="fr">Média non renseigné</label> + <label switch="off" code="nl"/> + <label switch="on" code="de">Gefüllt</label> + <label switch="on" code="en">Caption filled</label> + <label switch="on" code="fr">Média renseigné</label> + <label switch="on" code="nl"/> + </bit> + </statbits> +</record> diff --git a/lib/conf.d/data_templates/en-simple.xml b/lib/conf.d/data_templates/en-simple.xml index 57ec7f9043..a9b2e33460 100644 --- a/lib/conf.d/data_templates/en-simple.xml +++ b/lib/conf.d/data_templates/en-simple.xml @@ -5,7 +5,7 @@ <subdefgroup name="image"> <subdef class="preview" name="preview" downloadable="true"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <size>800</size> + <size>1024</size> <method>resample</method> <dpi>72</dpi> <strip>no</strip> @@ -18,7 +18,7 @@ </subdef> <subdef class="thumbnail" name="thumbnail" downloadable="true"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <size>200</size> + <size>240</size> <method>resample</method> <dpi>72</dpi> <strip>yes</strip> @@ -26,7 +26,7 @@ <meta>no</meta> <devices>screen</devices> <mediatype>image</mediatype> - <label lang="fr">Imagette</label> + <label lang="fr">Vignette</label> <label lang="en">Thumbnail</label> </subdef> <subdef class="preview" name="preview_mobile" downloadable="false"> @@ -50,145 +50,82 @@ <mediatype>image</mediatype> <meta>no</meta> <devices>handheld</devices> - <label lang="fr">Imagette mobile</label> + <label lang="fr">Vignette mobile</label> <label lang="en">Mobile Thumbnail</label> </subdef> </subdefgroup> <subdefgroup name="video"> - <subdef class="preview" name="preview_mobile_webm" downloadable="false"> + <subdef class="thumbnail" name="thumbnail" downloadable="false"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>video</mediatype> - <bitrate>300</bitrate> - <threads>2</threads> - <GOPsize>25</GOPsize> - <size>480</size> - <fps>15</fps> - <devices>handheld</devices> - <vcodec>libvpx</vcodec> - <acodec>libvorbis</acodec> - <label lang="fr">Prévisualisation mobile WebM</label> - <label lang="en">WebM mobile Preview</label> - </subdef> - <subdef class="preview" name="preview_mobile_ogg" downloadable="false"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>video</mediatype> - <bitrate>300</bitrate> - <threads>2</threads> - <GOPsize>25</GOPsize> - <size>480</size> - <fps>15</fps> - <devices>handheld</devices> - <vcodec>libtheora</vcodec> - <acodec>libvorbis</acodec> - <label lang="fr">Prévisualisation mobile Ogg</label> - <label lang="en">Ogg mobile Preview</label> - </subdef> - <subdef class="preview" name="preview_mobile_x264" downloadable="false"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>video</mediatype> - <bitrate>300</bitrate> - <threads>2</threads> - <GOPsize>25</GOPsize> - <size>480</size> - <fps>15</fps> - <devices>handheld</devices> - <acodec>libfaac</acodec> - <vcodec>libx264</vcodec> - <label lang="fr">Prévisualisation X264</label> - <label lang="en">X264 Preview</label> - </subdef> - <subdef class="preview" name="preview_webm" downloadable="false"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>video</mediatype> + <size>240</size> <devices>screen</devices> - <bitrate>1000</bitrate> - <threads>1</threads> - <acodec>libvorbis</acodec> - <GOPsize>25</GOPsize> - <size>800</size> - <fps>15</fps> - <vcodec>libvpx</vcodec> - <label lang="fr">Prévisualisation WebM</label> - <label lang="en">WebM Preview</label> - </subdef> - <subdef class="preview" name="preview_ogg" downloadable="false"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>video</mediatype> - <devices>screen</devices> - <bitrate>1000</bitrate> - <threads>1</threads> - <acodec>libvorbis</acodec> - <GOPsize>25</GOPsize> - <size>800</size> - <fps>15</fps> - <vcodec>libtheora</vcodec> - <label lang="fr">Prévisualisation Ogg</label> - <label lang="en">Ogg Preview</label> - </subdef> - <subdef class="thumbnail" name="thumbnail_mobile" downloadable="false"> - <size>150</size> - <resolution>72</resolution> - <strip>yes</strip> - <quality>75</quality> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> <mediatype>image</mediatype> - <meta>no</meta> - <devices>handheld</devices> - <label lang="fr">Imagette mobile</label> - <label lang="en">Mobile Thumbnail</label> + <writeDatas>no</writeDatas> + <label lang="fr">Vignette</label> + <label lang="en">Thumbnail</label> </subdef> - <subdef class="preview" name="preview" downloadable="true"> + <subdef class="thumbnail" name="thumbnailgif" downloadable="false"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <size>800</size> - <mediatype>video</mediatype> - <writeDatas>yes</writeDatas> - <acodec>libfaac</acodec> - <vcodec>libx264</vcodec> - <devices>screen</devices> - <bitrate>1000</bitrate> - <threads>8</threads> - <fps>15</fps> - <label lang="fr">Prévisualisation</label> - <label lang="en">Preview</label> - </subdef> - <subdef class="thumbnail" name="thumbnailgif" downloadable="true"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <size>200</size> + <size>240</size> <mediatype>gif</mediatype> - <delay>500</delay> + <delay>150</delay> <devices>screen</devices> <writeDatas>no</writeDatas> <label lang="fr">Animation GIF</label> <label lang="en">GIF Animation</label> </subdef> - <subdef class="thumbnail" name="thumbnail" downloadable="true"> + <subdef class="preview" name="preview" downloadable="true"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <size>200</size> + <size>748</size> + <mediatype>video</mediatype> + <writeDatas>yes</writeDatas> + <acodec>libfaac</acodec> + <vcodec>libx264</vcodec> <devices>screen</devices> - <mediatype>image</mediatype> - <writeDatas>no</writeDatas> - <label lang="fr">Imagette</label> - <label lang="en">Thumbnail</label> + <bitrate>1000</bitrate> + <audiobitrate>128</audiobitrate> + <audiosamplerate>48000</audiosamplerate> + <fps>25</fps> + <GOPsize>25</GOPsize> + <label lang="fr">Prévisualisation</label> + <label lang="en">Preview</label> + </subdef> + <subdef class="preview" name="preview_webm" downloadable="false"> + <path>{{datapathnoweb}}{{basename}}/subdefs</path> + <size>748</size> + <mediatype>video</mediatype> + <devices>screen</devices> + <bitrate>1000</bitrate> + <audiobitrate>128</audiobitrate> + <audiosamplerate>48000</audiosamplerate> + <acodec>libvorbis</acodec> + <fps>25</fps> + <GOPsize>25</GOPsize> + <vcodec>libvpx</vcodec> + <label lang="fr">Prévisualisation WebM</label> + <label lang="en">WebM Preview</label> </subdef> </subdefgroup> <subdefgroup name="audio"> + <subdef class="thumbnail" name="thumbnail" downloadable="true"> + <path>{{datapathnoweb}}{{basename}}/subdefs</path> + <mediatype>image</mediatype> + <size>240</size> + <devices>screen</devices> + <writeDatas>no</writeDatas> + <label lang="fr">Vignette</label> + <label lang="en">Thumbnail</label> + </subdef> <subdef class="preview" name="preview" downloadable="true"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> <mediatype>audio</mediatype> <writeDatas>yes</writeDatas> + <audiobitrate>128</audiobitrate> + <audiosamplerate>48000</audiosamplerate> <devices>screen</devices> <label lang="fr">Prévisualisation</label> <label lang="en">Preview</label> </subdef> - <subdef class="thumbnail" name="thumbnail" downloadable="true"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>image</mediatype> - <size>200</size> - <devices>screen</devices> - <writeDatas>no</writeDatas> - <label lang="fr">Imagette</label> - <label lang="en">Thumbnail</label> - </subdef> <subdef class="preview" name="preview_mobile" downloadable="false"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> <mediatype>audio</mediatype> @@ -196,20 +133,19 @@ <label lang="fr">Prévisualisation Mobile</label> <label lang="en">Mobile Preview</label> </subdef> - <subdef class="thumbnail" name="thumbnail_mobile" downloadable="false"> - <size>150</size> - <resolution>72</resolution> - <strip>yes</strip> - <quality>75</quality> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>image</mediatype> - <meta>no</meta> - <devices>handheld</devices> - <label lang="fr">Imagette mobile</label> - <label lang="en">Mobile Thumbnail</label> - </subdef> </subdefgroup> <subdefgroup name="document"> + <subdef class="thumbnail" name="thumbnail" downloadable="false"> + <path>{{datapathnoweb}}{{basename}}/subdefs</path> + <mediatype>image</mediatype> + <method>resample</method> + <dpi>72</dpi> + <size>240</size> + <writeDatas>no</writeDatas> + <devices>screen</devices> + <label lang="fr">Vignette</label> + <label lang="en">Thumbnail</label> + </subdef> <subdef class="preview" name="preview" downloadable="false"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> <mediatype>flexpaper</mediatype> @@ -218,38 +154,19 @@ <label lang="fr">Prévisualisation</label> <label lang="en">Preview</label> </subdef> + </subdefgroup> + <subdefgroup name="flash"> <subdef class="thumbnail" name="thumbnail" downloadable="false"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> <mediatype>image</mediatype> + <size>240</size> + <writeDatas>no</writeDatas> <method>resample</method> <dpi>72</dpi> - <size>200</size> - <writeDatas>no</writeDatas> <devices>screen</devices> - <label lang="fr">Imagette</label> + <label lang="fr">Vignette</label> <label lang="en">Thumbnail</label> </subdef> - <subdef class="preview" name="preview_mobile" downloadable="false"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>flexpaper</mediatype> - <devices>handheld</devices> - <label lang="fr">Prévisualisation Mobile</label> - <label lang="en">Mobile Preview</label> - </subdef> - <subdef class="thumbnail" name="thumbnail_mobile" downloadable="false"> - <size>150</size> - <resolution>72</resolution> - <strip>yes</strip> - <quality>75</quality> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>image</mediatype> - <meta>no</meta> - <devices>handheld</devices> - <label lang="fr">Imagette mobile</label> - <label lang="en">Mobile Thumbnail</label> - </subdef> - </subdefgroup> - <subdefgroup name="flash"> <subdef class="preview" name="preview" downloadable="false"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> <mediatype>image</mediatype> @@ -261,41 +178,6 @@ <label lang="fr">Prévisualisation</label> <label lang="en">Preview</label> </subdef> - <subdef class="thumbnail" name="thumbnail" downloadable="false"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>image</mediatype> - <size>200</size> - <writeDatas>no</writeDatas> - <method>resample</method> - <dpi>72</dpi> - <devices>screen</devices> - <label lang="fr">Imagette</label> - <label lang="en">Thumbnail</label> - </subdef> - <subdef class="preview" name="preview_mobile" downloadable="false"> - <size>480</size> - <resolution>72</resolution> - <strip>yes</strip> - <quality>75</quality> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>image</mediatype> - <meta>no</meta> - <devices>handheld</devices> - <label lang="fr">Prévisualisation Mobile</label> - <label lang="en">Mobile Preview</label> - </subdef> - <subdef class="thumbnail" name="thumbnail_mobile" downloadable="false"> - <size>150</size> - <resolution>72</resolution> - <strip>yes</strip> - <quality>75</quality> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>image</mediatype> - <meta>no</meta> - <devices>handheld</devices> - <label lang="fr">Imagette mobile</label> - <label lang="en">Mobile Thumbnail</label> - </subdef> </subdefgroup> </subdefs> diff --git a/lib/conf.d/data_templates/fr-simple.xml b/lib/conf.d/data_templates/fr-simple.xml index a53633cff6..550b8adac8 100644 --- a/lib/conf.d/data_templates/fr-simple.xml +++ b/lib/conf.d/data_templates/fr-simple.xml @@ -5,7 +5,7 @@ <subdefgroup name="image"> <subdef class="preview" name="preview" downloadable="true"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <size>800</size> + <size>1024</size> <method>resample</method> <dpi>72</dpi> <strip>no</strip> @@ -18,7 +18,7 @@ </subdef> <subdef class="thumbnail" name="thumbnail" downloadable="true"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <size>200</size> + <size>240</size> <method>resample</method> <dpi>72</dpi> <strip>yes</strip> @@ -26,7 +26,7 @@ <meta>no</meta> <devices>screen</devices> <mediatype>image</mediatype> - <label lang="fr">Imagette</label> + <label lang="fr">Vignette</label> <label lang="en">Thumbnail</label> </subdef> <subdef class="preview" name="preview_mobile" downloadable="false"> @@ -50,145 +50,82 @@ <mediatype>image</mediatype> <meta>no</meta> <devices>handheld</devices> - <label lang="fr">Imagette mobile</label> + <label lang="fr">Vignette mobile</label> <label lang="en">Mobile Thumbnail</label> </subdef> </subdefgroup> <subdefgroup name="video"> - <subdef class="preview" name="preview_mobile_webm" downloadable="false"> + <subdef class="thumbnail" name="thumbnail" downloadable="false"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>video</mediatype> - <bitrate>300</bitrate> - <threads>2</threads> - <GOPsize>25</GOPsize> - <size>480</size> - <fps>15</fps> - <devices>handheld</devices> - <vcodec>libvpx</vcodec> - <acodec>libvorbis</acodec> - <label lang="fr">Prévisualisation mobile WebM</label> - <label lang="en">WebM mobile Preview</label> - </subdef> - <subdef class="preview" name="preview_mobile_ogg" downloadable="false"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>video</mediatype> - <bitrate>300</bitrate> - <threads>2</threads> - <GOPsize>25</GOPsize> - <size>480</size> - <fps>15</fps> - <devices>handheld</devices> - <vcodec>libtheora</vcodec> - <acodec>libvorbis</acodec> - <label lang="fr">Prévisualisation mobile Ogg</label> - <label lang="en">Ogg mobile Preview</label> - </subdef> - <subdef class="preview" name="preview_mobile_x264" downloadable="false"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>video</mediatype> - <bitrate>300</bitrate> - <threads>2</threads> - <GOPsize>25</GOPsize> - <size>480</size> - <fps>15</fps> - <devices>handheld</devices> - <acodec>libfaac</acodec> - <vcodec>libx264</vcodec> - <label lang="fr">Prévisualisation X264</label> - <label lang="en">X264 Preview</label> - </subdef> - <subdef class="preview" name="preview_webm" downloadable="false"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>video</mediatype> + <size>240</size> <devices>screen</devices> - <bitrate>1000</bitrate> - <threads>1</threads> - <acodec>libvorbis</acodec> - <GOPsize>25</GOPsize> - <size>800</size> - <fps>15</fps> - <vcodec>libvpx</vcodec> - <label lang="fr">Prévisualisation WebM</label> - <label lang="en">WebM Preview</label> - </subdef> - <subdef class="preview" name="preview_ogg" downloadable="false"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>video</mediatype> - <devices>screen</devices> - <bitrate>1000</bitrate> - <threads>1</threads> - <acodec>libvorbis</acodec> - <GOPsize>25</GOPsize> - <size>800</size> - <fps>15</fps> - <vcodec>libtheora</vcodec> - <label lang="fr">Prévisualisation Ogg</label> - <label lang="en">Ogg Preview</label> - </subdef> - <subdef class="thumbnail" name="thumbnail_mobile" downloadable="false"> - <size>150</size> - <resolution>72</resolution> - <strip>yes</strip> - <quality>75</quality> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> <mediatype>image</mediatype> - <meta>no</meta> - <devices>handheld</devices> - <label lang="fr">Imagette mobile</label> - <label lang="en">Mobile Thumbnail</label> + <writeDatas>no</writeDatas> + <label lang="fr">Vignette</label> + <label lang="en">Thumbnail</label> </subdef> - <subdef class="preview" name="preview" downloadable="true"> + <subdef class="thumbnail" name="thumbnailgif" downloadable="false"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <size>800</size> - <mediatype>video</mediatype> - <writeDatas>yes</writeDatas> - <acodec>libfaac</acodec> - <vcodec>libx264</vcodec> - <devices>screen</devices> - <bitrate>1000</bitrate> - <threads>8</threads> - <fps>15</fps> - <label lang="fr">Prévisualisation</label> - <label lang="en">Preview</label> - </subdef> - <subdef class="thumbnail" name="thumbnailgif" downloadable="true"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <size>200</size> + <size>240</size> <mediatype>gif</mediatype> - <delay>500</delay> + <delay>150</delay> <devices>screen</devices> <writeDatas>no</writeDatas> <label lang="fr">Animation GIF</label> <label lang="en">GIF Animation</label> </subdef> - <subdef class="thumbnail" name="thumbnail" downloadable="true"> + <subdef class="preview" name="preview" downloadable="true"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <size>200</size> + <size>748</size> + <mediatype>video</mediatype> + <writeDatas>yes</writeDatas> + <acodec>libfaac</acodec> + <vcodec>libx264</vcodec> <devices>screen</devices> - <mediatype>image</mediatype> - <writeDatas>no</writeDatas> - <label lang="fr">Imagette</label> - <label lang="en">Thumbnail</label> + <bitrate>1000</bitrate> + <audiobitrate>128</audiobitrate> + <audiosamplerate>48000</audiosamplerate> + <fps>25</fps> + <GOPsize>25</GOPsize> + <label lang="fr">Prévisualisation</label> + <label lang="en">Preview</label> + </subdef> + <subdef class="preview" name="preview_webm" downloadable="false"> + <path>{{datapathnoweb}}{{basename}}/subdefs</path> + <size>748</size> + <mediatype>video</mediatype> + <devices>screen</devices> + <bitrate>1000</bitrate> + <audiobitrate>128</audiobitrate> + <audiosamplerate>48000</audiosamplerate> + <acodec>libvorbis</acodec> + <fps>25</fps> + <GOPsize>25</GOPsize> + <vcodec>libvpx</vcodec> + <label lang="fr">Prévisualisation WebM</label> + <label lang="en">WebM Preview</label> </subdef> </subdefgroup> <subdefgroup name="audio"> + <subdef class="thumbnail" name="thumbnail" downloadable="true"> + <path>{{datapathnoweb}}{{basename}}/subdefs</path> + <mediatype>image</mediatype> + <size>240</size> + <devices>screen</devices> + <writeDatas>no</writeDatas> + <label lang="fr">Vignette</label> + <label lang="en">Thumbnail</label> + </subdef> <subdef class="preview" name="preview" downloadable="true"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> <mediatype>audio</mediatype> <writeDatas>yes</writeDatas> + <audiobitrate>128</audiobitrate> + <audiosamplerate>48000</audiosamplerate> <devices>screen</devices> <label lang="fr">Prévisualisation</label> <label lang="en">Preview</label> </subdef> - <subdef class="thumbnail" name="thumbnail" downloadable="true"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>image</mediatype> - <size>200</size> - <devices>screen</devices> - <writeDatas>no</writeDatas> - <label lang="fr">Imagette</label> - <label lang="en">Thumbnail</label> - </subdef> <subdef class="preview" name="preview_mobile" downloadable="false"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> <mediatype>audio</mediatype> @@ -196,20 +133,19 @@ <label lang="fr">Prévisualisation Mobile</label> <label lang="en">Mobile Preview</label> </subdef> - <subdef class="thumbnail" name="thumbnail_mobile" downloadable="false"> - <size>150</size> - <resolution>72</resolution> - <strip>yes</strip> - <quality>75</quality> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>image</mediatype> - <meta>no</meta> - <devices>handheld</devices> - <label lang="fr">Imagette mobile</label> - <label lang="en">Mobile Thumbnail</label> - </subdef> </subdefgroup> <subdefgroup name="document"> + <subdef class="thumbnail" name="thumbnail" downloadable="false"> + <path>{{datapathnoweb}}{{basename}}/subdefs</path> + <mediatype>image</mediatype> + <method>resample</method> + <dpi>72</dpi> + <size>240</size> + <writeDatas>no</writeDatas> + <devices>screen</devices> + <label lang="fr">Vignette</label> + <label lang="en">Thumbnail</label> + </subdef> <subdef class="preview" name="preview" downloadable="false"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> <mediatype>flexpaper</mediatype> @@ -218,38 +154,19 @@ <label lang="fr">Prévisualisation</label> <label lang="en">Preview</label> </subdef> + </subdefgroup> + <subdefgroup name="flash"> <subdef class="thumbnail" name="thumbnail" downloadable="false"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> <mediatype>image</mediatype> + <size>240</size> + <writeDatas>no</writeDatas> <method>resample</method> <dpi>72</dpi> - <size>200</size> - <writeDatas>no</writeDatas> <devices>screen</devices> - <label lang="fr">Imagette</label> + <label lang="fr">Vignette</label> <label lang="en">Thumbnail</label> </subdef> - <subdef class="preview" name="preview_mobile" downloadable="false"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>flexpaper</mediatype> - <devices>handheld</devices> - <label lang="fr">Prévisualisation Mobile</label> - <label lang="en">Mobile Preview</label> - </subdef> - <subdef class="thumbnail" name="thumbnail_mobile" downloadable="false"> - <size>150</size> - <resolution>72</resolution> - <strip>yes</strip> - <quality>75</quality> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>image</mediatype> - <meta>no</meta> - <devices>handheld</devices> - <label lang="fr">Imagette mobile</label> - <label lang="en">Mobile Thumbnail</label> - </subdef> - </subdefgroup> - <subdefgroup name="flash"> <subdef class="preview" name="preview" downloadable="false"> <path>{{datapathnoweb}}{{basename}}/subdefs</path> <mediatype>image</mediatype> @@ -261,41 +178,6 @@ <label lang="fr">Prévisualisation</label> <label lang="en">Preview</label> </subdef> - <subdef class="thumbnail" name="thumbnail" downloadable="false"> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>image</mediatype> - <size>200</size> - <writeDatas>no</writeDatas> - <method>resample</method> - <dpi>72</dpi> - <devices>screen</devices> - <label lang="fr">Imagette</label> - <label lang="en">Thumbnail</label> - </subdef> - <subdef class="preview" name="preview_mobile" downloadable="false"> - <size>480</size> - <resolution>72</resolution> - <strip>yes</strip> - <quality>75</quality> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>image</mediatype> - <meta>no</meta> - <devices>handheld</devices> - <label lang="fr">Prévisualisation Mobile</label> - <label lang="en">Mobile Preview</label> - </subdef> - <subdef class="thumbnail" name="thumbnail_mobile" downloadable="false"> - <size>150</size> - <resolution>72</resolution> - <strip>yes</strip> - <quality>75</quality> - <path>{{datapathnoweb}}{{basename}}/subdefs</path> - <mediatype>image</mediatype> - <meta>no</meta> - <devices>handheld</devices> - <label lang="fr">Imagette mobile</label> - <label lang="en">Mobile Thumbnail</label> - </subdef> </subdefgroup> </subdefs> diff --git a/templates/web/admin/statusbit.html.twig b/templates/web/admin/statusbit.html.twig index 0a15ca07d8..4de766fdb1 100644 --- a/templates/web/admin/statusbit.html.twig +++ b/templates/web/admin/statusbit.html.twig @@ -42,12 +42,12 @@ {% set statusbit = attribute(status, bit) %} <td> {% if statusbit['img_off'] %} - <img title='{{ statusbit['labels_off_i18n'][app['locale']] }}' src='{{ statusbit['img_off'] }}' /> + <img class="status-img" title='{{ statusbit['labels_off_i18n'][app['locale']] }}' src='{{ statusbit['img_off'] }}' /> {% endif %} {{ statusbit['labels_off_i18n'][app['locale']] }} / {% if statusbit['img_on'] %} - <img title='{{ statusbit['labels_on_i18n'][app['locale']] }}' src='{{ statusbit['img_on'] }}' /> + <img class="status-img" title='{{ statusbit['labels_on_i18n'][app['locale']] }}' src='{{ statusbit['img_on'] }}' /> {% endif %} {{ statusbit['labels_on_i18n'][app['locale']] }} </td> diff --git a/templates/web/admin/statusbit/edit.html.twig b/templates/web/admin/statusbit/edit.html.twig index d8917b9f92..7330477824 100644 --- a/templates/web/admin/statusbit/edit.html.twig +++ b/templates/web/admin/statusbit/edit.html.twig @@ -53,7 +53,7 @@ <span class="btn btn-success fileinput-button pull-left"> <i class="icon-plus icon-white"></i> <span>{% trans %}Select files...{% endtrans %}</span> - <input type="file" name="image_off" accept="image/*"/> + <input type="file" name="image_off" accept="image/jpg, image/png"/> </span> <div class='thumbnail pull-left' style='height:20px;width:20px;margin-left:10px;'> {% if status['img_off'] is defined and status['img_off'] %} @@ -117,7 +117,7 @@ <span class="btn btn-success fileinput-button pull-left"> <i class="icon-plus icon-white"></i> <span>{% trans %}Select files...{% endtrans %}</span> - <input type="file" name="image_on" accept="image/*"/> + <input type="file" name="image_on" accept="image/jpg, image/png"/> </span> <div class='thumbnail pull-left' style='height:20px;width:20px;margin-left:10px'> {% if status['img_on'] is defined and status['img_on'] %} diff --git a/templates/web/client/index.html.twig b/templates/web/client/index.html.twig index 63a083c94b..81246ca3b9 100644 --- a/templates/web/client/index.html.twig +++ b/templates/web/client/index.html.twig @@ -45,6 +45,22 @@ </head> <body class="PNB" style="overflow:hidden;width:100%;height:100%;"> + + {% if app['phraseanet.configuration']['deprecate-client']|default(true) %} + <div id="clientModal" > + <div class="modal-body"> + <p style="background-color: red"> + {{ "Pour des raisons techniques cette interface n'est plus maintenue et serta bientôt rendue + inacessible. Nous vous invitons si vous le souhaitez à utiliser production dés maintenant."|trans }} + </p> + <br /> + <p><a href="{{ path('prod') }}" >{{ 'Production '|trans }} > </a></p> + </div> + </div> + <script type="text/javascript"> + $('#clientModal').dialog(); + </script> + {% endif %} <div id="container" style="position:absolute;top:0;left:0;overflow:hidden;width:100%;height:100%;"> {% include 'common/menubar.html.twig' %} <div style="top:30px;position:relative;float:left;"> diff --git a/templates/web/prod/actions/Tools/index.html.twig b/templates/web/prod/actions/Tools/index.html.twig index 3d6b1584b2..cef78ac8aa 100644 --- a/templates/web/prod/actions/Tools/index.html.twig +++ b/templates/web/prod/actions/Tools/index.html.twig @@ -1,7 +1,7 @@ {% set selectionLength = records|length %} {% set nbHdSubstitute = 0 %} -{% set nbThumbSubstitute = 0 %} +{% set nbSubdefSubstitute = 0 %} {% for record in records %} {% set subdefs = record.get_subdefs() %} @@ -9,10 +9,8 @@ {% for key, subdef in subdefs if subdef.is_substituted() %} {% if key == 'document' %} {% set nbHdSubstitute = nbHdSubstitute + 1 %} - {% endif%} - - {% if key == 'thumbnail' %} - {% set nbThumbSubstitute = nbThumbSubstitute + 1 %} + {% else %} + {% set nbSubdefSubstitute = nbSubdefSubstitute + 1 %} {% endif%} {% endfor %} @@ -68,7 +66,7 @@ <form id="new-img-form" action="{{ path('prod_tools_image') }}" method="post"> <fieldset style='border:1px solid #999; padding:20px;'> <legend style='color:#EEE'> <b>{{ "Reconstruire les sous definitions" | trans }}</b> </legend> - {% if nbThumbSubstitute > 0 %} + {% if nbSubdefSubstitute > 0 %} <div style="color:#A00;"> {{ "Attention, certain documents ont des sous-definitions substituees" | trans }} </div> diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig index 7e27453728..1965705235 100644 --- a/templates/web/prod/index.html.twig +++ b/templates/web/prod/index.html.twig @@ -44,6 +44,7 @@ {% endmacro %} {% set jquery_theme = 'dark-hive' %} +{% set step = app.flash('step_by_step') %} {% extends "common/index_bootstrap.html.twig" %} @@ -104,6 +105,41 @@ background-color: {{"#" ~ app['settings'].getUserSetting(app['authentication'].getUser(), 'background-selection', '404040')}}; } </style> + + {% if step %} + <link type="text/css" rel="stylesheet" href="{{ path('minifier', { 'f' : 'assets/joyride/joyride-2.1.css' }) }}" > + <style> + .joyride-tip-guide { + background-color: #eee; + color: #000; + } + + .joyride-tip-guide h1 { + font-weight: 100; + font-size: 20px; + color: #0a212b; + line-height: 22px; + margin-bottom: 10px; + } + + .joyride-tip-guide span.joyride-nub.top { + border-color: #eee; + } + + .joyride-tip-guide span.joyride-nub.right { + border-left-color: #eee !important; + } + + .joyride-expose-wrapper { + background-color: transparent; + } + + .joyride-tip-guide .joyride-next-tip { + background: #0a212b; + border: none; + } + </style> + {% endif %} {% endblock %} {% block javascript %} @@ -121,7 +157,6 @@ </div> </div> </div> - <div id="desktop" class="PNB" style="overflow:hidden;"> {% if app.flash('client_deprecated') %} <div id="clientModal" class="modal hide fade" > @@ -299,7 +334,7 @@ <form id="searchForm" method="POST" action="{{ path('prod_query') }}" name="phrasea_query" class="phrasea_query"> <div class="input-append"> <input autocomplete="off" class="search query" id="EDIT_query" name="qry" type="text" name="qry" value="{{app['settings'].getUserSetting(app['authentication'].getUser(), 'start_page_query')}}"> - <a href="#" class="btn btn-inverse adv_trigger adv_search_button"> + <a id="ADV_query" href="#" class="btn btn-inverse adv_trigger adv_search_button"> <img src="/skins/icons/settings.png" title="{{ 'Advanced Search' | trans }}"/> </a> <button type="submit" class="btn btn-inverse" style="font-size:14px">{{ 'boutton::rechercher' | trans }}</button> @@ -546,7 +581,7 @@ <span class="dropdownButton"> <div class="btn-group"> - <button class="default_action TOOL_disktt_btn results_window btn btn-inverse"> + <button id="TOOL_disktt" class="default_action TOOL_disktt_btn results_window btn btn-inverse"> <img src="/skins/prod/000000/images/disktt_history.png" height="16" width="16" /> {{ 'action : exporter' | trans }} </button> <button class="trigger btn btn-inverse dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button> @@ -1036,6 +1071,88 @@ <div id="modal_feed" title="{{ 'action : publier' | trans }}" style="display:none;"></div> <div id="dialog_dwnl" title="{{ 'action : exporter' | trans }}" style="display:none;"></div> + {% if step %} + <ol id="step_by_step" style="visibility: hidden;"> + /* data-id needs to be the same as the parent it will attach to */ + <li data-id="EDIT_query"> + <div> + <h1> + {{ "Rechercher"|trans }} + </h1> + <p> + {{ "Taper ici les termes de recherche afin de retrouver les documents souhaités."|trans }} + </p> + </div> + </li> + <li data-id="ADV_query"> + <div> + <h1> + {{ "Recherche Avancée"|trans }} + </h1> + <p> + {{ "Séléctionner les champs et les collections sur lesquels vous voulez rechercher."|trans }} + </p> + </div> + </li> + <li data-id="recordtype_sel"> + <div> + <h1> + {{ "Types de documents"|trans }} + </h1> + <p> + {{ "Séléctionner ici le type de document que vous souhaitez rechercher."|trans }} + </p> + </div> + </li> + <li data-id="TOOL_disktt"> + <div> + <h1> + {{ "Barre d'outils"|trans }} + </h1> + <p> + {{ "Utilisez la barre d'outils pour télécharger les documents ou pour agir sur ces documents."|trans }} + </p> + </div> + </li> + <li data-id="answers" data-options="tipLocation:left"> + <div> + <h1> + {{ "Sélection et Prévisualisation de documents"|trans }} + </h1> + <p> + {{ "Sélectionner les documents en cliquant dessus. + Pour sélectionner plusieurs documents, maintenez la touche maj enfoncée et + cliquez sur les documents souhaités. + Pour prévisualier un document cliquez dessus."|trans }} + </p> + </div> + </li> + <li data-id="basket_menu_trigger"> + <div> + <h1> + {{ "Paniers"|trans }} + </h1> + <p> + {{ "Consulter et administrer vos paniers dans cet onglet. + Pour créer un panier et affichez le menu déroulant en cliquant sue la + flèche blanche."|trans }} + </p> + </div> + </li> + <li data-id="answers" data-options="tipLocation:left"> + <div> + <h1> + {{ "Ajouter au panier"|trans }} + </h1> + <p> + {{ "Ajoutez des médias simplement en les faisant glisser vers le panier + désiré et en relachant au dessus."|trans }} + </p> + </div> + </li> + </ol> + {% endif %} + <script type="text/javascript"> {% include "prod/thesaurus.js.twig" %} </script> @@ -1088,5 +1205,19 @@ </script> <script type="text/javascript" id="bitly_loader"></script> + {% if step %} + <script type="text/javascript" src="{{ path('minifier', { 'f' : 'assets/joyride/jquery.cookie.js' }) }}"></script> + <script type="text/javascript" src="{{ path('minifier', { 'f' : 'assets/joyride/modernizr.mq.js' }) }}"></script> + <script type="text/javascript" src="{{ path('minifier', { 'f' : 'assets/joyride/jquery.joyride-2.1.js' }) }}"></script> + <script type="text/javascript"> + $(document).ready(function() { + $("#step_by_step").joyride({ + autoStart : true, + modal:true, + expose: true + }); + }); + </script> + {% endif %} {% endblock %} diff --git a/templates/web/prod/upload/lazaret.html.twig b/templates/web/prod/upload/lazaret.html.twig index 0fab287da0..26114a863c 100644 --- a/templates/web/prod/upload/lazaret.html.twig +++ b/templates/web/prod/upload/lazaret.html.twig @@ -2,13 +2,20 @@ {% if lazaretFiles is not none %} {% if lazaretFiles|length > 0 %} + <div id="QUARANTINE_TOOLBAR_EMPTYING_MSG"></div> <div class="btn-toolbar"> - <div class="btn-group" style="text-align:center; padding:5px 0;"> + <div class="btn-group emptying" style="text-align:center; padding:5px 0;"> + <button class="btn stopempty-lazaret" title="{{ "Stop"|trans }}"> + <img src="/skins/icons/delete.png"> +  <span id="QUARANTINE_TOOLBAR_EMPTYING_TODO"> </span> {{ "Stop"|trans }} + </button> + </div> + <div class="btn-group empty" style="text-align:center; padding:5px 0;"> <button class="btn empty-lazaret" title="{{ "Empty quarantine" | trans }}"> <img src="/skins/icons/delete.png">{{ "Empty quarantine" | trans }} </button> </div> - <div class="btn-group" style="text-align:center; padding:5px 0;"> + <div class="btn-group empty" style="text-align:center; padding:5px 0;"> <button class="btn" title="{{ "Page" | trans }}"> {{ "Page" | trans }} </button> @@ -42,6 +49,8 @@ <script> $('document').ready(function(){ + $(".btn-group.emptying").hide(); + var scope = $('#lazaretBox'); $("#tab-lazaret").scrollTop(0); @@ -90,47 +99,79 @@ $(this).addClass("thumb-selected"); }); + + var emptying = false; // true=emptying, set to false to stop + + // stop emptying lazaret + $('button.stopempty-lazaret', scope).bind('click', function() { + emptying = false; + }); + // empty lazaret $('button.empty-lazaret', scope).bind('click', function(){ + var that = $(this); + if(!confirm("{{ "Empty quarantine will remove all items, are you sure you want to continue ?" | trans }}")) { return false; } - var that = $(this); - $.ajax({ - type : 'POST', - url: '/prod/lazaret/empty/', - dataType: 'json', - data : { - }, - beforeSend: function(){ - startAjax(that); - }, - success: function(data){ - if(data.success){ + $(".btn-group.empty").hide(); + $(".btn-group.emptying").show(); - }else{ - var html = _.template($("#alert_error_tpl").html(), { - content:data.message + var f = function() { + var todo = 0; + var msg_html = ""; + $.ajax({ + type: 'POST', + url: '/prod/lazaret/empty/', + dataType: 'json', + data: { + "max": 10 + }, + success: function (data) { + if (data.success) { + todo = data.result.todo; + $("#QUARANTINE_TOOLBAR_EMPTYING_TODO").text(""+todo); + } else { + emptying = false; // force stop + msg_html = _.template($("#alert_error_tpl").html(), { + content: data.message + }); + } + }, + error: function () { + emptying = false; // force stop + msg_html = _.template($("#alert_error_tpl").html(), { + content: language.errorAjaxRequest }); - - that.closest(".btn-group").before( html ); } - }, - error: function(){ - stopAjax(that); - var html = _.template($("#alert_error_tpl").html(), { - content:language.errorAjaxRequest - }); + }) + .done(function(data) { + if(emptying && todo > 0) { + window.setTimeout(f, 500); // wait between loops + } + }) + .fail(function() { + emptying = false; // force stop + }) + .always(function(){ + if(!emptying || todo <= 0) { + $(".btn-group.emptying").hide(); + $(".btn-group.empty").show(); + if(msg_html != "") { + $("#QUARANTINE_TOOLBAR_EMPTYING_MSG").html(msg_html); + } + else { + reloadContent(true); + } + } + }); + }; - that.closest(".btn-group").before( html ); - }, - complete: function(){ - stopAjax(that); - reloadContent(true); - } - }); + // start emptying + emptying = true; + f(); }); //add lazaret file click action diff --git a/templates/web/prod/upload/upload-flash.html.twig b/templates/web/prod/upload/upload-flash.html.twig index e74036e6ca..708b6723e0 100644 --- a/templates/web/prod/upload/upload-flash.html.twig +++ b/templates/web/prod/upload/upload-flash.html.twig @@ -39,9 +39,13 @@ <td class='uploader-info'> <p> {{ 'You are using the Flash uploader.' | trans }} - {{ 'This version does not allow you to access all the features offered by the HTML5 uploader' | trans }} + {% if not app['browser'].supportFileAPI() %} + {{ 'This version does not allow you to access all the features offered by the HTML5 uploader' | trans }} + {% endif %} </p> - <a href="{{ path('upload_html5_form') }}" class="dialog full-dialog">{{ 'Use the HTML5 uploader' | trans }}</a> + {% if app['browser'].supportFileAPI() %} + <a id="UPLOAD_HTML5_LINK" href="{{ path('upload_html5_form') }}" class="dialog full-dialog">{{ 'Use the HTML5 uploader' | trans }}</a> + {% endif %} </td> </tr> </table> diff --git a/templates/web/prod/upload/upload.html.twig b/templates/web/prod/upload/upload.html.twig index 7fa2e2a22d..2735b3f5e7 100644 --- a/templates/web/prod/upload/upload.html.twig +++ b/templates/web/prod/upload/upload.html.twig @@ -142,22 +142,21 @@ <script> + $(document).ready(function () { - var userAgent = navigator.userAgent.toLowerCase(); - $.browser = { - version: (userAgent.match( /.+(?:rv|it|ra|ie|me)[/: ]([\d.]+)/ ) || [])[1], - chrome: /chrome/.test( userAgent ), - safari: /webkit/.test( userAgent ) && !/chrome/.test( userAgent ), - opera: /opera/.test( userAgent ), - msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), - mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) - }; + var iev=0; + var ieold = (/MSIE (\d+\.\d+);/.test(navigator.userAgent)); + var trident = !!navigator.userAgent.match(/Trident\/7.0/); + var rv=navigator.userAgent.indexOf("rv:11.0"); - if($.browser.msie && parseFloat($.browser.version)>=10) { + if (ieold) iev=new Number(RegExp.$1); + if (navigator.appVersion.indexOf("MSIE 10") != -1) iev=10; + if (trident&&rv!=-1) iev=11; + + if (iev >= 10) { $("#UPLOAD_FLASH_LINK").hide(); } - //Upload management var UploaderManager = new p4.UploaderManager({ container: $('#uploadBox'), diff --git a/templates/web/thesaurus/thesaurus.html.twig b/templates/web/thesaurus/thesaurus.html.twig index e74e18be74..ecbcb7d52b 100644 --- a/templates/web/thesaurus/thesaurus.html.twig +++ b/templates/web/thesaurus/thesaurus.html.twig @@ -1011,6 +1011,7 @@ case "kterm_newts": // nouveau terme specifique case "kterm_newsy": // nouveau synonyme var typ = menuelem_id=="kterm_newts" ? "TS" : "SY"; + $("#NEWSY_DLG input[type=\"text\"]").val(""); $("#NEWSY_DLG .label").html( typ=="TS" ? "{{ 'thesaurus:: terme' | trans }}" : "{{ 'thesaurus:: synonyme' | trans }}" ); diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Client/RootTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Client/RootTest.php index e9123c96cd..2d383f7cb4 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Client/RootTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Client/RootTest.php @@ -14,6 +14,6 @@ class RootTest extends \PhraseanetAuthenticatedWebTestCase $this->authenticate(self::$DI['app']); self::$DI['client']->request("GET", "/client/"); - $this->assertTrue(self::$DI['client']->getResponse()->isRedirect()); + $this->assertTrue(self::$DI['client']->getResponse()->isOk()); } } diff --git a/www/scripts/apps/login/home/config.js b/www/scripts/apps/login/home/config.js index dd62d757a9..c83d10cd49 100644 --- a/www/scripts/apps/login/home/config.js +++ b/www/scripts/apps/login/home/config.js @@ -15,9 +15,9 @@ require.config({ "jquery.ui": "../assets/jquery.ui/jquery-ui", underscore: "../assets/underscore-amd/underscore", backbone: "../assets/backbone-amd/backbone", - i18n: "../assets/i18next/i18next.amd-1.6.3", - bootstrap: "../assets/bootstrap/js/bootstrap.min", - multiselect: "../assets/bootstrap-multiselect/js/bootstrap-multiselect", + i18n: "../assets/i18next/release/i18next.amd-1.6.2.min", + bootstrap: "../skins/build/bootstrap/js/bootstrap.min", + multiselect: "../assets/bootstrap-multiselect/dist/js/bootstrap-multiselect", "jquery.geonames": "../assets/geonames-server-jquery-plugin/jquery.geonames" }, shim: { diff --git a/www/skins/admin/css/Bases.css b/www/skins/admin/css/Bases.css index 0b88c91512..c60c60819e 100644 --- a/www/skins/admin/css/Bases.css +++ b/www/skins/admin/css/Bases.css @@ -75,3 +75,8 @@ div[id$="_indexed_percent"] { a.btn { text-decoration: none; } + +.status-img { + max-width: 16px; + max-heigh: 16px; +} diff --git a/www/skins/prod/000000/prodcolor.css b/www/skins/prod/000000/prodcolor.css index e2e647f689..d8dbd3b535 100644 --- a/www/skins/prod/000000/prodcolor.css +++ b/www/skins/prod/000000/prodcolor.css @@ -4360,3 +4360,8 @@ ui-dialog-titlebar { max-width: 16px; max-heigh: 16px; } + +#answers .status img { + max-width: 16px; + max-heigh: 16px; +} \ No newline at end of file diff --git a/www/skins/prod/959595/prodcolor.css b/www/skins/prod/959595/prodcolor.css index e7dcff7bb7..4a748d3b80 100644 --- a/www/skins/prod/959595/prodcolor.css +++ b/www/skins/prod/959595/prodcolor.css @@ -4364,3 +4364,8 @@ ui-dialog-titlebar { max-width: 16px; max-heigh: 16px; } + +#answers .status img { + max-width: 16px; + max-heigh: 16px; +} \ No newline at end of file diff --git a/www/skins/prod/jquery.main-prod.js b/www/skins/prod/jquery.main-prod.js index ed6e729a06..7d75afc4a7 100644 --- a/www/skins/prod/jquery.main-prod.js +++ b/www/skins/prod/jquery.main-prod.js @@ -762,6 +762,7 @@ $(document).ready(function () { var $record_types = $('#recordtype_sel'); if ($this.hasClass('mode_type_reg')) { $record_types.hide(); + $record_types.prop("selectedIndex", 0); } else { $record_types.show(); }