From b21bca17de85b4f74ffb1654e36ebdd739ab6d23 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Oct 2019 00:55:52 +0200 Subject: [PATCH] Add button Save and stay when editing property of web site --- htdocs/admin/company.php | 4 ++-- htdocs/langs/en_US/main.lang | 1 + htdocs/website/index.php | 17 ++++++++++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 912995d7817..09a4e95c0ae 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -476,7 +476,7 @@ if (! empty($conf->barcode->enabled)) { } // Logo -print ''; +print ''; print '
'; print ''; print ''; @@ -493,7 +493,7 @@ print '
'; print ''; // Logo (squarred) -print ''; +print ''; print '
'; print ''; print ''; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 04f45f8de4b..656f6fb7a28 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -169,6 +169,7 @@ ToValidate=To validate NotValidated=Not validated Save=Save SaveAs=Save As +SaveAndStay=Save and stay TestConnection=Test connection ToClone=Clone ConfirmClone=Choose data you want to clone: diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 1eff07edb39..52dae7ba666 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1236,12 +1236,18 @@ if ($action == 'updatecss') setEventMessages($langs->trans("Saved"), null, 'mesgs'); } - $action='preview'; - - if ($backtopage) + if (! GETPOSTISSET('updateandstay')) // If we click on "Save And Stay", we don not make the redirect { - header("Location: ".$backtopage); - exit; + $action='preview'; + if ($backtopage) + { + header("Location: ".$backtopage); + exit; + } + } + else + { + $action = 'editcss'; } } } @@ -2105,6 +2111,7 @@ if (! GETPOST('hide_websitemenu')) if (in_array($action, array('editcss','editmenu','file_manager','replacesite','replacesiteconfirm'))) { + if ($action == 'editcss' && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print ''; if (preg_match('/^create/', $action) && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print ''; if (preg_match('/^edit/', $action) && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print ''; if ($action != 'preview') print '';