示例#1
0
 /**
  * Faz um diff do update se ouve realmente uma alteração envia um email a todos os participants
  *
  * @license    http://www.gnu.org/copyleft/gpl.html GPL
  * @author     Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
  * @sponsor    Caixa Econômica Federal
  * @author     Cristiano Corrêa Schmidt
  * @return     void
  * @access     public
  */
 public function updateEvent(&$uri, $params, &$criteria, $original)
 {
     $schedulableOld = Controller::read(array('concept' => 'schedulable', 'id' => $uri['id']), null, array('deepness' => '2'));
     $schedulable = $schedulableOld;
     $alt = false;
     foreach ($params as $i => $v) {
         //Verifica se ouve alteração no evento
         if (isset($schedulableOld[$i]) && $schedulableOld[$i] != $v && $i != 'participants') {
             $schedulable[$i] = $v;
             $alt = true;
         }
     }
     if ($alt === true && Config::regGet('noAlarm') === false && self::futureEvent($schedulable['startTime'], $schedulable['rangeEnd'], $schedulable['id'])) {
         $method = 'REQUEST';
         $notificationType = 'Modificação de Calendario';
         $part = 'othersAttendees';
         self::mountStruture($uri['id'], $schedulable, false, $data, $subject, $ical, $part, $method, $notificationType);
         $from = self::_getAttendeeOrganizer($schedulable);
         if (isset($part) && $part && count($part) > 0) {
             self::sendMail($data, $ical, implode(',', $part), $subject, $schedulableOld['type'] == '1' ? 'notify_modify_body' : 'notify_modify_body_task', $from);
         }
     }
 }