fixed not working autorepeat if $row_cont was used

This commit is contained in:
Ralf Becker 2014-03-28 17:32:32 +00:00
parent 8cfef6746d
commit ba4bb53c29
2 changed files with 20 additions and 10 deletions

View File

@ -7,7 +7,7 @@
* @subpackage api * @subpackage api
* @link http://www.egroupware.org * @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker@outdoor-training.de> * @author Ralf Becker <RalfBecker@outdoor-training.de>
* @copyright 2002-13 by RalfBecker@outdoor-training.de * @copyright 2002-14 by RalfBecker@outdoor-training.de
* @version $Id$ * @version $Id$
*/ */
@ -991,12 +991,16 @@ class etemplate_widget_box extends etemplate_widget
{ {
$pat = substr($pat,$pat[1] == '{' ? 2 : 1); $pat = substr($pat,$pat[1] == '{' ? 2 : 1);
$Ok = $pat[0] == 'r' && !(substr($pat,0,2) == 'r_' || substr($pat,0,4) == 'row_'); $Ok = $pat[0] == 'r' && !(substr($pat,0,2) == 'r_' ||
substr($pat,0,4) == 'row_' && substr($pat,0,8) != 'row_cont');
if ($Ok && ($value = self::get_array(self::$request->content, if ($Ok && ($fname=self::form_name($cname, $check_widget->id, $expand)) &&
$fname=self::form_name($cname, $check_widget->id, $expand))) !== false && isset($value)) // need to break if fname ends in [] as get_array() will ignore it and returns whole array
// for an id like "run[$row_cont[appname]]"
substr($fname, -2) != '[]' &&
($value = self::get_array(self::$request->content, $fname)) !== null) // null = not found (can be false!)
{ {
error_log(__METHOD__."($widget,$cname) $this autorepeating row $expand[row] because of $check_widget->id = '$fname' is ".array2string($value)); //error_log(__METHOD__."($widget,$cname) $this autorepeating row $expand[row] because of $check_widget->id = '$fname' is ".array2string($value));
return true; return true;
} }
} }

View File

@ -7,7 +7,7 @@
* @subpackage api * @subpackage api
* @link http://www.egroupware.org * @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker@outdoor-training.de> * @author Ralf Becker <RalfBecker@outdoor-training.de>
* @copyright 2002-11 by RalfBecker@outdoor-training.de * @copyright 2002-14 by RalfBecker@outdoor-training.de
* @version $Id$ * @version $Id$
*/ */
@ -184,20 +184,26 @@ class etemplate_widget_grid extends etemplate_widget_box
substr($pat,0,4) == 'col_'); substr($pat,0,4) == 'col_');
break; break;
case 'row': case 'row':
$Ok = $pat[0] == 'r' && !(substr($pat,0,2) == 'r_' || substr($pat,0,4) == 'row_'); $Ok = $pat[0] == 'r' && !(substr($pat,0,2) == 'r_' ||
substr($pat,0,4) == 'row_' && substr($pat,0,8) != 'row_cont');
//error_log(__METHOD__."() pat='$pat' --> Ok=".array2string($Ok));
break; break;
default: default:
return false; return false;
} }
if ($Ok && ($value = self::get_array(self::$request->content, if ($Ok && ($fname=self::form_name($cname, $child->id, $expand)) &&
$fname=self::form_name($cname, $child->id, $expand))) !== false && isset($value)) // need to break if fname ends in [] as get_array() will ignore it and returns whole array
// for an id like "run[$row_cont[appname]]"
substr($fname, -2) != '[]' &&
($value = self::get_array(self::$request->content,$fname)) !== null) // null = not found (can be false!)
{ {
//error_log(__METHOD__."('$method_name', ) $this autorepeating row $expand[row] because of $child->id = '$fname' is ".array2string($value)); //error_log(__METHOD__."('$cname', ) $this autorepeating row $expand[row] because of $child->id = '$fname' is ".array2string($value));
return true; return true;
} }
} }
} }
} }
//error_log(__METHOD__."('$cname', ) $this NOT autorepeating row $expand[row]");
return false; return false;
} }
} }