Skip to content

Commit

Permalink
Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/core/class/commonobject.class.php
	htdocs/core/class/extrafields.class.php
	htdocs/cron/list.php
  • Loading branch information
eldy committed Apr 5, 2018
2 parents 1b1a8f7 + 08ab672 commit eeb2d5a
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 34 deletions.
8 changes: 4 additions & 4 deletions htdocs/admin/modules.php
Expand Up @@ -79,9 +79,9 @@

$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/';
Expand Down Expand Up @@ -462,7 +462,7 @@
{
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.'">';
Expand Down
11 changes: 0 additions & 11 deletions htdocs/admin/payment.php
Expand Up @@ -257,17 +257,6 @@
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>';
Expand Down
12 changes: 10 additions & 2 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -1428,19 +1428,24 @@ function setValueFrom($field, $value, $table='', $id=null, $format='', $id_field
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);
Expand Down Expand Up @@ -2437,11 +2442,13 @@ function update_note($note,$suffix='')

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;
}
Expand Down Expand Up @@ -4991,6 +4998,7 @@ function updateExtraField($key, $trigger, $userused)

if ($error)
{
dol_syslog(get_class($this) . "::".__METHOD__ . $this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/class/extrafields.class.php
Expand Up @@ -740,6 +740,7 @@ function fetch_name_optionals_label($elementtype,$forceload=false)
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))
{
Expand All @@ -757,8 +758,7 @@ function fetch_name_optionals_label($elementtype,$forceload=false)
// 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."'";
Expand Down
18 changes: 12 additions & 6 deletions htdocs/core/lib/company.lib.php
Expand Up @@ -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');
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -933,17 +934,22 @@ 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.='&amp;search_status='.$search_status;
if ($search_name != '') $param.='&amp;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";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
$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";

Expand Down Expand Up @@ -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&amp;id='.$obj->rowid.'&amp;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>';
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/expensereport/card.php
Expand Up @@ -2090,7 +2090,7 @@
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>';
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/expensereport/class/expensereport.class.php
Expand Up @@ -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();
Expand Down
11 changes: 4 additions & 7 deletions htdocs/societe/class/societe.class.php
Expand Up @@ -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);

Expand Down

0 comments on commit eeb2d5a

Please sign in to comment.