Class: FieldList

Inherits:
MyRendererList show all
Defined in:
lib/FormHolder/Form/InputHolder/FieldList.rb

Overview

this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint([email protected])

Constant Summary

Constants included from ManqodCommon

ManqodCommon::CRITICAL, ManqodCommon::DEBUG, ManqodCommon::ERROR, ManqodCommon::INFO, ManqodCommon::NORMAL, ManqodCommon::WARNING

Constants included from Eprint

Eprint::DOMAIN, Eprint::LEVEL

Instance Attribute Summary collapse

Attributes inherited from MyRendererList

#form, #list, #model, #scroller

Instance Method Summary collapse

Methods inherited from MyRendererList

#parentM, #parentselected, #qrow, #query, #set_label, #set_model, #set_selected, #set_sensitive, #target, #text, #update

Methods included from ManqodCommon

#add_where, #admin, #admin_cache, #admin_qrow, #admin_rows, #backtrace_to_debug, #cache, #changed_ids_of_base, #client, #client_fields, #client_image_of_id, #client_qrow, #client_query, #client_rows, #eeval, #escape_string, #getBinding, #guess_base, #guess_table, #image_of_id, #lzero, #manqod_db, #measure, #myexec, #nick, #nick_id, #number_format, #qrow, #query, #reconnect_manqod_db, #rows, #run_events, #send_message, #sendmail, #set_manqod_db_uri, #set_nick

Methods included from Eprint

#ecode, #edebug, #eerror, #einfo, #enormal, #eprint, #ewarn, #gtk_set_edebug, #set_edebug, #tell_exception

Constructor Details

#initialize(pc) ⇒ FieldList

Returns a new instance of FieldList.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/FormHolder/Form/InputHolder/FieldList.rb', line 6

def initialize(pc)
	@pc=pc
	item['field']=true
	item['type_def']="[name:text:Field][type:text:Type]"
	item['querysql']=""
#		item['querysql']="select cdata,cdisplay,description from scv where combo='#{item['data']}' order by cdisplay"
	#parentM should be an admin Form
	#parentM.parentM should be an EditableList of Formsitems or Listheaders or Forms(in wysiwyg FormEditor)
	if ppid=pc.parentM.parentM.parentselected
		if attr_row=parentM.qrow("select data from gtkattributes where gtkobjectid='#{ppid}' and gtkobjecttype='form' and `attribute`='table'") and table=attr_row["data"]
			item['querysql']="select * from `#{table}` limit 1"
			else
			if row=parentM.qrow("select moditems.querysql,queries.sql from moditems left join queries on queries.id = moditems.query_sql_id where moditems.id='#{ppid}'")
				querysql=row['sql'] if !row["sql"].nil? and row["sql"].length>5
				querysql=row['querysql'] if row["querysql"].length>5
				item['querysql']="#{querysql} limit 1"
			end
		end
	end
	super(pc)
end

Instance Attribute Details

#pcObject

Returns the value of attribute pc.



27
28
29
# File 'lib/FormHolder/Form/InputHolder/FieldList.rb', line 27

def pc
  @pc
end

Instance Method Details

#inspectObject



32
33
34
# File 'lib/FormHolder/Form/InputHolder/FieldList.rb', line 32

def inspect
	"FieldList #{item["description"]}"
end

#itemObject



29
30
31
# File 'lib/FormHolder/Form/InputHolder/FieldList.rb', line 29

def item
	pc.item
end

#to_sObject



35
36
37
# File 'lib/FormHolder/Form/InputHolder/FieldList.rb', line 35

def to_s
	inspect
end