MentDB  Mentalese Database Engine
Strong AI, Weak AI, Interoperability and Software Development
Download MentDB Weak
    Home  >  App 'Task Manager'
Here is the first multi-language application developed completely with MentDB Weak. It is simple but very effective. And above all it is collaborative !!!! If another remote task manager gives you access to one of its projects, you can embed this remote project in your local task manager ... No more logging out, reconnecting. Everything is at hand.

Download 'Task Manager v_1.0.0' MQL source code (GPL v3) >>> MentDB v_2.1.9 compatible

Install:
  • Install MentDB Weak vX.X.X
  • Start a MQL Editor
  • Unzip the file 'taskmanager_X.X.X.mql.zip'
  • Copy the MQL source code from the file 'taskmanager_X.X.X.mql'
  • Paste the MQL source code into the MQL Editor
  • Execute the MQL source code
  • Your application is ready!
  • Go to https://localhost:9999
  • Click on 'taskmanager'
  • Login 'system', password 'pwd'
  • Enjoy!

Demo: W99 - The task manager

Screenshot:
MQL Source code
######################################################;
# Project: TaskManager                                ;
# License: GPL v_3 (under the licence of MentDB Weak) ;
# Website: https://www.mentdb.org/taskmanager.html    ;
# Twitter: https://twitter.com/mentalese_db           ;
# Facebook: https://www.facebook.com/mentdb           ;
# LinkedIn: https://www.linkedin.com/company/innov-ai ;
# Author: Jimmitry Payet                              ;
# Mail: contact@mentdb.org                            ;
# Locality: Reunion Island (French)                   ;
######################################################;

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.update_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {
		
		#Connect to the database;
		sql connect "session1" {cm get "MENTDB";};
		json load "row" (sql row "session1" (concat "select 
			`id`, 
			`name`, 
			`is_closed`, 
			`dtcreate`, 
			`client_id`, remote_mentdb, remote_project_id from `projects` where `id`= " (sql encode (json select "data" "/client_data/id")) " "));
	
		#Disconnection ...;
		sql disconnect "session1";

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		exception (1) ([err]);
		
	} "[err]";

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "projects_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update_project")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]"(json select "row" "/id")
			;
		
		# name -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "name") "[description]" "" "[maxlength]" "512" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/name")
			;
		
		# client_id -------- TO DELETE ...;
			
			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select id, name from clients where is_closed='N' order by name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / [D_name] STR;
			
			};
			sql disconnect "session_data";
		
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "client_id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "client" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[value]" (json select "row" "/client_id")
			;
		
		# is_closed -------- TO DELETE ...;
			
			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "is_closed" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "closed") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" (json select "row" "/is_closed")
			;

			json load "remote_server" (cm show);
			json load "inValues" "[]";
			json load "optionValues" "[]";
			json iarray "inValues" / "" STR;
			json iarray "optionValues" / "" STR;
			json parse_array "remote_server" "/" "[cm]" {
			
				json load "cm" (cm get [cm]);
				if (equal (json select "cm" /type) "mentdb") {
					
					json iarray "inValues" / [cm] STR;
					json iarray "optionValues" / [cm] STR;

				};
			
			};
		
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "remote_mentdb" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "remote_mentdb") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[value]" (json select "row" "/remote_mentdb")
			;

			include "app.100.obj.form.control.textbox.number.exe" "[control_id]" "remote_project_id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "remote_project_id") "[description]" "" "[maxlength]" ""
				"[min]" 0 "[max]" "" "[step]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/remote_project_id")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "projects_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.update.exe"
		"[data_eval]" "$('#projects_update_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update")
		"[submitType]" "warning";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.masks.update_reopen_form" false 1 
  (param
  	(var "[container_id]" {true} "" is_null:false is_empty:false "container1")
  ;) 
  "Reopen an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "masks_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update_mask")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "id" "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/id")
			;
		
		# groupname -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "groupname" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "group_name") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/groupname")
			;
		
		# key -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "key" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "key") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/key")
			;
		
		# order -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "order" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "order") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/order")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "masks_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.update.exe"
		"[data_eval]" "$('#masks_update_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update")
		"[submitType]" "warning";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.masks.onload" false 1 
  (param
  	(var "[OBJ_OVERWRITE]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Execute this script on load ..." 
{

	include "app.100.obj.sajax.server.exe"
		"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.list.exe"
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"container_id\":\"MENTDB_masks\", \"page\":\"1\", \"nb_by_page\":\"10\", \"nb_lr_pagination\":\"4\", \"order_by\":\"\"}")
	;
	
} "Reload all blocs";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.skeleton" false 1 
  (param
  ;) 
  "SCRUD skeleton ..." 
{

	include "app.100.obj.sajax.skeleton.onload.exe"
		"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.onload.exe"
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
	;
	
} "Return the page";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.insert" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);
		
		-> "[result]" (sql dml "session1" (concat 
			"INSERT INTO `projects` (
			`name`, 
			`is_closed`, 
			`client_id`
			) VALUES (
			" (sql encode (json select "data" "/client_data/name")) ", 
			" (sql encode (json select "data" "/client_data/is_closed")) ", 
			" (sql encode (json select "data" "/client_data/client_id")) "
			);"
		));
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "insert_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.insert_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.onload" false 1 
  (param
  	(var "[OBJ_OVERWRITE]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Execute this script on load ..." 
{

	include "app.100.obj.sajax.server.exe"
		"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe"
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"container_id\":\"jimdb_tasks0\", \"page\":\"1\", \"nb_by_page\":\"18\", \"nb_lr_pagination\":\"6\", \"order_by\":\"\", \"current_move_client\":\"\", \"current_move_client_reset\":\"1\"}")
	;
	
} "Reload all blocs";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.users.insert" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};
		sql auto_commit "session1" false;

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		if (or (is null or empty (json select "data" "/client_data/login")) (is null or empty (json select "data" "/client_data/password"))) {

			exception (1) ("The login or password cannot be null or empty.");

		};
		
		-> "[result]" (sql dml "session1" (concat 
			"INSERT INTO `users` (
			`login`, 
			`password`
			) VALUES (
			" (sql encode (json select "data" "/client_data/login")) ", 
			" (sql encode (string md5 (json select "data" "/client_data/password"))) "
			);INSERT INTO `user_group`
			(`login`,
			`group_id`)
			VALUES
			(" (sql encode (json select "data" "/client_data/login")) ",
			3);"
		));

		if (is not null (json select "data" "/client_data/clients")) {
			if (string starts_with (json select "data" "/client_data/clients") "[") {
	
				json load by ref "data" "/client_data/clients" "clients";
				json parse_array "clients" "/" "[id]" {
				
					-> "[result]" (sql dml "session1" (concat 
						"INSERT IGNORE INTO `user_clients` (
						`login`, 
						`id`
						) VALUES (
						" (sql encode (json select "data" "/client_data/login")) ", 
						" (sql encode [id]) "
						);"
					));
				
				};
	
			} {
	
				-> "[result]" (sql dml "session1" (concat 
					"INSERT IGNORE INTO `user_clients` (
					`login`, 
					`id`
					) VALUES (
					" (sql encode (json select "data" "/client_data/login")) ", 
					" (sql encode (json select "data" "/client_data/clients")) "
					);"
				));
	
			};
		};

		if (is not null (json select "data" "/client_data/projects")) {
			if (string starts_with (json select "data" "/client_data/projects") "[") {
	
				json load by ref "data" "/client_data/projects" "projects";
				json parse_array "projects" "/" "[id]" {
				
					-> "[result]" (sql dml "session1" (concat 
						"INSERT IGNORE INTO `user_projects` (
						`login`, 
						`id`
						) VALUES (
						" (sql encode (json select "data" "/client_data/login")) ", 
						" (sql encode [id]) "
						);"
					));
				
				};
	
			} {
	
				-> "[result]" (sql dml "session1" (concat 
					"INSERT IGNORE INTO `user_projects` (
					`login`, 
					`id`
					) VALUES (
					" (sql encode (json select "data" "/client_data/login")) ", 
					" (sql encode (json select "data" "/client_data/projects")) "
					);"
				));
	
			};
		};

		if (is not null (json select "data" "/client_data/users")) {
			if (string starts_with (json select "data" "/client_data/users") "[") {
	
				json load by ref "data" "/client_data/users" "users";
				json parse_array "users" "/" "[login_grant]" {
				
					-> "[result]" (sql dml "session1" (concat 
						"INSERT IGNORE INTO `user_users` (
						`login`, 
						`login_grant`
						) VALUES (
						" (sql encode (json select "data" "/client_data/login")) ", 
						" (sql encode [login_grant]) "
						);"
					));
				
				};
	
			} {
	
				-> "[result]" (sql dml "session1" (concat 
					"INSERT IGNORE INTO `user_users` (
					`login`, 
					`login_grant`
					) VALUES (
					" (sql encode (json select "data" "/client_data/login")) ", 
					" (sql encode (json select "data" "/client_data/users")) "
					);"
				));
	
			};
		};

		sql commit "session1";
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "insert_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		try {sql rollback "session1";} {} "[sub_err]";

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.insert_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create conf "app.100.template.taskmanager" false 1 
  (param
  ;) 
  "Configuration" 
{

	json load "configuration" "{}";

	#All;
	json iobject "configuration" / title (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "task_manager") STR;
	json iobject "configuration" / bar_icon "taskmanager_logo48x48.png" STR;
	json iobject "configuration" / font_family "Roboto,Helvetica Neue,Helvetica,Arial,sans-serif;" STR;
	json iobject "configuration" / copyright_years (concat "2012 - " (date year (date sysdate))) STR;
	json iobject "configuration" / copyright_link "<a href='https://www.mentdb.org' style='color:#333' target='_blank'><b>MentDB</b></a>" STR;
	
	#login;
	json iobject "configuration" / login_logo "taskmanager_logo128x128.png" STR;
	json iobject "configuration" / login_placeholder_user (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "user") STR;
	json iobject "configuration" / login_placeholder_password (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "password") STR;
	json iobject "configuration" / login_submit_title (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "login") STR;
	json iobject "configuration" / login_error_msg (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "bad_msg") STR;

	#default page;
	json iobject "configuration" / default_page "home" STR;

	#top;
	json iobject "configuration" / top_background_color "#004073" STR;
	json iobject "configuration" / top_color "#fff" STR;
	json iobject "configuration" / top_logo "taskmanager_logo128x128.png" STR;
	json iobject "configuration" / top_logo_width "50px" STR;
	json iobject "configuration" / top_logo_top "-2px" STR;
	json iobject "configuration" / top_logo_left "10px" STR;
	json iobject "configuration" / top_title (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "task_manager") STR;

	#menu;
	json iobject "configuration" / menu_background_color "#fff" STR;
	json iobject "configuration" / menu_default_show true STR;
	json iobject "configuration" / menu "[]" ARRAY;
	
	app menu "/menu" "home" "Home" "fa-home" "index.jsp?app_page=home" post "home" "menu_home" "*-";
	app menu "/menu" "gear" "Calendar" "fa-gear" "index.jsp?app_page=admin" post "gear" "menu_gear" "*-";

	json doc "configuration";

} "";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.clients.insert_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an insert form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "clients_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "add_new_client")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# name -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "company_name") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" ""
			;
		# contact_name -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_name") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" ""
			;
		
		# contact_email -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_email" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_email") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" ""
			;
		
		# contact_tel -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_tel" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_phone") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" ""
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "clients_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.insert.exe"
		"[data_eval]" "$('#clients_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "add")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.clients.update_reopen_form" false 1 
  (param
  	(var "[container_id]" {true} "" is_null:false is_empty:false "container1")
  ;) 
  "Reopen an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "clients_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update_client_c")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# id -------- TO DELETE ...;
		
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]" (json select "data" "/client_data/id")
			;
		
		# name -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "company_name") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/name")
			;
		
		# contact_name -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_name") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/contact_name")
			;
		
		# contact_email -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_email" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_email") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/contact_email")
			;
		
		# contact_tel -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_tel" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_phone") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/contact_tel")
			;

			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "is_closed" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "closed") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" (json select "data" "/client_data/is_closed")
			;

			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "ordered" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "order") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" (json select "data" "/client_data/ordered")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "clients_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.update.exe"
		"[data_eval]" "$('#clients_update_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update")
		"[submitType]" "warning";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.search_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a search form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "tasks_search_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "search_task")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";

	-> "[filter_sql]" (json select "app" (concat "/objects/jimdb_tasks_list/filter_sql"));
	if (not (is null or empty [filter_sql])) {
		json load "filter_sql" [filter_sql];
	} {
		json load "filter_sql" "{}";
	};
			
		# title -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/title")) {
				json iobject "filter_sql" / "title" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "title" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "search_task") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/title")
			;
		
		# description -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/description")) {
				json iobject "filter_sql" / "description" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "description" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "description" "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/description")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "tasks_search_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.search.exe"
		"[data_eval]" "$('#tasks_search_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "search")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update_open_form2" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {
		
		#Connect to the database;
		sql connect "session1" {cm get "MENTDB";};
		json load "row" (sql row "session1" (concat "select 
			`id`, 
			`title`, 
			`description`, 
			`state`, 
			`project_id`, 
			`login_from`, 
			`login_to`, 
			percent, 
			`dtcreate` from `tasks` where `id`= " (sql encode (json select "data" "/client_data/id")) " "));

		-> "[result]" (sql dml "session1" (concat 
			"INSERT IGNORE INTO `already_read` (id_task, login) values (" (sql encode (json select "data" "/client_data/id")) ", " (sql encode (json select "app" /user)) ");"
		));
		
		sql dml "session1" (concat "update tasks set last_update=current_timestamp() where id =" (json select "data" "/client_data/id"));
		
		#Disconnection ...;
		sql disconnect "session1";

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		exception (1) ([err]);
		
	} "[err]";

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "tasks_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "task_update")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]"(json select "row" "/id")
			;
		
		# title -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "title" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "title") "[description]" "" "[maxlength]" "1024" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/title")
			;
		
		# project_id -------- TO DELETE ...;
			
			sql connect "info_user" {cm get "MENTDB";};
			-> "[filtre_client_droit]" (sql value "info_user" (concat "select group_concat(user_clients.id) from user_clients, clients where clients.id=user_clients.id and is_closed='N' and login=" (sql encode (json select "app" /user))));
			-> "[filtre_projet_droit]" (sql value "info_user" (concat "select group_concat(user_projects.id) from user_projects, projects where projects.id=user_projects.id and is_closed='N' and login=" (sql encode (json select "app" /user))));
			sql disconnect "info_user";
			if (is null or empty [filtre_client_droit]) {
				-> "[filtre_client_droit]" (concat "and clients.id in (-1) ");
			} {
				-> "[filtre_client_droit]" (concat "and clients.id in (" [filtre_client_droit] ") ");
			};
			if (is null or empty [filtre_projet_droit]) {
				-> "[filtre_projet_droit]" (concat "and projects.id in (-1) ");
			} {
				-> "[filtre_projet_droit]" (concat "and projects.id in (" [filtre_projet_droit] ") ");
			};

			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select projects.id, projects.name, clients.name as client from projects, clients WHERE projects.client_id=clients.id and (remote_mentdb is null or remote_mentdb='') " [filtre_client_droit] [filtre_projet_droit] " order by clients.name, projects.name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / (concat [D_client] " / " [D_name]) STR;
			
			};
			sql disconnect "session_data";
		
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "project_id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "project") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[value]" (json select "row" "/project_id")
			;

			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "source" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "source" "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" true "[required]" false "[disabled]" true "[html]" ""
				"[value]" (json select "row" "/login_from")
			;

			if (equal (json select "app" /user) "system") {

				sql connect "session_data" {cm get "MENTDB";};
				json load "inValues" "[]";
				json load "optionValues" "[]";
				json iarray "inValues" / "" STR;
				json iarray "optionValues" / "" STR;
				sql parse "session_data" "D" (concat "select login from users where activate='Y' order by login") {
				
					json iarray "inValues" / [D_login] STR;
					json iarray "optionValues" / [D_login] STR;
				
				};
				sql disconnect "session_data";
			
				include "app.100.obj.form.control.select_mono.exe" "[control_id]" "login_to" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
					"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "destination") "[description]" ""
					"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
					"[inValues]" (json doc "inValues")
					"[optionValues]" (json doc "optionValues")
					"[value]" (json select "row" "/login_to")
				;
				
			} {

				if (equal (json select "row" "/login_from") (json select "app" "/user")) {

					sql connect "info_user" {cm get "MENTDB";};
					-> "[filtre_projet_droit]" (sql value "info_user" (concat "select group_concat(user_projects.id) from user_projects, projects where projects.id=user_projects.id and is_closed='N' and login=" (sql encode (json select "app" /user))));
					sql disconnect "info_user";
					if (is null or empty [filtre_projet_droit]) {
						-> "[filtre_projet_droit]" (concat "WHERE projects.id in (-1) ");
					} {
						-> "[filtre_projet_droit]" (concat "WHERE projects.id in (" [filtre_projet_droit] ") ");
					};
	
				
	
					sql connect "session_data" {cm get "MENTDB";};
	
					-> "[user_list_to]" (sql value "session_data" (concat "select group_concat(quote(user_users.login_grant)) from user_users, users where users.login=user_users.login and activate='Y' and user_users.login=" (sql encode (json select "app" /user))));
					if (is null or empty [user_list_to]) {
						-> "[user_list_to]" (concat "and login in ('') ");
					} {
						-> "[user_list_to]" (concat "and login in (" [user_list_to] ") ");
					};
					
					json load "inValues" "[]";
					json load "optionValues" "[]";
					json iarray "inValues" / "" STR;
					json iarray "optionValues" / "" STR;
					sql parse "session_data" "D" (concat "select login from users where activate='Y' " [user_list_to] " order by login") {
					
						json iarray "inValues" / [D_login] STR;
						json iarray "optionValues" / [D_login] STR;
					
					};
					sql disconnect "session_data";
				
					include "app.100.obj.form.control.select_mono.exe" "[control_id]" "login_to" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
						"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "destination") "[description]" ""
						"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
						"[inValues]" (json doc "inValues")
						"[optionValues]" (json doc "optionValues")
						"[value]" (json select "row" "/login_to")
					;

				} {

					include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "login_to" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
						"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "destination") "[description]" "" "[maxlength]" "" "[placeholder]" ""
						"[readonly]" true "[required]" false "[disabled]" false "[html]" ""
						"[value]" (json select "row" "/login_to")
					;

				};

			};
		
		# state -------- TO DELETE ...;
			
			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "state" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[0, 1, 2, 3, 4, 5]"
				"[optionValues]" (concat "[\"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_to_do") "\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_current") "\", \"Important\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_rdv") "\", \"Pause\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_completed") "\"]")
				"[value]" (json select "row" "/state")
			;
		
		# description -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.range.exe" "[control_id]" "percent" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "percent") "[description]" ""
				"[min]" 0 "[max]" 100 "[step]" 1 "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/percent")
			;
			
			include "app.100.obj.form.control.textarea.exe" "[control_id]" "commentaire" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "comment") "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" "style='height:150px'"
				"[value]" ""
			;

			sql connect "session_show_comment" {cm get "MENTDB";};
			sql parse "session_show_comment" "S" (concat "select dtcreate, comment from comments where task_id=" (json select "data" "/client_data/id") " order by dtcreate desc") {
			
				concat_var "[object]" "<div style='border:1px #333 solid;margin-bottom: 10px;padding: 4px;'>" (date format (string substr [S_dtcreate] 0 19) "yyyy-MM-dd HH:mm:ss" "dd/MM/yyyy HH:mm") ": " (string replace (string replace [S_comment] (concat [_r_] [_n_]) [_n_]) [_n_] "<br>") "</div>";
			
			};
			sql disconnect "session_show_comment";
			
			include "app.100.obj.form.control.textarea.exe" "[control_id]" "description" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "description" "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" "style='height:250px'"
				"[value]" (json select "row" "/description")
			;
		
			
		
		-> "[app_object_id]" (include "app.100.obj.form.end.remote.exe" "[form_id]" "tasks_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update1.exe"
		"[data_eval]" "$('#tasks_update_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update")
		"[submitType]" "warning");

		json load "return_obj" "{}";
		json iobject "return_obj" / "obj" [object] STR;
		json iobject "return_obj" / "id" [app_object_id] STR;

		json doc "return_obj";

	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.search1" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json iobject "data" / load_env (json doc "app") OBJ;

		sql connect "session1" {cm get "MENTDB";};
		-> "[remote_mentdb]" (sql value "session1" (concat "select remote_mentdb from projects where id=" (sql encode [current_remote_project_selected])));
		-> "[current_project_selected]" (sql value "session1" (concat "select remote_project_id from projects where id=" (sql encode [current_remote_project_selected])));
		sql disconnect "session1";

		json iobject "data" / current_project_selected [current_project_selected] STR;

		-> "[search_filter_multiple]" (tunnel execute_hot "session1" {cm get [remote_mentdb]} (concat 
			"include \"app.100.template.taskmanager.actions.demo.MENTDB.tasks.search2.exe\"
				\"[OBJ_OVERWRITE_B64]\" " (mql encode (string encode_b64 (json doc data))) "
			;"
		));

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list1.exe"
			"[OBJ_OVERWRITE_B64]" [search_filter_multiple]
		;

	} {
	
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
		#Close all objects;
		try {tunnel disconnect "session1";} {} "[e]";

	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update_reopen_form" false 1 
  (param
  	(var "[container_id]" {true} "" is_null:false is_empty:false "container1")
  ;) 
  "Reopen an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "tasks_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "task_update_c")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]" (json select "data" "/client_data/id")
			;
		
		# project_id -------- TO DELETE ...;
			
			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select id, name, (select name from clients where id=client_id) as client from projects order by client, name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / (concat [D_client] " / " [D_name]) STR;
			
			};
			sql disconnect "session_data";
		
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "project_id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "project") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[value]" (json select "data" "/client_data/project_id")
			;
		
		# title -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "title" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "title") "[description]" "" "[maxlength]" "1024" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/title")
			;
		
		# state -------- TO DELETE ...;
			
			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "state" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[0, 1, 2, 3, 4, 5]"
				"[optionValues]" (concat "[\"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_to_do") "\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_current") "\", \"Important\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_rdv") "\", \"Pause\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_completed") "\"]")
				"[value]" (json select "data" "/client_data/state")
			;
		
		# description -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.range.exe" "[control_id]" "percent" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "percent") "[description]" ""
				"[min]" 0 "[max]" 100 "[step]" 1 "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/percent")
			;
			
			include "app.100.obj.form.control.textarea.exe" "[control_id]" "commentaire" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "comment") "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" "style='height:150px'"
				"[value]" (json select "data" "/client_data/commentaire")
			;
			
			include "app.100.obj.form.control.textarea.exe" "[control_id]" "description" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "description" "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" "style='height:250px'"
				"[value]" (json select "data" "/client_data/description")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "tasks_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update.exe"
		"[data_eval]" "$('#tasks_update_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update")
		"[submitType]" "warning";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.clients.insert" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);
		
		-> "[result]" (sql dml "session1" (concat 
			"INSERT INTO `clients` (
			`name`, 
			`contact_name`, 
			`contact_email`, 
			`contact_tel`
			) VALUES (
			" (sql encode (json select "data" "/client_data/name")) ", 
			" (sql encode (json select "data" "/client_data/contact_name")) ", 
			" (sql encode (json select "data" "/client_data/contact_email")) ", 
			" (sql encode (json select "data" "/client_data/contact_tel")) "
			);"
		));
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "insert_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.insert_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.delete" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Delete elements ..." 
{

	json load "client_data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {

		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};
	
		json parse_array "client_data" "/client_data" "[o]" {
		
			json load "data" [o];
	
			-> "[result]" (sql dml "session1" (concat 
				"DELETE FROM `tasks` 
				WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
				;"
			));
		
		};
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"page\":\"1\"}")
		;

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;

	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Get data from a database into a list ..." 
{

	-> "[search_filter_multiple_del]" [OBJ_OVERWRITE_B64];
	
	include "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe"
		"[OBJ_OVERWRITE_B64]" [search_filter_multiple_del]
	;
	
} "Return the list";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list1" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Get data from a database into a list ..." 
{

	try {

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json iobject "data" / load_env (json doc "app") OBJ;

		if (is not null (json select "data" "/current_project_selected")) {
			-> "[current_remote_project_selected]" (json select "data" "/current_project_selected");
		};

		sql connect "session1" {cm get "MENTDB";};
		-> "[remote_mentdb]" (sql value "session1" (concat "select remote_mentdb from projects where id=" (sql encode [current_remote_project_selected])));
		-> "[current_project_selected]" (sql value "session1" (concat "select remote_project_id from projects where id=" (sql encode [current_remote_project_selected])));
		sql disconnect "session1";

		json iobject "data" / current_project_selected [current_project_selected] STR;

		-> "[object]" (tunnel execute_hot "session1" {cm get [remote_mentdb]} (concat 
			"include \"app.100.template.taskmanager.actions.demo.MENTDB.tasks.list2.exe\"
				\"[OBJ_OVERWRITE_B64]\" " (mql encode (string encode_b64 (json doc data))) "
			;"
		));
		
		include "app.100.obj.sajax.refresh.exe"
			"[target]" "jimdb_tasks0"
			"[innerHtml]" [object]
		;

	} {
	
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;

		#Close all objects;
		try {tunnel disconnect "session1";} {} "[e]";

	} "[err]";
	
} "Return the list";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.search" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json load "filter_sql" "{\"filter_sql\":{}}";

		
		if (not (is null or empty (json select "data" "/client_data/name"))) {
			json iobject "filter_sql" "/filter_sql" "name" (json select "data" "/client_data/name") STR;
			json iobject "filter_sql" "/filter_sql" "type:name" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		if (not (is null or empty (json select "data" "/client_data/is_closed"))) {
			json iobject "filter_sql" "/filter_sql" "is_closed" (json select "data" "/client_data/is_closed") STR;
			json iobject "filter_sql" "/filter_sql" "type:is_closed" "EQUAL" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		if (not (is null or empty (json select "data" "/client_data/client_id"))) {
			json iobject "filter_sql" "/filter_sql" "client_id" (json select "data" "/client_data/client_id") STR;
			json iobject "filter_sql" "/filter_sql" "type:client_id" "EQUAL" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};
		
		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "filter_sql"))
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.delete" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Delete elements ..." 
{

	json load "client_data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {

		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};
	
		json parse_array "client_data" "/client_data" "[o]" {
		
			json load "data" [o];
	
			-> "[result]" (sql dml "session1" (concat 
				"DELETE FROM `projects` 
				WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
				;"
			));
		
		};
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"page\":\"1\"}")
		;

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;

	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.update_reopen_form" false 1 
  (param
  	(var "[container_id]" {true} "" is_null:false is_empty:false "container1")
  ;) 
  "Reopen an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "projects_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update_project_c")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]" (json select "data" "/client_data/id")
			;
		
		# name -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "name") "[description]" "" "[maxlength]" "512" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/name")
			;
		
		# client_id -------- TO DELETE ...;
			
			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select id, name from clients where is_closed='N' order by name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / [D_name] STR;
			
			};
			sql disconnect "session_data";
		
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "client_id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "client" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[value]" (json select "data" "/client_data/client_id")
			;
		
		# is_closed -------- TO DELETE ...;
			
			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "is_closed" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "closed") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" (json select "data" "/client_data/is_closed")
			;

			json load "remote_server" (cm show);
			json load "inValues" "[]";
			json load "optionValues" "[]";
			json iarray "inValues" / "" STR;
			json iarray "optionValues" / "" STR;
			json parse_array "remote_server" "/" "[cm]" {
			
				json load "cm" (cm get [cm]);
				if (equal (json select "cm" /type) "mentdb") {
					
					json iarray "inValues" / [cm] STR;
					json iarray "optionValues" / [cm] STR;

				};
			
			};
		
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "remote_mentdb" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "remote_mentdb") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[value]" (json select "data" "/client_data/remote_mentdb")
			;

			include "app.100.obj.form.control.textbox.number.exe" "[control_id]" "remote_project_id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "remote_project_id") "[description]" "" "[maxlength]" ""
				"[min]" 0 "[max]" "" "[step]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/remote_project_id")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "projects_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.update.exe"
		"[data_eval]" "$('#projects_update_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update")
		"[submitType]" "warning";
	
} "Return the form";

