fix #644 Status off by default

This commit is contained in:
Nicolas Le Goff
2012-05-25 19:41:22 +02:00
parent 5c19104bef
commit 7c371a11cd
2 changed files with 5 additions and 4 deletions

View File

@@ -167,8 +167,9 @@ class Upload implements ControllerProviderInterface
$postStatus = $request->get('status'); $postStatus = $request->get('status');
if (is_array($postStatus)) { if (isset($postStatus[$collection->get_sbas_id()]) && is_array($postStatus[$collection->get_sbas_id()])) {
$postStatus = $postStatus[$collection->get_sbas_id()];
$status = ''; $status = '';
foreach (range(0, 64) as $i) { foreach (range(0, 64) as $i) {
$status .= isset($postStatus[$i]) ? ($postStatus[$i] ? '1' : '0') : '0'; $status .= isset($postStatus[$i]) ? ($postStatus[$i] ? '1' : '0') : '0';

View File

@@ -67,10 +67,10 @@
<img src="{{ status['img_off'] }}" width="16" height="16" /> <img src="{{ status['img_off'] }}" width="16" height="16" />
{% endif %} {% endif %}
<span>{{ status['labeloff']|default('off') }}</span> <span>{{ status['labeloff']|default('off') }}</span>
<input type="radio" name="status[{{ bit }}]" value="off" checked="checked"/> <input type="radio" name="status[{{ collection.get_base_id() }}][{{ bit }}]" value="off" checked="checked"/>
</td> </td>
<td class="status-tab-right"> <td class="status-tab-right">
<input type="radio" name="status[{{ bit }}]" value="on" /> <input type="radio" name="status[{{ collection.get_base_id() }}][{{ bit }}]" value="on" />
<span for="labelon">{{ status['labelon']|default('on') }}</span> <span for="labelon">{{ status['labelon']|default('on') }}</span>
{% if status['img_on'] is not empty %} {% if status['img_on'] is not empty %}
<img src="{{ status['img_on'] }}" width="16" height="16" /> <img src="{{ status['img_on'] }}" width="16" height="16" />