| ';
@@ -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 ' |
';
}
-
// Discount qty min
print '' . "\n";
// Email
- print '| ' . $langs->trans("Email") . '* | |
' . "\n";
+ print '| ' . $langs->trans("Email") . '* | |
' . "\n";
// Company
print '| ' . $langs->trans("Company");
if (!empty(floatval($project->price_registration))) {
- print '*';
+ print '*';
}
- print ' | |
' . "\n";
+ print ' ';
+ print img_picto('', 'company', 'class="pictofixedwidth"');
+ print ' | ' . "\n";
// Address
print '| ' . $langs->trans("Address") . ' | ' . "\n";
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 '| ' . $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 ' |
'."\n";
+// Title
print '| '.$langs->trans('UserTitle').' | ';
print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').' |
'."\n";
// Lastname
print '| '.$langs->trans("Lastname").' * | |
'."\n";
// Firstname
print '| '.$langs->trans("Firstname").' * | |
'."\n";
+// EMail
+print '| '.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').' | ';
+//print img_picto('', 'email', 'class="pictofixedwidth"');
+print ' |
'."\n";
+// Login
+if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
+ print '| '.$langs->trans("Login").' * | |
'."\n";
+ print '| '.$langs->trans("Password").' * | |
'."\n";
+ print '| '.$langs->trans("PasswordAgain").' * | |
'."\n";
+}
// Gender
print '| '.$langs->trans("Gender").' | ';
print '';
$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"));
print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1);
print ' |
';
-// Company
-print '| '.$langs->trans("Company").' | |
'."\n";
// Address
print '| '.$langs->trans("Address").' | '."\n";
print ' |
'."\n";
@@ -618,7 +631,8 @@ print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'se
print '';
// Country
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 ' |
';
}
-// EMail
-print '| '.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').' | |
'."\n";
-// Login
-if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
- print '| '.$langs->trans("Login").' * | |
'."\n";
- print '| '.$langs->trans("Password").' * | |
'."\n";
- print '| '.$langs->trans("PasswordAgain").' * | |
'."\n";
-}
// Birthday
print '| '.$langs->trans("DateOfBirth").' | ';
print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0);
@@ -669,7 +675,8 @@ print ' | '.$langs->trans("Comments").' | ';
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 '| '.$langs->trans("TurnoverOrBudget").' * | ';
@@ -712,6 +719,7 @@ if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) {
';
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 '| '.$langs->trans("Attendee");
print ' | ';
- print $thirdparty->name;
+ print $attendee->email;
+ print ($thirdparty->name ? ' ('.$thirdparty->name.')' : '');
print '';
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 '
'."\n";
print '