Fix embed code related issues.
authorVimal Joseph <vimal.joseph@zyxware.com>
Sun, 28 Dec 2014 08:07:31 +0000 (13:37 +0530)
committerVimal Joseph <vimal.joseph@zyxware.com>
Sun, 28 Dec 2014 08:07:31 +0000 (13:37 +0530)
1) Fix widget preview bug in the emebed code form.
2) Removed the placeholder referal id. Now the referal id will be empty by default

CRM/Wci/Form/NewEmbedCode.php
templates/CRM/Wci/Form/NewEmbedCode.tpl

index 3f2e76171f18e4bc297ffd776229392ad5e1f4c1..34f189f596be523b00cbfbff39e47c9803f2315a 100644 (file)
@@ -81,6 +81,7 @@ class CRM_Wci_Form_NewEmbedCode extends CRM_Core_Form {
               'widget' => $emb_code[$dao->id]['widget_id']));
       }
       CRM_Utils_System::setTitle(ts('Edit embed code'));
+      $this->assign('widget_id', $emb_code[$dao->id]['widget_id']);
     }
     else {
       CRM_Utils_System::setTitle(ts('New embed code'));
index f2ad29fe8b18fe9283df07e86218b5ab7ddfe8ce..9c20d33a6db141b7ba75ab904aa917773b2a0929 100644 (file)
@@ -47,7 +47,7 @@
           <div class="description">
             Click <strong>Save &amp; Preview</strong> to save any changes to your settings, and preview the widget again on this page.
           </div>
-          <script type="text/javascript" src="{crmURL p='civicrm/wci/embed' q="id=`$emb_id`&preview=1"}"></script>
+          <script type="text/javascript" src="{crmURL p='civicrm/wci/embed' q="id=$widget_id&preview=1"}"></script>
           <div id="widgetwci"></div>
         </div>
         <div class="col2">
@@ -55,7 +55,7 @@
             Add this widget to any web page by copying and pasting the code below.
           </div>
           <textarea rows="8" cols="40" name="widget_code" id="widget_code">
-<script type="text/javascript" src="{crmURL p='civicrm/wci/embed' q="id=`$emb_id`&referral_id=2442" a=1}"></script>
+<script type="text/javascript" src="{crmURL p='civicrm/wci/embed' q="id=`$emb_id`&referral_id=" a=1}"></script>
 <div id="widgetwci"></div>
           </textarea>
           <br>