Author: nathangray
New Revision: 55071
URL: http://svn.stylite.de/viewvc/egroupware?rev=55071&view=rev
Log:
Use calendar-owner widget in edit dialog for participants
Modified:
trunk/calendar/inc/class.calendar_owner_etemplate_widget.inc.php
trunk/calendar/inc/class.calendar_uiforms.inc.php
trunk/calendar/js/et2_widget_owner.js
trunk/calendar/templates/default/edit.xet
trunk/calendar/templates/pixelegg/app.css
trunk/calendar/templates/pixelegg/app.less
— trunk/calendar/inc/class.calendar_owner_etemplate_widget.inc.php (original)
+++ trunk/calendar/inc/class.calendar_owner_etemplate_widget.inc.php Thu Feb 18 21:54:26 2016
@@ -36,6 +36,7 @@
$form_name = self::form_name($cname, $this->id, $expand);
$value =& self::get_array(self::$request->content, $form_name);
@@ -88,6 +89,30 @@
}
}
- /**
-
-
-
-
@param string $cname current namespace
-
-
@param array $expand values for keys ‘c’, ‘row’, ‘c_’, ‘row_’, ‘cont’
-
-
-
@param array &$validated=array() validated content
- */
- public function validate($cname, array $expand, array $content, &$validated=array())
- {
-
$form_name = self::form_name($cname, $this->id, $expand);
-
-
if (!$this->is_readonly($cname, $form_name))
-
{
-
$value = $value_in =& self::get_array($content, $form_name);
-
if(!is_array($value))
-
{
-
$value = Array($value);
-
}
-
-
$valid =& self::get_array($validated, $form_name, true);
-
$valid = $value;
-
}
- }
/**
- Handle ajax searches for owner across all supported resources
-
— trunk/calendar/inc/class.calendar_uiforms.inc.php (original)
+++ trunk/calendar/inc/class.calendar_uiforms.inc.php Thu Feb 18 21:54:26 2016
@@ -361,66 +361,58 @@
case ‘cal_resources’:
case ‘status_date’:
break;
-
case 'add':
-
// email or rfc822 addresse (eg. "Ralf Becker <ralf@domain.com>") in the search field
-
$matches = array();
-
if (($email = $content['participants']['resource']['search']) &&
-
(preg_match('/^(.*<)?([a-z0-9_.-]+@[a-z0-9_.-]{5,})>?$/i',$email,$matches)))
-
{
-
$status = calendar_so::combine_status('U',$content['participants']['quantity'],$content['participants']['role']);
-
// check if email belongs to account or contact --> prefer them over just emails (if we are allowed to invite him)
-
if (($data = $GLOBALS['egw']->accounts->name2id($matches[2],'account_email')) && $this->bo->check_acl_invite($data))
-
case 'participant':
-
foreach($data as $participant)
-
{ // email or rfc822 addresse (eg. "Ralf Becker <ralf@domain.com>")
-
$email = array();
-
if(preg_match('/^(.*<)?([a-z0-9_.-]+@[a-z0-9_.-]{5,})>?$/i',$participant,$email))
{
-
$event['participants'][$data] = $event['participant_types']['u'][$data] = $status;
-
}
-
elseif ((list($data) = ExecMethod2('addressbook.addressbook_bo.search',array(
-
'email' => $matches[2],
-
'email_home' => $matches[2],
-
),true,'','','',false,'OR')))
-
{
-
$event['participants']['c'.$data['id']] = $event['participant_types']['c'][$data['id']] = $status;
-
$status = calendar_so::combine_status('U',$content['participants']['quantity'],$content['participants']['role']);
-
if (($data = $GLOBALS['egw']->accounts->name2id($email[2],'account_email')) && $this->bo->check_acl_invite($data))
-
{
-
$event['participants'][$data] = $event['participant_types']['u'][$data] = $status;
-
}
-
elseif ((list($data) = ExecMethod2('addressbook.addressbook_bo.search',array(
-
'email' => $email[2],
-
'email_home' => $email[2],
-
),true,'','','',false,'OR')))
-
{
-
$event['participants']['c'.$data['id']] = $event['participant_types']['c'][$data['id']] = $status;
-
}
-
else
-
{
-
$event['participants']['e'.$participant] = $event['participant_types']['e'][$participant] = $status;
-
}
}
else
{
-
$event['participants']['e'.$email] = $event['participant_types']['e'][$email] = $status;
-
}
-
}
-
elseif (!$content['participants']['account'] && !$content['participants']['resource'])
-
{
-
$msg = lang('You need to select an account, contact or resource first!');
-
}
-
break;
-
-
case 'resource':
-
if (is_array($data)) // if $data['current'] is NOT set --> $app==''
-
{
-
list($app,$id) = explode(':',$data['current']);
-
if(!$app && !$id)
-
{
-
$app = $data['app'];
-
$id = $data['id'];
-
}
-
}
-
else
-
{
-
list($app,$id) = explode(':',$data);
-
}
-
foreach($this->bo->resources as $type => $data)
-
{
-
if ($data['app'] == $app) break;
-
}
-
$uid = $this->bo->resources[$type]['app'] == $app ? $type.$id : false;
-
if ($app == 'home-accounts')
-
{
-
$data = $id;
-
}
-
// check if new entry is no account (or contact entry of an account)
-
elseif ($app != 'addressbook' || !($data = $GLOBALS['egw']->accounts->name2id($id,'person_id')) || !$this->bo->check_acl_invite($data))
-
{
-
if ($uid && $id)
-
{
-
$status = isset($this->bo->resources[$type]['new_status']) ? ExecMethod($this->bo->resources[$type]['new_status'],$id) : 'U';
-
if(is_numeric($participant))
-
{
-
$uid = 'u'.$participant;
-
$id = $participant;
-
$resource = $this->bo->resources[''];
-
}
-
else
-
{
-
$uid = $participant;
-
$id = substr($participant,1);
-
$resource = $this->bo->resources[$participant[0]];
-
}
-
if(!$this->bo->check_acl_invite($uid))
-
{
-
if(!$msg_permission_denied_added)
-
{
-
$msg .= lang('Permission denied!');
-
$msg_permission_denied_added = true;
-
}
-
continue;
-
}
-
-
$type = $resource['type'];
-
$status = isset($this->bo->resources[$type]['new_status']) ?
-
ExecMethod($this->bo->resources[$type]['new_status'],$id) :
-
($uid == $this->bo->user ? 'A' : 'U');
-
if ($status)
{
$res_info = $this->bo->resource_info($uid);
@@ -432,6 +424,7 @@
{
$event[‘participants’][$n] = $content[‘participants’][$n];
}
@@ -439,33 +432,13 @@
calendar_so::combine_status($status,$content[‘participants’][‘quantity’],$content[‘participants’][‘role’]);
}
}
-
elseif(!$msg_permission_denied_added)
-
{
-
$msg .= lang('Permission denied!');
-
$msg_permission_denied_added = true;
-
}
}
-
// if participant is a contact and no title yet, add its link title as title
-
if ($app == 'addressbook' && empty($event['title']))
-
{
-
$event['title'] = egw_link::title($app, substr($uid, 1));
-
}
-
break;
}
-
// fall-through for accounts entered as contact
-
case 'account':
-
foreach(is_array($data) ? $data : explode(',',$data) as $uid)
-
if ($uid && $this->bo->check_acl_invite($uid))
-
{
-
$event['participants'][$uid] = $event['participant_types']['u'][$uid] =
-
calendar_so::combine_status($uid == $this->bo->user ? 'A' : 'U',1,$content['participants']['role']);
-
}
-
elseif($uid && !$msg_permission_denied_added)
-
{
-
$msg .= lang('Permission denied!');
-
$msg_permission_denied_added = true;
-
}
— trunk/calendar/js/et2_widget_owner.js (original)
+++ trunk/calendar/js/et2_widget_owner.js Thu Feb 18 21:54:26 2016
@@ -75,8 +75,11 @@
// with the group
.on(‘load expand’, function() {
window.setTimeout(function() {
— trunk/calendar/templates/default/edit.xet (original)
+++ trunk/calendar/templates/default/edit.xet Thu Feb 18 21:54:26 2016
@@ -107,20 +107,12 @@
-
<vbox span="2">
-
<menulist>
-
<menupopup type="select-account" statustext="User or group" id="account" multiple="true" no_lang="true" tags="true" account_type="both" empty_label="User or group" class="et2_fullWidth" width="99%"/>
-
</menulist>
-
<link-entry id="resource" options="@cal_resources" query="app.calendar.edit_participant_search"/>
-
</vbox>
-
<vbox span="2">
-
<textbox type="integer" align="center" id="quantity" min="1" size="3"/>
-
<menulist>
-
<menupopup class="selectRole" id="role"/>
-
</menulist>
-
</vbox>
-
<calendar-owner id="participant" allowFreeEntries="true" span="2"/>
-
<textbox type="integer" align="center" id="quantity" min="1" size="3"/>
-
<menulist>
-
<menupopup class="selectRole" id="role"/>
-
</menulist>
<button align="center" label="Add" id="add" image="add" background_image="1" novalidate="1"/>
— trunk/calendar/templates/pixelegg/app.css (original)
+++ trunk/calendar/templates/pixelegg/app.css Thu Feb 18 21:54:26 2016
@@ -1747,68 +1747,12 @@
vertical-align: top;
padding-top: 3px;
}
-#calendar-edit #calendar-edit_calendar-edit-participants tbody span.ui-icon-search {
- /.background_color_10_gray;/
- -webkit-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5);
- -moz-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5);
- box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5);
- border: 1px solid rgba(0, 0, 0, 0.15);
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
- background-size: 16px 16px;
- width: 16px;
- height: 16px;
- margin-left: 3px;
- position: relative;
- top: 4px;
-}
-#calendar-edit #calendar-edit_calendar-edit-participants tbody span.ui-icon-search:hover {
- /.background_color_20_gray;/
- -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
- -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
- box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
- border: 1px solid rgba(0, 0, 0, 0.5);
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-#calendar-edit #calendar-edit_calendar-edit-participants tbody span.ui-icon-searchactive {
- /.background_color_30_gray;/
- border: 1px solid rgba(0, 0, 0, 0.9);
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
- -webkit-box-shadow: inset 1px 2px 1px rgba(0, 0, 0, 0.5);
- -moz-box-shadow: inset 1px 2px 1px rgba(0, 0, 0, 0.5);
- box-shadow: inset 1px 2px 1px rgba(0, 0, 0, 0.5);
- background-color: #1aa200;
-}
#calendar-edit #calendar-edit_calendar-edit-participants tbody input#calendar-edit_quantity {
width: 30px;
/* position: relative;
top: 34px;
left: 40px;*/
margin: 6px 0px;
-}
-#calendar-edit #calendar-edit_calendar-edit-participants tbody div#calendar-edit_resource {
- margin: 5px 0 10px 0;
-}
-#calendar-edit #calendar-edit_calendar-edit-participants tbody div#calendar-edit_resource select {
- margin-right: 3px;
-}
-#calendar-edit #calendar-edit_calendar-edit-participants tbody select#calendar-edit_role {
- /width: 30px;/
- /* position: relative;
-
top: 6px;
-
left: -168px;*/
- width: 120px;
- margin-top: 2px;
-}
-#calendar-edit #calendar-edit_calendar-edit-participants tbody #calendar-edit_add {
- position: relative;
- /left: -145px;/
- top: 31px;
}
#calendar-edit #calendar-edit_calendar-edit-recurrence tbody {
display: table;
— trunk/calendar/templates/pixelegg/app.less (original)
+++ trunk/calendar/templates/pixelegg/app.less Thu Feb 18 21:54:26 2016
@@ -565,20 +565,6 @@
td {vertical-align: top; padding-top: 3px;}
-
// Suchen Bild
-
-
span.ui-icon-search {
-
.Complete_Button_Icon_normal;
-
background-size: 16px 16px;
-
.dimension_width_height_s;
-
margin-left: 3px;
-
position: relative;
-
top: 4px;
-
-
&:hover {.Complete_Button_Icon_hover;}
-
&active {.Complete_Button_Icon_active;}
-
}
-
// Quantity
input#calendar-edit_quantity {
width: 30px;
@@ -588,36 +574,6 @@
margin: 6px 0px;
}
-
-
// Ressourcen
-
-
div#calendar-edit_resource {
-
margin: 5px 0 10px 0;
-
-
select {margin-right: 3px;}
-
}
-
-
-
// Rolle
-
-
select#calendar-edit_role {
-
/*width: 30px;*/
-/* position: relative;
-
top: 6px;
-
left: -168px;*/
-
width: 120px;
-
margin-top: 2px;
-
}
-
-
// hinzufügen button
-
-
#calendar-edit_add {
-
-
position: relative;
-
/*left: -145px;*/
-
top: 31px;
-
-
}
}
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs