Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
2d784f3008
@ -2300,9 +2300,9 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE)) {
|
if (empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE)) {
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), $text, 'confirm_closeas', $formquestion, '', 1, 250);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
|
||||||
} else {
|
} else {
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), $text, 'confirm_closeas', $formquestion, '', 1, 250);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
|
||||||
}
|
}
|
||||||
} elseif ($action == 'delete') {
|
} elseif ($action == 'delete') {
|
||||||
// Confirm delete
|
// Confirm delete
|
||||||
|
|||||||
@ -295,7 +295,7 @@ if ($action == "create" || $action == "start" || $action == 'close') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($terminalid != '') {
|
if (isset($terminalid) && $terminalid != '') {
|
||||||
// Calculate $initialbalanceforterminal for terminal 0
|
// Calculate $initialbalanceforterminal for terminal 0
|
||||||
foreach ($arrayofpaymentmode as $key => $val) {
|
foreach ($arrayofpaymentmode as $key => $val) {
|
||||||
if ($key != 'cash') {
|
if ($key != 'cash') {
|
||||||
@ -305,7 +305,7 @@ if ($action == "create" || $action == "start" || $action == 'close') {
|
|||||||
|
|
||||||
// Get the bank account dedicated to this point of sale module/terminal
|
// Get the bank account dedicated to this point of sale module/terminal
|
||||||
$vartouse = 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse;
|
$vartouse = 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse;
|
||||||
$bankid = $conf->global->$vartouse;
|
$bankid = getDolGlobalInt($vartouse);
|
||||||
|
|
||||||
if ($bankid > 0) {
|
if ($bankid > 0) {
|
||||||
$sql = "SELECT SUM(amount) as total FROM ".MAIN_DB_PREFIX."bank";
|
$sql = "SELECT SUM(amount) as total FROM ".MAIN_DB_PREFIX."bank";
|
||||||
|
|||||||
@ -1195,6 +1195,7 @@ if ($resql) {
|
|||||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
// Show the new button only when this page is not opend from the Extended POS
|
// Show the new button only when this page is not opend from the Extended POS
|
||||||
|
$newcardbutton = '';
|
||||||
if ($contextpage != 'poslist') {
|
if ($contextpage != 'poslist') {
|
||||||
$url = DOL_URL_ROOT.'/compta/facture/card.php?action=create';
|
$url = DOL_URL_ROOT.'/compta/facture/card.php?action=create';
|
||||||
if (!empty($socid)) {
|
if (!empty($socid)) {
|
||||||
@ -2588,7 +2589,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use correct digits number for totals
|
// Use correct digits number for totals
|
||||||
$totalarray['val']['total_margin'] = price2num($totalarray['val']['total_margin'], 'MT');
|
$totalarray['val']['total_margin'] = (isset($totalarray['val']['total_margin']) ? price2num($totalarray['val']['total_margin'], 'MT') : null);
|
||||||
|
|
||||||
// Show total line
|
// Show total line
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||||
|
|||||||
@ -34,6 +34,9 @@ if (!defined('NOIPCHECK')) {
|
|||||||
if (!defined('NOBROWSERNOTIF')) {
|
if (!defined('NOBROWSERNOTIF')) {
|
||||||
define('NOBROWSERNOTIF', '1');
|
define('NOBROWSERNOTIF', '1');
|
||||||
}
|
}
|
||||||
|
if (!defined('NOIPCHECK')) {
|
||||||
|
define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// For MultiCompany module.
|
// For MultiCompany module.
|
||||||
@ -626,7 +629,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
|||||||
// Get email content from template
|
// Get email content from template
|
||||||
$arraydefaultmessage = null;
|
$arraydefaultmessage = null;
|
||||||
|
|
||||||
$labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT;
|
$labeltouse = getDolGlobalString('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT');
|
||||||
if (!empty($labeltouse)) {
|
if (!empty($labeltouse)) {
|
||||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, '');
|
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, '');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,10 +51,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
|
||||||
// Hook to be used by external payment modules (ie Payzen, ...)
|
global $dolibarr_main_url_root;
|
||||||
$hookmanager = new HookManager($db);
|
|
||||||
|
|
||||||
$hookmanager->initHooks(array('newpayment'));
|
|
||||||
|
|
||||||
// Load translation files
|
// Load translation files
|
||||||
$langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data
|
$langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data
|
||||||
@ -84,12 +81,90 @@ if ($resultproject < 0) {
|
|||||||
$errmsg .= $project->error;
|
$errmsg .= $project->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hookmanager->initHooks(array('newpayment'));
|
||||||
|
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
|
$user->loadDefaultValues();
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (empty($conf->project->enabled)) {
|
if (empty($conf->project->enabled)) {
|
||||||
httponly_accessforbidden('Module Project not enabled');
|
httponly_accessforbidden('Module Project not enabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show header for new member
|
||||||
|
*
|
||||||
|
* @param string $title Title
|
||||||
|
* @param string $head Head array
|
||||||
|
* @param int $disablejs More content into html header
|
||||||
|
* @param int $disablehead More content into html header
|
||||||
|
* @param array $arrayofjs Array of complementary js files
|
||||||
|
* @param array $arrayofcss Array of complementary css files
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '')
|
||||||
|
{
|
||||||
|
global $user, $conf, $langs, $mysoc;
|
||||||
|
|
||||||
|
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
|
||||||
|
|
||||||
|
print '<body id="mainbody" class="publicnewmemberform">';
|
||||||
|
|
||||||
|
// Define urllogo
|
||||||
|
$urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png';
|
||||||
|
|
||||||
|
if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
|
||||||
|
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
|
||||||
|
} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
|
||||||
|
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo);
|
||||||
|
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
|
||||||
|
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<div class="center">';
|
||||||
|
// Output html code for logo
|
||||||
|
if ($urllogo) {
|
||||||
|
print '<div class="backgreypublicpayment">';
|
||||||
|
print '<div class="logopublicpayment">';
|
||||||
|
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
|
||||||
|
print '>';
|
||||||
|
print '</div>';
|
||||||
|
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
|
||||||
|
print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
|
||||||
|
}
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT)) {
|
||||||
|
print '<div class="backimagepubliceventorganizationsubscription">';
|
||||||
|
print '<img id="idPROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT" src="'.$conf->global->PROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT.'">';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '<div class="divmainbodylarge">';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show footer for new member
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function llxFooterVierge()
|
||||||
|
{
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
printCommonFooter('public');
|
||||||
|
|
||||||
|
print "</body>\n";
|
||||||
|
print "</html>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -147,66 +222,22 @@ print '<input type="hidden" name="forcesandbox" value="'.GETPOST('forcesandbox',
|
|||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
|
|
||||||
// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo)
|
|
||||||
// Define logo and logosmall
|
|
||||||
$logosmall = $mysoc->logo_small;
|
|
||||||
$logo = $mysoc->logo;
|
|
||||||
$paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix;
|
|
||||||
if (!empty($conf->global->$paramlogo)) {
|
|
||||||
$logosmall = $conf->global->$paramlogo;
|
|
||||||
} elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) {
|
|
||||||
$logosmall = $conf->global->ONLINE_PAYMENT_LOGO;
|
|
||||||
}
|
|
||||||
//print '- Show logo (logosmall='.$logosmall.' logo='.$logo.') '."\n";
|
|
||||||
// Define urllogo
|
|
||||||
$urllogo = '';
|
|
||||||
$urllogofull = '';
|
|
||||||
if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) {
|
|
||||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
|
|
||||||
$urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
|
|
||||||
} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) {
|
|
||||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
|
|
||||||
$urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Output html code for logo
|
|
||||||
if ($urllogo) {
|
|
||||||
print '<div class="backgreypublicpayment">';
|
|
||||||
print '<div class="logopublicpayment">';
|
|
||||||
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
|
|
||||||
print '>';
|
|
||||||
print '</div>';
|
|
||||||
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
|
|
||||||
print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
|
|
||||||
}
|
|
||||||
print '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT)) {
|
|
||||||
print '<div class="backimagepublicorganizedevent">';
|
|
||||||
print '<img id="idPROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT" src="'.$conf->global->PROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT.'">';
|
|
||||||
print '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
|
|
||||||
print '<div align="center">';
|
print '<div align="center">';
|
||||||
print '<div id="divsubscribe">';
|
print '<div id="divsubscribe">';
|
||||||
|
|
||||||
|
|
||||||
// Event summary
|
// Sub banner
|
||||||
print '<div class="center">';
|
print '<div class="center subscriptionformbanner subbanner justify margintoponly paddingtop marginbottomonly padingbottom">';
|
||||||
print '<span class="eventlabel large">'.dol_escape_htmltag($project->title . ' '. $project->label).'</span><br>';
|
print load_fiche_titre($langs->trans("NewRegistration"), '', '', 0, 0, 'center');
|
||||||
print '<br><br>'."\n";
|
// Welcome message
|
||||||
print '<span class="opacitymedium">'.$langs->trans("EvntOrgRegistrationWelcomeMessage")."</span>\n";
|
print '<span class="opacitymedium">'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'</span>';
|
||||||
print $project->note_public."\n";
|
print '<br>';
|
||||||
//print img_picto('', 'map-marker-alt').$langs->trans("Location").': xxxx';
|
// Title
|
||||||
|
print '<span class="eventlabel large">'.dol_escape_htmltag($project->title . ' '. $conference->label).'</span><br>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
// Help text
|
// Help text
|
||||||
print '<div class="center subscriptionformhelptext">';
|
print '<div class="justify subscriptionformhelptext">';
|
||||||
|
|
||||||
if ($project->date_start_event || $project->date_end_event) {
|
if ($project->date_start_event || $project->date_end_event) {
|
||||||
print '<br><span class="fa fa-calendar pictofixedwidth opacitymedium"></span>';
|
print '<br><span class="fa fa-calendar pictofixedwidth opacitymedium"></span>';
|
||||||
@ -301,61 +332,3 @@ htmlPrintOnlineFooter($mysoc, $langs, 1, $suffix, $object);
|
|||||||
llxFooter('', 'public');
|
llxFooter('', 'public');
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show header for new member
|
|
||||||
*
|
|
||||||
* @param string $title Title
|
|
||||||
* @param string $head Head array
|
|
||||||
* @param int $disablejs More content into html header
|
|
||||||
* @param int $disablehead More content into html header
|
|
||||||
* @param array $arrayofjs Array of complementary js files
|
|
||||||
* @param array $arrayofcss Array of complementary css files
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '')
|
|
||||||
{
|
|
||||||
global $user, $conf, $langs, $mysoc;
|
|
||||||
|
|
||||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
|
|
||||||
|
|
||||||
print '<body id="mainbody" class="publicnewmemberform">';
|
|
||||||
|
|
||||||
// Define urllogo
|
|
||||||
$urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png';
|
|
||||||
|
|
||||||
if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
|
|
||||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
|
|
||||||
} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
|
|
||||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo);
|
|
||||||
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
|
|
||||||
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<div class="center">';
|
|
||||||
|
|
||||||
// Output html code for logo
|
|
||||||
if ($urllogo) {
|
|
||||||
print '<div class="backgreypublicpayment">';
|
|
||||||
print '<div class="logopublicpayment">';
|
|
||||||
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
|
|
||||||
print '>';
|
|
||||||
print '</div>';
|
|
||||||
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
|
|
||||||
print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
|
|
||||||
}
|
|
||||||
print '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_SUGGEST_CONFERENCE)) {
|
|
||||||
print '<div class="backimagepublicsuggestconference">';
|
|
||||||
print '<img id="idPROJECT_IMAGE_PUBLIC_SUGGEST_CONFERENCE" src="'.$conf->global->PROJECT_IMAGE_PUBLIC_SUGGEST_CONFERENCE.'">';
|
|
||||||
print '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '<div class="divmainbodylarge">';
|
|
||||||
}
|
|
||||||
|
|||||||
@ -82,7 +82,7 @@ if ($resultproject < 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$securekeyreceived = GETPOST("securekey");
|
$securekeyreceived = GETPOST('securekey', 'alpha');
|
||||||
$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5');
|
$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5');
|
||||||
|
|
||||||
if ($securekeytocompare != $securekeyreceived) {
|
if ($securekeytocompare != $securekeyreceived) {
|
||||||
@ -201,10 +201,22 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
|
if (!GETPOST("lastname")) {
|
||||||
|
$error++;
|
||||||
|
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))."<br>\n";
|
||||||
|
}
|
||||||
if (!GETPOST("email")) {
|
if (!GETPOST("email")) {
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
|
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
|
||||||
}
|
}
|
||||||
|
if (!GETPOST("country_id") && !empty(floatval($project->price_booth))) {
|
||||||
|
$error++;
|
||||||
|
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."<br>\n";
|
||||||
|
}
|
||||||
|
if (!GETPOST("societe")) {
|
||||||
|
$error++;
|
||||||
|
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."<br>\n";
|
||||||
|
}
|
||||||
if (!GETPOST("label")) {
|
if (!GETPOST("label")) {
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."<br>\n";
|
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."<br>\n";
|
||||||
@ -213,44 +225,37 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$error++;
|
$error++;
|
||||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."<br>\n";
|
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."<br>\n";
|
||||||
}
|
}
|
||||||
if (!GETPOST("email")) {
|
|
||||||
$error++;
|
|
||||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
|
|
||||||
}
|
|
||||||
if (!GETPOST("lastname")) {
|
|
||||||
$error++;
|
|
||||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))."<br>\n";
|
|
||||||
}
|
|
||||||
if (!GETPOST("societe")) {
|
|
||||||
$error++;
|
|
||||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."<br>\n";
|
|
||||||
}
|
|
||||||
if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
|
if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."<br>\n";
|
$errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."<br>\n";
|
||||||
}
|
}
|
||||||
if (!GETPOST("country_id") && !empty(floatval($project->price_booth))) {
|
|
||||||
$error++;
|
|
||||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."<br>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
// Getting the thirdparty or creating it
|
// Getting the thirdparty or creating it
|
||||||
$thirdparty = new Societe($db);
|
$thirdparty = new Societe($db);
|
||||||
$resultfetchthirdparty = $thirdparty->fetch('', $societe);
|
$resultfetchthirdparty = $thirdparty->fetch('', $societe);
|
||||||
|
|
||||||
if ($resultfetchthirdparty<=0) {
|
if ($resultfetchthirdparty < 0) {
|
||||||
// Need to create a new one (not found or multiple with the same name)
|
// If an error was found
|
||||||
|
$error++;
|
||||||
|
$errmsg .= $thirdparty->error;
|
||||||
|
$errors = array_merge($errors, $thirdparty->errors);
|
||||||
|
} elseif ($resultfetchthirdparty == 0) { // No thirdparty found + a payment is expected
|
||||||
|
// Creation of a new thirdparty
|
||||||
|
if (!empty($societe)) {
|
||||||
$thirdparty->name = $societe;
|
$thirdparty->name = $societe;
|
||||||
|
} else {
|
||||||
|
$thirdparty->name = $genericcompanyname;
|
||||||
|
}
|
||||||
$thirdparty->address = GETPOST("address");
|
$thirdparty->address = GETPOST("address");
|
||||||
$thirdparty->zip = GETPOST("zipcode");
|
$thirdparty->zip = GETPOST("zipcode");
|
||||||
$thirdparty->town = GETPOST("town");
|
$thirdparty->town = GETPOST("town");
|
||||||
$thirdparty->client = 2;
|
$thirdparty->client = $thirdparty::PROSPECT;
|
||||||
$thirdparty->fournisseur = 0;
|
$thirdparty->fournisseur = 0;
|
||||||
$thirdparty->country_id = GETPOST("country_id", 'int');
|
$thirdparty->country_id = GETPOST("country_id", 'int');
|
||||||
$thirdparty->state_id = GETPOST("state_id", 'int');
|
$thirdparty->state_id = GETPOST("state_id", 'int');
|
||||||
$thirdparty->email = $email;
|
$thirdparty->email = ($emailcompany ? $emailcompany : $email);
|
||||||
|
|
||||||
// Load object modCodeTiers
|
// Load object modCodeTiers
|
||||||
$module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
|
$module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
|
||||||
@ -274,6 +279,7 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
if ($readythirdparty <0) {
|
if ($readythirdparty <0) {
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg .= $thirdparty->error;
|
$errmsg .= $thirdparty->error;
|
||||||
|
$errors = array_merge($errors, $thirdparty->errors);
|
||||||
} else {
|
} else {
|
||||||
$thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs);
|
$thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs);
|
||||||
$thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs);
|
$thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs);
|
||||||
@ -547,18 +553,19 @@ print '<div id="divsubscribe">';
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Event summary
|
// Sub banner
|
||||||
print '<div class="center">';
|
print '<div class="center subscriptionformbanner subbanner justify margintoponly paddingtop marginbottomonly padingbottom">';
|
||||||
|
print load_fiche_titre($langs->trans("NewSuggestionOfConference"), '', '', 0, 0, 'center');
|
||||||
|
// Welcome message
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'</span>';
|
||||||
|
print '<br>';
|
||||||
|
// Title
|
||||||
print '<span class="eventlabel large">'.dol_escape_htmltag($project->title . ' '. $project->label).'</span><br>';
|
print '<span class="eventlabel large">'.dol_escape_htmltag($project->title . ' '. $project->label).'</span><br>';
|
||||||
print '<br><br>'."\n";
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("EvntOrgRegistrationWelcomeMessage")."</span>\n";
|
|
||||||
print $project->note_public."\n";
|
|
||||||
//print img_picto('', 'map-marker-alt').$langs->trans("Location").': xxxx';
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
// Help text
|
// Help text
|
||||||
print '<div class="center subscriptionformhelptext">';
|
print '<div class="justify subscriptionformhelptext">';
|
||||||
|
|
||||||
if ($project->date_start_event || $project->date_end_event) {
|
if ($project->date_start_event || $project->date_end_event) {
|
||||||
print '<br><span class="fa fa-calendar pictofixedwidth opacitymedium"></span>';
|
print '<br><span class="fa fa-calendar pictofixedwidth opacitymedium"></span>';
|
||||||
@ -588,15 +595,16 @@ if ($project->date_start_event || $project->date_end_event) {
|
|||||||
if ($project->location) {
|
if ($project->location) {
|
||||||
print '<span class="fa fa-map-marked-alt pictofixedwidth opacitymedium"></span>'.dol_escape_htmltag($project->location).'<br>';
|
print '<span class="fa fa-map-marked-alt pictofixedwidth opacitymedium"></span>'.dol_escape_htmltag($project->location).'<br>';
|
||||||
}
|
}
|
||||||
|
if ($project->note_public) {
|
||||||
|
print '<br><span class="opacitymedium">'.dol_htmlentitiesbr($project->note_public).'</span><br>';
|
||||||
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("NewSuggestionOfBooth"), '', '', 0, 0, 'center');
|
|
||||||
|
|
||||||
|
dol_htmloutput_errors($errmsg, $errors);
|
||||||
dol_htmloutput_errors($errmsg);
|
|
||||||
|
|
||||||
// Print form
|
// Print form
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newmember">'."\n";
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newmember">'."\n";
|
||||||
|
|||||||
@ -83,7 +83,7 @@ if ($resultproject < 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$securekeyreceived = GETPOST("securekey");
|
$securekeyreceived = GETPOST('securekey', 'alpha');
|
||||||
$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5');
|
$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5');
|
||||||
|
|
||||||
if ($securekeytocompare != $securekeyreceived) {
|
if ($securekeytocompare != $securekeyreceived) {
|
||||||
@ -237,17 +237,26 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$thirdparty = new Societe($db);
|
$thirdparty = new Societe($db);
|
||||||
$resultfetchthirdparty = $thirdparty->fetch('', $societe);
|
$resultfetchthirdparty = $thirdparty->fetch('', $societe);
|
||||||
|
|
||||||
if ($resultfetchthirdparty<=0) {
|
if ($resultfetchthirdparty < 0) {
|
||||||
// Need to create a new one (not found or multiple with the same name)
|
// If an error was found
|
||||||
|
$error++;
|
||||||
|
$errmsg .= $thirdparty->error;
|
||||||
|
$errors = array_merge($errors, $thirdparty->errors);
|
||||||
|
} elseif ($resultfetchthirdparty == 0) { // No thirdparty found + a payment is expected
|
||||||
|
// Creation of a new thirdparty
|
||||||
|
if (!empty($societe)) {
|
||||||
$thirdparty->name = $societe;
|
$thirdparty->name = $societe;
|
||||||
|
} else {
|
||||||
|
$thirdparty->name = $genericcompanyname;
|
||||||
|
}
|
||||||
$thirdparty->address = GETPOST("address");
|
$thirdparty->address = GETPOST("address");
|
||||||
$thirdparty->zip = GETPOST("zipcode");
|
$thirdparty->zip = GETPOST("zipcode");
|
||||||
$thirdparty->town = GETPOST("town");
|
$thirdparty->town = GETPOST("town");
|
||||||
$thirdparty->client = 2;
|
$thirdparty->client = $thirdparty::PROSPECT;
|
||||||
$thirdparty->fournisseur = 0;
|
$thirdparty->fournisseur = 0;
|
||||||
$thirdparty->country_id = GETPOST("country_id", 'int');
|
$thirdparty->country_id = GETPOST("country_id", 'int');
|
||||||
$thirdparty->state_id = GETPOST("state_id", 'int');
|
$thirdparty->state_id = GETPOST("state_id", 'int');
|
||||||
$thirdparty->email = $email;
|
$thirdparty->email = ($emailcompany ? $emailcompany : $email);
|
||||||
|
|
||||||
// Load object modCodeTiers
|
// Load object modCodeTiers
|
||||||
$module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
|
$module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
|
||||||
@ -271,6 +280,7 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
if ($readythirdparty <0) {
|
if ($readythirdparty <0) {
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg .= $thirdparty->error;
|
$errmsg .= $thirdparty->error;
|
||||||
|
$errors = array_merge($errors, $thirdparty->errors);
|
||||||
} else {
|
} else {
|
||||||
$thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs);
|
$thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs);
|
||||||
$thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs);
|
$thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs);
|
||||||
@ -418,7 +428,7 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
// Get email content from template
|
// Get email content from template
|
||||||
$arraydefaultmessage = null;
|
$arraydefaultmessage = null;
|
||||||
|
|
||||||
$labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF;
|
$labeltouse = getDolGlobalString('EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF');
|
||||||
if (!empty($labeltouse)) {
|
if (!empty($labeltouse)) {
|
||||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, '');
|
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, '');
|
||||||
}
|
}
|
||||||
@ -456,7 +466,7 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
||||||
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl;
|
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl);
|
||||||
Header("Location: ".$redirection);
|
Header("Location: ".$redirection);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
@ -480,17 +490,18 @@ print '<div id="divsubscribe">';
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Event summary
|
// Sub banner
|
||||||
print '<div class="center">';
|
print '<div class="center subscriptionformbanner subbanner justify margintoponly paddingtop marginbottomonly padingbottom">';
|
||||||
|
print load_fiche_titre($langs->trans("NewSuggestionOfConference"), '', '', 0, 0, 'center');
|
||||||
|
// Welcome message
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'</span>';
|
||||||
|
print '<br>';
|
||||||
|
// Title
|
||||||
print '<span class="eventlabel large">'.dol_escape_htmltag($project->title . ' '. $project->label).'</span><br>';
|
print '<span class="eventlabel large">'.dol_escape_htmltag($project->title . ' '. $project->label).'</span><br>';
|
||||||
print '<br><br>'."\n";
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("EvntOrgRegistrationWelcomeMessage")."</span>\n";
|
|
||||||
print $project->note_public."\n";
|
|
||||||
//print img_picto('', 'map-marker-alt').$langs->trans("Location").': xxxx';
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
// Help text
|
// Help text
|
||||||
print '<div class="center subscriptionformhelptext">';
|
print '<div class="justify subscriptionformhelptext">';
|
||||||
|
|
||||||
if ($project->date_start_event || $project->date_end_event) {
|
if ($project->date_start_event || $project->date_end_event) {
|
||||||
print '<br><span class="fa fa-calendar pictofixedwidth opacitymedium"></span>';
|
print '<br><span class="fa fa-calendar pictofixedwidth opacitymedium"></span>';
|
||||||
@ -520,14 +531,14 @@ if ($project->date_start_event || $project->date_end_event) {
|
|||||||
if ($project->location) {
|
if ($project->location) {
|
||||||
print '<span class="fa fa-map-marked-alt pictofixedwidth opacitymedium"></span>'.dol_escape_htmltag($project->location).'<br>';
|
print '<span class="fa fa-map-marked-alt pictofixedwidth opacitymedium"></span>'.dol_escape_htmltag($project->location).'<br>';
|
||||||
}
|
}
|
||||||
|
if ($project->note_public) {
|
||||||
|
print '<br><span class="opacitymedium">'.dol_htmlentitiesbr($project->note_public).'</span><br>';
|
||||||
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("NewSuggestionOfConference"), '', '', 0, 0, 'center');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dol_htmloutput_errors($errmsg, $errors);
|
dol_htmloutput_errors($errmsg, $errors);
|
||||||
|
|
||||||
|
|||||||
@ -84,7 +84,7 @@ $vatRateDefault = get_default_tva($mysoc, $soc);
|
|||||||
$arrayofcss = array('/takepos/css/pos.css.php');
|
$arrayofcss = array('/takepos/css/pos.css.php');
|
||||||
$arrayofjs = array();
|
$arrayofjs = array();
|
||||||
|
|
||||||
top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss);
|
top_htmlhead('', '', 0, 0, $arrayofjs, $arrayofcss);
|
||||||
?>
|
?>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|||||||
@ -948,7 +948,7 @@ $( document ).ready(function() {
|
|||||||
if ($resql) {
|
if ($resql) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
// If there is no cash control from today open it
|
// If there is no cash control from today open it
|
||||||
if ($obj->rowid == null) {
|
if (!isset($obj->rowid) || is_null($obj->rowid)) {
|
||||||
print "ControlCashOpening();";
|
print "ControlCashOpening();";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,7 +125,7 @@ if ($action=="split") {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$invoice = new Facture($db);
|
$invoice = new Facture($db);
|
||||||
if ($invoiceid > 0) {
|
if (isset($invoiceid) && $invoiceid > 0) {
|
||||||
$invoice->fetch($invoiceid);
|
$invoice->fetch($invoiceid);
|
||||||
} else {
|
} else {
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
|
||||||
@ -134,7 +134,7 @@ if ($invoiceid > 0) {
|
|||||||
if ($obj) {
|
if ($obj) {
|
||||||
$invoiceid = $obj->rowid;
|
$invoiceid = $obj->rowid;
|
||||||
}
|
}
|
||||||
if (!$invoiceid) {
|
if (!isset($invoiceid)) {
|
||||||
$invoiceid = 0; // Invoice does not exist yet
|
$invoiceid = 0; // Invoice does not exist yet
|
||||||
} else {
|
} else {
|
||||||
$invoice->fetch($invoiceid);
|
$invoice->fetch($invoiceid);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user