Merge branch 'develop' into new_export_stock_valo

This commit is contained in:
Laurent Destailleur 2017-11-24 16:40:36 +01:00 committed by GitHub
commit d7f5f14f46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
63 changed files with 1189 additions and 764 deletions

View File

@ -56,9 +56,18 @@ $now = dol_now();
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
$hookmanager->initHooks(array('purchasesjournal'));
$parameters=array();
/* /*
* Actions * Actions
*/ */
$reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks
/*
* Views
*/
// Get informations of journal // Get informations of journal
$accountingjournalstatic = new AccountingJournal($db); $accountingjournalstatic = new AccountingJournal($db);

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -165,12 +165,13 @@ if ($conf->use_javascript_ajax)
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
print '<tr '.$bc[0].'><td align="center" colspan="2">'; print '<tr><td align="center" colspan="2">';
$SommeA=0; $SommeA=0;
$SommeB=0; $SommeB=0;
$SommeC=0; $SommeC=0;
$SommeD=0; $SommeD=0;
$total=0;
$dataval=array(); $dataval=array();
$datalabels=array(); $datalabels=array();
$i=0; $i=0;
@ -187,14 +188,23 @@ if ($conf->use_javascript_ajax)
$SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0; $SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
$i++; $i++;
} }
$total = $SommeA + $SommeB + $SommeC + $SommeD;
$dataseries=array(); $dataseries=array();
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'data'=>round($SommeB)); $dataseries[]=array($langs->trans("MenuMembersNotUpToDate"), round($SommeB));
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'data'=>round($SommeC)); $dataseries[]=array($langs->trans("MenuMembersUpToDate"), round($SommeC));
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'data'=>round($SommeD)); $dataseries[]=array($langs->trans("MembersStatusResiliated"), round($SommeD));
$dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'data'=>round($SommeA)); $dataseries[]=array($langs->trans("MembersStatusToValid"), round($SommeA));
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',1); include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total?0:1);
print '</td></tr>'; print '</td></tr>';
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">'; print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">';
print $SommeA+$SommeB+$SommeC+$SommeD; print $SommeA+$SommeB+$SommeC+$SommeD;

View File

@ -236,7 +236,10 @@ if ($action == 'builddoc')
{ {
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DescADHERENT_ETIQUETTE_TYPE")); $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DescADHERENT_ETIQUETTE_TYPE"));
} }
if (! $mesg) $result=doc_label_pdf_create($db, $arrayofrecords, $modellabel, $outputlangs, $diroutput, $template, 'tmp_barcode_sheet.pdf');
$outfile = $langs->trans("BarCode").'_sheets_'.dol_print_date(dol_now(),'dayhourlog').'.pdf';
if (! $mesg) $result=doc_label_pdf_create($db, $arrayofrecords, $modellabel, $outputlangs, $diroutput, $template, dol_sanitizeFileName($outfile));
} }
if ($result <= 0) if ($result <= 0)
@ -292,9 +295,9 @@ foreach(array_keys($_Avery_Labels) as $codecards)
$labeltoshow=$_Avery_Labels[$codecards]['name']; $labeltoshow=$_Avery_Labels[$codecards]['name'];
//$labeltoshow.=' ('.$_Avery_Labels[$row['code']]['paper-size'].')'; //$labeltoshow.=' ('.$_Avery_Labels[$row['code']]['paper-size'].')';
$arrayoflabels[$codecards]=$labeltoshow; $arrayoflabels[$codecards]=$labeltoshow;
$arrayoflabels[$codecards]=$_Avery_Labels[$codecards]['name'];
} }
print $form->selectarray('modellabel',$arrayoflabels,(GETPOST('modellabel')?GETPOST('modellabel'):$conf->global->ADHERENT_ETIQUETTE_TYPE),1,0,0); asort($arrayoflabels);
print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel')?GETPOST('modellabel'):$conf->global->ADHERENT_ETIQUETTE_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1);
print '</div></div>'; print '</div></div>';
// Number of stickers to print // Number of stickers to print

View File

@ -76,7 +76,7 @@ class AgendaEvents extends DolibarrApi
throw new RestException(401, "Insuffisant rights to read event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); throw new RestException(401, "Insuffisant rights to read event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
} }
if ( ! DolibarrApi::_checkAccessToResource('agenda',$this->actioncomm->id)) { if ( ! DolibarrApi::_checkAccessToResource('agenda',$this->actioncomm->id,'actioncomm','','fk_soc','id')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -61,7 +61,6 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
{ {
$var=false;
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">'; print '<table class="noborder nohover" width="100%">';
@ -115,11 +114,10 @@ if ($resql)
print '<table class="noborder nohover" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'</td></tr>'."\n"; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'</td></tr>'."\n";
$var=true;
$listofstatus=array(0,1,2,3,4); $listofstatus=array(0,1,2,3,4);
foreach ($listofstatus as $status) foreach ($listofstatus as $status)
{ {
$dataseries[]=array('label'=>$propalstatic->LibStatut($status,1),'data'=>(isset($vals[$status])?(int) $vals[$status]:0)); $dataseries[]=array($propalstatic->LibStatut($status,1), (isset($vals[$status])?(int) $vals[$status]:0));
if (! $conf->use_javascript_ajax) if (! $conf->use_javascript_ajax)
{ {
@ -131,9 +129,18 @@ if ($resql)
} }
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print '<tr class="impair"><td align="center" colspan="2">'; print '<tr><td align="center" colspan="2">';
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',1); include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->draw('idgraphthirdparties');
print $dolgraph->show($total?0:1);
print '</td></tr>'; print '</td></tr>';
} }
//if ($totalinprocess != $total) //if ($totalinprocess != $total)
@ -173,10 +180,8 @@ if (! empty($conf->propal->enabled))
if ($num) if ($num)
{ {
$i = 0; $i = 0;
$var = True;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -233,10 +238,8 @@ if ($resql)
if ($num) if ($num)
{ {
$i = 0; $i = 0;
$var = True;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -308,8 +311,6 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
$i = 0; $i = 0;
if ($num > 0) if ($num > 0)
{ {
$var=true;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></td></tr>'; print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></td></tr>';
@ -402,7 +403,6 @@ if (! empty($conf->propal->enabled))
if ($num) if ($num)
{ {
$i = 0; $i = 0;
$var = True;
while ($i < $num) while ($i < $num)
{ {
@ -474,7 +474,6 @@ if (! empty($conf->propal->enabled))
if ($num) if ($num)
{ {
$i = 0; $i = 0;
$var = True;
while ($i < $num) while ($i < $num)
{ {

View File

@ -768,7 +768,7 @@ class Commande extends CommonOrder
$sql.= ", multicurrency_code"; $sql.= ", multicurrency_code";
$sql.= ", multicurrency_tx"; $sql.= ", multicurrency_tx";
$sql.= ")"; $sql.= ")";
$sql.= " VALUES ('(PROV)',".$this->socid.", '".$this->db->idate($now)."', ".$user->id; $sql.= " VALUES ('(PROV)', ".$this->socid.", '".$this->db->idate($now)."', ".$user->id;
$sql.= ", ".($this->fk_project>0?$this->fk_project:"null"); $sql.= ", ".($this->fk_project>0?$this->fk_project:"null");
$sql.= ", '".$this->db->idate($date)."'"; $sql.= ", '".$this->db->idate($date)."'";
$sql.= ", ".($this->source>=0 && $this->source != '' ?$this->db->escape($this->source):'null'); $sql.= ", ".($this->source>=0 && $this->source != '' ?$this->db->escape($this->source):'null');

View File

@ -79,7 +79,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
* Statistics * Statistics
*/ */
$sql = "SELECT count(c.rowid), c.fk_statut, c.facture"; $sql = "SELECT count(c.rowid), c.fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."commande as c"; $sql.= ", ".MAIN_DB_PREFIX."commande as c";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -87,7 +87,8 @@ $sql.= " WHERE c.fk_soc = s.rowid";
$sql.= " AND c.entity IN (".getEntity('societe').")"; $sql.= " AND c.entity IN (".getEntity('societe').")";
if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id; if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id;
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " GROUP BY c.fk_statut, c.facture"; $sql.= " GROUP BY c.fk_statut";
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
@ -98,7 +99,6 @@ if ($resql)
$totalinprocess=0; $totalinprocess=0;
$dataseries=array(); $dataseries=array();
$vals=array(); $vals=array();
$bool=false;
// -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not) // -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not)
while ($i < $num) while ($i < $num)
{ {
@ -107,8 +107,7 @@ if ($resql)
{ {
//if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1)) //if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1))
{ {
$bool=(! empty($row[2])?true:false); if (! isset($vals[$row[1]])) $vals[$row[1]]=0;
if (! isset($vals[$row[1].$bool])) $vals[$row[1].$bool]=0;
$vals[$row[1].$bool]+=$row[0]; $vals[$row[1].$bool]+=$row[0];
$totalinprocess+=$row[0]; $totalinprocess+=$row[0];
} }
@ -119,37 +118,38 @@ if ($resql)
$db->free($resql); $db->free($resql);
print '<table class="noborder nohover" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'</th></tr>'."\n"; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'</th></tr>'."\n";
$listofstatus=array(0,1,2,3,3,-1); $listofstatus=array(0,1,2,3,-1);
$bool=false;
foreach ($listofstatus as $status) foreach ($listofstatus as $status)
{ {
$dataseries[]=array('label'=>$commandestatic->LibStatut($status,$bool,1),'data'=>(isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0)); $dataseries[]=array($commandestatic->LibStatut($status,$bool,1), (isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0));
if ($status==3 && ! $bool) $bool=true;
else $bool=false;
} }
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print '<tr class="impair"><td align="center" colspan="2">'; print '<tr class="impair"><td align="center" colspan="2">';
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',1); include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total?0:1);
print '</td></tr>'; print '</td></tr>';
} }
$var=true; else
$bool=false;
foreach ($listofstatus as $status)
{ {
if (! $conf->use_javascript_ajax) foreach ($listofstatus as $status)
{ {
print '<tr class="oddeven">';
print '<tr class="oddeven">';
print '<td>'.$commandestatic->LibStatut($status,$bool,0).'</td>'; print '<td>'.$commandestatic->LibStatut($status,$bool,0).'</td>';
print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' '; print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';
print $commandestatic->LibStatut($status,$bool,3); print $commandestatic->LibStatut($status,$bool,3);
print '</a>'; print '</a>';
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
if ($status==3 && ! $bool) $bool=true;
else $bool=false;
} }
} }
//if ($totalinprocess != $total) //if ($totalinprocess != $total)

View File

@ -41,10 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
$langs->load("banks"); $langs->loadLangs(array("banks","categories","companies","bills","trips"));
$langs->load("categories");
$langs->load("companies");
$langs->load("bills");
$action=GETPOST('action', 'alpha'); $action=GETPOST('action', 'alpha');
$id=GETPOST('account','int'); $id=GETPOST('account','int');
@ -705,7 +702,7 @@ else
$newline=0; $newline=0;
} }
elseif ($links[$key]['type']=='user') { elseif ($links[$key]['type']=='user') {
print '<a href="'.DOL_URL_ROOT.'/user/card.php?rowid='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowUser'),'user').' '; print img_object($langs->trans('ShowUser'),'user').' ';
print $links[$key]['label']; print $links[$key]['label'];
print '</a>'; print '</a>';

View File

@ -106,14 +106,23 @@ print "</tr>\n";
$listoftype=$tripandexpense_static->listOfTypes(); $listoftype=$tripandexpense_static->listOfTypes();
foreach ($listoftype as $code => $label) foreach ($listoftype as $code => $label)
{ {
$dataseries[]=array('label'=>$label,'data'=>(isset($nb[$code])?(int) $nb[$code]:0)); $dataseries[]=array($label, (isset($nb[$code])?(int) $nb[$code]:0));
} }
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print '<tr '.$bc[false].'><td align="center" colspan="4">'; print '<tr><td align="center" colspan="4">';
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',1); include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($totalnb?0:1);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -3791,7 +3791,7 @@ else if ($id > 0 || ! empty($ref))
// List of payments already done // List of payments already done
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder paymenttable" width="100%">'; print '<table class="noborder paymenttable" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -4002,6 +4002,7 @@ else if ($id > 0 || ! empty($ref))
} }
print '</table>'; print '</table>';
print '</div>';
// Margin Infos // Margin Infos
if (! empty($conf->margin->enabled)) { if (! empty($conf->margin->enabled)) {

View File

@ -591,7 +591,9 @@ if ($object->id > 0)
/* /*
* Withdrawals * Withdrawals
*/ */
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -664,7 +666,6 @@ if ($object->id > 0)
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td align="left">'.dol_print_date($db->jdate($obj->date_demande),'day')."</td>\n"; print '<td align="left">'.dol_print_date($db->jdate($obj->date_demande),'day')."</td>\n";
@ -689,7 +690,8 @@ if ($object->id > 0)
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }
if (! $num)
print '<tr class="oddeven"><td colspan="7" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
$db->free($result); $db->free($result);
} }
else else
@ -698,6 +700,7 @@ if ($object->id > 0)
} }
print "</table>"; print "</table>";
print '</div>';
} }

View File

@ -184,7 +184,7 @@ print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' -
$listofstatus=array(0,4,4,5); $bool=false; $listofstatus=array(0,4,4,5); $bool=false;
foreach($listofstatus as $status) foreach($listofstatus as $status)
{ {
$dataseries[]=array('label'=>$staticcontratligne->LibStatut($status,1,($bool?1:0)),'data'=>(isset($nb[$status.$bool])?(int) $nb[$status.$bool]:0)); $dataseries[]=array($staticcontratligne->LibStatut($status,1,($bool?1:0)),(isset($nb[$status.$bool])?(int) $nb[$status.$bool]:0));
if (empty($conf->use_javascript_ajax)) if (empty($conf->use_javascript_ajax))
{ {
@ -199,8 +199,17 @@ foreach($listofstatus as $status)
if (! empty($conf->use_javascript_ajax)) if (! empty($conf->use_javascript_ajax))
{ {
print '<tr class="impair"><td align="center" colspan="2">'; print '<tr class="impair"><td align="center" colspan="2">';
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',1); include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total?0:1);
print '</td></tr>'; print '</td></tr>';
} }
$listofstatus=array(0,4,4,5); $bool=false; $listofstatus=array(0,4,4,5); $bool=false;

View File

@ -125,7 +125,7 @@ $arrayfields=array(
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0), 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0), 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
'sale_representative'=>array('label'=>$langs->trans("SalesRepresentative"), 'checked'=>1), 'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1),
'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1), 'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1),
'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
@ -740,10 +740,16 @@ if ($resql)
$userstatic->id=$val['id']; $userstatic->id=$val['id'];
$userstatic->lastname=$val['lastname']; $userstatic->lastname=$val['lastname'];
$userstatic->firstname=$val['firstname']; $userstatic->firstname=$val['firstname'];
print '<div class="float">'.$userstatic->getNomUrl(1); $userstatic->email=$val['email'];
$userstatic->statut=$val['statut'];
$userstatic->entity=$val['entity'];
$userstatic->photo=$val['photo'];
//print '<div class="float">':
print $userstatic->getNomUrl(-2);
$j++; $j++;
if ($j < $nbofsalesrepresentative) print ', '; if ($j < $nbofsalesrepresentative) print ' ';
print '</div>'; //print '</div>';
} }
} }
//else print $langs->trans("NoSalesRepresentativeAffected"); //else print $langs->trans("NoSalesRepresentativeAffected");

View File

@ -6147,8 +6147,9 @@ abstract class CommonObject
// Clean and check mandatory // Clean and check mandatory
foreach($keys as $key) foreach($keys as $key)
{ {
if (preg_match('/^integer:/i', $this->fields[$key]['type']) && $values[$key] == '-1') $values[$key]=''; // This is an implicit foreign key field // If field is an implicit foreign key field
if (! empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key]=''; // This is an explicit foreign key field if (preg_match('/^integer:/i', $this->fields[$key]['type']) && $values[$key] == '-1') $values[$key]='';
if (! empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key]='';
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1)); //var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
if ($this->fields[$key]['notnull'] == 1 && empty($values[$key])) if ($this->fields[$key]['notnull'] == 1 && empty($values[$key]))
@ -6156,6 +6157,10 @@ abstract class CommonObject
$error++; $error++;
$this->errors[]=$langs->trans("ErrorFieldRequired", $this->fields[$key]['label']); $this->errors[]=$langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
} }
// If field is an implicit foreign key field
if (preg_match('/^integer:/i', $this->fields[$key]['type']) && empty($values[$key])) $values[$key]='null';
if (! empty($this->fields[$key]['foreignkey']) && empty($values[$key])) $values[$key]='null';
} }
if ($error) return -1; if ($error) return -1;

View File

@ -27,7 +27,7 @@
* Class to build graphs. * Class to build graphs.
* Usage is: * Usage is:
* $dolgraph=new DolGraph(); * $dolgraph=new DolGraph();
* $dolgraph->SetTitle($langs->transnoentities('Tracking_Projects_Pourcent').'<br>'.$langs->transnoentities('Tracking_IndicatorDefGraph').'%'); * $dolgraph->SetTitle($langs->transnoentities('MyTitle').'<br>'.$langs->transnoentities('MyTitlePercent').'%');
* $dolgraph->SetMaxValue(50); * $dolgraph->SetMaxValue(50);
* $dolgraph->SetData($data); * $dolgraph->SetData($data);
* $dolgraph->setShowLegend(1); * $dolgraph->setShowLegend(1);
@ -35,7 +35,7 @@
* $dolgraph->SetType(array('pie')); * $dolgraph->SetType(array('pie'));
* $dolgraph->setWidth('100%'); * $dolgraph->setWidth('100%');
* $dolgraph->draw('idofgraph'); * $dolgraph->draw('idofgraph');
* print $dolgraph->show(); * print $dolgraph->show($total?0:1);
*/ */
class DolGraph class DolGraph
{ {
@ -796,7 +796,7 @@ class DolGraph
* Build a graph using JFlot library. Input when calling this method should be: * Build a graph using JFlot library. Input when calling this method should be:
* $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB)); * $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB));
* $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // or when there is n series to show for each x * $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // or when there is n series to show for each x
* $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); // TODO Syntax not supported. Removed when dol_print_graph_removed * $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); // Syntax deprecated
* $this->legend= array("Val1",...,"Valn"); // list of n series name * $this->legend= array("Val1",...,"Valn"); // list of n series name
* $this->type = array('bars',...'lines'); or array('pie') * $this->type = array('bars',...'lines'); or array('pie')
* $this->mode = 'depth' ??? * $this->mode = 'depth' ???
@ -1041,10 +1041,20 @@ class DolGraph
/** /**
* Output HTML string to show graph * Output HTML string to show graph
* *
* @return string HTML string to show graph * @param int $shownographyet Show graph to say there is not enough data
* @return string HTML string to show graph
*/ */
function show() function show($shownographyet=0)
{ {
global $langs;
if ($shownographyet)
{
$s= '<div class="nographyet" style="width:'.(preg_match('/%/',$this->width)?$this->width:$this->width.'px').'; height:'.(preg_match('/%/',$this->height)?$this->height:$this->height.'px').';"></div>';
$s.='<div class="nographyettext">'.$langs->trans("NotEnoughDataYet").'</div>';
return $s;
}
return $this->stringtoshow; return $this->stringtoshow;
} }

View File

@ -1096,11 +1096,10 @@ class Form
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
if ($conf->use_javascript_ajax && ! $forcecombo) if (! $forcecombo)
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement =ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); $out .= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
$out.= $comboenhancement;
} }
// Construct $out and $outarray // Construct $out and $outarray
@ -1333,8 +1332,7 @@ class Form
if ($conf->use_javascript_ajax && ! $forcecombo && ! $options_only) if ($conf->use_javascript_ajax && ! $forcecombo && ! $options_only)
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox($htmlid, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT); $out .= ajax_combobox($htmlid, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
$out.= $comboenhancement;
} }
if ($htmlname != 'none' || $options_only) $out.= '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlid.'" name="'.$htmlname.'" '.(!empty($moreparam) ? $moreparam : '').'>'; if ($htmlname != 'none' || $options_only) $out.= '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlid.'" name="'.$htmlname.'" '.(!empty($moreparam) ? $moreparam : '').'>';
@ -1530,12 +1528,8 @@ class Form
if ($num) if ($num)
{ {
// Enhance with select2 // Enhance with select2
if ($conf->use_javascript_ajax) include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
{ $out .= ajax_combobox($htmlname);
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox($htmlname);
$out.=$comboenhancement;
}
// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
$out.= '<select class="flat'.($morecss?' minwidth100 '.$morecss:' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled':'').'>'; $out.= '<select class="flat'.($morecss?' minwidth100 '.$morecss:' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled':'').'>';
@ -1957,7 +1951,7 @@ class Form
} }
if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) { if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
$sql .= " LEFT JOIN llx_product_attribute_combination pac ON pac.fk_product_child = p.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
} }
$sql.= ' WHERE p.entity IN ('.getEntity('product').')'; $sql.= ' WHERE p.entity IN ('.getEntity('product').')';
@ -2023,11 +2017,10 @@ class Form
$events=null; $events=null;
if ($conf->use_javascript_ajax && ! $forcecombo) if (! $forcecombo)
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement =ajax_combobox($htmlname, $events, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); $out .= ajax_combobox($htmlname, $events, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
$out.= $comboenhancement;
} }
$out.='<select class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" id="'.$htmlname.'">'; $out.='<select class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" id="'.$htmlname.'">';
@ -5284,11 +5277,10 @@ class Form
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
if ($conf->use_javascript_ajax && ! $forcecombo) if (! $forcecombo)
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement =ajax_combobox($htmlname, null, $conf->global->$confkeyforautocompletemode); $out .= ajax_combobox($htmlname, null, $conf->global->$confkeyforautocompletemode);
$out.= $comboenhancement;
} }
// Construct $out and $outarray // Construct $out and $outarray
@ -5391,18 +5383,14 @@ class Form
$out=''; $out='';
// Add code for jquery to use multiselect // Add code for jquery to use multiselect
if ($addjscombo && empty($conf->dol_use_jmobile) && $jsbeautify) if ($addjscombo && $jsbeautify)
{ {
$minLengthToAutocomplete=0; $minLengthToAutocomplete=0;
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?(constant('REQUIRE_JQUERY_MULTISELECT')?constant('REQUIRE_JQUERY_MULTISELECT'):'select2'):$conf->global->MAIN_USE_JQUERY_MULTISELECT; $tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?(constant('REQUIRE_JQUERY_MULTISELECT')?constant('REQUIRE_JQUERY_MULTISELECT'):'select2'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
// Enhance with select2 // Enhance with select2
if ($conf->use_javascript_ajax) include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
{ $out .= ajax_combobox($htmlname);
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox($htmlname);
$out.=$comboenhancement;
}
} }
$out.='<select id="'.preg_replace('/^\./','',$htmlname).'" '.($disabled?'disabled ':'').'class="flat '.(preg_replace('/^\./','',$htmlname)).($morecss?' '.$morecss:'').'"'; $out.='<select id="'.preg_replace('/^\./','',$htmlname).'" '.($disabled?'disabled ':'').'class="flat '.(preg_replace('/^\./','',$htmlname)).($morecss?' '.$morecss:'').'"';
@ -6549,12 +6537,8 @@ class Form
if ($resql) if ($resql)
{ {
// Enhance with select2 // Enhance with select2
if ($conf->use_javascript_ajax) include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
{ $out .= ajax_combobox($htmlname);
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox($htmlname);
$out.= $comboenhancement;
}
$out.= '<select class="flat minwidth200" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled':'').'>'; $out.= '<select class="flat minwidth200" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled':'').'>';

View File

@ -148,6 +148,7 @@ class FormBarCode
$i++; $i++;
} }
print "</select>"; print "</select>";
print ajax_combobox("select_".$htmlname);
} }
else { else {
dol_print_error($this->db); dol_print_error($this->db);

View File

@ -1067,22 +1067,25 @@ if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && ! defined('DISABLE_JQUE
?> ?>
// Defined properties for JNotify // Defined properties for JNotify
$(document).ready(function() { $(document).ready(function() {
$.jnotify.setup({ if (typeof $.jnotify == 'function')
delay: 3000 // the default time to show each notification (in milliseconds) {
, sticky: false // determines if the message should be considered "sticky" (user must manually close notification) $.jnotify.setup({
, closeLabel: "&times;" // the HTML to use for the "Close" link delay: 3000 // the default time to show each notification (in milliseconds)
, showClose: true // determines if the "Close" link should be shown if notification is also sticky , sticky: false // determines if the message should be considered "sticky" (user must manually close notification)
, fadeSpeed: 1000 // the speed to fade messages out (in milliseconds) , closeLabel: "&times;" // the HTML to use for the "Close" link
, slideSpeed: 250 // the speed used to slide messages out (in milliseconds) , showClose: true // determines if the "Close" link should be shown if notification is also sticky
, classContainer: "jnotify-container" , fadeSpeed: 1000 // the speed to fade messages out (in milliseconds)
, classNotification: "jnotify-notification" , slideSpeed: 250 // the speed used to slide messages out (in milliseconds)
, classBackground: "jnotify-background" , classContainer: "jnotify-container"
, classClose: "jnotify-close" , classNotification: "jnotify-notification"
, classMessage: "jnotify-message" , classBackground: "jnotify-background"
, init: null // callback that occurs when the main jnotify container is created , classClose: "jnotify-close"
, create: null // callback that occurs when when the note is created (occurs just before appearing in DOM) , classMessage: "jnotify-message"
, beforeRemove: null // callback that occurs when before the notification starts to fade away , init: null // callback that occurs when the main jnotify container is created
}); , create: null // callback that occurs when when the note is created (occurs just before appearing in DOM)
, beforeRemove: null // callback that occurs when before the notification starts to fade away
});
}
}); });
<?php } ?> <?php } ?>

