diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index d46580b98b2..b227fcb8e88 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -479,7 +479,7 @@ class AccountancyExport /** * Export format : CIEL (Format XIMPORT) * Format since 2003 compatible CIEL version > 2002 / Sage50 - * Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr) + * Last review for this format : 2021-09-13 Alexandre Spangaro (aspangaro@open-dsi.fr) * * Help : https://sage50c.online-help.sage.fr/aide-technique/ * In sage software | Use menu : "Exchange" > "Importing entries..." @@ -507,7 +507,7 @@ class AccountancyExport $Tab = array(); $Tab['num_ecriture'] = str_pad($data->piece_num, 5); - $Tab['code_journal'] = str_pad($data->code_journal, 2); + $Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2); $Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT); $Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT); $Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12); @@ -515,9 +515,9 @@ class AccountancyExport $Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25); $Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT); $Tab['type_montant'] = str_pad($data->sens, 1); - $Tab['vide'] = str_repeat(' ', 18); + $Tab['vide'] = str_repeat(' ', 18); // Analytical accounting - Not managed in Dolibarr $Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34); - $Tab['end'] = 'O2003'; + $Tab['end'] = 'O2003'; // 0 = EUR | 2003 = Format Ciel $Tab['end_line'] = $end_line; diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 87e4538248c..f00fbb6b0de 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -56,7 +56,7 @@ if ($action == 'setMEMBER_ENABLE_PUBLIC') { if ($action == 'update') { $public = GETPOST('MEMBER_ENABLE_PUBLIC'); - $amount = GETPOST('MEMBER_NEWFORM_AMOUNT'); + $amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2); $editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT'); $payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE'); $forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int'); @@ -205,7 +205,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print ''; print $langs->trans("DefaultAmount"); print ''; - print ''; + print ''; print "\n"; // Can edit diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index f6a512eaa11..d46442edc94 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -660,7 +660,7 @@ if (empty($reshook)) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "companies", "install", "other")); // Get email content from template $arraydefaultmessage = null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; @@ -731,7 +731,7 @@ if (empty($reshook)) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "companies", "install", "other")); // Get email content from template $arraydefaultmessage = null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION; @@ -802,7 +802,7 @@ if (empty($reshook)) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "companies", "install", "other")); // Get email content from template $arraydefaultmessage = null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION; @@ -1509,7 +1509,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "companies", "install", "other")); // Get email content from template $arraydefaultmessage = null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 83144ba50e8..9c088aec61c 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -213,7 +213,7 @@ if ($action == 'edit') { print ''; print ''; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled']==1) { @@ -264,7 +264,7 @@ if ($action == 'edit') { } elseif (preg_match('/thirdparty_type/', $val['type'])) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $formcompany = new FormCompany($db); - print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname); + print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname, 'customerorprospect', 'form', '', 1); } elseif ($val['type'] == 'securekey') { print ''; if (!empty($conf->use_javascript_ajax)) { @@ -305,7 +305,7 @@ if ($action == 'edit') { } else { if (!empty($arrayofparameters)) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled']==1) { @@ -362,7 +362,7 @@ if ($action == 'edit') { $product = new Product($db); $resprod = $product->fetch($conf->global->{$constname}); if ($resprod > 0) { - print $product->ref; + print $product->getNomUrl(1); } elseif ($resprod < 0) { setEventMessages(null, $object->errors, "errors"); } diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 26ba4d40f58..85cd419d9ee 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -252,9 +252,8 @@ if ($resql) { print ''; print ""; print ''; print ''."\n"; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 9d3fd768647..09113ef882b 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -47,6 +47,8 @@ if (!$user->admin) { // Constant and translation of the module description $modules = array( + 'NOTE_PUBLIC' => 'FCKeditorForNotePublic', + 'NOTE_PRIVATE' => 'FCKeditorForNotePrivate', 'SOCIETE' => 'FCKeditorForCompany', 'PRODUCTDESC' => 'FCKeditorForProduct', 'DETAILS' => 'FCKeditorForProductDetails', @@ -54,11 +56,11 @@ $modules = array( 'MAILING' => 'FCKeditorForMailing', 'MAIL' => 'FCKeditorForMail', 'TICKET' => 'FCKeditorForTicket', - 'NOTE_PUBLIC' => 'FCKeditorForNotePublic', - 'NOTE_PRIVATE' => 'FCKeditorForNotePrivate', ); // Conditions for the option to be offered $conditions = array( + 'NOTE_PUBLIC' => 1, + 'NOTE_PRIVATE' => 1, 'SOCIETE' => 1, 'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)), 'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)), @@ -66,11 +68,11 @@ $conditions = array( 'MAILING' => !empty($conf->mailing->enabled), 'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)), 'TICKET' => !empty($conf->ticket->enabled), - 'NOTE_PUBLIC' => 1, - 'NOTE_PRIVATE' => 1, ); // Picto $picto = array( + 'NOTE_PUBLIC' => 'generic', + 'NOTE_PRIVATE' => 'generic', 'SOCIETE' => 'generic', 'PRODUCTDESC' => 'product', 'DETAILS' => 'product', @@ -78,8 +80,6 @@ $picto = array( 'MAILING' => 'email', 'MAIL' => 'email', 'TICKET' => 'ticket', - 'NOTE_PUBLIC' => 'generic', - 'NOTE_PRIVATE' => 'generic', ); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 25a33717c46..bacc8ef3166 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -228,7 +228,7 @@ if (!empty($conf->agenda->enabled)) { $elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush')); } if (!empty($conf->eventorganization->enabled) && !empty($user->rights->eventorganization->read)) { - $elementList['eventorganization_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization')); + $elementList['conferenceorbooth'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization')); } if (!empty($conf->partnership->enabled) && !empty($user->rights->partnership->read)) { $elementList['partnership_send'] = img_picto('', 'partnership', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToPartnership')); @@ -935,7 +935,7 @@ if ($resql) { print ''; @@ -1071,8 +1071,8 @@ if ($resql) { if ($showfield) { print ''; print ''; print ''."\n"; - print ''."\n"; + print ''."\n"; // Value print ''; }*/ print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 99bf843f50b..cbf2d8952b6 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4673,7 +4673,7 @@ if ($action == 'create') { print ''; print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code); print ' → '; - print ' '; + print ' '; print ''; print " '; + $response[] = array('title'=>$obj->question,'ref'=>$obj->url,'answer'=>$obj->answer,'url'=>$urltoprint); + } + $i++; + } + } else { + dol_print_error($db); + } + $response =json_encode($response); + echo $response; +} diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 9b7cbfc2fe6..0c349ad3e4c 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -122,7 +122,7 @@ class box_task extends ModeleBoxes $boxcontent .= ''."\n"; $selectArray = array('all' => $langs->trans("NoFilter"), 'im_task_contact' => $langs->trans("WhichIamLinkedTo"), 'im_project_contact' => $langs->trans("WhichIamLinkedToProject")); $boxcontent .= $form->selectArray($cookie_name, $selectArray, $filterValue); - $boxcontent .= ''; + $boxcontent .= ''; $boxcontent .= ''."\n"; $boxcontent .= ''."\n"; if (!empty($conf->use_javascript_ajax)) { diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 18920da3bc2..3f75ee30d02 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -447,6 +447,9 @@ abstract class CommonDocGenerator $array_key.'_bank_iban'=>$bank_account->iban, $array_key.'_bank_bic'=>$bank_account->bic, + $array_key.'_bank_label'=>$bank_account->label, + $array_key.'_bank_number'=>$bank_account->number, + $array_key.'_bank_proprio'=>$bank_account->proprio, $array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs), $array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)), diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 462a3bd5c44..45076e522a3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3845,8 +3845,14 @@ abstract class CommonObject $classfile = 'conferenceorbooth'; $classname = 'ConferenceOrBooth'; $module = 'eventorganization'; + } elseif ($objecttype == 'mo') { + $classpath = 'mrp/class'; + $classfile = 'mo'; + $classname = 'Mo'; + $module = 'mrp'; } + // Here $module, $classfile and $classname are set if ($conf->$module->enabled && (($element != $this->element) || $alsosametype)) { if ($loadalsoobjects) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5813c45047a..46159a52519 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7009,7 +7009,7 @@ class Form $tmparray = explode('@', $objecttmp->ismultientitymanaged); $sql .= " INNER JOIN ".MAIN_DB_PREFIX.$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; } - if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') { + if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { if (!$user->rights->societe->client->voir && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } @@ -7037,7 +7037,7 @@ class Form $sql .= " AND t.fk_soc = ".((int) $user->socid); } } - if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') { + if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { if (!$user->rights->societe->client->voir && !$user->socid) { $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -7891,12 +7891,16 @@ class Form $tplpath = 'eventorganization'; } elseif ($objecttype == 'conferenceorboothattendee') { $tplpath = 'eventorganization'; + } elseif ($objecttype == 'mo') { + $tplpath = 'mrp'; + if (empty($conf->mrp->enabled)) { + continue; // Do not show if module disabled + } } global $linkedObjectBlock; $linkedObjectBlock = $objects; - // Output template part (modules that overwrite templates must declare this into descriptor) $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); foreach ($dirtpls as $reldir) { @@ -7982,7 +7986,8 @@ class Form 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), 'invoice_supplier'=>array('enabled'=>$conf->supplier_invoice->enabled, 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'), - 'ticket'=>array('enabled'=>$conf->ticket->enabled, 'perms'=>1, 'label'=>'LinkToTicket', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')') + 'ticket'=>array('enabled'=>$conf->ticket->enabled, 'perms'=>1, 'label'=>'LinkToTicket', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')'), + 'mo'=>array('enabled'=>$conf->mrp->enabled, 'perms'=>1, 'label'=>'LinkToMO', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s INNER JOIN ".MAIN_DB_PREFIX."mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')') ); } diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index a06f1cd3e73..ac6bad50e41 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -781,7 +781,7 @@ class FormCompany extends Form $out .= ''; if ($typeinput == 'form') { - if ($selected == '' || $selected == '-1') { - $out .= ''; + if ($allowempty || ($selected == '' || $selected == '-1')) { + $out .= ''; } if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { $out .= ''; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index d486805cf46..abb5751a986 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -243,6 +243,65 @@ class FormTicket } } + if ($conf->knowledgemanagement->enabled) { + // KM Articles + print ''; + print ' + '."\n"; + } + // MESSAGE $msg = GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : ''; print ''; } - // Discount qty min print ''; print ''; diff --git a/htdocs/public/eventorganization/attendee_registration.php b/htdocs/public/eventorganization/attendee_register.php similarity index 90% rename from htdocs/public/eventorganization/attendee_registration.php rename to htdocs/public/eventorganization/attendee_register.php index 385152e420a..0cfdf1dabc0 100644 --- a/htdocs/public/eventorganization/attendee_registration.php +++ b/htdocs/public/eventorganization/attendee_register.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/public/eventorganization/attendee_registration.php + * \file htdocs/public/eventorganization/attendee_register.php * \ingroup project * \brief Example of form to subscribe to an event * @@ -251,10 +251,10 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $confattendee = new ConferenceOrBoothAttendee($db); if ($type == 'global') { - $filter = array('t.fk_project'=>$id, 'customsql'=>'t.email="'.$email.'"'); + $filter = array('t.fk_project'=>((int) $id), 'customsql'=>'t.email="'.$db->escape($email).'"'); } if ($action == 'conf') { - $filter = array('t.fk_actioncomm'=>$id, 'customsql'=>'t.email="'.$email.'"'); + $filter = array('t.fk_actioncomm'=>((int) $id), 'customsql'=>'t.email="'.$db->escape($email).'"'); } // Check if there is already an attendee into table eventorganization_conferenceorboothattendee for same event (or conference/booth) @@ -279,16 +279,25 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // At this point, we have an existing $confattendee. It may not be linked to a thirdparty. //var_dump($confattendee); - // If the attendee has already been paid - if (!empty($confattendee->date_subscription)) { - $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + // If the registration has already been paid for this attendee + if (!empty($confattendee->date_subscription) && !empty($confattendee->amount)) { + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'master'); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl); + + $mesg = $langs->trans("RegistrationAndPaymentWereAlreadyRecorder", $email); + setEventMessages($mesg, null, 'mesgs'); + + $db->commit(); + Header("Location: ".$redirection); exit; } + $resultfetchthirdparty = -1; + // Getting the thirdparty or creating it $thirdparty = new Societe($db); + $contact = new Contact($db); // Fetch using fk_soc if the attendee was already found if (!empty($confattendee->fk_soc) && $confattendee->fk_soc > 0) { $resultfetchthirdparty = $thirdparty->fetch($confattendee->fk_soc); @@ -298,10 +307,19 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen if (!empty($societe)) { $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $email); if ($resultfetchthirdparty <= 0) { - // Need to create a new one (not found or multiple with the same name/email) - $resultfetchthirdparty = 0; + // Try to find the thirdparty from the contact + $resultfetchcontact = $contact->fetch('', null, '', $email); + if ($resultfetchcontact <= 0 || $contact->fk_soc <= 0) { + // Need to create a new one (not found or multiple with the same name/email) + $resultfetchthirdparty = 0; + } else { + $thirdparty->fetch($contact->fk_soc); + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + $resultfetchthirdparty = 1; + } } else { - // We found an unique result with that name/email, so we set the fk_soc of attendee + // We found a unique result with that name/email, so we set the fk_soc of attendee $confattendee->fk_soc = $thirdparty->id; $confattendee->update($user); } @@ -310,6 +328,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $resultfetchthirdparty = 0; } } else { + // Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences) $resultfetchthirdparty = 0; } } @@ -359,6 +378,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); + // Update attendee country to match country of thirdparty $confattendee->fk_soc = $thirdparty->id; $confattendee->update($user); } @@ -370,6 +390,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $outputlangs = $langs; // TODO Use default language of $thirdparty->default_lang to build $outputlang + // Get product to use for invoice $productforinvoicerow = new Product($db); $productforinvoicerow->id = 0; @@ -378,6 +399,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION); } + // Create invoice if ($resultprod < 0) { $error++; $errmsg .= $productforinvoicerow->error; @@ -428,8 +450,10 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen if (!$error) { $db->commit(); - // Registration was recorded and invoice was generated, so we send an email + // Registration was recorded and invoice was generated, but payment not yet done. // TODO + // Send an email to says registration shas been received and that we are waiting for the payment. + // Should send email template (EventOrganizationEmailRegistrationEvent) saved into conf EVENTORGANIZATION_TEMPLATE_EMAIL_REGISTRATION_EVENT. // Now we redirect to the payment page $sourcetouse = 'organizedeventregistration'; @@ -442,6 +466,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $redirection .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } + Header("Location: ".$redirection); exit; } else { @@ -585,13 +610,15 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
".$langs->trans("RSS")." ".($i + 1)."'; - print ''; - print "   "; - print ''; + print ''; + print ''; print ''; print '
'; print ''; print ''; - print ''; + print ''; print '
'; print ''; print '
'; print $valuetoshow; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 2f18bab5896..8b5c05b7bda 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -101,6 +101,10 @@ if ($action == 'setMAIN_ENABLE_OVERWRITE_TRANSLATION') { } if ($action == 'update') { + if ($transkey == '') { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Key")), null, 'errors'); + $error++; + } if ($transvalue == '') { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NewTranslationStringToShow")), null, 'errors'); $error++; @@ -108,7 +112,7 @@ if ($action == 'update') { if (!$error) { $db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".GETPOST('rowid', 'int'); + $sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transkey = '".$db->escape($transkey)."', transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".((int) GETPOST('rowid', 'int')); $result = $db->query($sql); if ($result > 0) { $db->commit(); @@ -324,7 +328,13 @@ if ($mode == 'overwrite') { print '
'.$obj->lang.''.$obj->transkey.''; + if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) { + print ''; + } else { + print $obj->transkey; + } + print ''; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index e6ae5c78ae5..de8c87bcd43 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -946,7 +946,7 @@ class BOM extends CommonObject $this->lines = array(); $objectline = new BOMLine($this->db); - $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.$this->id)); + $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.((int) $this->id))); if (is_numeric($result)) { $this->error = $this->error; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index e5e264a12f5..dda6eec132c 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -889,7 +889,7 @@ if ($resql) { print ''; - print '
'; + print '
'; print ''; print '
'; @@ -589,23 +648,29 @@ class FormTicket /** * Return html list of ticket anaytic codes * - * @param string $selected Id categorie pre-selectionnée - * @param string $htmlname Name of select component - * @param string $filtertype To filter on some properties in llx_c_ticket_category ('public = 1'). This parameter must not come from input of users. - * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code - * @param int $empty 1=peut etre vide, 0 sinon - * @param int $noadmininfo 0=Add admin info, 1=Disable admin info - * @param int $maxlength Max length of label - * @param string $morecss More CSS - * @param int $use_multilevel If > 0 create a multilevel select which use $htmlname example: $use_multilevel = 1 permit to have 2 select boxes. + * @param string $selected Id categorie pre-selectionnée + * @param string $htmlname Name of select component + * @param string $filtertype To filter on some properties in llx_c_ticket_category ('public = 1'). This parameter must not come from input of users. + * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code + * @param int $empty 1=peut etre vide, 0 sinon + * @param int $noadmininfo 0=Add admin info, 1=Disable admin info + * @param int $maxlength Max length of label + * @param string $morecss More CSS + * @param int $use_multilevel If > 0 create a multilevel select which use $htmlname example: $use_multilevel = 1 permit to have 2 select boxes. + * @param Translate $outputlangs Output lnaguage * @return void */ - public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0) + public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0, $outputlangs = null) { - global $langs, $user; + global $conf, $langs, $user; dol_syslog(get_class($this)."::selectCategoryTickets ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); + if (empty($outputlangs)) { + $outputlangs = $langs; + } + $outputlangs->load("ticket"); + $ticketstat = new Ticket($this->db); $ticketstat->loadCacheCategoriesTickets(); @@ -629,6 +694,13 @@ class FormTicket continue; } + $label = ($arraycategories['label'] != '-' ? $arraycategories['label'] : ''); + if ($outputlangs->trans("TicketCategoryShort".$arraycategories['code']) != ("TicketCategoryShort".$arraycategories['code'])) { + $label = $outputlangs->trans("TicketCategoryShort".$arraycategories['code']); + } elseif ($outputlangs->trans($arraycategories['code']) != $arraycategories['code']) { + $label = $outputlangs->trans($arraycategories['code']); + } + if ($format == 0) { print '
'.$langs->trans("DiscountQtyMin").' %'; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 2ffaf43ea90..fc394d6203a 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -104,6 +104,29 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { + $backurlforlist = DOL_URL_ROOT.'/product/stock/list.php'; + + if (empty($backtopage) || ($cancel && empty($id))) { + if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { + if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { + $backtopage = $backurlforlist; + } else { + $backtopage = DOL_URL_ROOT.'/product/stock/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__'); + } + } + } + + if ($cancel) { + if (!empty($backtopageforcancel)) { + header("Location: ".$backtopageforcancel); + exit; + } elseif (!empty($backtopage)) { + header("Location: ".$backtopage); + exit; + } + $action = ''; + } + // Ajout entrepot if ($action == 'add' && $user->rights->stock->creer) { $object->ref = (string) GETPOST("ref", "alpha"); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 00394dda384..ff406e33131 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1525,7 +1525,7 @@ class Project extends CommonObject } } - $clone_project->datec = $now; + $clone_project->date_c = $now; if (!$clone_note) { $clone_project->note_private = ''; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 71219be4e57..fa6884ee920 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1387,7 +1387,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { } print ''; - print ''; + $form->buttonsSaveCancel(); + print ''; print ''; print '
' . "\n"; // Email - print '' . "\n"; + print '' . "\n"; // Company print '' . "\n"; + print ' ' . "\n"; // Address print '' . "\n"; @@ -602,7 +629,8 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print ''; // Country - print ''."\n"; +// Title print ''."\n"; // Lastname print ''."\n"; // Firstname print ''."\n"; +// EMail +print ''."\n"; +// Login +if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { + print ''."\n"; + print ''."\n"; + print ''."\n"; +} // Gender print ''; print ''; -// Company -print ''."\n"; // Address print ''."\n"; @@ -618,7 +631,8 @@ print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'se print ''; // Country print ''; } -// EMail -print ''."\n"; -// Login -if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''."\n"; - print ''."\n"; - print ''."\n"; -} // Birthday print ''; print ''; print ''."\n"; - // Add specific fields used by Dolibarr foundation for example +// Add specific fields used by Dolibarr foundation for example +// TODO Move this into generic feature. if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { $arraybudget = array('50'=>'<= 100 000', '100'=>'<= 200 000', '200'=>'<= 500 000', '300'=>'<= 1 500 000', '600'=>'<= 3 000 000', '1000'=>'<= 5 000 000', '2000'=>'5 000 000+'); print ''."\n"; } + if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { // $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 702c910ea01..d7bf9b3d565 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1834,7 +1834,8 @@ if ($source == 'organizedeventregistration') { // Debitor print ''."\n"; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 2f139748cba..20a5239153a 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1445,6 +1445,7 @@ if ($ispaymentok) { $key = 'ONLINE_PAYMENT_MESSAGE_OK'; if (!empty($conf->global->$key)) { + print '
'; print $conf->global->$key; } diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index 37635d27048..fa7df34af14 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -893,7 +893,7 @@ class RecruitmentCandidature extends CommonObject $this->lines = array(); $objectline = new RecruitmentCandidatureLine($this->db); - $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_recruitmentcandidature = '.$this->id)); + $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_recruitmentcandidature = '.((int) $this->id))); if (is_numeric($result)) { $this->error = $this->error; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c87ef8f2f1b..4110e59d4de 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1759,7 +1759,7 @@ class Societe extends CommonObject $this->country_id = $obj->country_id; $this->country_code = $obj->country_id ? $obj->country_code : ''; - $this->country = $obj->country_id ? ($langs->transnoentities('Country'.$obj->country_code) != 'Country'.$obj->country_code ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : ''; + $this->country = $obj->country_id ? (($langs->transnoentities('Country'.$obj->country_code) != 'Country'.$obj->country_code) ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : ''; $this->state_id = $obj->state_id; $this->state_code = $obj->state_code; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 985fd7d82fe..ea273064840 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1166,22 +1166,22 @@ class Ticket extends CommonObject } /** - * Charge dans cache la liste des catégories de tickets (paramétrable dans dictionnaire) + * Load into a cache array, the list of ticket categories (setup done into dictionary) * * @return int Number of lines loaded, 0 if already loaded, <0 if KO */ public function loadCacheCategoriesTickets() { - global $langs; + global $conf, $langs; if (!empty($this->cache_category_ticket) && count($this->cache_category_tickets)) { + // Cache already loaded return 0; } - // Cache deja charge $sql = "SELECT rowid, code, label, use_default, pos, description, public, active, force_severity, fk_parent"; $sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_category"; - $sql .= " WHERE active > 0"; + $sql .= " WHERE active > 0 AND entity = ".((int) $conf->entity); $sql .= " ORDER BY pos"; dol_syslog(get_class($this)."::load_cache_categories_tickets", LOG_DEBUG); $resql = $this->db->query($sql); @@ -1191,15 +1191,18 @@ class Ticket extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); $this->cache_category_tickets[$obj->rowid]['code'] = $obj->code; - // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut - $label = ($langs->trans("TicketCategoryShort".$obj->code) != ("TicketCategoryShort".$obj->code) ? $langs->trans("TicketCategoryShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); - $this->cache_category_tickets[$obj->rowid]['label'] = $label; $this->cache_category_tickets[$obj->rowid]['use_default'] = $obj->use_default; $this->cache_category_tickets[$obj->rowid]['pos'] = $obj->pos; $this->cache_category_tickets[$obj->rowid]['public'] = $obj->public; $this->cache_category_tickets[$obj->rowid]['active'] = $obj->active; $this->cache_category_tickets[$obj->rowid]['force_severity'] = $obj->force_severity; $this->cache_category_tickets[$obj->rowid]['fk_parent'] = $obj->fk_parent; + + // If translation exists, we use it to store already translated string. + // Warning: You should not use this and recompute the translated string into caller code to get the value into expected language + $label = ($langs->trans("TicketCategoryShort".$obj->code) != ("TicketCategoryShort".$obj->code) ? $langs->trans("TicketCategoryShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); + $this->cache_category_tickets[$obj->rowid]['label'] = $label; + $i++; } return $num; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 8d03d1d1cfb..c80cdb2a732 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1972,7 +1972,7 @@ if ($action == 'create' || $action == 'adduserldap') { print $form->select_dolgroups('', 'group', 1, $exclude, 0, '', '', $object->entity); print '   '; print ''; - print ''; + print ''; } print ''."\n"; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index fe1c6993558..649b8b55502 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -455,8 +455,9 @@ class User extends CommonObject } } - if ($sid) { // permet une recherche du user par son SID ActiveDirectory ou Samba - $sql .= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."') LIMIT 1"; + if ($sid) { + // permet une recherche du user par son SID ActiveDirectory ou Samba + $sql .= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."')"; } elseif ($login) { $sql .= " AND u.login = '".$this->db->escape($login)."'"; } elseif ($email) { @@ -466,6 +467,11 @@ class User extends CommonObject } $sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities + if ($sid) { + // permet une recherche du user par son SID ActiveDirectory ou Samba + $sql .= ' '.$this->db->plimit(1); + } + $result = $this->db->query($sql); if ($result) { $obj = $this->db->fetch_object($result); diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 1f20b018f2e..186d8463549 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -418,7 +418,7 @@ if ($action == 'create') { print $form->select_dolusers('', 'user', 1, $exclude, 0, '', '', $object->entity, 0, 0, '', 0, '', 'maxwidth300'); print '   '; print ''; - print ''; + print ''; print ''."\n"; print '
' . $langs->trans("Email") . '*
' . $langs->trans("Email") . '*
' . $langs->trans("Company"); if (!empty(floatval($project->price_registration))) { - print '*'; + print '*'; } - print '
'; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print '
' . $langs->trans("Address") . '' . "\n"; print '
' . $langs->trans('Country') . '*'; + print '
' . $langs->trans('Country') . '*'; + print img_picto('', 'country', 'class="pictofixedwidth"'); $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index f84fce1a2b6..b6498ca4032 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -536,15 +536,16 @@ jQuery(document).ready(function () { jQuery(document).ready(function () { function initmorphy() { - if (jQuery("#morphy").val()==\'phy\') { - jQuery("#trcompany").hide(); - } - if (jQuery("#morphy").val()==\'mor\') { - jQuery("#trcompany").show(); - } + console.log("Call initmorphy"); + if (jQuery("#morphy").val() == \'phy\') { + jQuery("#trcompany").hide(); + } + if (jQuery("#morphy").val() == \'mor\') { + jQuery("#trcompany").show(); + } }; initmorphy(); - jQuery("#morphy").click(function() { + jQuery("#morphy").change(function() { initmorphy(); }); jQuery("#selectcountry_id").change(function() { @@ -592,21 +593,33 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { print ''; } -// Civility +// Company +print '
'.$langs->trans("Company").''; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print '
'.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''; +//print img_picto('', 'email', 'class="pictofixedwidth"'); +print '
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("Gender").''; $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); print '
'.$langs->trans("Company").'
'.$langs->trans("Address").''."\n"; print '
'.$langs->trans('Country').''; -$country_id = GETPOST('country_id'); +print img_picto('', 'country', 'class="pictofixedwidth"'); +$country_id = GETPOST('country_id', 'int'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); } @@ -644,14 +658,6 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { } print '
'.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').'
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("DateOfBirth").''; print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); @@ -669,7 +675,8 @@ print ''.$langs->trans("Comments").'
'.$langs->trans("TurnoverOrBudget").' *'; @@ -712,6 +719,7 @@ if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { '; print '
'.$langs->trans("Attendee"); print ''; - print $thirdparty->name; + print $attendee->email; + print ($thirdparty->name ? ' ('.$thirdparty->name.')' : ''); print ''; print '
'."\n"; print '
'; diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index aae74e3804c..44299c1d363 100755 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -927,17 +927,20 @@ class Workstation extends CommonObject { $this->lines = array(); + /* $objectline = new WorkstationLine($this->db); - $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_workstation = '.$this->id)); + $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_workstation = '.((int) $this->id))); if (is_numeric($result)) { $this->error = $this->error; $this->errors = $this->errors; return $result; - } else { - $this->lines = $result; - return $this->lines; } + + $this->lines = $result; + */ + + return $this->lines; } /**