Roadmap of openbiz 2.4

Here is a tentative plan for openbiz 2.4 roadmap.

1. New UI pattern

- Cover page flows between pages of List : Details : Edit : New

- Drop display modes. See http://www.phpopenbiz.org/jim/node/385 2. New path of UI code and metadata. 2.3 BizForm and metadata are not touched - old code can run on 2.4

- Move rendering logic out of Form class.

- Drop RenderFormattedTable method. Layout and form rendering logic will be in template files. See http://www.phpopenbiz.org/jim/node/384

- Support Smarty and PHP templates

- Assign each UI element as class. For example, there will be 18 classes including Button, InputText, ... to cover basic and advanced UI elements

The new Form metadata xml will be like

<EasyForm Name="FM_Event" Package="demo.form" Class="ListForm" jsClass="jbForm" Title="Sports Events" Description="Event BizForm" BizDataObj="BOEvent" PageSize="10">
        <DataPanel>
            <ELement Name="row_selections" Class="RowSelector" FieldName="Id" Label=""/>
            <ELement Name="_desc" Class="ColumnText" FieldName="Description" Label="Description"/>
            <ELement Name="_end" Class="ColumnText" FieldName="End" Label="End"/>
            <ELement Name="_start" Class="ColumnText" FieldName="Start" Label="Start"/>
            ...
        </DataPanel>
        <ActionPanel>
            <ELement Name="btn_dosearch" Class="Button" Image="" Caption="Search">
                <EventHandler Name="onclick" Event="onclick" Function="RunSearch()" ShortcutKey="Enter"/>
            </ELement>
            <ELement Name="btn_edit" Class="Button" Image="edit.gif" Caption="Edit">
                <EventHandler Name="onclick" Event="onclick" Function="EditRecord()" ShortcutKey="Ctrl+Shift+E" ContextMenu="Edit"/>
            </ELement>
            ...
        </ActionPanel>
        <NavPanel>
            <ELement Name="btn_next" Class="Button" Image="next.gif" Caption="Next">
                <EventHandler Name="onclick" Event="onclick" Function="NextPage()" ShortcutKey="Ctrl+Shift+Right"/>
            </ELement>
            <ELement Name="btn_prev" Class="Button" Image="prev.gif" Caption="Previous">
                <EventHandler Name="onclick" Event="onclick" Function="PrevPage()" ShortcutKey="Ctrl+Shift+Left"/>
            </ELement>
            ...
        </NavPanel>
    </EasyForm>

3. Dataobj will use Exception instead of error code

4. A new tool (command line or web) for generating new metadata for the new UI code

You are welcome to drop your comments. Thanks!

EDIT: This is a reply to

EDIT: This is a reply to Jim's post below. Sorry for the wrong posting.

Yes, the values returned from the DB are already the aggregated ones but I still have to edit on the Render methods to create the properties that would be passed on to the custom template.

I was thinking of something in the lines of having an XML propery, say, TotalOn or SumOn or CountOn for a semi-colon delimited list of fields. This would then result on having the LIST or READ form to display the appropriate result underneath the defined columns.

I have it working the way it is. I was just thinking of making it easier for other developers.

Could you post some sample

Could you post some sample code?

I think I get what you mean...

Column.....X.....Y
-------------------------
#1..............2......3
#2..............3......1
-------------------------
Total..........5......4

How to properly display the bottom line?

This thread may not be the

This thread may not be the place to post this but here's a sample of how I display column totals:

In the RenderHTML method of the BizForm class (extended per UI that requires it) I have added the following:

$smarty->assign_by_ref("PO_amount_total", $this->GetSum('table', 'field_to_sum'));
$smarty->assign_by_ref("PO_items", $this->GetCount('table'));
etc...

I then adapted from the file download method of the FMAttachment class to have the following methods added to the BizForm class (there may be an easier way):

public function GetSum($table, $field)
{
global $g_BizSystem;
$db = $g_BizSystem->GetDBConnection();

$tablename = $table;
$fieldname = $field;
$searchrule = str_replace('[', '', $this->m_SearchRule);
$searchrule = str_replace(']', '', $searchrule);
if ($searchrule) {
$sql = "SELECT sum($fieldname) FROM $tablename WHERE $searchrule";
}
else {
$sql = "SELECT sum($fieldname) FROM $tablename";
}

try {
$pdo_stmt = $db->query($sql);
}
catch (Exception $e) {
$errMsg = "Error in query: " . $sql . ". " . $e->getMessage();
echo $errMsg;
exit;
}

list($amount) = $pdo_stmt->fetch(PDO::FETCH_NUM);

unset($pdo_stmt);
unset($db);

$amount = number_format($amount,
$this->m_LocaleInfo['frac_digits'],
$this->m_LocaleInfo['decimal_point'],
$this->m_LocaleInfo['thousands_sep']);

return $amount;
}

The same goes for the GetCount method except, of course, changing the select from sum to count.

I then create a custom template for the LIST page and insert where appropriate the following:

< d i v c l a s s = "tablefooter">TOTAL: < b >{$PO_amount_total}< / b >< / d i v>

Hi Rocky, What do you think

Hi Rocky,

What do you think about releasing a newer version of 2.3 before we move on to 2.4?

I've noticed some users are getting confused between the old release from March 2008 and the latest SVN which is much more stable.

Also, can we update the Eclipse Plugin to cover the different features we've added since the late release.

2.4 would include all new

2.4 would include all new features for 2.3. So another 2.3 release might not be necessary.

BTW, thanks Jim for his previous post, the new modal and draggable window document can be found at http://www.phpopenbiz.org/jim/node/341

Well the problem we have now

Well the problem we have now is that the new visitors to the site download the old 2.3 release not realizing that the latest SVN is way more stable.

I think it would be helpful to publish the current SVN as a Release Candidate and leave it at that.

Also, it looks like the project is no longer active to folks on SourceForge because they see the last release was over a year ago.

Sure. Will do a 2.3 beta

Sure. Will do a 2.3 beta from the current SVN this week.

Jim, 2.3 needs to have new

Jim, 2.3 needs to have new release. So far besides the bug fixes, the main new features are Modal Window and DHTML tabs. Will you help to write the document for these 2? I can check the document and test it. If they pass test and no regression, then I will make a new 2.3 release. Thanks!

Please include methods and

Please include methods and properties for field totals so I don't have to extend the BizForm and create custom templates just to show these totals.

An example will be for Purchase Orders. You have an "Amount" BizCtrl (calculated from the unit price * quantity fields) on the child table. There should be an easier way to display the total amount.

Can't you use the database

Can't you use the database to address this? MySQL and I would suppose other databases could calculate this value instead of extending a BizForm.