Skip to content

Commit

Permalink
Debug module website
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jul 2, 2017
1 parent b95dea3 commit 565de9b
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 115 deletions.
3 changes: 2 additions & 1 deletion htdocs/langs/en_US/website.lang
Expand Up @@ -25,4 +25,5 @@ RealURL=Real URL
ViewWebsiteInProduction=View web site using home URLs
SetHereVirtualHost=If you can set, on your web server, a dedicated virtual host with a root directory on <strong>%s</strong>, define here the virtual hostname so the preview can be done also using this direct web server access and not only using Dolibarr server.
PreviewSiteServedByWebServer=Preview %s in a new tab.<br><br>The %s will be served by an external web server (like Apache, Nginx, IIS). You must install and setup this server before to point to directory:<br><strong>%s</strong><br>URL served by external server:<br><strong>%s</strong>
PreviewSiteServedByDolibarr=Preview %s in a new tab.<br><br>The %s will be served by Dolibarr server so it does not need any extra web server (like Apache, Nginx, IIS) to be installed.<br>The inconvenient is that URL of pages are not user friendly and start with path of your Dolibarr.<br>URL served by Dolibarr:<br><strong>%s</strong><br><br>To use your own external web server to serve this web site, create a virtual host on your web server that point on directory<br><strong>%s</strong><br>then enter the name of this virtual server and clicking on the other preview button.
PreviewSiteServedByDolibarr=Preview %s in a new tab.<br><br>The %s will be served by Dolibarr server so it does not need any extra web server (like Apache, Nginx, IIS) to be installed.<br>The inconvenient is that URL of pages are not user friendly and start with path of your Dolibarr.<br>URL served by Dolibarr:<br><strong>%s</strong><br><br>To use your own external web server to serve this web site, create a virtual host on your web server that point on directory<br><strong>%s</strong><br>then enter the name of this virtual server and click on the other preview button.
NoPageYet=No pages yet
3 changes: 2 additions & 1 deletion htdocs/public/test/test_sessionlock.php
Expand Up @@ -12,9 +12,10 @@
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library
if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
// If you don't need session management (can't be logged if no session used). You must also set
// NOCSRFCHECK, NOTOKENRENEWAL, NOLOGIN,
// NOCSRFCHECK, NOTOKENRENEWAL, NOLOGIN
// Disable module with GETPOST('disablemodules') won't work. Variable 'dol_...' will not be set.
// $_SESSION are then simple vars if sessions are not active.
// TODO We can close session with session_write_close() as soon as we just need read access.
if (! defined("NOSESSION")) define("NOSESSION",'1');

define('REQUIRE_JQUERY_MULTISELECT','select2');
Expand Down
12 changes: 5 additions & 7 deletions htdocs/websites/class/websitepage.class.php
Expand Up @@ -193,7 +193,6 @@ public function fetch($id, $website_id = null, $page = null)

$sql = 'SELECT';
$sql .= ' t.rowid,';

$sql .= " t.fk_website,";
$sql .= " t.pageurl,";
$sql .= " t.title,";
Expand All @@ -203,7 +202,6 @@ public function fetch($id, $website_id = null, $page = null)
$sql .= " t.status,";
$sql .= " t.date_creation,";
$sql .= " t.tms as date_modification";

$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
//$sql .= ' WHERE entity IN ('.getEntity('website').')'; // entity is on website level
$sql .= ' WHERE 1 = 1';
Expand All @@ -214,7 +212,7 @@ public function fetch($id, $website_id = null, $page = null)
$sql .= ' AND t.rowid = ' . $id;
}
$sql .= $this->db->plimit(1);

$resql = $this->db->query($sql);
if ($resql) {
$numrows = $this->db->num_rows($resql);
Expand Down Expand Up @@ -278,7 +276,7 @@ public function fetchAll($websiteid, $sortorder='', $sortfield='', $limit=0, $of
$sql .= " t.date_creation,";
$sql .= " t.tms as date_modification";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element. ' as t';
$sql .= ' WHERE t.fk_website = '.$websiteid;
$sql .= ' WHERE t.fk_website = '.$websiteid;
// Manage filter
$sqlwhere = array();
if (count($filter) > 0) {
Expand Down Expand Up @@ -399,9 +397,9 @@ public function update(User $user, $notrigger = false)
if ($this->old_object->pageurl != $this->pageurl)
{
dol_syslog("The alias was changed, we must rename/recreate the page file into document");

}

if (!$error && !$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
Expand Down Expand Up @@ -628,7 +626,7 @@ public function initAsSpecimen()
$this->id = 0;

$now=dol_now();

$this->fk_website = '';
$this->pageurl = '';
$this->title = 'My Page';
Expand Down

0 comments on commit 565de9b

Please sign in to comment.