Skip to content

Commit

Permalink
Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 10.0
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/categories/index.php
	htdocs/comm/action/list.php
	htdocs/comm/action/rapport/index.php
	htdocs/compta/paiement.php
	htdocs/compta/sociales/document.php
	htdocs/compta/tva/document.php
	htdocs/core/actions_massactions.inc.php
	htdocs/core/class/commonobject.class.php
	htdocs/fourn/facture/paiement.php
	htdocs/loan/document.php
	htdocs/main.inc.php
  • Loading branch information
eldy committed Jun 4, 2019
2 parents 79a3e41 + ba68e3d commit 21a1e0d
Show file tree
Hide file tree
Showing 21 changed files with 62 additions and 42 deletions.
6 changes: 5 additions & 1 deletion htdocs/categories/index.php
Expand Up @@ -65,7 +65,11 @@

llxHeader('', $title, '', '', 0, 0, $arrayofjs, $arrayofcss);

$newcardbutton.= dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/categories/card.php?action=create&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type));

$newcardbutton='';
if (! empty($user->rights->categorie->creer)) {
$newcardbutton.= dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/categories/card.php?action=create&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type));
}

print load_fiche_titre($title, $newcardbutton);

Expand Down
4 changes: 2 additions & 2 deletions htdocs/comm/propal/card.php
Expand Up @@ -321,7 +321,7 @@

$datep = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$date_delivery = dol_mktime(12, 0, 0, GETPOST('date_livraisonmonth'), GETPOST('date_livraisonday'), GETPOST('date_livraisonyear'));
$duration = GETPOST('duree_validite');
$duration = GETPOST('duree_validite', 'int');

