[480] | 1 | <?php |
---|
| 2 | class ui_mobilecc{ |
---|
| 3 | |
---|
| 4 | var $nextmatchs; |
---|
[1474] | 5 | var $bo; |
---|
[480] | 6 | var $page_info = array ( |
---|
[527] | 7 | 'actual_catalog' => false, |
---|
| 8 | 'is_external_catalog' => false |
---|
[480] | 9 | ); |
---|
| 10 | |
---|
| 11 | var $public_functions = array( |
---|
| 12 | 'contacts_list' => true, |
---|
| 13 | ); |
---|
| 14 | |
---|
[527] | 15 | /** |
---|
| 16 | * Construtor... |
---|
| 17 | * |
---|
| 18 | */ |
---|
| 19 | public function ui_mobilecc() { |
---|
[480] | 20 | $this->nextmatchs = CreateObject('phpgwapi.nextmatchs'); |
---|
| 21 | } |
---|
| 22 | |
---|
[527] | 23 | /** |
---|
| 24 | * Inicia um BO de catálogo do módulo de contactcenter. |
---|
| 25 | * @return |
---|
| 26 | * @param $catalog String com o catálogo |
---|
| 27 | */ |
---|
| 28 | private function set_catalog($catalog) { |
---|
| 29 | if(strpos($catalog,'bo_global_ldap_catalog')===false) //Ldap? |
---|
| 30 | $this->bo= CreateObject("contactcenter.".$catalog); |
---|
| 31 | else { |
---|
| 32 | $exploded = explode("#",$catalog); |
---|
| 33 | $this->bo= CreateObject("contactcenter.bo_global_ldap_catalog",$exploded[1],$exploded[2],$exploded[3]); |
---|
| 34 | if($exploded[3]==1) |
---|
| 35 | $this->page_info['is_external_catalog'] = true; |
---|
| 36 | else { |
---|
| 37 | $this->page_info['is_external_catalog'] = false; |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | } |
---|
[480] | 41 | $this->page_info['actual_catalog'] = $catalog; |
---|
| 42 | } |
---|
| 43 | |
---|
[527] | 44 | /** |
---|
| 45 | * Busca um nome a partir do catálogo. Se nenhum for informado previamente, |
---|
| 46 | * retorna um array vazio. |
---|
| 47 | * |
---|
| 48 | * Caso o catálogo atual seja grupos, a busca será por títulos, caso seja |
---|
| 49 | * contatos pessoais, será por names_ordered, se for contato no ldap, será |
---|
| 50 | * por cn. |
---|
| 51 | * |
---|
| 52 | * @return array, com os ids relativos a busca |
---|
| 53 | * @param $name string com o nome à ser buscado. |
---|
| 54 | */ |
---|
| 55 | public function find($name) { |
---|
| 56 | if(!$this->page_info["actual_catalog"]) |
---|
| 57 | return array(); |
---|
| 58 | |
---|
| 59 | if($this->page_info['actual_catalog']=="bo_group_manager") { //parametros de busca para grupos |
---|
| 60 | $id = 'group.id_group'; |
---|
| 61 | $what = array('group.title',$id); |
---|
| 62 | $search = "group.title"; |
---|
| 63 | } |
---|
| 64 | else { //parametros de busca para pessoas |
---|
| 65 | $id = 'contact.id_contact'; |
---|
| 66 | $search = "contact.names_ordered"; |
---|
| 67 | $what = array('contact.names_ordered',$id); |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | if ((strpos($this->page_info["actual_catalog"],'bo_global_ldap_catalog')!==false) && |
---|
| 71 | (!$this->page_info['is_external_catalog'])) { //Ldap do expresso, leva em conta alguns atributos do expresso |
---|
| 72 | |
---|
| 73 | array_push($what,'contact.object_class', |
---|
| 74 | 'contact.account_visible', |
---|
| 75 | 'contact.account_status' |
---|
| 76 | ); |
---|
| 77 | |
---|
[480] | 78 | $rules = array( |
---|
| 79 | 0 => array( |
---|
| 80 | 'field' => 'contact.object_class', |
---|
| 81 | 'type' => '=', |
---|
| 82 | 'value' => 'phpgwAccount' |
---|
| 83 | ), |
---|
| 84 | 1 => array( |
---|
| 85 | 'field' => 'contact.account_status', |
---|
| 86 | 'type' => 'iLIKE', |
---|
| 87 | 'value' => '%' |
---|
| 88 | ), |
---|
| 89 | 2 => array( |
---|
| 90 | 'field' => 'contact.account_visible', |
---|
| 91 | 'type' => '!=', |
---|
| 92 | 'value' => '-1' |
---|
| 93 | ), |
---|
| 94 | 3 => array( |
---|
| 95 | 'field' => 'contact.object_class', |
---|
| 96 | 'type' => '=', |
---|
| 97 | 'value' => 'inetOrgPerson' |
---|
| 98 | ) |
---|
| 99 | ); |
---|
| 100 | } |
---|
| 101 | else{ |
---|
| 102 | $rules = array(); |
---|
| 103 | } |
---|
[527] | 104 | |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | if ($name != '') { //String em branco, não preciso adicionar essa regra |
---|
| 108 | array_push($rules,array( |
---|
| 109 | 'field' => $search, |
---|
| 110 | 'type' => 'iLIKE', |
---|
| 111 | 'value' => '%'.$name.'%' |
---|
| 112 | )); |
---|
[480] | 113 | } |
---|
[527] | 114 | |
---|
| 115 | $ids = $this->bo->find($what,$rules); |
---|
| 116 | |
---|
[623] | 117 | if(is_array($ids)) foreach($ids as $id_r) { //Quero apenas os ids, como valores nas posições do array |
---|
[480] | 118 | $retorno[] = $id_r[substr($id,strpos($id,".")+1)]; |
---|
| 119 | } |
---|
[527] | 120 | |
---|
[480] | 121 | return $retorno; |
---|
| 122 | } |
---|
[527] | 123 | |
---|
| 124 | /** |
---|
| 125 | * Monta a lista de contatos na tela, de acordo com a busca. Se não foi feita |
---|
| 126 | * busca, mostra apenas o formulário para pesquisa. |
---|
| 127 | * |
---|
| 128 | * @return |
---|
| 129 | */ |
---|
| 130 | |
---|
[588] | 131 | function contacts_list($from_calendar=false) { |
---|
[527] | 132 | |
---|
[480] | 133 | $entries = array(); |
---|
| 134 | $actual_page = 0; |
---|
[527] | 135 | |
---|
| 136 | if(isset($_POST['name']) && strlen($_POST['name'])<4) //Busca apenas para nomes com mais de 4 palavras |
---|
| 137 | $ids = false; |
---|
| 138 | else { |
---|
| 139 | /////////////// Pego os ids referente a consulta, se a mesma foi feita |
---|
| 140 | if(isset($_POST['name'])) { |
---|
| 141 | $this->set_catalog($_POST['catalog']); |
---|
| 142 | $ids = $this->find($_POST['name']); |
---|
| 143 | if(is_array($ids)) { |
---|
| 144 | $actual_page = 1; |
---|
| 145 | $_SESSION["mobile_search_ids"] = $ids; |
---|
| 146 | $_SESSION["mobile_search_catalog"] = $_POST['catalog']; |
---|
| 147 | $ids = array_slice($ids,0,10); //Apenas a primeira página |
---|
| 148 | } |
---|
[480] | 149 | } |
---|
[527] | 150 | else if(isset($_GET['page'])) { |
---|
| 151 | $this->set_catalog($_SESSION["mobile_search_catalog"]); |
---|
| 152 | $ids = array_slice($_SESSION["mobile_search_ids"],($_GET['page']-1)*10,10); //Página solicitada |
---|
| 153 | $actual_page = $_GET['page']; |
---|
| 154 | } |
---|
| 155 | else |
---|
| 156 | $ids = false; |
---|
[480] | 157 | } |
---|
[527] | 158 | |
---|
[480] | 159 | ///////////// Pego os dados dos ids da página em questão. |
---|
[527] | 160 | if(!is_array($ids) || count($_SESSION["mobile_search_ids"])>100 || (isset($_POST["name"]) && strlen($_POST['name'])<4)) { |
---|
[480] | 161 | $entries = array(); |
---|
| 162 | } |
---|
| 163 | else { //Só pego os dados completos caso haja resultado na busca |
---|
[527] | 164 | if($this->page_info['actual_catalog']!="bo_group_manager") { //Se não for grupo, tenho que ordenar as connections |
---|
[588] | 165 | $entries = $this->bo->get_multiple_entries($ids,array("names_ordered"=>true,"uidnumber"=>true,"id_contact"=>true,"connections"=>true)); |
---|
[480] | 166 | /** |
---|
| 167 | * As entradas vindas de get_multiple_entries não vem com as connections |
---|
| 168 | * ordenadas. Abaixo eu ordeno o array connections de cada entrada para ter |
---|
| 169 | * sempre na frente os valores defaults, primeiro o default de email, depois |
---|
| 170 | * o de telefone. |
---|
| 171 | */ |
---|
| 172 | foreach($entries as &$valor) { |
---|
[546] | 173 | /* Sempre iniciar os arrays, pois pode interferir na |
---|
| 174 | * ordenação atual se tiverem valores antigos desnecessários |
---|
| 175 | * causando erro de tamanhos inconsistentes */ |
---|
| 176 | $default = array(); |
---|
| 177 | $type = array(); |
---|
| 178 | |
---|
[480] | 179 | foreach($valor['connections'] as $key => $value) { |
---|
| 180 | $default[$key] = $value['connection_is_default']; |
---|
| 181 | $type[$key] = $value['id_type']; |
---|
| 182 | } |
---|
| 183 | array_multisort($default, SORT_DESC, $type, SORT_ASC, $valor['connections']); |
---|
[527] | 184 | }//Fim da ordenação |
---|
[480] | 185 | } |
---|
| 186 | else { |
---|
| 187 | $entries = $this->bo->get_multiple_entries($ids,array("id_group"=>true,"title"=>true,"short_name"=>true)); |
---|
| 188 | } |
---|
[588] | 189 | |
---|
[480] | 190 | } |
---|
[527] | 191 | |
---|
[480] | 192 | ///////////////// Monto os dados gerais da página no template. |
---|
| 193 | $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); |
---|
[588] | 194 | |
---|
| 195 | if(!$from_calendar) |
---|
| 196 | $p->set_file(Array('entries' => 'cc_main.tpl')); |
---|
[1474] | 197 | else if($from_calendar =='mobilecalendar') |
---|
[588] | 198 | $p->set_file(Array('entries' => 'add_participants.tpl')); |
---|
[1474] | 199 | else |
---|
| 200 | $p->set_file(Array('entries' => 'add_recipients.tpl')); |
---|
| 201 | |
---|
[480] | 202 | $p->set_block('entries','body'); |
---|
| 203 | $p->set_block('entries','people_header'); |
---|
| 204 | $p->set_block('entries','group_header'); |
---|
| 205 | $p->set_block('entries','row'); |
---|
| 206 | $p->set_block('entries','row_group'); |
---|
| 207 | $p->set_block('entries','row_empty'); |
---|
| 208 | $p->set_block('entries','option'); |
---|
| 209 | $p->set_block('entries','page'); |
---|
| 210 | $p->set_block('entries','page_no_link'); |
---|
[588] | 211 | $p->set_block('entries','row_addeds'); |
---|
[480] | 212 | |
---|
| 213 | |
---|
| 214 | $texts = array( |
---|
| 215 | 'lang_name' => lang("Name"), |
---|
| 216 | 'lang_catalog' => lang("Catalog"), |
---|
[1474] | 217 | 'lang_search' => lang("Search") |
---|
[480] | 218 | ); |
---|
| 219 | $p->set_var($texts); |
---|
| 220 | |
---|
[588] | 221 | $p->set_var('lang_already_addeds:',lang('already_addeds:')); |
---|
| 222 | |
---|
[1474] | 223 | if($from_calendar == 'mobilecalendar') |
---|
[588] | 224 | $p->set_var('lang_continue_scheduling',lang('continue scheduling')); |
---|
[1474] | 225 | else if($from_calendar == 'mobilemail'){ |
---|
| 226 | $p->set_var('lang_continue',lang('continue')); |
---|
| 227 | } |
---|
[588] | 228 | |
---|
[527] | 229 | /////////// Preenche o combo de catálogos |
---|
| 230 | |
---|
| 231 | $bo_cc = CreateObject("contactcenter.bo_contactcenter"); |
---|
| 232 | $branchs = $bo_cc->get_catalog_tree(); |
---|
| 233 | |
---|
[1474] | 234 | if(!$from_calendar || $from_calendar == 'mobilemail') { |
---|
[588] | 235 | foreach($branchs as $branch) { //Pego apenas a estrutura dos ramos vindos do banco, pois as do ldap estão confusas e com dados aparentemente inconsistentes. |
---|
| 236 | if($branch['class']!="bo_global_ldap_catalog" && $branch['class']!="bo_catalog_group_catalog") { |
---|
| 237 | $p->set_var(array('option_value'=>$branch['class'],'option_text'=>$branch['name'])); |
---|
[527] | 238 | |
---|
[588] | 239 | if($this->page_info['actual_catalog']==$branch['class']) |
---|
| 240 | $p->set_var('selected','selected'); |
---|
| 241 | else |
---|
| 242 | $p->set_var('selected',''); |
---|
| 243 | $p->parse('options','option',True); |
---|
| 244 | } |
---|
| 245 | |
---|
[527] | 246 | } |
---|
| 247 | } |
---|
| 248 | |
---|
| 249 | /////////// Preenche o combo, com dados do ldap |
---|
| 250 | $bo_ldap_manager = CreateObject("contactcenter.bo_ldap_manager"); |
---|
| 251 | $branchs = $bo_ldap_manager->get_all_ldap_sources(); |
---|
| 252 | |
---|
| 253 | foreach($branchs as $id=>$branch) { //Ldaps expresso |
---|
| 254 | $p->set_var(array('option_value'=>"bo_global_ldap_catalog#". |
---|
| 255 | $id."#". |
---|
| 256 | $branch['dn']."#". |
---|
| 257 | 0, |
---|
| 258 | 'option_text'=>$branch['name'])); //No value eu passo também o id, o contexto e se é externo, quando é um ldap |
---|
[480] | 259 | |
---|
[527] | 260 | if($this->page_info['actual_catalog']=="bo_global_ldap_catalog#".$id."#".$branch['dn']."#". 0) |
---|
| 261 | $p->set_var('selected','selected'); |
---|
| 262 | else |
---|
| 263 | $p->set_var('selected',''); |
---|
| 264 | $p->parse('options','option',True); |
---|
| 265 | } |
---|
| 266 | |
---|
[1474] | 267 | if(!$from_calendar || $from_calendar == 'mobilemail') { |
---|
[588] | 268 | $branchs = $bo_ldap_manager->get_external_ldap_sources(); |
---|
[623] | 269 | if(is_array($branchs)) foreach($branchs as $id=>$branch) { //Ldaps externos |
---|
[588] | 270 | $p->set_var(array('option_value'=>"bo_global_ldap_catalog#". |
---|
| 271 | $id."#". |
---|
| 272 | $branch['dn']."#". |
---|
| 273 | 1, |
---|
| 274 | 'option_text'=>$branch['name'])); //No value eu passo também o id, o contexto e se é externo, quando é um ldap |
---|
| 275 | |
---|
| 276 | if($this->page_info['actual_catalog']=="bo_global_ldap_catalog#".$id."#".$branch['dn']."#". 1) |
---|
| 277 | $p->set_var('selected','selected'); |
---|
| 278 | else |
---|
| 279 | $p->set_var('selected',''); |
---|
| 280 | $p->parse('options','option',True); |
---|
| 281 | } |
---|
[527] | 282 | } |
---|
| 283 | |
---|
[480] | 284 | /////////// Monta o resultado da pesquisa |
---|
| 285 | $p->set_var('th_theme',$GLOBALS['phpgw_info']['theme']['th_bg']); |
---|
[527] | 286 | |
---|
| 287 | if(empty($entries) && isset($_POST["name"]) && count($_SESSION["mobile_search_ids"])<=100 && strlen($_POST['name'])>=4) { //Se foi feita a busca e não teve resultados... |
---|
[480] | 288 | $p->set_var('message',lang('No matches found')); |
---|
| 289 | $p->parse('rows','row_empty',True); |
---|
| 290 | } |
---|
[527] | 291 | else if(count($_SESSION["mobile_search_ids"])>100) { //Muitos resultados... |
---|
| 292 | $p->set_var('message',lang('too many results')); |
---|
| 293 | $p->parse('rows','row_empty',True); |
---|
| 294 | } |
---|
| 295 | else if(isset($_POST["name"]) && strlen($_POST['name'])<4) { //Muitos resultados... |
---|
| 296 | $p->set_var('message',lang('the search argument must have at least 4 digits')); |
---|
| 297 | $p->parse('rows','row_empty',True); |
---|
| 298 | } |
---|
| 299 | else if((isset($_POST["name"])) || (isset($_GET["page"]))){ //Renderizar... |
---|
| 300 | |
---|
[480] | 301 | /////////// Preenche o cabeçalho da consulta |
---|
[527] | 302 | if($this->page_info['actual_catalog']!="bo_group_manager") { |
---|
[480] | 303 | $p->set_var( |
---|
| 304 | array('lang_people_name' => lang("Name"), |
---|
| 305 | 'lang_phone' => lang("Phone"), |
---|
| 306 | 'lang_mail' => lang("Email"))); |
---|
| 307 | $p->parse('header','people_header',True); |
---|
| 308 | } |
---|
| 309 | else { |
---|
| 310 | $p->set_var( |
---|
| 311 | array('lang_group_name' => lang("Name"), |
---|
| 312 | 'lang_title' => lang("Title") |
---|
| 313 | )); |
---|
| 314 | $p->parse('header','group_header',True); |
---|
| 315 | } |
---|
[588] | 316 | |
---|
[480] | 317 | /////////// Preencho as linhas do resultado |
---|
[588] | 318 | foreach($entries as $id => $entry) { |
---|
[480] | 319 | $this->nextmatchs->template_alternate_row_color($p); |
---|
[527] | 320 | if(($this->page_info['actual_catalog']!="bo_group_manager") && |
---|
| 321 | (strpos($this->page_info['actual_catalog'],'bo_global_ldap_catalog')===false)){ //People |
---|
[480] | 322 | $var = array('row_nome'=>$entry['names_ordered']); |
---|
| 323 | $conn1 = array_shift($entry['connections']); |
---|
| 324 | if(($conn1==NULL)||($conn1['connection_is_default']!=1)) { |
---|
| 325 | $var['row_telefone'] = ' '; |
---|
| 326 | $var['row_email'] = ' '; |
---|
| 327 | } |
---|
| 328 | else if($conn1['id_type']==1) { |
---|
| 329 | $var['row_email'] = $conn1['connection_value']; |
---|
| 330 | $conn2=array_shift($entry['connections']); |
---|
| 331 | if(($conn2==NULL)||($conn2['connection_is_default']!=1)) |
---|
| 332 | $var['row_telefone'] = ' '; |
---|
| 333 | else |
---|
| 334 | $var['row_telefone'] = $conn2['connection_value']; |
---|
| 335 | } |
---|
| 336 | else if($conn1['id_type']==2) { |
---|
| 337 | $var['row_email'] = ' '; |
---|
| 338 | $var['row_telefone'] = $conn1['connection_value']; |
---|
| 339 | } |
---|
[623] | 340 | $var['form_action'] = "index.php?menuaction=mobile.ui_mobilemail.new_msg"; |
---|
[480] | 341 | $p->set_var($var); |
---|
| 342 | $p->parse('rows','row',True); |
---|
| 343 | } |
---|
[527] | 344 | else if($this->page_info['actual_catalog']=="bo_group_manager"){ //Grupos |
---|
[480] | 345 | $var = array( |
---|
| 346 | 'row_group_name'=>$entry['short_name'], |
---|
| 347 | 'row_title' => $entry['title'] |
---|
| 348 | ); |
---|
| 349 | |
---|
| 350 | $p->set_var($var); |
---|
| 351 | $p->parse('rows','row_group',True); |
---|
| 352 | } |
---|
[527] | 353 | else { //Ldap |
---|
| 354 | $var = array('row_nome'=>$entry['names_ordered'][0]); |
---|
| 355 | $conn1 = array_shift($entry['connections']); |
---|
| 356 | if(($conn1==NULL)) { |
---|
| 357 | $var['row_telefone'] = ' '; |
---|
| 358 | $var['row_email'] = ' '; |
---|
| 359 | } |
---|
| 360 | else if($conn1['id_type']==1) { |
---|
| 361 | $var['row_email'] = $conn1['connection_value']; |
---|
| 362 | $conn2=array_shift($entry['connections']); |
---|
| 363 | if($conn2==NULL) |
---|
| 364 | $var['row_telefone'] = ' '; |
---|
| 365 | else |
---|
| 366 | $var['row_telefone'] = $conn2['connection_value']; |
---|
| 367 | } |
---|
| 368 | else if($conn1['id_type']==2) { |
---|
| 369 | $var['row_email'] = ' '; |
---|
| 370 | $var['row_telefone'] = $conn1['connection_value']; |
---|
| 371 | } |
---|
[588] | 372 | if(!$from_calendar) |
---|
[1499] | 373 | $var['form_action'] = "index.php?menuaction=mobile.ui_mobilemail.new_msg"; |
---|
[1474] | 374 | else if($from_calendar == 'mobilecalendar'){ |
---|
[588] | 375 | $var['id_contact'] = $entry['uidnumber'][0].'U'; |
---|
| 376 | $var['form_action'] = "index.php?menuaction=mobile.ui_mobilecalendar.add_participant"; |
---|
[1474] | 377 | }else{ |
---|
| 378 | $var['id_contact'] = $entry['uidnumber'][0].'U'; |
---|
| 379 | $var['form_action'] = "index.php?menuaction=mobile.ui_mobilemail.add_recipient"; |
---|
[588] | 380 | } |
---|
| 381 | $var['lang_select'] = lang("select"); |
---|
[527] | 382 | $p->set_var($var); |
---|
| 383 | $p->parse('rows','row',True); |
---|
| 384 | } |
---|
[480] | 385 | } |
---|
| 386 | } |
---|
| 387 | |
---|
[1474] | 388 | if($from_calendar == 'mobilemail') { |
---|
| 389 | $p->set_var('lang_choose_the_recipients',lang("choose the recipients")); |
---|
| 390 | $participants = $_SESSION['mobile_mail']; |
---|
| 391 | reset($participants); |
---|
| 392 | while (($participant = current($participants))!==false) { |
---|
| 393 | $p->set_var('row_contact_name',$participant); |
---|
| 394 | if(next($participants)!==false) |
---|
| 395 | $p->set_var('row_separate',','); |
---|
| 396 | else |
---|
| 397 | $p->set_var('row_separate','.'); |
---|
| 398 | $p->parse('rows_addeds','row_addeds',True); |
---|
| 399 | } |
---|
| 400 | }else if($from_calendar == 'mobilecalendar'){ |
---|
[588] | 401 | $p->set_var('lang_choose_the_participants',lang("choose the participants")); |
---|
| 402 | $participants = $_SESSION['mobile_calendar']; |
---|
[1474] | 403 | reset($participants); |
---|
| 404 | while (($participant = current($participants))!==false) { |
---|
[588] | 405 | $p->set_var('row_contact_name',$participant); |
---|
| 406 | if(next($participants)!==false) |
---|
| 407 | $p->set_var('row_separate',','); |
---|
| 408 | else |
---|
| 409 | $p->set_var('row_separate','.'); |
---|
| 410 | $p->parse('rows_addeds','row_addeds',True); |
---|
[1474] | 411 | } |
---|
[588] | 412 | } |
---|
| 413 | |
---|
[480] | 414 | ////////////////// Monto a paginação |
---|
[527] | 415 | if(!empty($entries) && count($_SESSION["mobile_search_ids"])<=100) { |
---|
| 416 | $num_pages = count($_SESSION["mobile_search_ids"])/10; |
---|
| 417 | |
---|
| 418 | if((count($_SESSION["mobile_search_ids"])%10!=0) || ($num_pages<1)) |
---|
| 419 | $num_pages++; |
---|
| 420 | if($actual_page!=0) { |
---|
| 421 | for($i=1;$i<=$num_pages;$i++) { |
---|
| 422 | $p->set_var('num_page',$i); |
---|
| 423 | $p->set_var('display_page',$i); |
---|
| 424 | if($i!=$actual_page) |
---|
| 425 | $p->parse('pages','page',True); |
---|
| 426 | else |
---|
| 427 | $p->parse('pages','page_no_link',True); |
---|
| 428 | } |
---|
[480] | 429 | } |
---|
[527] | 430 | |
---|
| 431 | if($actual_page>1) { |
---|
| 432 | $p->set_var('num_page',$actual_page-1); |
---|
| 433 | $p->set_var('display_page','<'); |
---|
| 434 | $p->parse('back','page',True); |
---|
| 435 | } |
---|
| 436 | |
---|
| 437 | if(($actual_page!=floor($num_pages)) && (floor($num_pages)>1) && ($actual_page!=0)) { |
---|
| 438 | $p->set_var('num_page',$actual_page+1); |
---|
| 439 | $p->set_var('display_page','>'); |
---|
| 440 | $p->parse('next','page',True); |
---|
| 441 | } |
---|
| 442 | } |
---|
[480] | 443 | |
---|
[623] | 444 | //$p->pfp('out','body'); |
---|
| 445 | $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out','body')); |
---|
[480] | 446 | } |
---|
| 447 | |
---|
| 448 | } |
---|
| 449 | ?> |
---|