From 2bc579324d48eb8e7feb455086c819e9b0090124 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 25 Sep 2013 21:26:06 +0200 Subject: [PATCH] Fix: Opening agenda for a specific day Fix: No picto of thirdparty of contact if link is broken --- htdocs/comm/action/fiche.php | 4 +++- htdocs/comm/action/index.php | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 77b88c49715..b9770c8c1a3 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -73,8 +73,10 @@ $hookmanager->initHooks(array('actioncard')); /* - * Action creation de l'action + * Actions */ + +// Add action if ($action == 'add_action') { $error=0; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index e52615f6e59..cb683dea35e 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -78,7 +78,7 @@ $type=GETPOST("type"); $maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=="0"?'':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); -if (GETPOST('viewcal')) { +if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') { $action='show_month'; $day=''; } // View by month if (GETPOST('viewweek')) { @@ -1134,7 +1134,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $cachethirdparties[$event->societe->id]=$thirdparty; } else $thirdparty=$cachethirdparties[$event->societe->id]; - $linerelatedto.=$thirdparty->getNomUrl(1,'',$length); + if (! empty($thirdparty->id)) $linerelatedto.=$thirdparty->getNomUrl(1,'',$length); } if (! empty($event->contact->id) && $event->contact->id > 0) { @@ -1146,7 +1146,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } else $contact=$cachecontacts[$event->contact->id]; if ($linerelatedto) $linerelatedto.=' / '; - $linerelatedto.=$contact->getNomUrl(1,'',$length); + if (! empty($contact->id)) $linerelatedto.=$contact->getNomUrl(1,'',$length); } if ($linerelatedto) print '
'.$linerelatedto; }