Discarded products are now displayed in a read-only format.
Also added a fragment for a public view of a product
This commit is contained in:
parent
dd6c270fa3
commit
212c34d779
@ -307,6 +307,109 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
¤¤ product_details_readonly ¤¤
|
||||||
|
<div id="product-details">
|
||||||
|
<h2>Product details</h2>
|
||||||
|
<div id="product-data"
|
||||||
|
class="data">
|
||||||
|
<table>
|
||||||
|
<tbody class="single fixedwidth">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Name:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤name¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Manufacturer:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤brand¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Invoice number:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤invoice¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr id="before_info">
|
||||||
|
<td>
|
||||||
|
Serial number:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤serial¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
¤info¤
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Tags:
|
||||||
|
</td>
|
||||||
|
<td id="tags">
|
||||||
|
¤tags¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="product-attachments"
|
||||||
|
class="¤hidden¤">
|
||||||
|
<h2>Attachments</h2>
|
||||||
|
¤attachments¤
|
||||||
|
</div>
|
||||||
|
|
||||||
|
¤¤ product_details_public ¤¤
|
||||||
|
<div id="product-details">
|
||||||
|
<h2>Product details</h2>
|
||||||
|
<div id="product-data"
|
||||||
|
class="data">
|
||||||
|
<table>
|
||||||
|
<tbody class="single fixedwidth">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Name:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤name¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Manufacturer:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤brand¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr id="before_info">
|
||||||
|
<td>
|
||||||
|
Serial number:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤serial¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
¤info¤
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Tags:
|
||||||
|
</td>
|
||||||
|
<td id="tags">
|
||||||
|
¤tags¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
¤¤ product_meta ¤¤
|
¤¤ product_meta ¤¤
|
||||||
<div id="product-history">
|
<div id="product-history">
|
||||||
<h2>Product history</h2>
|
<h2>Product history</h2>
|
||||||
@ -418,6 +521,16 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
¤¤ info_item_readonly ¤¤
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
¤name¤:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤value¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
¤¤ tag ¤¤
|
¤¤ tag ¤¤
|
||||||
<p>
|
<p>
|
||||||
<span class="tag">
|
<span class="tag">
|
||||||
@ -432,6 +545,13 @@
|
|||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
¤¤ tag_readonly ¤¤
|
||||||
|
<p>
|
||||||
|
<span class="tag">
|
||||||
|
¤tag¤
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
|
||||||
¤¤ user_details ¤¤
|
¤¤ user_details ¤¤
|
||||||
<div id="user-details">
|
<div id="user-details">
|
||||||
<form onSubmit="JavaScript:updateUser(event)">
|
<form onSubmit="JavaScript:updateUser(event)">
|
||||||
|
@ -307,6 +307,109 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
¤¤ product_details_readonly ¤¤
|
||||||
|
<div id="product-details">
|
||||||
|
<h2>Artikeldata</h2>
|
||||||
|
<div id="product-data"
|
||||||
|
class="data">
|
||||||
|
<table>
|
||||||
|
<tbody class="single fixedwidth">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Namn:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤name¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Tillverkare:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤brand¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Fakturanummer:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤invoice¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr id="before_info">
|
||||||
|
<td>
|
||||||
|
Serienummer:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤serial¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
¤info¤
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Taggar:
|
||||||
|
</td>
|
||||||
|
<td id="tags">
|
||||||
|
¤tags¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="product-attachments"
|
||||||
|
class="¤hidden¤">
|
||||||
|
<h2>Bilagor</h2>
|
||||||
|
¤attachments¤
|
||||||
|
</div>
|
||||||
|
|
||||||
|
¤¤ product_details_public ¤¤
|
||||||
|
<div id="product-details">
|
||||||
|
<h2>Artikeldata</h2>
|
||||||
|
<div id="product-data"
|
||||||
|
class="data">
|
||||||
|
<table>
|
||||||
|
<tbody class="single fixedwidth">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Namn:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤name¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Tillverkare:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤brand¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr id="before_info">
|
||||||
|
<td>
|
||||||
|
Serienummer:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤serial¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
¤info¤
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Taggar:
|
||||||
|
</td>
|
||||||
|
<td id="tags">
|
||||||
|
¤tags¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
¤¤ product_meta ¤¤
|
¤¤ product_meta ¤¤
|
||||||
<div id="product-history">
|
<div id="product-history">
|
||||||
<h2>Artikelhistorik</h2>
|
<h2>Artikelhistorik</h2>
|
||||||
@ -418,6 +521,16 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
¤¤ info_item_readonly ¤¤
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
¤name¤:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
¤value¤
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
¤¤ tag ¤¤
|
¤¤ tag ¤¤
|
||||||
<p>
|
<p>
|
||||||
<span class="tag">
|
<span class="tag">
|
||||||
@ -432,6 +545,13 @@
|
|||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
¤¤ tag_readonly ¤¤
|
||||||
|
<p>
|
||||||
|
<span class="tag">
|
||||||
|
¤tag¤
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
|
||||||
¤¤ user_details ¤¤
|
¤¤ user_details ¤¤
|
||||||
<div id="user-details">
|
<div id="user-details">
|
||||||
<form onSubmit="JavaScript:updateUser(event)">
|
<form onSubmit="JavaScript:updateUser(event)">
|
||||||
|
@ -44,17 +44,27 @@ class ProductPage extends Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function build_product_form() {
|
private function build_product_form() {
|
||||||
|
$discarded = $this->product->get_discardtime();
|
||||||
|
|
||||||
|
$info_item_fragment = $this->fragments['info_item'];
|
||||||
|
$tag_fragment = $this->fragments['tag'];
|
||||||
|
$product_details_fragment = $this->fragments['product_details'];
|
||||||
|
if($discarded) {
|
||||||
|
$info_item_fragment = $this->fragments['info_item_readonly'];
|
||||||
|
$tag_fragment = $this->fragments['tag_readonly'];
|
||||||
|
$product_details_fragment = $this->fragments['product_details_readonly'];
|
||||||
|
}
|
||||||
$info = '';
|
$info = '';
|
||||||
foreach($this->product->get_info() as $key => $value) {
|
foreach($this->product->get_info() as $key => $value) {
|
||||||
$info .= replace(array('name' => ucfirst($key),
|
$info .= replace(array('name' => ucfirst($key),
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
'value' => $value),
|
'value' => $value),
|
||||||
$this->fragments['info_item']);
|
$info_item_fragment);
|
||||||
}
|
}
|
||||||
$tags = '';
|
$tags = '';
|
||||||
foreach($this->escape_tags($this->product->get_tags()) as $tag) {
|
foreach($this->escape_tags($this->product->get_tags()) as $tag) {
|
||||||
$tags .= replace(array('tag' => ucfirst($tag)),
|
$tags .= replace(array('tag' => ucfirst($tag)),
|
||||||
$this->fragments['tag']);
|
$tag_fragment);
|
||||||
}
|
}
|
||||||
$history = $this->build_history_table($this->product->get_history());
|
$history = $this->build_history_table($this->product->get_history());
|
||||||
$attachments = $this->build_attachment_list(
|
$attachments = $this->build_attachment_list(
|
||||||
@ -87,7 +97,7 @@ class ProductPage extends Page {
|
|||||||
$fields['checkout_hidden'] = '';
|
$fields['checkout_hidden'] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$out = replace($fields, $this->fragments['product_details']);
|
$out = replace($fields, $product_details_fragment);
|
||||||
$out .= replace($fields, $this->fragments['product_meta']);
|
$out .= replace($fields, $this->fragments['product_meta']);
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
@ -145,6 +145,10 @@ input[type="text"].newfield {
|
|||||||
width: 11.5em;
|
width: 11.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tbody.fixedwidth > tr > td {
|
||||||
|
min-width: 11.5em;
|
||||||
|
}
|
||||||
|
|
||||||
input[type="text"].newtemplate {
|
input[type="text"].newtemplate {
|
||||||
width: 8em;
|
width: 8em;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user