mirror of
https://github.com/e107inc/e107.git
synced 2025-08-27 00:05:46 +02:00
Improved testing of admin-ui search/filter.
This commit is contained in:
@@ -0,0 +1,676 @@
|
||||
{
|
||||
"uri": "\/e107v2\/e107_admin\/newspost.php?searchquery=e107&filter_options=searchfield__news_title&mode=main&action=list&etrigger_filter=etrigger_filter",
|
||||
"methodInvocation": {
|
||||
"listQry": "SELECT n.*, nc.category_name, nc.category_sef, u.user_id,u.user_name FROM `#news` AS n \n LEFT JOIN `#news_category` AS nc ON n.news_category = nc.category_id \n LEFT JOIN `#user` AS u ON n.news_author = u.user_id ",
|
||||
"searchTerm": "e107",
|
||||
"filterOptions": "searchfield__news_title",
|
||||
"tablePath": "`#news`.",
|
||||
"tableFrom": "`#news`",
|
||||
"primaryName": "news_id",
|
||||
"raw": false,
|
||||
"orderField": null,
|
||||
"qryAsc": null,
|
||||
"forceFrom": false,
|
||||
"qryFrom": 0,
|
||||
"forceTo": false,
|
||||
"perPage": 10,
|
||||
"qryField": null,
|
||||
"isfilter": false,
|
||||
"handleAction": "List"
|
||||
},
|
||||
"preProcessedData": {
|
||||
"fields": {
|
||||
"checkboxes": {
|
||||
"title": "",
|
||||
"type": null,
|
||||
"width": "3%",
|
||||
"thclass": "center first",
|
||||
"class": "center",
|
||||
"nosort": true,
|
||||
"toggle": "news_selected",
|
||||
"forced": true,
|
||||
"table": "news",
|
||||
"alias": "",
|
||||
"field": "checkboxes",
|
||||
"__tableField": "`#news`.checkboxes",
|
||||
"__tableFrom": "`#news`.checkboxes"
|
||||
},
|
||||
"news_id": {
|
||||
"title": "ID",
|
||||
"type": "text",
|
||||
"width": "5%",
|
||||
"thclass": "center",
|
||||
"class": "center",
|
||||
"nosort": false,
|
||||
"readParms": "link=sef&target=blank",
|
||||
"table": "news",
|
||||
"alias": "n.news_id",
|
||||
"field": "news_id",
|
||||
"__tableField": "n.news_id",
|
||||
"__tableFrom": "`#news`.news_id AS n.news_id"
|
||||
},
|
||||
"news_thumbnail": {
|
||||
"title": "Image\/Video",
|
||||
"type": "method",
|
||||
"data": "str",
|
||||
"width": "110px",
|
||||
"thclass": "center",
|
||||
"class": "center",
|
||||
"nosort": false,
|
||||
"readParms": "thumb=60&thumb_urlraw=0&thumb_aw=60",
|
||||
"readonly": false,
|
||||
"table": "news",
|
||||
"alias": "n.news_thumbnail",
|
||||
"field": "news_thumbnail",
|
||||
"__tableField": "n.news_thumbnail",
|
||||
"__tableFrom": "`#news`.news_thumbnail AS n.news_thumbnail"
|
||||
},
|
||||
"news_title": {
|
||||
"title": "Title",
|
||||
"type": "text",
|
||||
"data": "safestr",
|
||||
"filter": true,
|
||||
"tab": 0,
|
||||
"writeParms": {
|
||||
"required": 1,
|
||||
"size": "block-level"
|
||||
},
|
||||
"inline": true,
|
||||
"width": "auto",
|
||||
"thclass": "",
|
||||
"class": null,
|
||||
"nosort": false,
|
||||
"table": "news",
|
||||
"alias": "n.news_title",
|
||||
"field": "news_title",
|
||||
"__tableField": "n.news_title",
|
||||
"__tableFrom": "`#news`.news_title AS n.news_title"
|
||||
},
|
||||
"news_summary": {
|
||||
"title": "Summary",
|
||||
"type": "text",
|
||||
"data": "safestr",
|
||||
"filter": true,
|
||||
"tab": 0,
|
||||
"inline": true,
|
||||
"writeParms": "size=block-level",
|
||||
"width": "auto",
|
||||
"thclass": "left",
|
||||
"class": "left",
|
||||
"nosort": false,
|
||||
"table": "news",
|
||||
"alias": "n.news_summary",
|
||||
"field": "news_summary",
|
||||
"__tableField": "n.news_summary",
|
||||
"__tableFrom": "`#news`.news_summary AS n.news_summary"
|
||||
},
|
||||
"news_body": {
|
||||
"title": "",
|
||||
"type": "method",
|
||||
"data": "str",
|
||||
"tab": 0,
|
||||
"nolist": true,
|
||||
"writeParms": "nolabel=1",
|
||||
"width": "auto",
|
||||
"thclass": "",
|
||||
"class": null,
|
||||
"nosort": false,
|
||||
"table": "news",
|
||||
"alias": "n.news_body",
|
||||
"field": "news_body",
|
||||
"__tableField": "n.news_body",
|
||||
"__tableFrom": "`#news`.news_body AS n.news_body"
|
||||
},
|
||||
"news_extended": {
|
||||
"title": "",
|
||||
"type": null,
|
||||
"data": "str",
|
||||
"tab": 0,
|
||||
"nolist": true,
|
||||
"noedit": true,
|
||||
"writeParms": "nolabel=1",
|
||||
"width": "auto",
|
||||
"thclass": "",
|
||||
"class": null,
|
||||
"nosort": false,
|
||||
"table": "news",
|
||||
"alias": "n.news_extended",
|
||||
"field": "news_extended",
|
||||
"__tableField": "n.news_extended",
|
||||
"__tableFrom": "`#news`.news_extended AS n.news_extended"
|
||||
},
|
||||
"news_meta_title": {
|
||||
"title": "Meta Title",
|
||||
"type": "text",
|
||||
"data": "safestr",
|
||||
"filter": true,
|
||||
"tab": 1,
|
||||
"inline": true,
|
||||
"width": "auto",
|
||||
"help": "",
|
||||
"writeParms": {
|
||||
"size": "xxlarge",
|
||||
"placeholder": "",
|
||||
"counter": 0,
|
||||
"maxlength": 255
|
||||
},
|
||||
"nosort": false,
|
||||
"table": "news",
|
||||
"alias": "n.news_meta_title",
|
||||
"field": "news_meta_title",
|
||||
"__tableField": "n.news_meta_title",
|
||||
"__tableFrom": "`#news`.news_meta_title AS n.news_meta_title"
|
||||
},
|
||||
"news_meta_keywords": {
|
||||
"title": "Keywords",
|
||||
"type": "tags",
|
||||
"data": "safestr",
|
||||
"filter": true,
|
||||
"tab": 1,
|
||||
"inline": true,
|
||||
"width": "auto",
|
||||
"thclass": "",
|
||||
"class": null,
|
||||
"nosort": false,
|
||||
"readParms": {
|
||||
"maxlength": 255,
|
||||
"maxItems": 30
|
||||
},
|
||||
"writeParms": {
|
||||
"maxItems": 30,
|
||||
"maxlength": 255
|
||||
},
|
||||
"table": "news",
|
||||
"alias": "n.news_meta_keywords",
|
||||
"field": "news_meta_keywords",
|
||||
"__tableField": "n.news_meta_keywords",
|
||||
"__tableFrom": "`#news`.news_meta_keywords AS n.news_meta_keywords"
|
||||
},
|
||||
"news_meta_description": {
|
||||
"title": "Meta Description",
|
||||
"type": "textarea",
|
||||
"data": "safestr",
|
||||
"filter": true,
|
||||
"tab": 1,
|
||||
"width": "auto",
|
||||
"thclass": "",
|
||||
"help": "",
|
||||
"class": null,
|
||||
"nosort": false,
|
||||
"writeParms": {
|
||||
"size": "xxlarge",
|
||||
"counter": 0,
|
||||
"maxlength": 255,
|
||||
"rows": 2
|
||||
},
|
||||
"table": "news",
|
||||
"alias": "n.news_meta_description",
|
||||
"field": "news_meta_description",
|
||||
"__tableField": "n.news_meta_description",
|
||||
"__tableFrom": "`#news`.news_meta_description AS n.news_meta_description"
|
||||
},
|
||||
"news_meta_robots": {
|
||||
"title": "Robots",
|
||||
"type": "dropdown",
|
||||
"data": "safestr",
|
||||
"tab": 1,
|
||||
"inline": true,
|
||||
"readParms": {
|
||||
"type": "checkboxes"
|
||||
},
|
||||
"writeParms": {
|
||||
"multiple": 1,
|
||||
"optArray": {
|
||||
"noindex": "NoIndex",
|
||||
"nofollow": "NoFollow",
|
||||
"noarchive": "NoArchive",
|
||||
"noimageindex": "NoImageIndex"
|
||||
},
|
||||
"title": {
|
||||
"noindex": "Prevent search engines from indexing this item.",
|
||||
"nofollow": "Prevent search engines from following links in this item.",
|
||||
"noarchive": "Prevent cached copies of this item from appearing in search results.",
|
||||
"noimageindex": "Prevent search engines from indexing images of this item."
|
||||
}
|
||||
},
|
||||
"width": "auto",
|
||||
"thclass": "left",
|
||||
"class": "left",
|
||||
"nosort": false,
|
||||
"batch": true,
|
||||
"filter": true,
|
||||
"table": "news",
|
||||
"alias": "n.news_meta_robots",
|
||||
"field": "news_meta_robots",
|
||||
"__tableField": "n.news_meta_robots",
|
||||
"__tableFrom": "`#news`.news_meta_robots AS n.news_meta_robots"
|
||||
},
|
||||
"news_sef": {
|
||||
"title": "SEF URL",
|
||||
"type": "text",
|
||||
"batch": 1,
|
||||
"data": "str",
|
||||
"tab": 1,
|
||||
"inline": true,
|
||||
"width": "auto",
|
||||
"thclass": "",
|
||||
"class": null,
|
||||
"nosort": false,
|
||||
"writeParms": {
|
||||
"size": "xxlarge",
|
||||
"show": 1,
|
||||
"sef": "news_title"
|
||||
},
|
||||
"table": "news",
|
||||
"alias": "n.news_sef",
|
||||
"field": "news_sef",
|
||||
"__tableField": "n.news_sef",
|
||||
"__tableFrom": "`#news`.news_sef AS n.news_sef"
|
||||
},
|
||||
"news_author": {
|
||||
"title": "Author",
|
||||
"type": "method",
|
||||
"tab": 2,
|
||||
"readParms": "idField=user_id&nameField=user_name",
|
||||
"width": "auto",
|
||||
"thclass": "",
|
||||
"class": null,
|
||||
"nosort": false,
|
||||
"table": "news",
|
||||
"alias": "n.news_author",
|
||||
"__tableField": "n.news_author",
|
||||
"__tableFrom": "`#news`.news_author AS n.news_author",
|
||||
"field": "news_author"
|
||||
},
|
||||
"news_datestamp": {
|
||||
"title": "Date stamp",
|
||||
"type": "datestamp",
|
||||
"data": "int",
|
||||
"tab": 2,
|
||||
"writeParms": "type=datetime",
|
||||
"width": "auto",
|
||||
"thclass": "",
|
||||
"class": null,
|
||||
"nosort": false,
|
||||
"filter": true,
|
||||
"batch": true,
|
||||
"table": "news",
|
||||
"alias": "n.news_datestamp",
|
||||
"field": "news_datestamp",
|
||||
"__tableField": "n.news_datestamp",
|
||||
"__tableFrom": "`#news`.news_datestamp AS n.news_datestamp"
|
||||
},
|
||||
"news_category": {
|
||||
"title": "Category",
|
||||
"type": "dropdown",
|
||||
"data": "int",
|
||||
"tab": 0,
|
||||
"inline": true,
|
||||
"width": "auto",
|
||||
"thclass": "",
|
||||
"class": null,
|
||||
"nosort": false,
|
||||
"batch": true,
|
||||
"filter": true,
|
||||
"table": "news",
|
||||
"alias": "n.news_category",
|
||||
"__tableField": "n.news_category",
|
||||
"__tableFrom": "`#news`.news_category AS n.news_category",
|
||||
"field": "news_category",
|
||||
"writeParms": {
|
||||
"optArray": {
|
||||
"2": "Category 1",
|
||||
"3": "Category 2",
|
||||
"1": "Misc"
|
||||
},
|
||||
"size": "xlarge"
|
||||
}
|
||||
},
|
||||
"news_start": {
|
||||
"title": "Start",
|
||||
"type": "datestamp",
|
||||
"data": "int",
|
||||
"tab": 2,
|
||||
"writeParms": "type=datetime",
|
||||
"width": "auto",
|
||||
"thclass": "",
|
||||
"class": null,
|
||||
"nosort": false,
|
||||
"table": "news",
|
||||
"alias": "n.news_start",
|
||||
"field": "news_start",
|
||||
"__tableField": "n.news_start",
|
||||
"__tableFrom": "`#news`.news_start AS n.news_start"
|
||||
},
|
||||
"news_end": {
|
||||
"title": "End",
|
||||
"type": "datestamp",
|
||||
"data": "int",
|
||||
"tab": 2,
|
||||
"writeParms": "type=datetime",
|
||||
"width": "auto",
|
||||
"thclass": "",
|
||||
"class": null,
|
||||
"nosort": false,
|
||||
"table": "news",
|
||||
"alias": "n.news_end",
|
||||
"field": "news_end",
|
||||
"__tableField": "n.news_end",
|
||||
"__tableFrom": "`#news`.news_end AS n.news_end"
|
||||
},
|
||||
"news_class": {
|
||||
"title": "Visibility",
|
||||
"type": "userclass",
|
||||
"tab": 2,
|
||||
"inline": true,
|
||||
"width": "auto",
|
||||
"thclass": "",
|
||||
"class": null,
|
||||
"batch": true,
|
||||
"filter": true,
|
||||
"table": "news",
|
||||
"alias": "n.news_class",
|
||||
"field": "news_class",
|
||||
"__tableField": "n.news_class",
|
||||
"__tableFrom": "`#news`.news_class AS n.news_class"
|
||||
},
|
||||
"news_template": {
|
||||
"title": "Template",
|
||||
"type": "method",
|
||||
"data": "safestr",
|
||||
"tab": 2,
|
||||
"inline": true,
|
||||
"writeParms": {
|
||||
"plugin": "news",
|
||||
"id": "news_view",
|
||||
"area": "front",
|
||||
"merge": false
|
||||
},
|
||||
"width": "auto",
|
||||
"thclass": "left",
|
||||
"class": "left",
|
||||
"nosort": false,
|
||||
"batch": true,
|
||||
"filter": true,
|
||||
"table": "news",
|
||||
"alias": "n.news_template",
|
||||
"field": "news_template",
|
||||
"__tableField": "n.news_template",
|
||||
"__tableFrom": "`#news`.news_template AS n.news_template"
|
||||
},
|
||||
"news_render_type": {
|
||||
"title": "Location",
|
||||
"type": "dropdown",
|
||||
"data": "safestr",
|
||||
"tab": 2,
|
||||
"inline": true,
|
||||
"readParms": {
|
||||
"type": "checkboxes"
|
||||
},
|
||||
"width": "auto",
|
||||
"thclass": "left",
|
||||
"class": "left",
|
||||
"nosort": false,
|
||||
"batch": true,
|
||||
"filter": true,
|
||||
"table": "news",
|
||||
"alias": "n.news_render_type",
|
||||
"field": "news_render_type",
|
||||
"__tableField": "n.news_render_type",
|
||||
"__tableFrom": "`#news`.news_render_type AS n.news_render_type",
|
||||
"writeParms": {
|
||||
"optArray": {
|
||||
"0": "Default Area",
|
||||
"1": "Default Area - Title",
|
||||
"4": "Default Area - Title\/Summary",
|
||||
"2": "Sidebar - Othernews",
|
||||
"3": "Sidebar - Othernews 2",
|
||||
"5": "Carousel",
|
||||
"6": "News Grid Menu"
|
||||
},
|
||||
"multiple": 1,
|
||||
"empty": "0"
|
||||
}
|
||||
},
|
||||
"news_sticky": {
|
||||
"title": "Sticky",
|
||||
"type": "boolean",
|
||||
"data": "int",
|
||||
"tab": 2,
|
||||
"width": "auto",
|
||||
"thclass": "center",
|
||||
"inline": true,
|
||||
"class": "center",
|
||||
"nosort": false,
|
||||
"batch": true,
|
||||
"filter": true,
|
||||
"table": "news",
|
||||
"alias": "n.news_sticky",
|
||||
"field": "news_sticky",
|
||||
"__tableField": "n.news_sticky",
|
||||
"__tableFrom": "`#news`.news_sticky AS n.news_sticky"
|
||||
},
|
||||
"news_modified": {
|
||||
"title": "Last Updated",
|
||||
"type": "datestamp",
|
||||
"readonly": true,
|
||||
"noedit": true,
|
||||
"data": "int",
|
||||
"tab": 2,
|
||||
"width": "auto",
|
||||
"thclass": "center",
|
||||
"inline": false,
|
||||
"class": "center",
|
||||
"nosort": false,
|
||||
"batch": false,
|
||||
"filter": true,
|
||||
"table": "news",
|
||||
"alias": "n.news_modified",
|
||||
"field": "news_modified",
|
||||
"__tableField": "n.news_modified",
|
||||
"__tableFrom": "`#news`.news_modified AS n.news_modified"
|
||||
},
|
||||
"news_allow_comments": {
|
||||
"title": "Comments",
|
||||
"type": "boolean",
|
||||
"data": "int",
|
||||
"tab": 2,
|
||||
"writeParms": "inverse=1",
|
||||
"width": "auto",
|
||||
"thclass": "center",
|
||||
"class": "center",
|
||||
"nosort": false,
|
||||
"batch": true,
|
||||
"filter": true,
|
||||
"readParms": "reverse=1",
|
||||
"table": "news",
|
||||
"alias": "n.news_allow_comments",
|
||||
"field": "news_allow_comments",
|
||||
"__tableField": "n.news_allow_comments",
|
||||
"__tableFrom": "`#news`.news_allow_comments AS n.news_allow_comments"
|
||||
},
|
||||
"news_comment_total": {
|
||||
"title": "Comment Total",
|
||||
"type": "number",
|
||||
"data": "int",
|
||||
"tab": 2,
|
||||
"noedit": true,
|
||||
"width": "10%",
|
||||
"thclass": "",
|
||||
"class": null,
|
||||
"nosort": false,
|
||||
"table": "news",
|
||||
"alias": "n.news_comment_total",
|
||||
"field": "news_comment_total",
|
||||
"__tableField": "n.news_comment_total",
|
||||
"__tableFrom": "`#news`.news_comment_total AS n.news_comment_total"
|
||||
},
|
||||
"news_email_notify": {
|
||||
"title": "Email notification",
|
||||
"type": "checkbox",
|
||||
"tab": 2,
|
||||
"data": false,
|
||||
"writeParms": {
|
||||
"show": 1,
|
||||
"tdClassRight": "form-inline",
|
||||
"post": "<span class='radio-inline radio inline'><a class='e-modal btn btn-xs btn-mini btn-primary' data-modal-caption='Notify' href='notify.php?iframe=1&type=admin_news_notify#\/tab-news-events'>Configure<\/a><\/span>"
|
||||
},
|
||||
"help": "Trigger an email notification when you submit this form.",
|
||||
"table": "news",
|
||||
"alias": "n.news_email_notify",
|
||||
"field": "news_email_notify",
|
||||
"__tableField": "n.news_email_notify",
|
||||
"__tableFrom": "`#news`.news_email_notify AS n.news_email_notify"
|
||||
},
|
||||
"submitted_id": {
|
||||
"title": "Submitted Item",
|
||||
"type": "hidden",
|
||||
"tab": 2,
|
||||
"data": false,
|
||||
"writeParms": "show=0",
|
||||
"table": "news",
|
||||
"alias": "n.submitted_id",
|
||||
"field": "submitted_id",
|
||||
"__tableField": "n.submitted_id",
|
||||
"__tableFrom": "`#news`.submitted_id AS n.submitted_id"
|
||||
},
|
||||
"x__blank_url": {
|
||||
"title": "Blank URL",
|
||||
"type": "url",
|
||||
"tab": 1,
|
||||
"writeParms": {
|
||||
"size": "xxlarge",
|
||||
"placeholder": "",
|
||||
"default": "https:\/\/"
|
||||
},
|
||||
"width": "auto",
|
||||
"help": "",
|
||||
"readParms": "",
|
||||
"class": "left",
|
||||
"thclass": "left",
|
||||
"data": false
|
||||
},
|
||||
"x__blank_custom": {
|
||||
"title": "Blank Custom",
|
||||
"type": "method",
|
||||
"tab": 1,
|
||||
"writeParms": {
|
||||
"size": "xxlarge",
|
||||
"placeholder": "",
|
||||
"default": "https:\/\/"
|
||||
},
|
||||
"width": "auto",
|
||||
"help": "",
|
||||
"readParms": "",
|
||||
"class": "left",
|
||||
"thclass": "left",
|
||||
"data": false,
|
||||
"method": "_blank_admin_form::x__blank_custom"
|
||||
},
|
||||
"x_ahrefs_traffic": {
|
||||
"title": "Organic Traffic",
|
||||
"type": "method",
|
||||
"tab": 1,
|
||||
"writeParms": {
|
||||
"size": "xxlarge",
|
||||
"placeholder": "",
|
||||
"default": "https:\/\/"
|
||||
},
|
||||
"width": "auto",
|
||||
"help": "",
|
||||
"readParms": "",
|
||||
"class": "left",
|
||||
"thclass": "left",
|
||||
"data": false,
|
||||
"method": "ahrefs_admin_form::x_ahrefs_traffic"
|
||||
},
|
||||
"x_canonical_url": {
|
||||
"title": "Canonical URL",
|
||||
"type": "url",
|
||||
"tab": 1,
|
||||
"writeParms": {
|
||||
"size": "xxlarge",
|
||||
"placeholder": "",
|
||||
"default": ""
|
||||
},
|
||||
"width": "auto",
|
||||
"help": "",
|
||||
"readParms": "",
|
||||
"class": "left",
|
||||
"thclass": "left",
|
||||
"data": false
|
||||
},
|
||||
"x_figure_captions": {
|
||||
"title": "Image\/Video Captions",
|
||||
"type": "method",
|
||||
"tab": 0,
|
||||
"writeParms": {
|
||||
"default": null
|
||||
},
|
||||
"width": "auto",
|
||||
"help": "",
|
||||
"readParms": [],
|
||||
"class": "left",
|
||||
"thclass": "left",
|
||||
"data": false,
|
||||
"method": "figure_admin_form::x_figure_captions"
|
||||
},
|
||||
"x_linkwords_stats": {
|
||||
"title": "Linkwords",
|
||||
"type": "method",
|
||||
"tab": 1,
|
||||
"noedit": true,
|
||||
"writeParms": [],
|
||||
"width": "auto",
|
||||
"help": "",
|
||||
"readParms": "",
|
||||
"class": "left",
|
||||
"thclass": "left",
|
||||
"data": false,
|
||||
"method": "linkwords_admin_form::x_linkwords_stats"
|
||||
},
|
||||
"x_reference_url": {
|
||||
"title": "Reference",
|
||||
"type": "method",
|
||||
"tab": "ref",
|
||||
"writeParms": {
|
||||
"nolabel": true,
|
||||
"size": "xxlarge",
|
||||
"placeholder": "",
|
||||
"default": ""
|
||||
},
|
||||
"width": "auto",
|
||||
"help": "",
|
||||
"readParms": "",
|
||||
"class": "left",
|
||||
"thclass": "left",
|
||||
"data": false,
|
||||
"method": "reference_admin_form::x_reference_url"
|
||||
},
|
||||
"options": {
|
||||
"title": "Options",
|
||||
"type": null,
|
||||
"width": "10%",
|
||||
"thclass": "center last",
|
||||
"class": "center",
|
||||
"nosort": true,
|
||||
"forced": true,
|
||||
"table": "news",
|
||||
"alias": "",
|
||||
"field": "options",
|
||||
"__tableField": "`#news`.options",
|
||||
"__tableFrom": "`#news`.options"
|
||||
}
|
||||
},
|
||||
"joinData": [],
|
||||
"listOrder": "news_id desc"
|
||||
},
|
||||
"intermediateStates": {
|
||||
"searchTerm": "e107",
|
||||
"searchQuery": "e107",
|
||||
"searchFilter": "news_title LIKE '%e107%' ",
|
||||
"listQry": "SELECT n.*, nc.category_name, nc.category_sef, u.user_id,u.user_name FROM `#news` AS n \n LEFT JOIN `#news_category` AS nc ON n.news_category = nc.category_id \n LEFT JOIN `#user` AS u ON n.news_author = u.user_id ",
|
||||
"listQryBeforeFinal": "SELECT n.*, nc.category_name, nc.category_sef, u.user_id,u.user_name FROM `#news` AS n \n LEFT JOIN `#news_category` AS nc ON n.news_category = nc.category_id \n LEFT JOIN `#user` AS u ON n.news_author = u.user_id "
|
||||
},
|
||||
"expected": "SELECT n.*, nc.category_name, nc.category_sef, u.user_id,u.user_name FROM `#news` AS n \n LEFT JOIN `#news_category` AS nc ON n.news_category = nc.category_id \n LEFT JOIN `#user` AS u ON n.news_author = u.user_id WHERE news_title LIKE '%e107%' ORDER BY news_id desc LIMIT 0, 10"
|
||||
}
|
@@ -21,8 +21,9 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->ui = $this->make(e_admin_controller_ui::class);
|
||||
$this->ui = $this->make(e_admin_ui::class);
|
||||
$this->req = $this->make(e_admin_request::class);
|
||||
$this->ui->setRequest($this->req);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
@@ -155,6 +156,36 @@
|
||||
$this::assertSame($expected, $result);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function test_ModifyListQrySearchField()
|
||||
{
|
||||
$listQry = 'SELECT u.* FROM `#user` WHERE 1 ';
|
||||
$filterOptions = '';
|
||||
$tablePath = '`#user`.';
|
||||
$tableFrom = '`#user`';
|
||||
$primaryName = 'user_id';
|
||||
$raw = false;
|
||||
$orderField = null;
|
||||
$qryAsc = null;
|
||||
$forceFrom = false;
|
||||
$qryFrom = 0;
|
||||
$forceTo = false;
|
||||
$perPage = 10;
|
||||
$qryField = null;
|
||||
$isfilter = false;
|
||||
$handleAction = 'List';
|
||||
|
||||
$this->ui->setFields([
|
||||
'user_id' => array('title'=>'User ID', '__tableField' => 'u.user_id', 'type'=>'int', 'data'=>'int'),
|
||||
'user_name' => array('title' => 'Name', '__tableField' => 'u.user_name', 'type' => 'text', 'data'=>'safestr'), // Display name
|
||||
'user_login' => array('title' => 'Login','__tableField' => 'u.user_login', 'type' => 'text', 'data'=>'safestr'), // Real name (no real vetting)
|
||||
'user_phone' => array('title' => 'Phone','__tableField' => 'u.user_phone', 'search'=>true, 'type' => 'text', 'data'=>'safestr'), // Real name (no real vetting)
|
||||
|
||||
|
||||
]);
|
||||
// Search Specific Field Test
|
||||
|
||||
$this->req->setAction('List');
|
||||
@@ -176,7 +207,108 @@
|
||||
$expected = "SELECT u.* FROM `#user` WHERE 1 AND u.user_phone LIKE '%custom_phone_5551234%' LIMIT 0, 10";
|
||||
$this::assertSame($expected, $result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function test_ModifyListQrySearch_FromJsonFiles()
|
||||
{
|
||||
// The directory where the JSON files are stored
|
||||
$directory = e_BASE . "e107_tests/tests/_data/e_admin_ui/_modifyListQrySearch/";
|
||||
if (!is_dir($directory))
|
||||
{
|
||||
$this::fail("Directory does not exist: " . $directory);
|
||||
}
|
||||
|
||||
// Scan the directory for JSON files
|
||||
$files = glob($directory . '*.json');
|
||||
|
||||
$this::assertNotEmpty($files, "No JSON files found in the specified directory!");
|
||||
|
||||
foreach ($files as $fl)
|
||||
{
|
||||
// Ensure the JSON file exists
|
||||
$file = realpath(codecept_data_dir().str_replace('/', DIRECTORY_SEPARATOR, '/e_admin_ui/_modifyListQrySearch/') . basename($fl));
|
||||
if (!file_exists($file))
|
||||
{
|
||||
$this::fail("File doesn't exist: " . $file);
|
||||
}
|
||||
|
||||
// Load JSON content
|
||||
$jsonContent = file_get_contents($file);
|
||||
if (empty($jsonContent))
|
||||
{
|
||||
$this::fail("Failed to read JSON file: " . $file);
|
||||
}
|
||||
|
||||
// Decode JSON
|
||||
$data = json_decode($jsonContent, true);
|
||||
if ($data === null)
|
||||
{
|
||||
$error = json_last_error_msg(); // Get a readable explanation of the problem
|
||||
$this::fail("JSON decoding failed for file: $file. Error: " . $error);
|
||||
}
|
||||
|
||||
// Ensure JSON data is valid
|
||||
$this::assertNotEmpty($data, "Failed to decode JSON file: " . $file);
|
||||
|
||||
// Extract input parameters from JSON structure
|
||||
$methodInvocation = $data['methodInvocation'];
|
||||
$preProcessedData = $data['preProcessedData'];
|
||||
$expected = $data['expected'];
|
||||
|
||||
// Verify fields are present in the JSON
|
||||
if (empty($preProcessedData['fields']))
|
||||
{
|
||||
$this::fail("Fields are not defined in the JSON file: " . $file);
|
||||
}
|
||||
|
||||
if(!empty($preProcessedData['listOrder']))
|
||||
{
|
||||
$this->ui->setListOrder($preProcessedData['listOrder']);
|
||||
}
|
||||
|
||||
$this->ui->setFields($preProcessedData['fields']);
|
||||
|
||||
$queryValue = $this->ui->getQuery('searchquery');
|
||||
|
||||
if(!empty($methodInvocation['searchTerm']))
|
||||
{
|
||||
$this->ui->setQuery('searchquery', $methodInvocation['searchTerm']);
|
||||
}
|
||||
|
||||
if(!empty($methodInvocation['handleAction']))
|
||||
{
|
||||
$this->req->setAction($methodInvocation['handleAction']);
|
||||
}
|
||||
|
||||
$query = $this->ui->_modifyListQrySearch(
|
||||
$methodInvocation['listQry'],
|
||||
$methodInvocation['searchTerm'],
|
||||
$methodInvocation['filterOptions'],
|
||||
$methodInvocation['tablePath'],
|
||||
$methodInvocation['tableFrom'],
|
||||
$methodInvocation['primaryName'],
|
||||
$methodInvocation['raw'],
|
||||
$methodInvocation['orderField'],
|
||||
$methodInvocation['qryAsc'],
|
||||
$methodInvocation['forceFrom'],
|
||||
$methodInvocation['qryFrom'],
|
||||
$methodInvocation['forceTo'],
|
||||
$methodInvocation['perPage'],
|
||||
$methodInvocation['qryField'],
|
||||
$methodInvocation['isfilter'],
|
||||
$methodInvocation['handleAction']
|
||||
);
|
||||
|
||||
$this::assertEquals($expected, $query, "Test failed for JSON file: " . $file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
public function testGetSortParent()
|
||||
{
|
||||
|
Reference in New Issue
Block a user