szollosil 1 год назад
Родитель
Сommit
eefad3816f

+ 14 - 5
comm/action/index.php

@@ -786,10 +786,10 @@ if ($filtert > 0 || $usergroup > 0) {
 	$sql .= ")";
 }
 // Sort on date
+$sql .= " AND ca.code = 'AC_EVENT'";
 $sql .= ' ORDER BY datep';
 //print $sql;
 
-
 dol_syslog("comm/action/index.php", LOG_DEBUG);
 $resql = $db->query($sql);
 if ($resql) {
@@ -1895,7 +1895,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
 
 					//var_dump($event->userassigned);
 					//var_dump($event->transparency);
-					print '<table class="centpercent cal_event';
+					print '<table class="centpercent cal_event cal_event_ac_event';
 					print (empty($event->transparency) ? ' cal_event_notbusy' : ' cal_event_busy');
 					//if (empty($event->transparency) && empty($conf->global->AGENDA_NO_TRANSPARENT_ON_NOT_BUSY)) print ' opacitymedium';	// Not busy
 					print '" style="'.$h;
@@ -1956,7 +1956,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
 
 							// Hour start
 							if ($tmpyearstart == $annee && $tmpmonthstart == $mois && $tmpdaystart == $jour) {
-								$daterange .= dol_print_date($event->date_start_in_calendar, 'hour', 'tzuserrel');
+								$daterange .= dol_print_date($event->date_start_in_calendar, 'H:i', 'tzuserrel');
 								if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) {
 									if ($tmpyearstart == $tmpyearend && $tmpmonthstart == $tmpmonthend && $tmpdaystart == $tmpdayend) {
 										$daterange .= '-';
@@ -1973,7 +1973,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
 							// Hour end
 							if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) {
 								if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) {
-									$daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel');
+									$daterange .= dol_print_date($event->date_end_in_calendar, 'H:i', 'tzuserrel');
 								}
 							}
 						} else {
@@ -1983,7 +1983,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
 						}
 
 						// Show title
-						$titletoshow = $daterange;
+						//$titletoshow = $daterange;
+						$titletoshow = $event->label;
 						$titletoshow .= ($titletoshow ? ' ' : '').dol_escape_htmltag($event->label ? $event->label : $event->libelle);
 
 						if ($event->type_code != 'ICALEVENT') {
@@ -2015,6 +2016,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
 						}
 
 						print $titletoshow;
+						print '<br>';
+						print '<a class="cal_event cal_event_title classfortooltip" href="" title="asd">' . $daterange . '</a>';
 						print $listofusertoshow;
 
 						if ($event->type_code == 'ICALEVENT') {
@@ -2223,3 +2226,9 @@ function sort_events_by_percentage($a, $b)
 
 	return $b->percentage - $a->percentage;
 }
+?>
+<style>
+	.cal_event_ac_event{
+		min-height: 100px !important;
+	}
+</style>

+ 2 - 2
custom/bbus/core/modules/modBBus.class.php

@@ -342,7 +342,7 @@ class modBBus extends DolibarrModules
 			'target'=>'',
 			'user'=>2,				                // 0=Menu for internal users, 1=external users, 2=both
 		);
