Tooltip everywhere

This commit is contained in:
frederic34
2015-01-25 01:20:58 +01:00
parent 76bf95789d
commit 736bee565c
56 changed files with 709 additions and 390 deletions

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Charles-Fr BENKE <charles.fr@benke.fr>
* Copyright (C) 2015 Frederic France <frederic.france@free.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
@@ -55,15 +56,20 @@ class box_actions extends ModeleBoxes
$this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$actionstatic=new ActionComm($db);
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$societestatic = new Societe($db);
$actionstatic = new ActionComm($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastActionsToDo",$max));
if ($user->rights->agenda->myactions->read) {
$sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,";
$sql.= " ta.code, ta.libelle as type_label,";
$sql.= " s.nom as name, s.rowid as socid";
$sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage";
$sql.= ", ta.code";
$sql.= ", ta.libelle as type_label";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_client";
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, ";
$sql.= MAIN_DB_PREFIX."actioncomm AS a)";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
@@ -81,62 +87,52 @@ class box_actions extends ModeleBoxes
$result = $db->query($sql);
if ($result) {
$now=dol_now();
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
$delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
$num = $db->num_rows($result);
$i = 0;
while ($i < $num) {
$late = '';
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->dp);
$datelimite = $db->jdate($objp->dp);
$actionstatic->label = $objp->label;
$actionstatic->type_label = $objp->type_label;
$actionstatic->code = $objp->code;
$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
$societestatic->code_client = $objp->code_client;
if ($objp->percentage >= 0 && $objp->percentage < 100 && $datelimite < ($now - $delay_warning)) $late=img_warning($langs->trans("Late"));
if ($objp->percentage >= 0 && $objp->percentage < 100 && $datelimite < ($now - $delay_warning))
$late=img_warning($langs->trans("Late"));
//($langs->transnoentities("Action".$objp->code)!=("Action".$objp->code) ? $langs->transnoentities("Action".$objp->code) : $objp->label)
$label=empty($objp->label)?$objp->type_label:$objp->label;
$label = empty($objp->label)?$objp->type_label:$objp->label;
$tooltip = $langs->trans('Action'.$objp->code).': '.$label;
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => ("action"),
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id,
);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => dol_trunc($label,32),
'text' => $actionstatic->getNomUrl(1),
'text2'=> $late,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id,
'asis' => 1,
);
$tooltip = $langs->trans('Customer').': '.$objp->name;
$this->info_box_contents[$i][2] = array(
'td' => 'align="left" width="16"',
'logo' => ($objp->socid?'company':''),
'tooltip' => $tooltip,
'url' => ($objp->socid?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid:''),
);
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => dol_trunc($objp->name,24),
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid,
'text' => $societestatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][4] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left" class="nowrap"',
'text' => dol_print_date($datelimite, "dayhour"),
);
$this->info_box_contents[$i][5] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => ($objp->percentage>= 0?$objp->percentage.'%':''),
);
$this->info_box_contents[$i][6] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"',
'text' => $actionstatic->LibStatut($objp->percentage,3),
);

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2012 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Frederic France <frederic.france@free.fr>
* Copyright (C) 2014-2015 Frederic France <frederic.france@free.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
@@ -75,7 +75,6 @@ class box_activity extends ModeleBoxes
$totalnb = 0;
$i = 0;
$cachetime = 3600;
$cachedir = DOL_DATA_ROOT.'/cache/boxes';
$fileid = '-e'.$conf->entity.'-u'.$user->id.'-s'.$user->societe_id.'-r'.($user->rights->societe->client->voir?'1':'0').'.cache';
$now = dol_now();
$nbofyears=2;
@@ -95,6 +94,7 @@ class box_activity extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($db);
$cachedir = DOL_DATA_ROOT.'/facture/temp';
$filename = '/boxactivity-invoice'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
@@ -177,6 +177,7 @@ class box_activity extends ModeleBoxes
);
}
$cachedir = DOL_DATA_ROOT.'/facture/temp';
$filename = '/boxactivity-invoice2'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
@@ -262,6 +263,7 @@ class box_activity extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic=new Commande($db);
$cachedir = DOL_DATA_ROOT.'/commande/temp';
$filename = '/boxactivity-order'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array();
@@ -344,6 +346,7 @@ class box_activity extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$propalstatic=new Propal($db);
$cachedir = DOL_DATA_ROOT.'/propale/temp';
$filename = '/boxactivity-propal'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array();
@@ -383,7 +386,7 @@ class box_activity extends ModeleBoxes
if (! empty($data)) {
$j=0;
while ($i < count($data)) {
$this->info_box_contents[$i][0] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=".$data[$j]->fk_statut,
'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
@@ -391,12 +394,12 @@ class box_activity extends ModeleBoxes
);
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
);
$this->info_box_contents[$i][2] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => $data[$j]->nb,
'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
@@ -404,12 +407,12 @@ class box_activity extends ModeleBoxes
);
$totalnb += $data[$j]->nb;
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
);
$totalMnt += $data[$j]->Mnttot;
$this->info_box_contents[$i][4] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"',
'text' => $propalstatic->LibStatut($data[$j]->fk_statut,3),
);

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Frederic France <frederic.france@free.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

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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
@@ -79,7 +80,13 @@ class box_clients extends ModeleBoxes
if ($user->rights->societe->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status";
$sql = "SELECT s.nom as name, s.rowid as socid";
$sql.= ", s.code_client";
$sql.= ", s.client";
$sql.= ", s.code_fournisseur";
$sql.= ", s.fournisseur";
$sql.= ", s.logo";
$sql.= ", s.datec, s.tms, s.status";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.client IN (1, 3)";
@@ -103,26 +110,26 @@ class box_clients extends ModeleBoxes
$objp = $db->fetch_object($result);
$datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms);
$thirdpartystatic->id = $objp->socid;
$thirdpartystatic->name = $objp->name;
$thirdpartystatic->code_client = $objp->code_client;
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
$thirdpartystatic->client = $objp->client;
$thirdpartystatic->fournisseur = $objp->fournisseur;
$thirdpartystatic->logo = $objp->logo;
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => $url.$objp->socid
);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->name,
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => $url.$objp->socid
'text' => $thirdpartystatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][2] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => dol_print_date($datem, "day")
);
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"',
'text' => $thirdpartystatic->LibStatut($objp->status,3)
);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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
@@ -53,20 +54,33 @@ class box_commandes extends ModeleBoxes
{
global $user, $langs, $db, $conf;
$this->max=$max;
$this->max = $max;
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic=new Commande($db);
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$commandestatic = new Commande($db);
$societestatic = new Societe($db);
$userstatic = new User($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerOrders",$max));
if ($user->rights->commande->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " c.ref, c.tms, c.rowid, c.date_commande,";
$sql.= " c.fk_statut, c.fk_user_valid, c.facture, c.total_ht";
$sql = "SELECT s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_client";
$sql.= ", s.logo";
$sql.= ", c.ref, c.tms";
$sql.= ", c.rowid";
$sql.= ", c.date_commande";
$sql.= ", c.ref_client";
$sql.= ", c.fk_statut";
$sql.= ", c.fk_user_valid";
$sql.= ", c.facture";
$sql.= ", c.total_ht";
$sql.= ", c.tva as total_tva";
$sql.= ", c.total_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -89,32 +103,27 @@ class box_commandes extends ModeleBoxes
$objp = $db->fetch_object($result);
$date=$db->jdate($objp->date_commande);
$datem=$db->jdate($objp->tms);
$commandestatic->id = $objp->rowid;
$commandestatic->ref = $objp->ref;
$commandestatic->ref_client = $objp->ref_client;
$commandestatic->total_ht = $objp->total_ht;
$commandestatic->total_tva = $objp->total_tva;
$commandestatic->total_ttc = $objp->total_ttc;
$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
$societestatic->code_client = $objp->code_client;
$societestatic->logo = $objp->logo;
$this->info_box_contents[$i][] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $langs->trans('Order').': '.$objp->ref,
'url' => DOL_URL_ROOT."/commande/card.php?id=".$objp->rowid,
'td' => 'align="left"',
'text' => $commandestatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->ref,
'tooltip' => $langs->trans('Order').': '.$objp->ref,
'url' => DOL_URL_ROOT."/commande/card.php?id=".$objp->rowid,
);
$this->info_box_contents[$i][] = array(
'td' => 'align="left" width="16"',
'logo' => 'company',
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->name,
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
'text' => $societestatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][] = array(
@@ -127,7 +136,7 @@ class box_commandes extends ModeleBoxes
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => (($objp->fk_user_valid > 0)?$userstatic->getNomUrl(1):''),
'url' => (($objp->fk_user_valid > 0)?DOL_URL_ROOT.'/user/card.php?id='.$objp->fk_user_valid:''),
'asis' => 1,
);
}

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Frederic France <frederic.france@free.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
@@ -102,31 +103,24 @@ class box_comptes extends ModeleBoxes
$objp = $db->fetch_object($result);
$account_static->id = $objp->rowid;
$account_static->label = $objp->label;
$account_static->number = $objp->number;
$solde=$account_static->solde(0);
$solde_total[$objp->currency_code] += $solde;
$tooltip = $langs->trans('Account').': '.$objp->label . '<br>' . $langs->trans('AccountNumber').': '.$objp->number;
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid,
);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->label,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid,
'text' => $account_static->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][2] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->number,
);
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => price($solde, 0, $langs, 0, -1, -1, $objp->currency_code)
);
@@ -136,21 +130,17 @@ class box_comptes extends ModeleBoxes
// Total
foreach ($solde_total as $key=>$solde) {
$this->info_box_contents[$i][0] = array(
$this->info_box_contents[$i][] = array(
'tr' => 'class="liste_total"',
'td' => 'align="right" class="liste_total"',
'text' => '&nbsp;',
);
$this->info_box_contents[$i][1] = array(
'td' => 'align="left" class="liste_total"',
'text' => $langs->trans('Total').' '.$key,
);
$this->info_box_contents[$i][2] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right" class="liste_total"',
'text' => '&nbsp;'
);
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right" class="liste_total"',
'text' => price($solde, 0, $langs, 0, -1, -1, $key)
);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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
@@ -92,35 +93,19 @@ class box_contacts extends ModeleBoxes
$societestatic->id=$objp->fk_soc;
$societestatic->name=$objp->socname;
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $langs->trans('Contact').': '.$contactstatic->getFullName($langs,0),
'url' => DOL_URL_ROOT."/contact/card.php?id=".$objp->rowid,
);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $contactstatic->getFullName($langs,0),
'tooltip' => $langs->trans('Contact').': '.$contactstatic->getFullName($langs,0),
'url' => DOL_URL_ROOT."/contact/card.php?id=".$objp->rowid,
'text' => $contactstatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][2] = array(
'td' => 'align="left" width="16"',
'logo' => ($objp->fk_soc > 0?'company':''),
'tooltip' => $societestatic->name,
'url' => ($objp->fk_soc > 0?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc:''),
);
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $societestatic->name,
'tooltip' => $societestatic->name,
'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc,
'text' => $societestatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][4] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => dol_print_date($datem, "day"),
);

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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
@@ -53,8 +54,11 @@ class box_factures extends ModeleBoxes
$this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($db);
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$facturestatic=new Facture($db);
$societestatic = new Societe($db);
$text = $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerBills",$max);
$this->info_box_head = array(
@@ -62,11 +66,16 @@ class box_factures extends ModeleBoxes
'limit'=> dol_strlen($text)
);
if ($user->rights->facture->lire)
{
$sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.total as total_ht, f.datef as df";
if ($user->rights->facture->lire) {
$sql = "SELECT f.rowid as facid";
$sql.= ", f.facnumber, f.type, f.total as total_ht";
$sql.= ", f.tva as total_tva";
$sql.= ", f.total_ttc";
$sql.= ", f.datef as df";
$sql.= ", f.paye, f.fk_statut, f.datec, f.tms";
$sql.= ", s.nom as name, s.rowid as socid";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_client";
$sql.= ", f.date_lim_reglement as datelimite";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -88,60 +97,48 @@ class box_factures extends ModeleBoxes
$i = 0;
$l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)';
while ($i < $num)
{
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->datelimite);
$date=$db->jdate($objp->df);
$datem=$db->jdate($objp->tms);
while ($i < $num) {
$objp = $db->fetch_object($result);
$datelimite = $db->jdate($objp->datelimite);
$date = $db->jdate($objp->df);
$datem = $db->jdate($objp->tms);
$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->facnumber;
$facturestatic->type = $objp->type;
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
$societestatic->code_client = $objp->code_client;
$picto='bill';
if ($objp->type == 1) $picto.='r';
if ($objp->type == 2) $picto.='a';
$late = '';
if ($objp->paye == 0 && ($objp->fk_statut != 2 && $objp->fk_statut != 3) && $datelimite < ($now - $conf->facture->client->warning_delay)) { $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));}
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => $picto,
'tooltip' => $langs->trans('CustomerInvoice').': '.$objp->facnumber,
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid,
);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->facnumber,
'text' => $facturestatic->getNomUrl(1),
'text2'=> $late,
'tooltip' => $langs->trans('CustomerInvoice').': '.$objp->facnumber,
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid,
'asis' => 1,
);
$this->info_box_contents[$i][2] = array(
'td' => 'align="left" width="16"',
'logo' => 'company',
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->name,
'maxlength'=>40,
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
'text' => $societestatic->getNomUrl(1, '', 40),
'asis' => 1,
);
$this->info_box_contents[$i][4] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => price($objp->total_ht),
);
$this->info_box_contents[$i][5] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => dol_print_date($date,'day'),
);
$this->info_box_contents[$i][6] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3),
);
@@ -173,11 +170,11 @@ class box_factures extends ModeleBoxes
}
/**
* Method to show box
* Method to show box
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @return void
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @return void
*/
function showBox($head = null, $contents = null)
{

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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
@@ -55,7 +56,10 @@ class box_factures_fourn extends ModeleBoxes
$this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$facturestatic=new FactureFournisseur($db);
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$facturestatic = new FactureFournisseur($db);
$societestatic = new Societe($db);
$this->info_box_head = array(
'text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."SupplierBills",$max)
@@ -64,7 +68,12 @@ class box_factures_fourn extends ModeleBoxes
if ($user->rights->fournisseur->facture->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.total_ht,";
$sql.= " s.code_fournisseur,";
$sql.= " s.logo,";
$sql.= " f.rowid as facid, f.ref, f.ref_supplier,";
$sql.= " f.total_ht,";
$sql.= " f.total_tva,";
$sql.= " f.total_ttc,";
$sql.= " f.paye, f.fk_statut,";
$sql.= ' f.datef as df,';
$sql.= ' f.datec as datec,';
@@ -94,47 +103,41 @@ class box_factures_fourn extends ModeleBoxes
$datelimite=$db->jdate($objp->datelimite);
$date=$db->jdate($objp->df);
$datem=$db->jdate($objp->tms);
$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->ref;
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
$societestatic->fournisseur = 1;
$societestatic->code_fournisseur = $objp->code_fournisseur;
$societestatic->logo = $objp->logo;
$late = '';
if ($objp->paye == 0 && $datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day')));
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'<br>'.$langs->trans('RefSupplier').': '.$objp->ref_supplier,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => ($objp->ref?$objp->ref:$objp->facid),
'text' => $facturestatic->getNomUrl(1),
'text2'=> $late,
'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'<br>'.$langs->trans('RefSupplier').': '.$objp->ref_supplier,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
'asis' => 1,
);
$this->info_box_contents[$i][2] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->ref_supplier,
'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'<br>'.$langs->trans('RefSupplier').': '.$objp->ref_supplier,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
);
$this->info_box_contents[$i][3] = array(
'td' => 'align="left" width="16"',
'logo' => 'company',
'tooltip' => $langs->trans('Supplier').': '.$objp->name,
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][4] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->name,
'tooltip' => $langs->trans('Supplier').': '.$objp->name,
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
'text' => $societestatic->getNomUrl(1, 'supplier'),
'asis' => 1,
);
$this->info_box_contents[$i][5] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => dol_print_date($date,'day'),
);

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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
@@ -57,15 +58,24 @@ class box_factures_imp extends ModeleBoxes
$this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($db);
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$facturestatic = new Facture($db);
$societestatic = new Societe($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills",$max));
if ($user->rights->facture->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " s.code_client,";
$sql.= " s.logo,";
$sql.= " f.facnumber, f.date_lim_reglement as datelimite,";
$sql.= " f.type,";
$sql.= " f.amount, f.datef as df,";
$sql.= " f.total as total_ht,";
$sql.= " f.tva as total_tva,";
$sql.= " f.total_ttc,";
$sql.= " f.paye, f.fk_statut, f.rowid as facid";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -92,34 +102,43 @@ class box_factures_imp extends ModeleBoxes
{
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->datelimite);
$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->facnumber;
$facturestatic->type = $objp->type;
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
$societestatic->client = 1;
$societestatic->code_client = $objp->code_client;
$societestatic->logo = $objp->logo;
$late='';
if ($datelimite < ($now - $conf->facture->client->warning_delay)) $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => $this->boximg,
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid);
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $facturestatic->getNomUrl(1),
'text2'=> $late,
'asis' => 1,
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->facnumber,
'text2'=> $late,
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid);
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $societestatic->getNomUrl(1, '', 44),
'asis' => 1,
);
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => dol_print_date($datelimite,'day'),
);
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->name,
'maxlength'=>44,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
'text' => dol_print_date($datelimite,'day'),
);
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3));
$this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3),
);
$i++;
}
@@ -130,14 +149,18 @@ class box_factures_imp extends ModeleBoxes
}
else
{
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql));
$this->info_box_contents[0][0] = array(
'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql),
);
}
}
else {
$this->info_box_contents[0][0] = array('td' => 'align="left"',
'text' => $langs->trans("ReadPermissionNotAllowed"));
$this->info_box_contents[0][0] = array(
'td' => 'align="left"',
'text' => $langs->trans("ReadPermissionNotAllowed"),
);
}
}

View File

@@ -1,20 +1,21 @@
<?php
/* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Frederic France <frederic.france@free.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
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* 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
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/boxes/box_ficheinter.php

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2004-2006 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2012 Maxime Kohlhaas <mko@atm-consulting.fr>
* Copyright (C) 2015 Frederic France <frederic.france@free.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

View File

@@ -1,6 +1,8 @@
<?php
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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

View File

@@ -3,6 +3,7 @@
/* Copyright (C) 2004-2006 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Frederic France <frederic.france@free.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

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2015 Frederic France <frederic.france@free.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
@@ -99,13 +100,13 @@ class box_task extends ModeleBoxes
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array(
'td' => 'align="left"',
'text' =>$langs->trans("Task")."&nbsp;".$taskstatic->LibStatut($objp->fk_statut,0)
'text' =>$langs->trans("Task")."&nbsp;".$taskstatic->LibStatut($objp->fk_statut,0),
);
$this->info_box_contents[$i][2] = array(
'td' => 'align="right"',
'text' => $objp->nb."&nbsp;".$langs->trans("Tasks"),
'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut
'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));

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Frederic France <frederic.france@free.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
@@ -183,13 +184,13 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
$MAXLENGTHBOX=60; // Mettre 0 pour pas de limite
$bcx=array();
$bcx = array();
$bcx[0] = 'class="box_pair"';
$bcx[1] = 'class="box_impair"';
$var = false;
$cachetime = 900; // 900 : 15mn
$cachedir = DOL_DATA_ROOT.'/cache/boxes';
$cachedir = DOL_DATA_ROOT.'/boxes/temp';
$fileid = get_class($this).'id-'.$this->box_id.'-e'.$conf->entity.'-u'.$user->id.'-s'.$user->societe_id.'.cache';
$filename = '/box-'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);