Browse Source

Remove gender, marital and the Skype/Twitter/Yahoo account info from Movim

Cleanup the translations
pull/516/head
Timothée Jaussoin 8 years ago
parent
commit
228b8d0c85
  1. 29
      app/helpers/UtilsHelper.php
  2. 54
      app/models/contact/Contact.php
  3. 34
      app/models/contact/ContactDAO.php
  4. 70
      app/widgets/ContactActions/_contactactions_drawer.tpl
  5. 14
      app/widgets/Vcard4/Vcard4.php
  6. 47
      app/widgets/Vcard4/_vcard4_form.tpl
  7. 7
      app/widgets/Vcard4/locales.ini
  8. 2
      composer.json
  9. 10
      composer.lock
  10. 31
      locales/locales.ini

29
app/helpers/UtilsHelper.php

@ -25,19 +25,6 @@ class Utils
}
}
/**
* Return the list of gender
*/
function getGender()
{
return [
'N' => __('gender.nil'),
'M' => __('gender.male'),
'F' => __('gender.female'),
'O' => __('gender.other')
];
}
/**
* Return the list of client types
*/
@ -370,22 +357,6 @@ function getCountries()
];
}
/**
* Return the list of marital status
*/
function getMarital() {
return [
'none' => __('marital.nil'),
'single' => __('marital.single'),
'relationship' => __('marital.relationship'),
'married' => __('marital.married'),
'divorced' => __('marital.divorced'),
'widowed' => __('marital.widowed'),
'cohabiting' => __('marital.cohabiting'),
'union' => __('marital.union')
];
}
function getPresences() {
return [
1 => __('presence.online'),

54
app/models/contact/Contact.php

@ -22,9 +22,6 @@ class Contact extends Model
public $adrpostalcode;
public $adrcountry;
public $gender;
public $marital;
public $photobin;
public $description;
@ -64,11 +61,6 @@ class Contact extends Model
public $locuri;
public $loctimestamp;
// Accounts
public $twitter;
public $skype;
public $yahoo;
public $avatarhash;
// Datetime
@ -86,8 +78,6 @@ class Contact extends Model
'adrlocality' => ['type' => 'string','size' => 128],
'adrpostalcode' => ['type' => 'string','size' => 12],
'adrcountry' => ['type' => 'string','size' => 64],
'gender' => ['type' => 'string','size' => 1],
'marital' => ['type' => 'string','size' => 16],
'description' => ['type' => 'text'],
'mood' => ['type' => 'serialized','size' => 64],
'activity' => ['type' => 'string','size' => 128],
@ -111,9 +101,6 @@ class Contact extends Model
'loctext' => ['type' => 'text'],
'locuri' => ['type' => 'string','size' => 128],
'loctimestamp' => ['type' => 'date','size' => 11],
'twitter' => ['type' => 'string','size' => 128],
'skype' => ['type' => 'string','size' => 128],
'yahoo' => ['type' => 'string','size' => 128],
'avatarhash' => ['type' => 'string','size' => 128],
'created' => ['type' => 'date','mandatory' => true],
'updated' => ['type' => 'date','mandatory' => true],
@ -129,15 +116,10 @@ class Contact extends Model
$this->date = (string)$vcard->vCard->BDAY;
}
//$this->date = date(SQL::SQL_DATE, strtotime($this->date));
$this->name = (string)$vcard->vCard->NICKNAME;
$this->fn = (string)$vcard->vCard->FN;
$this->url = (string)$vcard->vCard->URL;
$this->gender = (string)$vcard->vCard->{'X-GENDER'};
$this->marital = (string)$vcard->vCard->MARITAL->STATUS;
$this->email = (string)$vcard->vCard->EMAIL->USERID;
$this->adrlocality = (string)$vcard->vCard->ADR->LOCALITY;
@ -229,24 +211,6 @@ class Contact extends Model
$this->adrcountry = (string)$vcard->adr->country;
$this->adrpostalcode = (string)$vcard->adr->code;
if(isset($vcard->impp)) {
foreach($vcard->impp->children() as $c) {
list($key, $value) = explode(':', (string)$c);
switch($key) {
case 'twitter' :
$this->twitter = str_replace('@', '', $value);
break;
case 'skype' :
$this->skype = (string)$value;
break;
case 'ymsgr' :
$this->yahoo = (string)$value;
break;
}
}
}
$this->email = (string)$vcard->email->text;
$this->description = trim((string)$vcard->note->text);
}
@ -333,24 +297,6 @@ class Contact extends Model
return $dt->format('d-m-Y');
}
function getGender()
{
$gender = getGender();
if($this->gender != null && $this->gender != 'N') {
return $gender[$this->gender];
}
}
function getMarital()
{
$marital = getMarital();
if($this->marital != null && $this->marital != 'none') {
return $marital[$this->marital];
}
}
function getAlbum()
{
$uri = str_replace(

34
app/models/contact/ContactDAO.php

@ -57,9 +57,6 @@ class ContactDAO extends SQL
adrpostalcode = :adrpostalcode,
adrcountry = :adrcountry,
gender = :gender,
marital = :marital,
description = :description,
mood = :mood,
@ -88,9 +85,6 @@ class ContactDAO extends SQL
loctext = :loctext,
locuri = :locuri,
loctimestamp = :loctimestamp,
twitter = :twitter,
skype = :skype,
yahoo = :yahoo,
avatarhash = :avatarhash,
created = :created,
updated = :updated
@ -110,9 +104,6 @@ class ContactDAO extends SQL
'adrpostalcode' => $contact->adrpostalcode,
'adrcountry' => $contact->adrcountry,
'gender' => $contact->gender,
'marital' => $contact->marital,
'description' => $contact->description,
// User Mood (contain serialized array) - XEP 0107
@ -147,10 +138,6 @@ class ContactDAO extends SQL
'locuri' => $contact->locuri,
'loctimestamp' => $contact->loctimestamp,
'twitter' => $contact->twitter,
'skype' => $contact->skype,
'yahoo' => $contact->yahoo,
'avatarhash' => $contact->avatarhash,
'created' => $contact->created,
@ -177,9 +164,6 @@ class ContactDAO extends SQL
adrpostalcode,
adrcountry,
gender,
marital,
description,
mood,
@ -209,10 +193,6 @@ class ContactDAO extends SQL
locuri,
loctimestamp,
twitter,
skype,
yahoo,
avatarhash,
created,
@ -231,9 +211,6 @@ class ContactDAO extends SQL
:adrpostalcode,
:adrcountry,
:gender,
:marital,
:description,
:mood,
@ -263,10 +240,6 @@ class ContactDAO extends SQL
:locuri,
:loctimestamp,
:twitter,
:skype,
:yahoo,
:avatarhash,
:created,
@ -289,9 +262,6 @@ class ContactDAO extends SQL
'adrpostalcode' => $contact->adrpostalcode,
'adrcountry' => $contact->adrcountry,
'gender' => $contact->gender,
'marital' => $contact->marital,
'description' => $contact->description,
// User Mood (contain serialized array) - XEP 0107
@ -326,10 +296,6 @@ class ContactDAO extends SQL
'locuri' => $contact->locuri,
'loctimestamp' => $contact->loctimestamp,
'twitter' => $contact->twitter,
'skype' => $contact->skype,
'yahoo' => $contact->yahoo,
'avatarhash' => $contact->avatarhash,
'created' => date(SQL::SQL_DATE),

70
app/widgets/ContactActions/_contactactions_drawer.tpl

@ -113,77 +113,7 @@
<p>{$contact->date|strtotime|prepareDate:false}</p>
</li>
{/if}
{if="$contact->getMarital() != null"}
<li class="block">
<span class="primary icon gray"><i class="zmdi zmdi-accounts"></i></span>
<p>{$c->__('general.marital')}</p>
<p>{$contact->getMarital()}</p>
</li>
{/if}
{if="$contact->getGender() != null"}
<li class="block">
<span class="primary icon gray"><i class="zmdi zmdi-face"></i></span>
<p>{$c->__('general.gender')}</p>
<p>{$contact->getGender()}</p>
</li>
{/if}
</ul>
{if="$contact->twitter != null || $contact->skype != null || $contact->yahoo != null"}
<ul class="list">
<li class="subheader block">
<p>{$c->__('general.accounts')}</p>
</li>
{if="$contact->twitter != null"}
<li>
<span class="primary icon gray">
<i class="zmdi zmdi-twitter"></i>
</span>
<p>Twitter</p>
<p>
<a
target="_blank"
href="https://twitter.com/{$contact->twitter}">
@{$contact->twitter}
</a>
</p>
</li>
{/if}
{if="$contact->skype != null"}
<li>
<span class="primary icon gray">
<i class="zmdi zmdi-skype"></i>
</span>
<p>Skype</p>
<p>
<a
target="_blank"
href="callto://{$contact->skype}">
{$contact->skype}
</a>
</p>
</li>
{/if}
{if="$contact->yahoo != null"}
<li>
<span class="primary icon gray">
<i class="zmdi zmdi-yahoo"></i>
</span>
<p>Yahoo!</p>
<p>
<a
target="_blank"
href="ymsgr:sendIM?{$contact->yahoo}">
{$contact->yahoo}
</a>
</p>
</li>
{/if}
</ul>
{/if}
<br />
</section>

14
app/widgets/Vcard4/Vcard4.php

@ -34,8 +34,6 @@ class Vcard4 extends \Movim\Widget\Base
$vcardform->assign('me', $me);
$vcardform->assign('desc', trim($me->description));
$vcardform->assign('gender', getGender());
$vcardform->assign('marital', getMarital());
$vcardform->assign('countries',getCountries());
$me->isValidDate();
@ -114,14 +112,6 @@ class Vcard4 extends \Movim\Widget\Base
$c->url = '';
}
if(Validator::in(array_keys(getGender()))->validate($vcard->gender->value)) {
$c->gender = $vcard->gender->value;
}
if(Validator::in(array_keys(getMarital()))->validate($vcard->marital->value)) {
$c->marital = $vcard->marital->value;
}
$c->adrlocality = $vcard->locality->value;
$c->adrcountry = $vcard->country->value;
@ -131,10 +121,6 @@ class Vcard4 extends \Movim\Widget\Base
$c->email = '';
}
$c->twitter = $vcard->twitter->value;
$c->skype = $vcard->skype->value;
$c->yahoo = $vcard->yahoo->value;
if(Validator::stringType()->validate($vcard->desc->value)) {
$c->description = trim($vcard->desc->value);
}

