Changeset 4297 in subversion
- Timestamp:
- Dec 1, 2010 1:04:23 PM (2 years ago)
- Location:
- branches/devel-addressbook
- Files:
-
- 15 edited
-
index.php (modified) (1 diff)
-
program/include/html.php (modified) (1 diff)
-
program/include/rcube_browser.php (modified) (1 diff)
-
program/include/rcube_contacts.php (modified) (1 diff)
-
program/include/rcube_vcard.php (modified) (1 diff)
-
program/js/app.js (modified) (5 diffs)
-
program/steps/addressbook/export.inc (modified) (1 diff)
-
program/steps/addressbook/func.inc (modified) (4 diffs)
-
program/steps/addressbook/show.inc (modified) (1 diff)
-
skins/default/addressbook.css (modified) (3 diffs)
-
skins/default/functions.js (modified) (3 diffs)
-
skins/default/iehacks.css (modified) (1 diff)
-
skins/default/templates/contact.html (modified) (1 diff)
-
skins/default/templates/contactadd.html (modified) (1 diff)
-
skins/default/templates/contactedit.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/devel-addressbook/index.php
r4088 r4297 213 213 'addressbook' => array( 214 214 'add' => 'edit.inc', 215 'photo' => 'show.inc', 215 216 'group-create' => 'groups.inc', 216 217 'group-rename' => 'groups.inc', -
branches/devel-addressbook/program/include/html.php
r4239 r4297 72 72 public static function tag($tagname, $attrib = array(), $content = null, $allowed_attrib = null) 73 73 { 74 if (is_string($attrib)) 75 $attrib = array('class' => $attrib); 76 74 77 $inline_tags = array('a','span','img'); 75 78 $suffix = $attrib['nl'] || ($content && $attrib['nl'] !== false && !in_array($tagname, $inline_tags)) ? "\n" : ''; -
branches/devel-addressbook/program/include/rcube_browser.php
r3989 r4297 69 69 $this->pngalpha = $this->mz || $this->safari || ($this->ie && $this->ver>=5.5) || 70 70 ($this->ie && $this->ver>=5 && $this->mac) || ($this->opera && $this->ver>=7) ? true : false; 71 $this->imgdata = !$this->ie; 71 72 } 72 73 } -
branches/devel-addressbook/program/include/rcube_contacts.php
r4271 r4297 57 57 public $coltypes = array('name', 'firstname', 'surname', 'middlename', 'prefix', 'suffix', 'nickname', 58 58 'jobtitle', 'organization', 'department', 'gender', 'maidenname', 'email', 'phone', 'address', 59 'birthday', 'website', 'im', 'notes' );59 'birthday', 'website', 'im', 'notes', 'photo'); 60 60 61 61 -
branches/devel-addressbook/program/include/rcube_vcard.php
r4289 r4297 33 33 'N' => array(array('','','','','')), 34 34 ); 35 private $fieldmap = array('pho ne' => 'TEL', 'birthday' => 'BDAY', 'website' => 'URL', 'notes' => 'NOTE', 'email' => 'EMAIL', 'address' => 'ADR', 'gender' => 'X-GENDER', 'maidenname' => 'X-MAIDENNAME', 'gender' => 'X-GENDER');35 private $fieldmap = array('photo' => 'PHOTO', 'phone' => 'TEL', 'birthday' => 'BDAY', 'website' => 'URL', 'notes' => 'NOTE', 'email' => 'EMAIL', 'address' => 'ADR', 'gender' => 'X-GENDER', 'maidenname' => 'X-MAIDENNAME', 'gender' => 'X-GENDER'); 36 36 private $typemap = array('iPhone' => 'mobile', 'CELL' => 'mobile'); 37 37 private $phonetypemap = array('HOME1' => 'HOME', 'BUSINESS1' => 'WORK', 'BUSINESS2' => 'WORK2', 'WORKFAX' => 'BUSINESSFAX'); -
branches/devel-addressbook/program/js/app.js
r4265 r4297 324 324 for (var col in this.env.coltypes) 325 325 this.init_edit_field(col, null); 326 327 $('#contactpicframe').click(function(){ ref.upload_contact_photo(this); return false; }); 326 328 327 329 $('.contactfieldgroup .row a.deletebutton').click(function(){ ref.delete_edit_field(this); return false }); … … 4005 4007 4006 4008 if (!appendcontainer.length) 4007 appendcontainer = $('< div>').addClass('contactfieldgroup contactcontroller'+col).insertAfter($('#contactsection'+section+' .contactfieldgroup').last());4008 4009 if (appendcontainer.length && appendcontainer.get(0).nodeName == ' DIV') {4009 appendcontainer = $('<fieldset>').addClass('contactfieldgroup contactcontroller'+col).insertAfter($('#contactsection'+section+' .contactfieldgroup').last()); 4010 4011 if (appendcontainer.length && appendcontainer.get(0).nodeName == 'FIELDSET') { 4010 4012 var input, colprop = this.env.coltypes[col], 4011 4013 row = $('<div>').addClass('row'), … … 4066 4068 .appendTo(cell); 4067 4069 4068 row.append(label).append(cell).appendTo(appendcontainer );4070 row.append(label).append(cell).appendTo(appendcontainer.show()); 4069 4071 input.first().focus(); 4070 4072 … … 4078 4080 }; 4079 4081 4080 this.delete_edit_field = function(elem){ 4082 this.delete_edit_field = function(elem) 4083 { 4081 4084 var col = $(elem).attr('rel'), 4082 4085 colprop = this.env.coltypes[col], … … 4102 4105 4103 4106 4107 this.upload_contact_photo = function(frame) 4108 { 4109 // TODO: implement this 4110 }; 4111 4112 4104 4113 /*********************************************************/ 4105 4114 /********* user settings methods *********/ -
branches/devel-addressbook/program/steps/addressbook/export.inc
r4265 r4297 31 31 32 32 while ($result && ($row = $result->next())) { 33 // we already have a vcard record 34 if ($row['vcard']) { 35 echo $row['vcard']; 36 } 33 37 // copy values into vcard object 34 $vcard = new rcube_vcard($row['vcard']); 35 $vcard->reset(); 36 foreach ($row as $key => $values) { 38 else { 39 $vcard = new rcube_vcard($row['vcard']); 40 $vcard->reset(); 41 foreach ($row as $key => $values) { 37 42 list($field, $section) = explode(':', $key); 38 43 foreach ((array)$values as $value) { 39 if (is_array($value) || strlen($value))40 $vcard->set($field, $value, strtoupper($section));44 if (is_array($value) || strlen($value)) 45 $vcard->set($field, $value, strtoupper($section)); 41 46 } 47 } 48 49 echo $vcard->export(); 42 50 } 43 44 echo $vcard->export();45 51 } 46 52 -
branches/devel-addressbook/program/steps/addressbook/func.inc
r4289 r4297 84 84 'im' => array('type' => 'text', 'size' => 40, 'label' => rcube_label('instantmessenger'), 'subtypes' => array('aim','icq','msn','yahoo','jabber','other')), 85 85 'notes' => array('type' => 'textarea', 'size' => 40, 'rows' => 15, 'label' => rcube_label('notes'), 'limit' => 1), 86 'photo' => array('type' => 'image', 'limit' => 1), 86 87 // TODO: define fields for vcards GEO, PHOTO, KEY, X-ANNIVERSARY, X-ASSISTANT, X-MANAGER 87 88 ); … … 288 289 $record = $plugin['record']; 289 290 $formdata = array(); 291 $edit_mode = $RCMAIL->action != 'show'; 292 $pic_img = $attrib['picplaceholder'] ? $CONFIG['skin_path'] . $attrib['picplaceholder'] : 'program/blank.gif'; 290 293 $del_button = $attrib['deleteicon'] ? html::img(array('src' => $CONFIG['skin_path'] . $attrib['deleteicon'], 'alt' => rcube_label('delete'))) : rcube_label('delete'); 291 $edit_mode = $RCMAIL->action != 'show';294 unset($attrib['picplaceholder'], $attrib['deleteicon']); 292 295 $out = ''; 293 296 … … 319 322 if ($section == 'head') { 320 323 $content = ''; 324 325 if ($coltypes['photo']) { 326 if ($record['photo']) 327 $pic_img = $browser->imgdata ? 'data:image/jpeg;base64,' . $data : $RCMAIL->url(array('_action' => 'photo', '_cid' => $record['ID'], '_source' => $_REQUEST['_source'])); 328 $img = html::img(array('src' => $pic_img, 'border' => 1, 'alt' => '')); 329 if ($edit_mode) { 330 $label = $record['photo'] ? rcube_label('replacephoto') : rcube_label('addphoto'); 331 $img = html::a(array('href' => '#', 'id' => 'contactpicframe', 'title' => $label), $img); 332 } 333 $content .= html::div('contactpic', $img); 334 } 321 335 322 336 $names_arr = array($record['prefix'], $record['firstname'], $record['middlename'], $record['surname'], $record['suffix']); … … 492 506 493 507 // wrap rows in fieldgroup container 494 $content .= html::div('contactfieldgroup contactcontroller' . $col, $rows); 508 $content .= html::tag('fieldset', array('class' => 'contactfieldgroup contactcontroller' . $col, 'style' => ($rows ? null : 'display:none')), 509 ($colprop['subtypes'] ? html::tag('legend', null, Q($colprop['label'])) : ' ') . 510 $rows); 495 511 } 496 512 -
branches/devel-addressbook/program/steps/addressbook/show.inc
r4242 r4297 24 24 if (($cid = get_input_value('_cid', RCUBE_INPUT_GPC)) && ($record = $CONTACTS->get_record($cid, true))) { 25 25 $OUTPUT->set_env('cid', $record['ID']); 26 } 27 28 // return raw photo of the given contact 29 if ($RCMAIL->action == 'photo') { 30 if ($record['photo']) { 31 // assume image/jpg base64 encoded 32 $data = base64_decode(is_array($record['photo']) ? $record['photo'][0] : $record['photo'], true); 33 } 34 35 header('Content-Type: image/jpeg'); 36 echo $data ? $data : file_get_contents('program/blank.gif'); 37 exit; 26 38 } 27 39 -
branches/devel-addressbook/skins/default/addressbook.css
r4268 r4297 270 270 } 271 271 272 273 272 #contacthead .addnames input.ff_name 274 273 { … … 276 275 } 277 276 278 .contactfieldgroup 279 { 280 margin: 1em 0; 281 } 282 283 form .contactfieldgroup 284 { 285 margin: 1.3em 0; 277 #contacthead .contactpic 278 { 279 float: right; 280 width: 50px; 281 height: 50px; 282 border: 1px solid #ccc; 283 background: white; 284 margin-left: 3em; 285 } 286 287 fieldset.contactfieldgroup 288 { 289 border: 0; 290 margin: 0.5em 0; 291 padding: 0.5em 2px; 292 } 293 294 fieldset.contactfieldgroup legend 295 { 296 font-size: 0.8em; 286 297 } 287 298 … … 317 328 .contactfieldgroup .contactfieldcontent 318 329 { 319 margin-left: 90px;330 padding-left: 90px; 320 331 min-height: 1em; 321 332 } 322 333 323 334 .contactcontrolleraddress .contactfieldcontent { 324 width: 40em;335 width: 30em; 325 336 } 326 337 -
branches/devel-addressbook/skins/default/functions.js
r4070 r4297 26 26 function rcube_init_tabs(id, current) 27 27 { 28 var content = document.getElementById(id),29 fs = $('fieldset', content);28 var content = $('#'+id), 29 fs = content.children('fieldset'); 30 30 31 31 current = current ? current : 0; … … 39 39 // convert fildsets into tabs 40 40 fs.each(function(idx) { 41 var tab, a, elm = $(this), legend = $('legend', elm);41 var tab, a, elm = $(this), legend = elm.children('legend'); 42 42 43 43 // create a tab … … 61 61 function rcube_show_tab(id, index) 62 62 { 63 var content = document.getElementById(id), 64 fs = $('fieldset', content); 63 var fs = $('#'+id).children('fieldset'); 65 64 66 65 fs.each(function(idx) { -
branches/devel-addressbook/skins/default/iehacks.css
r3813 r4297 241 241 margin-top: 2px; 242 242 } 243 244 .contactfieldgroup legend 245 { 246 padding: 0 0 0.5em 0; 247 margin-left: -4px; 248 } -
branches/devel-addressbook/skins/default/templates/contact.html
r4227 r4297 10 10 <div id="contact-title" class="boxtitle"><roundcube:label name="contactproperties" /></div> 11 11 <div id="contact-details" class="boxcontent"> 12 <roundcube:object name="contacthead" id="contacthead" />12 <roundcube:object name="contacthead" id="contacthead" picPlaceholder="/images/contactpic.png" /> 13 13 <div id="contacttabs"> 14 14 <roundcube:object name="contactdetails" /> -
branches/devel-addressbook/skins/default/templates/contactadd.html
r4239 r4297 11 11 <div id="contact-details" class="boxcontent"> 12 12 <form name="editform" method="post" action="./"> 13 <roundcube:object name="contactedithead" id="contacthead" size="16" form="editform" />13 <roundcube:object name="contactedithead" id="contacthead" size="16" form="editform" picPlaceholder="/images/contactpic.png" /> 14 14 <div id="contacttabs"> 15 15 <roundcube:object name="contacteditform" size="40" textareacols="60" deleteIcon="/images/icons/delete.png" form="editform" /> -
branches/devel-addressbook/skins/default/templates/contactedit.html
r4239 r4297 11 11 <div id="contact-details" class="boxcontent"> 12 12 <form name="editform" method="post" action="./"> 13 <roundcube:object name="contactedithead" id="contacthead" size="16" form="editform" />13 <roundcube:object name="contactedithead" id="contacthead" size="16" form="editform" picPlaceholder="/images/contactpic.png" /> 14 14 <div id="contacttabs"> 15 15 <roundcube:object name="contacteditform" size="40" textareacols="60" deleteIcon="/images/icons/delete.png" form="editform" />
Note: See TracChangeset
for help on using the changeset viewer.
