Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0

This commit is contained in:
Laurent Destailleur
2017-05-24 13:46:03 +02:00
4 changed files with 49 additions and 50 deletions

View File

@@ -251,7 +251,7 @@ $cleanparam='';
$i=0; $i=0;
foreach($property as $key => $prop) foreach($property as $key => $prop)
{ {
$i++;
$addfield=1; $addfield=1;
if ($prop['field'] == 'tms') $addfield=0; // This is a field of type timestamp edited automatically if ($prop['field'] == 'tms') $addfield=0; // This is a field of type timestamp edited automatically
if ($prop['extra'] == 'auto_increment') $addfield=0; if ($prop['extra'] == 'auto_increment') $addfield=0;
@@ -263,6 +263,7 @@ foreach($property as $key => $prop)
$varprop.="';"; $varprop.="';";
$varprop.="\n"; $varprop.="\n";
} }
$i++;
} }
$targetcontent=preg_replace('/\$sql \.= \' field1,\';/', $varprop, $targetcontent); $targetcontent=preg_replace('/\$sql \.= \' field1,\';/', $varprop, $targetcontent);
$targetcontent=preg_replace('/\$sql \.= \' field2\';/', '', $targetcontent); $targetcontent=preg_replace('/\$sql \.= \' field2\';/', '', $targetcontent);

View File

@@ -3806,12 +3806,12 @@ else if ($id > 0 || ! empty($ref))
if ($object->situation_cycle_ref && $object->statut == 0) { if ($object->situation_cycle_ref && $object->statut == 0) {
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<form name="updatealllines" id="updatealllines" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '"#updatealllines" method="POST">'; print '<form name="updatealllines" id="updatealllines" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '#updatealllines" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '" />'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '" />';
print '<input type="hidden" name="action" value="updatealllines" />'; print '<input type="hidden" name="action" value="updatealllines" />';
print '<input type="hidden" name="id" value="' . $object->id . '" />'; print '<input type="hidden" name="id" value="' . $object->id . '" />';
print '<table id="tablelines" class="noborder noshadow" width="100%">'; print '<table id="tablelines_all_progress" class="noborder noshadow" width="100%">';
print '<tr class="liste_titre nodrag nodrop">'; print '<tr class="liste_titre nodrag nodrop">';
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {

View File

@@ -80,7 +80,7 @@ class Form
* @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...) * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...)
* @param string $moreparam More param to add on a href URL. * @param string $moreparam More param to add on a href URL.
* @param int $fieldrequired 1 if we want to show field as mandatory using the "fieldrequired" CSS. * @param int $fieldrequired 1 if we want to show field as mandatory using the "fieldrequired" CSS.
* @param int $notabletag 1=Do not output table tags but output a ':', 2=Do not output table tags and no ':', 3=Do not output table tags but output a ' ' * @param int $notabletag 1=Do not output table tags but output a ':', 2=Do not output table tags and no ':', 3=Do not output table tags but output a ' '
* @return string HTML edit field * @return string HTML edit field
*/ */
function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata='string', $moreparam='', $fieldrequired=0, $notabletag=0) function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata='string', $moreparam='', $fieldrequired=0, $notabletag=0)
@@ -512,7 +512,7 @@ class Form
* *
* @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default. * @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default.
* @param int $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action. * @param int $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
* @param int $alwaysvisible 1=select button always visible * @param int $alwaysvisible 1=select button always visible
* @return string Select list * @return string Select list
*/ */
function selectMassAction($selected, $arrayofaction, $alwaysvisible=0) function selectMassAction($selected, $arrayofaction, $alwaysvisible=0)
@@ -556,16 +556,16 @@ class Form
jQuery(".massaction").hide(); jQuery(".massaction").hide();
} }
} }
jQuery(document).ready(function () { jQuery(document).ready(function () {
initCheckForSelect(); initCheckForSelect();
jQuery(".checkforselect").click(function() { jQuery(".checkforselect").click(function() {
initCheckForSelect(); initCheckForSelect();
}); });
jQuery(".massactionselect").change(function() { jQuery(".massactionselect").change(function() {
var massaction = $( this ).val(); var massaction = $( this ).val();
var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
if (massaction == "builddoc") if (massaction == "builddoc")
{ {
urlform = urlform + "#show_files"; urlform = urlform + "#show_files";
} }
@@ -586,7 +586,7 @@ class Form
</script> </script>
'; ';
} }
return $ret; return $ret;
} }
@@ -1013,7 +1013,7 @@ class Form
{ {
global $conf,$user,$langs; global $conf,$user,$langs;
$out=''; $out='';
$num=0; $num=0;
$outarray=array(); $outarray=array();
@@ -1055,8 +1055,6 @@ class Form
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
$events = null;
if ($conf->use_javascript_ajax && ! $forcecombo) if ($conf->use_javascript_ajax && ! $forcecombo)
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
@@ -1420,7 +1418,7 @@ class Form
// Build list includeUsers to have only hierarchy and current user // Build list includeUsers to have only hierarchy and current user
$includeUsers = implode(",",$user->getAllChildIds(1)); $includeUsers = implode(",",$user->getAllChildIds(1));
} }
$out=''; $out='';
// On recherche les utilisateurs // On recherche les utilisateurs
@@ -1637,7 +1635,7 @@ class Form
$i++; $i++;
} }
if ($nbassignetouser) $out.='</div>'; if ($nbassignetouser) $out.='</div>';
//$out.='</form>'; //$out.='</form>';
return $out; return $out;
} }
@@ -1663,7 +1661,7 @@ class Form
* @param int $hidepriceinlabel 1=Hide prices in label * @param int $hidepriceinlabel 1=Hide prices in label
* @param string $warehouseStatus warehouse status filter, following comma separated filter options can be used * @param string $warehouseStatus warehouse status filter, following comma separated filter options can be used
* 'warehouseopen' = select products from open warehouses, * 'warehouseopen' = select products from open warehouses,
* 'warehouseclosed' = select products from closed warehouses, * 'warehouseclosed' = select products from closed warehouses,
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only * 'warehouseinternal' = select products from warehouses for internal correct/transfer only
* @return void * @return void
*/ */
@@ -1730,7 +1728,7 @@ class Form
* @param int $hidepriceinlabel 1=Hide prices in label * @param int $hidepriceinlabel 1=Hide prices in label
* @param string $warehouseStatus warehouse status filter, following comma separated filter options can be used * @param string $warehouseStatus warehouse status filter, following comma separated filter options can be used
* 'warehouseopen' = select products from open warehouses, * 'warehouseopen' = select products from open warehouses,
* 'warehouseclosed' = select products from closed warehouses, * 'warehouseclosed' = select products from closed warehouses,
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only * 'warehouseinternal' = select products from warehouses for internal correct/transfer only
* @return array Array of keys for json * @return array Array of keys for json
*/ */
@@ -1745,19 +1743,19 @@ class Form
if (! empty($warehouseStatus)) if (! empty($warehouseStatus))
{ {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
if (preg_match('/warehouseclosed/', $warehouseStatus)) if (preg_match('/warehouseclosed/', $warehouseStatus))
{ {
$warehouseStatusArray[] = Entrepot::STATUS_CLOSED; $warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
} }
if (preg_match('/warehouseopen/', $warehouseStatus)) if (preg_match('/warehouseopen/', $warehouseStatus))
{ {
$warehouseStatusArray[] = Entrepot::STATUS_OPEN_ALL; $warehouseStatusArray[] = Entrepot::STATUS_OPEN_ALL;
} }
if (preg_match('/warehouseinternal/', $warehouseStatus)) if (preg_match('/warehouseinternal/', $warehouseStatus))
{ {
$warehouseStatusArray[] = Entrepot::STATUS_OPEN_INTERNAL; $warehouseStatusArray[] = Entrepot::STATUS_OPEN_INTERNAL;
} }
} }
$selectFields = " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; $selectFields = " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression";
(count($warehouseStatusArray)) ? $selectFieldsGrouped = ", sum(ps.reel) as stock" : $selectFieldsGrouped = ", p.stock"; (count($warehouseStatusArray)) ? $selectFieldsGrouped = ", sum(ps.reel) as stock" : $selectFieldsGrouped = ", p.stock";
@@ -1796,7 +1794,7 @@ class Form
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.fk_product = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.fk_product = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on ps.fk_entrepot = e.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on ps.fk_entrepot = e.rowid";
} }
//Price by customer //Price by customer
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."product_customer_price as pcp ON pcp.fk_soc=".$socid." AND pcp.fk_product=p.rowid"; $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."product_customer_price as pcp ON pcp.fk_soc=".$socid." AND pcp.fk_product=p.rowid";
@@ -1863,7 +1861,7 @@ class Form
$num = $this->db->num_rows($result); $num = $this->db->num_rows($result);
$events=null; $events=null;
if ($conf->use_javascript_ajax && ! $forcecombo) if ($conf->use_javascript_ajax && ! $forcecombo)
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
@@ -1871,9 +1869,9 @@ class Form
$out.= $comboenhancement; $out.= $comboenhancement;
$nodatarole=($comboenhancement?' data-role="none"':''); $nodatarole=($comboenhancement?' data-role="none"':'');
} }
$out.='<select class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" id="'.$htmlname.'"'.$nodatarole.'>'; $out.='<select class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" id="'.$htmlname.'"'.$nodatarole.'>';
$textifempty=''; $textifempty='';
// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'. // Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
//if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
@@ -2898,7 +2896,7 @@ class Form
// Set default value if not already set by caller // Set default value if not already set by caller
if (empty($selected) && ! empty($conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID)) $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID; if (empty($selected) && ! empty($conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID)) $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID;
print '<select class="flat" name="'.$htmlname.'">'; print '<select class="flat" name="'.$htmlname.'">';
if ($addempty) print '<option value="0">&nbsp;</option>'; if ($addempty) print '<option value="0">&nbsp;</option>';
foreach($this->cache_conditions_paiements as $id => $arrayconditions) foreach($this->cache_conditions_paiements as $id => $arrayconditions)
@@ -3409,7 +3407,7 @@ class Form
// Clean parameters // Clean parameters
$newselectedchoice=empty($selectedchoice)?"no":$selectedchoice; $newselectedchoice=empty($selectedchoice)?"no":$selectedchoice;
if ($conf->browser->layout == 'phone') $width='95%'; if ($conf->browser->layout == 'phone') $width='95%';
if (is_array($formquestion) && ! empty($formquestion)) if (is_array($formquestion) && ! empty($formquestion))
{ {
// First add hidden fields and value // First add hidden fields and value
@@ -3675,7 +3673,7 @@ class Form
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
$out=''; $out='';
$formproject=new FormProjets($this->db); $formproject=new FormProjets($this->db);
$langs->load("project"); $langs->load("project");
@@ -3703,8 +3701,8 @@ class Form
$out.="&nbsp;"; $out.="&nbsp;";
} }
} }
if (empty($nooutput)) if (empty($nooutput))
{ {
print $out; print $out;
return ''; return '';
@@ -4049,7 +4047,7 @@ class Form
} }
print '</div>'; print '</div>';
} }
if ($more) if ($more)
{ {
print '<div class="inline-block">'; print '<div class="inline-block">';
print $more; print $more;
@@ -4259,7 +4257,7 @@ class Form
// Make select dynamic // Make select dynamic
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$out.= ajax_combobox($htmlname); $out.= ajax_combobox($htmlname);
return $out; return $out;
} }
@@ -4454,13 +4452,13 @@ class Form
$key.= $rate['nprtva'] ? '*': ''; $key.= $rate['nprtva'] ? '*': '';
if ($mode > 0 && $rate['code']) $key.=' ('.$rate['code'].')'; if ($mode > 0 && $rate['code']) $key.=' ('.$rate['code'].')';
if ($mode < 0) $key = $rate['rowid']; if ($mode < 0) $key = $rate['rowid'];
$return.= '<option value="'.$key.'"'; $return.= '<option value="'.$key.'"';
if (! $selectedfound) if (! $selectedfound)
{ {
if ($defaultcode) // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag if ($defaultcode) // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
{ {
if ($defaultcode == $rate['code']) if ($defaultcode == $rate['code'])
{ {
$return.= ' selected'; $return.= ' selected';
$selectedfound=true; $selectedfound=true;
@@ -4884,7 +4882,7 @@ class Form
* @param string $morecss Add more class to css styles * @param string $morecss Add more class to css styles
* @param int $addjscombo Add js combo * @param int $addjscombo Add js combo
* @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set. * @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set.
* @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.
* @return string HTML select string. * @return string HTML select string.
* @see multiselectarray * @see multiselectarray
*/ */
@@ -4906,7 +4904,7 @@ class Form
{ {
$minLengthToAutocomplete=0; $minLengthToAutocomplete=0;
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?(constant('REQUIRE_JQUERY_MULTISELECT')?constant('REQUIRE_JQUERY_MULTISELECT'):'select2'):$conf->global->MAIN_USE_JQUERY_MULTISELECT; $tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?(constant('REQUIRE_JQUERY_MULTISELECT')?constant('REQUIRE_JQUERY_MULTISELECT'):'select2'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
// Enhance with select2 // Enhance with select2
$nodatarole=''; $nodatarole='';
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
@@ -4933,7 +4931,7 @@ class Form
// Translate // Translate
if ($translate) if ($translate)
{ {
foreach($array as $key => $value) foreach($array as $key => $value)
{ {
$array[$key]=$langs->trans($value); $array[$key]=$langs->trans($value);
} }
@@ -5452,7 +5450,7 @@ class Form
$linktoelem=''; $linktoelem='';
$linktoelemlist=''; $linktoelemlist='';
if (! is_object($object->thirdparty)) $object->fetch_thirdparty(); if (! is_object($object->thirdparty)) $object->fetch_thirdparty();
$possiblelinks=array(); $possiblelinks=array();
@@ -5460,7 +5458,7 @@ class Form
{ {
$listofidcompanytoscan=$object->thirdparty->id; $listofidcompanytoscan=$object->thirdparty->id;
if (($object->thirdparty->parent > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) $listofidcompanytoscan.=','.$object->thirdparty->parent; if (($object->thirdparty->parent > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) $listofidcompanytoscan.=','.$object->thirdparty->parent;
$possiblelinks=array( $possiblelinks=array(
'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('propal',1).')'), 'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('propal',1).')'),
'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande',1).')'), 'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande',1).')'),
@@ -5472,9 +5470,9 @@ class Form
'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->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 (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture_fourn',1).')') 'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->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 (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture_fourn',1).')')
); );
} }
global $action; global $action;
// Can complet the possiblelink array // Can complet the possiblelink array
$hookmanager->initHooks(array('commonobject')); $hookmanager->initHooks(array('commonobject'));
$parameters=array(); $parameters=array();
@@ -5499,7 +5497,7 @@ class Form
$num = 0; $num = 0;
if (empty($possiblelink['enabled'])) continue; if (empty($possiblelink['enabled'])) continue;
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->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>';
@@ -5711,7 +5709,7 @@ class Form
//print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam"; //print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
$object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid,$nodbprefix); $object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid,$nodbprefix);
$navurl = $_SERVER["PHP_SELF"]; $navurl = $_SERVER["PHP_SELF"];
// Special case for project/task page // Special case for project/task page
if ($paramid == 'project_ref') if ($paramid == 'project_ref')
@@ -5753,10 +5751,10 @@ class Form
if ($conf->browser->layout == 'phone') $ret.='<div class="floatleft">'.$morehtmlleft.'</div>'; // class="center" to have photo in middle if ($conf->browser->layout == 'phone') $ret.='<div class="floatleft">'.$morehtmlleft.'</div>'; // class="center" to have photo in middle
else $ret.='<div class="inline-block floatleft">'.$morehtmlleft.'</div>'; else $ret.='<div class="inline-block floatleft">'.$morehtmlleft.'</div>';
} }
//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; //if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
$ret.='<div class="inline-block floatleft valignmiddle refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">'; $ret.='<div class="inline-block floatleft valignmiddle refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
// For thirdparty, contact, user, member, the ref is the id, so we show something else // For thirdparty, contact, user, member, the ref is the id, so we show something else
if ($object->element == 'societe') if ($object->element == 'societe')
{ {
@@ -5768,17 +5766,17 @@ class Form
} }
else if (in_array($object->element, array('action', 'agenda'))) else if (in_array($object->element, array('action', 'agenda')))
{ {
$ret.=$object->ref.'<br>'.$object->label; $ret.=$object->ref.'<br>'.$object->label;
} }
else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref);
if ($morehtmlref) if ($morehtmlref)
{ {
$ret.=' '.$morehtmlref; $ret.=' '.$morehtmlref;
} }
$ret.='</div>'; $ret.='</div>';
$ret.='</div><!-- End banner content -->'; $ret.='</div><!-- End banner content -->';
return $ret; return $ret;

View File

@@ -1001,7 +1001,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
if (get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; if (get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
if (get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; if (get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o"; if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
$sql.= " WHERE u.rowid = a.fk_user_author"; $sql.= " WHERE u.rowid = a.fk_user_action";
$sql.= " AND a.entity IN (".getEntity('agenda', 1).")"; $sql.= " AND a.entity IN (".getEntity('agenda', 1).")";
if (get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id; if (get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
if (get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id; if (get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;