diff --git a/ChangeLog b/ChangeLog
index 974e864518f..c6ae2ae82e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,7 @@ For users:
- New: Add an admin page of PHP sessions with a way to lock new connections
for other users than yourself. Can also purge existing sessions.
- New: Add experimental point of sale module.
+- New: Better usage when using with smartphones.
- Fix: "Now" link works when date popup is not used.
- Fix: Debug seriously the email notification module.
- Fix: Error Call to a member function trans when refusing a supplier order.
diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php
index 268142ee435..ab07fd55327 100644
--- a/htdocs/adherents/index.php
+++ b/htdocs/adherents/index.php
@@ -161,7 +161,7 @@ foreach ($AdherentType as $key => $adhtype)
{
$var=!$var;
print "
";
- print '| '.img_object($langs->trans("ShowType"),"group").' '.$adhtype->getNomUrl(0,20).' | ';
+ print ''.img_object($langs->trans("ShowType"),"group").' '.$adhtype->getNomUrl(0,dol_size(16)).' | ';
print ''.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).' | ';
print ''.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-$MemberUpToDate[$key] > 0) ? $MembersValidated[$key]-$MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).' | ';
print ''.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,gmmktime(),3).' | ';
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index 11f647d35a2..a3edf937843 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -108,7 +108,7 @@ class Form
$s.= $htmltext."\n";
$s.= ''."\n";
$s.= ''."\n";
}
diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index 2fbb35d6dd2..9a3b692683e 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -55,6 +55,20 @@ function dol_clone($object)
return $myclone;
}
+/**
+ * \brief Optimize a size for some browsers (phone, smarphone, ...)
+ * \param size Size we want
+ * \param type Type of optimizing(''=Optimize for a truncate, 'width'=Optimize for screen width)
+ * \return int New size after optimizing
+ */
+function dol_size($size,$type='')
+{
+ global $conf;
+ if (empty($conf->browser->phone)) return $size;
+ if ($type == 'width') return 250;
+ else return 10;
+}
+
/**
* \brief Return date for now
diff --git a/htdocs/lib/security.lib.php b/htdocs/lib/security.lib.php
index a8abc1b4536..8a5b6bf34b4 100644
--- a/htdocs/lib/security.lib.php
+++ b/htdocs/lib/security.lib.php
@@ -70,12 +70,13 @@ function dol_loginfunction($langs,$conf,$mysoc)
print '