CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Is there an easy way to put a wysiwyg on the civievent form?
Pages: [1] 2

Author Topic: Is there an easy way to put a wysiwyg on the civievent form?  (Read 5699 times)

westwesterson

  • Guest
Is there an easy way to put a wysiwyg on the civievent form?
December 10, 2007, 12:43:47 am
In civievent, the 'complete description' form it would be great to have a wysiwyg so that civicrm users wouldn't have to know html to make a nicely formatted page about an event. As it stands you can make a pretty nicely formatted page if you know html, but that is somewhat of a high barrier for some people. Seeing there is already a wysiwyg in civimail, this probably shouldn't be too hard. Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Is there an easy way to put a wysiwyg on the civievent form?
December 10, 2007, 07:10:23 am

Can you please file an issue. we'll implement it in a 2.x release

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

westwesterson

  • Guest
Re: Is there an easy way to put a wysiwyg on the civievent form?
December 11, 2007, 12:21:07 am
I take that this also means that there is no easy way to put a wysiwyg in the civievent form. (and yes I have added the issue)

jyotirmaya

  • Guest
Re: Is there an easy way to put a wysiwyg on the civievent form?
March 28, 2008, 02:23:27 pm
have just installed 2.0 on drupal 5.7 and I see no bundled wysiwyg editor for civievent. My Drupal installation is running fckeditor for text areas, how can I extend this to civievent text areas?

jyotirmaya

  • Guest
Re: Is there an easy way to put a wysiwyg on the civievent form?
March 28, 2008, 02:34:25 pm
Issue can be found  at http://issues.civicrm.org/jira/browse/CRM-2489
- due for implementation in 2.2.

Was not able to extend Drupal FCK editor into Civievent

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Is there an easy way to put a wysiwyg on the civievent form?
March 28, 2008, 05:56:48 pm

If you are a coder, you can also see how civimail handles this and do something similar. Submit a patch for the issue and it can potentially make it into 2.1 :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

jyotirmaya

  • Guest
Re: Is there an easy way to put a wysiwyg on the civievent form?
March 29, 2008, 02:11:10 pm
wish I was a coder.... will try to look at civimail, although haven't actually worked with that part of civicrm as yet... (could never get it running on my web host - no access to a command prompt!)

jyotirmaya

  • Guest
Re: Is there an easy way to put a wysiwyg on the civievent form?
April 01, 2008, 04:05:58 am
in CRM/Mailings/Form/upload.php There is the following
Quote
$this->assign( 'dojoIncludes',
                       "dojo.require('dijit.Editor'); dojo.require('dojo.parser'); dojo.require('dijit._editor.plugins.FontChoice');
                        dojo.require('dijit._editor.plugins.TextColor'); dojo.require('dijit._editor.plugins.LinkDialog');");
               
        $dojoAttributes = array( 'dojoType'             => 'dijit.Editor',
                                 'height'               => '250 px',
                                 'id'                   => 'html_message',
                                 'extraPlugins'         => '["createLink","foreColor","hiliteColor","formatBlock"]',
                                 'onkeyup'              => "return verify(this)"
                                 );

        $this->add( 'textarea', 'html_message', ts('HTML Message'), $dojoAttributes );

Would this be what I need to put into CRM/Event/Form/ManageEvent/eventinfo.php  above this line
Quote
$this->add('textarea','description',ts('Complete Description'), array("rows"=>4,"cols"=>60));
?

Do I need to change anything with classes?
« Last Edit: April 01, 2008, 04:27:51 am by jyotirmaya »

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Is there an easy way to put a wysiwyg on the civievent form?
April 01, 2008, 04:23:37 am
Yes, that should work. If you are stuck ping me on irc #civicrm

kurund
Found this reply helpful? Support CiviCRM

jyotirmaya

  • Guest
Re: Is there an easy way to put a wysiwyg on the civievent form?
April 01, 2008, 04:35:49 am
just did that - it was trying to work - it started to load dojo in the proper place - but the page couldn't finish loading with all the dojo icons, and the whole page hung - had to restart my browser to get out.
what next?

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Is there an easy way to put a wysiwyg on the civievent form?
April 01, 2008, 04:40:31 am
Quote
$this->assign( 'dojoIncludes',
                       "dojo.require('dijit.Editor'); dojo.require('dojo.parser'); dojo.require('dijit._editor.plugins.FontChoice');
                        dojo.require('dijit._editor.plugins.TextColor'); dojo.require('dijit._editor.plugins.LinkDialog');");
               
$dojoAttributes = array( 'dojoType'             => 'dijit.Editor',
                                 'height'               => '250 px',
                                 'id'                   => 'html_message',
                                 'extraPlugins'         => '["createLink","foreColor","hiliteColor","formatBlock"]',
                                 'onkeyup'              => "return verify(this)"
                                 );

$this->add('textarea','description',ts('Complete Description'), $dojoAttributes);

this should work, if not jump on to irc #civicrm

kurund
Found this reply helpful? Support CiviCRM

jyotirmaya

  • Guest
Re: Is there an easy way to put a wysiwyg on the civievent form?
April 01, 2008, 04:52:33 am
I tried that and it di the same thing - dojo icons don't load (just grey squares) and the page hangs.
Is there anything else I need to include in the page to make dojo function?
(soz - am getting connection refused from irc.freenode)

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Is there an easy way to put a wysiwyg on the civievent form?
April 01, 2008, 07:06:12 am
You also need to change templates/CRM/Event/Form/ManageEvent/EventInfo.tpl

From:
Quote
<tr><td class="label" >{$form.description.label}</td><td>{$form.description.html}</td></tr>

To:
Quote
<tr><td class="label" >{$form.description.label}</td><td style="border: 1px solid black;" class ="tundra">{$form.description.html}</td></tr>

kurund
Found this reply helpful? Support CiviCRM

jyotirmaya

  • Guest
Re: Is there an easy way to put a wysiwyg on the civievent form?
April 01, 2008, 07:30:36 am
Thanks Kurund - this has helped a lot. Dojo will now load with the page.
still having a few problems though
1) Firefox (2.0.013) - page still does not load completely and ends up hanging - have to restart FF. Clearing Cache, restarting FF and logging back into drupal do not help)
2) in IE - the editor seems to work fine, however, the changes I make in dojo do not seem to be saved when I hit save.

