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:
Juanjo Menent 2015-11-08 11:20:36 +01:00
commit 59b3124d7d
9 changed files with 14 additions and 14 deletions

View File

@ -106,7 +106,7 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
$ref_prodserv = "";
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")." ";
}

View File

@ -1166,7 +1166,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
$ref_prodserv = "";
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")." ";
}

View File

@ -98,7 +98,7 @@ function product_prepare_head($object)
$head[$h][2] = 'referers';
$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)
{

View File

@ -1038,7 +1038,7 @@ else
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$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), "");
// Main official, simple, and not duplicated code
@ -1144,7 +1144,7 @@ else
// Stock
/*
if ($object->isproduct() && ! empty($conf->stock->enabled))
if ($object->isProduct() && ! empty($conf->stock->enabled))
{
print "<tr>".'<td>'.$langs->trans("StockLimit").'</td><td>';
print '<input name="seuil_stock_alerte" size="4" value="'.$object->seuil_stock_alerte.'">';
@ -1169,7 +1169,7 @@ else
print '</td></tr>';
}
if ($object->isservice())
if ($object->isService())
{
// Duration
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>';
}
if ($object->isservice())
if ($object->isService())
{
// Duration
print '<tr><td class="titlefield">'.$langs->trans("Duration").'</td><td colspan="2">'.$object->duration_value.'&nbsp;';

View File

@ -3804,7 +3804,7 @@ class Product extends CommonObject
*
* @return boolean True if it's a product
*/
function isproduct()
function isProduct()
{
return ($this->type == Product::TYPE_PRODUCT ? true : false);
}
@ -3814,7 +3814,7 @@ class Product extends CommonObject
*
* @return boolean True if it's a service
*/
function isservice()
function isService()
{
return ($this->type == Product::TYPE_SERVICE ? true : false);
}

View File

@ -193,8 +193,8 @@ if ($id > 0 || ! empty($ref))
print "<tr>";
$nblignes=6;
if ($object->isproduct() && ! empty($conf->stock->enabled)) $nblignes++;
if ($object->isservice()) $nblignes++;
if ($object->isProduct() && ! empty($conf->stock->enabled)) $nblignes++;
if ($object->isService()) $nblignes++;
// Reference
print '<td width="25%">'.$langs->trans("Ref").'</td><td>';

View File

@ -521,7 +521,7 @@ if ($id > 0 || $ref)
{
// Suppliers list title
print '<table class="noborder" width="100%">';
if ($object->isproduct()) $nblignefour=4;
if ($object->isProduct()) $nblignefour=4;
else $nblignefour=4;
$param="&id=".$object->id;

View File

@ -583,7 +583,7 @@ if (GETPOST("source") == 'contractline' && $valid)
$duration='';
if ($contractline->fk_product)
{
if ($product->isservice() && $product->duration_value > 0)
if ($product->isService() && $product->duration_value > 0)
{
$label=$langs->trans("Duration");

View File

@ -720,7 +720,7 @@ if (GETPOST("source") == 'contractline' && $valid)
$duration='';
if ($contractline->fk_product)
{
if ($product->isservice() && $product->duration_value > 0)
if ($product->isService() && $product->duration_value > 0)
{
$label=$langs->trans("Duration");