diff --git a/addressbook/templates/default/edit.xet b/addressbook/templates/default/edit.xet
index cd6fc35dcd..754a77eec8 100644
--- a/addressbook/templates/default/edit.xet
+++ b/addressbook/templates/default/edit.xet
@@ -1,6 +1,5 @@
-
-
+
@@ -10,35 +9,28 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -54,101 +46,91 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+ set_value="tel_assistent" ro_true="♥" />
+
+
+
+
+
-
-
+
+
-
-
+ set_value="tel_fax" ro_true="♥" />
+
+
-
-
+
+
-
-
+ set_value="tel_other" ro_true="♥" />
+
+
-
-
+
+
-
-
-
-
-
-
+ set_value="tel_assistent" ro_true="♥" />
+
+
+
+
+
+
-
-
+
+
-
-
+ set_value="tel_fax" ro_true="♥" />
+
+
-
-
+
+
-
-
+ set_value="tel_other" ro_true="♥" />
+
+
-
-
+
+
-
-
+ set_value="tel_car" ro_true="♥" />
+
+
-
-
-
-
-
+
+
+
+
+
@@ -165,8 +147,8 @@
-
-
+
+
@@ -174,38 +156,38 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
-
+
+
-
+
@@ -222,99 +204,89 @@
-
-
+
+
-
-
-
+ set_value="tel_home" ro_true="♥" />
+
+
+
-
-
+
+
-
-
-
+ set_value="tel_cell_private" ro_true="♥" />
+
+
+
-
-
+
+
-
-
-
-
-
-
+ set_value="tel_fax_home" ro_true="♥" />
+
+
+
+
+
+
-
-
+
+
-
-
-
+ set_value="tel_pager" ro_true="♥" />
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+ set_value="tel_fax_home" ro_true="♥" />
+
+
+
+
+
+
+
-
-
+
+
-
-
-
+ set_value="tel_pager" ro_true="♥" />
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
@@ -326,31 +298,31 @@
-
+
-
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
@@ -368,51 +340,45 @@
-
+
@@ -434,65 +400,53 @@
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
-
\ No newline at end of file
+
diff --git a/api/etemplate.php b/api/etemplate.php
index 1ff2aeb3ad..f40dede5a0 100644
--- a/api/etemplate.php
+++ b/api/etemplate.php
@@ -34,31 +34,80 @@ $GLOBALS['egw_info'] = array(
);
$start = microtime(true);
-include '../header.inc.php';
+include dirname(__DIR__).'/header.inc.php';
send_template();
+/**
+ * Give usage plus option error and exit
+ *
+ * @param string $prog
+ * @param string? $err
+ * @return void
+ */
+function usage($prog, $err=null)
+{
+ error_log("Usage: $prog [(-i|--in-place)] \n");
+ error_log("\t convert to new syntax and output or replace it in-place.\n\n");
+ if ($err) error_log("$err\n\n");
+ exit;
+}
+
function send_template()
{
$header_include = microtime(true);
- // release session, as we don't need it and it blocks parallel requests
- $GLOBALS['egw']->session->commit_session();
+ if (PHP_SAPI === 'cli')
+ {
+ $in_place = false;
+ $args = $_SERVER['argv'];
+ $prog = array_shift($args);
+ while($args[0][0] === '-')
+ {
+ switch($arg = array_shift($args))
+ {
+ case '-i':
+ case '--in-place':
+ $in_place = true;
+ break;
+ default:
+ usage($prog, "Invalid argument '$arg'!");
+ }
+ if (count($args) !== 1)
+ {
+ usage($prog);
+ }
+ }
+ $fspath = array_shift($args);
+ if ($fspath[0] !== '/') $fspath = '/'.$fspath;
+ }
+ else
+ {
+ // release session, as we don't need it and it blocks parallel requests
+ $GLOBALS['egw']->session->commit_session();
- header('Content-Type: application/xml; charset=UTF-8');
+ header('Content-Type: application/xml; charset=UTF-8');
- //$path = EGW_SERVER_ROOT.$_SERVER['PATH_INFO'];
+ $fspath = $_SERVER['PATH_INFO'];
+ }
// check for customized template in VFS
- list(, $app, , $template, $name) = explode('/', $_SERVER['PATH_INFO']);
+ list(, $app, , $template, $name) = explode('/', $fspath);
$path = Api\Etemplate::rel2path(Api\Etemplate::relPath($app . '.' . basename($name, '.xet'), $template));
if(empty($path) || !file_exists($path) || !is_readable($path))
{
- http_response_code(404);
+ if (PHP_SAPI === 'cli')
+ {
+ usage("Path '$path' NOT found!");
+ }
+ else
+ {
+ http_response_code(404);
+ }
exit;
}
$cache = $GLOBALS['egw_info']['server']['temp_dir'].'/egw_cache/eT2-Cache-'.
$GLOBALS['egw_info']['server']['install_id'].'-'.str_replace('/', '-', $_SERVER['PATH_INFO']);
- if (file_exists($cache) && filemtime($cache) > max(filemtime($path), filemtime(__FILE__)) &&
+ if (PHP_SAPI !== 'cli' && file_exists($cache) && filemtime($cache) > max(filemtime($path), filemtime(__FILE__)) &&
($str = file_get_contents($cache)) !== false)
{
$cache_read = microtime(true);
@@ -453,7 +502,37 @@ function send_template()
// stop here for not existing file or path-traversal for both file and cache here
if(empty($str) || strpos($path, '..') !== false)
{
- http_response_code(404);
+ if (PHP_SAPI === 'cli')
+ {
+ usage("Path '$path' NOT found!");
+ }
+ else
+ {
+ http_response_code(404);
+ }
+ exit;
+ }
+
+ // remove old CSV Id
+ $str = trim(str_replace("\n", '', $str))."\n";
+
+ // replace DTD
+ $str = preg_replace('/^$/m',
+ '', $str);
+
+ // cli just echos or updates the file
+ if (PHP_SAPI === 'cli')
+ {
+ if (!$in_place)
+ {
+ echo $str;
+ }
+ elseif (!is_writable($path) ||
+ !rename($path, dirname($path).'/'.basename($path, '.xet').'.old.xet') ||
+ file_put_contents($path, $str) !== strlen($str))
+ {
+ error_log("Error writing file '$path'!\n");
+ }
exit;
}
diff --git a/api/src/Etemplate/Widget.php b/api/src/Etemplate/Widget.php
index 51879fee7f..e83459f8bb 100644
--- a/api/src/Etemplate/Widget.php
+++ b/api/src/Etemplate/Widget.php
@@ -18,6 +18,8 @@ use ReflectionMethod;
/**
* eTemplate widget baseclass
+ *
+ * @property-read string $required check $attrs['required'] ?? $attrs['needed']
*/
class Widget
{
@@ -50,10 +52,13 @@ class Widget
public $bool_attr_default = array(
'disabled' => null, // null = no default
'statustext_html' => false,
+ 'statustextHtml' => false,
'no_lang' => false,
+ 'noLang' => false,
// strictly speeding only for input widgets, but server-side input-widgets have a validation method, but no shared parent
'readonly' => null, // null = no default
'needed' => false,
+ 'required' => false,
);
/**
@@ -801,6 +806,21 @@ class Widget
}
}
+ /**
+ * Implement some (readonly) attributes
+ *
+ * @param $name
+ * @return void
+ */
+ public function __get($name)
+ {
+ switch($name)
+ {
+ case 'required':
+ return $this->attrs['required'] ?? $this->attrs['needed'] ?? false;
+ }
+ }
+
/**
* Convert widget (incl. children) to xml
*
diff --git a/api/src/Etemplate/Widget/Checkbox.php b/api/src/Etemplate/Widget/Checkbox.php
index 73cc3cf277..c633192c1a 100644
--- a/api/src/Etemplate/Widget/Checkbox.php
+++ b/api/src/Etemplate/Widget/Checkbox.php
@@ -59,7 +59,7 @@ class Checkbox extends Etemplate\Widget
if (!isset($value)) return; // value not transmitted --> nothing to validate
$valid =& self::get_array($validated, $form_name, true);
- if (!$value && $this->attrs['needed'])
+ if (!$value && $this->required)
{
self::set_validation_error($form_name,lang('Field must not be empty !!!'),'');
}
@@ -75,9 +75,9 @@ class Checkbox extends Etemplate\Widget
// Expand any content stuff
$selected_value = self::expand_name($this->attrs[$value_attr], $expand['c'], $expand['row'], $expand['c_'], $expand['row_'],$expand['cont']);
}
- if(array_key_exists('unselected_value',$this->attrs))
+ if(array_key_exists('unselectedValue',$this->attrs) || array_key_exists('unselected_value',$this->attrs))
{
- $unselected_value = self::expand_name($this->attrs['unselected_value'], $expand['c'], $expand['row'], $expand['c_'], $expand['row_'],$expand['cont']);
+ $unselected_value = self::expand_name($this->attrs['unselectedValue'] ?? $this->attrs['unselected_value'], $expand['c'], $expand['row'], $expand['c_'], $expand['row_'],$expand['cont']);
}
}
if ($type == 'radio')
@@ -129,4 +129,4 @@ class Checkbox extends Etemplate\Widget
}
}
}
-Etemplate\Widget::registerWidget(__NAMESPACE__.'\\Checkbox', array('checkbox', 'radio'));
+Etemplate\Widget::registerWidget(__NAMESPACE__.'\\Checkbox', array('checkbox', 'radio'));
\ No newline at end of file
diff --git a/api/src/Etemplate/Widget/Date.php b/api/src/Etemplate/Widget/Date.php
index 2198719ddf..c977a8b57a 100644
--- a/api/src/Etemplate/Widget/Date.php
+++ b/api/src/Etemplate/Widget/Date.php
@@ -70,7 +70,7 @@ class Date extends Transformer
$form_name = self::form_name($cname, $this->id, $expand);
$value =& self::get_array(self::$request->content, $form_name, false, true);
- if($this->type != 'date-duration' && $value)
+ if(!in_array($this->type, ['et2-date-duration', 'date-duration']) && $value)
{
$value = $this->format_date($value);
}
@@ -115,14 +115,15 @@ class Date extends Transformer
return $value;
} // otherwise we will get current date or 1970-01-01 instead of an empty value
+ $format = $this->attrs['dataFormat'] ?? $this->attrs['data_format'];
// for DateTime objects (regular PHP and Api\DateTime ones), set user timezone
if($value instanceof \DateTime)
{
$date = Api\DateTime::server2user($value);
}
// if data_format given, try that first, before leaving it to Api\DateTime to figure it out
- elseif (!empty($this->attrs['data_format']) && $this->attrs['data_format'] !== 'object' &&
- ($date = Api\DateTime::createFromFormat($this->attrs['data_format'], $value, Api\DateTime::$user_timezone)))
+ elseif (!empty($format) && $format !== 'object' &&
+ ($date = Api\DateTime::createFromFormat($format, $value, Api\DateTime::$user_timezone)))
{
// set AND checked above
}
@@ -130,7 +131,7 @@ class Date extends Transformer
{
$date = new Api\DateTime($value);
}
- if($this->type === 'date-timeonly' && $date)
+ if (in_array($this->type, ['et2-date-timeonly', 'date-timeonly']) && $date)
{
$date->setDate(1970, 1, 1);
}
@@ -185,7 +186,7 @@ class Date extends Transformer
}
}
- if((string)$value === '' && $this->attrs['needed'])
+ if((string)$value === '' && $this->required)
{
self::set_validation_error($form_name, lang('Field must not be empty !!!'));
}
@@ -265,12 +266,12 @@ class Date extends Transformer
// Not null, blank
$value = '';
}
- elseif($date && empty($this->attrs['data_format'])) // integer timestamp
+ elseif($date && empty($this->attrs['data_format']) && empty($this->attrs['dataFormat'])) // integer timestamp
{
$valid = $date->format('ts');
}
// string with formatting letters like for php's date() method
- elseif($date && ($valid = $date->format($this->attrs['data_format'])))
+ elseif($date && ($valid = $date->format($this->attrs['dataFormat'] ?? $this->attrs['data_format'])))
{
// Nothing to do here
}
diff --git a/api/src/Etemplate/Widget/Description.php b/api/src/Etemplate/Widget/Description.php
index e69bcdfd19..aa7c15238c 100644
--- a/api/src/Etemplate/Widget/Description.php
+++ b/api/src/Etemplate/Widget/Description.php
@@ -42,7 +42,7 @@ class Description extends Etemplate\Widget
*/
public function beforeSendToClient($cname, array $expand=null)
{
- if (!empty($this->attrs['activate_links']))
+ if (!empty($this->attrs['activate_links']) && !empty($this->attrs['activateLinks']))
{
$form_name = self::form_name($cname, $this->id, $expand);
$value =& self::get_array(self::$request->content, $form_name);
@@ -52,4 +52,4 @@ class Description extends Etemplate\Widget
}
}
}
-}
+}
\ No newline at end of file
diff --git a/api/src/Etemplate/Widget/HtmlArea.php b/api/src/Etemplate/Widget/HtmlArea.php
index d3250053cb..59f816f402 100644
--- a/api/src/Etemplate/Widget/HtmlArea.php
+++ b/api/src/Etemplate/Widget/HtmlArea.php
@@ -156,7 +156,7 @@ class HtmlArea extends Etemplate\Widget
{
$value = Api\Html\HtmLawed::purify(
self::get_array($content, $form_name),
- $this->attrs['validation_rules']
+ $this->attrs['validationRules'] ?? $this->attrs['validation_rules']
);
}
$valid =& self::get_array($validated, $form_name, true);
diff --git a/api/src/Etemplate/Widget/Link.php b/api/src/Etemplate/Widget/Link.php
index 4c0968cf92..c4923afb81 100644
--- a/api/src/Etemplate/Widget/Link.php
+++ b/api/src/Etemplate/Widget/Link.php
@@ -69,7 +69,7 @@ class Link extends Etemplate\Widget
$form_name = self::form_name($cname, $this->id, $expand);
$value =& self::get_array(self::$request->content, $form_name, true);
- if($value && !is_array($value) && !$this->attrs['only_app'])
+ if($value && !is_array($value) && !($this->attrs['onlyApp'] ?? $this->attrs['only_app']))
{
// Try to explode
if(count(explode(':',$value)) < 2)
diff --git a/api/src/Etemplate/Widget/Nextmatch/Customfilter.php b/api/src/Etemplate/Widget/Nextmatch/Customfilter.php
index 62d2bd978c..6f00512010 100644
--- a/api/src/Etemplate/Widget/Nextmatch/Customfilter.php
+++ b/api/src/Etemplate/Widget/Nextmatch/Customfilter.php
@@ -60,7 +60,7 @@ class Customfilter extends Widget\Transformer
}
$form_name = self::form_name($cname, $this->id, $expand);
- self::setElementAttribute($form_name, 'options', trim($this->attrs['widget_options']) != '' ? $this->attrs['widget_options'] : '');
+ self::setElementAttribute($form_name, 'options', trim($this->attrs['widgetOptions'] ?? $this->attrs['widget_options']) != '' ? ($this->attrs['widgetOptions'] ?? $this->attrs['widget_options']) : '');
self::setElementAttribute($form_name, 'type', $this->attrs['type']);
if($widget_type)
diff --git a/api/src/Etemplate/Widget/Password.php b/api/src/Etemplate/Widget/Password.php
index 365c76396c..34180b74ed 100644
--- a/api/src/Etemplate/Widget/Password.php
+++ b/api/src/Etemplate/Widget/Password.php
@@ -107,7 +107,7 @@ class Password extends Etemplate\Widget\Textbox
$value = Credentials::encrypt($value_in, 0, $encryption);
}
- if ((string)$value === '' && $this->attrs['needed'])
+ if ((string)$value === '' && $this->required)
{
self::set_validation_error($form_name,lang('Field must not be empty !!!'),'');
}
@@ -148,4 +148,4 @@ class Password extends Etemplate\Widget\Textbox
$response->data($decrypted);
}
}
-Etemplate\Widget::registerWidget(__NAMESPACE__.'\\Password', array('passwd'));
\ No newline at end of file
+Etemplate\Widget::registerWidget(__NAMESPACE__.'\\Password', ['et2-password', 'passwd']);
\ No newline at end of file
diff --git a/api/src/Etemplate/Widget/Select.php b/api/src/Etemplate/Widget/Select.php
index 728b749238..138e4732bc 100644
--- a/api/src/Etemplate/Widget/Select.php
+++ b/api/src/Etemplate/Widget/Select.php
@@ -198,7 +198,7 @@ class Select extends Etemplate\Widget
if(count($allowed) > 0 && in_array($val, $allowed)) continue 2; // +1 for switch
// validate accounts independent of options know to server
- $account_type = $this->attrs['account_type'] ? $this->attrs['account_type'] : 'accounts';
+ $account_type = $this->attrs['accountType'] ?? $this->attrs['account_type'] ?? 'accounts';
$type = $GLOBALS['egw']->accounts->exists($val);
//error_log(__METHOD__."($cname,...) form_name=$form_name, widget_type=$widget_type, account_type=$account_type, type=$type");
if (!$type || $type == 1 && in_array($account_type, array('groups', 'owngroups', 'memberships')) ||
@@ -242,7 +242,7 @@ class Select extends Etemplate\Widget
}
}
}
- if ($ok && $value === '' && $this->attrs['needed'])
+ if ($ok && $value === '' && $this->required)
{
self::set_validation_error($form_name,lang('Field must not be empty !!!',$value),'');
}
@@ -378,9 +378,10 @@ class Select extends Etemplate\Widget
self::$request->sel_options[$form_name] = array_merge(self::$request->sel_options[$form_name], $type_options);
// if no_lang was modified, forward modification to the client
- if ($no_lang != $this->attrs['no_lang'])
+ if ($no_lang != ($this->attrs['noLang'] ?? $this->attrs['no_lang']))
{
self::setElementAttribute($form_name, 'no_lang', $no_lang);
+ self::setElementAttribute($form_name, 'noLang', $no_lang);
}
}
$form_names_done[$form_name] = true;
diff --git a/api/src/Etemplate/Widget/Tabbox.php b/api/src/Etemplate/Widget/Tabbox.php
index d108bdd0a1..91fdd8e584 100644
--- a/api/src/Etemplate/Widget/Tabbox.php
+++ b/api/src/Etemplate/Widget/Tabbox.php
@@ -61,7 +61,7 @@ class Tabbox extends Etemplate\Widget
$this->tabs_attr_evaluated = true; // we must not evaluate tabs attribte more then once!
// add_tabs toggles replacing or adding to existing tabs
- if(!$this->attrs['add_tabs'])
+ if(!($this->attrs['addTabs'] ?? $this->attrs['add_tabs']))
{
$this->children[1]->children = array();
}
@@ -134,4 +134,4 @@ class Tabbox extends Etemplate\Widget
if (true) $valid = $value;
}
}
-}
+}
\ No newline at end of file
diff --git a/api/src/Etemplate/Widget/Taglist.php b/api/src/Etemplate/Widget/Taglist.php
index 4fcd2d0011..abef17b0a6 100644
--- a/api/src/Etemplate/Widget/Taglist.php
+++ b/api/src/Etemplate/Widget/Taglist.php
@@ -153,7 +153,7 @@ class Taglist extends Etemplate\Widget
// If in allowed options, skip account check to support app-specific options
if(count($allowed) > 0 && in_array($val, $allowed)) continue;
// validate accounts independent of options know to server
- $account_type = $this->attrs['account_type'] ? $this->attrs['account_type'] : 'accounts';
+ $account_type = $this->attrs['accountType'] ?? $this->attrs['account_type'] ?? 'accounts';
$type = $GLOBALS['egw']->accounts->exists($val);
//error_log(__METHOD__."($cname,...) form_name=$form_name, widget_type=$widget_type, account_type=$account_type, type=$type");
if (!$type || $type == 1 && in_array($account_type, array('groups', 'owngroups', 'memberships')) ||
@@ -179,7 +179,7 @@ class Taglist extends Etemplate\Widget
self::set_validation_error($form_name, lang("'%1' is NOT allowed ('%2')!", $val, implode("','", array_keys($allowed))), '');
unset($value[$key]);
}
- if(str_contains($this->type, 'email') && $this->attrs['include_lists'] && is_numeric($val))
+ if(str_contains($this->type, 'email') && ($this->attrs['includeLists'] ?? $this->attrs['include_lists']) && is_numeric($val))
{
$lists = $GLOBALS['egw']->contacts->get_lists(Api\Acl::READ);
if(!array_key_exists($val, $lists))
@@ -199,7 +199,7 @@ class Taglist extends Etemplate\Widget
}
}
}
- if ($ok && $value === '' && $this->attrs['needed'])
+ if ($ok && $value === '' && $this->required)
{
self::set_validation_error($form_name,lang('Field must not be empty !!!',$value),'');
}
diff --git a/api/src/Etemplate/Widget/Textbox.php b/api/src/Etemplate/Widget/Textbox.php
index cf2f2af24e..df13a28846 100644
--- a/api/src/Etemplate/Widget/Textbox.php
+++ b/api/src/Etemplate/Widget/Textbox.php
@@ -126,7 +126,7 @@ class Textbox extends Etemplate\Widget
$value = $value_in = self::get_array($content, $form_name);
- if ((string)$value === '' && $this->attrs['needed'])
+ if ((string)$value === '' && $this->required)
{
self::set_validation_error($form_name,lang('Field must not be empty !!!'),'');
}
@@ -153,7 +153,7 @@ class Textbox extends Etemplate\Widget
}
elseif ($this->attrs['type'] == 'integer' || $this->attrs['type'] == 'float') // cast int and float and check range
{
- if ((string)$value !== '' || $this->attrs['needed']) // empty values are Ok if needed is not set
+ if ((string)$value !== '' || $this->required) // empty values are Ok if needed is not set
{
$value = $this->attrs['type'] == 'integer' ? (int) $value : (float) str_replace(',','.',$value); // allow for german (and maybe other) format
@@ -181,4 +181,4 @@ class Textbox extends Etemplate\Widget
}
Etemplate\Widget::registerWidget(__NAMESPACE__ . '\\Textbox', array('et2-textarea', 'et2-textbox', 'textbox', 'text',
'int', 'integer', 'float', 'et2-number', 'hidden',
- 'colorpicker'));
+ 'colorpicker'));
\ No newline at end of file
diff --git a/api/src/Etemplate/Widget/Tree.php b/api/src/Etemplate/Widget/Tree.php
index 042d4f8ef9..608b5bef70 100644
--- a/api/src/Etemplate/Widget/Tree.php
+++ b/api/src/Etemplate/Widget/Tree.php
@@ -278,7 +278,7 @@ class Tree extends Etemplate\Widget
}
$value = implode(',',$value);
}
- if ($ok && $value === '' && $this->attrs['needed'])
+ if ($ok && $value === '' && $this->required)
{
self::set_validation_error($form_name,lang('Field must not be empty !!!',$value),'');
}
@@ -297,8 +297,9 @@ class Tree extends Etemplate\Widget
{
$form_name = self::form_name($cname, $this->id);
- if (($templated_path = self::templateImagePath($this->attrs['image_path'] ?? null)) !== ($this->attrs['image_path'] ?? null))
+ if (($templated_path = self::templateImagePath($this->attrs['imagePath'] ?? $this->attrs['image_path'] ?? null)) !== ($this->attrs['imagePath'] ?? $this->attrs['image_path'] ?? null))
{
+ self::setElementAttribute($form_name, 'imagePath', $this->attrs['imagePath'] = $templated_path);
self::setElementAttribute($form_name, 'image_path', $this->attrs['image_path'] = $templated_path);
//error_log(__METHOD__."() setting templated image-path for $form_name: $templated_path");
}
diff --git a/api/src/Etemplate/Widget/Url.php b/api/src/Etemplate/Widget/Url.php
index f50375e9d8..782eb34373 100644
--- a/api/src/Etemplate/Widget/Url.php
+++ b/api/src/Etemplate/Widget/Url.php
@@ -73,7 +73,7 @@ class Url extends Etemplate\Widget
{
$value = $value_in = self::get_array($content, $form_name);
- if ((string)$value === '' && $this->attrs['needed'])
+ if ((string)$value === '' && $this->required)
{
self::set_validation_error($form_name,lang('Field must not be empty !!!'),'');
return;
@@ -85,7 +85,7 @@ class Url extends Etemplate\Widget
{
case 'url':
$this->attrs['preg'] = self::URL_PREG;
- if($this->attrs['allow_path'])
+ if($this->attrs['allowPath'] ?? $this->attrs['allow_path'])
{
$url_valid = $value[0] === '/';
@@ -103,10 +103,10 @@ class Url extends Etemplate\Widget
// Remove intl chars & check again, but if it passes we'll keep the original
filter_var(preg_replace('/[^[:print:]]/','',$value), FILTER_VALIDATE_URL);
}
- if(array_key_exists('trailing_slash', $this->attrs))
+ if(array_key_exists('trailing_slash', $this->attrs) || array_key_exists('trailingSlash', $this->attrs))
{
$trailing_slash = substr($value, -1) === '/';
- $url_valid = (($this->attrs['trailing_slash'] == 'true') == $trailing_slash);
+ $url_valid = ((($this->attrs['trailingSlash'] ?? $this->attrs['trailing_slash']) == 'true') == $trailing_slash);
}
//error_log(__METHOD__."() filter_var(value=".array2string($value).", FILTER_VALIDATE_URL)=".array2string(filter_var($value, FILTER_VALIDATE_URL))." --> url_valid=".array2string($url_valid));
// remove http:// validation prefix again
@@ -165,4 +165,4 @@ class Url extends Etemplate\Widget
);
$response->data($result ? $result[0] : false);
}
-}
+}
\ No newline at end of file
diff --git a/infolog/templates/default/edit.xet b/infolog/templates/default/edit.xet
index e641f21df6..014cb168ab 100644
--- a/infolog/templates/default/edit.xet
+++ b/infolog/templates/default/edit.xet
@@ -1,10 +1,9 @@
-
-
+
-
-
+
+
@@ -14,13 +13,13 @@
-
+
-
+
-
+
@@ -35,32 +34,32 @@
-
-
-
+
+
+
-
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
@@ -80,22 +79,17 @@
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
@@ -103,40 +97,29 @@
-
-
-
-
+
+
-
-
+
+
-
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -156,45 +139,39 @@
-
-
+
+
-
-
-
+
+
+
-
+
@@ -211,48 +188,41 @@
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/timesheet/templates/default/edit.xet b/timesheet/templates/default/edit.xet
index 13a1948151..ea7af45002 100644
--- a/timesheet/templates/default/edit.xet
+++ b/timesheet/templates/default/edit.xet
@@ -1,6 +1,5 @@
-
-
+
@@ -15,48 +14,46 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
+
@@ -65,21 +62,21 @@
-
+
-
+
-
+
-
+
-
+
@@ -95,18 +92,18 @@
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
@@ -124,27 +121,27 @@
-
+
@@ -161,44 +158,40 @@
-
+
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+