diff --git a/html/js/scripts.js b/html/js/scripts.js index 5fce465d8..8218c27ca 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -4009,4 +4009,18 @@ function check_receipt_size(p_max_size,p_info) document.getElementById("receipt_info_id").innerHTML=""; document.getElementById("form_file").submit(); return true; +} +/** + * @brief toggle size of a div : fullsize or normal + * + */ +function full_size(p_div) { + div_dom=document.getElementById(p_div); + if ( ! div_dom ) return; + if ( div_dom.hasClassName('fullsize')) { + div_dom.removeClassName('fullsize');$('size_'+p_div).innerHTML=''; + } else { + div_dom.addClassName('fullsize');$('size_'+p_div).innerHTML=''; + } + } \ No newline at end of file diff --git a/html/style-classic7.css b/html/style-classic7.css index 220667928..0ceb33a39 100644 --- a/html/style-classic7.css +++ b/html/style-classic7.css @@ -2667,3 +2667,23 @@ span.tagcell { padding: 0.25em 1em 0.25em 1em; font-family: bold; } +/** + * set a element full size + */ +.fullsize { + width:100% !important; + height: 100% !important; + overflow:auto !important; + top:0px !important; + position:fixed !important; + left:0px !important; +} + + /********************************************* + * If a input is incorrect + */ + .input-error { + border:1px dotted red !important; + color:darkred !important; + + } \ No newline at end of file diff --git a/include/lib/html_input.class.php b/include/lib/html_input.class.php index e43c0ff53..3ed7595fc 100755 --- a/include/lib/html_input.class.php +++ b/include/lib/html_input.class.php @@ -837,7 +837,7 @@ class HtmlInput * @return type */ static function title_box($p_name, $p_div, $p_mod="close", $p_js="", - $p_draggable="n") + $p_draggable="n",$p_enlarge='n') { $p_div=strip_tags($p_div); $r='
'; @@ -847,6 +847,9 @@ class HtmlInput { $r.=Icon_Action::draggable($p_div); } + if ( $p_enlarge=='y') { + $r.=Icon_Action::full_size($p_div); + } if ($p_mod=='close') { $r.=Icon_Action::close($p_div, $p_js); diff --git a/include/lib/icon_action.class.php b/include/lib/icon_action.class.php index eef3a58a4..e9837127f 100644 --- a/include/lib/icon_action.class.php +++ b/include/lib/icon_action.class.php @@ -390,4 +390,11 @@ class Icon_Action if ( $p_value == 0 ) { return \Icon_Action::checked($p_id, $p_javascript); } if ( $p_value == 1 ) { return \Icon_Action::unchecked($p_id, $p_javascript);} } + static function full_size($p_div) { + $js=sprintf("full_size('%s')",$p_div); + $icon=""; + $r=sprintf('%s', + $p_div,$js,$icon); + return $r; + } } diff --git a/include/lib/manage_table_sql.class.php b/include/lib/manage_table_sql.class.php index ff50a7bcf..2b56a3ea8 100644 --- a/include/lib/manage_table_sql.class.php +++ b/include/lib/manage_table_sql.class.php @@ -88,7 +88,9 @@ class Manage_Table_SQL private $icon_mod; //!< place of right or left the icon update or mod, default right, accepted value=left,right,first column for mod private $icon_del; //!< place of right or left the icon update or mod, default right, accepted value=left,right - private $dialogbox_style; + private $dialogbox_style; + private $button_add_top; //!< place of the button add on the top, by default true + protected $title; //! < give the title of the diabox , default is Data /** * @brief Constructor : set the label to the column name, * the order of the column , set the properties and the @@ -129,6 +131,20 @@ class Manage_Table_SQL "max-width"=>"60%", "margin-left"=> "20%"); $this->search_table=true; + $this->button_add_top=true; + $this->title=_("Donnée"); + } + /** + * Set the title of the diabox , default is Donnée + * @param type $p_title + */ + function setTitle($p_title) + { + $this->title=$p_title; + } + function getTitle() + { + return $this->title; } /** * Get if we can search in the table @@ -666,8 +682,18 @@ function check() } } } + public function get_button_add_top() + { + return $this->button_add_top; + } - /** + public function set_button_add_top($button_add_top) + { + $this->button_add_top=$button_add_top; + return $this; + } + + /** * @brief display the data of the table * @param $p_order is the cond or order of the rows, * if empty the primary key will be used @@ -682,7 +708,7 @@ function check() } $ret=$this->table->seek($p_order, $p_array); $nb=Database::num_row($ret); - if ($this->can_append_row()==TRUE) + if ($this->can_append_row()==TRUE && $this->button_add_top == true) { echo HtmlInput::button_action(" "._("Ajout"), sprintf("%s.input('-1','%s')", @@ -952,7 +978,7 @@ function check() /** * @brief display into a dialog box the datarow in order * to be appended or modified. Can be override if you need - * a more complex form + * a more complex form. */ function input() { @@ -1132,7 +1158,7 @@ function check() ob_start(); - echo HtmlInput::title_box(_("Donnée"), $this->dialog_box,"close","","y"); + echo HtmlInput::title_box($this->getTitle(), $this->dialog_box,"close","","y","y"); printf('
', $this->object_name, $this->table->get_pk_value(), $this->object_name, $this->object_name, @@ -1147,10 +1173,10 @@ function check() $this->display_error(); echo ''; echo "
"; diff --git a/scenario/icon_actionTest.php b/scenario/icon_actionTest.php index 35c33a98c..c9037a14d 100644 --- a/scenario/icon_actionTest.php +++ b/scenario/icon_actionTest.php @@ -83,4 +83,9 @@ include_once NOALYSS_INCLUDE."/lib/icon_action.class.php";

Comment +

+

+

+ enlarge +

\ No newline at end of file