mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-13 03:12:35 +01:00
WIP PSR2
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
@@ -15,10 +16,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/boxes/box_task.php
|
||||
* \ingroup Projet
|
||||
* \brief Module to Task activity of the current year
|
||||
* \version $Id: box_task.php,v 1.1 2012/09/11 Charles-François BENKE
|
||||
* \file htdocs/core/boxes/box_task.php
|
||||
* \ingroup Projet
|
||||
* \brief Module to Task activity of the current year
|
||||
* \version $Id: box_task.php,v 1.1 2012/09/11 Charles-François BENKE
|
||||
*/
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php");
|
||||
@@ -29,32 +30,36 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
|
||||
*/
|
||||
class box_task extends ModeleBoxes
|
||||
{
|
||||
var $boxcode="projet";
|
||||
var $boximg="object_projecttask";
|
||||
var $boxlabel;
|
||||
//var $depends = array("projet");
|
||||
var $db;
|
||||
var $param;
|
||||
var $boxcode="projet";
|
||||
var $boximg="object_projecttask";
|
||||
var $boxlabel;
|
||||
//var $depends = array("projet");
|
||||
var $db;
|
||||
var $param;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function box_task()
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("boxes");
|
||||
$langs->load("projects");
|
||||
$this->boxlabel="Tasks";
|
||||
}
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db,$param='')
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("boxes");
|
||||
$langs->load("projects");
|
||||
$this->boxlabel="Tasks";
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load data for box to show them later
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@@ -73,8 +78,7 @@ class box_task extends ModeleBoxes
|
||||
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
|
||||
|
||||
// list the summary of the orders
|
||||
if ($user->rights->projet->lire)
|
||||
{
|
||||
if ($user->rights->projet->lire) {
|
||||
|
||||
$sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt";
|
||||
@@ -86,23 +90,23 @@ class box_task extends ModeleBoxes
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_projecttask');
|
||||
while ($i < $num) {
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_projecttask');
|
||||
|
||||
$objp = $db->fetch_object($result);
|
||||
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
|
||||
'text' =>$langs->trans("Task")." ".$taskstatic->LibStatut($objp->fk_statut,0)
|
||||
);
|
||||
$objp = $db->fetch_object($result);
|
||||
$this->info_box_contents[$i][1] = array(
|
||||
'td' => 'align="left"',
|
||||
'text' =>$langs->trans("Task")." ".$taskstatic->LibStatut($objp->fk_statut,0)
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
|
||||
'text' => $objp->nb." ".$langs->trans("Tasks"),
|
||||
'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut
|
||||
);
|
||||
$this->info_box_contents[$i][2] = array(
|
||||
'td' => 'align="right"',
|
||||
'text' => $objp->nb." ".$langs->trans("Tasks"),
|
||||
'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut
|
||||
);
|
||||
$totalnb += $objp->nb;
|
||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5));
|
||||
$totalplannedtot += $objp->plannedtot;
|
||||
|
||||
Reference in New Issue
Block a user