Menu

SuietASSURED Banner

Save

Save

Welcome, Guest
Username: Password: Remember me

TOPIC: Notifications on Screen - Assigned Record

Notifications on Screen - Assigned Record 1 week 20 hours ago #56621

  • TaufiqueAhmed
  • TaufiqueAhmed's Avatar
  • Offline
  • SuiteCRM Is My Life
  • Posts: 374
  • Thank you received: 32
  • Karma: 12
7.9.4

Top right hand side has "Notifications"

I notice this works with Meeting & Call reminders?

Is there anyway to add newly assigned records?

So for example I reassign an account, opportunity or contact etc it appears as a notification on the new assigned user
Kind Regards,

Taufique Ahmed
The administrator has disabled public write access.

Notifications on Screen - Assigned Record 6 days 20 hours ago #56660

  • pgr
  • pgr's Avatar
  • Offline
  • SuiteCRM Is My Life
  • Posts: 3150
  • Thank you received: 509
  • Karma: 119
Maybe this can help

stackoverflow.com/questions/32067430/sui...-my-own-notification

Please post back your solution once you work it out... :-)
The administrator has disabled public write access.
The following user(s) said Thank You: TaufiqueAhmed

Notifications on Screen - Assigned Record 4 days 21 hours ago #56770

  • MadMart
  • MadMart's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Thank you received: 5
  • Karma: 0
For Desktop Notifications as in those that display directly on your desktop through your web browser
you do something like
Alerts.prototype.show({title: 'test', options: {body: 'lorem ipsum'}})
on the client.


for desktop notifications as in those that display in the top bar of the suitecrm UI you do something like
$alert = BeanFactory::newBean('Alerts');
$alert->name = "Record Assigned";
$alert->description = "{$bean->module_name} assigned to you {$bean->name}";
$alert->assigned_user_id = $bean->assigned_user_id;
$alert->is_read = 0 ;
$alert->type = "info" ;
$alert->target_module = $bean->module_name;
$alert->url_redirect = "index.php?action=ajaxui#ajaxUILoc=";
$alert->url_redirect .= urlencode("index.php?module={$this->record->module_name}&action=DetailView&record={$this->record->id}");
$alert->save();
on the server *

* note that this type of notification uses the original module name (if it is targeting a module with an overwritten name) in it's title. I'll post an update when I find out how to get around that
The administrator has disabled public write access.
The following user(s) said Thank You: TaufiqueAhmed, pgr

Notifications on Screen - Assigned Record 4 days 19 hours ago #56792

  • MadMart
  • MadMart's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Thank you received: 5
  • Karma: 0
To make Alerts show an overwritten module name instead of an original module name, you will need to edit 2 files.

copy
<SUITE_DIR>/modules/Alerts/views/view.default.php
and
<SUITE_DIR>/modules/Alerts/templates/view.default.php
into the custom directory

then make these changes..
in view.default.php add:
        $moduleNames = array_intersect(
          array_column($this->view_object_map['Results'], 'target_module'),
          array_intersect(
            $GLOBALS['moduleList'],
            array_keys($GLOBALS['beanList'])
          )
        );
        $moduleNames = array_map(function($i) { return translate('LBL_MODULE_NAME', $i); }, $moduleNames);
        $this->ss->assign('moduleNames', $moduleNames);

to the display function before the echo


Then in the smarty template add
key=k
in the foreach statement on line 3

and replace
$result->target_module
with
$moduleNames[$k]
in the smarty template on line 12
The administrator has disabled public write access.
The following user(s) said Thank You: pgr

Notifications on Screen - Assigned Record 4 days 15 hours ago #56800

  • MadMart
  • MadMart's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Thank you received: 5
  • Karma: 0
played around with the client side desktop notifications a little more and I've come up with a complete example
Alerts.prototype.show({
  title: 'TITLE',
  options: {
    type: 'info',
    url_redirect: 'https://url.com',
    target_module: 'Call', body: 'lorem ipsum',
    icon: 'https://blahblah.jpg'
  }
})

so the target_module property is used to get back an icon to use.
The client side script takes in the plural spelling without the s and add's the s when it is running so modules that use irregular plurals are not compatible with this property.

you can also decide to not use the target_module property and specify the url directly in the icon property.
if you specify both icon will be overridden
The administrator has disabled public write access.
Time to create page: 0.057 seconds
Powered by Kunena Forum