27 include_once DOL_DOCUMENT_ROOT.
"/core/boxes/modules_boxes.php";
34 public $boxcode =
"validated_project";
35 public $boximg =
"object_projectpub";
46 public $info_box_head = array();
47 public $info_box_contents = array();
60 global $conf, $user, $langs;
63 $langs->loadLangs(array(
'boxes',
'projects'));
66 $this->boxlabel =
"ProjectsWithTask";
68 $this->hidden = !($user->rights->projet->lire);
70 if ($conf->global->MAIN_FEATURES_LEVEL < 2) $this->enabled = 0;
81 global $conf, $user, $langs;
89 $textHead = $langs->trans(
"ProjectTasksWithoutTimeSpent");
90 $this->info_box_head = array(
'text' => $textHead,
'limit'=>
dol_strlen($textHead));
93 if ($user->rights->projet->lire) {
94 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
101 $projectsListId =
'';
102 if (!$user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);
107 $sql =
"SELECT p.rowid, p.ref, p.fk_soc, p.dateo as startdate,";
108 $sql .=
" COUNT(DISTINCT t.rowid) as tasknumber";
109 $sql .=
" FROM ".MAIN_DB_PREFIX.
"projet AS p";
110 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"projet_task AS t ON p.rowid = t.fk_projet";
112 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"element_contact as ec ON ec.element_id = t.rowid AND fk_c_type_contact IN (-1, -2, -3)";
113 $sql .=
" WHERE p.fk_statut = 1";
114 if ($projectsListId) $sql .=
' AND p.rowid IN ('.$this->db->sanitize($projectsListId).
')';
115 $sql .=
" AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX.
"projet_task_time WHERE fk_user =".$user->id.
")";
116 $sql .=
" GROUP BY p.rowid, p.ref, p.fk_soc, p.dateo";
117 $sql .=
" ORDER BY p.dateo ASC";
119 $result = $this->
db->query($sql);
121 $num = $this->
db->num_rows($result);
123 $this->info_box_contents[$i][] = array(
124 'td' =>
'class="nowraponall"',
125 'text' =>
"Reference projet",
127 $this->info_box_contents[$i][] = array(
128 'td' =>
'class="center"',
131 $this->info_box_contents[$i][] = array(
132 'td' =>
'class="center"',
133 'text' =>
'Date debut de projet',
135 $this->info_box_contents[$i][] = array(
136 'td' =>
'class="center"',
137 'text' =>
'Nombre de mes tâches sans temps saisi',
141 while ($i < min($num + 1, $max + 1)) {
142 $objp = $this->
db->fetch_object($result);
144 $projectstatic->id = $objp->rowid;
145 $projectstatic->ref = $objp->ref;
147 $this->info_box_contents[$i][] = array(
148 'td' =>
'class="nowraponall"',
149 'text' => $projectstatic->getNomUrl(1),
153 if ($objp->fk_soc > 0) {
154 $sql =
'SELECT rowid, nom as name FROM '.MAIN_DB_PREFIX.
'societe WHERE rowid ='.$objp->fk_soc;
157 $obj2 = $this->
db->fetch_object(
$resql);
158 $this->info_box_contents[$i][] = array(
159 'td' =>
'class="tdoverflowmax150 maxwidth200onsmartphone"',
160 'text' => $obj2->name,
162 'url' => DOL_URL_ROOT.
'/societe/card.php?socid='.$obj2->rowid
166 $this->info_box_contents[$i][] = array(
167 'td' =>
'class="tdoverflowmax150 maxwidth200onsmartphone"',
174 $this->info_box_contents[$i][] = array(
175 'td' =>
'class="center"',
176 'text' => $objp->startDate,
179 $this->info_box_contents[$i][] = array(
180 'td' =>
'class="center"',
181 'text' => $objp->tasknumber.
" ".$langs->trans(
"Tasks"),
200 public function showBox($head = null, $contents = null, $nooutput = 0)
202 return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
loadBox($max=5)
Load data for box to show them later.
$conf db
API class for accounts.
showBox($head=null, $contents=null, $nooutput=0)
Method to show box.
Class to manage projects.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Class to manage the box to show last projet.
__construct($db, $param= '')
Constructor.