View File

@ -1119,7 +1119,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
if (count($keys)) $maxkey=max($keys); if (count($keys)) $maxkey=max($keys);
} }
//$conf->global->MAIN_MAXTABS_IN_CARD=3; if (! empty($conf->dol_optimize_smallscreen)) $conf->global->MAIN_MAXTABS_IN_CARD=2;
// Show tabs // Show tabs
$bactive=false; $bactive=false;
@ -1132,9 +1132,8 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
{ {
if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2])) if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2]))
{ {
// si l'active est présent dans la box // If active tab is already present
if ($i >= $limittoshow) if ($i >= $limittoshow) $limittoshow--;
$limittoshow--;
} }
} }
@ -1146,7 +1145,9 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
$bactive=true; $bactive=true;
} }
else else
{
$isactive=false; $isactive=false;
}
if ($i < $limittoshow || $isactive) if ($i < $limittoshow || $isactive)
{ {
@ -1155,11 +1156,11 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
{ {
if (!empty($links[$i][0])) if (!empty($links[$i][0]))
{ {
$out.='<a data-role="button" class="tabimage" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; $out.='<a class="tabimage" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
} }
else else
{ {
$out.='<span data-role="button" class="tabspan">'.$links[$i][1].'</span>'."\n"; $out.='<span class="tabspan">'.$links[$i][1].'</span>'."\n";
} }
} }
else if (! empty($links[$i][1])) else if (! empty($links[$i][1]))
@ -1167,11 +1168,15 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
//print "x $i $active ".$links[$i][2]." z"; //print "x $i $active ".$links[$i][2]." z";
if ($isactive) if ($isactive)
{ {
$out.='<a data-role="button"'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="tabactive tab inline-block" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; $out.='<a'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="tabactive tab inline-block" href="'.$links[$i][0].'">';
$out.=$links[$i][1];
$out.='</a>'."\n";
} }
else else
{ {
$out.='<a data-role="button"'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="tabunactive tab inline-block" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; $out.='<a'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="tabunactive tab inline-block" href="'.$links[$i][0].'">';
$out.=$links[$i][1];
$out.='</a>'."\n";
} }
} }
$out.='</div>'; $out.='</div>';
@ -1182,9 +1187,9 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
if (! $popuptab) if (! $popuptab)
{ {
$popuptab=1; $popuptab=1;
$outmore.='<div class="popuptabset">'; $outmore.='<div class="popuptabset wordwrap">'; // The css used to hide/show popup
} }
$outmore.='<div class="popuptab" style="display:inherit;">'; $outmore.='<div class="popuptab wordwrap" style="display:inherit;">';
if (isset($links[$i][2]) && $links[$i][2] == 'image') if (isset($links[$i][2]) && $links[$i][2] == 'image')
{ {
if (!empty($links[$i][0])) if (!empty($links[$i][0]))
@ -1194,8 +1199,11 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
} }
else if (! empty($links[$i][1])) else if (! empty($links[$i][1]))
$outmore.='<a'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="inline-block" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; {
$outmore.='<a'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="wordwrap inline-block" href="'.$links[$i][0].'">';
$outmore.=preg_replace('/([a-z])\/([a-z])/i', '\\1 / \\2', $links[$i][1]); // Replace x/y with x / y to allow wrap on long composed texts.
$outmore.='</a>'."\n";
}
$outmore.='</div>'; $outmore.='</div>';
$nbintab++; $nbintab++;
@ -1206,15 +1214,21 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
if ($displaytab > $limittoshow) if ($displaytab > $limittoshow)
{ {
$left=($langs->trans("DIRECTION") == 'rtl'?'right':'left');
$right=($langs->trans("DIRECTION") == 'rtl'?'left':'right');
$tabsname=str_replace("@", "", $picto); $tabsname=str_replace("@", "", $picto);
$out.='<div id="moretabs'.$tabsname.'" class="inline-block tabsElem">'; $out.='<div id="moretabs'.$tabsname.'" class="inline-block tabsElem">';
$out.='<a href="#" data-role="button" class="tab moretab inline-block tabunactive">'.$langs->trans("More").'... ('.$nbintab.')</a>'; $out.='<a href="#" class="tab moretab inline-block tabunactive">'.$langs->trans("More").'... ('.$nbintab.')</a>';
$out.='<div id="moretabsList'.$tabsname.'" style="position: absolute; left: -999em;text-align: left;margin:0px;padding:2px">'.$outmore.'</div>'; $out.='<div id="moretabsList'.$tabsname.'" style="position: absolute; '.$left.': -999em; text-align: '.$left.'; margin:0px; padding:2px">';
$out.=$outmore;
$out.='</div>';
$out.='<div></div>';
$out.="</div>\n"; $out.="</div>\n";
$out.="<script>"; $out.="<script>";
$out.="$('#moretabs".$tabsname."').mouseenter( function() { $('#moretabsList".$tabsname."').css('left','auto');});"; $out.="$('#moretabs".$tabsname."').mouseenter( function() { console.log('mouseenter ".$left."'); $('#moretabsList".$tabsname."').css('".$left."','auto');});";
$out.="$('#moretabs".$tabsname."').mouseleave( function() { $('#moretabsList".$tabsname."').css('left','-999em');});"; $out.="$('#moretabs".$tabsname."').mouseleave( function() { console.log('mouseleave ".$left."'); $('#moretabsList".$tabsname."').css('".$left."','-999em');});";
$out.="</script>"; $out.="</script>";
} }

View File

@ -128,14 +128,14 @@ class modFacture extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 11; $this->rights[$r][0] = 11;
$this->rights[$r][1] = 'Lire les factures'; $this->rights[$r][1] = 'Read invoices';
$this->rights[$r][2] = 'a'; $this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'lire'; $this->rights[$r][4] = 'lire';
$r++; $r++;
$this->rights[$r][0] = 12; $this->rights[$r][0] = 12;
$this->rights[$r][1] = 'Créer/modifier les factures'; $this->rights[$r][1] = 'Create and update invoices';
$this->rights[$r][2] = 'a'; $this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'creer'; $this->rights[$r][4] = 'creer';
@ -143,7 +143,7 @@ class modFacture extends DolibarrModules
// There is a particular permission for unvalidate because this may be not forbidden by some laws // There is a particular permission for unvalidate because this may be not forbidden by some laws
$r++; $r++;
$this->rights[$r][0] = 13; $this->rights[$r][0] = 13;
$this->rights[$r][1] = 'Dévalider les factures'; $this->rights[$r][1] = 'Devalidate invoices';
$this->rights[$r][2] = 'a'; $this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'invoice_advance'; $this->rights[$r][4] = 'invoice_advance';
@ -151,7 +151,7 @@ class modFacture extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 14; $this->rights[$r][0] = 14;
$this->rights[$r][1] = 'Valider les factures'; $this->rights[$r][1] = 'Validate invoices';
$this->rights[$r][2] = 'a'; $this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'invoice_advance'; $this->rights[$r][4] = 'invoice_advance';
@ -159,7 +159,7 @@ class modFacture extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 15; $this->rights[$r][0] = 15;
$this->rights[$r][1] = 'Envoyer les factures par email'; $this->rights[$r][1] = 'Send invoices by email';
$this->rights[$r][2] = 'a'; $this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'invoice_advance'; $this->rights[$r][4] = 'invoice_advance';
@ -167,21 +167,21 @@ class modFacture extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 16; $this->rights[$r][0] = 16;
$this->rights[$r][1] = 'Émettre des paiements sur les factures'; $this->rights[$r][1] = 'Issue payments on invoices';
$this->rights[$r][2] = 'a'; $this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'paiement'; $this->rights[$r][4] = 'paiement';
$r++; $r++;
$this->rights[$r][0] = 19; $this->rights[$r][0] = 19;
$this->rights[$r][1] = 'Supprimer les factures'; $this->rights[$r][1] = 'Delete invoices';
$this->rights[$r][2] = 'a'; $this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'supprimer'; $this->rights[$r][4] = 'supprimer';
$r++; $r++;
$this->rights[$r][0] = 1321; $this->rights[$r][0] = 1321;
$this->rights[$r][1] = 'Exporter les factures clients, attributs et règlements'; $this->rights[$r][1] = 'Export customer invoices, attributes and payments';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'facture'; $this->rights[$r][4] = 'facture';
@ -189,7 +189,7 @@ class modFacture extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 1322; $this->rights[$r][0] = 1322;
$this->rights[$r][1] = 'Rouvrir une facture totalement réglée'; $this->rights[$r][1] = 'Re-open a fully paid invoice';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'invoice_advance'; $this->rights[$r][4] = 'invoice_advance';

View File

@ -77,14 +77,14 @@ class modPropale extends DolibarrModules
$this->const[$r][0] = "PROPALE_ADDON_PDF"; $this->const[$r][0] = "PROPALE_ADDON_PDF";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "azur"; $this->const[$r][2] = "azur";
$this->const[$r][3] = 'Nom du gestionnaire de génération des propales en PDF'; $this->const[$r][3] = 'Name of the proposal generation manager in PDF format';
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
$this->const[$r][0] = "PROPALE_ADDON"; $this->const[$r][0] = "PROPALE_ADDON";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_propale_marbre"; $this->const[$r][2] = "mod_propale_marbre";
$this->const[$r][3] = 'Nom du gestionnaire de numérotation des propales'; $this->const[$r][3] = 'Name of proposal numbering manager';
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
@ -121,21 +121,21 @@ class modPropale extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 21; // id de la permission $this->rights[$r][0] = 21; // id de la permission
$this->rights[$r][1] = 'Lire les propositions commerciales'; // libelle de la permission $this->rights[$r][1] = 'Read commercial proposals'; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'lire'; $this->rights[$r][4] = 'lire';
$r++; $r++;
$this->rights[$r][0] = 22; // id de la permission $this->rights[$r][0] = 22; // id de la permission
$this->rights[$r][1] = 'Créer/modifier les propositions commerciales'; // libelle de la permission $this->rights[$r][1] = 'Create and update commercial proposals'; // libelle de la permission
$this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'creer'; $this->rights[$r][4] = 'creer';
$r++; $r++;
$this->rights[$r][0] = 24; // id de la permission $this->rights[$r][0] = 24; // id de la permission
$this->rights[$r][1] = 'Valider les propositions commerciales'; // libelle de la permission $this->rights[$r][1] = 'Validate commercial proposals'; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'propal_advance'; $this->rights[$r][4] = 'propal_advance';
@ -143,7 +143,7 @@ class modPropale extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 25; // id de la permission $this->rights[$r][0] = 25; // id de la permission
$this->rights[$r][1] = 'Envoyer les propositions commerciales aux clients'; // libelle de la permission $this->rights[$r][1] = 'Send commercial proposals to customers'; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'propal_advance'; $this->rights[$r][4] = 'propal_advance';
@ -151,21 +151,21 @@ class modPropale extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 26; // id de la permission $this->rights[$r][0] = 26; // id de la permission
$this->rights[$r][1] = 'Clôturer les propositions commerciales'; // libelle de la permission $this->rights[$r][1] = 'Close commercial proposals'; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'cloturer'; $this->rights[$r][4] = 'cloturer';
$r++; $r++;
$this->rights[$r][0] = 27; // id de la permission $this->rights[$r][0] = 27; // id de la permission
$this->rights[$r][1] = 'Supprimer les propositions commerciales'; // libelle de la permission $this->rights[$r][1] = 'Delete commercial proposals'; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'supprimer'; $this->rights[$r][4] = 'supprimer';
$r++; $r++;
$this->rights[$r][0] = 28; // id de la permission $this->rights[$r][0] = 28; // id de la permission
$this->rights[$r][1] = 'Exporter les propositions commerciales et attributs'; // libelle de la permission $this->rights[$r][1] = 'Exporting commercial proposals and attributes'; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'export'; $this->rights[$r][4] = 'export';

View File

@ -92,7 +92,7 @@ class modSociete extends DolibarrModules
$this->const[$r][0] = "SOCIETE_FISCAL_MONTH_START"; $this->const[$r][0] = "SOCIETE_FISCAL_MONTH_START";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "0"; $this->const[$r][2] = "0";
$this->const[$r][3] = "Mettre le numéro du mois du début d\'année fiscale, ex: 9 pour septembre"; $this->const[$r][3] = "Enter the month number of the first month of the fiscal year, e. g. 9 for September";
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
@ -141,7 +141,7 @@ class modSociete extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 121; // id de la permission $this->rights[$r][0] = 121; // id de la permission
$this->rights[$r][1] = 'Lire les sociétés'; // libelle de la permission $this->rights[$r][1] = 'Read third parties'; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'lire'; $this->rights[$r][4] = 'lire';
@ -165,7 +165,7 @@ class modSociete extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 122; // id de la permission $this->rights[$r][0] = 122; // id de la permission
$this->rights[$r][1] = 'Créer modifier les sociétés'; // libelle de la permission $this->rights[$r][1] = 'Create and update third parties'; // libelle de la permission
$this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'creer'; $this->rights[$r][4] = 'creer';
@ -189,14 +189,14 @@ class modSociete extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 125; // id de la permission $this->rights[$r][0] = 125; // id de la permission
$this->rights[$r][1] = 'Supprimer les sociétés'; // libelle de la permission $this->rights[$r][1] = 'Delete third parties'; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'supprimer'; $this->rights[$r][4] = 'supprimer';
$r++; $r++;
$this->rights[$r][0] = 126; // id de la permission $this->rights[$r][0] = 126; // id de la permission
$this->rights[$r][1] = 'Exporter les sociétés'; // libelle de la permission $this->rights[$r][1] = 'Export third parties'; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'export'; $this->rights[$r][4] = 'export';
@ -204,7 +204,7 @@ class modSociete extends DolibarrModules
// 262 : Resteindre l'acces des commerciaux // 262 : Resteindre l'acces des commerciaux
$r++; $r++;
$this->rights[$r][0] = 262; $this->rights[$r][0] = 262;
$this->rights[$r][1] = 'Consulter tous les tiers par utilisateurs internes (sinon uniquement si contact commercial). Non effectif pour utilisateurs externes (tjs limités à eux-même).'; $this->rights[$r][1] = 'Read all third parties by internal users (otherwise only if commercial contact). Not effective for external users (limited to themselves).';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'client'; $this->rights[$r][4] = 'client';
@ -212,7 +212,7 @@ class modSociete extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 281; // id de la permission $this->rights[$r][0] = 281; // id de la permission
$this->rights[$r][1] = 'Lire les contacts'; // libelle de la permission $this->rights[$r][1] = 'Read contacts'; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'contact'; $this->rights[$r][4] = 'contact';
@ -220,7 +220,7 @@ class modSociete extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 282; // id de la permission $this->rights[$r][0] = 282; // id de la permission
$this->rights[$r][1] = 'Créer modifier les contacts'; // libelle de la permission $this->rights[$r][1] = 'Create and update contact'; // libelle de la permission
$this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'contact'; $this->rights[$r][4] = 'contact';
@ -228,7 +228,7 @@ class modSociete extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 283; // id de la permission $this->rights[$r][0] = 283; // id de la permission
$this->rights[$r][1] = 'Supprimer les contacts'; // libelle de la permission $this->rights[$r][1] = 'Delete contacts'; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'contact'; $this->rights[$r][4] = 'contact';
@ -236,7 +236,7 @@ class modSociete extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 286; // id de la permission $this->rights[$r][0] = 286; // id de la permission
$this->rights[$r][1] = 'Exporter les contacts'; // libelle de la permission $this->rights[$r][1] = 'Export contacts'; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'contact'; $this->rights[$r][4] = 'contact';

