mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 10:47:18 +00:00 
			
		
		
		
	Support for calendar events priorities and categories
Review 880 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@284849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -65,6 +65,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") | ||||
| 					<enum name="description"><para>The text description of the event</para></enum> | ||||
| 					<enum name="organizer"><para>The organizer of the event</para></enum> | ||||
| 					<enum name="location"><para>The location of the eventt</para></enum> | ||||
| 					<enum name="categories"><para>The categories of the event</para></enum> | ||||
| 					<enum name="priority"><para>The priority of the event</para></enum> | ||||
| 					<enum name="calendar"><para>The name of the calendar associated with the event</para></enum> | ||||
| 					<enum name="uid"><para>The unique identifier for this event</para></enum> | ||||
| 					<enum name="start"><para>The start time of the event</para></enum> | ||||
| @@ -112,6 +114,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") | ||||
| 					<enum name="description"><para>The full event description</para></enum> | ||||
| 					<enum name="organizer"><para>The event organizer</para></enum> | ||||
| 					<enum name="location"><para>The event location</para></enum> | ||||
| 					<enum name="categories"><para>The categories of the event</para></enum> | ||||
| 					<enum name="priority"><para>The priority of the event</para></enum> | ||||
| 					<enum name="calendar"><para>The name of the calendar associted with the event</para></enum> | ||||
| 					<enum name="uid"><para>The unique identifier for the event</para></enum> | ||||
| 					<enum name="start"><para>The start time of the event (in seconds since epoch)</para></enum> | ||||
| @@ -142,6 +146,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") | ||||
| 					<enum name="description"><para>The full event description</para></enum> | ||||
| 					<enum name="organizer"><para>The event organizer</para></enum> | ||||
| 					<enum name="location"><para>The event location</para></enum> | ||||
| 					<enum name="categories"><para>The categories of the event</para></enum> | ||||
| 					<enum name="priority"><para>The priority of the event</para></enum> | ||||
| 					<enum name="uid"><para>The unique identifier for the event</para></enum> | ||||
| 					<enum name="start"><para>The start time of the event (in seconds since epoch)</para></enum> | ||||
| 					<enum name="end"><para>The end time of the event (in seconds since epoch)</para></enum> | ||||
| @@ -786,6 +792,8 @@ static void copy_event_data(struct ast_calendar_event *dst, struct ast_calendar_ | ||||
| 	ast_string_field_set(dst, organizer, src->organizer); | ||||
| 	ast_string_field_set(dst, location, src->location); | ||||
| 	ast_string_field_set(dst, uid, src->uid); | ||||
| 	ast_string_field_set(dst, categories, src->categories); | ||||
| 	dst->priority = src->priority; | ||||
| 	dst->owner = src->owner; | ||||
| 	dst->start = src->start; | ||||
| 	dst->end = src->end; | ||||
| @@ -1228,6 +1236,10 @@ static int calendar_query_result_exec(struct ast_channel *chan, const char *cmd, | ||||
| 			ast_copy_string(buf, entry->event->organizer, len); | ||||
| 		} else if (!strcasecmp(args.field, "location")) { | ||||
| 			ast_copy_string(buf, entry->event->location, len); | ||||
| 		} else if (!strcasecmp(args.field, "categories")) { | ||||
| 			ast_copy_string(buf, entry->event->categories, len); | ||||
| 		} else if (!strcasecmp(args.field, "priority")) { | ||||
| 			snprintf(buf, len, "%d", entry->event->priority); | ||||
| 		} else if (!strcasecmp(args.field, "calendar")) { | ||||
| 			ast_copy_string(buf, entry->event->owner->name, len); | ||||
| 		} else if (!strcasecmp(args.field, "uid")) { | ||||
| @@ -1313,6 +1325,10 @@ static int calendar_write_exec(struct ast_channel *chan, const char *cmd, char * | ||||
| 			ast_string_field_set(event, organizer, values.value[j]); | ||||
| 		} else if (!strcasecmp(fields.field[i], "location")) { | ||||
| 			ast_string_field_set(event, location, values.value[j]); | ||||
| 		} else if (!strcasecmp(fields.field[i], "categories")) { | ||||
| 			ast_string_field_set(event, categories, values.value[j]); | ||||
| 		} else if (!strcasecmp(fields.field[i], "priority")) { | ||||
| 			event->priority = atoi(values.value[j]); | ||||
| 		} else if (!strcasecmp(fields.field[i], "uid")) { | ||||
| 			ast_string_field_set(event, uid, values.value[j]); | ||||
| 		} else if (!strcasecmp(fields.field[i], "start")) { | ||||
| @@ -1468,6 +1484,8 @@ static char *handle_show_calendar(struct ast_cli_entry *e, int cmd, struct ast_c | ||||
| 		ast_cli(a->fd, FORMAT2, "Description", event->description); | ||||
| 		ast_cli(a->fd, FORMAT2, "Organizer", event->organizer); | ||||
| 		ast_cli(a->fd, FORMAT2, "Location", event->location); | ||||
| 		ast_cli(a->fd, FORMAT2, "Cartegories", event->categories); | ||||
| 		ast_cli(a->fd, "%-12.12s: %d\n", "Priority", event->priority); | ||||
| 		ast_cli(a->fd, FORMAT2, "UID", event->uid); | ||||
| 		ast_cli(a->fd, FORMAT2, "Start", epoch_to_string(buf, sizeof(buf), event->start)); | ||||
| 		ast_cli(a->fd, FORMAT2, "End", epoch_to_string(buf, sizeof(buf), event->end)); | ||||
| @@ -1539,6 +1557,10 @@ static int calendar_event_read(struct ast_channel *chan, const char *cmd, char * | ||||
| 		ast_copy_string(buf, event->organizer, len); | ||||
| 	} else if (!strcasecmp(data, "location")) { | ||||
| 		ast_copy_string(buf, event->location, len); | ||||
| 	} else if (!strcasecmp(data, "categories")) { | ||||
| 		ast_copy_string(buf, event->categories, len); | ||||
| 	} else if (!strcasecmp(data, "priority")) { | ||||
| 		snprintf(buf, len, "%d", event->priority); | ||||
| 	} else if (!strcasecmp(data, "calendar")) { | ||||
| 		ast_copy_string(buf, event->owner->name, len); | ||||
| 	} else if (!strcasecmp(data, "uid")) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user