Multi enhancements, including auto serialization, product editing

This commit is contained in:
Deon George
2012-03-30 15:13:01 +11:00
parent d9c3394b0f
commit 6807b6ab52
30 changed files with 445 additions and 115 deletions

View File

@@ -0,0 +1,15 @@
<?php echo Form::hidden('product_translate[id]',$pto->id); ?>
<table>
<tr>
<td style="width: 40%;">Product Name</td>
<td style="width: 60%;" style="data"><?php echo Form::input('product_translate[name]',$pto->name); ?></td>
</tr>
<tr>
<td>Product Short Description</td>
<td style="data"><?php echo Form::input('product_translate[description_short]',$pto->description_short); ?></td>
</tr>
<tr>
<td>Product Long Description</td>
<td style="data"><?php echo Form::textarea('product_translate[description_full]',$pto->description_full); ?></td>
</tr>
</table>

View File

@@ -0,0 +1,63 @@
<!-- @todo NEEDS TO BE TRANSLATED -->
<?php echo Form::open(); ?>
<table width="100%">
<tr>
<td style="width: 50%; vertical-align: top;">
<table width="100%">
<tr>
<td style="width: 40%;">Product Active</td>
<td style="width: 5%;">&nbsp;</td>
<td style="width: 60%;" class="data"><?php echo StaticList_YesNo::form('active',$po->active); ?></td>
</tr>
<tr>
<td colspan="2">Base Price</td>
<td class="data"><?php echo Form::input('price_base',$po->price_base); ?></td>
</tr>
<tr>
<td colspan="2">Price</td>
<td class="data">
<table>
<tr>
<td colspan="2">&nbsp;</td>
<?php foreach (StaticList_RecurSchedule::keys() as $k) { ?>
<td class="head"><?php echo StaticList_RecurSchedule::display($k); ?></td>
<td><?php echo Form::checkbox("price_group[$k][show]",1,$po->isPriceShown($k)); ?>
<?php } ?>
</tr>
<?php foreach ($po->availPriceGroups() as $g) { ?>
<?php foreach ($po->availPriceOptions() as $o) { ?>
<tr>
<td><?php echo ORM::factory('group',$g)->name; ?></td>
<td><?php echo $o; ?></td>
<?php foreach (StaticList_RecurSchedule::keys() as $k) { ?>
<td colspan="2"><?php echo Form::input("price_group[$k][$g][$o]",$po->price($g,$k,$o),array('size'=>5)); ?></td>
<?php } ?>
</tr>
<?php } ?>
<?php } ?>
</table>
</td>
</tr>
<tr>
<td colspan="2">Default Period</td>
<td class="data"><?php echo StaticList_RecurSchedule::form('price_recurr_default',$po,$po->price_recurr_default); ?></td>
</tr>
<tr>
<td colspan="2">Order</td>
<td class="data"><?php echo Form::input('position',$po->position); ?></td>
</tr>
<tr>
<td>Product Descriptions</td>
<td><?php echo Form::select('language_id',array('','EN'=>'EN')); ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td class="data" colspan="2"><div id="translate"></div></td>
</tr>
</table>
<?php if ($plugin_form) { echo '<br/>'.$plugin_form; } ?>
</td>
</tr>
</table>
<?php echo Form::submit('submit',_('Update'),array('class'=>'form_button')); ?>
<?php echo Form::close(); ?>

View File

@@ -27,7 +27,7 @@ echo Form::open('cart/add');
<td style="background-color: #FFFFFF;">
<table width="100%" border="0" cellpadding="4">
<tr>
<td class="body" rowspan="3"><?php echo $translate->description_full; ?></td>
<td class="body" rowspan="4"><?php echo $translate->description_full; ?></td>
<td style="text-align: right;"><?php if ($a=$record->show_thumb()) echo $a; ?></td>
</tr>
<tr>
@@ -43,10 +43,8 @@ echo Form::open('cart/add');
} ?>
</tr>
<tr>
<?php if ($record->prod_plugin_file && method_exists($record->prod_plugin_file,'feature_summary')) {
// @todo This doesnt work, it needs to be product_plugin_xx class
$pio = new $record->prod_plugin_file;
echo '<td style="vertical-align: top;">'.$pio->feature_summary().'</td>';
<?php if ($record->prod_plugin_file && method_exists($record->plugin(),'feature_summary')) {
echo '<td style="vertical-align: top;">'.$record->plugin()->feature_summary().'</td>';
} ?>
</tr>
<tr>
@@ -57,7 +55,7 @@ echo Form::open('cart/add');
<td class="body" style="width: 50%;"><b>Currency</b></td>
</tr>
<tr>
<td class="body"><?php echo StaticList_RecurSchedule::form('recurr_schedule',$record);?> </td>
<td class="body"><?php echo StaticList_RecurSchedule::form('recurr_schedule',$record,$record->price_recurr_default);?> </td>
<!-- @todo The default currency should be system configurable and displayed by default -->
<!-- @todo If CURRENCY's value is not active in the DB, then the wrong flag is shown, as StaticList_Module::form() only returns active values -->
<!-- @todo Currency is not used in the cart? -->