Merge branch 'develop' of github.com:Dolibarr/dolibarr into dev_contactdefault

This commit is contained in:
florian HENRY 2019-09-09 14:12:34 +02:00
commit 42cd15400d
58 changed files with 340 additions and 221 deletions

View File

@ -261,7 +261,7 @@ if (! empty($extrafields->attributes[$object->table_element]['label']))
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$sql.=preg_replace('/^,/', '', $hookmanager->resPrint);
$sql =preg_replace('/, $/', '', $sql);
$sql =preg_replace('/,\s*$/', '', $sql);
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d";
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)";
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member"; // We need this table joined to the select in order to filter by categ

View File

@ -156,6 +156,8 @@ class box_task extends ModeleBoxes
$sql.= " pt.entity = ".$conf->entity;
$sql.= " AND p.fk_statut = ".Project::STATUS_VALIDATED;
$sql.= " AND (pt.progress < 100 OR pt.progress IS NULL ) "; // 100% is done and not displayed
$sql.= " AND p.usage_task = 1 ";
$sql.= " ORDER BY pt.datee ASC, pt.dateo ASC";
$sql.= $db->plimit($max, 0);

View File

@ -565,7 +565,9 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
// resume
print '<td class="right">';
print getTaskProgressView($taskstatic, false, false);
if ($lines[$i]->progress != '' && $lines[$i]->duration) {
print getTaskProgressView($taskstatic, false, false);
}
print '</td>';
if ($showbilltime)
@ -664,12 +666,48 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print convertSecondToTime($total_projectlinesa_spent, 'allhourmin');
if ($projectidfortotallink > 0) print '</a>';
print '</td>';
if ($total_projectlinesa_planned) {
$totalAverageDeclaredProgress = round(100 * $total_projectlinesa_declared_if_planned / $total_projectlinesa_planned, 2);
$totalCalculatedProgress = round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned, 2);
// this conf is actually hidden, by default we use 1% for "be carefull or warning"
$warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.01;
// define progress color according to time spend vs workload
$progressBarClass = 'progress-bar-info';
$badgeClass = 'badge ';
if ($totalCalculatedProgress > $totalAverageDeclaredProgress) {
$progressBarClass = 'progress-bar-danger';
$badgeClass.= 'badge-danger';
} elseif ($totalCalculatedProgress * $warningRatio >= $totalAverageDeclaredProgress) { // warning if close at 1%
$progressBarClass = 'progress-bar-warning';
$badgeClass.= 'badge-warning';
} else {
$progressBarClass = 'progress-bar-success';
$badgeClass.= 'badge-success';
}
}
print '<td class="nowrap liste_total right">';
if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned, 2).' %';
if ($total_projectlinesa_planned) print $totalCalculatedProgress.' %';
print '</td>';
print '<td class="nowrap liste_total right">';
if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_declared_if_planned / $total_projectlinesa_planned, 2).' %';
if ($total_projectlinesa_planned) print '<span class="'.$badgeClass.'" >'.$totalAverageDeclaredProgress.' %</span>';
print '</td>';
// resume
print '<td class="right">';
if ($total_projectlinesa_planned){
print '</span>';
print ' <div class="progress sm" title="'.$totalAverageDeclaredProgress.'%" >';
print ' <div class="progress-bar '.$progressBarClass.'" style="width: '.$totalAverageDeclaredProgress.'%"></div>';
print ' </div>';
print '</div>';
}
print '</td>';
if ($showbilltime)
{
print '<td class="nowrap liste_total right">';

View File

@ -176,7 +176,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
$menu_arr[] = array(
'name' => 'TMenuMRP',
'link' => '/mrp/index.php?mainmenu=mrp&amp;leftmenu=',
'title' => $langs->trans("TMenuMRP"),
'title' => "TMenuMRP",
'level' => 0,
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
'target' => $atarget,

View File

@ -71,10 +71,10 @@ class modPhpbarcode extends ModeleBarCode
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -67,10 +67,10 @@ class modTcpdfbarcode extends ModeleBarCode
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -92,7 +92,7 @@ class mod_bom_advanced extends ModeleNumRefboms
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/

View File

@ -61,7 +61,7 @@ class mod_bom_standard extends ModeleNumRefboms
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -72,10 +72,10 @@ class mod_bom_standard extends ModeleNumRefboms
/**
* Test si les numeros deje en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -85,7 +85,7 @@ abstract class ModeleNumRefBoms
}
/**
* Renvoie la description par defaut du modele de numerotation
* Returns the default description of the numbering template
*
* @return string Texte descripif
*/
@ -97,7 +97,7 @@ abstract class ModeleNumRefBoms
}
/**
* Renvoie un exemple de numerotation
* Returns an example of numbering
*
* @return string Example
*/
@ -109,9 +109,10 @@ abstract class ModeleNumRefBoms
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
@ -119,7 +120,7 @@ abstract class ModeleNumRefBoms
}
/**
* Renvoie prochaine valeur attribuee
* Returns next assigned value
*
* @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for
@ -132,7 +133,7 @@ abstract class ModeleNumRefBoms
}
/**
* Renvoie version du module numerotation
* Returns version of numbering module
*
* @return string Valeur
*/

