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

This commit is contained in:
Laurent Destailleur 2021-05-06 16:59:06 +02:00
commit 3090c124f0
6 changed files with 28 additions and 4 deletions

View File

@ -1676,6 +1676,28 @@ class Account extends CommonObject
$this->owner_address = 'Owner address';
$this->country_id = 1;
}
/**
* Function used to replace a thirdparty id with another one.
*
* @param DoliDB $db Database handler
* @param int $origin_id Old thirdparty id
* @param int $dest_id New thirdparty id
* @return bool
*/
public static function replaceThirdparty($db, $origin_id, $dest_id)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."bank_url SET url_id = ".((int) $dest_id)." WHERE url_id = ".((int) $origin_id)." AND type='company'";
if (!$db->query($sql))
{
//if ($ignoreerrors) return true; // TODO Not enough. If there is A-B on kept thirdarty and B-C on old one, we must get A-B-C after merge. Not A-B.
//$this->errors = $db->lasterror();
return false;
} else {
return true;
}
}
}

View File

@ -68,7 +68,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC))
$link = GETPOST('link', 'alpha');
if ($link)
{
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://') {
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://' && substr($link, 0, 7) != 'davs://') {
$link = 'http://'.$link;
}
dol_add_file_process($upload_dir, 0, 1, 'userfile', null, $link, '', 0);

View File

@ -1870,7 +1870,7 @@ class FormFile
print '<td class="center">'.dol_print_date($link->datea, "dayhour", "tzuser").'</td>';
print '<td class="center"></td>';
print '<td class="right">';
print '<a href="'.$_SERVER['PHP_SELF'].'?action=update&linkid='.$link->id.$param.'" class="editfilelink editfielda reposition" >'.img_edit().'</a>'; // id= is included into $param
print '<a href="'.$_SERVER['PHP_SELF'].'?action=update&linkid='.$link->id.$param.'&token='.newToken().'" class="editfilelink editfielda reposition" >'.img_edit().'</a>'; // id= is included into $param
if ($permissiontodelete) {
print ' &nbsp; <a class="deletefilelink" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&linkid='.$link->id.$param.'">'.img_delete().'</a>'; // id= is included into $param
} else {

View File

@ -583,4 +583,5 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, active, position)
-- VMYSQL4.3 ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN montant double(24,8) NULL;
-- VPGSQL8.2 ALTER TABLE llx_accounting_bookkeeping ALTER COLUMN montant DROP NOT NULL;
ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64);

View File

@ -24,7 +24,7 @@ create table llx_export_model
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_user integer DEFAULT 0 NOT NULL,
label varchar(50) NOT NULL,
type varchar(20) NOT NULL,
type varchar(64) NOT NULL,
field text NOT NULL,
filter text

View File

@ -254,7 +254,8 @@ if (empty($reshook))
'Product' => '/product/class/product.class.php',
'Project' => '/projet/class/project.class.php',
'Ticket' => '/ticket/class/ticket.class.php',
'User' => '/user/class/user.class.php'
'User' => '/user/class/user.class.php',
'Account' => '/compta/bank/class/account.class.php',
);
//First, all core objects must update their tables