Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
calendar_event_cancellation_edit_fns.inc
1 <?php
17 require_once dirname(__FILE__).'/../../calendar_event/calendar_event_edit_fns.inc';
18 
31 {
32 
33 
39  {
40  $this->Calendar_Event_Edit_Fns();
41 
42  }//end constructor
43 
44 
55  function paintDateTimeChooser(&$asset, &$o, $prefix)
56  {
57  if ($asset->writeAccess('attributes')) {
58  ?>
59  <script type="text/javascript" src="<?php echo sq_web_path('data').'/asset_types/calendar_event/js/date_chooser.js'?>"></script>
60  <?php
61  $ts = iso8601_ts($asset->attr('start_date'));
62  if ($ts == -1) $ts = 0;
63  $this->printDateChooser($prefix.'_start', $ts);
64  hidden_field($prefix.'_start_end_chooser_printed', 1);
65  ?>
66  <br /><?php translate('cal_event_cancel_must_be_date'); ?>
67  <?php
68  } else {
69  echo $asset->getFriendlyDatesAndTimes();
70  }
71 
72  }//end paintDateTimeChooser()
73 
74 
85  function processDateTimeChooser(&$asset, &$o, $prefix)
86  {
87  return $this->processStartEndChooser($asset, $o, $prefix);
88 
89  }//end processDateTimeChooser()
90 
91 
102  function paintRecurringEventChooser(&$asset, &$o, $prefix)
103  {
104  $modified_event_asset = NULL;
105  if ($asset->id) {
106  $recurring_event_ids = array_keys($GLOBALS['SQ_SYSTEM']->am->getParents($asset->id, 'calendar_event_recurring', FALSE));
107  if (!empty($recurring_event_ids)) {
108  $modified_event_asset =& $GLOBALS['SQ_SYSTEM']->am->getAsset($recurring_event_ids[0]);
109  }
110  }
111  if (!is_null($modified_event_asset)) {
112  echo get_asset_tag_line($modified_event_asset->id);
113  } else {
114  echo translate('cal_event_cancel_no_event_selected');
115  }
116 
117  }//end paintRecurringEventChooser()
118 
119 
130  function processRecurringEventChooser(&$asset, &$o, $prefix)
131  {
132  // not doing anything here; the field is processed in saveAttributes() because
133  // we need an ID first
134  return TRUE;
135 
136  }//end processRecurringEventChooser()
137 
138 
139 }//end class
140 
141 ?>