Merge pull request #3938 from marcosgdf/fr-3876
NEW #3876 Renamed Product::isservice and Product::isproduct to match PSR-2
This commit is contained in:
commit
59b3124d7d
@ -106,7 +106,7 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
|||||||
$ref_prodserv = "";
|
$ref_prodserv = "";
|
||||||
if (! empty($conf->global->PRODUCT_ADD_TYPE_IN_DOCUMENTS)) // In standard mode, we do not show this
|
if (! empty($conf->global->PRODUCT_ADD_TYPE_IN_DOCUMENTS)) // In standard mode, we do not show this
|
||||||
{
|
{
|
||||||
if ($prodser->isservice())
|
if ($prodser->isService())
|
||||||
{
|
{
|
||||||
$prefix_prodserv = $outputlangs->transnoentitiesnoconv("Service")." ";
|
$prefix_prodserv = $outputlangs->transnoentitiesnoconv("Service")." ";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1166,7 +1166,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
|||||||
$ref_prodserv = "";
|
$ref_prodserv = "";
|
||||||
if (! empty($conf->global->PRODUCT_ADD_TYPE_IN_DOCUMENTS)) // In standard mode, we do not show this
|
if (! empty($conf->global->PRODUCT_ADD_TYPE_IN_DOCUMENTS)) // In standard mode, we do not show this
|
||||||
{
|
{
|
||||||
if ($prodser->isservice())
|
if ($prodser->isService())
|
||||||
{
|
{
|
||||||
$prefix_prodserv = $outputlangs->transnoentitiesnoconv("Service")." ";
|
$prefix_prodserv = $outputlangs->transnoentitiesnoconv("Service")." ";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,7 +98,7 @@ function product_prepare_head($object)
|
|||||||
$head[$h][2] = 'referers';
|
$head[$h][2] = 'referers';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if ($object->isproduct() || ($object->isservice() && ! empty($conf->global->STOCK_SUPPORTS_SERVICES))) // If physical product we can stock (or service with option)
|
if ($object->isProduct() || ($object->isService() && ! empty($conf->global->STOCK_SUPPORTS_SERVICES))) // If physical product we can stock (or service with option)
|
||||||
{
|
{
|
||||||
if (! empty($conf->stock->enabled) && $user->rights->stock->lire)
|
if (! empty($conf->stock->enabled) && $user->rights->stock->lire)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1038,7 +1038,7 @@ else
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
|
|
||||||
$type = $langs->trans('Product');
|
$type = $langs->trans('Product');
|
||||||
if ($object->isservice()) $type = $langs->trans('Service');
|
if ($object->isService()) $type = $langs->trans('Service');
|
||||||
//print load_fiche_titre($langs->trans('Modify').' '.$type.' : '.(is_object($object->oldcopy)?$object->oldcopy->ref:$object->ref), "");
|
//print load_fiche_titre($langs->trans('Modify').' '.$type.' : '.(is_object($object->oldcopy)?$object->oldcopy->ref:$object->ref), "");
|
||||||
|
|
||||||
// Main official, simple, and not duplicated code
|
// Main official, simple, and not duplicated code
|
||||||
@ -1144,7 +1144,7 @@ else
|
|||||||
|
|
||||||
// Stock
|
// Stock
|
||||||
/*
|
/*
|
||||||
if ($object->isproduct() && ! empty($conf->stock->enabled))
|
if ($object->isProduct() && ! empty($conf->stock->enabled))
|
||||||
{
|
{
|
||||||
print "<tr>".'<td>'.$langs->trans("StockLimit").'</td><td>';
|
print "<tr>".'<td>'.$langs->trans("StockLimit").'</td><td>';
|
||||||
print '<input name="seuil_stock_alerte" size="4" value="'.$object->seuil_stock_alerte.'">';
|
print '<input name="seuil_stock_alerte" size="4" value="'.$object->seuil_stock_alerte.'">';
|
||||||
@ -1169,7 +1169,7 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->isservice())
|
if ($object->isService())
|
||||||
{
|
{
|
||||||
// Duration
|
// Duration
|
||||||
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3"><input name="duration_value" size="3" maxlength="5" value="'.$object->duration_value.'">';
|
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3"><input name="duration_value" size="3" maxlength="5" value="'.$object->duration_value.'">';
|
||||||
@ -1435,7 +1435,7 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->isservice())
|
if ($object->isService())
|
||||||
{
|
{
|
||||||
// Duration
|
// Duration
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Duration").'</td><td colspan="2">'.$object->duration_value.' ';
|
print '<tr><td class="titlefield">'.$langs->trans("Duration").'</td><td colspan="2">'.$object->duration_value.' ';
|
||||||
|
|||||||
@ -3804,7 +3804,7 @@ class Product extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return boolean True if it's a product
|
* @return boolean True if it's a product
|
||||||
*/
|
*/
|
||||||
function isproduct()
|
function isProduct()
|
||||||
{
|
{
|
||||||
return ($this->type == Product::TYPE_PRODUCT ? true : false);
|
return ($this->type == Product::TYPE_PRODUCT ? true : false);
|
||||||
}
|
}
|
||||||
@ -3814,7 +3814,7 @@ class Product extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return boolean True if it's a service
|
* @return boolean True if it's a service
|
||||||
*/
|
*/
|
||||||
function isservice()
|
function isService()
|
||||||
{
|
{
|
||||||
return ($this->type == Product::TYPE_SERVICE ? true : false);
|
return ($this->type == Product::TYPE_SERVICE ? true : false);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -193,8 +193,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print "<tr>";
|
print "<tr>";
|
||||||
|
|
||||||
$nblignes=6;
|
$nblignes=6;
|
||||||
if ($object->isproduct() && ! empty($conf->stock->enabled)) $nblignes++;
|
if ($object->isProduct() && ! empty($conf->stock->enabled)) $nblignes++;
|
||||||
if ($object->isservice()) $nblignes++;
|
if ($object->isService()) $nblignes++;
|
||||||
|
|
||||||
// Reference
|
// Reference
|
||||||
print '<td width="25%">'.$langs->trans("Ref").'</td><td>';
|
print '<td width="25%">'.$langs->trans("Ref").'</td><td>';
|
||||||
|
|||||||
@ -521,7 +521,7 @@ if ($id > 0 || $ref)
|
|||||||
{
|
{
|
||||||
// Suppliers list title
|
// Suppliers list title
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
if ($object->isproduct()) $nblignefour=4;
|
if ($object->isProduct()) $nblignefour=4;
|
||||||
else $nblignefour=4;
|
else $nblignefour=4;
|
||||||
|
|
||||||
$param="&id=".$object->id;
|
$param="&id=".$object->id;
|
||||||
|
|||||||
@ -583,7 +583,7 @@ if (GETPOST("source") == 'contractline' && $valid)
|
|||||||
$duration='';
|
$duration='';
|
||||||
if ($contractline->fk_product)
|
if ($contractline->fk_product)
|
||||||
{
|
{
|
||||||
if ($product->isservice() && $product->duration_value > 0)
|
if ($product->isService() && $product->duration_value > 0)
|
||||||
{
|
{
|
||||||
$label=$langs->trans("Duration");
|
$label=$langs->trans("Duration");
|
||||||
|
|
||||||
|
|||||||
@ -720,7 +720,7 @@ if (GETPOST("source") == 'contractline' && $valid)
|
|||||||
$duration='';
|
$duration='';
|
||||||
if ($contractline->fk_product)
|
if ($contractline->fk_product)
|
||||||
{
|
{
|
||||||
if ($product->isservice() && $product->duration_value > 0)
|
if ($product->isService() && $product->duration_value > 0)
|
||||||
{
|
{
|
||||||
$label=$langs->trans("Duration");
|
$label=$langs->trans("Duration");
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user