Extensions

Reminder Functions

Estimated reading: 5 minutes

GUI Element (Javascript)

limbasDivShowReminder

limbasDivShowReminder(evt,el,add,remove,changeView,change,defaults,gtabid,ID)
  • evt – event [event]
  • el – js element [this]
  • add – add [1]
  • remove – delete [reminder ID]
  • change – change [reminder ID]
  • defaults – default values [array]
  • gtabid – table ID [gtabid]
  • ID – dataset ID [ID]
defaults using in formular parameter:

    * datetime => string | e.g. '16.03.2016 22:44'
    * usergroups => string | e.g. '33_u;22_g;55_u' or  for the current user
    * remark => string
    * mail => 0 or 1
    * category => int | id of category to use, 0 for default
    * hidecurrent => 1 to hide
    * gtabid
    * ID
   /*

   $gtabid = 1;
   ID = 23;
   return array(
       'datetime' => '10.03.2017 22:55',
       'usergroups' => '1_u',
       'remark' => 'testtttt',
       'mail' => 0,
       'category' => 2,
       'hidecurrent' => 1
   );

PHP Functions

lmb_addReminder

function lmb_addReminder($gfrist,$gfrist_desc,$gtabid,$ID,$to=null,$category=0,$wfl_inst=null,$fielddesc=null,$sendmail=null,$form_id=null){ ... }

The lmb_addReminder function inserts a reminder into the lmb_addReminder table. There are the following transfer parameters:

  • timestamp $gfrist; fills the database field deadline
  • varchar $gfrist_desc; fills the database field description
  • int2 $gtabid; fills the database field tabid
  • numeric $ID; fills the database field dat_id
  • string $to Default null; _u if the reminder is assigned to a single user, _g if the reminder is for a group
  • int2 $category Default 0; Indicates in which reminder group the new reminder gets inserted into.
  • Numeric $wfl_inst (workflow instance) Default null; If the reminder is for a customer and the category “Aquise” is selected, the attribute $wfl_inst is set when the first point is set in the workflow.
  • String $fielddesc Default null; Database field content
  • boolean $sendmail Default null; Whether a message should be sent by mail.
  • int2 $form_id Default null; Which form should be opened when clicking the reminder.

The return value of the function is $out[] (USER_ID if the reminder is for a user or GROUP_ID if it is for a group)

message text

When sending a message, the message text can be customized via its own function. The function name must be defined by the template settings.
The function can be defined using the $greminder [$ gtabid] [“message”] [0] = ‘myExt_functname’ array.

Example

function myExt_sendReminderMessage($userid,$gtabid,$ID,$categorie,$date,$description,$header,$wfl_inst){
   global $userdat, $session;

   hallo ".$userdat["bezeichnung"][$userid]."<br><br>
   ".$session['vorname']." ".$session['name']." send you a $header - reminder for:<br>
   <i><b><a href=\"".$umgvar['url']."/main.php?action=\"> $header </a></b></i><br><br><br>$description<br><br>";

   $message .="
   -------------------------------------------------------------------------------------<br>
   This is an automatically generated email, please do not reply!<br>
   -------------------------------------------------------------------------------------<br>
   ";
}

lmb_dropReminder

function lmb_dropReminder($rem_id,$gtabid=null,$category=null,$ID=null,$wfl_inst=null,$active=null,$extension=null){ ... }

The lmb_dropReminder function deletes a reminder from the lmb_reminder table. There are the following transfer parameters:

  • numeric $ rem_id ID of the table lmb_reminder
  • int2 $gtabid Database field tabid
  • int2 $category Default 0; Selects the desired reminder group.
  • Numeric $ID Database field dat_id
  • numeric $wfl_inst (workflow instance) Default null; If the reminder is for a customer and the “Aquise” category is selected, the attribute $ wfl_inst is set when the first point has been set in the workflow.
  • Unknown_type $ active Default null; If active is not null, a where condition is set with FRIST <timestamp
  • string $extension Default null; If the extension is not null, a where condition is set with the extension as a condition, otherwise a where condition is executed that checks whether the active user or an active subgroup is set

The return value of the function is true if the reminder was successfully deleted and false if an error occurred during the delete operation.

lmb_changeReminder

function lmb_changeReminder($rem_id, $gfrist, $gfrist_desc){ ... }

The lmb_changeReminder function changes the date and description of a re-run from the lmb_reminder table. There are the following transfer parameters:

  • numeric $rem_id ID of the table lmb_reminder
  • timestamp $gzeit fills the database field deadline
  • varchar $gfrist_desc fills the database field description

The return value of the function is true if the reminder was successfully changed, and false if an error occurred during the change.

lmb_getReminder

function lmb_getReminder($gtabid=null,$ID=null,$category=null,$wfl_inst=null,$valid=null){ ... }

The function lmb_getReminder is a getter function for a reminder. There are the following transfer parameters:

  • int2 $gtabid Database field tabid
  • numeric $ID Database field dat_id
  • int2 $category Default 0; Determines from which reminder group the reminder is selected.
  • Numeric $wfl_inst (workflow instance) Default null; If the reminder is for a customer and the “Aquise” category is selected, the attribute $wfl_inst is set when the first point has been set in the workflow.
  • Unknown_type $valid Default null; If valid is not null, a where condition is set with FRIST <timestamp>

If the reminder query is successful, it will be returned; otherwise, false.

lmb_getReminderCount

function lmb_getReminderCount($category){ ... }

The function lmb_getReminderCount provides a simple way to get the number of active reminders. The following parameters can be passed:

  • int2 $category Default 0; Selects the reminder group in which all reminders should be counted.

The return value is the amount of reminders found.

Share this Doc

Reminder Functions

Or copy link

CONTENTS