View File

@ -168,9 +168,9 @@ class modStock extends DolibarrModules
$this->export_code[$r]=$this->rights_class; $this->export_code[$r]=$this->rights_class;
$this->export_label[$r]="WarehousesAndProducts"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]="WarehousesAndProducts"; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("stock","lire")); $this->export_permission[$r]=array(array("stock","lire"));
$this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.label'=>'LocationSummary','e.description'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.zip'=>'Zip','e.town'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.tobuy'=>'OnBuy','p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','p.pmp'=>'PMPValue','p.cost_price'=>'CostPrice','ps.reel'=>'Stock'); $this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.ref'=>'LocationSummary','e.description'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.zip'=>'Zip','e.town'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.tobuy'=>'OnBuy','p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','ps.reel'=>'Stock');
$this->export_TypeFields_array[$r]=array('e.rowid'=>'List:entrepot:label','e.label'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text','p.rowid'=>"List:product:label",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date','p.pmp'=>'Numeric','p.cost_price'=>'Numeric','ps.reel'=>'Numeric'); $this->export_TypeFields_array[$r]=array('e.rowid'=>'List:entrepot:ref','e.ref'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text','p.rowid'=>"List:product:label",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date','ps.reel'=>'Numeric');
$this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.label'=>'warehouse','e.description'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.zip'=>'warehouse','e.town'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.tobuy'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','p.pmp'=>'product','p.cost_price'=>'product','ps.reel'=>'stock'); $this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.ref'=>'warehouse','e.description'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.zip'=>'warehouse','e.town'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.tobuy'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','p.pmp'=>'product','p.cost_price'=>'product','ps.reel'=>'stock');
$this->export_aggregate_array[$r]=array('ps.reel'=>'SUM'); // TODO Not used yet $this->export_aggregate_array[$r]=array('ps.reel'=>'SUM'); // TODO Not used yet
$this->export_dependencies_array[$r]=array('stock'=>array('p.rowid','e.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them. $this->export_dependencies_array[$r]=array('stock'=>array('p.rowid','e.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them.
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
@ -188,9 +188,9 @@ class modStock extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_lot'; $this->export_code[$r]=$this->rights_class.'_lot';
$this->export_label[$r]="WarehousesAndProductsBatchDetail"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]="WarehousesAndProductsBatchDetail"; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("stock","lire")); $this->export_permission[$r]=array(array("stock","lire"));
$this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.label'=>'LocationSummary','e.description'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.zip'=>'Zip','e.town'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.tobuy'=>'OnBuy','p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','pb.rowid'=>'Id','pb.batch'=>'Batch','pb.eatby'=>'EatByDate','pb.sellby'=>'SellByDate','pb.qty'=>'Qty'); $this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.ref'=>'LocationSummary','e.description'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.zip'=>'Zip','e.town'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.tobuy'=>'OnBuy','p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','pb.rowid'=>'Id','pb.batch'=>'Batch','pb.eatby'=>'EatByDate','pb.sellby'=>'SellByDate','pb.qty'=>'Qty');
$this->export_TypeFields_array[$r]=array('e.rowid'=>'List:entrepot:label','e.label'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text','p.rowid'=>"List:product:label",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date','pb.batch'=>'Text','pb.eatby'=>'Date','pb.sellby'=>'Date','pb.qty'=>'Numeric'); $this->export_TypeFields_array[$r]=array('e.rowid'=>'List:entrepot:ref','e.ref'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text','p.rowid'=>"List:product:label",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date','pb.batch'=>'Text','pb.eatby'=>'Date','pb.sellby'=>'Date','pb.qty'=>'Numeric');
$this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.label'=>'warehouse','e.description'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.zip'=>'warehouse','e.town'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.tobuy'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','pb.rowid'=>'batch','pb.batch'=>'batch','pb.eatby'=>'batch','pb.sellby'=>'batch','pb.qty'=>'batch'); $this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.ref'=>'warehouse','e.description'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.zip'=>'warehouse','e.town'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.tobuy'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','pb.rowid'=>'batch','pb.batch'=>'batch','pb.eatby'=>'batch','pb.sellby'=>'batch','pb.qty'=>'batch');
$this->export_aggregate_array[$r]=array('ps.reel'=>'SUM'); // TODO Not used yet $this->export_aggregate_array[$r]=array('ps.reel'=>'SUM'); // TODO Not used yet
$this->export_dependencies_array[$r]=array('batch'=>array('pb.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them. $this->export_dependencies_array[$r]=array('batch'=>array('pb.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them.
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
@ -203,9 +203,9 @@ class modStock extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_movement'; $this->export_code[$r]=$this->rights_class.'_movement';
$this->export_label[$r]="StockMovements"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]="StockMovements"; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("stock","lire")); $this->export_permission[$r]=array(array("stock","lire"));
$this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.label'=>'LocationSummary','e.description'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.zip'=>'Zip','e.town'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.tobuy'=>'OnBuy','p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','sm.rowid'=>'MovementId','sm.value'=>'Qty','sm.datem'=>'DateMovement','sm.label'=>'LabelMovement','sm.inventorycode'=>'InventoryCode'); $this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.ref'=>'LocationSummary','e.description'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.zip'=>'Zip','e.town'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.tobuy'=>'OnBuy','p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','sm.rowid'=>'MovementId','sm.value'=>'Qty','sm.datem'=>'DateMovement','sm.label'=>'LabelMovement','sm.inventorycode'=>'InventoryCode');
$this->export_TypeFields_array[$r]=array('e.rowid'=>'List:entrepot:label','e.label'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text','p.rowid'=>"List:product:label",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date','sm.rowid'=>'Numeric','sm.value'=>'Numeric','sm.datem'=>'Date','sm.batch'=>'Text','sm.label'=>'Text','sm.inventorycode'=>'Text'); $this->export_TypeFields_array[$r]=array('e.rowid'=>'List:entrepot:ref','e.ref'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text','p.rowid'=>"List:product:label",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date','sm.rowid'=>'Numeric','sm.value'=>'Numeric','sm.datem'=>'Date','sm.batch'=>'Text','sm.label'=>'Text','sm.inventorycode'=>'Text');
$this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.label'=>'warehouse','e.description'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.zip'=>'warehouse','e.town'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.tobuy'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','sm.rowid'=>'movement','sm.value'=>'movement','sm.datem'=>'movement','sm.label'=>'movement','sm.inventorycode'=>'movement'); $this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.ref'=>'warehouse','e.description'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.zip'=>'warehouse','e.town'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.tobuy'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','sm.rowid'=>'movement','sm.value'=>'movement','sm.datem'=>'movement','sm.label'=>'movement','sm.inventorycode'=>'movement');
if ($conf->productbatch->enabled) if ($conf->productbatch->enabled)
{ {
$this->export_fields_array[$r]['sm.batch']='Batch'; $this->export_fields_array[$r]['sm.batch']='Batch';
@ -232,7 +232,7 @@ class modStock extends DolibarrModules
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('e'=>MAIN_DB_PREFIX.'entrepot'); $this->import_tables_array[$r]=array('e'=>MAIN_DB_PREFIX.'entrepot');
$this->import_tables_creator_array[$r]=array('e'=>'fk_user_author'); $this->import_tables_creator_array[$r]=array('e'=>'fk_user_author');
$this->import_fields_array[$r]=array('e.label'=>"LocationSummary*", $this->import_fields_array[$r]=array('e.ref'=>"LocationSummary*",
'e.description'=>"DescWareHouse",'e.lieu'=>"LieuWareHouse", 'e.description'=>"DescWareHouse",'e.lieu'=>"LieuWareHouse",
'e.address'=>"Address",'e.zip'=>'Zip','e.fk_pays'=>'CountryCode', 'e.address'=>"Address",'e.zip'=>'Zip','e.fk_pays'=>'CountryCode',
'e.statut'=>'Status' 'e.statut'=>'Status'
@ -242,7 +242,7 @@ class modStock extends DolibarrModules
'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry') 'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry')
); );
$this->import_regex_array[$r]=array('e.statut'=>'^[0|1]'); $this->import_regex_array[$r]=array('e.statut'=>'^[0|1]');
$this->import_examplevalues_array[$r]=array('e.label'=>"ALM001", $this->import_examplevalues_array[$r]=array('e.ref'=>"ALM001",
'e.description'=>"Central Warehouse",'e.lieu'=>"Central", 'e.description'=>"Central Warehouse",'e.lieu'=>"Central",
'e.address'=>"Route 66",'e.zip'=>'28080','e.fk_pays'=>'US', 'e.address'=>"Route 66",'e.zip'=>'28080','e.fk_pays'=>'US',
'e.statut'=>'1'); 'e.statut'=>'1');
@ -258,7 +258,7 @@ class modStock extends DolibarrModules
$this->import_convertvalue_array[$r]=array( $this->import_convertvalue_array[$r]=array(
'ps.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'product'), 'ps.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'product'),
'ps.fk_entrepot'=>array('rule'=>'fetchidfromref','classfile'=>'/product/stock/class/entrepot.class.php','class'=>'Entrepot','method'=>'fetch','element'=>'label') 'ps.fk_entrepot'=>array('rule'=>'fetchidfromref','classfile'=>'/product/stock/class/entrepot.class.php','class'=>'Entrepot','method'=>'fetch','element'=>'ref')
); );
$this->import_examplevalues_array[$r]=array( $this->import_examplevalues_array[$r]=array(
'ps.fk_product'=>"PREF123456",'ps.fk_entrepot'=>"ALM001",'ps.reel'=>"10" 'ps.fk_product'=>"PREF123456",'ps.fk_entrepot'=>"ALM001",'ps.reel'=>"10"

View File

@ -52,6 +52,7 @@ llxHeader('',$langs->trans("Donations"),$help_url);
$nb=array(); $nb=array();
$somme=array(); $somme=array();
$total = 0;
$sql = "SELECT count(d.rowid) as nb, sum(d.amount) as somme , d.fk_statut"; $sql = "SELECT count(d.rowid) as nb, sum(d.amount) as somme , d.fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."don as d"; $sql.= " FROM ".MAIN_DB_PREFIX."don as d";
@ -69,6 +70,8 @@ if ($result)
$somme[$objp->fk_statut] = $objp->somme; $somme[$objp->fk_statut] = $objp->somme;
$nb[$objp->fk_statut] = $objp->nb; $nb[$objp->fk_statut] = $objp->nb;
$total += $objp->somme;
$i++; $i++;
} }
$db->free($result); $db->free($result);
@ -118,14 +121,23 @@ print "</tr>\n";
$listofstatus=array(0,1,-1,2); $listofstatus=array(0,1,-1,2);
foreach ($listofstatus as $status) foreach ($listofstatus as $status)
{ {
$dataseries[]=array('label'=>$donstatic->LibStatut($status,1),'data'=>(isset($nb[$status])?(int) $nb[$status]:0)); $dataseries[]=array($donstatic->LibStatut($status,1), (isset($nb[$status])?(int) $nb[$status]:0));
} }
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print '<tr '.$bc[false].'><td align="center" colspan="4">'; print '<tr><td align="center" colspan="4">';
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',1); include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total?0:1);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -2477,7 +2477,7 @@ else if ($id || $ref)
} }
// Create bill // Create bill
if (! empty($conf->facture->enabled) && $object->statut > 0) if (! empty($conf->facture->enabled) && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED))
{ {
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
{ {
@ -2489,18 +2489,18 @@ else if ($id || $ref)
// This is just to generate a delivery receipt // This is just to generate a delivery receipt
//var_dump($object->linkedObjectsIds['delivery']); //var_dump($object->linkedObjectsIds['delivery']);
if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0) if ($conf->livraison_bon->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0)
{ {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'</a>';
} }
// Close // Close
if (! empty($conf->facture->enabled) && $object->statut > 0) if ($object->statut == Expedition::STATUS_VALIDATED)
{ {
if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed) if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed)
{ {
$label="Close"; $paramaction='classifyclosed'; // = Transferred/Received $label="Close"; $paramaction='classifyclosed'; // = Transferred/Received
// Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders
if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) // TODO Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close. if (! empty($conf->facture->enabled) && ! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
{ {
$label="ClassifyBilled"; $label="ClassifyBilled";
$paramaction='classifybilled'; $paramaction='classifybilled';

View File

@ -118,14 +118,23 @@ print "</tr>\n";
$listoftype=$tripandexpense_static->listOfTypes(); $listoftype=$tripandexpense_static->listOfTypes();
foreach ($listoftype as $code => $label) foreach ($listoftype as $code => $label)
{ {
$dataseries[]=array('label'=>$label,'data'=>(isset($somme[$code])?(int) $somme[$code]:0)); $dataseries[]=array($label, (isset($somme[$code])?(int) $somme[$code]:0));
} }
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print '<tr '.$bc[0].'><td align="center" colspan="4">'; print '<tr><td align="center" colspan="4">';
$data=array('series'=>$dataseries);
dol_print_graph('stats',320,180,$data,1,'pie',0,'',0); include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($totalnb?0:1);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -121,15 +121,25 @@ if ($resql)
$bool=false; $bool=false;
foreach ($listofstatus as $status) foreach ($listofstatus as $status)
{ {
$dataseries[]=array('label'=>$fichinterstatic->LibStatut($status,$bool,1),'data'=>(isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0)); $dataseries[]=array($fichinterstatic->LibStatut($status,$bool,1), (isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0));
if ($status==3 && ! $bool) $bool=true; if ($status==3 && ! $bool) $bool=true;
else $bool=false; else $bool=false;
} }
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print '<tr class="impair"><td align="center" colspan="2">'; print '<tr class="impair"><td align="center" colspan="2">';
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total?0:1);
$data=array('series'=>$dataseries); $data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',1);
print '</td></tr>'; print '</td></tr>';
} }
$var=true; $var=true;

View File

@ -304,7 +304,7 @@ if ($resql)
$topicmail="Information"; $topicmail="Information";
$modelmail="intervention"; $modelmail="intervention";
$objecttmp=new Intervention($db); $objecttmp=new Fichinter($db);
$trackid='int'.$object->id; $trackid='int'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';

View File

@ -132,7 +132,7 @@ if ($object->id > 0)
dol_fiche_head($head, 'supplier', $langs->trans("ThirdParty"), -1, 'company'); dol_fiche_head($head, 'supplier', $langs->trans("ThirdParty"), -1, 'company');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');

View File

@ -116,7 +116,7 @@ if ($resql)
print "</tr>\n"; print "</tr>\n";
foreach (array(0,1,2,3,4,5,6) as $statut) foreach (array(0,1,2,3,4,5,6) as $statut)
{ {
$dataseries[]=array('label'=>$commandestatic->LibStatut($statut,1),'data'=>(isset($vals[$statut])?(int) $vals[$statut]:0)); $dataseries[]=array($commandestatic->LibStatut($statut,1), (isset($vals[$statut])?(int) $vals[$statut]:0));
if (! $conf->use_javascript_ajax) if (! $conf->use_javascript_ajax)
{ {
@ -129,8 +129,17 @@ if ($resql)
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print '<tr class="impair"><td align="center" colspan="2">'; print '<tr class="impair"><td align="center" colspan="2">';
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',1,'',0); include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total?0:1);
print '</td></tr>'; print '</td></tr>';
} }
//if ($totalinprocess != $total) //if ($totalinprocess != $total)

View File

@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$langs->load('companies');
$langs->load('bills'); $langs->load('bills');
$id = GETPOST("facid",'int')?GETPOST("facid",'int'):GETPOST("id",'int'); $id = GETPOST("facid",'int')?GETPOST("facid",'int'):GETPOST("id",'int');

View File

@ -68,6 +68,10 @@ ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer;
-- For 7.0 -- For 7.0
ALTER TABLE llx_inventory ADD UNIQUE INDEX uk_inventory_ref (ref, entity);
ALTER table llx_entrepot CHANGE COLUMN label ref varchar(255);
UPDATE llx_paiementfourn SET ref = rowid WHERE ref IS NULL; UPDATE llx_paiementfourn SET ref = rowid WHERE ref IS NULL;
UPDATE llx_paiementfourn SET entity = 1 WHERE entity IS NULL; UPDATE llx_paiementfourn SET entity = 1 WHERE entity IS NULL;
@ -582,3 +586,7 @@ ALTER TABLE llx_societe MODIFY COLUMN capital double(24,8);
ALTER TABLE llx_tva MODIFY COLUMN amount double(24,8); ALTER TABLE llx_tva MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_subscription MODIFY COLUMN subscription double(24,8); ALTER TABLE llx_subscription MODIFY COLUMN subscription double(24,8);
ALTER TABLE llx_resource ADD fk_country integer DEFAULT NULL;
ALTER TABLE llx_resource ADD INDEX idx_resource_fk_country (fk_country);
ALTER TABLE llx_resource ADD CONSTRAINT fk_resource_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_country (rowid);

View File

@ -17,4 +17,4 @@
-- ============================================================================ -- ============================================================================
ALTER TABLE llx_entrepot ADD UNIQUE INDEX uk_entrepot_label (label, entity); ALTER TABLE llx_entrepot ADD UNIQUE INDEX uk_entrepot_label (ref, entity);

View File

@ -1,6 +1,6 @@
-- ============================================================================ -- ============================================================================
-- Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> -- Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- This program is free software; you can redistribute it and/or modify
@ -21,9 +21,9 @@
create table llx_entrepot create table llx_entrepot
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(255) NOT NULL,
datec datetime, datec datetime,
tms timestamp, tms timestamp,
label varchar(255) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id entity integer DEFAULT 1 NOT NULL, -- multi company id
description text, description text,
lieu varchar(64), -- resume lieu situation lieu varchar(64), -- resume lieu situation

View File

@ -17,5 +17,7 @@
-- --
-- =================================================================== -- ===================================================================
ALTER TABLE llx_inventory ADD UNIQUE INDEX uk_inventory_ref (ref, entity);
ALTER TABLE llx_inventory ADD INDEX idx_inventory_tms (tms); ALTER TABLE llx_inventory ADD INDEX idx_inventory_tms (tms);
ALTER TABLE llx_inventory ADD INDEX idx_inventory_datec (datec); ALTER TABLE llx_inventory ADD INDEX idx_inventory_datec (datec);

View File

@ -18,3 +18,6 @@
ALTER TABLE llx_resource ADD UNIQUE INDEX uk_resource_ref (ref, entity); ALTER TABLE llx_resource ADD UNIQUE INDEX uk_resource_ref (ref, entity);
ALTER TABLE llx_resource ADD INDEX fk_code_type_resource_idx (fk_code_type_resource); ALTER TABLE llx_resource ADD INDEX fk_code_type_resource_idx (fk_code_type_resource);
ALTER TABLE llx_resource ADD INDEX idx_resource_fk_country (fk_country);
ALTER TABLE llx_resource ADD CONSTRAINT fk_resource_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_country (rowid);

1
htdocs/install/mysql/tables/llx_resource.sql Executable file → Normal file
View File

@ -33,5 +33,6 @@ CREATE TABLE llx_resource
note_private text, note_private text,
import_key varchar(14), import_key varchar(14),
extraparams varchar(255), -- for stock other parameters with json format extraparams varchar(255), -- for stock other parameters with json format
fk_country integer DEFAULT NULL, -- Optional id of original country
tms timestamp tms timestamp
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -329,6 +329,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</table>'; print '</table>';
print '</div>'; print '</div>';
/* Second column
print '<div class="fichehalfright">';
print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
print '</table>';
print '</div>';*/
print '</div>'; print '</div>';
print '</div>'; print '</div>';
@ -359,7 +369,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
} }
/* /*
if ($user->rights->sellyoursaas->create) if ($user->rights->mymodule->create)
{ {
if ($object->status == 1) if ($object->status == 1)
{ {
@ -396,13 +406,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<a name="builddoc"></a>'; // ancre print '<a name="builddoc"></a>'; // ancre
// Documents // Documents
/*$comref = dol_sanitizeFileName($object->ref); /*$objref = dol_sanitizeFileName($object->ref);
$relativepath = $comref . '/' . $comref . '.pdf'; $relativepath = $comref . '/' . $comref . '.pdf';
$filedir = $conf->mymodule->dir_output . '/' . $comref; $filedir = $conf->mymodule->dir_output . '/' . $objref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$genallowed = $user->rights->mymodule->read; // If you can read, you can build the PDF to read content $genallowed = $user->rights->mymodule->read; // If you can read, you can build the PDF to read content
$delallowed = $user->rights->mymodule->create; // If you can create/edit, you can remove a file on card $delallowed = $user->rights->mymodule->create; // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('mymodule', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); print $formfile->showdocuments('mymodule', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
*/ */
// Show links to link elements // Show links to link elements
@ -426,13 +436,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</div></div></div>'; print '</div></div></div>';
} }
// Presend form //Select mail models is same action as presend
$modelmail='myobject'; /*
$defaulttopic='Information'; if (GETPOST('modelselected')) $action = 'presend';
$diroutput = $conf->mymodule->dir_output;
$trackid = 'myobject'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; // Presend form
$modelmail='inventory';
$defaulttopic='InformationMessage';
$diroutput = $conf->product->dir_output.'/inventory';
$trackid = 'stockinv'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
*/
} }

View File

@ -388,8 +388,8 @@ print '<tr class="liste_titre">';
foreach($object->fields as $key => $val) foreach($object->fields as $key => $val)
{ {
$align=''; $align='';
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
if ($key == 'status') $align.=($align?' ':'').'center'; if ($key == 'status') $align.=($align?' ':'').'center';
if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>'; if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>';
} }
@ -434,24 +434,24 @@ print '<tr class="liste_titre">';
foreach($object->fields as $key => $val) foreach($object->fields as $key => $val)
{ {
$align=''; $align='';
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
if ($key == 'status') $align.=($align?' ':'').'center'; if ($key == 'status') $align.=($align?' ':'').'center';
if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n";
} }
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{ {
foreach($extrafields->attribute_label as $key => $val) foreach($extrafields->attribute_label as $key => $val)
{ {
if (! empty($arrayfields["ef.".$key]['checked'])) if (! empty($arrayfields["ef.".$key]['checked']))
{ {
$align=$extrafields->getAlignFlag($key); $align=$extrafields->getAlignFlag($key);
$sortonfield = "ef.".$key; $sortonfield = "ef.".$key;
if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; if (! empty($extrafields->attribute_computed[$key])) $sortonfield='';
print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n"; print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n";
} }
} }
} }
// Hook fields // Hook fields
$parameters=array('arrayfields'=>$arrayfields); $parameters=array('arrayfields'=>$arrayfields);
@ -479,40 +479,40 @@ while ($i < min($num, $limit))
if (empty($obj)) break; // Should not happen if (empty($obj)) break; // Should not happen
// Store properties in $object // Store properties in $object
$object->id = $obj->rowid; $object->id = $obj->rowid;
foreach($object->fields as $key => $val) foreach($object->fields as $key => $val)
{ {
if (isset($obj->$key)) $object->$key = $obj->$key; if (isset($obj->$key)) $object->$key = $obj->$key;
} }
// Show here line of result // Show here line of result
print '<tr class="oddeven">'; print '<tr class="oddeven">';
foreach($object->fields as $key => $val) foreach($object->fields as $key => $val)
{ {
$align=''; $align='';
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
if ($key == 'status') $align.=($align?' ':'').'center'; if ($key == 'status') $align.=($align?' ':'').'center';
if (! empty($arrayfields['t.'.$key]['checked'])) if (! empty($arrayfields['t.'.$key]['checked']))
{
print '<td';
if ($align) print ' class="'.$align.'"';
print '>';
print $object->showOutputField($val, $key, $obj->$key, '');
print '</td>';
if (! $i) $totalarray['nbfield']++;
if (! empty($val['isameasure']))
{ {
print '<td'; if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key;
if ($align) print ' class="'.$align.'"'; $totalarray['val']['t.'.$key] += $obj->$key;
print '>';
print $object->showOutputField($val, $key, $obj->$key, '');
print '</td>';
if (! $i) $totalarray['nbfield']++;
if (! empty($val['isameasure']))
{
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key;
$totalarray['val']['t.'.$key] += $obj->$key;
}
} }
}
} }
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{ {
foreach($extrafields->attribute_label as $key => $val) foreach($extrafields->attribute_label as $key => $val)
{ {
if (! empty($arrayfields["ef.".$key]['checked'])) if (! empty($arrayfields["ef.".$key]['checked']))
{ {
$align=$extrafields->getAlignFlag($key); $align=$extrafields->getAlignFlag($key);
@ -529,7 +529,7 @@ while ($i < min($num, $limit))
$totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey; $totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey;
} }
} }
} }
} }
// Fields from hook // Fields from hook
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);

View File

@ -216,7 +216,7 @@ dol_fiche_head($head,'general',$langs->trans("Survey"), -1, DOL_URL_ROOT.'/opens
$morehtmlref = ''; $morehtmlref = '';
$linkback = '<a href="'.DOL_URL_ROOT.'/opensurvey/list.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/opensurvey/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtmlref); dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtmlref);
@ -310,7 +310,7 @@ if ($action == 'edit') print $form->select_date($expiredate?$expiredate:$object-
else else
{ {
print dol_print_date($object->date_fin,'day'); print dol_print_date($object->date_fin,'day');
if ($object->date_fin && $object->date_fin < dol_now()) print img_warning($langs->trans("Expired")); if ($object->date_fin && $object->date_fin < dol_now() && $object->status == Opensurveysondage::STATUS_VALIDATED) print img_warning($langs->trans("Expired"));
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2013-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -34,9 +34,8 @@ $action=GETPOST('action','aZ09');
$id=GETPOST('id','alpha'); $id=GETPOST('id','alpha');
$numsondage= $id; $numsondage= $id;
$search_ref = GETPOST('search_ref', 'alpha'); $search_ref = GETPOST('search_ref', 'alpha');
$surveytitle=GETPOST('surveytitle', 'alpha'); $search_title = GETPOST('search_title', 'alpha');
$status=GETPOST('status', 'int'); $search_status = GETPOST('search_status', 'alpha');
//if (! isset($_POST['status']) && ! isset($_GET['status'])) $status='opened'; // If filter unknown, we choose 'opened'
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
@ -58,10 +57,10 @@ $langs->load("opensurvey");
* Actions * Actions
*/ */
if (GETPOST('button_removefilter')) if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{ {
$status=''; $search_status='';
$surveytitle=''; $search_title='';
$search_ref=''; $search_ref='';
} }
@ -75,7 +74,7 @@ $opensurvey_static = new Opensurveysondage($db);
$now = dol_now(); $now = dol_now();
llxHeader(); llxHeader('', $langs->trans("OpenSurveyArea"));
$param=''; $param='';
$fieldtosortuser=empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?'firstname':'lastname'; $fieldtosortuser=empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?'firstname':'lastname';
@ -98,13 +97,13 @@ print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"")
print '<tr class="liste_titre_filter">'; print '<tr class="liste_titre_filter">';
print '<td class="liste_titre"><input type="text" class="maxwidth100" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>'; print '<td class="liste_titre"><input type="text" class="maxwidth100" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
print '<td class="liste_titre"><input type="text" class="maxwidth100onsmartphone" name="surveytitle" value="'.dol_escape_htmltag($surveytitle).'"></td>'; print '<td class="liste_titre"><input type="text" class="maxwidth100onsmartphone" name="search_title" value="'.dol_escape_htmltag($search_title).'"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
$arraystatus=array(''=>'&nbsp;','expired'=>$langs->trans("Expired"),'opened'=>$langs->trans("Opened"));
print '<td class="liste_titre" align="center">'. $form->selectarray('status', $arraystatus, $status).'</td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
$arraystatus=array('-1'=>'&nbsp;','0'=>$langs->trans("Draft"),'1'=>$langs->trans("Opened"),'2'=>$langs->trans("Closed"));
print '<td class="liste_titre" align="center">'. $form->selectarray('search_status', $arraystatus, $search_status).'</td>';
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
@ -114,7 +113,7 @@ print '</tr>'."\n";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.id_sondage", $param,"","",$sortfield,$sortorder); print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.id_sondage", $param,"","",$sortfield,$sortorder);
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "p.titre", $param,"","",$sortfield,$sortorder); print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "p.titre", $param,"","",$sortfield,$sortorder);
print_liste_field_titre("Type"); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "p.format", $param,"","",$sortfield,$sortorder);
print_liste_field_titre("Author", $_SERVER["PHP_SELF"], "u.".$fieldtosortuser, $param,"","",$sortfield,$sortorder); print_liste_field_titre("Author", $_SERVER["PHP_SELF"], "u.".$fieldtosortuser, $param,"","",$sortfield,$sortorder);
print_liste_field_titre("NbOfVoters", $_SERVER["PHP_SELF"], "", $param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre("NbOfVoters", $_SERVER["PHP_SELF"], "", $param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre("ExpireDate", $_SERVER["PHP_SELF"], "p.date_fin", $param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre("ExpireDate", $_SERVER["PHP_SELF"], "p.date_fin", $param,"",'align="center"',$sortfield,$sortorder);
@ -125,7 +124,7 @@ print '</tr>'."\n";
$sql = "SELECT p.id_sondage, p.fk_user_creat, p.format, p.date_fin, p.status, p.titre, p.nom_admin,"; $sql = "SELECT p.id_sondage, p.fk_user_creat, p.format, p.date_fin, p.status, p.titre, p.nom_admin,";
$sql.= " u.login, u.firstname, u.lastname"; $sql.= " u.login, u.firstname, u.lastname";
$sql.= " FROM ".MAIN_DB_PREFIX."opensurvey_sondage as p"; $sql.= " FROM ".MAIN_DB_PREFIX."opensurvey_sondage as p";
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."user u ON u.rowid = p.fk_user_creat"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON u.rowid = p.fk_user_creat";
// Count total nb of records // Count total nb of records
$nbtotalofrecords = ''; $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
@ -134,11 +133,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$nbtotalofrecords = $db->num_rows($result); $nbtotalofrecords = $db->num_rows($result);
} }
$sql.= " WHERE p.entity = ".getEntity('survey'); $sql.= " WHERE p.entity = ".getEntity('survey');
if ($status == 'expired') $sql.=" AND date_fin < '".$db->idate($now)."'"; if ($search_status != '-1' && $search_status != '') $sql.=natural_search("p.status", $search_status, 2);
if ($status == 'opened') $sql.=" AND date_fin >= '".$db->idate($now)."'"; if ($search_expired == 'expired') $sql.=" AND p.date_fin < '".$db->idate($now)."'";
if ($search_expired == 'opened') $sql.=" AND p.date_fin >= '".$db->idate($now)."'";
if ($search_ref) $sql.=natural_search("p.id_sondage", $search_ref); if ($search_ref) $sql.=natural_search("p.id_sondage", $search_ref);
if ($surveytitle) $sql.=natural_search("p.titre", $surveytitle); if ($search_title) $sql.=natural_search("p.titre", $search_title);
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
// Count total nb of records // Count total nb of records
@ -149,7 +148,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$nbtotalofrecords = $db->num_rows($result); $nbtotalofrecords = $db->num_rows($result);
} }
$sql.= $db->plimit($limit + 1,$offset); $sql.= $db->plimit($limit+1, $offset);
$resql=$db->query($sql); $resql=$db->query($sql);
if (! $resql) dol_print_error($db); if (! $resql) dol_print_error($db);
@ -174,6 +173,7 @@ while ($i < min($num,$limit))
$opensurvey_static->ref=$obj->id_sondage; $opensurvey_static->ref=$obj->id_sondage;
$opensurvey_static->title=$obj->titre; $opensurvey_static->title=$obj->titre;
$opensurvey_static->status=$obj->status; $opensurvey_static->status=$obj->status;
$opensurvey_static->date_fin=$db->jdate($obj->date_fin);
print '<tr>'; print '<tr>';
@ -183,7 +183,10 @@ while ($i < min($num,$limit))
print '</td>'; print '</td>';
// Title // Title
print '<td>'.dol_htmlentities($obj->titre).'</td><td>'; print '<td>'.dol_htmlentities($obj->titre).'</td>';
// Type
print '<td>';
$type=($obj->format=='A')?'classic':'date'; $type=($obj->format=='A')?'classic':'date';
print img_picto('',dol_buildpath('/opensurvey/img/'.($type == 'classic'?'chart-32.png':'calendar-32.png'),1),'width="16"',1); print img_picto('',dol_buildpath('/opensurvey/img/'.($type == 'classic'?'chart-32.png':'calendar-32.png'),1),'width="16"',1);
print ' '.$langs->trans($type=='classic'?"TypeClassic":"TypeDate"); print ' '.$langs->trans($type=='classic'?"TypeClassic":"TypeDate");
@ -204,10 +207,11 @@ while ($i < min($num,$limit))
print '</td>'; print '</td>';
// Nb of voters
print'<td align="right">'.$nbuser.'</td>'."\n"; print'<td align="right">'.$nbuser.'</td>'."\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->date_fin),'day'); print '<td align="center">'.dol_print_date($db->jdate($obj->date_fin),'day');
if ($db->jdate($obj->date_fin) < time()) { print img_warning($langs->trans("Expired")); } if ($db->jdate($obj->date_fin) < $now && $obj->status == Opensurveysondage::STATUS_VALIDATED) { print img_warning($langs->trans("Expired")); }
print '</td>'; print '</td>';
print'<td align="center">'.$opensurvey_static->getLibStatut(5).'</td>'."\n"; print'<td align="center">'.$opensurvey_static->getLibStatut(5).'</td>'."\n";

View File

@ -389,13 +389,13 @@ for ($i = 0; $i < $nbcolonnes; $i++)
* View * View
*/ */
$form=new Form($db);
if ($object->fk_user_creat) { if ($object->fk_user_creat) {
$userstatic = new User($db); $userstatic = new User($db);
$userstatic->fetch($object->fk_user_creat); $userstatic->fetch($object->fk_user_creat);
} }
$form=new Form($db);
$result=$object->fetch(0,$numsondage); $result=$object->fetch(0,$numsondage);
if ($result <= 0) if ($result <= 0)
{ {
@ -430,7 +430,7 @@ dol_fiche_head($head,'preview',$langs->trans("Survey"), -1, DOL_URL_ROOT.'/opens
$morehtmlref = ''; $morehtmlref = '';
$linkback = '<a href="'.DOL_URL_ROOT.'/opensurvey/list.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/opensurvey/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtmlref); dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtmlref);

View File

@ -87,7 +87,7 @@ class FormProduct
$warehouseStatus[] = Entrepot::STATUS_OPEN_INTERNAL; $warehouseStatus[] = Entrepot::STATUS_OPEN_INTERNAL;
} }
$sql = "SELECT e.rowid, e.label, e.description, e.fk_parent"; $sql = "SELECT e.rowid, e.ref as label, e.description, e.fk_parent";
if (!empty($fk_product)) if (!empty($fk_product))
{ {
if (!empty($batch)) if (!empty($batch))
@ -125,8 +125,8 @@ class FormProduct
if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.$this->db->escape(implode(',', $exclude)).')'; if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.$this->db->escape(implode(',', $exclude)).')';
if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.label, e.description, e.fk_parent"; if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.ref, e.description, e.fk_parent";
$sql.= " ORDER BY e.label"; $sql.= " ORDER BY e.ref";
dol_syslog(get_class($this).'::loadWarehouses', LOG_DEBUG); dol_syslog(get_class($this).'::loadWarehouses', LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
@ -447,7 +447,7 @@ class FormProduct
// clear cache // clear cache
$this->cache_lot = array(); $this->cache_lot = array();
$productIdList = implode(',', $productIdArray); $productIdList = implode(',', $productIdArray);
$sql = "SELECT pb.batch, pb.rowid, ps.fk_entrepot, pb.qty, e.label, ps.fk_product"; $sql = "SELECT pb.batch, pb.rowid, ps.fk_entrepot, pb.qty, e.ref as label, ps.fk_product";
$sql.= " FROM ".MAIN_DB_PREFIX."product_batch as pb"; $sql.= " FROM ".MAIN_DB_PREFIX."product_batch as pb";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.rowid = pb.fk_product_stock"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.rowid = pb.fk_product_stock";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on e.rowid = ps.fk_entrepot AND e.entity IN (".getEntity('stock').")"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on e.rowid = ps.fk_entrepot AND e.entity IN (".getEntity('stock').")";
@ -455,7 +455,7 @@ class FormProduct
{ {
$sql.= " WHERE ps.fk_product IN (".$productIdList.")"; $sql.= " WHERE ps.fk_product IN (".$productIdList.")";
} }
$sql.= " ORDER BY e.label, pb.batch"; $sql.= " ORDER BY e.ref, pb.batch";
dol_syslog(get_class($this).'::loadLotStock', LOG_DEBUG); dol_syslog(get_class($this).'::loadLotStock', LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);

View File

@ -221,25 +221,38 @@ if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHS
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
if ($i < $nbmax) if ($i < $nbmax)
$dataseries[]=array('label'=>$obj->label,'data'=>round($obj->nb)); {
$dataseries[]=array($obj->label, round($obj->nb));
}
else else
{
$rest+=$obj->nb; $rest+=$obj->nb;
}
$total+=$obj->nb; $total+=$obj->nb;
$i++; $i++;
} }
if ($i > $nbmax) if ($i > $nbmax)
$dataseries[]=array('label'=>$langs->trans("Other"),'data'=>round($rest)); {
$data=array('series'=>$dataseries); $dataseries[]=array($langs->trans("Other"), round($rest));
dol_print_graph('statscategproduct',300,180,$data,1,'pie',0); }
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->draw('idstatscategproduct');
print $dolgraph->show($total?0:1);
} }
else else
{ {
$var=true;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
print '<tr $bc[$var]><td>'.$obj->label.'</td><td>'.$obj->nb.'</td></tr>'; print '<tr><td>'.$obj->label.'</td><td>'.$obj->nb.'</td></tr>';
$total+=$obj->nb; $total+=$obj->nb;
$i++; $i++;
} }

View File

@ -24,12 +24,14 @@
require '../../main.inc.php'; require '../../main.inc.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/inventory/lib/inventory.lib.php';
// Load traductions files requiredby by page // Load traductions files requiredby by page
$langs->loadLangs(array("inventory","other")); $langs->loadLangs(array("inventory","other"));
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
$cancel = GETPOST('cancel', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
@ -37,7 +39,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
// Initialize technical objects // Initialize technical objects
$object=new Inventory($db); $object=new Inventory($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$diroutputmassaction=$conf->inventory->dir_output . '/temp/massgeneration/'.$user->id; $diroutputmassaction=$conf->stock->dir_output . '/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('inventorycard')); // Note that conf->hooks_modules contains array $hookmanager->initHooks(array('inventorycard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels // Fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label('inventory'); $extralabels = $extrafields->fetch_name_optionals_label('inventory');
@ -53,12 +55,10 @@ foreach($object->fields as $key => $val)
if (empty($action) && empty($id) && empty($ref)) $action='view'; if (empty($action) && empty($id) && empty($ref)) $action='view';
// Protection if external user // Security check - Protection if external user
if ($user->societe_id > 0) //if ($user->societe_id > 0) access_forbidden();
{ //if ($user->societe_id > 0) $socid = $user->societe_id;
//accessforbidden(); //$result = restrictedArea($user, 'mymodule', $id);
}
//$result = restrictedArea($user, 'inventory', $id);
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
@ -69,7 +69,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
/* /*
* ACTIONS * Actions
*/ */
$parameters=array(); $parameters=array();
@ -80,19 +80,28 @@ if (empty($reshook))
{ {
$error=0; $error=0;
$permissiontoadd = $user->rights->inventory->create; $permissiontoadd = $user->rights->stock->creer;
$permissiontodelete = $user->rights->inventory->delete; $permissiontodelete = $user->rights->stock->supprimer;
$backurlforlist = dol_buildpath('/inventory/inventory_list.php',1); $backurlforlist = DOL_URL_ROOT.'/product/inventory/list.php';
// Actions cancel, add, update or delete // Actions cancel, add, update or delete
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
// Actions when printing a doc from card
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
/*$trigger_name='MYOBJECT_SENTBYMAIL';
$autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
$trackid='myobject'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/
} }
/* /*
* VIEW * View
*/ */
$form=new Form($db); $form=new Form($db);
@ -128,38 +137,9 @@ if ($action == 'create')
dol_fiche_head(array(), ''); dol_fiche_head(array(), '');
print '<table class="border centpercent">'."\n"; print '<table class="border centpercent">'."\n";
foreach($object->fields as $key => $val)
{ // Common attributes
if (in_array($key, array('rowid', 'entity', 'date_creation', 'date_validation', 'tms', 'fk_user_creat', 'fk_user_modif', 'fk_user_valid', 'import_key'))) continue; include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
print '<tr id="field_'.$key.'">';
print '<td';
print ' class="titlefieldcreate';
if ($val['notnull'] > 0) print ' fieldrequired';
if ($val['type'] == 'text') print ' tdtop';
print '"';
print '>';
print $langs->trans($val['label']);
print '</td>';
print '<td>';
$defaultcss='minwidth100';
if ($val['type'] == 'text')
{
print '<textarea class="flat quatrevingtpercent" rows="'.ROWS_4.'" name="'.$key.'">';
print GETPOST($key,'none');
print '</textarea>';
}
elseif (is_array($val['arrayofkeyval']))
{
print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int'));
}
else
{
$cssforinput = empty($val['css'])?$defaultcss:$val['css'];
print '<input class="flat'.($cssforinput?' '.$cssforinput:'').'" class="'.$cssforinput.'" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):'').'">';
}
print '</td>';
print '</tr>';
}
// Other attributes // Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
@ -171,20 +151,19 @@ if ($action == 'create')
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">'; print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
print '&nbsp; '; print '&nbsp; ';
print '<input type="button" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" onclick="javascript:history.go(-1)">'; // Cancel for create doe not post form print '<input type="'.($backtopage?"submit":"button").'" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage?'':' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
print '</div>'; print '</div>';
print '</form>'; print '</form>';
} }
// Part to edit record // Part to edit record
if (($id || $ref) && $action == 'edit') if (($id || $ref) && $action == 'edit')
{ {
print load_fiche_titre($langs->trans("Inventory")); print load_fiche_titre($langs->trans("Inventory"));
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">'; print '<input type="hidden" name="id" value="'.$object->id.'">';
@ -192,36 +171,9 @@ if (($id || $ref) && $action == 'edit')
dol_fiche_head(); dol_fiche_head();
print '<table class="border centpercent">'."\n"; print '<table class="border centpercent">'."\n";
foreach($object->fields as $key => $val)
{
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue;
print '<tr><td'; // Common attributes
print ' class="titlefieldcreate'; include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
if ($val['notnull'] > 0) print ' fieldrequired';
if ($val['type'] == 'text') print ' tdtop';
print '"';
print '>'.$langs->trans($val['label']).'</td>';
print '<td>';
$defaultcss='minwidth100';
if ($val['type'] == 'text')
{
print '<textarea class="flat quatrevingtpercent" rows="'.ROWS_4.'" name="'.$key.'">';
print GETPOST($key,'none')?GETPOST($key,'none'):$object->$key;
print '</textarea>';
}
elseif (is_array($val['arrayofkeyval']))
{
print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int')!=''?GETPOST($key, 'int'):$object->$key);
}
else
{
$cssforinput = empty($val['css'])?$defaultcss:$val['css'];
print '<input class="flat'.($cssforinput?' '.$cssforinput:'').'" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):$object->$key).'">';
}
print '</td>';
print '</tr>';
}
// Other attributes // Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
@ -237,22 +189,19 @@ if (($id || $ref) && $action == 'edit')
print '</form>'; print '</form>';
} }
// Part to show record // Part to show record
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
{ {
$res = $object->fetch_optionals($object->id, $extralabels); $res = $object->fetch_optionals($object->id, $extralabels);
$head = inventory_prepare_head($object); $head = inventoryPrepareHead($object);
dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), -1, 'order'); dol_fiche_head($head, 'inventory', $langs->trans("Inventory"), -1, 'inventory');
$formconfirm = ''; $formconfirm = '';
// Confirmation to delete // Confirmation to delete
if ($action == 'delete') { if ($action == 'delete') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteInventory'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
} }
// Confirmation of action xxxx // Confirmation of action xxxx
@ -280,13 +229,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print $formconfirm; print $formconfirm;
// Object card // Object card
// ------------------------------------------------------------ // ------------------------------------------------------------
$linkback = '<a href="' . DOL_URL_ROOT . '/inventory/inventory_list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; $linkback = '<a href="' . DOL_URL_ROOT . '/inventory/inventory_list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">'; $morehtmlref='<div class="refidno">';
/* /*
// Ref bis // Ref bis
@ -339,24 +286,25 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<div class="fichehalfleft">'; print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">'."\n"; print '<table class="border centpercent">'."\n";
// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
// LIST_OF_TD_LABEL_FIELDS_VIEW
// Common attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
// Other attributes // Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
print '</table>'; print '</table>';
print '</div>'; print '</div>';
/* Second column
print '<div class="fichehalfright">'; print '<div class="fichehalfright">';
print '<div class="ficheaddleft">'; print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">'; print '<table class="border centpercent">';
print '</table>'; print '</table>';
print '</div>'; print '</div>';*/
print '</div>'; print '</div>';
print '</div>'; print '</div>';
@ -375,16 +323,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook)) if (empty($reshook))
{ {
// Send // Send
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendByMail') . '</a></div>'."\n"; print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
if ($user->rights->inventory->write) if ($user->rights->inventory->write)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a></div>'."\n"; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a>'."\n";
}
else
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
} }
if ($user->rights->inventory->delete) if ($user->rights->inventory->delete)
{ {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a></div>'."\n"; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>'."\n";
}
else
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
} }
} }
print '</div>'."\n"; print '</div>'."\n";
@ -400,27 +356,34 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{ {
print '<div class="fichecenter"><div class="fichehalfleft">'; print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre print '<a name="builddoc"></a>'; // ancre
// Documents
$comref = dol_sanitizeFileName($object->ref);
$relativepath = $comref . '/' . $comref . '.pdf';
$filedir = $conf->product->dir_output . '/inventory/' . $comref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$genallowed = $user->rights->inventory->read;
$delallowed = $user->rights->inventory->create;
print $formfile->showdocuments('inventory', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
// Documents
/*$objref = dol_sanitizeFileName($object->ref);
$relativepath = $comref . '/' . $comref . '.pdf';
$filedir = $conf->mymodule->dir_output . '/' . $objref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$genallowed = $user->rights->mymodule->read; // If you can read, you can build the PDF to read content
$delallowed = $user->rights->mymodule->create; // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('mymodule', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
*/
// Show links to link elements // Show links to link elements
$linktoelem = $form->showLinkToObjectBlock($object, null, array('order')); $linktoelem = $form->showLinkToObjectBlock($object, null, array('inventory'));
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
print '</div><div class="fichehalfright"><div class="ficheaddleft">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
$MAXEVENT = 10;
$morehtmlright = '<a href="'.dol_buildpath('/mymodule/myobject_info.php', 1).'?id='.$object->id.'">';
$morehtmlright.= $langs->trans("SeeAll");
$morehtmlright.= '</a>';
// List of actions on element // List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db); $formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'order', $socid, 1); $somethingshown = $formactions->showactions($object, 'inventory', $socid, 1, '', $MAXEVENT, '', $morehtmlright);
print '</div></div></div>'; print '</div></div></div>';
} }

View File

@ -51,18 +51,24 @@ class Inventory extends CommonObject
/** /**
* @var string String with name of icon for inventory * @var string String with name of icon for inventory
*/ */
public $picto = 'inventory'; public $picto = 'stock';
/** /**
* 'type' if the field format, 'label' the translation key, 'enabled' is a condition when the filed must be managed, * 'type' if the field format.
* 'visible' says if field is visible in list (-1 means not shown by default but can be aded into list to be viewed) * 'label' the translation key.
* 'notnull' if not null in database * 'enabled' is a condition when the field must be managed.
* 'index' if we want an index in database * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing)
* 'position' is the sort order of field * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button * 'index' if we want an index in database.
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
* 'comment' is not used. You can store here any text of your choice. * 'position' is the sort order of field.
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
* 'help' is a string visible as a tooltip on field
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
* 'default' is a default value for creation (can still be replaced by the global setup of default values)
* 'showoncombobox' if field must be shown into the label of combobox
*/ */
// BEGIN MODULEBUILDER PROPERTIES // BEGIN MODULEBUILDER PROPERTIES
@ -74,16 +80,21 @@ class Inventory extends CommonObject
'ref' => array('type'=>'varchar(64)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Reference of object',), 'ref' => array('type'=>'varchar(64)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Reference of object',),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300'), 'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300'),
'fk_warehouse' => array('type'=>'integer', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'index'=>1,), 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'index'=>1, 'help'=>'LinkToThirparty'),
'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>1,), 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>1,),
'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'index'=>1,),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500,), 'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>502,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>501, 'notnull'=>1,), 'fk_user_valid' => array('type'=>'integer', 'label'=>'UserValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>512,),
'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-1, 'enabled'=>1, 'position'=>502,),
'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-1, 'enabled'=>1, 'position'=>510,), 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500),
'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-1, 'enabled'=>1, 'position'=>511,), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501),
'fk_user_valid' => array('type'=>'integer', 'label'=>'UserValidation', 'visible'=>-1, 'enabled'=>1, 'position'=>512,), //'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-1, 'enabled'=>1, 'position'=>1000, 'index'=>1,), 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510),
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Todo', 1=>'Done', -1=>'Cancel')),
); );
public $rowid; public $rowid;
@ -145,16 +156,130 @@ class Inventory extends CommonObject
} }
/**
* Create object into database
*
* @param User $user User that creates
* @param bool $notrigger false=launch triggers after, true=disable triggers
* @return int <0 if KO, Id of created object if OK
*/
public function create(User $user, $notrigger = false)
{
return $this->createCommon($user, $notrigger);
}
/**
* Clone and object into another one
*
* @param User $user User that creates
* @param int $fromid Id of object to clone
* @return mixed New object created, <0 if KO
*/
public function createFromClone(User $user, $fromid)
{
global $hookmanager, $langs;
$error = 0;
dol_syslog(__METHOD__, LOG_DEBUG);
$object = new self($this->db);
$this->db->begin();
// Load source object
$object->fetchCommon($fromid);
// Reset some properties
unset($object->id);
unset($object->fk_user_creat);
unset($object->import_key);
// Clear fields
$object->ref = "copy_of_".$object->ref;
$object->title = $langs->trans("CopyOf")." ".$object->title;
// ...
// Create clone
$object->context['createfromclone'] = 'createfromclone';
$result = $object->createCommon($user);
if ($result < 0) {
$error++;
$this->error = $object->error;
$this->errors = $object->errors;
}
// End
if (!$error) {
$this->db->commit();
return $object;
} else {
$this->db->rollback();
return -1;
}
}
/**
* Load object in memory from the database
*
* @param int $id Id object
* @param string $ref Ref
* @return int <0 if KO, 0 if not found, >0 if OK
*/
public function fetch($id, $ref = null)
{
$result = $this->fetchCommon($id, $ref);
if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines();
return $result;
}
/**
* Load object lines in memory from the database
*
* @return int <0 if KO, 0 if not found, >0 if OK
*/
/*public function fetchLines()
{
$this->lines=array();
// Load lines with object MyObjectLine
return count($this->lines)?1:0;
}*/
/**
* Update object into database
*
* @param User $user User that modifies
* @param bool $notrigger false=launch triggers after, true=disable triggers
* @return int <0 if KO, >0 if OK
*/
public function update(User $user, $notrigger = false)
{
return $this->updateCommon($user, $notrigger);
}
/**
* Delete object in database
*
* @param User $user User that deletes
* @param bool $notrigger false=launch triggers after, true=disable triggers
* @return int <0 if KO, >0 if OK
*/
public function delete(User $user, $notrigger = false)
{
return $this->deleteCommon($user, $notrigger);
}
/** /**
* Return a link to the object card (with optionaly the picto) * Return a link to the object card (with optionaly the picto)
* *
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to * @param string $option On what the link point to
* @param int $notooltip 1=Disable tooltip * @param int $notooltip 1=Disable tooltip
* @param string $morecss Add more css on link * @param string $morecss Add more css on link
* @return string String with URL * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL
*/ */
function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='') function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
{ {
global $db, $conf, $langs; global $db, $conf, $langs;
global $dolibarr_main_authentication, $dolibarr_main_demo; global $dolibarr_main_authentication, $dolibarr_main_demo;
@ -169,7 +294,7 @@ class Inventory extends CommonObject
$label.= '<br>'; $label.= '<br>';
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref; $label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
$url = $url = dol_buildpath('/inventory/m_card.php',1).'?id='.$this->id; $url = dol_buildpath('/product/inventory/card.php',1).'?id='.$this->id;
$linkclose=''; $linkclose='';
if (empty($notooltip)) if (empty($notooltip))
@ -188,12 +313,12 @@ class Inventory extends CommonObject
$linkstart.=$linkclose.'>'; $linkstart.=$linkclose.'>';
$linkend='</a>'; $linkend='</a>';
if ($withpicto) $result .= $linkstart;
{ if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
$result.=($linkstart.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend); if ($withpicto != 2) $result.= $this->ref;
if ($withpicto != 2) $result.=' '; $result .= $linkend;
} //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
$result.= $linkstart . $this->ref . $linkend;
return $result; return $result;
} }
@ -212,7 +337,7 @@ class Inventory extends CommonObject
* Return the status * Return the status
* *
* @param int $status Id status * @param int $status Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto, 6=Long label + Picto
* @return string Label of status * @return string Label of status
*/ */
static function LibStatut($status,$mode=0) static function LibStatut($status,$mode=0)
@ -222,41 +347,101 @@ class Inventory extends CommonObject
if ($mode == 0) if ($mode == 0)
{ {
$prefix=''; $prefix='';
if ($status == 0) return $langs->trans('Draft');
if ($status == 1) return $langs->trans('Enabled'); if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled'); if ($status == -1) return $langs->trans('Canceled');
} }
if ($mode == 1) if ($mode == 1)
{ {
if ($status == 0) return $langs->trans('Draft');
if ($status == 1) return $langs->trans('Enabled'); if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled'); if ($status == -1) return $langs->trans('Canceled');
} }
if ($mode == 2) if ($mode == 2)
{ {
if ($status == 0) return img_picto($langs->trans('Draft'),'statut5').' '.$langs->trans('Draft');
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); if ($status == -1) return img_picto($langs->trans('Canceled'),'statut6').' '.$langs->trans('Canceled');
} }
if ($mode == 3) if ($mode == 3)
{ {
if ($status == 0) return img_picto($langs->trans('Draft'),'statut5');
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4'); if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5'); if ($status == -1) return img_picto($langs->trans('Canceled'),'statut6');
} }
if ($mode == 4) if ($mode == 4)
{ {
if ($status == 0) return img_picto($langs->trans('Draft'),'statut5').' '.$langs->trans('Draft');
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); if ($status == -1) return img_picto($langs->trans('Canceled'),'statut6').' '.$langs->trans('Canceled');
} }
if ($mode == 5) if ($mode == 5)
{ {
if ($status == 0) return $langs->trans('Draft').' '.img_picto($langs->trans('Draft'),'statut5');
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); if ($status == -1) return $langs->trans('Canceled').' '.img_picto($langs->trans('Canceled'),'statut6');
} }
if ($mode == 6) if ($mode == 6)
{ {
if ($status == 0) return $langs->trans('Draft').' '.img_picto($langs->trans('Draft'),'statut5');
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); if ($status == -1) return $langs->trans('Canceled').' '.img_picto($langs->trans('Canceled'),'statut6');
} }
} }
/**
* Charge les informations d'ordre info dans l'objet commande
*
* @param int $id Id of order
* @return void
*/
function info($id)
{
$sql = 'SELECT rowid, date_creation as datec, tms as datem,';
$sql.= ' fk_user_creat, fk_user_modif';
$sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
$sql.= ' WHERE t.rowid = '.$id;
$result=$this->db->query($sql);
if ($result)
{
if ($this->db->num_rows($result))
{
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author)
{
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid)
{
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture)
{
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
}
$this->db->free($result);
}
else
{
dol_print_error($this->db);
}
}
/** /**
* Initialise object with example values * Initialise object with example values

View File

@ -69,7 +69,7 @@ if (! $sortorder) $sortorder="ASC";
$socid=0; $socid=0;
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
//$socid = $user->societe_id; //$socid = $user->societe_id;
accessforbidden(); accessforbidden();
} }
@ -78,14 +78,14 @@ $search_all=trim(GETPOST("search_all",'alpha'));
$search=array(); $search=array();
foreach($object->fields as $key => $val) foreach($object->fields as $key => $val)
{ {
if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha');
} }
// List of fields to search into when doing a "search in all" // List of fields to search into when doing a "search in all"
$fieldstosearchall = array(); $fieldstosearchall = array();
foreach($object->fields as $key => $val) foreach($object->fields as $key => $val)
{ {
if ($val['searchall']) $fieldstosearchall['t.'.$key]=$val['label']; if ($val['searchall']) $fieldstosearchall['t.'.$key]=$val['label'];
} }
// Definition of fields for list // Definition of fields for list
@ -93,15 +93,15 @@ $arrayfields=array();
foreach($object->fields as $key => $val) foreach($object->fields as $key => $val)
{ {
// If $val['visible']==0, then we never show the field // If $val['visible']==0, then we never show the field
if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']); if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']);
} }
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{ {
foreach($extrafields->attribute_label as $key => $val) foreach($extrafields->attribute_label as $key => $val)
{ {
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key])); if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
} }
} }
@ -117,37 +117,37 @@ if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook)) if (empty($reshook))
{ {
// Selection of new fields // Selection of new fields
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Purge search criteria // Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{ {
foreach($object->fields as $key => $val) foreach($object->fields as $key => $val)
{ {
$search[$key]=''; $search[$key]='';
} }
$toselect=''; $toselect='';
$search_array_options=array(); $search_array_options=array();
} }
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')
|| GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha'))
{ {
$massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation
} }
// Mass actions // Mass actions
$objectclass='Inventory'; $objectclass='Inventory';
$objectlabel='Inventory'; $objectlabel='Inventory';
$permtoread = $user->rights->inventory->read; $permtoread = $user->rights->stock->lire;
$permtodelete = $user->rights->inventory->delete; $permtodelete = $user->rights->stock->supprimer;
$uploaddir = $conf->inventory->dir_output; $uploaddir = $conf->stock->dir_output;
//include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; // TODO to fix for product module include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
} }
@ -172,29 +172,31 @@ $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Inventorys"));
$sql = 'SELECT '; $sql = 'SELECT ';
foreach($object->fields as $key => $val) foreach($object->fields as $key => $val)
{ {
$sql.='t.'.$key.', '; $sql.='t.'.$key.', ';
} }
// Add fields from extrafields // Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
// Add fields from hooks // Add fields from hooks
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint; $sql.=$hookmanager->resPrint;
$sql=preg_replace('/, $/','', $sql); $sql=preg_replace('/, $/','', $sql);
$sql.= " FROM ".MAIN_DB_PREFIX."inventory as t"; $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."inventory_extrafields as ef on (t.rowid = ef.fk_object)"; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."myobject_extrafields as ef on (t.rowid = ef.fk_object)";
$sql.= " WHERE t.entity IN (".getEntity('inventory').")"; if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('inventory').")";
else $sql.=" WHERE 1 = 1";
foreach($search as $key => $val) foreach($search as $key => $val)
{ {
if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'status')?2:($object->fields[$key]['type'] == 'integer'?1:0))); $mode_search=(($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))?1:0);
if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'status')?2:$mode_search));
} }
if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all); if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all);
// Add where from extra fields // Add where from extra fields
foreach ($search_array_options as $key => $val) foreach ($search_array_options as $key => $val)
{ {
$crit=$val; $crit=$val;
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode_search=0; $mode_search=0;
if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric
if (in_array($typ, array('sellist','link')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int if (in_array($typ, array('sellist','link')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int
@ -205,8 +207,23 @@ foreach ($search_array_options as $key => $val)
} }
// Add where from hooks // Add where from hooks
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint; $sql.=$hookmanager->resPrint;
/* If a group by is required
$sql.= " GROUP BY "
foreach($object->fields as $key => $val)
{
$sql.='t.'.$key.', ';
}
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
*/
$sql.=$db->order($sortfield,$sortorder); $sql.=$db->order($sortfield,$sortorder);
// Count total nb of records // Count total nb of records
@ -219,12 +236,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql.= $db->plimit($limit+1, $offset); $sql.= $db->plimit($limit+1, $offset);
dol_syslog($script_file, LOG_DEBUG);
$resql=$db->query($sql); $resql=$db->query($sql);
if (! $resql) if (! $resql)
{ {
dol_print_error($db); dol_print_error($db);
exit; exit;
} }
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
@ -232,10 +248,10 @@ $num = $db->num_rows($resql);
// Direct jump if only one record found // Direct jump if only one record found
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$id = $obj->rowid; $id = $obj->rowid;
header("Location: ".DOL_URL_ROOT.'/inventory/card.php?id='.$id); header("Location: ".DOL_URL_ROOT.'/inventory/card.php?id='.$id);
exit; exit;
} }
@ -262,26 +278,26 @@ jQuery(document).ready(function() {
$arrayofselected=is_array($toselect)?$toselect:array(); $arrayofselected=is_array($toselect)?$toselect:array();
$param=''; $param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
foreach($search as $key => $val) foreach($search as $key => $val)
{ {
$param.= '&search_'.$key.'='.urlencode($search[$key]); $param.= '&search_'.$key.'='.urlencode($search[$key]);
} }
if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
// Add $param from extra fields // Add $param from extra fields
foreach ($search_array_options as $key => $val) foreach ($search_array_options as $key => $val)
{ {
$crit=$val; $crit=$val;
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
} }
$arrayofmassactions = array( $arrayofmassactions = array(
'presend'=>$langs->trans("SendByMail"), 'presend'=>$langs->trans("SendByMail"),
'builddoc'=>$langs->trans("PDFMerge"), 'builddoc'=>$langs->trans("PDFMerge"),
); );
if ($user->rights->inventory->delete) $arrayofmassactions['predelete']=$langs->trans("Delete"); if ($user->rights->stock->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions); $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
@ -295,8 +311,9 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
// Add code for pre mass action (confirmation or email presend form)
$topicmail="Information"; $topicmail="Information";
$modelmail="inventory"; $modelmail="inventory";
$objecttmp=new Inventory($db); $objecttmp=new Inventory($db);
@ -305,17 +322,17 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall) if ($sall)
{ {
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
} }
$moreforfilter = ''; $moreforfilter = '';
$moreforfilter.='<div class="divsearchfield">'; /*$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">'; $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
$moreforfilter.= '</div>'; $moreforfilter.= '</div>';*/
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
else $moreforfilter = $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint;
@ -323,14 +340,14 @@ if (! empty($moreforfilter))
{ {
print '<div class="liste_titre liste_titre_bydiv centpercent">'; print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter; print $moreforfilter;
print '</div>'; print '</div>';
} }
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$selectedfields.=$form->showCheckAddButtons('checkforselect', 1); $selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n"; print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
@ -339,37 +356,38 @@ print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"")
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
foreach($object->fields as $key => $val) foreach($object->fields as $key => $val)
{ {
$align=''; $align='';
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; if (in_array($val['type'], array('date','datetime','timestamp'))) $align=($align?' ':'').'center';
if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>'; if ($key == 'status') $align.=($align?' ':'').'center';
if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>';
} }
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{ {
foreach($extrafields->attribute_label as $key => $val) foreach($extrafields->attribute_label as $key => $val)
{ {
if (! empty($arrayfields["ef.".$key]['checked'])) if (! empty($arrayfields["ef.".$key]['checked']))
{ {
$align=$extrafields->getAlignFlag($key); $align=$extrafields->getAlignFlag($key);
$typeofextrafield=$extrafields->attribute_type[$key]; $typeofextrafield=$extrafields->attribute_type[$key];
print '<td class="liste_titre'.($align?' '.$align:'').'">'; print '<td class="liste_titre'.($align?' '.$align:'').'">';
if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key])) if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key]))
{ {
$crit=$val; $crit=$val;
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$searchclass=''; $searchclass='';
if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring';
if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">'; print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">';
} }
print '</td>'; print '</td>';
} }
} }
} }
// Fields from hook // Fields from hook
$parameters=array('arrayfields'=>$arrayfields); $parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Action column // Action column
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
@ -384,28 +402,29 @@ print '</tr>'."\n";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
foreach($object->fields as $key => $val) foreach($object->fields as $key => $val)
{ {
$align=''; $align='';
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; if (in_array($val['type'], array('date','datetime','timestamp'))) $align=($align?' ':'').'center';
if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; if ($key == 'status') $align.=($align?' ':'').'center';
if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n";
} }
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{ {
foreach($extrafields->attribute_label as $key => $val) foreach($extrafields->attribute_label as $key => $val)
{ {
if (! empty($arrayfields["ef.".$key]['checked'])) if (! empty($arrayfields["ef.".$key]['checked']))
{ {
$align=$extrafields->getAlignFlag($key); $align=$extrafields->getAlignFlag($key);
$sortonfield = "ef.".$key; $sortonfield = "ef.".$key;
if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; if (! empty($extrafields->attribute_computed[$key])) $sortonfield='';
print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n"; print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n";
} }
} }
} }
// Hook fields // Hook fields
$parameters=array('arrayfields'=>$arrayfields); $parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n"; print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
print '</tr>'."\n"; print '</tr>'."\n";
@ -415,7 +434,7 @@ print '</tr>'."\n";
$needToFetchEachLine=0; $needToFetchEachLine=0;
foreach ($extrafields->attribute_computed as $key => $val) foreach ($extrafields->attribute_computed as $key => $val)
{ {
if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object
} }
@ -425,118 +444,117 @@ $i=0;
$totalarray=array(); $totalarray=array();
while ($i < min($num, $limit)) while ($i < min($num, $limit))
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
if ($obj) if (empty($obj)) break; // Should not happen
{
// Store properties in $object
$object->id = $obj->rowid;
foreach($object->fields as $key => $val)
{
if (isset($obj->$key)) $object->$key = $obj->$key;
}
// Show here line of result // Store properties in $object
print '<tr class="oddeven">'; $object->id = $obj->rowid;
foreach($object->fields as $key => $val) foreach($object->fields as $key => $val)
{ {
$align=''; if (isset($obj->$key)) $object->$key = $obj->$key;
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; }
if (in_array($val['type'], array('timestamp'))) $align.='nowrap';
if ($key == 'status') $align.=($align?' ':'').'center'; // Show here line of result
if (! empty($arrayfields['t.'.$key]['checked'])) print '<tr class="oddeven">';
{ foreach($object->fields as $key => $val)
print '<td'.($align?' class="'.$align.'"':'').'>'; {
if (in_array($val['type'], array('date','datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour'); $align='';
elseif ($key == 'ref') print $object->getNomUrl(1); if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
elseif ($key == 'status') print $object->getLibStatut(3); if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
else print $obj->$key; if ($key == 'status') $align.=($align?' ':'').'center';
print '</td>'; if (! empty($arrayfields['t.'.$key]['checked']))
if (! $i) $totalarray['nbfield']++;
if (! empty($val['isameasure']))
{
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key;
$totalarray['val']['t.'.$key] += $obj->$key;
}
}
}
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{ {
foreach($extrafields->attribute_label as $key => $val) print '<td';
{ if ($align) print ' class="'.$align.'"';
if (! empty($arrayfields["ef.".$key]['checked'])) print '>';
{ print $object->showOutputField($val, $key, $obj->$key, '');
print '<td'; print '</td>';
$align=$extrafields->getAlignFlag($key); if (! $i) $totalarray['nbfield']++;
if ($align) print ' align="'.$align.'"'; if (! empty($val['isameasure']))
print '>'; {
$tmpkey='options_'.$key; if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key;
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); $totalarray['val']['t.'.$key] += $obj->$key;
print '</td>'; }
if (! $i) $totalarray['nbfield']++;
if (! empty($val['isameasure']))
{
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey;
$totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey;
}
}
}
} }
// Fields from hook }
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); // Extra fields
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
print $hookmanager->resPrint; {
// Action column foreach($extrafields->attribute_label as $key => $val)
print '<td class="nowrap" align="center">'; {
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined if (! empty($arrayfields["ef.".$key]['checked']))
{ {
$selected=0; $align=$extrafields->getAlignFlag($key);
if (in_array($obj->rowid, $arrayofselected)) $selected=1; print '<td';
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>'; if ($align) print ' align="'.$align.'"';
} print '>';
print '</td>'; $tmpkey='options_'.$key;
if (! $i) $totalarray['nbfield']++; print $extrafields->showOutputField($key, $obj->$tmpkey, '');
print '</td>';
if (! $i) $totalarray['nbfield']++;
if (! empty($val['isameasure']))
{
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey;
$totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey;
}
}
}
}
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
print '<td class="nowrap" align="center">';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{
$selected=0;
if (in_array($obj->rowid, $arrayofselected)) $selected=1;
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
print '</tr>'; print '</tr>';
}
$i++; $i++;
} }
// Show total line // Show total line
if (isset($totalarray['pos'])) if (isset($totalarray['pos']))
{ {
print '<tr class="liste_total">'; print '<tr class="liste_total">';
$i=0; $i=0;
while ($i < $totalarray['nbfield']) while ($i < $totalarray['nbfield'])
{ {
$i++; $i++;
if (! empty($totalarray['pos'][$i])) print '<td align="right">'.price($totalarray['val'][$totalarray['pos'][$i]]).'</td>'; if (! empty($totalarray['pos'][$i])) print '<td align="right">'.price($totalarray['val'][$totalarray['pos'][$i]]).'</td>';
else else
{ {
if ($i == 1) if ($i == 1)
{ {
if ($num < $limit) print '<td align="left">'.$langs->trans("Total").'</td>'; if ($num < $limit) print '<td align="left">'.$langs->trans("Total").'</td>';
else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>'; else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
} }
print '<td></td>'; else print '<td></td>';
} }
} }
print '</tr>'; print '</tr>';
} }
// If no record found // If no record found
if ($num == 0) if ($num == 0)
{ {
$colspan=1; $colspan=1;
foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; } foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>'; print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
} }
$db->free($resql); $db->free($resql);
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
print '</table>'."\n"; print '</table>'."\n";
@ -544,27 +562,27 @@ print '</div>'."\n";
print '</form>'."\n"; print '</form>'."\n";
if ($nbtotalofrecords === '' || $nbtotalofrecords) if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords))
{ {
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
{ {
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php');
$formfile = new FormFile($db); $formfile = new FormFile($db);
// Show list of available documents // Show list of available documents
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
$urlsource.=str_replace('&amp;','&',$param); $urlsource.=str_replace('&amp;','&',$param);
$filedir=$diroutputmassaction; $filedir=$diroutputmassaction;
$genallowed=$user->rights->inventory->read; $genallowed=$user->rights->mymodule->read;
$delallowed=$user->rights->inventory->create; $delallowed=$user->rights->mymodule->create;
print $formfile->showdocuments('massfilesarea_inventory','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); print $formfile->showdocuments('massfilesarea_mymodule','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
} }
else else
{ {
print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>'; print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>';
} }
} }
// End of page // End of page

View File

@ -114,7 +114,7 @@ $sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price
$sql.= ' p.fk_product_type, p.tms as datem,'; $sql.= ' p.fk_product_type, p.tms as datem,';
$sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p.stock, p.tobatch,'; $sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p.stock, p.tobatch,';
$sql.= ' ps.fk_entrepot,'; $sql.= ' ps.fk_entrepot,';
$sql.= ' e.label as warehouse_ref, e.lieu as warehouse_lieu, e.fk_parent as warehouse_parent,'; $sql.= ' e.ref as warehouse_ref, e.lieu as warehouse_lieu, e.fk_parent as warehouse_parent,';
$sql.= ' pb.batch, pb.eatby as oldeatby, pb.sellby as oldsellby,'; $sql.= ' pb.batch, pb.eatby as oldeatby, pb.sellby as oldsellby,';
$sql.= ' pl.rowid as lotid, pl.eatby, pl.sellby,'; $sql.= ' pl.rowid as lotid, pl.eatby, pl.sellby,';
$sql.= ' SUM(pb.qty) as stock_physique, COUNT(pb.rowid) as nbinbatchtable'; $sql.= ' SUM(pb.qty) as stock_physique, COUNT(pb.rowid) as nbinbatchtable';
@ -150,13 +150,13 @@ if($catid) $sql.= " AND cp.fk_categorie = ".$catid;
if ($fourn_id > 0) $sql.= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".$fourn_id; if ($fourn_id > 0) $sql.= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".$fourn_id;
// Insert categ filter // Insert categ filter
if ($search_categ) $sql .= " AND cp.fk_categorie = ".$db->escape($search_categ); if ($search_categ) $sql .= " AND cp.fk_categorie = ".$db->escape($search_categ);
if ($search_warehouse) $sql .= natural_search("e.label", $search_warehouse); if ($search_warehouse) $sql .= natural_search("e.ref", $search_warehouse);
if ($search_batch) $sql .= natural_search("pb.batch", $search_batch); if ($search_batch) $sql .= natural_search("pb.batch", $search_batch);
$sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,"; $sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,";
$sql.= " p.fk_product_type, p.tms,"; $sql.= " p.fk_product_type, p.tms,";
$sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p.stock, p.tobatch,"; $sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p.stock, p.tobatch,";
$sql.= " ps.fk_entrepot,"; $sql.= " ps.fk_entrepot,";
$sql.= " e.label, e.lieu, e.fk_parent,"; $sql.= " e.ref, e.lieu, e.fk_parent,";
$sql.= " pb.batch, pb.eatby, pb.sellby,"; $sql.= " pb.batch, pb.eatby, pb.sellby,";
$sql.= " pl.rowid, pl.eatby, pl.sellby"; $sql.= " pl.rowid, pl.eatby, pl.sellby";
if ($toolowstock) $sql.= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet if ($toolowstock) $sql.= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet
@ -292,7 +292,7 @@ if ($resql)
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder); print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder);
if (! empty($conf->service->enabled) && $type == 1) print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder); if (! empty($conf->service->enabled) && $type == 1) print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre("Warehouse", $_SERVER["PHP_SELF"], "e.label",$param,"",'',$sortfield,$sortorder); print_liste_field_titre("Warehouse", $_SERVER["PHP_SELF"], "e.ref",$param,"",'',$sortfield,$sortorder);
//print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'align="right"',$sortfield,$sortorder); //print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre("Batch", $_SERVER["PHP_SELF"], "pb.batch",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre("Batch", $_SERVER["PHP_SELF"], "pb.batch",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby",$param,"",'align="center"',$sortfield,$sortorder);

View File

@ -275,7 +275,7 @@ else
{ {
$head = stock_prepare_head($object); $head = stock_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("Warehouse"), 0, 'stock'); dol_fiche_head($head, 'card', $langs->trans("Warehouse"), -1, 'stock');
$formconfirm = ''; $formconfirm = '';

View File

@ -98,6 +98,8 @@ class Entrepot extends CommonObject
{ {
global $conf; global $conf;
$error = 0;
$this->libelle = trim($this->libelle); $this->libelle = trim($this->libelle);
// Si libelle non defini, erreur // Si libelle non defini, erreur
@ -111,8 +113,8 @@ class Entrepot extends CommonObject
$this->db->begin(); $this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (entity, datec, fk_user_author, label, fk_parent)"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (ref, entity, datec, fk_user_author, fk_parent)";
$sql .= " VALUES (".$conf->entity.",'".$this->db->idate($now)."',".$user->id.",'".$this->db->escape($this->libelle)."', ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")"; $sql .= " VALUES ('".$this->db->escape($this->libelle)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")";
dol_syslog(get_class($this)."::create", LOG_DEBUG); dol_syslog(get_class($this)."::create", LOG_DEBUG);
$result=$this->db->query($sql); $result=$this->db->query($sql);
@ -123,7 +125,16 @@ class Entrepot extends CommonObject
{ {
$this->id = $id; $this->id = $id;
if ($this->update($id, $user) > 0) if (! $error)
{
$result = $this->update($id, $user);
if ($result <= 0)
{
$error++;
}
}
if (! $error)
{ {
$this->db->commit(); $this->db->commit();
return $id; return $id;
@ -185,7 +196,7 @@ class Entrepot extends CommonObject
$this->country_id=($this->country_id > 0 ? $this->country_id : 0); $this->country_id=($this->country_id > 0 ? $this->country_id : 0);
$sql = "UPDATE ".MAIN_DB_PREFIX."entrepot "; $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot ";
$sql .= " SET label = '" . $this->db->escape($this->libelle) ."'"; $sql .= " SET ref = '" . $this->db->escape($this->libelle) ."'";
$sql .= ", fk_parent = " . (($this->fk_parent > 0) ? $this->fk_parent : "NULL"); $sql .= ", fk_parent = " . (($this->fk_parent > 0) ? $this->fk_parent : "NULL");
$sql .= ", description = '" . $this->db->escape($this->description) ."'"; $sql .= ", description = '" . $this->db->escape($this->description) ."'";
$sql .= ", statut = " . $this->statut; $sql .= ", statut = " . $this->statut;
@ -297,7 +308,7 @@ class Entrepot extends CommonObject
{ {
global $conf; global $conf;
$sql = "SELECT rowid, fk_parent, label, description, statut, lieu, address, zip, town, fk_pays as country_id"; $sql = "SELECT rowid, fk_parent, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id";
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot"; $sql .= " FROM ".MAIN_DB_PREFIX."entrepot";
if ($id) if ($id)
{ {
@ -306,7 +317,7 @@ class Entrepot extends CommonObject
else else
{ {
$sql.= " WHERE entity = " .$conf->entity; $sql.= " WHERE entity = " .$conf->entity;
if ($ref) $sql.= " AND label = '".$this->db->escape($ref)."'"; if ($ref) $sql.= " AND ref = '".$this->db->escape($ref)."'";
} }
dol_syslog(get_class($this)."::fetch", LOG_DEBUG); dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
@ -319,8 +330,8 @@ class Entrepot extends CommonObject
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->fk_parent = $obj->fk_parent; $this->fk_parent = $obj->fk_parent;
$this->ref = $obj->rowid; $this->ref = $obj->label;
$this->label = $obj->label; $this->label = $obj->label; // deprecated
$this->libelle = $obj->label; // deprecated $this->libelle = $obj->label; // deprecated
$this->description = $obj->description; $this->description = $obj->description;
$this->statut = $obj->statut; $this->statut = $obj->statut;
@ -409,7 +420,7 @@ class Entrepot extends CommonObject
{ {
$liste = array(); $liste = array();
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, ref as label";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot";
$sql.= " WHERE entity IN (".getEntity('stock').")"; $sql.= " WHERE entity IN (".getEntity('stock').")";
$sql.= " AND statut = ".$status; $sql.= " AND statut = ".$status;
@ -574,7 +585,7 @@ class Entrepot extends CommonObject
$label = ''; $label = '';
$label = '<u>' . $langs->trans("ShowWarehouse").'</u>'; $label = '<u>' . $langs->trans("ShowWarehouse").'</u>';
$label.= '<br><b>' . $langs->trans('Ref') . ':</b> ' . (empty($this->label)?$this->libelle:$this->label); $label.= '<br><b>' . $langs->trans('Ref') . ':</b> ' . (empty($this->ref)?(empty($this->label)?$this->libelle:$this->label):$this->ref);
if (! empty($this->lieu)) if (! empty($this->lieu))
$label.= '<br><b>' . $langs->trans('LocationSummary').':</b> '.$this->lieu; $label.= '<br><b>' . $langs->trans('LocationSummary').':</b> '.$this->lieu;

View File

@ -25,6 +25,7 @@
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load("stocks"); $langs->load("stocks");
$langs->load("productbatch"); $langs->load("productbatch");
@ -37,6 +38,8 @@ $result=restrictedArea($user,'stock');
* View * View
*/ */
$producttmp=new Product($db);
$help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks'; $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
llxHeader("",$langs->trans("Stocks"),$help_url); llxHeader("",$langs->trans("Stocks"),$help_url);
@ -61,7 +64,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
} }
$sql = "SELECT e.label, e.rowid, e.statut"; $sql = "SELECT e.ref as label, e.rowid, e.statut";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= " WHERE e.statut in (0,1)"; $sql.= " WHERE e.statut in (0,1)";
$sql.= " AND e.entity IN (".getEntity('stock').")"; $sql.= " AND e.entity IN (".getEntity('stock').")";
@ -111,8 +114,8 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
// Last movements // Last movements
$max=10; $max=10;
$sql = "SELECT p.rowid, p.label as produit,"; $sql = "SELECT p.rowid, p.label as produit, p.tobatch, p.tosell, p.tobuy,";
$sql.= " e.label as stock, e.rowid as entrepot_id,"; $sql.= " e.ref as stock, e.rowid as entrepot_id,";
$sql.= " m.value as qty, m.datem, m.batch, m.eatby, m.sellby"; $sql.= " m.value as qty, m.datem, m.batch, m.eatby, m.sellby";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= ", ".MAIN_DB_PREFIX."stock_mouvement as m"; $sql.= ", ".MAIN_DB_PREFIX."stock_mouvement as m";
@ -144,7 +147,6 @@ if ($resql)
print '<th align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/product/stock/mouvement.php">'.$langs->trans("FullList").'</a></th>'; print '<th align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/product/stock/mouvement.php">'.$langs->trans("FullList").'</a></th>';
print "</tr>\n"; print "</tr>\n";
$var=True;
$i=0; $i=0;
while ($i < min($num,$max)) while ($i < min($num,$max))
{ {
@ -152,9 +154,14 @@ if ($resql)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.dol_print_date($db->jdate($objp->datem),'dayhour').'</td>'; print '<td>'.dol_print_date($db->jdate($objp->datem),'dayhour').'</td>';
print "<td><a href=\"../card.php?id=$objp->rowid\">"; print "<td>";
print img_object($langs->trans("ShowProduct"),"product").' '.$objp->produit; $producttmp->id = $objp->rowid;
print "</a></td>\n"; $producttmp->ref = $objp->produit;
$producttmp->status_batch = $objp->tobatch;
$producttmp->status_sell = $objp->tosell;
$producttmp->status_buy = $objp->tobuy;
print $producttmp->getNomUrl(1);
print "</td>\n";
if (! empty($conf->productbatch->enabled)) if (! empty($conf->productbatch->enabled))
{ {
print '<td>'.$objp->batch.'</td>'; print '<td>'.$objp->batch.'</td>';

View File

@ -40,7 +40,7 @@ $search_status=GETPOST("search_status","int");
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield"); $sortfield = GETPOST("sortfield");
$sortorder = GETPOST("sortorder"); $sortorder = GETPOST("sortorder");
if (! $sortfield) $sortfield="e.label"; if (! $sortfield) $sortfield="e.ref";
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
$page = GETPOST("page"); $page = GETPOST("page");
if ($page < 0) $page = 0; if ($page < 0) $page = 0;
@ -50,7 +50,7 @@ $year = strftime("%Y",time());
// List of fields to search into when doing a "search in all" // List of fields to search into when doing a "search in all"
$fieldstosearchall = array( $fieldstosearchall = array(
'e.label'=>"Ref", 'e.ref'=>"Ref",
'e.lieu'=>"LocationSummary", 'e.lieu'=>"LocationSummary",
'e.description'=>"Description", 'e.description'=>"Description",
'e.address'=>"Address", 'e.address'=>"Address",
@ -82,17 +82,17 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
$form=new Form($db); $form=new Form($db);
$warehouse=new Entrepot($db); $warehouse=new Entrepot($db);
$sql = "SELECT e.rowid, e.label as ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent,"; $sql = "SELECT e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent,";
$sql.= " SUM(p.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue, SUM(ps.reel) as stockqty"; $sql.= " SUM(p.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue, SUM(ps.reel) as stockqty";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid";
$sql.= " WHERE e.entity IN (".getEntity('stock').")"; $sql.= " WHERE e.entity IN (".getEntity('stock').")";
if ($search_ref) $sql.= natural_search("e.label", $search_ref); // ref if ($search_ref) $sql.= natural_search("e.ref", $search_ref); // ref
if ($search_label) $sql.= natural_search("e.lieu", $search_label); // label if ($search_label) $sql.= natural_search("e.lieu", $search_label); // label
if ($search_status != '' && $search_status >= 0) $sql.= " AND e.statut = ".$search_status; if ($search_status != '' && $search_status >= 0) $sql.= " AND e.statut = ".$search_status;
if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
$sql.= " GROUP BY e.rowid, e.label, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent"; $sql.= " GROUP BY e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent";
$totalnboflines=0; $totalnboflines=0;
$result=$db->query($sql); $result=$db->query($sql);
if ($result) if ($result)
@ -125,10 +125,10 @@ if ($result)
$param=''; $param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_ref) $param.="&search_ref=".$search_ref; if ($search_ref) $param.="&search_ref=".urlencode($search_ref);
if ($search_label) $param.="&search_label=".$search_label; if ($search_label) $param.="&search_label=".urlencode($search_label);
if ($search_status) $param.="&search_status=".$search_status; if ($search_status) $param.="&search_status=".urlencode($search_status);
if ($sall) $param.="&sall=".$sall; if ($sall) $param.="&sall=".urlencode($sall);
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -176,7 +176,7 @@ if ($result)
print '</tr>'; print '</tr>';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"], "e.label","",$param,"",$sortfield,$sortorder); print_liste_field_titre("Ref",$_SERVER["PHP_SELF"], "e.ref","",$param,"",$sortfield,$sortorder);
print_liste_field_titre("LocationSummary",$_SERVER["PHP_SELF"], "e.lieu","",$param,"",$sortfield,$sortorder); print_liste_field_titre("LocationSummary",$_SERVER["PHP_SELF"], "e.lieu","",$param,"",$sortfield,$sortorder);
print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stockqty",'',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stockqty",'',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("EstimatedStockValue", $_SERVER["PHP_SELF"], "estimatedvalue",'',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("EstimatedStockValue", $_SERVER["PHP_SELF"], "estimatedvalue",'',$param,'align="right"',$sortfield,$sortorder);
@ -194,7 +194,8 @@ if ($result)
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$warehouse->id = $objp->rowid; $warehouse->id = $objp->rowid;
$warehouse->label = $objp->ref; $warehouse->ref = $objp->ref;
$warehouse->label = $objp->ref;
$warehouse->lieu = $objp->lieu; $warehouse->lieu = $objp->lieu;
$warehouse->fk_parent = $objp->fk_parent; $warehouse->fk_parent = $objp->fk_parent;

View File

@ -95,7 +95,7 @@ $arrayfields=array(
'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(! empty($conf->productbatch->enabled))), 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(! empty($conf->productbatch->enabled))),
'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'enabled'=>(! empty($conf->productbatch->enabled))), 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'enabled'=>(! empty($conf->productbatch->enabled))),
'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(! empty($conf->productbatch->enabled))), 'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(! empty($conf->productbatch->enabled))),
'e.label'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(! $id > 0)), // If we are on specific warehouse, we hide it 'e.ref'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(! $id > 0)), // If we are on specific warehouse, we hide it
'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0), 'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0),
'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1), 'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1),
'm.label'=>array('label'=>$langs->trans("LabelMovement"), 'checked'=>1), 'm.label'=>array('label'=>$langs->trans("LabelMovement"), 'checked'=>1),
@ -414,7 +414,7 @@ $formproduct=new FormProduct($db);
if (!empty($conf->projet->enabled)) $formproject=new FormProjets($db); if (!empty($conf->projet->enabled)) $formproject=new FormProjets($db);
$sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.fk_product_type as type, p.entity,"; $sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.fk_product_type as type, p.entity,";
$sql.= " e.label as stock, e.rowid as entrepot_id, e.lieu,"; $sql.= " e.ref as stock, e.rowid as entrepot_id, e.lieu,";
$sql.= " m.rowid as mid, m.value as qty, m.datem, m.fk_user_author, m.label, m.inventorycode, m.fk_origin, m.origintype,"; $sql.= " m.rowid as mid, m.value as qty, m.datem, m.fk_user_author, m.label, m.inventorycode, m.fk_origin, m.origintype,";
$sql.= " m.batch,"; $sql.= " m.batch,";
$sql.= " pl.rowid as lotid, pl.eatby, pl.sellby,"; $sql.= " pl.rowid as lotid, pl.eatby, pl.sellby,";
@ -529,7 +529,7 @@ if ($resql)
{ {
$head = stock_prepare_head($object); $head = stock_prepare_head($object);
dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), 0, 'stock'); dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), -1, 'stock');
$linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php">'.$langs->trans("BackToList").'</a>';
@ -783,7 +783,7 @@ if ($resql)
print '</td>'; print '</td>';
} }
// Warehouse // Warehouse
if (! empty($arrayfields['e.label']['checked'])) if (! empty($arrayfields['e.ref']['checked']))
{ {
print '<td class="liste_titre maxwidthonsmartphone" align="left">'; print '<td class="liste_titre maxwidthonsmartphone" align="left">';
//print '<input class="flat" type="text" size="8" name="search_warehouse" value="'.($search_warehouse).'">'; //print '<input class="flat" type="text" size="8" name="search_warehouse" value="'.($search_warehouse).'">';
@ -879,7 +879,7 @@ if ($resql)
if (! empty($arrayfields['m.batch']['checked'])) print_liste_field_titre($arrayfields['m.batch']['label'],$_SERVER["PHP_SELF"],'m.batch','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['m.batch']['checked'])) print_liste_field_titre($arrayfields['m.batch']['label'],$_SERVER["PHP_SELF"],'m.batch','',$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['pl.eatby']['checked'])) print_liste_field_titre($arrayfields['pl.eatby']['label'],$_SERVER["PHP_SELF"],'pl.eatby','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['pl.eatby']['checked'])) print_liste_field_titre($arrayfields['pl.eatby']['label'],$_SERVER["PHP_SELF"],'pl.eatby','',$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['pl.sellby']['checked'])) print_liste_field_titre($arrayfields['pl.sellby']['label'],$_SERVER["PHP_SELF"],'pl.sellby','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['pl.sellby']['checked'])) print_liste_field_titre($arrayfields['pl.sellby']['label'],$_SERVER["PHP_SELF"],'pl.sellby','',$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['e.label']['checked'])) print_liste_field_titre($arrayfields['e.label']['label'],$_SERVER["PHP_SELF"], "e.label","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible if (! empty($arrayfields['e.ref']['checked'])) print_liste_field_titre($arrayfields['e.ref']['label'],$_SERVER["PHP_SELF"], "e.ref","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible
if (! empty($arrayfields['m.fk_user_author']['checked'])) print_liste_field_titre($arrayfields['m.fk_user_author']['label'],$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['m.fk_user_author']['checked'])) print_liste_field_titre($arrayfields['m.fk_user_author']['label'],$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder);
if (! empty($arrayfields['m.inventorycode']['checked'])) print_liste_field_titre($arrayfields['m.inventorycode']['label'],$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['m.inventorycode']['checked'])) print_liste_field_titre($arrayfields['m.inventorycode']['label'],$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder);
if (! empty($arrayfields['m.label']['checked'])) print_liste_field_titre($arrayfields['m.label']['label'],$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['m.label']['checked'])) print_liste_field_titre($arrayfields['m.label']['label'],$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder);
@ -982,7 +982,7 @@ if ($resql)
print '<td align="center">'. dol_print_date($objp->sellby,'day') .'</td>'; print '<td align="center">'. dol_print_date($objp->sellby,'day') .'</td>';
} }
// Warehouse // Warehouse
if (! empty($arrayfields['e.label']['checked'])) if (! empty($arrayfields['e.ref']['checked']))
{ {
print '<td>'; print '<td>';
print $warehousestatic->getNomUrl(1); print $warehousestatic->getNomUrl(1);

View File

@ -813,7 +813,7 @@ if ((! empty($conf->productbatch->enabled)) && $object->hasbatch())
print '</tr>'; print '</tr>';
} }
$sql = "SELECT e.rowid, e.label, e.lieu, ps.reel, ps.rowid as product_stock_id, p.pmp"; $sql = "SELECT e.rowid, e.ref as label, e.lieu, ps.reel, ps.rowid as product_stock_id, p.pmp";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,";
$sql.= " ".MAIN_DB_PREFIX."product_stock as ps"; $sql.= " ".MAIN_DB_PREFIX."product_stock as ps";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = ps.fk_product"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = ps.fk_product";
@ -821,7 +821,7 @@ $sql.= " WHERE ps.reel != 0";
$sql.= " AND ps.fk_entrepot = e.rowid"; $sql.= " AND ps.fk_entrepot = e.rowid";
$sql.= " AND e.entity IN (".getEntity('stock').")"; $sql.= " AND e.entity IN (".getEntity('stock').")";
$sql.= " AND ps.fk_product = ".$object->id; $sql.= " AND ps.fk_product = ".$object->id;
$sql.= " ORDER BY e.label"; $sql.= " ORDER BY e.ref";
$entrepotstatic=new Entrepot($db); $entrepotstatic=new Entrepot($db);
$product_lot_static=new Productlot($db); $product_lot_static=new Productlot($db);

View File

@ -263,7 +263,7 @@ $formproduct = new FormProduct($db);
$title = $langs->trans('Status'); $title = $langs->trans('Status');
if(!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
$sqldesiredtock=$db->ifsql("pse.desiredstock IS NULL", "p.desiredstock", "pse.desiredstock"); $sqldesiredtock=$db->ifsql("pse.desiredstock IS NULL", "p.desiredstock", "pse.desiredstock");
$sqlalertstock=$db->ifsql("pse.seuil_stock_alerte IS NULL", "p.seuil_stock_alerte", "pse.seuil_stock_alerte"); $sqlalertstock=$db->ifsql("pse.seuil_stock_alerte IS NULL", "p.seuil_stock_alerte", "pse.seuil_stock_alerte");
} else { } else {
@ -427,9 +427,12 @@ print '<input type="hidden" name="snom" value="'.$snom.'">';
print '<input type="hidden" name="salert" value="'.$salert.'">'; print '<input type="hidden" name="salert" value="'.$salert.'">';
print '<input type="hidden" name="draftorder" value="'.$draftorder.'">'; print '<input type="hidden" name="draftorder" value="'.$draftorder.'">';
print '<input type="hidden" name="mode" value="'.$mode.'">'; print '<input type="hidden" name="mode" value="'.$mode.'">';
print '<div class="inline-block valignmiddle" style="padding-right: 20px;">'; if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE))
print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1); {
print '</div>'; print '<div class="inline-block valignmiddle" style="padding-right: 20px;">';
print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1);
print '</div>';
}
print '<div class="inline-block valignmiddle" style="padding-right: 20px;">'; print '<div class="inline-block valignmiddle" style="padding-right: 20px;">';
print $langs->trans('Supplier').' '.$form->select_company($fk_supplier, 'fk_supplier', 'fournisseur=1', 1); print $langs->trans('Supplier').' '.$form->select_company($fk_supplier, 'fk_supplier', 'fournisseur=1', 1);
print '</div>'; print '</div>';

View File

@ -37,7 +37,7 @@ $sall=GETPOST('sall', 'alphanohtml');
$sortfield = GETPOST("sortfield"); $sortfield = GETPOST("sortfield");
$sortorder = GETPOST("sortorder"); $sortorder = GETPOST("sortorder");
if (! $sortfield) $sortfield="e.label"; if (! $sortfield) $sortfield="e.ref";
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
$page = $_GET["page"]; $page = $_GET["page"];
if ($page < 0) $page = 0; if ($page < 0) $page = 0;
@ -51,25 +51,22 @@ $year = strftime("%Y",time());
* View * View
*/ */
$sql = "SELECT e.rowid, e.label as ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays,"; $sql = "SELECT e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays,";
$sql.= " SUM(ps.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue"; $sql.= " SUM(ps.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid";
$sql.= " WHERE e.entity IN (".getEntity('stock').")"; $sql.= " WHERE e.entity IN (".getEntity('stock').")";
if ($sref) if ($sref) $sql.= natural_search("e.ref", $sref);
{
$sql.= " AND e.label LIKE '%".$db->escape($sref)."%'";
}
if ($sall) if ($sall)
{ {
$sql.= " AND (e.label LIKE '%".$db->escape($sall)."%'"; $sql.= " AND (e.ref LIKE '%".$db->escape($sall)."%'";
$sql.= " OR e.description LIKE '%".$db->escape($sall)."%'"; $sql.= " OR e.description LIKE '%".$db->escape($sall)."%'";
$sql.= " OR e.lieu LIKE '%".$db->escape($sall)."%'"; $sql.= " OR e.lieu LIKE '%".$db->escape($sall)."%'";
$sql.= " OR e.address LIKE '%".$db->escape($sall)."%'"; $sql.= " OR e.address LIKE '%".$db->escape($sall)."%'";
$sql.= " OR e.town LIKE '%".$db->escape($sall)."%')"; $sql.= " OR e.town LIKE '%".$db->escape($sall)."%')";
} }
$sql.= " GROUP BY e.rowid, e.label, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays"; $sql.= " GROUP BY e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays";
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1, $offset); $sql.= $db->plimit($limit + 1, $offset);
@ -87,7 +84,7 @@ if ($result)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "e.label","","","",$sortfield,$sortorder); print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "e.ref","","","",$sortfield,$sortorder);
print_liste_field_titre("LocationSummary", $_SERVER["PHP_SELF"], "e.lieu","","","",$sortfield,$sortorder); print_liste_field_titre("LocationSummary", $_SERVER["PHP_SELF"], "e.lieu","","","",$sortfield,$sortorder);
print_liste_field_titre("EstimatedStockValue", $_SERVER["PHP_SELF"], "e.valo_pmp",'','','align="right"',$sortfield,$sortorder); print_liste_field_titre("EstimatedStockValue", $_SERVER["PHP_SELF"], "e.valo_pmp",'','','align="right"',$sortfield,$sortorder);
print_liste_field_titre("EstimatedStockValueSell", $_SERVER["PHP_SELF"], "",'','','align="right"',$sortfield,$sortorder); print_liste_field_titre("EstimatedStockValueSell", $_SERVER["PHP_SELF"], "",'','','align="right"',$sortfield,$sortorder);

View File

@ -52,7 +52,6 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("OpportunitiesStatusForOpenedProjects").'</th></tr>'."\n"; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("OpportunitiesStatusForOpenedProjects").'</th></tr>'."\n";
$var=true;
$listofstatus=array_keys($listofoppstatus); $listofstatus=array_keys($listofoppstatus);
foreach ($listofstatus as $status) foreach ($listofstatus as $status)
{ {
@ -65,7 +64,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
//$labelstatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')'; //$labelstatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')';
//$labelstatus .= ' - '.price2num($listofoppstatus[$status]).'%'; //$labelstatus .= ' - '.price2num($listofoppstatus[$status]).'%';
$dataseries[]=array('label'=>$labelstatus,'data'=>(isset($valsamount[$status])?(float) $valsamount[$status]:0)); $dataseries[]=array($labelstatus, (isset($valsamount[$status])?(float) $valsamount[$status]:0));
if (! $conf->use_javascript_ajax) if (! $conf->use_javascript_ajax)
{ {
@ -77,9 +76,19 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
} }
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print '<tr class="impair"><td align="center" colspan="2">'; print '<tr><td align="center" colspan="2">';
$data=array('series'=>$dataseries);
dol_print_graph('stats',360,180,$data,1,'pie',0,'',0,$totaloppnb?0:1); include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->SetHeight(180);
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($totaloppnb?0:1);
print '</td></tr>'; print '</td></tr>';
} }
//if ($totalinprocess != $total) //if ($totalinprocess != $total)

