From cd066b825a8bf7915a07c4e37712a476594b5ed9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 6 Feb 2012 17:29:19 +0100 Subject: [PATCH] Fix: rename 'text' to 'string' --- htdocs/core/class/html.form.class.php | 8 +++----- htdocs/core/js/editinplace.js | 8 ++++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f4ec9c1e919..a4ef37e392f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1,10 +1,10 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2006 Marc Barilley/Ocebo * Copyright (C) 2007 Franky Van Liedekerke @@ -87,7 +87,6 @@ class Form if ($perm) { $tmp=explode(':',$typeofdata); - if (preg_match('/^(string|email|numeric)$/i',$tmp[0])) $tmp[0] = 'text'; $ret.= '
'; $ret.= $langs->trans($text); $ret.= '
'."\n"; @@ -237,8 +236,7 @@ class Form if (preg_match('/^(string|email|numeric)/',$inputType)) { $tmp=explode(':',$inputType); - $inputType='text'; - $inputOption=$tmp[1]; + $inputType=$tmp[0]; $inputOption=$tmp[1]; if (! empty($tmp[2])) $savemethod=$tmp[2]; } if (preg_match('/^datepicker/',$inputType)) diff --git a/htdocs/core/js/editinplace.js b/htdocs/core/js/editinplace.js index 32ef01985a9..8f91696a4cf 100644 --- a/htdocs/core/js/editinplace.js +++ b/htdocs/core/js/editinplace.js @@ -107,7 +107,7 @@ $(document).ready(function() { $( '#val_' + $(this).attr('id') ).click(); }); - $('.editval_text').editable(urlSaveInPlace, { + $('.editval_string').editable(urlSaveInPlace, { type : 'text', id : 'field', width : 300, @@ -118,7 +118,7 @@ $(document).ready(function() { indicator : indicatorInPlace, submitdata : function(result, settings) { var htmlname = $(this).attr('id').substr(4); - return getParameters('text', htmlname); + return getParameters('string', htmlname); }, callback : function(result, settings) { var obj = $.parseJSON(result); @@ -131,7 +131,7 @@ $(document).ready(function() { } } }); - $('.editkey_text').hover( + $('.editkey_string').hover( function () { $( '#val_' + $(this).attr('id') ).addClass("editval_hover"); }, @@ -139,7 +139,7 @@ $(document).ready(function() { $( '#val_' + $(this).attr('id') ).removeClass("editval_hover"); } ); - $('.editkey_text').click(function() { + $('.editkey_string').click(function() { $( '#val_' + $(this).attr('id') ).click(); });