From 49d943e57f917d225c6ae6ff0fe0da88cae31841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 21 Jul 2012 23:54:23 +0200 Subject: [PATCH] Removed duplicated code --- htdocs/admin/ihm.php | 16 +-- htdocs/commande/fiche.php | 188 ++++++++++++++-------------- htdocs/compta/deplacement/fiche.php | 30 +++-- htdocs/fourn/commande/fiche.php | 177 +++++++++++++------------- htdocs/product/fiche.php | 23 ++-- htdocs/product/traduction.php | 26 ++-- 6 files changed, 245 insertions(+), 215 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 647a4453084..4c76e19470b 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -101,6 +101,9 @@ print "
\n"; if ($action == 'edit') // Edit { + //WYSIWYG Editor + require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); + print '
'; print ''; print ''; @@ -132,12 +135,10 @@ if ($action == 'edit') // Edit print '
'."\n"; - // Themes show_theme('',1); print '
'; - // Liste des zone de recherche permanantes supportees print ''; print ''; @@ -227,18 +228,19 @@ if ($action == 'edit') // Edit // Message on login page $var=!$var; print ''."\n"; // Message of the day on home page $var=!$var; print ''."\n"; /* diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 7ddd5f25f6c..e0df749e770 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -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 = '
'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'
'; - } - else - { - $mesg = '
'.$object->error.'
'; - } - } - } - - // 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 = '
'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'
'; + } + else + { + $mesg = '
'.$object->error.'
'; + } + } + } + + // 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 ''; print '"; - // Note publique print ''; print ''; print ''; @@ -1505,7 +1507,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; print ''; print ''; print ''; - print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$langs->trans("MessageLogin").''; - // 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 '
'.$langs->trans("MessageOfDay").''; - 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 '
'.$langs->trans('Model').''; - 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 "
'.$langs->trans('NotePublic').''; - 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 ''; print '
'.$langs->trans('NotePrivate').''; - 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 ''; @@ -2047,24 +2049,24 @@ else print ''.$object->getLibStatut(4).'

'; + print '
'; 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'); } /* diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index cf97fd8ee83..02cf7dcb4ef 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -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 ''; print ''.$langs->trans('NotePublic').''; print ''; - 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 ''; // Private note @@ -306,9 +310,10 @@ if ($action == 'create') print ''; print ''.$langs->trans('NotePrivate').''; print ''; - 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 ''; } @@ -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 ''.$langs->trans("NotePublic").''; print ''; - 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 ""; // Private note @@ -392,9 +401,10 @@ else if ($id) { print ''.$langs->trans("NotePrivate").''; print ''; - 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 ""; } @@ -499,8 +509,8 @@ else if ($id) print "
"; // Notes - $blocname = 'notes'; - $title = $langs->trans('Notes'); + $blocname = 'notes'; + $title = $langs->trans('Notes'); include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'); print ''; diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 6f3281ecaef..e4eb6090ef3 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -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 = '
'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'
'; - } - else - { - $mesg = '
'.$object->error.'
'; - } - } - } - - // 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 = '
'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'
'; + } + else + { + $mesg = '
'.$object->error.'
'; + } + } + } + + // 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 "
"; - 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 ''; print ''; print ''; // 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 '
'; - // 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 ''; @@ -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 ''; diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 49fffe6c8b9..973efa76322 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -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 ''; print ''; print ''; @@ -747,8 +750,7 @@ else // Description (used in invoice, propal...) print ''.$langs->trans("Description").''; - 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 ""; @@ -823,8 +825,8 @@ else // Note (private, no output on invoices, propales...) print ''.$langs->trans("NoteNotVisibleOnBill").''; - 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 ""; @@ -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 ''.$langs->trans("Description").''; - 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 ""; print "\n"; @@ -1026,9 +1032,10 @@ else // Note print ''.$langs->trans("NoteNotVisibleOnBill").''; - 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 ""; print ''; diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index d1e2608e1c7..5674ca9134d 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -157,6 +157,9 @@ print ''; if ($_GET["action"] == 'edit') { + //WYSIWYG Editor + require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); + print ''; print ''; print ''; @@ -168,14 +171,16 @@ if ($_GET["action"] == 'edit') print ''; print ''; print ''; print ''; print ''; print '
'.$langs->trans('Label').'
'.$langs->trans('Description').''; - 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 '
'.$langs->trans('Note').''; - 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 '
'; @@ -232,6 +237,9 @@ print "\n\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 '
'; print ''; print ''; @@ -244,14 +252,16 @@ if ($_GET["action"] == 'add' && ($user->rights->produit->creer || $user->rights- print ''; print ''.$langs->trans('Label').''; print ''.$langs->trans('Description').''; - 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 ''; print ''.$langs->trans('Note').''; - 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 ''; print ''; print '';