* eTemplate/all apps: removed custom-field widget type IP again, as it caused too many problems in various modules

This commit is contained in:
Ralf Becker 2014-04-08 11:59:55 +00:00
parent 2b6500ef80
commit 9532debc5d
4 changed files with 10 additions and 25 deletions

View File

@ -689,17 +689,13 @@ class boetemplate extends soetemplate
*/
static function &get_array(&$arr,$idx,$reference_into=False,$skip_empty=False)
{
// return content of $arr itself (but no reference!) in all error-cases: $arr no array or $idx an object
if (is_object($idx) || !is_array($arr))
if (!is_array($arr))
{
$ret = $arr;
return $ret;
throw new egw_exception_assertion_failed(__METHOD__."(\$arr,'$idx',$reference_into,$skip_empty) \$arr is no array!");
}
if ((string)$idx === '')
{
$idxs = array();
}
elseif (count($idxs = explode('[', $idx, 2)) > 1)
if (is_object($idx)) return false; // given an error in php5.2
if (count($idxs = explode('[', $idx, 2)) > 1)
{
$idxs = array_merge(array($idxs[0]), explode('][', substr($idxs[1],0,-1)));
}

View File

@ -59,7 +59,6 @@ class customfields_widget
'url-email'=> 'EMail',
'url-phone'=> 'Phone number',
'htmlarea' => 'Formatted Text (HTML)',
'client-ip'=> 'IP address',
'link-entry' => 'Select entry', // should be last type, as the individual apps get added behind
);
@ -340,12 +339,6 @@ class customfields_widget
'size' => implode(',',$options)
));
break;
case 'client-ip':
if (empty($value[$this->prefix.$lname]))
{
$value[$this->prefix.$lname] = egw_session::getuser_ip();
}
// fall through
case 'text' :
case 'textarea' :
case '' : // not set

View File

@ -1079,8 +1079,9 @@ class etemplate extends boetemplate
list($name) = explode('=',$name);
}
$form_name = self::form_name($cname,$name);
$value =& $this->get_array($content,$name);
$old_value = $value; // remember value to be able to restore it
$value = $this->get_array($content,$name);
$options = '';
if ($readonly = $cell['readonly'] && $readonlys[$name] !== false || // allow to overwrite readonly settings of a cell
@$readonlys[$name] && !is_array($readonlys[$name]) || $readonlys['__ALL__'] && (!is_string($name) || $readonlys[$name] !== false) ||
@ -1927,10 +1928,6 @@ class etemplate extends boetemplate
self::$request->unset_to_process($form_name);
self::$request->set_to_process($form_name,'ext-'.$ext_type,$to_process);
}
// restoring value, as it is a reference into content
// some widgets change it and rely on it being a reference
// using same name for multiple widgets breaks, if we dont restore it now
$value = $old_value;
// save blur-value to strip it in process_exec
if (!empty($blur) && self::$request->isset_to_process($form_name))
{

View File

@ -6,7 +6,7 @@
* @package etemplate
* @link http://www.egroupware.org
* @author RalfBecker-At-outdoor-training.de
* @copyright 2006-13 by RalfBecker-At-outdoor-training.de
* @copyright 2006-11 by RalfBecker-At-outdoor-training.de
* @license GPL - GNU General Public License
* @version $Id$
*/
@ -215,8 +215,7 @@ class historylog_widget
}
else
{
self::$status_widgets['#'.$cf_name] = !in_array($cf_data['type'], array('text', 'client-ip')) ?
$cf_data['type'] : 'label';
self::$status_widgets['#'.$cf_name] = $cf_data['type'] != 'text' ? $cf_data['type'] : 'label';
}
}
elseif($cf_data['values']['@'])