<?

function pratiche_element_1()
{
	if (check_perm_mod("pratiche","r")==1)
	{
		$thislist= load_fwobject("lists","pratiche",1);
		//print_r ($thislist);
		$output=draw_list($thislist,"pratiche");
		return $output;

	} else return "";
}

function pratiche_element_2($ref_prat="")
{
	GLOBAL $DB,$CONF;
	
	if ($ref_prat=="") return "";
	$rs_prat=$DB->Execute("SELECT * FROM pratiche WHERE id=".$ref_prat);
	$res_prat=$rs_prat->FetchRow();
	$output='
		<div class="col-shortcuts">
    		<a href="'.$CONF[url_base].$CONF[dir_modules].'pratiche/pages/pratiche_show.php?id='.$ref_prat.'" class="col-shortcuts-tit"><img src="%[IMAGE_GPATH]%ico/ico_prat_peq.gif" width="16" height="16" border="0" align="absmiddle">'.$res_prat[pr_codice].'</a>
    		<a href="'.$CONF[url_base].$CONF[dir_modules].'prestazioni/pages/prestazioni_view.php?form_id=listprestaz&form_page=1&ref_id[text]='.urlencode($res_prat[pr_codice]).'&ref_id[realval][]='.$ref_prat.'" class="col-shortcuts-link">'.PRESTAZIONI_TITLE.'</a>
				<a href="'.$CONF[url_base].$CONF[dir_modules].'calendar/pages/app_view.php?form_id=listcont&form_page=1&ref_prat[text]='.urlencode($res_prat[pr_codice]).'&ref_prat[realval][]='.$ref_prat.'" class="col-shortcuts-link">'.PRATICHE_IMPEGN.'</a>
				<a href="'.$CONF[url_base].$CONF[dir_modules].'document/pages/documents_view.php?form_id=listdoc&form_page=1&ref_prat[text]='.urlencode($res_prat[pr_codice]).'&ref_prat[realval][]='.$ref_prat.'" class="col-shortcuts-link">'.DOCUMENT_TITLE.'</a>
		</div>';
	$keymap[54]=$CONF[url_base].$CONF[dir_modules]."/pratiche/pages/pratiche_show.php?id=".$ref_prat;
	$keymap[56]=$CONF[url_base].$CONF[dir_modules]."/prestazioni/pages/prestazioni_view.php?form_id=listprestaz&form_page=1&ref_id[text]=".urlencode($res_prat[pr_codice])."&ref_id[realval][]=".$ref_prat;
	$keymap[55]=$CONF[url_base].$CONF[dir_modules]."/calendar/pages/app_view.php?form_id=listcont&form_page=1&ref_prat[text]=".urlencode($res_prat[pr_codice])."&ref_prat[realval][]=".$ref_prat;
	$keymap[57]=$CONF[url_base].$CONF[dir_modules]."document/pages/documents_view.php?form_id=listdoc&form_page=1&ref_prat[text]=".urlencode($res_prat[pr_codice])."&ref_prat[realval][]=".$ref_prat;
		
	$output.= set_js_keyhandler($keymap);

	
	return $output;
}

?>