47
app/widgets/Vcard4/_vcard4_form.tpl

@ -57,36 +57,6 @@
<label for="date">{$c->__('general.date_of_birth')}</label>
</div>
<div class="block">
<div class="select">
<select name="gender">
{loop="$gender"}
<option
{if="$key == $me->gender"}
selected
{/if}
value="{$key}">{$value}</option>
{/loop}
</select>
</div>
<label for="gender">{$c->__('general.gender')}</label>
</div>
<div class="block">
<label for="marital">{$c->__('general.marital')}</label>
<div class="select">
<select name="marital">
{loop="$marital"}
<option
{if="$key == $me->marital"}
selected
{/if}
value="{$key}">{$value}</option>
{/loop}
</select>
</div>
</div>
<div class="block large">
<input type="url" name ="url" class="content" value="{$me->url}" placeholder="https://mywebsite.com/">
<label for="url">{$c->__('general.website')}</label>
@ -120,23 +90,6 @@
<label for="country">{$c->__('position.country')}</label>
</div>
<h3 class="block large">{$c->__('accounts.accounts_title')}</h3>
<div class="block">
<input type="text" name="twitter" class="content" value="{$me->twitter}" placeholder="{$c->__('accounts.twitter')}">
<label for="twitter"><i class="fa fa-twitter"></i> {$c->__('accounts.twitter')}</label>
</div>
<div class="block">
<input type="text" name="skype" class="content" value="{$me->skype}" placeholder="{$c->__('accounts.skype')}">
<label for="skype"><i class="fa fa-skype"></i> {$c->__('accounts.skype')}</label>
</div>
<div class="block">
<input type="email" name="yahoo" class="content" value="{$me->yahoo}" placeholder="{$c->__('accounts.yahoo')}">
<label for="skype"><i class="fa fa-yahoo"></i> {$c->__('accounts.yahoo')}</label>
</div>
<div class="block large">
<button
onclick="