if (empty($datep)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
Expand Down Expand Up @@ -1622,7 +1622,7 @@
print '</td></tr>';

// Validaty duration
print '<tr><td class="fieldrequired">' . $langs->trans("ValidityDuration") . '</td><td><input name="duree_validite" size="5" value="' . $conf->global->PROPALE_VALIDITY_DURATION . '"> ' . $langs->trans("days") . '</td></tr>';
print '<tr><td class="fieldrequired">' . $langs->trans("ValidityDuration") . '</td><td><input name="duree_validite" class="width50" value="' . (GETPOST('duree_validite', 'int') ? GETPOST('duree_validite', 'int') : $conf->global->PROPALE_VALIDITY_DURATION) . '"> ' . $langs->trans("days") . '</td></tr>';

// Terms of payment
print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
Expand Down
5 changes: 3 additions & 2 deletions htdocs/compta/facture/card.php
Expand Up @@ -1408,8 +1408,9 @@
{
// Don't add lines with qty 0 when coming from a shipment including all order lines
if($srcobject->element == 'shipping' && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS && $lines[$i]->qty == 0) continue;
// Don't add closed lines when coming from a contract
if($srcobject->element == 'contrat' && $lines[$i]->statut == 5) continue;
// Don't add closed lines when coming from a contract (Set constant to '0,5' to exclude also inactive lines)
if (! isset( $conf->global->CONTRACT_EXCLUDE_SERVICES_STATUS_FOR_INVOICE)) $conf->global->CONTRACT_EXCLUDE_SERVICES_STATUS_FOR_INVOICE = '5';
if ($srcobject->element == 'contrat' && in_array($lines[$i]->statut, explode(',', $conf->global->CONTRACT_EXCLUDE_SERVICES_STATUS_FOR_INVOICE))) continue;

$label=(! empty($lines[$i]->label)?$lines[$i]->label:'');
$desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/paiement.php
Expand Up @@ -848,7 +848,7 @@ function callForResult(imgId)
*/
if (! GETPOST('action', 'aZ09'))
{
if ($page == -1) $page = 0 ;
if (empty($page) || $page == -1) $page = 0;
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$offset = $limit * $page ;

Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/sociales/document.php
Expand Up @@ -55,7 +55,7 @@
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == -1) {
if (empty($page) || $page == -1) {
$page = 0;
}
$offset = $conf->liste_limit * $page;
Expand Down
3 changes: 2 additions & 1 deletion htdocs/compta/tva/document.php
Expand Up @@ -56,9 +56,10 @@
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == -1) {
if (empty($page) || $page == -1) {
$page = 0;
}

$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
Expand Down
12 changes: 7 additions & 5 deletions htdocs/core/actions_massactions.inc.php
Expand Up @@ -563,14 +563,16 @@

$objecttmp->socid = $cmd->socid;
$objecttmp->type = Facture::TYPE_STANDARD;
$objecttmp->cond_reglement_id = $cmd->cond_reglement_id;
$objecttmp->mode_reglement_id = $cmd->mode_reglement_id;
$objecttmp->fk_project = $cmd->fk_project;
$objecttmp->cond_reglement_id = $cmd->cond_reglement_id;
$objecttmp->mode_reglement_id = $cmd->mode_reglement_id;
$objecttmp->fk_project = $cmd->fk_project;
$objecttmp->multicurrency_code = $cmd->multicurrency_code;
if (empty($createbills_onebythird)) $objecttmp->ref_client = $cmd->ref_client;

$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
$datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
if (empty($datefacture))
{
$datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y"));
$datefacture = dol_now();
}

$objecttmp->date = $datefacture;
Expand Down
9 changes: 7 additions & 2 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -3887,6 +3887,7 @@ public function formAddObjectLine($dateSelector, $seller, $buyer, $defaulttpldir
{
$tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_create.tpl.php';
}

if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
Expand Down Expand Up @@ -4087,6 +4088,7 @@ public function printObjectLine($action, $line, $var, $num, $i, $dateSelector, $
{
$tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_view.tpl.php';
}

if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
Expand Down Expand Up @@ -4117,6 +4119,7 @@ public function printObjectLine($action, $line, $var, $num, $i, $dateSelector, $
{
$tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_edit.tpl.php';
}

if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
Expand Down Expand Up @@ -4192,9 +4195,10 @@ public function printOriginLinesList($restrictlist = '')
* @param CommonObjectLine $line Line
* @param string $var Var
* @param string $restrictlist ''=All lines, 'services'=Restrict to services only (strike line if not)
* @param string $defaulttpldir Directory where to find the template
* @return void
*/
public function printOriginLine($line, $var, $restrictlist = '')
public function printOriginLine($line, $var, $restrictlist = '', $defaulttpldir = '/core/tpl')
{
global $langs, $conf;

Expand Down Expand Up @@ -4315,7 +4319,7 @@ public function printOriginLine($line, $var, $restrictlist = '')

// Output template part (modules that overwrite templates must declare this into descriptor)
// Use global variables + $dateSelector + $seller and $buyer
$dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
$dirtpls=array_merge($conf->modules_parts['tpl'], array($defaulttpldir));
foreach($dirtpls as $module => $reldir)
{
if (!empty($module))
Expand All @@ -4326,6 +4330,7 @@ public function printOriginLine($line, $var, $restrictlist = '')
{
$tpl = DOL_DOCUMENT_ROOT.$reldir.'/originproductline.tpl.php';
}

if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/modules/modReceiptPrinter.class.php
Expand Up @@ -136,8 +136,8 @@ public function init($options = '')
// Clean before activation
$this->remove($options);
$sql = array(
"CREATE TABLE IF NOT EXISTS llx_printer_receipt (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), fk_type integer, fk_profile integer, parameter varchar(128), entity integer) ENGINE=innodb;",
"CREATE TABLE IF NOT EXISTS llx_printer_receipt_template (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), template text, entity integer) ENGINE=innodb;",
"CREATE TABLE IF NOT EXISTS ".MAIN_DB_PREFIX."printer_receipt (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), fk_type integer, fk_profile integer, parameter varchar(128), entity integer) ENGINE=innodb;",
"CREATE TABLE IF NOT EXISTS ".MAIN_DB_PREFIX."printer_receipt_template (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), template text, entity integer) ENGINE=innodb;",
);
return $this->_init($sql, $options);
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/modStock.class.php
Expand Up @@ -345,7 +345,7 @@ public function __construct($db)
'ps.fk_product'=>"PREF123456",'ps.fk_entrepot'=>"ALM001",'ps.reel'=>"10"
);
$this->import_run_sql_after_array[$r]=array( // Because we may change data that are denormalized, we must update dernormalized data after.
'UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps WHERE ps.fk_product = p.rowid);'
'UPDATE '.MAIN_DB_PREFIX.'product p SET p.stock= (SELECT SUM(ps.reel) FROM '.MAIN_DB_PREFIX.'product_stock ps WHERE ps.fk_product = p.rowid);'
);
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/fourn/facture/paiement.php
Expand Up @@ -799,7 +799,7 @@ function callForResult(imgId)
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page=GETPOST("page", 'int');
if ($page == -1 || $page == null) { $page = 0 ; }
if (empty($page) || $page == -1) { $page = 0; }
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/hrm/admin/admin_establishment.php
Expand Up @@ -54,7 +54,7 @@
if (!$sortorder) $sortorder="DESC";
if (!$sortfield) $sortfield="e.rowid";

if ($page == -1) {
if (empty($page) || $page == -1) {
$page = 0 ;
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/repair.php
Expand Up @@ -847,7 +847,7 @@
if ($resql2)
{
// We update product_stock, so we must field stock into product too.
$sql3='UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps WHERE ps.fk_product = p.rowid)';
$sql3='UPDATE '.MAIN_DB_PREFIX.'product p SET p.stock= (SELECT SUM(ps.reel) FROM '.MAIN_DB_PREFIX.'product_stock ps WHERE ps.fk_product = p.rowid)';
$resql3=$db->query($sql3);
if (! $resql3)
{
Expand Down
22 changes: 11 additions & 11 deletions htdocs/install/upgrade2.php
Expand Up @@ -699,8 +699,8 @@ function migrate_paiements_orphelins_1($db, $langs, $conf)
$sql = "SELECT distinct p.rowid, p.datec, p.amount as pamount, bu.fk_bank, b.amount as bamount,";
$sql.= " bu2.url_id as socid";
$sql.= " FROM (".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."bank_url as bu, ".MAIN_DB_PREFIX."bank as b)";
$sql.= " LEFT JOIN llx_paiement_facture as pf ON pf.fk_paiement = p.rowid";
$sql.= " LEFT JOIN llx_bank_url as bu2 ON (bu.fk_bank=bu2.fk_bank AND bu2.type = 'company')";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON pf.fk_paiement = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON (bu.fk_bank=bu2.fk_bank AND bu2.type = 'company')";
$sql.= " WHERE pf.rowid IS NULL AND (p.rowid=bu.url_id AND bu.type='payment') AND bu.fk_bank = b.rowid";
$sql.= " AND b.rappro = 1";
$sql.= " AND (p.fk_facture = 0 OR p.fk_facture IS NULL)";
Expand Down Expand Up @@ -826,8 +826,8 @@ function migrate_paiements_orphelins_2($db, $langs, $conf)
$sql = "SELECT distinct p.rowid, p.datec, p.amount as pamount, bu.fk_bank, b.amount as bamount,";
$sql.= " bu2.url_id as socid";
$sql.= " FROM (".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."bank_url as bu, ".MAIN_DB_PREFIX."bank as b)";
$sql.= " LEFT JOIN llx_paiement_facture as pf ON pf.fk_paiement = p.rowid";
$sql.= " LEFT JOIN llx_bank_url as bu2 ON (bu.fk_bank = bu2.fk_bank AND bu2.type = 'company')";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON pf.fk_paiement = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON (bu.fk_bank = bu2.fk_bank AND bu2.type = 'company')";
$sql.= " WHERE pf.rowid IS NULL AND (p.fk_bank = bu.fk_bank AND bu.type = 'payment') AND bu.fk_bank = b.rowid";
$sql.= " AND (p.fk_facture = 0 OR p.fk_facture IS NULL)";

Expand Down Expand Up @@ -1143,7 +1143,7 @@ function migrate_contracts_date1($db, $langs, $conf)
print '<br>';
print '<b>'.$langs->trans('MigrationContractsEmptyDatesUpdate')."</b><br>\n";

$sql="update llx_contrat set date_contrat=tms where date_contrat is null";
$sql="update ".MAIN_DB_PREFIX."contrat set date_contrat=tms where date_contrat is null";
dolibarr_install_syslog("upgrade2::migrate_contracts_date1");
$resql = $db->query($sql);
if (! $resql) dol_print_error($db);
Expand All @@ -1152,7 +1152,7 @@ function migrate_contracts_date1($db, $langs, $conf)
else
print $langs->trans('MigrationContractsEmptyDatesNothingToUpdate')."<br>\n";

$sql="update llx_contrat set datec=tms where datec is null";
$sql="update ".MAIN_DB_PREFIX."contrat set datec=tms where datec is null";
dolibarr_install_syslog("upgrade2::migrate_contracts_date1");
$resql = $db->query($sql);
if (! $resql) dol_print_error($db);
Expand Down Expand Up @@ -1243,7 +1243,7 @@ function migrate_contracts_date3($db, $langs, $conf)
print '<br>';
print '<b>'.$langs->trans('MigrationContractsIncoherentCreationDateUpdate')."</b><br>\n";

$sql="update llx_contrat set datec=date_contrat where datec is null or datec > date_contrat";
$sql="update ".MAIN_DB_PREFIX."contrat set datec=date_contrat where datec is null or datec > date_contrat";
dolibarr_install_syslog("upgrade2::migrate_contracts_date3");
$resql = $db->query($sql);
if (! $resql) dol_print_error($db);
Expand All @@ -1270,7 +1270,7 @@ function migrate_contracts_open($db, $langs, $conf)
print '<br>';
print '<b>'.$langs->trans('MigrationReopeningContracts')."</b><br>\n";

$sql = "SELECT c.rowid as cref FROM llx_contrat as c, llx_contratdet as cd";
$sql = "SELECT c.rowid as cref FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."contratdet as cd";
$sql.= " WHERE cd.statut = 4 AND c.statut=2 AND c.rowid=cd.fk_contrat";
dolibarr_install_syslog("upgrade2::migrate_contracts_open");
$resql = $db->query($sql);
Expand Down Expand Up @@ -2003,7 +2003,7 @@ function migrate_modeles($db, $langs, $conf)
if (count($modellist)==0)
{
// Aucun model par defaut.
$sql=" insert into llx_document_model(nom,type) values('crabe','invoice')";
$sql=" insert into ".MAIN_DB_PREFIX."document_model(nom,type) values('crabe','invoice')";
$resql = $db->query($sql);
if (! $resql) dol_print_error($db);
}
Expand All @@ -2016,7 +2016,7 @@ function migrate_modeles($db, $langs, $conf)
if (count($modellist)==0)
{
// Aucun model par defaut.
$sql=" insert into llx_document_model(nom,type) values('einstein','order')";
$sql=" insert into ".MAIN_DB_PREFIX."document_model(nom,type) values('einstein','order')";
$resql = $db->query($sql);
if (! $resql) dol_print_error($db);
}
Expand All @@ -2029,7 +2029,7 @@ function migrate_modeles($db, $langs, $conf)
if (count($modellist)==0)
{
// Aucun model par defaut.
$sql=" insert into llx_document_model(nom,type) values('rouget','shipping')";
$sql=" insert into ".MAIN_DB_PREFIX."document_model(nom,type) values('rouget','shipping')";
$resql = $db->query($sql);
if (! $resql) dol_print_error($db);
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/loan/document.php
Expand Up @@ -47,7 +47,7 @@
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == -1) {
if (empty($page) || $page == -1) {
$page = 0;
}
$offset = $conf->liste_limit * $page;
Expand Down
8 changes: 7 additions & 1 deletion htdocs/main.inc.php
Expand Up @@ -401,13 +401,19 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type)
if (GETPOSTISSET('disablemodules')) $_SESSION["disablemodules"]=GETPOST('disablemodules', 'alpha');
if (! empty($_SESSION["disablemodules"]))
{
$modulepartkeys = array('css', 'js', 'tabs', 'triggers', 'login', 'substitutions', 'menus', 'theme', 'sms', 'tpl', 'barcode', 'models', 'societe', 'hooks', 'dir', 'syslog', 'tpllinkable', 'contactelement', 'moduleforexternal');

$disabled_modules=explode(',', $_SESSION["disablemodules"]);
foreach($disabled_modules as $module)
{
if ($module)
{
if (empty($conf->$module)) $conf->$module=new stdClass();
if (empty($conf->$module)) $conf->$module=new stdClass(); // To avoid warnings
$conf->$module->enabled=false;
foreach($modulepartkeys as $modulepartkey)
{
unset($conf->modules_parts[$modulepartkey][$module]);
}
if ($module == 'fournisseur') // Special case
{
$conf->supplier_order->enabled=0;
Expand Down
6 changes: 4 additions & 2 deletions htdocs/resource/class/dolresource.class.php
Expand Up @@ -547,13 +547,13 @@ public function fetch_all($sortorder, $sortfield, $limit, $offset, $filter = '')
if ($limit) $sql.= $this->db->plimit($limit, $offset);
dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG);

$this->lines=array();
$resql=$this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
if ($num)
{
$this->lines=array();
while ($obj = $this->db->fetch_object($resql))
{
$line = new Dolresource($this->db);
Expand Down Expand Up @@ -853,6 +853,8 @@ public function getElementResources($element, $element_id, $resource_type = '')
$sql .= ' ORDER BY resource_type';

dol_syslog(get_class($this)."::getElementResources", LOG_DEBUG);

$resources = array();
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -904,7 +906,7 @@ public function load_cache_code_type_resource()
// phpcs:enable
global $langs;

if (count($this->cache_code_type_resource)) return 0; // Cache deja charge
if (is_array($this->cache_code_type_resource) && count($this->cache_code_type_resource)) return 0; // Cache deja charge

$sql = "SELECT rowid, code, label, active";
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_resource";
Expand Down
2 changes: 0 additions & 2 deletions htdocs/resource/class/html.formresource.class.php
Expand Up @@ -93,8 +93,6 @@ public function select_resource_list($selected = '', $htmlname = 'fk_resource',
$out = '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$out.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
}
//$out.= '<input type="hidden" name="action" value="search">';
//$out.= '<input type="hidden" name="id" value="'.$theme->id.'">';

if ($resourcestat)
{
Expand Down
3 changes: 1 addition & 2 deletions htdocs/resource/list.php
Expand Up @@ -94,8 +94,7 @@

$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$page = GETPOST("page");
$page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page;
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/societe/notify/index.php
Expand Up @@ -41,7 +41,7 @@
$sortfield="s.nom";
}

if ($page == -1 || $page == null) { $page = 0 ; }
if (empty($page) || $page == -1) { $page = 0 ; }

$offset = $conf->liste_limit * $page ;
$pageprev = $page - 1;
Expand Down
4 changes: 3 additions & 1 deletion htdocs/website/class/website.class.php
Expand Up @@ -892,6 +892,7 @@ public function exportWebSite()

// Warning: We must keep llx_ here. It is a generic SQL.
$line = 'INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, image, keywords, status, date_creation, tms, lang, import_key, grabbed_from, type_container, htmlheader, content)';

$line.= " VALUES(";
$line.= $objectpageold->newid."__+MAX_llx_website_page__, ";
$line.= ($objectpageold->newfk_page ? $this->db->escape($objectpageold->newfk_page)."__+MAX_llx_website_page__" : "null").", ";
Expand Down Expand Up @@ -939,7 +940,8 @@ public function exportWebSite()
//var_dump($this->fk_default_home.' - '.$objectpageold->id.' - '.$objectpageold->newid);exit;
if ($this->fk_default_home > 0 && ($objectpageold->id == $this->fk_default_home) && ($objectpageold->newid > 0)) // This is the record with home page
{
$line = "UPDATE llx_website SET fk_default_home = ".($objectpageold->newid > 0 ? $this->db->escape($objectpageold->newid)."__+MAX_llx_website_page__" : "null")." WHERE rowid = __WEBSITE_ID__;";
// Warning: We must keep llx_ here. It is a generic SQL.
$line = "UPDATE llx_website SET fk_default_home = ".($objectpageold->newid > 0 ? $this->db->escape($objectpageold->newid)."__+MAX_llx_website_page__" : "null")." WHERE rowid = __WEBSITE_ID__;";
$line.= "\n";
fputs($fp, $line);
}
Expand Down

0 comments on commit 21a1e0d

Please sign in to comment.