Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
d929d93376
@ -241,8 +241,15 @@ $sql.= " a.fk_contact, a.note, a.percent as percent,";
|
|||||||
$sql.= " a.fk_element, a.elementtype, a.datec, a.tms as datem,";
|
$sql.= " a.fk_element, a.elementtype, a.datec, a.tms as datem,";
|
||||||
$sql.= " c.code as type_code, c.libelle as type_label,";
|
$sql.= " c.code as type_code, c.libelle as type_label,";
|
||||||
$sql.= " sp.lastname, sp.firstname, sp.email, sp.phone, sp.address, sp.phone as phone_pro, sp.phone_mobile, sp.phone_perso, sp.fk_pays as country_id";
|
$sql.= " sp.lastname, sp.firstname, sp.email, sp.phone, sp.address, sp.phone as phone_pro, sp.phone_mobile, sp.phone_perso, sp.fk_pays as country_id";
|
||||||
|
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||||
|
|
||||||
|
// Add fields from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
||||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields as ef ON (a.id = ef.fk_object) ";
|
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields as ef ON (a.id = ef.fk_object) ";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||||
@ -314,9 +321,15 @@ if ($filtert > 0 || $usergroup > 0)
|
|||||||
if ($dateselect > 0) $sql.= " AND ((a.datep2 >= '".$db->idate($dateselect)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."') OR (a.datep2 IS NULL AND a.datep > '".$db->idate($dateselect-3600)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."'))";
|
if ($dateselect > 0) $sql.= " AND ((a.datep2 >= '".$db->idate($dateselect)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."') OR (a.datep2 IS NULL AND a.datep > '".$db->idate($dateselect-3600)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."'))";
|
||||||
if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AND '".$db->idate($datestart+3600*24-1)."'";
|
if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AND '".$db->idate($datestart+3600*24-1)."'";
|
||||||
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
|
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
|
||||||
|
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||||
|
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
|
|||||||
@ -454,7 +454,7 @@ class Invoices extends DolibarrApi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->invoice->update($id, DolibarrApiAccess::$user))
|
if($this->invoice->update(DolibarrApiAccess::$user))
|
||||||
return $this->get($id);
|
return $this->get($id);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -5732,7 +5732,7 @@ class Form
|
|||||||
* @param int $disablebademail Check if an email is found into value and if not disable and colorize entry
|
* @param int $disablebademail Check if an email is found into value and if not disable and colorize entry
|
||||||
* @param int $nohtmlescape No html escaping.
|
* @param int $nohtmlescape No html escaping.
|
||||||
* @return string HTML select string.
|
* @return string HTML select string.
|
||||||
* @see multiselectarray
|
* @see multiselectarray, selectArrayAjax, selectArrayFilter
|
||||||
*/
|
*/
|
||||||
static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='',$disablebademail=0, $nohtmlescape=0)
|
static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='',$disablebademail=0, $nohtmlescape=0)
|
||||||
{
|
{
|
||||||
@ -6062,14 +6062,18 @@ class Form
|
|||||||
* @param string $placeholder String to use as placeholder
|
* @param string $placeholder String to use as placeholder
|
||||||
* @param int $addjscombo Add js combo
|
* @param int $addjscombo Add js combo
|
||||||
* @return string HTML multiselect string
|
* @return string HTML multiselect string
|
||||||
* @see selectarray
|
* @see selectarray, selectArrayAjax, selectArrayFilter
|
||||||
*/
|
*/
|
||||||
static function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $morecss='', $translate=0, $width=0, $moreattrib='', $elemtype='', $placeholder='', $addjscombo=1)
|
static function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $morecss='', $translate=0, $width=0, $moreattrib='', $elemtype='', $placeholder='', $addjscombo=-1)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
|
if ($addjscombo < 0) {
|
||||||
|
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $addjscombo = 1;
|
||||||
|
else $addjscombo = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Add code for jquery to use multiselect
|
// Add code for jquery to use multiselect
|
||||||
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
|
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
|
||||||
@ -6520,7 +6524,7 @@ class Form
|
|||||||
|
|
||||||
if (! empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || ! in_array($key, $excludelinksto)))
|
if (! empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || ! in_array($key, $excludelinksto)))
|
||||||
{
|
{
|
||||||
print '<div id="'.$key.'list"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>';
|
print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax)?'':' style="display:none"').'>';
|
||||||
$sql = $possiblelink['sql'];
|
$sql = $possiblelink['sql'];
|
||||||
|
|
||||||
$resqllist = $this->db->query($sql);
|
$resqllist = $this->db->query($sql);
|
||||||
@ -6582,8 +6586,9 @@ class Form
|
|||||||
{
|
{
|
||||||
$linktoelem='
|
$linktoelem='
|
||||||
<dl class="dropdown" id="linktoobjectname">
|
<dl class="dropdown" id="linktoobjectname">
|
||||||
<dt><a href="#linktoobjectname">'.$langs->trans("LinkTo").'...</a></dt>
|
';
|
||||||
<dd>
|
if (! empty($conf->use_javascript_ajax)) $linktoelem.='<dt><a href="#linktoobjectname">'.$langs->trans("LinkTo").'...</a></dt>';
|
||||||
|
$linktoelem.='<dd>
|
||||||
<div class="multiselectlinkto">
|
<div class="multiselectlinkto">
|
||||||
<ul class="ulselectedfields">'.$linktoelemlist.'
|
<ul class="ulselectedfields">'.$linktoelemlist.'
|
||||||
</ul>
|
</ul>
|
||||||
@ -6596,7 +6601,9 @@ class Form
|
|||||||
$linktoelem='';
|
$linktoelem='';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<!-- Add js to show linkto box -->
|
if (! empty($conf->use_javascript_ajax))
|
||||||
|
{
|
||||||
|
print '<!-- Add js to show linkto box -->
|
||||||
<script type="text/javascript" language="javascript">
|
<script type="text/javascript" language="javascript">
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
jQuery(".linkto").click(function() {
|
jQuery(".linkto").click(function() {
|
||||||
@ -6606,7 +6613,8 @@ class Form
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
';
|
';
|
||||||
|
}
|
||||||
|
|
||||||
return $linktoelem;
|
return $linktoelem;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user