View File

@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php'; require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/resource.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/resource.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
// Load traductions files requiredby by page // Load traductions files requiredby by page
@ -48,6 +49,7 @@ $ref = GETPOST('ref','alpha');
$description = GETPOST('description'); $description = GETPOST('description');
$confirm = GETPOST('confirm'); $confirm = GETPOST('confirm');
$fk_code_type_resource = GETPOST('fk_code_type_resource','alpha'); $fk_code_type_resource = GETPOST('fk_code_type_resource','alpha');
$country_id = GETPOST('country_id', 'int');
// Protection if external user // Protection if external user
if ($user->socid > 0) if ($user->socid > 0)
@ -111,6 +113,7 @@ if (empty($reshook))
$object->ref = $ref; $object->ref = $ref;
$object->description = $description; $object->description = $description;
$object->fk_code_type_resource = $fk_code_type_resource; $object->fk_code_type_resource = $fk_code_type_resource;
$object->country_id = $country_id;
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
@ -157,6 +160,7 @@ if (empty($reshook))
$object->ref = $ref; $object->ref = $ref;
$object->description = $description; $object->description = $description;
$object->fk_code_type_resource = $fk_code_type_resource; $object->fk_code_type_resource = $fk_code_type_resource;
$object->country_id = $country_id;
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object); $ret = $extrafields->setOptionalsFromPost($extralabels, $object);
@ -271,6 +275,12 @@ if ($action == 'create' || $object->fetch($id) > 0)
$doleditor->Create(); $doleditor->Create();
print '</td></tr>'; print '</td></tr>';
// Origin country
print '<tr><td>'.$langs->trans("CountryOrigin").'</td><td>';
print $form->select_country($object->country_id,'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
print '</td></tr>';
// Other attributes // Other attributes
$parameters=array('objectsrc' => $objectsrc); $parameters=array('objectsrc' => $objectsrc);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
@ -345,6 +355,14 @@ if ($action == 'create' || $object->fetch($id) > 0)
print '</tr>'; print '</tr>';
// Origin country code
print '<tr>';
print '<td>'.$langs->trans("CountryOrigin").'</td>';
print '<td>';
print getCountry($object->country_id,0,$db);
print '</td>';
print '</tr>';
print '</table>'; print '</table>';
print '</div>'; print '</div>';

View File

@ -73,6 +73,7 @@ class Dolresource extends CommonObject
if (isset($this->ref)) $this->ref=trim($this->ref); if (isset($this->ref)) $this->ref=trim($this->ref);
if (isset($this->description)) $this->description=trim($this->description); if (isset($this->description)) $this->description=trim($this->description);
if (!is_numeric($this->country_id)) $this->country_id = 0;
if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource=trim($this->fk_code_type_resource); if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource=trim($this->fk_code_type_resource);
if (isset($this->note_public)) $this->note_public=trim($this->note_public); if (isset($this->note_public)) $this->note_public=trim($this->note_public);
if (isset($this->note_private)) $this->note_private=trim($this->note_private); if (isset($this->note_private)) $this->note_private=trim($this->note_private);
@ -84,6 +85,7 @@ class Dolresource extends CommonObject
$sql.= "entity,"; $sql.= "entity,";
$sql.= "ref,"; $sql.= "ref,";
$sql.= "description,"; $sql.= "description,";
$sql.= "fk_country,";
$sql.= "fk_code_type_resource,"; $sql.= "fk_code_type_resource,";
$sql.= "note_public,"; $sql.= "note_public,";
$sql.= "note_private"; $sql.= "note_private";
@ -93,6 +95,7 @@ class Dolresource extends CommonObject
$sql.= $conf->entity.", "; $sql.= $conf->entity.", ";
$sql.= " ".(! isset($this->ref)?'NULL':"'".$this->db->escape($this->ref)."'").","; $sql.= " ".(! isset($this->ref)?'NULL':"'".$this->db->escape($this->ref)."'").",";
$sql.= " ".(! isset($this->description)?'NULL':"'".$this->db->escape($this->description)."'").","; $sql.= " ".(! isset($this->description)?'NULL':"'".$this->db->escape($this->description)."'").",";
$sql.= " ".($this->country_id > 0 ? $this->country_id : 'null').",";
$sql.= " ".(! isset($this->fk_code_type_resource)?'NULL':"'".$this->db->escape($this->fk_code_type_resource)."'").","; $sql.= " ".(! isset($this->fk_code_type_resource)?'NULL':"'".$this->db->escape($this->fk_code_type_resource)."'").",";
$sql.= " ".(! isset($this->note_public)?'NULL':"'".$this->db->escape($this->note_public)."'").","; $sql.= " ".(! isset($this->note_public)?'NULL':"'".$this->db->escape($this->note_public)."'").",";
$sql.= " ".(! isset($this->note_private)?'NULL':"'".$this->db->escape($this->note_private)."'"); $sql.= " ".(! isset($this->note_private)?'NULL':"'".$this->db->escape($this->note_private)."'");
@ -181,6 +184,7 @@ class Dolresource extends CommonObject
$sql.= " t.entity,"; $sql.= " t.entity,";
$sql.= " t.ref,"; $sql.= " t.ref,";
$sql.= " t.description,"; $sql.= " t.description,";
$sql.= " t.fk_country,";
$sql.= " t.fk_code_type_resource,"; $sql.= " t.fk_code_type_resource,";
$sql.= " t.note_public,"; $sql.= " t.note_public,";
$sql.= " t.note_private,"; $sql.= " t.note_private,";
@ -203,6 +207,7 @@ class Dolresource extends CommonObject
$this->entity = $obj->entity; $this->entity = $obj->entity;
$this->ref = $obj->ref; $this->ref = $obj->ref;
$this->description = $obj->description; $this->description = $obj->description;
$this->country_id = $obj->fk_country;
$this->fk_code_type_resource = $obj->fk_code_type_resource; $this->fk_code_type_resource = $obj->fk_code_type_resource;
$this->note_public = $obj->note_public; $this->note_public = $obj->note_public;
$this->note_private = $obj->note_private; $this->note_private = $obj->note_private;
@ -228,6 +233,7 @@ class Dolresource extends CommonObject
} }
} }
/** /**
* Update object into database * Update object into database
* *
@ -244,6 +250,7 @@ class Dolresource extends CommonObject
if (isset($this->ref)) $this->ref=trim($this->ref); if (isset($this->ref)) $this->ref=trim($this->ref);
if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource=trim($this->fk_code_type_resource); if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource=trim($this->fk_code_type_resource);
if (isset($this->description)) $this->description=trim($this->description); if (isset($this->description)) $this->description=trim($this->description);
if (!is_numeric($this->country_id)) $this->country_id = 0;
if (empty($this->oldcopy)) if (empty($this->oldcopy))
{ {
@ -256,6 +263,7 @@ class Dolresource extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
$sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").","; $sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").",";
$sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").","; $sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").",";
$sql.= " fk_country=".($this->country_id > 0 ? $this->country_id :"null").",";
$sql.= " fk_code_type_resource=".(isset($this->fk_code_type_resource)?"'".$this->db->escape($this->fk_code_type_resource)."'":"null").","; $sql.= " fk_code_type_resource=".(isset($this->fk_code_type_resource)?"'".$this->db->escape($this->fk_code_type_resource)."'":"null").",";
$sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').""; $sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null')."";
$sql.= " WHERE rowid=".$this->id; $sql.= " WHERE rowid=".$this->id;
@ -555,6 +563,7 @@ class Dolresource extends CommonObject
$line->id = $obj->rowid; $line->id = $obj->rowid;
$line->ref = $obj->ref; $line->ref = $obj->ref;
$line->description = $obj->description; $line->description = $obj->description;
$line->country_id = $obj->fk_country;
$line->fk_code_type_resource = $obj->fk_code_type_resource; $line->fk_code_type_resource = $obj->fk_code_type_resource;
$line->type_label = $obj->type_label; $line->type_label = $obj->type_label;

View File

@ -131,33 +131,40 @@ print '<table class="noborder nohover" width="100%">'."\n";
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(round($third['customer'])?1:0)+(round($third['supplier'])?1:0)+(round($third['other'])?1:0) >= 2)) if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(round($third['customer'])?1:0)+(round($third['supplier'])?1:0)+(round($third['other'])?1:0) >= 2))
{ {
print '<tr '.$bc[0].'><td align="center" colspan="2">'; print '<tr><td align="center" colspan="2">';
$dataseries=array(); $dataseries=array();
if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect'])); if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array($langs->trans("Prospects"), round($third['prospect']));
if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer'])); if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array($langs->trans("Customers"), round($third['customer']));
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier'])); if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array($langs->trans("Suppliers"), round($third['supplier']));
if (! empty($conf->societe->enabled)) $dataseries[]=array('label'=>$langs->trans("Others"),'data'=>round($third['other'])); if (! empty($conf->societe->enabled)) $dataseries[]=array($langs->trans("Others"), round($third['other']));
$data=array('series'=>$dataseries); include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
dol_print_graph('stats',300,180,$data,1,'pie',0,'',0); $dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->draw('idgraphthirdparties');
print $dolgraph->show();
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
else else
{ {
if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS))
{ {
$statstring = "<tr ".$bc[0].">"; $statstring = "<tr>";
$statstring.= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=p">'.$langs->trans("Prospects").'</a></td><td align="right">'.round($third['prospect']).'</td>'; $statstring.= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=p">'.$langs->trans("Prospects").'</a></td><td align="right">'.round($third['prospect']).'</td>';
$statstring.= "</tr>"; $statstring.= "</tr>";
} }
if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS))
{ {
$statstring.= "<tr ".$bc[1].">"; $statstring.= "<tr>";
$statstring.= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=c">'.$langs->trans("Customers").'</a></td><td align="right">'.round($third['customer']).'</td>'; $statstring.= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=c">'.$langs->trans("Customers").'</a></td><td align="right">'.round($third['customer']).'</td>';
$statstring.= "</tr>"; $statstring.= "</tr>";
} }
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $user->rights->fournisseur->lire) if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $user->rights->fournisseur->lire)
{ {
$statstring2 = "<tr ".$bc[0].">"; $statstring2 = "<tr>";
$statstring2.= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=f">'.$langs->trans("Suppliers").'</a></td><td align="right">'.round($third['supplier']).'</td>'; $statstring2.= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=f">'.$langs->trans("Suppliers").'</a></td><td align="right">'.round($third['supplier']).'</td>';
$statstring2.= "</tr>"; $statstring2.= "</tr>";
} }
@ -202,20 +209,32 @@ if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHS
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
if ($i < $nbmax) if ($i < $nbmax)
$dataseries[]=array('label'=>$obj->label,'data'=>round($obj->nb)); {
$dataseries[]=array($obj->label, round($obj->nb));
}
else else
{
$rest+=$obj->nb; $rest+=$obj->nb;
}
$total+=$obj->nb; $total+=$obj->nb;
$i++; $i++;
} }
if ($i > $nbmax) if ($i > $nbmax)
$dataseries[]=array('label'=>$langs->trans("Other"),'data'=>round($rest)); {
$data=array('series'=>$dataseries); $dataseries[]=array($langs->trans("Other"), round($rest));
dol_print_graph('statscategclient',300,180,$data,1,'pie',0); }
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->draw('idgraphcateg');
print $dolgraph->show();
} }
else else
{ {
$var=true;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
@ -275,16 +294,10 @@ if ($result)
print '<th align="right">'.$langs->trans('Status').'</th>'; print '<th align="right">'.$langs->trans('Status').'</th>';
print '</tr>'."\n"; print '</tr>'."\n";
$var=True;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
print '<tr class="oddeven">';
// Name
print '<td class="nowrap">';
$thirdparty_static->id=$objp->rowid; $thirdparty_static->id=$objp->rowid;
$thirdparty_static->name=$objp->name; $thirdparty_static->name=$objp->name;
$thirdparty_static->client=$objp->client; $thirdparty_static->client=$objp->client;
@ -295,6 +308,10 @@ if ($result)
$thirdparty_static->code_client = $objp->code_client; $thirdparty_static->code_client = $objp->code_client;
$thirdparty_static->code_fournisseur = $objp->code_fournisseur; $thirdparty_static->code_fournisseur = $objp->code_fournisseur;
$thirdparty_static->canvas=$objp->canvas; $thirdparty_static->canvas=$objp->canvas;
print '<tr class="oddeven">';
// Name
print '<td class="nowrap">';
print $thirdparty_static->getNomUrl(1); print $thirdparty_static->getNomUrl(1);
print "</td>\n"; print "</td>\n";
// Type // Type

View File

@ -122,7 +122,7 @@ if ($resql)
$listofstatus=array(0,1,2,3,4); $listofstatus=array(0,1,2,3,4);
foreach ($listofstatus as $status) foreach ($listofstatus as $status)
{ {
$dataseries[]=array('label'=>$supplier_proposalstatic->LibStatut($status,1),'data'=>(isset($vals[$status])?(int) $vals[$status]:0)); $dataseries[]=array($supplier_proposalstatic->LibStatut($status,1), (isset($vals[$status])?(int) $vals[$status]:0));
if (! $conf->use_javascript_ajax) if (! $conf->use_javascript_ajax)
{ {
@ -134,9 +134,18 @@ if ($resql)
} }
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print '<tr '.$bc[false].'><td align="center" colspan="2">'; print '<tr><td align="center" colspan="2">';
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',1,'',0); include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
$dolgraph->setShowLegend(1);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setWidth('100%');
$dolgraph->draw('idgraphstatus');
print $dolgraph->show($total?0:1);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -456,6 +456,9 @@ fieldset { border: 1px solid #AAAAAA !important; }
.trextrafieldseparator td { .trextrafieldseparator td {
border-bottom: 2px solid rgb(120,120,120) !important; border-bottom: 2px solid rgb(120,120,120) !important;
} }
input#onlinepaymenturl, input#directdownloadlink {
opacity: 0.7;
}
hr { border: 0; border-top: 1px solid #ccc; } hr { border: 0; border-top: 1px solid #ccc; }
@ -581,6 +584,9 @@ textarea.centpercent {
.nowraponall { .nowraponall {
white-space: nowrap; white-space: nowrap;
} }
.wordwrap {
word-wrap: break-word;
}
.nobold { .nobold {
font-weight: normal !important; font-weight: normal !important;
} }
@ -911,6 +917,9 @@ select.selectarrowonleft option {
body { body {
font-size: <?php print $fontsize+3; ?>px; font-size: <?php print $fontsize+3; ?>px;
} }
div.refidno {
font-size: <?php print $fontsize+3; ?>px !important;
}
} }
/* Force values for small screen 570 */ /* Force values for small screen 570 */
@ -919,6 +928,9 @@ select.selectarrowonleft option {
body { body {
font-size: <?php print $fontsize+3; ?>px; font-size: <?php print $fontsize+3; ?>px;
} }
div.refidno {
font-size: <?php print $fontsize+3; ?>px !important;
}
.divmainbodylarge { margin-left: 20px !important; margin-right: 20px !important; } .divmainbodylarge { margin-left: 20px !important; margin-right: 20px !important; }
@ -932,7 +944,8 @@ select.selectarrowonleft option {
margin-top: <?php print ($dol_hide_topmenu?'12':'6'); ?>px !important; margin-top: <?php print ($dol_hide_topmenu?'12':'6'); ?>px !important;
} }
div.titre { div.titre {
line-height: 2em; margin-top: 12px;
/* line-height: 2em; */
} }
.border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { .border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col {
height: 40px !important; height: 40px !important;
@ -4080,6 +4093,7 @@ div#ecm-layout-center {
max-width: 1024px; max-width: 1024px;
padding-left: 10px !important; padding-left: 10px !important;
padding-right: 10px !important; padding-right: 10px !important;
word-wrap: break-word;
} }
.jnotify-container .jnotify-notification .jnotify-message { .jnotify-container .jnotify-notification .jnotify-message {
font-weight: normal; font-weight: normal;
@ -4887,6 +4901,10 @@ div.tabsElem a.tab {
div.tmenuleft { div.tmenuleft {
display: none; display: none;
} }
.dropdown dd ul {
max-width: 300px;
}
} }
/* rule to reduce top menu - 2nd reduction */ /* rule to reduce top menu - 2nd reduction */
@media only screen and (max-width: <?php echo round($nbtopmenuentries * $fontsize * 5, 0) + 24; ?>px) /* reduction 2 */ @media only screen and (max-width: <?php echo round($nbtopmenuentries * $fontsize * 5, 0) + 24; ?>px) /* reduction 2 */

View File

@ -589,6 +589,9 @@ textarea.centpercent {
.nowraponall { .nowraponall {
white-space: nowrap; white-space: nowrap;
} }
.wordwrap {
word-wrap: break-word;
}
.nobold { .nobold {
font-weight: normal !important; font-weight: normal !important;
} }
@ -908,6 +911,9 @@ select.selectarrowonleft option {
body { body {
font-size: <?php print $fontsize+3; ?>px; font-size: <?php print $fontsize+3; ?>px;
} }
div.refidno {
font-size: <?php print $fontsize+3; ?>px !important;
}
} }
/* Force values for small screen 570 */ /* Force values for small screen 570 */
@ -916,6 +922,9 @@ select.selectarrowonleft option {
body { body {
font-size: <?php print $fontsize+3; ?>px; font-size: <?php print $fontsize+3; ?>px;
} }
div.refidno {
font-size: <?php print $fontsize+3; ?>px !important;
}
.divmainbodylarge { margin-left: 20px; margin-right: 20px; } .divmainbodylarge { margin-left: 20px; margin-right: 20px; }
@ -929,7 +938,8 @@ select.selectarrowonleft option {
margin-top: <?php print ($dol_hide_topmenu?'12':'6'); ?>px !important; margin-top: <?php print ($dol_hide_topmenu?'12':'6'); ?>px !important;
} }
div.titre { div.titre {
line-height: 2em; margin-top: 12px;
/* line-height: 2em; */
} }
.border tbody tr, .border tbody tr td, div.tabBar table.border tr { .border tbody tr, .border tbody tr td, div.tabBar table.border tr {
height: 40px !important; height: 40px !important;