we are using upload.tpl as a reference, here are all the terms that reference dojo in that file:-
Quote
  <fieldset id="compose_id"><legend>{ts}Compose On-screen{/ts}</legend>
    <table class="dojoEditor form-layout-compressed">
   {if $templates}<tr><td class="label" width="105px">{$form.template.label}</td><td>{$form.template.html}</td></tr>{/if}
     <tr><td colspan="2"><span class="font-size11pt bold">{$form.text_message.label}</span><br />{$form.text_message.html}</td></tr>
        <tr><td colspan="2">
            <span class="font-size11pt bold">{$form.html_message.label}</span> &nbsp;
            <span class="description">({ts}Click your mouse in the upper left corner of the box below to begin editing your HTML message.{/ts})</span>
            <br />
            <div style="border: 1px solid black;" class ="tundra">
           {$form.html_message.html}
           </div>
        </td>
    </tr>
    </table>

Quote
//rebuild save template block
        document.getElementById("updateDetails").style.display = 'none';
       
        if ( !val ) {
       return;
        }

   var dataUrl = {/literal}"{crmURL p='civicrm/ajax/template' q='tid='}"{literal} + val;
       
        var result = dojo.xhrGet({
        url: dataUrl,
        handleAs: "text",
        timeout: 5000, //Time in milliseconds
        handle: function(response, ioArgs){
                if(response instanceof Error){
                        if(response.dojoType == "cancel"){
                                //The request was canceled by some other JavaScript code.
                                console.debug("Request canceled.");
                        }else if(response.dojoType == "timeout"){
                                //The request took over 5 seconds to complete.
                                console.debug("Request timed out.");
                        }else{
                                //Some other error happened.
                                console.error(response);
                        }
                } else {
              res = response.split('^A');


and right at the end of the file
Quote
function showSaveDetails(chkbox)
     {
       if (chkbox.checked) {
           document.getElementById("saveDetails").style.display = "block";
           document.getElementById("saveTemplateName").disabled = false;
       } else {
           document.getElementById("saveDetails").style.display = "none";
           document.getElementById("saveTemplateName").disabled = true;
       }   
     }

     dojo.connect( dijit.byId('html_message'), 'onload', 'setHTMLMessage')
     dojo.connect( dijit.byId('html_message'), 'onsubmit', 'getHTMLMessage')
     
     function setHTMLMessage ( ) {
        var message_html  = {/literal}'{$message_html}'{literal};
        dijit.byId('html_message').setValue( message_html );
     }

     function getHTMLMessage ( ) {
         document.Upload.hmsg.value = dijit.byId("html_message").getValue();
     }

wondering if we should have added any more terms in?

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Is there an easy way to put a wysiwyg on the civievent form?
April 01, 2008, 08:26:15 am
I guess you will have to do few more changes in both tpl and php files. If want this feature urgently please consider hiring someone from http://civicrm.org/professional

kurund
Found this reply helpful? Support CiviCRM

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Is there an easy way to put a wysiwyg on the civievent form?

This forum was archived on 2017-11-26.