Minor DB updates
This commit is contained in:
parent
fe317b9cb0
commit
6f1d0d749c
@ -64,10 +64,10 @@ class Controller_Task_Host extends Controller_Task {
|
|||||||
|
|
||||||
// Limit to show only those by the requested category.
|
// Limit to show only those by the requested category.
|
||||||
if ($cats) {
|
if ($cats) {
|
||||||
if (! $so->product->avail_category_id OR ! preg_match('/^a:/',$so->product->avail_category_id))
|
if (! $so->product->avail_category OR ! preg_match('/^a:/',$so->product->avail_category))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$pc = unserialize($so->product->avail_category_id);
|
$pc = unserialize($so->product->avail_category);
|
||||||
|
|
||||||
if (! array_intersect($pc,array_keys($cats)))
|
if (! array_intersect($pc,array_keys($cats)))
|
||||||
continue;
|
continue;
|
||||||
|
@ -55,7 +55,7 @@ class Controller_Product extends Controller_TemplateDefault {
|
|||||||
$co = ORM::factory('product_category',$_GET['cid']);
|
$co = ORM::factory('product_category',$_GET['cid']);
|
||||||
|
|
||||||
// If the product category doesnt exist, or doesnt match the product
|
// If the product category doesnt exist, or doesnt match the product
|
||||||
if (! $co->loaded() OR ! in_array($co->id,unserialize($po->avail_category_id)))
|
if (! $co->loaded() OR ! in_array($co->id,unserialize($po->avail_category)))
|
||||||
Request::current()->redirect('product_category/index');
|
Request::current()->redirect('product_category/index');
|
||||||
|
|
||||||
Breadcrumb::name('product/view',$co->name);
|
Breadcrumb::name('product/view',$co->name);
|
||||||
|
@ -23,7 +23,6 @@ class Model_Product extends ORMOSB {
|
|||||||
|
|
||||||
protected $_sorting = array(
|
protected $_sorting = array(
|
||||||
'position'=>'asc',
|
'position'=>'asc',
|
||||||
'sku'=>'asc',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
protected $_display_filters = array(
|
protected $_display_filters = array(
|
||||||
@ -121,10 +120,16 @@ class Model_Product extends ORMOSB {
|
|||||||
public function show_thumb() {
|
public function show_thumb() {
|
||||||
$mediapath = Route::get('default/media');
|
$mediapath = Route::get('default/media');
|
||||||
|
|
||||||
$thumb = $mediapath->uri(array('file'=>'img/thumbnails/'.$this->thumbnail));
|
$thumbfile = sprintf('prod_thmb_%s',$this->id);
|
||||||
|
|
||||||
|
// @todo This needs to be optimised. By nice if find_files could return the HTML path too.
|
||||||
|
if (Kohana::find_file('media/img/thumbnails',$thumbfile,'png')) {
|
||||||
|
$thumb = $mediapath->uri(array('file'=>'img/thumbnails/'.$thumbfile.'.png'));
|
||||||
|
|
||||||
// @todo Change the ALT to the product name.
|
// @todo Change the ALT to the product name.
|
||||||
echo HTML::image($thumb,array('alt'=>_('Thumb Nail')));
|
echo HTML::image($thumb,array('alt'=>_('Thumb Nail')));
|
||||||
|
} else
|
||||||
|
echo '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -149,7 +154,7 @@ class Model_Product extends ORMOSB {
|
|||||||
$results = array();
|
$results = array();
|
||||||
|
|
||||||
foreach ($this->where('active','=',TRUE)->find_all() as $po) {
|
foreach ($this->where('active','=',TRUE)->find_all() as $po) {
|
||||||
if ($c = unserialize($po->avail_category_id) AND in_array($cat,$c))
|
if ($c = unserialize($po->avail_category) AND in_array($cat,$c))
|
||||||
array_push($results,$po);
|
array_push($results,$po);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,22 +28,22 @@ echo Form::open('cart/add');
|
|||||||
<table width="100%" border="0" cellpadding="4">
|
<table width="100%" border="0" cellpadding="4">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="body" rowspan="3"><?php echo $translate->description_full; ?></td>
|
<td class="body" rowspan="3"><?php echo $translate->description_full; ?></td>
|
||||||
<td style="text-align: right;"><?php if ($record->thumbnail) $record->show_thumb(); ?></td>
|
<td style="text-align: right;"><?php if ($a=$record->show_thumb()) echo $a; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<?php if ($record->prod_plugin && method_exists($record->prod_plugin_file,'product_view')) {
|
<?php if ($record->prod_plugin_file && method_exists($record->prod_plugin_file,'product_view')) {
|
||||||
$pio = new $record->prod_plugin_file;
|
$pio = new $record->prod_plugin_file;
|
||||||
echo '<td style="vertical-align: bottom;">'.$pio->product_view($record->prod_plugin_data).'</td>';
|
echo '<td style="vertical-align: bottom;">'.$pio->product_view($record->prod_plugin_data).'</td>';
|
||||||
} ?>
|
} ?>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<?php if ($record->prod_plugin && method_exists($record->prod_plugin_file,'contract_view')) {
|
<?php if ($record->prod_plugin_file && method_exists($record->prod_plugin_file,'contract_view')) {
|
||||||
$pio = new $record->prod_plugin_file;
|
$pio = new $record->prod_plugin_file;
|
||||||
echo '<td style="vertical-align: top;">'.$pio->contract_view($record->prod_plugin_data,$record->price_base,$record->price_setup).'</td>';
|
echo '<td style="vertical-align: top;">'.$pio->contract_view($record->prod_plugin_data,$record->price_base,$record->price_setup).'</td>';
|
||||||
} ?>
|
} ?>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<?php if ($record->prod_plugin && method_exists($record->prod_plugin_file,'feature_summary')) {
|
<?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
|
// @todo This doesnt work, it needs to be product_plugin_xx class
|
||||||
$pio = new $record->prod_plugin_file;
|
$pio = new $record->prod_plugin_file;
|
||||||
echo '<td style="vertical-align: top;">'.$pio->feature_summary().'</td>';
|
echo '<td style="vertical-align: top;">'.$pio->feature_summary().'</td>';
|
||||||
@ -53,11 +53,11 @@ echo Form::open('cart/add');
|
|||||||
<td class="spacer" colspan="2"> </td>
|
<td class="spacer" colspan="2"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="body" style="width: 50%;"><b>SKU</b></td>
|
<td class="body" style="width: 50%;"><b>Recurring Billing Schedule</b></td>
|
||||||
<td class="body" style="width: 50%;"><b>Currency</b></td>
|
<td class="body" style="width: 50%;"><b>Currency</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="body"><?php echo $record->sku;?></td>
|
<td class="body"><?php echo StaticList_RecurSchedule::form('recurr_schedule',$record);?> </td>
|
||||||
<!-- @todo The default currency should be system configurable and displayed by default -->
|
<!-- @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 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? -->
|
<!-- @todo Currency is not used in the cart? -->
|
||||||
@ -72,14 +72,6 @@ echo Form::open('cart/add');
|
|||||||
<td class="body"><?php echo StaticList_PriceType::display($record->price_type);?></td>
|
<td class="body"><?php echo StaticList_PriceType::display($record->price_type);?></td>
|
||||||
<td class="body"><?php echo StaticList_YesNo::display($record->taxable);?></td>
|
<td class="body"><?php echo StaticList_YesNo::display($record->taxable);?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td class="body"><b>Recurring Billing Schedule</b></td>
|
|
||||||
<td class="body"><b> </b></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="body"><?php echo StaticList_RecurSchedule::form('recurr_schedule',$record);?> </td>
|
|
||||||
<td class="body"><?php echo '';?></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -87,7 +79,7 @@ echo Form::open('cart/add');
|
|||||||
<td class="spacer" colspan="2"> </td>
|
<td class="spacer" colspan="2"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<?php if ($record->prod_plugin && method_exists($record->prod_plugin_file,'product_cart')) {
|
<?php if ($record->prod_plugin_file && method_exists($record->prod_plugin_file,'product_cart')) {
|
||||||
$pio = new $record->prod_plugin_file;
|
$pio = new $record->prod_plugin_file;
|
||||||
echo '<td style="vertical-align: top;">'.$pio->product_cart($record->prod_plugin_data).'</td>';
|
echo '<td style="vertical-align: top;">'.$pio->product_cart($record->prod_plugin_data).'</td>';
|
||||||
} ?>
|
} ?>
|
||||||
|
@ -134,10 +134,10 @@ class Model_Service extends ORMOSB {
|
|||||||
$cats = ORM::factory('product_category')->list_bylistgroup($cat);
|
$cats = ORM::factory('product_category')->list_bylistgroup($cat);
|
||||||
|
|
||||||
foreach ($this->list_active() as $so) {
|
foreach ($this->list_active() as $so) {
|
||||||
if (! $so->product->avail_category_id OR ! preg_match('/^a:/',$so->product->avail_category_id))
|
if (! $so->product->avail_category OR ! preg_match('/^a:/',$so->product->avail_category))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$pc = unserialize($so->product->avail_category_id);
|
$pc = unserialize($so->product->avail_category);
|
||||||
if (array_intersect($pc,array_keys($cats)))
|
if (array_intersect($pc,array_keys($cats)))
|
||||||
array_push($result,$so);
|
array_push($result,$so);
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Certificate</td>
|
<td>Certificate</td>
|
||||||
<td class="data"><pre><?php echo $so->display('cert'); ?></pre></td>
|
<td class="data"><pre><?php echo $so->cert; ?></pre></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
|
Reference in New Issue
Block a user