Debug module website

This commit is contained in:
Laurent Destailleur 2017-10-26 13:09:11 +02:00
parent caa24e1a68
commit 5f5cbec1cf
6 changed files with 25 additions and 7 deletions

View File

@ -188,7 +188,7 @@ function dolIncludeHtmlContent($contentfile)
* Generate a zip with all data of web site. * Generate a zip with all data of web site.
* *
* @param Website $website Object website * @param Website $website Object website
* @return void * @return string Path to file with zip
*/ */
function exportWebSite($website) function exportWebSite($website)
{ {
@ -278,6 +278,24 @@ function exportWebSite($website)
} }
/**
* Open a zip with all data of web site and load it into database.
*
* @param string $filename Path of zip file
* @return int <0 if KO, >0 if OK
*/
function importWebSite($website)
{
$result = 0;
//$sql = array("INSERT INTO ".MAIN_DB_PREFIX."website(ref, entity, description, status) values('sellyoursaas', '.$conf->entity.', Portal to sell your SaaS', 1)");
return $result;
}
/** /**
* Download all images found into page content $tmp. * Download all images found into page content $tmp.
* If $modifylinks is set, links to images will be replace with a link to viewimage wrapper. * If $modifylinks is set, links to images will be replace with a link to viewimage wrapper.

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>

View File

@ -23,7 +23,7 @@ CREATE TABLE llx_website
entity integer DEFAULT 1, entity integer DEFAULT 1,
ref varchar(128) NOT NULL, ref varchar(128) NOT NULL,
description varchar(255), description varchar(255),
status integer, status integer DEFAULT 1,
fk_default_home integer, fk_default_home integer,
virtualhost varchar(255), virtualhost varchar(255),
fk_user_create integer, fk_user_create integer,

View File

@ -139,7 +139,7 @@ class Website extends CommonObject
$sql.= 'date_creation,'; $sql.= 'date_creation,';
$sql.= 'tms'; $sql.= 'tms';
$sql .= ') VALUES ('; $sql .= ') VALUES (';
$sql .= ' '.(! isset($this->entity)?'NULL':$this->entity).','; $sql .= ' '.((empty($this->entity) && $this->entity != '0')?'NULL':$this->entity).',';
$sql .= ' '.(! isset($this->ref)?'NULL':"'".$this->db->escape($this->ref)."'").','; $sql .= ' '.(! isset($this->ref)?'NULL':"'".$this->db->escape($this->ref)."'").',';
$sql .= ' '.(! isset($this->description)?'NULL':"'".$this->db->escape($this->description)."'").','; $sql .= ' '.(! isset($this->description)?'NULL':"'".$this->db->escape($this->description)."'").',';
$sql .= ' '.(! isset($this->status)?'NULL':$this->status).','; $sql .= ' '.(! isset($this->status)?'NULL':$this->status).',';