2
0
forked from Wavyzz/dolibarr

function Comment Missing

This commit is contained in:
Frédéric FRANCE
2018-08-31 21:39:23 +02:00
parent 7b1a705be4
commit ebcf43ec73
12 changed files with 134 additions and 39 deletions

View File

@@ -238,9 +238,9 @@
<!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>-->
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<!--<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
</rule>-->
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />

View File

@@ -25,9 +25,18 @@ include_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/PSWebServiceLibrary.class
*/
class Dolistore
{
// params
public $start; // beginning of pagination
public $end; // end of pagination
/**
* beginning of pagination
* @var int
*/
public $start;
/**
* end of pagination
* @var int
*/
public $end;
public $per_page; // pagination: display per page
public $categorie; // the current categorie
public $search; // the search keywords
@@ -282,16 +291,33 @@ class Dolistore
return $html;
}
/**
* get previous link
*
* @param string $text symbol previous
* @return string html previous link
*/
function get_previous_link($text = '<<')
{
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
}
/**
* get next link
*
* @param string $text symbol next
* @return string html next link
*/
function get_next_link($text = '>>')
{
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
}
/**
* get previous url
*
* @return string previous url
*/
function get_previous_url()
{
$param_array = array();
@@ -309,6 +335,11 @@ class Dolistore
return $this->url."&".$param;
}
/**
* get next url
*
* @return string next url
*/
function get_next_url()
{
$param_array = array();
@@ -326,6 +357,13 @@ class Dolistore
return $this->url."&".$param;
}
/**
* version compare
*
* @param string $v1 version 1
* @param string $v2 version 2
* @return int result of compare
*/
function version_compare($v1, $v2)
{
$v1 = explode('.', $v1);
@@ -355,4 +393,3 @@ class Dolistore
return $ret;
}
}

View File

@@ -52,6 +52,12 @@ if (!$mode) $mode='config';
// used in library escpos maybe useful if php doesn't support gzdecode
if (!function_exists('gzdecode')) {
/**
* Gzdecode
*
* @param string $data data to deflate
* @return string data deflated
*/
function gzdecode($data)
{
return gzinflate(substr($data,10,-8));
@@ -450,4 +456,3 @@ if ($mode == 'template' && $user->admin)
// End of page
llxFooter();
$db->close();

View File

@@ -607,19 +607,19 @@ function GETPOST($paramname, $check='none', $method=0, $filter=null, $options=nu
}
/**
* Return a prefix to use for this Dolibarr instance, for session/cookie names or email id.
* This prefix is valid in a web context only and is unique for instance and avoid conflict
* between multi-instances, even when having two instances with one root dir or two instances
* in virtual servers.
*
* @param string $mode '' (prefix for session name) or 'email' (prefix for email id)
* @return string A calculated prefix
*/
if (! function_exists('dol_getprefix'))
{
function dol_getprefix($mode='')
{
/**
* Return a prefix to use for this Dolibarr instance, for session/cookie names or email id.
* This prefix is valid in a web context only and is unique for instance and avoid conflict
* between multi-instances, even when having two instances with one root dir or two instances
* in virtual servers.
*
* @param string $mode '' (prefix for session name) or 'email' (prefix for email id)
* @return string A calculated prefix
*/
function dol_getprefix($mode='')
{
global $conf;
// If MAIL_PREFIX_FOR_EMAIL_ID is set and prefix is for email

View File

@@ -1167,6 +1167,14 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
return $numFinal;
}
/**
* Get string between
*
* @param string $string String to test
* @param int $start Value for start
* @param int $end Value for end
* @return string Return part of string
*/
function get_string_between($string, $start, $end)
{
$string = " ".$string;

View File

@@ -34,11 +34,18 @@ class CdavLib
private $langs;
/**
* Constructor
*
* @param User $user user
* @param DoliDB $db Database handler
* @param Translation $langs translation
*/
function __construct($user, $db, $langs)
{
$this->user = $user;
$this->db = $db;
$this->langs = $langs;
$this->user = $user;
$this->db = $db;
$this->langs = $langs;
}
/**

View File

@@ -657,6 +657,9 @@ class PropalmergepdfproductLine
var $tms='';
var $import_key;
/**
* Constructor
*/
function __construct()
{
return 1;

View File

@@ -25,7 +25,7 @@
/**
* Define head array for tabs of inventory tools setup pages
*
* @return Array of head
* @return array Array of head
*/
function inventoryAdminPrepareHead()
{
@@ -40,7 +40,7 @@ function inventoryAdminPrepareHead()
$head[$h][1] = $langs->trans("Parameters");
$head[$h][2] = 'settings';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
@@ -55,10 +55,19 @@ function inventoryAdminPrepareHead()
return $head;
}
/**
* Define head array for tabs of inventory tools setup pages
*
* @param Inventory $inventory Object inventory
* @param string $title parameter
* @param string $get parameter
*
* @return array Array of head
*/
function inventoryPrepareHead(&$inventory, $title='Inventory', $get='')
{
global $langs;
return array(
array(dol_buildpath('/product/inventory/card.php?id='.$inventory->id.$get, 1), $langs->trans($title),'inventory')
);
@@ -66,26 +75,33 @@ function inventoryPrepareHead(&$inventory, $title='Inventory', $get='')
/**
* Define head array for tabs of inventory tools setup pages
*
* @param Inventory $inventory Object inventory
*
* @return string html of products
*/
function inventorySelectProducts(&$inventory)
{
global $conf,$db,$langs;
$except_product_id = array();
foreach ($inventory->Inventorydet as $Inventorydet)
{
$except_product_id[] = $Inventorydet->fk_product;
}
ob_start();
$form = new Form($db);
$form->select_produits(-1, 'fk_product');
$TChildWarehouses = array($inventory->fk_warehouse);
$e = new Entrepot($db);
$e->fetch($inventory->fk_warehouse);
if(method_exists($e, 'get_children_warehouses')) $e->get_children_warehouses($e->id, $TChildWarehouses);
$Tab = array();
$sql = 'SELECT rowid, label
FROM '.MAIN_DB_PREFIX.'entrepot WHERE rowid IN('.implode(', ', $TChildWarehouses).')';
@@ -96,9 +112,8 @@ function inventorySelectProducts(&$inventory)
}
print '&nbsp;&nbsp;&nbsp;';
print $langs->trans('Warehouse').' : '.$form::selectarray('fk_warehouse', $Tab);
$select_html = ob_get_clean();
return $select_html;
}

View File

@@ -53,6 +53,11 @@ class ProductAttribute
*/
public $rang;
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
public function __construct(DoliDB $db)
{
global $conf;

View File

@@ -52,8 +52,13 @@ class ProductAttributeValue
*/
public $value;
public function __construct(DoliDB $db)
{
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
public function __construct(DoliDB $db)
{
global $conf;
$this->db = $db;

View File

@@ -70,7 +70,12 @@ class ProductCombination
*/
public $entity;
public function __construct(DoliDB $db)
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
public function __construct(DoliDB $db)
{
global $conf;

View File

@@ -52,10 +52,15 @@ class ProductCombination2ValuePair
*/
public $fk_prod_attr_val;
public function __construct(DoliDB $db)
{
$this->db = $db;
}
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
public function __construct(DoliDB $db)
{
$this->db = $db;
}
/**
* Translates this class to a human-readable string