details: https://code.openbravo.com/erp/devel/pi/rev/51521741bf55 changeset: 35638:51521741bf55 user: Asier Lostalé <asier.lostale <at> openbravo.com> date: Fri Apr 05 14:35:00 2019 +0200 summary: fixed issue 40543: remove unused calendar.php
diffstat: web/js/jscalendar/calendar.php | 119 ----------------------------------------- web/js/jscalendar/test.php | 116 --------------------------------------- 2 files changed, 0 insertions(+), 235 deletions(-) diffs (243 lines): diff -r ecffeb5a82ad -r 51521741bf55 web/js/jscalendar/calendar.php --- a/web/js/jscalendar/calendar.php Fri Apr 05 14:25:15 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -<?php - -/** - * File: calendar.php | (c) dynarch.com 2004 - * Distributed as part of "The Coolest DHTML Calendar" - * under the same terms. - * ----------------------------------------------------------------- - * This file implements a simple PHP wrapper for the calendar. It - * allows you to easily include all the calendar files and setup the - * calendar by instantiating and calling a PHP object. - */ - -define('NEWLINE', "\n"); - -class DHTML_Calendar { - var $calendar_lib_path; - - var $calendar_file; - var $calendar_lang_file; - var $calendar_setup_file; - var $calendar_theme_file; - var $calendar_options; - - function DHTML_Calendar($calendar_lib_path = '/calendar/', - $lang = 'en', - $theme = 'calendar-win2k-1', - $stripped = true) { - if ($stripped) { - $this->calendar_file = 'calendar_stripped.js'; - $this->calendar_setup_file = 'calendar-setup_stripped.js'; - } else { - $this->calendar_file = 'calendar.js'; - $this->calendar_setup_file = 'calendar-setup.js'; - } - $this->calendar_lang_file = 'lang/calendar-' . $lang . '.js'; - $this->calendar_theme_file = $theme.'.css'; - $this->calendar_lib_path = preg_replace('/\/+$/', '/', $calendar_lib_path); - $this->calendar_options = array('ifFormat' => '%Y/%m/%d', - 'daFormat' => '%Y/%m/%d'); - } - - function set_option($name, $value) { - $this->calendar_options[$name] = $value; - } - - function load_files() { - echo $this->get_load_files_code(); - } - - function get_load_files_code() { - $code = ( '<link rel="stylesheet" type="text/css" media="all" href="' . - $this->calendar_lib_path . $this->calendar_theme_file . - '" />' . NEWLINE ); - $code .= ( '<script type="text/javascript" src="' . - $this->calendar_lib_path . $this->calendar_file . - '"></script>' . NEWLINE ); - $code .= ( '<script type="text/javascript" src="' . - $this->calendar_lib_path . $this->calendar_lang_file . - '"></script>' . NEWLINE ); - $code .= ( '<script type="text/javascript" src="' . - $this->calendar_lib_path . $this->calendar_setup_file . - '"></script>' ); - return $code; - } - - function _make_calendar($other_options = array()) { - $js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options)); - $code = ( '<script type="text/javascript">Calendar.setup({' . - $js_options . - '});</script>' ); - return $code; - } - - function make_input_field($cal_options = array(), $field_attributes = array()) { - $id = $this->_gen_id(); - $attrstr = $this->_make_html_attr(array_merge($field_attributes, - array('id' => $this->_field_id($id), - 'type' => 'text'))); - echo '<input ' . $attrstr .'/>'; - echo '<a href="#" id="'. $this->_trigger_id($id) . '">' . - '<img align="middle" border="0" src="' . $this->calendar_lib_path . 'img.gif" alt="" /></a>'; - - $options = array_merge($cal_options, - array('inputField' => $this->_field_id($id), - 'button' => $this->_trigger_id($id))); - echo $this->_make_calendar($options); - } - - /// PRIVATE SECTION - - function _field_id($id) { return 'f-calendar-field-' . $id; } - function _trigger_id($id) { return 'f-calendar-trigger-' . $id; } - function _gen_id() { static $id = 0; return ++$id; } - - function _make_js_hash($array) { - $jstr = ''; - reset($array); - while (list($key, $val) = each($array)) { - if (is_bool($val)) - $val = $val ? 'true' : 'false'; - else if (!is_numeric($val)) - $val = '"'.$val.'"'; - if ($jstr) $jstr .= ','; - $jstr .= '"' . $key . '":' . $val; - } - return $jstr; - } - - function _make_html_attr($array) { - $attrstr = ''; - reset($array); - while (list($key, $val) = each($array)) { - $attrstr .= $key . '="' . $val . '" '; - } - return $attrstr; - } -}; - -?> diff -r ecffeb5a82ad -r 51521741bf55 web/js/jscalendar/test.php --- a/web/js/jscalendar/test.php Fri Apr 05 14:25:15 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -<?php - -$lang = $_GET['lang']; -if (!$lang) { - $lang = $_REQUEST['lang']; -} -if (!$lang) { - $lang = 'en'; -} -setcookie('lang', $lang); - -?> -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<title> -Test for calendar.php -</title> - -<?php - -// put here the correct path to "calendar.php"; don't move the file -// "calendar.php" -- I think it's best if you leave it inside the -// "/jscalendar/" directory. Just put here the correct path to it, such as -// "../jscalendar/calendar.php" or something. -require_once ('calendar.php'); - -// parameters to constructor: -// 1. the absolute URL path to the calendar files -// 2. the languate used for the calendar (see the lang/ dir) -// 3. the theme file used for the clanedar, without the ".css" extension -// 4. boolean that specifies if the "_stripped" files are to be loaded -// The stripped files are smaller as they have no whitespace and comments -$calendar = new DHTML_Calendar('/jscalendar/', $lang, 'calendar-win2k-2', false); - -// call this in the <head> section; it will "echo" code that loads the calendar -// scripts and theme file. -$calendar->load_files(); - -?> - -</head> - -<body> - -<?php if ($_REQUEST['submitted']) { ?> - -<h1>Form submitted</h1> - -<?php foreach ($_REQUEST as $key => $val) { - echo htmlspecialchars($key) . ' = ' . htmlspecialchars($val) . '<br />'; -} ?> - -<?php } else { ?> - -<h1>Calendar.php test</h1> - - <form action="test.php" method="get"> - Select language: <select name="lang" onchange="this.form.submit()"> - <?php -$cwd = getcwd(); -chdir('lang'); -foreach (glob('*.js') as $filename) { - $l = preg_replace('/(^calendar-|.js$)/', '', $filename); - $selected = ''; - if ($l == $lang) - $selected = 'selected="selected" '; - $display = $l; - if ($l == 'en') - $display = 'EN'; - echo '<option ' . $selected . 'value="' . $l . '">' . $display . '</option>'; -} - ?> - </select> - <blockquote style="font-size: 90%"> - <b>NOTE</b>: as of this release, 0.9.6, only "EN" and "RO", which I - maintain, function correctly. Other language files do not work - because they need to be updated. If you update some language file, - please consider sending it back to me so that I can include it in the - calendar distribution. - </blockquote> - </form> - - <form action="test.php" method="get"> - <input type="hidden" name="submitted" value="1" /> - - <table> - <tr> - <td> - Date 1: - </td> - <td> - <?php $calendar->make_input_field( - // calendar options go here; see the documentation and/or calendar-setup.js - array('firstDay' => 1, // show Monday first - 'showsTime' => true, - 'showOthers' => true, - 'ifFormat' => '%Y-%m-%d %I:%M %P', - 'timeFormat' => '12'), - // field attributes go here - array('style' => 'width: 15em; color: #840; background-color: #ff8; border: 1px solid #000; text-align: center', - 'name' => 'date1', - 'value' => strftime('%Y-%m-%d %I:%M %P', strtotime('now')))); ?> - </td> - </tr> - </table> - - <hr /> - <button>Submit</button> - - </form> - -<?php } ?> - -</body> -</html> _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits