17 require_once dirname(__FILE__).
'/../../calendar_event/calendar_event.inc';
34 var $parent_links = Array();
60 parent::load($assetid);
62 $this->parent_links = $GLOBALS[
'SQ_SYSTEM']->am->getLinks($assetid, SQ_SC_LINK_ALL,
'calendar_event_multi_date', FALSE,
'minor');
80 $replacee_link = $GLOBALS[
'SQ_SYSTEM']->am->getLink($link[
'asset']->
id, NULL,
'', TRUE, NULL,
'minor');
81 $replacee = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($replacee_link[
'majorid']);
82 if (substr($this->
attr(
'start_date'), 0, 10) == substr($link[
'asset']->
attr(
'start_date'), 0, 10)) {
83 $this->
setAttrValue(
'name',
'Modified: '.$replacee->name);
85 $this->
setAttrValue(
'name',
'Rescheduled from '.date(
'jS M Y', iso8601_ts($link[
'asset']->
attr(
'start_date'))).
': '.$replacee->name);
89 return parent::_preCreateCheck($link);
102 require_once SQ_FUDGE_PATH.
'/general/datetime.inc';
104 <table border=
"0" cellspacing=
"2" cellpadding=
"2">
106 <td><b><?php echo translate(
'name'); ?></b></td>
107 <td><?php echo $this->
attr(
'name'); ?></td>
110 if ($recurring_events = $GLOBALS[
'SQ_SYSTEM']->am->getParents($this->id,
'calendar_event_recurring', FALSE)) {
111 $root_url = array_values($GLOBALS[
'SQ_SYSTEM']->am->getRootURL());
112 if (is_array($root_url)) $root_url = $root_url[0];
115 <td><b><?php echo translate(
'cal_event_replaces_cancellation') ?></b></td>
118 $recurring_events = array_keys($recurring_events);
119 $recurring_event = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($recurring_events[0]);
120 if (isset($_REQUEST[
'SQ_CALENDAR_EVENT_ID'])) {
121 $cancellation_href = htmlspecialchars(replace_query_string_vars(Array(
'SQ_CALENDAR_EVENT_ID' => $recurring_events[0],
'SQ_CALENDAR_EVENT_ACTION' => NULL)));
123 $cancellation_href = $root_url.
'?a='.$recurring_events[0];
125 echo
'<a href="'.$cancellation_href.
'">'.$recurring_event->attr(
'name').
'</a>';
132 <td><b><?php echo translate(
'start_date') ?></b></td>
136 <td><b><?php echo translate(
'end_date') ?></b></td>
140 <td><b><?php echo translate(
'duration') ?></b></td>
143 $total_time = easy_time_total($this->
getDuration(), TRUE);
144 echo (empty($total_time) ?
'N/A' : $total_time);
148 <td><b><?php echo translate(
'description') ?></b></td>
173 $replacement = parent::getKeywordReplacement($keyword);
174 $empty_replacement = (((string)$replacement) ==
'%'.$keyword.
'%');
177 if ($empty_replacement && (count($this->parent_links) > 0)) {
179 $parent_link = reset($this->parent_links);
181 $parent_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($parent_link[
'majorid']);
182 $replacement = $parent_asset->getKeywordReplacement($keyword);
183 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($parent_asset);