diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index 3dee14ef24d..435b99bc7f1 100644 --- a/htdocs/admin/openinghours.php +++ b/htdocs/admin/openinghours.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2019 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,16 +17,13 @@ /** * \file htdocs/admin/openinghours.php - * \ingroup accountant - * \brief Setup page to configure accountant / auditor + * \ingroup Opening hours + * \brief Setup page to configure opening hours */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $action=GETPOST('action', 'aZ09'); $contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'adminaccoutant'; // To manage different context of search @@ -50,19 +47,13 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if ( ($action == 'update' && ! GETPOST("cancel", 'alpha')) || ($action == 'updateedit') ) { - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NAME", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOST('country_id', 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("tel", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_CODE", GETPOST("code", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NOTE", GETPOST("note", 'none'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_OPENINGHOURS_MONDAY", GETPOST("monday", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_OPENINGHOURS_TUESDAY", GETPOST("tuesday", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_OPENINGHOURS_WEDNESDAY", GETPOST("wednesday", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_OPENINGHOURS_THURSDAY", GETPOST("thursday", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_OPENINGHOURS_FRIDAY", GETPOST("friday", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_OPENINGHOURS_SATURDAY", GETPOST("saturday", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_OPENINGHOURS_SUNDAY", GETPOST('sunday', 'alpha'), 'chaine', 0, '', $conf->entity); if ($action != 'updateedit' && ! $error) { @@ -85,10 +76,6 @@ $head = company_admin_prepare_head(); dol_fiche_head($head, 'openinghours', $langs->trans("Company"), -1, 'company'); $form=new Form($db); -$formother=new FormOther($db); -$formcompany=new FormCompany($db); - -$countrynotdefined=''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; print ''.$langs->trans("OpeningHoursDesc")."
\n"; print "
\n"; @@ -98,15 +85,6 @@ if ($action == 'edit' || $action == 'updateedit') /** * Edit parameters */ - print "\n".''."\n"; - print '
'; print ''; print ''; @@ -114,58 +92,28 @@ if ($action == 'edit' || $action == 'updateedit') print ''; print ''."\n"; - // Name - print ''."\n"; + print ''."\n"; - // Address - print ''."\n"; + print ''."\n"; - print ''."\n"; + print ''."\n"; - print ''."\n"; + print ''."\n"; - // Country - print ''."\n"; + print ''."\n"; - print ''."\n"; + print ''."\n"; - print ''; - print ''."\n"; + print ''."\n"; - print ''; - print ''."\n"; - - print ''; - print ''."\n"; - - // Web - print ''; - print ''."\n"; - - // Code - print ''."\n"; - - // Note - print ''; - print ''; - - print '
'.$langs->trans("Day").''.$langs->trans("Value").'
'; - print '
'; + print '
'; - print '
'; + print '
'; - print '
'; + print '
'; - print '
'; + print '
'; - //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization - print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id'); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); - print '
'; + print '
'; - $formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id'); - print '
'; + print '
'; - print '
'; + print '
'; - print '
'; - print '
'; - print '
'; - print '
'; - print '
'; + print ''; print '
'; print ''; @@ -182,39 +130,17 @@ else * Show parameters */ - // Actions buttons - //print '
'; - //print ''.$langs->trans("Modify").''; - //print '

'; - print '
'; print ''; print ''; - print ''; - - - print ''; - - - print ''; - - - print ''; - - print ''; - - print ''; - - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print '
'.$langs->trans("Day").''.$langs->trans("Value").'
'.$langs->trans("Monday").'' . nl2br(empty($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS) . '
'.$langs->trans("Tuesday").'' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_ZIP)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ZIP) . '
'.$langs->trans("Wednesday").'' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_TOWN)?'':$conf->global->MAIN_INFO_ACCOUNTANT_TOWN) . '
'.$langs->trans("Thursday").''; - if (! empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY)) - { - $code = getCountry($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 2); - $img=picto_from_langcode($code); - print $img?$img.' ':''; - print getCountry($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 1); - } - print '
'.$langs->trans("Friday").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_PHONE, $mysoc->country_code) . '
'.$langs->trans("Saturday").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_FAX, $mysoc->country_code) . '
'.$langs->trans("Sunday").'' . dol_print_email($conf->global->MAIN_INFO_ACCOUNTANT_MAIL, 0, 0, 0, 80) . '
'.$langs->trans("Monday").'' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_MONDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_MONDAY) . '
'.$langs->trans("Tuesday").'' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY) . '
'.$langs->trans("Wednesday").'' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY) . '
'.$langs->trans("Thursday").'' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY) . '
'.$langs->trans("Friday").'' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY) . '
'.$langs->trans("Saturday").'' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY) . '
'.$langs->trans("Sunday").'' . (empty($conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY)?'':$conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY) . '
'; print "
";