diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 1d785e882fc..55b61145b6a 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -4,6 +4,7 @@ * Copyright (C) 2011-2017 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2017 Open-DSI * * 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 @@ -431,6 +432,29 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) } } +// AGENDA_SHOW_LINKED_OBJECT +$var=!$var; +print ''."\n"; +print ''.$langs->trans("AGENDA_SHOW_LINKED_OBJECT").''."\n"; +print ' '."\n"; +print ''."\n"; +if (! empty($conf->use_javascript_ajax)) +{ + print ajax_constantonoff('AGENDA_SHOW_LINKED_OBJECT'); +} +else +{ + if (empty($conf->global->AGENDA_SHOW_LINKED_OBJECT)) + { + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + } + else + { + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + } +} +print ''."\n"; + print ''; dol_fiche_end(); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 47ef8093c1a..0a8ab49ea38 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -6,6 +6,7 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2015 Marcos García + * Copyright (C) 2017 Open-DSI * * 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 @@ -446,6 +447,7 @@ $sql.= ' a.percent,'; $sql.= ' a.fk_user_author,a.fk_user_action,'; $sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql.= ' a.fk_soc, a.fk_contact,'; +$sql.= ' a.fk_element, a.elementtype,'; $sql.= ' ca.code as type_code, ca.libelle as type_label, ca.color as type_color'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; @@ -570,6 +572,8 @@ if ($resql) $event->fulldayevent=$obj->fulldayevent; $event->location=$obj->location; $event->transparency=$obj->transparency; + $event->fk_element=$obj->fk_element; + $event->elementtype=$obj->elementtype; $event->societe->id=$obj->fk_soc; $event->contact->id=$obj->fk_contact; @@ -1478,6 +1482,12 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($linerelatedto) $linerelatedto.=' / '; if (! empty($contact->id)) $linerelatedto.=$contact->getNomUrl(1,'',0); } + if (! empty($event->fk_element) && $event->fk_element > 0 && ! empty($event->elementtype) && ! empty($conf->global->AGENDA_SHOW_LINKED_OBJECT)) + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + if ($linerelatedto) $linerelatedto.=' / '; + $linerelatedto.=dolGetElementUrl($event->fk_element,$event->elementtype,1); + } if ($linerelatedto) print '
'.$linerelatedto; } diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 232eb0fc9b1..301cf63620e 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -3,6 +3,7 @@ * Copyright (C) 2003 Eric Seigne * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2017 Open-DSI * * 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 @@ -183,6 +184,7 @@ $sql.= " s.nom as societe, s.rowid as socid, s.client,"; $sql.= " a.id, a.label, a.datep as dp, a.datep2 as dp2,"; $sql.= ' a.fk_user_author,a.fk_user_action,'; $sql.= " a.fk_contact, a.note, a.percent as percent,"; +$sql.= " a.fk_element, a.elementtype,"; $sql.= " c.code as type_code, c.libelle as type_label,"; $sql.= " sp.lastname, sp.firstname"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a"; @@ -355,6 +357,7 @@ if ($resql) print ''; print ''; print ''; + if (! empty($conf->global->AGENDA_SHOW_LINKED_OBJECT)) print ''; print ''; print ''; print $formactions->form_select_status_action('formaction',$status,1,'status',1,2); @@ -375,7 +378,8 @@ if ($resql) print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ActionsOwnedByShort"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder); + if (! empty($conf->global->AGENDA_SHOW_LINKED_OBJECT)) print_liste_field_titre($langs->trans("LinkedObject"),$_SERVER["PHP_SELF"],"a.fk_element",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ActionsOwnedByShort"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre(""); print "\n"; @@ -482,6 +486,18 @@ if ($resql) } print ''; + // Linked object + if (! empty($conf->global->AGENDA_SHOW_LINKED_OBJECT)) { + print ''; + if ($obj->fk_element > 0 && ! empty($obj->elementtype)) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + print dolGetElementUrl($obj->fk_element,$obj->elementtype,1); + } else { + print " "; + } + print ''; + } + // User to do print ''; if ($obj->fk_user_action > 0) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 860519842fc..d25a97c28e5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1512,6 +1512,7 @@ AGENDA_DEFAULT_FILTER_STATUS=Set automatically this status for events into searc AGENDA_DEFAULT_VIEW=Which tab do you want to open by default when selecting menu Agenda AGENDA_NOTIFICATION=Enable event notification on user browsers when event date is reached (each user is able to refuse this from the browser confirmation question) AGENDA_NOTIFICATION_SOUND=Enable sound notification +AGENDA_SHOW_LINKED_OBJECT=Show linked object into agenda view ##### Clicktodial ##### ClickToDialSetup=Click To Dial module setup ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags
__PHONETO__ that will be replaced with the phone number of person to call
__PHONEFROM__ that will be replaced with phone number of calling person (yours)
__LOGIN__ that will be replaced with clicktodial login (defined on user card)
__PASS__ that will be replaced with clicktodial password (defined on user card). diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 4eac426571d..5fc1993c898 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1479,6 +1479,7 @@ AGENDA_DEFAULT_FILTER_STATUS=Régler automatiquement le statut d'événement dan AGENDA_DEFAULT_VIEW=Quel onglet voulez-vous voir ouvrir par défaut quand on choisit le menu Agenda AGENDA_NOTIFICATION=Activer les notifications d'événements dans le navigateur utilisateur quand la date de l'événement est atteinte (Chaque utilisateur peut refuser ceci au moment de la question de confirmation posée par le navigateur). AGENDA_NOTIFICATION_SOUND=Activer les notifications sonores. +AGENDA_SHOW_LINKED_OBJECT=Afficher l'objet lié dans la vue agenda ##### Clicktodial ##### ClickToDialSetup=Configuration du module Click To Dial ClickToDialUrlDesc=URL appelée lors d'un clic sur le pictogramme téléphone. Dans l'URL, vous pouvez utiliser les balises
__PHONETO__ qui sera remplacée par le téléphone de l'appelé
__PHONEFROM__ qui sera remplacée par le téléphone de l'appelant (le votre, défini sur votre fiche utilisateur)
__LOGIN__ qui sera remplacée par votre identifiant clicktodial (défini sur votre fiche utilisateur)
__PASS__ qui sera remplacée par votre mot de passe clicktodial (défini sur votre fiche utilisateur).