Skip to content

Commit

Permalink
Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 11, 2018
2 parents d5d6939 + f98ca2e commit 95e7062
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 15 deletions.
21 changes: 12 additions & 9 deletions htdocs/contact/class/contact.class.php
Expand Up @@ -991,9 +991,10 @@ function getNbOfEMailings()
* @param string $option Where the link point to
* @param int $maxlen Max length of
* @param string $moreparam Add more param into URL
* @param int $notooltip 1=Disable tooltip
* @return string String with URL
*/
function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='')
function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='',$notooltip=0)
{
global $conf, $langs, $hookmanager;

Expand All @@ -1012,13 +1013,15 @@ function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='')

$link = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'"';
$linkclose="";
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowContact");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.= ' class="classfortooltip">';
if (empty($notooltip)) {
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowContact");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.= ' class="classfortooltip"';
}

if (! is_object($hookmanager))
{
Expand All @@ -1030,7 +1033,7 @@ function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='')
$reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) $linkclose = $hookmanager->resPrint;

$link.=$linkclose;
$link.=$linkclose.'>';

$linkend='</a>';

Expand Down
12 changes: 11 additions & 1 deletion htdocs/core/class/html.formfile.class.php
Expand Up @@ -1018,7 +1018,17 @@ function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownlo
// Get list of files stored into database for same relative directory
if ($relativedir)
{
$filearrayindatabase = dol_dir_list_in_database($relativedir, '', null, 'name', SORT_ASC);
$filearrayindatabase = dol_dir_list_in_database($relativedir, '', null, 'name', SORT_ASC);

if($modulepart == 'produit' && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && ! empty($object->id)) {
if (! empty($conf->product->enabled)) $upload_dirold = $conf->product->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2),1,1).'/'.substr(substr("000".$object->id, -2),0,1).'/'.$object->id."/photos";
else $upload_dirold = $conf->service->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2),1,1).'/'.substr(substr("000".$object->id, -2),0,1).'/'.$object->id."/photos";

$relativedirold = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $upload_dirold);
$relativedirold = preg_replace('/^[\\/]/','',$relativedirold);

$filearrayindatabase = array_merge($filearrayindatabase, dol_dir_list_in_database($relativedirold, '', null, 'name', SORT_ASC));
}

//var_dump($filearray);
//var_dump($filearrayindatabase);
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/modules/mailings/advthirdparties.modules.php
Expand Up @@ -100,7 +100,7 @@ function add_to_target_spec($mailing_id,$socid,$type_of_target, $contactid)
'source_url' => $this->url($obj->id,'thirdparty'),
'source_id' => $obj->id,
'source_type' => 'thirdparty'
);
);
}
}

Expand Down Expand Up @@ -289,11 +289,11 @@ function url($id,$type)
if ($type=='thirdparty') {
$companystatic=new Societe($this->db);
$companystatic->fetch($id);
return $companystatic->getNomUrl(0);
return $companystatic->getNomUrl(0,'',0,1);
} elseif ($type=='contact') {
$contactstatic=new Contact($this->db);
$contactstatic->fetch($id);
return $contactstatic->getNomUrl(0);
return $contactstatic->getNomUrl(0,'',0,'',1);
}
}

Expand Down
9 changes: 7 additions & 2 deletions htdocs/societe/card.php
Expand Up @@ -10,6 +10,7 @@
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -291,11 +292,15 @@
// Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
if ($ret < 0) $error++;
if ($ret < 0) { $error++; }
if (! $error)
{
$result = $object->insertExtraFields();
if ($result < 0) $error++;
if ($result < 0)
{
$error++;
$errors = $object->errors;
}
}
if ($error) $action = 'edit_extras';
}
Expand Down

0 comments on commit 95e7062

Please sign in to comment.