- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
private static function recalcReplyRate($contact, $flags)
{
try
{
if (!ANKETA_REPLY_RATE)
throw new Exception_Base('', -1);
if (empty($contact))
throw new Exception_Base('', -2);
if ($flags == 0 &&
$contact->getProperty('msg_count_from') == 0 &&
$contact->getProperty('msg_count_to') == 0)
{
$delta = 1;
$user_id = $contact->getProperty('anketa_id');
}
elseif ($flags == 1 &&
$contact->getProperty('msg_count_from') > 0 &&
$contact->getProperty('msg_count_to') == 0)
{
$delta = -1;
$user_id = $contact->getProperty('contact_anketa_id');
}
else
{
throw new Exception_Base('', -3);
}
Data_Helper::recalcReplyRate($delta, $user_id);
}
catch (Exception_Base $e)
{
return;
}
}