Jump to content
X2Community Forums

Recommended Posts

Hi,

 

Does anyone know where to edit the code so that we can see more information when you mouse over a contact in the contact module? Check the attachment.

 

It would be useful to see other information than just email, lead source and background information.

 

Thanks,

Rob

post-996-0-40374200-1497960620_thumb.jpg

Link to post
Share on other sites

Hi Rob,

 

These hover notes are provided by functionality known as Qtips and are rendered by the "qtip" action of the controller for the respective model. In this case, it will be rendered by the ContactsController.actionQtip(), in protected/modules/contacts/controllers/ContactsController.php. The associated view file is stored at protected/modules/contacts/views/contacts/qtip.php.

 

Raymond

Link to post
Share on other sites

Thanks Ray - works nicely. I just edited the code and used the fields like I wanted. 

 

I have a process that shows the quote number as a hyperlink. When I move my mouse over it - it does not have the qtip hover over come up. Where can I edit that so that the contact name and other fields details will come through like the contact qtip?

Link to post
Share on other sites
  • 2 weeks later...

Hi Robert,

 

To enable qtips on Quotes, there are a handful of modifications that will need to be performed:

 

In LinkableBehavior, you'll want to add a custom class to Quote links:

diff --git a/x2engine/protected/components/behaviors/LinkableBehavior.php b/x2engine/protected/components/behaviors/LinkableBehavior.php
index 4183736..fd2c86a 100644
--- a/x2engine/protected/components/behaviors/LinkableBehavior.php
+++ b/x2engine/protected/components/behaviors/LinkableBehavior.php
@@ -197,6 +197,14 @@ class LinkableBehavior extends CActiveRecordBehavior {
                     'class'=>'contact-name'
                 ), $htmlOptions)
             );
+        } else if($this->owner instanceof Quote){
+            return CHtml::link(
+                '<span>'.X2Html::encode($name).'</span>',
+                $url,
+                array_merge (array(
+                    'class'=>'quote-name'
+                ), $htmlOptions)
+            );

Next, you'll need to define a new action to serve the qtip info in the QuotesController:

diff --git a/x2engine/protected/modules/quotes/controllers/QuotesController.php b/x2engine/protected/modules/quotes/controllers/QuotesController.php
index d78811a..240f150 100644
--- a/x2engine/protected/modules/quotes/controllers/QuotesController.php
+++ b/x2engine/protected/modules/quotes/controllers/QuotesController.php
@@ -634,4 +634,9 @@ class QuotesController extends x2base {
     }
 
 
+    public function actionQtip($id) {
+        $quote = $this->loadModel($id);
+
+        $this->renderPartial('qtip', array('quote' => $quote));
+    }

You'll want to define a view at protected/modules/quotes/views/quotes/qtip.php which renders your desired data from the $quote object passed to the view. For testing, I just used a simple view like:

if (isset ($_GET['suppressTitle']) && !$_GET['suppressTitle']) {
?>

<h2><?php echo $quote->renderAttribute('name'); ?></h2>

<?php
}

echo $quote->renderAttribute('name');
echo $quote->renderAttribute('total');

Finally, to enable the qtips on the Quotes grid and in the Process drag and drop interface, you'll need to make two adjustments:

diff --git a/x2engine/protected/modules/quotes/views/quotes/index.php b/x2engine/protected/modules/quotes/views/quotes/index.php
index ee96e4b..6bb913c 100644
--- a/x2engine/protected/modules/quotes/views/quotes/index.php
+++ b/x2engine/protected/modules/quotes/views/quotes/index.php
@@ -62,6 +62,13 @@ $('.search-form form').submit(function(){
 <?php
 $this->widget('X2GridView', array(
        'id'=>'quotes-grid',
+    'enableQtips' => true,
+    'qtipManager' => array(
+        'X2GridViewQtipManager',
+        'loadingText' => addslashes(Yii::t('app', 'loading...')),
+        'qtipSelector' => ".quote-name",
+        'modelType' => "quotes"
+    ),
        'title'=>Yii::t('quotes','{module}',  array('{module}'=>Modules::displayName())),
        'buttons'=>array('advancedSearch','clearFilters','columnSelector','autoResize','showHidden'),
        'template'=> 
diff --git a/x2engine/protected/modules/workflow/assets/js/DragAndDropViewManager.js b/x2engine/protected/modules/workflow/assets/js/DragAndDropViewManager.js
index d37c754..fdb2487 100644
--- a/x2engine/protected/modules/workflow/assets/js/DragAndDropViewManager.js
+++ b/x2engine/protected/modules/workflow/assets/js/DragAndDropViewManager.js
@@ -1511,7 +1511,7 @@ DragAndDropViewManager.prototype._setUpTopScrollbar = function () {
 DragAndDropViewManager.prototype._setUpQtips = function () {
 
     var that = this;
-    $.each (['opportunities', 'contacts', 'accounts'], function (i, type) {
+    $.each (['opportunities', 'contacts', 'accounts', 'quote'], function (i, type) {
         that._qtipManagers[type] = new x2.X2GridViewQtipManager ({
             loadingText: that.translations['Loading...'],

Hope this helps!

 

Raymond

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...