Merge pull request #16707 from FHenry/dev_EventOrganisation

new: working on conference or booth object and event type #FoundationFunding
This commit is contained in:
Laurent Destailleur 2021-03-16 10:34:55 +01:00 committed by GitHub
commit 87ab711a0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 159 additions and 31 deletions

View File

@ -3686,7 +3686,7 @@ class Commande extends CommonOrder
$label .= ' '.$this->getLibStatut(5);
}
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.(empty($this->ref_customer) ? (empty($this->ref_client) ? '' : $this-ref_client) : $this->ref_customer);
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.(empty($this->ref_customer) ? (empty($this->ref_client) ? '' : $this->ref_client) : $this->ref_customer);
if (!empty($this->total_ht)) {
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
}

View File

@ -7232,12 +7232,13 @@ abstract class CommonObject
$classname = $InfoFieldList[0];
$classpath = $InfoFieldList[1];
$getnomurlparam = (empty($InfoFieldList[2]) ? 3 : $InfoFieldList[2]);
$getnomurlparam2 = (empty($InfoFieldList[4]) ? '' : $InfoFieldList[4]);
if (!empty($classpath)) {
dol_include_once($InfoFieldList[1]);
if ($classname && class_exists($classname)) {
$object = new $classname($this->db);
$object->fetch($value);
$value = $object->getNomUrl($getnomurlparam);
$value = $object->getNomUrl($getnomurlparam, $getnomurlparam2);
}
} else {
dol_syslog('Error bad setup of extrafield', LOG_WARNING);

View File

@ -337,7 +337,82 @@ class modEventOrganization extends DolibarrModules
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
*/
$this->menu[$r++]=array(
'fk_menu'=>'fk_mainmenu=project', // '' 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'=>'EventOrganizationMenuLeft',
'mainmenu'=>'project',
'leftmenu'=>'eventorganization',
'url'=>'',
'langs'=>'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->eventorganization->enabled', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->eventorganization->read', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
$this->menu[$r++]=array(
'fk_menu'=>'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' 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'=>'List',
'url'=>'/projet/list.php?search_usage_event_organization=1&mainmenu=project',
'langs'=>'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->eventorganization->enabled', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->eventorganization->read', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
$this->menu[$r++]=array(
'fk_menu'=>'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' 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'=>'New',
'url'=>'/projet/card.php?leftmenu=projects&action=create&usage_organize_event=1',
'langs'=>'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->eventorganization->enabled', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->eventorganization->write', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
$this->menu[$r++]=array(
'fk_menu'=>'fk_mainmenu=project', // '' 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'=>'EventOrganizationMenuLeft',
'mainmenu'=>'project',
'leftmenu'=>'eventorganizationconforbooth',
'url'=>'',
'langs'=>'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->eventorganization->enabled', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->eventorganization->read', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
$this->menu[$r++]=array(
'fk_menu'=>'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth', // '' 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'=>'List',
'url'=>'/eventorganization/conferenceorbooth_list.php?mainmenu=project',
'langs'=>'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->eventorganization->enabled', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->eventorganization->read', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
$this->menu[$r++]=array(
'fk_menu'=>'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth', // '' 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'=>'New',
'url'=>'/eventorganization/conferenceorbooth_card.php?leftmenu=projects&action=create',
'langs'=>'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->eventorganization->enabled', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->eventorganization->write', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
/* END MODULEBUILDER LEFTMENU CONFERENCEORBOOTH */
// Exports profiles provided by this module
$r = 1;

View File

@ -77,6 +77,8 @@ foreach ($object->fields as $key => $val) {
$value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'));
} elseif ($val['type'] == 'boolean') {
$value = (GETPOST($key) == 'on' ? 1 : 0);
} elseif ($val['type'] == 'price') {
$value = price2num(GETPOST($key));
} else {
$value = GETPOST($key, 'alphanohtml');
}

View File

@ -77,6 +77,8 @@ foreach ($object->fields as $key => $val) {
$check = 'restricthtml';
}
$value = GETPOSTISSET($key) ? GETPOST($key, $check) : $object->$key;
} elseif ($val['type'] == 'price') {
$value = price2num(GETPOST($key));
} else {
$value = GETPOSTISSET($key) ? GETPOST($key, 'alpha') : $object->$key;
}

View File

@ -69,7 +69,7 @@ class ConferenceOrBooth extends ActionComm
const STATUS_CONFIRMED = 2;
const STATUS_NOT_QUALIFIED = 3;
const STATUS_DONE = 4;
const STATUS_CANCELED = -1;
const STATUS_CANCELED = 9;
/**
@ -104,18 +104,20 @@ class ConferenceOrBooth extends ActionComm
*/
public $fields=array(
'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'ref' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'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'=>1, 'index'=>1, 'help'=>"LinkToThirparty",),
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1,),
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1::eventorganization', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1,),
'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1,),
'fk_action' => array('type'=>'sellist:c_actioncomm:label:rowid::module LIKE (\'conference\',\'booth\'))', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1,),
'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1,),
'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',),
'datep2' => array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',),
'datec' => 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_author' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',),
'fk_user_mod' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,),
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Valid&eacute;', '9'=>'Annul&eacute;'),),
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'EvntOrgDraft', '1'=>'EvntOrgSuggested', '2'=> 'EvntOrgConfirmed', '3' =>'EvntOrgNotQualified', '4' =>'EvntOrgDone', '9'=>'EvntOrgCancelled'),),
);
public $rowid;
public $id;
@ -185,6 +187,7 @@ class ConferenceOrBooth extends ActionComm
public function create(User $user, $notrigger = false)
{
$this->setPercentageFromStatus();
$this->setActionCommFields($user);
return parent::create($user, $notrigger);
}
@ -193,7 +196,7 @@ class ConferenceOrBooth extends ActionComm
*
* @return void
*/
public function setPercentageFromStatus()
protected function setPercentageFromStatus()
{
if ($this->status==self::STATUS_DONE) {
$this->percentage=100;
@ -203,6 +206,32 @@ class ConferenceOrBooth extends ActionComm
}
}
/**
* Set action comm fields
*
* @param User $user User
* @return void
*/
protected function setActionCommFields(User $user)
{
$this->userownerid=$user->id;
$this->type_id=$this->fk_action;
$this->socid=$this->fk_soc;
$this->datef=$this->datep2;
}
/**
* Get action comm fields
*
* @return void
*/
protected function getActionCommFields()
{
$this->fk_action=$this->type_id;
$this->fk_soc=$this->socid;
$this->datep2=$this->datef;
}
/**
* Load object in memory from the database
*
@ -215,6 +244,7 @@ class ConferenceOrBooth extends ActionComm
public function fetch($id, $ref = null, $ref_ext = '', $email_msgid = '')
{
$result = parent::fetch($id, $ref, $ref_ext, $email_msgid);
$this->getActionCommFields();
return $result;
}
@ -310,6 +340,7 @@ class ConferenceOrBooth extends ActionComm
public function update(User $user, $notrigger = false)
{
$this->setPercentageFromStatus();
$this->setActionCommFields($user);
return parent::update($user, $notrigger);
}

View File

@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("eventorganization", "projects"));
@ -452,7 +453,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
// Back to draft
if ($object->status == $object::STATUS_VALIDATED) {
if ($object->status == $object::STATUS_CONFIRMED) {
print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes', '', $permissiontoadd);
}

View File

@ -205,11 +205,11 @@ $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("ConferenceOrBoot
if ($projectid > 0) {
$project = new Project($db);
$result=$project->fetch($projectid);
$result = $project->fetch($projectid);
if ($result < 0) {
setEventMessages(null, $project->errors, 'errors');
}
$result=$project->fetch_thirdparty();
$result = $project->fetch_thirdparty();
if ($result < 0) {
setEventMessages(null, $project->errors, 'errors');
}
@ -305,7 +305,7 @@ if ($projectid > 0) {
print '<br>';
}
if (!empty($conf->eventorganization->enabled)) {
print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')).'"> ';
print '<input type="checkbox" disabled name="usage_organize_event"'.($project->usage_organize_event ? ' checked="checked"' : '').'"> ';
$htmltext = $langs->trans("EventOrganizationDescriptionLong");
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
}
@ -408,14 +408,16 @@ if ($object->ismultientitymanaged == 1) {
} else {
$sql .= " WHERE 1 = 1";
}
foreach ($search as $key => $val) {
if (in_array($key, $object->fields)) {
if (array_key_exists($key, $object->fields)) {
//var_dump($key,$object->fields);
if ($key == 'status' && $search[$key] == -1) {
continue;
}
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
if (strpos($object->fields[$key]['type'], 'integer:') === 0) {
if ($search[$key] == '-1') {
if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0)) {
if ($search[$key] == '-1' || $search[$key] === '0') {
$search[$key] = '';
}
$mode_search = 2;
@ -424,6 +426,7 @@ foreach ($search as $key => $val) {
$sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
}
} else {
//var_dump($key,$object->fields);
if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
$columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key);
if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
@ -437,6 +440,7 @@ foreach ($search as $key => $val) {
}
}
}
if ($search_all) {
$sql .= natural_search(array_keys($fieldstosearchall), $search_all);
}
@ -555,7 +559,7 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/eventorganization/conferenceorbooth_card.php', 1).'?action=create'.(!empty($projectid)?'&fk_project='.$projectid:'').'&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/eventorganization/conferenceorbooth_card.php', 1).'?action=create'.(!empty($project->id)?'&fk_project='.$project->id:'').(!empty($project->socid)?'&fk_soc='.$project->socid:'').'&backtopage='.urlencode($_SERVER['PHP_SELF']).(!empty($project->id)?'?projectid='.$project->id:''), '', $permissiontoadd);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
@ -618,7 +622,7 @@ foreach ($object->fields as $key => $val) {
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
} elseif (strpos($val['type'], 'integer:') === 0) {
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) {
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1);
} elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';

View File

@ -54,11 +54,6 @@ function conferenceorboothPrepareHead($object)
$head[$h][2] = 'document';
$h++;
$head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_agenda.php", 1).'?id='.$object->id;
$head[$h][1] = $langs->trans("Events");
$head[$h][2] = 'agenda';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
//$this->tabs = array(

View File

@ -16,11 +16,16 @@
#
# Generic
#
ModuleEventOrganizationName = Event Organization
EventOrganizationDescription = Event Organization through Module Project
EventOrganizationDescriptionLong= Manage Event organization for conference, attendees, speaker, and attendees, with public subcription page
#
# Menu
#
EventOrganizationMenuLeft = Organized events
EventOrganizationConferenceOrBoothMenuLeft = Conference Or Booth
#
# Admin page
#
@ -70,3 +75,13 @@ PriceOfRegistrationHelp=Price of registration
PriceOfBooth=Price of subscription
PriceOfBoothHelp=Price of subscription
EventOrganizationICSLink=Link ICS for events
#
# Status
#
EvntOrgDraft = Draft
EvntOrgSuggested = Suggested
EvntOrgConfirmed = Confirmed
EvntOrgNotQualified = Not Qualified
EvntOrgDone = Done
EvntOrgCancelled = Cancelled

View File

@ -284,13 +284,13 @@ if ($object->ismultientitymanaged == 1) {
$sql .= " WHERE 1 = 1";
}
foreach ($search as $key => $val) {
if (in_array($key, $object->fields)) {
if (array_key_exists($key, $object->fields)) {
if ($key == 'status' && $search[$key] == -1) {
continue;
}
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
if (strpos($object->fields[$key]['type'], 'integer:') === 0) {
if ($search[$key] == '-1') {
if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0)) {
if ($search[$key] == '-1' || $search[$key] === '0') {
$search[$key] = '';
}
$mode_search = 2;
@ -514,7 +514,7 @@ foreach ($object->fields as $key => $val) {
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
} elseif (strpos($val['type'], 'integer:') === 0) {
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) {
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1);
} elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';

View File

@ -1168,6 +1168,8 @@ class Project extends CommonObject
$url = DOL_URL_ROOT.'/projet/tasks.php?id='.$this->id;
} elseif ($option == 'preview') {
$url = DOL_URL_ROOT.'/projet/element.php?id='.$this->id;
} elseif ($option == 'eventorganization') {
$url = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_list.php?projectid='.$this->id;
} else {
$url = DOL_URL_ROOT.'/projet/card.php?id='.$this->id;
}

View File

@ -987,7 +987,7 @@ while ($i < min($num, $limit)) {
// Project url
if (!empty($arrayfields['p.ref']['checked'])) {
print '<td class="nowraponall">';
print $object->getNomUrl(1);
print $object->getNomUrl(1, (!empty(GETPOST('search_usage_event_organization', 'int'))?'eventorganization':''));
if ($object->hasDelay()) {
print img_warning($langs->trans('Late'));
}
@ -1198,8 +1198,8 @@ while ($i < min($num, $limit)) {
// Event Organization
if (!empty($arrayfields['p.usage_organize_event']['checked'])) {
print '<td class="right">';
if ($obj->usage_event_organization) {
print yn($obj->usage_event_organization);
if ($obj->usage_organize_event) {
print yn($obj->usage_organize_event);
}
print '</td>';
if (!$i) {