[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 /***************************************************************************\ 3 * phpGroupWare - FeLaMiMail * 4 * http://www.linux-at-work.de * 5 * http://www.phpgw.de * 6 * http://www.phpgroupware.org * 7 * Written by : Lars Kneschke [lkneschke@linux-at-work.de] * 8 * ------------------------------------------------- * 9 * This program is free software; you can redistribute it and/or modify it * 10 * under the terms of the GNU General Public License as published by the * 11 * Free Software Foundation; either version 2 of the License, or (at your * 12 * option) any later version. * 13 \***************************************************************************/ 14 /* $Id: class.uibaseclass.inc.php 20093 2005-12-02 16:35:48Z lkneschke $ */ 15 16 class uibaseclass 17 { 18 var $public_functions = array( 19 'accounts_popup' => True, 20 'create_html' => True 21 ); 22 23 function accounts_popup($_appName) 24 { 25 $GLOBALS['egw']->accounts->accounts_popup($_appName); 26 } 27 28 function create_html() 29 { 30 if(!isset($GLOBALS['egw_info']['server']['deny_user_grants_access']) || !$GLOBALS['egw_info']['server']['deny_user_grants_access']) 31 { 32 $accounts = $GLOBALS['egw']->acl->get_ids_for_location('run',1,'calendar'); 33 $users = Array(); 34 # $this->build_part_list($users,$accounts,$event['owner']); 35 36 $str = ''; 37 @asort($users); 38 @reset($users); 39 40 switch($GLOBALS['egw_info']['user']['preferences']['common']['account_selection']) 41 { 42 case 'popup': 43 while (is_array($event['participants']) && list($id) = each($event['participants'])) 44 { 45 if($id != intval($event['owner'])) 46 { 47 $str .= '<option value="' . $id.$event['participants'][$id] . '"'.($event['participants'][$id] ? ' selected' : '').'>('.$GLOBALS['egw']->accounts->get_type($id) 48 .') ' . $GLOBALS['egw']->common->grab_owner_name($id) . '</option>' . "\n"; 49 } 50 } 51 $var[] = array 52 ( 53 'field' => '<input type="button" value="' . lang('Participants') . '" onClick="accounts_popup();">' . "\n" 54 . '<input type="hidden" name="accountid" value="' . $accountid . '">', 55 'data' => "\n".' <select name="participants[]" multiple size="7">' . "\n" . $str . '</select>' 56 ); 57 break; 58 default: 59 foreach($users as $id => $user_array) 60 { 61 if($id != intval($event['owner'])) 62 { 63 $str .= ' <option value="' . $id.$event['participants'][$id] . '"'.($event['participants'][$id] ? ' selected' : '').'>('.$user_array['type'].') '.$user_array['name'].'</option>'."\n"; 64 } 65 } 66 $var[] = array 67 ( 68 'field' => lang('Participants'), 69 'data' => "\n".' <select name="participants[]" multiple size="7">'."\n".$str.' </select>' 70 ); 71 break; 72 } 73 } 74 75 } 76 77 function create_table($_start, $_total, $_defaultSort, $_defaultOrder, $_header, $_rows, $_menuaction, $_name, $_tablePrefix) 78 { 79 $t =& CreateObject('phpgwapi.Template',EGW_APP_TPL); 80 $nextmatchs =& CreateObject('phpgwapi.nextmatchs'); 81 82 $rowCSS = array 83 ( 84 'row_on','row_off' 85 ); 86 87 $t->set_file(array("body" => 'nextmatchtable.tpl')); 88 $t->set_block('body','main'); 89 90 $url = $GLOBALS['egw']->link('/index.php','menuaction='.$_menuaction); 91 92 $order = get_var('order',array('POST','GET')) ? get_var('order',array('POST','GET')) : $_defaultOrder; 93 $sort = get_var('sort',array('POST','GET')) ? get_var('sort',array('POST','GET')) : $_defaultSort; 94 $start = get_var('start',array('POST','GET')) ? get_var('start',array('POST','GET')) : $_start; 95 96 #print "o: $order st: $start so: $sort<br>"; 97 98 $t->set_var('left_next_matchs', $nextmatchs->left($url,$start,$_total,$_menuaction)); 99 $t->set_var('name', lang('%1 - %2 of %3',$start+1,$start+count($_rows),$_total).' '.$_name); 100 $t->set_var('right_next_matchs', $nextmatchs->right($url,$start,$_total,$_menuaction)); 101 $t->set_var('table_prefix', $_tablePrefix); 102 103 // create the header 104 if(is_array($_header)) 105 { 106 // hack to reset start to 0, when switching sorting 107 $GLOBALS['start'] = 0; 108 foreach($_header as $key => $value) 109 { 110 if(!empty($value)) 111 $string = $nextmatchs->show_sort_order($sort,$value,$order,$url,$key); 112 else 113 $string = $key; 114 115 $header .= '<td class="th" align="center">'.$string.'</td>'; 116 } 117 $t->set_var('header','<tr>'.$header.'</tr>'); 118 unset($GLOBALS['start']); 119 } 120 121 // create the rows 122 if(is_array($_rows)) 123 { 124 $i=0; 125 foreach($_rows as $key => $value) 126 { 127 $rowData .= "<tr>\n"; 128 foreach($value as $cellData) 129 { 130 $rowData .= '<td class="'.$rowCSS[$i%2].'" align="center">'.$cellData.'</td>'; 131 } 132 $rowData .= "</tr>\n"; 133 $i++; 134 } 135 $t->set_var('rows',$rowData); 136 } 137 138 return $t->fp("out","main"); 139 } 140 } 141 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |