diff --git a/config/configuration.sample.yml b/config/configuration.sample.yml index 9173e61f5b..f488003af9 100644 --- a/config/configuration.sample.yml +++ b/config/configuration.sample.yml @@ -279,6 +279,7 @@ registry: api-subdef_service: false actions: export-stamp-choice: false + stamp-subdefs: false crossdomain: site-control: 'master-only' allow-access-from: diff --git a/lib/Alchemy/Phrasea/Controller/Admin/CollectionController.php b/lib/Alchemy/Phrasea/Controller/Admin/CollectionController.php index 89409b6958..d192fafbf6 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/CollectionController.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/CollectionController.php @@ -803,7 +803,9 @@ class CollectionController extends Controller try { if ('' !== trim($prefs)) { $domdoc = new \DOMDocument(); - if (true === @$domdoc->loadXML($prefs)) { + if (true === @$domdoc->loadXML($prefs, LIBXML_NONET | LIBXML_NOBLANKS)) { + $domdoc->formatOutput = true; + $domdoc->saveXML(null, LIBXML_NOEMPTYTAG); $collection->set_prefs($domdoc); $success = true; } diff --git a/lib/Alchemy/Phrasea/Controller/Prod/DownloadController.php b/lib/Alchemy/Phrasea/Controller/Prod/DownloadController.php index 55d08f9a2e..5fc51d2ff0 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/DownloadController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/DownloadController.php @@ -15,6 +15,7 @@ use Alchemy\Phrasea\Core\Configuration\PropertyAccess; use Alchemy\Phrasea\Core\Event\DownloadAsyncEvent; use Alchemy\Phrasea\Core\Event\ExportEvent; use Alchemy\Phrasea\Core\PhraseaEvents; +use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem; use Alchemy\Phrasea\Model\Manipulator\TokenManipulator; use set_export; use Symfony\Component\HttpFoundation\JsonResponse; @@ -42,7 +43,7 @@ class DownloadController extends Controller $ssttid = $request->request->get('ssttid', ''); $subdefs = $request->request->get('obj', []); - $download = new \set_export($this->app, $lst, $ssttid); + $download = new set_export($this->app, $lst, $ssttid); if (0 === $download->get_total_download()) { $this->app->abort(403); @@ -50,11 +51,13 @@ class DownloadController extends Controller $list = $download->prepare_export( $this->getAuthenticatedUser(), - $this->app['filesystem'], + $this->getFilesystem(), $subdefs, $request->request->get('type') === 'title' ? true : false, $request->request->get('businessfields'), - $request->request->get('stamp_choice') === "NO_STAMP" ? \set_export::NO_STAMP : \set_export::STAMP_SYNC + set_export::STAMP_SYNC, + $request->request->get('stamp_choice') === "REMOVE_STAMP", + false ); $list['export_name'] = sprintf('%s.zip', $download->getExportName()); @@ -89,7 +92,7 @@ class DownloadController extends Controller $ssttid = $request->request->get('ssttid', ''); $subdefs = $request->request->get('obj', []); - $download = new \set_export($this->app, $lst, $ssttid); + $download = new set_export($this->app, $lst, $ssttid); if (0 === $download->get_total_download()) { $this->app->abort(403); @@ -103,12 +106,12 @@ class DownloadController extends Controller $list = $download->prepare_export( $this->getAuthenticatedUser(), - $this->app['filesystem'], + $this->getFilesystem(), $subdefs, $request->request->get('type') === 'title' ? true : false, $request->request->get('businessfields'), - // do not stamp now, worker will do - $stamp_method, + set_export::STAMP_ASYNC, + $request->request->get('stamp_choice') === "REMOVE_STAMP", true ); $list['export_name'] = sprintf('%s.zip', $download->getExportName()); @@ -212,4 +215,11 @@ class DownloadController extends Controller { return $this->app['session']; } + /** + * @return PhraseanetFilesystem + */ + private function getFilesystem() + { + return $this->app['filesystem']; + } } diff --git a/lib/Alchemy/Phrasea/Controller/Prod/ExportController.php b/lib/Alchemy/Phrasea/Controller/Prod/ExportController.php index 4ef91b65c5..6ccea28428 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/ExportController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/ExportController.php @@ -9,6 +9,7 @@ */ namespace Alchemy\Phrasea\Controller\Prod; +use ACL; use Alchemy\Phrasea\Application\Helper\DispatcherAware; use Alchemy\Phrasea\Application\Helper\FilesystemAware; use Alchemy\Phrasea\Application\Helper\NotifierAware; @@ -19,6 +20,8 @@ use Alchemy\Phrasea\Core\PhraseaEvents; use Alchemy\Phrasea\Model\Manipulator\TokenManipulator; use Alchemy\Phrasea\WorkerManager\Event\ExportFtpEvent; use Alchemy\Phrasea\WorkerManager\Event\WorkerEvents; +use DOMDocument; +use DOMXPath; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -29,6 +32,15 @@ class ExportController extends Controller use FilesystemAware; use NotifierAware; + /** + * @return ACL + */ + private function getAclForConnectedUser() + { + return $this->getAclForUser($this->getAuthenticatedUser()); + } + + /** * Display form to export documents * @@ -44,17 +56,63 @@ class ExportController extends Controller $request->request->get('story') ); + // we must propose "do not stamp" when at least one collection is stamped AND the user has right to + // remove stamp on this collection + $removeable_stamp = false; // true if at least one coll is "unstampable" + $removeable_stamp_by_base = []; // unset: no stamp ; false: stamp not "unstampable" ; true: stamp "unstampable" + + $colls_manageable = array_keys($this->getAclForConnectedUser()->get_granted_base([ACL::COLL_MANAGE]) ?? []); + $dbox_manageable = array_keys($this->getAclForConnectedUser()->get_granted_sbas([ACL::BAS_MANAGE]) ?? []); + + foreach($download->get_elements() as $recordAdapter) { + // check collection only once + if(array_key_exists($bid = $recordAdapter->getCollection()->get_base_id(), $removeable_stamp_by_base)) { + continue; + } + // check stamp + $domprefs = new DOMDocument(); + if ( !$domprefs->loadXML($recordAdapter->getCollection()->get_prefs()) ) { + continue; + } + $xpprefs = new DOMXPath($domprefs); + if ($xpprefs->query('/baseprefs/stamp')->length == 0) { + // the collection has no stamp settings + continue; + } + unset($domprefs); + // the collection has stamp, check user's right to remove it + $removeable_stamp_by_base[$bid] = false; + switch ((string)$this->getConf()->get(['registry', 'actions', 'export-stamp-choice'], false)) { + case '1': // == (string)true + // everybody can remove stamp (bc) + $removeable_stamp_by_base[$bid] = $removeable_stamp = true; + break; + case 'manage_collection': + if (in_array($bid, $colls_manageable)) { + $removeable_stamp_by_base[$bid] = $removeable_stamp = true; + } + break; + case 'manage_databox': + if (in_array($recordAdapter->getDatabox()->get_sbas_id(), $dbox_manageable)) { + $removeable_stamp_by_base[$bid] = $removeable_stamp = true; + } + break; + } + } + $this->setSessionFormToken('prodExportDownload'); $this->setSessionFormToken('prodExportEmail'); $this->setSessionFormToken('prodExportFTP'); $this->setSessionFormToken('prodExportOrder'); return new Response($this->render('common/dialog_export.html.twig', [ - 'download' => $download, - 'ssttid' => $request->request->get('ssel'), - 'lst' => $download->serialize_list(), - 'default_export_title' => $this->getConf()->get(['registry', 'actions', 'default-export-title']), - 'choose_export_title' => $this->getConf()->get(['registry', 'actions', 'export-title-choice']) + 'download' => $download, + 'ssttid' => $request->request->get('ssel'), + 'lst' => $download->serialize_list(), + 'default_export_title' => $this->getConf()->get(['registry', 'actions', 'default-export-title']), + 'choose_export_title' => $this->getConf()->get(['registry', 'actions', 'export-title-choice']), + 'removeable_stamp' => $removeable_stamp, + 'removeable_stamp_by_base' => $removeable_stamp_by_base, ])); } @@ -123,7 +181,9 @@ class ExportController extends Controller $request->request->get('obj'), false, $request->request->get('businessfields'), - $request->request->get('stamp_choice') === "NO_STAMP" ? \set_export::NO_STAMP : \set_export::STAMP_ASYNC + \set_export::STAMP_ASYNC, + $request->request->get('stamp_choice') === "REMOVE_STAMP", + false ); $exportFtpId = $download->export_ftp( @@ -181,7 +241,8 @@ class ExportController extends Controller (array) $request->request->get('obj'), $request->request->get("type") == "title" ? : false, $request->request->get('businessfields'), - $request->request->get('stamp_choice') === "NO_STAMP" ? \set_export::NO_STAMP : \set_export::STAMP_ASYNC, + \set_export::STAMP_ASYNC, + $request->request->get('stamp_choice') === "REMOVE_STAMP", true ); diff --git a/lib/Alchemy/Phrasea/ControllerProvider/Admin/Collection.php b/lib/Alchemy/Phrasea/ControllerProvider/Admin/Collection.php index 2daaf273f4..1e6e863aad 100644 --- a/lib/Alchemy/Phrasea/ControllerProvider/Admin/Collection.php +++ b/lib/Alchemy/Phrasea/ControllerProvider/Admin/Collection.php @@ -52,10 +52,12 @@ class Collection implements ControllerProviderInterface, ServiceProviderInterfac ->assert('bas_id', '\d+') ->bind('admin_display_collection'); + /** @uses CollectionController::getSuggestedValues */ $controllers->get('/{bas_id}/suggested-values/', 'controller.admin.collection:getSuggestedValues') ->assert('bas_id', '\d+') ->bind('admin_collection_display_suggested_values'); + /** @uses CollectionController::submitSuggestedValues */ $controllers->post('/{bas_id}/suggested-values/', 'controller.admin.collection:submitSuggestedValues') ->assert('bas_id', '\d+') ->bind('admin_collection_submit_suggested_values'); diff --git a/lib/Alchemy/Phrasea/Order/Controller/ApiOrderController.php b/lib/Alchemy/Phrasea/Order/Controller/ApiOrderController.php index c61e27d1c6..bb802fb966 100644 --- a/lib/Alchemy/Phrasea/Order/Controller/ApiOrderController.php +++ b/lib/Alchemy/Phrasea/Order/Controller/ApiOrderController.php @@ -189,7 +189,16 @@ class ApiOrderController extends BaseOrderController $subdefs = $this->findDataboxSubdefNames(); try { - $exportData = $export->prepare_export($user, $this->getFilesystem(), $subdefs, true, true, false); + $exportData = $export->prepare_export( + $user, + $this->getFilesystem(), + $subdefs, + true, + true, + \set_export::STAMP_SYNC, + false, + false + ); } catch (\Exception $e) { throw new NotFoundHttpException(sprintf('No archive could be downloaded for Order "%d"', $order->getId())); diff --git a/lib/Alchemy/Phrasea/WorkerManager/Worker/DownloadAsyncWorker.php b/lib/Alchemy/Phrasea/WorkerManager/Worker/DownloadAsyncWorker.php index f735db799f..f7618ba8c1 100644 --- a/lib/Alchemy/Phrasea/WorkerManager/Worker/DownloadAsyncWorker.php +++ b/lib/Alchemy/Phrasea/WorkerManager/Worker/DownloadAsyncWorker.php @@ -218,7 +218,7 @@ class DownloadAsyncWorker implements WorkerInterface } foreach($v_file['subdefs'] as $k_subdef => $v_subdef) { - if($k_subdef === "document" && $v_subdef['to_stamp']) { + if($v_subdef['to_stamp']) { // we must stamp this document try { if(!$record) { diff --git a/lib/classes/recordutils/image.php b/lib/classes/recordutils/image.php index 6fd4aa5031..718c782baf 100644 --- a/lib/classes/recordutils/image.php +++ b/lib/classes/recordutils/image.php @@ -15,6 +15,7 @@ use Imagine\Exception\Exception as ImagineException; use Imagine\Image\Box; use Imagine\Image\ImagineInterface; use Imagine\Image\Palette\RGB; +use Imagine\Image\Palette\Color\ColorInterface; use Imagine\Image\Point; use MediaVorus\Media\Image; use MediaVorus\Media\MediaInterface; @@ -47,19 +48,22 @@ class recordutils_image } $xmlToColor = function ($attr, $ret = [255, 255, 255]) use ($palette) { - try { - $alpha = 100; - $attr = explode(',', $attr); - if (count($attr) == 4) { - // 0..127 -> 100..0 - $alpha = (int)((127 - (int)array_pop($attr)) / 1.27); - } + if($attr !== null) { + try { + $alpha = 100; + $attr = explode(',', $attr); + if (count($attr) == 4) { + // 0..127 -> 100..0 + $alpha = (int)((127 - (int)array_pop($attr)) / 1.27); + } - return $palette->color($attr, $alpha); - } - catch (ImagineException $e) { - return $palette->color($ret); + return $palette->color($attr, $alpha); + } + catch (ImagineException $e) { + return $palette->color($ret); + } } + return null; }; $base_id = $subdef->get_record()->getBaseId(); @@ -287,10 +291,11 @@ class recordutils_image if ($txtline != '') { $wrap = static::wrap($imagine, $fontsize, 0, __DIR__ . '/../../../resources/Fonts/arial.ttf', $txtline, $text_width); $txtblock[] = [ - 'fontsize' => $fontsize, - 'fontcolor' => $xmlToColor($texts->item($i)->getAttribute('color'), [0, 0, 0]), - 'h' => $wrap['toth'], - 'lines' => $wrap['l'] + 'fontsize' => $fontsize, + 'fontcolor' => $xmlToColor($texts->item($i)->getAttribute('color'), [0, 0, 0]), + 'shadowcolor' => $xmlToColor($texts->item($i)->getAttribute('shadow'), [0, 0, 0, 127]), + 'h' => $wrap['toth'], + 'lines' => $wrap['l'], ]; $txth += $wrap['toth']; } @@ -327,10 +332,22 @@ class recordutils_image $draw = $imfg->draw(); $txt_ypos = 0; foreach ($txtblock as $block) { - $font = $imagine->font(__DIR__ . '/../../../resources/Fonts/arial.ttf', $block['fontsize'], $block['fontcolor']); + /** @var ColorInterface $color */ + $color = $block['fontcolor']; + $font = $imagine->font(__DIR__ . '/../../../resources/Fonts/arial.ttf', $block['fontsize'], $color); + $shadowFont = null; + $shadowDelta = 0; + if($block['shadowcolor'] !== null) { + $shadowFont = $imagine->font(__DIR__ . '/../../../resources/Fonts/arial.ttf', $block['fontsize'], $block['shadowcolor']); + $shadowDelta = max(2, (int)($block['fontsize'] / 20)); + } foreach ($block['lines'] as $line) { if ($line['t'] != '') { - $draw->text($line['t'], $font, new Point($logo_reswidth, $txt_ypos), 0); + if($shadowFont) { + $draw->text($line['t'], $shadowFont, new Point($logo_reswidth, $txt_ypos + $shadowDelta), 0); + $draw->text($line['t'], $shadowFont, new Point($logo_reswidth+1, $txt_ypos + $shadowDelta*1.5), 0); + } + $draw->text($line['t'], $font, new Point($logo_reswidth + $shadowDelta, $txt_ypos), 0); } $txt_ypos += $line['h']; } @@ -354,7 +371,7 @@ class recordutils_image $newh = $tables['TOP']['h'] + $image_height + $tables['BOTTOM']['h']; // create the output image - $image_out = $imagine->create(new Box($image_width, $newh), $palette->color("FFFFFF", 64)); + $image_out = $imagine->create(new Box($image_width, $newh), $palette->color("FFFFFF")); // paste the input image into $image_out->paste($image_in, new Point(0, $tables['TOP']['h'])); @@ -414,7 +431,7 @@ class recordutils_image * * @return boolean|string */ - public static function watermark(Application $app, media_subdef $subdef) + public static function watermark(Application $app, media_subdef $subdef, $otherPath = null) { static $palette; @@ -436,7 +453,7 @@ class recordutils_image return false; } - $pathIn = $subdef->getRealPath(); + $pathIn = $otherPath ?? $subdef->getRealPath(); if (!is_file($pathIn)) { return false; diff --git a/lib/classes/set/export.php b/lib/classes/set/export.php index 99a34df139..757db0695a 100644 --- a/lib/classes/set/export.php +++ b/lib/classes/set/export.php @@ -9,6 +9,8 @@ */ use Alchemy\Phrasea\Application; +use Alchemy\Phrasea\Authentication\ACLProvider; +use Alchemy\Phrasea\Core\Configuration\PropertyAccess; use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem; use Alchemy\Phrasea\Model\Entities\Token; use Alchemy\Phrasea\Model\Entities\User; @@ -183,7 +185,7 @@ class set_export extends set_abstract /** @var record_exportElement $download_element */ foreach ($this->get_elements() as $download_element) { - if ($app->getAclForUser($app->getAuthenticatedUser())->has_right_on_base($download_element->getBaseId(), \ACL::CANMODIFRECORD)) { + if ($app->getAclForUser($app->getAuthenticatedUser())->has_right_on_base($download_element->getBaseId(), ACL::CANMODIFRECORD)) { $this->businessFieldsAccess = true; } @@ -235,11 +237,11 @@ class set_export extends set_abstract $display_ftp = []; - $hasadminright = $app->getAclForUser($app->getAuthenticatedUser())->has_right(\ACL::CANADDRECORD) - || $app->getAclForUser($app->getAuthenticatedUser())->has_right(\ACL::CANDELETERECORD) - || $app->getAclForUser($app->getAuthenticatedUser())->has_right(\ACL::CANMODIFRECORD) - || $app->getAclForUser($app->getAuthenticatedUser())->has_right(\ACL::COLL_MANAGE) - || $app->getAclForUser($app->getAuthenticatedUser())->has_right(\ACL::COLL_MODIFY_STRUCT); + $hasadminright = $app->getAclForUser($app->getAuthenticatedUser())->has_right(ACL::CANADDRECORD) + || $app->getAclForUser($app->getAuthenticatedUser())->has_right(ACL::CANDELETERECORD) + || $app->getAclForUser($app->getAuthenticatedUser())->has_right(ACL::CANMODIFRECORD) + || $app->getAclForUser($app->getAuthenticatedUser())->has_right(ACL::COLL_MANAGE) + || $app->getAclForUser($app->getAuthenticatedUser())->has_right(ACL::COLL_MODIFY_STRUCT); $this->ftp_datas = []; @@ -391,6 +393,35 @@ class set_export extends set_abstract return $this->total_ftp; } + /** + * @return ACLProvider + */ + private function getAclProvider() + { + return $this->app['acl']; + } + + /** + * Gets ACL for user. + * + * @param User $user + * + * @return ACL + */ + private function getAclForUser(User $user) + { + return $this->getAclProvider()->get($user); + } + + /** + * @return PropertyAccess + */ + protected function getConf() + { + return $this->app['conf']; + } + + const NO_STAMP = 'NO_STAMP'; const STAMP_SYNC = 'STAMP_SYNC'; const STAMP_ASYNC = 'STAMP_ASYNC'; @@ -404,7 +435,7 @@ class set_export extends set_abstract * @return array * @throws Exception */ - public function prepare_export(User $user, Filesystem $filesystem, Array $wantedSubdefs, $rename_title, $includeBusinessFields, $stampMethod, $exportEmail = false) + public function prepare_export(User $user, Filesystem $filesystem, Array $wantedSubdefs, $rename_title, $includeBusinessFields, $stampMethod, $removeStamp, $exportEmail = false) { if (!is_array($wantedSubdefs)) { throw new Exception('No subdefs given'); @@ -423,6 +454,13 @@ class set_export extends set_abstract $unicode = $this->app['unicode']; $hasCgu = false; + // we must propose "do not stamp" when at least one collection is stamped AND the user has right to + // remove stamp on this collection + $stamp_by_base = []; // unset: no stamp ; false: stamp not "unstampable" ; true: stamp "unstampable" + + $colls_manageable = array_keys($this->getAclForUser($user)->get_granted_base([ACL::COLL_MANAGE]) ?? []); + $dbox_manageable = array_keys($this->getAclForUser($user)->get_granted_sbas([ACL::BAS_MANAGE]) ?? []); + /** @var record_exportElement $download_element */ foreach ($this->elements as $download_element) { @@ -443,10 +481,49 @@ class set_export extends set_abstract $BF = false; - if ($includeBusinessFields && $this->app->getAclForUser($user)->has_right_on_base($download_element->getBaseId(), \ACL::CANMODIFRECORD)) { + if ($includeBusinessFields && $this->app->getAclForUser($user)->has_right_on_base($download_element->getBaseId(), ACL::CANMODIFRECORD)) { $BF = true; } + // check if stamp can be removed + // check collection only once + if(!array_key_exists($bid = $download_element->getCollection()->get_base_id(), $stamp_by_base)) { + // check stamp + $stamp_by_base[$bid] = self::NO_STAMP; + + $domprefs = new DOMDocument(); + if ($domprefs->loadXML($download_element->getCollection()->get_prefs())) { + $xpprefs = new DOMXPath($domprefs); + if ($xpprefs->query('/baseprefs/stamp')->length != 0) { + // the collection has stamp settings + unset($domprefs); + + // the collection has stamp, check user's right to remove it + $stamp_by_base[$bid] = $stampMethod; + if($removeStamp) { // user asked to remove stamp + switch ((string)$this->getConf()->get(['registry', 'actions', 'export-stamp-choice'], false)) { + case '1': // == (string)true + // everybody can remove stamp (bc) + $stamp_by_base[$bid] = self::NO_STAMP; + break; + case 'manage_collection': + if (in_array($bid, $colls_manageable)) { + $stamp_by_base[$bid] = self::NO_STAMP; + } + break; + case 'manage_databox': + if (in_array($download_element->getDatabox()->get_sbas_id(), $dbox_manageable)) { + $stamp_by_base[$bid] = self::NO_STAMP; + } + break; + } + } + } + } + } + $files[$id]['to_stamp'] = $stamp_by_base[$bid]; + + // $original_name : the original_name WITHOUT extension (ex. "DSC_1234") // $extension : the extension WITHOUT DOT (ex. "jpg") // $export_name : the export name WITHOUT extension, (ex. "Hollydays_2016_DSC_1234") @@ -539,9 +616,9 @@ class set_export extends set_abstract 'to_watermark' => false ]; - if($this->app['conf']->get(['registry', 'actions', 'export-stamp-choice']) !== true || $stampMethod !== self::NO_STAMP ){ + if($files[$id]['to_stamp'] !== self::NO_STAMP){ // stamp is mandatory, or user did not check "no stamp" : we must apply stamp - if($stampMethod === self::STAMP_SYNC) { + if($files[$id]['to_stamp'] === self::STAMP_SYNC) { // we prepare a direct download, we must stamp now $path = \recordutils_image::stamp($this->app, $sd[$subdefName]); if ($path && file_exists($path)) { @@ -568,18 +645,32 @@ class set_export extends set_abstract 'to_watermark' => false ]; - if (!$this->app->getAclForUser($user)->has_right_on_base($download_element->getBaseId(), \ACL::NOWATERMARK) + $stampedPath = null; + if($files[$id]['to_stamp'] !== self::NO_STAMP && $this->getConf()->get(['registry', 'actions', 'stamp-subdefs'], false) === true){ + // stamp is mandatory, or user did not check "no stamp" : we must apply stamp + if($files[$id]['to_stamp'] === self::STAMP_SYNC) { + // we prepare a direct download, we must stamp now + $path = \recordutils_image::stamp($this->app, $sd[$subdefName]); + if ($path && file_exists($path)) { + $stampedPath = $path; + $tmp_pathfile['path'] = dirname($path); + $tmp_pathfile['file'] = basename($path); + } + } + else { + // we prepare an email or ftp download : the worker will apply stamp + $tmp_pathfile ['to_stamp'] = true; + } + } + + if (!$this->app->getAclForUser($user)->has_right_on_base($download_element->getBaseId(), ACL::NOWATERMARK) && !$this->app->getAclForUser($user)->has_preview_grant($download_element) && $sd[$subdefName]->get_type() == media_subdef::TYPE_IMAGE ) { - $path = recordutils_image::watermark($this->app, $sd[$subdefName]); + $path = recordutils_image::watermark($this->app, $sd[$subdefName], $stampedPath); if (file_exists($path)) { - $tmp_pathfile = [ - 'path' => dirname($path), - 'file' => basename($path), - 'to_stamp' => false, - 'to_watermark' => false - ]; + $tmp_pathfile['path'] = dirname($path); + $tmp_pathfile['file'] = basename($path); $subdef_ok = true; } } diff --git a/templates/web/admin/collection/suggested_value.html.twig b/templates/web/admin/collection/suggested_value.html.twig index ab2a63fdf8..e4b715cc7d 100644 --- a/templates/web/admin/collection/suggested_value.html.twig +++ b/templates/web/admin/collection/suggested_value.html.twig @@ -1,657 +1,406 @@ -
+
-
- {{ 'phraseanet::chargement' | trans }}
-
- |
-
+
+ {{ 'phraseanet::chargement' | trans }}
+
+ |
+
+ | + -- {{ 'admin::sugval: Valeurs suggerees/Preferences de la collection' | trans }} {{ app['request'].attributes.get('bas_id')|bas_labels(app) }} - | +
+
- |
+
+
+
+
+
+ ||||||
- {{ 'boutton::vue xml' | trans }} - - | -||||||||
-
-
-
-
-
|
- ||||||||
+ - | -- {{ 'boutton::valider' | trans }} - | -- | -