Преглед изворни кода

NEW #3876 Renamed Product::isservice and Product::isproduct to match PSR-2

Marcos García de La Fuente пре 10 година
родитељ
комит
75b4cb4727

+ 1 - 1
htdocs/core/lib/doc.lib.php

@@ -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")." ";
 				}

+ 1 - 1
htdocs/core/lib/pdf.lib.php

@@ -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")." ";
 				}

+ 1 - 1
htdocs/core/lib/product.lib.php

@@ -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)
         {

+ 4 - 4
htdocs/product/card.php

@@ -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;';

+ 2 - 2
htdocs/product/class/product.class.php

@@ -3789,7 +3789,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);
 	}
@@ -3799,7 +3799,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);
 	}

+ 2 - 2
htdocs/product/composition/card.php

@@ -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>';

+ 1 - 1
htdocs/product/fournisseurs.php

@@ -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;

+ 1 - 1
htdocs/public/paybox/newpayment.php

@@ -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");
 

+ 1 - 1
htdocs/public/paypal/newpayment.php

@@ -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");