From 6253033e4329814c36b3d66ae7b0a6adca8c644f Mon Sep 17 00:00:00 2001 From: aina esokia Date: Mon, 30 Nov 2020 15:18:40 +0300 Subject: [PATCH 01/57] PHRAS-3276 invert push and validation string event --- lib/Alchemy/Phrasea/Controller/Prod/PushController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Prod/PushController.php b/lib/Alchemy/Phrasea/Controller/Prod/PushController.php index a4de6b17ad..648cf715d1 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/PushController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/PushController.php @@ -146,7 +146,7 @@ class PushController extends Controller $this->getDataboxLogger($element->getDatabox())->log( $element, - Session_Logger::EVENT_VALIDATE, + Session_Logger::EVENT_PUSH, $user_receiver->getId(), '' ); @@ -386,7 +386,7 @@ class PushController extends Controller $this->getDataboxLogger($basketElement->getRecord($this->app)->getDatabox())->log( $basketElement->getRecord($this->app), - Session_Logger::EVENT_PUSH, + Session_Logger::EVENT_VALIDATE, $participantUser->getId(), '' ); From c3a2a71105cfe638d16ee3adfc5b4e3aa1e0ccbb Mon Sep 17 00:00:00 2001 From: aina esokia Date: Mon, 7 Dec 2020 16:09:37 +0300 Subject: [PATCH 02/57] PHRAS-3276 update log_docs action push and validate --- lib/classes/patch/413.php | 79 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 lib/classes/patch/413.php diff --git a/lib/classes/patch/413.php b/lib/classes/patch/413.php new file mode 100644 index 0000000000..e4c2e43930 --- /dev/null +++ b/lib/classes/patch/413.php @@ -0,0 +1,79 @@ +release; + } + + /** + * {@inheritdoc} + */ + public function getDoctrineMigrations() + { + return []; + } + + /** + * {@inheritdoc} + */ + public function require_all_upgrades() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function concern() + { + return $this->concern; + } + + /** + * {@inheritdoc} + */ + public function apply(base $databox, Application $app) + { + // add a new temp action + $sql = "ALTER TABLE log_docs CHANGE action action ENUM('push','add','validate','edit','collection','status','print','substit','publish','download','mail','ftp','delete','to_do','') CHARACTER SET ascii COLLATE ascii_bin NOT NULL"; + $stmt = $databox->get_connection()->prepare($sql); + $stmt->execute(); + $stmt->closeCursor(); + + $sql = "UPDATE log_docs SET action = 'to_do' where action = 'push'"; + $stmt = $databox->get_connection()->prepare($sql); + $stmt->execute(); + $stmt->closeCursor(); + + $sql = "UPDATE log_docs SET action = 'push' where action = 'validate'"; + $stmt = $databox->get_connection()->prepare($sql); + $stmt->execute(); + $stmt->closeCursor(); + + $sql = "UPDATE log_docs SET action = 'validate' where action = 'to_do'"; + $stmt = $databox->get_connection()->prepare($sql); + $stmt->execute(); + $stmt->closeCursor(); + + // remove temp action + $sql = "ALTER TABLE log_docs CHANGE action action ENUM('push','add','validate','edit','collection','status','print','substit','publish','download','mail','ftp','delete','') CHARACTER SET ascii COLLATE ascii_bin NOT NULL"; + $stmt = $databox->get_connection()->prepare($sql); + $stmt->execute(); + $stmt->closeCursor(); + + return true; + } +} From a8b16f065f37611fffabca73439a7f9e89aa044d Mon Sep 17 00:00:00 2001 From: aina esokia Date: Wed, 9 Dec 2020 14:42:46 +0300 Subject: [PATCH 03/57] PHRAS-3276 remove patch and move to PHRAS-3278 --- lib/classes/patch/413.php | 79 --------------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 lib/classes/patch/413.php diff --git a/lib/classes/patch/413.php b/lib/classes/patch/413.php deleted file mode 100644 index e4c2e43930..0000000000 --- a/lib/classes/patch/413.php +++ /dev/null @@ -1,79 +0,0 @@ -release; - } - - /** - * {@inheritdoc} - */ - public function getDoctrineMigrations() - { - return []; - } - - /** - * {@inheritdoc} - */ - public function require_all_upgrades() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function concern() - { - return $this->concern; - } - - /** - * {@inheritdoc} - */ - public function apply(base $databox, Application $app) - { - // add a new temp action - $sql = "ALTER TABLE log_docs CHANGE action action ENUM('push','add','validate','edit','collection','status','print','substit','publish','download','mail','ftp','delete','to_do','') CHARACTER SET ascii COLLATE ascii_bin NOT NULL"; - $stmt = $databox->get_connection()->prepare($sql); - $stmt->execute(); - $stmt->closeCursor(); - - $sql = "UPDATE log_docs SET action = 'to_do' where action = 'push'"; - $stmt = $databox->get_connection()->prepare($sql); - $stmt->execute(); - $stmt->closeCursor(); - - $sql = "UPDATE log_docs SET action = 'push' where action = 'validate'"; - $stmt = $databox->get_connection()->prepare($sql); - $stmt->execute(); - $stmt->closeCursor(); - - $sql = "UPDATE log_docs SET action = 'validate' where action = 'to_do'"; - $stmt = $databox->get_connection()->prepare($sql); - $stmt->execute(); - $stmt->closeCursor(); - - // remove temp action - $sql = "ALTER TABLE log_docs CHANGE action action ENUM('push','add','validate','edit','collection','status','print','substit','publish','download','mail','ftp','delete','') CHARACTER SET ascii COLLATE ascii_bin NOT NULL"; - $stmt = $databox->get_connection()->prepare($sql); - $stmt->execute(); - $stmt->closeCursor(); - - return true; - } -} From 1efa7b4c1d8d85bbf951566372999368f5eed68e Mon Sep 17 00:00:00 2001 From: aina esokia Date: Tue, 5 Jan 2021 15:51:24 +0300 Subject: [PATCH 04/57] PHRAS-3322 add basket action --- .../src/components/record/addToBasket.js | 2 +- .../src/components/ui/workzone/index.js | 43 ++++++++++--------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/Phraseanet-production-client/src/components/record/addToBasket.js b/Phraseanet-production-client/src/components/record/addToBasket.js index 95a31f9b5a..c898896b02 100644 --- a/Phraseanet-production-client/src/components/record/addToBasket.js +++ b/Phraseanet-production-client/src/components/record/addToBasket.js @@ -11,7 +11,7 @@ const addToBasket = (services) => { let dbId = $el.data('db-id'); let recordId = $el.data('record-id'); appEvents.emit('workzone.doAddToBasket', { - dbId, recordId, event: event.currentTarget + dbId, recordId, event: event.currentTarget, singleSelection: true }); }); }; diff --git a/Phraseanet-production-client/src/components/ui/workzone/index.js b/Phraseanet-production-client/src/components/ui/workzone/index.js index 4a399757ff..20a5a4df53 100644 --- a/Phraseanet-production-client/src/components/ui/workzone/index.js +++ b/Phraseanet-production-client/src/components/ui/workzone/index.js @@ -214,11 +214,11 @@ const workzone = (services) => { selection: new Selectable(services, $('#baskets'), {selector: '.CHIM'}), refresh: refreshBaskets, addElementToBasket: function (options) { - let {sbas_id, record_id, event, singleSelection} = options; + let {dbId, recordId, event, singleSelection} = options; singleSelection = !!singleSelection || false; if ($('#baskets .SSTT.active').length === 1) { - return dropOnBask(event, $('#IMGT_' + sbas_id + '_' + record_id), $('#baskets .SSTT.active'), singleSelection); + return dropOnBask(event, $('#IMGT_' + dbId + '_' + recordId), $('#baskets .SSTT.active'), singleSelection); } else { humane.info(localeService.t('noActiveBasket')); } @@ -1129,26 +1129,29 @@ const workzone = (services) => { let publicationId = destKey.attr('data-publication-id'); let exposeName = $('#expose_list').val(); let assetsContainer = destKey.find('.expose_item_deployed'); - assetsContainer.empty().addClass('loading'); - $.ajax({ - type: 'POST', - url: '/prod/expose/publication/add-assets', - data: { - publicationId: publicationId, - exposeName: exposeName, - lst: data.lst - }, - dataType: 'json', - success: function (data) { - setTimeout(function(){ - getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1); - } - , 6000); + if (publicationId !== undefined) { + assetsContainer.empty().addClass('loading'); - console.log(data.message); - } - }); + $.ajax({ + type: 'POST', + url: '/prod/expose/publication/add-assets', + data: { + publicationId: publicationId, + exposeName: exposeName, + lst: data.lst + }, + dataType: 'json', + success: function (data) { + setTimeout(function(){ + getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1); + } + , 6000); + + console.log(data.message); + } + }); + } } } From 56d1374db57f55610af8d2523e77011b5b695c8f Mon Sep 17 00:00:00 2001 From: aina esokia Date: Tue, 5 Jan 2021 15:52:34 +0300 Subject: [PATCH 05/57] PHRAS-3268 delete record from basket --- .../src/components/ui/workzone/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Phraseanet-production-client/src/components/ui/workzone/index.js b/Phraseanet-production-client/src/components/ui/workzone/index.js index 20a5a4df53..e347169fef 100644 --- a/Phraseanet-production-client/src/components/ui/workzone/index.js +++ b/Phraseanet-production-client/src/components/ui/workzone/index.js @@ -373,7 +373,7 @@ const workzone = (services) => { }); function WorkZoneElementRemover(el, confirm) { - var context = el.data('context'); + var context = $(el).data('context'); if (confirm !== true && $(el).hasClass('groupings') && warnOnRemove) { var buttons = {}; From b9f07b99645ff586325fa8ec4cadd43d5d5473fa Mon Sep 17 00:00:00 2001 From: aina esokia Date: Tue, 5 Jan 2021 15:55:38 +0300 Subject: [PATCH 06/57] PHRAS-3322 generate dist --- .../dist/production.js | 47 ++++++++++--------- .../dist/production.min.js | 47 ++++++++++--------- 2 files changed, 50 insertions(+), 44 deletions(-) diff --git a/Phraseanet-production-client/dist/production.js b/Phraseanet-production-client/dist/production.js index 2b1c8ef5b3..18b0217bd0 100644 --- a/Phraseanet-production-client/dist/production.js +++ b/Phraseanet-production-client/dist/production.js @@ -10230,15 +10230,15 @@ var workzone = function workzone(services) { selection: new _selectable2.default(services, (0, _jquery2.default)('#baskets'), { selector: '.CHIM' }), refresh: refreshBaskets, addElementToBasket: function addElementToBasket(options) { - var sbas_id = options.sbas_id, - record_id = options.record_id, + var dbId = options.dbId, + recordId = options.recordId, event = options.event, singleSelection = options.singleSelection; singleSelection = !!singleSelection || false; if ((0, _jquery2.default)('#baskets .SSTT.active').length === 1) { - return dropOnBask(event, (0, _jquery2.default)('#IMGT_' + sbas_id + '_' + record_id), (0, _jquery2.default)('#baskets .SSTT.active'), singleSelection); + return dropOnBask(event, (0, _jquery2.default)('#IMGT_' + dbId + '_' + recordId), (0, _jquery2.default)('#baskets .SSTT.active'), singleSelection); } else { humane.info(localeService.t('noActiveBasket')); } @@ -10397,7 +10397,7 @@ var workzone = function workzone(services) { }); function WorkZoneElementRemover(el, confirm) { - var context = el.data('context'); + var context = (0, _jquery2.default)(el).data('context'); if (confirm !== true && (0, _jquery2.default)(el).hasClass('groupings') && warnOnRemove) { var buttons = {}; @@ -11125,25 +11125,28 @@ var workzone = function workzone(services) { var publicationId = destKey.attr('data-publication-id'); var exposeName = (0, _jquery2.default)('#expose_list').val(); var assetsContainer = destKey.find('.expose_item_deployed'); - assetsContainer.empty().addClass('loading'); - _jquery2.default.ajax({ - type: 'POST', - url: '/prod/expose/publication/add-assets', - data: { - publicationId: publicationId, - exposeName: exposeName, - lst: data.lst - }, - dataType: 'json', - success: function success(data) { - setTimeout(function () { - getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1); - }, 6000); + if (publicationId !== undefined) { + assetsContainer.empty().addClass('loading'); - console.log(data.message); - } - }); + _jquery2.default.ajax({ + type: 'POST', + url: '/prod/expose/publication/add-assets', + data: { + publicationId: publicationId, + exposeName: exposeName, + lst: data.lst + }, + dataType: 'json', + success: function success(data) { + setTimeout(function () { + getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1); + }, 6000); + + console.log(data.message); + } + }); + } } } @@ -63419,7 +63422,7 @@ var addToBasket = function addToBasket(services) { var dbId = $el.data('db-id'); var recordId = $el.data('record-id'); appEvents.emit('workzone.doAddToBasket', { - dbId: dbId, recordId: recordId, event: event.currentTarget + dbId: dbId, recordId: recordId, event: event.currentTarget, singleSelection: true }); }); }; diff --git a/Phraseanet-production-client/dist/production.min.js b/Phraseanet-production-client/dist/production.min.js index 2b1c8ef5b3..18b0217bd0 100644 --- a/Phraseanet-production-client/dist/production.min.js +++ b/Phraseanet-production-client/dist/production.min.js @@ -10230,15 +10230,15 @@ var workzone = function workzone(services) { selection: new _selectable2.default(services, (0, _jquery2.default)('#baskets'), { selector: '.CHIM' }), refresh: refreshBaskets, addElementToBasket: function addElementToBasket(options) { - var sbas_id = options.sbas_id, - record_id = options.record_id, + var dbId = options.dbId, + recordId = options.recordId, event = options.event, singleSelection = options.singleSelection; singleSelection = !!singleSelection || false; if ((0, _jquery2.default)('#baskets .SSTT.active').length === 1) { - return dropOnBask(event, (0, _jquery2.default)('#IMGT_' + sbas_id + '_' + record_id), (0, _jquery2.default)('#baskets .SSTT.active'), singleSelection); + return dropOnBask(event, (0, _jquery2.default)('#IMGT_' + dbId + '_' + recordId), (0, _jquery2.default)('#baskets .SSTT.active'), singleSelection); } else { humane.info(localeService.t('noActiveBasket')); } @@ -10397,7 +10397,7 @@ var workzone = function workzone(services) { }); function WorkZoneElementRemover(el, confirm) { - var context = el.data('context'); + var context = (0, _jquery2.default)(el).data('context'); if (confirm !== true && (0, _jquery2.default)(el).hasClass('groupings') && warnOnRemove) { var buttons = {}; @@ -11125,25 +11125,28 @@ var workzone = function workzone(services) { var publicationId = destKey.attr('data-publication-id'); var exposeName = (0, _jquery2.default)('#expose_list').val(); var assetsContainer = destKey.find('.expose_item_deployed'); - assetsContainer.empty().addClass('loading'); - _jquery2.default.ajax({ - type: 'POST', - url: '/prod/expose/publication/add-assets', - data: { - publicationId: publicationId, - exposeName: exposeName, - lst: data.lst - }, - dataType: 'json', - success: function success(data) { - setTimeout(function () { - getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1); - }, 6000); + if (publicationId !== undefined) { + assetsContainer.empty().addClass('loading'); - console.log(data.message); - } - }); + _jquery2.default.ajax({ + type: 'POST', + url: '/prod/expose/publication/add-assets', + data: { + publicationId: publicationId, + exposeName: exposeName, + lst: data.lst + }, + dataType: 'json', + success: function success(data) { + setTimeout(function () { + getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1); + }, 6000); + + console.log(data.message); + } + }); + } } } @@ -63419,7 +63422,7 @@ var addToBasket = function addToBasket(services) { var dbId = $el.data('db-id'); var recordId = $el.data('record-id'); appEvents.emit('workzone.doAddToBasket', { - dbId: dbId, recordId: recordId, event: event.currentTarget + dbId: dbId, recordId: recordId, event: event.currentTarget, singleSelection: true }); }); }; From 231ce25b54acc42b3993df3f738c6ca7f4a15c45 Mon Sep 17 00:00:00 2001 From: aina esokia Date: Wed, 6 Jan 2021 15:40:15 +0300 Subject: [PATCH 07/57] remove export item --- templates/web/prod/WorkZone/Macros.html.twig | 23 -------------------- 1 file changed, 23 deletions(-) diff --git a/templates/web/prod/WorkZone/Macros.html.twig b/templates/web/prod/WorkZone/Macros.html.twig index 9b683b1d1d..45c44e1cc8 100644 --- a/templates/web/prod/WorkZone/Macros.html.twig +++ b/templates/web/prod/WorkZone/Macros.html.twig @@ -76,11 +76,6 @@
-
-
{{ 'action::exporter' | trans }} -
-
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANMODIFRECORD')) %}