From be34fb454178f800bda438004ba3bc26e6ba8799 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Sun, 21 Feb 2021 12:32:16 +0100 Subject: [PATCH] tab event ok --- htdocs/core/lib/project.lib.php | 2 +- .../install/mysql/migration/13.0.0-14.0.0.sql | 5 + htdocs/install/mysql/tables/llx_projet.sql | 4 + htdocs/langs/en_US/eventorganization.lang | 13 + htdocs/projet/card.php | 18 +- htdocs/projet/class/project.class.php | 27 +- htdocs/projet/event.php | 346 ++++++++++++++++++ htdocs/projet/list.php | 96 +++++ 8 files changed, 500 insertions(+), 11 deletions(-) create mode 100644 htdocs/projet/event.php diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 866a94149c9..c11cc4a74d6 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -125,7 +125,7 @@ function project_prepare_head(Project $project) $langs->load('eventorganization'); //TODO : Count $nbConfOrBooth = 1; - $head[$h][0] = DOL_URL_ROOT . '/eventorganisation/conferenceorbooth_card.php?id=' . $project->id; + $head[$h][0] = DOL_URL_ROOT . '/projet/event.php?id=' . $project->id; $head[$h][1] = $langs->trans("ConferenceOrBoothTab"); if ($nbContact > 0) $head[$h][1] .= '' . $nbConfOrBooth . ''; $head[$h][2] = 'eventorganisation'; diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 5a88439e7de..c3b8ab2fea8 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -174,5 +174,10 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailAttendes', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendes)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__

__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__

__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); +ALTER TABLE llx_projet ADD COLUMN allow_unknown_people_conf integer DEFAULT 0; +ALTER TABLE llx_projet ADD COLUMN allow_unknown_people_booth integer DEFAULT 0; +ALTER TABLE llx_projet ADD COLUMN price_registration double(24,8); +ALTER TABLE llx_projet ADD COLUMN price_booth double(24,8); + -- Uniformize field total_ht, total_tva, total_ttc ALTER TABLE llx_propal CHANGE COLUMN tva total_tva double(24,8) default 0; diff --git a/htdocs/install/mysql/tables/llx_projet.sql b/htdocs/install/mysql/tables/llx_projet.sql index 76d254aafd3..e6dccbaf233 100644 --- a/htdocs/install/mysql/tables/llx_projet.sql +++ b/htdocs/install/mysql/tables/llx_projet.sql @@ -48,6 +48,10 @@ create table llx_projet usage_task integer DEFAULT 1, -- Set to 1 if project is used to manage tasks and/or record timesheet usage_bill_time integer DEFAULT 0, -- Set to 1 if time spent must be converted into invoices usage_organize_event integer DEFAULT 0, -- Set to 1 if you want to use project to organize an event, receive attendees subscription + allow_unknown_people_conf integer DEFAULT 0, -- Set to 1 if you want to allow unknown people to suggest conferences + allow_unknown_people_booth integer DEFAULT 0, -- Set to 1 if you want to Allow unknown people to suggest booth + price_registration double(24,8), + price_booth double(24,8), model_pdf varchar(255), last_main_doc varchar(255), -- relative filepath+filename of last main generated document import_key varchar(14) -- Import key diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 7dacefa4d56..0c7e4f047ce 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -57,3 +57,16 @@ EventOrganizationEmailSubsBooth = Subscription for booth EventOrganizationEmailSubsEvent = Subscription for an event EventOrganizationMassEmailAttendees = Communication to attendes EventOrganizationMassEmailSpeakers = Communication to speakers + +# +# Event +# +AllowUnknownPeopleSuggestConf=Allow unknown people to suggest conferences +AllowUnknownPeopleSuggestConfHelp=Allow unknown people to suggest conferences +AllowUnknownPeopleSuggestBooth=Allow unknown people to suggest booth +AllowUnknownPeopleSuggestBoothHelp=Allow unknown people to suggest booth +PriceOfRegistration=Price of registration +PriceOfRegistrationHelp=Price of registration +PriceOfBooth=Price of subscription +PriceOfBoothHelp=Price of subscription +EventOrganizationICSLink=Link ICS for events diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 0462f9d3391..5370dcfa8f9 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -228,7 +228,7 @@ if (empty($reshook)) } } - if ($action == 'update' && !$_POST["cancel"] && $user->rights->projet->creer) + if ($action == 'update' && empty(GETPOST('cancel')) && $user->rights->projet->creer) { $error = 0; @@ -1132,7 +1132,7 @@ if ($action == 'create' && $user->rights->projet->creer) if ($action == 'edit' && $userWrite > 0) { print '
'; - print '     '; + print '     '; print ''; print '
'; } @@ -1223,14 +1223,14 @@ if ($action == 'create' && $user->rights->projet->creer) // Send if (empty($user->socid)) { - if ($object->statut != 2) + if ($object->statut != Project::STATUS_CLOSED) { print ''.$langs->trans('SendMail').''; } } // Modify - if ($object->statut != 2 && $user->rights->projet->creer) + if ($object->statut != Project::STATUS_CLOSED && $user->rights->projet->creer) { if ($userWrite > 0) { @@ -1241,7 +1241,7 @@ if ($action == 'create' && $user->rights->projet->creer) } // Validate - if ($object->statut == 0 && $user->rights->projet->creer) + if ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer) { if ($userWrite > 0) { @@ -1252,7 +1252,7 @@ if ($action == 'create' && $user->rights->projet->creer) } // Close - if ($object->statut == 1 && $user->rights->projet->creer) + if ($object->statut == Project::STATUS_VALIDATED && $user->rights->projet->creer) { if ($userWrite > 0) { @@ -1263,7 +1263,7 @@ if ($action == 'create' && $user->rights->projet->creer) } // Reopen - if ($object->statut == 2 && $user->rights->projet->creer) + if ($object->statut == Project::STATUS_CLOSED && $user->rights->projet->creer) { if ($userWrite > 0) { @@ -1340,9 +1340,9 @@ if ($action == 'create' && $user->rights->projet->creer) } // Delete - if ($user->rights->projet->supprimer || ($object->statut == 0 && $user->rights->projet->creer)) + if ($user->rights->projet->supprimer || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) { - if ($userDelete > 0 || ($object->statut == 0 && $user->rights->projet->creer)) + if ($userDelete > 0 || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) { print ''.$langs->trans("Delete").''; } else { diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index ff4be5e8d77..878a491de49 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -201,6 +201,10 @@ class Project extends CommonObject 'usage_opportunity' =>array('type'=>'integer', 'label'=>'UsageOpportunity', 'enabled'=>1, 'visible'=>-1, 'position'=>135), 'usage_task' =>array('type'=>'integer', 'label'=>'UsageTasks', 'enabled'=>1, 'visible'=>-1, 'position'=>140), 'usage_organize_event' =>array('type'=>'integer', 'label'=>'UsageOrganizeEvent', 'enabled'=>1, 'visible'=>-1, 'position'=>145), + 'allow_unknown_people_conf' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestConf', 'enabled'=>1, 'visible'=>-1, 'position'=>146), + 'allow_unknown_people_booth' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>147), + 'price_registration' =>array('type'=>'double(24,8)', 'label'=>'PriceOfRegistration', 'enabled'=>1, 'visible'=>-1, 'position'=>148), + 'price_booth' =>array('type'=>'double(24,8)', 'label'=>'PriceOfBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>149), 'datec' =>array('type'=>'datetime', 'label'=>'DateCreationShort', 'enabled'=>1, 'visible'=>-2, 'position'=>200), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>205), 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>210), @@ -257,6 +261,10 @@ class Project extends CommonObject if (empty($conf->eventorganization->enabled)) { $this->fields['usage_organize_event']['visible'] = 0; + $this->fields['allow_unknown_people_conf']['enabled'] = 0; + $this->fields['allow_unknown_people_booth']['enabled'] = 0; + $this->fields['price_registration']['enabled'] = 0; + $this->fields['price_booth']['enabled'] = 0; } } @@ -316,6 +324,10 @@ class Project extends CommonObject $sql .= ", usage_task"; $sql .= ", usage_bill_time"; $sql .= ", usage_organize_event"; + $sql .= ", allow_unknown_people_conf"; + $sql .= ", allow_unknown_people_booth"; + $sql .= ", price_registration"; + $sql .= ", price_booth"; $sql .= ", email_msgid"; $sql .= ", note_private"; $sql .= ", note_public"; @@ -339,6 +351,10 @@ class Project extends CommonObject $sql .= ", ".($this->usage_task ? 1 : 0); $sql .= ", ".($this->usage_bill_time ? 1 : 0); $sql .= ", ".($this->usage_organize_event ? 1 : 0); + $sql .= ", ".($this->allow_unknown_people_conf ? 1 : 0); + $sql .= ", ".($this->allow_unknown_people_booth ? 1 : 0); + $sql .= ", ".(strcmp($this->price_registration, '') ? price2num($this->price_registration) : 'null'); + $sql .= ", ".(strcmp($this->price_booth, '') ? price2num($this->price_booth) : 'null'); $sql .= ", ".($this->email_msgid ? "'".$this->db->escape($this->email_msgid)."'" : 'null'); $sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : 'null'); $sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null'); @@ -442,6 +458,10 @@ class Project extends CommonObject $sql .= ", usage_task = ".($this->usage_task ? 1 : 0); $sql .= ", usage_bill_time = ".($this->usage_bill_time ? 1 : 0); $sql .= ", usage_organize_event = ".($this->usage_organize_event ? 1 : 0); + $sql .= ", allow_unknown_people_conf = ".($this->allow_unknown_people_conf ? 1 : 0); + $sql .= ", allow_unknown_people_booth = ".($this->allow_unknown_people_booth ? 1 : 0); + $sql .= ", price_registration = ".(strcmp($this->price_registration, '') ? price2num($this->price_registration) : "null"); + $sql .= ", price_booth = ".(strcmp($this->price_booth, '') ? price2num($this->price_booth) : "null"); $sql .= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update", LOG_DEBUG); @@ -531,7 +551,8 @@ class Project extends CommonObject $sql = "SELECT rowid, entity, ref, title, description, public, datec, opp_amount, budget_amount,"; $sql .= " tms, dateo, datee, date_close, fk_soc, fk_user_creat, fk_user_modif, fk_user_close, fk_statut as status, fk_opp_status, opp_percent,"; - $sql .= " note_private, note_public, model_pdf, usage_opportunity, usage_task, usage_bill_time, usage_organize_event, email_msgid"; + $sql .= " note_private, note_public, model_pdf, usage_opportunity, usage_task, usage_bill_time, usage_organize_event, email_msgid,"; + $sql .= " allow_unknown_people_conf, allow_unknown_people_booth, price_registration, price_booth"; $sql .= " FROM ".MAIN_DB_PREFIX."projet"; if (!empty($id)) { @@ -588,6 +609,10 @@ class Project extends CommonObject $this->usage_task = (int) $obj->usage_task; $this->usage_bill_time = (int) $obj->usage_bill_time; $this->usage_organize_event = (int) $obj->usage_organize_event; + $this->allow_unknown_people_conf = (int) $obj->allow_unknown_people_conf; + $this->allow_unknown_people_booth = (int) $obj->allow_unknown_people_booth; + $this->price_registration = $obj->price_registration; + $this->price_booth = $obj->price_booth; $this->email_msgid = $obj->email_msgid; $this->db->free($resql); diff --git a/htdocs/projet/event.php b/htdocs/projet/event.php new file mode 100644 index 00000000000..2aa0b29190a --- /dev/null +++ b/htdocs/projet/event.php @@ -0,0 +1,346 @@ + + * Copyright (C) 2012 Laurent Destailleur + * Copyright (C) 2021 florian.henry@scopen.fr + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/projet/event.php + * \ingroup project + * \brief Tab event organization + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + +// Load translation files required by the page +$langs->load('projects','enevntorganization'); + +$action = GETPOST('action', 'aZ09'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); + +$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0; +//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects + +$object = new Project($db); + +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once + +// Security check +$socid = 0; +if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. +$result = restrictedArea($user, 'eventorganization', $id); + +$permissiontoread = $user->rights->eventorganization->read; +$permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); + +/* + * Actions + */ + +if ($action == 'update' && empty(GETPOST('cancel')) && $permissiontoadd) { + $error = 0; + $object->oldcopy = clone $object; + + $object->allow_unknown_people_conf=(GETPOST('allow_unknown_people_conf', 'alpha') == 'on' ? 1 : 0); + $object->allow_unknown_people_booth=(GETPOST('allow_unknown_people_booth', 'alpha') == 'on' ? 1 : 0); + $object->price_registration=price2num(GETPOST('price_registration', 'alphanohtml'));; + $object->price_booth=price2num(GETPOST('price_booth', 'alphanohtml'));; + + $result = $object->update($user); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + $db->rollback(); + $action = 'edit'; + } else { + $db->commit(); + if (GETPOST('socid', 'int') > 0) $object->fetch_thirdparty(GETPOST('socid', 'int')); + else unset($object->thirdparty); + $action=''; + } +} + + + +/* + * View + */ + +$title = $langs->trans("Project").' - '.$langs->trans("ConferenceOrBoothTab").' - '.$object->ref.' '.$object->name; +if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->ref.' '.$object->name.' - '.$langs->trans("Note"); +//TODO Make wiki docs +$help_url = ''; +llxHeader("", $title, $help_url); + +$form = new Form($db); +$userstatic = new User($db); + +$now = dol_now(); + +if ($id > 0 || !empty($ref)) +{ + + $head = project_prepare_head($object); + print dol_get_fiche_head($head, 'eventorganisation', $langs->trans('ConferenceOrBoothTab'), -1); + + // Project card + + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
'; + // Title + $morehtmlref .= $object->title; + // Thirdparty + if ($object->thirdparty->id > 0) + { + $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + } + $morehtmlref .= '
'; + + // Define a complementary filter for search of next/prev ref. + if (!$user->rights->projet->all->lire) + { + $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); + $object->next_prev_filter = " rowid in (".(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")"; + } + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + print '
'; + print '
'; + + print ''; + + // Usage + print ''; + print ''; + + // Visibility + print ''; + + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) && !empty($object->usage_opportunity)) + { + // Opportunity status + print ''; + + // Opportunity percent + print ''; + + // Opportunity Amount + print ''; + + // Opportunity Weighted Amount + print ''; + } + + // Date start - end + print ''; + + // Budget + print ''; + + // Other attributes + $cols = 2; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; + + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + + if (!empty($conf->eventorganization->enabled)) + { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; + if ($object->public) print $langs->trans('SharedProject'); + else print $langs->trans('PrivateProject'); + print '
'.$langs->trans("OpportunityStatus").''; + $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); + if ($code) print $langs->trans("OppStatus".$code); + print '
'.$langs->trans("OpportunityProbability").''; + if (strcmp($object->opp_percent, '')) print price($object->opp_percent, 0, $langs, 1, 0).' %'; + print '
'.$langs->trans("OpportunityAmount").''; + /*if ($object->opp_status) + { + print price($obj->opp_amount, 1, $langs, 1, 0, -1, $conf->currency); + }*/ + if (strcmp($object->opp_amount, '')) print price($object->opp_amount, 0, $langs, 1, 0, -1, $conf->currency); + print '
'.$langs->trans('OpportunityWeightedAmount').''; + if (strcmp($object->opp_amount, '') && strcmp($object->opp_percent, '')) print price($object->opp_amount * $object->opp_percent / 100, 0, $langs, 1, 0, -1, $conf->currency); + print '
'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + $start = dol_print_date($object->date_start, 'day'); + print ($start ? $start : '?'); + $end = dol_print_date($object->date_end, 'day'); + print ' - '; + print ($end ? $end : '?'); + if ($object->hasDelay()) print img_warning("Late"); + print '
'.$langs->trans("Budget").''; + if (strcmp($object->budget_amount, '')) print price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); + print '
'; + + print '
'; + print '
'; + print '
'; + print '
'; + + if ($action == 'edit') { + print '
'; + print ''; + print ''; + print ''; + } + + print ''; + + // Description + print ''; + + // Categories + if ($conf->categorie->enabled) { + print '"; + } + + if ($action == 'edit' && $permissiontoadd) { + //Allow unknown people to suggest conferences + print '"; + + //Allow unknown people to suggest booth + print '"; + + //Price of registration + print '"; + + //Price of registration + print '"; + } else { + //Allow unknown people to suggest conferences + print '"; + + //Allow unknown people to suggest booth + print '"; + + //Price of registration + print '"; + + //Price of registration + print '"; + } + + //ICS Link + print '"; + + print '
'.$langs->trans("Description").''; + print dol_htmlentitiesbr($object->description); + print '
'.$langs->trans("Categories").''; + print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); + print "
' . $langs->trans("AllowUnknownPeopleSuggestConf") . $form->textwithpicto('', $langs->trans("AllowUnknownPeopleSuggestConfHelp")) . ''; + print 'allow_unknown_people_conf ? ' checked="checked"' : '')) . '"> '; + print "
' . $langs->trans("AllowUnknownPeopleSuggestBooth") . $form->textwithpicto('', $langs->trans("AllowUnknownPeopleSuggestBoothHelp")) . ''; + print 'allow_unknown_people_booth ? ' checked="checked"' : '')) . '"> '; + print "
' . $langs->trans("PriceOfRegistration") . ''; + print ''; + print "
' . $langs->trans("PriceOfBooth") . ''; + print ''; + print "
' . $langs->trans("AllowUnknownPeopleSuggestConf") . $form->textwithpicto('', $langs->trans("AllowUnknownPeopleSuggestConfHelp")) . ''; + print 'allow_unknown_people_conf ? ' checked="checked"' : '')) . '"> '; + print "
' . $langs->trans("AllowUnknownPeopleSuggestBooth") . $form->textwithpicto('', $langs->trans("AllowUnknownPeopleSuggestBoothHelp")) . ''; + print 'allow_unknown_people_booth ? ' checked="checked"' : '')) . '"> '; + print "
' . $langs->trans("PriceOfRegistration") . ''; + if (strcmp($object->price_registration, '')) print price($object->price_registration, 0, $langs, 1, 0, 0, $conf->currency); + print "
' . $langs->trans("PriceOfBooth") . ''; + if (strcmp($object->price_booth, '')) print price($object->price_booth, 0, $langs, 1, 0, 0, $conf->currency); + print "
'.$langs->trans("EventOrganizationICSLink").''; + //TODO ICS Link + //print 'ICS'; + print "
'; + + print ''; + + print '
'; + print '
'; + print '
'; + + print '
'; + +} + +print dol_get_fiche_end(); + +if ($action == 'edit' && $permissiontoadd > 0) +{ + print '
'; + print '     '; + print ''; + print '
'; + + print ''; +} + + +/* + * Actions Buttons + */ +print '
'; +$parameters = array(); +$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been +// modified by hook +if (empty($reshook)) +{ + // Modify + if ($object->statut != Project::STATUS_CLOSED && $action=='') + { + if ($permissiontoadd > 0) + { + print ''.$langs->trans("Modify").''; + } else { + print ''.$langs->trans('Modify').''; + } + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index c51713d1cce..2ba0569b892 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -43,6 +43,9 @@ if (!empty($conf->categorie->enabled)) // Load translation files required by the page $langs->loadLangs(array('projects', 'companies', 'commercial')); +if ($conf->eventorganization->enabled) { + $langs->loadLangs(array('eventorganization')); +} $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); @@ -93,6 +96,10 @@ $search_usage_opportunity = GETPOST('search_usage_opportunity', 'int'); $search_usage_task = GETPOST('search_usage_task', 'int'); $search_usage_bill_time = GETPOST('search_usage_bill_time', 'int'); $search_usage_event_organization = GETPOST('search_usage_event_organization', 'int'); +$search_allow_unknown_people_conf = GETPOST('search_allow_unknown_people_conf', 'int'); +$search_allow_unknown_people_booth = GETPOST('search_allow_unknown_people_booth', 'int'); +$search_price_registration = GETPOST("search_price_registration", 'alpha'); +$search_price_booth = GETPOST("search_price_booth", 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); $mine = $_REQUEST['mode'] == 'mine' ? 1 : 0; @@ -209,6 +216,10 @@ if (empty($reshook)) $search_usage_task = ''; $search_usage_bill_time = ''; $search_usage_event_organization = ''; + $search_allow_unknown_people_conf = ''; + $search_allow_unknown_people_booth = ''; + $search_price_registration = ''; + $search_price_booth = ''; $toselect = ''; $search_array_options = array(); $search_category_array = array(); @@ -304,6 +315,7 @@ $distinct = 'DISTINCT'; // We add distinct until we are added a protection to be $sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat"; $sql .= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount "; $sql .= ", p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event"; +$sql .= ", allow_unknown_people_conf, allow_unknown_people_booth, price_registration, price_booth"; $sql .= ", s.rowid as socid, s.nom as name, s.email"; $sql .= ", cls.code as opp_status_code"; // Add fields from extrafields @@ -373,6 +385,10 @@ if ($search_usage_opportunity != '' && $search_usage_opportunity >= 0) $sql .= n if ($search_usage_task != '' && $search_usage_task >= 0) $sql .= natural_search('p.usage_task', $search_usage_task, 2); if ($search_usage_bill_time != '' && $search_usage_bill_time >= 0) $sql .= natural_search('p.usage_bill_time', $search_usage_bill_time, 2); if ($search_usage_event_organization != '' && $search_usage_event_organization >= 0) $sql .= natural_search('p.usage_organize_event', $search_usage_event_organization, 2); +if ($search_allow_unknown_people_conf != '' && $search_allow_unknown_people_conf >= 0) $sql .= natural_search('p.allow_unknown_people_conf', $search_allow_unknown_people_conf, 2); +if ($search_allow_unknown_people_booth != '' && $search_allow_unknown_people_booth >= 0) $sql .= natural_search('p.allow_unknown_people_booth', $search_allow_unknown_people_booth, 2); +if ($search_price_registration != '') $sql .= natural_search('p.price_registration', $search_price_registration, 1); +if ($search_price_booth != '') $sql .= natural_search('p.price_booth', $search_price_booth, 1); // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -450,6 +466,10 @@ if ($search_budget_amount != '') $param .= '&search_budget_amount='.urlencode($s if ($search_usage_task != '') $param .= '&search_usage_task='.urlencode($search_usage_task); if ($search_usage_bill_time != '') $param .= '&search_usage_opportunity='.urlencode($search_usage_bill_time); if ($search_usage_event_organization != '') $param .= '&search_usage_event_organization='.urlencode($search_usage_event_organization); +if ($search_allow_unknown_people_conf != '') $param .= '&search_allow_unknown_people_conf='.urlencode($search_allow_unknown_people_conf); +if ($search_allow_unknown_people_booth != '') $param .= '&search_allow_unknown_people_booth='.urlencode($search_allow_unknown_people_booth); +if ($search_price_registration != '') $param .= '&search_price_registration='.urlencode($search_price_registration); +if ($search_price_booth != '') $param .= '&search_price_booth='.urlencode($search_price_booth); if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -663,6 +683,30 @@ if (!empty($arrayfields['p.usage_organize_event']['checked'])) print $form->selectyesno('search_usage_event_organization', $search_usage_event_organization, 1, false, 1); print ''; } +if (!empty($arrayfields['p.allow_unknown_people_conf']['checked'])) +{ + print ''; + print $form->selectyesno('search_allow_unknown_people_conf', $search_allow_unknown_people_conf, 1, false, 1); + print ''; +} +if (!empty($arrayfields['p.allow_unknown_people_booth']['checked'])) +{ + print ''; + print $form->selectyesno('search_allow_unknown_people_booth', $search_allow_unknown_people_booth, 1, false, 1); + print ''; +} +if (!empty($arrayfields['p.price_registration']['checked'])) +{ + print ''; + print ''; + print ''; +} +if (!empty($arrayfields['p.price_booth']['checked'])) +{ + print ''; + print ''; + print ''; +} // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; @@ -717,6 +761,10 @@ if (!empty($arrayfields['p.usage_opportunity']['checked'])) print_liste_field_ti if (!empty($arrayfields['p.usage_task']['checked'])) print_liste_field_titre($arrayfields['p.usage_task']['label'], $_SERVER["PHP_SELF"], 'p.usage_task', "", $param, '', $sortfield, $sortorder, 'right '); if (!empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right '); if (!empty($arrayfields['p.usage_organize_event']['checked'])) print_liste_field_titre($arrayfields['p.usage_organize_event']['label'], $_SERVER["PHP_SELF"], 'p.usage_organize_event', "", $param, '', $sortfield, $sortorder, 'right '); +if (!empty($arrayfields['p.allow_unknown_people_conf']['checked'])) print_liste_field_titre($arrayfields['p.allow_unknown_people_conf']['label'], $_SERVER["PHP_SELF"], 'p.allow_unknown_people_conf', "", $param, '', $sortfield, $sortorder, 'right '); +if (!empty($arrayfields['p.allow_unknown_people_booth']['checked'])) print_liste_field_titre($arrayfields['p.allow_unknown_people_booth']['label'], $_SERVER["PHP_SELF"], 'p.allow_unknown_people_booth', "", $param, '', $sortfield, $sortorder, 'right '); +if (!empty($arrayfields['p.price_registration']['checked'])) print_liste_field_titre($arrayfields['p.price_registration']['label'], $_SERVER["PHP_SELF"], 'p.price_registration', "", $param, '', $sortfield, $sortorder, 'right '); +if (!empty($arrayfields['p.price_booth']['checked'])) print_liste_field_titre($arrayfields['p.price_booth']['label'], $_SERVER["PHP_SELF"], 'p.price_booth', "", $param, '', $sortfield, $sortorder, 'right '); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields @@ -952,6 +1000,54 @@ while ($i < min($num, $limit)) print ''; if (!$i) $totalarray['nbfield']++; } + // Allow unknown people to suggest conferences + if (!empty($arrayfields['p.allow_unknown_people_conf']['checked'])) + { + print ''; + if ($obj->allow_unknown_people_conf) + { + print yn($obj->allow_unknown_people_conf); + } + print ''; + if (!$i) $totalarray['nbfield']++; + } + // Allow unknown people to suggest booth + if (!empty($arrayfields['p.allow_unknown_people_booth']['checked'])) + { + print ''; + if ($obj->allow_unknown_people_booth) + { + print yn($obj->allow_unknown_people_booth); + } + print ''; + if (!$i) $totalarray['nbfield']++; + } + // Price of registration + if (!empty($arrayfields['p.price_registration']['checked'])) + { + print ''; + if ($obj->price_registration != '') + { + print price($obj->price_registration, 1, $langs, 1, -1, -1); + $totalarray['val']['p.price_registration'] += $obj->price_registration; + } + print ''; + if (!$i) $totalarray['nbfield']++; + if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.price_registration'; + } + // PriceOfBooth + if (!empty($arrayfields['p.price_booth']['checked'])) + { + print ''; + if ($obj->price_booth != '') + { + print price($obj->price_booth, 1, $langs, 1, -1, -1); + $totalarray['val']['p.price_booth'] += $obj->price_booth; + } + print ''; + if (!$i) $totalarray['nbfield']++; + if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.price_booth'; + } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook