Skip to content

Commit

Permalink
Adds location_data field to form data tables to allow for segregating…
Browse files Browse the repository at this point in the history
… data by entry point (bi-directional to be used for event registration, etc...) Also minor tweaks to some ecommerce views, esp. in regards to bootstrap
  • Loading branch information
dleffler committed Apr 11, 2013
1 parent dadf341 commit ee33ce9
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 96 deletions.
4 changes: 2 additions & 2 deletions framework/core/models/expRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,6 @@ protected function getAttachableItems() {
if (!isset($this->id)) {
$this->$type = array();
} else {
$order = ($type == 'expFile' || $type == 'expDefinableField') ? ' ORDER BY rank ASC' : null;

$sql = 'SELECT ef.*, cef.subtype AS subtype FROM ';
$sql .= DB_TABLE_PREFIX . '_' . $tablename . ' ef JOIN ' . DB_TABLE_PREFIX . '_' . $content_table . ' cef ';
$sql .= "ON ef.id = cef." . $tablename . "_id";
Expand All @@ -842,6 +840,8 @@ protected function getAttachableItems() {
if ($type == 'expComment') {
$sql .= " AND approved='1'";
}

$order = ($type == 'expFile' || $type == 'expDefinableField') ? ' ORDER BY rank ASC' : null;
$sql .= $order;

$items = $db->selectArraysBySql($sql);
Expand Down
4 changes: 2 additions & 2 deletions framework/modules/ecommerce/assets/css/eventregistration.css
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ show view
}

#eventregform .label {
display : block;
display: inline;
/*display : block;*/
/*display: inline;*/
font-size : 114%;
font-weight : bold;
margin-bottom : 4px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{else}
<h1>{'New'|gettext} {$record->product_name}</h1>
{/if}
{ddrerank model="expDefinableField" items=$definablefields label="Input Fields"|gettext id="definable_field_registrant" sortfield="name"}
{ddrerank model="expDefinableField" items=$definablefields label="User Input Fields"|gettext id="definable_field_registrant" sortfield="name"}
{form action=update}
{control type="hidden" name="id" value=$record->id}
{control type="hidden" name="product_type" value=$record->product_type}
Expand All @@ -37,7 +37,7 @@
<li><a href="#tab4"><em>{'Options'|gettext}</em></a></li>
<li><a href="#tab5"><em>{'Images & Files'|gettext}</em></a></li>
<li><a href="#tab6"><em>{'SEO'|gettext}</em></a></li>
<li><a href="#tab7"><em>{'Configure Fields'|gettext}</em></a></li>
<li><a href="#tab7"><em>{'User Input Fields'|gettext}</em></a></li>
<li><a href="#tab8"><em>{'Waiver'|gettext}</em></a></li>
<li><a href="#tab9"><em>{'Status'|gettext}</em></a></li>
</ul>
Expand Down Expand Up @@ -108,6 +108,10 @@
</tr>
</table>
{/toggle}
{group label="Tax Class"|gettext}
{control type="dropdown" name="pricing[tax_class_id]" label="" frommodel=taxclass key=id display=name includeblank="-- No Tax Required --"|gettext value=$record->tax_class_id|default:1}
{icon controller="tax" action="manage" text="Manage Tax Classes"|gettext}
{/group}
</div>
<div id="tab4">
<h2>{'Add options to your product.'|gettext}</h2>
Expand All @@ -134,7 +138,7 @@
{control type="textarea" name="meta_description" label="Meta Keywords"|gettext value=$record->meta_keywords}
</div>
<div id="tab7">
<h2>{'Input Fields'|gettext}</h2>
<h2>{'User Input Fields'|gettext}</h2>
{icon class="manage" controller="expDefinableField" action="manage"}
{foreach from=$definablefields item=fields}
{$checked = false}
Expand Down
30 changes: 15 additions & 15 deletions framework/modules/ecommerce/products/views/product/addToOrder.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
{/if}
<td style="text-align: right;">
{if $chiprod->use_special_price}
<span style="color:red; font-size: 8px; font-weight: bold;">SALE</span>{br}
<span style="color:red; font-size: 8px; font-weight: bold;">{'SALE'|gettext}</span>{br}
<span>{currency_symbol}<input name="prod-price[{$chiprod->id}]" type="text" value="{$chiprod->special_price|number_format:2}" size=7 maxlength=9></span>
{else}
<span>{currency_symbol}<input name="prod-price[{$chiprod->id}]" type="text" value="{$chiprod->base_price|number_format:2}" size=7 maxlength=9></span>
Expand Down Expand Up @@ -153,20 +153,20 @@

{if !empty($product->user_input_fields) && $product->user_input_fields|@count>0 }
<div class="user-input-fields">
<h2>Additional Information for {$product->title}</h2>
<p>This item would like the following additional information. Items marked with an * are required:</p>
{foreach from=$product->user_input_fields key=uifkey item=uif}
<div class="user-input {cycle values="odd,even"}">
{if $uif.use}
{if $uif.is_required}
{control type=text name='user_input_fields[$uifkey]' size=50 maxlength=$uif.max_length label='* '|cat:$uif.name|cat:':' required=$uif.is_required value=$params.user_input_fields.$uifkey}
{else}
{control type=text name='user_input_fields[$uifkey]' size=50 maxlength=$uif.max_length label=$uif.name|cat:':' required=$uif.is_required value=$params.user_input_fields.$uifkey}
{/if}
{if $uif.description != ''}{$uif.description}{/if}
{/if}
</div>
{/foreach}
<h2>Additional Information for {$product->title}</h2>
<p>This item would like the following additional information. Items marked with an * are required:</p>
{foreach from=$product->user_input_fields key=uifkey item=uif}
<div class="user-input {cycle values="odd,even"}">
{if $uif.use}
{if $uif.is_required}
{control type=text name='user_input_fields[$uifkey]' size=50 maxlength=$uif.max_length label='* '|cat:$uif.name|cat:':' required=$uif.is_required value=$params.user_input_fields.$uifkey}
{else}
{control type=text name='user_input_fields[$uifkey]' size=50 maxlength=$uif.max_length label=$uif.name|cat:':' required=$uif.is_required value=$params.user_input_fields.$uifkey}
{/if}
{if $uif.description != ''}{$uif.description}{/if}
{/if}
</div>
{/foreach}
</div>
{/if}
{control type="buttongroup" submit="Add Item(s) to Order"|gettext}
Expand Down
8 changes: 4 additions & 4 deletions framework/modules/ecommerce/products/views/product/edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id parent_id = $record->parent_id view="edit_categories"}">{'Categories'|gettext}</a></li>
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id parent_id = $record->parent_id view="edit_options"}">{'Options'|gettext}</a></li>
{if $record->parent_id == 0}
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id view="edit_featured"}">{'Featured'|gettext}</a></li>
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id view="edit_related"}">{'Related Products'|gettext}</a></li>
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id view="edit_featured"}">{'Featured'|gettext}</a></li>
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id view="edit_related"}">{'Related Products'|gettext}</a></li>
{/if}
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id parent_id = $record->parent_id view="edit_userinput"}">{'User Input Fields'|gettext}</a></li>
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id parent_id = $record->parent_id view="edit_status"}">{'Active'|gettext} &amp; {'Status Settings'|gettext}</a></li>
{if $record->parent_id == 0}
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id view="edit_meta"}">{'SEO'|gettext}</a></li>
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id view="edit_meta"}">{'SEO'|gettext}</a></li>
{/if}
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id parent_id = $record->parent_id view="edit_notes"}">{'Notes'|gettext}</a></li>
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id parent_id = $record->parent_id view="edit_extrafields"}">{'Extra Fields'|gettext}</a></li>
{if $record->parent_id == 0}
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id view="edit_model"}">{'SKUS/Model'|gettext}</a></li>
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id view="edit_model"}">{'SKUS/Model'|gettext}</a></li>
{/if}
<li><a href="{link action="edit" product_type="product" ajax_action=1 id=$record->id parent_id = $record->parent_id view="edit_misc"}">{'Misc'|gettext}</a></li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions framework/modules/ecommerce/views/eventregistration/show.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@
</td>
<td>
{*<input name="event[0][phone]" type="text"/>*}
<input name="event[0][phone]" type=tel/>
<input name="event[0][phone]" type=tel />
</td>
<td>
{*<input name="event[0][email]" type="text"/>*}
<input name="event[0][email]" type=email/>
<input name="event[0][email]" type=email />
</td>
</tr>
{else}
Expand Down
5 changes: 4 additions & 1 deletion framework/modules/ecommerce/views/order/edit_invoice_id.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
*
*}

