WIP
This commit is contained in:
parent
be877ffb4b
commit
b658b9b1d3
@ -903,6 +903,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return combo list of activated countries, into language of user
|
* Return combo list of activated countries, into language of user
|
||||||
*
|
*
|
||||||
@ -1038,6 +1039,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return select list of incoterms
|
* Return select list of incoterms
|
||||||
*
|
*
|
||||||
@ -1126,6 +1128,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of types of lines (product or service)
|
* Return list of types of lines (product or service)
|
||||||
* Example: 0=product, 1=service, 9=other (for external module)
|
* Example: 0=product, 1=service, 9=other (for external module)
|
||||||
@ -1187,6 +1190,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load into cache cache_types_fees, array of types of fees
|
* Load into cache cache_types_fees, array of types of fees
|
||||||
*
|
*
|
||||||
@ -1234,6 +1238,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of types of notes
|
* Return list of types of notes
|
||||||
*
|
*
|
||||||
@ -1278,6 +1283,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output html form to select a third party
|
* Output html form to select a third party
|
||||||
*
|
*
|
||||||
@ -1350,6 +1356,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output html form to select a third party.
|
* Output html form to select a third party.
|
||||||
* Note, you must use the select_company to get the component to select a third party. This function must only be called by select_company.
|
* Note, you must use the select_company to get the component to select a third party. This function must only be called by select_company.
|
||||||
@ -1579,6 +1586,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return HTML combo list of absolute discounts
|
* Return HTML combo list of absolute discounts
|
||||||
*
|
*
|
||||||
@ -1665,6 +1673,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of all contacts (for a third party or all)
|
* Return list of all contacts (for a third party or all)
|
||||||
*
|
*
|
||||||
@ -1696,8 +1705,6 @@ class Form
|
|||||||
* Return HTML code of the SELECT of list of all contacts (for a third party or all).
|
* Return HTML code of the SELECT of list of all contacts (for a third party or all).
|
||||||
* This also set the number of contacts found into $this->num
|
* This also set the number of contacts found into $this->num
|
||||||
*
|
*
|
||||||
* @since 9.0 Add afterSelectContactOptions hook
|
|
||||||
*
|
|
||||||
* @param int $socid Id ot third party or 0 for all or -1 for empty list
|
* @param int $socid Id ot third party or 0 for all or -1 for empty list
|
||||||
* @param array|int $selected Array of ID of pre-selected contact id
|
* @param array|int $selected Array of ID of pre-selected contact id
|
||||||
* @param string $htmlname Name of HTML field ('none' for a not editable field)
|
* @param string $htmlname Name of HTML field ('none' for a not editable field)
|
||||||
@ -1715,6 +1722,8 @@ class Form
|
|||||||
* @param bool $multiple add [] in the name of element and add 'multiple' attribut
|
* @param bool $multiple add [] in the name of element and add 'multiple' attribut
|
||||||
* @param integer $disableifempty Set tag 'disabled' on select if there is no choice
|
* @param integer $disableifempty Set tag 'disabled' on select if there is no choice
|
||||||
* @return int|string <0 if KO, HTML with select string if OK.
|
* @return int|string <0 if KO, HTML with select string if OK.
|
||||||
|
* @since 9.0 Add afterSelectContactOptions hook
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public function selectcontacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $morecss = '', $options_only = false, $showsoc = 0, $forcecombo = 0, $events = array(), $moreparam = '', $htmlid = '', $multiple = false, $disableifempty = 0)
|
public function selectcontacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $morecss = '', $options_only = false, $showsoc = 0, $forcecombo = 0, $events = array(), $moreparam = '', $htmlid = '', $multiple = false, $disableifempty = 0)
|
||||||
{
|
{
|
||||||
@ -1915,6 +1924,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the HTML select list of users
|
* Return the HTML select list of users
|
||||||
*
|
*
|
||||||
@ -1937,6 +1947,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return select list of users
|
* Return select list of users
|
||||||
*
|
*
|
||||||
@ -2090,7 +2101,8 @@ class Form
|
|||||||
$disableline = ($enableonlytext ? $enableonlytext : '1');
|
$disableline = ($enableonlytext ? $enableonlytext : '1');
|
||||||
}
|
}
|
||||||
|
|
||||||
$labeltoshow = ''; $labeltoshowhtml = '';
|
$labeltoshow = '';
|
||||||
|
$labeltoshowhtml = '';
|
||||||
|
|
||||||
// $fullNameMode is 0=Lastname+Firstname (MAIN_FIRSTNAME_NAME_POSITION=1), 1=Firstname+Lastname (MAIN_FIRSTNAME_NAME_POSITION=0)
|
// $fullNameMode is 0=Lastname+Firstname (MAIN_FIRSTNAME_NAME_POSITION=1), 1=Firstname+Lastname (MAIN_FIRSTNAME_NAME_POSITION=0)
|
||||||
$fullNameMode = 0;
|
$fullNameMode = 0;
|
||||||
@ -2105,7 +2117,8 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Complete name with a more info string like: ' (info1 - info2 - ...)'
|
// Complete name with a more info string like: ' (info1 - info2 - ...)'
|
||||||
$moreinfo = ''; $moreinfohtml = '';
|
$moreinfo = '';
|
||||||
|
$moreinfohtml = '';
|
||||||
if (!empty($conf->global->MAIN_SHOW_LOGIN)) {
|
if (!empty($conf->global->MAIN_SHOW_LOGIN)) {
|
||||||
$moreinfo .= ($moreinfo ? ' - ' : ' (');
|
$moreinfo .= ($moreinfo ? ' - ' : ' (');
|
||||||
$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(');
|
$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(');
|
||||||
@ -2192,6 +2205,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return select list of users. Selected users are stored into session.
|
* Return select list of users. Selected users are stored into session.
|
||||||
* List of users are provided into $_SESSION['assignedtouser'].
|
* List of users are provided into $_SESSION['assignedtouser'].
|
||||||
@ -2288,6 +2302,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_list
|
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_list
|
||||||
*
|
*
|
||||||
@ -2525,6 +2540,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of products for a customer.
|
* Return list of products for a customer.
|
||||||
* Called by select_produits.
|
* Called by select_produits.
|
||||||
@ -3216,6 +3232,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list)
|
* Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list)
|
||||||
*
|
*
|
||||||
@ -3262,6 +3279,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of suppliers products
|
* Return list of suppliers products
|
||||||
*
|
*
|
||||||
@ -3691,6 +3709,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of suppliers prices for a product
|
* Return list of suppliers prices for a product
|
||||||
*
|
*
|
||||||
@ -3800,6 +3819,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of delivery address
|
* Return list of delivery address
|
||||||
*
|
*
|
||||||
@ -3848,6 +3868,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load into cache list of payment terms
|
* Load into cache list of payment terms
|
||||||
*
|
*
|
||||||
@ -3896,6 +3917,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load int a cache property th elist of possible delivery delays.
|
* Load int a cache property th elist of possible delivery delays.
|
||||||
*
|
*
|
||||||
@ -4076,6 +4098,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Charge dans cache la liste des types de paiements possibles
|
* Charge dans cache la liste des types de paiements possibles
|
||||||
*
|
*
|
||||||
@ -4127,6 +4150,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* print list of payment modes.
|
* print list of payment modes.
|
||||||
* Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want.
|
* Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want.
|
||||||
@ -4243,6 +4267,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of payment methods
|
* Return list of payment methods
|
||||||
* Constant MAIN_DEFAULT_PAYMENT_TYPE_ID can used to set default value but scope is all application, probably not what you want.
|
* Constant MAIN_DEFAULT_PAYMENT_TYPE_ID can used to set default value but scope is all application, probably not what you want.
|
||||||
@ -4385,6 +4410,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load in cache list of transport mode
|
* Load in cache list of transport mode
|
||||||
*
|
*
|
||||||
@ -4700,6 +4726,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a HTML select list of bank accounts
|
* Return a HTML select list of bank accounts
|
||||||
*
|
*
|
||||||
@ -4893,6 +4920,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of categories having choosed type
|
* Return list of categories having choosed type
|
||||||
*
|
*
|
||||||
@ -4987,6 +5015,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a confirmation HTML form or AJAX popup
|
* Show a confirmation HTML form or AJAX popup
|
||||||
*
|
*
|
||||||
@ -5431,6 +5460,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a form to select a project
|
* Show a form to select a project
|
||||||
*
|
*
|
||||||
@ -5486,6 +5516,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a form to select payment conditions
|
* Show a form to select payment conditions
|
||||||
*
|
*
|
||||||
@ -5546,6 +5577,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a form to select a delivery delay
|
* Show a form to select a delivery delay
|
||||||
*
|
*
|
||||||
@ -5613,6 +5645,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a form + html select a date
|
* Show a form + html select a date
|
||||||
*
|
*
|
||||||
@ -5662,6 +5695,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a select form to choose a user
|
* Show a select form to choose a user
|
||||||
*
|
*
|
||||||
@ -5698,6 +5732,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show form with payment mode
|
* Show form with payment mode
|
||||||
*
|
*
|
||||||
@ -5775,6 +5810,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show form with multicurrency code
|
* Show form with multicurrency code
|
||||||
*
|
*
|
||||||
@ -5801,6 +5837,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show form with multicurrency rate
|
* Show form with multicurrency rate
|
||||||
*
|
*
|
||||||
@ -5840,6 +5877,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a select box with available absolute discounts
|
* Show a select box with available absolute discounts
|
||||||
*
|
*
|
||||||
@ -5941,6 +5979,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show forms to select a contact
|
* Show forms to select a contact
|
||||||
*
|
*
|
||||||
@ -5983,6 +6022,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output html select to select thirdparty
|
* Output html select to select thirdparty
|
||||||
*
|
*
|
||||||
@ -6033,13 +6073,14 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne la liste des devises, dans la langue de l'utilisateur
|
* Retourne la liste des devises, dans la langue de l'utilisateur
|
||||||
*
|
*
|
||||||
* @param string $selected preselected currency code
|
* @param string $selected preselected currency code
|
||||||
* @param string $htmlname name of HTML select list
|
* @param string $htmlname name of HTML select list
|
||||||
* @deprecated
|
|
||||||
* @return void
|
* @return void
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public function select_currency($selected = '', $htmlname = 'currency_id')
|
public function select_currency($selected = '', $htmlname = 'currency_id')
|
||||||
{
|
{
|
||||||
@ -6167,6 +6208,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load into the cache vat rates of a country
|
* Load into the cache vat rates of a country
|
||||||
*
|
*
|
||||||
@ -6237,6 +6279,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output an HTML select vat rate.
|
* Output an HTML select vat rate.
|
||||||
* The name of this function should be selectVat. We keep bad name for compatibility purpose.
|
* The name of this function should be selectVat. We keep bad name for compatibility purpose.
|
||||||
@ -6435,6 +6478,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a HTML widget to input a date or combo list for day, month, years and optionaly hours and minutes.
|
* Show a HTML widget to input a date or combo list for day, month, years and optionaly hours and minutes.
|
||||||
* Fields are preselected with :
|
* Fields are preselected with :
|
||||||
@ -6991,6 +7035,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to show a form to select a duration on a page
|
* Function to show a form to select a duration on a page
|
||||||
*
|
*
|
||||||
@ -9138,6 +9183,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of export templates
|
* Return list of export templates
|
||||||
*
|
*
|
||||||
@ -9638,6 +9684,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return select list of groups
|
* Return select list of groups
|
||||||
*
|
*
|
||||||
@ -10027,10 +10074,10 @@ class Form
|
|||||||
* @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids.
|
* @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids.
|
||||||
* @param string $showproject 'all' = Show project info, ''=Hide project info
|
* @param string $showproject 'all' = Show project info, ''=Hide project info
|
||||||
* @param User $usertofilter User object to use for filtering
|
* @param User $usertofilter User object to use for filtering
|
||||||
* @param int $status Invoice status filter (-1 for no filter)
|
|
||||||
* @return int Nbr of project if OK, <0 if KO
|
* @return int Nbr of project if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
public function selectInvoice($socid = -1,$selected = '', $htmlname = 'invoiceid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null, $status=0, $events=array())
|
public
|
||||||
|
function selectInvoice($socid = -1, $selected = '', $htmlname = 'invoiceid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null)
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs;
|
global $user, $conf, $langs;
|
||||||
|
|
||||||
@ -10062,10 +10109,7 @@ class Form
|
|||||||
$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
|
$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
|
||||||
$sql .= ' ' . $this->db->prefix() . 'facture as f';
|
$sql .= ' ' . $this->db->prefix() . 'facture as f';
|
||||||
$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
|
$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
|
||||||
$sql .= " AND f.fk_projet = p.rowid "; //Brouillons seulement
|
$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
|
||||||
if ($status!== -1){
|
|
||||||
$sql .= " AND f.fk_statut=".(int)$status;
|
|
||||||
}
|
|
||||||
//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
|
//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
|
||||||
//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
|
//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
|
||||||
//if ($socid > 0) $sql.= " AND (p.fk_soc=".((int) $socid)." OR p.fk_soc IS NULL)";
|
//if ($socid > 0) $sql.= " AND (p.fk_soc=".((int) $socid)." OR p.fk_soc IS NULL)";
|
||||||
@ -10179,7 +10223,8 @@ class Form
|
|||||||
* @param string $morecss More css added to the select component
|
* @param string $morecss More css added to the select component
|
||||||
* @return int Nbr of project if OK, <0 if KO
|
* @return int Nbr of project if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
public function selectInvoiceRec($selected = '', $htmlname = 'facrecid', $maxlength = 24, $option_only = 0, $show_empty = '1', $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500')
|
public
|
||||||
|
function selectInvoiceRec($selected = '', $htmlname = 'facrecid', $maxlength = 24, $option_only = 0, $show_empty = '1', $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500')
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs;
|
global $user, $conf, $langs;
|
||||||
|
|
||||||
@ -10270,7 +10315,8 @@ class Form
|
|||||||
* @param string $search_component_params_hidden String with $search_component_params criterias
|
* @param string $search_component_params_hidden String with $search_component_params criterias
|
||||||
* @return string HTML component for advanced search
|
* @return string HTML component for advanced search
|
||||||
*/
|
*/
|
||||||
public function searchComponent($arrayofcriterias, $search_component_params, $arrayofinputfieldsalreadyoutput = array(), $search_component_params_hidden = '')
|
public
|
||||||
|
function searchComponent($arrayofcriterias, $search_component_params, $arrayofinputfieldsalreadyoutput = array(), $search_component_params_hidden = '')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@ -10357,7 +10403,8 @@ class Form
|
|||||||
* @param int $addjscombo Add js combobox
|
* @param int $addjscombo Add js combobox
|
||||||
* @return string HTML select string
|
* @return string HTML select string
|
||||||
*/
|
*/
|
||||||
public function selectModelMail($prefix, $modelType = '', $default = 0, $addjscombo = 0)
|
public
|
||||||
|
function selectModelMail($prefix, $modelType = '', $default = 0, $addjscombo = 0)
|
||||||
{
|
{
|
||||||
global $langs, $user;
|
global $langs, $user;
|
||||||
|
|
||||||
@ -10405,7 +10452,8 @@ class Form
|
|||||||
* @param string $dol_openinpopup If the button are shown in a context of a page shown inside a popup, we put here the string name of popup.
|
* @param string $dol_openinpopup If the button are shown in a context of a page shown inside a popup, we put here the string name of popup.
|
||||||
* @return string Html code with the buttons
|
* @return string Html code with the buttons
|
||||||
*/
|
*/
|
||||||
public function buttonsSaveCancel($save_label = 'Save', $cancel_label = 'Cancel', $morebuttons = array(), $withoutdiv = 0, $morecss = '', $dol_openinpopup = '')
|
public
|
||||||
|
function buttonsSaveCancel($save_label = 'Save', $cancel_label = 'Cancel', $morebuttons = array(), $withoutdiv = 0, $morecss = '', $dol_openinpopup = '')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
|
|||||||
@ -748,4 +748,122 @@ class FormProjets
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output a combo list with invoices and lines qualified for a project
|
||||||
|
*
|
||||||
|
* @param int $selectedInvoiceId Id invoice preselected
|
||||||
|
* @param int $selectedLineId Id invoice line preselected
|
||||||
|
* @param string $htmlNameInvoiceId Name of HTML select for Invoice
|
||||||
|
* @param int $htmlNameInvoiceLineId Name of HTML select for Invoice Line
|
||||||
|
* @param int $option_only Return only html options lines without the select tag
|
||||||
|
* @param string $morecss More css added to the select component
|
||||||
|
* @param array $filters Array of filters
|
||||||
|
* @return int Nbr of project if OK, <0 if KO
|
||||||
|
*/
|
||||||
|
public function selectInvoiceAndLine($selectedInvoiceId = 0, $selectedLineId = 0, $htmlNameInvoiceId = 'invoiceid', $htmlNameInvoiceLineId = 'invoicelineid', $morecss = 'maxwidth500', $filters = array())
|
||||||
|
{
|
||||||
|
global $user, $conf, $langs;
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
|
||||||
|
$out = '';
|
||||||
|
|
||||||
|
// Search Invoice
|
||||||
|
$sql = "SELECT f.rowid, f.ref as fref,";
|
||||||
|
$sql .= ' s.nom as name';
|
||||||
|
$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
|
||||||
|
$sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc';
|
||||||
|
$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid';
|
||||||
|
$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
|
||||||
|
if (!empty($filters)) {
|
||||||
|
foreach ($filters as $key => $value) {
|
||||||
|
if ($key == 'p.rowid') {
|
||||||
|
$sql .= " AND p.rowid=" . (int)$value;
|
||||||
|
}
|
||||||
|
if ($key == 'f.rowid') {
|
||||||
|
$sql .= " AND f.rowid=" . (int)$value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$sql .= " ORDER BY p.ref, f.ref ASC";
|
||||||
|
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
// Use select2 selector
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||||
|
$comboenhancement = ajax_combobox($htmlNameInvoiceId, '', 0, 0);
|
||||||
|
$out .= $comboenhancement;
|
||||||
|
$morecss = 'minwidth200imp maxwidth500';
|
||||||
|
}
|
||||||
|
|
||||||
|
$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoiceId . '" name="' . $htmlNameInvoiceId . '">';
|
||||||
|
$num = $this->db->num_rows($resql);
|
||||||
|
if ($num) {
|
||||||
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
$labeltoshow = $obj->fref; // Invoice ref
|
||||||
|
if ($obj->name) {
|
||||||
|
$labeltoshow .= ' - ' . $obj->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
$out .= '<option value="' . $obj->rowid . '" ';
|
||||||
|
if (!empty($selectedInvoiceId) && $selectedInvoiceId == $obj->rowid) {
|
||||||
|
$out .= ' selected ';
|
||||||
|
}
|
||||||
|
$out .= '>' . $labeltoshow . '</option>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dol_print_error($this->db->lasterror);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Search Invoice Line
|
||||||
|
$sql = "SELECT fd.rowid, fd.label, fd.description";
|
||||||
|
$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
|
||||||
|
$sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc';
|
||||||
|
$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid';
|
||||||
|
$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facturedet as fd ON fd.fk_facture = f.rowid';
|
||||||
|
$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
|
||||||
|
if (!empty($filters)) {
|
||||||
|
foreach ($filters as $key => $value) {
|
||||||
|
if ($key == 'p.rowid') {
|
||||||
|
$sql .= " AND p.rowid=" . (int) $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!empty($selectedInvoiceId)) {
|
||||||
|
$sql .= " AND f.rowid=" . (int) $selectedInvoiceId;
|
||||||
|
}
|
||||||
|
$sql .= " ORDER BY p.ref, f.ref ASC";
|
||||||
|
if ($resql) {
|
||||||
|
// Use select2 selector
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||||
|
$comboenhancement = ajax_combobox($htmlNameInvoiceLineId, '', 0, 0);
|
||||||
|
$out .= $comboenhancement;
|
||||||
|
$morecss = 'minwidth200imp maxwidth500';
|
||||||
|
}
|
||||||
|
|
||||||
|
$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoiceLineId . '" name="' . $htmlNameInvoiceLineId . '">';
|
||||||
|
$num = $this->db->num_rows($resql);
|
||||||
|
if ($num) {
|
||||||
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
$labeltoshow .= $obj->label; // Invoice ref
|
||||||
|
$labeltoshow .= dol_trunc($obj->description, 25); // Invoice ref
|
||||||
|
|
||||||
|
|
||||||
|
$out .= '<option value="' . $obj->rowid . '" ';
|
||||||
|
if (!empty($selectedInvoiceId) && $selectedLineId == $obj->rowid) {
|
||||||
|
$out .= ' selected ';
|
||||||
|
}
|
||||||
|
$out .= '>' . $labeltoshow . '</option>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dol_print_error($this->db->lasterror);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2345,9 +2345,11 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||||||
if ($task_time->invoice_id) {
|
if ($task_time->invoice_id) {
|
||||||
$result = $tmpinvoice->fetch($task_time->invoice_id);
|
$result = $tmpinvoice->fetch($task_time->invoice_id);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
var_dump($task_time->invoice_line_id);
|
if ($action=='editline' && $_GET['lineid'] == $task_time->rowid) {
|
||||||
//print $tmpinvoice->getNomUrl(1);
|
print $formproject->selectInvoiceAndLine($task_time->invoice_id, $task_time->invoice_line_id, 'invoiceid', 'invoicelineid', 'maxwidth500', array('p.rowid'=>$projectstatic->id));
|
||||||
//print $form->selectInvoiceAndLines($projectstatic->thirdparty->id, $tmpinvoice->id, 'invoiceid', 'invoicelineid', 24, 0, $langs->trans('NewInvoice'), 1, 0, 0, 'maxwidth500', '', 'all',null,-1);
|
} else {
|
||||||
|
print $tmpinvoice->getNomUrl(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("No");
|
print $langs->trans("No");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user