-		$this->menu[$r++]=array(
+		/* $this->menu[$r++]=array(
 			'fk_menu'=>'fk_mainmenu=bbus',      // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
 			'type'=>'left',                          // This is a Left menu entry
 			'titre'=>'DeviceHandler',
@@ -401,7 +401,7 @@ class modBBus extends DolibarrModules
 			'perms'=>'1',			                // Use 'perms'=>'$user->rights->bbus->level1->level2' if you want your menu with a permission rules
 			'target'=>'',
 			'user'=>2,				                // 0=Menu for internal users, 1=external users, 2=both
-		);
+		); */
 
 		### App version
 		$this->menu[$r++]=array(

+ 117 - 104
custom/eventwizard/class/eventdetails.class.php

@@ -24,7 +24,8 @@
 
 // Put here all includes required by your class file
 use Luracast\Restler\RestException;
-require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
+
+require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php';
 //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
 //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
 
@@ -113,26 +114,26 @@ class EventDetails extends CommonObject
 	/**
 	 * @var array  Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
 	 */
-	public $fields=array(
-		'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
-		'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>0, 'default'=>'1', 'index'=>1,),
-		'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'searchall'=>1, 'validate'=>'1', 'comment'=>"Reference of object"),
-		'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>"Help text", 'showoncombobox'=>'2', 'validate'=>'1',),
-		'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>0, 'index'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'help'=>"OrganizationEventLinkToThirdParty", 'validate'=>'1',),
-		'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>3, 'validate'=>'1',),
-		'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0, 'cssview'=>'wordbreak', 'validate'=>'1',),
-		'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0, 'cssview'=>'wordbreak', 'validate'=>'1',),
-		'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
-		'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,),
-		'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'picto'=>'user', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',),
-		'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,),
-		'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>0,),
-		'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
-		'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,),
-		'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>2000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Piszkozat', '1'=>'Hiteles&iacute;tve', '9'=>'Cancelled'), 'validate'=>'1',),
-		'type' => array('type'=>'integer:BasicServices:custom/bbus/class/basicservices.class.php', 'label'=>'Type', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>-1,),
-		'fk_elventlocation_departure' => array('type'=>'integer:EventLocation:custom/eventwizard/class/eventlocation.class.php:1:(t.status:=:1) AND (t.entity:in:__SHARED_ENTITIES__)', 'label'=>'DeparturePoint', 'enabled'=>'1', 'position'=>51, 'notnull'=>0, 'visible'=>-1, 'default'=>'null',),
-		'fk_elventlocation_arrival' => array('type'=>'integer:EventLocation:custom/eventwizard/class/eventlocation.class.php:1:(t.status:=:1) AND (t.entity:in:__SHARED_ENTITIES__)', 'label'=>'ArrivalPoint', 'enabled'=>'1', 'position'=>52, 'notnull'=>0, 'visible'=>-1, 'default'=>'null',),
+	public $fields = array(
+		'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"),
+		'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => 0, 'default' => '1', 'index' => 1,),
+		'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => '1', 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'validate' => '1', 'comment' => "Reference of object"),
+		'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => '1', 'position' => 30, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => '2', 'validate' => '1',),
+		'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label' => 'ThirdParty', 'enabled' => '1', 'position' => 50, 'notnull' => -1, 'visible' => 0, 'index' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'help' => "OrganizationEventLinkToThirdParty", 'validate' => '1',),
+		'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => '1', 'position' => 60, 'notnull' => 0, 'visible' => 3, 'validate' => '1',),
+		'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => '1', 'position' => 61, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => '1',),
+		'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => '1', 'position' => 62, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => '1',),
+		'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 500, 'notnull' => 1, 'visible' => -2,),
+		'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 501, 'notnull' => 0, 'visible' => -2,),
+		'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'picto' => 'user', 'enabled' => '1', 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
+		'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'picto' => 'user', 'enabled' => '1', 'position' => 511, 'notnull' => -1, 'visible' => -2,),
+		'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => '1', 'position' => 600, 'notnull' => 0, 'visible' => 0,),
+		'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => '1', 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
+		'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => '1', 'position' => 1010, 'notnull' => -1, 'visible' => 0,),
+		'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => '1', 'position' => 2000, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array('0' => 'Piszkozat', '1' => 'Hiteles&iacute;tve', '9' => 'Cancelled'), 'validate' => '1',),
+		'type' => array('type' => 'integer:BasicServices:custom/bbus/class/basicservices.class.php', 'label' => 'Type', 'enabled' => '1', 'position' => 50, 'notnull' => 0, 'visible' => -1,),
+		'fk_elventlocation_departure' => array('type' => 'integer:EventLocation:custom/eventwizard/class/eventlocation.class.php:1:(t.status:=:1) AND (t.entity:in:__SHARED_ENTITIES__)', 'label' => 'DeparturePoint', 'enabled' => '1', 'position' => 51, 'notnull' => 0, 'visible' => -1, 'default' => 'null',),
+		'fk_elventlocation_arrival' => array('type' => 'integer:EventLocation:custom/eventwizard/class/eventlocation.class.php:1:(t.status:=:1) AND (t.entity:in:__SHARED_ENTITIES__)', 'label' => 'ArrivalPoint', 'enabled' => '1', 'position' => 52, 'notnull' => 0, 'visible' => -1, 'default' => 'null',),
 	);
 	public $rowid;
 	public $entity;
@@ -272,15 +273,15 @@ class EventDetails extends CommonObject
 		// Load source object
 		$result = $object->fetchCommon($fromid);
 		if ($result > 0 && !empty($object->table_element_line)) {
-			require_once DOL_DOCUMENT_ROOT.'/custom/eventwizard/class/eventdetailsline.class.php';
-			require_once DOL_DOCUMENT_ROOT.'/custom/eventwizard/class/eventproduct.class.php';
-			require_once DOL_DOCUMENT_ROOT.'/custom/eventwizard/class/eventoption.class.php';
+			require_once DOL_DOCUMENT_ROOT . '/custom/eventwizard/class/eventdetailsline.class.php';
+			require_once DOL_DOCUMENT_ROOT . '/custom/eventwizard/class/eventproduct.class.php';
+			require_once DOL_DOCUMENT_ROOT . '/custom/eventwizard/class/eventoption.class.php';
 			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
 			$object->fetchLines();
 		}
 
 		// get lines so they will be clone
-		foreach($this->lines as $line)
+		foreach ($this->lines as $line)
 			$line->fetch_optionals();
 
 		// Reset some properties
@@ -290,10 +291,10 @@ class EventDetails extends CommonObject
 
 		// Clear fields
 		if (property_exists($object, 'ref')) {
-			$object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default'];
+			$object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_" . $object->ref : $this->fields['ref']['default'];
 		}
 		if (property_exists($object, 'label')) {
-			$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default'];
+			$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf") . " " . $object->label : $this->fields['label']['default'];
 		}
 		if (property_exists($object, 'status')) {
 			$object->status = self::STATUS_DRAFT;
@@ -366,9 +367,9 @@ class EventDetails extends CommonObject
 	{
 		$result = $this->fetchCommon($id, $ref);
 		if ($result > 0 && !empty($this->table_element_line)) {
-			require_once DOL_DOCUMENT_ROOT.'/custom/eventwizard/class/eventdetailsline.class.php';
-			require_once DOL_DOCUMENT_ROOT.'/custom/eventwizard/class/eventproduct.class.php';
-			require_once DOL_DOCUMENT_ROOT.'/custom/eventwizard/class/eventoption.class.php';
+			require_once DOL_DOCUMENT_ROOT . '/custom/eventwizard/class/eventdetailsline.class.php';
+			require_once DOL_DOCUMENT_ROOT . '/custom/eventwizard/class/eventproduct.class.php';
+			require_once DOL_DOCUMENT_ROOT . '/custom/eventwizard/class/eventoption.class.php';
 			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
 			$this->fetchLines();
 		}
@@ -388,7 +389,7 @@ class EventDetails extends CommonObject
 		return $result;
 	}
 
-	
+
 	/**
 	 * Load list of objects in memory from the database.
 	 *
@@ -410,9 +411,9 @@ class EventDetails extends CommonObject
 
 		$sql = "SELECT ";
 		$sql .= $this->getFieldList('t');
-		$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
+		$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element . " as t";
 		if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
-			$sql .= " WHERE t.entity IN (".getEntity($this->element).")";
+			$sql .= " WHERE t.entity IN (" . getEntity($this->element) . ")";
 		} else {
 			$sql .= " WHERE 1 = 1";
 		}
@@ -421,20 +422,20 @@ class EventDetails extends CommonObject
 		if (count($filter) > 0) {
 			foreach ($filter as $key => $value) {
 				if ($key == 't.rowid') {
-					$sqlwhere[] = $key." = ".((int) $value);
+					$sqlwhere[] = $key . " = " . ((int) $value);
 				} elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) {
-					$sqlwhere[] = $key." = '".$this->db->idate($value)."'";
+					$sqlwhere[] = $key . " = '" . $this->db->idate($value) . "'";
 				} elseif ($key == 'customsql') {
 					$sqlwhere[] = $value;
 				} elseif (strpos($value, '%') === false) {
-					$sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")";
+					$sqlwhere[] = $key . " IN (" . $this->db->sanitize($this->db->escape($value)) . ")";
 				} else {
-					$sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'";
+					$sqlwhere[] = $key . " LIKE '%" . $this->db->escape($value) . "%'";
 				}
 			}
 		}
 		if (count($sqlwhere) > 0) {
-			$sql .= " AND (".implode(" ".$filtermode." ", $sqlwhere).")";
+			$sql .= " AND (" . implode(" " . $filtermode . " ", $sqlwhere) . ")";
 		}
 
 		if (!empty($sortfield)) {
@@ -462,8 +463,8 @@ class EventDetails extends CommonObject
 
 			return $records;
 		} else {
-			$this->errors[] = 'Error '.$this->db->lasterror();
-			dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
+			$this->errors[] = 'Error ' . $this->db->lasterror();
+			dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
 
 			return -1;
 		}
@@ -524,13 +525,13 @@ class EventDetails extends CommonObject
 	{
 		global $conf, $langs;
 
-		require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+		require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
 
 		$error = 0;
 
 		// Protection
 		if ($this->status == self::STATUS_VALIDATED) {
-			dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING);
+			dol_syslog(get_class($this) . "::validate action abandonned: already validated", LOG_WARNING);
 			return 0;
 		}
 
@@ -556,18 +557,18 @@ class EventDetails extends CommonObject
 
 		if (!empty($num)) {
 			// Validate
-			$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
-			$sql .= " SET ref = '".$this->db->escape($num)."',";
-			$sql .= " status = ".self::STATUS_VALIDATED;
+			$sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element;
+			$sql .= " SET ref = '" . $this->db->escape($num) . "',";
+			$sql .= " status = " . self::STATUS_VALIDATED;
 			if (!empty($this->fields['date_validation'])) {
-				$sql .= ", date_validation = '".$this->db->idate($now)."'";
+				$sql .= ", date_validation = '" . $this->db->idate($now) . "'";
 			}
 			if (!empty($this->fields['fk_user_valid'])) {
-				$sql .= ", fk_user_valid = ".((int) $user->id);
+				$sql .= ", fk_user_valid = " . ((int) $user->id);
 			}
-			$sql .= " WHERE rowid = ".((int) $this->id);
+			$sql .= " WHERE rowid = " . ((int) $this->id);
 
-			dol_syslog(get_class($this)."::validate()", LOG_DEBUG);
+			dol_syslog(get_class($this) . "::validate()", LOG_DEBUG);
 			$resql = $this->db->query($sql);
 			if (!$resql) {
 				dol_print_error($this->db);
@@ -591,30 +592,31 @@ class EventDetails extends CommonObject
 			// Rename directory if dir was a temporary ref
 			if (preg_match('/^[\(]?PROV/i', $this->ref)) {
 				// Now we rename also files into index
-				$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'eventdetails/".$this->db->escape($this->newref)."'";
-				$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'eventdetails/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
+				$sql = 'UPDATE ' . MAIN_DB_PREFIX . "ecm_files set filename = CONCAT('" . $this->db->escape($this->newref) . "', SUBSTR(filename, " . (strlen($this->ref) + 1) . ")), filepath = 'eventdetails/" . $this->db->escape($this->newref) . "'";
+				$sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'eventdetails/" . $this->db->escape($this->ref) . "' and entity = " . $conf->entity;
 				$resql = $this->db->query($sql);
 				if (!$resql) {
-					$error++; $this->error = $this->db->lasterror();
+					$error++;
+					$this->error = $this->db->lasterror();
 				}
 
 				// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
 				$oldref = dol_sanitizeFileName($this->ref);
 				$newref = dol_sanitizeFileName($num);
-				$dirsource = $conf->eventwizard->dir_output.'/eventdetails/'.$oldref;
-				$dirdest = $conf->eventwizard->dir_output.'/eventdetails/'.$newref;
+				$dirsource = $conf->eventwizard->dir_output . '/eventdetails/' . $oldref;
+				$dirdest = $conf->eventwizard->dir_output . '/eventdetails/' . $newref;
 				if (!$error && file_exists($dirsource)) {
-					dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest);
+					dol_syslog(get_class($this) . "::validate() rename dir " . $dirsource . " into " . $dirdest);
 
 					if (@rename($dirsource, $dirdest)) {
 						dol_syslog("Rename ok");
 						// Rename docs starting with $oldref with $newref
-						$listoffiles = dol_dir_list($conf->eventwizard->dir_output.'/eventdetails/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/'));
+						$listoffiles = dol_dir_list($conf->eventwizard->dir_output . '/eventdetails/' . $newref, 'files', 1, '^' . preg_quote($oldref, '/'));
 						foreach ($listoffiles as $fileentry) {
 							$dirsource = $fileentry['name'];
-							$dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource);
-							$dirsource = $fileentry['path'].'/'.$dirsource;
-							$dirdest = $fileentry['path'].'/'.$dirdest;
+							$dirdest = preg_replace('/^' . preg_quote($oldref, '/') . '/', $newref, $dirsource);
+							$dirsource = $fileentry['path'] . '/' . $dirsource;
+							$dirdest = $fileentry['path'] . '/' . $dirdest;
 							@rename($dirsource, $dirdest);
 						}
 					}
@@ -730,14 +732,14 @@ class EventDetails extends CommonObject
 
 		$result = '';
 
-		$label = img_picto('', $this->picto).' <u>'.$langs->trans("EventDetails").'</u>';
+		$label = img_picto('', $this->picto) . ' <u>' . $langs->trans("EventDetails") . '</u>';
 		if (isset($this->status)) {
-			$label .= ' '.$this->getLibStatut(5);
+			$label .= ' ' . $this->getLibStatut(5);
 		}
 		$label .= '<br>';
-		$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
+		$label .= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
 
-		$url = dol_buildpath('/eventwizard/eventdetails_card.php', 1).'?id='.$this->id;
+		$url = dol_buildpath('/eventwizard/eventdetails_card.php', 1) . '?id=' . $this->id;
 
 		if ($option != 'nolink') {
 			// Add param to save lastsearch_values or not
@@ -754,20 +756,20 @@ class EventDetails extends CommonObject
 		if (empty($notooltip)) {
 			if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
 				$label = $langs->trans("ShowEventDetails");
-				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+				$linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"';
 			}
-			$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
-			$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
+			$linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"';
+			$linkclose .= ' class="classfortooltip' . ($morecss ? ' ' . $morecss : '') . '"';
 		} else {
-			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
+			$linkclose = ($morecss ? ' class="' . $morecss . '"' : '');
 		}
 
 		if ($option == 'nolink' || empty($url)) {
 			$linkstart = '<span';
 		} else {
-			$linkstart = '<a href="'.$url.'"';
+			$linkstart = '<a href="' . $url . '"';
 		}
-		$linkstart .= $linkclose.'>';
+		$linkstart .= $linkclose . '>';
 		if ($option == 'nolink' || empty($url)) {
 			$linkend = '</span>';
 		} else {
@@ -778,29 +780,29 @@ class EventDetails extends CommonObject
 
 		if (empty($this->showphoto_on_popup)) {
 			if ($withpicto) {
-				$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
+				$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="' . (($withpicto != 2) ? 'paddingright ' : '') . 'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
 			}
 		} else {
 			if ($withpicto) {
-				require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+				require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
 
 				list($class, $module) = explode('@', $this->picto);
-				$upload_dir = $conf->$module->multidir_output[$conf->entity]."/$class/".dol_sanitizeFileName($this->ref);
+				$upload_dir = $conf->$module->multidir_output[$conf->entity] . "/$class/" . dol_sanitizeFileName($this->ref);
 				$filearray = dol_dir_list($upload_dir, "files");
 				$filename = $filearray[0]['name'];
 				if (!empty($filename)) {
 					$pospoint = strpos($filearray[0]['name'], '.');
 
-					$pathtophoto = $class.'/'.$this->ref.'/thumbs/'.substr($filename, 0, $pospoint).'_mini'.substr($filename, $pospoint);
-					if (empty($conf->global->{strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS'})) {
-						$result .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$module.'" alt="No photo" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$module.'&entity='.$conf->entity.'&file='.urlencode($pathtophoto).'"></div></div>';
+					$pathtophoto = $class . '/' . $this->ref . '/thumbs/' . substr($filename, 0, $pospoint) . '_mini' . substr($filename, $pospoint);
+					if (empty($conf->global->{strtoupper($module . '_' . $class) . '_FORMATLISTPHOTOSASUSERS'})) {
+						$result .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo' . $module . '" alt="No photo" border="0" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $module . '&entity=' . $conf->entity . '&file=' . urlencode($pathtophoto) . '"></div></div>';
 					} else {
-						$result .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$module.'&entity='.$conf->entity.'&file='.urlencode($pathtophoto).'"></div>';
+						$result .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $module . '&entity=' . $conf->entity . '&file=' . urlencode($pathtophoto) . '"></div>';
 					}
 
 					$result .= '</div>';
 				} else {
-					$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
+					$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="' . (($withpicto != 2) ? 'paddingright ' : '') . 'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
 				}
 			}
 		}
@@ -814,7 +816,7 @@ class EventDetails extends CommonObject
 
 		global $action, $hookmanager;
 		$hookmanager->initHooks(array('eventdetailsdao'));
-		$parameters = array('id'=>$this->id, 'getnomurl' => &$result);
+		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
 		if ($reshook > 0) {
 			$result = $hookmanager->resPrint;
@@ -869,7 +871,7 @@ class EventDetails extends CommonObject
 			$this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled');
 		}
 
-		$statusType = 'status'.$status;
+		$statusType = 'status' . $status;
 		//if ($status == self::STATUS_VALIDATED) $statusType = 'status1';
 		if ($status == self::STATUS_CANCELED) {
 			$statusType = 'status6';
@@ -889,8 +891,8 @@ class EventDetails extends CommonObject
 		$sql = "SELECT rowid,";
 		$sql .= " date_creation as datec, tms as datem,";
 		$sql .= " fk_user_creat, fk_user_modif";
-		$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
-		$sql .= " WHERE t.rowid = ".((int) $id);
+		$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element . " as t";
+		$sql .= " WHERE t.rowid = " . ((int) $id);
 
 		$result = $this->db->query($sql);
 		if ($result) {
@@ -942,7 +944,7 @@ class EventDetails extends CommonObject
 		$this->lines = array();
 
 		$objectline = new EventDetailsLine($this->db);
-		$result = $objectline->fetchAll('ASC', 'rowid', 0, 0, array('customsql'=>'fk_eventdetails = '.((int) $this->id)));
+		$result = $objectline->fetchAll('ASC', 'rowid', 0, 0, array('customsql' => 'fk_eventdetails = ' . ((int) $this->id)));
 
 		if (is_numeric($result)) {
 			$this->error = $objectline->error;
@@ -971,20 +973,20 @@ class EventDetails extends CommonObject
 		if (!empty($conf->global->EVENTWIZARD_EVENTDETAILS_ADDON)) {
 			$mybool = false;
 
-			$file = $conf->global->EVENTWIZARD_EVENTDETAILS_ADDON.".php";
+			$file = $conf->global->EVENTWIZARD_EVENTDETAILS_ADDON . ".php";
 			$classname = $conf->global->EVENTWIZARD_EVENTDETAILS_ADDON;
 
 			// Include file with class
 			$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
 			foreach ($dirmodels as $reldir) {
-				$dir = dol_buildpath($reldir."core/modules/eventwizard/");
+				$dir = dol_buildpath($reldir . "core/modules/eventwizard/");
 
 				// Load file with numbering class (if found)
-				$mybool |= @include_once $dir.$file;
+				$mybool |= @include_once $dir . $file;
 			}
 
 			if ($mybool === false) {
-				dol_print_error('', "Failed to include file ".$file);
+				dol_print_error('', "Failed to include file " . $file);
 				return '';
 			}
 
@@ -1000,7 +1002,7 @@ class EventDetails extends CommonObject
 					return "";
 				}
 			} else {
-				print $langs->trans("Error")." ".$langs->trans("ClassNotFound").' '.$classname;
+				print $langs->trans("Error") . " " . $langs->trans("ClassNotFound") . ' ' . $classname;
 				return "";
 			}
 		} else {
@@ -1079,15 +1081,15 @@ class EventDetails extends CommonObject
 	}
 
 
-	public function genEvents($data){
+	public function genEvents($data)
+	{
 
 		global $conf, $langs, $user;
 		//event
-		require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
+		require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
 		if (!$user->rights->agenda->myactions->create) {
 			// throw new RestException(401, "Insufficient rights to create your Agenda Event");
 			throw new RestException(401, "user->rights->agenda->myactions->create DENIED");
-
 		}
 		if (!$user->rights->agenda->allactions->create && $user->id != $request_data['userownerid']) {
 			// throw new RestException(401, "Insufficient rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.$user->id);
@@ -1098,32 +1100,33 @@ class EventDetails extends CommonObject
 		// $result = $this->_validate($request_data);
 
 		// foreach ($request_data as $field => $value) {
-			// $this->actioncomm->$field = $this->_checkValForAPI($field, $value, $this->actioncomm);
+		// $this->actioncomm->$field = $this->_checkValForAPI($field, $value, $this->actioncomm);
 		// }
 		$now = dol_now();
-		
+
 		//... !!! $this->db->begin();
-		$AC_EVENT_ID = getDictionaryValue('c_actioncomm','id','AC_EVENT',false,'code');
-		if(!$AC_EVENT_ID){
+		$AC_EVENT_ID = getDictionaryValue('c_actioncomm', 'id', 'AC_EVENT', false, 'code');
+		if (!$AC_EVENT_ID) {
 			throw new RestException(401, "AC_EVENT_ID missing!");
 		}
-		foreach($data['dates'] as $k=>$v){
-			foreach($v as $k2=>$v2){
+		foreach ($data['dates'] as $k => $v) {
+			foreach ($v as $k2 => $v2) {
 				$this->actioncomm = new ActionComm($this->db);
-				
+
 				$this->actioncomm->entity = 1;
 				$this->actioncomm->fk_parent = 0;
 				$this->actioncomm->ref = '(PROV)';
 				$this->actioncomm->ref = 'Label';
+				$this->actioncomm->label = $this->getEventDetailsLabel((int)$data['id_eventdetails']);
 				$this->actioncomm->datec = $this->db->idate($now);
-				$this->actioncomm->datep = strtotime($k.' '.$v2['start']);
+				$this->actioncomm->datep = strtotime($k . ' ' . $v2['start']);
 				// $this->actioncomm->datef = $k.' '.$v2['end'];
-				$timeExpl = explode(":",$v2['duration']);
-				$time = new DateTime($k.' '.$v2['start']);
-				$time->add(new DateInterval('PT' . $timeExpl[0] . 'H'. $timeExpl[1] . 'M'));
+				$timeExpl = explode(":", $v2['duration']);
+				$time = new DateTime($k . ' ' . $v2['start']);
+				$time->add(new DateInterval('PT' . $timeExpl[0] . 'H' . $timeExpl[1] . 'M'));
 				$this->actioncomm->datef = strtotime($time->format('Y-m-d H:i:s'));
 				// $this->actioncomm->datep2 = $k.' '.$v2['end'];
-				
+
 				$this->actioncomm->type_id = $AC_EVENT_ID;
 				$this->actioncomm->code = 'AC_EVENT';
 				$this->actioncomm->elementtype = 'eventdetails@eventwizard';
@@ -1142,7 +1145,7 @@ class EventDetails extends CommonObject
 					"buffer" => (int)$data['buffer'],
 					"participants" => (int)$data['participants']
 				];
-				
+
 				// 	transparency	priority	visibility	fulldayevent	percent	location	durationp	label	note	calling_duration	email_subject	email_msgid	email_from	email_sender	email_to	email_tocc	email_tobcc	errors_to	reply_to	recurid	recurrule	recurdateend	num_vote	event_paid	status	fk_element	elementtype	import_key	extraparams
 				// $this->actioncomm->
 				// $info = [];
@@ -1161,5 +1164,15 @@ class EventDetails extends CommonObject
 		}
 		return true;
 	}
-}
 
+	private function getEventDetailsLabel($eventdetails_id) {
+		$sql = "SELECT label FROM llx_eventwizard_eventdetails WHERE rowid = {$eventdetails_id}";
+		$result = $this->db->query($sql);
+		if($this->db->num_rows($result) > 0){
+			while($row = $this->db->fetch_object($result)){
+				return $row->label;
+			}
+		}
+		return '';
+	}
+}