*
* 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
@@ -16,7 +16,7 @@
*/
/**
- * \file htdocs/public/paypal/index.php
+ * \file htdocs/public/websites/index.php
* \ingroup core
* \brief A redirect page to an error
* \author Laurent Destailleur
@@ -64,6 +64,24 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_AP
//print 'Directory with '.$appli.' websites.
';
+if (empty($pageid))
+{
+ require_once DOL_DOCUMENT_ROOT.'/websites/class/website.class.php';
+ require_once DOL_DOCUMENT_ROOT.'/websites/class/websitepage.class.php';
+
+ $object=new Website($db);
+ $object->fetch(0, $website);
+
+ $objectpage=new WebsitePage($db);
+ $array=$objectpage->fetchAll($object->id);
+
+ if (count($array) > 0)
+ {
+ $firstrep=reset($array);
+ $pageid=$firstrep->id;
+ }
+}
+
// Security: Delete string ../ into $original_file
global $dolibarr_main_data_root;
diff --git a/htdocs/websites/class/websitepage.class.php b/htdocs/websites/class/websitepage.class.php
index 430cf4f0f3b..b363687765f 100644
--- a/htdocs/websites/class/websitepage.class.php
+++ b/htdocs/websites/class/websitepage.class.php
@@ -307,7 +307,7 @@ class WebsitePage extends CommonObject
while ($obj = $this->db->fetch_object($resql))
{
- $record = new Websitepage($this->db);
+ $record = new WebsitePage($this->db);
$record->id = $obj->rowid;
$record->fk_website = $obj->fk_website;
@@ -320,7 +320,7 @@ class WebsitePage extends CommonObject
$record->date_creation = $this->db->jdate($obj->date_creation);
$record->date_modification = $this->db->jdate($obj->date_modification);
$record->tms = $this->db->jdate($obj->tms);
-
+ //var_dump($record->id);
$records[$record->id] = $record;
}
$this->db->free($resql);
diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php
index 91c4921d29d..98efd23f45b 100644
--- a/htdocs/websites/index.php
+++ b/htdocs/websites/index.php
@@ -420,6 +420,7 @@ if (count($object->records) > 0)
print $langs->trans("Website").': ';
print '';
+ // List of websites
print '';
+ // Button for websites
print '';
if ($action == 'preview')