diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index e821c4ce84d..e4b6907332b 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -1,7 +1,8 @@ - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Laurent Destailleur +/* Copyright (C) 2006 Roman Ozana + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin * * 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 @@ -28,14 +29,16 @@ class ical var $cal; // Array to save iCalendar parse data var $event_count; // Number of Events var $todo_count; // Number of Todos + var $freebusy_count; // Number of Freebusy var $last_key; //Help variable save last key (multiline string) /** * Constructor */ - public function ical() + public function __construct() { + } /** @@ -338,7 +341,7 @@ class ical */ function get_event_list() { - return $this->cal['VEVENT']; + return (! empty($this->cal['VEVENT'])?$this->cal['VEVENT']:''); } /** diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 2efad0d3cf4..50dc49e2f24 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -44,7 +44,9 @@ $langs->load("orders"); $langs->load("agenda"); $action=GETPOST('action','alpha'); +$cancel=GETPOST('cancel','alpha'); $backtopage=GETPOST('backtopage','alpha'); +$contactid=GETPOST('contactid','int'); // Security check $socid = GETPOST('socid','int'); @@ -53,6 +55,7 @@ if ($user->societe_id) $socid=$user->societe_id; //$result = restrictedArea($user, 'agenda', $id, 'actioncomm', 'actions', '', 'id'); $error=GETPOST("error"); +$mesg=''; $cactioncomm = new CActionComm($db); $actioncomm = new ActionComm($db); @@ -73,12 +76,12 @@ if ($action == 'add_action') else $backtopage=DOL_URL_ROOT.'/comm/action/index.php'; } - if ($_POST["contactid"]) + if ($contactid) { - $result=$contact->fetch($_POST["contactid"]); + $result=$contact->fetch($contactid); } - if ($_POST['cancel']) + if ($cancel) { header("Location: ".$backtopage); exit; @@ -368,7 +371,7 @@ if ($action == 'create') if ($result < 0) dol_print_error($db,$contact->error); } - if ($conf->use_javascript_ajax) + if (! empty($conf->use_javascript_ajax)) { print "\n".'