atk4

reference field on form

痴心易碎 提交于 2020-01-02 13:17:28
问题 I think I'm not understanding the reference field. I have a simple form <?php class page_prueba extends Page { function init(){ parent::init(); $p=$this; $f=$p->add('Form'); $f->setSource('ticket'); $f->addField('line','texto')->validateNotNull(); $f->addField('text','detalle')->validateNotNull(); $c=$p->add('Model_Usuario'); $f->addField('reference','usuario')->setValueList($c)->validateNotNull(); } } And I have a User Model <?php class Model_Usuario extends Model_Table { public $entity_code

ATK4 What is the procedure for setting up an Admin Area?

不想你离开。 提交于 2019-12-30 11:12:29
问题 I have setup a CRUD area on my frontendAPI.php file (testing my models)... and I even managed to secure it. I would like to do this the proper way... I would like to establish a separate directory/ Page for the Admins. Please advise on this. 回答1: Still new at this but I'm trying to do the same for a news page, think i've got the login part working but having problems with the CRUD (will post a question on it shortly) - i have a table to populate with data from an rss feed (but will be

How to implement CRUD with many:many relationship

扶醉桌前 提交于 2019-12-24 23:10:07
问题 im new to atk4, but i couldn't find some simple examples for using CRUD with many:many relationships between tables. I read in some instructions that M:M is best implemented with intermediate table, wich seems logical.. For example Model ONE has: $this->hasMany('Table1Table2','table1_id'); Model TWO has: $this->hasMany('Table1Table2','table2_id'); And Intermediate Model (Table1Table2) has: $this->hasOne('Table1'); $this->hasOne('Table2'); Wich generates this table, wich is OK: create table

a bilingual application on Agile Toolkit ? with language selector for the user?

回眸只為那壹抹淺笑 提交于 2019-12-24 04:52:10
问题 I am planning on developing a bilingual PHP app with Agile Toolkit, with a language selector on every page ( French & English ) .. Can ATK4 accommodate this ? I am thinking yes .. but .. how would a newbie like me go about this with ATK4 ?? any cues would be greatly appreciated... I wish to create one single file ( some kind of database file that holds the translations) and access everything through variables for the various page views ( even the menu items ). Any assistance or cues on this

Setting mysql port number in agile toolkit

﹥>﹥吖頭↗ 提交于 2019-12-24 02:39:07
问题 How do I set a port number for mysql connection in Agile Toolkit? The mysql in my local machine is running in a different port 3307, how should be my connection configuration look like? I tried the following but it did not work, $config['dsn']='mysql://atk:password@localhost:3307/atk'; I am getting the following error when I try a db test, C:\xampp\htdocs\atk4.1.2\atk4\lib\DBlite/mysql.php:40 [2] mysql_pconnect() [function.mysql-pconnect]: [2002] No connection could be made because the target

Calculated field always returns 1 - atk 4.2

感情迁移 提交于 2019-12-23 03:52:30
问题 I have a model that has a calculated field. The value returned is always 1. After turning the debug on, 1 is hardcoded in the query: <?php class Model_Income extends Model_base_Income { function init(){ parent::init(); $this->debug(); $this->addField('year')->calculated(true); } function calculate_year(){ return '22'; } } Query returned by debug select `name` ,(select `name` from `client` where `income`.`client_id` = `client`.`id` ) `client`,`amount`,`date`,`comment`,1 `year`,`id` from

Implementing a search form that updates grid or lister

谁说胖子不能爱 提交于 2019-12-13 06:47:59
问题 I am trying to implement a search form which would show results gotten from the db when given (a) keyword(s), then updating a grid or lister with the search results. Only i'm a bit lost as to how to update the grid... I've looked at some similar questions (ie: How to refresh grid after update from modal form in atk4? ) but I can't seem to get the grid to update after submitting my form. code follows, any tips on what i'm doing wrong, or a better way to do this? later i'd like the search and

Agile Toolkit - OR statement in combination with Model

♀尐吖头ヾ 提交于 2019-12-13 05:12:47
问题 I have a Model from which I want to select all rows for which 'caller' or 'callee' is a given value for presentation in a Grid. I have tried lots of different avenues of accomplishing this and cannot get anywhere with it. I have a working filter on the Grid which narrows down the results by date (starting and ending dates), by status ("ANSWERED","NO_ANSWER"), I can also add conditions for 'caller' and 'callee', but how do I get it to show all rows where either 'caller' or 'callee' is a match

Using addQuickSearch() with Grid

不想你离开。 提交于 2019-12-13 04:24:33
问题 I was using without problem the method addQuickSearch() in older versions 4.03 and 4.b1 but now, when I use $g->addquickSearch(array('field1','field2')) the result in screen when I access the page is BaseException Trying to get value of not-existing field: q /var/www/soporte/atk4/lib/BaseException.php:42 Stack trace: /var/www/soporte/atk4/lib/BaseException.php :42 BaseException BaseException->collectBasicData(Null, 1, 0) /var/www/soporte/atk4/lib/Form/Basic.php :187 BaseException

How to use Filestore in API in Agiletoolkit?

时光毁灭记忆、已成空白 提交于 2019-12-13 02:25:52
问题 i am working on an urgent project which involves implmentation of filestore of Agiletoolkit i went through the doc here => http://agiletoolkit.org/doc/filestore $f=$p->add('Form'); $c=$p->add('Controller_Filestore_File'); $c->setActualFields(array('id','filestore_type_id','filestore_volume_id','filename','filesize')); $f->addField('upload','upload')->setController($c); $p->add('H4')->set('Previously Uploaded Files'); $g=$p->add('MVCGrid')->setController($c); $g->dq->limit(5)->order('id desc')