'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print "\n".'
'."\n";
- $param="socid=".$object->id;
- if ($search_status != '') $param.='&search_status='.$search_status;
- if ($search_name != '') $param.='&search_name='.urlencode($search_name);
+ $param="socid=".urlencode($object->id);
+ if ($search_status != '') $param.='&search_status='.urlencode($search_status);
+ if ($search_name != '') $param.='&search_name='.urlencode($search_name);
+ if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
+ // Add $param from extra fields
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
$sql = "SELECT t.rowid, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.skype, t.statut, t.photo,";
$sql .= " t.civility as civility_id, t.address, t.zip, t.town";
@@ -943,7 +947,9 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
$sql .= " WHERE t.fk_soc = ".$object->id;
if ($search_status!='' && $search_status != '-1') $sql .= " AND t.statut = ".$db->escape($search_status);
- if ($search_name) $sql .= " AND (t.lastname LIKE '%".$db->escape($search_name)."%' OR t.firstname LIKE '%".$db->escape($search_name)."%')";
+ if ($search_name) $sql .= natural_search(array('t.lastname', 't.firstname'), $search_name);
+ // Add where from extra fields
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
if ($sortfield == "t.name") $sql.=" ORDER BY t.lastname $sortorder, t.firstname $sortorder";
else $sql.= " ORDER BY $sortfield $sortorder";
@@ -1107,7 +1113,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
// Edit
if ($user->rights->societe->contact->creer)
{
- print '';
+ print '';
print img_edit();
print '';
}
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 6fcc8e6494a72..eea3545bb07dc 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -2090,7 +2090,7 @@
if (! empty($conf->projet->enabled))
{
print '';
- $formproject->select_projects(-1, $line->fk_projet,'fk_projet', 0, 0, 1, 1);
+ $formproject->select_projects(-1, $line->fk_projet,'fk_projet', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300');
print ' | ';
}
diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php
index c3a6b2341f16f..57b3f9b34c8a7 100644
--- a/htdocs/expensereport/class/expensereport.class.php
+++ b/htdocs/expensereport/class/expensereport.class.php
@@ -1241,7 +1241,7 @@ function setApproved($fuser, $notrigger=0)
$error = 0;
// date approval
- $this->date_approve = $this->db->idate($now);
+ $this->date_approve = $now;
if ($this->fk_statut != 5)
{
$this->db->begin();
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index bb9748b1af3b5..5d452cabcb62e 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -2694,18 +2694,15 @@ function get_codecompta($type)
if (! empty($conf->global->SOCIETE_CODECOMPTA_ADDON))
{
- $file='';
+ $res=false;
$dirsociete=array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
foreach ($dirsociete as $dirroot)
{
- if (file_exists(DOL_DOCUMENT_ROOT.'/'.$dirroot.$conf->global->SOCIETE_CODECOMPTA_ADDON.".php"))
- {
- $file=$dirroot.$conf->global->SOCIETE_CODECOMPTA_ADDON.".php";
- break;
- }
+ $res=dol_include_once($dirroot.$conf->global->SOCIETE_CODECOMPTA_ADDON.'.php');
+ if ($res) break;
}
- if (! empty($file))
+ if ($res)
{
dol_include_once($file);