script create app "app.100.template.taskmanager" false 1 
  (param
  ;) 
  "Start point for the template" 
{

	#Main actions;
	if (not (is null or empty [app_action])) {

		#Disconnect the user;
		if (equal [app_action] "logout";) {

			json iobject "app" / connected "0" STR;
			json iobject "app" / disconnected "1" STR;
		
		};

		#Menu toggle;
		if (equal [app_action] "menu_toggle") {

			if (json select "app" /menu_default_show) {
				json iobject "app" / menu_default_show false STR;
			
			} {
				json iobject "app" / menu_default_show true STR;
			
			};
		
		};
	
	};

	#Change the page;
	if (not (is null or empty [app_page])) {

		json iobject "app" / "current_page" [app_page] STR;
	
	};
	
	-> "[app_page]" (json select "app" /current_page);
	-> "[app_user]" (json select "app" /user);

	#Check if the user is connected;
	if (json select "app" /connected) {

		include (concat "app." [app_version] ".template." [app_template] ".page." [app_page] ".exe");
	
	} {
		
		#try to connect if the user is send;
		if (is not null (json select "app" "/param/x-user")) {

			try {
				
				sql connect "session1" {cm get (json select "app" "/database")};
				
				if (equal (sql value "session1" (concat "select `password` from `users` where `login`=" (sql encode (json select "app" "/param/x-user")))) 
					(string md5 (json select "app" "/param/x-password"))) {

					json iobject "app" / groups (sql col_distinct "session1" (concat "select distinct tag 
						from user_group inner join group_tag on user_group.group_id=group_tag.group_id
						where login=" (sql encode (json select "app" "/param/x-user")));) OBJ;
					
					json iobject "app" / connected "1" STR;
					json iobject "app" / "user" (json select "app" "/param/x-user") STR;
					json iobject "app" / "current_page" (json select "app" "/default_page") STR;
					-> "[app_page]" (json select "app" /current_page);
					
					include (concat "app." [app_version] ".template." [app_template] ".page." [app_page] ".exe");
					
				} {
					
					include (concat "app." [app_version] ".template." [app_template] ".page.login.exe") "[err]" (json select "app" "/login_error_msg");
					
				};
				
				sql disconnect "session1";
		
			} {
				
				include (concat "app." [app_version] ".template." [app_template] ".page.login.exe") "[err]" [err];
				try {sql disconnect "session1";} {} "[sub_err]";
				
			} "[err]";

			[page];
		
		} {

			include (concat "app." [app_version] ".template." [app_template] ".page.login.exe") "[err]" "";
		
		};
	
	};

} "html";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.users.insert_reopen_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Reopen an insert form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "users_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "user_add_c")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# login -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "login" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "login" "[description]" "" "[maxlength]" "150" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/login")
			;
		
		# password -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "password" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "password") "[description]" "" "[maxlength]" "32" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/password")
			;
		
		# clients -------- TO DELETE ...;

			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select name, id from clients where is_closed='N' order by name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / [D_name] STR;
			
			};
			sql disconnect "session_data";

			json load "reload_clients" "{}";
			if (not (is null or empty (json select "data" "/client_data/clients"))) {
				if (string starts_with (json select "data" "/client_data/clients") "[") {
					json parse_array "data" "/client_data/clients" "[id]" {
					
						json iobject "reload_clients" / [id] 0 NUM;
					
					};
				} {
					json iobject "reload_clients" / (json select "data" "/client_data/clients") 0 NUM;
				};
			};
			
			include "app.100.obj.form.control.select_multiple.exe" "[control_id]" "clients" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "clients" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[values]" (json doc "reload_clients")
			;
		
		# projects -------- TO DELETE ...;
			
			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select name, id, (select name from clients where id=client_id) as client from projects where is_closed='N' order by client, name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / (concat [D_client] "/" [D_name]) STR;
			
			};

			json load "reload_projects" "{}";
			if (not (is null or empty (json select "data" "/client_data/projects"))) {
				if (string starts_with (json select "data" "/client_data/projects") "[") {
					json parse_array "data" "/client_data/projects" "[id]" {
					
						json iobject "reload_projects" / [id] 0 NUM;
					
					};
				} {
					json iobject "reload_projects" / (json select "data" "/client_data/projects") 0 NUM;
				};
			};
		
			include "app.100.obj.form.control.select_multiple.exe" "[control_id]" "projects" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "projects") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[values]" (json doc "reload_projects")
			;


			

			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select login from users where activate='Y' order by login") {
			
				json iarray "inValues" / [D_login] STR;
				json iarray "optionValues" / [D_login] STR;
			
			};
			sql disconnect "session_data";

			json load "reload_users" "{}";
			if (not (is null or empty (json select "data" "/client_data/users"))) {
				if (string starts_with (json select "data" "/client_data/users") "[") {
					json parse_array "data" "/client_data/users" "[login_grant]" {
					
						json iobject "reload_users" / [login_grant] 0 NUM;
					
					};
				} {
					json iobject "reload_users" / (json select "data" "/client_data/users") 0 NUM;
				};
			};
		
			include "app.100.obj.form.control.select_multiple.exe" "[control_id]" "users" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "users") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[values]" (json doc "reload_users")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "users_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.users.insert.exe"
		"[data_eval]" "$('#users_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "add")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.test" false 1 
  (param
  ;) 
  "Test" 
{

	include "app.100.obj.sajax.alert.exe"
		"[type]" "ALERT_SUCCESS"
		"[strong]" "OK !"
		"[msg]" "Super
		..."
	;

;} "";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.users.skeleton" false 1 
  (param
  ;) 
  "SCRUD skeleton ..." 
{

	include "app.100.obj.sajax.skeleton.onload.exe"
		"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.onload.exe"
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
	;
	
} "Return the page";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert_open_form1" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an insert form ..." 
{

	try {

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json iobject "data" / load_env (json doc "app") OBJ;

		sql connect "session1" {cm get "MENTDB";};
		-> "[remote_mentdb]" (sql value "session1" (concat "select remote_mentdb from projects where id=" (sql encode [current_remote_project_selected])));
		-> "[current_project_selected]" (sql value "session1" (concat "select remote_project_id from projects where id=" (sql encode [current_remote_project_selected])));
		sql disconnect "session1";

		json iobject "data" / current_project_selected [current_project_selected] STR;

		json load "return_obj" (tunnel execute_hot "session1" {cm get [remote_mentdb]} (concat 
			"include \"app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert_open_form2.exe\"
				\"[OBJ_OVERWRITE_B64]\" " (mql encode (string encode_b64 (json doc data))) "
			;"
		));

		include "app.100.obj.sajax.refresh.exe"
			"[target]" ""
			"[innerHtml]" (json select "return_obj" "/obj")
		;

		include "app.100.obj.sajax.javascript.exe"
			"[javascript]" (concat "object_onload" (json select "return_obj" "/id") "();")
		;

	} {
	
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
		#Close all objects;
		try {tunnel disconnect "session1";} {} "[e]";

	} "[err]";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.clients.update" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Update an element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		if (is null or empty (json select "data" "/client_data/name")) {

			exception (1) ("The company name cannot be null or empty.");

		};
		
		-> "[result]" (sql dml "session1" (concat 
			"UPDATE `clients` SET 
			`name`=" (sql encode (json select "data" "/client_data/name")) ", 
			`contact_name`=" (sql encode (json select "data" "/client_data/contact_name")) ", 
			`contact_email`=" (sql encode (json select "data" "/client_data/contact_email")) ", 
			`contact_tel`=" (sql encode (json select "data" "/client_data/contact_tel")) ", 
			`is_closed`=" (sql encode (json select "data" "/client_data/is_closed")) ", 
			`ordered`=" (sql encode (json select "data" "/client_data/ordered")) "
			WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
			;"
		));
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.update_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.clients.list" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Get data from a database into a list ..." 
{
	
	#Load the current object id and his configuration;
	-> "[OBJECT_ID]" "jimdb_clients_list";
	include "app.100.scrud.overwrite_config.exe"
		"[OBJ_PARAM_LIST]" "container_id,page,nb_by_page,nb_lr_pagination,order_by,filter_sql"
	;
	
	if (equal [nb_by_page] "*") {-> "[nb_by_page]" 999999999};
	if (is empty [order_by]) {
		-> "[asc_desc]" "ASC|";
		-> "[cur_asc_desc]" "";
		-> "[cur_order_by]" "";
	} {
		-> "[cur_asc_desc]" (atom get [order_by] 1 "|");
		-> "[cur_order_by]" (atom get [order_by] 2 "|");
		if (string starts_with [order_by] "ASC|") {
			-> "[asc_desc]" "DESC|";
		} {
			-> "[asc_desc]" "";
		};
	};

	#Initialization;
	-> "[object]" "<div style='border: 1px solid rgba(0,0,0,.12);-webkit-border-radius: 3px;
		-moz-border-radius: 3px;border-radius: 3px;
		margin-top: 2px;margin-bottom: 2px;padding:5px;background-color:#fff;color:#313131'>";

	concat_var "[object]" "<span style='float:right'><button type='button' class='btn btn-danger btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.delete_confirm.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "get_all_checked('clients_keys_checkbox')") "><span class='fa fa-remove fa-sm' aria-hidden='true'></span></button></span>";
	concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-success btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.insert_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-plus fa-sm' aria-hidden='true'></span></button></span>";
	concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.search_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-search fa-sm' aria-hidden='true'></span></button></span>";

	concat_var "[object]" "
	<span style='font-size:16px'><b>  Clients</b></span>
	
	<div style='height:10px;'></div>
	
	<table class='table table-striped table-hover table-bordered' style='margin-bottom: 0px;'>
  <thead>
    <tr>";
	
	#Connect to the database;
	sql connect "session1" {cm get "MENTDB";};

	try {

		#concat the row title counter;
		concat_var "[object]" "
      <th style='width:44px;padding: 0px 0px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' id='clients_main_checkbox' onchange='check_all(\"clients_keys_checkbox\", this);'></div></th>
      <th scope='col' style='padding: 0px;'><a style='border:0px' class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "name") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "name")}} {(concat "ASC|" "name")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "name") (if (equal [cur_order_by] "name") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
      <th scope='col' style='width:20px;padding: 0px;'></th>
	</tr>
  </thead>
  <tbody>";
		
		-> "[sql_filter]" "";
		-> "[sql_filter_keys]" "";
		if (not (is null or empty [filter_sql])) {
			json load "filter_sql" [filter_sql];
			json parse_obj "filter_sql" "/" "[key]" "[val]" {

				if (not (string starts_with [key] "type:")) {
					switch (json select "filter_sql" (concat "/type:" [key]))
						("EQUAL") {concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
						("LIKE_L") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "'";}
						("LIKE_R") {concat_var "[sql_filter]" " and `" [key] "` like '" (string sublrchar (sql encode [val]) 1) "%'";}
						("LIKE_LR") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "%'";}
						{concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
					;
					concat_var "[sql_filter_keys]" "<span class='badge badge-light'>" [key] "</span> ";
				};
			
			};
	
			if (> (json count "filter_sql" "/") 0) {
				-> "[sql_filter]" (concat " WHERE " (string substring [sql_filter] 5));
				-> "[sql_filter_keys]" (concat "<h5 style='margin-top: 1px;margin-bottom:0px'><button type='button' style='margin-left: 10px;' class='btn btn-outline-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"filter_sql\":{}}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-remove fa-xs' aria-hidden='true'></span> " (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "filter") "(s)</button></h5>");
			};
		};

		-> "[iline]" (+ 1 (- (* [page] [nb_by_page]) [nb_by_page]));
		-> "[nb_elements]" (sql value "session1" (concat "select count(*) from `clients` " [sql_filter] ";"));
		-> "[nb_page]" (math ceil (/ [nb_elements] [nb_by_page]));
		if (is empty [cur_order_by]) {
			-> "[sql_order_by]" "order by is_closed, `name`";
		} {
			-> "[sql_order_by]" (concat "order by `" [cur_order_by] "` " [cur_asc_desc]);
		};

		sql parse "session1" "T" (concat "select 
			`id`, 
			`name`, 
			`contact_name`, 
			`contact_email`, 
			`contact_tel`, is_closed from `clients` " [sql_filter] " " [sql_order_by] " limit " (- (* [page] [nb_by_page]) [nb_by_page]) ", " [nb_by_page] ";") {
			
			json load "primary_key" "{}";
			json iobject "primary_key" / "client_data" "{}" OBJ;
			json iobject "primary_key" "/client_data" "id" [T_id] STR;
			
      		
			concat_var "[object]" "
      <tr><th style='width:44px;padding: 0px 2px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' name='clients_keys_checkbox' value='" (string encode_b64 (json doc "primary_key")) "'></div></th>
      <td style='padding: 6px 2px 0px 2px;'>" (string replace [T_name] "<" "<") " " (if (equal [T_is_closed] "Y") {concat "[fermé]"}) "</td>";

			concat_var "[object]" "<td style='padding: 0px 2px 0px 2px;'><button type='button' class='btn btn-warning btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.update_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") "><span class='fa fa-pencil fa-sm' aria-hidden='true'></span></button></td>";
			concat_var "[object]" "</tr>";

      		++ "[iline]";
		
		};
    
		concat_var "[object]" "
	</tbody>
</table>

";

	concat_var "[object]" "<nav aria-label='Page navigation' style='display:inline-block'>
  <ul class='pagination' style='margin-bottom:0px'>
    <li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" 1 "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Previous'>
        <span aria-hidden='true'>«</span>
        <span class='sr-only'>Previous</span>
      </a>
    </li>";

	for (-> "[i_page]" (- [page] [nb_lr_pagination])) (< [i_page] [page]) (++ "[i_page]") {

		if (> [i_page] 0) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};

	for (-> "[i_page]" [page]) (<= [i_page] (+ [page] [nb_lr_pagination])) (++ "[i_page]") {

		if (<= [i_page] [nb_page]) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};
    
    concat_var "[object]" "<li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [nb_page] "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>
        <span aria-hidden='true'>»</span>
        <span class='sr-only'>Next</span>
      </a>
    </li>
  </ul>
</nav>  " [nb_elements] "
  <div style='float: right;display: inline-block;'><select id='app.100.template.taskmanager.actions.demo.MENTDB.clients.list.key.nb_by_page' style='height: 33px;color: #007bff;' class='form-control' onChange=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"order_by\":\"\", \"page\":\"1\"}") "[getElementById]" "nb_by_page=app.100.template.taskmanager.actions.demo.MENTDB.clients.list.key.nb_by_page" "[data]" "") ">
      <option " (if (== [nb_by_page] 1) {"selected"}) ">1</option>
      <option " (if (== [nb_by_page] 2) {"selected"}) ">2</option>
      <option " (if (== [nb_by_page] 3) {"selected"}) ">3</option>
      <option " (if (== [nb_by_page] 4) {"selected"}) ">4</option>
      <option " (if (== [nb_by_page] 5) {"selected"}) ">5</option>
      <option " (if (== [nb_by_page] 10) {"selected"}) ">10</option>
      <option " (if (== [nb_by_page] 25) {"selected"}) ">25</option>
      <option " (if (== [nb_by_page] 50) {"selected"}) ">50</option>
      <option " (if (== [nb_by_page] 100) {"selected"}) ">100</option>
      <option " (if (== [nb_by_page] 250) {"selected"}) ">250</option>
      <option " (if (== [nb_by_page] 500) {"selected"}) ">500</option>
      <option " (if (== [nb_by_page] 1000) {"selected"}) ">1000</option>
      <option " (if (== [nb_by_page] 2500) {"selected"}) ">2500</option>
      <option " (if (== [nb_by_page] 5000) {"selected"}) ">5000</option>
      <option " (if (== [nb_by_page] 999999999) {"selected"}) ">*</option>
    </select></div><div style='float: right;display: inline-block;line-height: 32px;margin-right: 20px;'>" [sql_filter_keys] "</div>

