- Timestamp:
- 09/11/08 16:42:44 (16 years ago)
- Location:
- trunk/expressoMail1_2
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.db_functions.inc.php
r205 r413 3 3 define('PHPGW_API_INC','../phpgwapi/inc'); 4 4 include_once(PHPGW_API_INC.'/class.db.inc.php'); 5 5 include_once('class.dynamic_contacts.inc.php'); 6 6 7 class db_functions 7 8 { … … 142 143 } 143 144 144 function get_dropdown_contacts(){ 145 function get_dropdown_contacts() 146 { 147 $dynamic_contact = new dynamic_contacts(); 145 148 146 149 $contacts = $this -> get_cc_contacts(); 147 150 $groups = $this -> get_cc_groups(); 151 $dynamic = $dynamic_contact->dynamic_contact_toString(); 148 152 149 153 if(($contacts) && ($groups)) … … 155 159 elseif ((!$contacts) && ($groups)) 156 160 $stringDropDownContacts = $groups; 157 161 if (($dynamic) && (($groups) || ($contacts))) 162 $stringDropDownContacts .= ',' . $dynamic; 163 else 164 if ($dynamic) 165 $stringDropDownContacts = $dynamic; 166 158 167 return $stringDropDownContacts; 159 168 } … … 257 266 return $result; 258 267 } 268 269 function get_dynamic_contacts() 270 { 271 // Pesquisa os emails e ultima inserção nos contatos dinamicos. 272 if(!$this->db->select('phpgw_expressomail_contacts','data', 273 'id_owner ='.$this -> user_id, 274 __LINE__,__FILE__)) 275 { 276 return $this->db->Error; 277 } 278 while($this->db->next_record()) 279 { 280 $result[] = $this->db->row(); 281 } 282 foreach($result as $item) 283 { 284 $contacts = unserialize($item['data']); 285 } 286 if (count($contacts) == 0) 287 { 288 return null; 289 } 290 return $contacts; 291 } 292 293 function update_contacts($contacts=array()) 294 { 295 // Atualiza um email nos contatos dinamicos. 296 if(!$this->db->update('phpgw_expressomail_contacts ','data=\''.serialize($contacts).'\'', 297 'id_owner ='.$this -> user_id, 298 __LINE__,__FILE__)) 299 { 300 return $this->db->Error; 301 } 302 return $contacts; 303 } 304 305 function insert_contact($contact) 306 { 307 $contacts[] = array( 'timestamp' => time(), 308 'email' => $contact ); 309 310 // Insere um email nos contatos dinamicos. 311 $query = 'INSERT INTO phpgw_expressomail_contacts (data, id_owner) ' . 312 'values ( \''.serialize($contacts).'\', '.$this->user_id.')'; 313 314 if(!$this->db->query($query,__LINE__,__FILE__)) 315 return $this->db->Error; 316 return $contacts; 317 } 318 319 function remove_dynamic_contact($user_id,$line,$file) 320 { 321 $where = $user_id.' = id_owner'; 322 $this->db->delete('phpgw_expressomail_contacts',$where,$line,$file); 323 } 259 324 } 260 325 ?> -
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r411 r413 1246 1246 $sent = trim($sent); 1247 1247 error_log("$now - $userip - $sent [$subject] - $userid => $addrs\r\n", 3, "/home/expressolivre/mail_senders.log"); 1248 } 1249 if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_dynamic_contacts']) 1250 { 1251 $contacts = new dynamic_contacts(); 1252 $contacts->add_dynamic_contacts($toaddress.$ccaddress.$ccoaddress); 1248 1253 } 1249 1254 return true; -
trunk/expressoMail1_2/index.php
r395 r413 82 82 'font_size' => $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['font_size'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['font_size'] : "11", 83 83 'use_shortcuts' => $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_shortcuts'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_shortcuts'] : "0", 84 'auto_save_draft' => $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_save_draft'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_save_draft'] : "0" 84 'auto_save_draft' => $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_save_draft'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_save_draft'] : "0", 85 'use_dynamic_contacts' => $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_dynamic_contacts'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_dynamic_contacts'] : "0" 85 86 86 87 ); … … 126 127 // End Set Anti-Spam options. 127 128 129 // Dynamic contact. 130 $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_Number_of_dynamic_contacts'] = $current_config['expressoMail_Number_of_dynamic_contacts']; 128 131 129 132 // Set Imap Folder names options -
trunk/expressoMail1_2/js/DropDownContacts.js
r376 r413 59 59 tmp[1] = tmp[1].replace(tmp_mail, tmp_mail.bold()); 60 60 tmp[0] = tmp[0].replace(tmp_mail, tmp_mail.bold()); 61 match_contacts[match_index] = '"' + tmp[0] + '" <' + tmp[1] + '>'; 61 if(tmp[0] == '') 62 match_contacts[match_index] = tmp[0] + ' <' + tmp[1] + '>'; 63 else 64 match_contacts[match_index] = '$"' + tmp[0] + '" <' + tmp[1] + '>'; 62 65 match_index++; 63 66 } -
trunk/expressoMail1_2/js/main.js
r389 r413 856 856 write_msg(get_lang('Your message was sent and save.')); 857 857 wfolders.alert = false; 858 init(); 858 859 }else{ 859 write_msg(get_lang('Your message was sent.')); 860 write_msg(get_lang('Your message was sent.')); 861 init(); 860 862 } 861 863 if ((! newMessageTab.toPreserve[ID]) && (newMessageTab.imapUid[ID] != 0)) -
trunk/expressoMail1_2/js/preferences.js
r340 r413 73 73 "<option value='15'>"+get_lang("Big")+"</option>"+ 74 74 "</select></td></tr>"+ 75 "<tr><td> - " + get_lang("Use dynamic contacts?") + "</td>"+ 76 "<td><input type='checkBox' id='use_dynamic_contacts' name='use_dynamic_contacts'></td></tr>"+ 77 "<tr><td> - " + get_lang("Use shortcuts?") + "</td>"+ 78 "<td><input type='checkBox' id='use_shortcuts' name='use_shortcuts'></td></tr>"+ 75 79 "<tr><td> - " + get_lang("Auto save draft") + "?</td>"+ 76 80 "<td><input type='checkBox' id='auto_save_draft' name='auto_save_draft'></td></tr>"+ 77 "<tr><td> - " + get_lang("Use shortcuts?") + "</td>"+78 "<td><input type='checkBox' id='use_shortcuts' name='use_shortcuts'></td></tr>"+79 81 "<tr><td nowrap> - " + get_lang('Insert signature automatically in new messages?') + "</td>"+ 80 82 "<td><input type='checkBox' id='use_signature' name='use_signature'></td>"+ … … 140 142 if(sel_size_font.options[i].value == preferences.font_size){sel_size_font.options[i].selected = true;} 141 143 } 144 var use_dynamic_contacts = Element("use_dynamic_contacts"); 145 if (preferences.use_dynamic_contacts == 1) { 146 use_dynamic_contacts.checked = true; 147 } 142 148 var use_signature = Element("use_signature"); 143 149 if( preferences.use_signature == 1){ … … 147 153 txt_signature.value = preferences.signature; 148 154 155 if ((_this.number_of_contacts < 1) || isNaN(_this.number_of_contacts)) 156 { 157 Element("use_dynamic_contacts").checked = false; 158 Element("use_dynamic_contacts").disabled = 'disabled'; 159 } 149 160 if( preferences.use_shortcuts == 1) Element("use_shortcuts").checked = true; 150 161 if( preferences.auto_save_draft == 1) Element("auto_save_draft").checked = true; … … 154 165 // Salva as opções do form; 155 166 Preferences.prototype.save_form = function(){ 156 157 //var prefe_string; 167 168 var _this = this; 169 //var prefe_string; 158 170 var reload_page = false; 159 171 … … 172 184 else if(preferences.auto_save_draft != Element("auto_save_draft").checked) 173 185 reload_page = true; 186 else if(preferences.use_dynamic_contacts != Element("use_dynamic_contacts").checked) 187 { 188 reload_page = true; 189 _this.delete_dynamic_contacts(); 190 } 174 191 175 192 preferences.max_email_per_page = Element("sel_num_max").value; … … 185 202 preferences.use_signature = Element("use_signature").checked ? 1 : 0; 186 203 preferences.signature = Element("txt_signature").value; 204 preferences.use_dynamic_contacts = Element("use_dynamic_contacts").checked ? 1 : 0; 187 205 preferences.use_shortcuts = Element("use_shortcuts").checked ? 1 : 0; 188 206 preferences.auto_save_draft = Element("auto_save_draft").checked ? 1 : 0; 189 190 var _this = this; 191 207 208 192 209 var handler_preferences = function(data){ 193 210 if(data && data.success){ … … 234 251 document.getElementById("use_signature").checked = false; 235 252 document.getElementById('txt_signature').value = ""; 253 document.getElementById("use_dynamic_contacts").checked = false; 236 254 } 237 255 … … 246 264 div.style.paddingLeft = "10px"; 247 265 var title = get_lang("ExpressoMail 1.2 Configuration"); 248 var wHeight = "4 20px";266 var wHeight = "480px"; 249 267 var wWidth = "530px"; 250 268 … … 270 288 win.open(); 271 289 } 290 291 Preferences.prototype.delete_dynamic_contacts = function(){ 292 var handler = function(data){} 293 var args = "$this.dynamic_contacts.delete_dynamic_contacts"; 294 var params = ""; 295 cExecute(args,handler,params); 296 } 297 Preferences.prototype.get_number_of_contacts = function(){ 298 var _this = this; 299 var handler = function(data){ 300 _this.number_of_contacts = data; 301 } 302 var args = "$this.dynamic_contacts.get_number_of_contacts"; 303 var params = ""; 304 cExecute(args,handler,params); 305 } 272 306 // Cria o objeto 273 307 var prefe; 274 308 prefe = new Preferences(); 309 prefe.get_number_of_contacts(); -
trunk/expressoMail1_2/preferences.php
r389 r413 50 50 $GLOBALS['phpgw']->template->set_var('checked_mainscreen_showmail',''); 51 51 52 if (!is_numeric($_SESSION['phpgw_info']['server']['expressomail']['expressoMail_Number_of_dynamic_contacts'])) 53 { 54 $GLOBALS['phpgw']->template->set_var('checked_dynamic_contacts',''); 55 $GLOBALS['phpgw']->template->set_var('checked_dynamic_contacts','disabled'); 56 } 57 else 58 { 59 if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_dynamic_contacts']) 60 $GLOBALS['phpgw']->template->set_var('checked_dynamic_contacts','checked'); 61 else 62 $GLOBALS['phpgw']->template->set_var('checked_dynamic_contacts',''); 63 } 64 52 65 if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_shortcuts']) 53 66 $GLOBALS['phpgw']->template->set_var('checked_shortcuts','checked'); … … 147 160 else 148 161 $GLOBALS['phpgw']->preferences->add('expressoMail','mainscreen_showmail',$_POST['mainscreen_showmail']); 162 163 if (!is_numeric($_SESSION['phpgw_info']['server']['expressomail']['expressoMail_Number_of_dynamic_contacts'])) 164 { 165 $GLOBALS['phpgw']->template->set_var('checked_dynamic_contacts',''); 166 $GLOBALS['phpgw']->template->set_var('checked_dynamic_contacts','disabled'); 167 } 168 else 169 { 170 if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_dynamic_contacts']) 171 { 172 $GLOBALS['phpgw']->preferences->change('expressoMail','use_dynamic_contacts',$_POST['use_dynamic_contacts']); 173 if($_POST['use_dynamic_contacts'] == '') 174 { 175 $contacts = CreateObject('expressoMail1_2.dynamic_contacts'); 176 $contacts->delete_dynamic_contacts(); 177 } 178 } 179 else 180 $GLOBALS['phpgw']->preferences->add('expressoMail','use_dynamic_contacts',$_POST['use_dynamic_contacts']); 181 } 149 182 150 183 if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_shortcuts']) … … 220 253 $GLOBALS['phpgw']->template->set_var('lang_line_height',lang('What is the height of the lines in the list of messages?')); 221 254 $GLOBALS['phpgw']->template->set_var('lang_font_size',lang('What the font size in the list of messages?')); 255 $GLOBALS['phpgw']->template->set_var('lang_use_dynamic_contacts',lang('Use dynamic contacts?')); 222 256 $GLOBALS['phpgw']->template->set_var('lang_use_shortcuts',lang('Use shortcuts?')); 223 257 $GLOBALS['phpgw']->template->set_var('lang_auto_save_draft',lang('Auto save draft')); -
trunk/expressoMail1_2/setup/setup.inc.php
r381 r413 17 17 // $setup_info['expressoMail1_2']['tables'][] = 'phpgw_expressoMail1_2_apps'; 18 18 // $setup_info['expressoMail1_2']['tables'][] = 'phpgw_expressoMail1_2_log'; 19 $setup_info['expressoMail1_2']['tables'][] = 'phpgw_expressomail_contacts'; 19 20 $setup_info['expressoMail1_2']['enable'] = 1; 20 21 -
trunk/expressoMail1_2/setup/tables_current.inc.php
r2 r413 9 9 * option) any later version. * 10 10 \**************************************************************************/ 11 11 /* 12 12 $phpgw_baseline = array( 13 13 'phpgw_expressoMail_serverconfig' => array( … … 34 34 ) 35 35 ); 36 */ 36 37 ?> -
trunk/expressoMail1_2/templates/default/config.tpl
r197 r413 42 42 </td> 43 43 </tr> 44 <tr bgcolor="{row_on}"> 45 <td>{lang_Number_of_dynamic_contacts}</td> 46 <td> 47 <input size="1" name="newsettings[expressoMail_Number_of_dynamic_contacts]" value="{value_expressoMail_Number_of_dynamic_contacts}"> 48 </td> 49 </tr> 44 50 <!-- END body --> 45 51 <!-- BEGIN footer --> -
trunk/expressoMail1_2/templates/default/preferences.tpl
r389 r413 90 90 </tr> 91 91 <tr bgcolor="{tr_color1}"> 92 <td>{lang_use_dynamic_contacts}</td> 93 <td align="center"> 94 <input type="checkbox" name="use_dynamic_contacts" value=1 {checked_dynamic_contacts}> 95 </td> 96 </tr> 97 <tr bgcolor="{tr_color2}"> 92 98 <td> 93 99 {lang_use_shortcuts} … … 98 104 </tr> 99 105 100 <tr bgcolor="{tr_color 2}">106 <tr bgcolor="{tr_color1}"> 101 107 <td> 102 108 {lang_auto_save_draft}
Note: See TracChangeset
for help on using the changeset viewer.