Removed duplicated code

This commit is contained in:
Marcos García 2012-07-21 23:54:23 +02:00
parent 3d10d6a559
commit 49d943e57f
6 changed files with 245 additions and 215 deletions

View File

@ -101,6 +101,9 @@ print "<br>\n";
if ($action == 'edit') // Edit
{
//WYSIWYG Editor
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
@ -132,12 +135,10 @@ if ($action == 'edit') // Edit
print '</table><br>'."\n";
// Themes
show_theme('',1);
print '<br>';
// Liste des zone de recherche permanantes supportees
print '<table summary="search" class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("PermanentLeftSearchForm").'</td><td colspan="2">'.$langs->trans("Activated").'</td></tr>';
@ -227,18 +228,19 @@ if ($action == 'edit') // Edit
// Message on login page
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageLogin").'</td><td colspan="2">';
// Editeur wysiwyg
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('main_home',$conf->global->MAIN_HOME,'',142,'dolibarr_notes','In',false,true,true,ROWS_4,90);
$doleditor = new DolEditor('main_home', $conf->global->MAIN_HOME, '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, 90);
$doleditor->Create();
print '</td></tr>'."\n";
// Message of the day on home page
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageOfDay").'</td><td colspan="2">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('main_motd',$conf->global->MAIN_MOTD,'',142,'dolibarr_notes','In',false,true,true,ROWS_4,90);
$doleditor = new DolEditor('main_motd', $conf->global->MAIN_MOTD, '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, 90);
$doleditor->Create();
print '</td></tr>'."\n";
/*

View File

@ -64,10 +64,10 @@ $result=restrictedArea($user,'commande',$id,'');
$object = new Commande($db);
// Load object
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
// Load object
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
@ -507,18 +507,18 @@ else if ($action == 'setremiseabsolue' && $user->rights->commande->creer)
$result = $object->set_remise_absolue($user, $_POST['remise_absolue']);
}
else if ($action == 'setnote_public' && $user->rights->commande->creer)
{
$object->fetch($id);
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote' && $user->rights->commande->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
else if ($action == 'setnote_public' && $user->rights->commande->creer)
{
$object->fetch($id);
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote' && $user->rights->commande->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
/*
@ -1222,64 +1222,64 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P
}
}
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
if ($action == 'addcontact' && $user->rights->commande->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
if ($action == 'addcontact' && $user->rights->commande->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
{
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->commande->creer)
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->commande->creer)
{
$object->fetch($id);
$result = $object->delete_contact($lineid);
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
dol_print_error($db);
}
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->commande->creer)
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->commande->creer)
{
$object->fetch($id);
$result = $object->delete_contact($lineid);
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
dol_print_error($db);
}
}
}
@ -1480,21 +1480,23 @@ if ($action == 'create' && $user->rights->commande->creer)
}
}
//WYSIWYG Editor
include_once(DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php');
// Template to use by default
print '<tr><td>'.$langs->trans('Model').'</td>';
print '<td colspan="2">';
include_once(DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php');
$liste=ModelePDFCommandes::liste_modeles($db);
print $form->selectarray('model',$liste,$conf->global->COMMANDE_ADDON_PDF);
print "</td></tr>";
// Note publique
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
print '<td valign="top" colspan="2">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print $doleditor->Create(1);
//print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_public.'</textarea>';
print '</td></tr>';
@ -1505,7 +1507,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
print '<td valign="top" colspan="2">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print $doleditor->Create(1);
//print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'</textarea>';
@ -2047,24 +2049,24 @@ else
print '<td colspan="2">'.$object->getLibStatut(4).'</td>';
print '</tr>';
print '</table><br>';
print '</table><br>';
print "\n";
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$formcompany= new FormCompany($db);
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$formcompany= new FormCompany($db);
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
/*

View File

@ -255,6 +255,9 @@ $form = new Form($db);
*/
if ($action == 'create')
{
//WYSIWYG Editor
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
print_fiche_titre($langs->trans("NewTrip"));
dol_htmloutput_errors($mesg);
@ -295,9 +298,10 @@ if ($action == 'create')
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
print '<td valign="top" colspan="2">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note_public',GETPOST('note_public','alpha'),600,200,'dolibarr_notes','In',false,true,true,ROWS_8,100);
$doleditor = new DolEditor('note_public', GETPOST('note_public', 'alpha'), 600, 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, 100);
print $doleditor->Create(1);
print '</td></tr>';
// Private note
@ -306,9 +310,10 @@ if ($action == 'create')
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
print '<td valign="top" colspan="2">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note_private',GETPOST('note_private','alpha'),600,200,'dolibarr_notes','In',false,true,true,ROWS_8,100);
$doleditor = new DolEditor('note_private', GETPOST('note_private', 'alpha'), 600, 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, 100);
print $doleditor->Create(1);
print '</td></tr>';
}
@ -332,6 +337,9 @@ else if ($id)
if ($action == 'edit' && $user->rights->deplacement->creer)
{
//WYSIWYG Editor
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$soc = new Societe($db);
if ($object->socid)
{
@ -382,9 +390,10 @@ else if ($id)
// Public note
print '<tr><td valign="top">'.$langs->trans("NotePublic").'</td>';
print '<td valign="top" colspan="3">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note_public',$object->note_public,600,200,'dolibarr_notes','In',false,true,true,ROWS_8,'100');
$doleditor = new DolEditor('note_public', $object->note_public, 600, 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '100');
print $doleditor->Create(1);
print "</td></tr>";
// Private note
@ -392,9 +401,10 @@ else if ($id)
{
print '<tr><td valign="top">'.$langs->trans("NotePrivate").'</td>';
print '<td valign="top" colspan="3">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note_private',$object->note_private,600,200,'dolibarr_notes','In',false,true,true,ROWS_8,'100');
$doleditor = new DolEditor('note_private', $object->note_private, 600, 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '100');
print $doleditor->Create(1);
print "</td></tr>";
}
@ -499,8 +509,8 @@ else if ($id)
print "</table><br>";
// Notes
$blocname = 'notes';
$title = $langs->trans('Notes');
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
print '</div>';

View File

@ -100,18 +100,18 @@ else if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->
$result = $object->set_remise($user, $_POST['remise_percent']);
}
else if ($action == 'setnote_public' && $user->rights->fournisseur->commande->creer)
{
$object->fetch($id);
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote' && $user->rights->fournisseur->commande->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
else if ($action == 'setnote_public' && $user->rights->fournisseur->commande->creer)
{
$object->fetch($id);
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote' && $user->rights->fournisseur->commande->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
@ -819,64 +819,64 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P
}
}
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
{
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->fournisseur->commande->creer)
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->fournisseur->commande->creer)
{
$object->fetch($id);
$result = $object->delete_contact($_GET["lineid"]);
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
dol_print_error($db);
}
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->fournisseur->commande->creer)
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->fournisseur->commande->creer)
{
$object->fetch($id);
$result = $object->delete_contact($_GET["lineid"]);
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
dol_print_error($db);
}
}
}
@ -1162,22 +1162,22 @@ if ($id > 0 || ! empty($ref))
print "</table><br>";
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
$formcompany= new FormCompany($db);
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
$formcompany= new FormCompany($db);
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
dol_htmloutput_mesg($mesg);
@ -1346,6 +1346,9 @@ if ($id > 0 || ! empty($ref))
*/
if ($object->statut == 0 && $user->rights->fournisseur->commande->creer && $action <> 'editline')
{
//WYSIWYG Editor
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
print '<tr class="liste_titre">';
print '<td>';
print '<a name="add"></a>'; // ancre
@ -1372,11 +1375,9 @@ if ($id > 0 || ! empty($ref))
if ($forceall || ($conf->product->enabled && $conf->service->enabled)
|| (empty($conf->product->enabled) && empty($conf->service->enabled))) print '<br>';
// Editor wysiwyg
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$nbrows=ROWS_2;
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
$doleditor=new DolEditor('dp_desc',$_POST["dp_desc"],'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
$doleditor = new DolEditor('dp_desc', $_POST["dp_desc"], '', 100, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, $nbrows, 70);
$doleditor->Create();
print '</td>';
@ -1430,11 +1431,9 @@ if ($id > 0 || ! empty($ref))
echo $hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action);
}
// Editor wysiwyg
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$nbrows=ROWS_2;
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
$doleditor=new DolEditor('np_desc',$_POST["np_desc"],'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
$doleditor = new DolEditor('np_desc', $_POST["np_desc"], '', 100, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, $nbrows, 70);
$doleditor->Create();
print '</td>';

View File

@ -697,6 +697,9 @@ else
// -----------------------------------------
if ($action == 'create' && ($user->rights->produit->creer || $user->rights->service->creer))
{
//WYSIWYG Editor
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
print '<form action="fiche.php" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
@ -747,8 +750,7 @@ else
// Description (used in invoice, propal...)
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('desc',$_POST["desc"],'',160,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,4,90);
$doleditor = new DolEditor('desc', $_POST["desc"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 4, 90);
$doleditor->Create();
print "</td></tr>";
@ -823,8 +825,8 @@ else
// Note (private, no output on invoices, propales...)
print '<tr><td valign="top">'.$langs->trans("NoteNotVisibleOnBill").'</td><td>';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note',$_POST["note"],'',180,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,8,70);
$doleditor = new DolEditor('note', $_POST["note"], '', 180, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 8, 70);
$doleditor->Create();
print "</td></tr>";
@ -880,6 +882,9 @@ else
// Fiche en mode edition
if ($action == 'edit' && ($user->rights->produit->creer || $user->rights->service->creer))
{
//WYSIWYG Editor
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$type = $langs->trans('Product');
if ($object->isservice()) $type = $langs->trans('Service');
print_fiche_titre($langs->trans('Modify').' '.$type.' : '.$object->ref, "");
@ -934,9 +939,10 @@ else
// Description (used in invoice, propal...)
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="2">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('desc',$object->description,'',160,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,4,90);
$doleditor = new DolEditor('desc', $object->description, '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 4, 90);
$doleditor->Create();
print "</td></tr>";
print "\n";
@ -1026,9 +1032,10 @@ else
// Note
print '<tr><td valign="top">'.$langs->trans("NoteNotVisibleOnBill").'</td><td colspan="2">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note',$object->note,'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,8,70);
$doleditor = new DolEditor('note', $object->note, '', 200, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 8, 70);
$doleditor->Create();
print "</td></tr>";
print '</table>';

View File

@ -157,6 +157,9 @@ print '</table>';
if ($_GET["action"] == 'edit')
{
//WYSIWYG Editor
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
print '<form action="" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="vedit">';
@ -168,14 +171,16 @@ if ($_GET["action"] == 'edit')
print '<table class="border" width="100%">';
print '<tr><td valign="top" width="15%" class="fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.$product->multilangs[$key]["libelle"].'"></td></tr>';
print '<tr><td valign="top" width="15%">'.$langs->trans('Description').'</td><td>';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('desc-'.$key.'',$product->multilangs[$key]["description"],'',160,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,3,80);
$doleditor = new DolEditor("desc-$key", $product->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 3, 80);
$doleditor->Create();
print '</td></tr>';
print '<tr><td valign="top" width="15%">'.$langs->trans('Note').'</td><td>';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note-'.$key.'',$product->multilangs[$key]["note"],'',160,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,3,80);
$doleditor = new DolEditor("note-$key", $product->multilangs[$key]["note"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 3, 80);
$doleditor->Create();
print '</td></tr>';
print '</tr>';
print '</table>';
@ -232,6 +237,9 @@ print "\n</div>\n";
if ($_GET["action"] == 'add' && ($user->rights->produit->creer || $user->rights->service->creer))
{
//WYSIWYG Editor
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
print '<br>';
print '<form action="" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -244,14 +252,16 @@ if ($_GET["action"] == 'add' && ($user->rights->produit->creer || $user->rights-
print '</td></tr>';
print '<tr><td valign="top" width="15%" class="fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" size="40"></td></tr>';
print '<tr><td valign="top" width="15%">'.$langs->trans('Description').'</td><td>';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('desc','','',160,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,3,80);
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 3, 80);
$doleditor->Create();
print '</td></tr>';
print '<tr><td valign="top" width="15%">'.$langs->trans('Note').'</td><td>';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note','','',160,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,3,80);
$doleditor = new DolEditor('note', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 3, 80);
$doleditor->Create();
print '</td></tr>';
print '</tr>';
print '</table>';