Add button Save and stay when editing property of web site

This commit is contained in:
Laurent Destailleur 2019-10-21 00:55:52 +02:00
parent 05352a62e5
commit b21bca17de
3 changed files with 15 additions and 7 deletions

View File

@ -476,7 +476,7 @@ if (! empty($conf->barcode->enabled)) {
}
// Logo
print '<tr class="oddeven"><td><label for="logo">'.$langs->trans("Logo").' (png,jpg)</label></td><td>';
print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans("Logo"), 'png, jpg').'</label></td><td>';
print '<table width="100%" class="nobordernopadding"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
print '<input type="file" class="flat minwidth200" name="logo" id="logo" accept="image/*">';
print '</td><td class="nocellnopadd right" valign="middle">';
@ -493,7 +493,7 @@ print '</td></tr></table>';
print '</td></tr>';
// Logo (squarred)
print '<tr class="oddeven"><td><label for="logo_squarred">'.$langs->trans("LogoSquarred").' (png,jpg)</label></td><td>';
print '<tr class="oddeven"><td><label for="logo_squarred">'.$form->textwithpicto($langs->trans("LogoSquarred"), 'png, jpg').'</label></td><td>';
print '<table width="100%" class="nobordernopadding"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
print '<input type="file" class="flat minwidth200" name="logo_squarred" id="logo_squarred" accept="image/*">';
print '</td><td class="nocellnopadd right" valign="middle">';

View File

@ -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:

View File

@ -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 '<input type="submit" id="savefilean stay" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("SaveAndStay")).'" name="updateandstay">';
if (preg_match('/^create/', $action) && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print '<input type="submit" id="savefile" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
if (preg_match('/^edit/', $action) && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print '<input type="submit" id="savefile" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
if ($action != 'preview') print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="cancel">';