'calendar', 'noappheader' => True, 'noappfooter' => True, 'nofooter' => True ); $GLOBALS['phpgw_info']['flags'] = $phpgw_flags; include('../../header.inc.php'); $_SESSION['calendar']['user'] = $GLOBALS['phpgw_info']['user']; $_SESSION['calendar']['server'] = $GLOBALS['phpgw_info']['server']; define('PHPGW_API_INC','../../phpgwapi/inc'); include_once(PHPGW_API_INC.'/class.db.inc.php'); $page_content = << PAGE; echo $page_content; $db = new db(); $db->Halt_On_Error = 'no'; $db->connect( $_SESSION['calendar']['server']['db_name'], $_SESSION['calendar']['server']['db_host'], $_SESSION['calendar']['server']['db_port'], $_SESSION['calendar']['server']['db_user'], $_SESSION['calendar']['server']['db_pass'], $_SESSION['calendar']['server']['db_type'] ); $user_id = $_SESSION['calendar']['user']['account_id']; function ldapName($uid){ $connection = $GLOBALS['phpgw']->common->ldapConnect(); $justthese = array("cn"); $search = ldap_search($connection, $GLOBALS['phpgw_info']['server']['ldap_context'], "uidNumber=" . $uid, $justthese); $result = ldap_get_entries($connection, $search); ldap_close($connection); return $result[0]['cn'][0]; } if (IsSet($_POST['CAT'])){ if (!preg_match("/[a-zA-Z0-9]+/i",$_POST['CAT'][0])){ echo "Invalid entry:".$_POST['CAT'][0]; return false; } if (strlen($_POST['DAT']) > 0 && !preg_match("/[0123][0-9].[01][0-9].[12][90][0-9][0-9]$/i",$_POST['DAT'])){ echo "Invalid entry:".$_POST['DAT']; return false; } if (IsSet($_POST['DAT'])) $initDate = mktime(null,null,null,substr($_POST['DAT'],3,2),substr($_POST['DAT'],0,2),substr($_POST['DAT'],6,4)); if ($_POST['CAL'][0] != 'run') $user_id = $_POST['CAL'][0]; foreach($_POST['CAT'] as $catid) if(!$db->query("select cal_id,title,description,datetime,edatetime from phpgw_cal where ".(!$_POST['NORM']?"cal_type = 'H' and":" is_public = 1 and ")." owner = ".$user_id." and (category like '%,".$catid.",%' or category like '%,".$catid."' or category like '".$catid.",%' or category = '".$catid."')".(IsSet($initDate)?" and datetime > ".$initDate:""))){ print("Query failed"); return; } else while($db->next_record()) $result_[] = $db->row(); echo ""; return; } $cat_query="select cat_id,cat_name from phpgw_categories where cat_appname = 'calendar' and (cat_owner = ".$user_id; foreach($GLOBALS['phpgw']->accounts->membership() as $idx => $group){ $cat_query = $cat_query.' or cat_owner = '.$group['account_name']; } $cat_query = $cat_query.')'; if (!$db->query($cat_query)) print("Query failed"); else while($db->next_record()) $categories[] = $db->row(); if (!$db->query("select acl_account from phpgw_acl where acl_appname = 'calendar' and acl_location = ".$user_id)) print("Query failed"); else while($db->next_record()) $userCals[] = $db->row(); $self = $_SERVER['PHP_SELF']; print(""); print(""); print("
"); print("
"); print("Categoria(s):
"); print("
"); print("Incluir ocorrências do tipo normal:
Usuario:
Apartir da data: dd/mm/aaaa
(caso todas deixar em branco):


"); print(""); ?>