NEW Can set the max number of attendees for an organized event
This commit is contained in:
parent
f1e429d333
commit
d76e7224d9
@ -234,7 +234,7 @@ class Form
|
|||||||
if (preg_match('/^(string|safehtmlstring|email)/', $typeofdata)) {
|
if (preg_match('/^(string|safehtmlstring|email)/', $typeofdata)) {
|
||||||
$tmp = explode(':', $typeofdata);
|
$tmp = explode(':', $typeofdata);
|
||||||
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').' autofocus>';
|
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').' autofocus>';
|
||||||
} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
|
} elseif (preg_match('/^(numeric|amount|integer)/', $typeofdata)) {
|
||||||
$tmp = explode(':', $typeofdata);
|
$tmp = explode(':', $typeofdata);
|
||||||
$valuetoshow = price2num($editvalue ? $editvalue : $value);
|
$valuetoshow = price2num($editvalue ? $editvalue : $value);
|
||||||
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').' autofocus>';
|
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').' autofocus>';
|
||||||
|
|||||||
@ -375,46 +375,52 @@ if ($projectid > 0) {
|
|||||||
print '<table class="border tableforfield centpercent">';
|
print '<table class="border tableforfield centpercent">';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
print '<tr><td class="titlefield tdtop">'.$langs->trans("Description").'</td><td class="valuefield">';
|
||||||
print nl2br($project->description);
|
print nl2br($project->description);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Categories
|
// Categories
|
||||||
if ($conf->categorie->enabled) {
|
if ($conf->categorie->enabled) {
|
||||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
print '<tr><td class="titlefield valignmiddle">'.$langs->trans("Categories").'</td><td class="valuefield">';
|
||||||
print $form->showCategories($project->id, Categorie::TYPE_PROJECT, 1);
|
print $form->showCategories($project->id, Categorie::TYPE_PROJECT, 1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td class="titlefield">';
|
||||||
$typeofdata = 'checkbox:'.($project->accept_conference_suggestions ? ' checked="checked"' : '');
|
$typeofdata = 'checkbox:'.($project->accept_conference_suggestions ? ' checked="checked"' : '');
|
||||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
|
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
|
||||||
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $project, $permissiontoadd, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $project, $permissiontoadd, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||||
print '</td><td>';
|
print '</td><td class="valuefield">';
|
||||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $project, $permissiontoadd, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $project, $permissiontoadd, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td class="titlefield">';
|
||||||
$typeofdata = 'checkbox:'.($project->accept_booth_suggestions ? ' checked="checked"' : '');
|
$typeofdata = 'checkbox:'.($project->accept_booth_suggestions ? ' checked="checked"' : '');
|
||||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
|
$htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
|
||||||
print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $project, $permissiontoadd, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $project, $permissiontoadd, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||||
print '</td><td>';
|
print '</td><td class="valuefield">';
|
||||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $project, $permissiontoadd, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $project, $permissiontoadd, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td class="titlefield">';
|
||||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $project, $permissiontoadd, 'amount', '', 0, 0, 'projectid');
|
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $project, $permissiontoadd, 'amount', '', 0, 0, 'projectid');
|
||||||
print '</td><td>';
|
print '</td><td class="valuefield">';
|
||||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $project->price_booth, $project, $permissiontoadd, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $project->price_booth, $project, $permissiontoadd, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td class="titlefield">';
|
||||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $project, $permissiontoadd, 'amount', '', 0, 0, 'projectid');
|
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $project, $permissiontoadd, 'amount', '', 0, 0, 'projectid');
|
||||||
print '</td><td>';
|
print '</td><td class="valuefield">';
|
||||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $project->price_registration, $project, $permissiontoadd, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $project->price_registration, $project, $permissiontoadd, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
print '<tr><td class="titlefield">';
|
||||||
|
print $form->editfieldkey($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', '', $project, $permissiontoadd, 'integer:3', '', 0, 0, 'projectid');
|
||||||
|
print '</td><td class="valuefield">';
|
||||||
|
print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $project->max_attendees, $project, $permissiontoadd, 'integer:3', '', 0, 0, '', 0, '', 'projectid');
|
||||||
|
print "</td></tr>";
|
||||||
|
|
||||||
|
print '<tr><td class="titlefield valignmiddle">'.$langs->trans("EventOrganizationICSLink").'</td><td class="valuefield">';
|
||||||
// Define $urlwithroot
|
// Define $urlwithroot
|
||||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
|
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
|
||||||
@ -427,11 +433,11 @@ if ($projectid > 0) {
|
|||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Link to the submit vote/register page
|
// Link to the submit vote/register page
|
||||||
print '<tr><td>';
|
print '<tr><td class="titlefield">';
|
||||||
//print '<span class="opacitymedium">';
|
//print '<span class="opacitymedium">';
|
||||||
print $form->textwithpicto($langs->trans("SuggestOrVoteForConfOrBooth"), $langs->trans("EvntOrgRegistrationHelpMessage"));
|
print $form->textwithpicto($langs->trans("SuggestOrVoteForConfOrBooth"), $langs->trans("EvntOrgRegistrationHelpMessage"));
|
||||||
//print '</span>';
|
//print '</span>';
|
||||||
print '</td><td>';
|
print '</td><td class="valuefield">';
|
||||||
$linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.((int) $project->id);
|
$linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.((int) $project->id);
|
||||||
$encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.((int) $project->id), 'md5');
|
$encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.((int) $project->id), 'md5');
|
||||||
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
|
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
|
||||||
@ -444,11 +450,11 @@ if ($projectid > 0) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Link to the subscribe
|
// Link to the subscribe
|
||||||
print '<tr><td>';
|
print '<tr><td class="titlefield">';
|
||||||
//print '<span class="opacitymedium">';
|
//print '<span class="opacitymedium">';
|
||||||
print $langs->trans("PublicAttendeeSubscriptionGlobalPage");
|
print $langs->trans("PublicAttendeeSubscriptionGlobalPage");
|
||||||
//print '</span>';
|
//print '</span>';
|
||||||
print '</td><td>';
|
print '</td><td class="valuefield">';
|
||||||
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.((int) $project->id).'&type=global';
|
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.((int) $project->id).'&type=global';
|
||||||
$encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.((int) $project->id), 'md5');
|
$encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.((int) $project->id), 'md5');
|
||||||
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
|
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
|
||||||
|
|||||||
@ -165,4 +165,5 @@ EmailAttendee=Attendee email
|
|||||||
EmailCompanyForInvoice=Company email (for invoice, if different of attendee email)
|
EmailCompanyForInvoice=Company email (for invoice, if different of attendee email)
|
||||||
ErrorSeveralCompaniesWithEmailContactUs=Several companies with this email has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation
|
ErrorSeveralCompaniesWithEmailContactUs=Several companies with this email has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation
|
||||||
ErrorSeveralCompaniesWithNameContactUs=Several companies with this name has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation
|
ErrorSeveralCompaniesWithNameContactUs=Several companies with this name has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation
|
||||||
NoPublicActionsAllowedForThisEvent=No public actions are open to public for this event
|
NoPublicActionsAllowedForThisEvent=No public actions are open to public for this event
|
||||||
|
MaxNbOfAttendees=Max number of attendees
|
||||||
|
|||||||
@ -150,6 +150,11 @@ class Project extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $price_booth;
|
public $price_booth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var float Max attendees
|
||||||
|
*/
|
||||||
|
public $max_attendees;
|
||||||
|
|
||||||
public $statuts_short;
|
public $statuts_short;
|
||||||
public $statuts_long;
|
public $statuts_long;
|
||||||
|
|
||||||
@ -248,6 +253,7 @@ class Project extends CommonObject
|
|||||||
'accept_booth_suggestions' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>147),
|
'accept_booth_suggestions' =>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_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),
|
'price_booth' =>array('type'=>'double(24,8)', 'label'=>'PriceOfBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>149),
|
||||||
|
'max_attendees' =>array('type'=>'integer', 'label'=>'MaxNbOfAttendees', 'enabled'=>1, 'visible'=>-1, 'position'=>150),
|
||||||
'datec' =>array('type'=>'datetime', 'label'=>'DateCreationShort', 'enabled'=>1, 'visible'=>-2, 'position'=>200),
|
'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),
|
'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),
|
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>210),
|
||||||
@ -372,6 +378,7 @@ class Project extends CommonObject
|
|||||||
$sql .= ", accept_booth_suggestions";
|
$sql .= ", accept_booth_suggestions";
|
||||||
$sql .= ", price_registration";
|
$sql .= ", price_registration";
|
||||||
$sql .= ", price_booth";
|
$sql .= ", price_booth";
|
||||||
|
$sql .= ", max_attendees";
|
||||||
$sql .= ", email_msgid";
|
$sql .= ", email_msgid";
|
||||||
$sql .= ", note_private";
|
$sql .= ", note_private";
|
||||||
$sql .= ", note_public";
|
$sql .= ", note_public";
|
||||||
@ -399,6 +406,7 @@ class Project extends CommonObject
|
|||||||
$sql .= ", ".($this->accept_booth_suggestions ? 1 : 0);
|
$sql .= ", ".($this->accept_booth_suggestions ? 1 : 0);
|
||||||
$sql .= ", ".(strcmp($this->price_registration, '') ? price2num($this->price_registration) : 'null');
|
$sql .= ", ".(strcmp($this->price_registration, '') ? price2num($this->price_registration) : 'null');
|
||||||
$sql .= ", ".(strcmp($this->price_booth, '') ? price2num($this->price_booth) : 'null');
|
$sql .= ", ".(strcmp($this->price_booth, '') ? price2num($this->price_booth) : 'null');
|
||||||
|
$sql .= ", ".(strcmp($this->max_attendees, '') ? ((int) $this->max_attendees) : 'null');
|
||||||
$sql .= ", ".($this->email_msgid ? "'".$this->db->escape($this->email_msgid)."'" : '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_private ? "'".$this->db->escape($this->note_private)."'" : 'null');
|
||||||
$sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null');
|
$sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null');
|
||||||
@ -509,6 +517,7 @@ class Project extends CommonObject
|
|||||||
$sql .= ", accept_booth_suggestions = ".($this->accept_booth_suggestions ? 1 : 0);
|
$sql .= ", accept_booth_suggestions = ".($this->accept_booth_suggestions ? 1 : 0);
|
||||||
$sql .= ", price_registration = ".(strcmp($this->price_registration, '') ? price2num($this->price_registration) : "null");
|
$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 .= ", price_booth = ".(strcmp($this->price_booth, '') ? price2num($this->price_booth) : "null");
|
||||||
|
$sql .= ", max_attendees = ".(strcmp($this->max_attendees, '') ? price2num($this->max_attendees) : "null");
|
||||||
$sql .= ", entity = ".((int) $this->entity);
|
$sql .= ", entity = ".((int) $this->entity);
|
||||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
|
|
||||||
@ -595,7 +604,7 @@ class Project extends CommonObject
|
|||||||
$sql = "SELECT rowid, entity, ref, title, description, public, datec, opp_amount, budget_amount,";
|
$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 .= " 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 .= " accept_conference_suggestions, accept_booth_suggestions, price_registration, price_booth";
|
$sql .= " accept_conference_suggestions, accept_booth_suggestions, price_registration, price_booth, max_attendees";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet";
|
$sql .= " FROM ".MAIN_DB_PREFIX."projet";
|
||||||
if (!empty($id)) {
|
if (!empty($id)) {
|
||||||
$sql .= " WHERE rowid = ".((int) $id);
|
$sql .= " WHERE rowid = ".((int) $id);
|
||||||
@ -653,6 +662,7 @@ class Project extends CommonObject
|
|||||||
$this->accept_booth_suggestions = (int) $obj->accept_booth_suggestions;
|
$this->accept_booth_suggestions = (int) $obj->accept_booth_suggestions;
|
||||||
$this->price_registration = $obj->price_registration;
|
$this->price_registration = $obj->price_registration;
|
||||||
$this->price_booth = $obj->price_booth;
|
$this->price_booth = $obj->price_booth;
|
||||||
|
$this->max_attendees = $obj->max_attendees;
|
||||||
$this->email_msgid = $obj->email_msgid;
|
$this->email_msgid = $obj->email_msgid;
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user