forked from Wavyzz/dolibarr
Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8
This commit is contained in:
@@ -592,7 +592,7 @@ if ($id > 0)
|
||||
if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) {
|
||||
print " ".img_warning();
|
||||
}
|
||||
print '</td><td align="right" width="80">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print '</td><td align="right" width="80px">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';
|
||||
print '<td align="right" style="min-width: 60px" class="nowrap">'.$propal_static->LibStatut($objp->fk_statut,5).'</td></tr>';
|
||||
$i++;
|
||||
@@ -673,7 +673,7 @@ if ($id > 0)
|
||||
$commande_static->total_tva = $objp->total_tva;
|
||||
$commande_static->total_ttc = $objp->total_ttc;
|
||||
print $commande_static->getNomUrl(1);
|
||||
print '</td><td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n";
|
||||
print '</td><td align="right" width="80px">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n";
|
||||
print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';
|
||||
print '<td align="right" style="min-width: 60px" class="nowrap">'.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'</td></tr>';
|
||||
$i++;
|
||||
@@ -737,7 +737,7 @@ if ($id > 0)
|
||||
print $sendingstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
if ($objp->date_creation > 0) {
|
||||
print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->date_creation),'day').'</td>';
|
||||
print '<td align="right" width="80px">'.dol_print_date($db->jdate($objp->date_creation),'day').'</td>';
|
||||
} else {
|
||||
print '<td align="right"><b>!!!</b></td>';
|
||||
}
|
||||
@@ -797,8 +797,8 @@ if ($id > 0)
|
||||
print $contrat->getNomUrl(1,12);
|
||||
print "</td>\n";
|
||||
print '<td class="nowrap">'.dol_trunc($objp->refsup,12)."</td>\n";
|
||||
print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n";
|
||||
print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->dcon),'day')."</td>\n";
|
||||
print '<td align="right" width="80px">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n";
|
||||
print '<td align="right" width="80px">'.dol_print_date($db->jdate($objp->dcon),'day')."</td>\n";
|
||||
print '<td width="20"> </td>';
|
||||
print '<td align="right" class="nowrap">';
|
||||
$contrat->fetch_lines();
|
||||
@@ -855,9 +855,9 @@ if ($id > 0)
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/fichinter/card.php?id='.$objp->id.'">'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.'</a></td>'."\n";
|
||||
//print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->startdate)).'</td>'."\n";
|
||||
print '<td align="right" width="120">'.convertSecondToTime($objp->duration).'</td>'."\n";
|
||||
print '<td align="right" width="100">'.$fichinter_static->getLibStatut(5).'</td>'."\n";
|
||||
//print '<td align="right" width="80px">'.dol_print_date($db->jdate($objp->startdate)).'</td>'."\n";
|
||||
print '<td align="right" style="min-width: 60px">'.convertSecondToTime($objp->duration).'</td>'."\n";
|
||||
print '<td align="right" class="nowrap" style="min-width: 60px">'.$fichinter_static->getLibStatut(5).'</td>'."\n";
|
||||
print '</tr>';
|
||||
$var=!$var;
|
||||
$i++;
|
||||
@@ -907,7 +907,7 @@ if ($id > 0)
|
||||
|
||||
$tableaushown=1;
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomersBills",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'">'.$langs->trans("AllBills").' <span class="badge">'.$num.'</span></a></td>';
|
||||
print '<td colspan="5"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomersBills",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'">'.$langs->trans("AllBills").' <span class="badge">'.$num.'</span></a></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
@@ -929,15 +929,24 @@ if ($id > 0)
|
||||
print '</td>';
|
||||
if ($objp->df > 0)
|
||||
{
|
||||
print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->df),'day').'</td>';
|
||||
print '<td align="right" width="80px">'.dol_print_date($db->jdate($objp->df),'day').'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="right"><b>!!!</b></td>';
|
||||
}
|
||||
print '<td align="right" width="120">'.price($objp->total_ht).'</td>';
|
||||
print '<td align="right" style="min-width: 60px">';
|
||||
print price($objp->total_ht);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right" class="nowrap" width="100" >'.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am)).'</td>';
|
||||
if (! empty($conf->global->MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES))
|
||||
{
|
||||
print '<td align="right" style="min-width: 60px">';
|
||||
print price($objp->total_ttc);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '<td align="right" class="nowrap" style="min-width: 60px">'.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am)).'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@@ -44,8 +45,10 @@ $langs->load('companies');
|
||||
|
||||
$orderyear=GETPOST("orderyear","int");
|
||||
$ordermonth=GETPOST("ordermonth","int");
|
||||
$orderday=GETPOST("orderday","int");
|
||||
$deliveryyear=GETPOST("deliveryyear","int");
|
||||
$deliverymonth=GETPOST("deliverymonth","int");
|
||||
$deliveryday=GETPOST("deliveryday","int");
|
||||
$search_product_category=GETPOST('search_product_category','int');
|
||||
$search_ref=GETPOST('search_ref','alpha')!=''?GETPOST('search_ref','alpha'):GETPOST('sref','alpha');
|
||||
$search_ref_customer=GETPOST('search_ref_customer','alpha');
|
||||
@@ -87,7 +90,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$search_total_ht='';
|
||||
$orderyear='';
|
||||
$ordermonth='';
|
||||
$deliverymonth='';
|
||||
$orderday='';
|
||||
$deliveryday='';
|
||||
$deliverymonth='';
|
||||
$deliveryyear='';
|
||||
}
|
||||
|
||||
@@ -168,10 +173,10 @@ if ($viewstatut <> '')
|
||||
}
|
||||
if ($ordermonth > 0)
|
||||
{
|
||||
if ($orderyear > 0 && empty($day))
|
||||
if ($orderyear > 0 && empty($orderday))
|
||||
$sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($orderyear,$ordermonth,false))."' AND '".$db->idate(dol_get_last_day($orderyear,$ordermonth,false))."'";
|
||||
else if ($orderyear > 0 && ! empty($day))
|
||||
$sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $ordermonth, $day, $orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $ordermonth, $day, $orderyear))."'";
|
||||
else if ($orderyear > 0 && ! empty($orderday))
|
||||
$sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $ordermonth, $orderday, $orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $ordermonth, $orderday, $orderyear))."'";
|
||||
else
|
||||
$sql.= " AND date_format(c.date_commande, '%m') = '".$ordermonth."'";
|
||||
}
|
||||
@@ -181,10 +186,10 @@ else if ($orderyear > 0)
|
||||
}
|
||||
if ($deliverymonth > 0)
|
||||
{
|
||||
if ($deliveryyear > 0 && empty($day))
|
||||
if ($deliveryyear > 0 && empty($deliveryday))
|
||||
$sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($deliveryyear,$deliverymonth,false))."' AND '".$db->idate(dol_get_last_day($deliveryyear,$deliverymonth,false))."'";
|
||||
else if ($deliveryyear > 0 && ! empty($day))
|
||||
$sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $deliverymonth, $day, $deliveryyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $deliverymonth, $day, $deliveryyear))."'";
|
||||
else if ($deliveryyear > 0 && ! empty($deliveryday))
|
||||
$sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $deliverymonth, $deliveryday, $deliveryyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $deliverymonth, $deliveryday, $deliveryyear))."'";
|
||||
else
|
||||
$sql.= " AND date_format(c.date_livraison, '%m') = '".$deliverymonth."'";
|
||||
}
|
||||
@@ -240,8 +245,10 @@ if ($resql)
|
||||
$title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill');
|
||||
|
||||
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
|
||||
if ($orderday) $param.='&orderday='.$orderday;
|
||||
if ($ordermonth) $param.='&ordermonth='.$ordermonth;
|
||||
if ($orderyear) $param.='&orderyear='.$orderyear;
|
||||
if ($deliveryday) $param.='&deliveryday='.$deliveryday;
|
||||
if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth;
|
||||
if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear;
|
||||
if ($search_ref) $param.='&search_ref='.$search_ref;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2015-2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@@ -119,7 +119,6 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_categ='';
|
||||
$search_user='';
|
||||
$search_sale='';
|
||||
$search_product_category='';
|
||||
@@ -132,6 +131,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$day='';
|
||||
$year='';
|
||||
$month='';
|
||||
$day_lim='';
|
||||
$year_lim='';
|
||||
$month_lim='';
|
||||
}
|
||||
|
||||
|
||||
@@ -261,13 +263,18 @@ if ($resql)
|
||||
}
|
||||
|
||||
$param='&socid='.$socid;
|
||||
if ($day) $param.='&day='.$day;
|
||||
if ($month) $param.='&month='.$month;
|
||||
if ($year) $param.='&year=' .$year;
|
||||
if ($day_lim) $param.='&day_lim='.$day_lim;
|
||||
if ($month_lim) $param.='&month_lim='.$month_lim;
|
||||
if ($year_lim) $param.='&year_lim=' .$year_lim;
|
||||
if ($search_ref) $param.='&search_ref=' .$search_ref;
|
||||
if ($search_refcustomer) $param.='&search_refcustomer=' .$search_refcustomer;
|
||||
if ($search_societe) $param.='&search_societe=' .$search_societe;
|
||||
if ($search_sale > 0) $param.='&search_sale=' .$search_sale;
|
||||
if ($search_user > 0) $param.='&search_user=' .$search_user;
|
||||
if ($search_product_category > 0) $param.='$search_product_category=' .$search_product_category;
|
||||
if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht;
|
||||
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc;
|
||||
if ($search_status != '') $param.='&search_status='.$search_status;
|
||||
|
||||
@@ -591,7 +591,7 @@ function listOfSessions()
|
||||
//$sessValues = 'newtoken|s:32:"1239f7a0c4b899200fe9ca5ea394f307";dol_loginmesg|s:0:"";newtoken|s:32:"1236457104f7ae0f328c2928973f3cb5";dol_loginmesg|s:0:"";token|s:32:"123615ad8d650c5cc4199b9a1a76783f";dol_login|s:5:"admin";dol_authmode|s:8:"dolibarr";dol_tz|s:1:"1";dol_tz_string|s:13:"Europe/Berlin";dol_dst|i:0;dol_dst_observed|s:1:"1";dol_dst_first|s:0:"";dol_dst_second|s:0:"";dol_screenwidth|s:4:"1920";dol_screenheight|s:3:"971";dol_company|s:12:"MyBigCompany";dol_entity|i:1;mainmenu|s:4:"home";leftmenuopened|s:10:"admintools";idmenu|s:0:"";leftmenu|s:10:"admintools";';
|
||||
|
||||
if (preg_match('/dol_login/i',$sessValues) && // limit to dolibarr session
|
||||
(preg_match('/dol_entity\|i:'.$conf->entity.';/i',$sessValues) || preg_match('/dol_entity\|s:([0-9]+):"'.$conf->entity.'"/i',$sessValues)) && // limit to current entity
|
||||
(preg_match('/dol_entity\|i:'.$conf->entity.';/i',$sessValues) || preg_match('/dol_entity\|s:([0-9]+):"'.$conf->entity.'"/i',$sessValues)) && // limit to current entity
|
||||
preg_match('/dol_company\|s:([0-9]+):"('.$conf->global->MAIN_INFO_SOCIETE_NOM.')"/i',$sessValues)) // limit to company name
|
||||
{
|
||||
$tmp=explode('_', $file);
|
||||
@@ -982,21 +982,29 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql
|
||||
//var_dump($objMod->dictionaries['tabname']);
|
||||
$taborder[] = 0;
|
||||
$tabfieldcheck[] = array(); $tabhelp[] = array();
|
||||
$nbtabname=$nbtablib=$nbtabsql=$nbtabsqlsort=$nbtabfield=$nbtabfieldvalue=$nbtabfieldinsert=$nbtabrowid=$nbtabcond=$nbtabfieldcheck=$nbtabhelp=0;
|
||||
foreach($objMod->dictionaries['tabname'] as $val)
|
||||
{
|
||||
$taborder[] = count($tabname)+1;
|
||||
$nbtabname++;
|
||||
$tabname[] = $val;
|
||||
}
|
||||
foreach($objMod->dictionaries['tablib'] as $val) $tablib[] = $val;
|
||||
foreach($objMod->dictionaries['tabsql'] as $val) $tabsql[] = $val;
|
||||
foreach($objMod->dictionaries['tabsqlsort'] as $val) $tabsqlsort[] = $val;
|
||||
foreach($objMod->dictionaries['tabfield'] as $val) $tabfield[] = $val;
|
||||
foreach($objMod->dictionaries['tabfieldvalue'] as $val) $tabfieldvalue[] = $val;
|
||||
foreach($objMod->dictionaries['tabfieldinsert'] as $val) $tabfieldinsert[] = $val;
|
||||
foreach($objMod->dictionaries['tabrowid'] as $val) $tabrowid[] = $val;
|
||||
foreach($objMod->dictionaries['tabcond'] as $val) $tabcond[] = $val;
|
||||
if (! empty($objMod->dictionaries['tabfieldcheck'])) foreach($objMod->dictionaries['tabfieldcheck'] as $val) $tabfieldcheck[] = $val;
|
||||
if (! empty($objMod->dictionaries['tabhelp'])) foreach($objMod->dictionaries['tabhelp'] as $val) $tabhelp[] = $val;
|
||||
foreach($objMod->dictionaries['tablib'] as $val) { $nbtablib++; $tablib[] = $val; }
|
||||
foreach($objMod->dictionaries['tabsql'] as $val) { $nbtabsql++; $tabsql[] = $val; }
|
||||
foreach($objMod->dictionaries['tabsqlsort'] as $val) { $nbtabsqlsort++; $tabsqlsort[] = $val; }
|
||||
foreach($objMod->dictionaries['tabfield'] as $val) { $nbtabfield++; $tabfield[] = $val; }
|
||||
foreach($objMod->dictionaries['tabfieldvalue'] as $val) { $nbtabfieldvalue++; $tabfieldvalue[] = $val; }
|
||||
foreach($objMod->dictionaries['tabfieldinsert'] as $val) { $nbtabfieldinsert++; $tabfieldinsert[] = $val; }
|
||||
foreach($objMod->dictionaries['tabrowid'] as $val) { $nbtabrowid++; $tabrowid[] = $val; }
|
||||
foreach($objMod->dictionaries['tabcond'] as $val) { $nbtabcond++; $tabcond[] = $val; }
|
||||
if (! empty($objMod->dictionaries['tabfieldcheck'])) foreach($objMod->dictionaries['tabfieldcheck'] as $val) { $nbtabfieldcheck++; $tabfieldcheck[] = $val; }
|
||||
if (! empty($objMod->dictionaries['tabhelp'])) foreach($objMod->dictionaries['tabhelp'] as $val) { $nbtabhelp++; $tabhelp[] = $val; }
|
||||
|
||||
if ($nbtabname != $nbtablib || $nbtablib != $nbtabsql || $nbtabsql != $nbtabsqlsort)
|
||||
{
|
||||
print 'Error in descriptor of module '.$const_name.'. Array ->dictionaries has not same number of record for key "tabname", "tablib", "tabsql" and "tabsqlsort"';
|
||||
//print "$const_name: $nbtabname=$nbtablib=$nbtabsql=$nbtabsqlsort=$nbtabfield=$nbtabfieldvalue=$nbtabfieldinsert=$nbtabrowid=$nbtabcond=$nbtabfieldcheck=$nbtabhelp\n";
|
||||
}
|
||||
//foreach($objMod->dictionaries['tabsqlsort'] as $val) $tablib[] = $val;
|
||||
//$tabname = array_merge ($tabname, $objMod->dictionaries['tabname']);
|
||||
//var_dump($tabcond);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Abbes Bahfir <bafbes@gmail.com>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2015-2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@@ -93,6 +93,10 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$search_status="";
|
||||
$year="";
|
||||
$month="";
|
||||
$day="";
|
||||
$year_lim="";
|
||||
$month_lim="";
|
||||
$day_lim="";
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -230,8 +234,12 @@ if ($resql)
|
||||
}
|
||||
|
||||
$param='&socid='.$socid;
|
||||
if ($day) $param.='&day='.urlencode($day);
|
||||
if ($month) $param.='&month='.urlencode($month);
|
||||
if ($year) $param.='&year=' .urlencode($year);
|
||||
if ($day_lim) $param.='&day_lim='.urlencode($day_lim);
|
||||
if ($month_lim) $param.='&month_lim='.urlencode($month_lim);
|
||||
if ($year_lim) $param.='&year_lim=' .urlencode($year_lim);
|
||||
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
|
||||
if ($search_ref_supplier) $param.='&search_ref_supplier'.urlencode($search_ref_supplier);
|
||||
if ($search_label) $param.='&search_label='.urlencode($search_label);
|
||||
|
||||
@@ -46,9 +46,14 @@ $langs->load("projects");
|
||||
*/
|
||||
|
||||
$now = dol_now();
|
||||
$tmp=dol_getdate($now);
|
||||
$day=$tmp['mday'];
|
||||
$month=$tmp['mon'];
|
||||
$year=$tmp['year'];
|
||||
|
||||
$projectstatic=new Project($db);
|
||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); // Return all projects I have permission on because I want my tasks and some of my task may be on a public projet that is not my project
|
||||
$taskstatic=new Task($db);
|
||||
$tasktmp=new Task($db);
|
||||
|
||||
$title=$langs->trans("Activities");
|
||||
@@ -125,7 +130,7 @@ if ( $resql )
|
||||
$projectstatic->title=$row->title;
|
||||
print $projectstatic->getNomUrl(1, '', 1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb, 'allhourmin').'</td>';
|
||||
print "</tr>\n";
|
||||
$total += $row->nb;
|
||||
}
|
||||
@@ -138,7 +143,7 @@ else
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans('Total').'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($total).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($total, 'allhourmin').'</td>';
|
||||
print "</tr>\n";
|
||||
print "</table>";
|
||||
|
||||
@@ -181,7 +186,7 @@ if ($db->type != 'pgsql')
|
||||
$projectstatic->title=$row->title;
|
||||
print $projectstatic->getNomUrl(1, '', 1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb, 'allhourmin').'</td>';
|
||||
print "</tr>\n";
|
||||
$total += $row->nb;
|
||||
}
|
||||
@@ -194,71 +199,74 @@ if ($db->type != 'pgsql')
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans('Total').'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($total).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($total, 'allhourmin').'</td>';
|
||||
print "</tr>\n";
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
|
||||
// TODO Do not use week function to be compatible with all database
|
||||
/*
|
||||
if ($db->type != 'pgsql')
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
// Affichage de la liste des projets de la semaine
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("ActivityOnProjectThisWeek").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Time").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, SUM(tt.task_duration) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."projet_task as t";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
||||
$sql.= " WHERE t.fk_projet = p.rowid";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
$sql.= " AND tt.fk_task = t.rowid";
|
||||
$sql.= " AND tt.fk_user = ".$user->id;
|
||||
$sql.= " AND task_date >= '".$db->idate(dol_get_first_day($year, $month)).'" AND ...";
|
||||
$sql.= " AND p.rowid in (".$projectsListId.")";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.title";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
$total = 0;
|
||||
$var=true;
|
||||
|
||||
while ($row = $db->fetch_object($resql))
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td>';
|
||||
$projectstatic->id=$row->rowid;
|
||||
$projectstatic->ref=$row->ref;
|
||||
$projectstatic->title=$row->title;
|
||||
print $projectstatic->getNomUrl(1, '', 1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb, 'allhourmin').'</td>';
|
||||
print "</tr>\n";
|
||||
$total += $row->nb;
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans('Total').'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($total, 'allhourmin').'</td>';
|
||||
print "</tr>\n";
|
||||
print "</table><br>";
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
print '<br>';
|
||||
|
||||
/* Affichage de la liste des projets de la semaine */
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("ActivityOnProjectThisWeek").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Time").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, SUM(tt.task_duration) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."projet_task as t";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
||||
$sql.= " WHERE t.fk_projet = p.rowid";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
$sql.= " AND tt.fk_task = t.rowid";
|
||||
$sql.= " AND tt.fk_user = ".$user->id;
|
||||
$sql.= " AND week(task_date) = '".strftime("%W",time())."'";
|
||||
$sql.= " AND p.rowid in (".$projectsListId.")";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.title";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
$total = 0;
|
||||
$var=true;
|
||||
|
||||
while ($row = $db->fetch_object($resql))
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td>';
|
||||
$projectstatic->id=$row->rowid;
|
||||
$projectstatic->ref=$row->ref;
|
||||
$projectstatic->title=$row->title;
|
||||
print $projectstatic->getNomUrl(1, '', 1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb).'</td>';
|
||||
print "</tr>\n";
|
||||
$total += $row->nb;
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans('Total').'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($total).'</td>';
|
||||
print "</tr>\n";
|
||||
print "</table><br>";
|
||||
|
||||
}
|
||||
|
||||
/* Affichage de la liste des projets du mois */
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@@ -274,13 +282,15 @@ $sql.= " WHERE t.fk_projet = p.rowid";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
$sql.= " AND tt.fk_task = t.rowid";
|
||||
$sql.= " AND tt.fk_user = ".$user->id;
|
||||
$sql.= " AND date_format(task_date,'%y-%m') = '".strftime("%y-%m",$now)."'";
|
||||
$sql.= " AND task_date BETWEEN '".$db->idate(dol_get_first_day($year, $month))."' AND '".$db->idate(dol_get_last_day($year, $month))."'";
|
||||
$sql.= " AND p.rowid in (".$projectsListId.")";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.title";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
$total = 0;
|
||||
|
||||
$var=false;
|
||||
|
||||
while ($row = $db->fetch_object($resql))
|
||||
@@ -292,9 +302,10 @@ if ( $resql )
|
||||
$projectstatic->title=$row->title;
|
||||
print $projectstatic->getNomUrl(1, '', 1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb, 'allhourmin').'</td>';
|
||||
print "</tr>\n";
|
||||
$var=!$var;
|
||||
$total += $row->nb;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
@@ -304,7 +315,7 @@ else
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans('Total').'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($total).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($total, 'allhourmin').'</td>';
|
||||
print "</tr>\n";
|
||||
print "</table>";
|
||||
|
||||
@@ -342,7 +353,7 @@ if (! empty($conf->global->PROJECT_TASK_TIME_YEAR))
|
||||
$projectstatic->title=$row->title;
|
||||
print $projectstatic->getNomUrl(1, '', 1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb, 'allhourmin').'</td>';
|
||||
print "</tr>\n";
|
||||
$var=!$var;
|
||||
}
|
||||
@@ -354,7 +365,7 @@ if (! empty($conf->global->PROJECT_TASK_TIME_YEAR))
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans('Total').'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($total).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($total, 'allhourmin').'</td>';
|
||||
print "</tr>\n";
|
||||
print "</table>";
|
||||
}
|
||||
@@ -364,8 +375,40 @@ if (! empty($conf->global->PROJECT_TASK_TIME_YEAR))
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS) && empty($conf->global->PROJECT_HIDE_LIST_HOME_AREA))
|
||||
{
|
||||
// Get id of types of contacts for projects (This list never contains a lot of elements)
|
||||
$listofprojectcontacttype=array();
|
||||
$sql = "SELECT ctc.rowid, ctc.code FROM ".MAIN_DB_PREFIX."c_type_contact as ctc";
|
||||
$sql.= " WHERE ctc.element = '" . $projectstatic->element . "'";
|
||||
$sql.= " AND ctc.source = 'internal'";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while($obj = $db->fetch_object($resql))
|
||||
{
|
||||
$listofprojectcontacttype[$obj->rowid]=$obj->code;
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0]='0'; // To avoid sql syntax error if not found
|
||||
// Get id of types of contacts for tasks (This list never contains a lot of elements)
|
||||
$listoftaskcontacttype=array();
|
||||
$sql = "SELECT ctc.rowid, ctc.code FROM ".MAIN_DB_PREFIX."c_type_contact as ctc";
|
||||
$sql.= " WHERE ctc.element = '" . $taskstatic->element . "'";
|
||||
$sql.= " AND ctc.source = 'internal'";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while($obj = $db->fetch_object($resql))
|
||||
{
|
||||
$listoftaskcontacttype[$obj->rowid]=$obj->code;
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
if (count($listoftaskcontacttype) == 0) $listoftaskcontacttype[0]='0'; // To avoid sql syntax error if not found
|
||||
|
||||
|
||||
// Tasks for all resources of all opened projects and time spent for each task/resource
|
||||
|
||||
$max = (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA);
|
||||
@@ -376,8 +419,16 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_time as tasktime on tasktime.fk_task = t.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on tasktime.fk_user = u.rowid";
|
||||
if ($mine)
|
||||
{
|
||||
$sql.= ", " . MAIN_DB_PREFIX . "element_contact as ect";
|
||||
}
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
||||
if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")"; // project i have permission on
|
||||
if ($mine) // this may duplicate record if we are contact twice
|
||||
{
|
||||
$sql.= " AND ect.fk_c_type_contact IN (".join(',',array_keys($listoftaskcontacttype)).") AND ect.element_id = t.rowid AND ect.fk_socpeople = ".$user->id;
|
||||
}
|
||||
if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
|
||||
$sql.= " AND p.fk_statut=1";
|
||||
$sql.= " GROUP BY p.ref, p.title, p.rowid, t.label, t.rowid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee";
|
||||
@@ -451,13 +502,13 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dateo),'day').'</td>';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->datee),'day').'</td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$obj->taskid.'&withproject=1">';
|
||||
print convertSecondToTime($obj->planned_workload, 'all');
|
||||
print convertSecondToTime($obj->planned_workload, 'allhourmin');
|
||||
print '</a></td>';
|
||||
print '<td align="right">';
|
||||
print ($obj->taskid>0)?$obj->progress.'%':'';
|
||||
print '</td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$obj->taskid.'&withproject=1">';
|
||||
print convertSecondToTime($obj->timespent, 'all');
|
||||
print convertSecondToTime($obj->timespent, 'allhourmin');
|
||||
print '</a></td>';
|
||||
print '<td align="right">';
|
||||
if (! empty($obj->taskid))
|
||||
|
||||
@@ -763,7 +763,7 @@ else
|
||||
* Creation
|
||||
*/
|
||||
$private=GETPOST("private","int");
|
||||
if (! empty($conf->global->MAIN_THIRPARTY_CREATION_INDIVIDUAL) && ! isset($_GET['private']) && ! isset($_POST['private'])) $private=1;
|
||||
if (! empty($conf->global->MAIN_THIRDPARTY_CREATION_INDIVIDUAL) && ! isset($_GET['private']) && ! isset($_POST['private'])) $private=1;
|
||||
if (empty($private)) $private=0;
|
||||
|
||||
// Load object modCodeTiers
|
||||
|
||||
Reference in New Issue
Block a user