Work on website module

This commit is contained in:
Laurent Destailleur 2016-02-02 16:24:12 +01:00
parent f28d8669d9
commit 1fb1da5be4
11 changed files with 1139 additions and 155 deletions

View File

@ -289,8 +289,8 @@ script:
- |
echo "Unit testing"
# Ensure we catch errors
set +e
# Ensure we catch errors. Set this to +e if you want to go to this end to see log file.
set -e
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
set +e
@ -298,12 +298,21 @@ script:
echo Output dolibarr.log
echo cat documents/dolibarr.log
after_script:
- |
# Dolibarr log file
echo "After script"
cat documents/dolibarr.log
after_success:
- |
echo Success
after_failure:
- |
echo Failure
# This part of code seems to be never executed, error or not ???
echo "Debugging informations"
# Upgrade log files
cat *.log
@ -319,8 +328,3 @@ after_failure:
echo
fi
after_script:
- |
# Dolibarr log file
cat documents/dolibarr.log

View File

@ -356,6 +356,12 @@ source_file = htdocs/langs/en_US/withdrawals.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.websites]
file_filter = htdocs/langs/<lang>/withdrawals.lang
source_file = htdocs/langs/en_US/withdrawals.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.workflow]
file_filter = htdocs/langs/<lang>/workflow.lang
source_file = htdocs/langs/en_US/workflow.lang

File diff suppressed because it is too large Load Diff

View File

@ -40,4 +40,43 @@ ALTER TABLE llx_cronjob ADD COLUMN test varchar(255) DEFAULT '1';
ALTER TABLE llx_facture ADD INDEX idx_facture_fk_statut (fk_statut);
UPDATE llx_projet as p set p.opp_percent = (SELECT percent FROM llx_c_lead_status as cls WHERE cls.rowid = p.fk_opp_status) WHERE p.opp_percent IS NULL AND p.fk_opp_status IS NOT NULL;
CREATE TABLE llx_website
(
rowid integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
entity integer DEFAULT 1,
shortname varchar(24) NOT NULL,
description varchar(255),
status integer,
date_creation datetime,
date_modification datetime,
tms timestamp
) ENGINE=innodb;
ALTER TABLE llx_website ADD UNIQUE INDEX uk_website_shortname (shortname, entity);
CREATE TABLE llx_website_page
(
rowid integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
fk_website integer,
pageurl varchar(16) NOT NULL,
title varchar(255),
description varchar(255),
keywords varchar(255),
content text,
status integer,
date_creation datetime,
date_modification datetime,
tms timestamp
) ENGINE=innodb;
ALTER TABLE llx_website_page ADD UNIQUE INDEX uk_website_page_url (fk_website,pageurl);
ALTER TABLE llx_website_page ADD CONSTRAINT fk_website_page_website FOREIGN KEY (fk_website) REFERENCES llx_website (rowid);

View File

@ -16,8 +16,5 @@
--
-- ===========================================================================
ALTER TABLE llx_website_page ADD UNIQUE INDEX uk_website_page_url (fk_website,pageurl);
ALTER TABLE llx_website_page ADD CONSTRAINT fk_website_page_website FOREIGN KEY (fk_website) REFERENCES llx_website (rowid);
ALTER TABLE llx_website ADD UNIQUE INDEX uk_website_shortname (shortname, entity);

View File

@ -20,7 +20,7 @@
CREATE TABLE llx_website
(
rowid integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
entity integer,
entity integer DEFAULT 1,
shortname varchar(24) NOT NULL,
description varchar(255),
status integer,

View File

@ -20,4 +20,3 @@ ALTER TABLE llx_website_page ADD UNIQUE INDEX uk_website_page_url (fk_website,pa
ALTER TABLE llx_website_page ADD CONSTRAINT fk_website_page_website FOREIGN KEY (fk_website) REFERENCES llx_website (rowid);

View File

@ -0,0 +1,5 @@
# Dolibarr language file - Source file is en_US - website
Shortname=Code
WebsiteSetupDesc=Create here as much entry as number of different websites you need. Then go into menu Websites to edit them.
DeleteWebsite=Delete website
ConfirmDeleteWebsite=Are you sure you want to delete this web site. All its pages and content will also be removed.

View File

@ -1,4 +1,4 @@
# Dolibarr language file - Source file is en_US - admin
# Dolibarr language file - Source file is en_US - workflow
WorkflowSetup=Workflow module setup
WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is open (you can do things in the order you want). You can activate the automatic actions you are interested in.
ThereIsNoWorkflowToModify=There is no workflow modifications available with the activated modules.

View File

@ -23,9 +23,16 @@
*/
require ("../main.inc.php");
//require_once (DOL_DOCUMENT_ROOT."/websites/class/website.class.php");
$langs->load("externalsite");
top_htmlhead("","");
top_menu("","","_top");
/*
$website = new Website($db);
$listofwebsites = $website->fetchAll();
*/
print 'rrr';

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -13,59 +13,154 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* \file htdocs/externalsite/frames.php
* \ingroup externalsite
* \brief Page that build two frames: One for menu, the other for the target page to show
* \author Laurent Destailleur
* \file htdocs/admin/website.php
* \ingroup website
* \brief Page to setup the module Website
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("externalsite");
$langs->load("admin");
$langs->load("other");
$langs->load("website");
if (empty($conf->global->EXTERNALSITE_URL))
if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$conf->dol_hide_leftmenu = 1;
$website='website1';
/*
* Actions
*/
// Action mise a jour ou ajout d'une constante
if ($action == 'update')
{
llxHeader();
print '<div class="error">'.$langs->trans('ExternalSiteModuleNotComplete').'</div>';
llxFooter();
if (! $res > 0) $error++;
if (! $error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
$mainmenu=GETPOST('mainmenu', 'alpha');
$leftmenu=GETPOST('leftmenu', 'alpha');
$idmenu=GETPOST('idmenu', 'int');
$theme=GETPOST('theme', 'alpha');
$codelang=GETPOST('lang', 'alpha');
print "
<html>
<head>
<title>Dolibarr frame for external web site</title>
</head>
<frameset ".(empty($conf->global->MAIN_MENU_INVERT)?"rows":"cols")."=\"".($heightforframes+50).",*\" border=0 framespacing=0 frameborder=0>
<frame name=\"barre\" src=\"frametop.php?mainmenu=".$mainmenu."&leftmenu=".$leftmenu."&idmenu=".$idmenu.($theme?'&theme='.$theme:'').($codelang?'&lang='.$codelang:'')."&nobackground=1\" noresize scrolling=\"NO\" noborder>
<frame name=\"main\" src=\"".$conf->global->EXTERNALSITE_URL."\">
<noframes>
<body>
</body>
</noframes>
</frameset>
<noframes>
<body>
<br><div class=\"center\">
Sorry, your browser is too old or not correctly configured to view this area.<br>
Your browser must support frames.<br>
</div>
</body>
</noframes>
</html>
";
/*
* View
*/
$_SESSION['website_mode'] = 'edit';
$form = new Form($db);
$help_url='';
llxHeader('',$langs->trans("WebsiteSetup"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("WebsiteSetup"),$linkback,'title_setup');
$head = array();
/*
* Edit mode
*/
if ($_SESSION['website_mode'] == 'edit')
{
print "\n".'<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
dol_fiche_head($head, 'general', $langs->trans("Page").': '.$langs->trans("Home"), 0, 'globe');
print load_fiche_titre($langs->trans("SEO"),'','');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
print '<tr><td>';
print $langs->trans('WEBSITE_PAGEURL');
print '</td><td>';
print '/public/websites/'.$website.'/index.php?page=home';
print '</td></tr>';
print '<tr><td>';
print $langs->trans('WEBSITE_TITLE');
print '</td><td>';
print '<input type="text" class="flat" size="96" name="WEBSITE_TITLE" value="'.dol_escape_htmltag($obj->WEBSITE_TITLE).'">';
print '</td></tr>';
print '<tr><td>';
print $langs->trans('WEBSITE_DESCRIPTION');
print '</td><td>';
print '<input type="text" class="flat" size="96" name="WEBSITE_DESCRIPTION" value="'.dol_escape_htmltag($obj->WEBSITE_DESCRIPTION).'">';
print '</td></tr>';
print '<tr><td>';
print $langs->trans('WEBSITE_KEYWORDS');
print '</td><td>';
print '<input type="text" class="flat" size="128" name="WEBSITE_KEYWORDS" value="'.dol_escape_htmltag($obj->WEBSITE_KEYWORDS).'">';
print '</td></tr>';
print '</table>';
print '<br>';
/*
* Editing global variables not related to a specific theme
*/
print load_fiche_titre($langs->trans("Other"),'','');
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('WEBSITE_HEADER',$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60);
$doleditor->Create();
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('WEBSITE_CONTENT',$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60);
$doleditor->Create();
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('WEBSITE_FOOTER',$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60);
$doleditor->Create();
dol_fiche_end();
print '<div align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'" name="update"></div>';
print '</form>';
}
llxFooter();
$db->close();