View File

@ -58,7 +58,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -69,10 +69,10 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
/**
* Test si les numeros deje en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -86,7 +86,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/

View File

@ -76,10 +76,11 @@ abstract class ModeleNumRefChequeReceipts
}
/**
* Test if the existing numbers in the database do not cause conflicts that would prevent this numbering run.
*
* @return boolean false si conflit, true si ok
*/
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;

View File

@ -61,7 +61,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -72,10 +72,10 @@ class mod_commande_marbre extends ModeleNumRefCommandes
/**
* Test si les numeros deje en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -92,7 +92,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/

View File

@ -110,9 +110,10 @@ abstract class ModeleNumRefCommandes
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
@ -120,7 +121,7 @@ abstract class ModeleNumRefCommandes
}
/**
* Renvoie prochaine valeur attribuee
* Returns next assigned value
*
* @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for
@ -133,7 +134,7 @@ abstract class ModeleNumRefCommandes
}
/**
* Renvoie version du module numerotation
* Returns version of numbering module
*
* @return string Valeur
*/

View File

@ -96,7 +96,7 @@ abstract class ModeleNumRefDons
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -108,10 +108,10 @@ abstract class ModeleNumRefDons
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas d
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -78,10 +78,10 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
/**
* Test whether the numbers already in force in the base do not cause conflicts
* that would prevent this numbering from working.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -95,7 +95,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/

View File

@ -74,7 +74,7 @@ class mod_facture_mars extends ModeleNumRefFactures
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -84,10 +84,10 @@ class mod_facture_mars extends ModeleNumRefFactures
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -84,7 +84,7 @@ class mod_facture_terre extends ModeleNumRefFactures
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -94,10 +94,10 @@ class mod_facture_terre extends ModeleNumRefFactures
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -98,7 +98,7 @@ abstract class ModeleNumRefFactures
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -110,10 +110,10 @@ abstract class ModeleNumRefFactures
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas
* de conflits qui empecheraient cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -97,7 +97,7 @@ class mod_arctic extends ModeleNumRefFicheinter
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/

View File

@ -68,7 +68,7 @@ class mod_pacific extends ModeleNumRefFicheinter
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -78,10 +78,10 @@ class mod_pacific extends ModeleNumRefFicheinter
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -109,10 +109,10 @@ abstract class ModeleNumRefFicheinter
}
/**
* Tests if the numbers already in force in the database do not cause conflicts
* that would prevent this numbering from working.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -72,7 +72,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -82,10 +82,10 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -100,7 +100,7 @@ abstract class ModeleNumRefDeliveryOrder
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -112,10 +112,10 @@ abstract class ModeleNumRefDeliveryOrder
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas d
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -113,9 +113,10 @@ class mailing_xinputuser extends MailingTargets
* Ajoute destinataires dans table des cibles
*
* @param int $mailing_id Id of emailing
* @param array $cibles Array with targets
* @return int < 0 si erreur, nb ajout si ok
*/
public function add_to_target($mailing_id)
public function add_to_target($mailing_id, $cibles)
{
// phpcs:enable
global $conf,$langs,$_FILES;

View File

@ -66,7 +66,7 @@ class modBom extends DolibarrModules
$this->descriptionlong = "Bill of Materials definitions. They can be used to make Manufacturing Resource Planning";
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
$this->version = 'experimental';
$this->version = 'dolibarr';
//Url to the file with your last numberversion of this module
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
@ -105,7 +105,7 @@ class modBom extends DolibarrModules
// Dependencies
$this->hidden = false; // A condition to hide module
$this->depends = array('modProduct'); // List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...)
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->requiredby = array('modMrp'); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
$this->langfiles = array("mrp");
//$this->phpmin = array(5,4); // Minimum version of PHP required by module

View File

@ -95,7 +95,7 @@ class mod_payment_ant extends ModeleNumRefPayments
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/

View File

@ -68,7 +68,7 @@ class mod_payment_cicada extends ModeleNumRefPayments
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -79,10 +79,10 @@ class mod_payment_cicada extends ModeleNumRefPayments
/**
* Test si les numeros deje en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -63,10 +63,11 @@ abstract class ModeleNumRefPayments
}
/**
* Test if the existing numbers in the database do not cause conflicts that would prevent this numbering run.
*
* @return boolean false si conflit, true si ok
*/
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;

View File

@ -90,7 +90,7 @@ abstract class ModeleProductCode
}
/** Renvoi un exemple de numerotation
/** Return an example of numbering
*
* @param Translate $langs Object langs
* @return string Example
@ -101,10 +101,11 @@ abstract class ModeleProductCode
return $langs->trans("NoExample");
}
/** Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
/**
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -80,10 +80,11 @@ class mod_project_simple extends ModeleNumRefProjects
}
/** Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
/**
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -96,7 +96,7 @@ class mod_project_universal extends ModeleNumRefProjects
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/

View File

@ -95,7 +95,7 @@ abstract class ModeleNumRefProjects
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -107,10 +107,10 @@ abstract class ModeleNumRefProjects
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -80,10 +80,11 @@ class mod_task_simple extends ModeleNumRefTask
}
/** Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
/**
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -96,7 +96,7 @@ class mod_task_universal extends ModeleNumRefTask
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/

View File

@ -96,7 +96,7 @@ abstract class ModeleNumRefTask
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -108,10 +108,10 @@ abstract class ModeleNumRefTask
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -81,10 +81,10 @@ class mod_propale_marbre extends ModeleNumRefPropales
/**
* Test si les numeros deje en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -98,7 +98,7 @@ class mod_propale_saphir extends ModeleNumRefPropales
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/

View File

@ -99,7 +99,7 @@ abstract class ModeleNumRefPropales
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -111,10 +111,10 @@ abstract class ModeleNumRefPropales
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -105,10 +105,11 @@ abstract class ModeleThirdPartyCode
return $langs->trans("NoExample");
}
/** Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
/**
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
@ -297,10 +298,11 @@ abstract class ModeleAccountancyCode
return $langs->trans("NoExample");
}
/** Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
/**
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -80,7 +80,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -91,10 +91,10 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -98,7 +98,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/

View File

@ -95,7 +95,7 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/

View File

@ -68,7 +68,7 @@ class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -79,10 +79,10 @@ class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments
/**
* Test si les numeros deje en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -98,10 +98,11 @@ abstract class ModeleNumRefSupplierPayments
}
/**
* Test if the existing numbers in the database do not cause conflicts that would prevent this numbering run.
*
* @return boolean false si conflit, true si ok
*/
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;

View File

@ -81,10 +81,10 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal
/**
* Test si les numeros deje en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -98,7 +98,7 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/

View File

@ -99,7 +99,7 @@ abstract class ModeleNumRefSupplierProposal
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -111,10 +111,10 @@ abstract class ModeleNumRefSupplierProposal
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -77,10 +77,10 @@ class mod_ticket_simple extends ModeleNumRefTicket
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -94,7 +94,7 @@ class mod_ticket_universal extends ModeleNumRefTicket
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/

View File

@ -57,7 +57,7 @@ abstract class ModeleNumRefTicket
}
/**
* Renvoi un exemple de numerotation
* Return an example of numbering
*
* @return string Example
*/
@ -69,10 +69,10 @@ abstract class ModeleNumRefTicket
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
* Checks if the numbers already in force in the data base do not
* cause conflicts that would prevent this numbering from working.
*
* @return boolean false si conflit, true si ok
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{

View File

@ -249,4 +249,7 @@ TimeSpentForInvoice=Time spent
OneLinePerUser=One line per user
ServiceToUseOnLines=Service to use on lines
InvoiceGeneratedFromTimeSpent=Invoice %s has been generated from time spent on project
ProjectBillTimeDescription=Check if you enter timesheet on tasks of project AND you plan to generate invoice(s) from the timesheet to bill the customer of the project (do not check if you plan to create invoice that is not based on entered timesheets).
ProjectBillTimeDescription=Check if you enter timesheet on tasks of project AND you plan to generate invoice(s) from the timesheet to bill the customer of the project (do not check if you plan to create invoice that is not based on entered timesheets).
UsageOpportunity=Usage: Opportunity
UsageTasks=Usage: Tasks
UsageBillTimeShort=Usage: Bill time

View File

@ -2390,68 +2390,68 @@ elseif (! empty($module))
{
foreach ($menus as $menu)
{
print '<tr class="oddeven">';
print '<tr class="oddeven">';
print '<td>';
print $menu['type'];
print '</td>';
print '<td>';
print $menu['type'];
print '</td>';
print '<td>';
print $menu['fk_menu'];
print '</td>';
print '<td>';
print $menu['fk_menu'];
print '</td>';
print '<td>';
print $menu['titre'];
print '</td>';
print '<td>';
print $menu['titre'];
print '</td>';
print '<td>';
print $menu['mainmenu'];
print '</td>';
print '<td>';
print $menu['mainmenu'];
print '</td>';
print '<td>';
print $menu['left'];
print '</td>';
print '<td>';
print $menu['left'];
print '</td>';
print '<td>';
print $menu['url'];
print '</td>';
print '<td>';
print $menu['url'];
print '</td>';
print '<td>';
print $menu['langs'];
print '</td>';
print '<td>';
print $menu['langs'];
print '</td>';
print '<td>';
print $menu['position'];
print '</td>';
print '<td>';
print $menu['position'];
print '</td>';
print '<td>';
print $menu['enabled'];
print '</td>';
print '<td>';
print $menu['enabled'];
print '</td>';
print '<td>';
print $menu['perms'];
print '</td>';
print '<td>';
print $menu['perms'];
print '</td>';
print '<td>';
print $menu['target'];
print '</td>';
print '<td>';
print $menu['target'];
print '</td>';
print '<td>';
print $menu['user'];
print '</td>';
print '<td>';
print $menu['user'];
print '</td>';
print '</tr>';
}
}
else
{
print '</tr>';
}
}
else
{
print '<tr><td class="opacitymedium" colspan="5">'.$langs->trans("None").'</td></tr>';
}
}
print '</table>';
print '</div>';
print '</table>';
print '</div>';
print '</form>';
print '</form>';
}
else
{
@ -2523,26 +2523,26 @@ elseif (! empty($module))
{
foreach ($perms as $perm)
{
print '<tr class="oddeven">';
print '<tr class="oddeven">';
print '<td>';
print $perm[0];
print '</td>';
print '<td>';
print $perm[0];
print '</td>';
print '<td>';
print $perm[1];
print '</td>';
print '<td>';
print $perm[1];
print '</td>';
print '<td>';
print $perm[4];
print '</td>';
print '<td>';
print $perm[4];
print '</td>';
print '<td>';
print $perm[5];
print '</td>';
print '<td>';
print $perm[5];
print '</td>';
print '</tr>';
}
print '</tr>';
}
}
else
{

View File

@ -222,7 +222,7 @@ if (! empty($extrafields->attributes[$object->table_element]['label']))
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql.=preg_replace('/^,/', '', $hookmanager->resPrint);
$sql =preg_replace('/, $/', '', $sql);
$sql =preg_replace('/,\s*$/', '', $sql);
$sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity($object->element).")";

View File

@ -85,6 +85,9 @@ $search_budget_amount=GETPOST("search_budget_amount", 'alpha');
$search_public=GETPOST("search_public", 'int');
$search_project_user=GETPOST('search_project_user', 'int');
$search_sale=GETPOST('search_sale', 'int');
$search_usage_opportunity=GETPOST('search_usage_opportunity', 'int');
$search_usage_task=GETPOST('search_usage_task', 'int');
$search_usage_bill_time=GETPOST('search_usage_bill_time', 'int');
$optioncss = GETPOST('optioncss', 'alpha');
$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
@ -129,7 +132,9 @@ $arrayfields=array(
'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>104),
'p.opp_percent'=>array('label'=>$langs->trans("OpportunityProbabilityShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>105),
'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110),
'p.usage_bill_time'=>array('label'=>$langs->trans("BillTimeShort"), 'checked'=>0, 'position'=>115),
'p.usage_opportunity'=>array('label'=>$langs->trans("UsageOpportunity"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>115),
'p.usage_task'=>array('label'=>$langs->trans("UsageTasks"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_HIDE_TASKS?0:1), 'position'=>116),
'p.usage_bill_time'=>array('label'=>$langs->trans("UsageBillTimeShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_HIDE_TASKS?0:1), 'position'=>117),
'p.datec'=>array('label'=>$langs->trans("DateCreationShort"), 'checked'=>0, 'position'=>500),
'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
'p.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
@ -184,6 +189,9 @@ if (empty($reshook))
$search_eday="";
$search_emonth="";
$search_eyear="";
$search_usage_opportunity='';
$search_usage_task='';
$search_usage_bill_time='';
$toselect='';
$search_array_options=array();
}
@ -279,7 +287,7 @@ if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0]='0';
$distinct='DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once.
$sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut, p.fk_opp_status, p.public, p.fk_user_creat";
$sql.= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount, p.usage_bill_time";
$sql.= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount, p.usage_opportunity, p.usage_task, p.usage_bill_time";
$sql.= ", s.rowid as socid, s.nom as name, s.email";
$sql.= ", cls.code as opp_status_code";
// We'll need these fields in order to filter by categ
@ -364,6 +372,9 @@ if ($search_sale > 0) $sql.= " AND sc.fk_user = " .$search_sale;
if ($search_project_user > 0) $sql.= " AND ecp.fk_c_type_contact IN (".join(',', array_keys($listofprojectcontacttype)).") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".$search_project_user;
if ($search_opp_amount != '') $sql .= natural_search('p.opp_amount', $search_opp_amount, 1);
if ($search_budget_amount != '') $sql .= natural_search('p.budget_amount', $search_budget_amount, 1);
if ($search_usage_opportunity != '' && $search_usage_opportunity >= 0) $sql .= natural_search('p.usage_opportunity', $search_usage_opportunity, 2);
if ($search_usage_task != '' && $search_usage_task >= 0) $sql .= natural_search('p.usage_task', $search_usage_task, 2);
if ($search_usage_bill_time != '' && $search_usage_bill_time >= 0) $sql .= natural_search('p.usage_bill_time', $search_usage_bill_time, 2);
// Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
// Add where from hooks
@ -619,10 +630,23 @@ if (! empty($arrayfields['p.budget_amount']['checked']))
print '<input type="text" class="flat" name="search_budget_amount" size="4" value="'.$search_budget_amount.'">';
print '</td>';
}
if (! empty($arrayfields['p.usage_opportunity']['checked']))
{
print '<td class="liste_titre nowrap right">';
print $form->selectyesno('search_usage_opportunity', $search_usage_opportunity, 1, false, 1);
print '';
print '</td>';
}
if (! empty($arrayfields['p.usage_task']['checked']))
{
print '<td class="liste_titre nowrap right">';
print $form->selectyesno('search_usage_task', $search_usage_task, 1, false, 1);
print '</td>';
}
if (! empty($arrayfields['p.usage_bill_time']['checked']))
{
print '<td class="liste_titre nowrap right">';
print '';
print $form->selectyesno('search_usage_bill_time', $search_usage_bill_time, 1, false, 1);
print '</td>';
}
// Extra fields
@ -674,7 +698,9 @@ if (! empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre
if (! empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'], $_SERVER["PHP_SELF"], 'p.opp_amount', "", $param, '', $sortfield, $sortorder, 'right ');
if (! empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'], $_SERVER["PHP_SELF"], 'p.opp_percent', "", $param, '', $sortfield, $sortorder, 'right ');
if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'], $_SERVER["PHP_SELF"], 'p.budget_amount', "", $param, '', $sortfield, $sortorder, 'right ');
if (! empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right ');
if (! empty($arrayfields['p.usage_opportunity']['checked'])) print_liste_field_titre($arrayfields['p.usage_opportunity']['label'], $_SERVER["PHP_SELF"], 'p.usage_opportunity', "", $param, '', $sortfield, $sortorder, 'right ');
if (! empty($arrayfields['p.usage_task']['checked'])) print_liste_field_titre($arrayfields['p.usage_task']['label'], $_SERVER["PHP_SELF"], 'p.usage_task', "", $param, '', $sortfield, $sortorder, 'right ');
if (! empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right ');
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
@ -855,6 +881,28 @@ while ($i < min($num, $limit))
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalbudgetfield']=$totalarray['nbfield'];
}
// Usage opportunity
if (! empty($arrayfields['p.usage_opportunity']['checked']))
{
print '<td class="right">';
if ($obj->usage_opportunity)
{
print yn($obj->usage_opportunity);
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Usage task
if (! empty($arrayfields['p.usage_task']['checked']))
{
print '<td class="right">';
if ($obj->usage_task)
{
print yn($obj->usage_task);
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Bill time
if (! empty($arrayfields['p.usage_bill_time']['checked']))
{

View File

@ -121,6 +121,7 @@ $arrayfields=array(
't.duration_effective'=>array('label'=>$langs->trans("TimeSpent"), 'checked'=>1, 'position'=>103),
't.progress_calculated'=>array('label'=>$langs->trans("ProgressCalculated"), 'checked'=>1, 'position'=>104),
't.progress'=>array('label'=>$langs->trans("ProgressDeclared"), 'checked'=>1, 'position'=>105),
't.progress_summary'=>array('label'=>$langs->trans("TaskProgressSummary"), 'checked'=>1, 'position'=>106),
't.tobill'=>array('label'=>$langs->trans("TimeToBill"), 'checked'=>0, 'position'=>110),
't.billed'=>array('label'=>$langs->trans("TimeBilled"), 'checked'=>0, 'position'=>111),
't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
@ -570,6 +571,7 @@ if (! empty($arrayfields['t.planned_workload']['checked'])) print '<td class="li
if (! empty($arrayfields['t.duration_effective']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['t.progress_calculated']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['t.progress']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['t.progress_summary']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['t.tobill']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['t.billed']['checked'])) print '<td class="liste_titre"></td>';
// Extra fields
@ -610,6 +612,7 @@ if (! empty($arrayfields['t.planned_workload']['checked'])) print_liste_
if (! empty($arrayfields['t.duration_effective']['checked'])) print_liste_field_titre($arrayfields['t.duration_effective']['label'], $_SERVER["PHP_SELF"], "t.duration_effective", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.progress_calculated']['checked'])) print_liste_field_titre($arrayfields['t.progress_calculated']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'center ');
if (! empty($arrayfields['t.progress']['checked'])) print_liste_field_titre($arrayfields['t.progress']['label'], $_SERVER["PHP_SELF"], "t.progress", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.progress_summary']['checked'])) print_liste_field_titre($arrayfields['t.progress_summary']['label'], $_SERVER["PHP_SELF"], "t.progress", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.tobill']['checked'])) print_liste_field_titre($arrayfields['t.tobill']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.billed']['checked'])) print_liste_field_titre($arrayfields['t.billed']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center ');
// Extra fields
@ -642,6 +645,9 @@ while ($i < min($num, $limit))
$object->progress = $obj->progress;
$object->datee = $db->jdate($obj->date_end); // deprecated
$object->date_end = $db->jdate($obj->date_end);
$object->planned_workload= $obj->planned_workload;
$object->duration_effective= $obj->duration_effective;
$projectstatic->id = $obj->projectid;
$projectstatic->ref = $obj->projectref;
@ -784,12 +790,23 @@ while ($i < min($num, $limit))
print '<td class="center">';
if ($obj->progress != '')
{
print $obj->progress.' %';
print getTaskProgressBadge($object);
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalprogress_declaredfield']=$totalarray['nbfield'];
$totalarray['totaldurationdeclared'] += $obj->planned_workload * $obj->progress / 100;
}
// Progress summary
if (! empty($arrayfields['t.progress_summary']['checked']))
{
print '<td class="center">';
if($obj->progress != '' && $obj->duration_effective){
print getTaskProgressView($object, false, false);
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalprogress_summary']=$totalarray['nbfield'];
}
// Time not billed
if (! empty($arrayfields['t.tobill']['checked']))
@ -891,7 +908,7 @@ if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['tota
elseif ($totalarray['totalprogress_declaredfield'] == $i) print '<td class="center">'.($totalarray['totalplannedworkload'] > 0 ? round(100 * $totalarray['totaldurationdeclared'] / $totalarray['totalplannedworkload'], 2).' %' : '').'</td>';
elseif ($totalarray['totaltobillfield'] == $i) print '<td class="center">'.convertSecondToTime($totalarray['totaltobill'], $plannedworkloadoutputformat).'</td>';
elseif ($totalarray['totalbilledfield'] == $i) print '<td class="center">'.convertSecondToTime($totalarray['totalbilled'], $plannedworkloadoutputformat).'</td>';
else print '<td></td>';
else print '<td></td>';
}
print '</tr>';
}