{'Invoice #\'s should be numeric and although you may select any number you\'d like, ideally it should fall in line with the current sequence of invoice #\'s.'|gettext}
<h1>{'Editing Invoice Number'|gettext}</h1>
<blockquote>
{'Invoice #\'s should be numeric and although you may select any number you\'d like, ideally it should fall in line with the current sequence of invoice #\'s.'|gettext}
</blockquote>
<div id="edit_shipping_method">
{form action=save_invoice_id}
{control type="hidden" name="id" value=$orderid}
Expand Down
60 changes: 31 additions & 29 deletions framework/modules/ecommerce/views/order/edit_order_item.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,24 @@
<strong>* {'If this item has product options and those options modify the price, YOU must adjust the price below manually if you change the options. This will NOT recalculate the option price modifiers automatically.'|gettext}</strong>{br}
{br}
<table width='60%'>
<tr><td>
{'Item name:'|gettext}</td><td>{control type=textarea name=products_name cols=40 rows=3 label="" value=$oi->products_name}
</td></tr>
<tr><td>
{'Item model:'|gettext}</td><td>{$oi->products_model}
</td></tr>
<tr><td>
{'Item price:'|gettext}</td><td>{control type=text name=products_price label="" value=$oi->products_price}
</td></tr>
<tr><td>
{'Item quantity:'|gettext}</td><td>{control type=text name=quantity label="" value=$oi->quantity}
</td></tr>

