From 578eb98b3332a4c14af91c97546f486ab1d1ba88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Wed, 10 May 2017 13:13:33 +0200 Subject: [PATCH] Better user interface --- htdocs/adherents/type.php | 8 ++++++-- htdocs/admin/defaultvalues.php | 7 +++---- htdocs/admin/ihm.php | 26 ++++++++++++-------------- htdocs/admin/translation.php | 4 +++- htdocs/langs/en_US/modulebuilder.lang | 4 ++-- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index ab6bfcc0704..fb147750e0b 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -82,9 +82,11 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter_x") || GETP // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('membertypecard','globalcard')); + /* * Actions */ + if ($action == 'add' && $user->rights->adherent->configurer) { if (! $cancel) @@ -308,12 +310,13 @@ if ($rowid > 0) $head = member_type_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group'); + dol_fiche_head($head, 'card', $langs->trans("MemberType"), -1, 'group'); $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/type.php">'.$langs->trans("BackToList").'</a>'; dol_banner_tab($object, 'rowid', $linkback); + print '<div class="fichecenter">'; print '<div class="underbanner clearboth"></div>'; print '<table class="border" width="100%">'; @@ -342,7 +345,8 @@ if ($rowid > 0) } print '</table>'; - + print '</div>'; + dol_fiche_end(); diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index dd37e4987e5..013be811b5b 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -172,9 +172,6 @@ if ($action == 'delete') - - - /* * View */ @@ -323,7 +320,9 @@ else print '<td align="center">'; print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; } -print '<input type="submit" class="button" value="'.$langs->trans("Add").'" name="add">'; +$disabled=''; +if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) $disabled=' disabled="disabled"'; +print '<input type="submit" class="button"'.$disabled.' value="'.$langs->trans("Add").'" name="add">'; print "</td>\n"; print '</tr>'; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 739a6fa4c88..cfa08f003ea 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -362,13 +362,6 @@ if ($action == 'edit') // Edit print '<td width="20"> </td>'; print '</tr>'; - // Hide helpcenter link on login page - print '<tr><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>'; - print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1); - print '</td>'; - print '<td width="20"> </td>'; - print '</tr>'; - // Message of the day on home page print '<tr><td class="titlefield">'.$langs->trans("MessageOfDay").'</td><td colspan="2">'; @@ -393,8 +386,14 @@ if ($action == 'edit') // Edit $doleditor->Create(); print '</td></tr>'."\n"; - // Background + // Hide helpcenter link on login page + print '<tr><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>'; + print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1); + print '</td>'; + print '<td width="20"> </td>'; + print '</tr>'; + // Background print '<tr><td><label for="imagebackground">'.$langs->trans("BackgroundImageLogin").' (png,jpg)</label></td><td colspan="2">'; print '<div class="centpercent inline-block">'; print '<input type="file" class="flat class=minwidth200" name="imagebackground" id="imagebackground">'; @@ -531,11 +530,6 @@ else // Show // Link to wiki help print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).'</td><td colspan="2">'; print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1); - print '</td></tr>'; - - // Link to help center - print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td colspan="2">'; - print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0),1); print '</td></tr>'; // Message of the day @@ -558,8 +552,12 @@ else // Show else print ' '; print '</td></tr>'."\n"; + // Link to help center + print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td colspan="2">'; + print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0),1); + print '</td></tr>'; + // Background login - print '<tr class="oddeven"><td>'.$langs->trans("BackgroundImageLogin").'</td><td colspan="2">'; print '<div class="centpercent inline-block">'; print $conf->global->MAIN_LOGIN_BACKGROUND; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index c51d1c2435d..44387bc2041 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -264,7 +264,9 @@ if ($mode == 'overwrite') print '<td align="center">'; print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; //} - print '<input type="submit" class="button" value="'.$langs->trans("Add").'" name="add">'; + $disabled=''; + if (empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) $disabled=' disabled="disabled"'; + print '<input type="submit" class="button"'.$disabled.' value="'.$langs->trans("Add").'" name="add">'; print "</td>\n"; print '</tr>'; diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 81a34b66b85..da734ea1356 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -1,7 +1,7 @@ # Dolibarr language file - Source file is en_US - loan ModuleBuilderDesc=This tools give you utilites to build or edit your own module. -ModuleBuilderDesc2=Path were modules are generated/edited (first alternative directory defined into %s): <strong>%s</strong>. -ModuleBuilderDesc3=Modules found: <strong>%s</strong> (they are detected as editable when the file <strong>%s</strong> exists in root of module directory). +ModuleBuilderDesc2=Path were modules are generated/edited (first alternative directory defined into %s): <strong>%s</strong> +ModuleBuilderDesc3=Generated/editable modules found: <strong>%s</strong> (they are detected as editable when the file <strong>%s</strong> exists in root of module directory). NewModule=New module ModuleKey=Key for new module -- GitLab