Merge pull request #6497 from MrPetovan/bug/6383-delivery-no-data
Bug/6383 delivery no data
This commit is contained in:
commit
a1de23d4cb
7 changed files with 104 additions and 36 deletions
|
@ -34,6 +34,9 @@ class PostUpdate
|
|||
if (!self::update1281()) {
|
||||
return false;
|
||||
}
|
||||
if (!self::update1297()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -377,4 +380,40 @@ class PostUpdate
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the delivery queue count to a negative value for all items preceding the feature.
|
||||
*
|
||||
* @return bool "true" when the job is done
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
private static function update1297()
|
||||
{
|
||||
// Was the script completed?
|
||||
if (Config::get('system', 'post_update_version') >= 1297) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$max_item_delivery_data = DBA::selectFirst('item-delivery-data', ['iid'], ['queue_count > 0 OR queue_done > 0'], ['order' => ['iid']]);
|
||||
$max_iid = $max_item_delivery_data['iid'];
|
||||
|
||||
Logger::info('Start update1297 with max iid: ' . $max_iid);
|
||||
|
||||
$condition = ['`queue_count` = 0 AND `iid` < ?', $max_iid];
|
||||
|
||||
DBA::update('item-delivery-data', ['queue_count' => -1], $condition);
|
||||
|
||||
if (DBA::errorNo() != 0) {
|
||||
Logger::error('Database error ' . DBA::errorNo() . ':' . DBA::errorMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
Logger::info('Processed rows: ' . DBA::affectedRows());
|
||||
|
||||
Config::set('system', 'post_update_version', 1297);
|
||||
|
||||
Logger::info('Done');
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,12 +2,17 @@
|
|||
Please don't use this template as is, this is a placeholder that needs to be
|
||||
overriden with specific icons to avoid taking too much visual space
|
||||
*}}
|
||||
{{if $delivery.queue_count >= -1 && $delivery.queue_count !== '' && $delivery.queue_count !== null}}
|
||||
<span class="delivery">
|
||||
•
|
||||
{{if $delivery.queue_count == 0}}
|
||||
{{$delivery.notifier_pending|escape}}
|
||||
{{$delivery.notifier_pending}}
|
||||
{{elseif $delivery.queue_done == 0}}
|
||||
{{$delivery.delivery_pending|escape}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}
|
||||
{{$delivery.delivery_pending}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}
|
||||
{{elseif $delivery.queue_done / $delivery.queue_count < 0.75}}
|
||||
{{$delivery.delivery_underway|escape}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}
|
||||
{{$delivery.delivery_underway}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}
|
||||
{{else}}
|
||||
{{$delivery.delivery_almost|escape}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}
|
||||
{{$delivery.delivery_almost}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/if}}
|
||||
|
|
|
@ -2094,6 +2094,7 @@ ul.dropdown-menu li:hover {
|
|||
/* Media Classes */
|
||||
.media .time,
|
||||
.media .shared-time,
|
||||
.media .delivery,
|
||||
.media .location,
|
||||
.media .location a {
|
||||
font-size: 11px;
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
{{if $delivery.queue_count >= -1 && $delivery.queue_count !== '' && $delivery.queue_count !== null}}
|
||||
<span class="delivery">
|
||||
•
|
||||
{{if $delivery.queue_count == 0}}
|
||||
<i class="fa fa-hourglass-o" aria-hidden="true" title="{{$delivery.notifier_pending|escape}}"></i>
|
||||
<span class="sr-only">{{$delivery.notifier_pending|escape}}</span>
|
||||
<i class="fa fa-hourglass-o" aria-hidden="true" title="{{$delivery.notifier_pending}}"></i>
|
||||
<span class="sr-only">{{$delivery.notifier_pending}}</span>
|
||||
{{elseif $delivery.queue_done == 0}}
|
||||
<i class="fa fa-hourglass" aria-hidden="true" title="{{$delivery.delivery_pending|escape}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
|
||||
<span class="sr-only">{{$delivery.delivery_pending|escape}}</span>
|
||||
<i class="fa fa-hourglass" aria-hidden="true" title="{{$delivery.delivery_pending}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
|
||||
<span class="sr-only">{{$delivery.delivery_pending}}</span>
|
||||
{{elseif $delivery.queue_done / $delivery.queue_count < 0.75}}
|
||||
<i class="fa fa-paper-plane-o" aria-hidden="true" title="{{$delivery.delivery_underway|escape}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
|
||||
<span class="sr-only">{{$delivery.delivery_underway|escape}}</span>
|
||||
<i class="fa fa-paper-plane-o" aria-hidden="true" title="{{$delivery.delivery_underway}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
|
||||
<span class="sr-only">{{$delivery.delivery_underway}}</span>
|
||||
{{else}}
|
||||
<i class="fa fa-paper-plane" aria-hidden="true" title="{{$delivery.delivery_almost|escape}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
|
||||
<span class="sr-only">{{$delivery.delivery_almost|escape}}</span>
|
||||
<i class="fa fa-paper-plane" aria-hidden="true" title="{{$delivery.delivery_almost}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
|
||||
<span class="sr-only">{{$delivery.delivery_almost}}</span>
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/if}}
|
||||
|
|
|
@ -202,7 +202,16 @@ as the value of $top_child_total (this is done at the end of this file)
|
|||
|
||||
<div class="additional-info text-muted">
|
||||
<div id="wall-item-ago-{{$item.id}}" class="wall-item-ago">
|
||||
<small><a href="{{$item.plink.orig}}"><span class="time" title="{{$item.localtime}}" data-toggle="tooltip"><time class="dt-published" datetime="{{$item.localtime}}">{{$item.ago}}</time></span></a></small>
|
||||
<small>
|
||||
<a href="{{$item.plink.orig}}">
|
||||
<span class="time" title="{{$item.localtime}}" data-toggle="tooltip">
|
||||
<time class="dt-published" datetime="{{$item.localtime}}">{{$item.ago}}</time>
|
||||
</span>
|
||||
</a>
|
||||
{{if $item.owner_self}}
|
||||
{{include file="sub/delivery_count.tpl" delivery=$item.delivery}}
|
||||
{{/if}}
|
||||
</small>
|
||||
</div>
|
||||
|
||||
{{if $item.location}}
|
||||
|
@ -223,7 +232,6 @@ as the value of $top_child_total (this is done at the end of this file)
|
|||
<a class="time" href="{{$item.plink.orig}}"><span class="wall-item-ago">{{$item.ago}}</span></a>
|
||||
{{if $item.location}} — ({{$item.location nofilter}}){{/if}}
|
||||
{{if $item.owner_self}}
|
||||
•
|
||||
{{include file="sub/delivery_count.tpl" delivery=$item.delivery}}
|
||||
{{/if}}
|
||||
</small>
|
||||
|
@ -239,7 +247,13 @@ as the value of $top_child_total (this is done at the end of this file)
|
|||
<h5 class="media-heading">
|
||||
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link userinfo"><span class="fakelink">{{$item.name}}</span></a>
|
||||
<span class="text-muted">
|
||||
<small><a class="time" href="{{$item.plink.orig}}" title="{{$item.localtime}}" data-toggle="tooltip">{{$item.ago}}</a> {{if $item.location}} — ({{$item.location nofilter}}){{/if}}</small>
|
||||
<small>
|
||||
<a class="time" href="{{$item.plink.orig}}" title="{{$item.localtime}}" data-toggle="tooltip">{{$item.ago}}</a>
|
||||
{{if $item.location}} — ({{$item.location nofilter}}){{/if}}
|
||||
{{if $item.owner_self}}
|
||||
{{include file="sub/delivery_count.tpl" delivery=$item.delivery}}
|
||||
{{/if}}
|
||||
</small>
|
||||
</span>
|
||||
</h5>
|
||||
</div>
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
{{if $delivery.queue_count >= -1 && $delivery.queue_count !== '' && $delivery.queue_count !== null}}
|
||||
<span class="delivery">
|
||||
•
|
||||
{{if $delivery.queue_count == 0}}
|
||||
<i class="icon-spinner" aria-hidden="true" title="{{$delivery.notifier_pending|escape}}"></i>
|
||||
<span class="sr-only">{{$delivery.notifier_pending|escape}}</span>
|
||||
<i class="icon-spinner" aria-hidden="true" title="{{$delivery.notifier_pending}}"></i>
|
||||
<span class="sr-only">{{$delivery.notifier_pending}}</span>
|
||||
{{elseif $delivery.queue_done == 0}}
|
||||
<i class="icon-spinner" aria-hidden="true" title="{{$delivery.delivery_pending|escape}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
|
||||
<span class="sr-only">{{$delivery.delivery_pending|escape}}</span>
|
||||
<i class="icon-spinner" aria-hidden="true" title="{{$delivery.delivery_pending}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
|
||||
<span class="sr-only">{{$delivery.delivery_pending}}</span>
|
||||
{{elseif $delivery.queue_done / $delivery.queue_count < 0.75}}
|
||||
<i class="icon-plane" aria-hidden="true" title="{{$delivery.delivery_underway|escape}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
|
||||
<span class="sr-only">{{$delivery.delivery_underway|escape}}</span>
|
||||
<i class="icon-plane" aria-hidden="true" title="{{$delivery.delivery_underway}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
|
||||
<span class="sr-only">{{$delivery.delivery_underway}}</span>
|
||||
{{else}}
|
||||
<i class="icon-plane" aria-hidden="true" title="{{$delivery.delivery_almost|escape}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
|
||||
<span class="sr-only">{{$delivery.delivery_almost|escape}}</span>
|
||||
<i class="icon-plane" aria-hidden="true" title="{{$delivery.delivery_almost}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
|
||||
<span class="sr-only">{{$delivery.delivery_almost}}</span>
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/if}}
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
<span class="wall-item-ago">
|
||||
{{if $item.plink}}<a title="{{$item.plink.title}}" href="{{$item.plink.href}}" class="u-url" style="color: #999"><time class="dt-published" datetime="{{$item.localtime}}">{{$item.created}}</time></a>{{else}} <time class="dt-published" datetime="{{$item.localtime}}">{{$item.created}}</time> {{/if}}
|
||||
{{if $item.owner_self}}
|
||||
•
|
||||
{{include file="sub/delivery_count.tpl" delivery=$item.delivery}}
|
||||
{{/if}}
|
||||
</span>
|
||||
|
|
Loading…
Reference in a new issue