<tr>
<td>{'Item name:'|gettext}</td>
<td>{control type=textarea name=products_name cols=40 rows=3 label="" value=$oi->products_name}</td>
</tr>
<tr>
<td>{'Item model:'|gettext}</td>
<td>{$oi->products_model}</td>
</tr>
<tr>
<td>{'Item price:'|gettext}</td>
<td>{control type=text name=products_price label="" value=$oi->products_price}</td>
</tr>
<tr>
<td>{'Item quantity:'|gettext}</td>
<td>{control type=text name=quantity label="" value=$oi->quantity}</td>
</tr>
</table>
{if $oi->product->hasOptions()}
{if $oi->product->hasOptions()}
<div class="product-options">
<h2>{$oi->products_name} {'Options'|gettext}</h2>
{foreach from=$oi->product->optiongroup item=og}
Expand All @@ -64,22 +67,21 @@

{if !empty($oi->product->user_input_fields) && $oi->product->user_input_fields|@count>0 }
<div class="user-input-fields">
<h2>{'User Input Fields'|gettext}</h2>
{foreach from=$oi->product->user_input_fields key=uifkey item=uif}
<div class="user-input {cycle values="odd,even"}">
{if $uif.use}
{if $uif.is_required}
{control type=text name='user_input_fields[$uifkey]' size=50 maxlength=$uif.max_length label='* '|cat:$uif.name|cat:':' required=$uif.is_required value=$oi->user_input_fields.$uifkey[$uif.name]}
{else}
{control type=text name='user_input_fields[$uifkey]' size=50 maxlength=$uif.max_length label=$uif.name|cat:':' required=$uif.is_required value=$oi->user_input_fields.$uifkey[$uif.name]}
{/if}
{if $uif.description != ''}{$uif.description}{/if}
{/if}
</div>
{/foreach}
<h2>{'User Input Fields'|gettext}</h2>
{foreach from=$oi->product->user_input_fields key=uifkey item=uif}
<div class="user-input {cycle values="odd,even"}">
{if $uif.use}
{if $uif.is_required}
{control type=text name='user_input_fields[$uifkey]' size=50 maxlength=$uif.max_length label='* '|cat:$uif.name|cat:':' required=$uif.is_required value=$oi->user_input_fields.$uifkey[$uif.name]}
{else}
{control type=text name='user_input_fields[$uifkey]' size=50 maxlength=$uif.max_length label=$uif.name|cat:':' required=$uif.is_required value=$oi->user_input_fields.$uifkey[$uif.name]}
{/if}
{if $uif.description != ''}{$uif.description}{/if}
{/if}
</div>
{/foreach}
</div>
{/if}
{control type=buttongroup submit="Save Order Item Change"|gettext cancel="Cancel"|gettext}

{control type=buttongroup submit="Save Order Item Change"|gettext cancel="Cancel"|gettext}
{/form}
</div>
Loading

0 comments on commit ee33ce9

Please sign in to comment.