noalyss Version-9
|
Purpose is to propose a librairy to display a table content and allow to update and delete row , handle also the ajax call thanks the script managetable.js. More...
Public Member Functions | |
__construct (Data_SQL $p_table) | |
add_json_param ($p_attribute, $p_value) | |
Add json parameter to the current one. More... | |
ajax_delete () | |
Delete a record and return an XML answer for ajax. More... | |
ajax_input ($p_status="OK") | |
send an xml with input of the object, create an xml answer. More... | |
ajax_save () | |
Save the record from Request into the DB and returns an XML to update the Html Element. More... | |
can_append_row () | |
return false if the append of the row is forbidden More... | |
can_delete_row () | |
return false if the delete of the row is forbidden More... | |
can_update_row () | |
return false if the update of the row is forbidden More... | |
check () | |
count_error () | |
returns the nb of errors found More... | |
create_js_script () | |
we must create first the javascript if we want to update, insert or delete rows. More... | |
delete () | |
delete a datarow , the id must be have set before More... | |
display_error () | |
Display a list of the error collected. More... | |
display_icon_custom ($p_row) | |
usually contain a link and calls another page, it must be overriden More... | |
display_icon_del ($p_row) | |
display_icon_mod ($p_row) | |
display_row ($p_row) | |
display a data row in the table, with the order defined in a_order and depending of the visibility of the column, all the rows contains the attribute ctl_pk_id , to retrieve in javascript , ie with the function afterSaveFct (see managetable.js) More... | |
display_row_custom ($p_key, $p_value, $p_id=0) | |
When displaying a row, if a column has the type "custom" , we can call this function to display properly the value including the tag "<td>". More... | |
display_table ($p_order="", $p_array=NULL) | |
display the data of the table More... | |
display_table_header () | |
display the column header excepted the not visible one and in the order defined with $this->a_order More... | |
execute_query ($p_order="", $p_array=NULL) | |
execute the query (Data_SQL.seek), called by display_table More... | |
from_request () | |
get the data from http request strip the not update or not visible data to their initial value. More... | |
get_button_add_top () | |
get_col_option ($p_key) | |
add extra to column, normally class , javascript or style More... | |
get_col_sort () | |
When adding an element , it is column we checked to insert before,. More... | |
get_col_type ($p_key) | |
return the type of a column More... | |
get_current_pos ($p_key) | |
get the position of a column More... | |
get_current_row () | |
Return the current row printed in display_row. More... | |
get_dialog_box () | |
get_dialogbox_style () | |
return the db_style More... | |
get_error ($p_col) | |
retrieve the error message More... | |
get_header_option ($p_key) | |
add extra to column Header, normally class , javascript or style More... | |
get_icon_del () | |
get_icon_mod () | |
get_js_variable () | |
Get the object name. More... | |
get_json () | |
get_object_name () | |
get_order () | |
get_property_updatable ($p_key) | |
return True if the column is updatable otherwise false More... | |
get_property_visible ($p_key) | |
return True if the column is visible otherwise false More... | |
get_search_table () | |
Get if we can search in the table. More... | |
get_sort_column () | |
return the column to sort More... | |
get_table () | |
getCssClass () | |
getTitle () | |
input () | |
display into a dialog box the datarow in order to be appended or modified. More... | |
input_custom ($p_key, $p_value) | |
this function let you create your own input , for example for a ITEXT , a IRADIO , ... it must be override , there is not default More... | |
insert () | |
insert a new value More... | |
move ($p_key, $p_idx) | |
if we change a column order , the order of the other columns is impacted. More... | |
param_set ($p_json) | |
Set the parameter of the object (gDossier, ac, plugin_code...) @detail By default , only gDossier will be set . More... | |
save () | |
save the Data_SQL Object The noalyss_SQL is not empty More... | |
send_header () | |
send the XML headers for the ajax call More... | |
set_append_row ($p_value) | |
Enable or disable the appending of rows. More... | |
set_button_add_top ($button_add_top) | |
set_callback ($p_file) | |
set the callback function that is passed to javascript More... | |
set_col_label ($p_key, $p_display) | |
set the name to display for a column More... | |
set_col_option ($p_key, $p_value) | |
add extra to column, normally class or style More... | |
set_col_sort ($p_num) | |
When adding an element ,we place it thanks the DOM Attribute sort_value set it to -1 if you want one to append. More... | |
set_col_tips ($p_key, $p_comment) | |
Set the info for a column, use Icon_Action::infobulle the message are in message_javascript.php. More... | |
set_col_type ($p_key, $p_value, $p_array=NULL) | |
set the type of a column , it will change in the input db box , the select must supply an array of possible values [val=> , label=>] with the variable $this->key_name->a_value More... | |
set_current_row ($current_row) | |
set the current row printed in display_row More... | |
set_delete_row ($p_value) | |
Enable or disable the deletion of rows. More... | |
set_dialog_box ($dialog_box) | |
set_dialogbox_style ($db_style) | |
Dialog box style , by default {position: "fixed", top: '15', width: "auto", "margin-left": "20%"}. More... | |
set_error ($p_col, $p_message) | |
set the error message for a wrong input More... | |
set_header_option ($p_key, $p_value) | |
add extra to column Header, normally class or style More... | |
set_icon_del ($pString) | |
Set the icon to delete at the right or left of the row. More... | |
set_icon_mod ($pString) | |
Set the icon to modify at the right ,the first col or left of the row, if the mod if custom , you have to override the function display_icon_custom. More... | |
set_json ($p_json) | |
Set the parameter of the object (gDossier, ac, plugin_code...) @detail By default , only gDossier will be set . More... | |
set_object_name ($p_object_name) | |
Set the object_name. More... | |
set_order ($p_order) | |
set_pk ($p_id) | |
set the id value of a data row and load from the db More... | |
set_property_updatable ($p_key, $p_value) | |
set a column of the data row updatable or not More... | |
set_property_visible ($p_key, $p_value) | |
set a column of the data row visible or not More... | |
set_search_table ($search_table) | |
Set the table searchable or not. More... | |
set_sort_column ($p_col) | |
set the column to sort by default More... | |
set_table (Data_SQL $p_noalyss_sql) | |
set_update_row ($p_value) | |
Enable or disable the updating of rows. More... | |
set_value ($p_key, $p_value) | |
setCssClass ($p_class) | |
setTitle ($p_title) | |
Set the title of the diabox , default is Donnée. More... | |
show_error ($p_col) | |
update () | |
Data Fields | |
const | UPDATABLE =1 |
const | VISIBLE =2 |
Protected Attributes | |
$a_col_option | |
in display_row and display_custom_row, it is the current row which is used More... | |
$a_header_option | |
Extra to add to the column Header : CSS Style , CSS class, javascript ,... More... | |
$a_info | |
Array with the infotip. More... | |
$a_label_displaid | |
Label of the col. of the datarow. More... | |
$a_order | |
order of the col More... | |
$a_prop | |
property for each col. More... | |
$a_select | |
Possible value if a_type is a SELECT. More... | |
$a_type | |
Type of the column : date , select ... Only in input. More... | |
$aerror | |
Array containing the error of the input data. More... | |
$button_add_top | |
place of the button add on the top, by default true More... | |
$callback | |
Callback function. More... | |
$col_sort | |
when inserting, it is the column to sort,-1 to disable it and append only More... | |
$cssclass | |
< give the title of the diabox , default is Data More... | |
$current_row | |
CSS class for the dialog box. More... | |
$dialog_box | |
ID of the dialog box which display the result of the ajax calls. More... | |
$dialogbox_style | |
style of the dialog box More... | |
$icon_del | |
place of right or left the icon update or mod, default right, accepted value=left,right More... | |
$icon_mod | |
place of right or left the icon update or mod, default right, accepted value=left,right,first,custom column for mod More... | |
$json_parameter | |
Default parameter to add (gDossier...), sent to the ajax callback. More... | |
$object_name | |
Object_name is used for the javascript , it is the row id to update or delete. More... | |
$row_append | |
Flag to indicate if rows can be added. More... | |
$row_delete | |
Flag to indicate if rows can be deleted. More... | |
$row_update | |
Flag to indicate if rows can be updated. More... | |
$search_table | |
boolean , by default true ,it is possible to search in the table, More... | |
$sort_column | |
javascript sort on this column , if empty there is no js sort More... | |
$table | |
Object Data_SQL. More... | |
$title | |
Purpose is to propose a librairy to display a table content and allow to update and delete row , handle also the ajax call thanks the script managetable.js.
Code for ajax , here we see the ajax_input for creating a dg box
If you need to add extra XML fields to manage them in the afterSaveFct then you can do like this in your php code answering the ajax call
The afterSaveFct is the function called after saving, the param is the HTML Element
Definition at line 100 of file manage_table_sql.class.php.
Manage_Table_SQL::__construct | ( | Data_SQL | $p_table | ) |
Reimplemented in Anc_Account_Table, Forecast_Category_MTable, and Forecast_Item_MTable.
Definition at line 141 of file manage_table_sql.class.php.
References $order, $value, Dossier\id(), table, title, and VISIBLE.
Manage_Table_SQL::add_json_param | ( | $p_attribute, | |
$p_value | |||
) |
Add json parameter to the current one.
Definition at line 503 of file manage_table_sql.class.php.
Referenced by Mobile_Device_MTable\__construct(), Document_State_MTable\build(), Forecast_Category_MTable\set_forecast_id(), Forecast_Item_MTable\set_forecast_id(), and Mobile_Device_MTable\set_profile_id().
Manage_Table_SQL::ajax_delete | ( | ) |
Delete a record and return an XML answer for ajax.
If a check is needed before deleting you can override this->delete and throw an exception if the deleting is not allowed
Definition at line 1470 of file manage_table_sql.class.php.
Manage_Table_SQL::ajax_input | ( | $p_status = "OK" | ) |
send an xml with input of the object, create an xml answer.
It will call Manage_Table_SQL.input to display the input , but if that function returns false, the "save" button will disappear but the form can be submitted with enter.
Definition at line 1376 of file manage_table_sql.class.php.
References $close, $ctl, $ex, $html, $root, $status, $xml, HtmlInput\button_action(), display_error(), getTitle(), HtmlInput\hidden(), input(), HtmlInput\json_to_hidden(), HtmlInput\submit(), table, and HtmlInput\title_box().
Referenced by ajax_save().
Manage_Table_SQL::ajax_save | ( | ) |
Save the record from Request into the DB and returns an XML to update the Html Element.
The function check() will be called before saving
Definition at line 1299 of file manage_table_sql.class.php.
References $array, $ctl, $ex, $html, $root, $status, $xml, ajax_input(), check(), display_row(), from_request(), save(), and table.
Manage_Table_SQL::can_append_row | ( | ) |
return false if the append of the row is forbidden
Definition at line 635 of file manage_table_sql.class.php.
References $row_append.
Referenced by display_table().
Manage_Table_SQL::can_delete_row | ( | ) |
return false if the delete of the row is forbidden
Definition at line 677 of file manage_table_sql.class.php.
References $row_delete.
Referenced by display_icon_del(), and display_table_header().
Manage_Table_SQL::can_update_row | ( | ) |
return false if the update of the row is forbidden
Definition at line 605 of file manage_table_sql.class.php.
References $row_update.
Referenced by display_icon_mod(), display_row(), and display_table_header().
Manage_Table_SQL::check | ( | ) |
@brief This function can be overrided to check the data before inserting , updating or removing, above an example of an overidden check. Usually , you get the row of the table (get_table) , you check the conditions if an condition is not met then you set the error with $this->set_error if there are error (returns false otherwise true @see set_error get_error count_error @return boolean
Reimplemented in Acc_Other_Tax_MTable, Acc_Plan_MTable, Acc_Report_MTable, Action_Document_Type_MTable, Anc_Account_Table, Card_Attribut_MTable, Currency_MTable, Forecast_Category_MTable, Forecast_Item_MTable, Mobile_Device_MTable, Parameter_Extra_MTable, Payment_Method_MTable, Template_Card_Category, and Tva_Rate_MTable.
Definition at line 386 of file manage_table_sql.class.php.
Referenced by ajax_save().
Manage_Table_SQL::count_error | ( | ) |
returns the nb of errors found
Definition at line 331 of file manage_table_sql.class.php.
Referenced by Acc_Other_Tax_MTable\check(), Card_Attribut_MTable\check(), Forecast_Item_MTable\check(), Mobile_Device_MTable\check(), and Tva_Rate_MTable\check().
Manage_Table_SQL::create_js_script | ( | ) |
we must create first the javascript if we want to update, insert or delete rows.
It is the default script .
Definition at line 551 of file manage_table_sql.class.php.
References $style.
Manage_Table_SQL::delete | ( | ) |
delete a datarow , the id must be have set before
Reimplemented in Action_Document_Type_MTable, Anc_Account_Table, Card_Attribut_MTable, Currency_MTable, Template_Card_Category, and Tva_Rate_MTable.
Definition at line 1459 of file manage_table_sql.class.php.
References table.
Manage_Table_SQL::display_error | ( | ) |
Display a list of the error collected.
Definition at line 1560 of file manage_table_sql.class.php.
References $error, $i, $label, get_error(), and h.
Referenced by ajax_input().
Manage_Table_SQL::display_icon_custom | ( | $p_row | ) |
usually contain a link and calls another page, it must be overriden
array | $p_row | is the current database row |
Definition at line 1583 of file manage_table_sql.class.php.
Referenced by display_row().
Manage_Table_SQL::display_icon_del | ( | $p_row | ) |
Definition at line 994 of file manage_table_sql.class.php.
References $js, can_delete_row(), table, and Icon_Action\trash().
Referenced by Acc_Plan_MTable\display_row(), and display_row().
Manage_Table_SQL::display_icon_mod | ( | $p_row | ) |
Definition at line 981 of file manage_table_sql.class.php.
References $js, can_update_row(), Icon_Action\modify(), and table.
Referenced by display_row().
Manage_Table_SQL::display_row | ( | $p_row | ) |
display a data row in the table, with the order defined in a_order and depending of the visibility of the column, all the rows contains the attribute ctl_pk_id , to retrieve in javascript , ie with the function afterSaveFct (see managetable.js)
array | $p_row | contains a row from the database |
From database
Reimplemented in Acc_Plan_MTable, Anc_Account_Table, Currency_MTable, Forecast_Item_MTable, and Card_Attribut_MTable.
Definition at line 1018 of file manage_table_sql.class.php.
References $col_sort, $e, $i, $idx, $js, $value, can_update_row(), display_icon_custom(), display_icon_del(), display_icon_mod(), display_row_custom(), elseif, get_col_type(), get_property_visible(), nbm(), table, and td().
Referenced by ajax_save(), and display_table().
Manage_Table_SQL::display_row_custom | ( | $p_key, | |
$p_value, | |||
$p_id = 0 |
|||
) |
When displaying a row, if a column has the type "custom" , we can call this function to display properly the value including the tag "<td>".
You can get the full array from display_row via get_current_row() or reload from db thanks $p_id
$p_key | string key name | |
$p_value | string value | |
int | $p_id | id of the row , usually the pk of Data_SQL (optional default 0) |
Reimplemented in Acc_Other_Tax_MTable, Acc_Report_MTable, Card_Attribut_MTable, and Mobile_Device_MTable.
Definition at line 1157 of file manage_table_sql.class.php.
References td().
Referenced by display_row().
Manage_Table_SQL::display_table | ( | $p_order = "" , |
|
$p_array = NULL |
|||
) |
display the data of the table
$p_order | is the cond or order of the rows, if empty the primary key will be used |
$p_array | array of the bind variables |
Reimplemented in Acc_Report_MTable, and Forecast_Item_MTable.
Definition at line 834 of file manage_table_sql.class.php.
References $e, $i, $nb, $p_array, $p_order, $result, $ret, $row, HtmlInput\button_action(), BUTTONADD, can_append_row(), display_row(), display_table_header(), execute_query(), DatabaseCore\fetch_array(), HtmlInput\filter_table(), get_property_visible(), get_search_table(), and DatabaseCore\num_row().
Manage_Table_SQL::display_table_header | ( | ) |
display the column header excepted the not visible one and in the order defined with $this->a_order
Definition at line 896 of file manage_table_sql.class.php.
References $i, $nb, $style, can_delete_row(), can_update_row(), get_property_visible(), and th().
Referenced by display_table().
Manage_Table_SQL::execute_query | ( | $p_order = "" , |
|
$p_array = NULL |
|||
) |
execute the query (Data_SQL.seek), called by display_table
string | (default empty) $p_order SQL string added to DatabaseCore::seek |
array | (default null) $p_array Array for the SQL string |
Definition at line 818 of file manage_table_sql.class.php.
References $p_array, $p_order, $ret, and table.
Referenced by display_table().
Manage_Table_SQL::from_request | ( | ) |
get the data from http request strip the not update or not visible data to their initial value.
Before saving , it is important to set the pk and load from db
Reimplemented in Acc_Other_Tax_MTable, Action_Document_Type_MTable, Currency_MTable, Forecast_Item_MTable, and Operation_Predef_MTable.
Definition at line 964 of file manage_table_sql.class.php.
References $http, $i, $nb, get_property_updatable(), get_property_visible(), and table.
Referenced by ajax_save().
Manage_Table_SQL::get_button_add_top | ( | ) |
Definition at line 801 of file manage_table_sql.class.php.
References $button_add_top.
Manage_Table_SQL::get_col_option | ( | $p_key | ) |
add extra to column, normally class , javascript or style
string | $p_key | column name |
Definition at line 395 of file manage_table_sql.class.php.
References $p_col.
Manage_Table_SQL::get_col_sort | ( | ) |
When adding an element , it is column we checked to insert before,.
Definition at line 266 of file manage_table_sql.class.php.
References $col_sort.
Manage_Table_SQL::get_col_type | ( | $p_key | ) |
return the type of a column
$p_key | col name |
Definition at line 482 of file manage_table_sql.class.php.
Referenced by display_row().
Manage_Table_SQL::get_current_pos | ( | $p_key | ) |
get the position of a column
$p_key | data column |
Definition at line 741 of file manage_table_sql.class.php.
References $i.
Referenced by move().
Manage_Table_SQL::get_current_row | ( | ) |
Return the current row printed in display_row.
Definition at line 1129 of file manage_table_sql.class.php.
References $current_row.
Manage_Table_SQL::get_dialog_box | ( | ) |
Definition at line 247 of file manage_table_sql.class.php.
References $dialog_box.
Manage_Table_SQL::get_dialogbox_style | ( | ) |
return the db_style
Definition at line 228 of file manage_table_sql.class.php.
References $dialogbox_style.
Manage_Table_SQL::get_error | ( | $p_col | ) |
retrieve the error message
$p_col | column name |
Definition at line 341 of file manage_table_sql.class.php.
References $p_col.
Referenced by display_error(), Template_Card_Category\input(), Tva_Rate_MTable\input(), input(), and show_error().
Manage_Table_SQL::get_header_option | ( | $p_key | ) |
add extra to column Header, normally class , javascript or style
string | $p_key | column name |
Definition at line 428 of file manage_table_sql.class.php.
References $p_col.
Manage_Table_SQL::get_icon_del | ( | ) |
Definition at line 295 of file manage_table_sql.class.php.
References $icon_del.
Manage_Table_SQL::get_icon_mod | ( | ) |
Definition at line 291 of file manage_table_sql.class.php.
References $icon_mod.
Manage_Table_SQL::get_js_variable | ( | ) |
Get the object name.
: return the object name , it is useful it the javascript will return coded without the create_js_script function
Definition at line 496 of file manage_table_sql.class.php.
References $object_name.
Manage_Table_SQL::get_json | ( | ) |
Definition at line 508 of file manage_table_sql.class.php.
References $json_parameter.
Manage_Table_SQL::get_object_name | ( | ) |
Definition at line 512 of file manage_table_sql.class.php.
References $object_name.
Referenced by Operation_Predef_MTable\display_button_add(), and Template_Card_Category\input().
Manage_Table_SQL::get_order | ( | ) |
Manage_Table_SQL::get_property_updatable | ( | $p_key | ) |
return True if the column is updatable otherwise false
$p_key | data column |
Definition at line 686 of file manage_table_sql.class.php.
References $val, and UPDATABLE.
Referenced by from_request(), Tva_Rate_MTable\input(), input(), and set_property_updatable().
Manage_Table_SQL::get_property_visible | ( | $p_key | ) |
return True if the column is visible otherwise false
$p_key | data column |
Definition at line 718 of file manage_table_sql.class.php.
Referenced by Acc_Plan_MTable\display_row(), display_row(), display_table(), display_table_header(), from_request(), Tva_Rate_MTable\input(), input(), and set_property_visible().
Manage_Table_SQL::get_search_table | ( | ) |
Get if we can search in the table.
Definition at line 200 of file manage_table_sql.class.php.
References $search_table.
Referenced by display_table().
Manage_Table_SQL::get_sort_column | ( | ) |
return the column to sort
Definition at line 945 of file manage_table_sql.class.php.
References $sort_column.
Manage_Table_SQL::get_table | ( | ) |
Definition at line 299 of file manage_table_sql.class.php.
References $table.
Referenced by Template_Card_Category\add_mandatory_attr(), Acc_Other_Tax_MTable\check(), Acc_Report_MTable\check(), Action_Document_Type_MTable\check(), Anc_Account_Table\check(), Card_Attribut_MTable\check(), Currency_MTable\check(), Forecast_Category_MTable\check(), Forecast_Item_MTable\check(), Mobile_Device_MTable\check(), Parameter_Extra_MTable\check(), Payment_Method_MTable\check(), Forecast_Item_MTable\count_category(), Action_Document_Type_MTable\delete(), Card_Attribut_MTable\delete(), Currency_MTable\delete(), Forecast_Item_MTable\display_row(), Forecast_Item_MTable\display_table(), Forecast_Item_MTable\from_request(), Operation_Predef_MTable\from_request(), Action_Document_Type_MTable\input(), Currency_MTable\input(), Forecast_Category_MTable\input(), Forecast_Item_MTable\input(), Operation_Predef_MTable\input(), Template_Card_Category\input(), Acc_Other_Tax_MTable\input_custom(), Card_Attribut_MTable\input_custom(), Mobile_Device_MTable\input_custom(), Payment_Method_MTable\input_custom(), Tag_Group_MTable\input_tag(), Action_Document_Type_MTable\save(), Currency_MTable\save(), Forecast_Category_MTable\set_forecast_id(), and Mobile_Device_MTable\set_profile_id().
Manage_Table_SQL::getCssClass | ( | ) |
Definition at line 181 of file manage_table_sql.class.php.
References $cssclass.
Manage_Table_SQL::getTitle | ( | ) |
Definition at line 192 of file manage_table_sql.class.php.
References $title.
Referenced by ajax_input().
Manage_Table_SQL::input | ( | ) |
display into a dialog box the datarow in order to be appended or modified.
Can be override if you need a more complex form or add elements with "set_order" before calling this function. This function does not add the form , only the table.
It returns true , if it is not readyonly and the form will have a "save" button, if it returns nothing or false then there is no save button, nor form, the content is then readonly
Reimplemented in Acc_Other_Tax_MTable, Acc_Plan_MTable, Action_Document_Type_MTable, Currency_MTable, Forecast_Category_MTable, Forecast_Item_MTable, Operation_Predef_MTable, Tag_Group_MTable, Template_Card_Category, and Tva_Rate_MTable.
Definition at line 1173 of file manage_table_sql.class.php.
References $error, $i, $label, $select, $text, $value, elseif, HtmlInput\errorbulle(), get_error(), get_property_updatable(), get_property_visible(), h, HtmlInput\hidden(), Icon_Action\infobulle(), input_custom(), noalyss_strlen(), prec, and table.
Referenced by ajax_input().
Manage_Table_SQL::input_custom | ( | $p_key, | |
$p_value | |||
) |
this function let you create your own input , for example for a ITEXT , a IRADIO , ... it must be override , there is not default
string | $p_key | name of the column |
string | $p_value | current value |
Reimplemented in Acc_Other_Tax_MTable, Acc_Plan_MTable, Acc_Report_MTable, Card_Attribut_MTable, Mobile_Device_MTable, and Payment_Method_MTable.
Definition at line 1290 of file manage_table_sql.class.php.
Referenced by input().
Manage_Table_SQL::insert | ( | ) |
insert a new value
Definition at line 1530 of file manage_table_sql.class.php.
References table.
Manage_Table_SQL::move | ( | $p_key, | |
$p_idx | |||
) |
if we change a column order , the order of the other columns is impacted.
With a_order[0,1,2,3]=[x,y,z,a] if we move the column x (idx=0) to 2
we must obtain [y,z,x,a]
string | $p_key | data column |
integer | $p_idx | new location |
Definition at line 760 of file manage_table_sql.class.php.
References $i, $old, and get_current_pos().
Manage_Table_SQL::param_set | ( | $p_json | ) |
Set the parameter of the object (gDossier, ac, plugin_code...) @detail By default , only gDossier will be set .
The default value is given in the constructor
string | with json format $p_json |
Definition at line 523 of file manage_table_sql.class.php.
References set_json().
Manage_Table_SQL::save | ( | ) |
save the Data_SQL Object The noalyss_SQL is not empty
Reimplemented in Action_Document_Type_MTable, Currency_MTable, Operation_Predef_MTable, and Tva_Rate_MTable.
Definition at line 1513 of file manage_table_sql.class.php.
References table.
Referenced by ajax_save().
Manage_Table_SQL::send_header | ( | ) |
send the XML headers for the ajax call
Definition at line 219 of file manage_table_sql.class.php.
Manage_Table_SQL::set_append_row | ( | $p_value | ) |
Enable or disable the appending of rows.
$p_value | Boolean : true enable the row to be appended |
Definition at line 656 of file manage_table_sql.class.php.
Referenced by Operation_Predef_MTable\__construct(), and Mobile_Device_MTable\__construct().
Manage_Table_SQL::set_button_add_top | ( | $button_add_top | ) |
Definition at line 806 of file manage_table_sql.class.php.
References $button_add_top.
Manage_Table_SQL::set_callback | ( | $p_file | ) |
set the callback function that is passed to javascript
$p_file | : callback file by default ajax.php |
Definition at line 542 of file manage_table_sql.class.php.
Referenced by Operation_Predef_MTable\__construct(), Mobile_Device_MTable\__construct(), and Document_State_MTable\build().
Manage_Table_SQL::set_col_label | ( | $p_key, | |
$p_display | |||
) |
set the name to display for a column
string | $p_key | data column |
string | $p_display | Label to display |
Definition at line 732 of file manage_table_sql.class.php.
Referenced by Card_Attribut_MTable\__construct(), Payment_Method_MTable\__construct(), Acc_Plan_MTable\__construct(), Contact_Option_Ref_MTable\__construct(), Anc_Account_Table\__construct(), Document_State_MTable\__construct(), Action_Document_Type_MTable\__construct(), Template_Card_Category\__construct(), Operation_Predef_MTable\__construct(), Mobile_Device_MTable\__construct(), Tag_Group_MTable\__construct(), Currency_MTable\__construct(), and Tva_Rate_MTable\__construct().
Manage_Table_SQL::set_col_option | ( | $p_key, | |
$p_value | |||
) |
add extra to column, normally class or style
string | $p_key | column name |
string | $p_value | extra info for this column (CSS, js, ...) |
Definition at line 415 of file manage_table_sql.class.php.
Manage_Table_SQL::set_col_sort | ( | $p_num | ) |
When adding an element ,we place it thanks the DOM Attribute sort_value set it to -1 if you want one to append.
numeric | $pn_num |
Definition at line 288 of file manage_table_sql.class.php.
Referenced by Card_Attribut_MTable\__construct(), Anc_Account_Table\__construct(), Operation_Predef_MTable\__construct(), and Mobile_Device_MTable\__construct().
Manage_Table_SQL::set_col_tips | ( | $p_key, | |
$p_comment | |||
) |
Set the info for a column, use Icon_Action::infobulle the message are in message_javascript.php.
string | $p_key | Column name |
integer | $p_comment | comment idx |
Definition at line 278 of file manage_table_sql.class.php.
Referenced by Card_Attribut_MTable\__construct(), Payment_Method_MTable\__construct(), and Mobile_Device_MTable\__construct().
Manage_Table_SQL::set_col_type | ( | $p_key, | |
$p_value, | |||
$p_array = NULL |
|||
) |
set the type of a column , it will change in the input db box , the select must supply an array of possible values [val=> , label=>] with the variable $this->key_name->a_value
$p_key | col name |
$p_type | is "text", "numeric", "date", "select", "timestamp","custom" |
$p_array | if type is SELECT an array is expected |
Definition at line 460 of file manage_table_sql.class.php.
References $p_array.
Referenced by Card_Attribut_MTable\__construct(), Payment_Method_MTable\__construct(), Acc_Plan_MTable\__construct(), Contact_Option_Ref_MTable\__construct(), Anc_Account_Table\__construct(), Document_State_MTable\__construct(), Operation_Predef_MTable\__construct(), Mobile_Device_MTable\__construct(), Currency_MTable\__construct(), and Tva_Rate_MTable\__construct().
Manage_Table_SQL::set_current_row | ( | $current_row | ) |
set the current row printed in display_row
type | $current_row |
Definition at line 1138 of file manage_table_sql.class.php.
References $current_row.
Manage_Table_SQL::set_delete_row | ( | $p_value | ) |
Enable or disable the deletion of rows.
$p_value | Boolean : true enable the row to be deleted |
Definition at line 645 of file manage_table_sql.class.php.
Referenced by Document_State_MTable\__construct(), Mobile_Device_MTable\__construct(), Currency_MTable\__construct(), Currency_MTable\display_row(), and Card_Attribut_MTable\display_row().
Manage_Table_SQL::set_dialog_box | ( | $dialog_box | ) |
mixed | $dialog_box |
Definition at line 256 of file manage_table_sql.class.php.
References $dialog_box.
Referenced by Operation_Predef_MTable\__construct().
Manage_Table_SQL::set_dialogbox_style | ( | $db_style | ) |
Dialog box style , by default {position: "fixed", top: '15', width: "auto", "margin-left": "20%"}.
array | $db_style,will | be transformed into a json object |
Definition at line 238 of file manage_table_sql.class.php.
Referenced by Acc_Plan_MTable\__construct().
Manage_Table_SQL::set_error | ( | $p_col, | |
$p_message | |||
) |
set the error message for a wrong input
$p_col | the column name |
$p_message | the error message |
Definition at line 324 of file manage_table_sql.class.php.
References $p_col.
Referenced by Acc_Other_Tax_MTable\check(), Acc_Plan_MTable\check(), Acc_Report_MTable\check(), Action_Document_Type_MTable\check(), Anc_Account_Table\check(), Card_Attribut_MTable\check(), Currency_MTable\check(), Forecast_Category_MTable\check(), Forecast_Item_MTable\check(), Mobile_Device_MTable\check(), Parameter_Extra_MTable\check(), Payment_Method_MTable\check(), Template_Card_Category\check(), and Tva_Rate_MTable\check().
Manage_Table_SQL::set_header_option | ( | $p_key, | |
$p_value | |||
) |
add extra to column Header, normally class or style
string | $p_key | column name |
string | $p_value | extra info for this column (CSS, js, ...) |
Definition at line 441 of file manage_table_sql.class.php.
Referenced by Mobile_Device_MTable\__construct().
Manage_Table_SQL::set_icon_del | ( | $pString | ) |
Set the icon to delete at the right or left of the row.
type | $pString |
Exception |
Definition at line 627 of file manage_table_sql.class.php.
Manage_Table_SQL::set_icon_mod | ( | $pString | ) |
Set the icon to modify at the right ,the first col or left of the row, if the mod if custom , you have to override the function display_icon_custom.
string | $pString | default right, accepted value=left,right,first,custom column for mod |
Exception | if invalide choice |
Definition at line 617 of file manage_table_sql.class.php.
Referenced by Acc_Plan_MTable\__construct(), and Currency_MTable\__construct().
Manage_Table_SQL::set_json | ( | $p_json | ) |
Set the parameter of the object (gDossier, ac, plugin_code...) @detail By default , only gDossier will be set .
The default value is given in the constructor
string | with json format $p_json |
Definition at line 533 of file manage_table_sql.class.php.
Referenced by param_set().
Manage_Table_SQL::set_object_name | ( | $p_object_name | ) |
Set the object_name.
string | $p_object_name | name of the JS var, used in ajax response,id of the part of the id DOMElement to modify |
Definition at line 578 of file manage_table_sql.class.php.
Referenced by Anc_Account_Table\__construct(), and Mobile_Device_MTable\__construct().
Manage_Table_SQL::set_order | ( | $p_order | ) |
Definition at line 312 of file manage_table_sql.class.php.
References $p_order.
Referenced by Card_Attribut_MTable\__construct(), Payment_Method_MTable\__construct(), Action_Document_Type_MTable\__construct(), Operation_Predef_MTable\__construct(), and Mobile_Device_MTable\__construct().
Manage_Table_SQL::set_pk | ( | $p_id | ) |
set the id value of a data row and load from the db
Definition at line 953 of file manage_table_sql.class.php.
Referenced by Operation_Predef_MTable\save().
Manage_Table_SQL::set_property_updatable | ( | $p_key, | |
$p_value | |||
) |
set a column of the data row updatable or not
string | $p_key | data column |
bool | $p_value | Boolean False or True |
Definition at line 588 of file manage_table_sql.class.php.
References elseif, get_property_updatable(), and UPDATABLE.
Referenced by Card_Attribut_MTable\__construct(), Acc_Plan_MTable\__construct(), Anc_Account_Table\__construct(), Document_State_MTable\__construct(), Action_Document_Type_MTable\__construct(), Template_Card_Category\__construct(), Operation_Predef_MTable\__construct(), Tag_Group_MTable\__construct(), and Tva_Rate_MTable\__construct().
Manage_Table_SQL::set_property_visible | ( | $p_key, | |
$p_value | |||
) |
set a column of the data row visible or not
string | $p_key | data column |
bool | $p_value | Boolean False or True |
Definition at line 699 of file manage_table_sql.class.php.
References elseif, get_property_visible(), and VISIBLE.
Referenced by Card_Attribut_MTable\__construct(), Payment_Method_MTable\__construct(), Acc_Plan_MTable\__construct(), Contact_Option_Ref_MTable\__construct(), Anc_Account_Table\__construct(), Document_State_MTable\__construct(), Action_Document_Type_MTable\__construct(), Operation_Predef_MTable\__construct(), Mobile_Device_MTable\__construct(), Tag_Group_MTable\__construct(), Currency_MTable\__construct(), and Acc_Other_Tax_MTable\input().
Manage_Table_SQL::set_search_table | ( | $search_table | ) |
Set the table searchable or not.
boolean | : true we can search |
Definition at line 210 of file manage_table_sql.class.php.
References $search_table.
Manage_Table_SQL::set_sort_column | ( | $p_col | ) |
set the column to sort by default
Definition at line 938 of file manage_table_sql.class.php.
References $p_col.
Referenced by Operation_Predef_MTable\__construct(), Mobile_Device_MTable\__construct(), and Currency_MTable\__construct().
Manage_Table_SQL::set_table | ( | Data_SQL | $p_noalyss_sql | ) |
Definition at line 304 of file manage_table_sql.class.php.
References table.
Manage_Table_SQL::set_update_row | ( | $p_value | ) |
Enable or disable the updating of rows.
$p_value | Boolean : true enable the row to be updated |
Definition at line 667 of file manage_table_sql.class.php.
Referenced by Currency_MTable\display_row(), and Card_Attribut_MTable\display_row().
Manage_Table_SQL::set_value | ( | $p_key, | |
$p_value | |||
) |
Definition at line 1550 of file manage_table_sql.class.php.
References table.
Manage_Table_SQL::setCssClass | ( | $p_class | ) |
Definition at line 178 of file manage_table_sql.class.php.
Manage_Table_SQL::setTitle | ( | $p_title | ) |
Set the title of the diabox , default is Donnée.
type | $p_title |
Definition at line 188 of file manage_table_sql.class.php.
References title.
Manage_Table_SQL::show_error | ( | $p_col | ) |
Definition at line 567 of file manage_table_sql.class.php.
References $error, $p_col, HtmlInput\errorbulle(), and get_error().
Manage_Table_SQL::update | ( | ) |
Definition at line 1540 of file manage_table_sql.class.php.
References table.
|
protected |
in display_row and display_custom_row, it is the current row which is used
Extra to add to the column : CSS Style , CSS class, javascript ,...
Definition at line 130 of file manage_table_sql.class.php.
|
protected |
Extra to add to the column Header : CSS Style , CSS class, javascript ,...
Definition at line 131 of file manage_table_sql.class.php.
|
protected |
Array with the infotip.
Definition at line 116 of file manage_table_sql.class.php.
|
protected |
Label of the col. of the datarow.
Definition at line 104 of file manage_table_sql.class.php.
|
protected |
order of the col
Definition at line 105 of file manage_table_sql.class.php.
Referenced by get_order().
|
protected |
property for each col.
Definition at line 106 of file manage_table_sql.class.php.
|
protected |
Possible value if a_type is a SELECT.
Definition at line 108 of file manage_table_sql.class.php.
|
protected |
Type of the column : date , select ... Only in input.
Definition at line 107 of file manage_table_sql.class.php.
|
protected |
Array containing the error of the input data.
Definition at line 114 of file manage_table_sql.class.php.
|
protected |
place of the button add on the top, by default true
Definition at line 126 of file manage_table_sql.class.php.
Referenced by get_button_add_top(), and set_button_add_top().
|
protected |
Callback function.
Definition at line 132 of file manage_table_sql.class.php.
|
protected |
when inserting, it is the column to sort,-1 to disable it and append only
Definition at line 115 of file manage_table_sql.class.php.
Referenced by display_row(), and get_col_sort().
|
protected |
< give the title of the diabox , default is Data
Definition at line 128 of file manage_table_sql.class.php.
Referenced by getCssClass().
|
protected |
CSS class for the dialog box.
Definition at line 129 of file manage_table_sql.class.php.
Referenced by get_current_row(), and set_current_row().
|
protected |
ID of the dialog box which display the result of the ajax calls.
Definition at line 118 of file manage_table_sql.class.php.
Referenced by get_dialog_box(), and set_dialog_box().
|
protected |
style of the dialog box
Definition at line 125 of file manage_table_sql.class.php.
Referenced by get_dialogbox_style().
|
protected |
place of right or left the icon update or mod, default right, accepted value=left,right
Definition at line 124 of file manage_table_sql.class.php.
Referenced by get_icon_del().
|
protected |
place of right or left the icon update or mod, default right, accepted value=left,right,first,custom column for mod
Definition at line 123 of file manage_table_sql.class.php.
Referenced by get_icon_mod().
|
protected |
Default parameter to add (gDossier...), sent to the ajax callback.
Definition at line 113 of file manage_table_sql.class.php.
Referenced by get_json().
|
protected |
Object_name is used for the javascript , it is the row id to update or delete.
Definition at line 109 of file manage_table_sql.class.php.
Referenced by get_js_variable(), and get_object_name().
|
protected |
Flag to indicate if rows can be added.
Definition at line 112 of file manage_table_sql.class.php.
Referenced by can_append_row().
|
protected |
Flag to indicate if rows can be deleted.
Definition at line 110 of file manage_table_sql.class.php.
Referenced by can_delete_row().
|
protected |
Flag to indicate if rows can be updated.
Definition at line 111 of file manage_table_sql.class.php.
Referenced by can_update_row().
|
protected |
boolean , by default true ,it is possible to search in the table,
Definition at line 119 of file manage_table_sql.class.php.
Referenced by get_search_table(), and set_search_table().
|
protected |
javascript sort on this column , if empty there is no js sort
Definition at line 117 of file manage_table_sql.class.php.
Referenced by get_sort_column().
|
protected |
Object Data_SQL.
Definition at line 103 of file manage_table_sql.class.php.
Referenced by Action_Document_Type_MTable\check(), Anc_Account_Table\check(), Currency_MTable\check(), Payment_Method_MTable\check(), Action_Document_Type_MTable\delete(), get_table(), and Action_Document_Type_MTable\input().
|
protected |
Definition at line 127 of file manage_table_sql.class.php.
Referenced by getTitle().
const Manage_Table_SQL::UPDATABLE =1 |
Definition at line 120 of file manage_table_sql.class.php.
Referenced by get_property_updatable(), and set_property_updatable().
const Manage_Table_SQL::VISIBLE =2 |
Definition at line 121 of file manage_table_sql.class.php.
Referenced by __construct(), get_property_visible(), and set_property_visible().