</div>";

		sql disconnect "session1";

		include "app.100.obj.sajax.refresh.exe"
			"[target]" [container_id]
			"[innerHtml]" [object]
		;

	} {

		#Save the error;
		log trace [err]; 
		
		#Close all objects;
		try {sql disconnect "session1";} {} "[e]";

		exception (1) (concat "ERR/APP/LIST: " [err]);

	} "[err]";
	
} "Return the list";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.masks.skeleton" false 1 
  (param
  ;) 
  "SCRUD skeleton ..." 
{

	include "app.100.obj.sajax.skeleton.container.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "";
		include "app.100.obj.sajax.skeleton.row.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "";
			include "app.100.obj.sajax.skeleton.col.exe" "[id]" "MENTDB_masks" "[name]" "" "[class]" "col-12 col-xs-12 col-sm-12 col-md-12 col-lg-12" "[style]" "";
			
			include "app.100.obj.sajax.skeleton.div.end.exe";
		include "app.100.obj.sajax.skeleton.div.end.exe";
	include "app.100.obj.sajax.skeleton.div.end.exe";

	include "app.100.obj.sajax.skeleton.onload.exe"
		"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.onload.exe"
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
	;
	
} "Return the page";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.insert_tasks_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an insert form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "projects_insert_tasks_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "mask_add")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";

			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]" (json select "data" "/client_data/id")
			;
			
		# group -------- TO DELETE ...;
			
			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select distinct groupname from masks order by groupname") {
			
				json iarray "inValues" / [D_groupname] STR;
				json iarray "optionValues" / [D_groupname] STR;
			
			};
			sql disconnect "session_data";
		
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "groupname" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "group") "[description]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[value]" ""
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "projects_insert_tasks_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.insert_tasks.exe"
		"[data_eval]" "$('#projects_insert_tasks_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "add")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.search_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a search form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "projects_search_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "search_project")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";

	-> "[filter_sql]" (json select "app" (concat "/objects/jimdb_projects_list/filter_sql"));
	if (not (is null or empty [filter_sql])) {
		json load "filter_sql" [filter_sql];
	} {
		json load "filter_sql" "{}";
	};
			
		# name -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/name")) {
				json iobject "filter_sql" / "name" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "name") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/name")
			;
		
		# is_closed -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/is_closed")) {
				json iobject "filter_sql" / "is_closed" "" STR;
			};
		
			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "is_closed" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "closed") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" (json select "filter_sql" "/is_closed")
			;
		
		# client_id -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/client_id")) {
				json iobject "filter_sql" / "client_id" "" STR;
			};

			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			json iarray "inValues" / "" STR;
			json iarray "optionValues" / "" STR;
			sql parse "session_data" "D" (concat "select id, name from clients order by name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / [D_name] STR;
			
			};
			sql disconnect "session_data";
		
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "client_id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "client" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[value]" (json select "filter_sql" "/client_id")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "projects_search_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.search.exe"
		"[data_eval]" "$('#projects_search_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "search")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.masks.delete_confirm" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a confirm dialog box for delete ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "masks_delete_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (concat (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_of") (json count "data" "/client_data") (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_of_elements"))
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-md"
				"[html]" "style='font-size:14px'";
			
		include "app.100.obj.form.end.exe" "[form_id]" "masks_delete_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.delete.exe"
		"[data_eval]" ""
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "cancel")
		"[submitTitle]" (if (> (json count "data" "/client_data") 0) {(include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete")} {""})
		"[submitType]" "danger";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		-> "[result]" (sql dml "session1" (concat 
			"INSERT INTO `tasks` (
			`title`, 
			`description`, 
			`state`, 
			`project_id`,
			last_update,
			login_from,
			login_to
			) VALUES (
			" (sql encode (json select "data" "/client_data/title")) ", 
			" (sql encode (json select "data" "/client_data/description")) ", 
			" (sql encode (json select "data" "/client_data/state")) ", 
			" (sql encode (json select "data" "/client_data/project_id")) ", 
			CURRENT_TIMESTAMP(),
			" (sql encode (json select "app" /user)) ",
			" (sql encode (json select "data" "/client_data/login_to")) "
			);"
		));

		-> "[last_insert_id]" (sql value "session1" (concat "select LAST_INSERT_ID()"););
		-> "[result]" (sql dml "session1" (concat 
			"INSERT IGNORE INTO `already_read` (id_task, login) values (" (sql encode [last_insert_id]) ", " (sql encode (json select "app" /user)) ");"
		));
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "insert_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.page.login" false 1 
  (param
  	(var "[err]" {true} "The error message" is_null:true is_empty:true "Bad password.")
  ;) 
  "Show the login page" 
{

	-> "[page]" "";

	concat_var "[page]" "<!doctype html>
		<html lang=\"fr\">
		<head>
		  <meta charset=\"utf-8\">
		  <title>" (json select "app" "/title") "</title>
		  <link  href=\"css/style.css\" rel=\"stylesheet\">
		  <link href=\"dist/css/bootstrap.css\" rel=\"stylesheet\">
		  <link rel=\"icon\" type=\"image/png\" href=\"images/" (json select "app" "/bar_icon") "\" />
		</head>
		<body id=\"body\" style='background-color: #f1f2f3;margin:0px;color:#333;font-family: " (json select "app" "/font_family") ";font-size: 12px;'>
		<div id=\"login\">
		  <div id='divSignInCenter'>
		      <div id='divSignIn' style='border: 5px #005ba2 solid;background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #004073), color-stop(100%, #004073)), #004073;
			      background: -webkit-linear-gradient(#004073, #004073), #004073;
			      background: -moz-linear-gradient(#004073, #004073), #004073;
			      background: -o-linear-gradient(#004073, #004073), #004073;
			      background: linear-gradient(#004073, #004073), #004073;box-shadow: 2px 0px 15px 1px #004073;'>
		          <div id='divSignInImg' style='padding-top: 35px;'><a href='index.jsp'><img src='images/" (json select "app" "/login_logo") "' height='70px' alt=''></a></div>
		          <div style='padding:5px;font-size: 16px;color:#fff;border-bottom: 1px #696969 solid;'><b>" (json select "app" "/title") "<br> </b></div>
		          <div id='connectError' style=\"color:#F00;min-height:25px\">" [err] "</div>
		          <form action='index.jsp' method='post'>
		              <input class='style-1' type='text' placeholder='" (json select "app" "/login_placeholder_user") "' name='x-user' id='x-user' autofocus><br>
		              <input class='style-1' type='password' placeholder='" (json select "app" "/login_placeholder_password") "' name='x-password' id='x-password'>
		              <input type=\"submit\" class='btn btn-light' style='padding: 5px 30px 5px 30px;margin-top: 10px;width: 200px;height: 35px;' value=\"" (json select "app" "/login_submit_title") "\">
		              <div style='height:25px'></div>
		          </form>
		      </div>
		      <div style='margin-top: 10px;color:#333'>© " (json select "app" "/copyright_years") " - " (json select "app" "/copyright_link") "</div>
		  </div>
		</div>
		</body>
		</html>";

	[page];

;} "The 'login' page";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.users.update_reopen_form" false 1 
  (param
  	(var "[container_id]" {true} "" is_null:false is_empty:false "container1")
  ;) 
  "Reopen an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "users_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (concat (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "user_update_c") " (" (json select "data" "/client_data/login") ") [Correction]")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# login -------- TO DELETE ...;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "login"
				"[value]" (json select "data" "/client_data/login")
			;
		
		# password -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "password" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "password") "[description]" "" "[maxlength]" "32" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/password")
			;
		
		# clients -------- TO DELETE ...;
			
			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select name, id from clients where is_closed='N' order by name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / [D_name] STR;
			
			};
			sql disconnect "session_data";

			json load "reload_clients" "{}";
			if (not (is null or empty (json select "data" "/client_data/clients"))) {
				if (string starts_with (json select "data" "/client_data/clients") "[") {
					json parse_array "data" "/client_data/clients" "[id]" {
					
						json iobject "reload_clients" / [id] 0 NUM;
					
					};
				} {
					json iobject "reload_clients" / (json select "data" "/client_data/clients") 0 NUM;
				};
			};
			
			include "app.100.obj.form.control.select_multiple.exe" "[control_id]" "clients" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "clients" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[values]" (json doc "reload_clients")
			;
		
		# projects -------- TO DELETE ...;
			
			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select name, id, (select name from clients where id=client_id) as client from projects where is_closed='N' order by client, name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / (concat [D_client] "/" [D_name]) STR;
			
			};

			json load "reload_projects" "{}";
			if (not (is null or empty (json select "data" "/client_data/projects"))) {
				if (string starts_with (json select "data" "/client_data/projects") "[") {
					json parse_array "data" "/client_data/projects" "[id]" {
					
						json iobject "reload_projects" / [id] 0 NUM;
					
					};
				} {
					json iobject "reload_projects" / (json select "data" "/client_data/projects") 0 NUM;
				};
			};
		
			include "app.100.obj.form.control.select_multiple.exe" "[control_id]" "projects" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "projects") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[values]" (json doc "reload_projects")
			;


			

			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select login from users where activate='Y' order by login") {
			
				json iarray "inValues" / [D_login] STR;
				json iarray "optionValues" / [D_login] STR;
			
			};
			sql disconnect "session_data";

			json load "reload_users" "{}";
			if (not (is null or empty (json select "data" "/client_data/users"))) {
				if (string starts_with (json select "data" "/client_data/users") "[") {
					json parse_array "data" "/client_data/users" "[login_grant]" {
					
						json iobject "reload_users" / [login_grant] 0 NUM;
					
					};
				} {
					json iobject "reload_users" / (json select "data" "/client_data/users") 0 NUM;
				};
			};
		
			include "app.100.obj.form.control.select_multiple.exe" "[control_id]" "users" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "users") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[values]" (json doc "reload_users")
			;

			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "activate" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "activate") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" (json select "data" "/client_data/activate")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "users_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.users.update.exe"
		"[data_eval]" "$('#users_update_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update")
		"[submitType]" "warning";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.masks.list" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Get data from a database into a list ..." 
{
	
	#Load the current object id and his configuration;
	-> "[OBJECT_ID]" "MENTDB_masks_list";
	include "app.100.scrud.overwrite_config.exe"
		"[OBJ_PARAM_LIST]" "container_id,page,nb_by_page,nb_lr_pagination,order_by,filter_sql"
	;
	
	if (equal [nb_by_page] "*") {-> "[nb_by_page]" 999999999};
	if (is empty [order_by]) {
		-> "[asc_desc]" "ASC|";
		-> "[cur_asc_desc]" "";
		-> "[cur_order_by]" "";
	} {
		-> "[cur_asc_desc]" (atom get [order_by] 1 "|");
		-> "[cur_order_by]" (atom get [order_by] 2 "|");
		if (string starts_with [order_by] "ASC|") {
			-> "[asc_desc]" "DESC|";
		} {
			-> "[asc_desc]" "";
		};
	};

	#Initialization;
	-> "[object]" "<div style='border: 1px solid rgba(0,0,0,.12);-webkit-border-radius: 3px;
		-moz-border-radius: 3px;border-radius: 3px;
		margin-top: 2px;margin-bottom: 2px;padding:5px;background-color:#fff;color:#313131'>";

	concat_var "[object]" "<span style='float:right'><button type='button' class='btn btn-danger btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.delete_confirm.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "get_all_checked('masks_keys_checkbox')") "><span class='fa fa-remove fa-sm' aria-hidden='true'></span></button></span>";
	concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-success btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.insert_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-plus fa-sm' aria-hidden='true'></span></button></span>";
	concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.search_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-search fa-sm' aria-hidden='true'></span></button></span>";

	concat_var "[object]" "
	<span style='font-size:16px'><b>  " (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "task_mask") "</b> </span>
	
	<div style='height:10px;'></div>
	
	<table class='table table-striped table-hover table-bordered' style='margin-bottom: 0px;'>
  <thead>
    <tr>";
	
	#Connect to the database;
	sql connect "session1" {cm get "MENTDB";};

	try {

		#concat the row title counter;
		concat_var "[object]" "
      <th style='width:44px;padding: 0px 0px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' id='masks_main_checkbox' onchange='check_all(\"masks_keys_checkbox\", this);'></div></th>
      <th scope='col' style='padding: 0px;'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "groupname") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "groupname")}} {(concat "ASC|" "groupname")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "group") (if (equal [cur_order_by] "groupname") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
      <th scope='col' style='padding: 0px;'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "key") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "key")}} {(concat "ASC|" "key")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "key") (if (equal [cur_order_by] "key") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
      <th scope='col' style='width:20px;padding: 0px;'></th>
	</tr>
  </thead>
  <tbody>";
		
		-> "[sql_filter]" "";
		-> "[sql_filter_keys]" "";
		if (not (is null or empty [filter_sql])) {
			json load "filter_sql" [filter_sql];
			json parse_obj "filter_sql" "/" "[key]" "[val]" {

				if (not (string starts_with [key] "type:")) {
					switch (json select "filter_sql" (concat "/type:" [key]))
						("EQUAL") {concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
						("LIKE_L") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "'";}
						("LIKE_R") {concat_var "[sql_filter]" " and `" [key] "` like '" (string sublrchar (sql encode [val]) 1) "%'";}
						("LIKE_LR") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "%'";}
						{concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
					;
					concat_var "[sql_filter_keys]" "<span class='badge badge-light'>" [key] "</span> ";
				};
			
			};
	
			if (> (json count "filter_sql" "/") 0) {
				-> "[sql_filter]" (concat " WHERE " (string substring [sql_filter] 5));
				-> "[sql_filter_keys]" (concat "<h5 style='margin-top: 1px;margin-bottom:0px'><button type='button' style='margin-left: 10px;' class='btn btn-outline-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"filter_sql\":{}}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-remove fa-xs' aria-hidden='true'></span> " (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "filter") "(s)</button></h5>");
			};
		};

		-> "[iline]" (+ 1 (- (* [page] [nb_by_page]) [nb_by_page]));
		-> "[nb_elements]" (sql value "session1" (concat "select count(*) from `masks` " [sql_filter] ";"));
		-> "[nb_page]" (math ceil (/ [nb_elements] [nb_by_page]));
		if (is empty [cur_order_by]) {
			-> "[sql_order_by]" "order by `groupname`, `order`";
		} {
			-> "[sql_order_by]" (concat "order by `" [cur_order_by] "` " [cur_asc_desc]);
		};

		sql parse "session1" "T" (concat "select 
			`id`, 
			`groupname`, 
			`key`, 
			`order` from `masks` " [sql_filter] " " [sql_order_by] " limit " (- (* [page] [nb_by_page]) [nb_by_page]) ", " [nb_by_page] ";") {
			
			json load "primary_key" "{}";
			json iobject "primary_key" / "client_data" "{}" OBJ;
			json iobject "primary_key" "/client_data" "id" [T_id] STR;
			
      		
			concat_var "[object]" "
      <tr><th style='width:44px;padding: 0px 2px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' name='masks_keys_checkbox' value='" (string encode_b64 (json doc "primary_key")) "'></div></th>
      <td style='padding: 6px 2px 0px 2px;'>" (string replace [T_groupname] "<" "<") "</td>
      <td style='padding: 6px 2px 0px 2px;'><b>#" [T_order] " - </b>" (string replace [T_key] "<" "<") "</td>";

			concat_var "[object]" "<td style='padding: 0px 2px 0px 2px;'><button type='button' class='btn btn-warning btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.update_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") "><span class='fa fa-pencil fa-sm' aria-hidden='true'></span></button></td>";
			concat_var "[object]" "</tr>";

      		++ "[iline]";
		
		};
    
		concat_var "[object]" "
	</tbody>
</table>

";

	concat_var "[object]" "<nav aria-label='Page navigation' style='display:inline-block'>
  <ul class='pagination' style='margin-bottom:0px'>
    <li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" 1 "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Previous'>
        <span aria-hidden='true'>«</span>
        <span class='sr-only'>Previous</span>
      </a>
    </li>";

	for (-> "[i_page]" (- [page] [nb_lr_pagination])) (< [i_page] [page]) (++ "[i_page]") {

		if (> [i_page] 0) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};

	for (-> "[i_page]" [page]) (<= [i_page] (+ [page] [nb_lr_pagination])) (++ "[i_page]") {

		if (<= [i_page] [nb_page]) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};
    
    concat_var "[object]" "<li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [nb_page] "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>
        <span aria-hidden='true'>»</span>
        <span class='sr-only'>Next</span>
      </a>
    </li>
  </ul>
</nav>  " [nb_elements] "
  <div style='float: right;display: inline-block;'><select id='app.100.template.taskmanager.actions.demo.MENTDB.masks.list.key.nb_by_page' style='height: 33px;color: #007bff;' class='form-control' onChange=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"order_by\":\"\", \"page\":\"1\"}") "[getElementById]" "nb_by_page=app.100.template.taskmanager.actions.demo.MENTDB.masks.list.key.nb_by_page" "[data]" "") ">
      <option " (if (== [nb_by_page] 1) {"selected"}) ">1</option>
      <option " (if (== [nb_by_page] 2) {"selected"}) ">2</option>
      <option " (if (== [nb_by_page] 3) {"selected"}) ">3</option>
      <option " (if (== [nb_by_page] 4) {"selected"}) ">4</option>
      <option " (if (== [nb_by_page] 5) {"selected"}) ">5</option>
      <option " (if (== [nb_by_page] 10) {"selected"}) ">10</option>
      <option " (if (== [nb_by_page] 25) {"selected"}) ">25</option>
      <option " (if (== [nb_by_page] 50) {"selected"}) ">50</option>
      <option " (if (== [nb_by_page] 100) {"selected"}) ">100</option>
      <option " (if (== [nb_by_page] 250) {"selected"}) ">250</option>
      <option " (if (== [nb_by_page] 500) {"selected"}) ">500</option>
      <option " (if (== [nb_by_page] 1000) {"selected"}) ">1000</option>
      <option " (if (== [nb_by_page] 2500) {"selected"}) ">2500</option>
      <option " (if (== [nb_by_page] 5000) {"selected"}) ">5000</option>
      <option " (if (== [nb_by_page] 999999999) {"selected"}) ">*</option>
    </select></div><div style='float: right;display: inline-block;line-height: 32px;margin-right: 20px;'>" [sql_filter_keys] "</div>

