]> git.pld-linux.org Git - packages/phpPgAdmin.git/blob - phpPgAdmin-calendar.patch
- make use of jscalendar library in date/time input fields
[packages/phpPgAdmin.git] / phpPgAdmin-calendar.patch
1 diff -ur phpPgAdmin-4.2.2.orig/classes/database/Postgres.php phpPgAdmin-4.2.2/classes/database/Postgres.php
2 --- phpPgAdmin-4.2.2.orig/classes/database/Postgres.php 2008-12-18 06:28:57.000000000 +0100
3 +++ phpPgAdmin-4.2.2/classes/database/Postgres.php      2009-01-12 23:28:00.000000000 +0100
4 @@ -320,6 +320,14 @@
5                                 echo htmlspecialchars($value);
6                                 echo "</textarea>\n";
7                                 break;
8 +                       case 'date':
9 +                               $showsTime='false'; $timeFormat='';
10 +                       case 'timestamp':
11 +                               if(!isset($showsTime)) { $showsTime='true'; $timeFormat=' %H:%M:%S'; }
12 +                               echo "<input name=\"", htmlspecialchars($name), "\" value=\"", htmlspecialchars($value), "\" size=\"35\"{$action_str} {$szExtra} id=\"", htmlspecialchars($name), "\"/>\n";
13 +                               echo "<button type=\"button\" onclick=\"return false\" id=\"trigger", htmlspecialchars($name), "\">...</button>";
14 +                               echo "<script type=\"text/javascript\">Calendar.setup( { inputField: \"", htmlspecialchars($name), "\", button: \"trigger", htmlspecialchars($name), "\", showsTime: $showsTime, ifFormat: \"%Y-%m-%d$timeFormat\" }); </script>";
15 +                               break;
16                         default:
17                                 echo "<input name=\"", htmlspecialchars($name), "\" value=\"", htmlspecialchars($value), "\" size=\"35\"{$action_str} {$szExtra} />\n";
18                                 break;
19 diff -ur phpPgAdmin-4.2.2.orig/classes/Misc.php phpPgAdmin-4.2.2/classes/Misc.php
20 --- phpPgAdmin-4.2.2.orig/classes/Misc.php      2008-12-18 06:28:57.000000000 +0100
21 +++ phpPgAdmin-4.2.2/classes/Misc.php   2009-04-13 17:22:01.000000000 +0200
22 @@ -374,6 +374,12 @@
23                                 echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$lang['appcharset']}\" />\n";
24                                 // Theme
25                                 echo "<link rel=\"stylesheet\" href=\"themes/{$conf['theme']}/global.css\" type=\"text/css\" />\n";
26 +?>
27 +<link rel="stylesheet" href="libraries/calendar/skins/aqua/theme.css" type="text/css" />
28 +<script src="libraries/calendar/calendar.js" type="text/javascript"></script>
29 +<script src="libraries/calendar/lang/calendar-en.js" type="text/javascript"></script>
30 +<script src="libraries/calendar/calendar-setup.js" type="text/javascript"></script>
31 +<?php
32                                 echo "<link rel=\"shortcut icon\" href=\"images/themes/{$conf['theme']}/Favicon.ico\" type=\"image/vnd.microsoft.icon\" />\n";
33                                 echo "<link rel=\"icon\" type=\"image/png\" href=\"images/themes/{$conf['theme']}/Introduction.png\" />\n";
34                                 echo "<title>", htmlspecialchars($appName);
35 diff -ur phpPgAdmin-4.2.2.orig/display.php phpPgAdmin-4.2.2/display.php
36 --- phpPgAdmin-4.2.2.orig/display.php   2008-12-18 06:28:57.000000000 +0100
37 +++ phpPgAdmin-4.2.2/display.php        2009-03-01 14:15:00.000000000 +0100
38 @@ -73,6 +73,7 @@
39                                 echo "<th class=\"data\">{$lang['strnull']}</th><th class=\"data\">{$lang['strvalue']}</th></tr>";
40  
41                                 $i = 0;
42 +                               $shift=0;
43                                 while (!$attrs->EOF) {
44                                         $szValueName = "values[{$attrs->fields['attname']}]";
45                                         $szEvents = '';
46 @@ -127,11 +128,12 @@
47                                         // as it contains '[' and ']' characters.
48                                         if (!$attrs->fields['attnotnull']) {
49                                                 echo $data->printField($szValueName, $rs->fields[$attrs->fields['attname']], $attrs->fields['type'], 
50 -                                                                                                       array('onChange' => 'elements[' . ($elements - 1) . '].checked = false;'),$szEvents) . $szDivPH;
51 +                                                                                                       array('onChange' => 'elements[' . ($elements - 1 + $shift) . '].checked = false;'),$szEvents) . $szDivPH;
52                                         }
53                                         else {
54                                                 echo $data->printField($szValueName, $rs->fields[$attrs->fields['attname']], $attrs->fields['type'],array(),$szEvents) . $szDivPH;
55                                         }
56 +                                       if (in_array(substr($attrs->fields['type'],0,9),array('date','timestamp'))) $shift++;
57                                         echo "</td>";
58                                         $elements++;
59                                         echo "</tr>\n";
This page took 0.029977 seconds and 4 git commands to generate.