Ticket #628: addsharedcontacts_expresso20_backport.patch
File addsharedcontacts_expresso20_backport.patch, 48.0 KB (added by niltonneto, 13 years ago) |
---|
-
phpgwapi/inc/class.acl.inc.php
632 632 633 633 return $grants; 634 634 } 635 635 636 function get_rights_and_owners($user,$appname = False) 637 { 638 639 if (!$appname) $appname = $GLOBALS['phpgw_info']['flags']['currentapp']; 640 641 if (!count($this->data) && $GLOBALS['phpgw_info']['server']['acl_default'] != 'deny') 642 { 643 return True; 644 } 645 646 $db2 = clone($this->db); 647 $db2->select($this->table_name,array('acl_account','acl_rights'),array( 648 'acl_appname' => $appname, 649 'acl_location' => $user, 650 ),__LINE__,__FILE__); 651 $return = array(); 652 while ($db2->next_record()) 653 { 654 $return[] = array( 655 'acl_rights' => $db2->f('acl_rights'), 656 'acl_account' => $db2->f('acl_account') 657 ); 658 } 659 return $return; 660 } 661 636 662 /** 637 663 * Deletes all ACL entries for an account (user or group) 638 664 * -
contactcenter/inc/class.bo_shared_people_manager.inc.php
16 16 'sex' => true, 17 17 'pgp_key' => true, 18 18 'notes' => true, 19 'corporate_name'=> true, 20 'job_title' => true, 21 'department' => true, 22 'web_page' => true, 19 23 20 24 /* Array fields */ 21 25 'companies' => true, … … 930 934 931 935 @return integer $id The Contact ID 932 936 */ 933 function add_single_entry ( $data )937 function add_single_entry ( $data, $owner ) 934 938 { 935 939 $permissions = $this->security->get_permissions(); 936 940 … … 953 957 $altered = true; 954 958 switch($field) 955 959 { 960 case 'corporate_name': 961 case 'job_title': 962 case 'department': 963 case 'web_page': 956 964 case 'photo': 957 965 case 'alias': 958 966 case 'id_prefix': … … 1053 1061 1054 1062 if ($altered) 1055 1063 { 1056 $contact->set_field('id_owner',$GLOBALS['phpgw_info']['user']['account_id']); 1064 if ($owner) 1065 { 1066 $contact->set_field('id_owner',$owner); 1067 }else 1068 $contact->set_field('id_owner',$GLOBALS['phpgw_info']['user']['account_id']); 1057 1069 return $contact->commit(); 1058 1070 } 1059 1071 … … 1299 1311 $altered = true; 1300 1312 switch($field) 1301 1313 { 1314 case 'corporate_name': 1315 case 'job_title': 1316 case 'department': 1317 case 'web_page': 1302 1318 case 'photo': 1303 1319 case 'alias': 1304 1320 case 'id_prefix': -
contactcenter/inc/class.ui_api.inc.php
47 47 $template->set_var('cc_msg_err_contacting_server',lang('Couldn\'t contact server or server response is invalid. Contact Admin.')); 48 48 $template->set_var('cc_msg_err_timeout',lang('Operation Timed Out.')); 49 49 $template->set_var('cc_msg_err_serialize_data_unknown',lang('Data to be serialized is of unknown type!')); 50 $template->set_var('cc_msg_err_shared',lang('No shared catalog that has permission to add.')); 50 51 /* End Messages */ 51 52 52 53 if ($preferences['displayConnector']) … … 233 234 $template->set_var('cc_contact_conns',lang('Connections')); 234 235 $template->set_var('emails_telephones', lang("E-Mails and Telephones")); 235 236 $template->set_var('cc_default', lang("Default")); 237 238 $template->set_var('cc_contact_shared',lang('Add to catalog')); 239 $template->set_var('cc_contact_shared_types',lang('Choose in wich catalog you would like to add...')); 236 240 237 241 /* End Contact */ 238 242 -
contactcenter/inc/class.ui_data.inc.php
122 122 $GLOBALS['phpgw']->template->set_var('cc_personal',lang('Personal')); 123 123 124 124 $GLOBALS['phpgw']->template->set_var('cc_full_add_button',lang('Full Add')); 125 $GLOBALS['phpgw']->template->set_var('cc_full_add_button_sh',lang('Full Add Shared')); 125 126 $GLOBALS['phpgw']->template->set_var('cc_reset',lang('Reset')); 126 127 127 128 $GLOBALS['phpgw']->template->set_var('cc_personal_data',lang('Personal Data')); … … 174 175 $GLOBALS['phpgw']->template->set_var('cc_del_relation',lang('Remove Selected Relations')); 175 176 $GLOBALS['phpgw']->template->set_var('cc_msg_group',lang('Group')); 176 177 $GLOBALS['phpgw']->template->set_var('cc_msg_contact_full',lang('Contact [Full]')); 178 $GLOBALS['phpgw']->template->set_var('cc_msg_contact_sh',lang('Contact [Shared]')); 177 179 $GLOBALS['phpgw']->template->set_var('cc_msg_contact_qa',lang('Contact [Quick Add]')); 178 180 $GLOBALS['phpgw']->template->set_var('cc_contact_title',lang('Contact Center').' - '.lang('Contacts')); 179 181 $GLOBALS['phpgw']->template->set_var('cc_window_views_title',lang('Contact Center').' - '.lang('Views')); … … 319 321 case 'post_full_add': 320 322 return $this->post_full_add(); 321 323 324 case 'post_full_add_shared' : 325 return $this->post_full_add_shared(); 326 322 327 case 'post_photo': 323 328 return $this->post_photo((int) $_GET['id'] ? (int) $_GET['id'] : '_new_'); 324 329 … … 379 384 case 'export_contacts': 380 385 return $this->export_contacts($_POST['typeExport']); 381 386 387 case 'get_qtds_compartilhado': 388 return $this->get_qtds_compartilhado(); 389 case 'get_list_owners_perms_add': 390 echo $this->get_list_owners_perms_add(); 391 return; 392 382 393 } 383 394 } 384 395 … … 556 567 'status' => 'fatal', 557 568 'msg' => lang('Couldn\'t get the actual catalog.'), 558 569 ); 570 } 571 572 function get_qtds_compartilhado() { 573 $so_contact = CreateObject('contactcenter.so_contact', $GLOBALS['phpgw_info']['user']['account_id']); 574 $relacionados = $so_contact->get_relations(); 575 576 $perms_relacao = array(); 577 578 foreach($relacionados as $uid_relacionado => $tipo_relacionamento) { 579 $aclTemp = CreateObject("phpgwapi.acl",$uid_relacionado); 580 $aclTemp->read(); 581 $perms_relacao[$uid_relacionado] = $aclTemp->get_specific_rights($GLOBALS['phpgw_info']['user']['account_id'],'contactcenter'); //Preciso verificar as permissõque o contato relacionado deu para o atual 582 } 583 584 $validos = array(); 585 $count = 0; 586 foreach($perms_relacao as $uid_relacionado => $val){ 587 if ($perms_relacao[$uid_relacionado]&2) 588 { 589 $validos[$uid_relacionado] = $perms_relacao[$uid_relacionado]; 590 $count++; 591 } 592 } 593 echo serialize(array(0=>$count)); 559 594 } 560 595 561 596 /*! … … 601 636 'value' => $letter !== 'all' ? $letter.'%' : '%' 602 637 ) 603 638 ); 604 if($this->page_info['actual_catalog']['class'] == 'bo_people_catalog'){ 639 640 //Tratamento de permissãde escrita no compartilhamento de catalogo 641 $so_contact = CreateObject('contactcenter.so_contact', $GLOBALS['phpgw_info']['user']['account_id']); 642 $relacionados = $so_contact->get_relations(); 643 644 $perms_relacao = array(); 645 646 foreach($relacionados as $uid_relacionado => $tipo_relacionamento) { 647 $aclTemp = CreateObject("phpgwapi.acl",$uid_relacionado); 648 $aclTemp->read(); 649 $perms_relacao[$uid_relacionado] = $aclTemp->get_specific_rights($GLOBALS['phpgw_info']['user']['account_id'],'contactcenter'); //Preciso verificar as permissõque o contato relacionado deu para o atual 650 } 651 652 $validos = array(); 653 $count = 0; 654 foreach($perms_relacao as $uid_relacionado => $val){ 655 if ($perms_relacao[$uid_relacionado]&2) 656 { 657 $validos[$uid_relacionado] = $perms_relacao[$uid_relacionado]; 658 $count++; 659 } 660 } 661 $prop_names = array(); 662 if($validos) { 663 $filtro = "(|"; 664 foreach($validos as $i => $prop) { 665 $filtro .= "(uidNumber=".$i.")"; 666 } 667 $filtro .= ")"; 668 669 if(!$this->bo->catalog->src_info) { 670 $ldaps = CreateObject('contactcenter.bo_ldap_manager'); 671 $this->bo->catalog->src_info = $ldaps->srcs[1]; 672 } 673 $s = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], false); 674 $n=$this->bo->catalog->src_info['dn']; 675 $apenasThese = array("cn","uidnumber","uid"); 676 $r = ldap_search($s,$n, $filtro,$apenasThese); 677 $infos = ldap_get_entries($s, $r); 678 ldap_close($s); 679 for($z = 0; $z < $infos['count']; $z++) { 680 $prop_names[$infos[$z]['uidnumber'][0]] = array("cn" => $infos[$z]['cn'][0], "uid" => $infos[$z]['uid'][0]); 681 } 682 } 683 //-------------------------------------------------------------------------------- 684 if($this->page_info['actual_catalog']['class'] == 'bo_people_catalog') 685 { 605 686 $find_restric[0][1] = array( 606 687 'field' => 'contact.id_owner', 607 688 'type' => '=', … … 1288 1369 } 1289 1370 $lnk_compose = "location.href=('../expressoMail1_2/index.php?to="; 1290 1371 $final[5] = '<span class="link" onclick="'.$lnk_compose; 1372 $final[6] = $prop_names; 1373 $final[7] = $validos; 1374 $final[8] = $this->page_info['actual_catalog']['class']; 1375 $final[9] = $count; 1291 1376 1292 1293 1377 $this->page_info['actual_letter'] = $letter; 1294 1378 $this->page_info['actual_page'] = $page; 1295 1379 … … 1307 1391 $final[1] = $this -> typeContact; 1308 1392 echo serialize($final); 1309 1393 } 1394 1395 function get_list_owners_perms_add(){ 1396 $acl = CreateObject('phpgwapi.acl'); 1397 $find_result = $acl->get_rights_and_owners($GLOBALS['phpgw_info']['user']['account_id'],'contactcenter'); 1398 if($find_result){ 1399 $owner_names = array(); 1400 $filter = "(|"; 1401 foreach($find_result as $owner) { 1402 if(($owner['acl_rights'] & PHPGW_ACL_ADD) == PHPGW_ACL_ADD){ 1403 $filter .= "(uidNumber=".$owner['acl_account'].")"; 1404 } 1405 } 1406 if(!$this->bo->catalog->src_info) { 1407 $ldap = CreateObject('contactcenter.bo_ldap_manager'); 1408 $this->bo->catalog->src_info = $ldap->srcs[1]; 1409 } 1410 $ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], false); 1411 $filter .= ")"; 1412 $dn=$this->bo->catalog->src_info['dn']; 1413 $justThese = array("cn","uidnumber","uid"); 1414 $sr = ldap_search($ds,$dn, $filter,$justThese); 1415 $info = ldap_get_entries($ds, $sr); 1416 for($z = 0; $z < $info['count']; $z++) { 1417 $owner_names[$info[$z]['uidnumber'][0]] = array("cn" => $info[$z]['cn'][0], "uid" => $info[$z]['uid'][0]); 1418 } 1419 ldap_close($ds); 1420 } 1421 echo serialize ($owner_names); 1422 } 1310 1423 1311 1424 function get_visible_all_ldap() 1312 1425 { … … 1997 2110 echo serialize($result); 1998 2111 } 1999 2112 2113 function post_full_add_shared() 2114 { 2115 $data = $_POST['data']; 2116 // Exceptions!!! utf8 special chars. 2117 $data = preg_replace("/\%u2(\d+)(\d+)(\d+)/","-",$data); 2118 $data = unserialize(str_replace('\\"', '"', $data)); 2119 $this -> bo -> catalog = CreateObject('contactcenter.bo_shared_people_manager'); 2120 2121 if (!is_array($data)) 2122 { 2123 echo serialize(array( 2124 'msg' => lang('<p>Some problem receiving data from browser. This is probably a bug in ContactCenter<br>'. 2125 'Please go to eGroupWare Bug Reporting page and report this bug.<br>'. 2126 'Sorry for the inconvenient!<br><br>'. 2127 '<b><i>ContactCenter Developer Team</i></b></p>'), 2128 'status' => 'fatal' 2129 )); 2130 return; 2131 } 2132 // print_r($data); 2133 // echo '<br><br>'; 2134 2135 $replacer = $data['commercialAnd']; 2136 unset($data['commercialAnd']); 2137 if (!is_string($replacer) or strpos($replacer, "'") or strpos($replacer, '"')) 2138 { 2139 echo serialize(array( 2140 'msg' => lang('Invalid \'&\' replacer! This may be an attempt to bypass Security! Action aborted!'), 2141 'status' => 'fatal' 2142 )); 2143 2144 return; 2145 } 2146 2147 if ($data['id_contact']) 2148 { 2149 $id = $data['id_contact']; 2150 $id_photo = $id; 2151 unset($data['id_contact']); 2152 } 2153 else 2154 { 2155 $id_photo = '_new_'; 2156 } 2157 2158 if ($data['owner']) 2159 { 2160 $owner = $data['owner']; 2161 unset($data['owner']); 2162 } 2163 /* 2164 * Process Photo, if available 2165 */ 2166 $sleep_count = 0; 2167 $photo_ok = $GLOBALS['phpgw']->session->appsession('ui_data.photo','contactcenter'); 2168 while($photo_ok[0]{0} !== 'o' and $photo_ok[1]{0} === 'y') 2169 { 2170 sleep(1); 2171 $photo_ok = $GLOBALS['phpgw']->session->appsession('ui_data.photo','contactcenter'); 2172 $sleep_count++; 2173 2174 if ($sleep_count > 35) 2175 { 2176 // TODO 2177 return; 2178 } 2179 } 2180 $GLOBALS['phpgw']->session->appsession('ui_data.photo','contactcenter', array('wait', 'n')); 2181 2182 if (isset($this->page_info['photos'][$id_photo])) 2183 { 2184 if (array_search($this->page_info['photos'][$id_photo]['status'], array('changed', 'sync')) === false) 2185 { 2186 echo serialize(array( 2187 'msg' => $this->page_info['photos'][$id_photo]['msg'], 2188 'status' => $this->page_info['photos'][$id_photo]['status'] 2189 )); 2190 2191 return; 2192 } 2193 2194 $data['photo'] = $this->page_info['photos'][$id_photo]['content']; 2195 unset($this->page_info['photos'][$id_photo]); 2196 $this->save_session(); 2197 } 2198 2199 /* 2200 * Arrange Date so it gets inserted correctly 2201 */ 2202 2203 $dateformat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']; 2204 2205 $j = 0; 2206 for ($i = 0; $i < 5; $i+=2) 2207 { 2208 switch($dateformat{$i}) 2209 { 2210 case 'Y': 2211 $date[$j]['size'] = 4; 2212 $date[$j]['digit'] = 'Y'; 2213 break; 2214 2215 case 'm': 2216 case 'M': 2217 $date[$j]['size'] = 2; 2218 $date[$j]['digit'] = 'M'; 2219 break; 2220 2221 case 'd': 2222 $date[$j]['size'] = 2; 2223 $date[$j]['digit'] = 'D'; 2224 } 2225 $j++; 2226 } 2227 $datecount = 0; 2228 2229 /* Verify Data and performs insertion/update */ 2230 foreach($data as $field => &$value) 2231 { 2232 if ($value == '' or is_null($value)) 2233 { 2234 unset($data[$field]); 2235 continue; 2236 } 2237 2238 switch($field) 2239 { 2240 case 'corporate_name': 2241 case 'job_title': 2242 case 'department': 2243 case 'web_page': 2244 case 'alias': 2245 case 'given_names': 2246 case 'family_names': 2247 case 'names_ordered': 2248 case 'pgp_key': 2249 case 'notes': 2250 case 'photo': 2251 $value = urldecode( $value ); 2252 /* Do Nothing. This is just to make sure no invalid field is passed */ 2253 break; 2254 2255 case 'id_status': 2256 case 'id_prefix': 2257 case 'id_suffix': 2258 if ($data[$field] == 0) 2259 { 2260 unset($data[$field]); 2261 } 2262 break; 2263 2264 case 'birthdate_0': 2265 case 'birthdate_1': 2266 case 'birthdate_2': 2267 2268 switch($date[$datecount]['digit']) 2269 { 2270 case 'Y': 2271 $date['value'][2] = (int) $data[$field]; 2272 break; 2273 2274 case 'M': 2275 $date['value'][0] = (int) $data[$field]; 2276 break; 2277 2278 case 'D': 2279 $date['value'][1] = (int) $data[$field]; 2280 break; 2281 } 2282 unset($data[$field]); 2283 $datecount++; 2284 2285 if ($datecount != 3) 2286 { 2287 break; 2288 } 2289 2290 if (!checkdate($date['value'][0], $date['value'][1], $date['value'][2])) 2291 { 2292 echo serialize(array( 2293 'msg' => lang('Invalid Date'), 2294 'status' => 'invalid_data' 2295 )); 2296 return; 2297 } 2298 2299 $data['birthdate'] = $date['value'][2].'-'.$date['value'][0].'-'.$date['value'][1]; 2300 break; 2301 2302 case 'sex': 2303 if ($data[$field] !== 'M' and $data[$field] !== 'F') 2304 { 2305 echo serialize(array( 2306 'msg' => lang('Invalid Sex'), 2307 'status' => 'invalid_data' 2308 )); 2309 return; 2310 } 2311 break; 2312 2313 2314 case 'addresses': 2315 /* Insert new cities/states */ 2316 if (isset($value['new_states'])) 2317 { 2318 foreach($value['new_states'] as $type => $state_info) 2319 { 2320 $index = 'address'.$type; 2321 2322 $id_state = $this->bo->catalog->add_state($state_info); 2323 $data['addresses'][$index]['id_state'] = $id_state; 2324 2325 if ($value['new_cities'][$type]) 2326 { 2327 $value['new_cities'][$type]['id_state'] = $id_state; 2328 } 2329 } 2330 2331 unset($data['addresses']['new_states']); 2332 } 2333 2334 if (isset($value['new_cities'])) 2335 { 2336 foreach($value['new_cities'] as $type => $city_info) 2337 { 2338 $index = 'address'.$type; 2339 2340 $id_city = $this->bo->catalog->add_city($city_info); 2341 $data['addresses'][$index]['id_city'] = $id_city; 2342 } 2343 2344 unset($data['addresses']['new_cities']); 2345 } 2346 2347 break; 2348 2349 case 'connections': 2350 /* Does nothing... */ 2351 break; 2352 2353 default: 2354 echo serialize(array( 2355 'msg' => lang('Invalid field: ').$field, 2356 'status' => 'invalid_data' 2357 )); 2358 return; 2359 } 2360 } 2361 2362 $code = '$id = $this->bo->catalog->'; 2363 2364 if (!is_null($id) and $id !== '') 2365 { 2366 $code .= $code.'update_single_info($id, $data);'; 2367 $result = array( 2368 'msg' => lang('Updated Successfully!'), 2369 'status' => 'ok' 2370 ); 2371 } 2372 else 2373 { 2374 $code .= 'add_single_entry($data,'.$owner.');'; 2375 $result = array( 2376 'msg' => lang('Entry Added Successfully!'), 2377 'status' => 'ok' 2378 ); 2379 } 2380 2381 eval($code); 2382 2383 if (!($id)) 2384 { 2385 $result = array( 2386 'msg' => lang('Some problem occured when trying to insert/update contact information.<br>'. 2387 'Report the problem to the Administrator.'), 2388 'status' => 'fail' 2389 ); 2390 } 2391 2392 echo serialize($result); 2393 } 2394 2000 2395 /*! 2001 2396 2002 2397 @function post_photo -
contactcenter/js/cc.js
37 37 * GLOBALS VARIABLES * 38 38 \***********************************************/ 39 39 40 var owners = new Array(); 41 var flag_compartilhado = false; 42 var qtd_compartilhado = 0; 43 40 44 var CC_visual = 'table'; 41 45 /* Cards Variables */ 42 46 var CC_actual_letter = 'a'; … … 171 175 Element("cc_conn_type_2").checked = false; 172 176 Element("cc_conn_type_sel").disabled = true; 173 177 Element("cc_conn_type_sel").selectedIndex = 0; 178 Element("cc_contact_sharing").style.display = 'none'; 174 179 } 175 180 181 function openFullAddShared(){ 182 if (flag_compartilhado) 183 { 184 if(!fullAddWin && !is_ie) 185 __f(); 186 187 resetFullAdd(); 188 populateFullAddConst(); 189 fullAddWin.open(); 190 tabs._showTab('cc_contact_tab_0'); 191 Element("cc_conn_type_1").checked = false; 192 Element("cc_conn_type_2").checked = false; 193 Element("cc_conn_type_sel").disabled = true; 194 Element("cc_conn_type_sel").selectedIndex = 0; 195 Element("cc_contact_sharing").align = 'center'; 196 Element("cc_contact_sharing").style.display = 'block'; 197 Element("cc_contact_shared_types").disabled = true; 198 populateSharingSelect(); 199 } else 200 { 201 if(qtd_compartilhado != 0) 202 { 203 ccTree.select(0.2); 204 ccTree.setCatalog(0.2); 205 if(!fullAddWin && !is_ie) 206 __f(); 207 resetFullAdd(); 208 populateFullAddConst(); 209 fullAddWin.open(); 210 tabs._showTab('cc_contact_tab_0'); 211 Element("cc_conn_type_1").checked = false; 212 Element("cc_conn_type_2").checked = false; 213 Element("cc_conn_type_sel").disabled = true; 214 Element("cc_conn_type_sel").selectedIndex = 0; 215 Element("cc_contact_sharing").aling = 'center'; 216 Element("cc_contact_sharing").style.display = 'block'; 217 Element("cc_contact_shared_types").disabled = true; 218 populateSharingSelect(); 219 } else 220 showMessage(Element('cc_msg_err_shared').value); 221 } 222 } 223 176 224 function closeFullAdd(){ 177 225 fullAddWin.close(); 178 226 } 179 227 /********** New Contact *************/ 180 228 function newContact(){ 181 229 openFullAdd(); 182 } 230 } 231 function newSharedContact(){ 232 openFullAddShared(); 233 } 183 234 /************ Edit Contact *************/ 184 235 function editContact (id){ 185 236 openFullAdd(); … … 201 252 /* 202 253 Updates all the constant fields in the 203 254 full add window, like Prefixes, Suffixes, 204 Countries and Types255 Countries, Types and Shared catalogs 205 256 */ 257 258 function populateSharingSelect() 259 { 260 var handler = function(responseText) 261 { 262 var data = unserialize(responseText); 263 var sharers = Element('cc_contact_shared_types'); 264 265 if (typeof(data) != 'object') 266 { 267 showMessage(Element('cc_msg_err_contacting_server').value); 268 fullAddWin.close(); 269 return; 270 }else{ 271 sharers.disabled = false; 272 j = 1; 273 for (var i in data) 274 { 275 sharers.options[j] = new Option(data[i]['cn'], i); 276 owners[j] = i; 277 j++; 278 } 279 return; 280 } 281 }; 282 Connector.newRequest('populateSharingSelect', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_list_owners_perms_add', 'POST', handler); 283 } 284 206 285 function populateFullAddConst() 207 286 { 208 287 CC_full_add_const = false; … … 442 521 CC_full_add_photo = true; 443 522 } 444 523 445 setTimeout('postFullAddInfo()', 100); 524 if (Element('cc_contact_sharing').style.display == 'none') 525 setTimeout('postFullAddInfo()', 100); 526 else 527 setTimeout('postFullAddInfoShared()', 100); 446 528 } 447 529 448 530 function postFullAddInfo() … … 468 550 }; 469 551 470 552 Connector.newRequest('postFullAddInfo', CC_url+'post_full_add', 'POST', handler, getFullAddData()); 553 } 554 555 function postFullAddInfoShared() 556 { 557 var handler = function (responseText) 558 { 559 var data = unserialize(responseText); 560 if (typeof(data) != 'object') 561 { 562 showMessage(Element('cc_msg_err_contacting_server').value); 563 return; 564 } 565 566 if (data['status'] != 'ok') 567 { 568 showMessage(data['msg']); 569 return; 570 } 571 572 fullAddWin.close(); 573 updateCards(); 574 }; 575 Connector.newRequest('postFullAddInfoShared', CC_url+'post_full_add_shared', 'POST', handler, getFullAddData()); 471 576 } 472 577 473 578 function getFullAddData() … … 484 589 data.length++; 485 590 } 486 591 592 /* Owner do contato (Para o caso de adicao de contato compartilhado) */ 593 if (Element('cc_contact_sharing').style.display == 'block') 594 { 595 var index = Element('cc_contact_shared_types').selectedIndex; 596 data['owner'] = replaceComAnd(owners[index], replacer); 597 data.length++; 598 } 599 487 600 /* Status: Full Added */ 488 601 data['id_status'] = CC_STATUS_FULL_ADD; 489 602 … … 579 692 data['connections'].length++; 580 693 } 581 694 695 var serial = serialize(data); 582 696 return 'data=' + escape(serialize(data)); 583 697 } 584 698 585 699 function checkFullAdd() 586 700 { 701 702 /* Checa se o listbox esta desativado ou éulo, ou seja, nãexiste catágos compartilhados com o user atual */ 703 704 if (!(Element('cc_contact_sharing').style.display == 'none' )) 705 { 706 if (Element('cc_contact_shared_types').disabled == true) 707 { 708 showMessage('Nenhum catágo compartilhado existente'); 709 return false; 710 } 711 if (Element('cc_contact_shared_types').selectedIndex == 0) 712 { 713 showMessage('Nenhum catágo selecionado'); 714 return false; 715 } 716 } 717 587 718 /* Check Personal Data */ 588 719 589 720 if (Element('cc_pd_given_names').value == '') … … 2337 2468 { 2338 2469 var data = new Array(); 2339 2470 2471 flag_compartilhado = false; 2340 2472 if ( letter != CC_actual_letter ) 2341 2473 { 2342 2474 CC_actual_page = '1'; … … 2389 2521 2390 2522 if (typeof(data[3]) == 'object') 2391 2523 { 2524 if (data[8] == 'bo_shared_people_manager') 2525 { 2526 flag_compartilhado = true; 2527 } 2528 else 2529 { 2530 flag_compartilhado = false; 2531 } 2532 qtd_compartilhado = data[9]; 2392 2533 CC_npages = parseInt(data[0]); 2393 2534 CC_actual_page = parseInt(data[1]); 2394 2535 if(CC_visual == 'cards') -
contactcenter/js/ccMain.js
53 53 else 54 54 { 55 55 ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); clearCards();'}); 56 var ccQtdCompartilhado = function(responseText) { 57 data = unserialize(responseText); 58 qtd_compartilhado = data[0]; 59 } 60 Connector.newRequest('fulfilQtdCompartilhado', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_qtds_compartilhado', 'POST', ccQtdCompartilhado); 56 61 } 57 62 } 58 63 … … 91 96 submenu = []; 92 97 textmenu = []; 93 98 94 textmenu[0] = ["cc_msg_contact_qa","cc_msg_contact_full","cc_msg_ group"]95 textmenu[1] = ["cc_quick_add", "cc_full_add_button", "cc_ add_group_button"];99 textmenu[0] = ["cc_msg_contact_qa","cc_msg_contact_full","cc_msg_contact_sh","cc_msg_group"] 100 textmenu[1] = ["cc_quick_add", "cc_full_add_button", "cc_full_add_button_sh","cc_add_group_button"]; 96 101 function show(){ 97 102 clearTimeout(_timeout); 98 103 button = document.getElementById("cc_button_new"); … … 125 130 ccQuickAdd.associateAsButton(Element('cc_quick_add')); 126 131 ccAddGroup.associateAsButton(Element('cc_add_group_button')); 127 132 Element("cc_full_add_button").onclick = newContact; 128 133 Element("cc_full_add_button_sh").onclick = newSharedContact; 129 134 130 135 ccQuickAdd.afterSave = function () 131 136 { -
contactcenter/templates/classic/api_common.tpl
12 12 <input id="cc_msg_err_contacting_server" type="hidden" value="{cc_msg_err_contacting_server}" /> 13 13 <input id="cc_msg_err_timeout" type="hidden" value="{cc_msg_err_timeout}" /> 14 14 <input id="cc_msg_err_serialize_data_unknown" type="hidden" value="{cc_msg_err_serialize_data_unknown}" /> 15 <input id="cc_msg_err_shared" type="hidden" type="hidden" value="{cc_msg_err_shared}" /> 15 16 16 17 <input id="cc_msg_err_empty_field" type="hidden" value="{cc_msg_err_empty_field}" /> 17 18 <input id="cc_msg_type_state" type="hidden" value="{cc_msg_type_state}" /> -
contactcenter/templates/classic/index.tpl
21 21 <input id="cc_msg_card_edit" type="hidden" value="{cc_msg_card_edit}"> 22 22 <input id="cc_msg_group" type="hidden" value="{cc_msg_group}"> 23 23 <input id="cc_msg_contact_full" type="hidden" value="{cc_msg_contact_full}"> 24 <input id="cc_msg_contact_sh" type="hidden" value="{cc_msg_contact_sh}"> 24 25 <input id="cc_msg_contact_qa" type="hidden" value="{cc_msg_contact_qa}"> 25 26 <input id="cc_msg_card_remove" type="hidden" value="{cc_msg_card_remove}"> 26 27 <input id="cc_msg_card_remove_confirm" type="hidden" value="{cc_msg_card_remove_confirm}"> … … 250 251 <script type="text/javascript" src="js/ccQuickAddContact.js"></script> 251 252 <script type="text/javascript" src="js/ccIEContacts.js"></script> 252 253 <script type="text/javascript" src="js/ccMain.js"></script> 253 <!-- END BOTTOM DETAILS--> 254 No newline at end of file 254 <!-- END BOTTOM DETAILS--> -
contactcenter/templates/classic/full_add.tpl
161 161 <div style="z-index:10000;position: absolute;display:none; top: 170px; left: 78px;" id="div_cc_conn_is_default"> {cc_default} <select id="cc_email_default" name="cc_email_default" disabled style="display:none"></select><select id="cc_phone_default" name="cc_phone_default" disabled style="display:none"></select></div> 162 162 </div> 163 163 <!-- _BOTTOM BUTTONS --> 164 <div align="center" id="cc_contact_tab_buttons" style="position: absolute; visibility: hidden; top: 250px; left: 0px; width: 498px; height: 32px; border: 0px solid black"> 164 <div align="center" id="cc_contact_tab_buttons" style="position: absolute; visibility: hidden; top: 250px; left: 0px; width: 498px; height: 64px; border: 0px solid black"> 165 <table class="row_off" align="center" width="498px" cellpadding="2" cellspacing="0" border="0"> 166 <tr class="row_off" id="cc_contact_sharing"> 167 <td >{cc_contact_shared}: </td> 168 <td colspan="2"> 169 <select id="cc_contact_shared_types" name="{cc_contact_shared}" style="width: 390px;"> 170 <option value="_NONE_">{cc_contact_shared_types}</option> 171 </select> 172 </td> 173 </tr> 174 </table> 165 175 <table class="row_off" align="center" width="498px" cellpadding="2" cellspacing="0" border="0"> 166 176 <tr> 167 177 <td align="center"> … … 222 232 'content_id': 'cc_contact_tab', 223 233 'win_class': 'row_off', 224 234 'width': '500px', 225 'height': '2 73px',235 'height': '295px', 226 236 'title_color': '#3978d6', 227 237 'title': Element('cc_contact_title').value, 228 238 'title_text_color': 'white', -
contactcenter/templates/default/api_common.tpl
12 12 <input id="cc_msg_err_contacting_server" type="hidden" value="{cc_msg_err_contacting_server}" /> 13 13 <input id="cc_msg_err_timeout" type="hidden" value="{cc_msg_err_timeout}" /> 14 14 <input id="cc_msg_err_serialize_data_unknown" type="hidden" value="{cc_msg_err_serialize_data_unknown}" /> 15 <input id="cc_msg_err_shared" type="hidden" type="hidden" value="{cc_msg_err_shared}" /> 15 16 16 17 <input id="cc_msg_err_empty_field" type="hidden" value="{cc_msg_err_empty_field}" /> 17 18 <input id="cc_msg_type_state" type="hidden" value="{cc_msg_type_state}" /> -
contactcenter/templates/default/index.tpl
21 21 <input id="cc_msg_card_edit" type="hidden" value="{cc_msg_card_edit}"> 22 22 <input id="cc_msg_group" type="hidden" value="{cc_msg_group}"> 23 23 <input id="cc_msg_contact_full" type="hidden" value="{cc_msg_contact_full}"> 24 <input id="cc_msg_contact_sh" type="hidden" value="{cc_msg_contact_sh}"> 24 25 <input id="cc_msg_contact_qa" type="hidden" value="{cc_msg_contact_qa}"> 25 26 <input id="cc_msg_card_remove" type="hidden" value="{cc_msg_card_remove}"> 26 27 <input id="cc_msg_card_remove_confirm" type="hidden" value="{cc_msg_card_remove_confirm}"> -
contactcenter/templates/default/full_add.tpl
161 161 <div style="z-index:10000;position: absolute;display:none; top: 170px; left: 78px;" id="div_cc_conn_is_default"> {cc_default} <select id="cc_email_default" name="cc_email_default" disabled style="display:none"></select><select id="cc_phone_default" name="cc_phone_default" disabled style="display:none"></select></div> 162 162 </div> 163 163 <!-- _BOTTOM BUTTONS --> 164 <div align="center" id="cc_contact_tab_buttons" style="position: absolute; visibility: hidden; top: 250px; left: 0px; width: 498px; height: 32px; border: 0px solid black"> 164 <div align="center" id="cc_contact_tab_buttons" style="position: absolute; visibility: hidden; top: 250px; left: 0px; width: 498px; height: 64px; border: 0px solid black"> 165 <table class="row_off" align="center" width="498px" cellpadding="2" cellspacing="0" border="0"> 166 <tr class="row_off" id="cc_contact_sharing"> 167 <td >{cc_contact_shared}: </td> 168 <td colspan="2"> 169 <select id="cc_contact_shared_types" name="{cc_contact_shared}" style="width: 390px;"> 170 <option value="_NONE_">{cc_contact_shared_types}</option> 171 </select> 172 </td> 173 </tr> 174 </table> 165 175 <table class="row_off" align="center" width="498px" cellpadding="2" cellspacing="0" border="0"> 166 176 <tr> 167 177 <td align="center"> … … 222 232 'content_id': 'cc_contact_tab', 223 233 'win_class': 'row_off', 224 234 'width': '500px', 225 'height': '2 73px',235 'height': '295px', 226 236 'title_color': '#3978d6', 227 237 'title': Element('cc_contact_title').value, 228 238 'title_text_color': 'white', -
preferences/inc/class.uiaclprefs.inc.php
199 199 $this->template->set_var("cancel", lang("Cancel")); 200 200 201 201 if($acl_app=='contactcenter') { 202 $this->template->set_var("add_invisible", "style='display:none'");202 //$this->template->set_var("add_invisible", "style='display:none'"); 203 203 $this->template->set_var("private_invisible", "style='display:none'"); 204 204 } 205 205 else {