</div>";

		sql disconnect "session1";

		include "app.100.obj.sajax.refresh.exe"
			"[target]" [container_id]
			"[innerHtml]" [object]
		;

	} {

		#Save the error;
		log trace [err]; 
		
		#Close all objects;
		try {sql disconnect "session1";} {} "[e]";

		exception (1) (concat "ERR/APP/LIST: " [err]);

	} "[err]";
	
} "Return the list";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert_open_form2" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an insert form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "tasks_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "task_add")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# title -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "title" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "title") "[description]" "" "[maxlength]" "1024" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" ""
			;
		
		# project_id -------- TO DELETE ...;
			
			sql connect "info_user" {cm get "MENTDB";};
			-> "[filtre_client_droit]" (sql value "info_user" (concat "select group_concat(user_clients.id) from user_clients, clients where clients.id=user_clients.id and is_closed='N' and login=" (sql encode (json select "app" /user))));
			-> "[filtre_projet_droit]" (sql value "info_user" (concat "select group_concat(user_projects.id) from user_projects, projects where projects.id=user_projects.id and is_closed='N' and login=" (sql encode (json select "app" /user))));
			sql disconnect "info_user";
			if (is null or empty [filtre_client_droit]) {
				-> "[filtre_client_droit]" (concat "and clients.id in (-1) ");
			} {
				-> "[filtre_client_droit]" (concat "and clients.id in (" [filtre_client_droit] ") ");
			};
			if (is null or empty [filtre_projet_droit]) {
				-> "[filtre_projet_droit]" (concat "and projects.id in (-1) ");
			} {
				-> "[filtre_projet_droit]" (concat "and projects.id in (" [filtre_projet_droit] ") ");
			};

			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select projects.id, projects.name, clients.name as client from projects, clients WHERE projects.client_id=clients.id and (remote_mentdb is null or remote_mentdb='') " [filtre_client_droit] [filtre_projet_droit] " order by clients.name, projects.name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / (concat [D_client] " / " [D_name]) STR;
			
			};
			sql disconnect "session_data";
		
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "project_id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "project") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[value]" (if (env exist var "[current_project_selected]") {[current_project_selected]})
			;



			if (equal (json select "app" /user) "system") {

				sql connect "session_data" {cm get "MENTDB";};
				json load "inValues" "[]";
				json load "optionValues" "[]";
				json iarray "inValues" / "" STR;
				json iarray "optionValues" / "" STR;
				sql parse "session_data" "D" (concat "select login from users where activate='Y' order by login") {
				
					json iarray "inValues" / [D_login] STR;
					json iarray "optionValues" / [D_login] STR;
				
				};
				sql disconnect "session_data";
			
				include "app.100.obj.form.control.select_mono.exe" "[control_id]" "login_to" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
					"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "destination") "[description]" ""
					"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
					"[inValues]" (json doc "inValues")
					"[optionValues]" (json doc "optionValues")
					"[value]" ""
				;
				
			} {

				sql connect "session_data" {cm get "MENTDB";};

				-> "[user_list_to]" (sql value "session_data" (concat "select group_concat(quote(user_users.login_grant)) from user_users, users where users.login=user_users.login and activate='Y' and user_users.login=" (sql encode (json select "app" /user))));
				if (is null or empty [user_list_to]) {
					-> "[user_list_to]" (concat "and login in ('') ");
				} {
					-> "[user_list_to]" (concat "and login in (" [user_list_to] ") ");
				};
				
				json load "inValues" "[]";
				json load "optionValues" "[]";
				json iarray "inValues" / "" STR;
				json iarray "optionValues" / "" STR;
				sql parse "session_data" "D" (concat "select login from users where activate='Y' " [user_list_to] " order by login") {
				
					json iarray "inValues" / [D_login] STR;
					json iarray "optionValues" / [D_login] STR;
				
				};
				sql disconnect "session_data";
			
				include "app.100.obj.form.control.select_mono.exe" "[control_id]" "login_to" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
					"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "destination") "[description]" ""
					"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
					"[inValues]" (json doc "inValues")
					"[optionValues]" (json doc "optionValues")
					"[value]" ""
				;

			};
		
			
		
		# state -------- TO DELETE ...;
			
			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "state" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[0, 1, 2, 3, 4, 5]"
				"[optionValues]" (concat "[\"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_to_do") "\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_current") "\", \"Important\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_rdv") "\", \"Pause\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_completed") "\"]")
				"[value]" "0"
			;
		
		# description -------- TO DELETE ...;
			
			
			
			include "app.100.obj.form.control.textarea.exe" "[control_id]" "description" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "description" "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" "style='height:250px'"
				"[value]" ""
			;
		
		-> "[app_object_id]" (include "app.100.obj.form.end.remote.exe" "[form_id]" "tasks_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert1.exe"
		"[data_eval]" "$('#tasks_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "add")
		"[submitType]" "primary");

		json load "return_obj" "{}";
		json iobject "return_obj" / "obj" [object] STR;
		json iobject "return_obj" / "id" [app_object_id] STR;

		json doc "return_obj";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.insert_reopen_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Reopen an insert form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "projects_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "project_add_c")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# name -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "name") "[description]" "" "[maxlength]" "512" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/name")
			;
		
		# client_id -------- TO DELETE ...;
			
			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select id, name from clients where is_closed='N' order by name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / [D_name] STR;
			
			};
			sql disconnect "session_data";
		
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "client_id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "client" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[value]" (json select "data" "/client_data/client_id")
			;
		
		# is_closed -------- TO DELETE ...;
			
			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "is_closed" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "closed") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" (json select "data" "/client_data/is_closed")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "projects_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.insert.exe"
		"[data_eval]" "$('#projects_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "add")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.masks.insert" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);
		
		-> "[result]" (sql dml "session1" (concat 
			"UPDATE `masks` SET `order`=`order`+1 WHERE `groupname`=" (sql encode (json select "data" "/client_data/groupname")) "
				and `order`>=" (sql encode (json select "data" "/client_data/order")) ";"
		));
		
		-> "[result]" (sql dml "session1" (concat 
			"INSERT INTO `masks` (
			`groupname`, 
			`key`, 
			`order`
			) VALUES (
			" (sql encode (json select "data" "/client_data/groupname")) ", 
			" (sql encode (json select "data" "/client_data/key")) ", 
			" (sql encode (json select "data" "/client_data/order")) "
			);"
		));
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "insert_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.insert_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Get data from a database into a list ..." 
{

	try {

		-> "[current_remote_project_selected]" "";

		if (not(env exist var "[current_project_selected]")) {
	
			-> "[current_project_selected]" "";
	
		};
	
		#Load the current object id and his configuration;
		-> "[OBJECT_ID]" "jimdb_tasks_list0";
		include "app.100.scrud.overwrite_config.exe"
			"[OBJ_PARAM_LIST]" "container_id,page,nb_by_page,nb_lr_pagination,order_by,filter_sql,current_task_selected,current_project_selected"
		;
		
		if (is null or empty [current_task_selected]) {
	
			-> "[current_task_selected]" -1;
	
		};
	
		if (is null or empty [current_project_selected]) {
	
			-> "[current_project_selected]" "";
	
		};
	
		if (equal [nb_by_page] "*") {-> "[nb_by_page]" 999999999};
		if (is empty [order_by]) {
			-> "[asc_desc]" "ASC|";
			-> "[cur_asc_desc]" "";
			-> "[cur_order_by]" "";
		} {
			-> "[cur_asc_desc]" (atom get [order_by] 1 "|");
			-> "[cur_order_by]" (atom get [order_by] 2 "|");
			if (string starts_with [order_by] "ASC|") {
				-> "[asc_desc]" "DESC|";
			} {
				-> "[asc_desc]" "";
			};
		};
	
		#Initialization;
		-> "[object]" "<div style='border: 1px solid rgba(0,0,0,.12);-webkit-border-radius: 3px;
			-moz-border-radius: 3px;border-radius: 3px;
			margin-top: 2px;margin-bottom: 2px;padding:5px;background-color:#fff;color:#313131'>";
		
		if (equal (json select "app" /user) "system") {
			concat_var "[object]" "<span style='float:right'><button type='button' class='btn btn-danger btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.delete_confirm.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "get_all_checked('tasks_keys_checkbox')") "><span class='fa fa-remove fa-sm' aria-hidden='true'></span></button></span>";
			concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-success btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-plus fa-sm' aria-hidden='true'></span></button></span>";
			concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.search_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-search fa-sm' aria-hidden='true'></span></button></span>";
		} {
			concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-success btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-plus fa-sm' aria-hidden='true'></span></button></span>";
			concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.search_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-search fa-sm' aria-hidden='true'></span></button></span>";
		};
		
		#Connect to the database;
		sql connect "session1" {cm get "MENTDB";};
	
		-> "[filter_project]" "";
		-> "[project_name_current]" "";
		if (not (is null or empty [current_project_selected])) {
			concat_var "[filter_project]" " and project_id=" [current_project_selected];
			-> "[project_name_current]" (sql value "session1" (concat "select name from projects where id=" [current_project_selected]));
		};
	
		sql connect "info_user" {cm get "MENTDB";};
		-> "[filtre_client_droit]" (sql value "info_user" (concat "select group_concat(user_clients.id) from user_clients, clients where clients.id=user_clients.id and is_closed='N' and login=" (sql encode (json select "app" /user))));
		-> "[filtre_projet_droit]" (sql value "info_user" (concat "select group_concat(user_projects.id) from user_projects, projects where projects.id=user_projects.id and is_closed='N' and login=" (sql encode (json select "app" /user))));
		sql disconnect "info_user";

		if (is null or empty [filtre_client_droit]) {
			-> "[filtre_client_droit]" (concat "clients.id in (-1) and ");
		} {
			-> "[filtre_client_droit]" (concat "clients.id in (" [filtre_client_droit] ") and ");
		};
		if (is null or empty [filtre_projet_droit]) {
			-> "[filtre_projet_droit]" (concat "projects.id in (-1) and ");
		} {
			-> "[filtre_projet_droit]" (concat "projects.id in (" [filtre_projet_droit] ") and ");
		};
	
		-> "[filtre_sur_utilisateur]" "";
		if (not equal (json select "app" /user) "system") {
		
			-> "[filtre_sur_utilisateur]" (concat "(login_from=" (sql encode (json select "app" /user)) " or login_to=" (sql encode (json select "app" /user)) " or login_to='') and " (string replace [filtre_projet_droit] "projects.id" "project_id"));
			
		};
	
		-> "[app_nb_type0]" (sql value "session1" (concat "select count(*) from tasks where " [filtre_sur_utilisateur] " state=0 " [filter_project]));
		-> "[app_nb_type1]" (sql value "session1" (concat "select count(*) from tasks where " [filtre_sur_utilisateur] " state=1 " [filter_project]));
		-> "[app_nb_type2]" (sql value "session1" (concat "select count(*) from tasks where " [filtre_sur_utilisateur] " state=2 " [filter_project]));
		-> "[app_nb_type3]" (sql value "session1" (concat "select count(*) from tasks where " [filtre_sur_utilisateur] " state=3 " [filter_project]));
		-> "[app_nb_type4]" (sql value "session1" (concat "select count(*) from tasks where " [filtre_sur_utilisateur] " state=4 " [filter_project]));
		-> "[app_nb_type5]" (sql value "session1" (concat "select count(*) from tasks where " [filtre_sur_utilisateur] " state=5 " [filter_project]));
	
		concat_var "[object]" "<div style='margin-top: 6px;height: 11px;'><button style='font-size: 10px;background-color: #e0e0e0;color: #292929;padding: 2px 5px 2px 5px;border-radius: 3px;border: 1px #a5a5a5 solid;' type='button' class='btn btn-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_project_selected\":null}")) "[getElementById]" "" "[data]" "") ">" [project_name_current] "</button>  
		<input type='radio' name='gender' value='0' " (if (== [current_task_selected] 0) {mql "checked"}) " onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_task_selected\":0}")) "[getElementById]" "" "[data]" "") "> " (if (> [app_nb_type0] 0) {concat "<span style='background-color: #00c306;color: #fff;padding: 2px 5px 2px 5px;border-radius: 3px;'>" [app_nb_type0] "</span>"}) " <span onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_task_selected\":0}")) "[getElementById]" "" "[data]" "") ">" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_to_do") "</span>  
		<input type='radio' name='gender' value='1' " (if (== [current_task_selected] 1) {mql "checked"}) " onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_task_selected\":1}")) "[getElementById]" "" "[data]" "") "> " (if (> [app_nb_type1] 0) {concat "<span style='background-color: #007bc3;color: #fff;padding: 2px 5px 2px 5px;border-radius: 3px;'>" [app_nb_type1] "</span>"}) " <span onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_task_selected\":1}")) "[getElementById]" "" "[data]" "") ">" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_current") "</span>   
		<input type='radio' name='gender' value='2' " (if (== [current_task_selected] 2) {mql "checked"}) " onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_task_selected\":2}")) "[getElementById]" "" "[data]" "") "> " (if (> [app_nb_type2] 0) {concat "<span style='background-color: #de0000;color: #fff;padding: 2px 5px 2px 5px;border-radius: 3px;'>" [app_nb_type2] "</span>"}) " <span onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_task_selected\":2}")) "[getElementById]" "" "[data]" "") ">Important</span>   
		<input type='radio' name='gender' value='3' " (if (== [current_task_selected] 3) {mql "checked"}) " onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_task_selected\":3}")) "[getElementById]" "" "[data]" "") "> " (if (> [app_nb_type3] 0) {concat "<span style='background-color: #de00de;color: #fff;padding: 2px 5px 2px 5px;border-radius: 3px;'>" [app_nb_type3] "</span>"}) " <span onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_task_selected\":3}")) "[getElementById]" "" "[data]" "") ">" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_rdv") "</span>   
		<input type='radio' name='gender' value='4' " (if (== [current_task_selected] 4) {mql "checked"}) " onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_task_selected\":4}")) "[getElementById]" "" "[data]" "") "> " (if (> [app_nb_type4] 0) {concat "<span style='background-color: #e88b00;color: #fff;padding: 2px 5px 2px 5px;border-radius: 3px;'>" [app_nb_type4] "</span>"}) " <span onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_task_selected\":4}")) "[getElementById]" "" "[data]" "") ">Pause</span>   
		<input type='radio' name='gender' value='5' " (if (== [current_task_selected] 5) {mql "checked"}) " onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_task_selected\":5}")) "[getElementById]" "" "[data]" "") "> " (if (> [app_nb_type5] 0) {concat "<span style='background-color: #717171;color: #fff;padding: 2px 5px 2px 5px;border-radius: 3px;'>" [app_nb_type5] "</span>"}) " <span onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_task_selected\":5}")) "[getElementById]" "" "[data]" "") ">" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_completed") "</span>
		</div>
		<div style='height:15px;'></div>";

		-> "[sql_filter]" "";
		-> "[sql_filter_keys]" "";
		if (not (is null or empty [filter_sql])) {
			json load "filter_sql" [filter_sql];
			json parse_obj "filter_sql" "/" "[key]" "[val]" {

				if (not (string starts_with [key] "type:")) {
					switch (json select "filter_sql" (concat "/type:" [key]))
						("EQUAL") {concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
						("LIKE_L") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "'";}
						("LIKE_R") {concat_var "[sql_filter]" " and `" [key] "` like '" (string sublrchar (sql encode [val]) 1) "%'";}
						("LIKE_LR") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "%'";}
						{concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
					;
					concat_var "[sql_filter_keys]" "<span class='badge badge-light'>" [key] "</span> ";
				};
			
			};
	
			if (> (json count "filter_sql" "/") 0) {
				-> "[sql_filter_keys]" (concat "<h5 style='margin-top: 1px;margin-bottom:0px'><button type='button' style='margin-left: 10px;' class='btn btn-outline-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"filter_sql\":{}}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-remove fa-xs' aria-hidden='true'></span></button></h5>");
			};
		};

		-> "[iline]" (+ 1 (- (* [page] [nb_by_page]) [nb_by_page]));
		if (== -1 [current_task_selected]) {
			-> "[nb_elements]" (sql value "session1" (concat "select count(*) from `tasks` WHERE " [filtre_sur_utilisateur] " state<5 " [sql_filter] " " [filter_project] ";"));
		} {
			-> "[nb_elements]" (sql value "session1" (concat "select count(*) from `tasks` WHERE " [filtre_sur_utilisateur] " state=" [current_task_selected] " " [sql_filter] " " [filter_project] ";"));
		};
		-> "[nb_page]" (math ceil (/ [nb_elements] [nb_by_page]));
		if (is empty [cur_order_by]) {
			-> "[sql_order_by]" "order by is_bold, state, last_update desc";
		} {
			-> "[sql_order_by]" (concat "order by `" [cur_order_by] "` " [cur_asc_desc]);
		};

	concat_var "[object]" "<nav aria-label='Page navigation' style='display:inline-block'>
  <ul class='pagination' style='margin-bottom:0px'>
    <li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" 1 "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Previous'>
        <span aria-hidden='true'>«</span>
        <span class='sr-only'>Previous</span>
      </a>
    </li>";

	for (-> "[i_page]" (- [page] [nb_lr_pagination])) (< [i_page] [page]) (++ "[i_page]") {

		if (> [i_page] 0) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};

	for (-> "[i_page]" [page]) (<= [i_page] (+ [page] [nb_lr_pagination])) (++ "[i_page]") {

		if (<= [i_page] [nb_page]) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};
    
    concat_var "[object]" "<li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [nb_page] "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>
        <span aria-hidden='true'>»</span>
        <span class='sr-only'>Next</span>
      </a>
    </li>
  </ul>
</nav>  " [nb_elements] "
  <div style='float: right;display: inline-block;'><select id='app.100.template.taskmanager.actions.demo.MENTDB.tasks.list.key.nb_by_page' style='height: 33px;color: #007bff;' class='form-control' onChange=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"order_by\":\"\", \"page\":\"1\"}") "[getElementById]" "nb_by_page=app.100.template.taskmanager.actions.demo.MENTDB.tasks.list.key.nb_by_page" "[data]" "") ">
      <option " (if (== [nb_by_page] 1) {"selected"}) ">1</option>
      <option " (if (== [nb_by_page] 2) {"selected"}) ">2</option>
      <option " (if (== [nb_by_page] 3) {"selected"}) ">3</option>
      <option " (if (== [nb_by_page] 4) {"selected"}) ">4</option>
      <option " (if (== [nb_by_page] 5) {"selected"}) ">5</option>
      <option " (if (== [nb_by_page] 6) {"selected"}) ">6</option>
      <option " (if (== [nb_by_page] 10) {"selected"}) ">10</option>
      <option " (if (== [nb_by_page] 12) {"selected"}) ">12</option>
      <option " (if (== [nb_by_page] 15) {"selected"}) ">15</option>
      <option " (if (== [nb_by_page] 18) {"selected"}) ">18</option>
      <option " (if (== [nb_by_page] 25) {"selected"}) ">25</option>
      <option " (if (== [nb_by_page] 50) {"selected"}) ">50</option>
      <option " (if (== [nb_by_page] 100) {"selected"}) ">100</option>
      <option " (if (== [nb_by_page] 250) {"selected"}) ">250</option>
      <option " (if (== [nb_by_page] 500) {"selected"}) ">500</option>
      <option " (if (== [nb_by_page] 1000) {"selected"}) ">1000</option>
      <option " (if (== [nb_by_page] 2500) {"selected"}) ">2500</option>
      <option " (if (== [nb_by_page] 5000) {"selected"}) ">5000</option>
      <option " (if (== [nb_by_page] 999999999) {"selected"}) ">*</option>
    </select></div><div style='float: right;display: inline-block;line-height: 32px;margin-right: 2px;'>" [sql_filter_keys] "</div>
	<div style='height:2px;'></div>
";
	
concat_var "[object]" "<table class='table table-striped table-hover table-bordered' style='margin-bottom: 0px;'>
  <thead>
    <tr>";

		#concat the row title counter;
		concat_var "[object]" "
      <th style='width:44px;padding: 0px 0px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' id='tasks_main_checkbox' onchange='check_all(\"tasks_keys_checkbox\", this);'></div></th>
      <th scope='col' style='padding: 0px;'><a style='border:0px' class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "title") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "title")}} {(concat "ASC|" "title")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>titre" (if (equal [cur_order_by] "title") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
	</tr>
  </thead>
  <tbody>";

		sql parse "session1" "T" (concat "select 
			`id`, 
			`title`, 
			`description`, 
			`percent`, 
			`state`, 
			`project_id`, 
			(select name from projects where id=project_id) as project_name,
			(SELECT (select name from clients where id=projects.client_id) FROM projects where projects.id=project_id) as client_name,
			(SELECT count(*) FROM already_read where id_task=id and login=" (sql encode (json select "app" /user)) ") as is_bold,
			`dtcreate` from `tasks` WHERE " [filtre_sur_utilisateur] " " (if (== -1 [current_task_selected]) {concat "state<5"} {concat "state=" [current_task_selected]}) " " [sql_filter] " " [filter_project] " " [sql_order_by] " limit " (- (* [page] [nb_by_page]) [nb_by_page]) ", " [nb_by_page] ";") {
			
			json load "primary_key" "{}";
			json iobject "primary_key" / "client_data" "{}" OBJ;
			json iobject "primary_key" "/client_data" "id" [T_id] STR;
			
			-> "[is_bold]" (not [T_is_bold]);
			
      		switch ([T_state])
				(0) {	concat_var "[object]" "
			      <tr><th style='width:44px;padding: 0px 2px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' name='tasks_keys_checkbox' value='" (string encode_b64 (json doc "primary_key")) "'></div></th>
			      <td style='padding: 0px 2px 0px 2px;'>" (concat "<button type='button' class='btn btn-link btn-sm' style='text-decoration: none;text-overflow: ellipsis;width: 800px;overflow: hidden;text-align: left;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") "><span style='" (if (< [T_percent] 100) {"border: 1px #007bff solid;"} {"background-color: #008640;color:#fff;font-weight:bold;"}) "padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_percent] "%</span> <span style='background-color: #717171;color: #fff;padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_client_name] "</span> <span style='background-color: #00c306;color: #fff;padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_project_name] "</span> " (if ([is_bold]) {"<b><img src='images/ko.png'> "} {"<img src='images/ok.png'> <span style='color:#333'>"}) [T_title] (if ([is_bold]) {"</b>"} {"</span>"})) "</button></td></tr>";
			}
				(1) {	concat_var "[object]" "
			      <tr><th style='width:44px;padding: 0px 2px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' name='tasks_keys_checkbox' value='" (string encode_b64 (json doc "primary_key")) "'></div></th>
			      <td style='padding: 0px 2px 0px 2px;'>" (concat "<button type='button' class='btn btn-link btn-sm' style='text-decoration: none;text-overflow: ellipsis;width: 800px;overflow: hidden;text-align: left;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") "><span style='" (if (< [T_percent] 100) {"border: 1px #007bff solid;"} {"background-color: #008640;color:#fff;font-weight:bold;"}) "padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_percent] "%</span> <span style='background-color: #717171;color: #fff;padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_client_name] "</span> <span style='background-color: #007bc3;color: #fff;padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_project_name] "</span> " (if ([is_bold]) {"<b><img src='images/ko.png'> "} {"<img src='images/ok.png'> <span style='color:#333'>"}) [T_title] (if ([is_bold]) {"</b>"} {"</span>"})) "</button></td></tr>";
			}
				(2) {	concat_var "[object]" "
			      <tr><th style='width:44px;padding: 0px 2px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' name='tasks_keys_checkbox' value='" (string encode_b64 (json doc "primary_key")) "'></div></th>
			      <td style='padding: 0px 2px 0px 2px;'>" (concat "<button type='button' class='btn btn-link btn-sm' style='text-decoration: none;text-overflow: ellipsis;width: 800px;overflow: hidden;text-align: left;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") "><span style='" (if (< [T_percent] 100) {"border: 1px #007bff solid;"} {"background-color: #008640;color:#fff;font-weight:bold;"}) "padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_percent] "%</span> <span style='background-color: #717171;color: #fff;padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_client_name] "</span> <span style='background-color: #de0000;color: #fff;padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_project_name] "</span> " (if ([is_bold]) {"<b><img src='images/ko.png'> "} {"<img src='images/ok.png'> <span style='color:#333'>"}) [T_title] (if ([is_bold]) {"</b>"} {"</span>"})) "</button></td>";
			}
				(3) {	concat_var "[object]" "
			      <tr><th style='width:44px;padding: 0px 2px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' name='tasks_keys_checkbox' value='" (string encode_b64 (json doc "primary_key")) "'></div></th>
			      <td style='padding: 0px 2px 0px 2px;'>" (concat "<button type='button' class='btn btn-link btn-sm' style='text-decoration: none;text-overflow: ellipsis;width: 800px;overflow: hidden;text-align: left;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") "><span style='" (if (< [T_percent] 100) {"border: 1px #007bff solid;"} {"background-color: #008640;color:#fff;font-weight:bold;"}) "padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_percent] "%</span> <span style='background-color: #717171;color: #fff;padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_client_name] "</span> <span style='background-color: #de00de;color: #fff;padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_project_name] "</span> " (if ([is_bold]) {"<b><img src='images/ko.png'> "} {"<img src='images/ok.png'> <span style='color:#333'>"}) [T_title] (if ([is_bold]) {"</b>"} {"</span>"})) "</button></td>";
			}
				(4) {	concat_var "[object]" "
			      <tr><th style='width:44px;padding: 0px 2px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' name='tasks_keys_checkbox' value='" (string encode_b64 (json doc "primary_key")) "'></div></th>
			      <td style='padding: 0px 2px 0px 2px;'>" (concat "<button type='button' class='btn btn-link btn-sm' style='text-decoration: none;text-overflow: ellipsis;width: 800px;overflow: hidden;text-align: left;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") "><span style='" (if (< [T_percent] 100) {"border: 1px #007bff solid;"} {"background-color: #008640;color:#fff;font-weight:bold;"}) "padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_percent] "%</span> <span style='background-color: #717171;color: #fff;padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_client_name] "</span> <span style='background-color: #e88b00;color: #fff;padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_project_name] "</span> " (if ([is_bold]) {"<b><img src='images/ko.png'> "} {"<img src='images/ok.png'> <span style='color:#333'>"}) [T_title] (if ([is_bold]) {"</b>"} {"</span>"})) "</button></td>";
			}
				(5) {	concat_var "[object]" "
			      <tr><th style='width:44px;padding: 0px 2px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' name='tasks_keys_checkbox' value='" (string encode_b64 (json doc "primary_key")) "'></div></th>
			      <td style='padding: 0px 2px 0px 2px;'>" (concat "<button type='button' class='btn btn-link btn-sm' style='text-decoration: none;text-overflow: ellipsis;width: 800px;overflow: hidden;text-align: left;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") "><span style='" (if (< [T_percent] 100) {"border: 1px #007bff solid;"} {"background-color: #008640;color:#fff;font-weight:bold;"}) "padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_percent] "%</span> <span style='background-color: #717171;color: #fff;padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_client_name] "</span> <span style='background-color: #717171;color: #fff;padding: 2px 5px 2px 5px;border-radius: 11px;font-size:12px'>" [T_project_name] "</span> " (if ([is_bold]) {"<b><img src='images/ko.png'> "} {"<img src='images/ok.png'> <span style='color:#333'>"}) [T_title] (if ([is_bold]) {"</b>"} {"</span>"})) "</button></td></tr>";
      		}
			;
			
      		++ "[iline]";
		
		};
    
		concat_var "[object]" "
	</tbody>
</table>
</div>

";

		include "app.100.obj.sajax.refresh.exe"
			"[target]" [container_id]
			"[innerHtml]" [object]
		;

		-> "[project_list]" (concat "<div style='width:100%;margin: 2px;' >"); 

		sql parse "session1" "T" (concat "select clients.name, clients.id, count(*) as nb, ordered from clients, projects where " [filtre_client_droit] [filtre_projet_droit] "  clients.id=projects.client_id group by clients.name, clients.id") {

			if (> [T_nb] 0) {

				concat_var "[project_list]" "<div style='margin-top:1px;background-color: #717171;color: #fff;padding: 2px 5px 2px 5px;border-radius: 3px;'>" [T_name] "</div>";

				if (equal [T_ordered] "Y") {
					-> "[T_ordered]" "projects.name";
				} {
					-> "[T_ordered]" "projects.dtcreate";
				};
				
				sql parse "session1" "U" (concat "select name, id, (select count(*) from tasks where " [filtre_sur_utilisateur] " projects.id=tasks.project_id and tasks.state<5) as nb_task
				, (select count(*) from tasks where " [filtre_sur_utilisateur] " projects.id=tasks.project_id and tasks.state=0) as nb_task_0
				, (select count(*) from tasks where " [filtre_sur_utilisateur] " projects.id=tasks.project_id and tasks.state=1) as nb_task_1
				, (select count(*) from tasks where " [filtre_sur_utilisateur] " projects.id=tasks.project_id and tasks.state=2) as nb_task_2
				, (select count(*) from tasks where " [filtre_sur_utilisateur] " projects.id=tasks.project_id and tasks.state=3) as nb_task_3
				, (select count(*) from tasks where " [filtre_sur_utilisateur] " projects.id=tasks.project_id and tasks.state=4) as nb_task_4
				, remote_mentdb, remote_project_id
				from projects where " [filtre_projet_droit] " client_id=" [T_id] " order by " [T_ordered]) {

					if (> [U_nb_task] 0) {
						
						json load "p" "{}";
						json iobject "p" / current_project_selected [U_id] STR;
						json iobject "p" / current_task_selected "-1" STR;

						if (or (is null or empty [U_remote_mentdb]) (is null or empty [U_remote_project_id])) {
							-> "[remote_target]" "0";
						} {
							-> "[remote_target]" "1";
							json iobject "p" / current_remote_project_selected [U_id] STR;
						};
						
						concat_var "[project_list]" "<button style='margin-top:1px;background-color: #" (if ([remote_target]) {concat "FF5722"} {concat "e0e0e0"}) ";color: #" (if ([remote_target]) {concat "fff"} {concat "292929"}) ";padding: 2px 5px 2px 5px;border-radius: 3px;border: 1px #" (if ([remote_target]) {concat "c32f00"} {concat "a5a5a5"}) " solid;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" (concat "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list" [remote_target] ".exe") "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "p")) "[getElementById]" "" "[data]" "") ">" [U_name] "</button>"
						(if (> [U_nb_task_0] 0) {concat "<button style='margin-top:1px;background-color: #00c306;color: #fff;padding: 2px 5px 2px 5px;border-radius: 3px;border:0px' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_project_selected\":" [U_id] ", \"current_task_selected\": 0}")) "[getElementById]" "" "[data]" "") ">" [U_nb_task_0] "</button>")}
						(if (> [U_nb_task_1] 0) {concat "<button style='margin-top:1px;background-color: #007bc3;color: #fff;padding: 2px 5px 2px 5px;border-radius: 3px;border:0px' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_project_selected\":" [U_id] ", \"current_task_selected\": 1}")) "[getElementById]" "" "[data]" "") ">" [U_nb_task_1] "</button>")}
						(if (> [U_nb_task_2] 0) {concat "<button style='margin-top:1px;background-color: #de0000;color: #fff;padding: 2px 5px 2px 5px;border-radius: 3px;border:0px' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_project_selected\":" [U_id] ", \"current_task_selected\": 2}")) "[getElementById]" "" "[data]" "") ">" [U_nb_task_2] "</button>")}
						(if (> [U_nb_task_3] 0) {concat "<button style='margin-top:1px;background-color: #de00de;color: #fff;padding: 2px 5px 2px 5px;border-radius: 3px;border:0px' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_project_selected\":" [U_id] ", \"current_task_selected\": 3}")) "[getElementById]" "" "[data]" "") ">" [U_nb_task_3] "</button>")}
						(if (> [U_nb_task_4] 0) {concat "<button style='margin-top:1px;background-color: #e88b00;color: #fff;padding: 2px 5px 2px 5px;border-radius: 3px;border:0px' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"current_project_selected\":" [U_id] ", \"current_task_selected\": 4}")) "[getElementById]" "" "[data]" "") ">" [U_nb_task_4] "</button>")}
						"<br>";
					
					} {
					
						json load "p" "{}";
						json iobject "p" / current_project_selected [U_id] STR;

						if (or (is null or empty [U_remote_mentdb]) (is null or empty [U_remote_project_id])) {
							-> "[remote_target]" "0";
						} {
							-> "[remote_target]" "1";
							json iobject "p" / current_remote_project_selected [U_id] STR;
						};
						
						concat_var "[project_list]" "<button style='margin-top:1px;background-color: #" (if ([remote_target]) {concat "FF5722"} {concat "e0e0e0"}) ";color: #" (if ([remote_target]) {concat "fff"} {concat "292929"}) ";padding: 2px 5px 2px 5px;border-radius: 3px;border: 1px #" (if ([remote_target]) {concat "c32f00"} {concat "a5a5a5"}) " solid;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" (concat "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list" [remote_target] ".exe") "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "p")) "[getElementById]" "" "[data]" "") ">" [U_name] "</button><br>";
					
					};
					
				};

			};
		
		};

		concat_var "[project_list]" "</div>";

		include "app.100.obj.sajax.refresh.exe"
			"[target]" "project_graph"
			"[innerHtml]" [project_list]
		;

		sql disconnect "session1";

	} {

		#Save the error;
		log trace [err]; 
		
		#Close all objects;
		try {sql disconnect "session1";} {} "[e]";

		exception (1) (concat "ERR/APP/LIST: " [err]);

	} "[err]";
	
} "Return the list";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.users.onload" false 1 
  (param
  	(var "[OBJ_OVERWRITE]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Execute this script on load ..." 
{

	include "app.100.obj.sajax.server.exe"
		"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.list.exe"
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"container_id\":\"MENTDB_users\", \"page\":\"1\", \"nb_by_page\":\"10\", \"nb_lr_pagination\":\"4\", \"order_by\":\"\"}")
	;
	
} "Reload all blocs";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert_reopen_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Reopen an insert form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "tasks_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "task_add_c")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# project_id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "project_id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "project") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[1, 2, \"\", 3, 4, 5]"
				"[optionValues]" "[\"A\", \"B\", \"C\", \"D\", \"E\", \"F\"]"
				"[value]" (json select "data" "/client_data/project_id")
			;
		
		# title -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "title" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "title") "[description]" "" "[maxlength]" "1024" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/title")
			;
		
		# state -------- TO DELETE ...;
			
			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "state" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[0, 1, 2, 3, 4, 5]"
				"[optionValues]" (concat "[\"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_to_do") "\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_current") "\", \"Important\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_rdv") "\", \"Pause\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_completed") "\"]")
				"[value]" (json select "data" "/client_data/state")
			;
		
		# description -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textarea.exe" "[control_id]" "description" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "description" "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" "style='height:250px'"
				"[value]" (json select "data" "/client_data/description")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "tasks_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert.exe"
		"[data_eval]" "$('#tasks_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "add")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.masks.update_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {
		
		#Connect to the database;
		sql connect "session1" {cm get "MENTDB";};
		json load "row" (sql row "session1" (concat "select 
			`id`, 
			`groupname`, 
			`key`, 
			`order` from `masks` where `id`= " (sql encode (json select "data" "/client_data/id")) " "));
	
		#Disconnection ...;
		sql disconnect "session1";

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		exception (1) ([err]);
		
	} "[err]";

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "masks_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "mask_update")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]"(json select "row" "/id")
			;
		
		# groupname -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "groupname" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "group") "[description]" "" "[maxlength]" "1024" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/groupname")
			;
		
		# key -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "key" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "key") "[description]" "" "[maxlength]" "2048" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/key")
			;
		
		# order -------- TO DELETE ...;

			json load "array_order" "[]";
			for (-> "[i_order]" 0) (< [i_order] 200) (++ "[i_order]") {
			
				json iarray "array_order" / [i_order] INT;
			
			};
			
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "order" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "order") "[description]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[inValues]" (json doc "array_order")
				"[optionValues]" (json doc "array_order")
				"[value]" (json select "row" "/order")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "masks_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.update.exe"
		"[data_eval]" "$('#masks_update_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update")
		"[submitType]" "warning";
	
} "Return the form";

script create exe "app.100.template.taskmanager.html.body_bottom" false 1 
  (param
  ;) 
  "Body bottom" 
{

	concat_var "[page]" "    </div>";
	concat_var "[page]" "  </div>";
	concat_var "[page]" "</div>";
	
	include (concat "app." [app_version] ".obj.onload.exe");

	concat_var "[page]" "</body></html>";

	[page]

;} "html";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.clients.delete_confirm" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a confirm dialog box for delete ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "clients_delete_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (concat (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_of") (json count "data" "/client_data") (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_of_elements"))
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-md"
				"[html]" "style='font-size:14px'";
			
		include "app.100.obj.form.end.exe" "[form_id]" "clients_delete_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.delete.exe"
		"[data_eval]" ""
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "cancel")
		"[submitTitle]" (if (> (json count "data" "/client_data") 0) {(include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete")} {""})
		"[submitType]" "danger";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.users.insert_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an insert form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "users_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "user_add")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# login -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "login" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "login" "[description]" "" "[maxlength]" "150" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" ""
			;
		# password -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "password" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "password") "[description]" "" "[maxlength]" "32" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" ""
			;
		
		# clients -------- TO DELETE ...;
			
			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select name, id from clients where is_closed='N' order by name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / [D_name] STR;
			
			};
			sql disconnect "session_data";
		
			include "app.100.obj.form.control.select_multiple.exe" "[control_id]" "clients" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "clients" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[values]" "{}"
			;
		
		# projects -------- TO DELETE ...;

			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select name, id, (select name from clients where id=client_id) as client from projects where is_closed='N' order by client, name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / (concat [D_client] "/" [D_name]) STR;
			
			};
		
			include "app.100.obj.form.control.select_multiple.exe" "[control_id]" "projects" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "projects") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[values]" "{}"
			;


			

			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select login from users where activate='Y' order by login") {
			
				json iarray "inValues" / [D_login] STR;
				json iarray "optionValues" / [D_login] STR;
			
			};
			sql disconnect "session_data";
		
			include "app.100.obj.form.control.select_multiple.exe" "[control_id]" "users" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "users") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[values]" "{}"
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "users_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.users.insert.exe"
		"[data_eval]" "$('#users_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "add")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.users.delete_confirm" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a confirm dialog box for delete ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "users_delete_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (concat (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_of") (json count "data" "/client_data") (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_of_elements"))
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-md"
				"[html]" "style='font-size:14px'";
			
		include "app.100.obj.form.end.exe" "[form_id]" "users_delete_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.users.delete.exe"
		"[data_eval]" ""
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "cancel")
		"[submitTitle]" (if (> (json count "data" "/client_data") 0) {(include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete")} {""})
		"[submitType]" "danger";
	
} "Return the form";

script create exe "app.100.template.taskmanager.init" false 1 
  (param
  	(var "[lang]" {type is_enum [lang] "en,fr"} "The app language" is_null:false is_empty:false "en")
  ;) 
  "Initialise the taskmanager" 
{

	#Create the remote user grant object;
	json load "grants" "{}";
	#json iobject "grants" "/" "system" "[]" ARRAY;
	#json iarray "grants" "/system" 1 NUM;
	parameter add TASKMANAGER_JSON_GRANTS (json doc "grants") 0;

	#The default language;
	parameter add "TASKMANAGER_LANG" [lang] 0;

	#Create the SQL database;
	sql connect "session1" {cm get "MENTDB";};
	sql dml "session1" (concat "CREATE TABLE IF NOT EXISTS `clients` (
		  `id` bigint(20) NOT NULL AUTO_INCREMENT,
		  `name` varchar(256) NOT NULL,
		  `contact_name` varchar(256) NOT NULL,
		  `contact_email` varchar(256) NOT NULL,
		  `contact_tel` varchar(256) NOT NULL,
		  `is_closed` char(1) NOT NULL DEFAULT 'N',
		  `ordered` char(1) NOT NULL DEFAULT 'Y',
		  PRIMARY KEY (`id`)
		) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
	");
	sql dml "session1" (concat "CREATE TABLE IF NOT EXISTS `projects` (
		  `id` bigint(20) NOT NULL AUTO_INCREMENT,
		  `name` varchar(512) NOT NULL,
		  `is_closed` char(1) NOT NULL DEFAULT 'N',
		  `dtcreate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
		  `client_id` bigint(20) NOT NULL,
		  `remote_mentdb` varchar(255) DEFAULT NULL,
		  `remote_project_id` bigint(20) DEFAULT NULL,
		  PRIMARY KEY (`id`),
		  KEY `fk_client_project_idx` (`client_id`),
		  CONSTRAINT `fk_client_project` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
		) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
	");
	sql dml "session1" (concat "CREATE TABLE IF NOT EXISTS `tasks` (
		  `id` bigint(20) NOT NULL AUTO_INCREMENT,
		  `title` varchar(1024) NOT NULL,
		  `description` longtext NOT NULL,
		  `state` int(11) NOT NULL DEFAULT '0',
		  `project_id` bigint(20) NOT NULL,
		  `dtcreate` datetime DEFAULT CURRENT_TIMESTAMP,
		  `last_update` datetime DEFAULT NULL,
		  `percent` int(11) NOT NULL DEFAULT '0',
		  `login_from` varchar(150) NOT NULL DEFAULT 'system',
		  `login_to` varchar(150) NOT NULL DEFAULT 'system',
		  PRIMARY KEY (`id`),
		  KEY `fk_project_task_idx` (`project_id`),
		  CONSTRAINT `fk_project_task` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
		) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
	");
	sql dml "session1" (concat "CREATE TABLE IF NOT EXISTS `already_read` (
		  `id_task` bigint(20) NOT NULL,
		  `login` varchar(150) NOT NULL,
		  PRIMARY KEY (`id_task`,`login`),
		  CONSTRAINT `fk_already_read_tasks` FOREIGN KEY (`id_task`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
		) ENGINE=InnoDB DEFAULT CHARSET=latin1;
	");
	sql dml "session1" (concat "CREATE TABLE IF NOT EXISTS `comments` (
		  `id` bigint(20) NOT NULL AUTO_INCREMENT,
		  `comment` longtext NOT NULL,
		  `dtcreate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
		  `task_id` bigint(20) NOT NULL,
		  PRIMARY KEY (`id`),
		  KEY `fk_task_comment_idx` (`task_id`),
		  CONSTRAINT `fk_task_comment` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
		) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
	");
	sql dml "session1" (concat "CREATE TABLE IF NOT EXISTS `user_clients` (
		  `login` VARCHAR(150) NOT NULL,
		  `id` bigint(20) NOT NULL,
		  PRIMARY KEY (`login`, `id`),
		  CONSTRAINT `fk_user_client_user` FOREIGN KEY (`login`) REFERENCES `users` (`login`) ON DELETE CASCADE ON UPDATE NO ACTION,
		  CONSTRAINT `fk_user_client_client` FOREIGN KEY (`id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
		) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=latin1;
	");
	sql dml "session1" (concat "CREATE TABLE IF NOT EXISTS `user_projects` (
		  `login` VARCHAR(150) NOT NULL,
		  `id` bigint(20) NOT NULL,
		  PRIMARY KEY (`login`, `id`),
		  CONSTRAINT `fk_user_project_user` FOREIGN KEY (`login`) REFERENCES `users` (`login`) ON DELETE CASCADE ON UPDATE NO ACTION,
		  CONSTRAINT `fk_user_project_project` FOREIGN KEY (`id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
		) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
	");
	sql dml "session1" (concat "CREATE TABLE IF NOT EXISTS `user_users` (
		  `login` VARCHAR(150) NOT NULL,
		  `login_grant` VARCHAR(150) NOT NULL,
		  PRIMARY KEY (`login`, `login_grant`),
		  CONSTRAINT `fk_user_user_user1` FOREIGN KEY (`login`) REFERENCES `users` (`login`) ON DELETE CASCADE ON UPDATE NO ACTION,
		  CONSTRAINT `fk_user_user_user2` FOREIGN KEY (`login_grant`) REFERENCES `users` (`login`) ON DELETE CASCADE ON UPDATE NO ACTION
		) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
	");
	sql dml "session1" (concat "CREATE TABLE IF NOT EXISTS `masks` (
		  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
		  `groupname` VARCHAR(1024) NOT NULL,
		  `key` VARCHAR(2048) NOT NULL,
		  `order` BIGINT(20) NOT NULL,
		  PRIMARY KEY (`id`));
	");
	sql disconnect "session1";
	
} "Return nothing";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.onload" false 1 
  (param
  	(var "[OBJ_OVERWRITE]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Execute this script on load ..." 
{

	include "app.100.obj.sajax.server.exe"
		"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe"
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"container_id\":\"jimdb_projects\", \"page\":\"1\", \"nb_by_page\":\"10\", \"nb_lr_pagination\":\"4\", \"order_by\":\"\"}")
	;
	
} "Reload all blocs";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.insert_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an insert form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "projects_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "project_add")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# name -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "name") "[description]" "" "[maxlength]" "512" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" ""
			;
		
		# client_id -------- TO DELETE ...;
			
			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select id, name from clients where is_closed='N' order by name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / [D_name] STR;
			
			};
			sql disconnect "session_data";
		
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "client_id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "client" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[value]" ""
			;
		
		# is_closed -------- TO DELETE ...;
			
			
		
			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "is_closed" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "closed") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" "N"
			;
			
		include "app.100.obj.form.end.exe" "[form_id]" "projects_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.insert.exe"
		"[data_eval]" "$('#projects_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "add")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.delete_confirm" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a confirm dialog box for delete ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "projects_delete_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (concat (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_of") (json count "data" "/client_data") (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_of_elements"))
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-md"
				"[html]" "style='font-size:14px'";
			
		include "app.100.obj.form.end.exe" "[form_id]" "projects_delete_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.delete.exe"
		"[data_eval]" ""
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "cancel")
		"[submitTitle]" (if (> (json count "data" "/client_data") 0) {(include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete")} {""})
		"[submitType]" "danger";
	
} "Return the form";

script create exe "app.100.template.taskmanager.html.body_top" false 1 
  (param
  ;) 
  "Body top" 
{

	-> "[page]" "";

	concat_var "[page]" "<!doctype html>
		<html lang=\"fr\" style='height:100%'>
		<head>
		  <meta charset=\"utf-8\">
		  <title>" (json select "app" "/title") "</title>
		  <link href=\"font_awesome/css/font-awesome.min.css\" rel=\"stylesheet\">
		  <link href=\"css/menu-vertical.css\" rel=\"stylesheet\">
		  <script src=\"js/menu-vertical.js\"></script>
		  <link href=\"dist/css/bootstrap.css\" rel=\"stylesheet\">
		  <link href=\"css/tempusdominus-bootstrap-4.min.css\" rel=\"stylesheet\">
		  <script src=\"js/jquery.min.js\"></script>
		  <script src=\"js/moment-with-locales.js\"></script>
		  <script src=\"js/tempusdominus-bootstrap-4.min.js\"></script>
		  <script src=\"js/utils.js\"></script>
		  <script src=\"js/Chart.bundle.js\"></script>
		  <script src=\"dist/js/bootstrap.min.js\"></script>
		  <script src=\"js/jquery.sparkline.min.js\"></script>
		  <script src=\"js/raphael-2.1.4.min.js\"></script>
		  <script src=\"js/justgage.js\"></script>
		  <script src=\"js/progressbar.min.js\"></script>
		  <script src=\"js/mentdb.js\"></script>
		  <link rel=\"icon\" type=\"image/png\" href=\"images/" (json select "app" "/bar_icon") "\" />
		  <style>
.jqstooltip{
    box-sizing: content-box;
}

.GaugeMeter{
	Position:        Relative;
	Text-Align:      Center;
	Overflow:        Hidden;
	Cursor:          Default;
}

.GaugeMeter SPAN,
    .GaugeMeter B{
    	Margin:          0 23%;
    	Width:           50%;
    	Position:        Absolute;
    	Text-align:      Center;
    	Display:         Inline-Block;
    	Color:           RGBa(0,0,0,.8);
    	Font-Weight:     100;
    	Font-Family:     \"Open Sans\", Arial;
    	Overflow:        Hidden;
    	White-Space:     NoWrap;
    	Text-Overflow:   Ellipsis;
}
.GaugeMeter[data-style=\"Semi\"] B{
	Margin:          0 10%;
	Width:           80%;
}

.GaugeMeter S,
    .GaugeMeter U{
    	Text-Decoration: None;
    	Font-Size:       .49em;
    	Opacity:         .5;
}

.GaugeMeter B{
	Color:           Black;
	Font-Weight:     300;
	Opacity:         .8;
}

.progress > svg {
	width: 100%;
	height: 100%;
	display: block;
}
			
		  </style>
		</head>
		<body id=\"body\" style='height:100%;margin:0px;color:#333;font-family: " (json select "app" "/font_family") ";font-size: 12px;'>
			<div id='mentdb_alert_container'></div><div id='mentdb_modal_container'></div>";

	include (concat "app." [app_version] ".template." [app_template] ".html.bar_top.exe");
	concat_var "[page]" "<div style='display:table;width:100%;height:100%;padding-top: 65px;'>";
	concat_var "[page]" "  <div style='display:table-row'>";
	if (json select "app" /menu_default_show) {
	
		concat_var "[page]" "    <div style='display:table-cell;width:70px;border-right: 1px solid rgba(0,0,0,.11);vertical-align: top;'>";
		include (concat "app." [app_version] ".template." [app_template] ".html.menu_left.exe");
		concat_var "[page]" "    </div>";
	
	};
	
	concat_var "[page]" "    <div style='display:table-cell;background-color:#f1f2f3;padding: 8px;'>";

;} "html";

script create exe "app.100.template.taskmanager.page.admin.onload" false 1 
  (param
  	(var "[OBJ_OVERWRITE]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Show the admin page" 
{

	

;} "The 'admin' page";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update2" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Update an element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		if (== 5 (json select "data" "/client_data/state")) {
			json iobject "data" "/client_data" percent 100 STR;
		};
		
		-> "[result]" (sql dml "session1" (concat 
			"UPDATE `tasks` SET 
			last_update=CURRENT_TIMESTAMP(),
			`title`=" (sql encode (json select "data" "/client_data/title")) ", 
			`description`=" (sql encode (json select "data" "/client_data/description")) ", 
			`percent`=" (sql encode (json select "data" "/client_data/percent")) ", 
			`state`=" (sql encode (json select "data" "/client_data/state")) ", 
			`project_id`=" (sql encode (json select "data" "/client_data/project_id")) ", 
			`login_to`=" (sql encode (json select "data" "/client_data/login_to")) "
			WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
			;"
		));
		
		-> "[result]" (sql dml "session1" (concat 
			"DELETE FROM `already_read` WHERE `id_task`= " (sql encode (json select "data" "/client_data/id")) ";
			INSERT IGNORE INTO `already_read` (id_task, login) values (" (sql encode (json select "data" "/client_data/id")) ", " (sql encode (json select "app" /user)) ");"
		));

		if (not (is null or empty (json select "data" "/client_data/commentaire"))) {

			if (is not empty (string lrtrim (json select "data" "/client_data/commentaire"))) {
		
				-> "[result]" (sql dml "session1" (concat 
					"INSERT INTO `comments` (
						`comment`,
						`task_id`
					) VALUES (
						" (sql encode (concat "[" (json select "app" "/user") "] >>> " (json select "data" "/client_data/commentaire"))) " ,
						" (sql encode (json select "data" "/client_data/id")) "
					);"
				));

			};

		};	
		
		#Disconnection ...;
		sql disconnect "session1";
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.page.home.onload" false 1 
  (param
  	(var "[OBJ_OVERWRITE]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Show the home page" 
{

	

;} "The 'home' page";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.clients.update_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {
		
		#Connect to the database;
		sql connect "session1" {cm get "MENTDB";};
		json load "row" (sql row "session1" (concat "select 
			`id`, 
			`name`, 
			`contact_name`, 
			`contact_email`, 
			`contact_tel`, is_closed, ordered from `clients` where `id`= " (sql encode (json select "data" "/client_data/id")) " "));
	
		#Disconnection ...;
		sql disconnect "session1";

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		exception (1) ([err]);
		
	} "[err]";

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "clients_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "client_update")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]"(json select "row" "/id")
			;
		
		# name -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "company_name") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/name")
			;
		
		# contact_name -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_name") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/contact_name")
			;
		
		# contact_email -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_email" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_email") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/contact_email")
			;
		
		# contact_tel -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_tel" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_phone") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/contact_tel")
			;

			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "is_closed" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "closed") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" (json select "row" "/is_closed")
			;

			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "ordered" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "order") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" (json select "row" "/ordered")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "clients_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.update.exe"
		"[data_eval]" "$('#clients_update_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update")
		"[submitType]" "warning";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.list" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Get data from a database into a list ..." 
{
	
	#Load the current object id and his configuration;
	-> "[OBJECT_ID]" "jimdb_projects_list";
	include "app.100.scrud.overwrite_config.exe"
		"[OBJ_PARAM_LIST]" "container_id,page,nb_by_page,nb_lr_pagination,order_by,filter_sql"
	;
	
	if (equal [nb_by_page] "*") {-> "[nb_by_page]" 999999999};
	if (is empty [order_by]) {
		-> "[asc_desc]" "ASC|";
		-> "[cur_asc_desc]" "";
		-> "[cur_order_by]" "";
	} {
		-> "[cur_asc_desc]" (atom get [order_by] 1 "|");
		-> "[cur_order_by]" (atom get [order_by] 2 "|");
		if (string starts_with [order_by] "ASC|") {
			-> "[asc_desc]" "DESC|";
		} {
			-> "[asc_desc]" "";
		};
	};

	#Initialization;
	-> "[object]" "<div style='border: 1px solid rgba(0,0,0,.12);-webkit-border-radius: 3px;
		-moz-border-radius: 3px;border-radius: 3px;
		margin-top: 2px;margin-bottom: 2px;padding:5px;background-color:#fff;color:#313131'>";

	concat_var "[object]" "<span style='float:right'><button type='button' class='btn btn-danger btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.delete_confirm.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "get_all_checked('projects_keys_checkbox')") "><span class='fa fa-remove fa-sm' aria-hidden='true'></span></button></span>";
	concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-success btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.insert_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-plus fa-sm' aria-hidden='true'></span></button></span>";
	concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.search_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-search fa-sm' aria-hidden='true'></span></button></span>";

	concat_var "[object]" "
	<span style='font-size:16px'><b>  " (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "Projects") "</b></span>
	
	<div style='height:10px;'></div>
	
	<table class='table table-striped table-hover table-bordered' style='margin-bottom: 0px;'>
  <thead>
    <tr>";
	
	#Connect to the database;
	sql connect "session1" {cm get "MENTDB";};

	try {

		#concat the row title counter;
		concat_var "[object]" "
      <th style='width:44px;padding: 0px 0px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' id='projects_main_checkbox' onchange='check_all(\"projects_keys_checkbox\", this);'></div></th>
      <th scope='col' style='padding: 0px;'><a style='border:0px' class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "name") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "name")}} {(concat "ASC|" "name")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "name") (if (equal [cur_order_by] "name") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
      <th scope='col' style='padding: 0px;'><a style='border:0px' class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "client_id") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "client_id")}} {(concat "ASC|" "client_id")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>client" (if (equal [cur_order_by] "client_id") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
      <th scope='col' style='width:20px;padding: 0px;'></th>
      <th scope='col' style='width:20px;padding: 0px;'></th>
	</tr>
  </thead>
  <tbody>";
		
		-> "[sql_filter]" "";
		-> "[sql_filter_keys]" "";
		if (not (is null or empty [filter_sql])) {
			json load "filter_sql" [filter_sql];
			json parse_obj "filter_sql" "/" "[key]" "[val]" {

				if (not (string starts_with [key] "type:")) {
					switch (json select "filter_sql" (concat "/type:" [key]))
						("EQUAL") {concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
						("LIKE_L") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "'";}
						("LIKE_R") {concat_var "[sql_filter]" " and `" [key] "` like '" (string sublrchar (sql encode [val]) 1) "%'";}
						("LIKE_LR") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "%'";}
						{concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
					;
					concat_var "[sql_filter_keys]" "<span class='badge badge-light'>" [key] "</span> ";
				};
			
			};
	
			if (> (json count "filter_sql" "/") 0) {
				-> "[sql_filter]" (concat " WHERE " (string substring [sql_filter] 5));
				-> "[sql_filter_keys]" (concat "<h5 style='margin-top: 1px;margin-bottom:0px'><button type='button' style='margin-left: 10px;' class='btn btn-outline-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"filter_sql\":{}}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-remove fa-xs' aria-hidden='true'></span> " (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "filter") "(s)</button></h5>");
			};
		};

		-> "[iline]" (+ 1 (- (* [page] [nb_by_page]) [nb_by_page]));
		-> "[nb_elements]" (sql value "session1" (concat "select count(*) from `projects` " [sql_filter] ";"));
		-> "[nb_page]" (math ceil (/ [nb_elements] [nb_by_page]));
		if (is empty [cur_order_by]) {
			-> "[sql_order_by]" "order by is_closed, `name`";
		} {
			-> "[sql_order_by]" (concat "order by `" [cur_order_by] "` " [cur_asc_desc]);
		};

		sql parse "session1" "T" (concat "select 
			`id`, 
			`name`, 
			`is_closed`, 
			`dtcreate`, 
			(select `name` from clients where id=`client_id`) as client, remote_project_id, remote_mentdb from `projects` " [sql_filter] " " [sql_order_by] " limit " (- (* [page] [nb_by_page]) [nb_by_page]) ", " [nb_by_page] ";") {
			
			json load "primary_key" "{}";
			json iobject "primary_key" / "client_data" "{}" OBJ;
			json iobject "primary_key" "/client_data" "id" [T_id] STR;
			
      		
			concat_var "[object]" "
      <tr><th style='width:44px;padding: 0px 2px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' name='projects_keys_checkbox' value='" (string encode_b64 (json doc "primary_key")) "'></div></th>
      <td style='padding: 6px 2px 0px 2px;'><b>#" [T_id] (if (not (is null or empty [T_remote_project_id])) {concat "=>" [T_remote_mentdb] "@" [T_remote_project_id]}) "</b>  -  " (string replace [T_name] "<" "<") " " (if (equal [T_is_closed] "Y") {concat "[fermé]"}) "</td>
      <td style='padding: 6px 2px 0px 2px;'>" (string replace [T_client] "<" "<") "</td>";

			concat_var "[object]" "<td style='padding: 0px 2px 0px 2px;'><button type='button' class='btn btn-warning btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.update_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") "><span class='fa fa-pencil fa-sm' aria-hidden='true'></span></button></td>";
			concat_var "[object]" "<td style='padding: 0px 2px 0px 2px;'><button type='button' class='btn btn-light btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.insert_tasks_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") "><span class='fa fa-plus fa-sm' aria-hidden='true'></span></button></td>";
			concat_var "[object]" "</tr>";

      		++ "[iline]";
		
		};
    
		concat_var "[object]" "
	</tbody>
