Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/admin/mails_templates.php htdocs/core/actions_linkedfiles.inc.php htdocs/core/lib/functions.lib.php htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php htdocs/societe/consumption.php
This commit is contained in:
commit
bd5e141d26
@ -542,7 +542,7 @@ $cfg['ThemePerServer'] = FALSE; // allow diferent theme for each co
|
|||||||
* %f will be replaced by a list of field names.
|
* %f will be replaced by a list of field names.
|
||||||
* (%t and %f only applies to DefaultQueryTable)
|
* (%t and %f only applies to DefaultQueryTable)
|
||||||
*/
|
*/
|
||||||
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
|
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1 = 1';
|
||||||
$cfg['DefaultQueryDatabase'] = '';
|
$cfg['DefaultQueryDatabase'] = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -333,13 +333,13 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si verif ok et action add, on ajoute la ligne
|
// If previous test is ok action is add, we add the line
|
||||||
if ($ok && GETPOST('actionadd')) {
|
if ($ok && GETPOST('actionadd')) {
|
||||||
// Add new entry
|
// Add new entry
|
||||||
$sql = "INSERT INTO ".$tabname[$id]." (";
|
$sql = "INSERT INTO ".$tabname[$id]." (";
|
||||||
// List of fields
|
// List of fields
|
||||||
$sql .= $tabfieldinsert[$id];
|
$sql .= $tabfieldinsert[$id];
|
||||||
$sql .= ",active)";
|
$sql .= ", active, enabled)";
|
||||||
$sql .= " VALUES(";
|
$sql .= " VALUES(";
|
||||||
|
|
||||||
// List of values
|
// List of values
|
||||||
@ -390,7 +390,7 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$sql .= ", 1)";
|
$sql .= ", 1, 1)";
|
||||||
|
|
||||||
dol_syslog("actionadd", LOG_DEBUG);
|
dol_syslog("actionadd", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -1680,6 +1680,28 @@ class Account extends CommonObject
|
|||||||
$this->owner_address = 'Owner address';
|
$this->owner_address = 'Owner address';
|
||||||
$this->country_id = 1;
|
$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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC)) {
|
|||||||
} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC)) {
|
} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC)) {
|
||||||
$link = GETPOST('link', 'alpha');
|
$link = GETPOST('link', 'alpha');
|
||||||
if ($link) {
|
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;
|
$link = 'http://'.$link;
|
||||||
}
|
}
|
||||||
dol_add_file_process($upload_dir, 0, 1, 'userfile', null, $link, '', 0);
|
dol_add_file_process($upload_dir, 0, 1, 'userfile', null, $link, '', 0);
|
||||||
|
|||||||
@ -2029,7 +2029,7 @@ class FormFile
|
|||||||
print '<td class="center">'.dol_print_date($link->datea, "dayhour", "tzuser").'</td>';
|
print '<td class="center">'.dol_print_date($link->datea, "dayhour", "tzuser").'</td>';
|
||||||
print '<td class="center"></td>';
|
print '<td class="center"></td>';
|
||||||
print '<td class="right">';
|
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) {
|
if ($permissiontodelete) {
|
||||||
print ' <a class="deletefilelink" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&linkid='.$link->id.$param.'">'.img_delete().'</a>'; // id= is included into $param
|
print ' <a class="deletefilelink" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&linkid='.$link->id.$param.'">'.img_delete().'</a>'; // id= is included into $param
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -9386,7 +9386,8 @@ function getDictvalue($tablename, $field, $id, $checkentity = false, $rowidfield
|
|||||||
|
|
||||||
if (!isset($dictvalues[$tablename])) {
|
if (!isset($dictvalues[$tablename])) {
|
||||||
$dictvalues[$tablename] = array();
|
$dictvalues[$tablename] = array();
|
||||||
$sql = 'SELECT * FROM '.$tablename.' WHERE 1'; // Here select * is allowed as it is generic code and we don't have list of fields
|
|
||||||
|
$sql = 'SELECT * FROM '.$tablename.' WHERE 1 = 1'; // Here select * is allowed as it is generic code and we don't have list of fields
|
||||||
if ($checkentity) {
|
if ($checkentity) {
|
||||||
$sql .= ' AND entity IN (0,'.getEntity($tablename).')';
|
$sql .= ' AND entity IN (0,'.getEntity($tablename).')';
|
||||||
}
|
}
|
||||||
@ -9675,6 +9676,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
|
|||||||
$class = 'butAction';
|
$class = 'butAction';
|
||||||
if ($actionType == 'danger' || $actionType == 'delete') {
|
if ($actionType == 'danger' || $actionType == 'delete') {
|
||||||
$class = 'butActionDelete';
|
$class = 'butActionDelete';
|
||||||
|
if (strpos($url, 'token=') === false) $url .= '&token='.newToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
$attr = array(
|
$attr = array(
|
||||||
|
|||||||
@ -231,10 +231,10 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$objphoto->fetch($object->lines[$i]->fk_product);
|
$objphoto->fetch($object->lines[$i]->fk_product);
|
||||||
|
|
||||||
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
|
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
|
||||||
$pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/";
|
$pdir = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/";
|
||||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||||
} else {
|
} else {
|
||||||
$pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
|
$pdir = get_exdir($objphoto->id, 0, 0, 0, $objphoto, 'product');
|
||||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -246,13 +246,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$objphoto->fetch($object->lines[$i]->fk_product);
|
$objphoto->fetch($object->lines[$i]->fk_product);
|
||||||
|
|
||||||
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
|
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
|
||||||
$pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/";
|
$pdir = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/";
|
||||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||||
} else {
|
} else {
|
||||||
$pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
|
$pdir = get_exdir($objphoto->id, 0, 0, 0, $objphoto, 'product');
|
||||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||||
}
|
}
|
||||||
|
|
||||||
$realpath = '';
|
$realpath = '';
|
||||||
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
|
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
|
||||||
$filename = $obj['photo'];
|
$filename = $obj['photo'];
|
||||||
|
|||||||
@ -587,4 +587,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;
|
-- 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;
|
-- VPGSQL8.2 ALTER TABLE llx_accounting_bookkeeping ALTER COLUMN montant DROP NOT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64);
|
||||||
|
|
||||||
|
|||||||
@ -270,7 +270,8 @@ if (empty($reshook)) {
|
|||||||
'Product' => '/product/class/product.class.php',
|
'Product' => '/product/class/product.class.php',
|
||||||
'Project' => '/projet/class/project.class.php',
|
'Project' => '/projet/class/project.class.php',
|
||||||
'Ticket' => '/ticket/class/ticket.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
|
//First, all core objects must update their tables
|
||||||
|
|||||||
@ -352,7 +352,7 @@ if (!empty($sql_select)) {
|
|||||||
$sql .= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'";
|
$sql .= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'";
|
||||||
}
|
}
|
||||||
if ($sprod_fulldescr) {
|
if ($sprod_fulldescr) {
|
||||||
$sql .= " AND (d.description LIKE '%".$db->escape($sprod_fulldescr)."%'";
|
$sql .= " AND (d.description LIKE '%".$db->escape($sprod_fulldescr)."%' OR d.description LIKE '%".$db->escape(dol_htmlentities($sprod_fulldescr))."%'";
|
||||||
if (GETPOST('type_element') != 'fichinter') {
|
if (GETPOST('type_element') != 'fichinter') {
|
||||||
$sql .= " OR p.ref LIKE '%".$db->escape($sprod_fulldescr)."%'";
|
$sql .= " OR p.ref LIKE '%".$db->escape($sprod_fulldescr)."%'";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3399,7 +3399,7 @@ class User extends CommonObject
|
|||||||
$sql .= " WHERE t.entity IN (".getEntity('user').")";
|
$sql .= " WHERE t.entity IN (".getEntity('user').")";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$sql .= " WHERE 1";
|
$sql .= " WHERE 1 = 1";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Manage filter
|
// Manage filter
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user