mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 16:07:03 +03:00
Implementation of share contacts (begin)
This commit is contained in:
parent
5198dcfa20
commit
026839d864
17 changed files with 469 additions and 50 deletions
|
|
@ -5927,6 +5927,9 @@ class Actions
|
|||
/* @var $mResponse \RainLoop\Providers\PersonalAddressBook\Classes\Contact */
|
||||
'IdContact' => $mResponse->IdContact,
|
||||
'Display' => \MailSo\Base\Utils::Utf8Clear($mResponse->Display),
|
||||
'ReadOnly' => $mResponse->ReadOnly,
|
||||
'ScopeType' => $mResponse->ScopeType,
|
||||
'ScopeValue' => $mResponse->ScopeValue,
|
||||
'IdPropertyFromSearch' => $mResponse->IdPropertyFromSearch,
|
||||
'Properties' => $this->responseObject($mResponse->Properties, $sParent, $aParameters)
|
||||
));
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ class Contact
|
|||
*/
|
||||
public $ScopeType;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $ScopeValue;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
@ -44,6 +49,11 @@ class Contact
|
|||
*/
|
||||
public $Properties;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $ReadOnly;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->Clear();
|
||||
|
|
@ -57,9 +67,11 @@ class Contact
|
|||
$this->DisplayName = '';
|
||||
$this->DisplayEmail = '';
|
||||
$this->ScopeType = \RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::DEFAULT_;
|
||||
$this->ScopeValue = '';
|
||||
$this->Changed = \time();
|
||||
$this->IdPropertyFromSearch = 0;
|
||||
$this->Properties = array();
|
||||
$this->ReadOnly = false;
|
||||
}
|
||||
|
||||
public function UpdateDependentValues()
|
||||
|
|
@ -72,6 +84,7 @@ class Contact
|
|||
if ($oProperty)
|
||||
{
|
||||
$oProperty->ScopeType = $this->ScopeType;
|
||||
$oProperty->ScopeValue = $this->ScopeValue;
|
||||
$oProperty->UpdateDependentValues();
|
||||
|
||||
if ('' === $sDisplayName && \RainLoop\Providers\PersonalAddressBook\Enumerations\PropertyType::FULLNAME === $oProperty->Type &&
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@ class Property
|
|||
*/
|
||||
public $ScopeType;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $ScopeValue;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
|
@ -52,6 +57,7 @@ class Property
|
|||
|
||||
$this->Type = PropertyType::UNKNOWN;
|
||||
$this->ScopeType = \RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::DEFAULT_;
|
||||
$this->ScopeValue = '';
|
||||
$this->TypeCustom = '';
|
||||
|
||||
$this->Value = '';
|
||||
|
|
|
|||
|
|
@ -6,5 +6,7 @@ class ScopeType
|
|||
{
|
||||
const DEFAULT_ = 0;
|
||||
const AUTO = 1;
|
||||
const SHARE = 2;
|
||||
const SHARE_ALL = 2;
|
||||
const SHARE_DOMAIN = 3;
|
||||
const SHARE_EMAIL = 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class PdoPersonalAddressBook
|
|||
$aFreq = $this->getContactFreq($iUserID, $iIdContact);
|
||||
|
||||
$sSql = 'UPDATE rainloop_pab_contacts SET display = :display, display_name = :display_name, display_email = :display_email, '.
|
||||
'scope_type = :scope_type, changed = :changed WHERE id_user = :id_user AND id_contact = :id_contact';
|
||||
'scope_type = :scope_type, scope_value = :scope_value, changed = :changed WHERE id_user = :id_user AND id_contact = :id_contact';
|
||||
|
||||
$this->prepareAndExecute($sSql,
|
||||
array(
|
||||
|
|
@ -121,6 +121,7 @@ class PdoPersonalAddressBook
|
|||
':display_name' => array($oContact->DisplayName, \PDO::PARAM_STR),
|
||||
':display_email' => array($oContact->DisplayEmail, \PDO::PARAM_STR),
|
||||
':scope_type' => array($oContact->ScopeType, \PDO::PARAM_INT),
|
||||
':scope_value' => array($oContact->ScopeValue, \PDO::PARAM_STR),
|
||||
':changed' => array($oContact->Changed, \PDO::PARAM_INT),
|
||||
)
|
||||
);
|
||||
|
|
@ -137,8 +138,8 @@ class PdoPersonalAddressBook
|
|||
else
|
||||
{
|
||||
$sSql = 'INSERT INTO rainloop_pab_contacts '.
|
||||
'( id_user, display, display_name, display_email, scope_type, changed) VALUES '.
|
||||
'(:id_user, :display, :display_name, :display_email, :scope_type, :changed)';
|
||||
'( id_user, display, display_name, display_email, scope_type, scope_value, changed) VALUES '.
|
||||
'(:id_user, :display, :display_name, :display_email, :scope_type, :scope_value, :changed)';
|
||||
|
||||
$this->prepareAndExecute($sSql,
|
||||
array(
|
||||
|
|
@ -147,6 +148,7 @@ class PdoPersonalAddressBook
|
|||
':display_name' => array($oContact->DisplayName, \PDO::PARAM_STR),
|
||||
':display_email' => array($oContact->DisplayEmail, \PDO::PARAM_STR),
|
||||
':scope_type' => array($oContact->ScopeType, \PDO::PARAM_INT),
|
||||
':scope_value' => array($oContact->ScopeValue, \PDO::PARAM_STR),
|
||||
':changed' => array($oContact->Changed, \PDO::PARAM_INT)
|
||||
)
|
||||
);
|
||||
|
|
@ -174,6 +176,7 @@ class PdoPersonalAddressBook
|
|||
':id_contact' => array($iIdContact, \PDO::PARAM_INT),
|
||||
':id_user' => array($iUserID, \PDO::PARAM_INT),
|
||||
':scope_type' => array($oContact->ScopeType, \PDO::PARAM_INT),
|
||||
':scope_value' => array($oContact->ScopeValue, \PDO::PARAM_STR),
|
||||
':prop_type' => array($oProp->Type, \PDO::PARAM_INT),
|
||||
':prop_type_custom' => array($oProp->TypeCustom, \PDO::PARAM_STR),
|
||||
':prop_value' => array($oProp->Value, \PDO::PARAM_STR),
|
||||
|
|
@ -183,8 +186,8 @@ class PdoPersonalAddressBook
|
|||
}
|
||||
|
||||
$sSql = 'INSERT INTO rainloop_pab_properties '.
|
||||
'( id_contact, id_user, prop_type, prop_type_custom, prop_value, prop_value_custom, scope_type, prop_frec) VALUES '.
|
||||
'(:id_contact, :id_user, :prop_type, :prop_type_custom, :prop_value, :prop_value_custom, :scope_type, :prop_frec)';
|
||||
'( id_contact, id_user, prop_type, prop_type_custom, prop_value, prop_value_custom, scope_type, scope_value, prop_frec) VALUES '.
|
||||
'(:id_contact, :id_user, :prop_type, :prop_type_custom, :prop_value, :prop_value_custom, :scope_type, :scope_value, :prop_frec)';
|
||||
|
||||
$this->prepareAndExecute($sSql, $aParams, true);
|
||||
}
|
||||
|
|
@ -286,7 +289,10 @@ class PdoPersonalAddressBook
|
|||
$iLimit = 0 < $iLimit ? (int) $iLimit : 20;
|
||||
$sSearch = \trim($sSearch);
|
||||
|
||||
$iUserID = $this->getUserId($oAccount->ParentEmailHelper());
|
||||
$sEmail = $oAccount->ParentEmailHelper();
|
||||
$sDomain = \MailSo\Base\Utils::GetDomainFromEmail($sEmail);
|
||||
|
||||
$iUserID = $this->getUserId($sEmail);
|
||||
|
||||
$iCount = 0;
|
||||
$aSearchIds = array();
|
||||
|
|
@ -294,15 +300,24 @@ class PdoPersonalAddressBook
|
|||
|
||||
if (0 < \strlen($sSearch))
|
||||
{
|
||||
$sSql = 'SELECT id_prop, id_contact FROM rainloop_pab_properties WHERE id_user = :id_user'.
|
||||
' AND scope_type = :scope_type AND prop_value LIKE :search ESCAPE \'=\' GROUP BY id_contact, id_prop';
|
||||
|
||||
$sSql = 'SELECT id_user, id_prop, id_contact FROM rainloop_pab_properties '.
|
||||
'WHERE ('.
|
||||
'(id_user = :id_user)'.
|
||||
' OR (scope_type = :scope_type_share_all)'.
|
||||
' OR (scope_type = :scope_type_share_domain AND scope_value = :scope_value_domain)'.
|
||||
' OR (scope_type = :scope_type_share_email AND scope_value = :scope_value_email)'.
|
||||
') AND prop_value LIKE :search ESCAPE \'=\' GROUP BY id_contact, id_prop';
|
||||
|
||||
$aParams = array(
|
||||
':id_user' => array($iUserID, \PDO::PARAM_INT),
|
||||
':scope_type' => array($iScopeType, \PDO::PARAM_INT),
|
||||
':scope_type_share_all' => array(\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::SHARE_ALL, \PDO::PARAM_INT),
|
||||
':scope_type_share_domain' => array(\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::SHARE_DOMAIN, \PDO::PARAM_INT),
|
||||
':scope_type_share_email' => array(\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::SHARE_EMAIL, \PDO::PARAM_INT),
|
||||
':scope_value_domain' => array($sDomain, \PDO::PARAM_STR),
|
||||
':scope_value_email' => array($sEmail, \PDO::PARAM_STR),
|
||||
':search' => array($this->specialConvertSearchValue($sSearch, '='), \PDO::PARAM_STR)
|
||||
);
|
||||
|
||||
|
||||
$oStmt = $this->prepareAndExecute($sSql, $aParams);
|
||||
if ($oStmt)
|
||||
{
|
||||
|
|
@ -325,10 +340,22 @@ class PdoPersonalAddressBook
|
|||
}
|
||||
else
|
||||
{
|
||||
$sSql = 'SELECT COUNT(DISTINCT id_contact) as contact_count FROM rainloop_pab_properties WHERE id_user = :id_user AND scope_type = :scope_type';
|
||||
$sSql = 'SELECT COUNT(DISTINCT id_contact) as contact_count FROM rainloop_pab_properties '.
|
||||
'WHERE ('.
|
||||
'(id_user = :id_user)'.
|
||||
' OR (scope_type = :scope_type_share_all)'.
|
||||
' OR (scope_type = :scope_type_share_domain AND scope_value = :scope_value_domain)'.
|
||||
' OR (scope_type = :scope_type_share_email AND scope_value = :scope_value_email)'.
|
||||
')'
|
||||
;
|
||||
|
||||
$aParams = array(
|
||||
':id_user' => array($iUserID, \PDO::PARAM_INT),
|
||||
':scope_type' => array($iScopeType, \PDO::PARAM_INT)
|
||||
':scope_type_share_all' => array(\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::SHARE_ALL, \PDO::PARAM_INT),
|
||||
':scope_type_share_domain' => array(\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::SHARE_DOMAIN, \PDO::PARAM_INT),
|
||||
':scope_type_share_email' => array(\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::SHARE_EMAIL, \PDO::PARAM_INT),
|
||||
':scope_value_domain' => array($sDomain, \PDO::PARAM_STR),
|
||||
':scope_value_email' => array($sEmail, \PDO::PARAM_STR)
|
||||
);
|
||||
|
||||
$oStmt = $this->prepareAndExecute($sSql, $aParams);
|
||||
|
|
@ -346,10 +373,22 @@ class PdoPersonalAddressBook
|
|||
|
||||
if (0 < $iCount)
|
||||
{
|
||||
$sSql = 'SELECT * FROM rainloop_pab_contacts WHERE id_user = :id_user AND scope_type = :scope_type';
|
||||
$sSql = 'SELECT * FROM rainloop_pab_contacts '.
|
||||
'WHERE ('.
|
||||
'(id_user = :id_user)'.
|
||||
' OR (scope_type = :scope_type_share_all)'.
|
||||
' OR (scope_type = :scope_type_share_domain AND scope_value = :scope_value_domain)'.
|
||||
' OR (scope_type = :scope_type_share_email AND scope_value = :scope_value_email)'.
|
||||
')'
|
||||
;
|
||||
|
||||
$aParams = array(
|
||||
':id_user' => array($iUserID, \PDO::PARAM_INT),
|
||||
':scope_type' => array($iScopeType, \PDO::PARAM_INT)
|
||||
':scope_type_share_all' => array(\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::SHARE_ALL, \PDO::PARAM_INT),
|
||||
':scope_type_share_domain' => array(\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::SHARE_DOMAIN, \PDO::PARAM_INT),
|
||||
':scope_type_share_email' => array(\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::SHARE_EMAIL, \PDO::PARAM_INT),
|
||||
':scope_value_domain' => array($sDomain, \PDO::PARAM_STR),
|
||||
':scope_value_email' => array($sEmail, \PDO::PARAM_STR)
|
||||
);
|
||||
|
||||
if (0 < \count($aSearchIds))
|
||||
|
|
@ -384,7 +423,9 @@ class PdoPersonalAddressBook
|
|||
$oContact->DisplayEmail = isset($aItem['display_email']) ? (string) $aItem['display_email'] : '';
|
||||
$oContact->ScopeType = isset($aItem['scope_type']) ? (int) $aItem['scope_type'] :
|
||||
\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::DEFAULT_;
|
||||
$oContact->ScopeValue = isset($aItem['scope_value']) ? (string) $aItem['scope_value'] : '';
|
||||
$oContact->Changed = isset($aItem['changed']) ? (int) $aItem['changed'] : 0;
|
||||
$oContact->ReadOnly = $iUserID !== (isset($aItem['id_user']) ? (int) $aItem['id_user'] : 0);
|
||||
|
||||
$oContact->IdPropertyFromSearch = isset($aPropertyFromSearchIds[$iIdContact]) &&
|
||||
0 < $aPropertyFromSearchIds[$iIdContact] ? $aPropertyFromSearchIds[$iIdContact] : 0;
|
||||
|
|
@ -400,10 +441,8 @@ class PdoPersonalAddressBook
|
|||
{
|
||||
$oStmt->closeCursor();
|
||||
|
||||
$sSql = 'SELECT * FROM rainloop_pab_properties WHERE id_user = :id_user AND id_contact IN ('.\implode(',', $aIdContacts).')';
|
||||
$oStmt = $this->prepareAndExecute($sSql, array(
|
||||
':id_user' => array($iUserID, \PDO::PARAM_INT)
|
||||
));
|
||||
$sSql = 'SELECT * FROM rainloop_pab_properties WHERE id_contact IN ('.\implode(',', $aIdContacts).')';
|
||||
$oStmt = $this->prepareAndExecute($sSql);
|
||||
|
||||
if ($oStmt)
|
||||
{
|
||||
|
|
@ -421,6 +460,7 @@ class PdoPersonalAddressBook
|
|||
$oProperty->IdProperty = (int) $aItem['id_prop'];
|
||||
$oProperty->ScopeType = isset($aItem['scope_type']) ? (int) $aItem['scope_type'] :
|
||||
\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::DEFAULT_;
|
||||
$oProperty->ScopeValue = isset($aItem['scope_value']) ? (string) $aItem['scope_value'] : '';
|
||||
$oProperty->Type = (int) $aItem['prop_type'];
|
||||
$oProperty->TypeCustom = isset($aItem['prop_type_custom']) ? (string) $aItem['prop_type_custom'] : '';
|
||||
$oProperty->Value = (string) $aItem['prop_value'];
|
||||
|
|
@ -467,18 +507,32 @@ class PdoPersonalAddressBook
|
|||
}
|
||||
|
||||
$this->Sync();
|
||||
$iUserID = $this->getUserId($oAccount->ParentEmailHelper());
|
||||
|
||||
$sEmail = $oAccount->ParentEmailHelper();
|
||||
$sDomain = \MailSo\Base\Utils::GetDomainFromEmail($sEmail);
|
||||
|
||||
$iUserID = $this->getUserId($sEmail);
|
||||
|
||||
$sTypes = implode(',', array(
|
||||
PropertyType::EMAIl_PERSONAL, PropertyType::EMAIl_BUSSINES, PropertyType::EMAIl_OTHER, PropertyType::FULLNAME
|
||||
));
|
||||
|
||||
$sSql = 'SELECT id_contact, id_prop, prop_type, prop_value FROM rainloop_pab_properties '.
|
||||
'WHERE id_user = :id_user AND prop_type IN ('.$sTypes.') AND prop_value LIKE :search ESCAPE \'=\'';
|
||||
'WHERE ('.
|
||||
'(id_user = :id_user)'.
|
||||
' OR (scope_type = :scope_type_share_all)'.
|
||||
' OR (scope_type = :scope_type_share_domain AND scope_value = :scope_value_domain)'.
|
||||
' OR (scope_type = :scope_type_share_email AND scope_value = :scope_value_email)'.
|
||||
') AND prop_type IN ('.$sTypes.') AND prop_value LIKE :search ESCAPE \'=\'';
|
||||
|
||||
$aParams = array(
|
||||
':id_user' => array($iUserID, \PDO::PARAM_INT),
|
||||
':limit' => array($iLimit, \PDO::PARAM_INT),
|
||||
':scope_type_share_all' => array(\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::SHARE_ALL, \PDO::PARAM_INT),
|
||||
':scope_type_share_domain' => array(\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::SHARE_DOMAIN, \PDO::PARAM_INT),
|
||||
':scope_type_share_email' => array(\RainLoop\Providers\PersonalAddressBook\Enumerations\ScopeType::SHARE_EMAIL, \PDO::PARAM_INT),
|
||||
':scope_value_domain' => array($sDomain, \PDO::PARAM_STR),
|
||||
':scope_value_email' => array($sEmail, \PDO::PARAM_STR),
|
||||
':search' => array($this->specialConvertSearchValue($sSearch, '='), \PDO::PARAM_STR)
|
||||
);
|
||||
|
||||
|
|
@ -537,11 +591,9 @@ class PdoPersonalAddressBook
|
|||
));
|
||||
|
||||
$sSql = 'SELECT id_prop, id_contact, prop_type, prop_value FROM rainloop_pab_properties '.
|
||||
'WHERE id_user = :id_user AND prop_type IN ('.$sTypes.') AND id_contact IN ('.\implode(',', $aIdContacts).')';
|
||||
'WHERE prop_type IN ('.$sTypes.') AND id_contact IN ('.\implode(',', $aIdContacts).')';
|
||||
|
||||
$oStmt = $this->prepareAndExecute($sSql, array(
|
||||
':id_user' => array($iUserID, \PDO::PARAM_INT)
|
||||
));
|
||||
$oStmt = $this->prepareAndExecute($sSql);
|
||||
if ($oStmt)
|
||||
{
|
||||
$aFetch = $oStmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
|
|
@ -990,15 +1042,27 @@ SQLITEINITIAL;
|
|||
{
|
||||
case 'mysql':
|
||||
return $this->dataBaseUpgrade($this->sDsnType.'-pab-version', array(
|
||||
1 => $this->getInitialTablesArray($this->sDsnType)
|
||||
1 => $this->getInitialTablesArray($this->sDsnType),
|
||||
2 => array(
|
||||
'ALTER TABLE rainloop_pab_contacts ADD scope_value varchar(128) NOT NULL DEFAULT \'\' AFTER scope_type',
|
||||
'ALTER TABLE rainloop_pab_properties ADD scope_value varchar(128) NOT NULL DEFAULT \'\' AFTER scope_type'
|
||||
)
|
||||
));
|
||||
case 'pgsql':
|
||||
return $this->dataBaseUpgrade($this->sDsnType.'-pab-version', array(
|
||||
1 => $this->getInitialTablesArray($this->sDsnType)
|
||||
1 => $this->getInitialTablesArray($this->sDsnType),
|
||||
2 => array(
|
||||
'ALTER TABLE rainloop_pab_contacts ADD scope_value varchar(128) NOT NULL DEFAULT \'\'',
|
||||
'ALTER TABLE rainloop_pab_properties ADD scope_value varchar(128) NOT NULL DEFAULT \'\''
|
||||
)
|
||||
));
|
||||
case 'sqlite':
|
||||
return $this->dataBaseUpgrade($this->sDsnType.'-pab-version', array(
|
||||
1 => $this->getInitialTablesArray($this->sDsnType)
|
||||
1 => $this->getInitialTablesArray($this->sDsnType),
|
||||
2 => array(
|
||||
'ALTER TABLE rainloop_pab_contacts ADD scope_value text NOT NULL default \'\'',
|
||||
'ALTER TABLE rainloop_pab_properties ADD scope_value text NOT NULL default \'\''
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,9 @@
|
|||
<div class="checkedParent">
|
||||
<i class="checkboxItem" data-bind="css: checked() || selected() ? 'checkboxMessage icon-checkbox-checked' : 'checkboxMessage icon-checkbox-unchecked'"></i>
|
||||
</div>
|
||||
<div class="shareParent actionHandle">
|
||||
<i class="icon-share"></i>
|
||||
</div>
|
||||
<div class="nameParent actionHandle">
|
||||
<span class="listName" data-bind="text: display"></span>
|
||||
|
||||
|
|
@ -83,7 +86,7 @@
|
|||
<!-- ko template: { name: 'Pagenator', data: contactsPagenator } --><!-- /ko -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="b-view-content" data-bind="nano: true">
|
||||
<div class="b-view-content" data-bind="nano: true, css: {'read-only': viewReadOnly}">
|
||||
<div class="content g-scrollbox">
|
||||
<div class="content-wrapper">
|
||||
<div class="b-contact-view-desc" data-bind="visible: emptySelection">
|
||||
|
|
@ -91,40 +94,43 @@
|
|||
</div>
|
||||
<div data-bind="visible: !emptySelection()">
|
||||
<div class="form-horizontal top-part">
|
||||
<div class="control-group">
|
||||
<div class="control-group" data-bind="visible: !viewReadOnly() || 0 < viewPropertiesNames().length">
|
||||
<label class="control-label remove-padding-top fix-width">
|
||||
<i class="icon-user iconsize24" data-placement="left" data-bind="tooltip: 'CONTACTS/LABEL_DISPLAY_NAME'"></i>
|
||||
</label>
|
||||
<div class="controls fix-width" data-bind="foreach: viewPropertiesNames">
|
||||
<div class="property-line">
|
||||
<span class="contactValueStatic" data-bind="text: value" />
|
||||
<input type="text" class="contactValueInput" data-bind="value: value, hasFocus: focused, valueUpdate: 'keyup'" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-group" data-bind="visible: !viewReadOnly() || 0 < viewPropertiesEmails().length">
|
||||
<label class="control-label remove-padding-top fix-width">
|
||||
<i class="icon-at iconsize24" data-placement="left" data-bind="tooltip: 'CONTACTS/LABEL_EMAIL'"></i>
|
||||
</label>
|
||||
<div class="controls fix-width">
|
||||
<div data-bind="foreach: viewPropertiesEmails">
|
||||
<div class="property-line">
|
||||
<span class="contactValueStatic" data-bind="text: value" />
|
||||
<input type="email" class="contactValueInput" data-bind="value: value, hasFocus: focused, valueUpdate: 'keyup'" />
|
||||
</div>
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="g-ui-link add-link i18n" data-bind="click: addNewEmail" data-i18n-text="CONTACTS/LINK_ADD_EMAIL"></a>
|
||||
<a href="javascript:void(0);" class="g-ui-link add-link i18n" data-bind="visible: !viewReadOnly(), click: addNewEmail" data-i18n-text="CONTACTS/LINK_ADD_EMAIL"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-group" data-bind="visible: !viewReadOnly() || 0 < viewPropertiesPhones().length">
|
||||
<label class="control-label remove-padding-top fix-width">
|
||||
<i class="icon-telephone iconsize24" data-placement="left" data-bind="tooltip: 'CONTACTS/LABEL_PHONE'"></i>
|
||||
</label>
|
||||
<div class="controls fix-width">
|
||||
<div data-bind="foreach: viewPropertiesPhones">
|
||||
<div class="property-line">
|
||||
<span class="contactValueStatic" data-bind="text: value" />
|
||||
<input type="text" class="contactValueInput" data-bind="value: value, hasFocus: focused, valueUpdate: 'keyup'" />
|
||||
</div>
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="g-ui-link add-link i18n" data-bind="click: addNewPhone" data-i18n-text="CONTACTS/LINK_ADD_PHONE"></a>
|
||||
<a href="javascript:void(0);" class="g-ui-link add-link i18n" data-bind="visible: !viewReadOnly(), click: addNewPhone" data-i18n-text="CONTACTS/LINK_ADD_PHONE"></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="control-group" data-bind="foreach: viewPropertiesOther">
|
||||
|
|
@ -133,6 +139,7 @@
|
|||
</label>
|
||||
<div class="controls fix-width">
|
||||
<div class="property-line">
|
||||
<span class="contactValueStatic" data-bind="text: value" />
|
||||
<input type="text" class="contactValueInput" data-bind="value: value, hasFocus: focused, valueUpdate: 'keyup'" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -145,6 +152,43 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="e-read-only-sign" style="display: none">
|
||||
<i class="icon-lock iconsize24" data-placement="left" data-bind="tooltip: 'CONTACTS/LABEL_READ_ONLY'"></i>
|
||||
</div>
|
||||
|
||||
<div class="e-share-sign" style="display: none">
|
||||
<div class="btn-group pull-right">
|
||||
<a class="btn dropdown-toggle" data-placement="left" data-toggle="dropdown" data-bind="tooltip: 'CONTACTS/LABEL_SHARE'">
|
||||
<i class="icon-share"></i>
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu g-ui-menu">
|
||||
<li class="e-item">
|
||||
<a class="e-link" data-bind="css: {'selected': this.shareToNone}">
|
||||
<i class="icon-none"></i>
|
||||
|
||||
<span class="i18n" data-i18n-text="CONTACTS/BUTTON_SHARE_NONE"></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="e-item">
|
||||
<a class="e-link" data-bind="css: {'selected': this.shareToDomain}">
|
||||
<i class="icon-none"></i>
|
||||
|
||||
<span class="i18n" data-i18n-text="CONTACTS/BUTTON_SHARE_DOMAIN"></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="e-item">
|
||||
<a class="e-link" data-bind="css: {'selected': this.shareToAll}">
|
||||
<i class="icon-none"></i>
|
||||
|
||||
<span class="i18n" data-i18n-text="CONTACTS/BUTTON_SHARE_ALL"></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="btn button-save-contact" data-bind="command: saveCommand">
|
||||
<i data-bind="css: {'icon-ok': !viewSaving(), 'icon-spinner animated': viewSaving()}"></i>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue