projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added 'company_logo_on_views' in sys_prefs in the default sql charts.
[fa-stable.git]
/
includes
/
ui
/
class.crud_view.inc
diff --git
a/includes/ui/class.crud_view.inc
b/includes/ui/class.crud_view.inc
index 8572fdbe867d6f3c527cc3fcb330b0e2e4763d48..963ed75b311a50b1396fe7f531193dc0935235dd 100644
(file)
--- a/
includes/ui/class.crud_view.inc
+++ b/
includes/ui/class.crud_view.inc
@@
-43,7
+43,7
@@
class user_view {
var $dec;
var $name;
var $dec;
var $name;
- function
user_view
($name)
+ function
__construct
($name)
{
$this->name = $name;
}
{
$this->name = $name;
}
@@
-72,6
+72,8
@@
class user_view {
return user_numeric($value);
case 'percent':
return user_numeric($value)/100;
return user_numeric($value);
case 'percent':
return user_numeric($value)/100;
+ case 'check':
+ return isset($value) ? 1 : 0;
case 'text':
case 'date':
default:
case 'text':
case 'date':
default:
@@
-92,6
+94,8
@@
class user_view {
return number_format2($value);
case 'percent':
return percent_format($value*100);
return number_format2($value);
case 'percent':
return percent_format($value*100);
+ case 'check':
+ return !empty($value);
case 'stock':
$this->dec = get_qty_dec($value); // retrieve dec for use in following qty fields
case 'text':
case 'stock':
$this->dec = get_qty_dec($value); // retrieve dec for use in following qty fields
case 'text':
@@
-161,7
+165,8
@@
class user_view {
$value = isset($this->data->$fld) ? $this->data->$fld : @$fmt['dflt'];
else
$value = isset($this->data[$fld]) ? $this->data[$fld] : @$fmt['dflt'];
$value = isset($this->data->$fld) ? $this->data->$fld : @$fmt['dflt'];
else
$value = isset($this->data[$fld]) ? $this->data[$fld] : @$fmt['dflt'];
- if(isset($value))
+
+ if (isset($value))
$output[$post] = $this->_format_output($value, @$fmt['fmt']);
}
}
$output[$post] = $this->_format_output($value, @$fmt['fmt']);
}
}
@@
-198,9
+203,13
@@
class user_view {
$post = isset($fmt['post']) ? $fmt['post'] : $name; // input name (default to field name)
$fld = isset($fmt['fld']) ? $fmt['fld'] : $name; // input value (default to field name)
$post = isset($fmt['post']) ? $fmt['post'] : $name; // input name (default to field name)
$fld = isset($fmt['fld']) ? $fmt['fld'] : $name; // input value (default to field name)
+
// if ($all || array_key_exists($post, $input))
// {
// if ($all || array_key_exists($post, $input))
// {
- $value = $this->_format_input(@$input[$post], @$fmt['fmt']);
+ if (@$fmt['fmt'] == 'check')
+ $value = @$input[$post] ? 1 : 0;
+ else
+ $value = $this->_format_input(@$input[$post], @$fmt['fmt']);
// if (is_array($data))
if ($all || isset($value))
// if (is_array($data))
if ($all || isset($value))
@@
-269,9
+278,9
@@
class simple_crud_view extends user_view {
var $display_both = false; //when set to true both list and editor are displayed all the time (eventually set in sub classes)
//
//
var $display_both = false; //when set to true both list and editor are displayed all the time (eventually set in sub classes)
//
//
- function
simple_crud_view
($name, $data_set = null, $options=array())
+ function
__construct
($name, $data_set = null, $options=array())
{
{
-
$this->user_view
($name);
+
parent::__construct
($name);
$this->options = array_merge($this->options, $options);
$this->options = array_merge($this->options, $options);
@@
-596,10
+605,10
@@
class simple_crud_view extends user_view {
class selector_crud_view extends simple_crud_view {
class selector_crud_view extends simple_crud_view {
- function
selector_crud_view
($name, $data_set = null, $options=array())
+ function
__construct
($name, $data_set = null, $options=array())
{
$this->display_both = true;
{
$this->display_both = true;
-
$this->simple_crud_view
($name, $data_set, $options);
+
parent::__construct
($name, $data_set, $options);
}
function _check_mode()
}
function _check_mode()
@@
-650,10
+659,10
@@
class table_crud_view extends simple_crud_view {
var $title;
var $title;
- function
table_crud_view
($name, &$data_set = null, $options=array())
+ function
__construct
($name, &$data_set = null, $options=array())
{
$this->display_both = true;
{
$this->display_both = true;
-
$this->simple_crud_view
($name, $data_set, $options);
+
parent::__construct
($name, $data_set, $options);
}
/**
*
}
/**
*