diff --git a/lib/Alchemy/Phrasea/PhraseanetService/Controller/PSExposeController.php b/lib/Alchemy/Phrasea/PhraseanetService/Controller/PSExposeController.php index ec72aaadd7..1f265f7134 100644 --- a/lib/Alchemy/Phrasea/PhraseanetService/Controller/PSExposeController.php +++ b/lib/Alchemy/Phrasea/PhraseanetService/Controller/PSExposeController.php @@ -185,6 +185,7 @@ public function listPublicationAction(PhraseaApplication $app, Request $request) { $exposeName = $request->get('exposeName'); $page = empty($request->get('page')) ? 1 : $request->get('page'); + $title = urlencode($request->get('title')); if ($exposeName == null) { return $app->json([ @@ -253,7 +254,8 @@ public function listPublicationAction(PhraseaApplication $app, Request $request) $exposeClient = $proxyConfig->getClientWithOptions($clientOptions); try { - $uri = '/publications?flatten=true&order[createdAt]=desc&page=' . $page; + $uri = '/publications?flatten=true&order[createdAt]=desc&page=' . $page . '&title=' . $title; + if ($request->get('mine') && $exposeConfiguration['connection_kind'] === 'password') { $uri .= '&mine=true'; } @@ -307,9 +309,22 @@ public function listPublicationAction(PhraseaApplication $app, Request $request) $exposeFrontBasePath = \p4string::addEndSlash($exposeConfiguration['expose_front_uri']); if ($request->get('format') == 'pub-list') { + $publicationsList = []; + + foreach ($publications as $key => $publication) { + $publicationsList[$key]['id'] = $basePath . '/' . $publication['id']; + $publicationsList[$key]['text'] = $publication['title']; + } + + $pagination = ['more' => false]; + if ($nextPage) { + $pagination = ['more' => true]; + } + return $app->json([ - 'publications' => $publications, - 'basePath' => $basePath + 'publications' => $publicationsList, + 'basePath' => $basePath, + 'pagination' => $pagination ]); } diff --git a/package.json b/package.json index ed013eae32..b9cf58b97d 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "npm-modernizr": "^2.8.3", "pusher-js": "^8.3.0", "requirejs": "^2.3.5", + "select2": "^4.1.0-rc.0", "tinymce": "^4.0.28", "underscore": "^1.8.3", "zxcvbn": "^4.4.2" diff --git a/resources/gulp/build.js b/resources/gulp/build.js index 9ac912d5e5..4f7cc205da 100644 --- a/resources/gulp/build.js +++ b/resources/gulp/build.js @@ -51,6 +51,7 @@ gulp.task('build-vendors', [ 'build-jquery-test-paths', 'build-simple-colorpicker', 'build-jquery-datetimepicker', - 'build-pusher-js' + 'build-pusher-js', + 'build-select2' ], function () { }); diff --git a/resources/gulp/components/vendors/select2.js b/resources/gulp/components/vendors/select2.js new file mode 100644 index 0000000000..66826eced0 --- /dev/null +++ b/resources/gulp/components/vendors/select2.js @@ -0,0 +1,8 @@ +var gulp = require('gulp'); +var config = require('../../config.js'); +var utils = require('../../utils.js'); + +gulp.task('build-select2', [], function(){ + return gulp.src([config.paths.nodes + 'select2/**']) + .pipe(gulp.dest(config.paths.build + 'vendors/select2')); +}); diff --git a/templates/web/prod/WorkZone/ExposeEdit.html.twig b/templates/web/prod/WorkZone/ExposeEdit.html.twig index 9e207466b3..1dafd340c0 100644 --- a/templates/web/prod/WorkZone/ExposeEdit.html.twig +++ b/templates/web/prod/WorkZone/ExposeEdit.html.twig @@ -44,13 +44,13 @@