projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A bit more work on Greek file to improve quality.
[timetracker.git]
/
WEB-INF
/
lib
/
form
/
ActionForm.class.php
diff --git
a/WEB-INF/lib/form/ActionForm.class.php
b/WEB-INF/lib/form/ActionForm.class.php
index
03994dd
..
97c9219
100644
(file)
--- a/
WEB-INF/lib/form/ActionForm.class.php
+++ b/
WEB-INF/lib/form/ActionForm.class.php
@@
-36,9
+36,8
@@
class ActionForm {
var $mForm = null;
var $mInitForm = false;
var $mForm = null;
var $mInitForm = false;
- function
ActionForm
($name, &$form, $request=null) {
+ function
__construct
($name, &$form, $request=null) {
$this->setName($name);
$this->setName($name);
- $form->setRequest($request);
$this->setForm($form);
//if ($request) $this->initAttributes($request);
$this->initAttributes($request);
$this->setForm($form);
//if ($request) $this->initAttributes($request);
$this->initAttributes($request);
@@
-53,7
+52,7
@@
class ActionForm {
function &getFormElement($name) {
if ($this->mForm!=null) {
function &getFormElement($name) {
if ($this->mForm!=null) {
-
return $this->mForm->mE
lements[$name];
+
return $this->mForm->e
lements[$name];
}
return null;
}
}
return null;
}
@@
-63,8
+62,8
@@
class ActionForm {
}
function setName($name) {
}
function setName($name) {
- $this->
mN
ame = $name;
- $this->mSessionCell = "formbean_".$this->
mN
ame;
+ $this->
n
ame = $name;
+ $this->mSessionCell = "formbean_".$this->
n
ame;
}
/**
}
/**
@@
-73,16
+72,15
@@
class ActionForm {
* @param object $request
*/
function initAttributes(&$request) {
* @param object $request
*/
function initAttributes(&$request) {
- //$submit_flag = $this->isSubmit();
$submit_flag = (is_object($request) && ($request->isPost()));
if ($submit_flag) {
// fill ActionForm and Form from Request
foreach ($this->mVariables as $name) {
$submit_flag = (is_object($request) && ($request->isPost()));
if ($submit_flag) {
// fill ActionForm and Form from Request
foreach ($this->mVariables as $name) {
- if ($this->mForm->
mE
lements[$name] && $request->getParameter($name)) {
- $this->mForm->
mE
lements[$name]->setValue($request->getParameter($name));
- $this->mValues[$name] = $this->mForm->
mE
lements[$name]->getValue();
+ if ($this->mForm->
e
lements[$name] && $request->getParameter($name)) {
+ $this->mForm->
e
lements[$name]->setValue($request->getParameter($name));
+ $this->mValues[$name] = $this->mForm->
e
lements[$name]->getValue();
}
}
} else {
}
}
} else {
@@
-94,24
+92,14
@@
class ActionForm {
if ($this->mForm) {
$elements = $this->mForm->getElements();
foreach ($elements as $name=>$el) {
if ($this->mForm) {
$elements = $this->mForm->getElements();
foreach ($elements as $name=>$el) {
- if ($this->mForm->
mE
lements[$name] && isset($this->mValues[$name])) {
- $this->mForm->
mE
lements[$name]->setValue($this->mValues[$name]);
+ if ($this->mForm->
e
lements[$name] && isset($this->mValues[$name])) {
+ $this->mForm->
e
lements[$name]->setValue($this->mValues[$name]);
}
}
$this->mInitForm = true;
}
}
}
}
$this->mInitForm = true;
}
}
-
- /**
- * Init custom variables
- *
- * @param unknown $request
- * @param unknown $respons
- */
- function initVariables(&$request, &$respons) {
-
- }
-
+
function setVariablesNames($namelist) {
$this->mVariables = $namelist;
}
function setVariablesNames($namelist) {
$this->mVariables = $namelist;
}
@@
-121,12
+109,12
@@
class ActionForm {
$this->mValues[$name] = $value;
if ($this->mForm) {
$this->mValues[$name] = $value;
if ($this->mForm) {
- if (isset($this->mForm->
mE
lements[$name])) {
- if ($this->mForm->
mElements[$name]->cClassName
=="DateField") {
+ if (isset($this->mForm->
e
lements[$name])) {
+ if ($this->mForm->
elements[$name]->class
=="DateField") {
$dt = new DateAndTime($user->date_format, $value);
$value = $dt->toString(DB_DATEFORMAT);
}
$dt = new DateAndTime($user->date_format, $value);
$value = $dt->toString(DB_DATEFORMAT);
}
- $this->mForm->
mE
lements[$name]->setValueSafe($value);
+ $this->mForm->
e
lements[$name]->setValueSafe($value);
}
}
}
}
}
}
@@
-150,12
+138,12
@@
class ActionForm {
if (is_array($this->mValues))
foreach ($this->mValues as $name=>$value) {
if ($this->mForm) {
if (is_array($this->mValues))
foreach ($this->mValues as $name=>$value) {
if ($this->mForm) {
- if (isset($this->mForm->
mE
lements[$name])) {
- if ($this->mForm->
mElements[$name]->cClassName
=="DateField") {
+ if (isset($this->mForm->
e
lements[$name])) {
+ if ($this->mForm->
elements[$name]->class
=="DateField") {
$dt = new DateAndTime($user->date_format, $value);
$value = $dt->toString(DB_DATEFORMAT);
}
$dt = new DateAndTime($user->date_format, $value);
$value = $dt->toString(DB_DATEFORMAT);
}
- $this->mForm->
mE
lements[$name]->setValueSafe($value);
+ $this->mForm->
e
lements[$name]->setValueSafe($value);
}
}
}
}
}
}
@@
-165,14
+153,6
@@
class ActionForm {
print_r($this->mValues);
}
print_r($this->mValues);
}
- function isSubmit() {
- $res = false;
- if (is_object($this->mForm)) {
- $res = $this->mForm->isSubmit();
- }
- return $res;
- }
-
function saveBean() {
if ($this->mForm) {
$elements = $this->mForm->getElements();
function saveBean() {
if ($this->mForm) {
$elements = $this->mForm->getElements();
@@
-196,11
+176,11
@@
class ActionForm {
import('form.'.$ref_el["class"]);
$class_name = $ref_el["class"];
$el = new $class_name($ref_el["name"]);
import('form.'.$ref_el["class"]);
$class_name = $ref_el["class"];
$el = new $class_name($ref_el["name"]);
-
if (isset($GLOBALS["I18N"])) $el->setLocalization($GLOBALS["I18N"]
);
+
$el->localize(
);
$el->setValueSafe(@$_SESSION[$this->mSessionCell . "_" .$el->getName()]);
$el->setValueSafe(@$_SESSION[$this->mSessionCell . "_" .$el->getName()]);
- if ($this->mForm && !isset($this->mForm->
mE
lements[$ref_el["name"]])) {
- $this->mForm->
mE
lements[$ref_el["name"]] = &$el;
+ if ($this->mForm && !isset($this->mForm->
e
lements[$ref_el["name"]])) {
+ $this->mForm->
e
lements[$ref_el["name"]] = &$el;
}
$this->mValues[$el->getName()] = $el->getValue();
}
}
$this->mValues[$el->getName()] = $el->getValue();
}
@@
-222,4
+202,3
@@
class ActionForm {
return (isset($_SESSION[$this->mSessionCell . "session_store_elements"]) ? true : false);
}
}
return (isset($_SESSION[$this->mSessionCell . "session_store_elements"]) ? true : false);
}
}
-