X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_input.inc;h=a2355cfb02ee4f34c8823d65c63a1feb6910f539;hb=310a0d3ae5aeacbdaa0069546cc2652ac7518e6b;hp=a85f41a8f3af6285c8a1bf35280fe1887b3532c6;hpb=2150d50b1dbe375fffa2f868ad2bdd791f4ec894;p=fa-stable.git
diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc
index a85f41a8..a2355cfb 100644
--- a/includes/ui/ui_input.inc
+++ b/includes/ui/ui_input.inc
@@ -199,14 +199,6 @@ function submit_add_or_update_center($add=true, $title=false, $async=false)
echo "";
}
-/*
-function submit_add_or_update_row($add=true)
-{
- echo "
";
- submit_add_or_update($add);
- echo " |
\n";
-}
-*/
function submit_add_or_update_row($add=true, $right=true, $extra="", $title=false, $async=false)
{
echo "";
@@ -239,6 +231,11 @@ function submit_return($name, $value, $title=false, $async=false)
submit($name, $value, true, $title, $async);
}
}
+
+function submit_js_confirm($name, $msg) {
+ add_js_source(
+ "_validate.$name=function(){ return confirm('$msg');};");
+};
//-----------------------------------------------------------------------------------
function set_icon($icon, $title=false)
@@ -268,7 +265,7 @@ function button($name, $value, $title=false, $icon=false)
function button_cell($name, $value, $title=false, $icon=false)
{
- echo "";
+ echo " | ";
echo button($name, $value, $title, $icon);
echo " | ";
}
@@ -323,11 +320,12 @@ function check($label, $name, $value=null, $submit_on_change=false, $title=false
echo checkbox($label, $name, $value, $submit_on_change, $title);
}
-function check_cells($label, $name, $value, $submit_on_change=false, $title=false)
+function check_cells($label, $name, $value, $submit_on_change=false, $title=false,
+ $params='')
{
if ($label != null)
echo "$label | \n";
- echo "";
+ echo " | ";
echo check(null, $name, $value, $submit_on_change, $title);
echo " | ";
}
@@ -486,22 +484,38 @@ function text_row_ex($label, $name, $size, $max=null, $title=null, $value=null,
//-----------------------------------------------------------------------------------
function email_row($label, $name, $value, $size, $max, $title=null, $params="", $post_label="")
{
- text_row("$label", $name, $value, $size, $max, $title, $params, $post_label);
+ if (get_post($name))
+ $label = "$label";
+ text_row($label, $name, $value, $size, $max, $title, $params, $post_label);
}
function email_row_ex($label, $name, $size, $max=null, $title=null, $value=null, $params=null, $post_label=null)
{
- text_row_ex("$label", $name, $size, $max, $title, $value, $params, $post_label);
+ if (get_post($name))
+ $label = "$label";
+ text_row_ex($label, $name, $size, $max, $title, $value, $params, $post_label);
}
function link_row($label, $name, $value, $size, $max, $title=null, $params="", $post_label="")
{
- text_row("$label", $name, $value, $size, $max, $title, $params, $post_label);
+ $val = get_post($name);
+ if ($val) {
+ if (strpos($val,'http://')===false)
+ $val = 'http://'.$val;
+ $label = "$label";
+ }
+ text_row($label, $name, $value, $size, $max, $title, $params, $post_label);
}
function link_row_ex($label, $name, $size, $max=null, $title=null, $value=null, $params=null, $post_label=null)
{
- text_row_ex("$label", $name, $size, $max, $title, $value, $params, $post_label);
+ $val = get_post($name);
+ if ($val) {
+ if (strpos($val,'http://')===false)
+ $val = 'http://'.$val;
+ $label = "$label";
+ }
+ text_row_ex($label, $name, $size, $max, $title, $value, $params, $post_label);
}
//-----------------------------------------------------------------------------------
@@ -741,6 +755,48 @@ function text_row_with_submit($label, $name, $value, $size, $max, $input_name, $
}
*/
//-----------------------------------------------------------------------------------
+//
+// When show_inactive page option is set
+// displays value of inactive field as checkbox cell.
+// Also updates database record after status change.
+//
+function inactive_control_cell($id, $value, $table, $key)
+{
+ global $Ajax;
+ $name = "Inactive". $id;
+ $value = $value ? 1:0;
+ if (check_value('show_inactive')) {
+ if (isset($_POST['LInact'][$id]) && (get_post('_Inactive'.$id.'_update') ||
+ get_post('Update')) && (check_value('Inactive'.$id) != $value)) {
+ update_record_status($id, !$value, $table, $key);
+ }
+ echo ''. checkbox(null, $name, $value, true, '', "align='center'")
+ . hidden("LInact[$id]", $value, false) . ' | ';
+ }
+}
+//
+// Displays controls for optional display of inactive records
+//
+function inactive_control_row($th) {
+ echo "
"
+ ." "
+ . checkbox(null, 'show_inactive', null, true). _("Show also Inactive")
+ ." "
+ . submit('Update', _('Update'), false, '', null)
+ ." |
";
+}
+//
+// Inserts additional column header when display of inactive records is on.
+//
+function inactive_control_column(&$th) {
+ global $Ajax;
+
+ if (check_value('show_inactive'))
+ array_insert($th, count($th)-2 , _("Inactive"));
+ if (get_post('_show_inactive_update')) {
+ $Ajax->activate('_page_body');
+ }
+}
?>
\ No newline at end of file