Skip to content
Snippets Groups Projects
Commit 10ded212 authored by Regis Houssin's avatar Regis Houssin
Browse files

Test CKEditor

parent d3710434
Branches
Tags
No related merge requests found
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
* \version $Id$ * \version $Id$
*/ */
if (! defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR','1');
require("../main.inc.php"); require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'); require_once(DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php');
require_once(DOL_DOCUMENT_ROOT."/includes/modules/propale/modules_propale.php"); require_once(DOL_DOCUMENT_ROOT."/includes/modules/propale/modules_propale.php");
...@@ -45,12 +47,11 @@ $langs->load('bills'); ...@@ -45,12 +47,11 @@ $langs->load('bills');
$langs->load('orders'); $langs->load('orders');
$langs->load('products'); $langs->load('products');
$sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"]; $sall=GETPOST("sall");
if (isset($_GET["msg"])) { $mesg=$_GET["mesg"]; } $mesg=GETPOST("mesg");
$year=isset($_GET["year"])?$_GET["year"]:""; $year=GETPOST("year");
$month=isset($_GET["month"])?$_GET["month"]:""; $month=GETPOST("month");
$socid=isset($_GET['socid'])?$_GET['socid']:$_POST['socid']; $socid=GETPOST('socid');
$mesg=isset($_GET['mesg'])?$_GET['mesg']:'';
// Security check // Security check
$module='propale'; $module='propale';
...@@ -370,11 +371,11 @@ if ($_GET["action"] == 'classifybilled') ...@@ -370,11 +371,11 @@ if ($_GET["action"] == 'classifybilled')
/* /*
* Cloture de la propale * Cloture de la propale
*/ */
if ($_REQUEST['action'] == 'setstatut' && $user->rights->propale->cloturer) if (GETPOST('action') == 'setstatut' && $user->rights->propale->cloturer)
{ {
if (! $_POST['cancel']) if (! $_POST['cancel'])
{ {
if (empty($_REQUEST['statut'])) if (! GETPOST('statut'))
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("CloseAs")).'</div>'; $mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("CloseAs")).'</div>';
$_REQUEST['action']='statut'; $_REQUEST['action']='statut';
...@@ -964,8 +965,8 @@ $companystatic=new Societe($db); ...@@ -964,8 +965,8 @@ $companystatic=new Societe($db);
$now=dol_now(); $now=dol_now();
$id = $_REQUEST['id']?$_REQUEST['id']:$_REQUEST['id']; $id = GETPOST('id');
$ref= $_REQUEST['ref']; $ref= GETPOST('ref');
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
......
...@@ -68,12 +68,11 @@ class DolEditor ...@@ -68,12 +68,11 @@ class DolEditor
$this->tool='fckeditor'; // By default $this->tool='fckeditor'; // By default
// Check fckeditor is ok // Check fckeditor is ok
if ($this->tool == 'fckeditor' && (empty($conf->fckeditor->enabled) || ! $okforextandededitor)) if ($this->tool == 'fckeditor' && (empty($conf->fckeditor->enabled) || ! $okforextandededitor || $conf->global->MAIN_USE_CKEDITOR))
{ {
$this->tool = 'textarea'; $this->tool = 'textarea';
} }
if ($this->tool == 'fckeditor') if ($this->tool == 'fckeditor')
{ {
require_once(DOL_DOCUMENT_ROOT."/includes/fckeditor/fckeditor.php"); require_once(DOL_DOCUMENT_ROOT."/includes/fckeditor/fckeditor.php");
...@@ -120,6 +119,8 @@ class DolEditor ...@@ -120,6 +119,8 @@ class DolEditor
*/ */
function Create() function Create()
{ {
global $conf;
$found=0; $found=0;
if ($this->tool == 'fckeditor') if ($this->tool == 'fckeditor')
...@@ -130,7 +131,9 @@ class DolEditor ...@@ -130,7 +131,9 @@ class DolEditor
if ($this->tool == 'textarea') if ($this->tool == 'textarea')
{ {
$found=1; $found=1;
print '<textarea id="'.$this->htmlname.'" name="'.$this->htmlname.'" rows="'.$this->rows.'" cols="'.$this->cols.'" class="flat">'; $cssclass='flat';
if ($conf->global->MAIN_USE_CKEDITOR) $cssclass='ckeditor';
print '<textarea id="'.$this->htmlname.'" name="'.$this->htmlname.'" rows="'.$this->rows.'" cols="'.$this->cols.'" class="'.$cssclass.'">';
print $this->content; print $this->content;
print '</textarea>'; print '</textarea>';
} }
......
...@@ -886,6 +886,12 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs ...@@ -886,6 +886,12 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
{ {
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/layout/jquery.layout-latest'.$ext.'"></script>'."\n"; print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/layout/jquery.layout-latest'.$ext.'"></script>'."\n";
} }
// CKEditor
if ($conf->global->MAIN_USE_CKEDITOR && defined('REQUIRE_CKEDITOR'))
{
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/ckeditor/ckeditor.js"></script>'."\n";
}
} }
// Output module javascript // Output module javascript
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment