diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index fd9df1ea848..705c7d6ff1c 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -753,7 +753,9 @@ if (empty($action) || $action == 'show_month') // View by month $newparam=preg_replace('/day=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/month=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/year=[0-9]+&?/i','',$newparam); + $newparam=preg_replace('/viewcal=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter + $newparam.='&viewcal=1'; echo ''; echo ' '; $i=0; @@ -824,7 +826,9 @@ elseif ($action == 'show_week') // View by week $newparam=preg_replace('/day=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/month=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/year=[0-9]+&?/i','',$newparam); + $newparam=preg_replace('/viewweek=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter + $newparam.='&viewweek=1'; echo '
'; echo ' '; $i=0; @@ -878,6 +882,8 @@ else // View by day $newparam=$param; // newparam is for birthday links $newparam=preg_replace('/action=show_month&?/i','',$newparam); $newparam=preg_replace('/action=show_week&?/i','',$newparam); + $newparam=preg_replace('/viewday=[0-9]+&?/i','',$newparam); + $newparam.='&viewday=1'; // Code to show just one day $style='cal_current_month'; $today=0; @@ -944,6 +950,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa global $theme_datacolor; global $cachethirdparties, $cachecontacts, $colorindexused; + print '
'."\n"; $curtime = dol_mktime(0, 0, 0, $month, $day, $year); print '
'; @@ -951,7 +958,6 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''; if ($showinfo) print dol_print_date($curtime,'daytext'); else print dol_print_date($curtime,'%d'); @@ -959,6 +965,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print '
'; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { + $newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; + //$param='month='.$monthshown.'&year='.$year; $hourminsec='100000'; print ''; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index fb1ce97fd01..f4409e27928 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -883,7 +883,8 @@ class Contact extends CommonObject global $langs; $langs->load("dict"); - $code=$this->civilite_id; + $code=(! empty($this->civilite_id)?$this->civilite_id:(! empty($this->civility_id)?$this->civility_id:'')); + if (empty($code)) return ''; return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 6279e4ee9a0..170d2cb9da2 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -92,10 +92,13 @@ function societe_prepare_head($object) $head[$h][2] = 'note'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; - $head[$h][1] = $langs->trans("Referers"); - $head[$h][2] = 'consumption'; - $h++; + if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)) + { + $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; + $head[$h][1] = $langs->trans("Referers"); + $head[$h][2] = 'consumption'; + $h++; + } // Attached files $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index a2516c160a3..d12b803fd69 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -61,8 +61,12 @@ print '
'; $nbofsearch=0; +// Instantiate hooks of thirdparty module +$hookmanager->initHooks(array('searchform')); + // Define $searchform -if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) +// TODO Mutualize code here with function left_menu into main.inc.php page +if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) { $langs->load("companies"); $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname'); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 74633bce37e..310a9a5e2f2 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1476,18 +1476,18 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me $searchform=''; $bookmarks=''; - // Instantiate hooks of thirdparty module - $hookmanager->initHooks(array('searchform','leftblock')); - if (empty($conf->dol_hide_leftmenu)) { - if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "\n".'
'."\n"; + // Instantiate hooks of thirdparty module + $hookmanager->initHooks(array('searchform','leftblock')); + + if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "\n".'
'."\n"; else print '
'; print "\n"; // Define $searchform - if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) + if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) { $langs->load("companies"); $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname');