From: <ken...@us...> - 2009-02-09 21:00:31
|
Revision: 1227 http://andro.svn.sourceforge.net/andro/?rev=1227&view=rev Author: kendowns Date: 2009-02-09 21:00:28 +0000 (Mon, 09 Feb 2009) Log Message: ----------- 1) Removed temporary hack limiting number of child tabs. 2) If 'table_id_par' and 'pre_*' vars are passed to a conventional screen, various FETCHES and defaults from the parent table are populated on new rows. Modified Paths: -------------- trunk/andro/lib/androX6.php Modified: trunk/andro/lib/androX6.php =================================================================== --- trunk/andro/lib/androX6.php 2009-02-06 17:16:03 UTC (rev 1226) +++ trunk/andro/lib/androX6.php 2009-02-09 21:00:28 UTC (rev 1227) @@ -828,6 +828,30 @@ # ******************************************************************* # =================================================================== function profile_conventional() { + # KFD 2/9/09, new feature for Jeff/wholdist. If "table_id_par" + # was passed in, load a certain row from the parent + # table into the bulletin board. Specifically this + # is so the table can act like a child table + # w/respect to loading FETCH and FETCHDEF values. + # Maybe we'll do more with it later. + $tid_par = gp('table_id_par',''); + if( $tid_par <> '' ) { + $ddpar = ddTable($tid_par); + $pks = explode(',',$ddpar['pks']); + $aWhere = array(); + foreach($pks as $pk) { + $type_id = $ddpar['flat'][$pk]['type_id']; + if( ($pkval=gp('pre_'.$pk))<>'') { + $aWhere[] = $pk .'='.SQL_Format($type_id,$pkval); + } + } + $sql = 'select * from '.ddView($tid_par).' where ' + .implode('AND',$aWhere); + $row = sql_oneRow($sql); + x6Script("x6bb.fwSet('dbRow_$tid_par',".json_encode($row).')'); + } + + # Grab the data dictionary for this table $dd = $this->dd; $table_id = $this->dd['table_id']; @@ -863,6 +887,9 @@ # Begin with title and tabs $top->h('h1',$dd['description']); + if(method_exists($this,'insert_belowh1')) { + $this->insert_belowh1($top); + } $options = array('x6profile'=>'conventional','x6table'=>$table_id); $tabs = $top->addTabs('tabs_'.$table_id,$hpane1,$options); $lookup = $tabs->addTab('Lookup'); @@ -897,7 +924,7 @@ # because otherwise the programmer would have selected # a different profile. # - $divDetail = $detail->addDetail($dd['table_id'],true,$hdetail); + $divDetail = $detail->addDetail($dd['table_id'],true,$hdetail,$tid_par); $divDetail->addCustomButtons($this->customButtons()); $divDetail->ap['xTabSelector'] = $tabs->ul->hp['id']; $divDetail->ap['xTabIndex'] = 1; @@ -922,10 +949,6 @@ # KFD 1/2/09. If x6display is 'none', skip it if(trim(arr($info,'x6display',''))=='none') continue; - # KFD 1/28/09, Hardcoded hack to limit entries. - # Will have to come out eventually. - if($idx++ > 6) continue; - $tc = $top->addTableController($child); $tc->hp['x6tablepar'] = $table_id; $tab = $tabKids->addTab($info['description']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |