diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php
index d5af14f9171..8a3096ef72a 100755
--- a/build/generate_filelist_xml.php
+++ b/build/generate_filelist_xml.php
@@ -164,7 +164,7 @@ foreach ($files as $filetmp) {
if (filetype($file)=="file") {
$md5=md5_file($file);
$checksumconcat[]=$md5;
- fputs($fp, '
';
+print ''.$langs->trans("FileCheckDesc").'
';
// Version
print '
| '.$trigger['picto'].' | '; + print ''.$trigger['picto'].' | '; print ''.$trigger['file'].' | '; print ''.$trigger['status'].' | '; print '';
diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php
index 8ea4f46c89d..9c9b8d12bff 100644
--- a/htdocs/asset/list.php
+++ b/htdocs/asset/list.php
@@ -152,8 +152,8 @@ if (empty($reshook))
// Mass actions
$objectclass='Asset';
$objectlabel='Asset';
- $permtoread = $user->rights->asset->read;
- $permtodelete = $user->rights->asset->delete;
+ $permissiontoread = $user->rights->asset->read;
+ $permissiontodelete = $user->rights->asset->delete;
$uploaddir = $conf->asset->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php
index 231679f7b3a..f4124b2b9db 100644
--- a/htdocs/bom/bom_card.php
+++ b/htdocs/bom/bom_card.php
@@ -72,14 +72,14 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
// Security check - Protection if external user
//if ($user->socid > 0) access_forbidden();
//if ($user->socid > 0) $socid = $user->socid;
-//$isdraft = (($object->statut == BillOfMaterials::STATUS_DRAFT) ? 1 : 0);
+//$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0);
//$result = restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
$permissionnote=$user->rights->bom->write; // Used by the include of actions_setnotes.inc.php
$permissiondellink=$user->rights->bom->write; // Used by the include of actions_dellink.inc.php
$permissionedit=$user->rights->bom->write; // Used by the include of actions_lineupdown.inc.php
$permissiontoadd=$user->rights->bom->write; // Used by the include of actions_addupdatedelete.inc.php
-$permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && $object->status == 0);
+$permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
/*
@@ -457,7 +457,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
$langs->load("projects");
$morehtmlref.=' '.$langs->trans('Project') . ' '; - if ($user->rights->bom->write) + if ($permissiontoadd) { if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; @@ -532,7 +532,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ' ';
- if (! empty($object->lines) || ($object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline'))
+ if (! empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline'))
{
print ' '."\n";
$parameters=array();
@@ -584,7 +584,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
// Modify
- if ($user->rights->bom->write)
+ if ($permissiontoadd)
{
print 'id.'&action=edit">'.$langs->trans("Modify").''."\n";
}
@@ -619,7 +619,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
// Clone
- if ($user->rights->bom->write)
+ if ($permissiontoadd)
{
print '' . $langs->trans("ToClone") . '';
}
@@ -638,7 +638,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
*/
- if ($user->rights->bom->delete)
+ if ($permissiontodelete)
{
print 'id.'&action=delete">'.$langs->trans('Delete').''."\n";
}
diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php
index 0775c2cc370..aa690b9468a 100644
--- a/htdocs/bom/bom_list.php
+++ b/htdocs/bom/bom_list.php
@@ -1,6 +1,5 @@
- * Copyright (C) ---Put here your own copyright and developer email---
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -114,6 +113,9 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
+$permissiontoread = $user->rights->bom->read;
+$permissiontoadd = $user->rights->bom->write;
+$permissiontodelete = $user->rights->bom->delete;
/*
@@ -151,13 +153,68 @@ if (empty($reshook))
// Mass actions
$objectclass='BOM';
$objectlabel='BillOfMaterials';
- $permtoread = $user->rights->bom->read;
- $permtodelete = $user->rights->bom->delete;
+ $permissiontoread = $user->rights->bom->read;
+ $permissiontodelete = $user->rights->bom->delete;
$uploaddir = $conf->bom->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
-}
+ // Validate records
+ if (! $error && $massaction == 'disable' && $permissiontoadd)
+ {
+ $objecttmp=new $objectclass($db);
+
+ if (! $error)
+ {
+ $db->begin();
+
+ $nbok = 0;
+ foreach($toselect as $toselectid)
+ {
+ $result=$objecttmp->fetch($toselectid);
+ if ($result > 0)
+ {
+ if ($objecttmp->status != $objecttmp::STATUS_VALIDATED)
+ {
+ $langs->load("errors");
+ setEventMessages($langs->trans("ErrorObjectMustHaveStatusValidatedToBeDisabled", $objecttmp->ref), null, 'errors');
+ $error++;
+ break;
+ }
+
+ // Can be 'cancel()' or 'close()'
+ $result = $objecttmp->cancel($user);
+ if ($result < 0)
+ {
+ setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
+ $error++;
+ break;
+ }
+ else $nbok++;
+ }
+ else
+ {
+ setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
+ $error++;
+ break;
+ }
+ }
+
+ if (! $error)
+ {
+ if ($nbok > 1) setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
+ else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
+ $db->commit();
+ }
+ else
+ {
+ $db->rollback();
+ }
+ //var_dump($listofobjectthirdparties);exit;
+ }
+ }
+}
+
/*
* View
@@ -303,7 +360,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// List of mass actions available
$arrayofmassactions = array(
//'presend'=>$langs->trans("SendByMail"),
- //'builddoc'=>$langs->trans("PDFMerge"),
+ 'disable'=>$langs->trans("Disable"),
);
if ($user->rights->bom->delete) $arrayofmassactions['predelete']=''.$langs->trans("Delete");
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions=array();
@@ -539,6 +596,7 @@ print ' '."\n";
print ''."\n";
+
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords))
{
$hidegeneratedfilelistifempty=1;
diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php
index 4a623c3f36d..65f619cb0b2 100644
--- a/htdocs/bom/class/bom.class.php
+++ b/htdocs/bom/class/bom.class.php
@@ -91,7 +91,7 @@ class BOM extends CommonObject
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1',),
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
- 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp'),
+ 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp'),
'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1', 'css'=>'maxwidth75imp'),
'efficiency' => array('type'=>'real', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>-1, 'default'=>1, 'position'=>100, 'notnull'=>0, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'),
'duration' => array('type'=>'real', 'label'=>'EstimatedDuration', 'enabled'=>1, 'visible'=>-1, 'position'=>101, 'notnull'=>-1, 'css'=>'maxwidth50imp', 'help'=>'EstimatedDurationDesc'),
diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php
index e78ef64b5c7..7da2c768b7f 100644
--- a/htdocs/bom/lib/bom.lib.php
+++ b/htdocs/bom/lib/bom.lib.php
@@ -90,7 +90,7 @@ function bomPrepareHead($object)
if (!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/bom/bom_note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'note';
$h++;
}
@@ -102,7 +102,7 @@ function bomPrepareHead($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/bom/bom_document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'document';
$h++;
diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php
index ff69bd00c0c..0e3d7a7725e 100644
--- a/htdocs/comm/mailing/list.php
+++ b/htdocs/comm/mailing/list.php
@@ -102,8 +102,8 @@ if (empty($reshook))
// Mass actions
/*$objectclass='MyObject';
$objectlabel='MyObject';
- $permtoread = $user->rights->mymodule->read;
- $permtodelete = $user->rights->mymodule->delete;
+ $permissiontoread = $user->rights->mymodule->read;
+ $permissiontodelete = $user->rights->mymodule->delete;
$uploaddir = $conf->mymodule->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
*/
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index a83d7ee5161..0c52fea9f35 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -241,9 +241,9 @@ if (empty($reshook))
{
$objectclass='Propal';
$objectlabel='Proposals';
- $permtoread = $user->rights->propal->lire;
- $permtodelete = $user->rights->propal->supprimer;
- $permtoclose = $user->rights->propal->cloturer;
+ $permissiontoread = $user->rights->propal->lire;
+ $permissiontodelete = $user->rights->propal->supprimer;
+ $permissiontoclose = $user->rights->propal->cloturer;
$uploaddir = $conf->propal->multidir_output[$conf->entity];
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 5f9906b58dc..23af81ab24e 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -220,8 +220,8 @@ if (empty($reshook))
// Mass actions
$objectclass='Commande';
$objectlabel='Orders';
- $permtoread = $user->rights->commande->lire;
- $permtodelete = $user->rights->commande->supprimer;
+ $permissiontoread = $user->rights->commande->lire;
+ $permissiontodelete = $user->rights->commande->supprimer;
$uploaddir = $conf->commande->multidir_output[$conf->entity];
$trigger_name='ORDER_SENTBYMAIL';
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index 773ee1e9255..4a9d0947b1e 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -209,8 +209,8 @@ if (empty($reshook))
{
$objectclass='Account';
$objectlabel='BankTransaction';
- $permtoread = $user->rights->banque->lire;
- $permtodelete = $user->rights->banque->supprimer;
+ $permissiontoread = $user->rights->banque->lire;
+ $permissiontodelete = $user->rights->banque->supprimer;
$uploaddir = $conf->bank->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php
index e0461d35368..45129b6ee19 100644
--- a/htdocs/compta/cashcontrol/cashcontrol_list.php
+++ b/htdocs/compta/cashcontrol/cashcontrol_list.php
@@ -168,8 +168,8 @@ if (empty($reshook))
// Mass actions
$objectclass='CashControl';
$objectlabel='CashControl';
- $permtoread = ($user->rights->cashdesk->use || $user->rights->takepos->use);
- $permtodelete = ($user->rights->cashdesk->use || $user->rights->takepos->use);
+ $permissiontoread = ($user->rights->cashdesk->use || $user->rights->takepos->use);
+ $permissiontodelete = ($user->rights->cashdesk->use || $user->rights->takepos->use);
//$uploaddir = '';
//include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php
index 10eb2ac03c8..49cb9529c71 100644
--- a/htdocs/compta/facture/card-rec.php
+++ b/htdocs/compta/facture/card-rec.php
@@ -146,8 +146,8 @@ if (empty($reshook))
// Mass actions
/*$objectclass='MyObject';
$objectlabel='MyObject';
- $permtoread = $user->rights->mymodule->read;
- $permtodelete = $user->rights->mymodule->delete;
+ $permissiontoread = $user->rights->mymodule->read;
+ $permissiontodelete = $user->rights->mymodule->delete;
$uploaddir = $conf->mymodule->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';*/
diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index 09873f5ee61..941aa0723ef 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -191,8 +191,8 @@ if (empty($reshook))
// Mass actions
/*$objectclass='MyObject';
$objectlabel='MyObject';
- $permtoread = $user->rights->mymodule->read;
- $permtodelete = $user->rights->mymodule->delete;
+ $permissiontoread = $user->rights->mymodule->read;
+ $permissiontodelete = $user->rights->mymodule->delete;
$uploaddir = $conf->mymodule->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';*/
}
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 74c27c1e467..43f8d41db10 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -265,9 +265,9 @@ if (empty($reshook))
{
$objectclass='Facture';
$objectlabel='Invoices';
- $permtoread = $user->rights->facture->lire;
- $permtocreate = $user->rights->facture->creer;
- $permtodelete = $user->rights->facture->supprimer;
+ $permissiontoread = $user->rights->facture->lire;
+ $permissiontoadd = $user->rights->facture->creer;
+ $permissiontodelete = $user->rights->facture->supprimer;
$uploaddir = $conf->facture->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index f8d92d19b34..d23963fde0a 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -254,8 +254,8 @@ if (empty($reshook))
// Mass actions
$objectclass='Contact';
$objectlabel='Contact';
- $permtoread = $user->rights->societe->lire;
- $permtodelete = $user->rights->societe->supprimer;
+ $permissiontoread = $user->rights->societe->lire;
+ $permissiontodelete = $user->rights->societe->supprimer;
$uploaddir = $conf->societe->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 0b9c6768eda..7049ce77076 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -1875,8 +1875,8 @@ class Contrat extends CommonObject
/**
* Return label of a contract status
*
- * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length
- * @return string Label
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto, 7=Same than 6 with fixed length
+ * @return string Label
*/
public function getLibStatut($mode)
{
@@ -1888,7 +1888,7 @@ class Contrat extends CommonObject
* Renvoi label of a given contrat status
*
* @param int $status Id status
- * @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto, 7=Same than 6 with fixed length
* @return string Label
*/
public function LibStatut($status, $mode)
@@ -1921,13 +1921,13 @@ class Contrat extends CommonObject
$text.=': ';
$text.='';
}
- $text.=($mode == 7?'':'');
+ $text.=($mode == 7?'':'');
$text.=($mode != 7 || $this->nbofserviceswait > 0) ? ($this->nbofserviceswait.ContratLigne::LibStatut(0, 3, -1, 'class="marginleft2"')).(($mode != 7 || $this->nbofservicesopened || $this->nbofservicesexpired || $this->nbofservicesclosed)?' ':'') : '';
- $text.=($mode == 7?'':'');
+ $text.=($mode == 7?'':'');
$text.=($mode != 7 || $this->nbofservicesopened > 0) ? ($this->nbofservicesopened.ContratLigne::LibStatut(4, 3, 0, 'class="marginleft2"')).(($mode != 7 || $this->nbofservicesexpired || $this->nbofservicesclosed)?' ':'') : '';
- $text.=($mode == 7?'':'');
+ $text.=($mode == 7?'':'');
$text.=($mode != 7 || $this->nbofservicesexpired > 0) ? ($this->nbofservicesexpired.ContratLigne::LibStatut(4, 3, 1, 'class="marginleft2"')).(($mode != 7 || $this->nbofservicesclosed)?' ':'') : '';
- $text.=($mode == 7?'':'');
+ $text.=($mode == 7?'':'');
$text.=($mode != 7 || $this->nbofservicesclosed > 0) ? ($this->nbofservicesclosed.ContratLigne::LibStatut(5, 3, -1, 'class="marginleft2"')) : '';
$text.=($mode == 7?'':'');
return $text;
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index 3df193d53d2..f24105a93db 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -188,8 +188,8 @@ if (empty($reshook))
{
$objectclass='Contrat';
$objectlabel='Contracts';
- $permtoread = $user->rights->contrat->lire;
- $permtodelete = $user->rights->contrat->supprimer;
+ $permissiontoread = $user->rights->contrat->lire;
+ $permissiontodelete = $user->rights->contrat->supprimer;
$uploaddir = $conf->contrat->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@@ -591,10 +591,10 @@ if (! empty($arrayfields['lower_planned_end_date']['checked'])) {
print_liste_field_titre($arrayfields['lower_planned_end_date']['label'], $_SERVER["PHP_SELF"], "lower_planned_end_date", "", $param, '', $sortfield, $sortorder, 'center ');
}
if (! empty($arrayfields['status']['checked'])) {
- print_liste_field_titre($staticcontratligne->LibStatut(0, 3), '', '', '', '', 'width="16"');
- print_liste_field_titre($staticcontratligne->LibStatut(4, 3, 0), '', '', '', '', 'width="16"');
- print_liste_field_titre($staticcontratligne->LibStatut(4, 3, 1), '', '', '', '', 'width="16"');
- print_liste_field_titre($staticcontratligne->LibStatut(5, 3), '', '', '', '', 'width="16"');
+ print_liste_field_titre($staticcontratligne->LibStatut(0, 3, -1, 'class="nochangebackground"'), '', '', '', '', 'width="16"');
+ print_liste_field_titre($staticcontratligne->LibStatut(4, 3, 0, 'class="nochangebackground"'), '', '', '', '', 'width="16"');
+ print_liste_field_titre($staticcontratligne->LibStatut(4, 3, 1, 'class="nochangebackground"'), '', '', '', '', 'width="16"');
+ print_liste_field_titre($staticcontratligne->LibStatut(5, 3, -1, 'class="nochangebackground"'), '', '', '', '', 'width="16"');
}
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print " | '; print ' | ';
print '' . img_edit() . ''; // id= is included into $param
- if ($permtodelete) {
+ if ($permissiontodelete) {
print ' ' . img_delete() . ''; // id= is included into $param
} else {
print ' ';
diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php
index 86b4bbf0673..bdcfe6bbf75 100644
--- a/htdocs/core/class/interfaces.class.php
+++ b/htdocs/core/class/interfaces.class.php
@@ -343,7 +343,7 @@ class Interfaces
}
// We set info of modules
- $triggers[$j]['picto'] = $objMod->picto?img_object('', $objMod->picto):img_object('', 'generic');
+ $triggers[$j]['picto'] = $objMod->picto?img_object('', $objMod->picto, 'class="valignmiddle pictomodule "'):img_object('', 'generic', 'class="valignmiddle pictomodule "');
$triggers[$j]['file'] = $files[$key];
$triggers[$j]['fullpath'] = $fullpath[$key];
$triggers[$j]['relpath'] = $relpath[$key];
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index e31f9b6d7d7..1d3f7eb65c3 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -663,7 +663,7 @@ function security_prepare_head()
$head[$h][0] = DOL_URL_ROOT."/admin/perms.php";
$head[$h][1] = $langs->trans("DefaultRights");
- if ($nbPerms > 0) $head[$h][1].= ' '.$nbPerms.'';
+ if ($nbPerms > 0) $head[$h][1].= ''.$nbPerms.'';
$head[$h][2] = 'default';
$h++;
diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php
index af859ccca7f..ad17cd259bd 100644
--- a/htdocs/core/lib/agenda.lib.php
+++ b/htdocs/core/lib/agenda.lib.php
@@ -473,7 +473,7 @@ function actions_prepare_head($object)
$listofresourcelinked = $resource->getElementResources($object->element, $object->id);
$nbResources=(is_array($listofresourcelinked)?count($listofresourcelinked):0);
$head[$h][1] = $langs->trans("Resources");
- if ($nbResources > 0) $head[$h][1].= ' '.($nbResources).'';
+ if ($nbResources > 0) $head[$h][1].= ''.($nbResources).'';
$head[$h][2] = 'resources';
$h++;
}
diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php
index 3b59dfda73d..5c6bac579f2 100644
--- a/htdocs/core/lib/asset.lib.php
+++ b/htdocs/core/lib/asset.lib.php
@@ -102,7 +102,7 @@ function asset_prepare_head(Asset $object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/asset/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'documents';
$h++;
@@ -111,7 +111,7 @@ function asset_prepare_head(Asset $object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/asset/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Notes");
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'note';
$h++;
diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php
index 91e0b719734..c4849d59adc 100644
--- a/htdocs/core/lib/bank.lib.php
+++ b/htdocs/core/lib/bank.lib.php
@@ -84,7 +84,7 @@ function bank_prepare_head(Account $object)
$head[$h][0] = DOL_URL_ROOT."/compta/bank/releve.php?account=".$object->id;
$head[$h][1] = $langs->trans("AccountStatements");
- if (($nbReceipts) > 0) $head[$h][1].= ' '.($nbReceipts).'';
+ if (($nbReceipts) > 0) $head[$h][1].= ''.($nbReceipts).'';
$head[$h][2] = 'statement';
$h++;
}
@@ -97,7 +97,7 @@ function bank_prepare_head(Account $object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/document.php?account=" . $object->id;
$head[$h][1] = $langs->trans("Documents");
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'document';
$h++;
@@ -186,7 +186,7 @@ function various_payment_prepare_head($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'documents';
$h++;
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 9f4f1021b4c..8cb023237d4 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -69,7 +69,7 @@ function societe_prepare_head(Societe $object)
$head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
- if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.'';
+ if ($nbContact > 0) $head[$h][1].= ''.$nbContact.'';
$head[$h][2] = 'contact';
$h++;
}
@@ -79,7 +79,7 @@ function societe_prepare_head(Societe $object)
$head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id;
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
$head[$h][1] = $langs->trans("ContactsAddresses");
- if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.'';
+ if ($nbContact > 0) $head[$h][1].= ''.$nbContact.'';
$head[$h][2] = 'contact';
$h++;
}
@@ -136,7 +136,7 @@ function societe_prepare_head(Societe $object)
else {
dol_print_error($db);
}
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'project';
$h++;
}
@@ -229,7 +229,7 @@ function societe_prepare_head(Societe $object)
$head[$h][0] = DOL_URL_ROOT .'/societe/paymentmodes.php?socid='.$object->id;
$head[$h][1] = $title;
if ($foundonexternalonlinesystem) $head[$h][1].= ' ...';
- elseif ($nbBankAccount > 0) $head[$h][1].= ' '.$nbBankAccount.'';
+ elseif ($nbBankAccount > 0) $head[$h][1].= ''.$nbBankAccount.'';
$head[$h][2] = 'rib';
$h++;
}
@@ -257,7 +257,7 @@ function societe_prepare_head(Societe $object)
else {
dol_print_error($db);
}
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'website';
$h++;
}
@@ -295,7 +295,7 @@ function societe_prepare_head(Societe $object)
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Notifications");
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'notify';
$h++;
}
@@ -306,7 +306,7 @@ function societe_prepare_head(Societe $object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/societe/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Notes");
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'note';
$h++;
@@ -319,7 +319,7 @@ function societe_prepare_head(Societe $object)
$head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Documents");
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'document';
$h++;
}
diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php
index 7e5096bb8c5..0082947d0c1 100644
--- a/htdocs/core/lib/contact.lib.php
+++ b/htdocs/core/lib/contact.lib.php
@@ -78,7 +78,7 @@ function contact_prepare_head(Contact $object)
$nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1);
$head[$tab][0] = DOL_URL_ROOT.'/contact/note.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Note");
- if($nbNote > 0) $head[$tab][1].= ' '.$nbNote.'';
+ if($nbNote > 0) $head[$tab][1].= ''.$nbNote.'';
$head[$tab][2] = 'note';
$tab++;
}
@@ -90,7 +90,7 @@ function contact_prepare_head(Contact $object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$tab][0] = DOL_URL_ROOT.'/contact/document.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Documents");
- if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ''.($nbFiles+$nbLinks).'';
$head[$tab][2] = 'documents';
$tab++;
diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php
index 73cd8e1748e..ec91a2dcc70 100644
--- a/htdocs/core/lib/contract.lib.php
+++ b/htdocs/core/lib/contract.lib.php
@@ -45,7 +45,7 @@ function contract_prepare_head(Contrat $object)
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
$head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans("ContactsAddresses");
- if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.'';
+ if ($nbContact > 0) $head[$h][1].= ''.$nbContact.'';
$head[$h][2] = 'contact';
$h++;
}
@@ -63,7 +63,7 @@ function contract_prepare_head(Contrat $object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Notes");
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'note';
$h++;
}
@@ -75,7 +75,7 @@ function contract_prepare_head(Contrat $object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$object->id;
$head[$h][1] = $langs->trans("Documents");
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'documents';
$h++;
diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php
index d430c9ebd46..16d7d3d8a97 100644
--- a/htdocs/core/lib/donation.lib.php
+++ b/htdocs/core/lib/donation.lib.php
@@ -85,7 +85,7 @@ function donation_prepare_head($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/don/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'documents';
$h++;
@@ -94,7 +94,7 @@ function donation_prepare_head($object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/don/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Notes");
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'note';
$h++;
diff --git a/htdocs/core/lib/emailing.lib.php b/htdocs/core/lib/emailing.lib.php
index 82c4d5c1ae4..59bb080d93e 100644
--- a/htdocs/core/lib/emailing.lib.php
+++ b/htdocs/core/lib/emailing.lib.php
@@ -43,7 +43,7 @@ function emailing_prepare_head(Mailing $object)
{
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/cibles.php?id=".$object->id;
$head[$h][1] = $langs->trans("MailRecipients");
- if ($object->nbemail > 0) $head[$h][1].= ' '.$object->nbemail.'';
+ if ($object->nbemail > 0) $head[$h][1].= ''.$object->nbemail.'';
$head[$h][2] = 'targets';
$h++;
}
diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php
index 02b736dd0cb..caef261b277 100644
--- a/htdocs/core/lib/expensereport.lib.php
+++ b/htdocs/core/lib/expensereport.lib.php
@@ -52,7 +52,7 @@ function expensereport_prepare_head($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/expensereport/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'documents';
$h++;
@@ -63,7 +63,7 @@ function expensereport_prepare_head($object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/expensereport/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'note';
$h++;
}
diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php
index 6997cd5c028..d707063bbe8 100644
--- a/htdocs/core/lib/fichinter.lib.php
+++ b/htdocs/core/lib/fichinter.lib.php
@@ -51,7 +51,7 @@ function fichinter_prepare_head($object)
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
$head[$h][0] = DOL_URL_ROOT.'/fichinter/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('InterventionContact');
- if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.'';
+ if ($nbContact > 0) $head[$h][1].= ''.$nbContact.'';
$head[$h][2] = 'contact';
$h++;
}
@@ -83,7 +83,7 @@ function fichinter_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=fichinter&element_id='.$object->id;
$head[$h][1] = $langs->trans("Resources");
- if ($nbResource > 0) $head[$h][1].= ' '.$nbResource.'';
+ if ($nbResource > 0) $head[$h][1].= ''.$nbResource.'';
$head[$h][2] = 'resource';
$h++;
}
@@ -95,7 +95,7 @@ function fichinter_prepare_head($object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/fichinter/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'note';
$h++;
}
@@ -107,7 +107,7 @@ function fichinter_prepare_head($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/fichinter/document.php?id='.$object->id;
$head[$h][1] = $langs->trans("Documents");
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'documents';
$h++;
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 711e65edaaa..90c673e9e25 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -3072,13 +3072,14 @@ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathre
{
$filename = $path.$file['name'];
$file_list['insignature'][] = $filename;
+ $expectedsize = (empty($file['size']) ? '' : $file['size']);
$expectedmd5 = (string) $file;
//if (preg_match('#'.$exclude.'#', $filename)) continue;
if (!file_exists($pathref.'/'.$filename))
{
- $file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>$expectedmd5);
+ $file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>$expectedmd5, 'expectedsize'=>$expectedsize);
}
else
{
@@ -3090,7 +3091,7 @@ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathre
}
else
{
- if ($md5_local != $expectedmd5) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>$expectedmd5, 'md5'=>(string) $md5_local);
+ if ($md5_local != $expectedmd5) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>$expectedmd5, 'expectedsize'=>$expectedsize, 'md5'=>(string) $md5_local);
$checksumconcat[] = $md5_local;
}
}
diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php
index f11fb417769..9336d9b221f 100644
--- a/htdocs/core/lib/fourn.lib.php
+++ b/htdocs/core/lib/fourn.lib.php
@@ -48,7 +48,7 @@ function facturefourn_prepare_head($object)
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/contact.php?facid='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
- if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.'';
+ if ($nbContact > 0) $head[$h][1].= ''.$nbContact.'';
$head[$h][2] = 'contact';
$h++;
}
@@ -66,7 +66,7 @@ function facturefourn_prepare_head($object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/note.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'note';
$h++;
}
@@ -78,7 +78,7 @@ function facturefourn_prepare_head($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'documents';
$h++;
@@ -116,7 +116,7 @@ function ordersupplier_prepare_head($object)
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
- if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.'';
+ if ($nbContact > 0) $head[$h][1].= ''.$nbContact.'';
$head[$h][2] = 'contact';
$h++;
}
@@ -143,7 +143,7 @@ function ordersupplier_prepare_head($object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Notes");
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'note';
$h++;
}
@@ -155,7 +155,7 @@ function ordersupplier_prepare_head($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'documents';
$h++;
diff --git a/htdocs/core/lib/holiday.lib.php b/htdocs/core/lib/holiday.lib.php
index cb4e1331837..f1b18df11b2 100644
--- a/htdocs/core/lib/holiday.lib.php
+++ b/htdocs/core/lib/holiday.lib.php
@@ -47,7 +47,7 @@ function holiday_prepare_head($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/holiday/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'documents';
$h++;
diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php
index 7dfee37666a..f2818f72872 100644
--- a/htdocs/core/lib/invoice.lib.php
+++ b/htdocs/core/lib/invoice.lib.php
@@ -50,7 +50,7 @@ function facture_prepare_head($object)
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
- if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.'';
+ if ($nbContact > 0) $head[$h][1].= ''.$nbContact.'';
$head[$h][2] = 'contact';
$h++;
}
@@ -71,7 +71,7 @@ function facture_prepare_head($object)
else dol_print_error($db);
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id;
$head[$h][1] = $langs->trans('StandingOrders');
- if ($nbStandingOrders > 0) $head[$h][1].= ' '.$nbStandingOrders.'';
+ if ($nbStandingOrders > 0) $head[$h][1].= ''.$nbStandingOrders.'';
$head[$h][2] = 'standingorders';
$h++;
}
@@ -89,7 +89,7 @@ function facture_prepare_head($object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'note';
$h++;
}
@@ -101,7 +101,7 @@ function facture_prepare_head($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'documents';
$h++;
diff --git a/htdocs/core/lib/loan.lib.php b/htdocs/core/lib/loan.lib.php
index 4d47c79e6da..e751dfd68c8 100644
--- a/htdocs/core/lib/loan.lib.php
+++ b/htdocs/core/lib/loan.lib.php
@@ -59,7 +59,7 @@ function loan_prepare_head($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$tab][0] = DOL_URL_ROOT.'/loan/document.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Documents");
- if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ''.($nbFiles+$nbLinks).'';
$head[$tab][2] = 'documents';
$tab++;
@@ -68,7 +68,7 @@ function loan_prepare_head($object)
$nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1);
$head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id;
$head[$tab][1] = $langs->trans("Notes");
- if($nbNote > 0) $head[$tab][1].= ' '.$nbNote.'';
+ if($nbNote > 0) $head[$tab][1].= ''.$nbNote.'';
$head[$tab][2] = 'note';
$tab++;
}
diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php
index 6068246341e..1f643dd8a48 100644
--- a/htdocs/core/lib/member.lib.php
+++ b/htdocs/core/lib/member.lib.php
@@ -59,7 +59,7 @@ function member_prepare_head(Adherent $object)
$head[$h][0] = DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$object->id;
$head[$h][1] = $langs->trans("Subscriptions");
$head[$h][2] = 'subscription';
- if ($nbSubscription > 0) $head[$h][1].= ' '.$nbSubscription.'';
+ if ($nbSubscription > 0) $head[$h][1].= ''.$nbSubscription.'';
$h++;
}
@@ -76,7 +76,7 @@ function member_prepare_head(Adherent $object)
$head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Note");
$head[$h][2] = 'note';
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$h++;
// Attachments
@@ -87,7 +87,7 @@ function member_prepare_head(Adherent $object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'document';
$h++;
diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php
index 558a3d0d035..97ab411bdfc 100644
--- a/htdocs/core/lib/order.lib.php
+++ b/htdocs/core/lib/order.lib.php
@@ -53,7 +53,7 @@ function commande_prepare_head(Commande $object)
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
- if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.'';
+ if ($nbContact > 0) $head[$h][1].= ''.$nbContact.'';
$head[$h][2] = 'contact';
$h++;
}
@@ -67,7 +67,7 @@ function commande_prepare_head(Commande $object)
if ($conf->expedition_bon->enabled) $text.=$langs->trans("Shipments");
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text.='/';
if ($conf->livraison_bon->enabled) $text.=$langs->trans("Receivings");
- if ($nbShipments > 0 || $nbReceiption > 0) $text.= ' '.($nbShipments?$nbShipments:0);
+ if ($nbShipments > 0 || $nbReceiption > 0) $text.= ''.($nbShipments?$nbShipments:0);
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text.='/';
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text.= ($nbReceiption?$nbReceiption:0);
if ($nbShipments > 0 || $nbReceiption > 0) $text.= '';
@@ -89,7 +89,7 @@ function commande_prepare_head(Commande $object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/commande/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'note';
$h++;
}
@@ -101,7 +101,7 @@ function commande_prepare_head(Commande $object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'documents';
$h++;
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index 11c5d50592a..bdeb9181d3b 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -82,7 +82,7 @@ function product_prepare_head($object)
$head[$h][1] = $langs->trans('AssociatedProducts');
$nbFatherAndChild = $object->hasFatherOrChild();
- if ($nbFatherAndChild > 0) $head[$h][1].= ' '.$nbFatherAndChild.'';
+ if ($nbFatherAndChild > 0) $head[$h][1].= ''.$nbFatherAndChild.'';
$head[$h][2] = 'subproduct';
$h++;
}
@@ -110,7 +110,7 @@ function product_prepare_head($object)
$head[$h][1] = $langs->trans('ProductCombinations');
$head[$h][2] = 'combinations';
$nbVariant = $prodcomb->countNbOfCombinationForFkProductParent($object->id);
- if ($nbVariant > 0) $head[$h][1].= ' '.$nbVariant.'';
+ if ($nbVariant > 0) $head[$h][1].= ''.$nbVariant.'';
}
$h++;
@@ -160,7 +160,7 @@ function product_prepare_head($object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/product/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'note';
$h++;
}
@@ -179,7 +179,7 @@ function product_prepare_head($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'documents';
$h++;
@@ -228,7 +228,7 @@ function productlot_prepare_head($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT."/product/stock/productlot_document.php?id=".$object->id;
$head[$h][1] = $langs->trans("Documents");
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'documents';
$h++;
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 825142d1385..8ceca03b0b2 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -48,7 +48,7 @@ function project_prepare_head($object)
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
$head[$h][0] = DOL_URL_ROOT.'/projet/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans("ProjectContact");
- if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.'';
+ if ($nbContact > 0) $head[$h][1].= ''.$nbContact.'';
$head[$h][2] = 'contact';
$h++;
@@ -61,7 +61,7 @@ function project_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
$taskstatic=new Task($db);
$nbTasks=count($taskstatic->getTasksArray(0, 0, $object->id, 0, 0));
- if ($nbTasks > 0) $head[$h][1].= ' '.($nbTasks).'';
+ if ($nbTasks > 0) $head[$h][1].= ''.($nbTasks).'';
$head[$h][2] = 'tasks';
$h++;
@@ -82,7 +82,7 @@ function project_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.$object->id;
$head[$h][1] = $langs->trans("TimeSpent");
- if ($nbTimeSpent > 0) $head[$h][1].= ' ...';
+ if ($nbTimeSpent > 0) $head[$h][1].= '...';
$head[$h][2] = 'timespent';
$h++;
}
@@ -123,7 +123,7 @@ function project_prepare_head($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/projet/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'document';
$h++;
@@ -133,7 +133,7 @@ function project_prepare_head($object)
$nbComments = $object->getNbComments();
$head[$h][0] = DOL_URL_ROOT.'/projet/comment.php?id='.$object->id;
$head[$h][1] = $langs->trans("CommentLink");
- if ($nbComments > 0) $head[$h][1].= ' '.$nbComments.'';
+ if ($nbComments > 0) $head[$h][1].= ''.$nbComments.'';
$head[$h][2] = 'project_comment';
$h++;
}
@@ -174,7 +174,7 @@ function task_prepare_head($object)
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/contact.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
$head[$h][1] = $langs->trans("TaskRessourceLinks");
- if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.'';
+ if ($nbContact > 0) $head[$h][1].= ''.$nbContact.'';
$head[$h][2] = 'task_contact';
$h++;
@@ -195,7 +195,7 @@ function task_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
$head[$h][1] = $langs->trans("TimeSpent");
- if ($nbTimeSpent > 0) $head[$h][1].= ' ...';
+ if ($nbTimeSpent > 0) $head[$h][1].= '...';
$head[$h][2] = 'task_time';
$h++;
@@ -212,7 +212,7 @@ function task_prepare_head($object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
$head[$h][1] = $langs->trans('Notes');
- if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
$head[$h][2] = 'task_notes';
$h++;
}
@@ -224,7 +224,7 @@ function task_prepare_head($object)
$nbFiles = count(dol_dir_list($filesdir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
$head[$h][2] = 'task_document';
$h++;
@@ -234,7 +234,7 @@ function task_prepare_head($object)
$nbComments = $object->getNbComments();
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/comment.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
$head[$h][1] = $langs->trans("CommentLink");
- if ($nbComments > 0) $head[$h][1].= ' '.$nbComments.'';
+ if ($nbComments > 0) $head[$h][1].= ''.$nbComments.'';
$head[$h][2] = 'task_comment';
$h++;
}
@@ -1857,7 +1857,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
$i = 0;
print ' Note: Products with the property 'Nature of product' = 'Raw material' are not visible into this list. BOMsNumberingModules=BOM numbering templates BOMsModelModule=BOM document templates MOsNumberingModules=MO numbering templates diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index a1bf67cb8c5..776bec4171c 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -120,8 +120,8 @@ if (empty($reshook)) if ((string) $type == '1') { $objectlabel='Services'; } if ((string) $type == '0') { $objectlabel='Products'; } - $permtoread = $user->rights->produit->lire; - $permtodelete = $user->rights->produit->supprimer; + $permissiontoread = $user->rights->produit->lire; + $permissiontodelete = $user->rights->produit->supprimer; $uploaddir = $conf->product->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; */ diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 111e190bcf3..5179dbcf37c 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -102,14 +102,14 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu // Security check - Protection if external user //if ($user->socid > 0) access_forbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0); +//$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); //$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); $permissionnote = $user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->mymodule->myobject->write; // Used by the include of actions_dellink.inc.php $permissionedit = $user->rights->mymodule->myobject->write; // Used by the include of actions_lineupdown.inc.php $permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php -$permissiontodelete = $user->rights->mymodule->myobject->delete || ($permissiontoadd && $object->status == 0); +$permissiontodelete = $user->rights->mymodule->myobject->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); @@ -404,7 +404,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ' ';
- if (! empty($object->lines) && $object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline')
+ if (! empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline'))
{
print ' '; + $text .= $notify->confirmMessage('BOM_VALIDATE', $object->socid, $object); + }*/ + + $formquestion=array(); + if (! empty($conf->bom->enabled)) + { + $langs->load("mrp"); + require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; + $formproduct = new FormProduct($db); + $forcecombo=0; + if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy + $formquestion = array( + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + ); + } + + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Validate'), $text, 'confirm_validate', $formquestion, 0, 1, 220); + } + // Clone confirmation if ($action == 'clone') { // Create an array for form @@ -332,7 +373,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { $langs->load("projects"); $morehtmlref.=' '.$langs->trans('Project') . ' '; - if ($user->rights->mrp->write) + if ($permissiontoadd) { if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; @@ -366,7 +407,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ' ';
print ' ';
print '';
- print ' |