Ejemplo n.º 1
0
 $result = false;
 if (empty($id)) {
     $old_entry = array();
     $result = process_sql_insert('tagenda', $values);
 } else {
     $old_entry = get_db_row('tagenda', 'id', $id);
     $result = process_sql_update('tagenda', $values, array('id' => $id));
 }
 if ($result !== false) {
     if (empty($id)) {
         $groups = agenda_process_privacy_groups($result, $public, $groups);
     } else {
         $groups = agenda_process_privacy_groups($id, $public, $groups);
     }
     $full_path = $config['homedir'] . '/attachment/tmp/';
     $ical_text = create_ical($date . ' ' . $time, $duration, $config['id_user'], $description, "Integria imported event: {$title}");
     $full_filename = $full_path . $config['id_user'] . '-' . microtime(true) . '.ics';
     $full_filename_h = fopen($full_filename, 'a');
     fwrite($full_filename_h, $ical_text);
     fclose($full_filename_h);
     $nombre = get_db_value('nombre_real', 'tusuario', 'id_usuario', $config['id_user']);
     $email = get_db_value('direccion', 'tusuario', 'id_usuario', $config['id_user']);
     if (empty($id)) {
         $mail_description = $config["HEADER_EMAIL"] . "A new entry in calendar has been created by user " . $config['id_user'] . " ({$nombre})\n\n\n\t\t\t\tDate and time: {$date} {$time}\n\n\t\t\t\tTitle        : {$title}\n\n\t\t\t\tDescription  : {$description}\n\n" . $config["FOOTER_EMAIL"];
     } else {
         $mail_description = $config["HEADER_EMAIL"] . "A calendar entry has been updated by user " . $config['id_user'] . " ({$nombre})\n\n\n\t\t\t\tOld date and time: " . $old_entry['timestamp'] . "\n\n\t\t\t\tOld title        : " . $old_entry['title'] . "\n\n\t\t\t\tOld description  : " . $old_entry['description'] . "\n\n\n\t\t\t\tNew date and time: {$date} {$time}\n\n\t\t\t\tNew title        : {$title}\n\n\t\t\t\tNew description  : {$description}\n\n" . $config["FOOTER_EMAIL"];
     }
     $emails = array();
     $users = false;
     if ($public) {
         $users = get_user_visible_users($config['id_user'], 'AR', false, true, true);
Ejemplo n.º 2
0
			$groups = agenda_process_privacy_groups($id, $public, $groups);

		$i = 0;
		$str_groups = "";
		foreach ($groups as $key => $id_group) {
			$group_name = groups_get_group_name($id_group);
			if ($i == 0) {
				$str_groups = $group_name;
			} else {
				$str_groups .= ','.$group_name;
			}
			$i++;
		}

		$full_path = $config['homedir'].'/attachment/tmp/';
		$ical_text = create_ical ($date.' '.$time, $duration, $config['id_user'], $description, "Integria imported event: ".safe_output($title));
		$full_filename = $full_path.$config['id_user'].'-'.microtime(true).'.ics';
		$full_filename_h = fopen($full_filename, 'a');
		fwrite($full_filename_h, $ical_text);
		fclose($full_filename_h);

		$nombre = get_db_value('nombre_real', 'tusuario', 'id_usuario', $config['id_user']);
		$email = get_db_value('direccion', 'tusuario', 'id_usuario', $config['id_user']);
		
		//Macros
		$MACROS["_entry-username_"] = $config['id_user'];
		$MACROS["_entry-realname_"] = $nombre;
		
		$MACROS["_entry-date_"] = $date;
		$MACROS["_entry-time_"] = $time;
		$MACROS["_entry-title_"] = $title;