[PHPVortex-Commit] phpvortex FT_Numeric.class.php, NONE, 1.1 FT_Base.class.php, 1.10, 1.11 FT_File.
Brought to you by:
nop144666
From: Thiago R. <nop...@us...> - 2006-11-02 16:54:35
|
Update of /cvsroot/phpvortex/phpvortex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14412 Modified Files: FT_Base.class.php FT_File.class.php FT_List.class.php FT_ListArray.class.php SEC_Edit.class.php SEC_Page.class.php TB_Base.class.php URL.class.php debug.php Added Files: FT_Numeric.class.php Log Message: Added a FT_Numeric class, and a lot of bug fixes --- NEW FILE: FT_Numeric.class.php --- <?php /** * File for class FT_Numeric. * * @package Vortex * @subpackage DB * @author Thiago Ramon Gonçalves Montoya * @copyright Copyright 2004, Thiago Ramon Gonçalves Montoya * @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ /** Require the base class */ require_once('FT_Base.class.php'); /** * Database field, Numeric field. * * @package Vortex * @subpackage DB */ class FT_Numeric extends FT_Base { /** * Output the field as a HTML Form. * * @param string $value Value to load the control with. */ function ShowForm($value, $origin = FT_OR_DB) { echo "<input type='text' name='{$this->name_form}' value='$value' />"; } /** * Output the field as plain text. * * @param string $value Value to load the control with. */ function ShowPlain($value, $origin = FT_OR_DB) { echo $value; } /** * Output the field consistency testing in JavaScript. */ function JSConsist() { if ($this->required) { echo <<<END if (frm.{$this->name_form}.value == "") errors += " * {$this->label}\\n"; END; } } /** * Test the field consistency. * * @param string $field The data from the field to be tested. * @return bool Returns TRUE if the field is consistent, FALSE otherwise. */ function ConsistTest(&$field) { if ($this->required && ($field == '')) return FALSE; return TRUE; } /** * Format the field for a WHERE clause. * * @param string $field The data from the field to be formated. * @return string Returns the formated field. */ function Where(&$field) { return "{$this->name_db} = $field"; } } ?> Index: FT_ListArray.class.php =================================================================== RCS file: /cvsroot/phpvortex/phpvortex/FT_ListArray.class.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FT_ListArray.class.php 29 Sep 2005 20:23:17 -0000 1.2 --- FT_ListArray.class.php 2 Nov 2006 16:54:24 -0000 1.3 *************** *** 88,102 **** return TRUE; } - - /** - * Format the field for database insertion. - * - * @param string $field The data from the field to be formated. - * @return string Returns the formated field. - */ - function ConsistFormat(&$field) - { - return (string)((int)$field); - } } --- 88,91 ---- Index: URL.class.php =================================================================== RCS file: /cvsroot/phpvortex/phpvortex/URL.class.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** URL.class.php 6 Aug 2006 14:21:08 -0000 1.3 --- URL.class.php 2 Nov 2006 16:54:24 -0000 1.4 *************** *** 55,59 **** $this->parameters = array(); if (count($parts)==2) { ! $params = explode('&', $parts[1]); foreach ($params as $param) { $pieces = explode('=',$param); --- 55,59 ---- $this->parameters = array(); if (count($parts)==2) { ! $params = explode('&', str_replace('&', '&', $parts[1])); foreach ($params as $param) { $pieces = explode('=',$param); Index: FT_Base.class.php =================================================================== RCS file: /cvsroot/phpvortex/phpvortex/FT_Base.class.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FT_Base.class.php 29 Sep 2005 20:23:17 -0000 1.10 --- FT_Base.class.php 2 Nov 2006 16:54:24 -0000 1.11 *************** *** 158,162 **** return FALSE; } else { ! return "'".$this->default."'"; } } --- 158,162 ---- return FALSE; } else { ! return $this->ConsistFormat($this->default); } } Index: FT_File.class.php =================================================================== RCS file: /cvsroot/phpvortex/phpvortex/FT_File.class.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FT_File.class.php 6 Aug 2006 16:20:48 -0000 1.1 --- FT_File.class.php 2 Nov 2006 16:54:24 -0000 1.2 *************** *** 122,126 **** return FALSE; } else { ! return "'".$this->default."'"; } } --- 122,126 ---- return FALSE; } else { ! return $this->ConsistFormat($this->default); } } Index: SEC_Page.class.php =================================================================== RCS file: /cvsroot/phpvortex/phpvortex/SEC_Page.class.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SEC_Page.class.php 7 Oct 2004 21:21:05 -0000 1.4 --- SEC_Page.class.php 2 Nov 2006 16:54:24 -0000 1.5 *************** *** 81,85 **** $this->AddSection('header', $this->header['class'], $this->header['opts']); } ! $this->AddSection('body_open', 'SEC_Static', array('code' => "<body>".(!empty($this->onload)?" onload='{$this->onload}'":'')."\n")); if (!empty($this->layout)) { foreach ($this->layout as $sect) { --- 81,85 ---- $this->AddSection('header', $this->header['class'], $this->header['opts']); } ! $this->AddSection('body_open', 'SEC_Static', array('code' => "<body".(!empty($this->onload)?" onload='{$this->onload}'":'').">\n")); if (!empty($this->layout)) { foreach ($this->layout as $sect) { Index: FT_List.class.php =================================================================== RCS file: /cvsroot/phpvortex/phpvortex/FT_List.class.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FT_List.class.php 29 Sep 2005 20:23:17 -0000 1.3 --- FT_List.class.php 2 Nov 2006 16:54:24 -0000 1.4 *************** *** 67,71 **** { parent::FT_Base($db, $opts); ! is_null($this->rel_order) and $this->rel_order = $this->rel_label; } --- 67,71 ---- { parent::FT_Base($db, $opts); ! empty($this->rel_order) and $this->rel_order = $this->rel_label; } Index: debug.php =================================================================== RCS file: /cvsroot/phpvortex/phpvortex/debug.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** debug.php 30 Sep 2004 19:27:47 -0000 1.3 --- debug.php 2 Nov 2006 16:54:24 -0000 1.4 *************** *** 17,20 **** --- 17,22 ---- include_once("debuglib.php"); + error_reporting(E_ALL); + /** * Outputs a debug message, and optionally a variable's content. *************** *** 50,53 **** --- 52,57 ---- } } else { + error_reporting(0); + /** @ignore */ function d($msg, $var = NULL) // Out of debug mode, does nothing. Index: SEC_Edit.class.php =================================================================== RCS file: /cvsroot/phpvortex/phpvortex/SEC_Edit.class.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SEC_Edit.class.php 29 Sep 2005 20:23:17 -0000 1.4 --- SEC_Edit.class.php 2 Nov 2006 16:54:24 -0000 1.5 *************** *** 205,208 **** --- 205,209 ---- $this->AddSection("{$this->table->name}_list", $this->list, $opts); + $url =& new URL(); $url->parameters["{$this->table->name}_action"] = 'S'; $this->AddSection("{$this->table->name}_form", $this->form, array( *************** *** 294,298 **** unset($url->parameters["page_{$this->table->name}"]); $url->parameters["{$this->table->name}_action"] = 'R'; ! $code .= "<script language='JavaScript'>\n\tfunction {$this->table->name}_Reset() {\n\t\tdocument.form_{$this->table->name}.action = '".$url->Get()."';\n\t\tdocument.form_{$this->table->name}.submit();\n\t}\n</script>\n"; if (empty($this->img_reset)) { $code .= "<input type='button' value='".(empty($this->txt_reset)?$vortex_msgs['form_reset']:$this->txt_reset)."' onclick='{$this->table->name}_Reset();' />\n"; --- 295,299 ---- unset($url->parameters["page_{$this->table->name}"]); $url->parameters["{$this->table->name}_action"] = 'R'; ! $code .= "<script language='JavaScript'>\n\tfunction {$this->table->name}_Reset() {\n\t\tdocument.form_{$this->table->name}.action = '".str_replace('&', '&', $url->Get())."';\n\t\tdocument.form_{$this->table->name}.submit();\n\t}\n</script>\n"; if (empty($this->img_reset)) { $code .= "<input type='button' value='".(empty($this->txt_reset)?$vortex_msgs['form_reset']:$this->txt_reset)."' onclick='{$this->table->name}_Reset();' />\n"; *************** *** 303,307 **** $url =& new URL(); $url->parameters["{$this->table->name}_action"] = 'N'; ! $code .= "<script language='JavaScript'>\n\tfunction {$this->table->name}_New() {\n\t\tdocument.form_{$this->table->name}.action = '".$url->Get()."';\n\t\tdocument.form_{$this->table->name}.submit();\n\t}\n</script>\n"; if (empty($this->img_new)) { $code .= "<input type='button' value='".(empty($this->txt_new)?$vortex_msgs['form_new']:$this->txt_new)."' onclick='{$this->table->name}_New();' />\n"; --- 304,308 ---- $url =& new URL(); $url->parameters["{$this->table->name}_action"] = 'N'; ! $code .= "<script language='JavaScript'>\n\tfunction {$this->table->name}_New() {\n\t\tdocument.form_{$this->table->name}.action = '".str_replace('&', '&', $url->Get())."';\n\t\tdocument.form_{$this->table->name}.submit();\n\t}\n</script>\n"; if (empty($this->img_new)) { $code .= "<input type='button' value='".(empty($this->txt_new)?$vortex_msgs['form_new']:$this->txt_new)."' onclick='{$this->table->name}_New();' />\n"; *************** *** 312,316 **** $url =& new URL(); $url->parameters["{$this->table->name}_action"] = 'D'; ! $code .= "<script language='JavaScript'>\n\tfunction {$this->table->name}_Delete() {\n\t\tdocument.form_{$this->table->name}.action = '".$url->Get()."';\n\t\tdocument.form_{$this->table->name}.submit();\n\t}\n</script>\n"; if (empty($this->img_delete)) { $code .= "<input type='button' value='".(empty($this->txt_delete)?$vortex_msgs['form_delete']:$this->txt_delete)."' onclick='{$this->table->name}_Delete();' />\n"; --- 313,317 ---- $url =& new URL(); $url->parameters["{$this->table->name}_action"] = 'D'; ! $code .= "<script language='JavaScript'>\n\tfunction {$this->table->name}_Delete() {\n\t\tdocument.form_{$this->table->name}.action = '".str_replace('&', '&', $url->Get())."';\n\t\tdocument.form_{$this->table->name}.submit();\n\t}\n</script>\n"; if (empty($this->img_delete)) { $code .= "<input type='button' value='".(empty($this->txt_delete)?$vortex_msgs['form_delete']:$this->txt_delete)."' onclick='{$this->table->name}_Delete();' />\n"; *************** *** 322,326 **** unset($url->parameters["page_{$this->table->name}"]); $url->parameters["{$this->table->name}_action"] = 'F'; ! $code .= "<script language='JavaScript'>\n\tfunction {$this->table->name}_Find() {\n\t\tdocument.form_{$this->table->name}.action = '".$url->Get()."';\n\t\tdocument.form_{$this->table->name}.submit();\n\t}\n</script>\n"; if (empty($this->img_find)) { $code .= "<input type='button' value='".(empty($this->txt_find)?$vortex_msgs['form_find']:$this->txt_find)."' onclick='{$this->table->name}_Find();' />\n"; --- 323,327 ---- unset($url->parameters["page_{$this->table->name}"]); $url->parameters["{$this->table->name}_action"] = 'F'; ! $code .= "<script language='JavaScript'>\n\tfunction {$this->table->name}_Find() {\n\t\tdocument.form_{$this->table->name}.action = '".str_replace('&', '&', $url->Get())."';\n\t\tdocument.form_{$this->table->name}.submit();\n\t}\n</script>\n"; if (empty($this->img_find)) { $code .= "<input type='button' value='".(empty($this->txt_find)?$vortex_msgs['form_find']:$this->txt_find)."' onclick='{$this->table->name}_Find();' />\n"; Index: TB_Base.class.php =================================================================== RCS file: /cvsroot/phpvortex/phpvortex/TB_Base.class.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TB_Base.class.php 6 Aug 2006 16:20:48 -0000 1.16 --- TB_Base.class.php 2 Nov 2006 16:54:24 -0000 1.17 *************** *** 202,206 **** $where .= (strlen($where)?' AND ':'').$field->Where($value); } else { ! $values[$field->name_db] = $value; } } --- 202,208 ---- $where .= (strlen($where)?' AND ':'').$field->Where($value); } else { ! if (($value != $field->ConsistFormat($field->default)) || isset($data[$field->name_form]) || $field->required) { ! $values[$field->name_db] = $value; ! } } } *************** *** 214,218 **** return FALSE; } ! return TRUE; } if (empty($values)) { --- 216,221 ---- return FALSE; } ! $id = $rs->LastId(); ! return (($id > 0)?$id:TRUE); } if (empty($values)) { |