Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/core/class/commonobject.class.php htdocs/core/class/extrafields.class.php htdocs/cron/list.php
This commit is contained in:
commit
eeb2d5a4da
@ -79,9 +79,9 @@ $familyinfo=array(
|
||||
|
||||
$param='';
|
||||
if ($search_keyword) $param.='&search_keyword='.urlencode($search_keyword);
|
||||
if ($search_status > -1) $param.='&search_status='.urlencode($search_status);
|
||||
if ($search_nature > -1) $param.='&search_nature='.urlencode($search_nature);
|
||||
if ($search_version > -1) $param.='&search_version='.urlencode($search_version);
|
||||
if ($search_status && $search_status != '-1') $param.='&search_status='.urlencode($search_status);
|
||||
if ($search_nature && $search_nature != '-1') $param.='&search_nature='.urlencode($search_nature);
|
||||
if ($search_version && $search_version != '-1') $param.='&search_version='.urlencode($search_version);
|
||||
|
||||
$dirins=DOL_DOCUMENT_ROOT.'/custom';
|
||||
$urldolibarrmodules='https://www.dolistore.com/';
|
||||
@ -462,7 +462,7 @@ if ($mode == 'common')
|
||||
{
|
||||
dol_set_focus('#search_keyword');
|
||||
|
||||
print '<form method="GET" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
|
||||
@ -257,17 +257,6 @@ print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS",$con
|
||||
print '</td><td align="right">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Add js auto fill amount on paiement form
|
||||
/* always on now
|
||||
$var=! $var;
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("JSOnPaimentBill");
|
||||
print '</td><td width="60" align="center">';
|
||||
print $form->selectyesno("INVOICE_AUTO_FILLJS",$conf->global->INVOICE_AUTO_FILLJS,1);
|
||||
print '</td><td align="right">';
|
||||
print "</td></tr>\n";
|
||||
*/
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<center>';
|
||||
|
||||
@ -1428,19 +1428,24 @@ abstract class CommonObject
|
||||
if (empty($format)) $format='text';
|
||||
if (empty($id_field)) $id_field='rowid';
|
||||
|
||||
$fk_user_field = 'fk_user_modif';
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Special case
|
||||
if ($table == 'product' && $field == 'note_private') $field='note';
|
||||
if (in_array($table, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
|
||||
$fk_user_field = 'fk_user_mod';
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET ";
|
||||
if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'";
|
||||
else if ($format == 'int') $sql.= $field." = ".$this->db->escape($value);
|
||||
else if ($format == 'date') $sql.= $field." = ".($value ? "'".$this->db->idate($value)."'" : "null");
|
||||
if (! empty($fuser) && is_object($fuser)) $sql.=", fk_user_modif = ".$fuser->id;
|
||||
elseif (empty($fuser) || $fuser != 'none') $sql.=", fk_user_modif = ".$user->id;
|
||||
if (! empty($fuser) && is_object($fuser)) $sql.=", ".$fk_user_field." = ".$fuser->id;
|
||||
elseif (empty($fuser) || $fuser != 'none') $sql.=", ".$fk_user_field." = ".$user->id;
|
||||
$sql.= " WHERE ".$id_field." = ".$id;
|
||||
|
||||
dol_syslog(get_class($this)."::".__FUNCTION__."", LOG_DEBUG);
|
||||
@ -2437,11 +2442,13 @@ abstract class CommonObject
|
||||
|
||||
if (! $this->table_element)
|
||||
{
|
||||
$this->error='update_note was called on objet with property table_element not defined';
|
||||
dol_syslog(get_class($this)."::update_note was called on objet with property table_element not defined", LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
if (! in_array($suffix,array('','_public','_private')))
|
||||
{
|
||||
$this->error='update_note Parameter suffix must be empty, \'_private\' or \'_public\'';
|
||||
dol_syslog(get_class($this)."::update_note Parameter suffix must be empty, '_private' or '_public'", LOG_ERR);
|
||||
return -2;
|
||||
}
|
||||
@ -4991,6 +4998,7 @@ abstract class CommonObject
|
||||
|
||||
if ($error)
|
||||
{
|
||||
dol_syslog(get_class($this) . "::".__METHOD__ . $this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -740,6 +740,7 @@ class ExtraFields
|
||||
if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return $array_name_label;
|
||||
|
||||
// Set array of label of entity
|
||||
// TODO Remove completely loading of label. This should be done by presentation.
|
||||
$labelmulticompany=array();
|
||||
if (!empty($conf->multicompany->enabled))
|
||||
{
|
||||
@ -757,8 +758,7 @@ class ExtraFields
|
||||
// We should not have several time this log. If we have, there is some optimization to do by calling a simple $object->fetch_optionals() that include cache management.
|
||||
dol_syslog("fetch_name_optionals_label elementtype=".$elementtype);
|
||||
|
||||
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,fielddefault,fieldcomputed";
|
||||
$sql.= ",entity";
|
||||
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,fielddefault,fieldcomputed,entity";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."extrafields";
|
||||
$sql.= " WHERE entity IN (0,".$conf->entity.")";
|
||||
if ($elementtype) $sql.= " AND elementtype = '".$elementtype."'";
|
||||
|
||||
@ -835,6 +835,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST('page','int');
|
||||
@ -886,7 +887,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
{
|
||||
if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha');
|
||||
}
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
@ -933,9 +934,12 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print "\n".'<table class="tagtable liste">'."\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 '<a href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
@ -2090,7 +2090,7 @@ else
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
print '<td>';
|
||||
$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 '</td>';
|
||||
}
|
||||
|
||||
|
||||
@ -1241,7 +1241,7 @@ class ExpenseReport extends CommonObject
|
||||
$error = 0;
|
||||
|
||||
// date approval
|
||||
$this->date_approve = $this->db->idate($now);
|
||||
$this->date_approve = $now;
|
||||
if ($this->fk_statut != 5)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
@ -2694,18 +2694,15 @@ class Societe extends CommonObject
|
||||
|
||||
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);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user