diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 9b73b00d375..a6d9d38bc87 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -568,12 +568,12 @@ class ActionComm extends CommonObject * @return string Chaine avec URL * @remarks Utilise $this->id, $this->code et $this->libelle */ - function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='') + function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='') { global $langs; $result=''; - if ($option=='birthday') $lien = 'id.'">'.img_object('','contact').' '; + if ($option=='birthday') $lien = 'id.'">'; else $lien = 'id.'">'; $lienfin=''; @@ -588,7 +588,7 @@ class ActionComm extends CommonObject $libelleshort=dol_trunc($this->libelle,$maxlength); } - if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAction").': '.$libelle,'task').$lienfin); + if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAction").': '.$libelle,($overwritepicto?$overwritepicto:'task')).$lienfin); if ($withpicto==1) $result.=' '; $result.=$lien.$libelleshort.$lienfin; return $result; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 1ab739e66f9..ab438e83053 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -27,12 +27,14 @@ */ require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/agenda.lib.php"); if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php"); +$filter=GETPOST("filter"); $filtera = GETPOST("userasked","int")?GETPOST("userasked","int"):GETPOST("filtera","int"); $filtert = GETPOST("usertodo","int")?GETPOST("usertodo","int"):GETPOST("filtert","int"); $filterd = GETPOST("userdone","int")?GETPOST("userdone","int"):GETPOST("filterd","int"); @@ -55,7 +57,7 @@ $result = restrictedArea($user, 'agenda', 0, '', 'myactions'); $canedit=1; if (! $user->rights->agenda->myactions->read) accessforbidden(); if (! $user->rights->agenda->allactions->read) $canedit=0; -if (! $user->rights->agenda->allactions->read || GETPOST("filter","",1)=='mine') // If no permission to see all, we show only affected to me +if (! $user->rights->agenda->allactions->read || $filter =='mine') // If no permission to see all, we show only affected to me { $filtera=$user->id; $filtert=$user->id; @@ -67,7 +69,7 @@ $year=GETPOST("year","int")?GETPOST("year","int"):date("Y"); $month=GETPOST("month","int")?GETPOST("month","int"):date("m"); $day=GETPOST("day","int")?GETPOST("day","int"):0; $pid=GETPOST("projectid","int")?GETPOST("projectid","int"):0; -$status=GETPOST("status","int"); +$status=GETPOST("status"); $langs->load("other"); $langs->load("commercial"); @@ -108,6 +110,8 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); $form=new Form($db); +$companystatic=new Societe($db); +$contactstatic=new Contact($db); //print $langs->trans("FeatureNotYetAvailable"); $now=dol_now('tzref'); @@ -168,12 +172,13 @@ print_actions_filter($form,$canedit,$status,$year,$month,$day,$showborthday,$act $actionarray=array(); $sql = 'SELECT a.id,a.label,'; -$sql.= ' datep,'; -$sql.= ' datep2,'; -$sql.= ' datea,'; -$sql.= ' datea2,'; +$sql.= ' a.datep,'; +$sql.= ' a.datep2,'; +$sql.= ' a.datea,'; +$sql.= ' a.datea2,'; $sql.= ' a.percent,'; $sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,'; +$sql.= ' a.fk_soc, a.fk_contact,'; $sql.= ' ca.code'; $sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a'; $sql.= ', '.MAIN_DB_PREFIX.'c_actioncomm as ca'; @@ -246,6 +251,9 @@ if ($resql) $action->usertodo->id=$obj->fk_user_action; $action->userdone->id=$obj->fk_user_done; + $action->societe->id=$obj->fk_soc; + $action->contact->id=$obj->fk_contact; + // Defined date_start_in_calendar and date_end_in_calendar property // They are date start and end of action but modified to not be outside calendar view. if ($action->percentage <= 0) @@ -376,6 +384,10 @@ if ($showbirthday) } } +$maxlength=16; +$cachethirdparties=array(); +$cachecontact=array(); + // Define theme_datacolor array $color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php"; if (is_readable($color_file)) @@ -421,7 +433,7 @@ if ($_GET["action"] != 'show_day') // View by month { $style='cal_other_month'; echo '