diff --git a/htdocs/bookcal/admin/about.php b/htdocs/bookcal/admin/about.php deleted file mode 100644 index 2ff4e874450..00000000000 --- a/htdocs/bookcal/admin/about.php +++ /dev/null @@ -1,80 +0,0 @@ - - * Copyright (C) 2022 Alice Adminson - * - * 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file bookcal/admin/about.php - * \ingroup bookcal - * \brief About page of module BookCal. - */ - -// Load Dolibarr environment -require '../../main.inc.php'; - -// Libraries -require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once '../lib/bookcal.lib.php'; - -// Translations -$langs->loadLangs(array("errors", "admin", "bookcal@bookcal")); - -// Access control -if (!$user->admin) { - accessforbidden(); -} - -// Parameters -$action = GETPOST('action', 'aZ09'); -$backtopage = GETPOST('backtopage', 'alpha'); - - -/* - * Actions - */ - -// None - - -/* - * View - */ - -$form = new Form($db); - -$help_url = ''; -$page_name = "BookCalAbout"; - -llxHeader('', $langs->trans($page_name), $help_url); - -// Subheader -$linkback = ''.$langs->trans("BackToModuleList").''; - -print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); - -// Configuration header -$head = bookcalAdminPrepareHead(); -print dol_get_fiche_head($head, 'about', $langs->trans($page_name), 0, 'bookcal@bookcal'); - -dol_include_once('/bookcal/core/modules/modBookCal.class.php'); -$tmpmodule = new modBookCal($db); -print $tmpmodule->getDescLong(); - -// Page end -print dol_get_fiche_end(); -llxFooter(); -$db->close(); diff --git a/htdocs/bookcal/admin/availabilities_extrafields.php b/htdocs/bookcal/admin/availabilities_extrafields.php index ba7dca39570..190a44f339d 100644 --- a/htdocs/bookcal/admin/availabilities_extrafields.php +++ b/htdocs/bookcal/admin/availabilities_extrafields.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once '../lib/bookcal.lib.php'; // Load translation files required by the page -$langs->loadLangs(array('bookcal@bookcal', 'admin')); +$langs->loadLangs(array('agenda', 'admin')); $extrafields = new ExtraFields($db); $form = new Form($db); @@ -80,7 +80,7 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); $head = bookcalAdminPrepareHead(); -print dol_get_fiche_head($head, 'availabilities_extrafields', $langs->trans($page_name), -1, 'bookcal@bookcal'); +print dol_get_fiche_head($head, 'availabilities_extrafields', $langs->trans($page_name), -1, 'fa-calendar-check'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/bookcal/admin/booking_extrafields.php b/htdocs/bookcal/admin/booking_extrafields.php index 2e9163af158..b4029a99338 100644 --- a/htdocs/bookcal/admin/booking_extrafields.php +++ b/htdocs/bookcal/admin/booking_extrafields.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once '../lib/bookcal.lib.php'; // Load translation files required by the page -$langs->loadLangs(array('bookcal@bookcal', 'admin')); +$langs->loadLangs(array('agenda', 'admin')); $extrafields = new ExtraFields($db); $form = new Form($db); @@ -80,7 +80,7 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); $head = bookcalAdminPrepareHead(); -print dol_get_fiche_head($head, 'booking_extrafields', $langs->trans($page_name), -1, 'bookcal@bookcal'); +print dol_get_fiche_head($head, 'booking_extrafields', $langs->trans($page_name), -1, 'fa-calendar-check'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/bookcal/admin/setup.php b/htdocs/bookcal/admin/setup.php index 9772ffbbbf0..e3addec83e3 100644 --- a/htdocs/bookcal/admin/setup.php +++ b/htdocs/bookcal/admin/setup.php @@ -33,7 +33,7 @@ require_once '../lib/bookcal.lib.php'; //require_once "../class/myclass.class.php"; // Translations -$langs->loadLangs(array("admin", "bookcal@bookcal")); +$langs->loadLangs(array("admin", "agenda")); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('bookcalsetup', 'globalsetup')); @@ -269,7 +269,7 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); // Configuration header $head = bookcalAdminPrepareHead(); -print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "bookcal@bookcal"); +print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "fa-calendar-check"); // Setup page goes here echo ''.$langs->trans("BookCalSetupPage").'

'; diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index 0d34fa992c1..d97970c3add 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bookcal@bookcal", "other")); +$langs->loadLangs(array("agenda", "other")); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index ac580c650c5..f64b5e6f4b6 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bookcal@bookcal", "other")); +$langs->loadLangs(array("agenda", "other")); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/bookcal/availabilities_contact.php b/htdocs/bookcal/availabilities_contact.php index 41508aaa46a..348602f58a9 100644 --- a/htdocs/bookcal/availabilities_contact.php +++ b/htdocs/bookcal/availabilities_contact.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); +$langs->loadLangs(array("agenda", "companies", "other", "mails")); $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); diff --git a/htdocs/bookcal/availabilities_document.php b/htdocs/bookcal/availabilities_document.php index e7335bff74c..ed6b2976570 100644 --- a/htdocs/bookcal/availabilities_document.php +++ b/htdocs/bookcal/availabilities_document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); +$langs->loadLangs(array("agenda", "companies", "other", "mails")); $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index 9af4b65a022..26d66ce0ca4 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -36,7 +36,7 @@ require_once __DIR__.'/class/availabilities.class.php'; //dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page -$langs->loadLangs(array("bookcal@bookcal", "other")); +$langs->loadLangs(array("agenda", "other")); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); @@ -210,7 +210,7 @@ $now = dol_now(); //$help_url = "EN:Module_Availabilities|FR:Module_Availabilities_FR|ES:Módulo_Availabilities"; $help_url = ''; -$title = $langs->trans("Availabilitiess"); +$title = $langs->trans("Availabilities"); $morejs = array(); $morecss = array(); diff --git a/htdocs/bookcal/availabilities_note.php b/htdocs/bookcal/availabilities_note.php index 44ced158e03..6913491d85e 100644 --- a/htdocs/bookcal/availabilities_note.php +++ b/htdocs/bookcal/availabilities_note.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bookcal@bookcal", "companies")); +$langs->loadLangs(array("agenda", "companies")); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/bookcal/bookcalindex.php b/htdocs/bookcal/bookcalindex.php index 6ec6ae6fb3e..46281eb048a 100644 --- a/htdocs/bookcal/bookcalindex.php +++ b/htdocs/bookcal/bookcalindex.php @@ -30,7 +30,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Load translation files required by the page -$langs->loadLangs(array("bookcal@bookcal")); +$langs->loadLangs(array("agenda")); $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/bookcal/booking_agenda.php b/htdocs/bookcal/booking_agenda.php index a9163d7f70d..fb26fce4fc7 100644 --- a/htdocs/bookcal/booking_agenda.php +++ b/htdocs/bookcal/booking_agenda.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bookcal@bookcal", "other")); +$langs->loadLangs(array("agenda", "other")); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/bookcal/booking_card.php b/htdocs/bookcal/booking_card.php index 7f0fc3b9f3a..82bd884cd2d 100644 --- a/htdocs/bookcal/booking_card.php +++ b/htdocs/bookcal/booking_card.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bookcal@bookcal", "other")); +$langs->loadLangs(array("agenda", "other")); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/bookcal/booking_contact.php b/htdocs/bookcal/booking_contact.php index bb73368b770..631f6af8e6c 100644 --- a/htdocs/bookcal/booking_contact.php +++ b/htdocs/bookcal/booking_contact.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); +$langs->loadLangs(array("agenda", "companies", "other", "mails")); $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); diff --git a/htdocs/bookcal/booking_document.php b/htdocs/bookcal/booking_document.php index c102597e189..fa925759399 100644 --- a/htdocs/bookcal/booking_document.php +++ b/htdocs/bookcal/booking_document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); +$langs->loadLangs(array("agenda", "companies", "other", "mails")); $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/bookcal/booking_list.php b/htdocs/bookcal/booking_list.php index c7ebdd6f378..2e4fbfccd16 100644 --- a/htdocs/bookcal/booking_list.php +++ b/htdocs/bookcal/booking_list.php @@ -36,7 +36,7 @@ require_once __DIR__.'/class/booking.class.php'; //dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page -$langs->loadLangs(array("bookcal@bookcal", "other")); +$langs->loadLangs(array("agenda", "other")); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); diff --git a/htdocs/bookcal/booking_note.php b/htdocs/bookcal/booking_note.php index c8b2de4e6ff..809f382cc16 100644 --- a/htdocs/bookcal/booking_note.php +++ b/htdocs/bookcal/booking_note.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bookcal@bookcal", "companies")); +$langs->loadLangs(array("agenda", "companies")); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 3ccc4542670..6b4502e3364 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -116,10 +116,10 @@ class Availabilities extends CommonObject 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>2000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Canceled'), 'validate'=>'1',), - 'start' => array('type'=>'date', 'label'=>'Start Date', 'enabled'=>'1', 'position'=>40, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'isameasure'=>'1',), - 'end' => array('type'=>'date', 'label'=>'End Date', 'enabled'=>'1', 'position'=>45, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'isameasure'=>'1',), + 'start' => array('type'=>'date', 'label'=>'Start Date', 'enabled'=>'1', 'position'=>40, 'notnull'=>1, 'visible'=>1, 'searchall'=>1), + 'end' => array('type'=>'date', 'label'=>'End Date', 'enabled'=>'1', 'position'=>45, 'notnull'=>1, 'visible'=>1, 'searchall'=>1), 'type' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>'1', 'position'=>49, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Customer', '1'=>'Supplier', '2'=>'Else'),), - 'duration' => array('type'=>'integer', 'label'=>'Duration', 'enabled'=>'1', 'position'=>47, 'notnull'=>1, 'visible'=>1, 'default'=>'30', 'isameasure'=>'1',), + 'duration' => array('type'=>'integer', 'label'=>'Duration', 'enabled'=>'1', 'position'=>47, 'notnull'=>1, 'visible'=>1, 'default'=>'30'), 'startHour' => array('type'=>'integer', 'label'=>'Start Hour', 'enabled'=>'1', 'position'=>46, 'notnull'=>1, 'visible'=>-1,), 'endHour' => array('type'=>'integer', 'label'=>'End Hour', 'enabled'=>'1', 'position'=>46.5, 'notnull'=>1, 'visible'=>-1,), ); @@ -842,7 +842,7 @@ class Availabilities extends CommonObject // phpcs:enable if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; - //$langs->load("bookcal@bookcal"); + //$langs->load("agenda"); $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); @@ -944,7 +944,7 @@ class Availabilities extends CommonObject public function getNextNumRef() { global $langs, $conf; - $langs->load("bookcal@bookcal"); + $langs->load("agenda"); if (empty($conf->global->BOOKCAL_AVAILABILITIES_ADDON)) { $conf->global->BOOKCAL_AVAILABILITIES_ADDON = 'mod_availabilities_standard'; @@ -1009,7 +1009,7 @@ class Availabilities extends CommonObject $result = 0; $includedocgeneration = 0; - $langs->load("bookcal@bookcal"); + $langs->load("agenda"); if (!dol_strlen($modele)) { $modele = 'standard_availabilities'; diff --git a/htdocs/bookcal/class/booking.class.php b/htdocs/bookcal/class/booking.class.php index 1a4f402626b..80807d7125f 100644 --- a/htdocs/bookcal/class/booking.class.php +++ b/htdocs/bookcal/class/booking.class.php @@ -842,7 +842,7 @@ class Booking extends CommonObject // phpcs:enable if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; - //$langs->load("bookcal@bookcal"); + //$langs->load("agenda"); $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); @@ -944,7 +944,7 @@ class Booking extends CommonObject public function getNextNumRef() { global $langs, $conf; - $langs->load("bookcal@bookcal"); + $langs->load("agenda"); if (empty($conf->global->BOOKCAL_BOOKING_ADDON)) { $conf->global->BOOKCAL_BOOKING_ADDON = 'mod_booking_standard'; @@ -1009,7 +1009,7 @@ class Booking extends CommonObject $result = 0; $includedocgeneration = 0; - $langs->load("bookcal@bookcal"); + $langs->load("agenda"); if (!dol_strlen($modele)) { $modele = 'standard_booking'; diff --git a/htdocs/bookcal/lib/bookcal.lib.php b/htdocs/bookcal/lib/bookcal.lib.php index bc60468fb1d..3f809da08d8 100644 --- a/htdocs/bookcal/lib/bookcal.lib.php +++ b/htdocs/bookcal/lib/bookcal.lib.php @@ -30,7 +30,7 @@ function bookcalAdminPrepareHead() { global $langs, $conf; - $langs->load("bookcal@bookcal"); + $langs->load("agenda"); $h = 0; $head = array(); @@ -47,11 +47,6 @@ function bookcalAdminPrepareHead() $h++; */ - $head[$h][0] = dol_buildpath("/bookcal/admin/about.php", 1); - $head[$h][1] = $langs->trans("About"); - $head[$h][2] = 'about'; - $h++; - // Show more tabs from modules // Entries must be declared in modules descriptor with line //$this->tabs = array( diff --git a/htdocs/bookcal/lib/bookcal_availabilities.lib.php b/htdocs/bookcal/lib/bookcal_availabilities.lib.php index 83d204a2d76..1fb4b2aed75 100644 --- a/htdocs/bookcal/lib/bookcal_availabilities.lib.php +++ b/htdocs/bookcal/lib/bookcal_availabilities.lib.php @@ -31,7 +31,7 @@ function availabilitiesPrepareHead($object) { global $db, $langs, $conf; - $langs->load("bookcal@bookcal"); + $langs->load("agenda"); $showtabofpagecontact = 1; $showtabofpagenote = 1; diff --git a/htdocs/bookcal/lib/bookcal_booking.lib.php b/htdocs/bookcal/lib/bookcal_booking.lib.php index a6cb0e50df6..c0dec7d6d2e 100644 --- a/htdocs/bookcal/lib/bookcal_booking.lib.php +++ b/htdocs/bookcal/lib/bookcal_booking.lib.php @@ -31,7 +31,7 @@ function bookingPrepareHead($object) { global $db, $langs, $conf; - $langs->load("bookcal@bookcal"); + $langs->load("agenda"); $showtabofpagecontact = 1; $showtabofpagenote = 1; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 8ec011f5e9d..e730243bfbf 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1945,7 +1945,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } $listofusertoshow = ''; - $listofusertoshow .= '
'.$cacheusers[$tmpid]->getNomUrl(-1, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom'); + $listofusertoshow .= '
'.$cacheusers[$tmpid]->getNomUrl(-1, '', 0, 0, 0, 0, '', 'paddingright valignmiddle'); print $listofusertoshow; } else { // Other calendar // Picto @@ -2020,7 +2020,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $cacheusers[$tmpid] = $newuser; } - $listofusertoshow .= $cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom'); + $listofusertoshow .= $cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'valignmiddle'); } print $titletoshow; @@ -2070,7 +2070,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $linerelatedto .= dolGetElementUrl($event->fk_element, $event->elementtype, 1); } if ($linerelatedto) { - print '
'.$linerelatedto; + print ' '.$linerelatedto; } } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 82d3d263e21..b998fcbd71a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7858,30 +7858,34 @@ abstract class CommonObject /** * Return validation test result for a field * - * @param array $val Array of properties of field to show + * @param array $fields Array of properties of field to show * @param string $fieldKey Key of attribute * @param string $fieldValue value of attribute * @return bool return false if fail true on success, see $this->error for error message */ - public function validateField($val, $fieldKey, $fieldValue) + public function validateField($fields, $fieldKey, $fieldValue) { global $langs; - if (!class_exists('Validate')) { require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php'; } + if (!class_exists('Validate')) { + require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php'; + } $this->clearFieldError($fieldKey); - if (!isset($val[$fieldKey])) { + if (!isset($fields[$fieldKey])) { $this->setFieldError($fieldKey, $langs->trans('FieldNotFoundInObject')); return false; } + $val = $fields[$fieldKey]; + $param = array(); $param['options'] = array(); - $type = $val[$fieldKey]['type']; + $type = $val['type']; $required = false; - if (isset($val[$fieldKey]['notnull']) && $val[$fieldKey]['notnull'] === 1) { + if (isset($val['notnull']) && $val['notnull'] === 1) { // 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). $required = true; } @@ -7892,6 +7896,7 @@ abstract class CommonObject // // PREPARE Elements // + $reg = array(); // Convert var to be able to share same code than showOutputField of extrafields if (preg_match('/varchar\((\d+)\)/', $type, $reg)) { @@ -7905,7 +7910,7 @@ abstract class CommonObject $type = 'select'; } - if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) { + if (!empty($val['type']) && preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) { $type = 'link'; } diff --git a/htdocs/core/modules/modBookCal.class.php b/htdocs/core/modules/modBookCal.class.php index c3066dbd2e0..6e3d6768206 100644 --- a/htdocs/core/modules/modBookCal.class.php +++ b/htdocs/core/modules/modBookCal.class.php @@ -40,11 +40,12 @@ class modBookCal extends DolibarrModules public function __construct($db) { global $langs, $conf; + $this->db = $db; // Id for module (must be unique). // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). - $this->numero = 500000; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve an id number for your module + $this->numero = 2430; // Key text used to identify module (for permissions, menus, etc...) $this->rights_class = 'bookcal'; @@ -76,7 +77,7 @@ class modBookCal extends DolibarrModules // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' // To use a supported fa-xxx css style of font awesome, use this->picto='xxx' - $this->picto = 'fa-generic'; + $this->picto = 'fa-calendar-check'; // Define some features supported by module (triggers, login, substitutions, menus, css, etc...) $this->module_parts = array( @@ -463,8 +464,7 @@ class modBookCal extends DolibarrModules { global $conf, $langs; - //$result = $this->_load_tables('/install/mysql/', 'bookcal'); - $result = $this->_load_tables('/bookcal/sql/'); + $result = $this->_load_tables('/install/mysql/', 'bookcal'); if ($result < 0) { return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default') } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 934464db3de..8e0acd832d5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -645,6 +645,8 @@ Module2300Name=Scheduled jobs Module2300Desc=Scheduled jobs management (alias cron or chrono table) Module2400Name=Events/Agenda Module2400Desc=Track events. Log automatic events for tracking purposes or record manual events or meetings. This is the principal module for good Customer or Vendor Relationship Management. +Module2430Name=Booking Calendar System +Module2430Desc=Provide an online calendar to allow anyone to book rendez-vous, according to predefined ranges or availabilities. Module2500Name=DMS / ECM Module2500Desc=Document Management System / Electronic Content Management. Automatic organization of your generated or stored documents. Share them when you need. Module2600Name=API / Web services (SOAP server) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 98b2bec97a0..29f400fc778 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2763,11 +2763,13 @@ class Societe extends CommonObject $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="classfortooltip refurl"'; + $linkclose .= ' class="classfortooltip refurl valignmiddle"'; $target_value = array('_self', '_blank', '_parent', '_top'); if (in_array($target, $target_value)) { $linkclose .= ' target="'.dol_escape_htmltag($target).'"'; } + } else { + $linkclose .= ' class="valignmiddle"'; } $linkstart .= $linkclose.'>'; $linkend = '';