7
app/widgets/Vcard4/locales.ini

@ -5,13 +5,6 @@ not_updated = Profile Not Updated
public = Your profile is now public
restricted = Your profile is now restricted
[accounts]
accounts_title = Accounts
twitter = Twitter
skype = Skype
yahoo = Yahoo Account
accounts_nickname = Nickname
[privacy]
my_profile = Go to my profile page
privacy_title = Privacy Level

2
composer.json

@ -16,7 +16,7 @@
"movim/modl": "dev-master#03c6f6e0c83b494ba33df318a724caf779cd37a8",
"movim/sasl2": "dev-master",
"movim/moxl": "dev-master#7bfff234c0407f63e6dae56f8252d3bbd7688b4e",
"movim/moxl": "dev-master#35568d33db5bfef845bd9fcbf93d67d4657367f8",
"embed/embed": "dev-master",
"heyupdate/emoji": "dev-twemoji2#99dda1bed08472046cac1498221f08684ad83d55",

10
composer.lock

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "441b07328fc5cb0a743c2b0223df9cb5",
"content-hash": "ed4135995811ea8aaacd5c91b318775f",
"packages": [
{
"name": "cboden/ratchet",
@ -778,12 +778,12 @@
"source": {
"type": "git",
"url": "https://github.com/movim/moxl.git",
"reference": "7bfff234c0407f63e6dae56f8252d3bbd7688b4e"
"reference": "35568d33db5bfef845bd9fcbf93d67d4657367f8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/movim/moxl/zipball/7bfff234c0407f63e6dae56f8252d3bbd7688b4e",
"reference": "7bfff234c0407f63e6dae56f8252d3bbd7688b4e",
"url": "https://api.github.com/repos/movim/moxl/zipball/35568d33db5bfef845bd9fcbf93d67d4657367f8",
"reference": "35568d33db5bfef845bd9fcbf93d67d4657367f8",
"shasum": ""
},
"require": {
@ -818,7 +818,7 @@
"php",
"xmpp"
],
"time": "2017-10-20 21:55:52"
"time": "2017-10-23 21:22:50"
},
{
"name": "movim/sasl2",

31
locales/locales.ini

@ -16,7 +16,6 @@ avatar = Avatar
contacts = Contacts
chats = Chats
configuration = Configuration
public_groups = Public Groups
profile = Profile
publish = Publish
post = Post
@ -28,7 +27,6 @@ feed = Feed
posts = Posts
gallery = Gallery
visio = Visio-conference
pods = Pods
share = Share
room = Room
tag = Tag
@ -93,12 +91,6 @@ friday = Friday
saturday = Saturday
sunday = Sunday
[gender]
nil = None
male = Male
female = Female
other = Other
[client]
bot = Bot
desktop = Desktop
@ -106,23 +98,6 @@ phone = Phone
web = Web
registered = Registered
[marital]
nil = None
single = Single
relationship = In a relationship
married = Married
divorced = Divorced
widowed = Widowed
cohabiting = Cohabiting
union = Civil Union
[flag]
white = Not shared
green = Shared with one contact
orange = Shared with all contacts
red = Shared with the XMPP network
black = Shared with the whole Internet
[presence]
online = Online
away = Away
@ -244,25 +219,19 @@ day = day
[post]
title = Title
whats_new = "What's new ?"
place = Place
by = by
geolocalisation = Geolocalisation
email = email
empty = No content
no_comments = No comments yet
no_comments_stream = No comments stream
no_load = Your feed cannot be loaded.
older = Get older posts
new_items = %s new items
comment_error = Comment publication error
comments_older = Show the older comments
comments_loading = "Loading comments..."
comments_get = Get the comments
comment_add = Add a comment
share = Share with
share_everyone = Everyone
share_your_contacts= Your contacts
delete = Delete this post
updated = Updated
content_not_found = Content not found

Loading…
Cancel
Save