</table>

";

	concat_var "[object]" "<nav aria-label='Page navigation' style='display:inline-block'>
  <ul class='pagination' style='margin-bottom:0px'>
    <li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" 1 "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Previous'>
        <span aria-hidden='true'>«</span>
        <span class='sr-only'>Previous</span>
      </a>
    </li>";

	for (-> "[i_page]" (- [page] [nb_lr_pagination])) (< [i_page] [page]) (++ "[i_page]") {

		if (> [i_page] 0) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};

	for (-> "[i_page]" [page]) (<= [i_page] (+ [page] [nb_lr_pagination])) (++ "[i_page]") {

		if (<= [i_page] [nb_page]) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};
    
    concat_var "[object]" "<li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [nb_page] "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>
        <span aria-hidden='true'>»</span>
        <span class='sr-only'>Next</span>
      </a>
    </li>
  </ul>
</nav>  " [nb_elements] "
  <div style='float: right;display: inline-block;'><select id='app.100.template.taskmanager.actions.demo.MENTDB.projects.list.key.nb_by_page' style='height: 33px;color: #007bff;' class='form-control' onChange=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"order_by\":\"\", \"page\":\"1\"}") "[getElementById]" "nb_by_page=app.100.template.taskmanager.actions.demo.MENTDB.projects.list.key.nb_by_page" "[data]" "") ">
      <option " (if (== [nb_by_page] 1) {"selected"}) ">1</option>
      <option " (if (== [nb_by_page] 2) {"selected"}) ">2</option>
      <option " (if (== [nb_by_page] 3) {"selected"}) ">3</option>
      <option " (if (== [nb_by_page] 4) {"selected"}) ">4</option>
      <option " (if (== [nb_by_page] 5) {"selected"}) ">5</option>
      <option " (if (== [nb_by_page] 10) {"selected"}) ">10</option>
      <option " (if (== [nb_by_page] 12) {"selected"}) ">12</option>
      <option " (if (== [nb_by_page] 25) {"selected"}) ">25</option>
      <option " (if (== [nb_by_page] 50) {"selected"}) ">50</option>
      <option " (if (== [nb_by_page] 100) {"selected"}) ">100</option>
      <option " (if (== [nb_by_page] 250) {"selected"}) ">250</option>
      <option " (if (== [nb_by_page] 500) {"selected"}) ">500</option>
      <option " (if (== [nb_by_page] 1000) {"selected"}) ">1000</option>
      <option " (if (== [nb_by_page] 2500) {"selected"}) ">2500</option>
      <option " (if (== [nb_by_page] 5000) {"selected"}) ">5000</option>
      <option " (if (== [nb_by_page] 999999999) {"selected"}) ">*</option>
    </select></div><div style='float: right;display: inline-block;line-height: 32px;margin-right: 20px;'>" [sql_filter_keys] "</div>

</div>";

		sql disconnect "session1";

		include "app.100.obj.sajax.refresh.exe"
			"[target]" [container_id]
			"[innerHtml]" [object]
		;

	} {

		#Save the error;
		log trace [err]; 
		
		#Close all objects;
		try {sql disconnect "session1";} {} "[e]";

		exception (1) (concat "ERR/APP/LIST: " [err]);

	} "[err]";
	
} "Return the list";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert2" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		-> "[result]" (sql dml "session1" (concat 
			"INSERT INTO `tasks` (
			`title`, 
			`description`, 
			`state`, 
			`project_id`,
			last_update,
			login_from,
			login_to
			) VALUES (
			" (sql encode (json select "data" "/client_data/title")) ", 
			" (sql encode (json select "data" "/client_data/description")) ", 
			" (sql encode (json select "data" "/client_data/state")) ", 
			" (sql encode (json select "data" "/client_data/project_id")) ", 
			CURRENT_TIMESTAMP(),
			" (sql encode (json select "app" /user)) ",
			" (sql encode (json select "data" "/client_data/login_to")) "
			);"
		));

		-> "[last_insert_id]" (sql value "session1" (concat "select LAST_INSERT_ID()"););
		-> "[result]" (sql dml "session1" (concat 
			"INSERT IGNORE INTO `already_read` (id_task, login) values (" (sql encode [last_insert_id]) ", " (sql encode (json select "app" /user)) ");"
		));
		
		#Disconnection ...;
		sql disconnect "session1";
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.clients.onload" false 1 
  (param
  	(var "[OBJ_OVERWRITE]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Execute this script on load ..." 
{

	include "app.100.obj.sajax.server.exe"
		"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.list.exe"
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"container_id\":\"jimdb_clients\", \"page\":\"1\", \"nb_by_page\":\"10\", \"nb_lr_pagination\":\"4\", \"order_by\":\"\"}")
	;
	
} "Reload all blocs";

script create exe "app.100.template.taskmanager.page.home" false 1 
  (param
  ;) 
  "Show the home page" 
{

	include (concat "app." [app_version] ".template." [app_template] ".html.body_top.exe");

	#____________________________________________________________;

	#Your container code here;
	include "app.100.obj.sajax.skeleton.container.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "padding-right: 0px;padding-left: 0px;";
		include "app.100.obj.sajax.skeleton.row.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "padding:0px 10px 10px 10px";

		concat_var "[page]" "<table style='width:100%;'><tr><td style='width:230px;vertical-align:top'>";
			include "app.100.obj.sajax.skeleton.col.exe" "[id]" "project_graph" "[name]" "" "[class]" "" "[style]" "padding-right: 4px;overflow-y: auto;height: 690px;background-color: #fff;border: 1px solid rgba(0,0,0,.12);"; include "app.100.obj.sajax.skeleton.div.end.exe";
		concat_var "[page]" "</td><td style='vertical-align:top'>";
			include "app.100.obj.sajax.skeleton.col.exe" "[id]" "jimdb_tasks0" "[name]" "" "[class]" "" "[style]" "padding-left: 2px;"; include "app.100.obj.sajax.skeleton.div.end.exe";
		concat_var "[page]" "</td></tr></table>";
		
		include "app.100.obj.sajax.skeleton.div.end.exe";
	include "app.100.obj.sajax.skeleton.div.end.exe";
	
	include "app.100.template.taskmanager.actions.demo.MENTDB.tasks.skeleton.exe";
	
	include "app.100.obj.sajax.skeleton.onload.exe"
		"[scriptname]" (concat "app." [app_version] ".template." [app_template] ".page.home.onload.exe")
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
	;
	
	#____________________________________________________________;
	
	include (concat "app." [app_version] ".template." [app_template] ".html.body_bottom.exe");

;} "The 'home' page";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an insert form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "tasks_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "task_add")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# title -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "title" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "title") "[description]" "" "[maxlength]" "1024" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" ""
			;
		
		# project_id -------- TO DELETE ...;
			
			sql connect "info_user" {cm get "MENTDB";};
			-> "[filtre_client_droit]" (sql value "info_user" (concat "select group_concat(user_clients.id) from user_clients, clients where clients.id=user_clients.id and is_closed='N' and login=" (sql encode (json select "app" /user))));
			-> "[filtre_projet_droit]" (sql value "info_user" (concat "select group_concat(user_projects.id) from user_projects, projects where projects.id=user_projects.id and is_closed='N' and login=" (sql encode (json select "app" /user))));
			sql disconnect "info_user";
			if (is null or empty [filtre_client_droit]) {
				-> "[filtre_client_droit]" (concat "and clients.id in (-1) ");
			} {
				-> "[filtre_client_droit]" (concat "and clients.id in (" [filtre_client_droit] ") ");
			};
			if (is null or empty [filtre_projet_droit]) {
				-> "[filtre_projet_droit]" (concat "and projects.id in (-1) ");
			} {
				-> "[filtre_projet_droit]" (concat "and projects.id in (" [filtre_projet_droit] ") ");
			};

			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select projects.id, projects.name, clients.name as client from projects, clients WHERE projects.client_id=clients.id and (remote_mentdb is null or remote_mentdb='') " [filtre_client_droit] [filtre_projet_droit] " order by clients.name, projects.name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / (concat [D_client] " / " [D_name]) STR;
			
			};
			sql disconnect "session_data";
		
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "project_id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "project") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[value]" (if (env exist var "[current_project_selected]") {[current_project_selected]})
			;



			if (equal (json select "app" /user) "system") {

				sql connect "session_data" {cm get "MENTDB";};
				json load "inValues" "[]";
				json load "optionValues" "[]";
				json iarray "inValues" / "" STR;
				json iarray "optionValues" / "" STR;
				sql parse "session_data" "D" (concat "select login from users where activate='Y' order by login") {
				
					json iarray "inValues" / [D_login] STR;
					json iarray "optionValues" / [D_login] STR;
				
				};
				sql disconnect "session_data";
			
				include "app.100.obj.form.control.select_mono.exe" "[control_id]" "login_to" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
					"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "destination") "[description]" ""
					"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
					"[inValues]" (json doc "inValues")
					"[optionValues]" (json doc "optionValues")
					"[value]" ""
				;
				
			} {

				sql connect "session_data" {cm get "MENTDB";};

				-> "[user_list_to]" (sql value "session_data" (concat "select group_concat(quote(user_users.login_grant)) from user_users, users where users.login=user_users.login and activate='Y' and user_users.login=" (sql encode (json select "app" /user))));
				if (is null or empty [user_list_to]) {
					-> "[user_list_to]" (concat "and login in ('') ");
				} {
					-> "[user_list_to]" (concat "and login in (" [user_list_to] ") ");
				};
				
				json load "inValues" "[]";
				json load "optionValues" "[]";
				json iarray "inValues" / "" STR;
				json iarray "optionValues" / "" STR;
				sql parse "session_data" "D" (concat "select login from users where activate='Y' " [user_list_to] " order by login") {
				
					json iarray "inValues" / [D_login] STR;
					json iarray "optionValues" / [D_login] STR;
				
				};
				sql disconnect "session_data";
			
				include "app.100.obj.form.control.select_mono.exe" "[control_id]" "login_to" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
					"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "destination") "[description]" ""
					"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
					"[inValues]" (json doc "inValues")
					"[optionValues]" (json doc "optionValues")
					"[value]" ""
				;

			};
		
			
		
		# state -------- TO DELETE ...;
			
			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "state" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[0, 1, 2, 3, 4, 5]"
				"[optionValues]" (concat "[\"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_to_do") "\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_current") "\", \"Important\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_rdv") "\", \"Pause\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_completed") "\"]")
				"[value]" "0"
			;
		
		# description -------- TO DELETE ...;
			
			
			
			include "app.100.obj.form.control.textarea.exe" "[control_id]" "description" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "description" "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" "style='height:250px'"
				"[value]" ""
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "tasks_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert.exe"
		"[data_eval]" "$('#tasks_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "add")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.clients.insert_reopen_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Reopen an insert form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "clients_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "client_add_c")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# name -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "company_name") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/name")
			;
		
		# contact_name -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_name") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/contact_name")
			;
		
		# contact_email -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_email" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_email") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/contact_email")
			;
		
		# contact_tel -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_tel" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_phone") "[description]" "" "[maxlength]" "256" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/contact_tel")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "clients_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.insert.exe"
		"[data_eval]" "$('#clients_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "add")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.html.bar_top" false 1 
  (param
  ;) 
  "Bar top" 
{

	concat_var "[page]" "<div style='box-shadow: 0px 0px 8px " (json select "app" "/top_background_color") ";z-index: 999;position: fixed;width:100%;height:65px;line-height:63px;
		background-color: " (json select "app" "/top_background_color") ";
		color: " (json select "app" "/top_color") ";
		font-size: 22px;'>
		<img src='images/refresh.gif' style='display:none'>
	     <a href='index.jsp'><img id='top_refresh_icon' src='images/" (json select "app" "/top_logo") "' 
			style='vertical-align:middle;
		     width:" (json select "app" "/top_logo_width") ";
			margin-top:" (json select "app" "/top_logo_top") ";
			margin-left:" (json select "app" "/top_logo_left") ";'></a>   " (json select "app" "/top_title") "

		<div style='float:right'>
			<span class='hidden-xs' style='font-size:18px'>" (json select "app" "/user") "</span>  
			<a style='margin-right: 20px;color:#fff' href='index.jsp?app_action=menu_toggle'><i class='fa fa-bars' style='vertical-align: middle;'></i></a>
			<a style='margin-right: 20px;color:#fff' href='index.jsp?app_action=logout'><i class='fa fa-power-off' style='vertical-align: middle;'></i></a>
		</div>
	
	</div>";

;} "html";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.search_open_form1" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a search form ..." 
{

	try {

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json iobject "data" / load_env (json doc "app") OBJ;

		sql connect "session1" {cm get "MENTDB";};
		-> "[remote_mentdb]" (sql value "session1" (concat "select remote_mentdb from projects where id=" (sql encode [current_remote_project_selected])));
		-> "[current_project_selected]" (sql value "session1" (concat "select remote_project_id from projects where id=" (sql encode [current_remote_project_selected])));
		sql disconnect "session1";

		json iobject "data" / current_project_selected [current_project_selected] STR;

		json load "return_obj" (tunnel execute_hot "session1" {cm get [remote_mentdb]} (concat 
			"include \"app.100.template.taskmanager.actions.demo.MENTDB.tasks.search_open_form2.exe\"
				\"[OBJ_OVERWRITE_B64]\" " (mql encode (string encode_b64 (json doc data))) "
			;"
		));

		include "app.100.obj.sajax.refresh.exe"
			"[target]" ""
			"[innerHtml]" (json select "return_obj" "/obj")
		;

		include "app.100.obj.sajax.javascript.exe"
			"[javascript]" (concat "object_onload" (json select "return_obj" "/id") "();")
		;

	} {
	
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
		#Close all objects;
		try {tunnel disconnect "session1";} {} "[e]";

	} "[err]";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.users.update" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Update an element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};
		sql auto_commit "session1" false;

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		if (is null or empty (json select "data" "/client_data/login")) {

			exception (1) ("The login or password cannot be null or empty.");

		};

		-> "[result]" (sql dml "session1" (concat 
			"UPDATE `users` SET 
			`activate`=" (sql encode (json select "data" "/client_data/activate")) "
			WHERE `login`= " (sql encode (json select "data" "/client_data/login")) " 
			;"
		));
		
		if (not (is null or empty (json select "data" "/client_data/password"))) {
		
			-> "[result]" (sql dml "session1" (concat 
				"UPDATE `users` SET 
				`password`=" (sql encode (string md5 (json select "data" "/client_data/password"))) "
				WHERE `login`= " (sql encode (json select "data" "/client_data/login")) " 
				;"
			));

		};

		-> "[result]" (sql dml "session1" (concat 
			"DELETE FROM user_clients WHERE `login`= " (sql encode (json select "data" "/client_data/login")) ";
			DELETE FROM user_projects WHERE `login`= " (sql encode (json select "data" "/client_data/login")) ";
			DELETE FROM user_users WHERE `login`= " (sql encode (json select "data" "/client_data/login")) ";"
		));

		if (is not null (json select "data" "/client_data/clients")) {
			if (string starts_with (json select "data" "/client_data/clients") "[") {
	
				json load by ref "data" "/client_data/clients" "clients";
				json parse_array "clients" "/" "[id]" {
				
					-> "[result]" (sql dml "session1" (concat 
						"INSERT IGNORE INTO `user_clients` (
						`login`, 
						`id`
						) VALUES (
						" (sql encode (json select "data" "/client_data/login")) ", 
						" (sql encode [id]) "
						);"
					));
				
				};
	
			} {
	
				-> "[result]" (sql dml "session1" (concat 
					"INSERT IGNORE INTO `user_clients` (
					`login`, 
					`id`
					) VALUES (
					" (sql encode (json select "data" "/client_data/login")) ", 
					" (sql encode (json select "data" "/client_data/clients")) "
					);"
				));
	
			};
		};

		if (is not null (json select "data" "/client_data/projects")) {
			if (string starts_with (json select "data" "/client_data/projects") "[") {
	
				json load by ref "data" "/client_data/projects" "projects";
				json parse_array "projects" "/" "[id]" {
				
					-> "[result]" (sql dml "session1" (concat 
						"INSERT IGNORE INTO `user_projects` (
						`login`, 
						`id`
						) VALUES (
						" (sql encode (json select "data" "/client_data/login")) ", 
						" (sql encode [id]) "
						);"
					));
				
				};
	
			} {
	
				-> "[result]" (sql dml "session1" (concat 
					"INSERT IGNORE INTO `user_projects` (
					`login`, 
					`id`
					) VALUES (
					" (sql encode (json select "data" "/client_data/login")) ", 
					" (sql encode (json select "data" "/client_data/projects")) "
					);"
				));
	
			};
		};

		if (is not null (json select "data" "/client_data/users")) {
			if (string starts_with (json select "data" "/client_data/users") "[") {
	
				json load by ref "data" "/client_data/users" "users";
				json parse_array "users" "/" "[login_grant]" {
				
					-> "[result]" (sql dml "session1" (concat 
						"INSERT IGNORE INTO `user_users` (
						`login`, 
						`login_grant`
						) VALUES (
						" (sql encode (json select "data" "/client_data/login")) ", 
						" (sql encode [login_grant]) "
						);"
					));
				
				};
	
			} {
	
				-> "[result]" (sql dml "session1" (concat 
					"INSERT IGNORE INTO `user_users` (
					`login`, 
					`login_grant`
					) VALUES (
					" (sql encode (json select "data" "/client_data/login")) ", 
					" (sql encode (json select "data" "/client_data/users")) "
					);"
				));
	
			};
		};

		sql commit "session1";
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		try {sql rollback "session1";} {} "[sub_err]";

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.update_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.delete_confirm" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a confirm dialog box for delete ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "tasks_delete_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (concat (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_of") (json count "data" "/client_data") (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_of_elements"))
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-md"
				"[html]" "style='font-size:14px'";
			
		include "app.100.obj.form.end.exe" "[form_id]" "tasks_delete_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.delete.exe"
		"[data_eval]" ""
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "cancel")
		"[submitTitle]" (if (> (json count "data" "/client_data") 0) {(include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete")} {""})
		"[submitType]" "danger";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.users.search_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a search form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "users_search_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "search_user")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";

	-> "[filter_sql]" (json select "app" (concat "/objects/MENTDB_users_list/filter_sql"));
	if (not (is null or empty [filter_sql])) {
		json load "filter_sql" [filter_sql];
	} {
		json load "filter_sql" "{}";
	};
			
		# login -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/login")) {
				json iobject "filter_sql" / "login" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "login" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "login" "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/login")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "users_search_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.users.search.exe"
		"[data_eval]" "$('#users_search_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "search")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.search" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json load "filter_sql" "{\"filter_sql\":{}}";

		

		if (not (is null or empty (json select "data" "/client_data/title"))) {
			json iobject "filter_sql" "/filter_sql" "title" (json select "data" "/client_data/title") STR;
			json iobject "filter_sql" "/filter_sql" "type:title" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		if (not (is null or empty (json select "data" "/client_data/description"))) {
			json iobject "filter_sql" "/filter_sql" "description" (json select "data" "/client_data/description") STR;
			json iobject "filter_sql" "/filter_sql" "type:description" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		-> "[search_filter_multiple]" (string encode_b64 (json doc "filter_sql"));

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe"
			"[OBJ_OVERWRITE_B64]" [search_filter_multiple]
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.html.menu_left" false 1 
  (param
  ;) 
  "Menu left" 
{
	
	concat_var "[page]" "<div style='width: 100%;width:100%;height:100%;
		background-color: " (json select "app" "/menu_background_color") ";'>

		" (app menu show) "
	
	</div>";

;} "html";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.masks.search_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a search form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "masks_search_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "search_mask")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";

	-> "[filter_sql]" (json select "app" (concat "/objects/MENTDB_masks_list/filter_sql"));
	if (not (is null or empty [filter_sql])) {
		json load "filter_sql" [filter_sql];
	} {
		json load "filter_sql" "{}";
	};
			
		# groupname -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/groupname")) {
				json iobject "filter_sql" / "groupname" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "groupname" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "group") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/groupname")
			;
		
		# key -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/key")) {
				json iobject "filter_sql" / "key" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "key" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "key") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/key")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "masks_search_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.search.exe"
		"[data_eval]" "$('#masks_search_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "search")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.update" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Update an element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);
		
		-> "[result]" (sql dml "session1" (concat 
			"UPDATE `projects` SET 
			`name`=" (sql encode (json select "data" "/client_data/name")) ", 
			`is_closed`=" (sql encode (json select "data" "/client_data/is_closed")) ", 
			`client_id`=" (sql encode (json select "data" "/client_data/client_id")) ", 
			`remote_mentdb`=" (sql encode (json select "data" "/client_data/remote_mentdb")) ", 
			`remote_project_id`=" (if (is null or empty (json select "data" "/client_data/remote_project_id")) {concat "null"} {sql encode (json select "data" "/client_data/remote_project_id")}) "
			WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
			;"
		));
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.update_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.masks.delete" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Delete elements ..." 
{

	json load "client_data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {

		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};
	
		json parse_array "client_data" "/client_data" "[o]" {
		
			json load "data" [o];

			-> "[result]" (sql dml "session1" (concat 
				"UPDATE `masks` SET `order`=`order`-1 WHERE `groupname`=" (sql encode (sql value "session1" (concat "select groupname from masks where id=" (json select "data" "/client_data/id")))) "
					and `order`>" (sql encode (sql value "session1" (concat "select `order` from masks where id=" (json select "data" "/client_data/id")))) ";"
			));
	
			-> "[result]" (sql dml "session1" (concat 
				"DELETE FROM `masks` 
				WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
				;"
			));
		
		};
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"page\":\"1\"}")
		;

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;

	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.masks.search" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json load "filter_sql" "{\"filter_sql\":{}}";

		
		if (not (is null or empty (json select "data" "/client_data/groupname"))) {
			json iobject "filter_sql" "/filter_sql" "groupname" (json select "data" "/client_data/groupname") STR;
			json iobject "filter_sql" "/filter_sql" "type:groupname" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		if (not (is null or empty (json select "data" "/client_data/key"))) {
			json iobject "filter_sql" "/filter_sql" "key" (json select "data" "/client_data/key") STR;
			json iobject "filter_sql" "/filter_sql" "type:key" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "filter_sql"))
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.projects.insert_tasks" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);
		
		sql parse "session1" "T" (concat "select `key` from masks where groupname=" (sql encode (json select "data" "/client_data/groupname")) " order by `order`") {
			
			if (== 0 (sql value "session1" (concat "select count(*) from tasks where project_id=" (json select "data" "/client_data/id") " and 
				title=" (sql encode [T_key])))) {

				-> "[result]" (sql dml "session1" (concat 
					"INSERT INTO `tasks` (
						`title`,
						`description`,
						`state`,
						`project_id`,
						`percent`,
						`login_from`,
						`login_to`)
						VALUES (
						" (sql encode [T_key]) ",
						'',
						0,
						" (sql encode (json select "data" "/client_data/id")) ",
						0,
						" (sql encode (json select "app" /user)) ",
						'');
	"
				));

			};
		
		};
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "insert_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.projects.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.page.admin" false 1 
  (param
  ;) 
  "Show the admin page" 
{

	include (concat "app." [app_version] ".template." [app_template] ".html.body_top.exe");

	#____________________________________________________________;

	#Your container code here;
	include "app.100.obj.sajax.skeleton.container.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "padding-right: 0px;padding-left: 0px;";
		include "app.100.obj.sajax.skeleton.row.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "";
			include "app.100.obj.sajax.skeleton.col.exe" "[id]" "jimdb_projects" "[name]" "" "[class]" "col-6 col-xs-6 col-sm-6 col-md-6 col-lg-6" "[style]" "padding-right: 2px;"; include "app.100.obj.sajax.skeleton.div.end.exe";
			include "app.100.obj.sajax.skeleton.col.exe" "[id]" "jimdb_clients" "[name]" "" "[class]" "col-6 col-xs-6 col-sm-6 col-md-6 col-lg-6" "[style]" "padding-left: 2px;"; include "app.100.obj.sajax.skeleton.div.end.exe";
		include "app.100.obj.sajax.skeleton.div.end.exe";
		include "app.100.obj.sajax.skeleton.row.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "";
			include "app.100.obj.sajax.skeleton.col.exe" "[id]" "MENTDB_users" "[name]" "" "[class]" "col-6 col-xs-6 col-sm-6 col-md-6 col-lg-6" "[style]" "padding-right: 2px;"; include "app.100.obj.sajax.skeleton.div.end.exe";
			include "app.100.obj.sajax.skeleton.col.exe" "[id]" "MENTDB_masks" "[name]" "" "[class]" "col-6 col-xs-6 col-sm-6 col-md-6 col-lg-6" "[style]" "padding-left: 2px;"; include "app.100.obj.sajax.skeleton.div.end.exe";
		include "app.100.obj.sajax.skeleton.div.end.exe";
	include "app.100.obj.sajax.skeleton.div.end.exe";
	
	include "app.100.template.taskmanager.actions.demo.MENTDB.clients.skeleton.exe";
	include "app.100.template.taskmanager.actions.demo.MENTDB.projects.skeleton.exe";
	include "app.100.template.taskmanager.actions.demo.MENTDB.users.skeleton.exe";
	include "app.100.template.taskmanager.actions.demo.MENTDB.masks.skeleton.exe";
	
	include "app.100.obj.sajax.skeleton.onload.exe"
		"[scriptname]" (concat "app." [app_version] ".template." [app_template] ".page.admin.onload.exe")
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
	;
	
	#____________________________________________________________;
	
	include (concat "app." [app_version] ".template." [app_template] ".html.body_bottom.exe");

;} "The 'home' page";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Update an element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		if (== 5 (json select "data" "/client_data/state")) {
			json iobject "data" "/client_data" percent 100 STR;
		};
		
		-> "[result]" (sql dml "session1" (concat 
			"UPDATE `tasks` SET 
			last_update=CURRENT_TIMESTAMP(),
			`title`=" (sql encode (json select "data" "/client_data/title")) ", 
			`description`=" (sql encode (json select "data" "/client_data/description")) ", 
			`percent`=" (sql encode (json select "data" "/client_data/percent")) ", 
			`state`=" (sql encode (json select "data" "/client_data/state")) ", 
			`project_id`=" (sql encode (json select "data" "/client_data/project_id")) ", 
			`login_to`=" (sql encode (json select "data" "/client_data/login_to")) "
			WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
			;"
		));
		
		-> "[result]" (sql dml "session1" (concat 
			"DELETE FROM `already_read` WHERE `id_task`= " (sql encode (json select "data" "/client_data/id")) ";
			INSERT IGNORE INTO `already_read` (id_task, login) values (" (sql encode (json select "data" "/client_data/id")) ", " (sql encode (json select "app" /user)) ");"
		));

		if (not (is null or empty (json select "data" "/client_data/commentaire"))) {

			if (is not empty (string lrtrim (json select "data" "/client_data/commentaire"))) {
		
				-> "[result]" (sql dml "session1" (concat 
					"INSERT INTO `comments` (
						`comment`,
						`task_id`
					) VALUES (
						" (sql encode (concat "[" (json select "app" "/user") "] >>> " (json select "data" "/client_data/commentaire"))) " ,
						" (sql encode (json select "data" "/client_data/id")) "
					);"
				));

			};

		};

		if (not (is null or empty (json select "data" "/client_data/fichier_a_uploader_filename"))) {

			if (not (file exist (concat "web/https/taskmanager/attachements/" (json select "data" "/client_data/id")))) {
				file mkdir (concat "web/https/taskmanager/attachements/" (json select "data" "/client_data/id"));
			};

			-> "[filename_tmp]" (string replace (json select "data" "/client_data/fichier_a_uploader_filename") (string int_to_char 92) "/");

			file b64_write (json select "data" "/client_data/fichier_a_uploader_datafile") 
				(concat "web/https/taskmanager/attachements/" (json select "data" "/client_data/id") "/" (atom get [filename_tmp] (atom size [filename_tmp] "/") "/"));
			
		};
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.delete_attachement" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a confirm dialog box for delete ..." 
{

	try {
		
		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		log trace (json doc "data");

		if (not (is null or empty (json select "data" "/id_task"))) {

			if (file exist (concat "web/https/taskmanager/attachements/" (json select "data" "/id_task") "/" (json select "data" "/filename"))) {
	
				file delete (concat "web/https/taskmanager/attachements/" (json select "data" "/id_task") "/" (json select "data" "/filename"));
	
			};

		};
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_ok")
		;
		
	} {

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.clients.search_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a search form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "clients_search_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "search_client")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";

	-> "[filter_sql]" (json select "app" (concat "/objects/jimdb_clients_list/filter_sql"));
	if (not (is null or empty [filter_sql])) {
		json load "filter_sql" [filter_sql];
	} {
		json load "filter_sql" "{}";
	};
			
		# name -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/name")) {
				json iobject "filter_sql" / "name" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "company_name") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/name")
			;
		
		# contact_name -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/contact_name")) {
				json iobject "filter_sql" / "contact_name" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_name") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/contact_name")
			;
		
		# contact_email -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/contact_email")) {
				json iobject "filter_sql" / "contact_email" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_email" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_email") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/contact_email")
			;
		
		# contact_tel -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/contact_tel")) {
				json iobject "filter_sql" / "contact_tel" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "contact_tel" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "contact_phone") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/contact_tel")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "clients_search_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.search.exe"
		"[data_eval]" "$('#clients_search_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "search")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.search2" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json load "filter_sql" "{\"filter_sql\":{}}";

		

		if (not (is null or empty (json select "data" "/client_data/title"))) {
			json iobject "filter_sql" "/filter_sql" "title" (json select "data" "/client_data/title") STR;
			json iobject "filter_sql" "/filter_sql" "type:title" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		if (not (is null or empty (json select "data" "/client_data/description"))) {
			json iobject "filter_sql" "/filter_sql" "description" (json select "data" "/client_data/description") STR;
			json iobject "filter_sql" "/filter_sql" "type:description" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		string encode_b64 (json doc "filter_sql");
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update_open_form1" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an update form ..." 
{

	try {

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json iobject "data" / load_env (json doc "app") OBJ;

		sql connect "session1" {cm get "MENTDB";};
		-> "[remote_mentdb]" (sql value "session1" (concat "select remote_mentdb from projects where id=" (sql encode [current_remote_project_selected])));
		-> "[current_project_selected]" (sql value "session1" (concat "select remote_project_id from projects where id=" (sql encode [current_remote_project_selected])));
		sql disconnect "session1";

		json iobject "data" / current_project_selected [current_project_selected] STR;

		json load "return_obj" (tunnel execute_hot "session1" {cm get [remote_mentdb]} (concat 
			"include \"app.100.template.taskmanager.actions.demo.MENTDB.tasks.update_open_form2.exe\"
				\"[OBJ_OVERWRITE_B64]\" " (mql encode (string encode_b64 (json doc data))) "
			;"
		));

		include "app.100.obj.sajax.refresh.exe"
			"[target]" ""
			"[innerHtml]" (json select "return_obj" "/obj")
		;

		include "app.100.obj.sajax.javascript.exe"
			"[javascript]" (concat "object_onload" (json select "return_obj" "/id") "();")
		;

	} {
	
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
		#Close all objects;
		try {tunnel disconnect "session1";} {} "[e]";

	} "[err]";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.masks.update" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Update an element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		-> "[result]" (sql dml "session1" (concat 
			"UPDATE `masks` SET `order`=`order`-1 WHERE `groupname`=" (sql encode (json select "data" "/client_data/groupname")) "
				and `order`>" (sql encode (sql value "session1" (concat "select `order` from masks where id=" (json select "data" "/client_data/id")))) ";"
		));
		
		-> "[result]" (sql dml "session1" (concat 
			"UPDATE `masks` SET `order`=`order`+1 WHERE `groupname`=" (sql encode (json select "data" "/client_data/groupname")) "
				and `order`>=" (sql encode (json select "data" "/client_data/order")) ";"
		));
		
		-> "[result]" (sql dml "session1" (concat 
			"UPDATE `masks` SET 
			`groupname`=" (sql encode (json select "data" "/client_data/groupname")) ", 
			`key`=" (sql encode (json select "data" "/client_data/key")) ", 
			`order`=" (sql encode (json select "data" "/client_data/order")) "
			WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
			;"
		));
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.update_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.users.delete" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Delete elements ..." 
{

	json load "client_data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {

		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};
	
		json parse_array "client_data" "/client_data" "[o]" {
		
			json load "data" [o];
	
			-> "[result]" (sql dml "session1" (concat 
				"DELETE FROM `users` 
				WHERE `login`= " (sql encode (json select "data" "/client_data/login")) " 
				;"
			));
		
		};
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "delete_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"page\":\"1\"}")
		;

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;

	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.clients.skeleton" false 1 
  (param
  ;) 
  "SCRUD skeleton ..." 
{

	include "app.100.obj.sajax.skeleton.onload.exe"
		"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.onload.exe"
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
	;
	
} "Return the page";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.users.search" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json load "filter_sql" "{\"filter_sql\":{}}";

		

		if (not (is null or empty (json select "data" "/client_data/login"))) {
			json iobject "filter_sql" "/filter_sql" "login" (json select "data" "/client_data/login") STR;
			json iobject "filter_sql" "/filter_sql" "type:login" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};
		
		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "filter_sql"))
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {
		
		#Connect to the database;
		sql connect "session1" {cm get "MENTDB";};
		json load "row" (sql row "session1" (concat "select 
			`id`, 
			`title`, 
			`description`, 
			`state`, 
			`project_id`, 
			`login_from`, 
			`login_to`, 
			percent, 
			`dtcreate` from `tasks` where `id`= " (sql encode (json select "data" "/client_data/id")) " "));

		-> "[result]" (sql dml "session1" (concat 
			"INSERT IGNORE INTO `already_read` (id_task, login) values (" (sql encode (json select "data" "/client_data/id")) ", " (sql encode (json select "app" /user)) ");"
		));
		
		sql dml "session1" (concat "update tasks set last_update=current_timestamp() where id =" (json select "data" "/client_data/id"));
		
		#Disconnection ...;
		sql disconnect "session1";

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		exception (1) ([err]);
		
	} "[err]";

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "tasks_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "task_update")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "80%;max-width:80%;"
				"[html]" "style='font-size:14px;'";
			
		# id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]"(json select "row" "/id")
			;
		
		# title -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "title" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "title") "[description]" "" "[maxlength]" "1024" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/title")
			;
		
		# project_id -------- TO DELETE ...;
			
			sql connect "info_user" {cm get "MENTDB";};
			-> "[filtre_client_droit]" (sql value "info_user" (concat "select group_concat(user_clients.id) from user_clients, clients where clients.id=user_clients.id and is_closed='N' and login=" (sql encode (json select "app" /user))));
			-> "[filtre_projet_droit]" (sql value "info_user" (concat "select group_concat(user_projects.id) from user_projects, projects where projects.id=user_projects.id and is_closed='N' and login=" (sql encode (json select "app" /user))));
			sql disconnect "info_user";
			if (is null or empty [filtre_client_droit]) {
				-> "[filtre_client_droit]" (concat "and clients.id in (-1) ");
			} {
				-> "[filtre_client_droit]" (concat "and clients.id in (" [filtre_client_droit] ") ");
			};
			if (is null or empty [filtre_projet_droit]) {
				-> "[filtre_projet_droit]" (concat "and projects.id in (-1) ");
			} {
				-> "[filtre_projet_droit]" (concat "and projects.id in (" [filtre_projet_droit] ") ");
			};

			sql connect "session_data" {cm get "MENTDB";};
			json load "inValues" "[]";
			json load "optionValues" "[]";
			sql parse "session_data" "D" (concat "select projects.id, projects.name, clients.name as client from projects, clients WHERE projects.client_id=clients.id and (remote_mentdb is null or remote_mentdb='') " [filtre_client_droit] [filtre_projet_droit] " order by clients.name, projects.name") {
			
				json iarray "inValues" / [D_id] STR;
				json iarray "optionValues" / (concat [D_client] " / " [D_name]) STR;
			
			};
			sql disconnect "session_data";
		
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "project_id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "project") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "inValues")
				"[optionValues]" (json doc "optionValues")
				"[value]" (json select "row" "/project_id")
			;

			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "source" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "source" "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" true "[required]" false "[disabled]" true "[html]" ""
				"[value]" (json select "row" "/login_from")
			;

			if (equal (json select "app" /user) "system") {

				sql connect "session_data" {cm get "MENTDB";};
				json load "inValues" "[]";
				json load "optionValues" "[]";
				json iarray "inValues" / "" STR;
				json iarray "optionValues" / "" STR;
				sql parse "session_data" "D" (concat "select login from users where activate='Y' order by login") {
				
					json iarray "inValues" / [D_login] STR;
					json iarray "optionValues" / [D_login] STR;
				
				};
				sql disconnect "session_data";
			
				include "app.100.obj.form.control.select_mono.exe" "[control_id]" "login_to" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
					"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "destination") "[description]" ""
					"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
					"[inValues]" (json doc "inValues")
					"[optionValues]" (json doc "optionValues")
					"[value]" (json select "row" "/login_to")
				;
				
			} {

				if (equal (json select "row" "/login_from") (json select "app" "/user")) {

					sql connect "info_user" {cm get "MENTDB";};
					-> "[filtre_projet_droit]" (sql value "info_user" (concat "select group_concat(user_projects.id) from user_projects, projects where projects.id=user_projects.id and is_closed='N' and login=" (sql encode (json select "app" /user))));
					sql disconnect "info_user";
					if (is null or empty [filtre_projet_droit]) {
						-> "[filtre_projet_droit]" (concat "WHERE projects.id in (-1) ");
					} {
						-> "[filtre_projet_droit]" (concat "WHERE projects.id in (" [filtre_projet_droit] ") ");
					};
	
				
	
					sql connect "session_data" {cm get "MENTDB";};
	
					-> "[user_list_to]" (sql value "session_data" (concat "select group_concat(quote(user_users.login_grant)) from user_users, users where users.login=user_users.login and activate='Y' and user_users.login=" (sql encode (json select "app" /user))));
					if (is null or empty [user_list_to]) {
						-> "[user_list_to]" (concat "and login in ('') ");
					} {
						-> "[user_list_to]" (concat "and login in (" [user_list_to] ") ");
					};
					
					json load "inValues" "[]";
					json load "optionValues" "[]";
					json iarray "inValues" / "" STR;
					json iarray "optionValues" / "" STR;
					sql parse "session_data" "D" (concat "select login from users where activate='Y' " [user_list_to] " order by login") {
					
						json iarray "inValues" / [D_login] STR;
						json iarray "optionValues" / [D_login] STR;
					
					};
					sql disconnect "session_data";
				
					include "app.100.obj.form.control.select_mono.exe" "[control_id]" "login_to" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
						"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "destination") "[description]" ""
						"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
						"[inValues]" (json doc "inValues")
						"[optionValues]" (json doc "optionValues")
						"[value]" (json select "row" "/login_to")
					;

				} {

					include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "login_to" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
						"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "destination") "[description]" "" "[maxlength]" "" "[placeholder]" ""
						"[readonly]" true "[required]" false "[disabled]" false "[html]" ""
						"[value]" (json select "row" "/login_to")
					;

				};

			};
		
			
		
		# state -------- TO DELETE ...;
			
			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "state" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "" "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[0, 1, 2, 3, 4, 5]"
				"[optionValues]" (concat "[\"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_to_do") "\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_current") "\", \"Important\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_rdv") "\", \"Pause\", \"" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "t_completed") "\"]")
				"[value]" (json select "row" "/state")
			;
		
		# description -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.range.exe" "[control_id]" "percent" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "percent") "[description]" ""
				"[min]" 0 "[max]" 100 "[step]" 1 "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/percent")
			;
			
			include "app.100.obj.form.control.textarea.exe" "[control_id]" "commentaire" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "comment") "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" "style='height:150px'"
				"[value]" ""
			;

			sql connect "session_show_comment" {cm get "MENTDB";};
			sql parse "session_show_comment" "S" (concat "select dtcreate, comment from comments where task_id=" (json select "data" "/client_data/id") " order by dtcreate desc") {
			
				concat_var "[object]" "<div style='border:1px #333 solid;margin-bottom: 10px;padding: 4px;'>" (date format (string substr [S_dtcreate] 0 19) "yyyy-MM-dd HH:mm:ss" "dd/MM/yyyy HH:mm") ": " (string replace (string replace [S_comment] (concat [_r_] [_n_]) [_n_]) [_n_] "<br>") "</div>";
			
			};
			sql disconnect "session_show_comment";
			
			include "app.100.obj.form.control.textarea.exe" "[control_id]" "description" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "description" "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" "style='height:250px'"
				"[value]" (json select "row" "/description")
			;

			include "app.100.obj.form.control.textbox.file.exe" "[control_id]" "fichier_a_uploader" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "Fichier à uploader" "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" ""
			;

			if (file exist (concat "web/https/taskmanager/attachements/" (json select "row" "/id"))) {

				json load "task_attachements" (file dir_list (concat "web/https/taskmanager/attachements/" (json select "row" "/id")));

				json parse_array "task_attachements" "/" "[filename_tmp]" {

					json load "att" "{}";
					json iobject "att" / id_task (json select "row" "/id") "STR";
					json iobject "att" / filename [filename_tmp] "STR";
					concat_var "[object]" "<div style='line-height: 36px;border:1px #333 solid;margin-bottom: 10px;padding: 4px;'><span style='float:right'><button type='button' class='btn btn-danger btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.delete_attachement.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "att")) "[getElementById]" "" "[data]" "") "><span class='fa fa-remove fa-sm' aria-hidden='true'></span></button></span>   <a target='_blank' href='attachements/" (json select "row" "/id") "/" (string replace [filename_tmp] "'" "'") "'>" [filename_tmp] "</a></div>";
				
				};


			};

			
			
		
		include "app.100.obj.form.end.exe" "[form_id]" "tasks_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update.exe"
		"[data_eval]" "@@@$('#tasks_update_form_id').serializeObject_file_upload(scriptname, OBJ_OVERWRITE_B64)"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update")
		"[submitType]" "warning";

		

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list0.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.masks.insert_reopen_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Reopen an insert form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "masks_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "mask_add_c")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "id" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "id" "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/id")
			;
		
		# groupname -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "groupname" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "group") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/groupname")
			;
		
		# key -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "key" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "key") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/key")
			;
		
		# order -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "order" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "order") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/order")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "masks_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.taskmanager.actions.demo.MENTDB.masks.insert.exe"
		"[data_eval]" "$('#masks_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "close")
		"[submitTitle]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "add")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.clients.search" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json load "filter_sql" "{\"filter_sql\":{}}";

		

		if (not (is null or empty (json select "data" "/client_data/name"))) {
			json iobject "filter_sql" "/filter_sql" "name" (json select "data" "/client_data/name") STR;
			json iobject "filter_sql" "/filter_sql" "type:name" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		if (not (is null or empty (json select "data" "/client_data/contact_name"))) {
			json iobject "filter_sql" "/filter_sql" "contact_name" (json select "data" "/client_data/contact_name") STR;
			json iobject "filter_sql" "/filter_sql" "type:contact_name" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		if (not (is null or empty (json select "data" "/client_data/contact_email"))) {
			json iobject "filter_sql" "/filter_sql" "contact_email" (json select "data" "/client_data/contact_email") STR;
			json iobject "filter_sql" "/filter_sql" "type:contact_email" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		if (not (is null or empty (json select "data" "/client_data/contact_tel"))) {
			json iobject "filter_sql" "/filter_sql" "contact_tel" (json select "data" "/client_data/contact_tel") STR;
			json iobject "filter_sql" "/filter_sql" "type:contact_tel" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};
		
		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.clients.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "filter_sql"))
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.users.list" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Get data from a database into a list ..." 
{
	
	#Load the current object id and his configuration;
	-> "[OBJECT_ID]" "MENTDB_users_list";
	include "app.100.scrud.overwrite_config.exe"
		"[OBJ_PARAM_LIST]" "container_id,page,nb_by_page,nb_lr_pagination,order_by,filter_sql"
	;
	
	if (equal [nb_by_page] "*") {-> "[nb_by_page]" 999999999};
	if (is empty [order_by]) {
		-> "[asc_desc]" "ASC|";
		-> "[cur_asc_desc]" "";
		-> "[cur_order_by]" "";
	} {
		-> "[cur_asc_desc]" (atom get [order_by] 1 "|");
		-> "[cur_order_by]" (atom get [order_by] 2 "|");
		if (string starts_with [order_by] "ASC|") {
			-> "[asc_desc]" "DESC|";
		} {
			-> "[asc_desc]" "";
		};
	};

	#Initialization;
	-> "[object]" "<div style='border: 1px solid rgba(0,0,0,.12);-webkit-border-radius: 3px;
		-moz-border-radius: 3px;border-radius: 3px;
		margin-top: 2px;margin-bottom: 2px;padding:5px;background-color:#fff;color:#313131'>";

	concat_var "[object]" "<span style='float:right'><button type='button' class='btn btn-danger btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.delete_confirm.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "get_all_checked('users_keys_checkbox')") "><span class='fa fa-remove fa-sm' aria-hidden='true'></span></button></span>";
	concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-success btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.insert_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-plus fa-sm' aria-hidden='true'></span></button></span>";
	concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.search_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-search fa-sm' aria-hidden='true'></span></button></span>";

	concat_var "[object]" "
	<span style='font-size:16px'><b>  " (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "Users") "</b></span>
	
	<div style='height:10px;'></div>
	
	<table class='table table-striped table-hover table-bordered' style='margin-bottom: 0px;'>
  <thead>
    <tr>";
	
	#Connect to the database;
	sql connect "session1" {cm get "MENTDB";};

	try {

		#concat the row title counter;
		concat_var "[object]" "
      <th style='width:44px;padding: 0px 0px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' id='users_main_checkbox' onchange='check_all(\"users_keys_checkbox\", this);'></div></th>
      <th style='padding: 0px;' scope='col'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "login") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "login")}} {(concat "ASC|" "login")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>login" (if (equal [cur_order_by] "login") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
      <th style='padding: 0px;width:20px;' scope='col'></th>
	</tr>
  </thead>
  <tbody>";
		
		-> "[sql_filter]" "";
		-> "[sql_filter_keys]" "";
		if (not (is null or empty [filter_sql])) {
			json load "filter_sql" [filter_sql];
			json parse_obj "filter_sql" "/" "[key]" "[val]" {

				if (not (string starts_with [key] "type:")) {
					switch (json select "filter_sql" (concat "/type:" [key]))
						("EQUAL") {concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
						("LIKE_L") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "'";}
						("LIKE_R") {concat_var "[sql_filter]" " and `" [key] "` like '" (string sublrchar (sql encode [val]) 1) "%'";}
						("LIKE_LR") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "%'";}
						{concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
					;
					concat_var "[sql_filter_keys]" "<span class='badge badge-light'>" [key] "</span> ";
				};
			
			};
	
			if (> (json count "filter_sql" "/") 0) {
				-> "[sql_filter]" (concat " WHERE " (string substring [sql_filter] 5));
				-> "[sql_filter_keys]" (concat "<h5 style='margin-top: 1px;margin-bottom:0px'><button type='button' style='margin-left: 10px;' class='btn btn-outline-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"filter_sql\":{}}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-remove fa-xs' aria-hidden='true'></span> " (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "filter") "(s)</button></h5>");
			};
		};

		-> "[iline]" (+ 1 (- (* [page] [nb_by_page]) [nb_by_page]));
		-> "[nb_elements]" (sql value "session1" (concat "select count(*) from `users` " [sql_filter] ";"));
		-> "[nb_page]" (math ceil (/ [nb_elements] [nb_by_page]));
		if (is empty [cur_order_by]) {
			-> "[sql_order_by]" "order by activate desc, login";
		} {
			-> "[sql_order_by]" (concat "order by `" [cur_order_by] "` " [cur_asc_desc]);
		};

		sql parse "session1" "T" (concat "select 
			`login`, 
			`activate` from `users` " [sql_filter] " " [sql_order_by] " limit " (- (* [page] [nb_by_page]) [nb_by_page]) ", " [nb_by_page] ";") {
			
			json load "primary_key" "{}";
			json iobject "primary_key" / "client_data" "{}" OBJ;
			json iobject "primary_key" "/client_data" "login" [T_login] STR;
			
      		
			concat_var "[object]" "
      <tr><th style='width:44px;padding: 0px 2px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' name='users_keys_checkbox' value='" (string encode_b64 (json doc "primary_key")) "'></div></th>
      <td style='padding: 6px 2px 0px 2px;'>" (string replace [T_login] "<" "<") " " (if (equal [T_activate] "N") {concat "[désactivé]"}) "</td>";

			concat_var "[object]" "<td style='padding: 0px 2px 0px 2px;'><button type='button' class='btn btn-warning btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.update_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") "><span class='fa fa-pencil fa-sm' aria-hidden='true'></span></button></td>";
			concat_var "[object]" "</tr>";

      		++ "[iline]";
		
		};
    
		concat_var "[object]" "
	</tbody>
</table>

";

	concat_var "[object]" "<nav aria-label='Page navigation' style='display:inline-block'>
  <ul class='pagination' style='margin-bottom:0px'>
    <li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" 1 "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Previous'>
        <span aria-hidden='true'>«</span>
        <span class='sr-only'>Previous</span>
      </a>
    </li>";

	for (-> "[i_page]" (- [page] [nb_lr_pagination])) (< [i_page] [page]) (++ "[i_page]") {

		if (> [i_page] 0) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};

	for (-> "[i_page]" [page]) (<= [i_page] (+ [page] [nb_lr_pagination])) (++ "[i_page]") {

		if (<= [i_page] [nb_page]) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};
    
    concat_var "[object]" "<li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [nb_page] "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>
        <span aria-hidden='true'>»</span>
        <span class='sr-only'>Next</span>
      </a>
    </li>
  </ul>
</nav>  " [nb_elements] "
  <div style='float: right;display: inline-block;'><select id='app.100.template.taskmanager.actions.demo.MENTDB.users.list.key.nb_by_page' style='height: 33px;color: #007bff;' class='form-control' onChange=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.users.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"order_by\":\"\", \"page\":\"1\"}") "[getElementById]" "nb_by_page=app.100.template.taskmanager.actions.demo.MENTDB.users.list.key.nb_by_page" "[data]" "") ">
      <option " (if (== [nb_by_page] 1) {"selected"}) ">1</option>
      <option " (if (== [nb_by_page] 2) {"selected"}) ">2</option>
      <option " (if (== [nb_by_page] 3) {"selected"}) ">3</option>
      <option " (if (== [nb_by_page] 4) {"selected"}) ">4</option>
      <option " (if (== [nb_by_page] 5) {"selected"}) ">5</option>
      <option " (if (== [nb_by_page] 10) {"selected"}) ">10</option>
      <option " (if (== [nb_by_page] 13) {"selected"}) ">13</option>
      <option " (if (== [nb_by_page] 25) {"selected"}) ">25</option>
      <option " (if (== [nb_by_page] 50) {"selected"}) ">50</option>
      <option " (if (== [nb_by_page] 100) {"selected"}) ">100</option>
      <option " (if (== [nb_by_page] 250) {"selected"}) ">250</option>
      <option " (if (== [nb_by_page] 500) {"selected"}) ">500</option>
      <option " (if (== [nb_by_page] 1000) {"selected"}) ">1000</option>
      <option " (if (== [nb_by_page] 2500) {"selected"}) ">2500</option>
      <option " (if (== [nb_by_page] 5000) {"selected"}) ">5000</option>
      <option " (if (== [nb_by_page] 999999999) {"selected"}) ">*</option>
    </select></div><div style='float: right;display: inline-block;line-height: 32px;margin-right: 20px;'>" [sql_filter_keys] "</div>

</div>";

		sql disconnect "session1";

		include "app.100.obj.sajax.refresh.exe"
			"[target]" [container_id]
			"[innerHtml]" [object]
		;

	} {

		#Save the error;
		log trace [err]; 
		
		#Close all objects;
		try {sql disconnect "session1";} {} "[e]";

		exception (1) (concat "ERR/APP/LIST: " [err]);

	} "[err]";
	
} "Return the list";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert1" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json iobject "data" / load_env (json doc "app") OBJ;

		sql connect "session1" {cm get "MENTDB";};
		-> "[remote_mentdb]" (sql value "session1" (concat "select remote_mentdb from projects where id=" (sql encode [current_remote_project_selected])));
		-> "[current_project_selected]" (sql value "session1" (concat "select remote_project_id from projects where id=" (sql encode [current_remote_project_selected])));
		sql disconnect "session1";

		json iobject "data" / current_project_selected [current_project_selected] STR;

		tunnel execute_hot "session1" {cm get [remote_mentdb]} (concat 
			"include \"app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert2.exe\"
				\"[OBJ_OVERWRITE_B64]\" " (mql encode (string encode_b64 (json doc data))) "
			;"
		);

		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "insert_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list1.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;

	} {
	
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
		#Close all objects;
		try {tunnel disconnect "session1";} {} "[e]";

	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.update1" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Update an element ..." 
{

	try {

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json iobject "data" / load_env (json doc "app") OBJ;

		sql connect "session1" {cm get "MENTDB";};
		-> "[remote_mentdb]" (sql value "session1" (concat "select remote_mentdb from projects where id=" (sql encode [current_remote_project_selected])));
		-> "[current_project_selected]" (sql value "session1" (concat "select remote_project_id from projects where id=" (sql encode [current_remote_project_selected])));
		sql disconnect "session1";

		json iobject "data" / current_project_selected [current_project_selected] STR;

		tunnel execute_hot "session1" {cm get [remote_mentdb]} (concat 
			"include \"app.100.template.taskmanager.actions.demo.MENTDB.tasks.update2.exe\"
				\"[OBJ_OVERWRITE_B64]\" " (mql encode (string encode_b64 (json doc data))) "
			;"
		);

		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "update_ok")
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list1.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;

	} {
	
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" (include "app.100.template.taskmanager.lang.exe" "[key_lang]" "error")
			"[msg]" [err]
		;
		
		#Close all objects;
		try {tunnel disconnect "session1";} {} "[e]";

	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.taskmanager.actions.demo.MENTDB.tasks.list2" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Get data from a database into a list ..." 
{

	try {
		
		if (not(env exist var "[current_project_selected]")) {
	
			-> "[current_project_selected]" "";
	
		};

		-> "[check_right]" 0;

		if (not (json exist "app")) {

			json load "tmp" (string decode_b64 [OBJ_OVERWRITE_B64]);
			json load "app" (json select "tmp" "/load_env");

			-> "[app_object_id]" 0;
			-> "[app_object_id_no_load]" 0;

			if (not (parameter exist "TASKMANAGER_JSON_GRANTS")) {

				exception (1) ("Sorry, the parameter 'TASKMANAGER_JSON_GRANTS' does not exist (exemple {\"login\": [0, 1, 2, 3]}).");

			};

			json load "grants" (parameter get value "TASKMANAGER_JSON_GRANTS");

			if (is null (json select "grants" (concat "/" (json select "app" /user)))) {

				exception (1) (concat "Sorry, the user " (json select "app" /user) " is not granted in the parameter 'TASKMANAGER_JSON_GRANTS' (exemple {\"login\": [0, 1, 2, 3]}).");

			};

			-> "[check_right]" 1;

		};
	
		#Load the current object id and his configuration;
		-> "[OBJECT_ID]" "jimdb_tasks_list0";
		include "app.100.scrud.overwrite_config.exe"
			"[OBJ_PARAM_LIST]" "container_id,page,nb_by_page,nb_lr_pagination,order_by,filter_sql,current_task_selected,current_project_selected"
		;

		if ([check_right]) {

			-> "[grant_ok]" 0;
			json parse_array "grants" (concat "/" (json select "app" /user)) "[ip]" {
			
				if (== [ip] [current_project_selected]) {

					-> "[grant_ok]" 1;

				};
			
			};

			if (not [grant_ok]) {

				exception (1) (concat "Sorry, the project id " [current_project_selected] " is not granted to the user " (json select "app" /user) " in the parameter 'TASKMANAGER_JSON_GRANTS' (exemple {\"login\": [0, 1, 2, 3]}).");

			}
			
		};
		
		if (is null or empty [current_task_selected]) {
	
			-> "[current_task_selected]" -1;
	
		};
	
		if (is null or empty [current_project_selected]) {
	
			-> "[current_project_selected]" "";
	
		};
	
		if (equal [nb_by_page] "*") {-> "[nb_by_page]" 999999999};
		if (is empty [order_by]) {
			-> "[asc_desc]" "ASC|";
			-> "[cur_asc_desc]" "";
			-> "[cur_order_by]" "";
		} {
			-> "[cur_asc_desc]" (atom get [order_by] 1 "|");
			-> "[cur_order_by]" (atom get [order_by] 2 "|");
			if (string starts_with [order_by] "ASC|") {
				-> "[asc_desc]" "DESC|";
			} {
				-> "[asc_desc]" "";
			};
		};
	
		#Initialization;
		-> "[object]" "<div style='border: 1px solid rgba(0,0,0,.12);-webkit-border-radius: 3px;
			-moz-border-radius: 3px;border-radius: 3px;
			margin-top: 2px;margin-bottom: 2px;padding:5px;background-color:#fff;color:#313131'>";
		
		concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-success btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.insert_open_form1.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-plus fa-sm' aria-hidden='true'></span></button></span>";
		concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.taskmanager.actions.demo.MENTDB.tasks.search_open_form1.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-search fa-sm' aria-hidden='true'></span></button></span>";
		
		#Connect to the database;
		sql connect "session1" {cm get "MENTDB";};
	
		-> "[filter_project]" "";
		-> "[project_name_current]" "";
		if (not (is null or empty [current_project_selected])) {
			concat_var "[filter_project]" " and project_id=" [current_project_selected];
			-> "[project_name_current]" (sql value "session1" (concat "select name from projects where id=" [current_project_selected]));
		};
	
		sql connect "info_user" {cm get "MENTDB";};
		-> "[filtre_client_droit]" (sql value "info_user" (concat "select group_concat(user_clients.id) from user_clients, clients where clients.id=user_clients.id and is_closed='N' and login=" (sql encode (json select "app" /user))));
		-> "[filtre_projet_droit]" (sql value "info_user" (concat "select group_concat(user_projects.id) from user_projects, projects where projects.id=user_projects.id and is_closed='N' and login=" (sql encode (json select</