diff options
author | Jim Hu <jimhu@users.sourceforge.net> | 2007-05-19 16:18:13 +0000 |
---|---|---|
committer | Jim Hu <jimhu@users.sourceforge.net> | 2007-05-19 16:18:13 +0000 |
commit | cc3fc71a8aca6cbd6c6263b9b4e08eaebaa52a44 (patch) | |
tree | b58eecf29add350a9be0399f874c640c9a3acc04 | |
parent | d2594889e58f17893f8a7dc4477b1723a6faf391 (diff) | |
download | phpicalendar-cc3fc71a8aca6cbd6c6263b9b4e08eaebaa52a44.tar.gz phpicalendar-cc3fc71a8aca6cbd6c6263b9b4e08eaebaa52a44.tar.bz2 phpicalendar-cc3fc71a8aca6cbd6c6263b9b4e08eaebaa52a44.zip |
fix bug 1641928 change todo popup to be like event popup
-rw-r--r-- | functions/event.js | 27 | ||||
-rw-r--r-- | functions/template.php | 13 | ||||
-rw-r--r-- | includes/todo.php | 2 | ||||
-rw-r--r-- | templates/default/header.tpl | 4 | ||||
-rw-r--r-- | templates/default/sidebar.tpl | 6 | ||||
-rw-r--r-- | templates/default/sidebar_year.tpl | 6 | ||||
-rw-r--r-- | templates/green/sidebar.tpl | 6 | ||||
-rw-r--r-- | templates/grey/sidebar.tpl | 6 | ||||
-rw-r--r-- | templates/red/sidebar.tpl | 6 | ||||
-rw-r--r-- | templates/red/sidebar_year.tpl | 6 | ||||
-rw-r--r-- | templates/tan/sidebar.tpl | 6 |
11 files changed, 57 insertions, 31 deletions
diff --git a/functions/event.js b/functions/event.js index 6895626..9020de9 100644 --- a/functions/event.js +++ b/functions/event.js @@ -23,16 +23,29 @@ function EventData(date, time, uid, cpath, event_data) { this.cpath = cpath; this.event_data = event_data; } +//--> +</script> +<script language="JavaScript" type="text/javascript"> +<!-- + +function openTodoInfo(num) { + // populate the hidden form + var data = document.todo_popup_data[num]; + var form = document.forms.todoPopupForm; -function openTodoInfo(vtodo_array) { - var windowW = 460; - var windowH = 275; - var url = "includes/todo.php?vtodo_array="+vtodo_array; - options = "scrollbars=yes,width="+windowW+",height="+windowH; - info = window.open(url, "Popup", options); - info.focus(); + form.elements.todo_data.value = data.todo_data; + + // open a new window + var w = window.open('', 'Popup', 'scrollbars=yes,width=460,height=275'); + form.target = 'Popup'; + form.submit(); +} +function TodoData(todo_data,todo_text) { + this.todo_data = todo_data; + this.todo_text = todo_text; } document.popup_data = new Array(); +document.todo_popup_data = new Array(); //--> </script> diff --git a/functions/template.php b/functions/template.php index 62c9edc..1353f75 100644 --- a/functions/template.php +++ b/functions/template.php @@ -779,7 +779,7 @@ class Page { $important = trim($match2[1]); $normal = trim($match3[1]); $nugget2 = ''; - + $todo_popup_data_index = 0; if (is_array($master_array['-2'])) { foreach ($master_array['-2'] as $vtodo_times) { foreach ($vtodo_times as $val) { @@ -805,8 +805,17 @@ class Page { 'start_date' => $start_date, 'status' => $status, 'vtodo_text' => $vtodo_text); + $vtodo_array = base64_encode(urlencode(serialize($vtodo_array))); + $todo = " + <script language=\"Javascript\" type=\"text/javascript\"><!-- + var todoData = new TodoData('$vtodo_array','$vtodo_text'); + document.todo_popup_data[$todo_popup_data_index] = todoData; + // --></script>"; - $vtodo_array = base64_encode(serialize($vtodo_array)); + $todo .= '<a class="psf" title="'.$title.'" href="#" onclick="openTodoInfo('.$todo_popup_data_index.'); return false;">'; + $todo_popup_data_index++; + $vtodo_array = $todo; + $vtodo_text = word_wrap(strip_tags(str_replace('<br />',' ',$vtodo_text), '<b><i><u>'), 21, $tomorrows_events_lines); $data = array ('{VTODO_TEXT}', '{VTODO_ARRAY}'); $rep = array ($vtodo_text, $vtodo_array); diff --git a/includes/todo.php b/includes/todo.php index 007632d..6823405 100644 --- a/includes/todo.php +++ b/includes/todo.php @@ -5,7 +5,7 @@ include_once(BASE.'functions/init.inc.php'); include_once(BASE.'functions/date_functions.php'); require_once(BASE.'functions/template.php'); -$vtodo_array = unserialize(base64_decode($_GET['vtodo_array'])); +$vtodo_array = unserialize(urldecode(base64_decode($_REQUEST['todo_data']))); // Set the variables from the array $vtodo_text = (isset($vtodo_array['vtodo_text'])) ? $vtodo_array['vtodo_text'] : (''); diff --git a/templates/default/header.tpl b/templates/default/header.tpl index 07837a9..884b5fc 100644 --- a/templates/default/header.tpl +++ b/templates/default/header.tpl @@ -18,3 +18,7 @@ <input type="hidden" name="cpath" id="cpath" value="" /> <input type="hidden" name="event_data" id="event_data" value="" /> </form> +<form name="todoPopupForm" id="todoPopupForm" method="post" action="includes/todo.php" style="display: none;"> + <input type="hidden" name="todo_data" id="todo_data" value="" /> + <input type="hidden" name="todo_text" id="todo_text" value="" /> +</form> diff --git a/templates/default/sidebar.tpl b/templates/default/sidebar.tpl index ba6ccd8..e5aa36a 100644 --- a/templates/default/sidebar.tpl +++ b/templates/default/sidebar.tpl @@ -161,21 +161,21 @@ <tr> <td><img src="images/completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><s><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></s></td> + <td><s>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></s></td> </tr> <!-- switch show_completed off --> <!-- switch show_important on --> <tr> <td><img src="images/important.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_important off --> <!-- switch show_normal on --> <tr> <td><img src="images/not_completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_normal off --> </table> diff --git a/templates/default/sidebar_year.tpl b/templates/default/sidebar_year.tpl index a34da93..f4b40d9 100644 --- a/templates/default/sidebar_year.tpl +++ b/templates/default/sidebar_year.tpl @@ -161,21 +161,21 @@ <tr> <td><img src="images/completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><s><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></s></td> + <td><s>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></s></td> </tr> <!-- switch show_completed off --> <!-- switch show_important on --> <tr> <td><img src="images/important.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_important off --> <!-- switch show_normal on --> <tr> <td><img src="images/not_completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_normal off --> </table> diff --git a/templates/green/sidebar.tpl b/templates/green/sidebar.tpl index ba6ccd8..e5aa36a 100644 --- a/templates/green/sidebar.tpl +++ b/templates/green/sidebar.tpl @@ -161,21 +161,21 @@ <tr> <td><img src="images/completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><s><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></s></td> + <td><s>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></s></td> </tr> <!-- switch show_completed off --> <!-- switch show_important on --> <tr> <td><img src="images/important.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_important off --> <!-- switch show_normal on --> <tr> <td><img src="images/not_completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_normal off --> </table> diff --git a/templates/grey/sidebar.tpl b/templates/grey/sidebar.tpl index ba6ccd8..e5aa36a 100644 --- a/templates/grey/sidebar.tpl +++ b/templates/grey/sidebar.tpl @@ -161,21 +161,21 @@ <tr> <td><img src="images/completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><s><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></s></td> + <td><s>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></s></td> </tr> <!-- switch show_completed off --> <!-- switch show_important on --> <tr> <td><img src="images/important.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_important off --> <!-- switch show_normal on --> <tr> <td><img src="images/not_completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_normal off --> </table> diff --git a/templates/red/sidebar.tpl b/templates/red/sidebar.tpl index ba6ccd8..e5aa36a 100644 --- a/templates/red/sidebar.tpl +++ b/templates/red/sidebar.tpl @@ -161,21 +161,21 @@ <tr> <td><img src="images/completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><s><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></s></td> + <td><s>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></s></td> </tr> <!-- switch show_completed off --> <!-- switch show_important on --> <tr> <td><img src="images/important.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_important off --> <!-- switch show_normal on --> <tr> <td><img src="images/not_completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_normal off --> </table> diff --git a/templates/red/sidebar_year.tpl b/templates/red/sidebar_year.tpl index a34da93..f4b40d9 100644 --- a/templates/red/sidebar_year.tpl +++ b/templates/red/sidebar_year.tpl @@ -161,21 +161,21 @@ <tr> <td><img src="images/completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><s><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></s></td> + <td><s>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></s></td> </tr> <!-- switch show_completed off --> <!-- switch show_important on --> <tr> <td><img src="images/important.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_important off --> <!-- switch show_normal on --> <tr> <td><img src="images/not_completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_normal off --> </table> diff --git a/templates/tan/sidebar.tpl b/templates/tan/sidebar.tpl index ba6ccd8..e5aa36a 100644 --- a/templates/tan/sidebar.tpl +++ b/templates/tan/sidebar.tpl @@ -161,21 +161,21 @@ <tr> <td><img src="images/completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><s><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></s></td> + <td><s>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></s></td> </tr> <!-- switch show_completed off --> <!-- switch show_important on --> <tr> <td><img src="images/important.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_important off --> <!-- switch show_normal on --> <tr> <td><img src="images/not_completed.gif" alt=" " width="13" height="11" border="0" align="middle" /></td> <td><img src="images/spacer.gif" width="2" height="1" border="0" alt="" /></td> - <td><a class="psf" href="javascript:openTodoInfo('{VTODO_ARRAY}')"><font class="G10B"> {VTODO_TEXT}</font></a></td> + <td>{VTODO_ARRAY}<font class="G10B"> {VTODO_TEXT}</font></a></td> </tr> <!-- switch show_normal off --> </table> |