function _card(&$PDOdb, &$object)
{
    global $langs, $conf, $user, $db;
    llxHeader();
    dol_fiche_head(array(), 'menu', 'Menu');
    $formCore = new TFormCore('auto', 'formMenu', 'post');
    echo $formCore->hidden('action', 'save');
    echo $formCore->hidden('id', $object->getId());
    $TQuery = array('0' => '----') + TQuery::getQueries($PDOdb);
    $TDashBoard = array('0' => '----') + TQDashBoard::getDashboard($PDOdb, '', 0, true);
    $tbs = new TTemplateTBS();
    echo $tbs->render('tpl/menu.html', array(), array('menu' => array('type_menu' => $formCore->combo('', 'type_menu', $object->TTypeMenu, $object->type_menu), 'tab_object' => $formCore->combo('', 'tab_object', $object->TTabObject, $object->tab_object), 'mainmenu' => $formCore->combo('', 'mainmenu', TQueryMenu::getMenu($PDOdb, 'main'), $object->mainmenu), 'leftmenu' => $formCore->combo('', 'leftmenu', TQueryMenu::getMenu($PDOdb, 'left'), $object->leftmenu), 'fk_query' => $formCore->combo('', 'fk_query', $TQuery, $object->fk_query), 'fk_dashboard' => $formCore->combo('', 'fk_dashboard', $TDashBoard, $object->fk_dashboard), 'title' => $formCore->texte('', 'title', $object->title, 80, 255), 'perms' => $formCore->texte('', 'perms', $object->perms, 80, 255)), 'view' => array('langs' => $langs, 'buttons' => $formCore->btsubmit($langs->trans('Delete'), 'bt_delete', '', 'butActionDelete') . '   ' . $formCore->btsubmit($langs->trans('Save'), 'bt_save'))));
    $formCore->end();
    dol_fiche_end();
    llxFooter();
}
function fiche(&$dashboard, $action = 'edit', $withHeader = true)
{
    global $langs, $conf, $user, $db;
    $PDOdb = new TPDOdb();
    $form = new TFormCore();
    $cell_height = 200;
    $tab_object = GETPOST('tab_object');
    $table_element = GETPOST('table_element');
    $fk_object = GETPOST('fk_object');
    if (empty($table_element)) {
        if ($tab_object == 'thirdparty') {
            $table_element = 'societe';
        } else {
            if ($tab_object == 'project') {
                $table_element = 'projet';
            } else {
                $table_element = $tab_object;
            }
        }
    }
    if ($withHeader) {
        llxHeader('', 'Query DashBoard', '', '', 0, 0, array('/query/js/dashboard.js', '/query/js/jquery.gridster.min.js'), array('/query/css/dashboard.css', '/query/css/jquery.gridster.min.css'));
        $head = TQueryMenu::getHeadForObject($tab_object, $fk_object);
        dol_fiche_head($head, 'tabQuery' . GETPOST('menuId'), 'Query');
        print_fiche_titre($dashboard->title);
    } else {
        if (GETPOST('for_incusion') > 0) {
            ?>
		<div class="querydashboard">
			<link rel="stylesheet" type="text/css" title="default" href="<?php 
            echo dol_buildpath('/query/css/dashboard.css', 1);
            ?>
">
			<link rel="stylesheet" type="text/css" title="default" href="<?php 
            echo dol_buildpath('/query/css/jquery.gridster.min.css', 1);
            ?>
">
			<script type="text/javascript" src="<?php 
            echo dol_buildpath('/query/js/dashboard.js', 1);
            ?>
"></script>
			<script type="text/javascript" src="<?php 
            echo dol_buildpath('/query/js/jquery.gridster.min.js', 1);
            ?>
"></script>

		<?php 
        } else {
            ?>
<html>
			<head>
				<meta charset="UTF-8">
				<link rel="stylesheet" type="text/css" href="<?php 
            echo dol_buildpath('/theme/eldy/style.css.php?lang=fr_FR&theme=eldy', 1);
            ?>
">
				<link rel="stylesheet" type="text/css" title="default" href="<?php 
            echo dol_buildpath('/query/css/dashboard.css', 1);
            ?>
">
				<link rel="stylesheet" type="text/css" title="default" href="<?php 
            echo dol_buildpath('/query/css/jquery.gridster.min.css', 1);
            ?>
">

				<script type="text/javascript" src="<?php 
            echo dol_buildpath('/includes/jquery/js/jquery.min.js', 1);
            ?>
"></script>
				<script type="text/javascript" src="<?php 
            echo dol_buildpath('/query/js/dashboard.js', 1);
            ?>
"></script>
				<script type="text/javascript" src="<?php 
            echo dol_buildpath('/query/js/jquery.gridster.min.js', 1);
            ?>
"></script>
				<style type="text/css">
					.pagination { display : none; }
					<?php 
            if ((int) GETPOST('allow_gen') != 1) {
                echo '.notInGeneration { display : none; }';
            }
            ?>

					table.liste tr.impair,table.liste tr.pair,table.liste tr.liste_titre,div.titre {
						font-size: 12px;
					}
				</style>
			</head>
		<body >
		<?php 
        }
    }
    ?>
	<script type="text/javascript">
		var MODQUERY_INTERFACE = "<?php 
    echo dol_buildpath('/query/script/interface.php', 1);
    ?>
";
		
		$(document).ready(function(){ //DOM Ready
			
			gridster_width = Math.round($('.gridster').innerWidth() / 5);
			if(gridster_width<50) gridster_width = 240;
			
		    $(".gridster ul").gridster({
		        widget_margins: [10, 10]
		        ,widget_base_dimensions: [gridster_width, <?php 
    echo $cell_height;
    ?>
]
		        ,min_cols:3
		        ,min_rows:5
		        ,serialize_params: function($w, wgd) { 
		        	return { posx: wgd.col, posy: wgd.row, width: wgd.size_x, height: wgd.size_y, k : $w.attr('data-k') } 
		        }
		        <?php 
    if ($action == 'edit') {
        ?>
,resize: {
		            enabled: true
		            ,max_size: [4, 4]
		            ,min_size: [1, 1]
		        }
		        
		       
		       <?php 
    }
    ?>
		    })<?php 
    if ($action == 'view') {
        echo '.data(\'gridster\').disable()';
    }
    ?>
;
		
			var gridster = $(".gridster ul").gridster().data('gridster');
		
			$('#addQuery').click(function() {
				
				var fk_query = $('select[name=fk_query]').val();
				
				$.ajax({
					url: MODQUERY_INTERFACE
					,data: {
						put:'dashboard-query'
						,fk_query : fk_query
						,fk_qdashboard:<?php 
    echo $dashboard->getId();
    ?>
					}
					,dataType:'json'
					
				}).done(function(data) {
					
					var title = $('select[name=fk_query] option:selected').text();
					
					gridster.add_widget('<li data-k="'+data+'">'+title+'</li>',1,1,1,1);	
				});
				
			});
			
			$('#saveDashboard').click(function() {
				
				var $button = $(this);
				
				$button.hide();
				
				$.ajax({
					url: MODQUERY_INTERFACE
					,data: {
						put:'dashboard'
						,id:<?php 
    echo $dashboard->getId();
    ?>
						,title:$('input[name=title]').val()
						,fk_usergroup:$('select[name=fk_usergroup]').val()
						,send_by_mail:$('select[name=send_by_mail]').val()
						,hook:$('select[name=hook]').val()
						,use_as_landing_page:$('select[name=use_as_landing_page]').val()
						,refresh_dashboard:$('input[name=refresh_dashboard]').val()
					}
					
				}).done(function(data) {
				   <?php 
    if ($dashboard->getId() > 0) {
        ?>
$.ajax({
							url: MODQUERY_INTERFACE
							,data: {
								put:'dashboard-query-link'
								,TCoord:gridster.serialize( )
								,fk_qdashboard:<?php 
        echo $dashboard->getId();
        ?>
							}
							,dataType:'json'
							
					  }).done(function(data) {
					  	$button.show();
					  });
						
						<?php 
    } else {
        echo 'document.location.href="?action=view&id="+data;';
    }
    ?>
					  	
		              
				});
				
			});
		
		});
		
		function delTile(idTile) {
			$('li[tile-id='+idTile+']').css('opacity',.5);
			
			$.ajax({
				url: MODQUERY_INTERFACE
				,data: {
					put:'dashboard-query-remove'
					,id : idTile
				}
				,dataType:'json'
				
			}).done(function(data) {
				$('li[tile-id='+idTile+']').toggle();
				//document.location.hre
			});
			
		}
			
	</script>
	<?php 
    if ($action == 'edit') {
        ?>
<div><?php 
        $TQuery = TQuery::getQueries($PDOdb);
        echo $form->texte($langs->trans('Title'), 'title', $dashboard->title, 50, 255);
        $formDoli = new Form($db);
        echo ' - ' . $langs->trans('LimitAccessToThisGroup') . ' : ' . $formDoli->select_dolgroups($dashboard->fk_usergroup, 'fk_usergroup', 1) . '/' . $langs->trans('UseAsLandingPage') . $formDoli->selectarray('use_as_landing_page', array($langs->trans('No'), $langs->trans('Yes')), $dashboard->use_as_landing_page);
        echo $form->combo(' - ' . $langs->trans('SendByMailToThisGroup'), 'send_by_mail', $dashboard->TSendByMail, $dashboard->send_by_mail);
        echo $form->combo(' - ' . $langs->trans('ShowThisInCard'), 'hook', $dashboard->THook, $dashboard->hook);
        echo $form->number('<br />' . $langs->trans('RefreshDashboard'), 'refresh_dashboard', $dashboard->refresh_dashboard, 20, 1, 0);
        ?>
			<a href="#" class="butAction" id="saveDashboard"><?php 
        echo $langs->trans('SaveDashboard');
        ?>
</a>
		</div>
		<?php 
        if ($dashboard->getId() > 0) {
            ?>
		<div>
			<?php 
            $TQuery = TQuery::getQueries($PDOdb);
            echo $form->combo('', 'fk_query', $TQuery, 0);
            ?>
			<a href="#" class="butAction" id="addQuery"><?php 
            echo $langs->trans('AddThisQuery');
            ?>
</a>
		</div>
		
		<?php 
        }
    } else {
        if (!empty($conf->global->QUERY_SHOW_PDF_TRANSFORM)) {
            echo '<div style="text-align:right" class="notInGeneration"><a class="butAction" style=";z-index:999;" href="download-dashboard.php?uid=' . $dashboard->uid . '">' . $langs->trans('Download') . '</a></div>';
        }
    }
    ?>
		
	
	<div class="gridster">
	    <ul>
	    	<?php 
    foreach ($dashboard->TQDashBoardQuery as $k => &$cell) {
        echo '<li tile-id="' . $cell->getId() . '" data-k="' . $k . '" data-row="' . $cell->posy . '" data-col="' . $cell->posx . '" data-sizex="' . $cell->width . '" data-sizey="' . $cell->height . '" ' . ($withHeader ? '' : 'style="overflow:hidden;"') . '>';
        if ($action == 'edit') {
            echo '<a style="position:absolute; top:3px; right:3px; z-index:999;" href="javascript:delTile(' . $cell->getId() . ')">' . img_delete('DeleteThisTile') . '</a>';
        } else {
            echo '<a style="position:absolute; top:3px; right:3px; z-index:999;" href="' . dol_buildpath('/query/query.php?action=run-in&id=' . $cell->query->getId(), 1) . '">' . img_picto($langs->trans('Run'), 'object_cron.png') . '</a>';
        }
        if ($cell->query->type == 'LIST') {
            $cell->query->type = 'SIMPLELIST';
        }
        if (!empty($cell->query)) {
            if (!$withHeader) {
                echo $cell->query->run(false, $cell->height * $cell_height, $table_element, $fk_object, 0);
            } else {
                echo $cell->query->run(false, $cell->height * $cell_height, $table_element, $fk_object);
            }
        }
        echo '</li>';
    }
    ?>
	        
	
	    </ul>
	</div>
	
	<div style="clear:both"></div>

	<?php 
    if ($dashboard->refresh_dashboard > 0 && !$withHeader) {
        echo "<script type=\"text/javascript\">\n";
        echo "   // Automatically refresh\n";
        echo "   setInterval(\"window.location.reload()\"," . 60000 * $dashboard->refresh_dashboard . ");\n";
        echo "</script>\n";
    }
    ?>
	
	<?php 
    if ($withHeader) {
        if ($dashboard->getId() > 0) {
            print dol_buildpath('/query/dashboard.php?action=run&uid=' . $dashboard->uid, 2);
        }
        dol_fiche_end();
        llxFooter();
    } else {
        if (GETPOST('for_incusion') > 0) {
            ?>
</div><?php 
        } else {
            ?>
		</body></html>
		<?php 
        }
    }
}
function run(&$PDOdb, &$query, $preview = false)
{
    global $conf, $langs;
    if (!$preview) {
        llxHeader('', 'Query', '', '', 0, 0, array(), array('/query/css/query.css'));
        $head = TQueryMenu::getHeadForObject(GETPOST('tab_object'), GETPOST('fk_object'));
        dol_fiche_head($head, 'tabQuery' . GETPOST('menuId'), 'Query');
    } else {
        ?>
<html>
			<head>
				<link rel="stylesheet" type="text/css" href="<?php 
        echo dol_buildpath('/theme/eldy/style.css.php', 1);
        ?>
">
				<link rel="stylesheet" type="text/css" href="<?php 
        echo dol_buildpath('/query/css/query.css', 1);
        ?>
">
				<script type="text/javascript" src="<?php 
        echo dol_buildpath('/includes/jquery/js/jquery.min.js', 1);
        ?>
"></script>
				<meta http-equiv="content-type" content="text/html; charset=utf-8" />
			</head>
		<body style="margin:0 0 0 0;padding:0 0 0 0;"><?php 
    }
    if (empty($query->sql_from)) {
        die('InvalidQuery');
    }
    $show_details = GETPOST('_a') == '' ? true : false;
    if ($preview === true) {
        $query->preview = true;
    }
    $tab_object = GETPOST('tab_object');
    $table_element = GETPOST('table_element');
    $fk_object = GETPOST('fk_object');
    if (empty($table_element)) {
        if ($tab_object == 'thirdparty') {
            $table_element = 'societe';
        } else {
            if ($tab_object == 'project') {
                $table_element = 'projet';
            } else {
                $table_element = $tab_object;
            }
        }
    }
    echo $query->run($show_details, 0, $table_element, $fk_object, -1, GETPOST('show_as_list'));
    if (!$preview) {
        echo '<p><a href="' . dol_buildpath('/query/get-json.php', 1) . '?' . http_build_query(array('TListTBS' => $_REQUEST['TListTBS'])) . '&uid=' . $query->uid . '" target="_blank">' . $langs->trans('QueryAsJSON') . '</a></p>';
        dol_fiche_end();
        llxFooter();
    } else {
        ?>
</body></html><?php 
    }
}
<?php

/*
 * Script créant et vérifiant que les champs requis s'ajoutent bien
 */
if (defined('INC_FROM_DOLIBARR')) {
    dol_include_once('/query/config.php');
    $PDOdb = new TPDOdb();
} else {
    define('INC_FROM_CRON_SCRIPT', true);
    require '../config.php';
    $PDOdb = new TPDOdb();
    $PDOdb->db->debug = true;
}
dol_include_once('/query/class/query.class.php');
dol_include_once('/query/class/dashboard.class.php');
dol_include_once('/query/class/bddconnector.class.php');
$o = new TQuery($db);
$o->init_db_by_vars($PDOdb);
$o = new TQDashBoard($db);
$o->init_db_by_vars($PDOdb);
$o = new TQDashBoardQuery($db);
$o->init_db_by_vars($PDOdb);
$o = new TQueryMenu($db);
$o->init_db_by_vars($PDOdb);
$o = new TBDDConnector($db);
$o->init_db_by_vars($PDOdb);
$PDOdb->Execute("INSERT INTO `llx_qdashboard` (`rowid`, `date_cre`, `date_maj`, `fk_user`, `fk_user_author`, `fk_usergroup`, `uid`, `send_by_mail`, `hook`, `title`, `refresh_dashboard`) VALUES\n(1, '2015-12-04 16:20:45', '2015-12-09 17:48:27', 1, 2, 4, '5239255d1f9cb26f08f8a52125178c38', '', 'projectcard', 'Projets', '0'),\n(2, '2015-12-05 17:16:18', '2015-12-09 17:45:24', 1, 2, 2, '9100b0751204b7521c91febb15c1920d', '', 'usercard', 'Commercial', '0'),\n(4, '2015-12-09 12:28:02', '2015-12-09 12:29:42', 2, 2, 4, '887f97707d73f89288eb9dc0a76530ee', 'WEEK', 'usercard', 'Développeur', '0')");
$PDOdb->Execute("INSERT INTO `llx_qdashboard_query` (`rowid`, `date_cre`, `date_maj`, `fk_qdashboard`, `fk_query`, `width`, `height`, `posx`, `posy`, `title`) VALUES\n(1, '2015-12-04 16:21:25', '2015-12-09 17:48:27', 1, 1, 2, 1, 1, 3, ''),\n(2, '2015-12-04 16:57:41', '2015-12-09 17:48:27', 1, 2, 3, 2, 2, 1, ''),\n(3, '2015-12-04 17:05:40', '2015-12-09 17:48:27', 1, 3, 1, 2, 1, 1, ''),\n(5, '2015-12-04 23:33:32', '2015-12-09 17:48:27', 1, 5, 2, 1, 3, 3, ''),\n(6, '2015-12-05 17:16:46', '2015-12-09 17:45:24', 2, 7, 1, 2, 1, 1, ''),\n(8, '2015-12-05 17:17:01', '2015-12-09 17:45:24', 2, 6, 1, 2, 2, 1, ''),\n(12, '2015-12-09 12:29:04', '2015-12-09 12:29:42', 4, 2, 3, 1, 1, 1, ''),\n(11, '2015-12-09 12:28:31', '2015-12-09 12:29:42', 4, 5, 3, 1, 1, 2, '')");
$PDOdb->Execute("INSERT INTO `llx_query` (`rowid`, `date_cre`, `date_maj`, `sql_fields`, `sql_from`, `sql_where`, `sql_afterwhere`, `TField`, `TTable`, `TOrder`, `TTitle`, `TLink`, `THide`, `TTranslate`, `TMode`, `TOperator`, `TGroup`, `TFunction`, `TValue`, `TJoin`, `expert`, `title`, `type`, `xaxis`) VALUES\n(1, '2015-12-04 16:14:01', '2015-12-04 16:20:40', 'llx_projet_task.duration_effective,llx_projet_task.planned_workload,llx_projet.ref,llx_projet.fk_statut', 'llx_projet_task LEFT JOIN llx_projet ON (llx_projet.rowid=llx_projet_task.fk_projet) ', '', NULL, 'a:4:{i:0;s:34:\"llx_projet_task.duration_effective\";i:1;s:32:\"llx_projet_task.planned_workload\";i:2;s:14:\"llx_projet.ref\";i:3;s:20:\"llx_projet.fk_statut\";}', 'a:2:{i:0;s:15:\"llx_projet_task\";i:1;s:10:\"llx_projet\";}', 'a:1:{s:14:\"llx_projet.ref\";s:3:\"ASC\";}', 'a:3:{s:34:\"llx_projet_task.duration_effective\";s:9:\"Effectué\";s:32:\"llx_projet_task.planned_workload\";s:6:\"Prévu\";s:14:\"llx_projet.ref\";s:6:\"Projet\";}', 'a:0:{}', 'a:2:{s:14:\"llx_projet.ref\";s:1:\"1\";s:20:\"llx_projet.fk_statut\";s:1:\"1\";}', NULL, 'a:4:{s:34:\"llx_projet_task.duration_effective\";s:5:\"value\";s:32:\"llx_projet_task.planned_workload\";s:5:\"value\";s:14:\"llx_projet.ref\";s:5:\"value\";s:20:\"llx_projet.fk_statut\";s:5:\"value\";}', 'a:0:{}', 'a:1:{i:0;s:14:\"llx_projet.ref\";}', 'a:3:{s:34:\"llx_projet_task.duration_effective\";s:19:\"SUM(@field@ / 3600)\";s:32:\"llx_projet_task.planned_workload\";s:19:\"SUM(@field@ / 3600)\";s:14:\"llx_projet.ref\";s:36:\"CONCAT(@field@,'' '',llx_projet.title)\";}', 'a:1:{s:20:\"llx_projet.fk_statut\";s:1:\"1\";}', 'a:1:{s:10:\"llx_projet\";a:2:{i:0;s:16:\"llx_projet.rowid\";i:1;s:25:\"llx_projet_task.fk_projet\";}}', 0, 'Temps passés / prévus', 'CHART', 'llx_projet.ref'),\n(2, '2015-12-04 16:23:08', '2015-12-04 17:00:37', 'llx_projet_task_time.task_date,llx_projet_task_time.task_duration,llx_projet_task_time.fk_user,llx_user.login', 'llx_projet_task_time LEFT JOIN llx_projet_task ON (llx_projet_task.rowid=llx_projet_task_time.fk_task)  LEFT JOIN llx_projet ON (llx_projet.rowid=llx_projet_task.fk_projet)  LEFT JOIN llx_user ON (llx_user.rowid=llx_projet_task_time.fk_user) ', 'llx_projet_task_time.task_date >= (NOW() - INTERVAL 7 DAY)', NULL, 'a:4:{i:0;s:30:\"llx_projet_task_time.task_date\";i:1;s:34:\"llx_projet_task_time.task_duration\";i:2;s:28:\"llx_projet_task_time.fk_user\";i:3;s:14:\"llx_user.login\";}', 'a:4:{i:0;s:20:\"llx_projet_task_time\";i:1;s:15:\"llx_projet_task\";i:2;s:10:\"llx_projet\";i:3;s:8:\"llx_user\";}', 'a:2:{s:30:\"llx_projet_task_time.task_date\";s:3:\"ASC\";s:14:\"llx_user.login\";s:3:\"ASC\";}', 'a:2:{s:34:\"llx_projet_task_time.task_duration\";s:6:\"Durée\";s:14:\"llx_user.login\";s:11:\"Utilisateur\";}', 'a:0:{}', 'a:2:{s:30:\"llx_projet_task_time.task_date\";s:1:\"1\";s:28:\"llx_projet_task_time.fk_user\";s:1:\"1\";}', NULL, 'a:4:{s:30:\"llx_projet_task_time.task_date\";s:8:\"function\";s:34:\"llx_projet_task_time.task_duration\";s:5:\"value\";s:28:\"llx_projet_task_time.fk_user\";s:5:\"value\";s:14:\"llx_user.login\";s:5:\"value\";}', 'a:1:{s:30:\"llx_projet_task_time.task_date\";s:2:\">=\";}', 'a:1:{i:0;s:28:\"llx_projet_task_time.fk_user\";}', 'a:2:{s:30:\"llx_projet_task_time.task_date\";s:29:\"DATE_FORMAT(@field@, ''%m/%Y'')\";s:34:\"llx_projet_task_time.task_duration\";s:17:\"SUM(@field@/3600)\";}', 'a:1:{s:30:\"llx_projet_task_time.task_date\";s:22:\"NOW() - INTERVAL 7 DAY\";}', 'a:3:{s:15:\"llx_projet_task\";a:2:{i:0;s:21:\"llx_projet_task.rowid\";i:1;s:28:\"llx_projet_task_time.fk_task\";}s:10:\"llx_projet\";a:2:{i:0;s:16:\"llx_projet.rowid\";i:1;s:25:\"llx_projet_task.fk_projet\";}s:8:\"llx_user\";a:2:{i:0;s:14:\"llx_user.rowid\";i:1;s:28:\"llx_projet_task_time.fk_user\";}}', 0, 'Temps par développeur à la semaine', 'CHART', 'llx_user.login'),\n(3, '2015-12-04 17:04:11', '2015-12-04 20:29:17', 'llx_projet_task_time.task_duration,llx_user.login,llx_projet_task_time.task_date', 'llx_projet_task_time LEFT JOIN llx_projet_task ON (llx_projet_task.rowid=llx_projet_task_time.fk_task)  LEFT JOIN llx_projet ON (llx_projet.rowid=llx_projet_task.fk_projet)  LEFT JOIN llx_user ON (llx_user.rowid=llx_projet_task_time.fk_user) ', 'llx_projet_task_time.task_date > (NOW() - INTERVAL 1 YEAR)', NULL, 'a:3:{i:0;s:30:\"llx_projet_task_time.task_date\";i:1;s:34:\"llx_projet_task_time.task_duration\";i:2;s:14:\"llx_user.login\";}', 'a:4:{i:0;s:20:\"llx_projet_task_time\";i:1;s:15:\"llx_projet_task\";i:2;s:10:\"llx_projet\";i:3;s:8:\"llx_user\";}', 'a:0:{}', 'a:2:{s:34:\"llx_projet_task_time.task_duration\";s:6:\"Durée\";s:14:\"llx_user.login\";s:12:\"Développeur\";}', 'a:0:{}', 'a:1:{s:30:\"llx_projet_task_time.task_date\";s:1:\"1\";}', NULL, 'a:3:{s:34:\"llx_projet_task_time.task_duration\";s:5:\"value\";s:14:\"llx_user.login\";s:5:\"value\";s:30:\"llx_projet_task_time.task_date\";s:8:\"function\";}', 'a:1:{s:30:\"llx_projet_task_time.task_date\";s:1:\">\";}', 'a:1:{i:0;s:14:\"llx_user.login\";}', 'a:1:{s:34:\"llx_projet_task_time.task_duration\";s:19:\"SUM(@field@ / 3600)\";}', 'a:1:{s:30:\"llx_projet_task_time.task_date\";s:23:\"NOW() - INTERVAL 1 YEAR\";}', 'a:3:{s:15:\"llx_projet_task\";a:2:{i:0;s:21:\"llx_projet_task.rowid\";i:1;s:28:\"llx_projet_task_time.fk_task\";}s:10:\"llx_projet\";a:2:{i:0;s:16:\"llx_projet.rowid\";i:1;s:25:\"llx_projet_task.fk_projet\";}s:8:\"llx_user\";a:2:{i:0;s:14:\"llx_user.rowid\";i:1;s:28:\"llx_projet_task_time.fk_user\";}}', 0, 'Temps par utilisateur sur 1 an', 'PIE', 'llx_user.login'),\n(5, '2015-12-04 23:26:12', '2015-12-09 12:37:04', 'llx_projet_task_time.task_date,llx_projet_task_time.task_duration', 'llx_projet_task_time LEFT JOIN llx_projet_task ON (llx_projet_task.rowid=llx_projet_task_time.fk_task)  LEFT JOIN llx_projet ON (llx_projet.rowid=llx_projet_task.fk_projet)  LEFT JOIN llx_user ON (llx_user.rowid=llx_projet_task_time.fk_user) ', 'llx_projet_task_time.task_date >= (NOW() - INTERVAL 1 YEAR)', '', 'a:2:{i:0;s:30:\"llx_projet_task_time.task_date\";i:1;s:34:\"llx_projet_task_time.task_duration\";}', 'a:4:{i:0;s:20:\"llx_projet_task_time\";i:1;s:15:\"llx_projet_task\";i:2;s:10:\"llx_projet\";i:3;s:8:\"llx_user\";}', 'a:1:{s:30:\"llx_projet_task_time.task_date\";s:3:\"ASC\";}', 'a:2:{s:30:\"llx_projet_task_time.task_date\";s:4:\"Jour\";s:34:\"llx_projet_task_time.task_duration\";s:6:\"Durée\";}', 'a:0:{}', 'a:0:{}', NULL, 'a:2:{s:30:\"llx_projet_task_time.task_date\";s:8:\"function\";s:34:\"llx_projet_task_time.task_duration\";s:8:\"function\";}', 'a:1:{s:30:\"llx_projet_task_time.task_date\";s:2:\">=\";}', 'a:1:{i:0;s:30:\"llx_projet_task_time.task_date\";}', 'a:2:{s:30:\"llx_projet_task_time.task_date\";s:32:\"DATE_FORMAT(@field@, ''%d/%m/%Y'')\";s:34:\"llx_projet_task_time.task_duration\";s:17:\"SUM(@field@/3600)\";}', 'a:1:{s:30:\"llx_projet_task_time.task_date\";s:23:\"NOW() - INTERVAL 1 YEAR\";}', 'a:3:{s:15:\"llx_projet_task\";a:2:{i:0;s:21:\"llx_projet_task.rowid\";i:1;s:28:\"llx_projet_task_time.fk_task\";}s:10:\"llx_projet\";a:2:{i:0;s:16:\"llx_projet.rowid\";i:1;s:25:\"llx_projet_task.fk_projet\";}s:8:\"llx_user\";a:2:{i:0;s:14:\"llx_user.rowid\";i:1;s:28:\"llx_projet_task_time.fk_user\";}}', 0, 'Temps consacré par jour sur l''année', 'LINE', 'llx_projet_task_time.task_date'),\n(6, '2015-12-05 17:04:59', '2015-12-09 16:49:58', 'llx_propal.tms,llx_propal.fk_statut,llx_propal.total_ht,llx_propal.total', 'llx_propal LEFT JOIN llx_user ON (llx_user.rowid=llx_propal.fk_user_author) ', 'llx_propal.tms >= (NOW() - INTERVAL 1 YEAR)', '', 'a:4:{i:0;s:14:\"llx_propal.tms\";i:1;s:20:\"llx_propal.fk_statut\";i:2;s:19:\"llx_propal.total_ht\";i:3;s:16:\"llx_propal.total\";}', 'a:2:{i:0;s:10:\"llx_propal\";i:1;s:8:\"llx_user\";}', 's:0:\"\";', 'a:3:{s:20:\"llx_propal.fk_statut\";s:6:\"Statut\";s:19:\"llx_propal.total_ht\";s:8:\"Total HT\";s:16:\"llx_propal.total\";s:6:\"Nombre\";}', 'a:0:{}', 'a:2:{s:14:\"llx_propal.tms\";s:1:\"1\";s:16:\"llx_propal.total\";s:1:\"1\";}', 'a:1:{s:20:\"llx_propal.fk_statut\";s:57:\"0:Brouillon,1:Ouverte,2:Signée,3:Non Signée,4:Facturée\";}', 'a:4:{s:14:\"llx_propal.tms\";s:8:\"function\";s:20:\"llx_propal.fk_statut\";s:5:\"value\";s:19:\"llx_propal.total_ht\";s:5:\"value\";s:16:\"llx_propal.total\";s:5:\"value\";}', 'a:1:{s:14:\"llx_propal.tms\";s:2:\">=\";}', 'a:1:{i:0;s:20:\"llx_propal.fk_statut\";}', 'a:2:{s:19:\"llx_propal.total_ht\";s:12:\"SUM(@field@)\";s:16:\"llx_propal.total\";s:8:\"COUNT(*)\";}', 'a:1:{s:14:\"llx_propal.tms\";s:23:\"NOW() - INTERVAL 1 YEAR\";}', 'a:1:{s:8:\"llx_user\";a:2:{i:0;s:14:\"llx_user.rowid\";i:1;s:25:\"llx_propal.fk_user_author\";}}', 0, 'Valeurs des propositions sur 1 an par statut', 'PIE', 'llx_propal.fk_statut'),\n(7, '2015-12-05 17:04:59', '2015-12-09 17:25:51', 'llx_propal.tms,llx_propal.fk_statut,llx_propal.total_ht,llx_propal.total', 'llx_propal LEFT JOIN llx_user ON (llx_user.rowid=llx_propal.fk_user_author) ', 'llx_propal.tms >= (NOW() - INTERVAL 1 YEAR)', '', 'a:4:{i:0;s:14:\"llx_propal.tms\";i:1;s:20:\"llx_propal.fk_statut\";i:2;s:19:\"llx_propal.total_ht\";i:3;s:16:\"llx_propal.total\";}', 'a:2:{i:0;s:10:\"llx_propal\";i:1;s:8:\"llx_user\";}', 's:0:\"\";', 'a:3:{s:20:\"llx_propal.fk_statut\";s:6:\"Statut\";s:19:\"llx_propal.total_ht\";s:8:\"Total HT\";s:16:\"llx_propal.total\";s:6:\"Nombre\";}', 'a:0:{}', 'a:2:{s:14:\"llx_propal.tms\";s:1:\"1\";s:19:\"llx_propal.total_ht\";s:1:\"1\";}', 'a:1:{s:20:\"llx_propal.fk_statut\";s:57:\"0:Brouillon,1:Ouverte,2:Signée,3:Non Signée,4:Facturée\";}', 'a:4:{s:14:\"llx_propal.tms\";s:8:\"function\";s:20:\"llx_propal.fk_statut\";s:5:\"value\";s:19:\"llx_propal.total_ht\";s:5:\"value\";s:16:\"llx_propal.total\";s:5:\"value\";}', 'a:1:{s:14:\"llx_propal.tms\";s:2:\">=\";}', 'a:1:{i:0;s:20:\"llx_propal.fk_statut\";}', 'a:2:{s:19:\"llx_propal.total_ht\";s:12:\"SUM(@field@)\";s:16:\"llx_propal.total\";s:8:\"COUNT(*)\";}', 'a:1:{s:14:\"llx_propal.tms\";s:23:\"NOW() - INTERVAL 1 YEAR\";}', 'a:1:{s:8:\"llx_user\";a:2:{i:0;s:14:\"llx_user.rowid\";i:1;s:25:\"llx_propal.fk_user_author\";}}', 0, 'Nombre de propositions sur 1 an par statut', 'PIE', 'llx_propal.fk_statut')");