Click on time of event to edit event
authorunknown <kevinyeh@alum.mit.edu>
Mon, 12 Nov 2012 17:11:55 +0000 (12 12:11 -0500)
committerunknown <kevinyeh@alum.mit.edu>
Tue, 13 Nov 2012 02:52:42 +0000 (12 21:52 -0500)
interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/ajax_template.html
interface/main/calendar/modules/PostCalendar/pntemplates/default/views/header.html
interface/main/calendar/modules/PostCalendar/pntemplates/default/views/month/ajax_template.html
interface/main/calendar/modules/PostCalendar/pntemplates/default/views/week/ajax_template.html
interface/themes/ajax_calendar.css

index 7b06e44..d0023d8 100644 (file)
@@ -635,7 +635,7 @@ foreach ($providers as $provider) {
                 // some sort of patient appointment
                 $divTitle .= "\r\n[".$catname.' '.htmlspecialchars($comment, ENT_QUOTES) ."]".htmlspecialchars($fname, ENT_QUOTES)." ".htmlspecialchars($lname, ENT_QUOTES);
                 $content .= "<span class='appointment'>";
-                $content .= $dispstarth . ':' . $startm;
+                $content .= create_event_time_anchor($dispstarth.":".$startm);
                 if ($event['recurrtype'] == 1) $content .= "<img src='$TPL_IMAGE_PATH/repeating8.png' border='0' style='margin:0px 2px 0px 2px;' title='".htmlspecialchars(xl("Repeating event"),ENT_QUOTES)."' alt='".htmlspecialchars(xl("Repeating event"),ENT_QUOTES)."'>";
                 // $content .= htmlspecialchars($event['apptstatus']);
                 $content .= '&nbsp;'.htmlspecialchars($event['apptstatus']);
index 855c68e..71ce122 100644 (file)
 <script type="text/javascript" src="[-php-] echo $GLOBALS['webroot'] [-/php-]/library/textformat.js"></script>
 <script type="text/javascript" src="[-php-] echo $GLOBALS['webroot'] [-/php-]/library/js/jquery-1.6.4.min.js"></script>
 <script type="text/javascript" src="[-php-] echo $GLOBALS['webroot'] [-/php-]/library/js/calendarDirectSelect.js"></script>
-
+<script>function event_time_click(elem){EditEvent($(elem).parents("div.event_appointment").get(0))} </script>
+[-php-]
+/**
+ * @param string $displayString This is the text to be displayed(most likely representing the time of an event).  It is the responsibility of the caller to escape any entities as needed. This allows html tags to be used in the $displayString if desired.
+ * @return string html anchor element with javascript onclick event that edits an appointment
+ */
+function create_event_time_anchor($displayString)
+{
+    $title=htmlspecialchars(xl('Click to edit'));
+    return "<a class='event_time' onclick='event_time_click(this)' title='" .$title."'>".$displayString."</a>";
+}
+[-/php-]
 [-/if-]
 
 </head>
index 48f860c..0768bf6 100644 (file)
@@ -498,7 +498,7 @@ foreach ($providers as $provider) {
             else {
                 // some sort of patient appointment
                 $divTitle .= "\r\n[".$catname.' '.htmlspecialchars($comment, ENT_QUOTES) ."]".htmlspecialchars($fname,ENT_QUOTES)." ".htmlspecialchars($lname,ENT_QUOTES);
-                $content .= $displayTime;
+                $content .= create_event_time_anchor($displayTime);
                 if ($patientid) {
                     // include patient name and link to their details
                     $link_title = htmlspecialchars($fname,ENT_QUOTES)." ".htmlspecialchars($lname,ENT_QUOTES). " \n";
index d2bd5c3..9132314 100644 (file)
@@ -676,7 +676,7 @@ foreach ($providers as $provider) {
                 // some sort of patient appointment
                 $divTitle .= "\r\n[".$catname.' '.htmlspecialchars($comment, ENT_QUOTES) ."] ".htmlspecialchars($fname,ENT_QUOTES)." ".htmlspecialchars($lname,ENT_QUOTES);
                 $content .= "<span class='appointment".$apptToggle."'>";
-                $content .= $dispstarth . ':' . $startm;
+                $content .= create_event_time_anchor($dispstarth . ':' . $startm);
                 if ($event['recurrtype'] == 1) $content .= "<img src='$TPL_IMAGE_PATH/repeating8.png' border='0' style='margin:0px 2px 0px 2px;' title='Repeating event' alt='Repeating event'>";
                 $content .= htmlspecialchars($event['apptstatus']);
                 if ($patientid) {
index 86ccb50..fe99dbb 100644 (file)
@@ -302,6 +302,15 @@ div.tiny { width:1px; height:1px; font-size:1px; }
     margin: -3px;
     background-color: black;
 }
+.event_time
+{
+    cursor: pointer;
+}
+.event_time:hover
+{
+    color: red;
+}
+
 .view1 {
 font-size:10px;
 }