Browse Source

- Update the translations

- Display the roster subscription status
- Add actions on contact with 'none', 'to' or 'from' status
pull/16/head
Jaussoin Timothée 10 years ago
parent
commit
6fe0e44c40
  1. 4
      app/models/contact/Contact.php
  2. 3
      app/models/contact/ContactDAO.php
  3. 40
      app/widgets/Contact/_contact.tpl
  4. 11
      app/widgets/Contact/locales.ini
  5. 22
      app/widgets/Notifs/Notifs.php
  6. 1
      app/widgets/Roster/Roster.php
  7. 5
      app/widgets/Roster/roster.tpl
  8. 1399
      locales/ar.po
  9. 1368
      locales/be.po
  10. 1362
      locales/bn.po
  11. 1391
      locales/br.po
  12. 1369
      locales/da.po
  13. 1462
      locales/de.po
  14. 1389
      locales/el.po
  15. 1393
      locales/eo.po
  16. 1455
      locales/es.po
  17. 1362
      locales/fa.po
  18. 1392
      locales/fi.po
  19. 787
      locales/fr.po
  20. 1368
      locales/gl.po
  21. 1462
      locales/he.po
  22. 1362
      locales/hr.po
  23. 1430
      locales/id.po
  24. 1362
      locales/io.po
  25. 1454
      locales/it.po
  26. 1424
      locales/ja.po
  27. 1362
      locales/kk.po
  28. 1429
      locales/lv.po
  29. 1362
      locales/messages.pot
  30. 1456
      locales/nl.po
  31. 1368
      locales/no.po
  32. 1448
      locales/oc.po
  33. 1392
      locales/pt.po
  34. 1369
      locales/ro.po
  35. 1462
      locales/ru.po
  36. 1381
      locales/uk.po
  37. 1462
      locales/zh.po
  38. 4
      mud.php
  39. 2
      themes/material/css/form.css

4
app/models/contact/Contact.php

@ -393,6 +393,7 @@ class Contact extends Model {
return array(
'jid' => $this->jid,
'rostername' => $this->rostername,
'rostername' => $this->rostername,
'groupname' => $this->groupname,
'status' => $this->status,
'resource' => $this->resource,
@ -504,6 +505,7 @@ class RosterContact extends Contact {
protected $publickey;
protected $muc;
protected $rosterask;
protected $rostersubscription;
protected $node;
protected $ver;
protected $category;
@ -517,6 +519,8 @@ class RosterContact extends Contact {
{'type':'string', 'size':128 },
'rosterask' :
{'type':'string', 'size':128 },
'rostersubscription' :
{'type':'string', 'size':8 },
'groupname' :
{'type':'string', 'size':128 },
'resource' :

3
app/models/contact/ContactDAO.php

@ -422,6 +422,7 @@ class ContactDAO extends SQL {
contact.tuneartist,
contact.tunetitle,
rosterlink.rostername,
rosterlink.rostersubscription,
rosterlink.groupname,
rosterlink.chaton,
presence.status,
@ -460,6 +461,7 @@ class ContactDAO extends SQL {
contact.tuneartist,
contact.tunetitle,
rosterlink.rostername,
rosterlink.rostersubscription,
rosterlink.groupname,
rosterlink.chaton
from rosterlink
@ -531,6 +533,7 @@ class ContactDAO extends SQL {
contact.tuneartist,
contact.tunetitle,
rosterlink.rostername,
rosterlink.rostersubscription,
rosterlink.groupname,
rosterlink.chaton,
presence.status,

40
app/widgets/Contact/_contact.tpl

@ -301,6 +301,46 @@
</ul>
{/if}
{if="$contactr->rostersubscription != 'both'"}
<div class="card">
<ul class="middle">
<li class="condensed">
{if="$contactr->rostersubscription == 'to'"}
<span class="icon gray">
<i class="md md-call-received"></i>
</span>
<span>{$c->__('subscription.to')}</span>
<p>{$c->__('subscription.to_text')}</p>
<a class="button flat" onclick="Notifs_ajaxAccept('{$contactr->jid}')">
{$c->__('subscription.to_button')}
</a>
{/if}
{if="$contactr->rostersubscription == 'from'"}
<span class="icon gray">
<i class="md md-call-made"></i>
</span>
<span>{$c->__('subscription.from')}</span>
<p>{$c->__('subscription.from_text')}</p>
<a class="button flat" onclick="Notifs_ajaxAsk('{$contactr->jid}')">
{$c->__('subscription.from_button')}
</a>
{/if}
{if="$contactr->rostersubscription == 'none'"}
<span class="icon gray">
<i class="md md-do-not-disturb"></i>
</span>
<span>{$c->__('subscription.none')}</span>
<p>{$c->__('subscription.none_text')}</p>
<a class="button flat" onclick="Notifs_ajaxAsk('{$contactr->jid}')">
{$c->__('subscription.none_button')}
</a>
{/if}
</li>
</ul>
</div>
{/if}
<a onclick="{$chat}" class="button action color red">
<i class="md md-chat"></i>
</a>

11
app/widgets/Contact/locales.ini

@ -49,3 +49,14 @@ age.years = '%s years'
[blog]
blog.last = 'Last public post'
[subscription]
subscription.to = 'You can see this contact status'
subscription.to_button = 'Share my status'
subscription.to_text = 'But this contact cannot see yours'
subscription.from = 'You are not subscribed to this contact'
subscription.from_button= 'Ask to subscribe'
subscription.from_text = 'But this contact can still see if you are online'
subscription.none = 'No subscriptions'
subscription.none_button= 'Invite'
subscription.none_text = 'This contact is in your contact list but there is no subscriptions between the two accounts'

22
app/widgets/Notifs/Notifs.php

@ -20,6 +20,7 @@
use Moxl\Xec\Action\Presence\Subscribed;
use Moxl\Xec\Action\Presence\Unsubscribed;
use Moxl\Xec\Action\Roster\AddItem;
use Moxl\Xec\Action\Roster\UpdateItem;
use Moxl\Xec\Action\Presence\Subscribe;
class Notifs extends WidgetBase
@ -31,6 +32,7 @@ class Notifs extends WidgetBase
$this->registerEvent('subscribe', 'onNotifs');
$this->registerEvent('roster_additem_handle', 'onNotifs');
$this->registerEvent('roster_updateitem_handle', 'onNotifs');
$this->registerEvent('presence_subscribe_handle', 'onNotifs');
$this->registerEvent('presence_subscribed_handle', 'onNotifs');
}
@ -78,10 +80,22 @@ class Notifs extends WidgetBase
{
$jid = echapJid($jid);
$r = new AddItem;
$r->setTo($jid)
->setFrom($this->user->getLogin())
->request();
$rd = new \Modl\RosterLinkDAO();
$c = $rd->get($jid);
if(isset($c) && $c->groupname) {
$ui = new UpdateItem;
$ui->setTo($jid)
->setFrom($this->user->getLogin())
->setName($c->rostername)
->setGroup($c->groupname)
->request();
} else {
$r = new AddItem;
$r->setTo($jid)
->setFrom($this->user->getLogin())
->request();
}
$p = new Subscribe;
$p->setTo($jid)

1
app/widgets/Roster/Roster.php

@ -287,6 +287,7 @@ class Roster extends WidgetBase
$c['rosterview']['color'] = stringToColor($oc->jid);
$c['rosterview']['name'] = $oc->getTrueName();
$c['rosterview']['friendpage'] = $this->route('contact', $oc->jid);
$c['rosterview']['subscription'] = $oc->rostersubscription;
// Some data relative to the presence
if($oc->last != null && $oc->last > 60)

5
app/widgets/Roster/roster.tpl

@ -30,13 +30,16 @@
<!--ng-class="rosterCtrl.getContactClient(myjid.ajiditems)"-- >-->
<div
class="action"
ng-if="myjid.ajiditems.rosterview.tune != '' || myjid.ajiditems.rosterview.type != '' "
ng-if="myjid.ajiditems.rosterview.tune != '' || myjid.ajiditems.rosterview.type != '' || myjid.ajiditems.rosterview.subscription != 'both'"
ng-switch on="myjid.ajiditems.rosterview.type">
<i ng-switch-when="handheld" class="md md-smartphone"></i>
<i ng-switch-when="phone" class="md md-smartphone"></i>
<i ng-switch-when="web" class="md md-language"></i>
<i ng-switch-when="bot" class="md md-memory"></i>
<i ng-if="myjid.ajiditems.rosterview.tune" class="md md-play-arrow"></i>
<i ng-if="myjid.ajiditems.rosterview.subscription == 'to'" class="md md-call-received"></i>
<i ng-if="myjid.ajiditems.rosterview.subscription == 'from'" class="md md-call-made"></i>
<i ng-if="myjid.ajiditems.rosterview.subscription == 'none'" class="md md-do-not-disturb"></i>
</div>
<span

1399
locales/ar.po
File diff suppressed because it is too large
View File

1368
locales/be.po
File diff suppressed because it is too large
View File

1362
locales/bn.po
File diff suppressed because it is too large
View File

1391
locales/br.po
File diff suppressed because it is too large
View File

1369
locales/da.po
File diff suppressed because it is too large
View File

1462
locales/de.po
File diff suppressed because it is too large
View File

1389
locales/el.po
File diff suppressed because it is too large
View File

1393
locales/eo.po
File diff suppressed because it is too large
View File

1455
locales/es.po
File diff suppressed because it is too large
View File

1362
locales/fa.po
File diff suppressed because it is too large
View File

1392
locales/fi.po
File diff suppressed because it is too large
View File

787
locales/fr.po
File diff suppressed because it is too large
View File

1368
locales/gl.po
File diff suppressed because it is too large
View File

1462
locales/he.po
File diff suppressed because it is too large
View File

1362
locales/hr.po
File diff suppressed because it is too large
View File

1430
locales/id.po
File diff suppressed because it is too large
View File

1362
locales/io.po
File diff suppressed because it is too large
View File

1454
locales/it.po
File diff suppressed because it is too large
View File

1424
locales/ja.po
File diff suppressed because it is too large
View File

1362
locales/kk.po
File diff suppressed because it is too large
View File

1429
locales/lv.po
File diff suppressed because it is too large
View File

1362
locales/messages.pot
File diff suppressed because it is too large
View File

1456
locales/nl.po
File diff suppressed because it is too large
View File

1368
locales/no.po
File diff suppressed because it is too large
View File

1448
locales/oc.po
File diff suppressed because it is too large
View File

1392
locales/pt.po
File diff suppressed because it is too large
View File

1369
locales/ro.po
File diff suppressed because it is too large
View File

1462
locales/ru.po
File diff suppressed because it is too large
View File

1381
locales/uk.po
File diff suppressed because it is too large
View File

1462
locales/zh.po
File diff suppressed because it is too large
View File

4
mud.php

@ -24,9 +24,9 @@ Here some requests you can do with me :", 'green')."
case 'getloc':
getloc();
break;
case 'comploc':
/*case 'comploc':
comploc();
break;
break;*/
case 'comptz':
comptz();
break;

2
themes/material/css/form.css

@ -320,7 +320,7 @@ header.big ~ .button.action {
top: 16rem;
}
@media screen and (min-width: 1024px) {
@media screen and (min-width: 1025px) {
main > section > div:first-child:nth-last-child(2) .button.action {
right: calc(70% + 3rem);
}

Loading…
Cancel
Save