Tweaks to layout and fields
Posted by mholmes on 10 Aug 2009 in Activity log
I''m working on some requests from JW regarding the order of fields in the documents table, and also the need for one new column. This is a record of my changes in the DEV copy of the project, so that when we're happy I can port those changes over to the LIVE copy:
- Edited local_classes.php to change the order of fields in the JwDocument object.
- Created a new table called docStatusVals, with one primary key (dsv_id) and one VARCHAR 64 (dsv_description). Added four items per JW's instructions, and one initial value indicating "not yet assigned". This will be a lookup table for the new field in the documents table.
- Ran this on the main documents table, to assign an initial value of 1 to this new field in all of the records:
UPDATE documents set doc_to_docStatusVals_id = "1" where 1=1
. This step is necessary before you can add the actual foreign key constraint; otherwise setting the constraint will fail. - Added a new line in the JwDocument constructor:
$this->addField(new MdhStrSelectField('doc_to_docStatusVals_id', 'Status', 0, 'docStatusVals', 'dsv_id', 'dsv_description', true));
- Added a new panel to the editing interface:
<div id="pnlDocStatusVals" class="tabPanel"> <?php getRecordList('docStatusVals', 4, 20); ?> </div>
- Added a new tab, to make the panel accessible:
<span id="tabDocStatusVals" onclick="showTab('DocStatusVals')">Document status values</span>
- Added a new class to the
local_classes.php
file:class JwDocStatusVal extends MdhRecord{ public function __construct(){ //Call the parent constructor. parent::__construct('docStatusVals', 'Document status values'); $this->addField(new MdhIntField('dsv_id', 'id', 0)); $this->addField(new MdhStrField('dsv_description', 'Status description', '', array(), 64)); } }
-
Added a new clause to the get_reclist.php file to handle the new table type:
case 'docStatusVals': $recList = new MdhRecordList('docStatusVals', 'JwDocStatusVal'); $recList->recsToDisplay = $recsToDisplay; $recList->colsToDisplay = $colsToDisplay; $recList->orderByField = 'dsv_id'; break;
- In
db_recordlist.php
, added a new option to see 500 files in the dropdown list (line 293:$recsToDisplayOpts = array(10,20,50,100,200,500);
).